!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).SimpleBar=e()}(this,function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}function r(t){return t&&t.Math==Math&&t}function g(t){try{return!!t()}catch(t){return!0}}function m(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}function n(t){return T.call(t).slice(8,-1)}function c(t){if(null==t)throw TypeError("Can't call method on "+t);return t}function u(t){return R(c(t))}function y(t){return"object"==typeof t?null!==t:"function"==typeof t}function i(t,e){if(!y(t))return t;var r,i;if(e&&"function"==typeof(r=t.toString)&&!y(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!y(i=r.call(t)))return i;if(!e&&"function"==typeof(r=t.toString)&&!y(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}function h(t,e){return W.call(t,e)}function o(t){return C?z.createElement(t):{}}function O(t){if(!y(t))throw TypeError(String(t)+" is not an object");return t}function f(e,r){try{F(S,e,r)}catch(t){S[e]=r}return r}function a(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++X+Y).toString(36)}function s(t){return G[t]||(G[t]=a(t))}var l,d,p,v,b,x,E,w,_="object",S=r(typeof globalThis==_&&globalThis)||r(typeof window==_&&window)||r(typeof self==_&&self)||r(typeof t==_&&t)||Function("return this")(),A=!g(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),k={}.propertyIsEnumerable,L=Object.getOwnPropertyDescriptor,M={f:L&&!k.call({1:2},1)?function(t){var e=L(this,t);return!!e&&e.enumerable}:k},T={}.toString,j="".split,R=g(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==n(t)?j.call(t,""):Object(t)}:Object,W={}.hasOwnProperty,z=S.document,C=y(z)&&y(z.createElement),N=!A&&!g(function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}),I=Object.getOwnPropertyDescriptor,D={f:A?I:function(t,e){if(t=u(t),e=i(e,!0),N)try{return I(t,e)}catch(t){}if(h(t,e))return m(!M.f.call(t,e),t[e])}},P=Object.defineProperty,V={f:A?P:function(t,e,r){if(O(t),e=i(e,!0),O(r),N)try{return P(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},F=A?function(t,e,r){return V.f(t,e,m(1,r))}:function(t,e,r){return t[e]=r,t},B=e(function(t){var r=S["__core-js_shared__"]||f("__core-js_shared__",{});(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),H=B("native-function-to-string",Function.toString),q=S.WeakMap,$="function"==typeof q&&/native code/.test(H.call(q)),X=0,Y=Math.random(),G=B("keys"),U={},Q=S.WeakMap;E=$?(l=new Q,d=l.get,p=l.has,v=l.set,b=function(t,e){return v.call(l,t,e),e},x=function(t){return d.call(l,t)||{}},function(t){return p.call(l,t)}):(w=s("state"),U[w]=!0,b=function(t,e){return F(t,w,e),e},x=function(t){return h(t,w)?t[w]:{}},function(t){return h(t,w)});function K(t){return"function"==typeof t?t:void 0}function J(t,e){return arguments.length<2?K(pt[t])||K(S[t]):pt[t]&&pt[t][e]||S[t]&&S[t][e]}function Z(t){return isNaN(t=+t)?0:(0n;)h(i,r=e[n++])&&(~xt(o,r)||o.push(r));return o}function it(t,e){var r=Lt[kt(t)];return r==Tt||r!=Mt&&("function"==typeof e?g(e):!!e)}function nt(t,e){var r,i,n,o,s,a=t.target,c=t.global,l=t.stat;if(r=c?S:l?S[a]||f(a,{}):(S[a]||{}).prototype)for(i in e){if(o=e[i],n=t.noTargetGet?(s=Rt(r,i))&&s.value:r[i],!jt(c?i:a+(l?".":"#")+i,t.forced)&&void 0!==n){if(typeof o==typeof n)continue;!function(t,e){for(var r=St(e),i=V.f,n=D.f,o=0;odocument.F=Object<\/script>"),t.close(),te=t.F;r--;)delete te.prototype[Et[r]];return te()},ee=Object.create||function(t,e){var r;return null!==t?(Ut.prototype=O(t),r=new Ut,Ut.prototype=null,r[Zt]=t):r=te(),void 0===e?r:Kt(r,e)};U[Zt]=!0;var re=ct("unscopables"),ie=Array.prototype;null==ie[re]&&F(ie,re,ee(null));function ne(t){ie[re][t]=!0}var oe,se,ae,ce={},le=!g(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),ue=s("IE_PROTO"),he=Object.prototype,fe=le?Object.getPrototypeOf:function(t){return t=at(t),h(t,ue)?t[ue]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?he:null},de=ct("iterator"),pe=!1;[].keys&&("next"in(ae=[].keys())?(se=fe(fe(ae)))!==Object.prototype&&(oe=se):pe=!0),null==oe&&(oe={}),h(oe,de)||F(oe,de,function(){return this});function ve(t,e,r){t&&!h(t=r?t:t.prototype,Ee)&&xe(t,Ee,{configurable:!0,value:e})}function ge(){return this}function ye(){return this}function be(t,e,r,i,n,o,s){var a,c;function l(t){if(t===n&&y)return y;if(!Se&&t in v)return v[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}}c=e+" Iterator",(a=r).prototype=ee(we,{next:m(1,i)}),ve(a,c,!1),ce[c]=ge;var u,h,f,d=e+" Iterator",p=!1,v=t.prototype,g=v[Ae]||v["@@iterator"]||n&&v[n],y=!Se&&g||l(n),b="Array"==e&&v.entries||g;if(b&&(u=fe(b.call(new t)),_e!==Object.prototype&&u.next&&(fe(u)!==_e&&(Oe?Oe(u,_e):"function"!=typeof u[Ae]&&F(u,Ae,ye)),ve(u,d,!0))),"values"==n&&g&&"values"!==g.name&&(p=!0,y=function(){return g.call(this)}),v[Ae]!==y&&F(v,Ae,y),ce[e]=y,n)if(h={values:l("values"),keys:o?y:l("keys"),entries:l("entries")},s)for(f in h)!Se&&!p&&f in v||dt(v,f,h[f]);else nt({target:e,proto:!0,forced:Se||p},h);return h}var me={IteratorPrototype:oe,BUGGY_SAFARI_ITERATORS:pe},xe=V.f,Ee=ct("toStringTag"),we=me.IteratorPrototype,Oe=Object.setPrototypeOf||("__proto__"in{}?function(){var r,i=!1,t={};try{(r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(t,[]),i=t instanceof Array}catch(r){}return function(t,e){return O(t),function(){if(!y(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(),i?r.call(t,e):t.__proto__=e,t}}():void 0),_e=me.IteratorPrototype,Se=me.BUGGY_SAFARI_ITERATORS,Ae=ct("iterator"),ke=ft.set,Le=ft.getterFor("Array Iterator"),Me=be(Array,"Array",function(t,e){ke(this,{type:"Array Iterator",target:u(t),index:0,kind:e})},function(){var t=Le(this),e=t.target,r=t.kind,i=t.index++;return!e||i>=e.length?{value:t.target=void 0,done:!0}:"keys"==r?{value:i,done:!1}:"values"==r?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}},"values");ce.Arguments=ce.Array,ne("keys"),ne("values"),ne("entries");var Te=Object.assign,je=!Te||g(function(){var t={},e={},r=Symbol();return t[r]=7,"abcdefghijklmnopqrst".split("").forEach(function(t){e[t]=t}),7!=Te({},t)[r]||"abcdefghijklmnopqrst"!=Qt(Te({},e)).join("")})?function(t,e){for(var r=at(t),i=arguments.length,n=1,o=_t.f,s=M.f;n>>0||($e.test(r)?16:10))}:qe;nt({global:!0,forced:parseInt!=Xe},{parseInt:Xe});function Ye(a){return function(t,e){var r,i,n=String(c(t)),o=Z(e),s=n.length;return o<0||s<=o?a?"":void 0:(r=n.charCodeAt(o))<55296||56319=r.length?{value:void 0,done:!0}:(t=Ue(r,i),e.index+=t.length,{value:t,done:!1})});function Je(t,e,r){for(var i in e)dt(t,i,e[i],r);return t}function Ze(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t}var tr=!g(function(){return Object.isExtensible(Object.preventExtensions({}))}),er=e(function(t){function r(t){e(t,i,{value:{objectID:"O"+ ++n,weakData:{}}})}var e=V.f,i=a("meta"),n=0,o=Object.isExtensible||function(){return!0},s=t.exports={REQUIRED:!1,fastKey:function(t,e){if(!y(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!h(t,i)){if(!o(t))return"F";if(!e)return"E";r(t)}return t[i].objectID},getWeakData:function(t,e){if(!h(t,i)){if(!o(t))return!0;if(!e)return!1;r(t)}return t[i].weakData},onFreeze:function(t){return tr&&s.REQUIRED&&o(t)&&!h(t,i)&&r(t),t}};U[i]=!0}),rr=(er.REQUIRED,er.fastKey,er.getWeakData,er.onFreeze,ct("iterator")),ir=Array.prototype,nr=ct("iterator"),or=e(function(t){function f(t,e){this.stopped=t,this.result=e}(t.exports=function(t,e,r,i,n){var o,s,a,c,l,u,h=st(e,r,i?2:1);if(n)o=t;else{if("function"!=typeof(s=function(){if(null!=t)return t[nr]||t["@@iterator"]||ce[Re(t)]}()))throw TypeError("Target is not iterable");if(void 0!==s&&(ce.Array===s||ir[rr]===s)){for(a=0,c=tt(t.length);a")}),jn=!g(function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}),Rn=Ge.charAt;An("match",1,function(i,l,u){return[function(t){var e=c(this),r=null==t?void 0:t[i];return void 0!==r?r.call(t,e):new RegExp(t)[i](String(e))},function(t){var e=u(l,t,this);if(e.done)return e.value;var r=O(t),i=String(this);if(!r.global)return Ln(r,i);for(var n,o=r.unicode,s=[],a=r.lastIndex=0;null!==(n=Ln(r,i));){var c=String(n[0]);""===(s[a]=c)&&(r.lastIndex=kn(i,tt(r.lastIndex),o)),a++}return 0===a?null:s}]});var Wn=Math.max,zn=Math.min,Cn=Math.floor,Nn=/\$([$&'`]|\d\d?|<[^>]*>)/g,In=/\$([$&'`]|\d\d?)/g;An("replace",2,function(n,E,w){return[function(t,e){var r=c(this),i=null==t?void 0:t[n];return void 0!==i?i.call(t,r,e):E.call(String(r),t,e)},function(t,e){var r=w(E,t,this,e);if(r.done)return r.value;var i=O(t),n=String(this),o="function"==typeof e;o||(e=String(e));var s,a=i.global;a&&(s=i.unicode,i.lastIndex=0);for(var c=[];;){var l=Ln(i,n);if(null===l)break;if(c.push(l),!a)break;""===String(l[0])&&(i.lastIndex=kn(n,tt(i.lastIndex),s))}for(var u,h="",f=0,d=0;d
';var e=t.firstElementChild;document.body.appendChild(e);var r=e.firstElementChild;e.scrollLeft=0;var i=c.getOffset(e),n=c.getOffset(r);e.scrollLeft=999;var o=c.getOffset(r);return{isRtlScrollingInverted:i.left!==n.left&&n.left-o.left!=0,isRtlScrollbarInverted:i.left!==n.left}},c.getOffset=function(t){var e=t.getBoundingClientRect(),r=Vn(t),i=Pn(t);return{top:e.top+(i.pageYOffset||r.documentElement.scrollTop),left:e.left+(i.pageXOffset||r.documentElement.scrollLeft)}};var t=c.prototype;return t.init=function(){c.instances.set(this.el,this),Xt&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},t.initDOM=function(){var t,e,r=this;if(Array.prototype.filter.call(this.el.children,function(t){return t.classList.contains(r.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}this.axis.x.track.el&&this.axis.y.track.el||(t=document.createElement("div"),e=document.createElement("div"),t.classList.add(this.classNames.track),e.classList.add(this.classNames.scrollbar),t.appendChild(e),this.axis.x.track.el=t.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=t.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)),this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},t.initListeners=function(){var e=this,t=Pn(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(t){e.el.addEventListener(t,e.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(t){e.el.addEventListener(t,e.onPointerEvent,{capture:!0,passive:!0})}),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),t.addEventListener("resize",this.onWindowResize);var r=!1,i=t.ResizeObserver||cn;this.resizeObserver=new i(function(){r&&e.recalculate()}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),t.requestAnimationFrame(function(){r=!0}),this.mutationObserver=new t.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},t.recalculate=function(){var t=Pn(this.el);this.elStyles=t.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;var e=this.contentEl.offsetWidth,r=this.heightAutoObserverEl.offsetHeight<=1,i=this.heightAutoObserverEl.offsetWidth<=1||0=t.left&&this.mouseX<=t.left+t.width&&this.mouseY>=t.top&&this.mouseY<=t.top+t.height},t.findChild=function(t,e){var r=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector;return Array.prototype.filter.call(t.children,function(t){return r.call(t,e)})[0]},c}();return Fn.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},Fn.instances=new WeakMap,Fn.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-simplebar]"),function(t){"init"===t.getAttribute("data-simplebar")||Fn.instances.has(t)||new Fn(t,Dn(t.attributes))})},Fn.removeObserver=function(){this.globalObserver.disconnect()},Fn.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),"undefined"!=typeof MutationObserver&&(this.globalObserver=new MutationObserver(Fn.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0})),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))},Fn.handleMutations=function(t){t.forEach(function(t){Array.prototype.forEach.call(t.addedNodes,function(t){1===t.nodeType&&(t.hasAttribute("data-simplebar")?Fn.instances.has(t)||new Fn(t,Dn(t.attributes)):Array.prototype.forEach.call(t.querySelectorAll("[data-simplebar]"),function(t){"init"===t.getAttribute("data-simplebar")||Fn.instances.has(t)||new Fn(t,Dn(t.attributes))}))}),Array.prototype.forEach.call(t.removedNodes,function(t){1===t.nodeType&&(t.hasAttribute('[data-simplebar="init"]')?Fn.instances.has(t)&&Fn.instances.get(t).unMount():Array.prototype.forEach.call(t.querySelectorAll('[data-simplebar="init"]'),function(t){Fn.instances.has(t)&&Fn.instances.get(t).unMount()}))})})},Fn.getOptions=Dn,Xt&&Fn.initHtmlApi(),Fn});