aptechka 0.4.22 → 0.4.24
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 +7 -1
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +611 -579
- package/package.json +1 -1
|
@@ -5,6 +5,10 @@ import { CustomElement } from '../custom-element';
|
|
|
5
5
|
import { Damped } from '../animation';
|
|
6
6
|
|
|
7
7
|
export type ScrollBehaviour = 'smooth' | 'instant';
|
|
8
|
+
export type SectionMark = 'current' | 'previous' | 'next' | null;
|
|
9
|
+
export type SectionmarkChangeEvent = CustomEvent<{
|
|
10
|
+
mark: SectionMark;
|
|
11
|
+
}>;
|
|
8
12
|
declare class Section {
|
|
9
13
|
#private;
|
|
10
14
|
constructor(element: HTMLElement, scrollElement: ScrollElement);
|
|
@@ -14,6 +18,7 @@ declare class Section {
|
|
|
14
18
|
setSize(value?: number): void;
|
|
15
19
|
resize(): void;
|
|
16
20
|
transform(): void;
|
|
21
|
+
mark(mark: SectionMark): void;
|
|
17
22
|
}
|
|
18
23
|
export declare class ScrollElement extends CustomElement {
|
|
19
24
|
#private;
|
|
@@ -22,9 +27,9 @@ export declare class ScrollElement extends CustomElement {
|
|
|
22
27
|
get pagesCSSProperty(): CSSProperty<number, keyof import('../store').StoreManagers>;
|
|
23
28
|
get splitCSSProperty(): CSSProperty<boolean, keyof import('../store').StoreManagers>;
|
|
24
29
|
get sectionalCSSProperty(): CSSProperty<boolean, keyof import('../store').StoreManagers>;
|
|
30
|
+
get autoSizeCSSProperty(): CSSProperty<boolean, keyof import('../store').StoreManagers>;
|
|
25
31
|
get wheelMaxDeltaCSSProperty(): CSSProperty<boolean, keyof import('../store').StoreManagers>;
|
|
26
32
|
get sectionsInViewCSSProperty(): CSSProperty<number, keyof import('../store').StoreManagers>;
|
|
27
|
-
get autoSizeCSSProperty(): CSSProperty<boolean, keyof import('../store').StoreManagers>;
|
|
28
33
|
get infiniteCSSProperty(): CSSProperty<boolean, keyof import('../store').StoreManagers>;
|
|
29
34
|
get dampingCSSProperty(): CSSProperty<number, keyof import('../store').StoreManagers>;
|
|
30
35
|
get massCSSProperty(): CSSProperty<number, keyof import('../store').StoreManagers>;
|
|
@@ -71,6 +76,7 @@ declare global {
|
|
|
71
76
|
}
|
|
72
77
|
interface HTMLElementEventMap {
|
|
73
78
|
sectionsChange: CustomEvent;
|
|
79
|
+
sectionMarkChange: SectionmarkChangeEvent;
|
|
74
80
|
}
|
|
75
81
|
}
|
|
76
82
|
export {};
|
package/lib/scroll/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var rs=(r,e,i)=>{if(!e.has(r))throw TypeError("Cannot "+i)};var o=(r,e,i)=>(rs(r,e,"read from private field"),i?i.call(r):e.get(r)),O=(r,e,i)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,i)},R=(r,e,i,h)=>(rs(r,e,"write to private field"),h?h.call(r,i):e.set(r,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Es=require("../Damped-B0G_t-pw.cjs"),Ne=require("../browser-CpzFX2xg.cjs"),mt=require("../layout-8ryRAMGJ.cjs"),Ht=require("../math-GDWEqu7y.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const wt=require("../Store-BQGNOHlY.cjs"),ks=require("../Derived-BZtlW0bB.cjs");require("../ticker/index.cjs");const Fe=require("../DragControls-CV1YozSr.cjs"),vt=require("../custom-element/index.cjs"),Ve=require("../order/index.cjs"),Kt=require("../window-resizer/index.cjs"),Vt=require("../scroll-entries/index.cjs"),A=require("../tags-CueX-JLX.cjs"),Je=require("../createStylesheet-C8aQQ4hd.cjs"),hs=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),Ws=require("../Viewport-_WllZTJ0.cjs"),Ms=require("../gestures-DHLrn6Q8.cjs"),ns=require("../theme/index.cjs"),os=require("../element-resizer/index.cjs"),xs=require("../dom-JBOkFLTh.cjs"),cs=require("../function-MthRj-GJ.cjs");var Ls=Object.defineProperty,zs=Object.getOwnPropertyDescriptor,Vs=(r,e,i,h)=>{for(var n=h>1?void 0:h?zs(e,i):e,c=r.length-1,u;c>=0;c--)(u=r[c])&&(n=(h?u(e,i,n):u(n))||n);return h&&n&&Ls(e,i,n),n},Qe=(r,e,i)=>{if(!e.has(r))throw TypeError("Cannot "+i)},s=(r,e,i)=>(Qe(r,e,"read from private field"),i?i.call(r):e.get(r)),l=(r,e,i)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,i)},g=(r,e,i,h)=>(Qe(r,e,"write to private field"),h?h.call(r,i):e.set(r,i),i),C=(r,e,i)=>(Qe(r,e,"access private method"),i),f,$,et,N,st,_t,it,Qt,D,$t,ue,pe,Ft,Dt,Rt,w,We,d,fe,Se,M,b,q,J,xt,ct,y,Xt,bt,Nt,Jt,ne,Me,Gt,oe,xe,Xe,Le,Ye,de,De,me,Re,tt,Oe,Te,us,Yt,ve,qe,ze,je,_,E,zt,Y;class Os{constructor(e,i){O(this,_,void 0);O(this,E,void 0);O(this,zt,0);O(this,Y,0);R(this,_,e),R(this,E,i),Vt.scrollEntries.register(o(this,_))}get size(){return o(this,zt)}get position(){return o(this,Y)}destroy(){Vt.scrollEntries.unregister(o(this,_)),o(this,_).style.transform=""}setSize(e){e?(o(this,_).style.setProperty("--size",e+"px"),o(this,E).axisCSSProperty.current==="x"?(o(this,_).style.width=e+"px",o(this,_).style.height=""):(o(this,_).style.height=e+"px",o(this,_).style.width="")):(o(this,_).style.width="",o(this,_).style.height="",o(this,_).style.removeProperty("--size"))}resize(){R(this,zt,o(this,E).vertical?o(this,_).offsetHeight:o(this,_).offsetWidth),R(this,Y,o(this,E).vertical?mt.getCumulativeOffsetTop(o(this,_)):mt.getCumulativeOffsetLeft(o(this,_))),R(this,Y,o(this,Y)-o(this,E).contentPosition)}transform(){let e=0;const i=o(this,E).viewportSize;o(this,E).infiniteCSSProperty.current&&o(this,E).overscroll&&o(this,Y)+o(this,zt)<o(this,E).currentScrollValue&&(e=o(this,E).distance*-1-o(this,E).gap),Vt.scrollEntries.update(o(this,_),o(this,E).axisCSSProperty.current,e);const h=o(this,E).currentScrollValue+e,n=o(this,Y)-o(this,E).viewportSize-i,c=o(this,Y)+o(this,zt)+i,u=Ht.clamp(h,n,c);o(this,E).vertical?o(this,_).style.transform=`translate3d(0px, ${u*-1}px, 0px)`:o(this,_).style.transform=`translate3d(${u*-1}px, 0px, 0px)`}}_=new WeakMap,E=new WeakMap,zt=new WeakMap,Y=new WeakMap;const $s=Je.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":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)"},':host([hibernated="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});exports.ScrollElement=class extends vt.CustomElement{constructor(){super(),l(this,ne),l(this,Gt),l(this,xe),l(this,Le),l(this,de),l(this,me),l(this,Te),l(this,ve),l(this,ze),l(this,f,null),l(this,$,new S.CSSProperty(this,"--axis","y")),l(this,et,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)})),l(this,N,new S.CSSProperty(this,"--split",!1)),l(this,st,new S.CSSProperty(this,"--sectional",!1)),l(this,_t,new S.CSSProperty(this,"--wheel-max-delta",!1)),l(this,it,new S.CSSProperty(this,"--sections-in-view",1)),l(this,Qt,new S.CSSProperty(this,"--auto-size",!1)),l(this,D,new S.CSSProperty(this,"--infinite",!1)),l(this,$t,new S.CSSProperty(this,"--damping",20)),l(this,ue,new S.CSSProperty(this,"--mass",0)),l(this,pe,new S.CSSProperty(this,"--stiffness",0)),l(this,Ft,new S.CSSProperty(this,"--mouse-drag",!1)),l(this,Dt,new S.CSSProperty(this,"--disabled",!1)),l(this,Rt,new S.CSSProperty(this,"--hibernated",!1)),l(this,w,null),l(this,We,null),l(this,d,[]),l(this,fe,0),l(this,Se,0),l(this,M,0),l(this,b,0),l(this,q,0),l(this,J,null),l(this,xt,null),l(this,ct,null),l(this,y,new wt.Store(0)),l(this,Xt,0),l(this,bt,0),l(this,Nt,!0),l(this,Jt,!0),l(this,tt,()=>{const e=this.currentScrollValue/s(this,b)||0;if(g(this,fe,this.vertical?mt.getCumulativeOffsetTop(this):mt.getCumulativeOffsetLeft(this)),g(this,Se,this.vertical?mt.getCumulativeOffsetTop(s(this,w)):mt.getCumulativeOffsetLeft(s(this,w))),g(this,M,this.vertical?this.offsetHeight:this.offsetWidth),s(this,et).current){g(this,b,s(this,M)*s(this,et).current);const i=s(this,b)+s(this,M);this.vertical?(s(this,w).style.width=i+"px",s(this,w).style.height="100%"):(s(this,w).style.height=i+"px",s(this,w).style.width="100%")}else this.vertical?(s(this,w).style.width="100%",s(this,w).style.height="max-content",g(this,b,s(this,w).offsetHeight-s(this,M))):(s(this,w).style.width="max-content",s(this,w).style.height="100%",g(this,b,s(this,w).offsetWidth-s(this,M)));if(this.vertical?g(this,q,hs.cssUnitParser.parse(getComputedStyle(s(this,w)).rowGap)):g(this,q,hs.cssUnitParser.parse(getComputedStyle(s(this,w)).columnGap)),s(this,Qt).current&&s(this,d).length){const i=s(this,it).current,h=(s(this,M)-s(this,q)*(i-1))/i;s(this,d).forEach(n=>{n.setSize(h)})}else s(this,d).forEach(i=>{i.setSize()});if(!s(this,D).current){const i=getComputedStyle(this);g(this,b,s(this,b)+(this.vertical?parseFloat(i.paddingBlockStart)+parseFloat(i.paddingBlockEnd):parseFloat(i.paddingInlineStart)+parseFloat(i.paddingInlineEnd))),s(this,f).max=s(this,b)}if(s(this,d).forEach(i=>{i.resize(),i.transform()}),s(this,D).current&&s(this,d).length){const i=s(this,d)[s(this,d).length-1],h=i.position+i.size-s(this,M),n=s(this,b)-h;g(this,bt,i.position+i.size+n)}else g(this,bt,s(this,b));if(s(this,st).current&&s(this,d).length){const i=s(this,d)[s(this,y).current];s(this,f).set(i.position,!0)}else s(this,f).set(e*s(this,b),!0)}),l(this,Oe,()=>{const e=this.currentScrollValue;if(g(this,Xt,Math.max(0,e-s(this,b))),s(this,d).length){let i=0;for(let h=0;h<s(this,d).length;h++){const n=s(this,d)[h];n.transform(),this.targetScrollValue+n.size/2>=n.position&&(i=h)}s(this,y).current=i}else this.vertical?s(this,w).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:s(this,w).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;Vt.scrollEntries.update(this,s(this,$).current,e)}),l(this,Yt,(e,i)=>{if(!(e==="drag"&&!Ws.device.isMobile&&!s(this,Ft).current))if(s(this,st).current){const h=Math.sign(i);s(this,d).length?this.shiftSections(h):s(this,f).shift(h*s(this,M))}else s(this,f).shift(i)}),Ne.isBrowser&&(g(this,f,new Es.Damped(0,{damping:.01,min:0,order:Ve.TICK_ORDER.SCROLL})),this.openShadow($s),A.element(this,{tabIndex:0,children:[A.div({class:"static",children:[A.slot({name:"static"})]}),A.div({class:"content",children:[A.slot({ref:e=>g(this,We,e)})],style:{flexDirection:new ks.Derived(s(this,$),e=>e==="x"?"row":"column")},ref:e=>g(this,w,e)})]}),g(this,J,new Fe.WheelControls({element:this})),s(this,J).changeEvent.subscribe(s(this,Yt)),g(this,xt,new Fe.KeyboardControls({element:this})),s(this,xt).changeEvent.subscribe(s(this,Yt)),g(this,ct,new Fe.DragControls({element:this})),s(this,ct).changeEvent.subscribe(s(this,Yt)),s(this,$).subscribe(({current:e})=>{s(this,w).style.flexDirection=e==="x"?"row":"column",s(this,J).axis=s(this,_t).current?"max":e,s(this,xt).dimension=e==="x"?"width":"height",s(this,ct).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),this.isConnected&&s(this,tt).call(this)}),s(this,_t).subscribe(e=>{s(this,J).axis=e.current?"max":s(this,$).current}),s(this,et).subscribe(()=>{this.isConnected&&s(this,tt).call(this)}),s(this,N).subscribe(({current:e})=>{this.isConnected&&(e?C(this,ne,Me).call(this):C(this,Gt,oe).call(this))}),s(this,st).subscribe(e=>{s(this,y).current=0,s(this,J).debounce=e.current,s(this,ct).swipe=e.current,s(this,f).reset(),this.isConnected&&(e.current&&!e.previous?C(this,ne,Me).call(this):!e.current&&e.previous&&C(this,Gt,oe).call(this))}),s(this,it).subscribe(e=>{this.isConnected&&s(this,tt).call(this)}),s(this,Qt).subscribe(e=>{this.isConnected&&s(this,tt).call(this)}),s(this,D).subscribe(e=>{e.current?(this.isConnected&&(s(this,d).length||(s(this,N).current=!0)),s(this,d).length&&(s(this,f).max=1/0,s(this,f).min=-1/0)):(g(this,Xt,0),s(this,f).max=s(this,b),s(this,f).min=0)}),s(this,$t).subscribe(e=>{s(this,f).damping=e.current}),s(this,ue).subscribe(e=>{s(this,f).mass=e.current}),s(this,pe).subscribe(e=>{s(this,f).stiffness=e.current}),s(this,Dt).subscribe(e=>{e.current&&!e.previous?C(this,xe,Xe).call(this):!e.current&&e.previous&&C(this,Le,Ye).call(this)}),s(this,Rt).subscribe(e=>{e.current&&!e.previous?C(this,de,De).call(this):!e.current&&e.previous&&C(this,me,Re).call(this)}),s(this,f).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),s(this,y).subscribe(e=>{s(this,d).length&&C(this,ze,je).call(this)}))}get axisCSSProperty(){return s(this,$)}get pagesCSSProperty(){return s(this,et)}get splitCSSProperty(){return s(this,N)}get sectionalCSSProperty(){return s(this,st)}get wheelMaxDeltaCSSProperty(){return s(this,_t)}get sectionsInViewCSSProperty(){return s(this,it)}get autoSizeCSSProperty(){return s(this,Qt)}get infiniteCSSProperty(){return s(this,D)}get dampingCSSProperty(){return s(this,$t)}get massCSSProperty(){return s(this,ue)}get stiffnessCSSProperty(){return s(this,pe)}get mouseDragCSSProperty(){return s(this,Ft)}get disabledCSSProperty(){return s(this,Dt)}get hibernatedCSSProperty(){return s(this,Rt)}get currentScrollValue(){return C(this,ve,qe).call(this,"current")}get targetScrollValue(){return C(this,ve,qe).call(this,"target")}get contentElement(){return s(this,w)}get sections(){return s(this,d)}get position(){return s(this,fe)}get contentPosition(){return s(this,Se)}get viewportSize(){return s(this,M)}get scrollSize(){return s(this,b)}get gap(){return s(this,q)}get counter(){return s(this,y)}get limit(){return s(this,d).length-s(this,it).current}get distance(){return s(this,bt)}get infiniteDistance(){return s(this,D).current?s(this,bt)+s(this,q):s(this,bt)}get overscroll(){return s(this,Xt)}get vertical(){return s(this,$).current==="y"}get currentProgress(){return this.currentScrollValue/this.infiniteDistance||0}get targetProgress(){return this.targetScrollValue/this.infiniteDistance||0}get speed(){return s(this,f).speed}get direction(){return s(this,f).direction}get isRunning(){return s(this,f).isRunning}get scrollWidth(){return s(this,$).current==="y"?0:s(this,f).length}get scrollHeight(){return s(this,$).current==="x"?0:s(this,f).length}onScroll(...e){return s(this,f).subscribe(...e)}offScroll(...e){s(this,f).unsubscribe(...e)}range(e,i,h=0){const n=e-h,c=n+i+h*2;return this.currentProgress<n?0:this.currentProgress>c?1:(this.currentProgress-n)/(c-n)}curve(e,i,h=0){return Math.sin(this.range(e,i,h)*Math.PI)}visible(e,i,h=0){const n=e-h,c=n+i+h*2;return this.currentProgress>=n&&this.currentProgress<=c}scrollToSection(e,i="smooth"){if(!s(this,d).length)return;const h=s(this,y).current;C(this,Te,us).call(this,e);const n=s(this,d)[h],c=s(this,d)[s(this,y).current];if(n&&c){let u=0;s(this,D).current?s(this,y).current===0&&h===this.limit?u=s(this,b)+s(this,M)-n.position+s(this,q):s(this,y).current===this.limit&&h===0?u=c.position-(s(this,b)+s(this,M)+s(this,q)):u=c.position-n.position:u=c.position-n.position,s(this,f).shift(u,i==="instant")}}shiftSections(e,i="smooth"){s(this,d).length&&this.scrollToSection(s(this,y).current+e,i)}setPosition(e,i="smooth"){s(this,f).set(e,i==="instant")}connectedCallback(){s(this,$).observe(),s(this,et).observe(),s(this,N).observe(),s(this,st).observe(),s(this,_t).observe(),s(this,it).observe(),s(this,D).observe(),s(this,$t).observe(),s(this,Ft).observe(),s(this,Dt).observe(),s(this,Rt).observe(),C(this,me,Re).call(this)}disconnectedCallback(){s(this,$).unobserve(),s(this,et).unobserve(),s(this,N).unobserve(),s(this,st).unobserve(),s(this,_t).unobserve(),s(this,it).unobserve(),s(this,D).unobserve(),s(this,$t).unobserve(),s(this,Ft).unobserve(),s(this,Dt).unobserve(),s(this,Rt).unobserve(),C(this,de,De).call(this)}};f=new WeakMap;$=new WeakMap;et=new WeakMap;N=new WeakMap;st=new WeakMap;_t=new WeakMap;it=new WeakMap;Qt=new WeakMap;D=new WeakMap;$t=new WeakMap;ue=new WeakMap;pe=new WeakMap;Ft=new WeakMap;Dt=new WeakMap;Rt=new WeakMap;w=new WeakMap;We=new WeakMap;d=new WeakMap;fe=new WeakMap;Se=new WeakMap;M=new WeakMap;b=new WeakMap;q=new WeakMap;J=new WeakMap;xt=new WeakMap;ct=new WeakMap;y=new WeakMap;Xt=new WeakMap;bt=new WeakMap;Nt=new WeakMap;Jt=new WeakMap;ne=new WeakSet;Me=function(){C(this,Gt,oe).call(this),s(this,We).assignedElements().forEach(r=>{r instanceof HTMLElement&&s(this,d).push(new Os(r,this))}),s(this,w).style.transform="",this.dispatchEvent(new CustomEvent("sectionsChange",{composed:!0})),s(this,tt).call(this),C(this,ze,je).call(this)};Gt=new WeakSet;oe=function(){s(this,d).forEach(r=>{r.destroy()}),g(this,d,[]),this.dispatchEvent(new CustomEvent("sectionsChange",{composed:!0}))};xe=new WeakSet;Xe=function(){s(this,Nt)||(g(this,Nt,!0),s(this,f).unsubscribe(s(this,Oe)),s(this,f).unlistenAnimationFrame(),s(this,J).disconnect(),s(this,xt).disconnect(),s(this,ct).disconnect())};Le=new WeakSet;Ye=function(){s(this,Nt)&&(g(this,Nt,!1),s(this,f).subscribe(s(this,Oe)),s(this,J).connect(),s(this,xt).connect(),s(this,ct).connect())};de=new WeakSet;De=function(){s(this,Jt)||(g(this,Jt,!0),Kt.windowResizer.unsubscribe(s(this,tt)),s(this,f).reset(),C(this,xe,Xe).call(this),s(this,w).style.transform="",s(this,N).current&&C(this,Gt,oe).call(this),Vt.scrollEntries.unregister(this))};me=new WeakSet;Re=function(){s(this,Jt)&&(g(this,Jt,!1),s(this,N).current&&C(this,ne,Me).call(this),Vt.scrollEntries.register(this),Kt.windowResizer.subscribe(s(this,tt),Ve.RESIZE_ORDER.SCROLL),C(this,Le,Ye).call(this))};tt=new WeakMap;Oe=new WeakMap;Te=new WeakSet;us=function(r){s(this,D).current?(s(this,y).current=r%s(this,d).length,s(this,y).current=s(this,y).current<0?s(this,d).length+s(this,y).current:s(this,y).current):s(this,y).current=Ht.clamp(r,0,this.limit)};Yt=new WeakMap;ve=new WeakSet;qe=function(r="current"){if(s(this,D).current&&s(this,d).length){const e=s(this,f)[r]%(s(this,b)+s(this,M)+s(this,q));return e<0?s(this,b)+e+s(this,M)+s(this,q):e}else return s(this,f)[r]};ze=new WeakSet;je=function(){s(this,d).length&&(s(this,y).current===0?this.classList.add("start"):this.classList.remove("start"),s(this,y).current===this.limit?this.classList.add("end"):this.classList.remove("end"))};exports.ScrollElement=Vs([vt.define("e-scroll")],exports.ScrollElement);var ae;class $e extends vt.CustomElement{constructor(){super(...arguments);O(this,ae,null)}get scrollElement(){return o(this,ae)}connectedCallback(){const i=xs.findParentElement(this,exports.ScrollElement);i instanceof exports.ScrollElement?R(this,ae,i):console.error(this,"e-scroll not found")}}ae=new WeakMap;var Fs=Object.defineProperty,Ds=Object.getOwnPropertyDescriptor,Rs=(r,e,i,h)=>{for(var n=h>1?void 0:h?Ds(e,i):e,c=r.length-1,u;c>=0;c--)(u=r[c])&&(n=(h?u(e,i,n):u(n))||n);return h&&n&&Fs(e,i,n),n},ps=(r,e,i)=>{if(!e.has(r))throw TypeError("Cannot "+i)},p=(r,e,i)=>(ps(r,e,"read from private field"),i?i.call(r):e.get(r)),U=(r,e,i)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,i)},gt=(r,e,i,h)=>(ps(r,e,"write to private field"),h?h.call(r,i):e.set(r,i),i),jt,F,rt,ht,te,ee,Tt,ge,we,_e;const Ts=Je.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:ns.aptechkaTheme.colorLight.var},':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:ns.aptechkaTheme.colorDark.var,borderRadius:"1vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}});exports.ScrollbarElement=class extends $e{constructor(){super(),U(this,jt,null),U(this,F,null),U(this,rt,!1),U(this,ht,0),U(this,te,0),U(this,ee,0),U(this,Tt,()=>{gt(this,rt,this.offsetWidth>this.offsetHeight);const e=p(this,rt)?this.offsetWidth:this.offsetHeight;gt(this,ht,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),gt(this,ht,Math.max(p(this,ht),30)),p(this,rt)?(p(this,F).style.width=p(this,ht)+"px",p(this,F).style.height="100%"):(p(this,F).style.width="100%",p(this,F).style.height=p(this,ht)+"px"),gt(this,te,e-p(this,ht)),this.scrollElement.scrollSize||(this.style.display="none")}),U(this,ge,()=>{gt(this,ee,this.scrollElement.currentProgress*p(this,te)),p(this,rt)?p(this,F).style.transform=`translate3d(${p(this,ee)}px, 0px, 0px)`:p(this,F).style.transform=`translate3d(0px, ${p(this,ee)}px, 0px)`}),U(this,we,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)}),U(this,_e,e=>{document.documentElement.classList.add("grabbing"),Ms.setupDrag(n=>{const c=p(this,rt)?n.x:n.y,u=this.scrollElement.distance/p(this,te),Ps=(c-h)*u;this.scrollElement.setPosition(i+Ps)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.targetScrollValue,h=p(this,rt)?e.x:e.y}),Ne.isBrowser&&(this.openShadow(Ts),A.element(this,{slot:"static","drag-dead-zone":"",children:[A.slot({ref:e=>gt(this,jt,e),children:A.div({class:"default-thumb"})})]}))}get thumbElement(){return p(this,F)}connectedCallback(){super.connectedCallback();const e=p(this,jt).assignedElements()[0]||p(this,jt).firstElementChild;gt(this,F,e),p(this,F).addEventListener("pointerdown",p(this,_e)),Kt.windowResizer.subscribe(p(this,Tt),Ve.RESIZE_ORDER.SCROLL+1),os.elementResizer.subscribe(this,p(this,Tt)),this.scrollElement.onScroll(p(this,ge)),this.scrollElement.axisCSSProperty.subscribe(p(this,we))}disconnectedCallback(){p(this,F).removeEventListener("pointerdown",p(this,_e)),Kt.windowResizer.unsubscribe(p(this,Tt)),os.elementResizer.unsubscribe(p(this,Tt)),this.scrollElement.offScroll(p(this,ge)),this.scrollElement.axisCSSProperty.unsubscribe(p(this,we))}};jt=new WeakMap;F=new WeakMap;rt=new WeakMap;ht=new WeakMap;te=new WeakMap;ee=new WeakMap;Tt=new WeakMap;ge=new WeakMap;we=new WeakMap;_e=new WeakMap;exports.ScrollbarElement=Rs([vt.define("e-scrollbar")],exports.ScrollbarElement);const qs=Je.createStylesheet({button:{all:"inherit"}});class fs extends $e{constructor(){super(),this.openShadow(qs),Ne.isBrowser&&A.element(this,{children:[A.button({onClick:()=>{this.handleClick()},children:[A.slot()]})]})}}var Bs=Object.defineProperty,As=Object.getOwnPropertyDescriptor,Is=(r,e,i,h)=>{for(var n=h>1?void 0:h?As(e,i):e,c=r.length-1,u;c>=0;c--)(u=r[c])&&(n=(h?u(e,i,n):u(n))||n);return h&&n&&Bs(e,i,n),n};exports.ScrollSetButtonElement=class extends fs{handleClick(){const e=this.getAttribute("index"),i=this.getAttribute("behaviour");this.scrollElement.scrollToSection(parseInt(e||"0"),i)}};exports.ScrollSetButtonElement=Is([vt.define("e-scroll-set-button")],exports.ScrollSetButtonElement);var Hs=Object.defineProperty,Gs=Object.getOwnPropertyDescriptor,Us=(r,e,i,h)=>{for(var n=h>1?void 0:h?Gs(e,i):e,c=r.length-1,u;c>=0;c--)(u=r[c])&&(n=(h?u(e,i,n):u(n))||n);return h&&n&&Hs(e,i,n),n};exports.ScrollStepButtonElement=class extends fs{handleClick(){const e=this.getAttribute("step"),i=this.getAttribute("behaviour");this.scrollElement.shiftSections(parseInt(e||"1"),i)}};exports.ScrollStepButtonElement=Us([vt.define("e-scroll-step-button")],exports.ScrollStepButtonElement);var Zs=Object.defineProperty,Ks=Object.getOwnPropertyDescriptor,Ns=(r,e,i,h)=>{for(var n=h>1?void 0:h?Ks(e,i):e,c=r.length-1,u;c>=0;c--)(u=r[c])&&(n=(h?u(e,i,n):u(n))||n);return h&&n&&Zs(e,i,n),n},Ss=(r,e,i)=>{if(!e.has(r))throw TypeError("Cannot "+i)},Ot=(r,e,i)=>(Ss(r,e,"read from private field"),i?i.call(r):e.get(r)),as=(r,e,i)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,i)},ls=(r,e,i,h)=>(Ss(r,e,"write to private field"),h?h.call(r,i):e.set(r,i),i),Ct,se,j,dt,Ut,le,ce,Zt;class Js{constructor(e,i,h){O(this,j,void 0);O(this,dt,void 0);O(this,Ut,void 0);O(this,le,void 0);O(this,ce,()=>{o(this,dt).scrollToSection(o(this,Ut),o(this,le))});O(this,Zt,()=>{o(this,j).classList.toggle("current",o(this,dt).counter.current===o(this,Ut))});R(this,j,document.createElement("button")),R(this,dt,e),R(this,le,h),R(this,Ut,i),o(this,j).addEventListener("click",o(this,ce)),o(this,dt).counter.subscribe(o(this,Zt)),o(this,Zt).call(this)}get element(){return o(this,j)}destroy(){o(this,j).removeEventListener("click",o(this,ce)),o(this,dt).counter.unsubscribe(o(this,Zt)),o(this,j).remove()}}j=new WeakMap,dt=new WeakMap,Ut=new WeakMap,le=new WeakMap,ce=new WeakMap,Zt=new WeakMap;exports.ScrollBulletButtonsElement=class extends $e{constructor(){super(...arguments),as(this,Ct,[]),as(this,se,cs.debounce(()=>{Ot(this,Ct).forEach(e=>e.destroy()),ls(this,Ct,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Js(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),Ot(this,Ct).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",Ot(this,se)),Ot(this,se).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",Ot(this,se)),Ot(this,Ct).forEach(e=>e.destroy()),ls(this,Ct,[])}};Ct=new WeakMap;se=new WeakMap;exports.ScrollBulletButtonsElement=Ns([vt.define("e-scroll-bullet-buttons")],exports.ScrollBulletButtonsElement);var Qs=Object.defineProperty,Xs=Object.getOwnPropertyDescriptor,Ys=(r,e,i,h)=>{for(var n=h>1?void 0:h?Xs(e,i):e,c=r.length-1,u;c>=0;c--)(u=r[c])&&(n=(h?u(e,i,n):u(n))||n);return h&&n&&Qs(e,i,n),n},ts=(r,e,i)=>{if(!e.has(r))throw TypeError("Cannot "+i)},t=(r,e,i)=>(ts(r,e,"read from private field"),i?i.call(r):e.get(r)),a=(r,e,i)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,i)},m=(r,e,i,h)=>(ts(r,e,"write to private field"),h?h.call(r,i):e.set(r,i),i),P=(r,e,i)=>(ts(r,e,"access private method"),i),qt,yt,Pt,Et,kt,V,I,H,G,Mt,L,ut,pt,ot,at,lt,Bt,ie,x,K,Z,ft,St,Q,be,v,At,It,Ce,B,X,z,W,T,re,Lt,k,ye,Be,es,ds,Ae,ms,Ie,vs,He,gs,Ge,ws,Ue,_s,Ze,bs,Pe,he,nt,Wt,ss,Cs,is,ys,Ee,Ke,ke;exports.ScrollSegmentElement=class extends $e{constructor(){super(...arguments),a(this,ye),a(this,es),a(this,Ae),a(this,Ie),a(this,He),a(this,Ge),a(this,Ue),a(this,Ze),a(this,nt),a(this,ss),a(this,is),a(this,Ee),a(this,qt,new S.CSSProperty(this,"--target","")),a(this,yt,new S.CSSProperty(this,"--disabled",!1)),a(this,Pt,new S.CSSProperty(this,"--distance-offset",0)),a(this,Et,new S.CSSProperty(this,"--start-offset",0)),a(this,kt,new S.CSSProperty(this,"--capture-once",!1)),a(this,V,new S.CSSProperty(this,"--captured","")),a(this,I,new S.CSSProperty(this,"--released","")),a(this,H,new S.CSSProperty(this,"--captured-from-start","")),a(this,G,new S.CSSProperty(this,"--captured-from-finish","")),a(this,Mt,new S.CSSProperty(this,"--released-from-start","")),a(this,L,new S.CSSProperty(this,"--released-from-finish","")),a(this,ut,new S.CSSProperty(this,"--passed-var","")),a(this,pt,new S.CSSProperty(this,"--progress-var","")),a(this,ot,new S.CSSProperty(this,"--distance-var","")),a(this,at,new S.CSSProperty(this,"--start-var","")),a(this,lt,new S.CSSProperty(this,"--finish-var","")),a(this,Bt,new S.CSSProperty(this,"--smoothstep",!1)),a(this,ie,new S.CSSProperty(this,"--smootherstep",!1)),a(this,x,new wt.Store(!1)),a(this,K,new wt.Store(!1)),a(this,Z,new wt.Store(!1)),a(this,ft,new wt.Store(!1)),a(this,St,new wt.Store(!1)),a(this,Q,new wt.Store(!1)),a(this,be,[]),a(this,v,this),a(this,At,0),a(this,It,0),a(this,Ce,0),a(this,B,0),a(this,X,0),a(this,z,0),a(this,W,0),a(this,T,0),a(this,re,!1),a(this,Lt,!1),a(this,k,!0),a(this,Pe,()=>{t(this,k)||(this.resize(),t(this,he).call(this))}),a(this,he,()=>{!t(this,k)&&t(this,re)&&this.tick()}),a(this,ke,cs.debounce(()=>{const e=Vt.scrollEntries.getAll(this).reverse();let i=0;e.forEach((h,n)=>{h.element===this.scrollElement&&(i=n)}),m(this,be,e.slice(i+1))},0))}get distanceOffsetCSSProperty(){return t(this,Pt)}get startOffsetCSSProperty(){return t(this,Et)}get captureOnceCSSProperty(){return t(this,kt)}get capturedCSSProperty(){return t(this,V)}get releasedCSSProperty(){return t(this,I)}get capturedFromStartCSSProperty(){return t(this,H)}get capturedFromFinishCSSProperty(){return t(this,G)}get releasedFromStartCSSProperty(){return t(this,Mt)}get releasedFromFinishCSSProperty(){return t(this,L)}get passedVarCSSProperty(){return t(this,ut)}get progressVarCSSProperty(){return t(this,pt)}get distanceVarCSSProperty(){return t(this,ot)}get startVarCSSProperty(){return t(this,at)}get finishVarCSSProperty(){return t(this,lt)}get smoothstepCSSProperty(){return t(this,Bt)}get smootherstepCSSProperty(){return t(this,ie)}get disabledCSSProperty(){return t(this,yt)}get targetCSSProperty(){return t(this,qt)}get isCaptured(){return t(this,x)}get isReleased(){return t(this,K)}get isCapturedFromStart(){return t(this,Z)}get isReleasedFromStart(){return t(this,ft)}get isCapturedFromFinish(){return t(this,St)}get isReleasedFromFinish(){return t(this,Q)}get directionPosition(){return t(this,At)}get directionSize(){return t(this,It)}get passed(){return t(this,B)}get progress(){return t(this,X)}get start(){return t(this,z)}get finish(){return t(this,T)}get distance(){return t(this,W)}get isCapturedOnce(){return t(this,Lt)}get isDisabled(){return t(this,k)}resize(){m(this,It,this.scrollElement.vertical?this.offsetHeight:this.offsetWidth),m(this,At,this.scrollElement.vertical?mt.getCumulativeOffsetTop(this,this.scrollElement):mt.getCumulativeOffsetLeft(this,this.scrollElement)),m(this,z,this.getStart()),m(this,W,this.getDistance()),m(this,z,t(this,z)+t(this,Et).current),m(this,W,t(this,W)+t(this,Pt).current),m(this,T,t(this,z)+t(this,W)),this.scrollElement.currentScrollValue>t(this,T)&&!t(this,x).current&&!t(this,K).current&&(t(this,x).current=!0),this.setVar(t(this,at).current,t(this,z)),this.setVar(t(this,lt).current,t(this,T)),this.setVar(t(this,ot).current,t(this,W)),m(this,re,!0)}tick(){let e=this.scrollElement.currentScrollValue;t(this,be).forEach(h=>{e+=h.value}),m(this,B,this.updateValue(e-t(this,z),0,t(this,W))||0),m(this,X,t(this,B)/t(this,W)||0);const i=Math.round(e);t(this,x).current&&(i>t(this,z)?t(this,Z).current||P(this,He,gs).call(this):t(this,Z).current&&!t(this,ft).current&&P(this,Ue,_s).call(this),i<t(this,T)?t(this,Q).current&&!t(this,St).current&&P(this,Ge,ws).call(this):t(this,Z).current&&!t(this,Q).current&&P(this,Ze,bs).call(this)),i>t(this,z)&&i<t(this,T)?(P(this,ye,Be).call(this),t(this,x).current||P(this,Ae,ms).call(this)):t(this,x).current&&(m(this,B,Ht.step(t(this,W)/2,t(this,B),0,t(this,W))),m(this,X,t(this,B)/t(this,W)),P(this,ye,Be).call(this),P(this,Ie,vs).call(this)),t(this,Lt)&&t(this,kt).current&&(t(this,V).current&&t(this,v).classList.add(t(this,V).current),m(this,k,!0))}disable(){this.style.cssText="",m(this,At,0),m(this,It,0),m(this,B,0),m(this,X,0),m(this,z,0),m(this,W,0),m(this,T,0),m(this,re,!1),t(this,x).current=!1,t(this,K).current=!1,t(this,Z).current=!1,t(this,ft).current=!1,t(this,St).current=!1,t(this,Q).current=!1,m(this,Lt,!1),m(this,k,!0),P(this,Ee,Ke).call(this)}enable(){m(this,k,!1)}connectedCallback(){super.connectedCallback(),t(this,qt).observe(),t(this,yt).observe(),t(this,Pt).observe(),t(this,Et).observe(),t(this,kt).observe(),t(this,V).observe(),t(this,I).observe(),t(this,H).observe(),t(this,G).observe(),t(this,Mt).observe(),t(this,L).observe(),t(this,ut).observe(),t(this,pt).observe(),t(this,ot).observe(),t(this,at).observe(),t(this,lt).observe(),t(this,Bt).observe(),t(this,ie).observe();let e=!1;this.scrollElement.addEventListener("sectionsChange",t(this,ke)),t(this,ke).call(this),t(this,yt).current||this.enable(),t(this,qt).subscribe(i=>{i.previous&&P(this,Ee,Ke).call(this),i.current?i.current==="parent"?m(this,v,this.parentElement||this):m(this,v,document.querySelector(i.current)||this):m(this,v,this)}),t(this,yt).subscribe(i=>{i.current&&!i.previous?this.disable():!i.current&&i.previous&&(this.resize(),this.enable())}),t(this,Et).subscribe(()=>{e&&!t(this,k)&&this.resize()}),t(this,Pt).subscribe(()=>{e&&!t(this,k)&&this.resize()}),t(this,V).subscribe(i=>{P(this,nt,Wt).call(this,i)}),t(this,H).subscribe(i=>{P(this,nt,Wt).call(this,i)}),t(this,G).subscribe(i=>{P(this,nt,Wt).call(this,i)}),t(this,I).subscribe(i=>{P(this,nt,Wt).call(this,i)}),t(this,Mt).subscribe(i=>{P(this,nt,Wt).call(this,i)}),t(this,L).subscribe(i=>{P(this,nt,Wt).call(this,i)}),t(this,kt).subscribe(i=>{t(this,k)||!i.current&&i.previous&&(this.resize(),this.enable())}),t(this,ut).subscribe(i=>{t(this,k)||(this.removeVar(i.previous),this.setVar(i.current,this.passed))}),t(this,pt).subscribe(i=>{t(this,k)||(this.removeVar(i.previous),this.setVar(i.current,t(this,X)))}),t(this,at).subscribe(i=>{t(this,k)||(this.removeVar(i.previous),this.setVar(i.current,t(this,z)))}),t(this,lt).subscribe(i=>{t(this,k)||(this.removeVar(i.previous),this.setVar(i.current,t(this,T)))}),t(this,ot).subscribe(i=>{t(this,k)||(this.removeVar(i.previous),this.setVar(i.current,t(this,W)))}),Kt.windowResizer.subscribe(t(this,Pe),Ve.RESIZE_ORDER.SEGMENT),this.scrollElement.onScroll(t(this,he)),e=!0}disconnectedCallback(){Kt.windowResizer.unsubscribe(t(this,Pe)),this.scrollElement.offScroll(t(this,he)),t(this,qt).close(),t(this,yt).close(),t(this,Pt).close(),t(this,Et).close(),t(this,kt).close(),t(this,V).close(),t(this,I).close(),t(this,H).close(),t(this,G).close(),t(this,Mt).close(),t(this,L).close(),t(this,ut).close(),t(this,pt).close(),t(this,ot).close(),t(this,at).close(),t(this,lt).close(),t(this,Bt).close(),t(this,ie).close(),t(this,x).close(),t(this,K).close(),t(this,Z).close(),t(this,ft).close(),t(this,St).close(),t(this,Q).close(),this.disable()}removeVar(e){e&&t(this,v).style.removeProperty(`--${e}`)}setVar(e,i){e&&t(this,v).style.setProperty(`--${e}`,i.toString())}updateValue(e,i=0,h=1){return this.smootherstepCSSProperty.current?Ht.smootherstep(e,i,h)*h:t(this,Bt).current?Ht.smoothstep(e,i,h)*h:Ht.clamp(e,i,h)}getDistance(){return t(this,It)+t(this,Ce)}getStart(){return t(this,At)-t(this,Ce)}};qt=new WeakMap;yt=new WeakMap;Pt=new WeakMap;Et=new WeakMap;kt=new WeakMap;V=new WeakMap;I=new WeakMap;H=new WeakMap;G=new WeakMap;Mt=new WeakMap;L=new WeakMap;ut=new WeakMap;pt=new WeakMap;ot=new WeakMap;at=new WeakMap;lt=new WeakMap;Bt=new WeakMap;ie=new WeakMap;x=new WeakMap;K=new WeakMap;Z=new WeakMap;ft=new WeakMap;St=new WeakMap;Q=new WeakMap;be=new WeakMap;v=new WeakMap;At=new WeakMap;It=new WeakMap;Ce=new WeakMap;B=new WeakMap;X=new WeakMap;z=new WeakMap;W=new WeakMap;T=new WeakMap;re=new WeakMap;Lt=new WeakMap;k=new WeakMap;ye=new WeakSet;Be=function(){P(this,es,ds).call(this),this.setVar(t(this,ut).current,t(this,B)),this.setVar(t(this,pt).current,t(this,X))};es=new WeakSet;ds=function(){this.dispatchEvent(new CustomEvent("segmentPass",{detail:{distance:t(this,W),start:t(this,z),finish:t(this,T),passed:t(this,B),progress:t(this,X)}}))};Ae=new WeakSet;ms=function(){t(this,x).current=!0,t(this,K).current=!1,m(this,Lt,!0),t(this,I).current&&t(this,v).classList.remove(t(this,I).current),t(this,L).current&&t(this,v).classList.remove(t(this,L).current),t(this,L).current&&t(this,v).classList.remove(t(this,L).current),t(this,V).current&&t(this,v).classList.add(t(this,V).current)};Ie=new WeakSet;vs=function(){t(this,K).current=!0,t(this,x).current=!1,m(this,Lt,!0),t(this,V).current&&t(this,v).classList.remove(t(this,V).current),t(this,H).current&&t(this,v).classList.remove(t(this,H).current),t(this,G).current&&t(this,v).classList.remove(t(this,G).current),t(this,I).current&&t(this,v).classList.add(t(this,I).current)};He=new WeakSet;gs=function(){t(this,x).current=!0,t(this,Z).current=!0,t(this,ft).current=!1,t(this,H).current&&t(this,v).classList.add(t(this,H).current)};Ge=new WeakSet;ws=function(){t(this,x).current=!0,t(this,St).current=!0,t(this,Q).current=!1,t(this,G).current&&t(this,v).classList.add(t(this,G).current)};Ue=new WeakSet;_s=function(){t(this,K).current=!0,t(this,ft).current=!0,t(this,Z).current=!1,t(this,L).current&&t(this,v).classList.add(t(this,L).current)};Ze=new WeakSet;bs=function(){t(this,K).current=!0,t(this,Q).current=!0,t(this,St).current=!1,t(this,L).current&&t(this,v).classList.add(t(this,L).current)};Pe=new WeakMap;he=new WeakMap;nt=new WeakSet;Wt=function(r){if(t(this,k)){r.previous&&t(this,v).classList.remove(r.previous),r.current&&t(this,v).classList.remove(r.current);return}r.current&&t(this,x).current?(r.previous&&t(this,v).classList.remove(r.previous),t(this,v).classList.add(r.current)):!r.current&&r.previous&&t(this,v).classList.remove(r.previous)};ss=new WeakSet;Cs=function(...r){r.forEach(e=>{e&&t(this,v).classList.remove(e)})};is=new WeakSet;ys=function(...r){r.forEach(e=>{e&&t(this,v).style.removeProperty(`--${e}`)})};Ee=new WeakSet;Ke=function(){P(this,ss,Cs).call(this,t(this,V).current,t(this,H).current,t(this,G).current,t(this,I).current,t(this,Mt).current,t(this,L).current),P(this,is,ys).call(this,t(this,ut).current,t(this,pt).current,t(this,ot).current,t(this,at).current,t(this,lt).current)};ke=new WeakMap;exports.ScrollSegmentElement=Ys([vt.define("e-scroll-segment")],exports.ScrollSegmentElement);
|
|
1
|
+
"use strict";var os=(r,t,i)=>{if(!t.has(r))throw TypeError("Cannot "+i)};var o=(r,t,i)=>(os(r,t,"read from private field"),i?i.call(r):t.get(r)),z=(r,t,i)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,i)},$=(r,t,i,n)=>(os(r,t,"write to private field"),n?n.call(r,i):t.set(r,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xs=require("../Damped-B0G_t-pw.cjs"),Ye=require("../browser-CpzFX2xg.cjs"),vt=require("../layout-8ryRAMGJ.cjs"),Nt=require("../math-GDWEqu7y.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const _t=require("../Store-BQGNOHlY.cjs"),Ls=require("../Derived-BZtlW0bB.cjs");require("../ticker/index.cjs");const Te=require("../DragControls-CV1YozSr.cjs"),gt=require("../custom-element/index.cjs"),Fe=require("../order/index.cjs"),Qt=require("../window-resizer/index.cjs"),$t=require("../scroll-entries/index.cjs"),A=require("../tags-CueX-JLX.cjs"),je=require("../createStylesheet-C8aQQ4hd.cjs"),ls=require("../css-unit-parser/index.cjs"),d=require("../css-property/index.cjs"),Vs=require("../Viewport-_WllZTJ0.cjs"),zs=require("../gestures-DHLrn6Q8.cjs"),as=require("../theme/index.cjs"),cs=require("../element-resizer/index.cjs"),Os=require("../dom-JBOkFLTh.cjs"),fs=require("../function-MthRj-GJ.cjs");var $s=Object.defineProperty,Fs=Object.getOwnPropertyDescriptor,Ds=(r,t,i,n)=>{for(var h=n>1?void 0:n?Fs(t,i):t,c=r.length-1,p;c>=0;c--)(p=r[c])&&(h=(n?p(t,i,h):p(h))||h);return n&&h&&$s(t,i,h),h},ts=(r,t,i)=>{if(!t.has(r))throw TypeError("Cannot "+i)},e=(r,t,i)=>(ts(r,t,"read from private field"),i?i.call(r):t.get(r)),a=(r,t,i)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,i)},_=(r,t,i,n)=>(ts(r,t,"write to private field"),n?n.call(r,i):t.set(r,i),i),b=(r,t,i)=>(ts(r,t,"access private method"),i),S,F,st,J,it,jt,bt,U,R,Dt,de,me,Rt,Tt,qt,g,Ve,u,ve,ge,M,C,q,Q,Lt,ct,P,te,Ct,Xt,Yt,Ut,ae,Vt,Zt,ze,es,Oe,ss,we,qe,_e,Be,et,De,Ae,Ss,ee,be,Ie,ce,$e,He,ds,w,E,Ot,j,dt;class Rs{constructor(t,i){z(this,w,void 0);z(this,E,void 0);z(this,Ot,0);z(this,j,0);z(this,dt,null);$(this,w,t),$(this,E,i),$t.scrollEntries.register(o(this,w))}get size(){return o(this,Ot)}get position(){return o(this,j)}destroy(){$t.scrollEntries.unregister(o(this,w)),o(this,w).style.transform="",this.mark(null)}setSize(t){t?(o(this,w).style.setProperty("--size",t+"px"),o(this,E).axisCSSProperty.current==="x"?(o(this,w).style.width=t+"px",o(this,w).style.height=""):(o(this,w).style.height=t+"px",o(this,w).style.width="")):(o(this,w).style.width="",o(this,w).style.height="",o(this,w).style.removeProperty("--size"))}resize(){$(this,Ot,o(this,E).vertical?o(this,w).offsetHeight:o(this,w).offsetWidth),$(this,j,o(this,E).vertical?vt.getCumulativeOffsetTop(o(this,w)):vt.getCumulativeOffsetLeft(o(this,w))),$(this,j,o(this,j)-o(this,E).contentPosition)}transform(){let t=0;const i=o(this,E).viewportSize;o(this,E).infiniteCSSProperty.current&&o(this,E).overscroll&&o(this,j)+o(this,Ot)<o(this,E).currentScrollValue&&(t=o(this,E).distance*-1-o(this,E).gap),$t.scrollEntries.update(o(this,w),o(this,E).axisCSSProperty.current,t);const n=o(this,E).currentScrollValue+t,h=o(this,j)-o(this,E).viewportSize-i,c=o(this,j)+o(this,Ot)+i,p=Nt.clamp(n,h,c);o(this,E).vertical?o(this,w).style.transform=`translate3d(0px, ${p*-1}px, 0px)`:o(this,w).style.transform=`translate3d(${p*-1}px, 0px, 0px)`}mark(t){o(this,dt)!==t&&(o(this,dt)&&o(this,w).classList.remove(o(this,dt)),t&&o(this,w).classList.add(t),$(this,dt,t),o(this,w).dispatchEvent(new CustomEvent("sectionsChange",{composed:!0,detail:{mark:o(this,dt)}})))}}w=new WeakMap,E=new WeakMap,Ot=new WeakMap,j=new WeakMap,dt=new WeakMap;const Ts=je.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":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)"},':host([hibernated="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});exports.ScrollElement=class extends gt.CustomElement{constructor(){super(),a(this,Ut),a(this,Vt),a(this,ze),a(this,Oe),a(this,we),a(this,_e),a(this,Ae),a(this,be),a(this,ce),a(this,He),a(this,S,null),a(this,F,new d.CSSProperty(this,"--axis","y")),a(this,st,new d.CSSProperty(this,"--pages",0,{validate:t=>Math.max(0,t-1)})),a(this,J,new d.CSSProperty(this,"--split",!1)),a(this,it,new d.CSSProperty(this,"--sectional",!1)),a(this,jt,new d.CSSProperty(this,"--auto-size",!1)),a(this,bt,new d.CSSProperty(this,"--wheel-max-delta",!1)),a(this,U,new d.CSSProperty(this,"--sections-in-view",1)),a(this,R,new d.CSSProperty(this,"--infinite",!1)),a(this,Dt,new d.CSSProperty(this,"--damping",20)),a(this,de,new d.CSSProperty(this,"--mass",0)),a(this,me,new d.CSSProperty(this,"--stiffness",0)),a(this,Rt,new d.CSSProperty(this,"--mouse-drag",!1)),a(this,Tt,new d.CSSProperty(this,"--disabled",!1)),a(this,qt,new d.CSSProperty(this,"--hibernated",!1)),a(this,g,null),a(this,Ve,null),a(this,u,[]),a(this,ve,0),a(this,ge,0),a(this,M,0),a(this,C,0),a(this,q,0),a(this,Q,null),a(this,Lt,null),a(this,ct,null),a(this,P,new _t.Store(0)),a(this,te,0),a(this,Ct,0),a(this,Xt,!0),a(this,Yt,!0),a(this,et,()=>{e(this,S).unlistenAnimationFrame();const t=this.currentScrollValue/e(this,C)||0,i=e(this,P).current;if(_(this,ve,this.vertical?vt.getCumulativeOffsetTop(this):vt.getCumulativeOffsetLeft(this)),_(this,ge,this.vertical?vt.getCumulativeOffsetTop(e(this,g)):vt.getCumulativeOffsetLeft(e(this,g))),_(this,M,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?_(this,q,ls.cssUnitParser.parse(getComputedStyle(e(this,g)).rowGap)):_(this,q,ls.cssUnitParser.parse(getComputedStyle(e(this,g)).columnGap)),e(this,jt).current&&e(this,u).length){const n=e(this,U).current,h=(e(this,M)-e(this,q)*(n-1))/n;e(this,u).forEach(c=>{c.setSize(h)})}else e(this,u).forEach(n=>{n.setSize()});if(e(this,u).forEach(n=>{n.resize()}),e(this,st).current){_(this,C,e(this,M)*e(this,st).current);const n=e(this,C)+e(this,M);this.vertical?(e(this,g).style.width=n+"px",e(this,g).style.height="100%"):(e(this,g).style.height=n+"px",e(this,g).style.width="100%")}else this.vertical?(e(this,g).style.width="100%",e(this,g).style.height="max-content",_(this,C,e(this,g).offsetHeight-e(this,M))):(e(this,g).style.width="max-content",e(this,g).style.height="100%",_(this,C,e(this,g).offsetWidth-e(this,M)));if(!e(this,R).current){const n=getComputedStyle(this),h=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);_(this,C,e(this,C)+h),e(this,S).max=e(this,C)}if(e(this,R).current&&e(this,u).length){const n=e(this,u)[e(this,u).length-1],h=n.position+n.size-e(this,M),c=e(this,C)-h;_(this,Ct,n.position+n.size+c)}else _(this,Ct,e(this,C));if(e(this,it).current&&e(this,u).length){const n=e(this,u)[i];e(this,S).set(n.position,!0)}else e(this,S).set(t*e(this,C),!0)}),a(this,De,()=>{const t=this.currentScrollValue;if(_(this,te,Math.max(0,t-e(this,C))),e(this,u).length){let i=0;for(let n=0;n<e(this,u).length;n++){const h=e(this,u)[n];h.transform(),this.targetScrollValue+h.size/2>=h.position&&(i=n)}e(this,P).current=i}else this.vertical?e(this,g).style.transform=`translate3d(0px, ${t*-1}px, 0px)`:e(this,g).style.transform=`translate3d(${t*-1}px, 0px, 0px)`;$t.scrollEntries.update(this,e(this,F).current,t)}),a(this,ee,(t,i)=>{if(!(t==="drag"&&!Vs.device.isMobile&&!e(this,Rt).current))if(e(this,it).current){const n=Math.sign(i);e(this,u).length?this.shiftSections(n):e(this,S).shift(n*e(this,M))}else e(this,S).shift(i)}),Ye.isBrowser&&(_(this,S,new xs.Damped(0,{damping:.01,min:0,order:Fe.TICK_ORDER.SCROLL})),this.openShadow(Ts),A.element(this,{tabIndex:0,children:[A.div({class:"static",children:[A.slot({name:"static"})]}),A.div({class:"content",children:[A.slot({ref:t=>_(this,Ve,t)})],style:{flexDirection:new Ls.Derived(e(this,F),t=>t==="x"?"row":"column")},ref:t=>_(this,g,t)})]}),_(this,Q,new Te.WheelControls({element:e(this,g)})),e(this,Q).changeEvent.subscribe(e(this,ee)),_(this,Lt,new Te.KeyboardControls({element:e(this,g)})),e(this,Lt).changeEvent.subscribe(e(this,ee)),_(this,ct,new Te.DragControls({element:e(this,g)})),e(this,ct).changeEvent.subscribe(e(this,ee)),e(this,F).subscribe(({current:t})=>{e(this,g).style.flexDirection=t==="x"?"row":"column",e(this,Q).axis=e(this,bt).current?"max":t,e(this,Lt).dimension=t==="x"?"width":"height",e(this,ct).axis=t,t==="x"?this.style.touchAction="pan-y":t==="y"&&(this.style.touchAction="pan-x"),this.isConnected&&e(this,et).call(this)}),e(this,bt).subscribe(t=>{e(this,Q).axis=t.current?"max":e(this,F).current}),e(this,st).subscribe(()=>{this.isConnected&&e(this,et).call(this)}),e(this,J).subscribe(({current:t})=>{this.isConnected&&(t?b(this,Ut,ae).call(this):b(this,Vt,Zt).call(this))}),e(this,it).subscribe(t=>{e(this,Q).debounce=t.current,e(this,ct).swipe=t.current,this.isConnected&&(t.current&&!t.previous&&!e(this,u).length?b(this,Ut,ae).call(this):!t.current&&t.previous&&e(this,u).length&&b(this,Vt,Zt).call(this))}),e(this,jt).subscribe(t=>{this.isConnected&&(e(this,et).call(this),t.current&&!t.previous&&!e(this,u).length?b(this,Ut,ae).call(this):!t.current&&t.previous&&e(this,u).length&&b(this,Vt,Zt).call(this))}),e(this,U).subscribe(t=>{this.isConnected&&(e(this,et).call(this),b(this,ce,$e).call(this))}),e(this,R).subscribe(t=>{t.current?(this.isConnected&&(e(this,u).length||(e(this,J).current=!0)),e(this,u).length&&(e(this,S).max=1/0,e(this,S).min=-1/0)):(_(this,te,0),e(this,S).max=e(this,C),e(this,S).min=0)}),e(this,Dt).subscribe(t=>{e(this,S).damping=t.current}),e(this,de).subscribe(t=>{e(this,S).mass=t.current}),e(this,me).subscribe(t=>{e(this,S).stiffness=t.current}),e(this,Tt).subscribe(t=>{t.current&&!t.previous?b(this,ze,es).call(this):!t.current&&t.previous&&b(this,Oe,ss).call(this)}),e(this,qt).subscribe(t=>{t.current&&!t.previous?b(this,we,qe).call(this):!t.current&&t.previous&&b(this,_e,Be).call(this)}),e(this,S).isRunning.subscribe(t=>{this.classList.toggle("active",t.current)}),e(this,P).subscribe(t=>{e(this,u).length&&b(this,ce,$e).call(this)}))}get axisCSSProperty(){return e(this,F)}get pagesCSSProperty(){return e(this,st)}get splitCSSProperty(){return e(this,J)}get sectionalCSSProperty(){return e(this,it)}get autoSizeCSSProperty(){return e(this,jt)}get wheelMaxDeltaCSSProperty(){return e(this,bt)}get sectionsInViewCSSProperty(){return e(this,U)}get infiniteCSSProperty(){return e(this,R)}get dampingCSSProperty(){return e(this,Dt)}get massCSSProperty(){return e(this,de)}get stiffnessCSSProperty(){return e(this,me)}get mouseDragCSSProperty(){return e(this,Rt)}get disabledCSSProperty(){return e(this,Tt)}get hibernatedCSSProperty(){return e(this,qt)}get currentScrollValue(){return b(this,be,Ie).call(this,"current")}get targetScrollValue(){return b(this,be,Ie).call(this,"target")}get contentElement(){return e(this,g)}get sections(){return e(this,u)}get position(){return e(this,ve)}get contentPosition(){return e(this,ge)}get viewportSize(){return e(this,M)}get scrollSize(){return e(this,C)}get gap(){return e(this,q)}get counter(){return e(this,P)}get limit(){return e(this,u).length-e(this,U).current}get distance(){return e(this,Ct)}get infiniteDistance(){return e(this,R).current?e(this,Ct)+e(this,q):e(this,Ct)}get overscroll(){return e(this,te)}get vertical(){return e(this,F).current==="y"}get currentProgress(){return this.currentScrollValue/this.infiniteDistance||0}get targetProgress(){return this.targetScrollValue/this.infiniteDistance||0}get speed(){return e(this,S).speed}get direction(){return e(this,S).direction}get isRunning(){return e(this,S).isRunning}get scrollWidth(){return e(this,F).current==="y"?0:e(this,S).length}get scrollHeight(){return e(this,F).current==="x"?0:e(this,S).length}onScroll(...t){return e(this,S).subscribe(...t)}offScroll(...t){e(this,S).unsubscribe(...t)}range(t,i,n=0){const h=t-n,c=h+i+n*2;return this.currentProgress<h?0:this.currentProgress>c?1:(this.currentProgress-h)/(c-h)}curve(t,i,n=0){return Math.sin(this.range(t,i,n)*Math.PI)}visible(t,i,n=0){const h=t-n,c=h+i+n*2;return this.currentProgress>=h&&this.currentProgress<=c}scrollToSection(t,i="smooth"){if(!e(this,u).length)return;const n=e(this,P).current;b(this,Ae,Ss).call(this,t);const h=e(this,u)[n],c=e(this,u)[e(this,P).current];if(h&&c){let p=0;const Se=b(this,He,ds).call(this),Ms=Se?this.targetScrollValue-Se.position:0;e(this,R).current?e(this,P).current===0&&n===e(this,u).length-1?p=e(this,C)+e(this,M)-h.position+e(this,q):e(this,P).current===e(this,u).length-1&&n===0?p=c.position-(e(this,C)+e(this,M)+e(this,q)):p=c.position-h.position:p=c.position-h.position,e(this,S).shift(p-Ms,i==="instant")}}shiftSections(t,i="smooth"){e(this,u).length&&this.scrollToSection(e(this,P).current+t,i)}setPosition(t,i="smooth"){e(this,S).set(t,i==="instant")}connectedCallback(){e(this,F).observe(),e(this,st).observe(),e(this,J).observe(),e(this,it).observe(),e(this,bt).observe(),e(this,U).observe(),e(this,R).observe(),e(this,Dt).observe(),e(this,Rt).observe(),e(this,Tt).observe(),e(this,qt).observe(),b(this,_e,Be).call(this)}disconnectedCallback(){e(this,F).unobserve(),e(this,st).unobserve(),e(this,J).unobserve(),e(this,it).unobserve(),e(this,bt).unobserve(),e(this,U).unobserve(),e(this,R).unobserve(),e(this,Dt).unobserve(),e(this,Rt).unobserve(),e(this,Tt).unobserve(),e(this,qt).unobserve(),b(this,we,qe).call(this)}};S=new WeakMap;F=new WeakMap;st=new WeakMap;J=new WeakMap;it=new WeakMap;jt=new WeakMap;bt=new WeakMap;U=new WeakMap;R=new WeakMap;Dt=new WeakMap;de=new WeakMap;me=new WeakMap;Rt=new WeakMap;Tt=new WeakMap;qt=new WeakMap;g=new WeakMap;Ve=new WeakMap;u=new WeakMap;ve=new WeakMap;ge=new WeakMap;M=new WeakMap;C=new WeakMap;q=new WeakMap;Q=new WeakMap;Lt=new WeakMap;ct=new WeakMap;P=new WeakMap;te=new WeakMap;Ct=new WeakMap;Xt=new WeakMap;Yt=new WeakMap;Ut=new WeakSet;ae=function(){b(this,Vt,Zt).call(this),e(this,Ve).assignedElements().forEach(r=>{r instanceof HTMLElement&&e(this,u).push(new Rs(r,this))}),e(this,g).style.transform="",this.dispatchEvent(new CustomEvent("sectionsChange",{composed:!0})),e(this,et).call(this),b(this,ce,$e).call(this)};Vt=new WeakSet;Zt=function(){e(this,u).forEach(r=>{r.destroy()}),_(this,u,[]),e(this,P).current=0,e(this,S).reset(),this.dispatchEvent(new CustomEvent("sectionsChange",{composed:!0}))};ze=new WeakSet;es=function(){e(this,Xt)||(_(this,Xt,!0),e(this,S).unsubscribe(e(this,De)),e(this,S).unlistenAnimationFrame(),e(this,Q).disconnect(),e(this,Lt).disconnect(),e(this,ct).disconnect())};Oe=new WeakSet;ss=function(){e(this,Xt)&&(_(this,Xt,!1),e(this,S).subscribe(e(this,De)),e(this,Q).connect(),e(this,Lt).connect(),e(this,ct).connect())};we=new WeakSet;qe=function(){e(this,Yt)||(_(this,Yt,!0),Qt.windowResizer.unsubscribe(e(this,et)),e(this,S).reset(),b(this,ze,es).call(this),e(this,g).style.transform="",e(this,J).current&&b(this,Vt,Zt).call(this),$t.scrollEntries.unregister(this))};_e=new WeakSet;Be=function(){e(this,Yt)&&(_(this,Yt,!1),e(this,J).current&&b(this,Ut,ae).call(this),$t.scrollEntries.register(this),Qt.windowResizer.subscribe(e(this,et),Fe.RESIZE_ORDER.SCROLL),b(this,Oe,ss).call(this))};et=new WeakMap;De=new WeakMap;Ae=new WeakSet;Ss=function(r){e(this,R).current?(e(this,P).current=r%e(this,u).length,e(this,P).current=e(this,P).current<0?e(this,u).length+e(this,P).current:e(this,P).current):e(this,P).current=Nt.clamp(r,0,this.limit)};ee=new WeakMap;be=new WeakSet;Ie=function(r="current"){if(e(this,R).current&&e(this,u).length){const t=e(this,S)[r]%(e(this,C)+e(this,M)+e(this,q));return t<0?e(this,C)+t+e(this,M)+e(this,q):t}else return e(this,S)[r]};ce=new WeakSet;$e=function(){if(e(this,u).length){const r=e(this,P).current;r===0?this.classList.add("start"):this.classList.remove("start"),r===this.limit?this.classList.add("end"):this.classList.remove("end"),e(this,u).forEach((t,i)=>{const n=r-this.limit-1,h=r+e(this,U).current,c=this.sections.length-h;i>=r&&i<h||i<=n?t.mark("current"):i>=h&&i<h+c/2||i<=n+e(this,U).current?t.mark("next"):t.mark("previous")})}};He=new WeakSet;ds=function(){let r=null,t=1/0;for(let i=0;i<e(this,u).length;i++){const n=Math.abs(e(this,u)[i].position-this.targetScrollValue);n<t&&(t=n,r=i)}return r!==null?e(this,u)[r]:null};exports.ScrollElement=Ds([gt.define("e-scroll")],exports.ScrollElement);var ue;class Re extends gt.CustomElement{constructor(){super(...arguments);z(this,ue,null)}get scrollElement(){return o(this,ue)}connectedCallback(){const i=Os.findParentElement(this,exports.ScrollElement);i instanceof exports.ScrollElement?$(this,ue,i):console.error(this,"e-scroll not found")}}ue=new WeakMap;var qs=Object.defineProperty,Bs=Object.getOwnPropertyDescriptor,As=(r,t,i,n)=>{for(var h=n>1?void 0:n?Bs(t,i):t,c=r.length-1,p;c>=0;c--)(p=r[c])&&(h=(n?p(t,i,h):p(h))||h);return n&&h&&qs(t,i,h),h},ms=(r,t,i)=>{if(!t.has(r))throw TypeError("Cannot "+i)},f=(r,t,i)=>(ms(r,t,"read from private field"),i?i.call(r):t.get(r)),N=(r,t,i)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,i)},wt=(r,t,i,n)=>(ms(r,t,"write to private field"),n?n.call(r,i):t.set(r,i),i),se,D,rt,nt,ie,re,Bt,Ce,ye,Pe;const Is=je.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:as.aptechkaTheme.colorLight.var},':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:as.aptechkaTheme.colorDark.var,borderRadius:"1vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}});exports.ScrollbarElement=class extends Re{constructor(){super(),N(this,se,null),N(this,D,null),N(this,rt,!1),N(this,nt,0),N(this,ie,0),N(this,re,0),N(this,Bt,()=>{wt(this,rt,this.offsetWidth>this.offsetHeight);const t=f(this,rt)?this.offsetWidth:this.offsetHeight;wt(this,nt,t/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/t)),wt(this,nt,Math.max(f(this,nt),30)),f(this,rt)?(f(this,D).style.width=f(this,nt)+"px",f(this,D).style.height="100%"):(f(this,D).style.width="100%",f(this,D).style.height=f(this,nt)+"px"),wt(this,ie,t-f(this,nt)),this.scrollElement.scrollSize||(this.style.display="none")}),N(this,Ce,()=>{wt(this,re,this.scrollElement.currentProgress*f(this,ie)),f(this,rt)?f(this,D).style.transform=`translate3d(${f(this,re)}px, 0px, 0px)`:f(this,D).style.transform=`translate3d(0px, ${f(this,re)}px, 0px)`}),N(this,ye,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)}),N(this,Pe,t=>{document.documentElement.classList.add("grabbing"),zs.setupDrag(h=>{const c=f(this,rt)?h.x:h.y,p=this.scrollElement.distance/f(this,ie),Se=(c-n)*p;this.scrollElement.setPosition(i+Se)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.targetScrollValue,n=f(this,rt)?t.x:t.y}),Ye.isBrowser&&(this.openShadow(Is),A.element(this,{slot:"static","drag-dead-zone":"",children:[A.slot({ref:t=>wt(this,se,t),children:A.div({class:"default-thumb"})})]}))}get thumbElement(){return f(this,D)}connectedCallback(){super.connectedCallback();const t=f(this,se).assignedElements()[0]||f(this,se).firstElementChild;wt(this,D,t),f(this,D).addEventListener("pointerdown",f(this,Pe)),Qt.windowResizer.subscribe(f(this,Bt),Fe.RESIZE_ORDER.SCROLL+1),cs.elementResizer.subscribe(this,f(this,Bt)),this.scrollElement.onScroll(f(this,Ce)),this.scrollElement.axisCSSProperty.subscribe(f(this,ye))}disconnectedCallback(){f(this,D).removeEventListener("pointerdown",f(this,Pe)),Qt.windowResizer.unsubscribe(f(this,Bt)),cs.elementResizer.unsubscribe(f(this,Bt)),this.scrollElement.offScroll(f(this,Ce)),this.scrollElement.axisCSSProperty.unsubscribe(f(this,ye))}};se=new WeakMap;D=new WeakMap;rt=new WeakMap;nt=new WeakMap;ie=new WeakMap;re=new WeakMap;Bt=new WeakMap;Ce=new WeakMap;ye=new WeakMap;Pe=new WeakMap;exports.ScrollbarElement=As([gt.define("e-scrollbar")],exports.ScrollbarElement);const Hs=je.createStylesheet({button:{all:"inherit"}});class vs extends Re{constructor(){super(),this.openShadow(Hs),Ye.isBrowser&&A.element(this,{children:[A.button({onClick:()=>{this.handleClick()},children:[A.slot()]})]})}}var Gs=Object.defineProperty,Ns=Object.getOwnPropertyDescriptor,Us=(r,t,i,n)=>{for(var h=n>1?void 0:n?Ns(t,i):t,c=r.length-1,p;c>=0;c--)(p=r[c])&&(h=(n?p(t,i,h):p(h))||h);return n&&h&&Gs(t,i,h),h};exports.ScrollSetButtonElement=class extends vs{handleClick(){const t=this.getAttribute("index"),i=this.getAttribute("behaviour");this.scrollElement.scrollToSection(parseInt(t||"0"),i)}};exports.ScrollSetButtonElement=Us([gt.define("e-scroll-set-button")],exports.ScrollSetButtonElement);var Zs=Object.defineProperty,Ks=Object.getOwnPropertyDescriptor,Js=(r,t,i,n)=>{for(var h=n>1?void 0:n?Ks(t,i):t,c=r.length-1,p;c>=0;c--)(p=r[c])&&(h=(n?p(t,i,h):p(h))||h);return n&&h&&Zs(t,i,h),h};exports.ScrollStepButtonElement=class extends vs{handleClick(){const t=this.getAttribute("step"),i=this.getAttribute("behaviour");this.scrollElement.shiftSections(parseInt(t||"1"),i)}};exports.ScrollStepButtonElement=Js([gt.define("e-scroll-step-button")],exports.ScrollStepButtonElement);var Qs=Object.defineProperty,Xs=Object.getOwnPropertyDescriptor,Ys=(r,t,i,n)=>{for(var h=n>1?void 0:n?Xs(t,i):t,c=r.length-1,p;c>=0;c--)(p=r[c])&&(h=(n?p(t,i,h):p(h))||h);return n&&h&&Qs(t,i,h),h},gs=(r,t,i)=>{if(!t.has(r))throw TypeError("Cannot "+i)},Ft=(r,t,i)=>(gs(r,t,"read from private field"),i?i.call(r):t.get(r)),us=(r,t,i)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,i)},ps=(r,t,i,n)=>(gs(r,t,"write to private field"),n?n.call(r,i):t.set(r,i),i),yt,ne,tt,mt,Kt,pe,fe,Jt;class js{constructor(t,i,n){z(this,tt,void 0);z(this,mt,void 0);z(this,Kt,void 0);z(this,pe,void 0);z(this,fe,()=>{o(this,mt).scrollToSection(o(this,Kt),o(this,pe))});z(this,Jt,()=>{o(this,tt).classList.toggle("current",o(this,mt).counter.current===o(this,Kt))});$(this,tt,document.createElement("button")),$(this,mt,t),$(this,pe,n),$(this,Kt,i),o(this,tt).addEventListener("click",o(this,fe)),o(this,mt).counter.subscribe(o(this,Jt)),o(this,Jt).call(this)}get element(){return o(this,tt)}destroy(){o(this,tt).removeEventListener("click",o(this,fe)),o(this,mt).counter.unsubscribe(o(this,Jt)),o(this,tt).remove()}}tt=new WeakMap,mt=new WeakMap,Kt=new WeakMap,pe=new WeakMap,fe=new WeakMap,Jt=new WeakMap;exports.ScrollBulletButtonsElement=class extends Re{constructor(){super(...arguments),us(this,yt,[]),us(this,ne,fs.debounce(()=>{Ft(this,yt).forEach(t=>t.destroy()),ps(this,yt,[]);for(let t=0;t<this.scrollElement.sections.length;t++){const i=new js(this.scrollElement,t,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),Ft(this,yt).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",Ft(this,ne)),Ft(this,ne).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",Ft(this,ne)),Ft(this,yt).forEach(t=>t.destroy()),ps(this,yt,[])}};yt=new WeakMap;ne=new WeakMap;exports.ScrollBulletButtonsElement=Ys([gt.define("e-scroll-bullet-buttons")],exports.ScrollBulletButtonsElement);var ti=Object.defineProperty,ei=Object.getOwnPropertyDescriptor,si=(r,t,i,n)=>{for(var h=n>1?void 0:n?ei(t,i):t,c=r.length-1,p;c>=0;c--)(p=r[c])&&(h=(n?p(t,i,h):p(h))||h);return n&&h&&ti(t,i,h),h},is=(r,t,i)=>{if(!t.has(r))throw TypeError("Cannot "+i)},s=(r,t,i)=>(is(r,t,"read from private field"),i?i.call(r):t.get(r)),l=(r,t,i)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,i)},m=(r,t,i,n)=>(is(r,t,"write to private field"),n?n.call(r,i):t.set(r,i),i),y=(r,t,i)=>(is(r,t,"access private method"),i),At,Pt,Et,kt,Wt,O,I,H,G,xt,L,ut,pt,ot,lt,at,It,he,x,K,Z,ft,St,X,Ee,v,Ht,Gt,ke,B,Y,V,W,T,oe,zt,k,We,Ge,rs,ws,Ne,_s,Ue,bs,Ze,Cs,Ke,ys,Je,Ps,Qe,Es,Me,le,ht,Mt,ns,ks,hs,Ws,xe,Xe,Le;exports.ScrollSegmentElement=class extends Re{constructor(){super(...arguments),l(this,We),l(this,rs),l(this,Ne),l(this,Ue),l(this,Ze),l(this,Ke),l(this,Je),l(this,Qe),l(this,ht),l(this,ns),l(this,hs),l(this,xe),l(this,At,new d.CSSProperty(this,"--target","")),l(this,Pt,new d.CSSProperty(this,"--disabled",!1)),l(this,Et,new d.CSSProperty(this,"--distance-offset",0)),l(this,kt,new d.CSSProperty(this,"--start-offset",0)),l(this,Wt,new d.CSSProperty(this,"--capture-once",!1)),l(this,O,new d.CSSProperty(this,"--captured","")),l(this,I,new d.CSSProperty(this,"--released","")),l(this,H,new d.CSSProperty(this,"--captured-from-start","")),l(this,G,new d.CSSProperty(this,"--captured-from-finish","")),l(this,xt,new d.CSSProperty(this,"--released-from-start","")),l(this,L,new d.CSSProperty(this,"--released-from-finish","")),l(this,ut,new d.CSSProperty(this,"--passed-var","")),l(this,pt,new d.CSSProperty(this,"--progress-var","")),l(this,ot,new d.CSSProperty(this,"--distance-var","")),l(this,lt,new d.CSSProperty(this,"--start-var","")),l(this,at,new d.CSSProperty(this,"--finish-var","")),l(this,It,new d.CSSProperty(this,"--smoothstep",!1)),l(this,he,new d.CSSProperty(this,"--smootherstep",!1)),l(this,x,new _t.Store(!1)),l(this,K,new _t.Store(!1)),l(this,Z,new _t.Store(!1)),l(this,ft,new _t.Store(!1)),l(this,St,new _t.Store(!1)),l(this,X,new _t.Store(!1)),l(this,Ee,[]),l(this,v,this),l(this,Ht,0),l(this,Gt,0),l(this,ke,0),l(this,B,0),l(this,Y,0),l(this,V,0),l(this,W,0),l(this,T,0),l(this,oe,!1),l(this,zt,!1),l(this,k,!0),l(this,Me,()=>{s(this,k)||(this.resize(),s(this,le).call(this))}),l(this,le,()=>{!s(this,k)&&s(this,oe)&&this.tick()}),l(this,Le,fs.debounce(()=>{const t=$t.scrollEntries.getAll(this).reverse();let i=0;t.forEach((n,h)=>{n.element===this.scrollElement&&(i=h)}),m(this,Ee,t.slice(i+1))},0))}get distanceOffsetCSSProperty(){return s(this,Et)}get startOffsetCSSProperty(){return s(this,kt)}get captureOnceCSSProperty(){return s(this,Wt)}get capturedCSSProperty(){return s(this,O)}get releasedCSSProperty(){return s(this,I)}get capturedFromStartCSSProperty(){return s(this,H)}get capturedFromFinishCSSProperty(){return s(this,G)}get releasedFromStartCSSProperty(){return s(this,xt)}get releasedFromFinishCSSProperty(){return s(this,L)}get passedVarCSSProperty(){return s(this,ut)}get progressVarCSSProperty(){return s(this,pt)}get distanceVarCSSProperty(){return s(this,ot)}get startVarCSSProperty(){return s(this,lt)}get finishVarCSSProperty(){return s(this,at)}get smoothstepCSSProperty(){return s(this,It)}get smootherstepCSSProperty(){return s(this,he)}get disabledCSSProperty(){return s(this,Pt)}get targetCSSProperty(){return s(this,At)}get isCaptured(){return s(this,x)}get isReleased(){return s(this,K)}get isCapturedFromStart(){return s(this,Z)}get isReleasedFromStart(){return s(this,ft)}get isCapturedFromFinish(){return s(this,St)}get isReleasedFromFinish(){return s(this,X)}get directionPosition(){return s(this,Ht)}get directionSize(){return s(this,Gt)}get passed(){return s(this,B)}get progress(){return s(this,Y)}get start(){return s(this,V)}get finish(){return s(this,T)}get distance(){return s(this,W)}get isCapturedOnce(){return s(this,zt)}get isDisabled(){return s(this,k)}resize(){m(this,Gt,this.scrollElement.vertical?this.offsetHeight:this.offsetWidth),m(this,Ht,this.scrollElement.vertical?vt.getCumulativeOffsetTop(this,this.scrollElement):vt.getCumulativeOffsetLeft(this,this.scrollElement)),m(this,V,this.getStart()),m(this,W,this.getDistance()),m(this,V,s(this,V)+s(this,kt).current),m(this,W,s(this,W)+s(this,Et).current),m(this,T,s(this,V)+s(this,W)),this.scrollElement.currentScrollValue>s(this,T)&&!s(this,x).current&&!s(this,K).current&&(s(this,x).current=!0),this.setVar(s(this,lt).current,s(this,V)),this.setVar(s(this,at).current,s(this,T)),this.setVar(s(this,ot).current,s(this,W)),m(this,oe,!0)}tick(){let t=this.scrollElement.currentScrollValue;s(this,Ee).forEach(n=>{t+=n.value}),m(this,B,this.updateValue(t-s(this,V),0,s(this,W))||0),m(this,Y,s(this,B)/s(this,W)||0);const i=Math.round(t);s(this,x).current&&(i>s(this,V)?s(this,Z).current||y(this,Ze,Cs).call(this):s(this,Z).current&&!s(this,ft).current&&y(this,Je,Ps).call(this),i<s(this,T)?s(this,X).current&&!s(this,St).current&&y(this,Ke,ys).call(this):s(this,Z).current&&!s(this,X).current&&y(this,Qe,Es).call(this)),i>s(this,V)&&i<s(this,T)?(y(this,We,Ge).call(this),s(this,x).current||y(this,Ne,_s).call(this)):s(this,x).current&&(m(this,B,Nt.step(s(this,W)/2,s(this,B),0,s(this,W))),m(this,Y,s(this,B)/s(this,W)),y(this,We,Ge).call(this),y(this,Ue,bs).call(this)),s(this,zt)&&s(this,Wt).current&&(s(this,O).current&&s(this,v).classList.add(s(this,O).current),m(this,k,!0))}disable(){this.style.cssText="",m(this,Ht,0),m(this,Gt,0),m(this,B,0),m(this,Y,0),m(this,V,0),m(this,W,0),m(this,T,0),m(this,oe,!1),s(this,x).current=!1,s(this,K).current=!1,s(this,Z).current=!1,s(this,ft).current=!1,s(this,St).current=!1,s(this,X).current=!1,m(this,zt,!1),m(this,k,!0),y(this,xe,Xe).call(this)}enable(){m(this,k,!1)}connectedCallback(){super.connectedCallback(),s(this,At).observe(),s(this,Pt).observe(),s(this,Et).observe(),s(this,kt).observe(),s(this,Wt).observe(),s(this,O).observe(),s(this,I).observe(),s(this,H).observe(),s(this,G).observe(),s(this,xt).observe(),s(this,L).observe(),s(this,ut).observe(),s(this,pt).observe(),s(this,ot).observe(),s(this,lt).observe(),s(this,at).observe(),s(this,It).observe(),s(this,he).observe();let t=!1;this.scrollElement.addEventListener("sectionsChange",s(this,Le)),s(this,Le).call(this),s(this,Pt).current||this.enable(),s(this,At).subscribe(i=>{i.previous&&y(this,xe,Xe).call(this),i.current?i.current==="parent"?m(this,v,this.parentElement||this):m(this,v,document.querySelector(i.current)||this):m(this,v,this)}),s(this,Pt).subscribe(i=>{i.current&&!i.previous?this.disable():!i.current&&i.previous&&(this.resize(),this.enable())}),s(this,kt).subscribe(()=>{t&&!s(this,k)&&this.resize()}),s(this,Et).subscribe(()=>{t&&!s(this,k)&&this.resize()}),s(this,O).subscribe(i=>{y(this,ht,Mt).call(this,i)}),s(this,H).subscribe(i=>{y(this,ht,Mt).call(this,i)}),s(this,G).subscribe(i=>{y(this,ht,Mt).call(this,i)}),s(this,I).subscribe(i=>{y(this,ht,Mt).call(this,i)}),s(this,xt).subscribe(i=>{y(this,ht,Mt).call(this,i)}),s(this,L).subscribe(i=>{y(this,ht,Mt).call(this,i)}),s(this,Wt).subscribe(i=>{s(this,k)||!i.current&&i.previous&&(this.resize(),this.enable())}),s(this,ut).subscribe(i=>{s(this,k)||(this.removeVar(i.previous),this.setVar(i.current,this.passed))}),s(this,pt).subscribe(i=>{s(this,k)||(this.removeVar(i.previous),this.setVar(i.current,s(this,Y)))}),s(this,lt).subscribe(i=>{s(this,k)||(this.removeVar(i.previous),this.setVar(i.current,s(this,V)))}),s(this,at).subscribe(i=>{s(this,k)||(this.removeVar(i.previous),this.setVar(i.current,s(this,T)))}),s(this,ot).subscribe(i=>{s(this,k)||(this.removeVar(i.previous),this.setVar(i.current,s(this,W)))}),Qt.windowResizer.subscribe(s(this,Me),Fe.RESIZE_ORDER.SEGMENT),this.scrollElement.onScroll(s(this,le)),t=!0}disconnectedCallback(){Qt.windowResizer.unsubscribe(s(this,Me)),this.scrollElement.offScroll(s(this,le)),s(this,At).close(),s(this,Pt).close(),s(this,Et).close(),s(this,kt).close(),s(this,Wt).close(),s(this,O).close(),s(this,I).close(),s(this,H).close(),s(this,G).close(),s(this,xt).close(),s(this,L).close(),s(this,ut).close(),s(this,pt).close(),s(this,ot).close(),s(this,lt).close(),s(this,at).close(),s(this,It).close(),s(this,he).close(),s(this,x).close(),s(this,K).close(),s(this,Z).close(),s(this,ft).close(),s(this,St).close(),s(this,X).close(),this.disable()}removeVar(t){t&&s(this,v).style.removeProperty(`--${t}`)}setVar(t,i){t&&s(this,v).style.setProperty(`--${t}`,i.toString())}updateValue(t,i=0,n=1){return this.smootherstepCSSProperty.current?Nt.smootherstep(t,i,n)*n:s(this,It).current?Nt.smoothstep(t,i,n)*n:Nt.clamp(t,i,n)}getDistance(){return s(this,Gt)+s(this,ke)}getStart(){return s(this,Ht)-s(this,ke)}};At=new WeakMap;Pt=new WeakMap;Et=new WeakMap;kt=new WeakMap;Wt=new WeakMap;O=new WeakMap;I=new WeakMap;H=new WeakMap;G=new WeakMap;xt=new WeakMap;L=new WeakMap;ut=new WeakMap;pt=new WeakMap;ot=new WeakMap;lt=new WeakMap;at=new WeakMap;It=new WeakMap;he=new WeakMap;x=new WeakMap;K=new WeakMap;Z=new WeakMap;ft=new WeakMap;St=new WeakMap;X=new WeakMap;Ee=new WeakMap;v=new WeakMap;Ht=new WeakMap;Gt=new WeakMap;ke=new WeakMap;B=new WeakMap;Y=new WeakMap;V=new WeakMap;W=new WeakMap;T=new WeakMap;oe=new WeakMap;zt=new WeakMap;k=new WeakMap;We=new WeakSet;Ge=function(){y(this,rs,ws).call(this),this.setVar(s(this,ut).current,s(this,B)),this.setVar(s(this,pt).current,s(this,Y))};rs=new WeakSet;ws=function(){this.dispatchEvent(new CustomEvent("segmentPass",{detail:{distance:s(this,W),start:s(this,V),finish:s(this,T),passed:s(this,B),progress:s(this,Y)}}))};Ne=new WeakSet;_s=function(){s(this,x).current=!0,s(this,K).current=!1,m(this,zt,!0),s(this,I).current&&s(this,v).classList.remove(s(this,I).current),s(this,L).current&&s(this,v).classList.remove(s(this,L).current),s(this,L).current&&s(this,v).classList.remove(s(this,L).current),s(this,O).current&&s(this,v).classList.add(s(this,O).current)};Ue=new WeakSet;bs=function(){s(this,K).current=!0,s(this,x).current=!1,m(this,zt,!0),s(this,O).current&&s(this,v).classList.remove(s(this,O).current),s(this,H).current&&s(this,v).classList.remove(s(this,H).current),s(this,G).current&&s(this,v).classList.remove(s(this,G).current),s(this,I).current&&s(this,v).classList.add(s(this,I).current)};Ze=new WeakSet;Cs=function(){s(this,x).current=!0,s(this,Z).current=!0,s(this,ft).current=!1,s(this,H).current&&s(this,v).classList.add(s(this,H).current)};Ke=new WeakSet;ys=function(){s(this,x).current=!0,s(this,St).current=!0,s(this,X).current=!1,s(this,G).current&&s(this,v).classList.add(s(this,G).current)};Je=new WeakSet;Ps=function(){s(this,K).current=!0,s(this,ft).current=!0,s(this,Z).current=!1,s(this,L).current&&s(this,v).classList.add(s(this,L).current)};Qe=new WeakSet;Es=function(){s(this,K).current=!0,s(this,X).current=!0,s(this,St).current=!1,s(this,L).current&&s(this,v).classList.add(s(this,L).current)};Me=new WeakMap;le=new WeakMap;ht=new WeakSet;Mt=function(r){if(s(this,k)){r.previous&&s(this,v).classList.remove(r.previous),r.current&&s(this,v).classList.remove(r.current);return}r.current&&s(this,x).current?(r.previous&&s(this,v).classList.remove(r.previous),s(this,v).classList.add(r.current)):!r.current&&r.previous&&s(this,v).classList.remove(r.previous)};ns=new WeakSet;ks=function(...r){r.forEach(t=>{t&&s(this,v).classList.remove(t)})};hs=new WeakSet;Ws=function(...r){r.forEach(t=>{t&&s(this,v).style.removeProperty(`--${t}`)})};xe=new WeakSet;Xe=function(){y(this,ns,ks).call(this,s(this,O).current,s(this,H).current,s(this,G).current,s(this,I).current,s(this,xt).current,s(this,L).current),y(this,hs,Ws).call(this,s(this,ut).current,s(this,pt).current,s(this,ot).current,s(this,lt).current,s(this,at).current)};Le=new WeakMap;exports.ScrollSegmentElement=si([gt.define("e-scroll-segment")],exports.ScrollSegmentElement);
|