aptechka 0.42.2 → 0.42.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +1 -1
- package/lib/source/index.cjs +2 -2
- package/lib/source/index.js +14 -14
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +20 -19
- package/package.json +1 -1
package/lib/scroll/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Be=Object.defineProperty;var Pe=Object.getOwnPropertySymbols;var _e=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable;var Ee=u=>{throw TypeError(u)};var we=(u,h,e)=>h in u?Be(u,h,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[h]=e,xe=(u,h)=>{for(var e in h||(h={}))_e.call(h,e)&&we(u,e,h[e]);if(Pe)for(var e of Pe(h))He.call(h,e)&&we(u,e,h[e]);return u};var be=(u,h,e)=>h.has(u)||Ee("Cannot "+e);var t=(u,h,e)=>(be(u,h,"read from private field"),e?e.call(u):h.get(u)),s=(u,h,e)=>h.has(u)?Ee("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(u):h.set(u,e),r=(u,h,e,i)=>(be(u,h,"write to private field"),i?i.call(u,e):h.set(u,e),e),c=(u,h,e)=>(be(u,h,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const We=require("../Store-C2J4Q87x.cjs"),Se=require("../browser-CpzFX2xg.cjs"),Fe=require("../easings-GegIwET5.cjs"),le=require("../events-KVanG9sR.cjs"),ze=require("../jss-GJLvaNfT.cjs"),zt=require("../layout-Ctc2p3uz.cjs"),ke=require("../math-GDWEqu7y.cjs"),$e=require("../polyfills-BANSrI_m.cjs");require("../ticker/index.cjs");const ce=require("../order/index.cjs"),Ne=require("../Damped-CHZ314Rn.cjs"),Ue=require("../Tweened-Dn6CMA-p.cjs"),oe=require("../controls/index.cjs"),kt=require("../window-resizer/index.cjs"),ft=require("../scroll-entries/index.cjs"),Le=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),Ge=require("../device/index.cjs"),Jt=require("../element-resizer/index.cjs"),Ze=require("../gestures-DHLrn6Q8.cjs"),Re=require("../dom-JBOkFLTh.cjs"),je=require("../function-MthRj-GJ.cjs"),Ke=require("../scroll-segment/index.cjs");var f,Qt,g,mt,V,J;class Je{constructor(h,e,i){s(this,f);s(this,Qt);s(this,g);s(this,mt,0);s(this,V,0);s(this,J,null);r(this,f,h),r(this,Qt,e),r(this,g,i),ft.scrollEntries.register(t(this,f))}get index(){return t(this,Qt)}get size(){return t(this,mt)}get position(){return t(this,V)}destroy(){ft.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null),this.setSize()}setSize(h){h?(t(this,f).style.setProperty("--size",h+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,f).style.width=h+"px",t(this,f).style.height=""):(t(this,f).style.height=h+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){r(this,mt,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),r(this,V,t(this,g).vertical?zt.getCumulativeOffsetTop(t(this,f)):zt.getCumulativeOffsetLeft(t(this,f))),r(this,V,t(this,V)-t(this,g).contentPosition)}transform(){let h=0;const e=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,g).overscroll&&t(this,V)+t(this,mt)<t(this,g).currentScrollValue&&(h=t(this,g).distance*-1-t(this,g).gap),ft.scrollEntries.update(t(this,f),t(this,g).axisCSSProperty.current,h);const i=t(this,g).currentScrollValue+h,n=t(this,V)-t(this,g).viewportSize-e,d=t(this,V)+t(this,mt)+e,b=ke.clamp(i,n,d);t(this,g).vertical?t(this,f).style.transform=`translate3d(0px, ${b*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${b*-1}px, 0px, 0px)`}mark(h){t(this,J)!==h&&(t(this,J)&&t(this,f).classList.remove(t(this,J)),h&&t(this,f).classList.add(h),r(this,J,h),le.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,J)},custom:!0}))}}f=new WeakMap,Qt=new WeakMap,g=new WeakMap,mt=new WeakMap,V=new WeakMap,J=new WeakMap;const Qe=ze.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"100%",height:"100%",overflow:"var(--overflow, initial)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,gt,x,Q,B,_,H,I,X,Y,W,tt,yt,q,v,vt,Ct,Pt,wt,Rt,T,Et,et,D,st,F,it,xt,rt,nt,ht,p,Tt,l,Xt,Yt,y,m,z,A,ot,M,P,w,It,lt,$,N,ct,qt,ut,U,Dt,O,E,o,fe,Kt,Lt,ue,ae,me,ge,k,At,Te,Mt,te,ye,ve,bt,de,ee;class Zt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,gt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,Q,new S.CSSProperty(this,"--reverse",!1));s(this,B,new S.CSSProperty(this,"--direction",0));s(this,_,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,H,new S.CSSProperty(this,"--split",!1));s(this,I,new S.CSSProperty(this,"--sectional",!1));s(this,X,new S.CSSProperty(this,"--tween-easing",!1));s(this,Y,new S.CSSProperty(this,"--tween-duration",!1));s(this,W,new S.CSSProperty(this,"--auto-size",!1));s(this,tt,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,yt,new S.CSSProperty(this,"--drag-inertion",1));s(this,q,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,vt,new S.CSSProperty(this,"--damping",20));s(this,Ct,new S.CSSProperty(this,"--mass",0));s(this,Pt,new S.CSSProperty(this,"--stiffness",0));s(this,wt,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Rt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,T,new S.CSSProperty(this,"--autoplay",0));s(this,Et,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,et,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,D,new S.CSSProperty(this,"--classes",!1));s(this,st,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,F,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,it,new S.CSSProperty(this,"--focus-delay",0));s(this,xt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,rt,new S.CSSProperty(this,"--disabled",!1));s(this,nt,new S.CSSProperty(this,"--hibernate",!1));s(this,ht,null);s(this,p,null);s(this,Tt,null);s(this,l,[]);s(this,Xt,0);s(this,Yt,0);s(this,y,0);s(this,m,0);s(this,z,0);s(this,A,null);s(this,ot,null);s(this,M,null);s(this,P,null);s(this,w,new We.Store(0));s(this,It,0);s(this,lt,0);s(this,$,!1);s(this,N,!0);s(this,ct,!0);s(this,qt);s(this,ut);s(this,U,new Ue.Tweened);s(this,Dt,!1);s(this,O,null);s(this,E,!1);s(this,k,()=>{if(t(this,nt).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,w).current;if(r(this,Xt,this.vertical?zt.getCumulativeOffsetTop(this):zt.getCumulativeOffsetLeft(this)),r(this,Yt,this.vertical?zt.getCumulativeOffsetTop(t(this,p)):zt.getCumulativeOffsetLeft(t(this,p))),r(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,W).current&&t(this,l).length){const n=t(this,q).current,d=(t(this,y)-t(this,z)*(n-1))/n;t(this,l).forEach(b=>{b.setSize(d)})}else t(this,l).forEach(n=>{n.setSize()});if(t(this,l).forEach(n=>{n.resize()}),t(this,_).current){r(this,m,t(this,y)*t(this,_).current);const n=t(this,m)+t(this,y);this.vertical?(t(this,p).style.width=n+"px",t(this,p).style.height="100%"):(t(this,p).style.height=n+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",r(this,m,t(this,p).offsetHeight-t(this,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",r(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const n=getComputedStyle(this),d=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);r(this,m,t(this,m)+d),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const n=t(this,l)[t(this,l).length-1],d=n.position+n.size-t(this,y),b=t(this,m)-d;r(this,lt,n.position+n.size+b)}else r(this,lt,t(this,m));if(t(this,I).current&&t(this,l).length){const n=t(this,l)[i];t(this,a).set(n.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});r(this,$,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,y)),this.classList.toggle("has-overflow",t(this,$)),t(this,$)?t(this,rt).current||c(this,o,ae).call(this):c(this,o,ue).call(this),t(this,At).call(this)});s(this,At,()=>{if(!t(this,$)||t(this,ct)||t(this,N))return;const e=this.currentScrollValue;if(r(this,It,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,w).current=c(this,o,de).call(this)}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;ft.scrollEntries.update(this,t(this,x).current,e)});s(this,Mt,(e,i)=>{t(this,gt).current&&(c(this,o,ye).call(this,Math.sign(i)||1),t(this,te).call(this,e,i))});s(this,te,(e,i)=>{if(t(this,B).current){if(t(this,B).current<0&&i>0)return;if(t(this,B).current>0&&i<0)return}if(t(this,ut)||t(this,U).unlistenAnimationFrame(),!t(this,T).current&&t(this,it).current&&(clearInterval(t(this,qt)),r(this,qt,setTimeout(()=>{const n=t(this,l)[c(this,o,de).call(this)];n&&this.scrollToSection(n.index,{tween:{duration:t(this,xt).current,easing:Fe.easeInOutExpo}})},t(this,it).current))),!(e.includes("drag")&&!Ge.device.isTouch&&!t(this,wt).current)){if(out&&(out.innerText=e+" "+i),t(this,I).current&&e!=="drag"){const n=Math.sign(i);if(t(this,l).length){const d={tween:t(this,X).current||t(this,Y).current?{easing:t(this,X).current||"easeInOutCubic",duration:t(this,Y).current||500}:void 0};t(this,Dt)?this.scrollToSection(t(this,w).current,d):this.shiftSections(n,d)}else t(this,a).shift(n*t(this,y))}else t(this,a).shift(i);r(this,Dt,e==="drag")}});s(this,ee,()=>{r(this,E,!0),this.hibernatedCSSProperty.current||c(this,o,ge).call(this)});if(Se.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Qe];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),r(this,ht,document.createElement("div")),t(this,ht).className="content-wrapper",r(this,p,document.createElement("div")),t(this,p).className="content",r(this,Tt,document.createElement("slot")),t(this,p).appendChild(t(this,Tt)),t(this,ht).appendChild(t(this,p)),e.appendChild(t(this,ht))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,gt)}get axisCSSProperty(){return t(this,x)}get reverseCSSProperty(){return t(this,Q)}get directionCSSProperty(){return t(this,B)}get pagesCSSProperty(){return t(this,_)}get splitCSSProperty(){return t(this,H)}get sectionalCSSProperty(){return t(this,I)}get easingCSSProperty(){return t(this,X)}get durationCSSProperty(){return t(this,Y)}get autoSizeCSSProperty(){return t(this,W)}get wheelMaxDeltaCSSProperty(){return t(this,tt)}get dragInertionCSSProperty(){return t(this,yt)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,vt)}get massCSSProperty(){return t(this,Ct)}get stiffnessCSSProperty(){return t(this,Pt)}get mouseDragCSSProperty(){return t(this,wt)}get sectionDistanceScaleCSSProperty(){return t(this,Rt)}get autoplayCSSProperty(){return t(this,T)}get autoplayPauseDurationCSSProperty(){return t(this,Et)}get autoplayUserDirectionCSSProperty(){return t(this,et)}get classesCSSProperty(){return t(this,D)}get currentIndexStartOffsetCSSProperty(){return t(this,st)}get currentIndexEndOffsetCSSProperty(){return t(this,F)}get focusDelayCSSProperty(){return t(this,it)}get focusDurationCSSProperty(){return t(this,xt)}get disabledCSSProperty(){return t(this,rt)}get hibernatedCSSProperty(){return t(this,nt)}get currentScrollValue(){return c(this,o,ve).call(this,"current")}get targetScrollValue(){return c(this,o,ve).call(this,"target")}get contentWrapperElement(){return t(this,ht)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,Xt)}get contentPosition(){return t(this,Yt)}get viewportSize(){return t(this,y)}get scrollSize(){return t(this,m)}get gap(){return t(this,z)}get counter(){return t(this,w)}get limit(){return Math.ceil(t(this,l).length-t(this,q).current)}get distance(){return t(this,lt)}get loopDistance(){return t(this,v).current?t(this,lt)+t(this,z):t(this,lt)}get hasOverflow(){return t(this,$)}get overscroll(){return t(this,It)}get scrollLine(){return t(this,O)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress<d?0:this.currentProgress>b?1:(this.currentProgress-d)/(b-d)}curve(e,i,n=0){return Math.sin(this.range(e,i,n)*Math.PI)}visible(e,i,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress>=d&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const n=t(this,w).current,d=c(this,o,Te).call(this,e),b=t(this,l)[n],C=t(this,l)[d];if(b&&C){let R=0;const pe=c(this,o,de).call(this),jt=t(this,l)[pe],Ve=jt?this.targetScrollValue-jt.position:0;t(this,v).current?d===0&&n===t(this,l).length-1?R=t(this,m)+t(this,y)-b.position+t(this,z):d===t(this,l).length-1&&n===0?R=C.position-(t(this,m)+t(this,y)+t(this,z)):R=C.position-b.position:R=C.position-b.position,this.shiftPosition(R-Ve,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,w).current+e,i)}setPosition(e,i){c(this,o,ye).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,ut)||(t(this,U).set(t(this,a).current,{equalize:!0}),t(this,U).set(e,xe({},i.tween)),r(this,ut,setTimeout(()=>{r(this,ut,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){ft.scrollEntries.register(this),r(this,a,new Ne.Damped(0,{damping:.01,min:0,order:ce.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),r(this,A,new oe.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Mt)),r(this,ot,new oe.KeyboardControls({element:this})),t(this,ot).changeEvent.subscribe(t(this,Mt)),r(this,M,new oe.DragControls({element:t(this,p)})),t(this,M).changeEvent.subscribe(t(this,Mt)),r(this,P,new oe.AutoplayControls({culling:this})),t(this,P).changeEvent.subscribe(t(this,te)),t(this,x).subscribe(()=>{c(this,o,fe).call(this)}),t(this,Q).subscribe(()=>{c(this,o,fe).call(this)}),t(this,tt).subscribe(e=>{t(this,A).axis=e.current?"max":t(this,x).current}),t(this,yt).subscribe(e=>{t(this,M).inertion=typeof e.current=="number"?e.current:1}),t(this,_).subscribe(()=>{t(this,E)&&t(this,k).call(this)}),t(this,H).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,Kt).call(this):c(this,o,Lt).call(this))}),t(this,I).subscribe(e=>{t(this,A).debounce=e.current,t(this,M).swipe=e.current,t(this,P).interval=e.current,t(this,E)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,Kt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Lt).call(this))}),t(this,W).subscribe(e=>{t(this,E)&&(t(this,k).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,Kt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Lt).call(this))}),t(this,q).subscribe(e=>{t(this,E)&&(t(this,k).call(this),c(this,o,bt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,E)&&(t(this,l).length||(t(this,H).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(r(this,It,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,vt).subscribe(e=>{t(this,a).damping=e.current}),t(this,Ct).subscribe(e=>{t(this,a).mass=e.current}),t(this,Pt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,T).subscribe(e=>{t(this,P).speed=e.current,!t(this,N)&&e.current&&!e.previous?t(this,P).connect():!e.current&&e.previous&&t(this,P).disconnect()}),t(this,et).subscribe(e=>{e.current||(t(this,P).direction=1)}),t(this,D).subscribe(e=>{t(this,E)&&c(this,o,bt).call(this)}),t(this,st).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,bt).call(this)}),t(this,F).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,bt).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,w).subscribe(e=>{t(this,l).length&&c(this,o,bt).call(this)}),t(this,U).subscribe(e=>{t(this,U).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,rt).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,ue).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,ae).call(this))}),t(this,nt).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,me).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,ge).call(this))}),t(this,gt).observe(),t(this,x).observe(),t(this,Q).observe(),t(this,B).observe(),t(this,_).observe(),t(this,H).observe(),t(this,I).observe(),t(this,X).observe(),t(this,Y).observe(),t(this,W).observe(),t(this,tt).observe(),t(this,yt).observe(),t(this,q).observe(),t(this,v).observe(),t(this,vt).observe(),t(this,Ct).observe(),t(this,Pt).observe(),t(this,wt).observe(),t(this,Rt).observe(),t(this,T).observe(),t(this,T).observe(),t(this,Et).observe(),t(this,et).observe(),t(this,D).observe(),t(this,st).observe(),t(this,F).observe(),t(this,it).observe(),t(this,xt).observe(),t(this,rt).observe(),t(this,nt).observe(),kt.windowResizer.subscribe(t(this,ee),ce.RESIZE_ORDER.LAST)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,gt).unobserve(),t(this,x).unobserve(),t(this,Q).unobserve(),t(this,B).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,I).unobserve(),t(this,X).unobserve(),t(this,Y).unobserve(),t(this,W).unobserve(),t(this,tt).unobserve(),t(this,yt).unobserve(),t(this,q).unobserve(),t(this,v).unobserve(),t(this,vt).unobserve(),t(this,Ct).unobserve(),t(this,Pt).unobserve(),t(this,wt).unobserve(),t(this,Rt).unobserve(),t(this,T).unobserve(),t(this,Et).unobserve(),t(this,et).unobserve(),t(this,D).unobserve(),t(this,st).unobserve(),t(this,F).unobserve(),t(this,it).unobserve(),t(this,xt).unobserve(),t(this,rt).unobserve(),t(this,nt).unobserve(),kt.windowResizer.unsubscribe(t(this,ee)),c(this,o,me).call(this)}}a=new WeakMap,gt=new WeakMap,x=new WeakMap,Q=new WeakMap,B=new WeakMap,_=new WeakMap,H=new WeakMap,I=new WeakMap,X=new WeakMap,Y=new WeakMap,W=new WeakMap,tt=new WeakMap,yt=new WeakMap,q=new WeakMap,v=new WeakMap,vt=new WeakMap,Ct=new WeakMap,Pt=new WeakMap,wt=new WeakMap,Rt=new WeakMap,T=new WeakMap,Et=new WeakMap,et=new WeakMap,D=new WeakMap,st=new WeakMap,F=new WeakMap,it=new WeakMap,xt=new WeakMap,rt=new WeakMap,nt=new WeakMap,ht=new WeakMap,p=new WeakMap,Tt=new WeakMap,l=new WeakMap,Xt=new WeakMap,Yt=new WeakMap,y=new WeakMap,m=new WeakMap,z=new WeakMap,A=new WeakMap,ot=new WeakMap,M=new WeakMap,P=new WeakMap,w=new WeakMap,It=new WeakMap,lt=new WeakMap,$=new WeakMap,N=new WeakMap,ct=new WeakMap,qt=new WeakMap,ut=new WeakMap,U=new WeakMap,Dt=new WeakMap,O=new WeakMap,E=new WeakMap,o=new WeakSet,fe=function(){const e=t(this,x).current,i=t(this,Q).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,A).axis=t(this,tt).current?"max":e,t(this,ot).dimension=e==="x"?"width":"height",t(this,M).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,k).call(this)},Kt=function(){c(this,o,Lt).call(this),t(this,Tt).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Je(e,i,this))}),t(this,p).style.transform="",le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,k).call(this),c(this,o,bt).call(this)},Lt=function(){t(this,l).forEach(e=>{e.destroy()}),r(this,l,[]),t(this,w).reset(),t(this,a).reset(),le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ue=function(){t(this,N)||(r(this,N,!0),t(this,a).unsubscribe(t(this,At)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,qt)),clearInterval(t(this,ut)),t(this,U).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,ot).disconnect(),t(this,M).disconnect(),t(this,P).disconnect(),t(this,$)||this.sections.forEach(e=>{e.unsetTransform()}))},ae=function(){t(this,N)&&(r(this,N,!1),t(this,a).subscribe(t(this,At)),t(this,A).connect(),t(this,ot).connect(),t(this,M).connect(),t(this,T).current&&t(this,P).connect())},me=function(){t(this,ct)||(r(this,ct,!0),kt.windowResizer.unsubscribe(t(this,k)),Jt.elementResizer.unsubscribe(t(this,k)),c(this,o,ue).call(this),t(this,p).style.transform="",t(this,p).style.height="",t(this,p).style.width="",this.classList.remove("has-overflow","start","end"),t(this,l).length?c(this,o,Lt).call(this):(t(this,w).reset(),t(this,a).reset()),ft.scrollEntries.unregister(this))},ge=function(){t(this,ct)&&(r(this,ct,!1),ft.scrollEntries.register(this),(t(this,v).current||t(this,H).current||t(this,v).current||t(this,W).current||t(this,I).current)&&c(this,o,Kt).call(this),c(this,o,ae).call(this),kt.windowResizer.subscribe(t(this,k),ce.RESIZE_ORDER.SCROLL),Jt.elementResizer.subscribe(this,t(this,k)))},k=new WeakMap,At=new WeakMap,Te=function(e){let i=t(this,w).current;return t(this,v).current?i=$e.loopNumber(e,t(this,l).length):i=ke.clamp(e,0,this.limit),i},Mt=new WeakMap,te=new WeakMap,ye=function(e=1){t(this,et).current&&(t(this,P).direction=e),t(this,T).current&&t(this,P).pauseAndContinue(t(this,Et).current,this.sectionalCSSProperty.current)},ve=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,m)+t(this,y)+t(this,z));return i<0?t(this,m)+i+t(this,y)+t(this,z):i}else return t(this,a)[e]},bt=function(){if(t(this,l).length){const e=t(this,w).current+t(this,st).current;if(e===0?r(this,O,"start"):e===this.limit?r(this,O,"end"):r(this,O,null),le.dispatchEvent(this,"scrollLine",{detail:{line:t(this,O)}}),t(this,D).current){this.classList.remove("end","start"),t(this,O)&&this.classList.add(t(this,O));const i=t(this,q).current+t(this,F).current;t(this,l).forEach((n,d)=>{const b=e-this.limit-1+t(this,F).current,C=e+i,R=this.sections.length-C;d>=e&&d<C||d<=b?n.mark("current"):d>=C&&d<C+R/2||d<=b+i?n.mark("next"):n.mark("previous")})}}},de=function(){let e=this.targetScrollValue,i=1/0,n=0;const d=t(this,a).direction;for(let b=0;b<t(this,l).length;b++){const C=t(this,l)[b];let R=t(this,Dt)?C.size*d*-1*.4:0,pe=C.position;const jt=Math.abs(pe+R-e);jt<i&&(i=jt,n=b)}return n},ee=new WeakMap;customElements.get("e-scroll")||customElements.define("e-scroll",Zt);var se;class Ce extends HTMLElement{constructor(){super(...arguments);s(this,se,null)}get scrollElement(){return t(this,se)}connectedCallback(){const e=Re.findParentElement(this,Zt);e instanceof Zt?r(this,se,e):console.error(this,"e-scroll not found")}}se=new WeakMap;var at,L,G,Z,Ot,Vt,dt,Bt,ie,re;class Ie extends Ce{constructor(){super();s(this,at,null);s(this,L,null);s(this,G,!1);s(this,Z,0);s(this,Ot,0);s(this,Vt,0);s(this,dt,()=>{r(this,G,this.offsetWidth>this.offsetHeight);const e=t(this,G)?this.offsetWidth:this.offsetHeight;r(this,Z,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),r(this,Z,Math.max(t(this,Z),30)),t(this,G)?(t(this,L).style.width=t(this,Z)+"px",t(this,L).style.height="100%"):(t(this,L).style.width="100%",t(this,L).style.height=t(this,Z)+"px"),r(this,Ot,e-t(this,Z)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Bt).call(this)});s(this,Bt,()=>{r(this,Vt,this.scrollElement.currentProgress*t(this,Ot)),t(this,G)?t(this,L).style.transform=`translate3d(${t(this,Vt)}px, 0px, 0px)`:t(this,L).style.transform=`translate3d(0px, ${t(this,Vt)}px, 0px)`});s(this,ie,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,re,e=>{document.documentElement.classList.add("grabbing"),Ze.setupDrag(d=>{const b=t(this,G)?d.x:d.y,C=this.scrollElement.distance/t(this,Ot),R=(b-n)*C;this.scrollElement.setPosition(i+R)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,n=t(this,G)?e.x:e.y});if(Se.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[ze.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],r(this,at,document.createElement("slot")),t(this,at).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,at))}}get thumbElement(){return t(this,L)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,at).assignedElements()[0]||t(this,at).firstElementChild;r(this,L,e),t(this,L).addEventListener("pointerdown",t(this,re)),kt.windowResizer.subscribe(t(this,dt),ce.RESIZE_ORDER.SCROLL),Jt.elementResizer.subscribe(this,t(this,dt)),Jt.elementResizer.subscribe(this.scrollElement,t(this,dt)),this.scrollElement.onScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.subscribe(t(this,ie))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,L).removeEventListener("pointerdown",t(this,re)),kt.windowResizer.unsubscribe(t(this,dt)),Jt.elementResizer.unsubscribe(t(this,dt)),this.scrollElement.offScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,ie))}}at=new WeakMap,L=new WeakMap,G=new WeakMap,Z=new WeakMap,Ot=new WeakMap,Vt=new WeakMap,dt=new WeakMap,Bt=new WeakMap,ie=new WeakMap,re=new WeakMap;customElements.get("e-scrollbar")||customElements.define("e-scrollbar",Ie);var _t,Ht,Wt;class qe extends Ce{constructor(){super();s(this,_t,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Ht,new S.CSSProperty(this,"--tween-easing",!1));s(this,Wt,new S.CSSProperty(this,"--tween-duration",0));Se.isBrowser&&this.addEventListener("click",()=>{const e=t(this,_t).current,i=t(this,Ht).current,n=t(this,Wt).current;this.handleClick({behaviour:e,tween:i||n?{easing:i,duration:n}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,_t).observe(),t(this,Ht).observe(),t(this,Wt).observe()}disconnectedCallback(){t(this,_t).close(),t(this,Ht).close(),t(this,Wt).close()}}_t=new WeakMap,Ht=new WeakMap,Wt=new WeakMap;var Ft;class De extends qe{constructor(){super(...arguments);s(this,Ft,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Ft).current,e)}connectedCallback(){super.connectedCallback(),t(this,Ft).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Ft).close()}}Ft=new WeakMap;customElements.get("e-scroll-set-button")||customElements.define("e-scroll-set-button",De);var j,$t;class Ae extends qe{constructor(){super(...arguments);s(this,j,new S.CSSProperty(this,"--step",1));s(this,$t,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,j).current>0&&this.scrollElement.scrollLine==="end"||t(this,j).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,j).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,j).subscribe(()=>{t(this,$t).call(this)}),t(this,j).observe(),this.scrollElement.addEventListener("scrollLine",t(this,$t)),t(this,$t).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,j).close(),this.removeAttribute("disabled")}}j=new WeakMap,$t=new WeakMap;customElements.get("e-scroll-step-button")||customElements.define("e-scroll-step-button",Ae);var K,St,Nt,ne,he,Ut;class Xe{constructor(h,e,i){s(this,K,null);s(this,St,null);s(this,Nt,null);s(this,ne,null);s(this,he,()=>{t(this,St).scrollToSection(t(this,Nt),{behaviour:t(this,ne)})});s(this,Ut,()=>{t(this,K).classList.toggle("current",t(this,St).counter.current===t(this,Nt))});Se.isBrowser&&(r(this,K,document.createElement("button")),r(this,St,h),r(this,ne,i),r(this,Nt,e),t(this,K).addEventListener("click",t(this,he)),t(this,St).counter.subscribe(t(this,Ut)),t(this,Ut).call(this))}get element(){return t(this,K)}destroy(){t(this,K).removeEventListener("click",t(this,he)),t(this,St).counter.unsubscribe(t(this,Ut)),t(this,K).remove()}}K=new WeakMap,St=new WeakMap,Nt=new WeakMap,ne=new WeakMap,he=new WeakMap,Ut=new WeakMap;var pt,Gt;class Me extends Ce{constructor(){super(...arguments);s(this,pt,[]);s(this,Gt,je.debounce(()=>{t(this,pt).forEach(e=>e.destroy()),r(this,pt,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Xe(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,pt).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Gt)),t(this,Gt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Gt)),t(this,pt).forEach(e=>e.destroy()),r(this,pt,[])}}pt=new WeakMap,Gt=new WeakMap;customElements.get("e-scroll-bullet-buttons")||customElements.define("e-scroll-bullet-buttons",Me);class Oe extends Ke.ScrollSegmentElement{connectedCallback(){const h=Re.findParentElement(this,Zt);h instanceof Zt?(this.scrollContainer=h,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}customElements.get("e-scroll-segment")||customElements.define("e-scroll-segment",Oe);exports.ScrollBulletButtonsElement=Me;exports.ScrollElement=Zt;exports.ScrollSegmentElement=Oe;exports.ScrollSetButtonElement=De;exports.ScrollStepButtonElement=Ae;exports.ScrollbarElement=Ie;
|
|
1
|
+
"use strict";var Be=Object.defineProperty;var Pe=Object.getOwnPropertySymbols;var _e=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable;var Ee=u=>{throw TypeError(u)};var we=(u,h,e)=>h in u?Be(u,h,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[h]=e,xe=(u,h)=>{for(var e in h||(h={}))_e.call(h,e)&&we(u,e,h[e]);if(Pe)for(var e of Pe(h))He.call(h,e)&&we(u,e,h[e]);return u};var be=(u,h,e)=>h.has(u)||Ee("Cannot "+e);var t=(u,h,e)=>(be(u,h,"read from private field"),e?e.call(u):h.get(u)),s=(u,h,e)=>h.has(u)?Ee("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(u):h.set(u,e),r=(u,h,e,i)=>(be(u,h,"write to private field"),i?i.call(u,e):h.set(u,e),e),c=(u,h,e)=>(be(u,h,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const We=require("../Store-C2J4Q87x.cjs"),Se=require("../browser-CpzFX2xg.cjs"),Fe=require("../easings-GegIwET5.cjs"),le=require("../events-KVanG9sR.cjs"),ze=require("../jss-GJLvaNfT.cjs"),zt=require("../layout-Ctc2p3uz.cjs"),ke=require("../math-GDWEqu7y.cjs"),$e=require("../polyfills-BANSrI_m.cjs");require("../ticker/index.cjs");const ce=require("../order/index.cjs"),Ne=require("../Damped-CHZ314Rn.cjs"),Ue=require("../Tweened-Dn6CMA-p.cjs"),oe=require("../controls/index.cjs"),kt=require("../window-resizer/index.cjs"),ft=require("../scroll-entries/index.cjs"),Le=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),Ge=require("../device/index.cjs"),Jt=require("../element-resizer/index.cjs"),Ze=require("../gestures-DHLrn6Q8.cjs"),Re=require("../dom-JBOkFLTh.cjs"),je=require("../function-MthRj-GJ.cjs"),Ke=require("../scroll-segment/index.cjs");var f,Qt,g,mt,V,J;class Je{constructor(h,e,i){s(this,f);s(this,Qt);s(this,g);s(this,mt,0);s(this,V,0);s(this,J,null);r(this,f,h),r(this,Qt,e),r(this,g,i),ft.scrollEntries.register(t(this,f))}get index(){return t(this,Qt)}get size(){return t(this,mt)}get position(){return t(this,V)}destroy(){ft.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null),this.setSize()}setSize(h){h?(t(this,f).style.setProperty("--size",h+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,f).style.width=h+"px",t(this,f).style.height=""):(t(this,f).style.height=h+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){r(this,mt,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),r(this,V,t(this,g).vertical?zt.getCumulativeOffsetTop(t(this,f)):zt.getCumulativeOffsetLeft(t(this,f))),r(this,V,t(this,V)-t(this,g).contentPosition)}transform(){let h=0;const e=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,g).overscroll&&t(this,V)+t(this,mt)<t(this,g).currentScrollValue&&(h=t(this,g).distance*-1-t(this,g).gap),ft.scrollEntries.update(t(this,f),t(this,g).axisCSSProperty.current,h);const i=t(this,g).currentScrollValue+h,n=t(this,V)-t(this,g).viewportSize-e,d=t(this,V)+t(this,mt)+e,b=ke.clamp(i,n,d);t(this,g).vertical?t(this,f).style.transform=`translate3d(0px, ${b*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${b*-1}px, 0px, 0px)`}mark(h){t(this,J)!==h&&(t(this,J)&&t(this,f).classList.remove(t(this,J)),h&&t(this,f).classList.add(h),r(this,J,h),le.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,J)},custom:!0}))}}f=new WeakMap,Qt=new WeakMap,g=new WeakMap,mt=new WeakMap,V=new WeakMap,J=new WeakMap;const Qe=ze.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"100%",height:"100%",overflow:"var(--overflow, initial)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,gt,x,Q,B,_,H,T,X,Y,W,tt,yt,q,v,vt,Ct,Pt,wt,Rt,I,Et,et,D,st,F,it,xt,rt,nt,ht,p,It,l,Xt,Yt,y,m,z,A,ot,M,P,w,Tt,lt,$,N,ct,qt,ut,U,Dt,O,E,o,fe,Kt,Lt,ue,ae,me,ge,k,At,Ie,Mt,te,ye,ve,bt,de,ee;class Zt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,gt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,Q,new S.CSSProperty(this,"--reverse",!1));s(this,B,new S.CSSProperty(this,"--direction",0));s(this,_,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,H,new S.CSSProperty(this,"--split",!1));s(this,T,new S.CSSProperty(this,"--sectional",!1));s(this,X,new S.CSSProperty(this,"--tween-easing",!1));s(this,Y,new S.CSSProperty(this,"--tween-duration",!1));s(this,W,new S.CSSProperty(this,"--auto-size",!1));s(this,tt,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,yt,new S.CSSProperty(this,"--drag-inertion",1));s(this,q,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,vt,new S.CSSProperty(this,"--damping",20));s(this,Ct,new S.CSSProperty(this,"--mass",0));s(this,Pt,new S.CSSProperty(this,"--stiffness",0));s(this,wt,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Rt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,I,new S.CSSProperty(this,"--autoplay",0));s(this,Et,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,et,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,D,new S.CSSProperty(this,"--classes",!1));s(this,st,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,F,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,it,new S.CSSProperty(this,"--focus-delay",0));s(this,xt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,rt,new S.CSSProperty(this,"--disabled",!1));s(this,nt,new S.CSSProperty(this,"--hibernate",!1));s(this,ht,null);s(this,p,null);s(this,It,null);s(this,l,[]);s(this,Xt,0);s(this,Yt,0);s(this,y,0);s(this,m,0);s(this,z,0);s(this,A,null);s(this,ot,null);s(this,M,null);s(this,P,null);s(this,w,new We.Store(0));s(this,Tt,0);s(this,lt,0);s(this,$,!1);s(this,N,!0);s(this,ct,!0);s(this,qt);s(this,ut);s(this,U,new Ue.Tweened);s(this,Dt,!1);s(this,O,null);s(this,E,!1);s(this,k,()=>{if(t(this,nt).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,w).current;if(r(this,Xt,this.vertical?zt.getCumulativeOffsetTop(this):zt.getCumulativeOffsetLeft(this)),r(this,Yt,this.vertical?zt.getCumulativeOffsetTop(t(this,p)):zt.getCumulativeOffsetLeft(t(this,p))),r(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,W).current&&t(this,l).length){const n=t(this,q).current,d=(t(this,y)-t(this,z)*(n-1))/n;t(this,l).forEach(b=>{b.setSize(d)})}else t(this,l).forEach(n=>{n.setSize()});if(t(this,l).forEach(n=>{n.resize()}),t(this,_).current){r(this,m,t(this,y)*t(this,_).current);const n=t(this,m)+t(this,y);this.vertical?(t(this,p).style.width=n+"px",t(this,p).style.height="100%"):(t(this,p).style.height=n+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",r(this,m,t(this,p).offsetHeight-t(this,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",r(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const n=getComputedStyle(this),d=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);r(this,m,t(this,m)+d),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const n=t(this,l)[t(this,l).length-1],d=n.position+n.size-t(this,y),b=t(this,m)-d;r(this,lt,n.position+n.size+b)}else r(this,lt,t(this,m));if(t(this,T).current&&t(this,l).length){const n=t(this,l)[i];t(this,a).set(n.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});r(this,$,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,y)),this.classList.toggle("has-overflow",t(this,$)),t(this,$)?t(this,rt).current||c(this,o,ae).call(this):c(this,o,ue).call(this),t(this,At).call(this)});s(this,At,()=>{if(!t(this,$)||t(this,ct)||t(this,N))return;const e=this.currentScrollValue;if(r(this,Tt,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,w).current=c(this,o,de).call(this)}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;ft.scrollEntries.update(this,t(this,x).current,e)});s(this,Mt,(e,i)=>{t(this,gt).current&&(c(this,o,ye).call(this,Math.sign(i)||1),t(this,te).call(this,e,i))});s(this,te,(e,i)=>{if(t(this,B).current){if(t(this,B).current<0&&i>0)return;if(t(this,B).current>0&&i<0)return}if(t(this,ut)||t(this,U).unlistenAnimationFrame(),!t(this,I).current&&t(this,it).current&&(clearInterval(t(this,qt)),r(this,qt,setTimeout(()=>{const n=t(this,l)[c(this,o,de).call(this)];n&&this.scrollToSection(n.index,{tween:{duration:t(this,xt).current,easing:Fe.easeInOutExpo}})},t(this,it).current))),!(e.includes("drag")&&!Ge.device.isTouch&&!t(this,wt).current)){if(t(this,T).current&&e!=="drag"){const n=Math.sign(i);if(t(this,l).length){const d={tween:t(this,X).current||t(this,Y).current?{easing:t(this,X).current||"easeInOutCubic",duration:t(this,Y).current||500}:void 0};t(this,Dt)?this.scrollToSection(t(this,w).current,d):this.shiftSections(n,d)}else t(this,a).shift(n*t(this,y))}else t(this,a).shift(i);r(this,Dt,e==="drag")}});s(this,ee,()=>{r(this,E,!0),this.hibernatedCSSProperty.current||c(this,o,ge).call(this)});if(Se.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Qe];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),r(this,ht,document.createElement("div")),t(this,ht).className="content-wrapper",r(this,p,document.createElement("div")),t(this,p).className="content",r(this,It,document.createElement("slot")),t(this,p).appendChild(t(this,It)),t(this,ht).appendChild(t(this,p)),e.appendChild(t(this,ht))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,gt)}get axisCSSProperty(){return t(this,x)}get reverseCSSProperty(){return t(this,Q)}get directionCSSProperty(){return t(this,B)}get pagesCSSProperty(){return t(this,_)}get splitCSSProperty(){return t(this,H)}get sectionalCSSProperty(){return t(this,T)}get easingCSSProperty(){return t(this,X)}get durationCSSProperty(){return t(this,Y)}get autoSizeCSSProperty(){return t(this,W)}get wheelMaxDeltaCSSProperty(){return t(this,tt)}get dragInertionCSSProperty(){return t(this,yt)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,vt)}get massCSSProperty(){return t(this,Ct)}get stiffnessCSSProperty(){return t(this,Pt)}get mouseDragCSSProperty(){return t(this,wt)}get sectionDistanceScaleCSSProperty(){return t(this,Rt)}get autoplayCSSProperty(){return t(this,I)}get autoplayPauseDurationCSSProperty(){return t(this,Et)}get autoplayUserDirectionCSSProperty(){return t(this,et)}get classesCSSProperty(){return t(this,D)}get currentIndexStartOffsetCSSProperty(){return t(this,st)}get currentIndexEndOffsetCSSProperty(){return t(this,F)}get focusDelayCSSProperty(){return t(this,it)}get focusDurationCSSProperty(){return t(this,xt)}get disabledCSSProperty(){return t(this,rt)}get hibernatedCSSProperty(){return t(this,nt)}get currentScrollValue(){return c(this,o,ve).call(this,"current")}get targetScrollValue(){return c(this,o,ve).call(this,"target")}get contentWrapperElement(){return t(this,ht)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,Xt)}get contentPosition(){return t(this,Yt)}get viewportSize(){return t(this,y)}get scrollSize(){return t(this,m)}get gap(){return t(this,z)}get counter(){return t(this,w)}get limit(){return Math.ceil(t(this,l).length-t(this,q).current)}get distance(){return t(this,lt)}get loopDistance(){return t(this,v).current?t(this,lt)+t(this,z):t(this,lt)}get hasOverflow(){return t(this,$)}get overscroll(){return t(this,Tt)}get scrollLine(){return t(this,O)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress<d?0:this.currentProgress>b?1:(this.currentProgress-d)/(b-d)}curve(e,i,n=0){return Math.sin(this.range(e,i,n)*Math.PI)}visible(e,i,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress>=d&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const n=t(this,w).current,d=c(this,o,Ie).call(this,e),b=t(this,l)[n],C=t(this,l)[d];if(b&&C){let R=0;const pe=c(this,o,de).call(this),jt=t(this,l)[pe],Ve=jt?this.targetScrollValue-jt.position:0;t(this,v).current?d===0&&n===t(this,l).length-1?R=t(this,m)+t(this,y)-b.position+t(this,z):d===t(this,l).length-1&&n===0?R=C.position-(t(this,m)+t(this,y)+t(this,z)):R=C.position-b.position:R=C.position-b.position,this.shiftPosition(R-Ve,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,w).current+e,i)}setPosition(e,i){c(this,o,ye).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,ut)||(t(this,U).set(t(this,a).current,{equalize:!0}),t(this,U).set(e,xe({},i.tween)),r(this,ut,setTimeout(()=>{r(this,ut,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){ft.scrollEntries.register(this),r(this,a,new Ne.Damped(0,{damping:.01,min:0,order:ce.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),r(this,A,new oe.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Mt)),r(this,ot,new oe.KeyboardControls({element:this})),t(this,ot).changeEvent.subscribe(t(this,Mt)),r(this,M,new oe.DragControls({element:t(this,p)})),t(this,M).changeEvent.subscribe(t(this,Mt)),r(this,P,new oe.AutoplayControls({culling:this})),t(this,P).changeEvent.subscribe(t(this,te)),t(this,x).subscribe(()=>{c(this,o,fe).call(this)}),t(this,Q).subscribe(()=>{c(this,o,fe).call(this)}),t(this,tt).subscribe(e=>{t(this,A).axis=e.current?"max":t(this,x).current}),t(this,yt).subscribe(e=>{t(this,M).inertion=typeof e.current=="number"?e.current:1}),t(this,_).subscribe(()=>{t(this,E)&&t(this,k).call(this)}),t(this,H).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,Kt).call(this):c(this,o,Lt).call(this))}),t(this,T).subscribe(e=>{t(this,A).debounce=e.current,t(this,M).swipe=e.current,t(this,P).interval=e.current,t(this,E)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,Kt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Lt).call(this))}),t(this,W).subscribe(e=>{t(this,E)&&(t(this,k).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,Kt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Lt).call(this))}),t(this,q).subscribe(e=>{t(this,E)&&(t(this,k).call(this),c(this,o,bt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,E)&&(t(this,l).length||(t(this,H).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(r(this,Tt,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,vt).subscribe(e=>{t(this,a).damping=e.current}),t(this,Ct).subscribe(e=>{t(this,a).mass=e.current}),t(this,Pt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,I).subscribe(e=>{t(this,P).speed=e.current,!t(this,N)&&e.current&&!e.previous?t(this,P).connect():!e.current&&e.previous&&t(this,P).disconnect()}),t(this,et).subscribe(e=>{e.current||(t(this,P).direction=1)}),t(this,D).subscribe(e=>{t(this,E)&&c(this,o,bt).call(this)}),t(this,st).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,bt).call(this)}),t(this,F).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,bt).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,w).subscribe(e=>{t(this,l).length&&c(this,o,bt).call(this)}),t(this,U).subscribe(e=>{t(this,U).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,rt).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,ue).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,ae).call(this))}),t(this,nt).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,me).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,ge).call(this))}),t(this,gt).observe(),t(this,x).observe(),t(this,Q).observe(),t(this,B).observe(),t(this,_).observe(),t(this,H).observe(),t(this,T).observe(),t(this,X).observe(),t(this,Y).observe(),t(this,W).observe(),t(this,tt).observe(),t(this,yt).observe(),t(this,q).observe(),t(this,v).observe(),t(this,vt).observe(),t(this,Ct).observe(),t(this,Pt).observe(),t(this,wt).observe(),t(this,Rt).observe(),t(this,I).observe(),t(this,I).observe(),t(this,Et).observe(),t(this,et).observe(),t(this,D).observe(),t(this,st).observe(),t(this,F).observe(),t(this,it).observe(),t(this,xt).observe(),t(this,rt).observe(),t(this,nt).observe(),kt.windowResizer.subscribe(t(this,ee),ce.RESIZE_ORDER.LAST)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,gt).unobserve(),t(this,x).unobserve(),t(this,Q).unobserve(),t(this,B).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,T).unobserve(),t(this,X).unobserve(),t(this,Y).unobserve(),t(this,W).unobserve(),t(this,tt).unobserve(),t(this,yt).unobserve(),t(this,q).unobserve(),t(this,v).unobserve(),t(this,vt).unobserve(),t(this,Ct).unobserve(),t(this,Pt).unobserve(),t(this,wt).unobserve(),t(this,Rt).unobserve(),t(this,I).unobserve(),t(this,Et).unobserve(),t(this,et).unobserve(),t(this,D).unobserve(),t(this,st).unobserve(),t(this,F).unobserve(),t(this,it).unobserve(),t(this,xt).unobserve(),t(this,rt).unobserve(),t(this,nt).unobserve(),kt.windowResizer.unsubscribe(t(this,ee)),c(this,o,me).call(this)}}a=new WeakMap,gt=new WeakMap,x=new WeakMap,Q=new WeakMap,B=new WeakMap,_=new WeakMap,H=new WeakMap,T=new WeakMap,X=new WeakMap,Y=new WeakMap,W=new WeakMap,tt=new WeakMap,yt=new WeakMap,q=new WeakMap,v=new WeakMap,vt=new WeakMap,Ct=new WeakMap,Pt=new WeakMap,wt=new WeakMap,Rt=new WeakMap,I=new WeakMap,Et=new WeakMap,et=new WeakMap,D=new WeakMap,st=new WeakMap,F=new WeakMap,it=new WeakMap,xt=new WeakMap,rt=new WeakMap,nt=new WeakMap,ht=new WeakMap,p=new WeakMap,It=new WeakMap,l=new WeakMap,Xt=new WeakMap,Yt=new WeakMap,y=new WeakMap,m=new WeakMap,z=new WeakMap,A=new WeakMap,ot=new WeakMap,M=new WeakMap,P=new WeakMap,w=new WeakMap,Tt=new WeakMap,lt=new WeakMap,$=new WeakMap,N=new WeakMap,ct=new WeakMap,qt=new WeakMap,ut=new WeakMap,U=new WeakMap,Dt=new WeakMap,O=new WeakMap,E=new WeakMap,o=new WeakSet,fe=function(){const e=t(this,x).current,i=t(this,Q).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,A).axis=t(this,tt).current?"max":e,t(this,ot).dimension=e==="x"?"width":"height",t(this,M).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,k).call(this)},Kt=function(){c(this,o,Lt).call(this),t(this,It).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Je(e,i,this))}),t(this,p).style.transform="",le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,k).call(this),c(this,o,bt).call(this)},Lt=function(){t(this,l).forEach(e=>{e.destroy()}),r(this,l,[]),t(this,w).reset(),t(this,a).reset(),le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ue=function(){t(this,N)||(r(this,N,!0),t(this,a).unsubscribe(t(this,At)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,qt)),clearInterval(t(this,ut)),t(this,U).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,ot).disconnect(),t(this,M).disconnect(),t(this,P).disconnect(),t(this,$)||this.sections.forEach(e=>{e.unsetTransform()}))},ae=function(){t(this,N)&&(r(this,N,!1),t(this,a).subscribe(t(this,At)),t(this,A).connect(),t(this,ot).connect(),t(this,M).connect(),t(this,I).current&&t(this,P).connect())},me=function(){t(this,ct)||(r(this,ct,!0),kt.windowResizer.unsubscribe(t(this,k)),Jt.elementResizer.unsubscribe(t(this,k)),c(this,o,ue).call(this),t(this,p).style.transform="",t(this,p).style.height="",t(this,p).style.width="",this.classList.remove("has-overflow","start","end"),t(this,l).length?c(this,o,Lt).call(this):(t(this,w).reset(),t(this,a).reset()),ft.scrollEntries.unregister(this))},ge=function(){t(this,ct)&&(r(this,ct,!1),ft.scrollEntries.register(this),(t(this,v).current||t(this,H).current||t(this,v).current||t(this,W).current||t(this,T).current)&&c(this,o,Kt).call(this),c(this,o,ae).call(this),kt.windowResizer.subscribe(t(this,k),ce.RESIZE_ORDER.SCROLL),Jt.elementResizer.subscribe(this,t(this,k)))},k=new WeakMap,At=new WeakMap,Ie=function(e){let i=t(this,w).current;return t(this,v).current?i=$e.loopNumber(e,t(this,l).length):i=ke.clamp(e,0,this.limit),i},Mt=new WeakMap,te=new WeakMap,ye=function(e=1){t(this,et).current&&(t(this,P).direction=e),t(this,I).current&&t(this,P).pauseAndContinue(t(this,Et).current,this.sectionalCSSProperty.current)},ve=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,m)+t(this,y)+t(this,z));return i<0?t(this,m)+i+t(this,y)+t(this,z):i}else return t(this,a)[e]},bt=function(){if(t(this,l).length){const e=t(this,w).current+t(this,st).current;if(e===0?r(this,O,"start"):e===this.limit?r(this,O,"end"):r(this,O,null),le.dispatchEvent(this,"scrollLine",{detail:{line:t(this,O)}}),t(this,D).current){this.classList.remove("end","start"),t(this,O)&&this.classList.add(t(this,O));const i=t(this,q).current+t(this,F).current;t(this,l).forEach((n,d)=>{const b=e-this.limit-1+t(this,F).current,C=e+i,R=this.sections.length-C;d>=e&&d<C||d<=b?n.mark("current"):d>=C&&d<C+R/2||d<=b+i?n.mark("next"):n.mark("previous")})}}},de=function(){let e=this.targetScrollValue,i=1/0,n=0;const d=t(this,a).direction;for(let b=0;b<t(this,l).length;b++){const C=t(this,l)[b];let R=t(this,Dt)?C.size*d*-1*.4:0,pe=C.position;const jt=Math.abs(pe+R-e);jt<i&&(i=jt,n=b)}return n},ee=new WeakMap;customElements.get("e-scroll")||customElements.define("e-scroll",Zt);var se;class Ce extends HTMLElement{constructor(){super(...arguments);s(this,se,null)}get scrollElement(){return t(this,se)}connectedCallback(){const e=Re.findParentElement(this,Zt);e instanceof Zt?r(this,se,e):console.error(this,"e-scroll not found")}}se=new WeakMap;var at,L,G,Z,Ot,Vt,dt,Bt,ie,re;class Te extends Ce{constructor(){super();s(this,at,null);s(this,L,null);s(this,G,!1);s(this,Z,0);s(this,Ot,0);s(this,Vt,0);s(this,dt,()=>{r(this,G,this.offsetWidth>this.offsetHeight);const e=t(this,G)?this.offsetWidth:this.offsetHeight;r(this,Z,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),r(this,Z,Math.max(t(this,Z),30)),t(this,G)?(t(this,L).style.width=t(this,Z)+"px",t(this,L).style.height="100%"):(t(this,L).style.width="100%",t(this,L).style.height=t(this,Z)+"px"),r(this,Ot,e-t(this,Z)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Bt).call(this)});s(this,Bt,()=>{r(this,Vt,this.scrollElement.currentProgress*t(this,Ot)),t(this,G)?t(this,L).style.transform=`translate3d(${t(this,Vt)}px, 0px, 0px)`:t(this,L).style.transform=`translate3d(0px, ${t(this,Vt)}px, 0px)`});s(this,ie,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,re,e=>{document.documentElement.classList.add("grabbing"),Ze.setupDrag(d=>{const b=t(this,G)?d.x:d.y,C=this.scrollElement.distance/t(this,Ot),R=(b-n)*C;this.scrollElement.setPosition(i+R)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,n=t(this,G)?e.x:e.y});if(Se.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[ze.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],r(this,at,document.createElement("slot")),t(this,at).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,at))}}get thumbElement(){return t(this,L)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,at).assignedElements()[0]||t(this,at).firstElementChild;r(this,L,e),t(this,L).addEventListener("pointerdown",t(this,re)),kt.windowResizer.subscribe(t(this,dt),ce.RESIZE_ORDER.SCROLL),Jt.elementResizer.subscribe(this,t(this,dt)),Jt.elementResizer.subscribe(this.scrollElement,t(this,dt)),this.scrollElement.onScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.subscribe(t(this,ie))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,L).removeEventListener("pointerdown",t(this,re)),kt.windowResizer.unsubscribe(t(this,dt)),Jt.elementResizer.unsubscribe(t(this,dt)),this.scrollElement.offScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,ie))}}at=new WeakMap,L=new WeakMap,G=new WeakMap,Z=new WeakMap,Ot=new WeakMap,Vt=new WeakMap,dt=new WeakMap,Bt=new WeakMap,ie=new WeakMap,re=new WeakMap;customElements.get("e-scrollbar")||customElements.define("e-scrollbar",Te);var _t,Ht,Wt;class qe extends Ce{constructor(){super();s(this,_t,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Ht,new S.CSSProperty(this,"--tween-easing",!1));s(this,Wt,new S.CSSProperty(this,"--tween-duration",0));Se.isBrowser&&this.addEventListener("click",()=>{const e=t(this,_t).current,i=t(this,Ht).current,n=t(this,Wt).current;this.handleClick({behaviour:e,tween:i||n?{easing:i,duration:n}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,_t).observe(),t(this,Ht).observe(),t(this,Wt).observe()}disconnectedCallback(){t(this,_t).close(),t(this,Ht).close(),t(this,Wt).close()}}_t=new WeakMap,Ht=new WeakMap,Wt=new WeakMap;var Ft;class De extends qe{constructor(){super(...arguments);s(this,Ft,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Ft).current,e)}connectedCallback(){super.connectedCallback(),t(this,Ft).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Ft).close()}}Ft=new WeakMap;customElements.get("e-scroll-set-button")||customElements.define("e-scroll-set-button",De);var j,$t;class Ae extends qe{constructor(){super(...arguments);s(this,j,new S.CSSProperty(this,"--step",1));s(this,$t,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,j).current>0&&this.scrollElement.scrollLine==="end"||t(this,j).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,j).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,j).subscribe(()=>{t(this,$t).call(this)}),t(this,j).observe(),this.scrollElement.addEventListener("scrollLine",t(this,$t)),t(this,$t).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,j).close(),this.removeAttribute("disabled")}}j=new WeakMap,$t=new WeakMap;customElements.get("e-scroll-step-button")||customElements.define("e-scroll-step-button",Ae);var K,St,Nt,ne,he,Ut;class Xe{constructor(h,e,i){s(this,K,null);s(this,St,null);s(this,Nt,null);s(this,ne,null);s(this,he,()=>{t(this,St).scrollToSection(t(this,Nt),{behaviour:t(this,ne)})});s(this,Ut,()=>{t(this,K).classList.toggle("current",t(this,St).counter.current===t(this,Nt))});Se.isBrowser&&(r(this,K,document.createElement("button")),r(this,St,h),r(this,ne,i),r(this,Nt,e),t(this,K).addEventListener("click",t(this,he)),t(this,St).counter.subscribe(t(this,Ut)),t(this,Ut).call(this))}get element(){return t(this,K)}destroy(){t(this,K).removeEventListener("click",t(this,he)),t(this,St).counter.unsubscribe(t(this,Ut)),t(this,K).remove()}}K=new WeakMap,St=new WeakMap,Nt=new WeakMap,ne=new WeakMap,he=new WeakMap,Ut=new WeakMap;var pt,Gt;class Me extends Ce{constructor(){super(...arguments);s(this,pt,[]);s(this,Gt,je.debounce(()=>{t(this,pt).forEach(e=>e.destroy()),r(this,pt,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Xe(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,pt).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Gt)),t(this,Gt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Gt)),t(this,pt).forEach(e=>e.destroy()),r(this,pt,[])}}pt=new WeakMap,Gt=new WeakMap;customElements.get("e-scroll-bullet-buttons")||customElements.define("e-scroll-bullet-buttons",Me);class Oe extends Ke.ScrollSegmentElement{connectedCallback(){const h=Re.findParentElement(this,Zt);h instanceof Zt?(this.scrollContainer=h,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}customElements.get("e-scroll-segment")||customElements.define("e-scroll-segment",Oe);exports.ScrollBulletButtonsElement=Me;exports.ScrollElement=Zt;exports.ScrollSegmentElement=Oe;exports.ScrollSetButtonElement=De;exports.ScrollStepButtonElement=Ae;exports.ScrollbarElement=Te;
|
package/lib/scroll/index.js
CHANGED
|
@@ -312,7 +312,7 @@ class jt extends HTMLElement {
|
|
|
312
312
|
}
|
|
313
313
|
});
|
|
314
314
|
}, t(this, it).current))), !(e.includes("drag") && !Ke.isTouch && !t(this, Et).current)) {
|
|
315
|
-
if (
|
|
315
|
+
if (t(this, A).current && e !== "drag") {
|
|
316
316
|
const n = Math.sign(i);
|
|
317
317
|
if (t(this, l).length) {
|
|
318
318
|
const d = {
|
package/lib/source/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var W=h=>{throw TypeError(h)};var G=(h,r,e)=>r.has(h)||W("Cannot "+e);var t=(h,r,e)=>(G(h,r,"read from private field"),e?e.call(h):r.get(h)),i=(h,r,e)=>r.has(h)?W("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(h):r.set(h,e),s=(h,r,e,o)=>(G(h,r,"write to private field"),o?o.call(h,e):r.set(h,e),e),_=(h,r,e)=>(G(h,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../class-linked-status/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),U=require("../events-KVanG9sR.cjs"),et=require("../string-DhgS_iFl.cjs"),K=require("../loading/index.cjs"),st=require("../order/index.cjs"),Z=require("../window-resizer/index.cjs"),it=require("../Store-C2J4Q87x.cjs");var T,
|
|
1
|
+
"use strict";var W=h=>{throw TypeError(h)};var G=(h,r,e)=>r.has(h)||W("Cannot "+e);var t=(h,r,e)=>(G(h,r,"read from private field"),e?e.call(h):r.get(h)),i=(h,r,e)=>r.has(h)?W("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(h):r.set(h,e),s=(h,r,e,o)=>(G(h,r,"write to private field"),o?o.call(h,e):r.set(h,e),e),_=(h,r,e)=>(G(h,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../class-linked-status/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),U=require("../events-KVanG9sR.cjs"),et=require("../string-DhgS_iFl.cjs"),K=require("../loading/index.cjs"),st=require("../order/index.cjs"),Z=require("../window-resizer/index.cjs"),it=require("../Store-C2J4Q87x.cjs");var T,E,$,q,u,f,M;class J{constructor(r){i(this,T);i(this,E);i(this,$);i(this,q);i(this,u);i(this,f);i(this,M);s(this,T,r);let e=r.split(".");const o=/\b\d{1,2}x\b/g,d=e.find(p=>p.match(o)&&parseInt(p));s(this,$,d?parseInt(d):1),d&&(e=e.slice(0,-1)),s(this,E,e.length>1?e.slice(0,-1).join("."):e.join("."));const l=/\d+max/g,x=/\d+min/g,B=/\d+mar/g,P=/\d+mir/g,H=e.find(p=>p.match(l)),n=e.find(p=>p.match(x)),b=e.find(p=>p.match(B)),N=e.find(p=>p.match(P));b?(s(this,u,parseInt(b)),s(this,f,"max"),s(this,q,`(max-aspect-ratio: ${t(this,u)})`)):N?(s(this,u,parseInt(N)),s(this,f,"max"),s(this,q,`(min-aspect-ratio: ${t(this,u)})`)):H?(s(this,u,parseInt(H)),s(this,f,"max"),s(this,q,`(max-width: ${t(this,u)}px)`)):n?(s(this,u,parseInt(n)),s(this,q,`(min-width: ${t(this,u)}px)`),s(this,f,"min")):(s(this,u,0),s(this,q,`(min-width: ${t(this,u)}px)`),s(this,f,"min")),s(this,E,t(this,E).replace(`.${t(this,u)}${t(this,f)}`,"")),s(this,M,e[e.length-1]===t(this,E)?"":"."+e[e.length-1]),s(this,M,t(this,M).replace(`.${t(this,u)}${t(this,f)}`,""))}get url(){return t(this,T)}get name(){return t(this,E)}get density(){return t(this,$)}get query(){return t(this,q)}get extension(){return t(this,M)}get queryType(){return t(this,f)}get queryValue(){return t(this,u)}}T=new WeakMap,E=new WeakMap,$=new WeakMap,q=new WeakMap,u=new WeakMap,f=new WeakMap,M=new WeakMap;let rt=0;var m,a,y,w,g,z,R,c,k,v,S,C,A,j,D,O,F;class nt extends HTMLElement{constructor(e){super();i(this,A);i(this,m,null);i(this,a,null);i(this,y,!1);i(this,w,!1);i(this,g,!1);i(this,z,"");i(this,R,"");i(this,c,new Y.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));i(this,k,null);i(this,v);i(this,S,null);i(this,C);i(this,D,e=>{const o=e[0];t(this,g)&&(!t(this,w)||this.hasAttribute("reload-source"))&&o.isIntersecting&&this.triggerLazyLoad(),o.isIntersecting?U.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(_(this,A,j).call(this,void 0),s(this,w,!1)),U.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,O,()=>{t(this,c).set("loaded",!0),t(this,c).set("error",!1),t(this,c).set("loading",!1),!t(this,g)&&!t(this,y)&&K.loading.complete(t(this,R)),U.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,v,setTimeout(()=>{t(this,c).set("clear",!0)},parseFloat(e)*1e3)):t(this,c).set("clear",!0),s(this,y,!0)});i(this,F,e=>{t(this,c).set("loaded",!1),t(this,c).set("error",!0),t(this,c).set("loading",!1),!t(this,g)&&!t(this,y)&&K.loading.error(t(this,R)),U.dispatchEvent(this,"sourceError",{custom:!0}),s(this,y,!0)});s(this,C,e==null?void 0:e.sourceSetOptions),tt.isBrowser&&window.IntersectionObserver&&s(this,k,new IntersectionObserver(t(this,D)))}get consumerElement(){return t(this,a)}get sourceManager(){return t(this,m)}get status(){return t(this,c)}get isLazy(){return t(this,g)}get currentURL(){return t(this,S)}get isFirstLoadHappened(){return t(this,y)}triggerLazyLoad(){!t(this,w)&&t(this,m).current&&t(this,m).current!==t(this,m).previous&&(s(this,w,!0),_(this,A,j).call(this,t(this,m).current))}connectedCallback(){s(this,z,`source-consumer-${++rt}`);const e=this.getAttribute("srcset")||"",o=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;o&&t(this,c).addElement(o),s(this,a,this.createConsumer()),t(this,a).style.cssText=`
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100%;
|
|
5
|
-
`,t(this,a).classList.add("source-consumer"),Array.from(this.attributes).forEach(d=>{if(d.name!=="srcset"){const l=d.nodeValue||"",x=et.kebabToCamel(d.name);x in t(this,a)&&(t(this,a)[x]=l||!0)}}),this.appendChild(t(this,a)),s(this,m,new X({srcset:e,sourceSetOptions:t(this,C)})),s(this,g,this.hasAttribute("lazy")),t(this,m).subscribe(d=>{(!t(this,g)||t(this,g)&&t(this,
|
|
5
|
+
`,t(this,a).classList.add("source-consumer"),Array.from(this.attributes).forEach(d=>{if(d.name!=="srcset"){const l=d.nodeValue||"",x=et.kebabToCamel(d.name);x in t(this,a)&&(t(this,a)[x]=l||!0)}}),this.appendChild(t(this,a)),s(this,m,new X({srcset:e,sourceSetOptions:t(this,C)})),s(this,g,this.hasAttribute("lazy")),t(this,m).subscribe(d=>{(!t(this,g)||t(this,g)&&t(this,w))&&_(this,A,j).call(this,d.current)}),t(this,m).connect(),t(this,k).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,v)),t(this,k).disconnect(),(e=t(this,m))==null||e.close(),t(this,a)&&(t(this,a).onloadeddata=null,t(this,a).onload=null,t(this,a).onerror=null,t(this,a).remove()),s(this,y,!1),s(this,w,!1),t(this,c).reset()}}m=new WeakMap,a=new WeakMap,y=new WeakMap,w=new WeakMap,g=new WeakMap,z=new WeakMap,R=new WeakMap,c=new WeakMap,k=new WeakMap,v=new WeakMap,S=new WeakMap,C=new WeakMap,A=new WeakSet,j=function(e){if(clearTimeout(t(this,v)),t(this,a).onloadeddata=null,t(this,a).onload=null,t(this,a).onerror=null,t(this,c).set("loaded",!1),t(this,c).set("error",!1),t(this,c).set("loading",!1),t(this,c).set("clear",!1),e){s(this,R,`${t(this,z)}-${e.url}`);const o=this.hasAttribute("keep-source-parameters");t(this,c).set("loading",!0),s(this,S,o?e.url:e.name+e.extension),this.consumeSource(t(this,S)),!t(this,g)&&!t(this,y)&&K.loading.add(t(this,R)),t(this,a).onloadeddata=()=>{t(this,O).call(this)},t(this,a).onload=()=>{t(this,O).call(this)},t(this,a).onerror=()=>{t(this,F).call(this,t(this,S))}}else s(this,S,null),this.consumeSource(null)},D=new WeakMap,O=new WeakMap,F=new WeakMap;var L;class Q{constructor(r,e){i(this,L);s(this,L,new Map);const o=(e==null?void 0:e.mediaBuckets)!==!1,d=typeof r=="string"?o?r.trim().split(",").map(n=>n.trim()).filter(n=>!!n):[r]:r,l=[];d.forEach(n=>{const b=new J(n);l.push([b.query,b])});const x=l.filter(n=>n[1].queryType.includes("max")).sort((n,b)=>b[1].queryValue-n[1].queryValue),B=l.filter(n=>n[1].queryType.includes("min")&&n[1].queryValue!==0).sort((n,b)=>n[1].queryValue-b[1].queryValue),P=l.filter(n=>n[0]==="(min-width: 0px)");(P?[...P,...x,...B]:[...x,...B]).forEach(n=>{t(this,L).has(n[0])||t(this,L).set(n[0],[]),t(this,L).get(n[0]).push(n[1])})}get mediaBuckets(){return t(this,L)}}L=new WeakMap;var V,I;class X extends it.Store{constructor(e){super(void 0);i(this,V);i(this,I,()=>{let e;t(this,V).mediaBuckets.forEach((l,x)=>{matchMedia(x).matches&&(e=l)});let o,d=0;e==null||e.forEach(l=>{l.density>d&&l.density<=Math.max(devicePixelRatio,1)&&(d=l.density,o=l)}),e!=null&&e.length&&!o&&(o=e[0]),this.current=o});s(this,V,new Q(e.srcset,e.sourceSetOptions))}close(){super.close(),this.disconnect()}connect(){Z.windowResizer.subscribe(t(this,I),st.RESIZE_ORDER.SOURCE_MANAGER),t(this,I).call(this)}disconnect(){Z.windowResizer.unsubscribe(t(this,I))}}V=new WeakMap,I=new WeakMap;exports.Source=J;exports.SourceElement=nt;exports.SourceManager=X;exports.SourceSet=Q;
|
package/lib/source/index.js
CHANGED
|
@@ -11,11 +11,11 @@ import { loading as K } from "../loading/index.js";
|
|
|
11
11
|
import { RESIZE_ORDER as Y } from "../order/index.js";
|
|
12
12
|
import { windowResizer as Z } from "../window-resizer/index.js";
|
|
13
13
|
import { S as tt } from "../Store-Cm3LPXlx.js";
|
|
14
|
-
var T,
|
|
14
|
+
var T, w, C, L, u, f, k;
|
|
15
15
|
class et {
|
|
16
16
|
constructor(r) {
|
|
17
17
|
i(this, T);
|
|
18
|
-
i(this,
|
|
18
|
+
i(this, w);
|
|
19
19
|
i(this, C);
|
|
20
20
|
i(this, L);
|
|
21
21
|
i(this, u);
|
|
@@ -24,12 +24,12 @@ class et {
|
|
|
24
24
|
s(this, T, r);
|
|
25
25
|
let e = r.split(".");
|
|
26
26
|
const o = /\b\d{1,2}x\b/g, d = e.find((g) => g.match(o) && parseInt(g));
|
|
27
|
-
s(this, C, d ? parseInt(d) : 1), d && (e = e.slice(0, -1)), s(this,
|
|
27
|
+
s(this, C, d ? parseInt(d) : 1), d && (e = e.slice(0, -1)), s(this, w, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
|
|
28
28
|
const c = /\d+max/g, x = /\d+min/g, B = /\d+mar/g, P = /\d+mir/g, _ = e.find((g) => g.match(c)), h = e.find((g) => g.match(x)), b = e.find((g) => g.match(B)), N = e.find((g) => g.match(P));
|
|
29
|
-
b ? (s(this, u, parseInt(b)), s(this, f, "max"), s(this, L, `(max-aspect-ratio: ${t(this, u)})`)) : N ? (s(this, u, parseInt(N)), s(this, f, "max"), s(this, L, `(min-aspect-ratio: ${t(this, u)})`)) : _ ? (s(this, u, parseInt(_)), s(this, f, "max"), s(this, L, `(max-width: ${t(this, u)}px)`)) : h ? (s(this, u, parseInt(h)), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")) : (s(this, u, 0), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")), s(this,
|
|
29
|
+
b ? (s(this, u, parseInt(b)), s(this, f, "max"), s(this, L, `(max-aspect-ratio: ${t(this, u)})`)) : N ? (s(this, u, parseInt(N)), s(this, f, "max"), s(this, L, `(min-aspect-ratio: ${t(this, u)})`)) : _ ? (s(this, u, parseInt(_)), s(this, f, "max"), s(this, L, `(max-width: ${t(this, u)}px)`)) : h ? (s(this, u, parseInt(h)), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")) : (s(this, u, 0), s(this, L, `(min-width: ${t(this, u)}px)`), s(this, f, "min")), s(this, w, t(this, w).replace(
|
|
30
30
|
`.${t(this, u)}${t(this, f)}`,
|
|
31
31
|
""
|
|
32
|
-
)), s(this, k, e[e.length - 1] === t(this,
|
|
32
|
+
)), s(this, k, e[e.length - 1] === t(this, w) ? "" : "." + e[e.length - 1]), s(this, k, t(this, k).replace(
|
|
33
33
|
`.${t(this, u)}${t(this, f)}`,
|
|
34
34
|
""
|
|
35
35
|
));
|
|
@@ -38,7 +38,7 @@ class et {
|
|
|
38
38
|
return t(this, T);
|
|
39
39
|
}
|
|
40
40
|
get name() {
|
|
41
|
-
return t(this,
|
|
41
|
+
return t(this, w);
|
|
42
42
|
}
|
|
43
43
|
get density() {
|
|
44
44
|
return t(this, C);
|
|
@@ -56,9 +56,9 @@ class et {
|
|
|
56
56
|
return t(this, u);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
T = new WeakMap(),
|
|
59
|
+
T = new WeakMap(), w = new WeakMap(), C = new WeakMap(), L = new WeakMap(), u = new WeakMap(), f = new WeakMap(), k = new WeakMap();
|
|
60
60
|
let st = 0;
|
|
61
|
-
var m, a, y,
|
|
61
|
+
var m, a, y, E, p, O, A, l, I, M, q, V, R, F, H, z, j;
|
|
62
62
|
class ft extends HTMLElement {
|
|
63
63
|
constructor(e) {
|
|
64
64
|
super();
|
|
@@ -66,7 +66,7 @@ class ft extends HTMLElement {
|
|
|
66
66
|
i(this, m, null);
|
|
67
67
|
i(this, a, null);
|
|
68
68
|
i(this, y, !1);
|
|
69
|
-
i(this,
|
|
69
|
+
i(this, E, !1);
|
|
70
70
|
i(this, p, !1);
|
|
71
71
|
i(this, O, "");
|
|
72
72
|
i(this, A, "");
|
|
@@ -82,7 +82,7 @@ class ft extends HTMLElement {
|
|
|
82
82
|
i(this, V);
|
|
83
83
|
i(this, H, (e) => {
|
|
84
84
|
const o = e[0];
|
|
85
|
-
t(this, p) && (!t(this,
|
|
85
|
+
t(this, p) && (!t(this, E) || this.hasAttribute("reload-source")) && o.isIntersecting && this.triggerLazyLoad(), o.isIntersecting ? D(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (U(this, R, F).call(this, void 0), s(this, E, !1)), D(this, "sourceRelease", { custom: !0 }));
|
|
86
86
|
});
|
|
87
87
|
i(this, z, () => {
|
|
88
88
|
t(this, l).set("loaded", !0), t(this, l).set("error", !1), t(this, l).set("loading", !1), !t(this, p) && !t(this, y) && K.complete(t(this, A)), D(this, "sourceLoaded", { custom: !0 });
|
|
@@ -117,7 +117,7 @@ class ft extends HTMLElement {
|
|
|
117
117
|
return t(this, y);
|
|
118
118
|
}
|
|
119
119
|
triggerLazyLoad() {
|
|
120
|
-
!t(this,
|
|
120
|
+
!t(this, E) && t(this, m).current && t(this, m).current !== t(this, m).previous && (s(this, E, !0), U(this, R, F).call(this, t(this, m).current));
|
|
121
121
|
}
|
|
122
122
|
connectedCallback() {
|
|
123
123
|
s(this, O, `source-consumer-${++st}`);
|
|
@@ -135,15 +135,15 @@ class ft extends HTMLElement {
|
|
|
135
135
|
srcset: e,
|
|
136
136
|
sourceSetOptions: t(this, V)
|
|
137
137
|
})), s(this, p, this.hasAttribute("lazy")), t(this, m).subscribe((d) => {
|
|
138
|
-
(!t(this, p) || t(this, p) && t(this,
|
|
138
|
+
(!t(this, p) || t(this, p) && t(this, E)) && U(this, R, F).call(this, d.current);
|
|
139
139
|
}), t(this, m).connect(), t(this, I).observe(this);
|
|
140
140
|
}
|
|
141
141
|
disconnectedCallback() {
|
|
142
142
|
var e;
|
|
143
|
-
clearTimeout(t(this, M)), t(this, I).disconnect(), (e = t(this, m)) == null || e.close(), t(this, a) && (t(this, a).onloadeddata = null, t(this, a).onload = null, t(this, a).onerror = null, t(this, a).remove()), s(this, y, !1), s(this,
|
|
143
|
+
clearTimeout(t(this, M)), t(this, I).disconnect(), (e = t(this, m)) == null || e.close(), t(this, a) && (t(this, a).onloadeddata = null, t(this, a).onload = null, t(this, a).onerror = null, t(this, a).remove()), s(this, y, !1), s(this, E, !1), t(this, l).reset();
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
m = new WeakMap(), a = new WeakMap(), y = new WeakMap(),
|
|
146
|
+
m = new WeakMap(), a = new WeakMap(), y = new WeakMap(), E = new WeakMap(), p = new WeakMap(), O = new WeakMap(), A = new WeakMap(), l = new WeakMap(), I = new WeakMap(), M = new WeakMap(), q = new WeakMap(), V = new WeakMap(), R = new WeakSet(), F = function(e) {
|
|
147
147
|
if (clearTimeout(t(this, M)), t(this, a).onloadeddata = null, t(this, a).onload = null, t(this, a).onerror = null, t(this, l).set("loaded", !1), t(this, l).set("error", !1), t(this, l).set("loading", !1), t(this, l).set("clear", !1), e) {
|
|
148
148
|
s(this, A, `${t(this, O)}-${e.url}`);
|
|
149
149
|
const o = this.hasAttribute("keep-source-parameters");
|
package/lib/video/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var h=e=>{throw TypeError(e)};var d=(e,s,t)=>s.has(e)||h("Cannot "+t);var r=(e,s,t)=>(d(e,s,"read from private field"),t?t.call(e):s.get(e)),u=(e,s,t)=>s.has(e)?h("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,t),c=(e,s,t,l)=>(d(e,s,"write to private field"),l?l.call(e,t):s.set(e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../source/index.cjs");require("../window-resizer/index.cjs");require("../Store-C2J4Q87x.cjs");const b=require("../events-KVanG9sR.cjs"),o=require("../ticker/index.cjs");var i,a,n;class m extends E.SourceElement{constructor(){super(...arguments);u(this,i,0);u(this,a,!1);u(this,n,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>r(this,i)&&c(this,i,t),b.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:r(this,i)}}),this.consumerElement.readyState===4&&(o.ticker.unsubscribe(r(this,n)),r(this,a)&&this.sourceManager.current&&this.consumerElement.play())})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{c(this,a,!1),this.hasAttribute("capture-autoplay")&&(this.sourceManager.current?this.consumerElement.play():c(this,a,!0)),o.ticker.subscribe(r(this,n))}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),o.ticker.unsubscribe(r(this,n)),c(this,i,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||""}}i=new WeakMap,a=new WeakMap,n=new WeakMap;customElements.get("e-video")||customElements.define("e-video",m);exports.VideoElement=m;
|
package/lib/video/index.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
var
|
|
1
|
+
var h = (e) => {
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
|
-
var l = (e, s, t) => s.has(e) ||
|
|
5
|
-
var
|
|
6
|
-
import { SourceElement as
|
|
4
|
+
var l = (e, s, t) => s.has(e) || h("Cannot " + t);
|
|
5
|
+
var r = (e, s, t) => (l(e, s, "read from private field"), t ? t.call(e) : s.get(e)), o = (e, s, t) => s.has(e) ? h("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), c = (e, s, t, m) => (l(e, s, "write to private field"), m ? m.call(e, t) : s.set(e, t), t);
|
|
6
|
+
import { SourceElement as d } from "../source/index.js";
|
|
7
7
|
import "../window-resizer/index.js";
|
|
8
8
|
import "../Store-Cm3LPXlx.js";
|
|
9
|
-
import { d } from "../events-CsVF98U6.js";
|
|
10
|
-
import { ticker as
|
|
11
|
-
var
|
|
12
|
-
class
|
|
9
|
+
import { d as p } from "../events-CsVF98U6.js";
|
|
10
|
+
import { ticker as u } from "../ticker/index.js";
|
|
11
|
+
var i, a, n;
|
|
12
|
+
class E extends d {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
o(this, i, 0);
|
|
16
|
+
o(this, a, !1);
|
|
17
|
+
o(this, n, () => {
|
|
17
18
|
this.classList.add(`state-${this.consumerElement.readyState}`);
|
|
18
19
|
const t = this.consumerElement.readyState / 4;
|
|
19
|
-
t >
|
|
20
|
+
t > r(this, i) && c(this, i, t), p(this, "videoReadyStateChange", {
|
|
20
21
|
detail: {
|
|
21
22
|
readyState: this.consumerElement.readyState,
|
|
22
|
-
progress:
|
|
23
|
+
progress: r(this, i)
|
|
23
24
|
}
|
|
24
|
-
}), this.consumerElement.readyState === 4 &&
|
|
25
|
+
}), this.consumerElement.readyState === 4 && (u.unsubscribe(r(this, n)), r(this, a) && this.sourceManager.current && this.consumerElement.play());
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
28
|
connectedCallback() {
|
|
28
29
|
super.connectedCallback(), this.addEventListener("sourceCapture", () => {
|
|
29
|
-
|
|
30
|
+
c(this, a, !1), this.hasAttribute("capture-autoplay") && (this.sourceManager.current ? this.consumerElement.play() : c(this, a, !0)), u.subscribe(r(this, n));
|
|
30
31
|
}), this.addEventListener("sourceRelease", () => {
|
|
31
32
|
this.hasAttribute("capture-autoplay") && (this.consumerElement.pause(), this.hasAttribute("replay") && (this.consumerElement.currentTime = 0)), this.hasAttribute("reload-source") && this.classList.remove(
|
|
32
33
|
"state-0",
|
|
@@ -38,17 +39,17 @@ class p extends h {
|
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
disconnectedCallback() {
|
|
41
|
-
super.disconnectedCallback(),
|
|
42
|
+
super.disconnectedCallback(), u.unsubscribe(r(this, n)), c(this, i, 0);
|
|
42
43
|
}
|
|
43
44
|
createConsumer() {
|
|
44
45
|
return document.createElement("video");
|
|
45
46
|
}
|
|
46
47
|
consumeSource(t) {
|
|
47
|
-
this.consumerElement.src = t || ""
|
|
48
|
+
this.consumerElement.src = t || "";
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
customElements.get("e-video") || customElements.define("e-video",
|
|
51
|
+
i = new WeakMap(), a = new WeakMap(), n = new WeakMap();
|
|
52
|
+
customElements.get("e-video") || customElements.define("e-video", E);
|
|
52
53
|
export {
|
|
53
|
-
|
|
54
|
+
E as VideoElement
|
|
54
55
|
};
|