aptechka 0.31.2 → 0.32.0
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/{Animation-DN95L7Xo.js → Animation-B1AS8IQG.js} +9 -9
- package/lib/Animation-CN0h3D4p.cjs +1 -0
- package/lib/{Damped-CTsV8tl_.cjs → Damped-C3MyWa5_.cjs} +1 -1
- package/lib/{Damped-Chu29wn-.js → Damped-cQCN3d0W.js} +1 -1
- package/lib/Tweened-ChIsd14E.cjs +1 -0
- package/lib/Tweened-CynwDTYT.js +44 -0
- package/lib/animation/Tweened.d.ts +3 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/controls/DragControls.d.ts +1 -0
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +118 -120
- package/lib/easings-BEmRlrDd.js +38 -0
- package/lib/easings-GegIwET5.cjs +1 -0
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +1 -1
- package/lib/scroll/vanilla/ScrollButtonElement.d.ts +2 -1
- package/lib/scroll/vanilla/ScrollElement.d.ts +6 -3
- package/lib/scroll/vanilla/ScrollSetButtonElement.d.ts +2 -1
- package/lib/scroll/vanilla/ScrollStepButtonElement.d.ts +2 -1
- package/lib/scroll/vanilla/index.cjs +1 -1
- package/lib/scroll/vanilla/index.js +371 -337
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.js +1 -1
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +10 -10
- package/package.json +1 -1
- package/lib/Animation-B9m8bw96.cjs +0 -1
- package/lib/Tweened-BUuSLSF7.js +0 -44
- package/lib/Tweened-BttGiyB0.cjs +0 -1
- package/lib/easings-BKi40vHz.js +0 -19
- package/lib/easings-DsS5-Kqc.cjs +0 -1
package/lib/pointer/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var A=Object.defineProperty;var _=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var M=i=>{throw TypeError(i)};var D=(i,s,t)=>s in i?A(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,T=(i,s)=>{for(var t in s||(s={}))F.call(s,t)&&D(i,t,s[t]);if(_)for(var t of _(s))G.call(s,t)&&D(i,t,s[t]);return i};var k=(i,s,t)=>s.has(i)||M("Cannot "+t);var e=(i,s,t)=>(k(i,s,"read from private field"),t?t.call(i):s.get(i)),n=(i,s,t)=>s.has(i)?M("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),c=(i,s,t,a)=>(k(i,s,"write to private field"),a?a.call(i,t):s.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-CDb6RMce.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),I=require("../dom-JBOkFLTh.cjs"),H=require("../math-GDWEqu7y.cjs");require("../ticker/vanilla/index.cjs");const R=require("../Damped-
|
|
1
|
+
"use strict";var A=Object.defineProperty;var _=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var M=i=>{throw TypeError(i)};var D=(i,s,t)=>s in i?A(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,T=(i,s)=>{for(var t in s||(s={}))F.call(s,t)&&D(i,t,s[t]);if(_)for(var t of _(s))G.call(s,t)&&D(i,t,s[t]);return i};var k=(i,s,t)=>s.has(i)||M("Cannot "+t);var e=(i,s,t)=>(k(i,s,"read from private field"),t?t.call(i):s.get(i)),n=(i,s,t)=>s.has(i)?M("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),c=(i,s,t,a)=>(k(i,s,"write to private field"),a?a.call(i,t):s.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-CDb6RMce.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),I=require("../dom-JBOkFLTh.cjs"),H=require("../math-GDWEqu7y.cjs");require("../ticker/vanilla/index.cjs");const R=require("../Damped-C3MyWa5_.cjs"),j=require("../element-resizer/vanilla/index.cjs"),B=require("../window-resizer/vanilla/index.cjs"),P=require("../css-property/index.cjs");var o,l,m,d,y,u,b,v,f,w,C,p;class O{constructor(s){n(this,o);n(this,l);n(this,m);n(this,d);n(this,y);n(this,u);n(this,b,0);n(this,v,0);n(this,f,s=>{e(this,d).set(1)});n(this,w,s=>{e(this,d).set(0)});n(this,C,s=>{const t=q.getPointerPosition(s,e(this,o).getBoundingClientRect()),a={width:e(this,b),height:e(this,v)},h={x:t.x,y:t.y};if(e(this,y)){const z=q.screenToCartesian(h,a);h.x=z.x,h.y=z.y}if(e(this,u)){const z=q.normalize(h,a);h.x=H.clamp(z.x*2,-1,1),h.y=H.clamp(z.y*2,-1,1)}e(this,l).set(h.x),e(this,m).set(h.y)});n(this,p,()=>{c(this,b,this.element.clientWidth),c(this,v,this.element.clientHeight);let s=0,t=0,a=0,h=0;e(this,y)?e(this,u)?(s=-1,t=1,a=-1,h=1):(s=e(this,b)/2*-1,t=e(this,b)/2*1,a=e(this,v)/2*-1,h=e(this,v)/2*1):e(this,u)?(s=0,t=1,a=0,h=1):(s=0,t=e(this,b),a=0,h=e(this,v)),e(this,l).min=s,e(this,l).max=t,e(this,m).min=a,e(this,m).max=h});c(this,o,I.getElement(s.element)),c(this,l,new R.Damped(0,s.damped)),c(this,m,new R.Damped(0,s.damped)),c(this,d,new R.Damped(0,T({min:0,max:1},s.damped))),c(this,y,s.cartesian||!1),c(this,u,s.normalize||!1)}get element(){return e(this,o)}get x(){return e(this,l)}get y(){return e(this,m)}get z(){return e(this,d)}get cartesian(){return e(this,y)}set cartesian(s){c(this,y,s),e(this,p).call(this)}get normalize(){return e(this,u)}set normalize(s){c(this,u,s),e(this,p).call(this)}connect(){e(this,o).addEventListener("pointerenter",e(this,f)),e(this,o).addEventListener("pointerleave",e(this,w)),e(this,o).addEventListener("pointermove",e(this,C)),j.elementResizer.subscribe(e(this,o),e(this,p)),B.windowResizer.subscribe(e(this,p))}disconnect(){e(this,o).removeEventListener("pointerenter",e(this,f)),e(this,o).removeEventListener("pointerleave",e(this,w)),e(this,o).removeEventListener("pointermove",e(this,C)),j.elementResizer.unsubscribe(e(this,p)),B.windowResizer.unsubscribe(e(this,p)),e(this,l).reset(),e(this,m).reset(),e(this,d).reset()}}o=new WeakMap,l=new WeakMap,m=new WeakMap,d=new WeakMap,y=new WeakMap,u=new WeakMap,b=new WeakMap,v=new WeakMap,f=new WeakMap,w=new WeakMap,C=new WeakMap,p=new WeakMap;var r,x,g,S,E,L;class W extends HTMLElement{constructor(){super();n(this,r);n(this,x,new P.CSSProperty(this,"--damping",20));n(this,g,new P.CSSProperty(this,"--mass",0));n(this,S,new P.CSSProperty(this,"--stiffness",0));n(this,E,new P.CSSProperty(this,"--cartesian",!1));n(this,L,new P.CSSProperty(this,"--normalize",!1));c(this,r,new O({element:this})),e(this,x).subscribe(t=>{e(this,r).x.damping=t.current,e(this,r).y.damping=t.current,e(this,r).z.damping=t.current}),e(this,E).subscribe(t=>{e(this,r).cartesian=t.current}),e(this,L).subscribe(t=>{e(this,r).normalize=t.current}),e(this,g).subscribe(t=>{e(this,r).x.mass=t.current,e(this,r).y.mass=t.current,e(this,r).z.mass=t.current}),e(this,S).subscribe(t=>{e(this,r).x.stiffness=t.current,e(this,r).y.stiffness=t.current,e(this,r).z.stiffness=t.current}),e(this,r).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,r).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,r).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,r)}connectedCallback(){e(this,r).connect(),e(this,x).observe(),e(this,g).observe(),e(this,S).observe()}disconnectedCallback(){e(this,r).disconnect(),e(this,x).unobserve(),e(this,g).unobserve(),e(this,S).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}r=new WeakMap,x=new WeakMap,g=new WeakMap,S=new WeakMap,E=new WeakMap,L=new WeakMap;customElements.get("e-pointer")||customElements.define("e-pointer",W);exports.Pointer=O;exports.PointerElement=W;
|
package/lib/pointer/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import { g as G, s as I, n as J } from "../coordinates-CgdGoSYs.js";
|
|
|
19
19
|
import { g as K } from "../dom-0S_WDL4g.js";
|
|
20
20
|
import { c as B } from "../math-BOBiC4TN.js";
|
|
21
21
|
import "../ticker/vanilla/index.js";
|
|
22
|
-
import { D as R } from "../Damped-
|
|
22
|
+
import { D as R } from "../Damped-cQCN3d0W.js";
|
|
23
23
|
import { elementResizer as W } from "../element-resizer/vanilla/index.js";
|
|
24
24
|
import { windowResizer as j } from "../window-resizer/vanilla/index.js";
|
|
25
25
|
import { CSSProperty as P } from "../css-property/index.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ScrollUserElement } from './ScrollUserElement';
|
|
2
|
+
import { ScrollSetOptions } from './ScrollElement';
|
|
2
3
|
|
|
3
4
|
export declare abstract class ScrollButtonElement extends ScrollUserElement {
|
|
4
5
|
constructor();
|
|
5
|
-
protected abstract handleClick(): void;
|
|
6
|
+
protected abstract handleClick(options: ScrollSetOptions): void;
|
|
6
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Damped } from '../../animation';
|
|
1
|
+
import { Damped, TweenedOptions } from '../../animation';
|
|
2
2
|
import { Store } from '../../store/vanilla';
|
|
3
|
-
import { Axes2D
|
|
3
|
+
import { Axes2D } from '../../utils';
|
|
4
4
|
import { CSSProperty } from '../../css-property';
|
|
5
5
|
import { ScrollSection } from './ScrollSection';
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ export type ScrollBehaviour = 'smooth' | 'instant';
|
|
|
11
11
|
export interface ScrollSetOptions {
|
|
12
12
|
behaviour?: ScrollBehaviour;
|
|
13
13
|
tween?: {
|
|
14
|
-
easing?:
|
|
14
|
+
easing?: TweenedOptions['easing'];
|
|
15
15
|
duration: number;
|
|
16
16
|
};
|
|
17
17
|
}
|
|
@@ -25,8 +25,11 @@ export declare class ScrollElement extends HTMLElement {
|
|
|
25
25
|
get pagesCSSProperty(): CSSProperty<number>;
|
|
26
26
|
get splitCSSProperty(): CSSProperty<boolean>;
|
|
27
27
|
get sectionalCSSProperty(): CSSProperty<boolean>;
|
|
28
|
+
get easingCSSProperty(): CSSProperty<false | "linear" | "easeInQuad" | "easeOutQuad" | "easeInOutQuad" | "easeInCubic" | "easeOutCubic" | "easeInOutCubic" | "easeInQuart" | "easeOutQuart" | "easeInOutQuart" | "easeInQuint" | "easeOutQuint" | "easeInOutQuint" | "easeInExpo" | "easeOutExpo" | "easeInOutExpo">;
|
|
29
|
+
get durationCSSProperty(): CSSProperty<number | false>;
|
|
28
30
|
get autoSizeCSSProperty(): CSSProperty<boolean>;
|
|
29
31
|
get wheelMaxDeltaCSSProperty(): CSSProperty<boolean>;
|
|
32
|
+
get dragInertionCSSProperty(): CSSProperty<number>;
|
|
30
33
|
get sectionsInViewCSSProperty(): CSSProperty<number>;
|
|
31
34
|
get loopCSSProperty(): CSSProperty<boolean>;
|
|
32
35
|
get dampingCSSProperty(): CSSProperty<number>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ScrollButtonElement } from './ScrollButtonElement';
|
|
2
|
+
import { ScrollSetOptions } from './ScrollElement';
|
|
2
3
|
|
|
3
4
|
export declare class ScrollSetButtonElement extends ScrollButtonElement {
|
|
4
|
-
protected handleClick(): void;
|
|
5
|
+
protected handleClick(options: ScrollSetOptions): void;
|
|
5
6
|
}
|
|
6
7
|
declare global {
|
|
7
8
|
interface HTMLElementTagNameMap {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ScrollButtonElement } from './ScrollButtonElement';
|
|
2
|
+
import { ScrollSetOptions } from './ScrollElement';
|
|
2
3
|
|
|
3
4
|
export declare class ScrollStepButtonElement extends ScrollButtonElement {
|
|
4
|
-
protected handleClick(): void;
|
|
5
|
+
protected handleClick(options: ScrollSetOptions): void;
|
|
5
6
|
}
|
|
6
7
|
declare global {
|
|
7
8
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ve=Object.defineProperty;var re=Object.getOwnPropertySymbols;var Ce=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable;var he=u=>{throw TypeError(u)};var ne=(u,n,e)=>n in u?ve(u,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[n]=e,oe=(u,n)=>{for(var e in n||(n={}))Ce.call(n,e)&&ne(u,e,n[e]);if(re)for(var e of re(n))Ee.call(n,e)&&ne(u,e,n[e]);return u};var Zt=(u,n,e)=>n.has(u)||he("Cannot "+e);var t=(u,n,e)=>(Zt(u,n,"read from private field"),e?e.call(u):n.get(u)),s=(u,n,e)=>n.has(u)?he("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(u):n.set(u,e),h=(u,n,e,i)=>(Zt(u,n,"write to private field"),i?i.call(u,e):n.set(u,e),e),d=(u,n,e)=>(Zt(u,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Pe=require("../../Store-CDb6RMce.cjs"),Kt=require("../../browser-CpzFX2xg.cjs"),we=require("../../easings-DsS5-Kqc.cjs"),Jt=require("../../events-KVanG9sR.cjs"),ce=require("../../jss-GJLvaNfT.cjs"),yt=require("../../layout-8ryRAMGJ.cjs"),ue=require("../../math-GDWEqu7y.cjs");require("../../ticker/vanilla/index.cjs");const Qt=require("../../order/index.cjs"),xe=require("../../Damped-CTsV8tl_.cjs"),ze=require("../../Tweened-BttGiyB0.cjs"),Ut=require("../../controls/index.cjs"),jt=require("../../window-resizer/vanilla/index.cjs"),nt=require("../../scroll-entries/index.cjs"),le=require("../../css-unit-parser/index.cjs"),S=require("../../css-property/index.cjs"),Le=require("../../device/index.cjs"),Gt=require("../../element-resizer/vanilla/index.cjs"),ke=require("../../gestures-DHLrn6Q8.cjs"),ae=require("../../dom-JBOkFLTh.cjs"),De=require("../../function-MthRj-GJ.cjs"),qe=require("../../scroll-segment/index.cjs");var f,At,y,ht,A,N;class Re{constructor(n,e,i){s(this,f);s(this,At);s(this,y);s(this,ht,0);s(this,A,0);s(this,N,null);h(this,f,n),h(this,At,e),h(this,y,i),nt.scrollEntries.register(t(this,f))}get index(){return t(this,At)}get size(){return t(this,ht)}get position(){return t(this,A)}destroy(){nt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null)}setSize(n){n?(t(this,f).style.setProperty("--size",n+"px"),t(this,y).axisCSSProperty.current==="x"?(t(this,f).style.width=n+"px",t(this,f).style.height=""):(t(this,f).style.height=n+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){h(this,ht,t(this,y).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),h(this,A,t(this,y).vertical?yt.getCumulativeOffsetTop(t(this,f)):yt.getCumulativeOffsetLeft(t(this,f))),h(this,A,t(this,A)-t(this,y).contentPosition)}transform(){let n=0;const e=t(this,y).viewportSize*t(this,y).sectionDistanceScaleCSSProperty.current;t(this,y).loopCSSProperty.current&&t(this,y).overscroll&&t(this,A)+t(this,ht)<t(this,y).currentScrollValue&&(n=t(this,y).distance*-1-t(this,y).gap),nt.scrollEntries.update(t(this,f),t(this,y).axisCSSProperty.current,n);const i=t(this,y).currentScrollValue+n,r=t(this,A)-t(this,y).viewportSize-e,c=t(this,A)+t(this,ht)+e,m=ue.clamp(i,r,c);t(this,y).vertical?t(this,f).style.transform=`translate3d(0px, ${m*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${m*-1}px, 0px, 0px)`}mark(n){t(this,N)!==n&&(t(this,N)&&t(this,f).classList.remove(t(this,N)),n&&t(this,f).classList.add(n),h(this,N,n),Jt.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,N)},custom:!0}))}}f=new WeakMap,At=new WeakMap,y=new WeakMap,ht=new WeakMap,A=new WeakMap,N=new WeakMap;const Te=ce.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"100%",height:"100%",overflow:"var(--overflow, initial)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},':host([hibernated="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,ot,x,I,M,O,D,V,j,q,C,lt,ct,ut,at,vt,k,dt,G,R,K,B,Z,pt,St,J,Q,p,Ct,l,It,Mt,v,g,z,T,X,_,E,b,Et,Y,H,tt,ft,Pt,W,o,Tt,gt,$t,Nt,Xt,Yt,L,wt,de,xt,Ot,te,ee,rt,se;class Rt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,ot,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,I,new S.CSSProperty(this,"--direction",0));s(this,M,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,O,new S.CSSProperty(this,"--split",!1));s(this,D,new S.CSSProperty(this,"--sectional",!1));s(this,V,new S.CSSProperty(this,"--auto-size",!1));s(this,j,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,q,new S.CSSProperty(this,"--sections-in-view",1));s(this,C,new S.CSSProperty(this,"--loop",!1));s(this,lt,new S.CSSProperty(this,"--damping",20));s(this,ct,new S.CSSProperty(this,"--mass",0));s(this,ut,new S.CSSProperty(this,"--stiffness",0));s(this,at,new S.CSSProperty(this,"--mouse-drag",!1));s(this,vt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,k,new S.CSSProperty(this,"--autoplay",0));s(this,dt,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,G,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,R,new S.CSSProperty(this,"--classes",!1));s(this,K,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,B,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,Z,new S.CSSProperty(this,"--focus-delay",0));s(this,pt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,St,new S.CSSProperty(this,"--disabled",!1));s(this,J,new S.CSSProperty(this,"--hibernated",!1));s(this,Q,null);s(this,p,null);s(this,Ct,null);s(this,l,[]);s(this,It,0);s(this,Mt,0);s(this,v,0);s(this,g,0);s(this,z,0);s(this,T,null);s(this,X,null);s(this,_,null);s(this,E,null);s(this,b,new Pe.Store(0));s(this,Et,0);s(this,Y,0);s(this,H,!1);s(this,tt,!0);s(this,ft,!0);s(this,Pt);s(this,W,new ze.Tweened);s(this,L,()=>{t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,g)||0,i=t(this,b).current;if(h(this,It,this.vertical?yt.getCumulativeOffsetTop(this):yt.getCumulativeOffsetLeft(this)),h(this,Mt,this.vertical?yt.getCumulativeOffsetTop(t(this,p)):yt.getCumulativeOffsetLeft(t(this,p))),h(this,v,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,z,le.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):h(this,z,le.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,V).current&&t(this,l).length){const r=t(this,q).current,c=(t(this,v)-t(this,z)*(r-1))/r;t(this,l).forEach(m=>{m.setSize(c)})}else t(this,l).forEach(r=>{r.setSize()});if(t(this,l).forEach(r=>{r.resize()}),t(this,M).current){h(this,g,t(this,v)*t(this,M).current);const r=t(this,g)+t(this,v);this.vertical?(t(this,p).style.width=r+"px",t(this,p).style.height="100%"):(t(this,p).style.height=r+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",h(this,g,t(this,p).offsetHeight-t(this,v))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",h(this,g,t(this,p).offsetWidth-t(this,v)));if(!t(this,C).current){const r=getComputedStyle(this),c=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);h(this,g,t(this,g)+c),t(this,a).max=t(this,g)}if(t(this,C).current&&t(this,l).length){const r=t(this,l)[t(this,l).length-1],c=r.position+r.size-t(this,v),m=t(this,g)-c;h(this,Y,r.position+r.size+m)}else h(this,Y,t(this,g));if(t(this,D).current&&t(this,l).length){const r=t(this,l)[i];t(this,a).set(r.position,{equalize:!0})}else t(this,a).set(e*t(this,g),{equalize:!0});h(this,H,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,v)),this.classList.toggle("has-overflow",t(this,H)),t(this,H)?d(this,o,Nt).call(this):d(this,o,$t).call(this),t(this,wt).call(this)});s(this,wt,()=>{if(!t(this,H))return;const e=this.currentScrollValue;if(h(this,Et,Math.max(0,e-t(this,g))),t(this,l).length){let i=0;for(let r=0;r<t(this,l).length;r++){const c=t(this,l)[r];c.transform(),this.targetScrollValue+c.size/2>=c.position&&(i=r)}t(this,b).current=i}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;nt.scrollEntries.update(this,t(this,x).current,e)});s(this,xt,(e,i)=>{t(this,ot).current&&(d(this,o,te).call(this,Math.sign(i)||1),t(this,Ot).call(this,e,i))});s(this,Ot,(e,i)=>{if(t(this,I).current){if(t(this,I).current<0&&i>0)return;if(t(this,I).current>0&&i<0)return}if(t(this,W).unlistenAnimationFrame(),!t(this,k).current&&t(this,Z).current&&(clearInterval(t(this,Pt)),h(this,Pt,setTimeout(()=>{const r=d(this,o,se).call(this);r&&this.scrollToSection(r.index,{tween:{duration:t(this,pt).current,easing:we.easeInOutExpo}})},t(this,Z).current))),!(e==="drag"&&!Le.device.isMobile&&!t(this,at).current))if(t(this,D).current){const r=Math.sign(i);t(this,l).length?this.shiftSections(r):t(this,a).shift(r*t(this,v))}else t(this,a).shift(i)});if(Kt.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(Te);const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,Q,document.createElement("div")),t(this,Q).className="content-wrapper",h(this,p,document.createElement("div")),t(this,p).className="content",h(this,Ct,document.createElement("slot")),t(this,p).appendChild(t(this,Ct)),t(this,Q).appendChild(t(this,p)),e.appendChild(t(this,Q))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,ot)}get axisCSSProperty(){return t(this,x)}get directionCSSProperty(){return t(this,I)}get pagesCSSProperty(){return t(this,M)}get splitCSSProperty(){return t(this,O)}get sectionalCSSProperty(){return t(this,D)}get autoSizeCSSProperty(){return t(this,V)}get wheelMaxDeltaCSSProperty(){return t(this,j)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,C)}get dampingCSSProperty(){return t(this,lt)}get massCSSProperty(){return t(this,ct)}get stiffnessCSSProperty(){return t(this,ut)}get mouseDragCSSProperty(){return t(this,at)}get sectionDistanceScaleCSSProperty(){return t(this,vt)}get autoplayCSSProperty(){return t(this,k)}get autoplayPauseDurationCSSProperty(){return t(this,dt)}get autoplayUserDirectionCSSProperty(){return t(this,G)}get classesCSSProperty(){return t(this,R)}get currentIndexStartOffsetCSSProperty(){return t(this,K)}get currentIndexEndOffsetCSSProperty(){return t(this,B)}get focusDelayCSSProperty(){return t(this,Z)}get focusDurationCSSProperty(){return t(this,pt)}get disabledCSSProperty(){return t(this,St)}get hibernatedCSSProperty(){return t(this,J)}get currentScrollValue(){return d(this,o,ee).call(this,"current")}get targetScrollValue(){return d(this,o,ee).call(this,"target")}get contentWrapperElement(){return t(this,Q)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,It)}get contentPosition(){return t(this,Mt)}get viewportSize(){return t(this,v)}get scrollSize(){return t(this,g)}get gap(){return t(this,z)}get counter(){return t(this,b)}get limit(){return t(this,l).length-t(this,q).current}get distance(){return t(this,Y)}get loopDistance(){return t(this,C).current?t(this,Y)+t(this,z):t(this,Y)}get hasOverflow(){return t(this,H)}get overscroll(){return t(this,Et)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,r=0){const c=e-r,m=c+i+r*2;return this.currentProgress<c?0:this.currentProgress>m?1:(this.currentProgress-c)/(m-c)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const c=e-r,m=c+i+r*2;return this.currentProgress>=c&&this.currentProgress<=m}scrollToSection(e,i){if(!t(this,l).length)return;const r=t(this,b).current;d(this,o,de).call(this,e);const c=t(this,l)[r],m=t(this,l)[t(this,b).current];if(c&&m){let w=0;const bt=d(this,o,se).call(this),ye=bt?this.targetScrollValue-bt.position:0;t(this,C).current?t(this,b).current===0&&r===t(this,l).length-1?w=t(this,g)+t(this,v)-c.position+t(this,z):t(this,b).current===t(this,l).length-1&&r===0?w=m.position-(t(this,g)+t(this,v)+t(this,z)):w=m.position-c.position:w=m.position-c.position,this.shiftPosition(w-ye,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,b).current+e,i)}setPosition(e,i){d(this,o,te).call(this,Math.sign(e)||1),i!=null&&i.tween?(t(this,W).set(t(this,a).current,{equalize:!0}),t(this,W).set(e,oe({},i.tween))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){nt.scrollEntries.register(this),h(this,a,new xe.Damped(0,{damping:.01,min:0,order:Qt.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,T,new Ut.WheelControls({element:t(this,p)})),t(this,T).changeEvent.subscribe(t(this,xt)),h(this,X,new Ut.KeyboardControls({element:this})),t(this,X).changeEvent.subscribe(t(this,xt)),h(this,_,new Ut.DragControls({element:t(this,p)})),t(this,_).changeEvent.subscribe(t(this,xt)),h(this,E,new Ut.AutoplayControls({culling:this})),t(this,E).changeEvent.subscribe(t(this,Ot)),t(this,x).subscribe(({current:e})=>{t(this,p).style.flexDirection=e==="x"?"row":"column",t(this,T).axis=t(this,j).current?"max":e,t(this,X).dimension=e==="x"?"width":"height",t(this,_).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),this.isConnected&&t(this,L).call(this)}),t(this,j).subscribe(e=>{t(this,T).axis=e.current?"max":t(this,x).current}),t(this,M).subscribe(()=>{this.isConnected&&t(this,L).call(this)}),t(this,O).subscribe(({current:e})=>{this.isConnected&&(e?d(this,o,Tt).call(this):d(this,o,gt).call(this))}),t(this,D).subscribe(e=>{t(this,T).debounce=e.current,t(this,_).swipe=e.current,t(this,E).interval=e.current,this.isConnected&&(e.current&&!e.previous&&!t(this,l).length?d(this,o,Tt).call(this):!e.current&&e.previous&&t(this,l).length&&d(this,o,gt).call(this))}),t(this,V).subscribe(e=>{this.isConnected&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,l).length?d(this,o,Tt).call(this):!e.current&&e.previous&&t(this,l).length&&d(this,o,gt).call(this))}),t(this,q).subscribe(e=>{this.isConnected&&(t(this,L).call(this),d(this,o,rt).call(this))}),t(this,C).subscribe(e=>{e.current?(this.isConnected&&(t(this,l).length||(t(this,O).current=!0)),t(this,l).length&&(t(this,a).max=1/0,t(this,a).min=-1/0)):(h(this,Et,0),t(this,a).max=t(this,g),t(this,a).min=0)}),t(this,lt).subscribe(e=>{t(this,a).damping=e.current}),t(this,ct).subscribe(e=>{t(this,a).mass=e.current}),t(this,ut).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,k).subscribe(e=>{t(this,E).speed=e.current,!t(this,tt)&&e.current&&!e.previous?t(this,E).connect():!e.current&&e.previous&&t(this,E).disconnect()}),t(this,G).subscribe(e=>{e.current||(t(this,E).direction=1)}),t(this,R).subscribe(e=>{this.isConnected&&d(this,o,rt).call(this)}),t(this,K).subscribe(e=>{this.isConnected&&t(this,R).current&&d(this,o,rt).call(this)}),t(this,B).subscribe(e=>{this.isConnected&&t(this,R).current&&d(this,o,rt).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,b).subscribe(e=>{t(this,l).length&&d(this,o,rt).call(this)}),t(this,W).subscribe(e=>{t(this,W).isRunning.current&&t(this,a).set(e.current)}),t(this,St).subscribe(e=>{e.current&&!e.previous?d(this,o,$t).call(this):!e.current&&e.previous&&d(this,o,Nt).call(this)}),t(this,J).subscribe(e=>{e.current&&!e.previous?d(this,o,Xt).call(this):!e.current&&e.previous&&d(this,o,Yt).call(this)}),t(this,ot).observe(),t(this,x).observe(),t(this,I).observe(),t(this,M).observe(),t(this,O).observe(),t(this,D).observe(),t(this,V).observe(),t(this,j).observe(),t(this,q).observe(),t(this,C).observe(),t(this,lt).observe(),t(this,ct).observe(),t(this,ut).observe(),t(this,at).observe(),t(this,vt).observe(),t(this,k).observe(),t(this,k).observe(),t(this,dt).observe(),t(this,G).observe(),t(this,R).observe(),t(this,K).observe(),t(this,B).observe(),t(this,Z).observe(),t(this,pt).observe(),t(this,St).observe(),t(this,J).observe(),t(this,J).current||d(this,o,Yt).call(this)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("has-overflow"),t(this,ot).unobserve(),t(this,x).unobserve(),t(this,I).unobserve(),t(this,M).unobserve(),t(this,O).unobserve(),t(this,D).unobserve(),t(this,V).unobserve(),t(this,j).unobserve(),t(this,q).unobserve(),t(this,C).unobserve(),t(this,lt).unobserve(),t(this,ct).unobserve(),t(this,ut).unobserve(),t(this,at).unobserve(),t(this,vt).unobserve(),t(this,k).unobserve(),t(this,dt).unobserve(),t(this,G).unobserve(),t(this,R).unobserve(),t(this,K).unobserve(),t(this,B).unobserve(),t(this,Z).unobserve(),t(this,pt).unobserve(),t(this,St).unobserve(),t(this,J).unobserve(),d(this,o,Xt).call(this)}}a=new WeakMap,ot=new WeakMap,x=new WeakMap,I=new WeakMap,M=new WeakMap,O=new WeakMap,D=new WeakMap,V=new WeakMap,j=new WeakMap,q=new WeakMap,C=new WeakMap,lt=new WeakMap,ct=new WeakMap,ut=new WeakMap,at=new WeakMap,vt=new WeakMap,k=new WeakMap,dt=new WeakMap,G=new WeakMap,R=new WeakMap,K=new WeakMap,B=new WeakMap,Z=new WeakMap,pt=new WeakMap,St=new WeakMap,J=new WeakMap,Q=new WeakMap,p=new WeakMap,Ct=new WeakMap,l=new WeakMap,It=new WeakMap,Mt=new WeakMap,v=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,X=new WeakMap,_=new WeakMap,E=new WeakMap,b=new WeakMap,Et=new WeakMap,Y=new WeakMap,H=new WeakMap,tt=new WeakMap,ft=new WeakMap,Pt=new WeakMap,W=new WeakMap,o=new WeakSet,Tt=function(){d(this,o,gt).call(this),t(this,Ct).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Re(e,i,this))}),t(this,p).style.transform="",Jt.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),d(this,o,rt).call(this)},gt=function(){t(this,l).forEach(e=>{e.destroy()}),h(this,l,[]),t(this,b).reset(),t(this,a).reset(),Jt.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},$t=function(){t(this,tt)||(h(this,tt,!0),t(this,a).unsubscribe(t(this,wt)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Pt)),t(this,W).unlistenAnimationFrame(),t(this,T).disconnect(),t(this,X).disconnect(),t(this,_).disconnect(),t(this,E).disconnect(),t(this,H)||this.sections.forEach(e=>{e.unsetTransform()}))},Nt=function(){t(this,tt)&&(h(this,tt,!1),t(this,a).subscribe(t(this,wt)),t(this,T).connect(),t(this,X).connect(),t(this,_).connect(),t(this,k).current&&t(this,E).connect())},Xt=function(){t(this,ft)||(h(this,ft,!0),jt.windowResizer.unsubscribe(t(this,L)),Gt.elementResizer.unsubscribe(t(this,L)),d(this,o,$t).call(this),t(this,p).style.transform="",t(this,l).length?d(this,o,gt).call(this):(t(this,b).reset(),t(this,a).reset()),nt.scrollEntries.unregister(this))},Yt=function(){t(this,ft)&&(h(this,ft,!1),nt.scrollEntries.register(this),(t(this,C).current||t(this,O).current||t(this,C).current||t(this,V).current||t(this,D).current)&&d(this,o,Tt).call(this),d(this,o,Nt).call(this),jt.windowResizer.subscribe(t(this,L),Qt.RESIZE_ORDER.SCROLL),Gt.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,wt=new WeakMap,de=function(e){t(this,C).current?(t(this,b).current=e%t(this,l).length,t(this,b).current=t(this,b).current<0?t(this,l).length+t(this,b).current:t(this,b).current):t(this,b).current=ue.clamp(e,0,this.limit)},xt=new WeakMap,Ot=new WeakMap,te=function(e=1){t(this,G).current&&(t(this,E).direction=e),t(this,k).current&&t(this,E).pauseAndContinue(t(this,dt).current,this.sectionalCSSProperty.current)},ee=function(e="current"){if(t(this,C).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,g)+t(this,v)+t(this,z));return i<0?t(this,g)+i+t(this,v)+t(this,z):i}else return t(this,a)[e]},rt=function(){if(t(this,R).current&&t(this,l).length){const e=t(this,b).current+t(this,K).current;e===0?this.classList.add("start"):this.classList.remove("start"),e===this.limit?this.classList.add("end"):this.classList.remove("end");const i=t(this,q).current+t(this,B).current;t(this,l).forEach((r,c)=>{const m=e-this.limit-1+t(this,B).current,w=e+i,bt=this.sections.length-w;c>=e&&c<w||c<=m?r.mark("current"):c>=w&&c<w+bt/2||c<=m+i?r.mark("next"):r.mark("previous")})}},se=function(){let e=null,i=1/0;for(let r=0;r<t(this,l).length;r++){const c=Math.abs(t(this,l)[r].position-this.targetScrollValue);c<i&&(i=c,e=r)}return e!==null?t(this,l)[e]:null};customElements.get("e-scroll")||customElements.define("e-scroll",Rt);var Vt;class ie extends HTMLElement{constructor(){super(...arguments);s(this,Vt,null)}get scrollElement(){return t(this,Vt)}connectedCallback(){const e=ae.findParentElement(this,Rt);e instanceof Rt?h(this,Vt,e):console.error(this,"e-scroll not found")}}Vt=new WeakMap;var et,P,F,U,zt,Lt,mt,Bt,_t,Ht;class pe extends ie{constructor(){super();s(this,et,null);s(this,P,null);s(this,F,!1);s(this,U,0);s(this,zt,0);s(this,Lt,0);s(this,mt,()=>{h(this,F,this.offsetWidth>this.offsetHeight);const e=t(this,F)?this.offsetWidth:this.offsetHeight;h(this,U,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,U,Math.max(t(this,U),30)),t(this,F)?(t(this,P).style.width=t(this,U)+"px",t(this,P).style.height="100%"):(t(this,P).style.width="100%",t(this,P).style.height=t(this,U)+"px"),h(this,zt,e-t(this,U)),this.scrollElement.scrollSize||(this.style.display="none")});s(this,Bt,()=>{h(this,Lt,this.scrollElement.currentProgress*t(this,zt)),t(this,F)?t(this,P).style.transform=`translate3d(${t(this,Lt)}px, 0px, 0px)`:t(this,P).style.transform=`translate3d(0px, ${t(this,Lt)}px, 0px)`});s(this,_t,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,Ht,e=>{document.documentElement.classList.add("grabbing"),ke.setupDrag(c=>{const m=t(this,F)?c.x:c.y,w=this.scrollElement.distance/t(this,zt),bt=(m-r)*w;this.scrollElement.setPosition(i+bt)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,F)?e.x:e.y});if(Kt.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(ce.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"black",borderRadius:"0.3vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})),h(this,et,document.createElement("slot")),t(this,et).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,et))}}get thumbElement(){return t(this,P)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,et).assignedElements()[0]||t(this,et).firstElementChild;h(this,P,e),t(this,P).addEventListener("pointerdown",t(this,Ht)),jt.windowResizer.subscribe(t(this,mt),Qt.RESIZE_ORDER.SCROLL),Gt.elementResizer.subscribe(this,t(this,mt)),this.scrollElement.onScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.subscribe(t(this,_t))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),t(this,P).removeEventListener("pointerdown",t(this,Ht)),jt.windowResizer.unsubscribe(t(this,mt)),Gt.elementResizer.unsubscribe(t(this,mt)),this.scrollElement.offScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,_t))}}et=new WeakMap,P=new WeakMap,F=new WeakMap,U=new WeakMap,zt=new WeakMap,Lt=new WeakMap,mt=new WeakMap,Bt=new WeakMap,_t=new WeakMap,Ht=new WeakMap;customElements.get("e-scrollbar")||customElements.define("e-scrollbar",pe);class Se extends ie{constructor(){super(),Kt.isBrowser&&this.addEventListener("click",()=>{this.handleClick()})}}class fe extends Se{handleClick(){const n=this.getAttribute("index"),e=this.getAttribute("behaviour");this.scrollElement.scrollToSection(parseInt(n||"0"),{behaviour:e})}}customElements.get("e-scroll-set-button")||customElements.define("e-scroll-set-button",fe);class me extends Se{handleClick(){const n=this.getAttribute("step"),e=this.getAttribute("behaviour");this.scrollElement.shiftSections(parseInt(n||"1"),{behaviour:e})}}customElements.get("e-scroll-step-button")||customElements.define("e-scroll-step-button",me);var $,st,kt,Wt,Ft,Dt;class Ae{constructor(n,e,i){s(this,$,null);s(this,st,null);s(this,kt,null);s(this,Wt,null);s(this,Ft,()=>{t(this,st).scrollToSection(t(this,kt),{behaviour:t(this,Wt)})});s(this,Dt,()=>{t(this,$).classList.toggle("current",t(this,st).counter.current===t(this,kt))});Kt.isBrowser&&(h(this,$,document.createElement("button")),h(this,st,n),h(this,Wt,i),h(this,kt,e),t(this,$).addEventListener("click",t(this,Ft)),t(this,st).counter.subscribe(t(this,Dt)),t(this,Dt).call(this))}get element(){return t(this,$)}destroy(){t(this,$).removeEventListener("click",t(this,Ft)),t(this,st).counter.unsubscribe(t(this,Dt)),t(this,$).remove()}}$=new WeakMap,st=new WeakMap,kt=new WeakMap,Wt=new WeakMap,Ft=new WeakMap,Dt=new WeakMap;var it,qt;class be extends ie{constructor(){super(...arguments);s(this,it,[]);s(this,qt,De.debounce(()=>{t(this,it).forEach(e=>e.destroy()),h(this,it,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Ae(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,it).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,qt)),t(this,qt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,qt)),t(this,it).forEach(e=>e.destroy()),h(this,it,[])}}it=new WeakMap,qt=new WeakMap;customElements.get("e-scroll-bullet-buttons")||customElements.define("e-scroll-bullet-buttons",be);class ge extends qe.ScrollSegmentElement{connectedCallback(){const n=ae.findParentElement(this,Rt);n instanceof Rt?(this.scrollContainer=n,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}customElements.get("e-scroll-segment")||customElements.define("e-scroll-segment",ge);exports.ScrollBulletButtonsElement=be;exports.ScrollElement=Rt;exports.ScrollSegmentElement=ge;exports.ScrollSetButtonElement=fe;exports.ScrollStepButtonElement=me;exports.ScrollbarElement=pe;
|
|
1
|
+
"use strict";var we=Object.defineProperty;var le=Object.getOwnPropertySymbols;var xe=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable;var ue=u=>{throw TypeError(u)};var ce=(u,r,e)=>r in u?we(u,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[r]=e,ae=(u,r)=>{for(var e in r||(r={}))xe.call(r,e)&&ce(u,e,r[e]);if(le)for(var e of le(r))ze.call(r,e)&&ce(u,e,r[e]);return u};var Yt=(u,r,e)=>r.has(u)||ue("Cannot "+e);var t=(u,r,e)=>(Yt(u,r,"read from private field"),e?e.call(u):r.get(u)),s=(u,r,e)=>r.has(u)?ue("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(u):r.set(u,e),h=(u,r,e,i)=>(Yt(u,r,"write to private field"),i?i.call(u,e):r.set(u,e),e),d=(u,r,e)=>(Yt(u,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Le=require("../../Store-CDb6RMce.cjs"),Xt=require("../../browser-CpzFX2xg.cjs"),ke=require("../../easings-GegIwET5.cjs"),te=require("../../events-KVanG9sR.cjs"),Se=require("../../jss-GJLvaNfT.cjs"),Et=require("../../layout-8ryRAMGJ.cjs"),pe=require("../../math-GDWEqu7y.cjs");require("../../ticker/vanilla/index.cjs");const ee=require("../../order/index.cjs"),Ie=require("../../Damped-C3MyWa5_.cjs"),qe=require("../../Tweened-ChIsd14E.cjs"),Gt=require("../../controls/index.cjs"),Jt=require("../../window-resizer/vanilla/index.cjs"),lt=require("../../scroll-entries/index.cjs"),de=require("../../css-unit-parser/index.cjs"),p=require("../../css-property/index.cjs"),De=require("../../device/index.cjs"),Qt=require("../../element-resizer/vanilla/index.cjs"),Te=require("../../gestures-DHLrn6Q8.cjs"),fe=require("../../dom-JBOkFLTh.cjs"),Ae=require("../../function-MthRj-GJ.cjs"),Re=require("../../scroll-segment/index.cjs");var f,Vt,y,ct,R,N;class Me{constructor(r,e,i){s(this,f);s(this,Vt);s(this,y);s(this,ct,0);s(this,R,0);s(this,N,null);h(this,f,r),h(this,Vt,e),h(this,y,i),lt.scrollEntries.register(t(this,f))}get index(){return t(this,Vt)}get size(){return t(this,ct)}get position(){return t(this,R)}destroy(){lt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null)}setSize(r){r?(t(this,f).style.setProperty("--size",r+"px"),t(this,y).axisCSSProperty.current==="x"?(t(this,f).style.width=r+"px",t(this,f).style.height=""):(t(this,f).style.height=r+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){h(this,ct,t(this,y).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),h(this,R,t(this,y).vertical?Et.getCumulativeOffsetTop(t(this,f)):Et.getCumulativeOffsetLeft(t(this,f))),h(this,R,t(this,R)-t(this,y).contentPosition)}transform(){let r=0;const e=t(this,y).viewportSize*t(this,y).sectionDistanceScaleCSSProperty.current;t(this,y).loopCSSProperty.current&&t(this,y).overscroll&&t(this,R)+t(this,ct)<t(this,y).currentScrollValue&&(r=t(this,y).distance*-1-t(this,y).gap),lt.scrollEntries.update(t(this,f),t(this,y).axisCSSProperty.current,r);const i=t(this,y).currentScrollValue+r,n=t(this,R)-t(this,y).viewportSize-e,c=t(this,R)+t(this,ct)+e,m=pe.clamp(i,n,c);t(this,y).vertical?t(this,f).style.transform=`translate3d(0px, ${m*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${m*-1}px, 0px, 0px)`}mark(r){t(this,N)!==r&&(t(this,N)&&t(this,f).classList.remove(t(this,N)),r&&t(this,f).classList.add(r),h(this,N,r),te.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,N)},custom:!0}))}}f=new WeakMap,Vt=new WeakMap,y=new WeakMap,ct=new WeakMap,R=new WeakMap,N=new WeakMap;const Oe=Se.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"100%",height:"100%",overflow:"var(--overflow, initial)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},':host([hibernated="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,ut,x,M,O,V,I,j,G,B,K,at,q,C,dt,St,pt,ft,wt,k,mt,Z,D,J,_,Q,gt,bt,X,Y,S,xt,l,Bt,_t,v,b,z,T,tt,A,P,g,zt,et,H,st,yt,Lt,it,F,o,Ot,Pt,Kt,Zt,se,ie,L,kt,me,It,Ht,re,ne,ot,he;class Mt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,ut,new p.CSSProperty(this,"--controls",!0));s(this,x,new p.CSSProperty(this,"--axis","y"));s(this,M,new p.CSSProperty(this,"--direction",0));s(this,O,new p.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,V,new p.CSSProperty(this,"--split",!1));s(this,I,new p.CSSProperty(this,"--sectional",!1));s(this,j,new p.CSSProperty(this,"--easing",!1));s(this,G,new p.CSSProperty(this,"--duration",!1));s(this,B,new p.CSSProperty(this,"--auto-size",!1));s(this,K,new p.CSSProperty(this,"--wheel-max-delta",!1));s(this,at,new p.CSSProperty(this,"--drag-inertion",1));s(this,q,new p.CSSProperty(this,"--sections-in-view",1));s(this,C,new p.CSSProperty(this,"--loop",!1));s(this,dt,new p.CSSProperty(this,"--damping",20));s(this,St,new p.CSSProperty(this,"--mass",0));s(this,pt,new p.CSSProperty(this,"--stiffness",0));s(this,ft,new p.CSSProperty(this,"--mouse-drag",!1));s(this,wt,new p.CSSProperty(this,"--section-distance-scale",.5));s(this,k,new p.CSSProperty(this,"--autoplay",0));s(this,mt,new p.CSSProperty(this,"--autoplay-pause-duration",0));s(this,Z,new p.CSSProperty(this,"--autoplay-user-direction",!1));s(this,D,new p.CSSProperty(this,"--classes",!1));s(this,J,new p.CSSProperty(this,"--current-index-start-offset",0));s(this,_,new p.CSSProperty(this,"--current-index-end-offset",0));s(this,Q,new p.CSSProperty(this,"--focus-delay",0));s(this,gt,new p.CSSProperty(this,"--focus-duration",3e3));s(this,bt,new p.CSSProperty(this,"--disabled",!1));s(this,X,new p.CSSProperty(this,"--hibernated",!1));s(this,Y,null);s(this,S,null);s(this,xt,null);s(this,l,[]);s(this,Bt,0);s(this,_t,0);s(this,v,0);s(this,b,0);s(this,z,0);s(this,T,null);s(this,tt,null);s(this,A,null);s(this,P,null);s(this,g,new Le.Store(0));s(this,zt,0);s(this,et,0);s(this,H,!1);s(this,st,!0);s(this,yt,!0);s(this,Lt);s(this,it);s(this,F,new qe.Tweened);s(this,L,()=>{t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,b)||0,i=t(this,g).current;if(h(this,Bt,this.vertical?Et.getCumulativeOffsetTop(this):Et.getCumulativeOffsetLeft(this)),h(this,_t,this.vertical?Et.getCumulativeOffsetTop(t(this,S)):Et.getCumulativeOffsetLeft(t(this,S))),h(this,v,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,z,de.cssUnitParser.parse(getComputedStyle(t(this,S)).rowGap)):h(this,z,de.cssUnitParser.parse(getComputedStyle(t(this,S)).columnGap)),t(this,B).current&&t(this,l).length){const n=t(this,q).current,c=(t(this,v)-t(this,z)*(n-1))/n;t(this,l).forEach(m=>{m.setSize(c)})}else t(this,l).forEach(n=>{n.setSize()});if(t(this,l).forEach(n=>{n.resize()}),t(this,O).current){h(this,b,t(this,v)*t(this,O).current);const n=t(this,b)+t(this,v);this.vertical?(t(this,S).style.width=n+"px",t(this,S).style.height="100%"):(t(this,S).style.height=n+"px",t(this,S).style.width="100%")}else this.vertical?(t(this,S).style.width="100%",t(this,S).style.height="max-content",h(this,b,t(this,S).offsetHeight-t(this,v))):(t(this,S).style.width="max-content",t(this,S).style.height="100%",h(this,b,t(this,S).offsetWidth-t(this,v)));if(!t(this,C).current){const n=getComputedStyle(this),c=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);h(this,b,t(this,b)+c),t(this,a).max=t(this,b)}if(t(this,C).current&&t(this,l).length){const n=t(this,l)[t(this,l).length-1],c=n.position+n.size-t(this,v),m=t(this,b)-c;h(this,et,n.position+n.size+m)}else h(this,et,t(this,b));if(t(this,I).current&&t(this,l).length){const n=t(this,l)[i];t(this,a).set(n.position,{equalize:!0})}else t(this,a).set(e*t(this,b),{equalize:!0});h(this,H,(this.vertical?t(this,S).offsetHeight:t(this,S).offsetWidth)>t(this,v)),this.classList.toggle("has-overflow",t(this,H)),t(this,H)?d(this,o,Zt).call(this):d(this,o,Kt).call(this),t(this,kt).call(this)});s(this,kt,()=>{if(!t(this,H))return;const e=this.currentScrollValue;if(h(this,zt,Math.max(0,e-t(this,b))),t(this,l).length){let i=0;for(let n=0;n<t(this,l).length;n++){const c=t(this,l)[n];c.transform(),this.targetScrollValue+c.size/2>=c.position&&(i=n)}t(this,g).current=i}else this.vertical?t(this,S).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,S).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;lt.scrollEntries.update(this,t(this,x).current,e)});s(this,It,(e,i)=>{t(this,ut).current&&(d(this,o,re).call(this,Math.sign(i)||1),t(this,Ht).call(this,e,i))});s(this,Ht,(e,i)=>{if(t(this,M).current){if(t(this,M).current<0&&i>0)return;if(t(this,M).current>0&&i<0)return}if(t(this,it)||t(this,F).unlistenAnimationFrame(),!t(this,k).current&&t(this,Q).current&&(clearInterval(t(this,Lt)),h(this,Lt,setTimeout(()=>{const n=d(this,o,he).call(this);n&&this.scrollToSection(n.index,{tween:{duration:t(this,gt).current,easing:ke.easeInOutExpo}})},t(this,Q).current))),!(e.includes("drag")&&!De.device.isMobile&&!t(this,ft).current))if(t(this,I).current&&e==="drag-end"){const n=Math.sign(i);t(this,l).length?this.shiftSections(n,{tween:t(this,j).current||t(this,G).current?{easing:t(this,j).current||"easeInOutCubic",duration:t(this,G).current||500}:void 0}):t(this,a).shift(n*t(this,v))}else t(this,a).shift(i)});if(Xt.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(Oe);const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,Y,document.createElement("div")),t(this,Y).className="content-wrapper",h(this,S,document.createElement("div")),t(this,S).className="content",h(this,xt,document.createElement("slot")),t(this,S).appendChild(t(this,xt)),t(this,Y).appendChild(t(this,S)),e.appendChild(t(this,Y))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,ut)}get axisCSSProperty(){return t(this,x)}get directionCSSProperty(){return t(this,M)}get pagesCSSProperty(){return t(this,O)}get splitCSSProperty(){return t(this,V)}get sectionalCSSProperty(){return t(this,I)}get easingCSSProperty(){return t(this,j)}get durationCSSProperty(){return t(this,G)}get autoSizeCSSProperty(){return t(this,B)}get wheelMaxDeltaCSSProperty(){return t(this,K)}get dragInertionCSSProperty(){return t(this,at)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,C)}get dampingCSSProperty(){return t(this,dt)}get massCSSProperty(){return t(this,St)}get stiffnessCSSProperty(){return t(this,pt)}get mouseDragCSSProperty(){return t(this,ft)}get sectionDistanceScaleCSSProperty(){return t(this,wt)}get autoplayCSSProperty(){return t(this,k)}get autoplayPauseDurationCSSProperty(){return t(this,mt)}get autoplayUserDirectionCSSProperty(){return t(this,Z)}get classesCSSProperty(){return t(this,D)}get currentIndexStartOffsetCSSProperty(){return t(this,J)}get currentIndexEndOffsetCSSProperty(){return t(this,_)}get focusDelayCSSProperty(){return t(this,Q)}get focusDurationCSSProperty(){return t(this,gt)}get disabledCSSProperty(){return t(this,bt)}get hibernatedCSSProperty(){return t(this,X)}get currentScrollValue(){return d(this,o,ne).call(this,"current")}get targetScrollValue(){return d(this,o,ne).call(this,"target")}get contentWrapperElement(){return t(this,Y)}get contentElement(){return t(this,S)}get sections(){return t(this,l)}get position(){return t(this,Bt)}get contentPosition(){return t(this,_t)}get viewportSize(){return t(this,v)}get scrollSize(){return t(this,b)}get gap(){return t(this,z)}get counter(){return t(this,g)}get limit(){return t(this,l).length-t(this,q).current}get distance(){return t(this,et)}get loopDistance(){return t(this,C).current?t(this,et)+t(this,z):t(this,et)}get hasOverflow(){return t(this,H)}get overscroll(){return t(this,zt)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,n=0){const c=e-n,m=c+i+n*2;return this.currentProgress<c?0:this.currentProgress>m?1:(this.currentProgress-c)/(m-c)}curve(e,i,n=0){return Math.sin(this.range(e,i,n)*Math.PI)}visible(e,i,n=0){const c=e-n,m=c+i+n*2;return this.currentProgress>=c&&this.currentProgress<=m}scrollToSection(e,i){if(!t(this,l).length)return;const n=t(this,g).current;d(this,o,me).call(this,e);const c=t(this,l)[n],m=t(this,l)[t(this,g).current];if(c&&m){let w=0;const Ct=d(this,o,he).call(this),Ee=Ct?this.targetScrollValue-Ct.position:0;t(this,C).current?t(this,g).current===0&&n===t(this,l).length-1?w=t(this,b)+t(this,v)-c.position+t(this,z):t(this,g).current===t(this,l).length-1&&n===0?w=m.position-(t(this,b)+t(this,v)+t(this,z)):w=m.position-c.position:w=m.position-c.position,this.shiftPosition(w-Ee,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,g).current+e,i)}setPosition(e,i){d(this,o,re).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,it)||(t(this,F).set(t(this,a).current,{equalize:!0}),t(this,F).set(e,ae({},i.tween)),h(this,it,setTimeout(()=>{h(this,it,void 0)},i.tween.duration))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){lt.scrollEntries.register(this),h(this,a,new Ie.Damped(0,{damping:.01,min:0,order:ee.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,T,new Gt.WheelControls({element:t(this,S)})),t(this,T).changeEvent.subscribe(t(this,It)),h(this,tt,new Gt.KeyboardControls({element:this})),t(this,tt).changeEvent.subscribe(t(this,It)),h(this,A,new Gt.DragControls({element:t(this,S)})),t(this,A).changeEvent.subscribe(t(this,It)),h(this,P,new Gt.AutoplayControls({culling:this})),t(this,P).changeEvent.subscribe(t(this,Ht)),t(this,x).subscribe(({current:e})=>{t(this,S).style.flexDirection=e==="x"?"row":"column",t(this,T).axis=t(this,K).current?"max":e,t(this,tt).dimension=e==="x"?"width":"height",t(this,A).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),this.isConnected&&t(this,L).call(this)}),t(this,K).subscribe(e=>{t(this,T).axis=e.current?"max":t(this,x).current}),t(this,at).subscribe(e=>{t(this,A).inertion=typeof e.current=="number"?e.current:1}),t(this,O).subscribe(()=>{this.isConnected&&t(this,L).call(this)}),t(this,V).subscribe(({current:e})=>{this.isConnected&&(e?d(this,o,Ot).call(this):d(this,o,Pt).call(this))}),t(this,I).subscribe(e=>{t(this,T).debounce=e.current,t(this,A).swipe=e.current,t(this,P).interval=e.current,this.isConnected&&(e.current&&!e.previous&&!t(this,l).length?d(this,o,Ot).call(this):!e.current&&e.previous&&t(this,l).length&&d(this,o,Pt).call(this))}),t(this,B).subscribe(e=>{this.isConnected&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,l).length?d(this,o,Ot).call(this):!e.current&&e.previous&&t(this,l).length&&d(this,o,Pt).call(this))}),t(this,q).subscribe(e=>{this.isConnected&&(t(this,L).call(this),d(this,o,ot).call(this))}),t(this,C).subscribe(e=>{e.current?(this.isConnected&&(t(this,l).length||(t(this,V).current=!0)),t(this,l).length&&(t(this,a).max=1/0,t(this,a).min=-1/0)):(h(this,zt,0),t(this,a).max=t(this,b),t(this,a).min=0)}),t(this,dt).subscribe(e=>{t(this,a).damping=e.current}),t(this,St).subscribe(e=>{t(this,a).mass=e.current}),t(this,pt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,k).subscribe(e=>{t(this,P).speed=e.current,!t(this,st)&&e.current&&!e.previous?t(this,P).connect():!e.current&&e.previous&&t(this,P).disconnect()}),t(this,Z).subscribe(e=>{e.current||(t(this,P).direction=1)}),t(this,D).subscribe(e=>{this.isConnected&&d(this,o,ot).call(this)}),t(this,J).subscribe(e=>{this.isConnected&&t(this,D).current&&d(this,o,ot).call(this)}),t(this,_).subscribe(e=>{this.isConnected&&t(this,D).current&&d(this,o,ot).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,g).subscribe(e=>{t(this,l).length&&d(this,o,ot).call(this)}),t(this,F).subscribe(e=>{t(this,F).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,bt).subscribe(e=>{e.current&&!e.previous?d(this,o,Kt).call(this):!e.current&&e.previous&&d(this,o,Zt).call(this)}),t(this,X).subscribe(e=>{e.current&&!e.previous?d(this,o,se).call(this):!e.current&&e.previous&&d(this,o,ie).call(this)}),t(this,ut).observe(),t(this,x).observe(),t(this,M).observe(),t(this,O).observe(),t(this,V).observe(),t(this,I).observe(),t(this,j).observe(),t(this,G).observe(),t(this,B).observe(),t(this,K).observe(),t(this,at).observe(),t(this,q).observe(),t(this,C).observe(),t(this,dt).observe(),t(this,St).observe(),t(this,pt).observe(),t(this,ft).observe(),t(this,wt).observe(),t(this,k).observe(),t(this,k).observe(),t(this,mt).observe(),t(this,Z).observe(),t(this,D).observe(),t(this,J).observe(),t(this,_).observe(),t(this,Q).observe(),t(this,gt).observe(),t(this,bt).observe(),t(this,X).observe(),t(this,X).current||d(this,o,ie).call(this)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("has-overflow"),t(this,ut).unobserve(),t(this,x).unobserve(),t(this,M).unobserve(),t(this,O).unobserve(),t(this,V).unobserve(),t(this,I).unobserve(),t(this,j).unobserve(),t(this,G).unobserve(),t(this,B).unobserve(),t(this,K).unobserve(),t(this,at).unobserve(),t(this,q).unobserve(),t(this,C).unobserve(),t(this,dt).unobserve(),t(this,St).unobserve(),t(this,pt).unobserve(),t(this,ft).unobserve(),t(this,wt).unobserve(),t(this,k).unobserve(),t(this,mt).unobserve(),t(this,Z).unobserve(),t(this,D).unobserve(),t(this,J).unobserve(),t(this,_).unobserve(),t(this,Q).unobserve(),t(this,gt).unobserve(),t(this,bt).unobserve(),t(this,X).unobserve(),d(this,o,se).call(this)}}a=new WeakMap,ut=new WeakMap,x=new WeakMap,M=new WeakMap,O=new WeakMap,V=new WeakMap,I=new WeakMap,j=new WeakMap,G=new WeakMap,B=new WeakMap,K=new WeakMap,at=new WeakMap,q=new WeakMap,C=new WeakMap,dt=new WeakMap,St=new WeakMap,pt=new WeakMap,ft=new WeakMap,wt=new WeakMap,k=new WeakMap,mt=new WeakMap,Z=new WeakMap,D=new WeakMap,J=new WeakMap,_=new WeakMap,Q=new WeakMap,gt=new WeakMap,bt=new WeakMap,X=new WeakMap,Y=new WeakMap,S=new WeakMap,xt=new WeakMap,l=new WeakMap,Bt=new WeakMap,_t=new WeakMap,v=new WeakMap,b=new WeakMap,z=new WeakMap,T=new WeakMap,tt=new WeakMap,A=new WeakMap,P=new WeakMap,g=new WeakMap,zt=new WeakMap,et=new WeakMap,H=new WeakMap,st=new WeakMap,yt=new WeakMap,Lt=new WeakMap,it=new WeakMap,F=new WeakMap,o=new WeakSet,Ot=function(){d(this,o,Pt).call(this),t(this,xt).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Me(e,i,this))}),t(this,S).style.transform="",te.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),d(this,o,ot).call(this)},Pt=function(){t(this,l).forEach(e=>{e.destroy()}),h(this,l,[]),t(this,g).reset(),t(this,a).reset(),te.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},Kt=function(){t(this,st)||(h(this,st,!0),t(this,a).unsubscribe(t(this,kt)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Lt)),clearInterval(t(this,it)),t(this,F).unlistenAnimationFrame(),t(this,T).disconnect(),t(this,tt).disconnect(),t(this,A).disconnect(),t(this,P).disconnect(),t(this,H)||this.sections.forEach(e=>{e.unsetTransform()}))},Zt=function(){t(this,st)&&(h(this,st,!1),t(this,a).subscribe(t(this,kt)),t(this,T).connect(),t(this,tt).connect(),t(this,A).connect(),t(this,k).current&&t(this,P).connect())},se=function(){t(this,yt)||(h(this,yt,!0),Jt.windowResizer.unsubscribe(t(this,L)),Qt.elementResizer.unsubscribe(t(this,L)),d(this,o,Kt).call(this),t(this,S).style.transform="",t(this,l).length?d(this,o,Pt).call(this):(t(this,g).reset(),t(this,a).reset()),lt.scrollEntries.unregister(this))},ie=function(){t(this,yt)&&(h(this,yt,!1),lt.scrollEntries.register(this),(t(this,C).current||t(this,V).current||t(this,C).current||t(this,B).current||t(this,I).current)&&d(this,o,Ot).call(this),d(this,o,Zt).call(this),Jt.windowResizer.subscribe(t(this,L),ee.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,kt=new WeakMap,me=function(e){t(this,C).current?(t(this,g).current=e%t(this,l).length,t(this,g).current=t(this,g).current<0?t(this,l).length+t(this,g).current:t(this,g).current):t(this,g).current=pe.clamp(e,0,this.limit)},It=new WeakMap,Ht=new WeakMap,re=function(e=1){t(this,Z).current&&(t(this,P).direction=e),t(this,k).current&&t(this,P).pauseAndContinue(t(this,mt).current,this.sectionalCSSProperty.current)},ne=function(e="current"){if(t(this,C).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,b)+t(this,v)+t(this,z));return i<0?t(this,b)+i+t(this,v)+t(this,z):i}else return t(this,a)[e]},ot=function(){if(t(this,D).current&&t(this,l).length){const e=t(this,g).current+t(this,J).current;e===0?this.classList.add("start"):this.classList.remove("start"),e===this.limit?this.classList.add("end"):this.classList.remove("end");const i=t(this,q).current+t(this,_).current;t(this,l).forEach((n,c)=>{const m=e-this.limit-1+t(this,_).current,w=e+i,Ct=this.sections.length-w;c>=e&&c<w||c<=m?n.mark("current"):c>=w&&c<w+Ct/2||c<=m+i?n.mark("next"):n.mark("previous")})}},he=function(e=this.targetScrollValue){let i=null,n=1/0;for(let c=0;c<t(this,l).length;c++){const m=Math.abs(t(this,l)[c].position-e);m<n&&(n=m,i=c)}return i!==null?t(this,l)[i]:null};customElements.get("e-scroll")||customElements.define("e-scroll",Mt);var Ft;class oe extends HTMLElement{constructor(){super(...arguments);s(this,Ft,null)}get scrollElement(){return t(this,Ft)}connectedCallback(){const e=fe.findParentElement(this,Mt);e instanceof Mt?h(this,Ft,e):console.error(this,"e-scroll not found")}}Ft=new WeakMap;var rt,E,W,U,qt,Dt,vt,Wt,Ut,$t;class ge extends oe{constructor(){super();s(this,rt,null);s(this,E,null);s(this,W,!1);s(this,U,0);s(this,qt,0);s(this,Dt,0);s(this,vt,()=>{h(this,W,this.offsetWidth>this.offsetHeight);const e=t(this,W)?this.offsetWidth:this.offsetHeight;h(this,U,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,U,Math.max(t(this,U),30)),t(this,W)?(t(this,E).style.width=t(this,U)+"px",t(this,E).style.height="100%"):(t(this,E).style.width="100%",t(this,E).style.height=t(this,U)+"px"),h(this,qt,e-t(this,U)),this.scrollElement.scrollSize||(this.style.display="none")});s(this,Wt,()=>{h(this,Dt,this.scrollElement.currentProgress*t(this,qt)),t(this,W)?t(this,E).style.transform=`translate3d(${t(this,Dt)}px, 0px, 0px)`:t(this,E).style.transform=`translate3d(0px, ${t(this,Dt)}px, 0px)`});s(this,Ut,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,$t,e=>{document.documentElement.classList.add("grabbing"),Te.setupDrag(c=>{const m=t(this,W)?c.x:c.y,w=this.scrollElement.distance/t(this,qt),Ct=(m-n)*w;this.scrollElement.setPosition(i+Ct)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,n=t(this,W)?e.x:e.y});if(Xt.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(Se.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"black",borderRadius:"0.3vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})),h(this,rt,document.createElement("slot")),t(this,rt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,rt))}}get thumbElement(){return t(this,E)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,rt).assignedElements()[0]||t(this,rt).firstElementChild;h(this,E,e),t(this,E).addEventListener("pointerdown",t(this,$t)),Jt.windowResizer.subscribe(t(this,vt),ee.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,vt)),this.scrollElement.onScroll(t(this,Wt)),this.scrollElement.axisCSSProperty.subscribe(t(this,Ut))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),t(this,E).removeEventListener("pointerdown",t(this,$t)),Jt.windowResizer.unsubscribe(t(this,vt)),Qt.elementResizer.unsubscribe(t(this,vt)),this.scrollElement.offScroll(t(this,Wt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,Ut))}}rt=new WeakMap,E=new WeakMap,W=new WeakMap,U=new WeakMap,qt=new WeakMap,Dt=new WeakMap,vt=new WeakMap,Wt=new WeakMap,Ut=new WeakMap,$t=new WeakMap;customElements.get("e-scrollbar")||customElements.define("e-scrollbar",ge);class be extends oe{constructor(){super(),Xt.isBrowser&&this.addEventListener("click",()=>{const r=this.getAttribute("behaviour"),e=this.getAttribute("easing")||void 0,i=e?parseFloat(this.getAttribute("duration")||"0"):void 0;this.handleClick({behaviour:r,tween:e?{easing:e,duration:i}:void 0})})}}class ye extends be{handleClick(r){const e=this.getAttribute("index");this.scrollElement.scrollToSection(parseInt(e||"0"),r)}}customElements.get("e-scroll-set-button")||customElements.define("e-scroll-set-button",ye);class ve extends be{handleClick(r){const e=this.getAttribute("step");this.scrollElement.shiftSections(parseInt(e||"1"),r)}}customElements.get("e-scroll-step-button")||customElements.define("e-scroll-step-button",ve);var $,nt,Tt,Nt,jt,At;class Ve{constructor(r,e,i){s(this,$,null);s(this,nt,null);s(this,Tt,null);s(this,Nt,null);s(this,jt,()=>{t(this,nt).scrollToSection(t(this,Tt),{behaviour:t(this,Nt)})});s(this,At,()=>{t(this,$).classList.toggle("current",t(this,nt).counter.current===t(this,Tt))});Xt.isBrowser&&(h(this,$,document.createElement("button")),h(this,nt,r),h(this,Nt,i),h(this,Tt,e),t(this,$).addEventListener("click",t(this,jt)),t(this,nt).counter.subscribe(t(this,At)),t(this,At).call(this))}get element(){return t(this,$)}destroy(){t(this,$).removeEventListener("click",t(this,jt)),t(this,nt).counter.unsubscribe(t(this,At)),t(this,$).remove()}}$=new WeakMap,nt=new WeakMap,Tt=new WeakMap,Nt=new WeakMap,jt=new WeakMap,At=new WeakMap;var ht,Rt;class Ce extends oe{constructor(){super(...arguments);s(this,ht,[]);s(this,Rt,Ae.debounce(()=>{t(this,ht).forEach(e=>e.destroy()),h(this,ht,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Ve(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,ht).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Rt)),t(this,Rt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Rt)),t(this,ht).forEach(e=>e.destroy()),h(this,ht,[])}}ht=new WeakMap,Rt=new WeakMap;customElements.get("e-scroll-bullet-buttons")||customElements.define("e-scroll-bullet-buttons",Ce);class Pe extends Re.ScrollSegmentElement{connectedCallback(){const r=fe.findParentElement(this,Mt);r instanceof Mt?(this.scrollContainer=r,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}customElements.get("e-scroll-segment")||customElements.define("e-scroll-segment",Pe);exports.ScrollBulletButtonsElement=Ce;exports.ScrollElement=Mt;exports.ScrollSegmentElement=Pe;exports.ScrollSetButtonElement=ye;exports.ScrollStepButtonElement=ve;exports.ScrollbarElement=ge;
|