aptechka 0.50.21 → 0.50.23
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/ScrollElement.d.ts +1 -0
- package/lib/scroll/ScrollSegmentElement.d.ts +1 -0
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +175 -169
- package/lib/scroll-segment/ScrollSegmentElement.d.ts +1 -1
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.js +131 -130
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var mt=l=>{throw TypeError(l)};var lt=(l,c,r)=>c.has(l)||mt("Cannot "+r);var t=(l,c,r)=>(lt(l,c,"read from private field"),r?r.call(l):c.get(l)),i=(l,c,r)=>c.has(l)?mt("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(l):c.set(l,r),e=(l,c,r,s)=>(lt(l,c,"write to private field"),s?s.call(l,r):c.set(l,r),r),u=(l,c,r)=>(lt(l,c,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const zt=require("../dom-JBOkFLTh.cjs"),Ot=require("../index-Cqw2NKev.cjs"),ot=require("../element-resizer/index.cjs"),ut=require("../window-resizer/index.cjs"),o=require("../css-property/index.cjs"),bt=require("../order/index.cjs"),et=require("../events-KVanG9sR.cjs"),qt=require("../function-MthRj-GJ.cjs"),St=require("../layout-Ctc2p3uz.cjs"),xt=require("../math-GDWEqu7y.cjs"),rt=require("../Store-DRp_K37w.cjs"),kt=require("../scroll-entries/index.cjs");require("../ticker/index.cjs");const Dt=require("../Damped-B1lXa9nb.cjs");var w,ct,it,j;class ft{constructor(c){i(this,w,null);i(this,ct);i(this,it,!1);i(this,j,()=>{e(this,it,!(t(this,w).scrollWidth>t(this,w).clientWidth))});e(this,ct,c),e(this,w,zt.findScrollParentElement(t(this,ct))),ot.elementResizer.subscribe(t(this,w),t(this,j)),ut.windowResizer.subscribe(t(this,j)),t(this,j).call(this)}get element(){return t(this,w)}get currentScrollValue(){return t(this,it)?t(this,w).scrollTop:t(this,w).scrollLeft}get vertical(){return t(this,it)}destroy(){ot.elementResizer.unsubscribe(t(this,j)),ut.windowResizer.unsubscribe(t(this,j))}onScroll(c){t(this,w).addEventListener("scroll",c)}offScroll(c){t(this,w).removeEventListener("scroll",c)}}w=new WeakMap,ct=new WeakMap,it=new WeakMap,j=new WeakMap;var S,B,G,K,Z,_,A,I,$,m,g,v,y,H,p,q,x,L,Y,k,D,M,f,P,V,R,z,F,ht,n,W,J,nt,d,O,C,b,E,tt,N,a,Q,h,vt,pt,yt,Pt,Vt,wt,Ft,Et,U,st,X,Lt,Rt,dt,Ct;let gt=(Ct=class extends HTMLElement{constructor(){super(...arguments);i(this,h);i(this,S);i(this,B);i(this,G);i(this,K);i(this,Z);i(this,_);i(this,A);i(this,I);i(this,$);i(this,m);i(this,g);i(this,v);i(this,y);i(this,H);i(this,p);i(this,q);i(this,x);i(this,L);i(this,Y);i(this,k);i(this,D);i(this,M);i(this,f);i(this,P);i(this,V);i(this,R);i(this,z);i(this,F);i(this,ht);i(this,n);i(this,W);i(this,J);i(this,nt);i(this,d);i(this,O);i(this,C);i(this,b);i(this,E);i(this,tt);i(this,N);i(this,a);i(this,Q);i(this,U);i(this,st);e(this,S,null),e(this,B,new o.CSSProperty(this,"--damping",20)),e(this,G,new o.CSSProperty(this,"--mass",0)),e(this,K,new o.CSSProperty(this,"--stiffness",0)),e(this,Z,new o.CSSProperty(this,"--target","")),e(this,_,new o.CSSProperty(this,"--disabled",!1)),e(this,A,new o.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),e(this,I,new o.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),e(this,$,new o.CSSProperty(this,"--capture-once",!1)),e(this,m,new o.CSSProperty(this,"--captured","")),e(this,g,new o.CSSProperty(this,"--released","")),e(this,v,new o.CSSProperty(this,"--captured-from-start","")),e(this,y,new o.CSSProperty(this,"--captured-from-finish","")),e(this,H,new o.CSSProperty(this,"--released-from-start","")),e(this,p,new o.CSSProperty(this,"--released-from-finish","")),e(this,q,new o.CSSProperty(this,"--passed-var","")),e(this,x,new o.CSSProperty(this,"--progress-var","")),e(this,L,new o.CSSProperty(this,"--progress-arc-var","")),e(this,Y,new o.CSSProperty(this,"--animation-var-type","target")),e(this,k,new o.CSSProperty(this,"--distance-var","")),e(this,D,new o.CSSProperty(this,"--start-var","")),e(this,M,new o.CSSProperty(this,"--finish-var","")),e(this,f,new rt.Store(!1)),e(this,P,new rt.Store(!1)),e(this,V,new rt.Store(!1)),e(this,R,new rt.Store(!1)),e(this,z,new rt.Store(!1)),e(this,F,new rt.Store(!1)),e(this,ht,[]),e(this,n,this),e(this,W,0),e(this,J,0),e(this,nt,0),e(this,d,new Dt.Damped(0,{order:bt.TICK_ORDER.SEGMENT,min:0,max:1})),e(this,O,0),e(this,C,0),e(this,b,0),e(this,E,0),e(this,tt,!1),e(this,N,!1),e(this,a,!0),e(this,Q,!1),this.findAnotherScrollEntries=qt.debounce(()=>{const r=kt.scrollEntries.getAll(this).reverse();let s=0;r.forEach((T,at)=>{T.element===t(this,S)&&(s=at)}),e(this,ht,r.slice(s+1))},0),e(this,U,()=>{t(this,a)||(this.resize(),t(this,st).call(this))}),e(this,st,()=>{!t(this,a)&&t(this,tt)&&this.tick()})}get scrollContainer(){return t(this,S)}set scrollContainer(r){u(this,h,pt).call(this),e(this,S,r),u(this,h,vt).call(this)}get distanceOffsetCSSProperty(){return t(this,A)}get startOffsetCSSProperty(){return t(this,I)}get captureOnceCSSProperty(){return t(this,$)}get capturedCSSProperty(){return t(this,m)}get releasedCSSProperty(){return t(this,g)}get capturedFromStartCSSProperty(){return t(this,v)}get capturedFromFinishCSSProperty(){return t(this,y)}get releasedFromStartCSSProperty(){return t(this,H)}get releasedFromFinishCSSProperty(){return t(this,p)}get passedVarCSSProperty(){return t(this,q)}get progressVarCSSProperty(){return t(this,x)}get progressArcVarCSSProperty(){return t(this,L)}get animationVarTypeCSSProperty(){return t(this,Y)}get distanceVarCSSProperty(){return t(this,k)}get startVarCSSProperty(){return t(this,D)}get finishVarCSSProperty(){return t(this,M)}get disabledCSSProperty(){return t(this,_)}get dampingCSSProperty(){return t(this,B)}get massCSSProperty(){return t(this,G)}get stiffnessCSSProperty(){return t(this,K)}get targetCSSProperty(){return t(this,Z)}get isCaptured(){return t(this,f)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,V)}get isReleasedFromStart(){return t(this,R)}get isCapturedFromFinish(){return t(this,z)}get isReleasedFromFinish(){return t(this,F)}get directionPosition(){return t(this,W)}get directionSize(){return t(this,J)}get passed(){return t(this,d)}get progress(){return t(this,O)}get start(){return t(this,C)}get finish(){return t(this,E)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,N)}get isDisabled(){return t(this,a)}resize(){e(this,J,t(this,S).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,S)instanceof HTMLElement?t(this,S):t(this,S).element;e(this,W,t(this,S).vertical?St.getCumulativeOffsetTop(this,r):St.getCumulativeOffsetLeft(this,r));const s=St.getStickyOffset(this,t(this,S).vertical?"top":"left");e(this,W,t(this,W)-s),e(this,C,this.getStart()),e(this,b,this.getDistance()),e(this,C,t(this,C)+t(this,I).current),e(this,b,t(this,b)+t(this,A).current),e(this,E,t(this,C)+t(this,b)),t(this,S).currentScrollValue>t(this,E)&&!t(this,f).current&&!t(this,P).current&&(t(this,f).current=!0),this.setVar(t(this,D).current,t(this,C)),this.setVar(t(this,M).current,t(this,E)),this.setVar(t(this,k).current,t(this,b)),t(this,d).max=t(this,b),e(this,tt,!0)}tick(){let r=t(this,S).currentScrollValue;t(this,ht).forEach(at=>{r+=at.value});const s=r-t(this,C);t(this,Q)||e(this,Q,t(this,d).previous?Math.abs(t(this,d).previous-s)>1e3:!1),t(this,d).set(s);const T=Math.round(r);t(this,f).current&&(T>=t(this,C)?t(this,V).current||u(this,h,Vt).call(this):t(this,V).current&&!t(this,R).current&&u(this,h,Ft).call(this),T<t(this,E)?t(this,F).current&&!t(this,z).current&&u(this,h,wt).call(this):t(this,V).current&&!t(this,F).current&&u(this,h,Et).call(this)),T>=t(this,C)&&T<t(this,E)?t(this,f).current||u(this,h,yt).call(this):t(this,f).current&&(t(this,d).set(xt.step(t(this,b)/2,t(this,d).target,0,t(this,b))),u(this,h,Pt).call(this)),t(this,N)&&t(this,$).current&&(t(this,m).current&&t(this,n).classList.add(t(this,m).current),e(this,a,!0))}disable(){this.style.cssText="",e(this,W,0),e(this,J,0),t(this,d).reset(),e(this,O,0),e(this,C,0),e(this,b,0),e(this,E,0),e(this,tt,!1),t(this,f).current=!1,t(this,P).current=!1,t(this,V).current=!1,t(this,R).current=!1,t(this,z).current=!1,t(this,F).current=!1,e(this,N,!1),e(this,a,!0),u(this,h,dt).call(this)}enable(){e(this,a,!1)}connectedCallback(){this.scrollContainer=new ft(this)}disconnectedCallback(){t(this,S)instanceof ft&&t(this,S).destroy(),u(this,h,pt).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,s){r&&t(this,n).style.setProperty(`--${r}`,s.toString())}getDistance(){return t(this,J)+t(this,nt)}getStart(){return t(this,W)-t(this,nt)}},S=new WeakMap,B=new WeakMap,G=new WeakMap,K=new WeakMap,Z=new WeakMap,_=new WeakMap,A=new WeakMap,I=new WeakMap,$=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,y=new WeakMap,H=new WeakMap,p=new WeakMap,q=new WeakMap,x=new WeakMap,L=new WeakMap,Y=new WeakMap,k=new WeakMap,D=new WeakMap,M=new WeakMap,f=new WeakMap,P=new WeakMap,V=new WeakMap,R=new WeakMap,z=new WeakMap,F=new WeakMap,ht=new WeakMap,n=new WeakMap,W=new WeakMap,J=new WeakMap,nt=new WeakMap,d=new WeakMap,O=new WeakMap,C=new WeakMap,b=new WeakMap,E=new WeakMap,tt=new WeakMap,N=new WeakMap,a=new WeakMap,Q=new WeakMap,h=new WeakSet,vt=function(){if(!t(this,S))return;t(this,f).subscribe(s=>{s.current&&et.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,V).subscribe(s=>{s.current&&et.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,z).subscribe(s=>{s.current&&et.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(s=>{s.current&&et.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,R).subscribe(s=>{s.current&&et.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,F).subscribe(s=>{s.current&&et.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,B).observe(),t(this,G).observe(),t(this,K).observe(),t(this,Z).observe(),t(this,_).observe(),t(this,A).observe(),t(this,I).observe(),t(this,$).observe(),t(this,m).observe(),t(this,g).observe(),t(this,v).observe(),t(this,y).observe(),t(this,H).observe(),t(this,p).observe(),t(this,q).observe(),t(this,x).observe(),t(this,L).observe(),t(this,Y).observe(),t(this,k).observe(),t(this,D).observe(),t(this,M).observe();let r=!1;this.findAnotherScrollEntries(),t(this,_).current||this.enable(),t(this,B).subscribe(s=>{t(this,d).damping=s.current}),t(this,G).subscribe(s=>{t(this,d).mass=s.current}),t(this,K).subscribe(s=>{t(this,d).stiffness=s.current}),t(this,Z).subscribe(s=>{s.previous&&u(this,h,dt).call(this),s.current?s.current==="parent"?e(this,n,this.parentElement||this):e(this,n,document.querySelector(s.current)||this):e(this,n,this)}),t(this,_).subscribe(s=>{s.current&&!s.previous?this.disable():!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,I).subscribe(()=>{r&&!t(this,a)&&this.resize()}),t(this,A).subscribe(()=>{r&&!t(this,a)&&this.resize()}),t(this,m).subscribe(s=>{u(this,h,X).call(this,s)}),t(this,v).subscribe(s=>{u(this,h,X).call(this,s)}),t(this,y).subscribe(s=>{u(this,h,X).call(this,s)}),t(this,g).subscribe(s=>{u(this,h,X).call(this,s)}),t(this,H).subscribe(s=>{u(this,h,X).call(this,s)}),t(this,p).subscribe(s=>{u(this,h,X).call(this,s)}),t(this,$).subscribe(s=>{t(this,a)||!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,q).subscribe(s=>{t(this,a)||(this.removeVar(s.previous),this.setVar(s.current,this.passed.current))}),t(this,x).subscribe(s=>{t(this,a)||(this.removeVar(s.previous),this.setVar(s.current,t(this,O)))}),t(this,L).subscribe(s=>{t(this,a)||(this.removeVar(s.previous),this.setVar(s.current,t(this,O)))}),t(this,D).subscribe(s=>{t(this,a)||(this.removeVar(s.previous),this.setVar(s.current,t(this,C)))}),t(this,M).subscribe(s=>{t(this,a)||(this.removeVar(s.previous),this.setVar(s.current,t(this,E)))}),t(this,k).subscribe(s=>{t(this,a)||(this.removeVar(s.previous),this.setVar(s.current,t(this,b)))}),t(this,d).subscribe(s=>{if(t(this,Q)){e(this,Q,!1);return}const T=t(this,d)[t(this,Y).current];e(this,O,T/t(this,b)||0),this.setVar(t(this,q).current,T.toFixed(6)),this.setVar(t(this,x).current,t(this,O).toFixed(6)),t(this,L).current&&this.setVar(t(this,L).current,Math.abs(Math.cos(t(this,O)*Math.PI)).toFixed(6))}),ut.windowResizer.subscribe(t(this,U),bt.RESIZE_ORDER.SCROLL+1),ot.elementResizer.subscribe(this,t(this,U)),this.scrollContainer.onScroll(t(this,st)),r=!0},pt=function(){t(this,S)&&(ut.windowResizer.unsubscribe(t(this,U)),ot.elementResizer.unsubscribe(t(this,U)),this.scrollContainer.offScroll(t(this,st)),t(this,B).close(),t(this,G).close(),t(this,K).close(),t(this,Z).close(),t(this,_).close(),t(this,A).close(),t(this,I).close(),t(this,$).close(),t(this,m).close(),t(this,g).close(),t(this,v).close(),t(this,y).close(),t(this,H).close(),t(this,p).close(),t(this,q).close(),t(this,x).close(),t(this,L).close(),t(this,k).close(),t(this,D).close(),t(this,M).close(),t(this,f).close(),t(this,P).close(),t(this,V).close(),t(this,R).close(),t(this,z).close(),t(this,F).close(),this.disable())},yt=function(){t(this,f).current=!0,t(this,P).current=!1,e(this,N,!0),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,m).current&&t(this,n).classList.add(t(this,m).current)},Pt=function(){t(this,P).current=!0,t(this,f).current=!1,e(this,N,!0),t(this,m).current&&t(this,n).classList.remove(t(this,m).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,g).current&&t(this,n).classList.add(t(this,g).current)},Vt=function(){t(this,f).current=!0,t(this,V).current=!0,t(this,R).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},wt=function(){t(this,f).current=!0,t(this,z).current=!0,t(this,F).current=!1,t(this,y).current&&t(this,n).classList.add(t(this,y).current)},Ft=function(){t(this,P).current=!0,t(this,R).current=!0,t(this,V).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},Et=function(){t(this,P).current=!0,t(this,F).current=!0,t(this,z).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},U=new WeakMap,st=new WeakMap,X=function(r){if(t(this,a)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,f).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},Lt=function(...r){r.forEach(s=>{s&&t(this,n).classList.remove(s)})},Rt=function(...r){r.forEach(s=>{s&&t(this,n).style.removeProperty(`--${s}`)})},dt=function(){u(this,h,Lt).call(this,t(this,m).current,t(this,v).current,t(this,y).current,t(this,g).current,t(this,H).current,t(this,p).current),u(this,h,Rt).call(this,t(this,q).current,t(this,x).current,t(this,L).current,t(this,k).current,t(this,D).current,t(this,M).current)},Ct);Ot.isBrowser&&!customElements.get("scroll-segment")&&customElements.define("scroll-segment",gt);exports.ScrollSegmentDefaultContainer=ft;exports.ScrollSegmentElement=gt;
|
|
1
|
+
"use strict";var mt=l=>{throw TypeError(l)};var at=(l,c,r)=>c.has(l)||mt("Cannot "+r);var t=(l,c,r)=>(at(l,c,"read from private field"),r?r.call(l):c.get(l)),i=(l,c,r)=>c.has(l)?mt("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(l):c.set(l,r),e=(l,c,r,s)=>(at(l,c,"write to private field"),s?s.call(l,r):c.set(l,r),r),o=(l,c,r)=>(at(l,c,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ot=require("../dom-JBOkFLTh.cjs"),qt=require("../index-Cqw2NKev.cjs"),bt=require("../element-resizer/index.cjs"),ct=require("../window-resizer/index.cjs"),u=require("../css-property/index.cjs"),Ct=require("../order/index.cjs"),st=require("../events-KVanG9sR.cjs"),xt=require("../function-MthRj-GJ.cjs"),lt=require("../layout-Ctc2p3uz.cjs"),kt=require("../math-GDWEqu7y.cjs"),et=require("../Store-DRp_K37w.cjs"),Dt=require("../scroll-entries/index.cjs");require("../ticker/index.cjs");const Mt=require("../Damped-B1lXa9nb.cjs");var w,ot,rt,j;class St{constructor(c){i(this,w,null);i(this,ot);i(this,rt,!1);i(this,j,()=>{e(this,rt,!(t(this,w).scrollWidth>t(this,w).clientWidth))});e(this,ot,c),e(this,w,Ot.findScrollParentElement(t(this,ot))),bt.elementResizer.subscribe(t(this,w),t(this,j)),ct.windowResizer.subscribe(t(this,j)),t(this,j).call(this)}get element(){return t(this,w)}get currentScrollValue(){return t(this,rt)?t(this,w).scrollTop:t(this,w).scrollLeft}get vertical(){return t(this,rt)}destroy(){bt.elementResizer.unsubscribe(t(this,j)),ct.windowResizer.unsubscribe(t(this,j))}onScroll(c){t(this,w).addEventListener("scroll",c)}offScroll(c){t(this,w).removeEventListener("scroll",c)}}w=new WeakMap,ot=new WeakMap,rt=new WeakMap,j=new WeakMap;var S,B,G,K,Z,_,A,I,$,m,g,v,y,H,p,O,q,L,X,x,k,D,f,P,V,R,z,F,it,n,W,J,ht,d,M,C,b,E,Y,N,a,Q,h,yt,ft,Pt,Vt,wt,Ft,Et,Lt,nt,tt,pt,U,Rt,zt,dt,gt;let vt=(gt=class extends HTMLElement{constructor(){super(...arguments);i(this,h);i(this,S);i(this,B);i(this,G);i(this,K);i(this,Z);i(this,_);i(this,A);i(this,I);i(this,$);i(this,m);i(this,g);i(this,v);i(this,y);i(this,H);i(this,p);i(this,O);i(this,q);i(this,L);i(this,X);i(this,x);i(this,k);i(this,D);i(this,f);i(this,P);i(this,V);i(this,R);i(this,z);i(this,F);i(this,it);i(this,n);i(this,W);i(this,J);i(this,ht);i(this,d);i(this,M);i(this,C);i(this,b);i(this,E);i(this,Y);i(this,N);i(this,a);i(this,Q);i(this,nt);i(this,tt);e(this,S,null),e(this,B,new u.CSSProperty(this,"--damping",20)),e(this,G,new u.CSSProperty(this,"--mass",0)),e(this,K,new u.CSSProperty(this,"--stiffness",0)),e(this,Z,new u.CSSProperty(this,"--target","")),e(this,_,new u.CSSProperty(this,"--disabled",!1)),e(this,A,new u.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),e(this,I,new u.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),e(this,$,new u.CSSProperty(this,"--capture-once",!1)),e(this,m,new u.CSSProperty(this,"--captured","")),e(this,g,new u.CSSProperty(this,"--released","")),e(this,v,new u.CSSProperty(this,"--captured-from-start","")),e(this,y,new u.CSSProperty(this,"--captured-from-finish","")),e(this,H,new u.CSSProperty(this,"--released-from-start","")),e(this,p,new u.CSSProperty(this,"--released-from-finish","")),e(this,O,new u.CSSProperty(this,"--passed-var","")),e(this,q,new u.CSSProperty(this,"--progress-var","")),e(this,L,new u.CSSProperty(this,"--progress-arc-var","")),e(this,X,new u.CSSProperty(this,"--animation-var-type","target")),e(this,x,new u.CSSProperty(this,"--distance-var","")),e(this,k,new u.CSSProperty(this,"--start-var","")),e(this,D,new u.CSSProperty(this,"--finish-var","")),e(this,f,new et.Store(!1)),e(this,P,new et.Store(!1)),e(this,V,new et.Store(!1)),e(this,R,new et.Store(!1)),e(this,z,new et.Store(!1)),e(this,F,new et.Store(!1)),e(this,it,[]),e(this,n,this),e(this,W,0),e(this,J,0),e(this,ht,0),e(this,d,new Mt.Damped(0,{order:Ct.TICK_ORDER.SEGMENT,min:0,max:1})),e(this,M,0),e(this,C,0),e(this,b,0),e(this,E,0),e(this,Y,!1),e(this,N,!1),e(this,a,!0),e(this,Q,!1),this.resize=()=>{e(this,J,t(this,S).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,S)instanceof HTMLElement?t(this,S):t(this,S).element;e(this,W,t(this,S).vertical?lt.getCumulativeOffsetTop(this,r):lt.getCumulativeOffsetLeft(this,r));const s=lt.getStickyOffset(this,t(this,S).vertical?"top":"left");e(this,W,t(this,W)-s),e(this,C,this.getStart()),e(this,b,this.getDistance()),e(this,C,t(this,C)+t(this,I).current),e(this,b,t(this,b)+t(this,A).current),e(this,E,t(this,C)+t(this,b)),t(this,S).currentScrollValue>t(this,E)&&!t(this,f).current&&!t(this,P).current&&(t(this,f).current=!0),this.setVar(t(this,k).current,t(this,C)),this.setVar(t(this,D).current,t(this,E)),this.setVar(t(this,x).current,t(this,b)),t(this,d).max=t(this,b),e(this,Y,!0),t(this,tt).call(this)},this.findAnotherScrollEntries=xt.debounce(()=>{const r=Dt.scrollEntries.getAll(this).reverse();let s=0;r.forEach((T,ut)=>{T.element===t(this,S)&&(s=ut)}),e(this,it,r.slice(s+1))},0),e(this,nt,()=>{t(this,a)||this.resize()}),e(this,tt,()=>{!t(this,a)&&t(this,Y)&&this.tick()})}get scrollContainer(){return t(this,S)}set scrollContainer(r){o(this,h,ft).call(this),e(this,S,r),o(this,h,yt).call(this)}get distanceOffsetCSSProperty(){return t(this,A)}get startOffsetCSSProperty(){return t(this,I)}get captureOnceCSSProperty(){return t(this,$)}get capturedCSSProperty(){return t(this,m)}get releasedCSSProperty(){return t(this,g)}get capturedFromStartCSSProperty(){return t(this,v)}get capturedFromFinishCSSProperty(){return t(this,y)}get releasedFromStartCSSProperty(){return t(this,H)}get releasedFromFinishCSSProperty(){return t(this,p)}get passedVarCSSProperty(){return t(this,O)}get progressVarCSSProperty(){return t(this,q)}get progressArcVarCSSProperty(){return t(this,L)}get animationVarTypeCSSProperty(){return t(this,X)}get distanceVarCSSProperty(){return t(this,x)}get startVarCSSProperty(){return t(this,k)}get finishVarCSSProperty(){return t(this,D)}get disabledCSSProperty(){return t(this,_)}get dampingCSSProperty(){return t(this,B)}get massCSSProperty(){return t(this,G)}get stiffnessCSSProperty(){return t(this,K)}get targetCSSProperty(){return t(this,Z)}get isCaptured(){return t(this,f)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,V)}get isReleasedFromStart(){return t(this,R)}get isCapturedFromFinish(){return t(this,z)}get isReleasedFromFinish(){return t(this,F)}get directionPosition(){return t(this,W)}get directionSize(){return t(this,J)}get passed(){return t(this,d)}get progress(){return t(this,M)}get start(){return t(this,C)}get finish(){return t(this,E)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,N)}get isDisabled(){return t(this,a)}tick(){let r=t(this,S).currentScrollValue;t(this,it).forEach(ut=>{r+=ut.value});const s=r-t(this,C);t(this,Q)||e(this,Q,t(this,d).previous?Math.abs(t(this,d).previous-s)>1e3:!1),t(this,d).set(s);const T=Math.round(r);t(this,f).current&&(T>=t(this,C)?t(this,V).current||o(this,h,wt).call(this):t(this,V).current&&!t(this,R).current&&o(this,h,Et).call(this),T<t(this,E)?t(this,F).current&&!t(this,z).current&&o(this,h,Ft).call(this):t(this,V).current&&!t(this,F).current&&o(this,h,Lt).call(this)),T>=t(this,C)&&T<t(this,E)?t(this,f).current||o(this,h,Pt).call(this):t(this,f).current&&(t(this,d).set(kt.step(t(this,b)/2,t(this,d).target,0,t(this,b))),o(this,h,Vt).call(this)),t(this,N)&&t(this,$).current&&(t(this,m).current&&t(this,n).classList.add(t(this,m).current),e(this,a,!0))}disable(){this.style.cssText="",e(this,W,0),e(this,J,0),t(this,d).reset(),e(this,M,0),e(this,C,0),e(this,b,0),e(this,E,0),e(this,Y,!1),t(this,f).current=!1,t(this,P).current=!1,t(this,V).current=!1,t(this,R).current=!1,t(this,z).current=!1,t(this,F).current=!1,e(this,N,!1),e(this,a,!0),o(this,h,dt).call(this)}enable(){e(this,a,!1)}connectedCallback(){this.scrollContainer=new St(this)}disconnectedCallback(){t(this,S)instanceof St&&t(this,S).destroy(),o(this,h,ft).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,s){r&&t(this,n).style.setProperty(`--${r}`,s.toString())}getDistance(){return t(this,J)+t(this,ht)}getStart(){return t(this,W)-t(this,ht)}},S=new WeakMap,B=new WeakMap,G=new WeakMap,K=new WeakMap,Z=new WeakMap,_=new WeakMap,A=new WeakMap,I=new WeakMap,$=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,y=new WeakMap,H=new WeakMap,p=new WeakMap,O=new WeakMap,q=new WeakMap,L=new WeakMap,X=new WeakMap,x=new WeakMap,k=new WeakMap,D=new WeakMap,f=new WeakMap,P=new WeakMap,V=new WeakMap,R=new WeakMap,z=new WeakMap,F=new WeakMap,it=new WeakMap,n=new WeakMap,W=new WeakMap,J=new WeakMap,ht=new WeakMap,d=new WeakMap,M=new WeakMap,C=new WeakMap,b=new WeakMap,E=new WeakMap,Y=new WeakMap,N=new WeakMap,a=new WeakMap,Q=new WeakMap,h=new WeakSet,yt=function(){if(!t(this,S))return;t(this,f).subscribe(s=>{s.current&&st.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,V).subscribe(s=>{s.current&&st.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,z).subscribe(s=>{s.current&&st.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(s=>{s.current&&st.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,R).subscribe(s=>{s.current&&st.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,F).subscribe(s=>{s.current&&st.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,B).observe(),t(this,G).observe(),t(this,K).observe(),t(this,Z).observe(),t(this,_).observe(),t(this,A).observe(),t(this,I).observe(),t(this,$).observe(),t(this,m).observe(),t(this,g).observe(),t(this,v).observe(),t(this,y).observe(),t(this,H).observe(),t(this,p).observe(),t(this,O).observe(),t(this,q).observe(),t(this,L).observe(),t(this,X).observe(),t(this,x).observe(),t(this,k).observe(),t(this,D).observe();let r=!1;this.findAnotherScrollEntries(),t(this,_).current||this.enable(),t(this,B).subscribe(s=>{t(this,d).damping=s.current}),t(this,G).subscribe(s=>{t(this,d).mass=s.current}),t(this,K).subscribe(s=>{t(this,d).stiffness=s.current}),t(this,Z).subscribe(s=>{s.previous&&o(this,h,dt).call(this),s.current?s.current==="parent"?e(this,n,this.parentElement||this):e(this,n,document.querySelector(s.current)||this):e(this,n,this)}),t(this,_).subscribe(s=>{s.current&&!s.previous?this.disable():!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,I).subscribe(()=>{r&&!t(this,a)&&this.resize()}),t(this,A).subscribe(()=>{r&&!t(this,a)&&this.resize()}),t(this,m).subscribe(s=>{o(this,h,U).call(this,s)}),t(this,v).subscribe(s=>{o(this,h,U).call(this,s)}),t(this,y).subscribe(s=>{o(this,h,U).call(this,s)}),t(this,g).subscribe(s=>{o(this,h,U).call(this,s)}),t(this,H).subscribe(s=>{o(this,h,U).call(this,s)}),t(this,p).subscribe(s=>{o(this,h,U).call(this,s)}),t(this,$).subscribe(s=>{t(this,a)||!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,O).subscribe(s=>{t(this,a)||(this.removeVar(s.previous),this.setVar(s.current,this.passed.current))}),t(this,q).subscribe(s=>{t(this,a)||(this.removeVar(s.previous),this.setVar(s.current,t(this,M)))}),t(this,L).subscribe(s=>{t(this,a)||(this.removeVar(s.previous),this.setVar(s.current,o(this,h,pt).call(this)))}),t(this,k).subscribe(s=>{t(this,a)||(this.removeVar(s.previous),this.setVar(s.current,t(this,C)))}),t(this,D).subscribe(s=>{t(this,a)||(this.removeVar(s.previous),this.setVar(s.current,t(this,E)))}),t(this,x).subscribe(s=>{t(this,a)||(this.removeVar(s.previous),this.setVar(s.current,t(this,b)))}),t(this,d).subscribe(s=>{if(t(this,Q)){e(this,Q,!1);return}const T=t(this,d)[t(this,X).current];e(this,M,T/t(this,b)||0),this.setVar(t(this,O).current,T.toFixed(6)),this.setVar(t(this,q).current,t(this,M).toFixed(6)),t(this,L).current&&this.setVar(t(this,L).current,o(this,h,pt).call(this).toFixed(6))}),ct.windowResizer.subscribe(t(this,nt),Ct.RESIZE_ORDER.SCROLL+1),this.scrollContainer.onScroll(t(this,tt)),r=!0},ft=function(){t(this,S)&&(ct.windowResizer.unsubscribe(t(this,nt)),this.scrollContainer.offScroll(t(this,tt)),t(this,B).close(),t(this,G).close(),t(this,K).close(),t(this,Z).close(),t(this,_).close(),t(this,A).close(),t(this,I).close(),t(this,$).close(),t(this,m).close(),t(this,g).close(),t(this,v).close(),t(this,y).close(),t(this,H).close(),t(this,p).close(),t(this,O).close(),t(this,q).close(),t(this,L).close(),t(this,x).close(),t(this,k).close(),t(this,D).close(),t(this,f).close(),t(this,P).close(),t(this,V).close(),t(this,R).close(),t(this,z).close(),t(this,F).close(),this.disable())},Pt=function(){t(this,f).current=!0,t(this,P).current=!1,e(this,N,!0),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,m).current&&t(this,n).classList.add(t(this,m).current)},Vt=function(){t(this,P).current=!0,t(this,f).current=!1,e(this,N,!0),t(this,m).current&&t(this,n).classList.remove(t(this,m).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,g).current&&t(this,n).classList.add(t(this,g).current)},wt=function(){t(this,f).current=!0,t(this,V).current=!0,t(this,R).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},Ft=function(){t(this,f).current=!0,t(this,z).current=!0,t(this,F).current=!1,t(this,y).current&&t(this,n).classList.add(t(this,y).current)},Et=function(){t(this,P).current=!0,t(this,R).current=!0,t(this,V).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},Lt=function(){t(this,P).current=!0,t(this,F).current=!0,t(this,z).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},nt=new WeakMap,tt=new WeakMap,pt=function(){return Math.abs(Math.cos(t(this,M)*Math.PI))},U=function(r){if(t(this,a)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,f).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},Rt=function(...r){r.forEach(s=>{s&&t(this,n).classList.remove(s)})},zt=function(...r){r.forEach(s=>{s&&t(this,n).style.removeProperty(`--${s}`)})},dt=function(){o(this,h,Rt).call(this,t(this,m).current,t(this,v).current,t(this,y).current,t(this,g).current,t(this,H).current,t(this,p).current),o(this,h,zt).call(this,t(this,O).current,t(this,q).current,t(this,L).current,t(this,x).current,t(this,k).current,t(this,D).current)},gt);qt.isBrowser&&!customElements.get("scroll-segment")&&customElements.define("scroll-segment",vt);exports.ScrollSegmentDefaultContainer=St;exports.ScrollSegmentElement=vt;
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
var mt = (l) => {
|
|
2
2
|
throw TypeError(l);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var t = (l,
|
|
6
|
-
import { f as
|
|
7
|
-
import { i as
|
|
8
|
-
import { elementResizer as
|
|
9
|
-
import { windowResizer as
|
|
10
|
-
import { CSSProperty as
|
|
11
|
-
import { TICK_ORDER as
|
|
12
|
-
import { d as
|
|
13
|
-
import { d as
|
|
14
|
-
import { a as
|
|
15
|
-
import { s as
|
|
16
|
-
import { S as
|
|
17
|
-
import { scrollEntries as
|
|
4
|
+
var at = (l, o, r) => o.has(l) || mt("Cannot " + r);
|
|
5
|
+
var t = (l, o, r) => (at(l, o, "read from private field"), r ? r.call(l) : o.get(l)), i = (l, o, r) => o.has(l) ? mt("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(l) : o.set(l, r), e = (l, o, r, s) => (at(l, o, "write to private field"), s ? s.call(l, r) : o.set(l, r), r), c = (l, o, r) => (at(l, o, "access private method"), r);
|
|
6
|
+
import { f as Et } from "../dom-CVWzyXPH.js";
|
|
7
|
+
import { i as Rt } from "../index-euf5anj6.js";
|
|
8
|
+
import { elementResizer as St } from "../element-resizer/index.js";
|
|
9
|
+
import { windowResizer as ot } from "../window-resizer/index.js";
|
|
10
|
+
import { CSSProperty as u } from "../css-property/index.js";
|
|
11
|
+
import { TICK_ORDER as Ot, RESIZE_ORDER as zt } from "../order/index.js";
|
|
12
|
+
import { d as st } from "../events-CsVF98U6.js";
|
|
13
|
+
import { d as kt } from "../function-C10DGppn.js";
|
|
14
|
+
import { a as Dt, g as xt, c as Mt } from "../layout-DpZo-I0y.js";
|
|
15
|
+
import { s as Tt } from "../math-BOBiC4TN.js";
|
|
16
|
+
import { S as et } from "../Store-D2xCXENW.js";
|
|
17
|
+
import { scrollEntries as At } from "../scroll-entries/index.js";
|
|
18
18
|
import "../ticker/index.js";
|
|
19
|
-
import { D as
|
|
20
|
-
var F, ct,
|
|
21
|
-
class
|
|
22
|
-
constructor(
|
|
19
|
+
import { D as It } from "../Damped-BXsGpI-B.js";
|
|
20
|
+
var F, ct, rt, B;
|
|
21
|
+
class dt {
|
|
22
|
+
constructor(o) {
|
|
23
23
|
i(this, F, null);
|
|
24
24
|
i(this, ct);
|
|
25
|
-
i(this,
|
|
25
|
+
i(this, rt, !1);
|
|
26
26
|
i(this, B, () => {
|
|
27
|
-
e(this,
|
|
27
|
+
e(this, rt, !(t(this, F).scrollWidth > t(this, F).clientWidth));
|
|
28
28
|
});
|
|
29
|
-
e(this, ct,
|
|
29
|
+
e(this, ct, o), e(this, F, Et(t(this, ct))), St.subscribe(t(this, F), t(this, B)), ot.subscribe(t(this, B)), t(this, B).call(this);
|
|
30
30
|
}
|
|
31
31
|
get element() {
|
|
32
32
|
return t(this, F);
|
|
33
33
|
}
|
|
34
34
|
get currentScrollValue() {
|
|
35
|
-
return t(this,
|
|
35
|
+
return t(this, rt) ? t(this, F).scrollTop : t(this, F).scrollLeft;
|
|
36
36
|
}
|
|
37
37
|
get vertical() {
|
|
38
|
-
return t(this,
|
|
38
|
+
return t(this, rt);
|
|
39
39
|
}
|
|
40
40
|
destroy() {
|
|
41
|
-
|
|
41
|
+
St.unsubscribe(t(this, B)), ot.unsubscribe(t(this, B));
|
|
42
42
|
}
|
|
43
|
-
onScroll(
|
|
44
|
-
t(this, F).addEventListener("scroll",
|
|
43
|
+
onScroll(o) {
|
|
44
|
+
t(this, F).addEventListener("scroll", o);
|
|
45
45
|
}
|
|
46
|
-
offScroll(
|
|
47
|
-
t(this, F).removeEventListener("scroll",
|
|
46
|
+
offScroll(o) {
|
|
47
|
+
t(this, F).removeEventListener("scroll", o);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
F = new WeakMap(), ct = new WeakMap(),
|
|
51
|
-
var f, G, K, Z, j, I, $, H, W, d, v, C, y, N, m,
|
|
52
|
-
let
|
|
50
|
+
F = new WeakMap(), ct = new WeakMap(), rt = new WeakMap(), B = new WeakMap();
|
|
51
|
+
var f, G, K, Z, j, I, $, H, W, d, v, C, y, N, m, z, k, E, X, D, x, M, p, P, V, R, O, L, it, n, _, J, ht, S, T, g, b, w, Y, q, a, Q, h, gt, lt, vt, Ct, yt, Pt, Vt, Ft, nt, tt, ft, U, Lt, wt, pt, bt;
|
|
52
|
+
let $t = (bt = class extends HTMLElement {
|
|
53
53
|
constructor() {
|
|
54
54
|
super(...arguments);
|
|
55
55
|
i(this, h);
|
|
@@ -68,87 +68,96 @@ let It = (dt = class extends HTMLElement {
|
|
|
68
68
|
i(this, y);
|
|
69
69
|
i(this, N);
|
|
70
70
|
i(this, m);
|
|
71
|
+
i(this, z);
|
|
71
72
|
i(this, k);
|
|
72
|
-
i(this, D);
|
|
73
73
|
i(this, E);
|
|
74
|
-
i(this,
|
|
74
|
+
i(this, X);
|
|
75
|
+
i(this, D);
|
|
75
76
|
i(this, x);
|
|
76
77
|
i(this, M);
|
|
77
|
-
i(this, T);
|
|
78
78
|
i(this, p);
|
|
79
79
|
i(this, P);
|
|
80
80
|
i(this, V);
|
|
81
81
|
i(this, R);
|
|
82
82
|
i(this, O);
|
|
83
83
|
i(this, L);
|
|
84
|
-
i(this,
|
|
84
|
+
i(this, it);
|
|
85
85
|
i(this, n);
|
|
86
86
|
i(this, _);
|
|
87
87
|
i(this, J);
|
|
88
|
-
i(this,
|
|
88
|
+
i(this, ht);
|
|
89
89
|
i(this, S);
|
|
90
|
-
i(this,
|
|
90
|
+
i(this, T);
|
|
91
91
|
i(this, g);
|
|
92
92
|
i(this, b);
|
|
93
93
|
i(this, w);
|
|
94
|
-
i(this,
|
|
94
|
+
i(this, Y);
|
|
95
95
|
i(this, q);
|
|
96
96
|
i(this, a);
|
|
97
97
|
i(this, Q);
|
|
98
|
-
i(this,
|
|
99
|
-
i(this,
|
|
100
|
-
e(this, f, null), e(this, G, new
|
|
98
|
+
i(this, nt);
|
|
99
|
+
i(this, tt);
|
|
100
|
+
e(this, f, null), e(this, G, new u(this, "--damping", 20)), e(this, K, new u(this, "--mass", 0)), e(this, Z, new u(this, "--stiffness", 0)), e(this, j, new u(this, "--target", "")), e(this, I, new u(this, "--disabled", !1)), e(this, $, new u(
|
|
101
101
|
this,
|
|
102
102
|
"--distance-offset",
|
|
103
103
|
0,
|
|
104
104
|
{ rawValueCheck: !1 }
|
|
105
|
-
)), e(this, H, new
|
|
105
|
+
)), e(this, H, new u(this, "--start-offset", 0, {
|
|
106
106
|
rawValueCheck: !1
|
|
107
|
-
})), e(this, W, new
|
|
107
|
+
})), e(this, W, new u(
|
|
108
108
|
this,
|
|
109
109
|
"--capture-once",
|
|
110
110
|
!1
|
|
111
|
-
)), e(this, d, new
|
|
111
|
+
)), e(this, d, new u(this, "--captured", "")), e(this, v, new u(this, "--released", "")), e(this, C, new u(
|
|
112
112
|
this,
|
|
113
113
|
"--captured-from-start",
|
|
114
114
|
""
|
|
115
|
-
)), e(this, y, new
|
|
115
|
+
)), e(this, y, new u(
|
|
116
116
|
this,
|
|
117
117
|
"--captured-from-finish",
|
|
118
118
|
""
|
|
119
|
-
)), e(this, N, new
|
|
119
|
+
)), e(this, N, new u(
|
|
120
120
|
this,
|
|
121
121
|
"--released-from-start",
|
|
122
122
|
""
|
|
123
|
-
)), e(this, m, new
|
|
123
|
+
)), e(this, m, new u(
|
|
124
124
|
this,
|
|
125
125
|
"--released-from-finish",
|
|
126
126
|
""
|
|
127
|
-
)), e(this,
|
|
127
|
+
)), e(this, z, new u(this, "--passed-var", "")), e(this, k, new u(this, "--progress-var", "")), e(this, E, new u(
|
|
128
128
|
this,
|
|
129
129
|
"--progress-arc-var",
|
|
130
130
|
""
|
|
131
|
-
)), e(this,
|
|
131
|
+
)), e(this, X, new u(
|
|
132
132
|
this,
|
|
133
133
|
"--animation-var-type",
|
|
134
134
|
"target"
|
|
135
|
-
)), e(this,
|
|
136
|
-
|
|
135
|
+
)), e(this, D, new u(this, "--distance-var", "")), e(this, x, new u(this, "--start-var", "")), e(this, M, new u(this, "--finish-var", "")), e(this, p, new et(!1)), e(this, P, new et(!1)), e(this, V, new et(!1)), e(this, R, new et(!1)), e(this, O, new et(!1)), e(this, L, new et(!1)), e(this, it, []), e(this, n, this), e(this, _, 0), e(this, J, 0), e(this, ht, 0), e(this, S, new It(0, { order: Ot.SEGMENT, min: 0, max: 1 })), e(this, T, 0), e(this, g, 0), e(this, b, 0), e(this, w, 0), e(this, Y, !1), e(this, q, !1), e(this, a, !0), e(this, Q, !1), this.resize = () => {
|
|
136
|
+
e(this, J, t(this, f).vertical ? this.offsetHeight : this.offsetWidth);
|
|
137
|
+
const r = t(this, f) instanceof HTMLElement ? t(this, f) : t(this, f).element;
|
|
138
|
+
e(this, _, t(this, f).vertical ? Dt(this, r) : xt(this, r));
|
|
139
|
+
const s = Mt(
|
|
140
|
+
this,
|
|
141
|
+
t(this, f).vertical ? "top" : "left"
|
|
142
|
+
);
|
|
143
|
+
e(this, _, t(this, _) - s), e(this, g, this.getStart()), e(this, b, this.getDistance()), e(this, g, t(this, g) + t(this, H).current), e(this, b, t(this, b) + t(this, $).current), e(this, w, t(this, g) + t(this, b)), t(this, f).currentScrollValue > t(this, w) && !t(this, p).current && !t(this, P).current && (t(this, p).current = !0), this.setVar(t(this, x).current, t(this, g)), this.setVar(t(this, M).current, t(this, w)), this.setVar(t(this, D).current, t(this, b)), t(this, S).max = t(this, b), e(this, Y, !0), t(this, tt).call(this);
|
|
144
|
+
}, this.findAnotherScrollEntries = kt(() => {
|
|
145
|
+
const r = At.getAll(this).reverse();
|
|
137
146
|
let s = 0;
|
|
138
|
-
r.forEach((A,
|
|
139
|
-
A.element === t(this, f) && (s =
|
|
140
|
-
}), e(this,
|
|
141
|
-
}, 0), e(this,
|
|
142
|
-
t(this, a) ||
|
|
143
|
-
}), e(this,
|
|
144
|
-
!t(this, a) && t(this,
|
|
147
|
+
r.forEach((A, ut) => {
|
|
148
|
+
A.element === t(this, f) && (s = ut);
|
|
149
|
+
}), e(this, it, r.slice(s + 1));
|
|
150
|
+
}, 0), e(this, nt, () => {
|
|
151
|
+
t(this, a) || this.resize();
|
|
152
|
+
}), e(this, tt, () => {
|
|
153
|
+
!t(this, a) && t(this, Y) && this.tick();
|
|
145
154
|
});
|
|
146
155
|
}
|
|
147
156
|
get scrollContainer() {
|
|
148
157
|
return t(this, f);
|
|
149
158
|
}
|
|
150
159
|
set scrollContainer(r) {
|
|
151
|
-
|
|
160
|
+
c(this, h, lt).call(this), e(this, f, r), c(this, h, gt).call(this);
|
|
152
161
|
}
|
|
153
162
|
get distanceOffsetCSSProperty() {
|
|
154
163
|
return t(this, $);
|
|
@@ -178,25 +187,25 @@ let It = (dt = class extends HTMLElement {
|
|
|
178
187
|
return t(this, m);
|
|
179
188
|
}
|
|
180
189
|
get passedVarCSSProperty() {
|
|
181
|
-
return t(this,
|
|
190
|
+
return t(this, z);
|
|
182
191
|
}
|
|
183
192
|
get progressVarCSSProperty() {
|
|
184
|
-
return t(this,
|
|
193
|
+
return t(this, k);
|
|
185
194
|
}
|
|
186
195
|
get progressArcVarCSSProperty() {
|
|
187
196
|
return t(this, E);
|
|
188
197
|
}
|
|
189
198
|
get animationVarTypeCSSProperty() {
|
|
190
|
-
return t(this,
|
|
199
|
+
return t(this, X);
|
|
191
200
|
}
|
|
192
201
|
get distanceVarCSSProperty() {
|
|
193
|
-
return t(this,
|
|
202
|
+
return t(this, D);
|
|
194
203
|
}
|
|
195
204
|
get startVarCSSProperty() {
|
|
196
|
-
return t(this,
|
|
205
|
+
return t(this, x);
|
|
197
206
|
}
|
|
198
207
|
get finishVarCSSProperty() {
|
|
199
|
-
return t(this,
|
|
208
|
+
return t(this, M);
|
|
200
209
|
}
|
|
201
210
|
get disabledCSSProperty() {
|
|
202
211
|
return t(this, I);
|
|
@@ -241,7 +250,7 @@ let It = (dt = class extends HTMLElement {
|
|
|
241
250
|
return t(this, S);
|
|
242
251
|
}
|
|
243
252
|
get progress() {
|
|
244
|
-
return t(this,
|
|
253
|
+
return t(this, T);
|
|
245
254
|
}
|
|
246
255
|
get start() {
|
|
247
256
|
return t(this, g);
|
|
@@ -258,39 +267,29 @@ let It = (dt = class extends HTMLElement {
|
|
|
258
267
|
get isDisabled() {
|
|
259
268
|
return t(this, a);
|
|
260
269
|
}
|
|
261
|
-
resize() {
|
|
262
|
-
e(this, J, t(this, f).vertical ? this.offsetHeight : this.offsetWidth);
|
|
263
|
-
const r = t(this, f) instanceof HTMLElement ? t(this, f) : t(this, f).element;
|
|
264
|
-
e(this, _, t(this, f).vertical ? kt(this, r) : Dt(this, r));
|
|
265
|
-
const s = xt(
|
|
266
|
-
this,
|
|
267
|
-
t(this, f).vertical ? "top" : "left"
|
|
268
|
-
);
|
|
269
|
-
e(this, _, t(this, _) - s), e(this, g, this.getStart()), e(this, b, this.getDistance()), e(this, g, t(this, g) + t(this, H).current), e(this, b, t(this, b) + t(this, $).current), e(this, w, t(this, g) + t(this, b)), t(this, f).currentScrollValue > t(this, w) && !t(this, p).current && !t(this, P).current && (t(this, p).current = !0), this.setVar(t(this, M).current, t(this, g)), this.setVar(t(this, T).current, t(this, w)), this.setVar(t(this, x).current, t(this, b)), t(this, S).max = t(this, b), e(this, tt, !0);
|
|
270
|
-
}
|
|
271
270
|
tick() {
|
|
272
271
|
let r = t(this, f).currentScrollValue;
|
|
273
|
-
t(this,
|
|
274
|
-
r +=
|
|
272
|
+
t(this, it).forEach((ut) => {
|
|
273
|
+
r += ut.value;
|
|
275
274
|
});
|
|
276
275
|
const s = r - t(this, g);
|
|
277
276
|
t(this, Q) || e(this, Q, t(this, S).previous ? Math.abs(t(this, S).previous - s) > 1e3 : !1), t(this, S).set(s);
|
|
278
277
|
const A = Math.round(r);
|
|
279
|
-
t(this, p).current && (A >= t(this, g) ? t(this, V).current ||
|
|
280
|
-
|
|
281
|
-
),
|
|
278
|
+
t(this, p).current && (A >= t(this, g) ? t(this, V).current || c(this, h, yt).call(this) : t(this, V).current && !t(this, R).current && c(this, h, Vt).call(this), A < t(this, w) ? t(this, L).current && !t(this, O).current && c(this, h, Pt).call(this) : t(this, V).current && !t(this, L).current && c(this, h, Ft).call(this)), A >= t(this, g) && A < t(this, w) ? t(this, p).current || c(this, h, vt).call(this) : t(this, p).current && (t(this, S).set(
|
|
279
|
+
Tt(t(this, b) / 2, t(this, S).target, 0, t(this, b))
|
|
280
|
+
), c(this, h, Ct).call(this)), t(this, q) && t(this, W).current && (t(this, d).current && t(this, n).classList.add(t(this, d).current), e(this, a, !0));
|
|
282
281
|
}
|
|
283
282
|
disable() {
|
|
284
|
-
this.style.cssText = "", e(this, _, 0), e(this, J, 0), t(this, S).reset(), e(this,
|
|
283
|
+
this.style.cssText = "", e(this, _, 0), e(this, J, 0), t(this, S).reset(), e(this, T, 0), e(this, g, 0), e(this, b, 0), e(this, w, 0), e(this, Y, !1), t(this, p).current = !1, t(this, P).current = !1, t(this, V).current = !1, t(this, R).current = !1, t(this, O).current = !1, t(this, L).current = !1, e(this, q, !1), e(this, a, !0), c(this, h, pt).call(this);
|
|
285
284
|
}
|
|
286
285
|
enable() {
|
|
287
286
|
e(this, a, !1);
|
|
288
287
|
}
|
|
289
288
|
connectedCallback() {
|
|
290
|
-
this.scrollContainer = new
|
|
289
|
+
this.scrollContainer = new dt(this);
|
|
291
290
|
}
|
|
292
291
|
disconnectedCallback() {
|
|
293
|
-
t(this, f) instanceof
|
|
292
|
+
t(this, f) instanceof dt && t(this, f).destroy(), c(this, h, lt).call(this);
|
|
294
293
|
}
|
|
295
294
|
removeVar(r) {
|
|
296
295
|
r && t(this, n).style.removeProperty(`--${r}`);
|
|
@@ -299,45 +298,45 @@ let It = (dt = class extends HTMLElement {
|
|
|
299
298
|
r && t(this, n).style.setProperty(`--${r}`, s.toString());
|
|
300
299
|
}
|
|
301
300
|
getDistance() {
|
|
302
|
-
return t(this, J) + t(this,
|
|
301
|
+
return t(this, J) + t(this, ht);
|
|
303
302
|
}
|
|
304
303
|
getStart() {
|
|
305
|
-
return t(this, _) - t(this,
|
|
304
|
+
return t(this, _) - t(this, ht);
|
|
306
305
|
}
|
|
307
|
-
}, f = new WeakMap(), G = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), j = new WeakMap(), I = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), W = new WeakMap(), d = new WeakMap(), v = new WeakMap(), C = new WeakMap(), y = new WeakMap(), N = new WeakMap(), m = new WeakMap(),
|
|
306
|
+
}, f = new WeakMap(), G = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), j = new WeakMap(), I = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), W = new WeakMap(), d = new WeakMap(), v = new WeakMap(), C = new WeakMap(), y = new WeakMap(), N = new WeakMap(), m = new WeakMap(), z = new WeakMap(), k = new WeakMap(), E = new WeakMap(), X = new WeakMap(), D = new WeakMap(), x = new WeakMap(), M = new WeakMap(), p = new WeakMap(), P = new WeakMap(), V = new WeakMap(), R = new WeakMap(), O = new WeakMap(), L = new WeakMap(), it = new WeakMap(), n = new WeakMap(), _ = new WeakMap(), J = new WeakMap(), ht = new WeakMap(), S = new WeakMap(), T = new WeakMap(), g = new WeakMap(), b = new WeakMap(), w = new WeakMap(), Y = new WeakMap(), q = new WeakMap(), a = new WeakMap(), Q = new WeakMap(), h = new WeakSet(), gt = function() {
|
|
308
307
|
if (!t(this, f))
|
|
309
308
|
return;
|
|
310
309
|
t(this, p).subscribe((s) => {
|
|
311
|
-
s.current &&
|
|
310
|
+
s.current && st(this, "scrollSegmentCapture", {
|
|
312
311
|
composed: !0,
|
|
313
312
|
custom: !0
|
|
314
313
|
});
|
|
315
314
|
}), t(this, V).subscribe((s) => {
|
|
316
|
-
s.current &&
|
|
315
|
+
s.current && st(this, "scrollSegmentCaptureFromStart", {
|
|
317
316
|
composed: !0,
|
|
318
317
|
custom: !0
|
|
319
318
|
});
|
|
320
319
|
}), t(this, O).subscribe((s) => {
|
|
321
|
-
s.current &&
|
|
320
|
+
s.current && st(this, "scrollSegmentCaptureFromFinish", {
|
|
322
321
|
composed: !0,
|
|
323
322
|
custom: !0
|
|
324
323
|
});
|
|
325
324
|
}), t(this, P).subscribe((s) => {
|
|
326
|
-
s.current &&
|
|
325
|
+
s.current && st(this, "scrollSegmentRelease", {
|
|
327
326
|
composed: !0,
|
|
328
327
|
custom: !0
|
|
329
328
|
});
|
|
330
329
|
}), t(this, R).subscribe((s) => {
|
|
331
|
-
s.current &&
|
|
330
|
+
s.current && st(this, "scrollSegmentReleaseFromStart", {
|
|
332
331
|
composed: !0,
|
|
333
332
|
custom: !0
|
|
334
333
|
});
|
|
335
334
|
}), t(this, L).subscribe((s) => {
|
|
336
|
-
s.current &&
|
|
335
|
+
s.current && st(this, "scrollSegmentReleaseFromFinish", {
|
|
337
336
|
composed: !0,
|
|
338
337
|
custom: !0
|
|
339
338
|
});
|
|
340
|
-
}), t(this, G).observe(), t(this, K).observe(), t(this, Z).observe(), t(this, j).observe(), t(this, I).observe(), t(this, $).observe(), t(this, H).observe(), t(this, W).observe(), t(this, d).observe(), t(this, v).observe(), t(this, C).observe(), t(this, y).observe(), t(this, N).observe(), t(this, m).observe(), t(this,
|
|
339
|
+
}), t(this, G).observe(), t(this, K).observe(), t(this, Z).observe(), t(this, j).observe(), t(this, I).observe(), t(this, $).observe(), t(this, H).observe(), t(this, W).observe(), t(this, d).observe(), t(this, v).observe(), t(this, C).observe(), t(this, y).observe(), t(this, N).observe(), t(this, m).observe(), t(this, z).observe(), t(this, k).observe(), t(this, E).observe(), t(this, X).observe(), t(this, D).observe(), t(this, x).observe(), t(this, M).observe();
|
|
341
340
|
let r = !1;
|
|
342
341
|
this.findAnotherScrollEntries(), t(this, I).current || this.enable(), t(this, G).subscribe((s) => {
|
|
343
342
|
t(this, S).damping = s.current;
|
|
@@ -346,7 +345,7 @@ let It = (dt = class extends HTMLElement {
|
|
|
346
345
|
}), t(this, Z).subscribe((s) => {
|
|
347
346
|
t(this, S).stiffness = s.current;
|
|
348
347
|
}), t(this, j).subscribe((s) => {
|
|
349
|
-
s.previous &&
|
|
348
|
+
s.previous && c(this, h, pt).call(this), s.current ? s.current === "parent" ? e(this, n, this.parentElement || this) : e(this, n, document.querySelector(s.current) || this) : e(this, n, this);
|
|
350
349
|
}), t(this, I).subscribe((s) => {
|
|
351
350
|
s.current && !s.previous ? this.disable() : !s.current && s.previous && (this.resize(), this.enable());
|
|
352
351
|
}), t(this, H).subscribe(() => {
|
|
@@ -354,94 +353,96 @@ let It = (dt = class extends HTMLElement {
|
|
|
354
353
|
}), t(this, $).subscribe(() => {
|
|
355
354
|
r && !t(this, a) && this.resize();
|
|
356
355
|
}), t(this, d).subscribe((s) => {
|
|
357
|
-
|
|
356
|
+
c(this, h, U).call(this, s);
|
|
358
357
|
}), t(this, C).subscribe((s) => {
|
|
359
|
-
|
|
358
|
+
c(this, h, U).call(this, s);
|
|
360
359
|
}), t(this, y).subscribe((s) => {
|
|
361
|
-
|
|
360
|
+
c(this, h, U).call(this, s);
|
|
362
361
|
}), t(this, v).subscribe((s) => {
|
|
363
|
-
|
|
362
|
+
c(this, h, U).call(this, s);
|
|
364
363
|
}), t(this, N).subscribe((s) => {
|
|
365
|
-
|
|
364
|
+
c(this, h, U).call(this, s);
|
|
366
365
|
}), t(this, m).subscribe((s) => {
|
|
367
|
-
|
|
366
|
+
c(this, h, U).call(this, s);
|
|
368
367
|
}), t(this, W).subscribe((s) => {
|
|
369
368
|
t(this, a) || !s.current && s.previous && (this.resize(), this.enable());
|
|
370
|
-
}), t(this,
|
|
369
|
+
}), t(this, z).subscribe((s) => {
|
|
371
370
|
t(this, a) || (this.removeVar(s.previous), this.setVar(s.current, this.passed.current));
|
|
372
|
-
}), t(this,
|
|
373
|
-
t(this, a) || (this.removeVar(s.previous), this.setVar(s.current, t(this,
|
|
371
|
+
}), t(this, k).subscribe((s) => {
|
|
372
|
+
t(this, a) || (this.removeVar(s.previous), this.setVar(s.current, t(this, T)));
|
|
374
373
|
}), t(this, E).subscribe((s) => {
|
|
375
|
-
t(this, a) || (this.removeVar(s.previous), this.setVar(s.current,
|
|
376
|
-
}), t(this,
|
|
374
|
+
t(this, a) || (this.removeVar(s.previous), this.setVar(s.current, c(this, h, ft).call(this)));
|
|
375
|
+
}), t(this, x).subscribe((s) => {
|
|
377
376
|
t(this, a) || (this.removeVar(s.previous), this.setVar(s.current, t(this, g)));
|
|
378
|
-
}), t(this,
|
|
377
|
+
}), t(this, M).subscribe((s) => {
|
|
379
378
|
t(this, a) || (this.removeVar(s.previous), this.setVar(s.current, t(this, w)));
|
|
380
|
-
}), t(this,
|
|
379
|
+
}), t(this, D).subscribe((s) => {
|
|
381
380
|
t(this, a) || (this.removeVar(s.previous), this.setVar(s.current, t(this, b)));
|
|
382
381
|
}), t(this, S).subscribe((s) => {
|
|
383
382
|
if (t(this, Q)) {
|
|
384
383
|
e(this, Q, !1);
|
|
385
384
|
return;
|
|
386
385
|
}
|
|
387
|
-
const A = t(this, S)[t(this,
|
|
388
|
-
e(this,
|
|
389
|
-
t(this,
|
|
390
|
-
t(this,
|
|
386
|
+
const A = t(this, S)[t(this, X).current];
|
|
387
|
+
e(this, T, A / t(this, b) || 0), this.setVar(t(this, z).current, A.toFixed(6)), this.setVar(
|
|
388
|
+
t(this, k).current,
|
|
389
|
+
t(this, T).toFixed(6)
|
|
391
390
|
), t(this, E).current && this.setVar(
|
|
392
391
|
t(this, E).current,
|
|
393
|
-
|
|
392
|
+
c(this, h, ft).call(this).toFixed(6)
|
|
394
393
|
);
|
|
395
|
-
}),
|
|
396
|
-
},
|
|
397
|
-
t(this, f) && (
|
|
398
|
-
},
|
|
394
|
+
}), ot.subscribe(t(this, nt), zt.SCROLL + 1), this.scrollContainer.onScroll(t(this, tt)), r = !0;
|
|
395
|
+
}, lt = function() {
|
|
396
|
+
t(this, f) && (ot.unsubscribe(t(this, nt)), this.scrollContainer.offScroll(t(this, tt)), t(this, G).close(), t(this, K).close(), t(this, Z).close(), t(this, j).close(), t(this, I).close(), t(this, $).close(), t(this, H).close(), t(this, W).close(), t(this, d).close(), t(this, v).close(), t(this, C).close(), t(this, y).close(), t(this, N).close(), t(this, m).close(), t(this, z).close(), t(this, k).close(), t(this, E).close(), t(this, D).close(), t(this, x).close(), t(this, M).close(), t(this, p).close(), t(this, P).close(), t(this, V).close(), t(this, R).close(), t(this, O).close(), t(this, L).close(), this.disable());
|
|
397
|
+
}, vt = function() {
|
|
399
398
|
t(this, p).current = !0, t(this, P).current = !1, e(this, q, !0), t(this, v).current && t(this, n).classList.remove(t(this, v).current), t(this, m).current && t(this, n).classList.remove(
|
|
400
399
|
t(this, m).current
|
|
401
400
|
), t(this, m).current && t(this, n).classList.remove(
|
|
402
401
|
t(this, m).current
|
|
403
402
|
), t(this, d).current && t(this, n).classList.add(t(this, d).current);
|
|
404
|
-
},
|
|
403
|
+
}, Ct = function() {
|
|
405
404
|
t(this, P).current = !0, t(this, p).current = !1, e(this, q, !0), t(this, d).current && t(this, n).classList.remove(t(this, d).current), t(this, C).current && t(this, n).classList.remove(
|
|
406
405
|
t(this, C).current
|
|
407
406
|
), t(this, y).current && t(this, n).classList.remove(
|
|
408
407
|
t(this, y).current
|
|
409
408
|
), t(this, v).current && t(this, n).classList.add(t(this, v).current);
|
|
410
|
-
},
|
|
409
|
+
}, yt = function() {
|
|
411
410
|
t(this, p).current = !0, t(this, V).current = !0, t(this, R).current = !1, t(this, C).current && t(this, n).classList.add(
|
|
412
411
|
t(this, C).current
|
|
413
412
|
);
|
|
414
|
-
},
|
|
413
|
+
}, Pt = function() {
|
|
415
414
|
t(this, p).current = !0, t(this, O).current = !0, t(this, L).current = !1, t(this, y).current && t(this, n).classList.add(
|
|
416
415
|
t(this, y).current
|
|
417
416
|
);
|
|
418
|
-
},
|
|
417
|
+
}, Vt = function() {
|
|
419
418
|
t(this, P).current = !0, t(this, R).current = !0, t(this, V).current = !1, t(this, m).current && t(this, n).classList.add(
|
|
420
419
|
t(this, m).current
|
|
421
420
|
);
|
|
422
|
-
},
|
|
421
|
+
}, Ft = function() {
|
|
423
422
|
t(this, P).current = !0, t(this, L).current = !0, t(this, O).current = !1, t(this, m).current && t(this, n).classList.add(
|
|
424
423
|
t(this, m).current
|
|
425
424
|
);
|
|
426
|
-
},
|
|
425
|
+
}, nt = new WeakMap(), tt = new WeakMap(), ft = function() {
|
|
426
|
+
return Math.abs(Math.cos(t(this, T) * Math.PI));
|
|
427
|
+
}, U = function(r) {
|
|
427
428
|
if (t(this, a)) {
|
|
428
429
|
r.previous && t(this, n).classList.remove(r.previous), r.current && t(this, n).classList.remove(r.current);
|
|
429
430
|
return;
|
|
430
431
|
}
|
|
431
432
|
r.current && t(this, p).current ? (r.previous && t(this, n).classList.remove(r.previous), t(this, n).classList.add(r.current)) : !r.current && r.previous && t(this, n).classList.remove(r.previous);
|
|
432
|
-
},
|
|
433
|
+
}, Lt = function(...r) {
|
|
433
434
|
r.forEach((s) => {
|
|
434
435
|
s && t(this, n).classList.remove(s);
|
|
435
436
|
});
|
|
436
|
-
},
|
|
437
|
+
}, wt = function(...r) {
|
|
437
438
|
r.forEach((s) => {
|
|
438
439
|
s && t(this, n).style.removeProperty(`--${s}`);
|
|
439
440
|
});
|
|
440
441
|
}, pt = function() {
|
|
441
|
-
|
|
442
|
-
},
|
|
443
|
-
|
|
442
|
+
c(this, h, Lt).call(this, t(this, d).current, t(this, C).current, t(this, y).current, t(this, v).current, t(this, N).current, t(this, m).current), c(this, h, wt).call(this, t(this, z).current, t(this, k).current, t(this, E).current, t(this, D).current, t(this, x).current, t(this, M).current);
|
|
443
|
+
}, bt);
|
|
444
|
+
Rt && !customElements.get("scroll-segment") && customElements.define("scroll-segment", $t);
|
|
444
445
|
export {
|
|
445
|
-
|
|
446
|
-
|
|
446
|
+
dt as ScrollSegmentDefaultContainer,
|
|
447
|
+
$t as ScrollSegmentElement
|
|
447
448
|
};
|