mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-19 13:50:36 +03:00
1 line
18 KiB
JavaScript
1 line
18 KiB
JavaScript
const t=(t,e)=>{const{o:n,s:o,u:r}=e||{};let i,s=o;return{_:(e,o)=>{const l=s,a=t?t(o,s,i):o,c=e||(n?!n(l,a):l!==a);return(c||r)&&(s=a,i=l),{v:s,g:i,p:c}},m:t=>({v:s,g:i,p:!!t})}},e=Node.ELEMENT_NODE,{toString:n,hasOwnProperty:o}=Object.prototype;function r(t){return void 0===t}function i(t){return null===t}const s=t=>r(t)||i(t)?""+t:n.call(t).replace(/^\[object (.+)\]$/,"$1").toLowerCase();function l(t){return"number"==typeof t}function a(t){return"string"==typeof t}function c(t){return"function"==typeof t}function d(t){return Array.isArray(t)}function u(t){return"object"==typeof t&&!d(t)&&!i(t)}function _(t){const e=!!t&&t.length,n=l(e)&&e>-1&&e%1==0;return!!(d(t)||!c(t)&&n)&&(!(e>0&&u(t))||e-1 in t)}function v(t){if(!t||!u(t)||"object"!==s(t))return!1;let e;const n=t.constructor,i=n&&n.prototype,l=o.call(t,"constructor"),a=i&&o.call(i,"isPrototypeOf");if(n&&!l&&!a)return!1;for(e in t);return r(e)||o.call(t,e)}function g(t){const n=window.Element;return!!t&&(n?t instanceof n:t.nodeType===e)}function h(t,e){if(_(t))for(let n=0;n<t.length&&!1!==e(t[n],n,t);n++);else t&&h(Object.keys(t),n=>e(t[n],n,t));return t}const f=(t,e,n)=>t.indexOf(e,n),p=(t,e,n)=>(n||a(e)||!_(e)?t.push(e):Array.prototype.push.apply(t,e),t),w=t=>{if(Array.from)return Array.from(t);const e=[];return h(t,t=>{p(e,t)}),e},b=t=>t&&0===t.length,y=(t,e)=>{const n=t=>t&&t(e);t instanceof Set?t.forEach(n):h(t,n)},m=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),S=t=>t?Object.keys(t):[];function x(t,e,n,o,r,s,l){const a=[e,n,o,r,s,l];return"object"==typeof t&&!i(t)||c(t)||(t={}),h(a,e=>{h(S(e),n=>{const o=e[n];if(t===o)return!0;const r=d(o);if(o&&(v(o)||r)){const e=t[n];let i=e;r&&!d(e)?i=[]:r||v(e)||(i={}),t[n]=x(i,o)}else t[n]=o})}),t}function z(t){for(const e in t)return!1;return!0}function C(t,e,n,o){if(r(o))return n?n[t]:e;n&&(n[t]=o)}function O(t,e,n){if(r(n))return t?t.getAttribute(e):null;t&&t.setAttribute(e,n)}function M(t,e){return C("scrollLeft",0,t,e)}function I(t,e){return C("scrollTop",0,t,e)}const L=Element.prototype,$=(t,e)=>{const n=[],o=e?g(e)?e:null:document;return o?p(n,o.querySelectorAll(t)):n},A=(t,e)=>{if(g(t)){return(L.matches||L.msMatchesSelector).call(t,e)}return!1},V=t=>t?w(t.childNodes):[],T=t=>t?t.parentElement:null,R=(t,e,n)=>{if(n){let o,r=e;t&&(_(n)?(o=document.createDocumentFragment(),h(n,t=>{t===r&&(r=t.previousSibling),o.appendChild(t)})):o=n,e&&(r?r!==e&&(r=r.nextSibling):r=t.firstChild),t.insertBefore(o,r||null))}},P=(t,e)=>{R(t,null,e)},j=(t,e)=>{R(t,t&&t.firstChild,e)},E=(t,e)=>{R(T(t),t&&t.nextSibling,e)},q=t=>{if(_(t))h(w(t),t=>q(t));else if(t){const e=T(t);e&&e.removeChild(t)}},B=t=>{const e=document.createElement("div");return t&&O(e,"class",t),e},H=t=>{const e=B();return e.innerHTML=t.trim(),h(V(e),t=>q(t))},F=["WebKit","Moz","O","MS","webkit","moz","o","ms"],D={},G=t=>{let e=D[t]||window[t];return m(D,t)||(h(F,n=>{var o;return e=e||window[n+(o=t,o.charAt(0).toUpperCase()+o.slice(1))],!e}),D[t]=e),e},N=G("MutationObserver"),W=G("IntersectionObserver"),Y=G("ResizeObserver"),k=G("cancelAnimationFrame"),U=G("requestAnimationFrame"),X=/[^\x20\t\r\n\f]+/g,J=(t,e,n)=>{let o,r=0,i=!1;if(t&&a(e)){const s=e.match(X)||[];for(i=s.length>0;o=s[r++];)i=!!n(t.classList,o)&&i}return i},K=(t,e)=>{J(t,e,(t,e)=>t.add(e))},Q=(t,e)=>{J(t,e,(t,e)=>t.remove(e))},Z={w:0,h:0},tt=()=>({w:window.innerWidth,h:window.innerHeight}),et=t=>t?{w:t.offsetWidth,h:t.offsetHeight}:Z,nt=t=>t?{w:t.clientWidth,h:t.clientHeight}:Z,ot=t=>t?{w:t.scrollWidth,h:t.scrollHeight}:Z,rt=t=>t.getBoundingClientRect();let it;const st=t=>t.split(" "),lt=(t,e,n,o)=>{h(st(e),e=>{t.removeEventListener(e,n,o)})},at=(t,e,n,o)=>{const i=(()=>{if(r(it)){it=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){it=!0}}))}catch(t){}}return it})(),s=i&&o&&o.S||!1,l=o&&o.C||!1,a=o&&o.O||!1,c=[],d=i?{passive:s,capture:l}:l;return h(st(e),e=>{const o=a?r=>{t.removeEventListener(e,o,l),n&&n(r)}:n;p(c,lt.bind(null,t,e,o,l)),t.addEventListener(e,o,d)}),y.bind(0,c)},ct=t=>t.stopPropagation(),dt=t=>t.preventDefault(),ut=(t,e,n,o)=>{if(t&&e){let r=!0;return h(n,n=>{(o?o(t[n]):t[n])!==(o?o(e[n]):e[n])&&(r=!1)}),r}return!1},_t=(t,e)=>ut(t,e,["w","h"]),vt=(t,e)=>ut(t,e,["x","y"]),gt=(t,e)=>ut(t,e,["t","r","b","l"]),ht=(t,e,n)=>ut(t,e,["width","height"],n&&(t=>Math.round(t))),ft=()=>{},pt=(t,e,n)=>{let o,r;const i=l(e)&&e>0,s=l(n)&&n>0,a=i?window.clearTimeout:k,c=i?window.setTimeout:U,d=function(e){r=s?performance.now():0,o&&a(o),t.apply(this,e)};return function(){const t=d.bind(this,arguments),i=!!s&&performance.now()-r>=n;o&&a(o),o=i?t():c(t,e)}},wt={animationiterationcount:1,columncount:1,fillopacity:1,flexgrow:1,flexshrink:1,fontweight:1,lineheight:1,opacity:1,order:1,orphans:1,widows:1,zindex:1,zoom:1},bt=(t,e)=>{const n=e?parseFloat(t):parseInt(t,10);return Number.isNaN(n)?0:n},yt=(t,e,n)=>null!=e?e[n]||e.getPropertyValue(n):t.style[n],mt=(t,e,n)=>{try{if(t){const{style:o}=t;r(o[e])?o.setProperty(e,n):o[e]=((t,e)=>!wt[t.toLowerCase()]&&l(e)?e+"px":e)(e,n)}}catch(o){}};function St(t,e){const n=a(e);if(d(e)||n){let o=n?"":{};if(t){const r=window.getComputedStyle(t,null);o=n?yt(t,r,e):e.reduce((e,n)=>(e[n]=yt(t,r,n),e),o)}return o}h(S(e),n=>mt(t,n,e[n]))}const xt={x:0,y:0},zt=t=>{const e=t?rt(t):0;return e?{x:e.left+window.pageYOffset,y:e.top+window.pageXOffset}:xt};var Ct=function(t){var e={exports:{}};return t(e,e.exports),e.exports}((function(t){function e(){return t.exports=e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},e.apply(this,arguments)}t.exports=e}));const{stringify:Ot}=JSON,Mt=["__TPL_","_TYPE__"],It=["boolean","number","string","array","object","function","null"].reduce((t,e)=>(t[e]=Mt[0]+e+Mt[1],t),{}),Lt=(t,e,n,o,i)=>{const l={},c=Ct({},t);return h(S(e).filter(e=>m(t,e)),u=>{const _=r(n[u])?{}:n[u],g=t[u],f=e[u],w=v(f),b=i?i+".":"";if(w&&v(g)){const t=Lt(g,f,_,o,b+u);l[u]=t.M,c[u]=t.I,h([c,l],t=>{z(t[u])&&delete t[u]})}else if(!w){let t=!1;const e=[],n=[],i=s(g);if(h(d(f)?f:[f],o=>{let s;h(It,(t,e)=>{t===o&&(s=e)});const l=r(s);if(l&&a(g)){const n=o.split(" ");t=!!n.find(t=>t===g),p(e,n)}else t=It[i]===o;return p(n,l?It.string:s),!t}),t){(d(g)||v(g)?Ot(g)!==Ot(_):g!==_)&&(l[u]=g)}else o&&console.warn(`The option "${b}${u}" wasn't set, because it doesn't accept the type [ ${i.toUpperCase()} ] with the value of "${g}".\r\nAccepted types are: [ ${n.join(", ").toUpperCase()} ].\r\n${e.length>0?`\r\nValid strings are: [ ${e.join(", ")} ].`:""}`);delete c[u]}}),{I:c,M:l}},$t=(t,e,n,o)=>Lt(t,e,n||{},o||!1);let At;const{abs:Vt,round:Tt}=Math,Rt=(t,e)=>{P(t,e);const n=nt(e),o=et(e);return{x:o.h-n.h,y:o.w-n.w}},Pt=(t,e)=>{St(t,{overflowX:"hidden",overflowY:"hidden",direction:"rtl"}),M(t,0);const n=zt(t),o=zt(e);M(t,-999);const r=zt(e);return{i:n.x===o.x,n:o.x!==r.x}},jt=(t,e)=>{K(t,"os-environment-flexbox-glue");const n=rt(t),o=rt(e),r=ht(o,n,!0);K(t,"os-environment-flexbox-glue-max");const i=rt(t),s=rt(e),l=ht(s,i,!0);return r&&l},Et=()=>{const t=window.screen.deviceXDPI||0,e=window.screen.logicalXDPI||1;return window.devicePixelRatio||t/e},qt=()=>{const{body:t}=document,e=H('<div class="os-environment"><div></div></div>')[0],n=e.firstChild,o=new Set,r=Rt(t,e),i={x:0===r.x,y:0===r.y},s={L:!1,$:r,A:i,V:!1,T:"-1"===St(e,"zIndex"),R:Pt(e,n),P:jt(e,n),j(t){o.add(t)},q(t){o.delete(t)}};var l,a;if(a="style",(l=e)&&l.removeAttribute(a),q(e),!i.x||!i.y){let n=tt(),i=Et(),s=r;window.addEventListener("resize",()=>{if(o.size){const r=tt(),l={w:r.w-n.w,h:r.h-n.h};if(0===l.w&&0===l.h)return;const a={w:Vt(l.w),h:Vt(l.h)},c={w:Vt(Tt(r.w/(n.w/100))),h:Vt(Tt(r.h/(n.h/100)))},d=Et(),u=a.w>2&&a.h>2,_=!((t,e)=>{const n=Vt(t),o=Vt(e);return!(n===o||n+1===o||n-1===o)})(c.w,c.h),v=d!==i&&i>0;if(u&&_&&v){const n=At.$=Rt(t,e);q(e),s.x===n.x&&s.y===n.y||y(o),s=n}n=r,i=d}})}return s},Bt=()=>(At||(At=qt()),At),Ht=t=>{P(T(t),V(t)),q(t)};let Ft=0;const Dt=t=>{const n=function(t){const n=window.HTMLElement;return!!t&&(n?t instanceof n:t.nodeType===e)}(t),o=n?{}:{B:t.host,H:t.target,F:t.padding,D:t.viewport,G:t.content};if(n){const e=B("os-padding"),n=B("os-viewport"),r=B("os-content");P(e,n),P(n,r),o.H=t,o.F=e,o.D=n,o.G=r}let{H:i,F:s,D:l,G:a}=o;const c=[],d=A(i,"textarea"),u=!d&&A(i,"body"),_=d?o.B||B():i,v=t=>d?i:V(t);if(d&&_!==o.B&&(E(i,_),p(c,()=>{E(_,i),q(_)})),n)P(a,v(i)),P(_,s),p(c,()=>{P(_,V(a)),q(s),Q(_,"os-host")});else{const t=a||l||s||_,e=r(s),n=r(l),i=r(a),d=v(t);s=o.F=e?B():s,l=o.D=n?B():l,a=o.G=i?B():a,P(_,s),P(s||_,l),P(l,a);P(a||l,d),p(c,()=>{i&&Ht(a),n&&Ht(l),e&&Ht(s),Q(_,"os-host"),Q(s,"os-padding"),Q(l,"os-viewport"),Q(a,"os-content")})}K(_,"os-host"),K(s,"os-padding"),K(l,"os-viewport"),K(a,"os-content");const g=i.ownerDocument,h=g.body,f={N:g.defaultView,W:g,Y:T(h),k:h,U:d,X:u},w=Ct({},o,{B:_}),{V:b,A:m,T:S}=Bt();if(b)p(c,Q.bind(0,l,"os-viewport-scrollbar-styled"));else if(!S&&(m.x||m.y)){const t=(()=>{const t=document.createElement("style");return O(t,"id","os-viewport-arrange-"+Ft),Ft++,t})();z=t,R(T(x=l),x,z),p(c,q.bind(0,t)),w.J=t}var x,z;return{K:w,Z:f,tt:()=>{y(c)}}},Gt=e=>{const{et:n,nt:o,ot:r}=e,{B:i,F:s,D:l}=r.K,{_:a,m:c}=t(()=>((t,e,n)=>{const o=e?e+"-":"",r=n?"-"+n:"",i=`${o}top${r}`,s=`${o}right${r}`,l=`${o}bottom${r}`,a=`${o}left${r}`,c=St(t,[i,s,l,a]);return{t:bt(c[i]),r:bt(c[s]),b:bt(c[l]),l:bt(c[a])}})(i,"padding"),{o:gt});return(t,e,r)=>{let{v:i,p:d}=c(r);const{V:u}=Bt(),{rt:_,it:v}=t,{v:g,p:h}=v,{v:f,p}=e("paddingAbsolute");(_||d)&&({v:i,p:d}=a(r));const w=p||h||d;if(w){const{v:t}=a(r),e=!f||!s&&!u,i=t.r+t.l,c=t.t+t.b,d={marginTop:0,marginRight:0,marginBottom:e?-c:0,marginLeft:0,top:e?-t.t:0,right:0,bottom:0,left:0,maxWidth:e?`calc(100% + ${i}px)`:""},_={paddingTop:e?t.t:0,paddingRight:e?t.r:0,paddingBottom:e?t.b:0,paddingLeft:e?t.l:0};if(e){const e=g?"right":"left",n=g?"marginLeft":"marginRight",o=g?t.r:t.l;d[e]=-o,d[n]=-i}St(s||l,d),St(l,_),n({st:!e,F:t}),o(s?_:Ct({},d,_))}return{lt:w}}},Nt=e=>{const{ot:n,at:o,ct:r,dt:i,ut:s}=e,{B:l,F:a,D:c,J:d}=n.K,{_:u,m:_}=t(t=>h(t._t,t.vt,t.gt),{o:_t}),{_:v,m:g}=t(t=>({x:Math.max(0,t.ht.w-t.ft.w),y:Math.max(0,t.ht.h-t.ft.h)}),{o:vt,s:{x:0,y:0}}),h=(t,e,n)=>({w:t.w-Math.round(Math.max(0,n.width-e.w)),h:t.h-Math.round(Math.max(0,n.height-e.h))}),f=(t,e)=>{if(St(c,{height:""}),e){const{st:e,F:n}=i(),{pt:o,wt:r}=t,s=rt(l),a=et(l),d=nt(l),u=e?n.b+n.t:0,_=d.h+(s.height-a.h);St(c,{height:_+(o.x?r.x:0)-u})}},p=(t,e)=>{const{$:n,A:o,V:r}=Bt(),{x:i,y:s}=o,l=r||t?0:42,a=!e?St(c,["overflowX","overflowY"]):e,d={x:"scroll"===a.overflowX,y:"scroll"===a.overflowY};return{pt:d,wt:{x:d.x&&!r?i?l:n.x:0,y:d.y&&!r?s?l:n.y:0}}},w=(t,e,n)=>{if(o){const{wt:o}=t,{x:i,y:s}=o,l=r(),a=l[n?"paddingRight":"paddingLeft"],u=l.paddingTop,_={w:s?s+e.w-a+"px":"",h:i?i+e.h-u+"px":""};if(d){const{sheet:t}=d;if(t){const{cssRules:e}=t;if(e){e.length||t.insertRule(`#${O(d,"id")} + .os-viewport-arrange::before {}`,0);const n=e[0].style;n.width=_.w,n.height=_.h}}}else St(c,{"--viewport-arrange-width":_.w,"--viewport-arrange-height":_.h})}return o};return(t,e,n)=>{const{it:i,bt:d,rt:b,yt:y,St:m,lt:x}=t,{P:z,V:C,A:O}=Bt(),{v:M,p:I}=d,{v:L,p:$}=i,{v:A,p:V}=e("nativeScrollbarsOverlaid.show"),T=A&&O.x&&O.y,R=!z&&(b||m||y||V||I);let P,j=g(n),E=_(n);if(V&&C&&(T?Q(c,"os-viewport-scrollbar-styled"):K(c,"os-viewport-scrollbar-styled")),R&&(P=p(T),f(P,!!M)),b||x||m||V||$){const t=(()=>{if(o){const{P:t}=Bt();let e=r();t||(e=Ct({},e,{height:""}));const n=St(c,S(e));return Q(c,"os-viewport-arrange"),St(c,e),()=>{St(c,n),K(c,"os-viewport-arrange")}}return ft})(),e=nt(c),i=rt(c),s=et(c);let l=ot(c),a=e;const{v:d,p:_}=E=u(n,{gt:i,vt:s,_t:l});if(t(),(_||V)&&!T){w(P||p(T),d,L)&&(a=nt(c),l=h(ot(c),et(c),rt(c)))}j=v(n,{ht:{w:Math.max(d.w,l.w),h:Math.max(d.h,l.h)},ft:{w:a.w+Math.max(0,e.w-d.w),h:a.h+Math.max(0,e.h-d.h)}})}const{v:q,p:B}=e("overflow"),{v:H,p:F}=E,{v:D,p:G}=j;if(x||F||G||B||V||$||R){const t={marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,maxWidth:"",overflowY:"",overflowX:""},e=((t,e,n,o)=>{const r=(t,e,n,o)=>{const r="visible-scroll"===n,i=e>0&&("scroll"===n||"hidden"===n);return i&&(o[t?"overflowX":"overflowY"]=n),{xt:!i,zt:r?"scroll":"hidden"}},{xt:i,zt:s}=r(!0,e.x,n.x,o),{xt:l,zt:a}=r(!1,e.y,n.y,o);return i&&!l&&(o.overflowX=s),l&&!i&&(o.overflowY=a),p(t,o)})(T,D,q,t);((t,e,n,o)=>{const{V:i}=Bt(),{pt:s,wt:c}=t,{x:d,y:u}=c,{x:_,y:v}=s,g=r(),h=e?"marginLeft":"marginRight",f=e?"paddingLeft":"paddingRight",p=g[h],w=g.marginBottom,b=g[f],y=g.paddingBottom;o.maxWidth=`calc(100% + ${u+-1*p}px)`,o[h]=-u+p,o.marginBottom=-d+w,n&&(o[f]=b+u,o.paddingBottom=y+d),i||St(a||l,{overflow:_||v?"hidden":""})})(e,L,w(e,H,L),t),R&&f(e,!!M),St(c,t),s(e.pt)}}},Wt={direction:["rtl"]},Yt=t=>{let e=!1;return h(St(t,["direction"]),(t,n)=>{e=e||f(Wt[n],t)>-1}),e},kt=t=>t&&(t.height||t.width),Ut=(e,n,o)=>{const{Ct:r=!1,Ot:i=!1}=o||{},{R:s}=Bt(),l=H('<div class="os-size-observer"><div class="os-size-observer-listener"></div></div>')[0],a=l.firstChild,{_:c}=t(0,{u:!0,o:(t,e)=>!(!t||!kt(t)&&kt(e))}),u=t=>{const e=t&&"boolean"==typeof t.v;let o=!1;if(d(t)&&t.length>0){const{g:e,v:n,p:r}=c(0,t.pop().contentRect);o=!e||!kt(n)}else e&&t.p;if(r){const n=e?t.v:Yt(l);M(l,n?s.n?-3333333:s.i?0:3333333:3333333),I(l,3333333)}o||n(e?t:void 0)},_=[];let v,g=!!i&&u;if(Y){const t=new Y(u);t.observe(a),p(_,()=>t.disconnect())}else{const t=H('<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>');P(a,t),K(a,"os-size-observer-listener-scroll");const e=t[0],n=e.lastChild,o=e.firstChild,r=null==o?void 0:o.firstChild;let s,l=et(a),c=l,d=!1;const v=()=>{M(o,3333333),I(o,3333333),M(n,3333333),I(n,3333333)},h=()=>{s=0,d&&(l=c,u())},f=t=>(c=et(a),d=!t||!_t(c,l),t&&d&&!s?(k(s),s=U(h)):t||h(),v(),t&&(dt(t),ct(t)),!1);p(_,[at(o,"scroll",f),at(n,"scroll",f)]),St(r,{width:3333333,height:3333333}),v(),g=i?()=>f():v}if(r){v=t(()=>Yt(l));const{_:e}=v;p(_,at(l,"scroll",t=>{const n=e(),{v:o,p:r}=n;return r&&(St(a,o?{left:"auto",right:0}:{left:0,right:"auto"}),u(n)),dt(t),ct(t),!1}))}return g&&(K(l,"os-size-observer-appear"),p(_,at(l,"animationstart",g,{O:!!Y}))),j(e,l),{tt(){y(_),q(l)},Mt:t=>({it:v?v.m(t):{v:!1,g:!1,p:!1}})}},Xt=(t,e,n,o)=>{let i;const s=()=>{n.forEach((t,e)=>{lt(e,t,o)}),n.clear()},l=e=>{if(i){h(i.reduce((n,o)=>{if(o){const r=o[0],i=o[1],s=i&&r&&(e?e(r):$(r,t));s&&p(n,[s,c(i)?i(s):i],!0)}return n},[]),t=>{const e=t[0],i=t[1];h(e,t=>{((t,e)=>{const i=n.get(t),s=r(i),l=()=>{n.set(t,e),at(t,e,o)};s||e===i?s&&l():(lt(t,i,o),l())})(t,i)})})}},a=t=>{i=t,s(),l()};return e&&a(e),{tt:s,It:l,_:a}},Jt=(t,e,n)=>{let o=!1;const{Lt:r,$t:i,At:s,Vt:l,Tt:c,Rt:d,Pt:u}=n||{},{It:_,tt:v,_:g}=Xt(t,r&&l,new Map,pt(()=>{o&&e([],!1,!0)},84)),w=s||[],y=(i||[]).concat(w),m=o=>{const i=d||ft,s=u||ft,l=[],v=[];let g=!1,y=!1,m=!1;h(o,e=>{const{attributeName:o,target:d,type:u,oldValue:_,addedNodes:h}=e,b="attributes"===u,S="childList"===u,x=t===d,z=b&&a(o)?O(d,o):0,C=0!==z&&_!==z,M=C&&x&&!r&&!i(d,o,_,z),I=f(w,o)>-1&&C;if(M&&p(l,o),r){const r=!b,l=b&&I&&!x,a=l&&c&&A(d,c),u=(a?!i(d,o,_,z):r||l)&&!s(e,!!a,t,n);p(v,h),y=y||u,m=m||S}g=g||M&&I}),m&&!b(v)&&_(t=>v.reduce((e,n)=>(p(e,$(t,n)),A(n,t)?p(e,n):e),[])),(!b(l)||g||y)&&e(l,g,y)},S=new N(m);return S.observe(t,{attributes:!0,attributeOldValue:!0,attributeFilter:y,subtree:r,childList:r,characterData:r}),o=!0,{jt:()=>{o&&(v(),S.disconnect(),o=!1)},Et:t=>{g(o&&r&&t)},_:()=>{o&&m(S.takeRecords())}}},Kt=(t,e)=>t&&e.split(".").reduce((t,e)=>t&&m(t,e)?t[e]:void 0,t),Qt=["id","class","style","open"],Zt={st:!1,F:{t:0,r:0,b:0,l:0}},te={marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},ee={x:!1,y:!1},ne={v:!1,g:!1,p:!1},oe={v:!1,g:!1,p:!1},re=(e,n)=>{let o=Zt,r=te,i=ee;const{B:s,D:a,G:c}=n.K,{V:d,A:u,P:_,j:v,q:g}=Bt(),f=!d&&(u.x||u.y),w=[],b={qt:e,ot:n,at:f,dt:()=>o,et(t){o=t||Zt},ct:()=>r,nt(t){var e,n;r=t?(n=te,S(e=t).reduce((t,n)=>{const o=e[n];return t[n]=""===o?0:o,t},Ct({},n))):te},Bt:()=>i,ut(t){i=t||ee}};p(w,(t=>{const{ot:e}=t,{G:n}=e.K;return t=>{const{bt:e}=t,{v:o,p:r}=e;r&&St(n,{height:o?"auto":"100%"})}})(b)),p(w,Gt(b)),p(w,Nt(b));const m=(t,n,o)=>{let{it:r,bt:i,rt:s=o||!1,yt:c=o||!1,St:d=o||!1,lt:u=o||!1}=t||{};const v=r||(z?z.Mt(o).it:ne),g=i||(x?x.Mt(o).bt:oe),p=t=>({v:Kt(e,t),p:o||void 0!==Kt(n,t)}),b=f||!_,y=b&&M(a),m=b&&I(a);h(w,t=>{const{rt:e,yt:n,St:r,lt:i}=t({it:v,bt:g,rt:s,yt:c,St:d,lt:u},p,!!o)||{};s=e||s,c=n||c,d=r||d,u=i||u}),l(y)&&M(a,y),l(m)&&I(a,m)},x=c&&((e,n)=>{const o=H('<div class="os-trinsic-observer"></div>')[0],r=[],{_:i,m:s}=t(t=>0===t.h||t.isIntersecting||t.intersectionRatio>0,{s:!1});if(W){const t=new W(t=>{if(t&&t.length>0){const e=t.pop();if(e){const t=i(0,e);t.p&&n(t)}}},{root:e});t.observe(o),p(r,()=>t.disconnect())}else{const t=()=>{const t=et(o),e=i(0,t);e.p&&n(e)};p(r,Ut(o,t).tt),t()}return j(e,o),{tt(){y(r),q(o)},Mt:t=>({bt:s(t)})}})(s,t=>{m({bt:t})}),z=Ut(s,t=>{m({it:t,rt:!t})},{Ot:!0,Ct:!d}),C=(Jt(s,()=>{requestAnimationFrame(()=>{m({yt:!0})})},{At:Qt,$t:Qt}),Jt(c||a,()=>{requestAnimationFrame(()=>{m({St:!0})})},{Lt:!0,At:Qt,$t:Qt,Vt:e.updating.elementEvents}),(t,e)=>{m(null,t,e)}),O=C.bind(null,null,!0);return v(O),console.log("flexboxGlue",_),{_:C,tt(){g(O)}}},ie=It.number,se=[It.string,It.array,It.null],le=[!0,It.boolean],ae=[!1,It.boolean],ce={resize:["none","none both horizontal vertical"],paddingAbsolute:ae,updating:{elementEvents:[[["img","load"]],[It.array,It.null]],contentMutationDebounce:[80,ie],hostMutationDebounce:[0,ie],resizeDebounce:[0,ie]},overflow:{x:["scroll","visible-hidden visible-scroll scroll hidden"],y:["scroll","visible-hidden visible-scroll scroll hidden"]},scrollbars:{visibility:["auto","visible hidden auto"],autoHide:["never","never scroll leavemove"],autoHideDelay:[800,ie],dragScroll:le,clickScroll:ae,touch:le},textarea:{dynWidth:ae,dynHeight:ae,inheritedAttrs:[["style","class"],se]},nativeScrollbarsOverlaid:{show:ae,initialize:ae}},{Ht:de,qt:ue}=function t(e){const n={Ht:{},qt:{}};return h(S(e),o=>{const r=e[o];if(d(r))n.Ht[o]=r[1],n.qt[o]=r[0];else{const e=t(r);n.Ht[o]=e.Ht,n.qt[o]=e.qt}}),n}(ce),_e=(t,e,n)=>{const o=x({},ue,$t(e||{},de,null,!0).M),r=Dt(t),i=re(o,r),s={options(t){if(t){const{M:e}=$t(t,de,o,!0);z(e)||(x(o,e),i._(e))}return o},update(t){i._(null,t)}};return s.update(!0),s};export default()=>[Bt(),_e(document.body)]; |