aptechka 0.50.22 → 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 +72 -73
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var bt=l=>{throw TypeError(l)};var lt=(l,o,r)=>o.has(l)||bt("Cannot "+r);var t=(l,o,r)=>(lt(l,o,"read from private field"),r?r.call(l):o.get(l)),i=(l,o,r)=>o.has(l)?bt("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(l):o.set(l,r),e=(l,o,r,s)=>(lt(l,o,"write to private field"),s?s.call(l,r):o.set(l,r),r),c=(l,o,r)=>(lt(l,o,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ot=require("../dom-JBOkFLTh.cjs"),qt=require("../index-Cqw2NKev.cjs"),ot=require("../element-resizer/index.cjs"),ut=require("../window-resizer/index.cjs"),u=require("../css-property/index.cjs"),Ct=require("../order/index.cjs"),et=require("../events-KVanG9sR.cjs"),xt=require("../function-MthRj-GJ.cjs"),St=require("../layout-Ctc2p3uz.cjs"),kt=require("../math-GDWEqu7y.cjs"),rt=require("../Store-DRp_K37w.cjs"),Dt=require("../scroll-entries/index.cjs");require("../ticker/index.cjs");const Mt=require("../Damped-B1lXa9nb.cjs");var w,ct,it,j;class ft{constructor(o){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,o),e(this,w,Ot.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(o){t(this,w).addEventListener("scroll",o)}offScroll(o){t(this,w).removeEventListener("scroll",o)}}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,O,q,L,Y,x,k,D,f,P,V,R,z,F,ht,n,W,J,nt,d,M,C,b,E,tt,N,a,Q,h,yt,pt,Pt,Vt,wt,Ft,Et,Lt,U,st,dt,X,Rt,zt,mt,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,Y);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,ht);i(this,n);i(this,W);i(this,J);i(this,nt);i(this,d);i(this,M);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 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,Y,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 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 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,tt,!1),e(this,N,!1),e(this,a,!0),e(this,Q,!1),this.findAnotherScrollEntries=xt.debounce(()=>{const r=Dt.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){c(this,h,pt).call(this),e(this,S,r),c(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,Y)}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)}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,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,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||c(this,h,wt).call(this):t(this,V).current&&!t(this,R).current&&c(this,h,Et).call(this),T<t(this,E)?t(this,F).current&&!t(this,z).current&&c(this,h,Ft).call(this):t(this,V).current&&!t(this,F).current&&c(this,h,Lt).call(this)),T>=t(this,C)&&T<t(this,E)?t(this,f).current||c(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))),c(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,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),c(this,h,mt).call(this)}enable(){e(this,a,!1)}connectedCallback(){this.scrollContainer=new ft(this)}disconnectedCallback(){t(this,S)instanceof ft&&t(this,S).destroy(),c(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,O=new WeakMap,q=new WeakMap,L=new WeakMap,Y=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,ht=new WeakMap,n=new WeakMap,W=new WeakMap,J=new WeakMap,nt=new WeakMap,d=new WeakMap,M=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,yt=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,O).observe(),t(this,q).observe(),t(this,L).observe(),t(this,Y).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&&c(this,h,mt).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=>{c(this,h,X).call(this,s)}),t(this,v).subscribe(s=>{c(this,h,X).call(this,s)}),t(this,y).subscribe(s=>{c(this,h,X).call(this,s)}),t(this,g).subscribe(s=>{c(this,h,X).call(this,s)}),t(this,H).subscribe(s=>{c(this,h,X).call(this,s)}),t(this,p).subscribe(s=>{c(this,h,X).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,c(this,h,dt).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,Y).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,c(this,h,dt).call(this).toFixed(6))}),ut.windowResizer.subscribe(t(this,U),Ct.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,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)},U=new WeakMap,st=new WeakMap,dt=function(){return Math.abs(Math.cos(t(this,M)*Math.PI))},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)},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}`)})},mt=function(){c(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),c(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=ft;exports.ScrollSegmentElement=vt;
|
|
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,44 +1,44 @@
|
|
|
1
|
-
var
|
|
1
|
+
var mt = (l) => {
|
|
2
2
|
throw TypeError(l);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var t = (l, o, r) => (
|
|
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
6
|
import { f as Et } from "../dom-CVWzyXPH.js";
|
|
7
7
|
import { i as Rt } from "../index-euf5anj6.js";
|
|
8
|
-
import { elementResizer as
|
|
9
|
-
import { windowResizer as
|
|
8
|
+
import { elementResizer as St } from "../element-resizer/index.js";
|
|
9
|
+
import { windowResizer as ot } from "../window-resizer/index.js";
|
|
10
10
|
import { CSSProperty as u } from "../css-property/index.js";
|
|
11
11
|
import { TICK_ORDER as Ot, RESIZE_ORDER as zt } from "../order/index.js";
|
|
12
|
-
import { d as
|
|
12
|
+
import { d as st } from "../events-CsVF98U6.js";
|
|
13
13
|
import { d as kt } from "../function-C10DGppn.js";
|
|
14
14
|
import { a as Dt, g as xt, c as Mt } from "../layout-DpZo-I0y.js";
|
|
15
15
|
import { s as Tt } from "../math-BOBiC4TN.js";
|
|
16
|
-
import { S as
|
|
16
|
+
import { S as et } from "../Store-D2xCXENW.js";
|
|
17
17
|
import { scrollEntries as At } from "../scroll-entries/index.js";
|
|
18
18
|
import "../ticker/index.js";
|
|
19
19
|
import { D as It } from "../Damped-BXsGpI-B.js";
|
|
20
|
-
var F, ct,
|
|
20
|
+
var F, ct, rt, B;
|
|
21
21
|
class dt {
|
|
22
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, o), e(this, F, Et(t(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
43
|
onScroll(o) {
|
|
44
44
|
t(this, F).addEventListener("scroll", o);
|
|
@@ -47,8 +47,8 @@ class dt {
|
|
|
47
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, z, k, E,
|
|
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
52
|
let $t = (bt = class extends HTMLElement {
|
|
53
53
|
constructor() {
|
|
54
54
|
super(...arguments);
|
|
@@ -71,7 +71,7 @@ let $t = (bt = class extends HTMLElement {
|
|
|
71
71
|
i(this, z);
|
|
72
72
|
i(this, k);
|
|
73
73
|
i(this, E);
|
|
74
|
-
i(this,
|
|
74
|
+
i(this, X);
|
|
75
75
|
i(this, D);
|
|
76
76
|
i(this, x);
|
|
77
77
|
i(this, M);
|
|
@@ -81,22 +81,22 @@ let $t = (bt = class extends HTMLElement {
|
|
|
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
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,
|
|
98
|
+
i(this, nt);
|
|
99
|
+
i(this, tt);
|
|
100
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",
|
|
@@ -128,27 +128,36 @@ let $t = (bt = class extends HTMLElement {
|
|
|
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, 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
|
|
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(() => {
|
|
136
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
|
-
c(this, h,
|
|
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, $);
|
|
@@ -187,7 +196,7 @@ let $t = (bt = class extends HTMLElement {
|
|
|
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
202
|
return t(this, D);
|
|
@@ -258,20 +267,10 @@ let $t = (bt = 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 ? Dt(this, r) : xt(this, r));
|
|
265
|
-
const s = Mt(
|
|
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, 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, 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);
|
|
@@ -281,7 +280,7 @@ let $t = (bt = class extends HTMLElement {
|
|
|
281
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, T, 0), e(this, g, 0), e(this, b, 0), e(this, w, 0), 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);
|
|
@@ -290,7 +289,7 @@ let $t = (bt = class extends HTMLElement {
|
|
|
290
289
|
this.scrollContainer = new dt(this);
|
|
291
290
|
}
|
|
292
291
|
disconnectedCallback() {
|
|
293
|
-
t(this, f) instanceof dt && t(this, f).destroy(), c(this, h,
|
|
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 $t = (bt = 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(), z = new WeakMap(), k = new WeakMap(), E = 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, z).observe(), t(this, k).observe(), t(this, E).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 $t = (bt = 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 && c(this, h,
|
|
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,17 +353,17 @@ let $t = (bt = class extends HTMLElement {
|
|
|
354
353
|
}), t(this, $).subscribe(() => {
|
|
355
354
|
r && !t(this, a) && this.resize();
|
|
356
355
|
}), t(this, d).subscribe((s) => {
|
|
357
|
-
c(this, h,
|
|
356
|
+
c(this, h, U).call(this, s);
|
|
358
357
|
}), t(this, C).subscribe((s) => {
|
|
359
|
-
c(this, h,
|
|
358
|
+
c(this, h, U).call(this, s);
|
|
360
359
|
}), t(this, y).subscribe((s) => {
|
|
361
|
-
c(this, h,
|
|
360
|
+
c(this, h, U).call(this, s);
|
|
362
361
|
}), t(this, v).subscribe((s) => {
|
|
363
|
-
c(this, h,
|
|
362
|
+
c(this, h, U).call(this, s);
|
|
364
363
|
}), t(this, N).subscribe((s) => {
|
|
365
|
-
c(this, h,
|
|
364
|
+
c(this, h, U).call(this, s);
|
|
366
365
|
}), t(this, m).subscribe((s) => {
|
|
367
|
-
c(this, h,
|
|
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
369
|
}), t(this, z).subscribe((s) => {
|
|
@@ -372,7 +371,7 @@ let $t = (bt = class extends HTMLElement {
|
|
|
372
371
|
}), t(this, k).subscribe((s) => {
|
|
373
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, c(this, h,
|
|
374
|
+
t(this, a) || (this.removeVar(s.previous), this.setVar(s.current, c(this, h, ft).call(this)));
|
|
376
375
|
}), t(this, x).subscribe((s) => {
|
|
377
376
|
t(this, a) || (this.removeVar(s.previous), this.setVar(s.current, t(this, g)));
|
|
378
377
|
}), t(this, M).subscribe((s) => {
|
|
@@ -384,17 +383,17 @@ let $t = (bt = class extends HTMLElement {
|
|
|
384
383
|
e(this, Q, !1);
|
|
385
384
|
return;
|
|
386
385
|
}
|
|
387
|
-
const A = t(this, S)[t(this,
|
|
386
|
+
const A = t(this, S)[t(this, X).current];
|
|
388
387
|
e(this, T, A / t(this, b) || 0), this.setVar(t(this, z).current, A.toFixed(6)), this.setVar(
|
|
389
388
|
t(this, k).current,
|
|
390
389
|
t(this, T).toFixed(6)
|
|
391
390
|
), t(this, E).current && this.setVar(
|
|
392
391
|
t(this, E).current,
|
|
393
|
-
c(this, h,
|
|
392
|
+
c(this, h, ft).call(this).toFixed(6)
|
|
394
393
|
);
|
|
395
|
-
}),
|
|
396
|
-
},
|
|
397
|
-
t(this, f) && (
|
|
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());
|
|
398
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
|
|
@@ -423,9 +422,9 @@ let $t = (bt = class extends HTMLElement {
|
|
|
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() {
|
|
427
426
|
return Math.abs(Math.cos(t(this, T) * Math.PI));
|
|
428
|
-
},
|
|
427
|
+
}, U = function(r) {
|
|
429
428
|
if (t(this, a)) {
|
|
430
429
|
r.previous && t(this, n).classList.remove(r.previous), r.current && t(this, n).classList.remove(r.current);
|
|
431
430
|
return;
|
|
@@ -439,7 +438,7 @@ let $t = (bt = class extends HTMLElement {
|
|
|
439
438
|
r.forEach((s) => {
|
|
440
439
|
s && t(this, n).style.removeProperty(`--${s}`);
|
|
441
440
|
});
|
|
442
|
-
},
|
|
441
|
+
}, pt = function() {
|
|
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);
|
|
444
443
|
}, bt);
|
|
445
444
|
Rt && !customElements.get("scroll-segment") && customElements.define("scroll-segment", $t);
|