Files
OverlayScrollbars/packages/overlayscrollbars/dist/overlayscrollbars.min.js
T
2021-04-28 22:06:20 +02:00

1 line
21 KiB
JavaScript

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).OverlayScrollbars=t()}(this,(function(){"use strict";var n=function(n,t){var r,e=t||{},i=e.o,o=e.u,u=e.s,a=o;return{v:function(t,e){var o=a,c=n?n(e,a,r):e,f=t||(i?!i(o,c):o!==c);return(f||u)&&(a=c,r=o),{_:a,g:r,p:f}},m:function(n){return{_:a,g:r,p:!!n}}}},t=Node.ELEMENT_NODE,r=Object.prototype,e=r.toString,i=r.hasOwnProperty;function o(n){return void 0===n}function u(n){return null===n}var a=function(n){return o(n)||u(n)?""+n:e.call(n).replace(/^\[object (.+)\]$/,"$1").toLowerCase()};function c(n){return"number"==typeof n}function f(n){return"string"==typeof n}function l(n){return"boolean"==typeof n}function s(n){return"function"==typeof n}function v(n){return Array.isArray(n)}function d(n){return"object"==typeof n&&!v(n)&&!u(n)}function _(n){var t=!!n&&n.length,r=c(t)&&t>-1&&t%1==0;return!!(v(n)||!s(n)&&r)&&(!(t>0&&d(n))||t-1 in n)}function g(n){if(!n||!d(n)||"object"!==a(n))return!1;var t,r=n.constructor,e=r&&r.prototype,u=i.call(n,"constructor"),c=e&&i.call(e,"isPrototypeOf");if(r&&!u&&!c)return!1;for(t in n);return o(t)||i.call(n,t)}function h(n){var r=window.Element;return!!n&&(r?n instanceof r:n.nodeType===t)}function p(n,t){if(_(n))for(var r=0;r<n.length&&!1!==t(n[r],r,n);r++);else n&&p(Object.keys(n),(function(r){return t(n[r],r,n)}));return n}var w=function(n,t,r){return r||f(t)||!_(t)?n.push(t):Array.prototype.push.apply(n,t),n},b=function(n){if(Array.from)return Array.from(n);var t=[];return p(n,(function(n){w(t,n)})),t},m=function(n){return n&&0===n.length},y=function(n,t){var r=function(n){return n&&n(t)};n instanceof Set?n.forEach(r):p(n,r)},x=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},S=function(n){return n?Object.keys(n):[]};function z(n,t,r,e,i,o,a){var c=[t,r,e,i,o,a];return"object"==typeof n&&!u(n)||s(n)||(n={}),p(c,(function(t){p(S(t),(function(r){var e=t[r];if(n===e)return!0;var i=v(e);if(e&&(g(e)||i)){var o=n[r],u=o;i&&!v(o)?u=[]:i||g(o)||(u={}),n[r]=z(u,e)}else n[r]=e}))})),n}function O(n){for(var t in n)return!1;return!0}function C(n,t,r,e){if(o(e))return r?r[n]:t;r&&(r[n]=e)}function M(n,t,r){if(o(r))return n?n.getAttribute(t):null;n&&n.setAttribute(t,r)}function A(n,t){return C("scrollLeft",0,n,t)}function L(n,t){return C("scrollTop",0,n,t)}var T,I=Element.prototype,R=function(n,t){var r=[],e=t?h(t)?t:null:document;return e?w(r,e.querySelectorAll(n)):r},j=function(n,t){return!!h(n)&&(I.matches||I.msMatchesSelector).call(n,t)},E=function(n){return n?b(n.childNodes):[]},V=function(n){return n?n.parentElement:null},B=function(n,t){if(h(n)){var r=I.closest;if(r)return r.call(n,t);do{if(j(n,t))return n;n=V(n)}while(n)}return null},D=function(n,t,r){var e=n&&B(n,t),i=n&&function(n,t){var r=t?h(t)?t:null:document;return r?r.querySelector(n):null}(r,e);return!(!e||!i)&&(e===n||i===n||B(B(n,r),t)!==e)},q=function(n,t,r){if(r){var e,i=t;n&&(_(r)?(e=document.createDocumentFragment(),p(r,(function(n){n===i&&(i=n.previousSibling),e.appendChild(n)}))):e=r,t&&(i?i!==t&&(i=i.nextSibling):i=n.firstChild),n.insertBefore(e,i||null))}},F=function(n,t){q(n,null,t)},P=function(n,t){q(n,n&&n.firstChild,t)},H=function(n,t){q(V(n),n&&n.nextSibling,t)},Y=function n(t){if(_(t))p(b(t),(function(t){return n(t)}));else if(t){var r=V(t);r&&r.removeChild(t)}},N=function(n){var t=document.createElement("div");return n&&M(t,"class",n),t},W=function(n){var t=N();return t.innerHTML=n.trim(),p(E(t),(function(n){return Y(n)}))},X=["WebKit","Moz","O","MS","webkit","moz","o","ms"],k={},$=function(n){var t=k[n]||window[n];return x(k,n)||(p(X,(function(r){var e;return!(t=t||window[r+(e=n,e.charAt(0).toUpperCase()+e.slice(1))])})),k[n]=t),t},G=$("MutationObserver"),J=$("IntersectionObserver"),K=$("ResizeObserver"),U=$("cancelAnimationFrame"),Q=$("requestAnimationFrame"),Z=/[^\x20\t\r\n\f]+/g,nn=function(n,t,r){var e,i=0,o=!1;if(n&&f(t)){var u=t.match(Z)||[];for(o=u.length>0;e=u[i++];)o=!!r(n.classList,e)&&o}return o},tn=function(n,t){nn(n,t,(function(n,t){return n.add(t)}))},rn=function(n,t){nn(n,t,(function(n,t){return n.remove(t)}))},en={w:0,h:0},on=function(){return{w:window.innerWidth,h:window.innerHeight}},un=function(n){return n?{w:n.offsetWidth,h:n.offsetHeight}:en},an=function(n){return n?{w:n.clientWidth,h:n.clientHeight}:en},cn=function(n){return n?{w:n.scrollWidth,h:n.scrollHeight}:en},fn=function(n){return n.getBoundingClientRect()},ln=function(n){return n.split(" ")},sn=function(n,t,r,e){p(ln(t),(function(t){n.removeEventListener(t,r,e)}))},vn=function(n,t,r,e){var i=function(){if(o(T)){T=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){T=!0}}))}catch(n){}}return T}(),u=i&&e&&e.S||!1,a=e&&e.O||!1,c=e&&e.C||!1,f=[],l=i?{passive:u,capture:a}:a;return p(ln(t),(function(t){var e=c?function(i){n.removeEventListener(t,e,a),r&&r(i)}:r;w(f,sn.bind(null,n,t,e,a)),n.addEventListener(t,e,l)})),y.bind(0,f)},dn=function(n){return function(n){return n.stopPropagation()}(n)||function(n){return n.preventDefault()}(n)},_n=function(n,t,r,e){if(n&&t){var i=!0;return p(r,(function(r){(e?e(n[r]):n[r])!==(e?e(t[r]):t[r])&&(i=!1)})),i}return!1},gn=function(n,t){return _n(n,t,["w","h"])},hn=function(n,t){return _n(n,t,["t","r","b","l"])},pn=function(n,t,r){return _n(n,t,["width","height"],r&&function(n){return Math.round(n)})},wn=function(){},bn={opacity:1,zindex:1},mn=function(n,t){var r=t?parseFloat(n):parseInt(n,10);return Number.isNaN(r)?0:r},yn=function(n,t,r){return null!=t?t[r]||t.getPropertyValue(r):n.style[r]},xn=function(n,t,r){try{if(n){var e=n.style;o(e[t])?e.setProperty(t,r):e[t]=function(n,t){return!bn[n.toLowerCase()]&&c(t)?t+"px":t}(t,r)}}catch(i){}};function Sn(n,t){var r=f(t);if(v(t)||r){var e=r?"":{};if(n){var i=window.getComputedStyle(n,null);e=r?yn(n,i,t):t.reduce((function(t,r){return t[r]=yn(n,i,r),t}),e)}return e}p(S(t),(function(r){return xn(n,r,t[r])}))}var zn={x:0,y:0},On=function(n){var t=n?fn(n):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:zn};var Cn,Mn=function(n){var t={exports:{}};return n(t,t.exports),t.exports}((function(n){function t(){return n.exports=t=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n},t.apply(this,arguments)}n.exports=t})),An=JSON.stringify,Ln=["__TPL_","_TYPE__"],Tn=["boolean","number","string","array","object","function","null"].reduce((function(n,t){return n[t]=Ln[0]+t+Ln[1],n}),{}),In=function(n,t,r,e){return function n(t,r,e,i,u){var c={},l=Mn({},t);return p(S(r).filter((function(n){return x(t,n)})),(function(s){var d=o(e[s])?{}:e[s],_=t[s],h=r[s],b=g(h),m=u?u+".":"";if(b&&g(_)){var y=n(_,h,d,i,m+s);c[s]=y.M,l[s]=y.A,p([l,c],(function(n){O(n[s])&&delete n[s]}))}else if(!b){var x=!1,S=[],z=[],C=a(_);if(p(v(h)?h:[h],(function(n){var t;p(Tn,(function(r,e){r===n&&(t=e)}));var r=o(t);if(r&&f(_)){var e=n.split(" ");x=!!e.find((function(n){return n===_})),w(S,e)}else x=Tn[C]===n;return w(z,r?Tn.string:t),!x})),x)(v(_)||g(_)?An(_)!==An(d):_!==d)&&(c[s]=_);else i&&console.warn('The option "'+m+s+"\" wasn't set, because it doesn't accept the type [ "+C.toUpperCase()+' ] with the value of "'+_+'".\r\nAccepted types are: [ '+z.join(", ").toUpperCase()+" ].\r\n"+(S.length>0?"\r\nValid strings are: [ "+S.join(", ")+" ].":""));delete l[s]}})),{A:l,M:c}}(n,t,r||{},e||!1)},Rn=Tn.number,jn=[Tn.string,Tn.array,Tn.null],En=[!0,Tn.boolean],Vn=[!1,Tn.boolean],Bn=function n(t){var r={L:{},T:{}};return p(S(t),(function(e){var i=t[e];if(v(i))r.L[e]=i[1],r.T[e]=i[0];else{var o=n(i);r.L[e]=o.L,r.T[e]=o.T}})),r}({resize:["none","none both horizontal vertical"],paddingAbsolute:Vn,updating:{elementEvents:[[["img","load"]],[Tn.array,Tn.null]],contentMutationDebounce:[80,Rn],hostMutationDebounce:[0,Rn],resizeDebounce:[0,Rn]},overflow:{x:["scroll","hidden scroll visible visible-hidden"],y:["scroll","hidden scroll visible visible-hidden"]},scrollbars:{visibility:["auto","visible hidden auto"],autoHide:["never","never scroll leavemove"],autoHideDelay:[800,Rn],dragScroll:En,clickScroll:Vn,touch:En},textarea:{dynWidth:Vn,dynHeight:Vn,inheritedAttrs:[["style","class"],jn]},nativeScrollbarsOverlaid:{show:Vn,initialize:Vn}}),Dn=Bn.L,qn=Bn.T,Fn=Math.abs,Pn=Math.round,Hn=function(n,t){F(n,t);var r=an(t),e=un(t);return{x:e.h-r.h,y:e.w-r.w}},Yn=function(n,t){Sn(n,{overflowX:"hidden",overflowY:"hidden",direction:"rtl"}),A(n,0);var r=On(n),e=On(t);A(n,-999);var i=On(t);return{i:r.x===e.x,n:e.x!==i.x}},Nn=function(n,t){tn(n,"os-environment-flexbox-glue");var r=fn(n),e=fn(t),i=pn(e,r,!0);tn(n,"os-environment-flexbox-glue-max");var o=fn(n),u=fn(t),a=pn(u,o,!0);return i&&a},Wn=function(){var n=window.screen.deviceXDPI||0,t=window.screen.logicalXDPI||1;return window.devicePixelRatio||n/t},Xn=function(){var n,t,r=document.body,e=W('<div class="os-environment"><div></div></div>')[0],i=e.firstChild,o=new Set,u=Hn(r,e),a={x:0===u.x,y:0===u.y},c=function(n){return{I:!n,R:!1}}(!1),f=c,l=qn,s={j:u,V:a,B:!1,D:"-1"===Sn(e,"zIndex"),q:Yn(e,i),F:Nn(e,i),P:function(n){o.add(n)},H:function(n){o.delete(n)},Y:function(){return Mn({},f)},N:function(n){f=z({},f,n)},W:function(){return Mn({},l)},X:function(n){l=z({},l,n)},k:c,$:l};if(t="style",(n=e)&&n.removeAttribute(t),Y(e),!a.x||!a.y){var v=on(),d=Wn(),_=u;window.addEventListener("resize",(function(){if(o.size){var n=on(),t={w:n.w-v.w,h:n.h-v.h};if(0===t.w&&0===t.h)return;var i={w:Fn(t.w),h:Fn(t.h)},u={w:Fn(Pn(n.w/(v.w/100))),h:Fn(Pn(n.h/(v.h/100)))},a=Wn(),c=i.w>2&&i.h>2,f=(s=u.h,g=Fn(u.w),h=Fn(s),!(g!==h&&g+1!==h&&g-1!==h));if(c&&f&&(a!==d&&d>0)){var l=Cn.j=Hn(r,e);Y(e),_.x===l.x&&_.y===l.y||y(o),_=l}v=n,d=a}var s,g,h}))}return s},kn=function(){return Cn||(Cn=Xn()),Cn},$n=function(n){F(V(n),E(n)),Y(n)},Gn=0,Jn=function(n,t){var r=l(n);return r||o(n)?(r?n:t)&&void 0:n},Kn=function(n){var r=kn(),e=r.Y,i=r.B,u=r.V,a=r.D,c=e(),f=c.I,l=c.R,s=function(n){var r=window.HTMLElement;return!!n&&(r?n instanceof r:n.nodeType===t)}(n),v=s?{}:{G:n.host,J:n.target,K:n.viewport,I:Jn(n.padding,f),R:Jn(n.content,l)};if(s){var d=N("os-viewport"),_=f&&N("os-padding"),g=l&&N("os-content");v.J=n,v.I=_,v.K=d,v.R=g}var h=v.J,p=v.I,b=v.K,m=v.R,x=[],S=j(h,"textarea"),z=!S&&j(h,"body"),O=S?v.G||N():h,C=function(n){return S?h:E(n)};if(S&&O!==v.G&&(H(h,O),w(x,(function(){H(O,h),Y(O)}))),s){var A=m||b;F(A,C(h)),F(O,p),F(p||O,b),F(b,m),w(x,(function(){F(O,E(A)),Y(p||b),rn(O,"os-host")}))}else{var L=m||b||p||O,T=o(p),I=o(b),R=o(m),B=C(L);p=v.I=T?N():p,b=v.K=I?N():b,m=v.R=R?N():m,F(O,p),F(p||O,b),F(b,m),F(m||b,B),w(x,(function(){R&&$n(m),I&&$n(b),T&&$n(p),rn(O,"os-host"),rn(p,"os-padding"),rn(b,"os-viewport"),rn(m,"os-content")}))}tn(O,"os-host"),tn(p,"os-padding"),tn(b,"os-viewport"),tn(m,"os-content");var D,P,W,X=h.ownerDocument,k=X.body,$={U:X.defaultView,Z:X,nn:V(k),tn:k,rn:S,en:z},G=Mn({},v,{G:O});if(i)w(x,rn.bind(0,b,"os-viewport-scrollbar-styled"));else if(!a&&(u.x||u.y)){var J=(M(W=document.createElement("style"),"id","os-viewport-arrange-"+Gn),Gn++,W);P=J,q(V(D=b),D,P),w(x,Y.bind(0,J)),G.in=J}return{on:G,un:$,an:function(){y(x)}}},Un=function(t){var r=t.cn,e=t.fn,i=r.on,o=i.G,u=i.I,a=i.K,c=n((function(){return f=Sn(o,[i=(r=(n="padding")?n+"-":"")+"top"+(e=t?"-"+t:""),u=r+"right"+e,a=r+"bottom"+e,c=r+"left"+e]),{t:mn(f[i]),r:mn(f[u]),b:mn(f[a]),l:mn(f[c])};var n,t,r,e,i,u,a,c,f}),{o:hn}),f=c.v,l=c.m;return function(n,t,r){var i=l(r),o=(i._,i.p),c=kn().B,s=n.ln,v=n.sn,d=v._,_=v.p,g=t("paddingAbsolute"),h=g._,p=g.p;if(s||o){var w=f(r);w._,o=w.p}var b=p||_||o;if(b){var m=f(r)._,y=!h||!u&&!c,x=m.r+m.l,S=m.t+m.b,z={marginTop:0,marginRight:0,marginBottom:y?-S:0,marginLeft:0,top:y?-m.t:0,right:0,bottom:0,left:0,maxWidth:y?"calc(100% + "+x+"px)":""},O={paddingTop:y?m.t:0,paddingRight:y?m.r:0,paddingBottom:y?m.b:0,paddingLeft:y?m.l:0};if(y){var C=d?"right":"left",M=d?"marginLeft":"marginRight",A=d?m.r:m.l;z[C]=-A,z[M]=-x}Sn(u||a,z),Sn(a,O),e({vn:{dn:!y,I:m},_n:u?O:Mn({},z,O)})}return{gn:b}}},Qn=function(t){var r=t.cn,e=t.hn,i=t.pn,o=t.fn,u=r.on,a=u.G,c=u.K,f=u.in,l=n((function(n){return h(n.wn,n.bn,n.mn)}),{o:gn}),s=l.v,v=l.m,d=n((function(n){return{w:Math.max(0,n.yn.w-n.xn.w),h:Math.max(0,n.yn.h-n.xn.h)}}),{o:gn,u:{w:0,h:0}}),_=d.v,g=d.m,h=function(n,t,r){return{w:n.w-Math.round(Math.max(0,r.width-t.w)),h:n.h-Math.round(Math.max(0,r.height-t.h))}},w=function(n,t){if(Sn(c,{height:""}),t){var r=i().vn,e=r.dn,o=r.I,u=n.Sn,f=n.zn,l=fn(a),s=un(a),v=an(a),d=e||"content-box"===Sn(c,"boxSizing")?o.b+o.t:0,_=v.h+(l.height-s.h);Sn(c,{height:_+(u.x?f.x:0)-d})}},b=function(n,t){var r=kn(),e=r.j,i=r.V,o=r.B,u=i.x,a=i.y,f=o||n?0:42,l=!t?Sn(c,["overflowX","overflowY"]):t,s={x:"scroll"===l.overflowX,y:"scroll"===l.overflowY};return{Sn:s,On:{x:u&&!!f,y:a&&!!f},zn:{x:s.x&&!o?u?f:e.x:0,y:s.y&&!o?a?f:e.y:0}}},m=function(n,t,r){if(e){var o=n.zn,u=n.On,a=u.x,l=u.y,s=o.x,v=o.y,d=i()._n,_=d[r?"paddingRight":"paddingLeft"],g=d.paddingTop,h={w:v&&l?v+t.w-_+"px":"",h:s&&a?s+t.h-g+"px":""};if(f){var p=f.sheet;if(p){var w=p.cssRules;if(w){w.length||p.insertRule("#"+M(f,"id")+" + .os-viewport-arrange::before {}",0);var b=w[0].style;b.width=h.w,b.height=h.h}}}else Sn(c,{"--viewport-arrange-width":h.w,"--viewport-arrange-height":h.h})}return e},y=function(n,t,r,e){var o=n.zn,u=n.On,a=u.x,c=u.y,f=o.x,l=o.y,s=i()._n,v=t?"marginLeft":"marginRight",d=t?"paddingLeft":"paddingRight",_=s[v],g=s.marginBottom,h=s[d],p=s.paddingBottom;e.maxWidth="calc(100% + "+(l+-1*_)+"px)",e[v]=-l+_,e.marginBottom=-f+g,r&&(e[d]=h+(c?l:0),e.paddingBottom=p+(a?f:0))};return function(n,t,r){var u,a=n.sn,f=n.Cn,l=n.ln,d=n.Mn,x=n.An,z=n.gn,O=kn(),C=O.F,M=O.B,A=O.V,L=f._,T=f.p,I=a._,R=a.p,j=t("nativeScrollbarsOverlaid.show"),E=j._,V=j.p,B=E&&A.x&&A.y,D=!C&&(l||x||d||V||T),q=g(r),F=v(r);if(V&&M&&(B?rn(c,"os-viewport-scrollbar-styled"):tn(c,"os-viewport-scrollbar-styled")),D&&(u=b(B),w(u,!!L)),l||z||x||V||R){var P=function(n,t,r){if(e){var o=r||b(n),u=i()._n,a=kn().F,f=o.On,l=f.x,s=f.y,v={},d=function(n){return p(n.split(" "),(function(n){v[n]=u[n]}))};a||(v.height=""),l&&d("marginTop marginBottom paddingTop paddingBottom"),s&&d("marginLeft marginRight paddingLeft paddingRight");var _=Sn(c,S(v));return rn(c,"os-viewport-arrange"),Sn(c,v),{Ln:function(){y(o,t,e,_),Sn(c,_),tn(c,"os-viewport-arrange")},Tn:o}}return{Ln:wn}}(B,I,u),H=P.Ln,Y=P.Tn,N=an(c),W=fn(c),X=un(c),k=cn(c),$=N,G=F=s(r,{mn:W,bn:X,wn:k}),J=G._,K=G.p;H(),(K||V)&&Y&&!B&&m(Y,J,I)&&($=an(c),k=h(cn(c),un(c),fn(c))),q=_(r,{yn:{w:Math.max(J.w,k.w),h:Math.max(J.h,k.h)},xn:{w:$.w+Math.max(0,N.w-J.w),h:$.h+Math.max(0,N.h-J.h)}})}var U=t("overflow"),Q=U._,Z=U.p,nn=F,en=nn._,on=nn.p,ln=q,sn=ln._,vn=ln.p;if(z||on||vn||Z||V||R||D){var dn={marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,maxWidth:"",overflowY:"",overflowX:""},_n=function(n,t,r,e){var i=function(n,t,r,e){var i=n?"overflowX":"overflowY",o=0===r.indexOf("visible"),u="visible-hidden"===r,a="scroll"===r;return o&&(e[i]="visible"),a&&t>0&&(e[i]=r),{In:o,Rn:u?"hidden":"scroll"}},o=i(!0,t.w,r.x,e),u=o.In,a=o.Rn,c=i(!1,t.h,r.y,e),f=c.In,l=c.Rn;return u&&!f&&(e.overflowX=a),f&&!u&&(e.overflowY=l),b(n,e)}(B,sn,Q,dn),gn=m(_n,en,I);y(_n,I,gn,dn),D&&w(_n,!!L),Sn(c,dn),o({jn:_n.Sn,En:sn})}}},Zn=function(n){return"rtl"===Sn(n,"direction")},nt=function(n){return n&&(n.height||n.width)},tt=function(t,r,e){var i,o=e||{},u=o.Vn,a=void 0!==u&&u,c=o.Bn,f=void 0!==c&&c,s=kn().q,d=W('<div class="os-size-observer"><div class="os-size-observer-listener"></div></div>')[0],_=d.firstChild,g=n(0,{s:!0,o:function(n,t){return!(!n||!nt(n)&&nt(t))}}).v,h=function(n){var t=n&&l(n._),e=!1;if(v(n)&&n.length>0){var i=g(0,n.pop().contentRect),o=i.g,u=i._;i.p;e=!o||!nt(u)}else t&&n.p;if(a){var c=t?n._:Zn(d);A(d,c?s.n?-3333333:s.i?0:3333333:3333333),L(d,3333333)}e||r(t?n:void 0)},p=[],b=!!f&&h;if(K){var m=new K(h);m.observe(_),w(p,(function(){return m.disconnect()}))}else{var x=W('<div class="os-size-observer-listener-item" dir="ltr"><div class="os-size-observer-listener-item"><div class="os-size-observer-listener-item-final"></div></div><div class="os-size-observer-listener-item"><div class="os-size-observer-listener-item-final" style="width: 200%; height: 200%"></div></div></div>');F(_,x),tn(_,"os-size-observer-listener-scroll");var S,z=x[0],O=z.lastChild,C=z.firstChild,M=null==C?void 0:C.firstChild,T=un(_),I=T,R=!1,j=function(){A(C,3333333),L(C,3333333),A(O,3333333),L(O,3333333)},E=function(){S=0,R&&(T=I,h())},V=function(n){I=un(_),R=!n||!gn(I,T),n?(dn(n),R&&!S&&(U(S),S=Q(E))):E(),j()};w(p,[vn(C,"scroll",V),vn(O,"scroll",V)]),Sn(M,{width:3333333,height:3333333}),j(),b=f?V.bind(0,!1):j}if(a){var B=(i=n((function(){return Zn(d)}))).v;w(p,vn(d,"scroll",(function(n){var t=B(),r=t._;t.p&&(rn(_,"ltr rtl"),tn(_,r?"rtl":"ltr"),h(t)),dn(n)})))}return b&&(tn(d,"os-size-observer-appear"),w(p,vn(d,"animationstart",b,{C:!!K}))),P(t,d),{an:function(){y(p),Y(d)},Dn:function(n){return{sn:i?i.m(n):{_:!1,g:!1,p:!1}}}}},rt=function(n,t,r,e){var i,u,a,l,v,d,_,g,h,b,y=!1,x=e||{},S=x.qn,z=x.Fn,O=x.Pn,C=x.Hn,A=x.Yn,L=x.Nn,T=x.Wn,I=function(n,t,r){var e,i,u=function(){e&&(e.forEach((function(n,t){return sn(t,n,r)})),e.clear())},a=function(t){e&&i&&p(i.reduce((function(r,e){if(e){var i=e[0],o=e[1],u=o&&i&&(t?t(i):R(i,n)),a=s(o)?o(u):o;u&&u.length&&a&&f(a)&&w(r,[u,a.trim()],!0)}return r}),[]),(function(n){return p(n[0],(function(t){var i=n[1],u=e.get(t),a=!o(u)&&i!==u,c=a?u+" "+i:i;a&&sn(t,u,r),e.set(t,c),vn(t,c,r)}))}))},c=function(n){e=e||new Map,i=n,u(),a()};return t&&c(t),{an:u,Xn:a,kn:c}}(n,t&&O,(i=function(){y&&r(!0)},d=c(u=84)&&u>0,_=c(a)&&a>0,g=d?window.clearTimeout:U,h=d?window.setTimeout:Q,b=function(n){v=_?performance.now():0,l&&g(l),i.apply(this,n)},function(){var n=b.bind(this,arguments),t=!!_&&performance.now()-v>=a;l&&g(l),l=t?n():h(n,u)})),E=I.an,V=I.Xn,B=I.kn,D=z||[],q=(S||[]).concat(D),F=function(i){var o=(t?L:A)||wn,u=T||wn,a=[],c=[],l=!1,s=!1,v=!1;p(i,(function(r){var i,d,_=r.attributeName,g=r.target,h=r.type,p=r.oldValue,b=r.addedNodes,m="attributes"===h,y="childList"===h,x=n===g,S=m&&f(_)?M(g,_):0,z=0!==S&&p!==S,O=(i=_,D.indexOf(i,d)>-1&&z);if(t&&!x){var A=!m,L=m&&O,T=L&&C&&j(g,C),I=(T?!o(g,_,p,S):A||L)&&!u(r,!!T,n,e);w(c,b),s=s||I,v=v||y}!t&&x&&z&&!o(g,_,p,S)&&(w(a,_),l=l||O)})),v&&!m(c)&&V((function(n){return c.reduce((function(t,r){return w(t,R(n,r)),j(r,n)?w(t,r):t}),[])})),t?s&&r(s):m(a)&&!l||r(a,l)},P=new G(F);return P.observe(n,{attributes:!0,attributeOldValue:!0,attributeFilter:q,subtree:t,childList:t,characterData:t}),y=!0,{an:function(){y&&(E(),P.disconnect(),y=!1)},kn:function(n){B(y&&t&&n)},v:function(){y&&F(P.takeRecords())}}},et=function(n,t){return n?t.split(".").reduce((function(n,t){return n&&x(n,t)?n[t]:void 0}),n):void 0},it=["id","class","style","open"],ot=function(n,t,r,e){var i,o,u,a,c;return!("class"!==t||!r||!e)&&!!(o=e,u=(i=r)&&i.split(" "),a=o&&o.split(" "),c={},p(u,(function(n){c[n]=1})),p(a,(function(n){c[n]?delete c[n]:c[n]=1})),S(c)).find((function(n){return 0!==n.indexOf("os-")}))},ut={_:!1,g:!1,p:!1},at={_:!1,g:!1,p:!1},ct={vn:{dn:!1,I:{t:0,r:0,b:0,l:0}},jn:{x:!1,y:!1},En:{w:0,h:0},_n:{marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0}},ft=function(t,r){var e=ct,i=r.on,o=i.G,u=i.K,a=i.R,f=kn(),l=f.B,s=f.V,v=f.F,d=f.P,_=f.H,g=!l&&(s.x||s.y),h=[],b={T:t,cn:r,hn:g,pn:function(){return e},fn:function(n){var t,r;n&&n._n&&(n._n=(t=n._n,r=ct._n,S(t).reduce((function(n,r){var e=t[r];return n[r]=""===e?0:e,n}),Mn({},r)))),e=z({},e,n)}};w(h,function(n){var t=n.cn.on.R;return function(n){var r=n.Cn,e=r._,i=r.p;return i&&Sn(t,{height:e?"":"100%",display:e?"":"inline"}),{ln:i,An:i}}}(b)),w(h,Un(b)),w(h,Qn(b));var m=function(n,r,e){var i=n||{},o=i.sn,a=i.Cn,f=i.ln,l=void 0===f?e||!1:f,s=i.Mn,d=void 0===s?e||!1:s,_=i.An,w=void 0===_?e||!1:_,b=i.gn,m=void 0===b?e||!1:b,y=o||(O?O.Dn(e).sn:ut),S=a||(x?x.Dn(e).Cn:at),z=function(n){return{_:et(t,n),p:e||void 0!==et(r,n)}},C=g||!v,M=C&&A(u),T=C&&L(u);p(h,(function(n){var t=n({sn:y,Cn:S,ln:l,Mn:d,An:w,gn:m},z,!!e)||{},r=t.ln,i=t.Mn,o=t.An,u=t.gn;l=r||l,d=i||d,w=o||w,m=u||m})),c(M)&&A(u,M),c(T)&&L(u,T)},x=(a||!v)&&function(t,r){var e=N("os-trinsic-observer"),i=[],o=n((function(n){return 0===n.h||n.isIntersecting||n.intersectionRatio>0}),{u:!1}),u=o.v,a=o.m;if(J){var c=new J((function(n){if(n&&n.length>0){var t=n.pop();if(t){var e=u(0,t);e.p&&r(e)}}}),{root:t});c.observe(e),w(i,(function(){return c.disconnect()}))}else{var f=function(){var n=un(e),t=u(0,n);t.p&&r(t)};w(i,tt(e,f).an),f()}return P(t,e),{an:function(){y(i),Y(e)},Dn:function(n){return{Cn:a(n)}}}}(o,(function(n){m({Cn:n})})),O=tt(o,(function(n){m({sn:n,ln:!n})}),{Bn:!0,Vn:!l}),C=(rt(o,!1,(function(){requestAnimationFrame((function(){m({Mn:!0})}))}),{Fn:it,qn:it,Yn:ot}),rt(a||u,!0,(function(){requestAnimationFrame((function(){m({An:!0})}))}),{Fn:it,qn:it,Pn:t.updating.elementEvents,Hn:".os-host",Wn:function(n,t){var r=n.target,e=n.attributeName;return!t&&(!!e&&(D(r,".os-host",".os-viewport")||D(r,".os-host",".os-content")))},Nn:ot}),function(n,t){m(null,n,t)}),M=C.bind(null,null,!0);return d(M),console.log(kn()),{v:C,$n:function(){return{Gn:e.En}},an:function(){_(M)}}};return function(n,t,r){var e=z({},(0,kn().W)(),In(t||{},Dn,null,!0).M),i=Kn(n),o=ft(e,i),u={options:function(n){if(n){var t=In(n,Dn,e,!0).M;O(t)||(z(e,t),o.v(t))}return e},state:function(){return o.$n()},update:function(n){o.v(null,n)}};return u.update(!0),u}}));