1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-02-24 15:47:45 +01:00

11 lines
27 KiB
JavaScript
Raw Normal View History

2024-06-15 11:05:29 +02:00
/**
* simplebar - v6.2.7
* Scrollbars, simpler.
* https://grsmto.github.io/simplebar/
*
* Made by Adrien Denat from a fork by Jonathan Nicol
* Under MIT License
*/
var SimpleBar=function(){"use strict";var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};var e="object"==typeof global&&global&&global.Object===Object&&global,i="object"==typeof self&&self&&self.Object===Object&&self,s=e||i||Function("return this")(),r=s.Symbol,l=Object.prototype,o=l.hasOwnProperty,n=l.toString,a=r?r.toStringTag:void 0;var c=Object.prototype.toString;var h=r?r.toStringTag:void 0;function u(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":h&&h in Object(t)?function(t){var e=o.call(t,a),i=t[a];try{t[a]=void 0;var s=!0}catch(t){}var r=n.call(t);return s&&(e?t[a]=i:delete t[a]),r}(t):function(t){return c.call(t)}(t)}var d=/\s/;var p=/^\s+/;function v(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&d.test(t.charAt(e)););return e}(t)+1).replace(p,""):t}function f(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var m=/^[-+]0x[0-9a-f]+$/i,b=/^0b[01]+$/i,g=/^0o[0-7]+$/i,x=parseInt;function y(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==u(t)}(t))return NaN;if(f(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=f(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=v(t);var i=b.test(t);return i||g.test(t)?x(t.slice(2),i?2:8):m.test(t)?NaN:+t}var E=function(){return s.Date.now()},O=Math.max,w=Math.min;function S(t,e,i){var s,r,l,o,n,a,c=0,h=!1,u=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var i=s,l=r;return s=r=void 0,c=e,o=t.apply(l,i)}function v(t){return c=t,n=setTimeout(b,e),h?p(t):o}function m(t){var i=t-a;return void 0===a||i>=e||i<0||u&&t-c>=l}function b(){var t=E();if(m(t))return g(t);n=setTimeout(b,function(t){var i=e-(t-a);return u?w(i,l-(t-c)):i}(t))}function g(t){return n=void 0,d&&s?p(t):(s=r=void 0,o)}function x(){var t=E(),i=m(t);if(s=arguments,r=this,a=t,i){if(void 0===n)return v(a);if(u)return clearTimeout(n),n=setTimeout(b,e),p(a)}return void 0===n&&(n=setTimeout(b,e)),o}return e=y(e)||0,f(i)&&(h=!!i.leading,l=(u="maxWait"in i)?O(y(i.maxWait)||0,e):l,d="trailing"in i?!!i.trailing:d),x.cancel=function(){void 0!==n&&clearTimeout(n),c=0,s=a=r=n=void 0},x.flush=function(){return void 0===n?o:g(E())},x}var A=function(){return A=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},A.apply(this,arguments)};function k(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView:window}function W(t){return t&&t.ownerDocument?t.ownerDocument:document}var M=function(t){return Array.prototype.reduce.call(t,(function(t,e){var i=e.name.match(/data-simplebar-(.+)/);if(i){var s=i[1].replace(/\W+(.)/g,(function(t,e){return e.toUpperCase()}));switch(e.value){case"true":t[s]=!0;break;case"false":t[s]=!1;break;case void 0:t[s]=!0;break;default:t[s]=e.value}}return t}),{})};function N(t,e){var i;t&&(i=t.classList).add.apply(i,e.split(" "))}function L(t,e){t&&e.split(" ").forEach((function(e){t.classList.remove(e)}))}function z(t){return".".concat(t.split(" ").join("."))}var C=!("undefined"==typeof window||!window.document||!window.document.createElement),T=Object.freeze({__proto__:null,addClasses:N,canUseDOM:C,classNamesToQuery:z,getElementDocument:W,getElementWindow:k,getOptions:M,removeClasses:L}),D=null,R=null;function V(){if(null===D){if("undefined"==typeof document)return D=0;var t=document.body,e=document.createElement("div");e.classList.add("simplebar-hide-scrollbar"),t.appendChild(e);var i=e.getBoundingClientRect().right;t.removeChild(e),D=i}return D}C&&window.addEventListener("resize",(function(){R!==window.devicePixelRatio&&(R=window.devicePixelRatio,D=null)}));var H=k,j=W,B=M,_=N,q=L,P=z,X=function(){function t(e,i){void 0===i&&(i={});var s=this;if(this.removePreventClickId=null,this.minScrollbarWidth=20,this.stopScrollDelay=175,this.i