You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vestride_Shuffle/dist/shuffle.min.js

3 lines
17 KiB
JavaScript

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.shuffle=e()}(this,function(){"use strict";function t(t,e){if(b)return b.call(t,e);for(var i=t.parentNode.querySelectorAll(e),n=0;n<i.length;n++)if(i[n]==t)return!0;return!1}function e(){for(var t={},e=0;e<arguments.length;e++){var i=arguments[e];for(var n in i)L.call(i,n)&&(t[n]=i[n])}return t}function i(t,e){function i(){r=0,l=+new Date,o=t.apply(n,s),n=null,s=null}var n,s,o,r,l=0;return function(){n=this,s=arguments;var t=new Date-l;return r||(t>=e?i():r=setTimeout(i,e-t)),o}}function n(){}function s(t){return parseFloat(t)||0}function o(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.getComputedStyle(t,null),n=s(i[e]);return W||"width"!==e?W||"height"!==e||(n+=s(i.paddingTop)+s(i.paddingBottom)+s(i.borderTopWidth)+s(i.borderBottomWidth)):n+=s(i.paddingLeft)+s(i.paddingRight)+s(i.borderLeftWidth)+s(i.borderRightWidth),n}function r(t){for(var e=t.length;e;){e-=1;var i=Math.floor(Math.random()*(e+1)),n=t[i];t[i]=t[e],t[e]=n}return t}function l(t,e){var i=w(R,e),n=[].slice.call(t),s=!1;return t.length?i.randomize?r(t):("function"==typeof i.by&&t.sort(function(t,e){if(s)return 0;var n=i.by(t[i.key]),o=i.by(e[i.key]);return void 0===n&&void 0===o?(s=!0,0):n<o||"sortFirst"===n||"sortLast"===o?-1:n>o||"sortLast"===n||"sortFirst"===o?1:0}),s?n:(i.reverse&&t.reverse(),t)):[]}function a(){return P+=1,q+P}function u(t){return!!H[t]&&(H[t].element.removeEventListener(q,H[t].listener),H[t]=null,!0)}function h(t,e){var i=a(),n=function(t){t.currentTarget===t.target&&(u(i),e(t))};return t.addEventListener(q,n),H[i]={element:t,listener:n},i}function f(t){return Math.max.apply(Math,t)}function c(t){return Math.min.apply(Math,t)}function d(t,e,i,n){var s=t/e;return Math.abs(Math.round(s)-s)<n&&(s=Math.round(s)),Math.min(Math.ceil(s),i)}function m(t,e,i){if(1===e)return t;for(var n=[],s=0;s<=i-e;s++)n.push(f(t.slice(s,s+e)));return n}function v(t,e){for(var i=c(t),n=0,s=t.length;n<s;n++)if(t[n]>=i-e&&t[n]<=i+e)return n;return 0}function p(t){for(var e=t.itemSize,i=t.positions,n=t.gridSize,s=t.total,o=t.threshold,r=t.buffer,l=d(e.width,n,s,o),a=m(i,l,s),u=v(a,r),h=new A(Math.round(n*u),Math.round(a[u])),f=a[u]+e.height,c=0;c<l;c++)i[u+c]=f;return h}function y(t){return Array.prototype.slice.call(t)}function g(t,e){return t.indexOf(e)>-1}try{var _=new window.CustomEvent("test");if(_.preventDefault(),!0!==_.defaultPrevented)throw new Error("Could not prevent default")}catch(t){var E=function(t,e){var i,n;return e=e||{bubbles:!1,cancelable:!1,detail:void 0},i=document.createEvent("CustomEvent"),i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n=i.preventDefault,i.preventDefault=function(){n.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(t){this.defaultPrevented=!0}},i};E.prototype=window.Event.prototype,window.CustomEvent=E}var S=Element.prototype,b=S.matches||S.matchesSelector||S.webkitMatchesSelector||S.mozMatchesSelector||S.msMatchesSelector||S.oMatchesSelector,I=t,k="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},T=function(t,e){return e={exports:{}},t(e,e.exports),e.exports}(function(t){function e(t){for(var e=[],i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}function i(t){var e=new Set;return t.filter(function(t){return!e.has(t)&&(e.add(t),!0)})}function n(t){var e=[];return new Set(t).forEach(function(t){e.push(t)}),e}"Set"in k?"function"==typeof Set.prototype.forEach&&function(){var t=!1;return new Set([!0]).forEach(function(e){t=e}),!0===t}()?t.exports=n:t.exports=i:t.exports=e}),w=e,L=Object.prototype.hasOwnProperty,C=i,z=function(t,e,i){function s(t){return function(e,n){if(!r){if(e)return i(e,l),void(r=!0);l[t]=n,--o||i(null,l)}}}i||("function"==typeof e?(i=e,e=null):i=n);var o=t&&t.length;if(!o)return i(null,[]);var r=!1,l=new Array(o);t.forEach(e?function(t,i){t.call(e,s(i))}:function(t,e){t(s(e))})},D=function(t,e){if(!(t instanceof e))throw new Ty
//# sourceMappingURL=shuffle.min.js.map