aptechka 0.85.0 → 0.86.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.
@@ -2,6 +2,7 @@ import { LayoutBox, LayoutBoxOptions } from '../layout-box';
2
2
  import { ElementOrSelector } from '../utils';
3
3
  import { Object3D, OrthographicCamera, PerspectiveCamera, Scene } from 'three';
4
4
  import { En3 } from './En3';
5
+ import { En3Clip } from './objects/En3Clip';
5
6
  export interface En3ViewOptions {
6
7
  cameraType?: 'perspective' | 'orthographic';
7
8
  cameraDistance?: number;
@@ -14,9 +15,12 @@ export interface En3ViewOptions {
14
15
  export type En3AttachedObject3D<T extends Object3D> = T & {
15
16
  userData: {
16
17
  box: LayoutBox;
18
+ clip?: En3Clip;
17
19
  };
18
20
  };
19
- export type En3AttachOptions = Omit<LayoutBoxOptions, 'containerElement' | 'cartesian' | 'scrollStep'>;
21
+ export type En3AttachOptions = Omit<LayoutBoxOptions, 'containerElement' | 'cartesian' | 'scrollStep'> & {
22
+ clip?: boolean;
23
+ };
20
24
  export type En3ViewBeforeRenderCallback = () => void;
21
25
  export declare class En3View {
22
26
  #private;
package/lib/en3/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const order_index=require("../order/index.cjs"),intersector_index=require("../index-DZ44osDT.cjs"),dom=require("../dom-B40i6NXw.cjs");require("construct-style-sheets-polyfill");const windowResizer_index=require("../window-resizer/index.cjs"),three=require("three"),layoutBox_index=require("../layout-box/index.cjs"),_function=require("../function-H4b_gTg6.cjs");function dispose(object3d){const cleanMaterial=__name(material=>{material.dispose();for(const key of Object.keys(material)){const value=material[key];value&&typeof value=="object"&&"minFilter"in value&&value.dispose()}},"cleanMaterial");object3d.traverse(object=>{if(object instanceof three.Mesh){if(object.geometry.dispose(),!Array.isArray(object.material)&&object.material.isMaterial)cleanMaterial(object.material);else if(Array.isArray(object.material))for(const material of object.material)cleanMaterial(material)}})}__name(dispose,"dispose");var _en3,_name,_camera,_scene,_attachedObjects,_cameraDistance,_cameraFov,_sizeElement,_box,_debouncedResize;const _En3View=class _En3View{constructor(en3,name,options){__privateAdd(this,_en3);__privateAdd(this,_name);__privateAdd(this,_camera);__privateAdd(this,_scene);__privateAdd(this,_attachedObjects);__privateAdd(this,_cameraDistance);__privateAdd(this,_cameraFov);__privateAdd(this,_sizeElement);__privateAdd(this,_box);__privateAdd(this,_debouncedResize,_function.debounce(()=>{this.resize()},0));__privateSet(this,_en3,en3),__privateSet(this,_name,name),__privateSet(this,_camera,(options==null?void 0:options.cameraType)==="orthographic"?new three.OrthographicCamera:new three.PerspectiveCamera),__privateSet(this,_scene,new three.Scene),__privateSet(this,_attachedObjects,[]),__privateSet(this,_cameraDistance,(options==null?void 0:options.cameraDistance)||1e3),__privateGet(this,_camera).near=(options==null?void 0:options.cameraNear)||1,__privateGet(this,_camera).far=(options==null?void 0:options.cameraFar)||11e3,__privateSet(this,_cameraFov,(options==null?void 0:options.cameraFov)||"auto"),__privateGet(this,_camera).position.z=__privateGet(this,_cameraDistance),__privateGet(this,_camera).name=`Cameras.${__privateGet(this,_name)}`,__privateSet(this,_sizeElement,dom.getElement(options==null?void 0:options.sizeElement)||document.documentElement),this.beforeRenderCallback=options==null?void 0:options.beforeRender,__privateSet(this,_box,new layoutBox_index.LayoutBox(__privateGet(this,_sizeElement))),__privateGet(this,_box).onResize(()=>{this.resize()})}get name(){return __privateGet(this,_name)}get camera(){return __privateGet(this,_camera)}get scene(){return __privateGet(this,_scene)}get box(){return __privateGet(this,_box)}get cameraDistance(){return __privateGet(this,_cameraDistance)}set cameraDistance(value){__privateSet(this,_cameraDistance,value),__privateGet(this,_debouncedResize).call(this)}set fov(value){__privateSet(this,_cameraFov,value),__privateGet(this,_debouncedResize).call(this)}get fov(){return __privateGet(this,_cameraFov)}set near(value){__privateGet(this,_camera).near=value,__privateGet(this,_debouncedResize).call(this)}get near(){return __privateGet(this,_camera).near}set far(value){__privateGet(this,_camera).far=value,__privateGet(this,_debouncedResize).call(this)}get far(){return __privateGet(this,_camera).far}get sizeElement(){return __privateGet(this,_sizeElement)}get isClipped(){return __privateGet(this,_sizeElement)!==__privateGet(this,_en3).containerElement}resize(){const{width,height}=__privateGet(this,_box);__privateGet(this,_camera).userData.controlled||(__privateGet(this,_camera).position.z=__privateGet(this,_cameraDistance)),__privateGet(this,_camera)instanceof three.PerspectiveCamera?(__privateGet(this,_camera).aspect=width/height,__privateGet(this,_camera).fov=__privateGet(this,_cameraFov)==="auto"?2*Math.atan(height/2/__privateGet(this,_cameraDistance))*(180/Math.PI):__privateGet(this,_camera).userData.controlled?__privateGet(this,_camera).fov:__privateGet(this,_cameraFov)):__privateGet(this,_camera)instanceof three.OrthographicCamera&&(__privateGet(this,_camera).left=width/-2,__privateGet(this,_camera).right=width/2,__privateGet(this,_camera).top=height/2,__privateGet(this,_camera).bottom=height/-2),__privateGet(this,_camera).updateProjectionMatrix()}destroy(){__privateGet(this,_attachedObjects).forEach(object=>{object.userData.box.destroy()}),__privateGet(this,_scene).clear(),dispose(__privateGet(this,_scene)),__privateGet(this,_en3).destroyView(this.name),__privateGet(this,_box).destroy()}attachToHTMLElement(element,object,options){const box=new layoutBox_index.LayoutBox(element,__spreadProps(__spreadValues({},options),{containerElement:__privateGet(this,_sizeElement),cartesian:!0,scrollStep:!this.isClipped}));return box.bindObject(object),object.userData.box=box,__privateGet(this,_attachedObjects).push(object),object}detachFromHTMLElement(object){__privateSet(this,_attachedObjects,__privateGet(this,_attachedObjects).filter(o=>o===object?(object.userData.box.destroy(),!1):!0))}add(...args){const object=args[0],element=args[1],options=args[2];return element&&this.attachToHTMLElement(element,object,options),this.scene.add(object),object}remove(object,detach){this.scene.remove(object),detach&&this.detachFromHTMLElement(object)}};_en3=new WeakMap,_name=new WeakMap,_camera=new WeakMap,_scene=new WeakMap,_attachedObjects=new WeakMap,_cameraDistance=new WeakMap,_cameraFov=new WeakMap,_sizeElement=new WeakMap,_box=new WeakMap,_debouncedResize=new WeakMap,__name(_En3View,"En3View");let En3View=_En3View;var _CDNVersion,_containerElement,_webglRenderer,_views,_width,_height,_pixelRatio,_maxPixelRatio,_isCreated,_composer,_resizeListener,_tickListener;const _En3=class _En3{constructor(){__privateAdd(this,_CDNVersion,`https://unpkg.com/three@0.${three.REVISION}.x`);__privateAdd(this,_containerElement,null);__privateAdd(this,_webglRenderer,null);__privateAdd(this,_views,new Map);__privateAdd(this,_width,0);__privateAdd(this,_height,0);__privateAdd(this,_pixelRatio,0);__privateAdd(this,_maxPixelRatio,2);__privateAdd(this,_isCreated,!1);__privateAdd(this,_composer,null);__privateAdd(this,_resizeListener,__name(e=>{e instanceof CustomEvent||(__privateSet(this,_width,__privateGet(this,_containerElement).clientWidth),__privateSet(this,_height,__privateGet(this,_containerElement).clientHeight),__privateSet(this,_pixelRatio,Math.min(__privateGet(this,_maxPixelRatio),devicePixelRatio||1)),__privateGet(this,_webglRenderer).setPixelRatio(__privateGet(this,_pixelRatio)),__privateGet(this,_webglRenderer).setSize(__privateGet(this,_width),__privateGet(this,_height)),__privateGet(this,_composer)&&(__privateGet(this,_composer).setPixelRatio(__privateGet(this,_pixelRatio)),__privateGet(this,_composer).setSize(__privateGet(this,_width),__privateGet(this,_height))))},"#resizeListener"));__privateAdd(this,_tickListener,__name(()=>{__privateGet(this,_webglRenderer).setRenderTarget(null),__privateGet(this,_views).forEach(view=>{this.render(view)})},"#tickListener"))}get CDNVersion(){return __privateGet(this,_CDNVersion)}get containerElement(){return __privateGet(this,_containerElement)}get webglRenderer(){return __privateGet(this,_webglRenderer)}get views(){return __privateGet(this,_views)}get view(){return this.getView("default")}get camera(){return this.getView("default").camera}get scene(){return this.getView("default").scene}get width(){return __privateGet(this,_width)}get height(){return __privateGet(this,_height)}get pixelRatio(){return __privateGet(this,_pixelRatio)}get composer(){return __privateGet(this,_composer)}setup(options){if(__privateGet(this,_isCreated))return;__privateSet(this,_containerElement,dom.getElement(options==null?void 0:options.containerElement)||document.body),__privateSet(this,_maxPixelRatio,(options==null?void 0:options.maxPixelRatio)||2),__privateSet(this,_webglRenderer,new three.WebGLRenderer(options==null?void 0:options.webGLRendererParameters)),__privateGet(this,_webglRenderer).domElement.style.cssText=`
1
+ "use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const order_index=require("../order/index.cjs"),intersector_index=require("../index-DZ44osDT.cjs"),dom=require("../dom-B40i6NXw.cjs");require("construct-style-sheets-polyfill");const windowResizer_index=require("../window-resizer/index.cjs"),three=require("three"),layoutBox_index=require("../layout-box/index.cjs"),_function=require("../function-H4b_gTg6.cjs");var _layoutBox,_planes,_tickListener;const _En3Clip=class _En3Clip{constructor(material,elementOrSelector){__privateAdd(this,_layoutBox,null);__privateAdd(this,_planes,[]);__privateAdd(this,_tickListener,__name(()=>{const scrollValueX=__privateGet(this,_layoutBox).position.x-__privateGet(this,_layoutBox).left,scrollValueY=__privateGet(this,_layoutBox).position.y-__privateGet(this,_layoutBox).top;__privateGet(this,_planes)[0].constant=__privateGet(this,_layoutBox).scale.y/2+scrollValueY*-1,__privateGet(this,_planes)[1].constant=__privateGet(this,_layoutBox).scale.y/2+scrollValueY,__privateGet(this,_planes)[2].constant=__privateGet(this,_layoutBox).scale.x/2+scrollValueX,__privateGet(this,_planes)[3].constant=__privateGet(this,_layoutBox).scale.x/2+scrollValueX*-1},"#tickListener"));__privateSet(this,_layoutBox,new layoutBox_index.LayoutBox(elementOrSelector,{cartesian:!1})),__privateSet(this,_planes,[new three.Plane(new three.Vector3(0,-1,0)),new three.Plane(new three.Vector3(0,1,0)),new three.Plane(new three.Vector3(-1,0,0)),new three.Plane(new three.Vector3(1,0,0))]),material.clippingPlanes=__privateGet(this,_planes),intersector_index.ticker.subscribe(__privateGet(this,_tickListener),{order:order_index.TICK_ORDER.LAYOUT_BOX})}get planes(){return __privateGet(this,_planes)}get layoutBox(){return __privateGet(this,_layoutBox)}destroy(){intersector_index.ticker.unsubscribe(__privateGet(this,_tickListener)),__privateGet(this,_layoutBox).destroy()}};_layoutBox=new WeakMap,_planes=new WeakMap,_tickListener=new WeakMap,__name(_En3Clip,"En3Clip");let En3Clip=_En3Clip;function dispose(object3d){const cleanMaterial=__name(material=>{material.dispose();for(const key of Object.keys(material)){const value=material[key];value&&typeof value=="object"&&"minFilter"in value&&value.dispose()}},"cleanMaterial");object3d.traverse(object=>{if(object instanceof three.Mesh){if(object.geometry.dispose(),!Array.isArray(object.material)&&object.material.isMaterial)cleanMaterial(object.material);else if(Array.isArray(object.material))for(const material of object.material)cleanMaterial(material)}})}__name(dispose,"dispose");var _en3,_name,_camera,_scene,_attachedObjects,_cameraDistance,_cameraFov,_sizeElement,_box,_debouncedResize;const _En3View=class _En3View{constructor(en3,name,options){__privateAdd(this,_en3);__privateAdd(this,_name);__privateAdd(this,_camera);__privateAdd(this,_scene);__privateAdd(this,_attachedObjects);__privateAdd(this,_cameraDistance);__privateAdd(this,_cameraFov);__privateAdd(this,_sizeElement);__privateAdd(this,_box);__privateAdd(this,_debouncedResize,_function.debounce(()=>{this.resize()},0));__privateSet(this,_en3,en3),__privateSet(this,_name,name),__privateSet(this,_camera,(options==null?void 0:options.cameraType)==="orthographic"?new three.OrthographicCamera:new three.PerspectiveCamera),__privateSet(this,_scene,new three.Scene),__privateSet(this,_attachedObjects,[]),__privateSet(this,_cameraDistance,(options==null?void 0:options.cameraDistance)||1e3),__privateGet(this,_camera).near=(options==null?void 0:options.cameraNear)||1,__privateGet(this,_camera).far=(options==null?void 0:options.cameraFar)||11e3,__privateSet(this,_cameraFov,(options==null?void 0:options.cameraFov)||"auto"),__privateGet(this,_camera).position.z=__privateGet(this,_cameraDistance),__privateGet(this,_camera).name=`Cameras.${__privateGet(this,_name)}`,__privateSet(this,_sizeElement,dom.getElement(options==null?void 0:options.sizeElement)||document.documentElement),this.beforeRenderCallback=options==null?void 0:options.beforeRender,__privateSet(this,_box,new layoutBox_index.LayoutBox(__privateGet(this,_sizeElement))),__privateGet(this,_box).onResize(()=>{this.resize()})}get name(){return __privateGet(this,_name)}get camera(){return __privateGet(this,_camera)}get scene(){return __privateGet(this,_scene)}get box(){return __privateGet(this,_box)}get cameraDistance(){return __privateGet(this,_cameraDistance)}set cameraDistance(value){__privateSet(this,_cameraDistance,value),__privateGet(this,_debouncedResize).call(this)}set fov(value){__privateSet(this,_cameraFov,value),__privateGet(this,_debouncedResize).call(this)}get fov(){return __privateGet(this,_cameraFov)}set near(value){__privateGet(this,_camera).near=value,__privateGet(this,_debouncedResize).call(this)}get near(){return __privateGet(this,_camera).near}set far(value){__privateGet(this,_camera).far=value,__privateGet(this,_debouncedResize).call(this)}get far(){return __privateGet(this,_camera).far}get sizeElement(){return __privateGet(this,_sizeElement)}get isClipped(){return __privateGet(this,_sizeElement)!==__privateGet(this,_en3).containerElement}resize(){const{width,height}=__privateGet(this,_box);__privateGet(this,_camera).userData.controlled||(__privateGet(this,_camera).position.z=__privateGet(this,_cameraDistance)),__privateGet(this,_camera)instanceof three.PerspectiveCamera?(__privateGet(this,_camera).aspect=width/height,__privateGet(this,_camera).fov=__privateGet(this,_cameraFov)==="auto"?2*Math.atan(height/2/__privateGet(this,_cameraDistance))*(180/Math.PI):__privateGet(this,_camera).userData.controlled?__privateGet(this,_camera).fov:__privateGet(this,_cameraFov)):__privateGet(this,_camera)instanceof three.OrthographicCamera&&(__privateGet(this,_camera).left=width/-2,__privateGet(this,_camera).right=width/2,__privateGet(this,_camera).top=height/2,__privateGet(this,_camera).bottom=height/-2),__privateGet(this,_camera).updateProjectionMatrix()}destroy(){__privateGet(this,_attachedObjects).forEach(object=>{object.userData.box.destroy()}),__privateGet(this,_scene).clear(),dispose(__privateGet(this,_scene)),__privateGet(this,_en3).destroyView(this.name),__privateGet(this,_box).destroy()}attachToHTMLElement(element,object,options){const box=new layoutBox_index.LayoutBox(element,__spreadProps(__spreadValues({},options),{containerElement:__privateGet(this,_sizeElement),cartesian:!0,scrollStep:!this.isClipped}));if(box.bindObject(object),object.userData.box=box,options!=null&&options.clip&&"material"in object){const clip=new En3Clip(object.material,element);object.userData.clip=clip}return __privateGet(this,_attachedObjects).push(object),object}detachFromHTMLElement(object){__privateSet(this,_attachedObjects,__privateGet(this,_attachedObjects).filter(o=>{if(o===object){const{box,clip}=object.userData;return box.destroy(),clip==null||clip.destroy(),!1}return!0}))}add(...args){const object=args[0],element=args[1],options=args[2];return element&&this.attachToHTMLElement(element,object,options),this.scene.add(object),object}remove(object,detach){this.scene.remove(object),detach&&this.detachFromHTMLElement(object)}};_en3=new WeakMap,_name=new WeakMap,_camera=new WeakMap,_scene=new WeakMap,_attachedObjects=new WeakMap,_cameraDistance=new WeakMap,_cameraFov=new WeakMap,_sizeElement=new WeakMap,_box=new WeakMap,_debouncedResize=new WeakMap,__name(_En3View,"En3View");let En3View=_En3View;var _CDNVersion,_containerElement,_webglRenderer,_views,_width,_height,_pixelRatio,_maxPixelRatio,_isCreated,_composer,_resizeListener,_tickListener2;const _En3=class _En3{constructor(){__privateAdd(this,_CDNVersion,`https://unpkg.com/three@0.${three.REVISION}.x`);__privateAdd(this,_containerElement,null);__privateAdd(this,_webglRenderer,null);__privateAdd(this,_views,new Map);__privateAdd(this,_width,0);__privateAdd(this,_height,0);__privateAdd(this,_pixelRatio,0);__privateAdd(this,_maxPixelRatio,2);__privateAdd(this,_isCreated,!1);__privateAdd(this,_composer,null);__privateAdd(this,_resizeListener,__name(e=>{e instanceof CustomEvent||(__privateSet(this,_width,__privateGet(this,_containerElement).clientWidth),__privateSet(this,_height,__privateGet(this,_containerElement).clientHeight),__privateSet(this,_pixelRatio,Math.min(__privateGet(this,_maxPixelRatio),devicePixelRatio||1)),__privateGet(this,_webglRenderer).setPixelRatio(__privateGet(this,_pixelRatio)),__privateGet(this,_webglRenderer).setSize(__privateGet(this,_width),__privateGet(this,_height)),__privateGet(this,_composer)&&(__privateGet(this,_composer).setPixelRatio(__privateGet(this,_pixelRatio)),__privateGet(this,_composer).setSize(__privateGet(this,_width),__privateGet(this,_height))))},"#resizeListener"));__privateAdd(this,_tickListener2,__name(()=>{__privateGet(this,_webglRenderer).setRenderTarget(null),__privateGet(this,_views).forEach(view=>{this.render(view)})},"#tickListener"))}get CDNVersion(){return __privateGet(this,_CDNVersion)}get containerElement(){return __privateGet(this,_containerElement)}get webglRenderer(){return __privateGet(this,_webglRenderer)}get views(){return __privateGet(this,_views)}get view(){return this.getView("default")}get camera(){return this.getView("default").camera}get scene(){return this.getView("default").scene}get width(){return __privateGet(this,_width)}get height(){return __privateGet(this,_height)}get pixelRatio(){return __privateGet(this,_pixelRatio)}get composer(){return __privateGet(this,_composer)}setup(options){if(__privateGet(this,_isCreated))return;__privateSet(this,_containerElement,dom.getElement(options==null?void 0:options.containerElement)||document.body),__privateSet(this,_maxPixelRatio,(options==null?void 0:options.maxPixelRatio)||2),__privateSet(this,_webglRenderer,new three.WebGLRenderer(options==null?void 0:options.webGLRendererParameters)),__privateGet(this,_webglRenderer).domElement.style.cssText=`
2
2
  position: ${(options==null?void 0:options.position)||"fixed"};
3
3
  left: 0;
4
4
  top: 0;
5
5
  width: 100%;
6
6
  height: 100%;
7
7
  z-index: ${(options==null?void 0:options.zIndex)||0};
8
- `,(__privateGet(this,_containerElement).shadowRoot||__privateGet(this,_containerElement)).append(__privateGet(this,_webglRenderer).domElement),__privateGet(this,_views).set("default",new En3View(this,"default",__spreadValues({sizeElement:__privateGet(this,_containerElement)},options==null?void 0:options.view))),options!=null&&options.composer&&(__privateSet(this,_composer,new options.composer(__privateGet(this,_webglRenderer))),this.render=()=>{__privateGet(this,_composer).render()}),__privateSet(this,_isCreated,!0),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener),order_index.RESIZE_ORDER.CANVAS),intersector_index.ticker.subscribe(__privateGet(this,_tickListener),{order:order_index.TICK_ORDER.CANVAS,culling:__privateGet(this,_containerElement)})}destroy(){var _a;__privateGet(this,_isCreated)&&(windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),intersector_index.ticker.unsubscribe(__privateGet(this,_tickListener)),__privateGet(this,_views).forEach(view=>{view.destroy()}),__privateGet(this,_views).clear(),__privateGet(this,_webglRenderer).dispose(),__privateGet(this,_webglRenderer).domElement.remove(),__privateSet(this,_webglRenderer,null),(_a=__privateGet(this,_composer))==null||_a.dispose(),__privateSet(this,_composer,null),__privateSet(this,_isCreated,!1))}createView(viewName,viewOptions){const size=__privateGet(this,_views).size,view=new En3View(this,viewName,viewOptions);return __privateGet(this,_views).set(viewName,view),size===1&&__privateGet(this,_webglRenderer).setScissorTest(!0),view}getView(viewName){return __privateGet(this,_views).get(viewName)}destroyView(viewName){const view=__privateGet(this,_views).get(viewName);view&&(__privateGet(this,_views).delete(viewName),view.destroy(),__privateGet(this,_views).size<=1&&__privateGet(this,_webglRenderer).setScissorTest(!1))}render(view){var _a;if(__privateGet(this,_views).size>1||this.view.isClipped){const left=view.box.left+view.box.CSSTranslation.x+view.box.scrollValue.x,top=this.height-view.box.height-view.box.top+view.box.CSSTranslation.y+view.box.scrollValue.y*-1;__privateGet(this,_webglRenderer).setScissor(left,top,view.box.width,view.box.height),__privateGet(this,_webglRenderer).setViewport(left,top,view.box.width,view.box.height)}(_a=view.beforeRenderCallback)==null||_a.call(view),__privateGet(this,_webglRenderer).render(view.scene,view.camera)}};_CDNVersion=new WeakMap,_containerElement=new WeakMap,_webglRenderer=new WeakMap,_views=new WeakMap,_width=new WeakMap,_height=new WeakMap,_pixelRatio=new WeakMap,_maxPixelRatio=new WeakMap,_isCreated=new WeakMap,_composer=new WeakMap,_resizeListener=new WeakMap,_tickListener=new WeakMap,__name(_En3,"En3");let En3=_En3;function coverTexture(texture,planeSize,aspect){const width=planeSize.x,height=planeSize.y,_aspect=aspect||texture.image.width/texture.image.height;let sx=0,sy=0,tx=texture.offset.x,ty=texture.offset.y,r=texture.rotation,cx=texture.center.x,cy=texture.center.y;width/height>_aspect?(sx=1,sy=height/width*_aspect):(sy=1,sx=width/height/_aspect),texture.matrix.setUvTransform(tx,ty,sx,sy,r,cx,cy)}__name(coverTexture,"coverTexture");const tempTarget=new three.Vector3,position=new three.Vector3;function getCurrentViewport(en3,target,viewName="default"){const view=en3.getView(viewName),{width,height}=en3,aspect=width/height;target instanceof three.Vector3?tempTarget.copy(target):tempTarget.set(...target);const distance=view.camera.getWorldPosition(position).distanceTo(tempTarget);if(view.camera instanceof three.OrthographicCamera)return{width:width/view.camera.zoom,height:height/view.camera.zoom,factor:1,distance,aspect};{const fov=view.camera.fov*Math.PI/180,h=2*Math.tan(fov/2)*distance,w=h*(width/height);return{width:w,height:h,factor:width/w,distance,aspect}}}__name(getCurrentViewport,"getCurrentViewport");function traverseMaterials(object,callback){object.traverse(node=>{node instanceof three.Mesh&&node.material&&(Array.isArray(node.material)?node.material:[node.material]).forEach(callback)})}__name(traverseMaterials,"traverseMaterials");function traverseMeshes(object,callback){object.traverse(node=>{node instanceof three.Mesh&&callback(node)})}__name(traverseMeshes,"traverseMeshes");exports.En3=En3;exports.En3View=En3View;exports.coverTexture=coverTexture;exports.dispose=dispose;exports.getCurrentViewport=getCurrentViewport;exports.traverseMaterials=traverseMaterials;exports.traverseMeshes=traverseMeshes;
8
+ `,(__privateGet(this,_containerElement).shadowRoot||__privateGet(this,_containerElement)).append(__privateGet(this,_webglRenderer).domElement),__privateGet(this,_views).set("default",new En3View(this,"default",__spreadValues({sizeElement:__privateGet(this,_containerElement)},options==null?void 0:options.view))),options!=null&&options.composer&&(__privateSet(this,_composer,new options.composer(__privateGet(this,_webglRenderer))),this.render=()=>{__privateGet(this,_composer).render()}),__privateSet(this,_isCreated,!0),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener),order_index.RESIZE_ORDER.CANVAS),intersector_index.ticker.subscribe(__privateGet(this,_tickListener2),{order:order_index.TICK_ORDER.CANVAS,culling:__privateGet(this,_containerElement)})}destroy(){var _a;__privateGet(this,_isCreated)&&(windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),intersector_index.ticker.unsubscribe(__privateGet(this,_tickListener2)),__privateGet(this,_views).forEach(view=>{view.destroy()}),__privateGet(this,_views).clear(),__privateGet(this,_webglRenderer).dispose(),__privateGet(this,_webglRenderer).domElement.remove(),__privateSet(this,_webglRenderer,null),(_a=__privateGet(this,_composer))==null||_a.dispose(),__privateSet(this,_composer,null),__privateSet(this,_isCreated,!1))}createView(viewName,viewOptions){const size=__privateGet(this,_views).size,view=new En3View(this,viewName,viewOptions);return __privateGet(this,_views).set(viewName,view),size===1&&__privateGet(this,_webglRenderer).setScissorTest(!0),view}getView(viewName){return __privateGet(this,_views).get(viewName)}destroyView(viewName){const view=__privateGet(this,_views).get(viewName);view&&(__privateGet(this,_views).delete(viewName),view.destroy(),__privateGet(this,_views).size<=1&&__privateGet(this,_webglRenderer).setScissorTest(!1))}render(view){var _a;if(__privateGet(this,_views).size>1||this.view.isClipped){const left=view.box.left+view.box.CSSTranslation.x+view.box.scrollValue.x,top=this.height-view.box.height-view.box.top+view.box.CSSTranslation.y+view.box.scrollValue.y*-1;__privateGet(this,_webglRenderer).setScissor(left,top,view.box.width,view.box.height),__privateGet(this,_webglRenderer).setViewport(left,top,view.box.width,view.box.height)}(_a=view.beforeRenderCallback)==null||_a.call(view),__privateGet(this,_webglRenderer).render(view.scene,view.camera)}};_CDNVersion=new WeakMap,_containerElement=new WeakMap,_webglRenderer=new WeakMap,_views=new WeakMap,_width=new WeakMap,_height=new WeakMap,_pixelRatio=new WeakMap,_maxPixelRatio=new WeakMap,_isCreated=new WeakMap,_composer=new WeakMap,_resizeListener=new WeakMap,_tickListener2=new WeakMap,__name(_En3,"En3");let En3=_En3;function coverTexture(texture,planeSize,aspect){const width=planeSize.x,height=planeSize.y,_aspect=aspect||texture.image.width/texture.image.height;let sx=0,sy=0,tx=texture.offset.x,ty=texture.offset.y,r=texture.rotation,cx=texture.center.x,cy=texture.center.y;width/height>_aspect?(sx=1,sy=height/width*_aspect):(sy=1,sx=width/height/_aspect),texture.matrix.setUvTransform(tx,ty,sx,sy,r,cx,cy)}__name(coverTexture,"coverTexture");const tempTarget=new three.Vector3,position=new three.Vector3;function getCurrentViewport(en3,target,viewName="default"){const view=en3.getView(viewName),{width,height}=en3,aspect=width/height;target instanceof three.Vector3?tempTarget.copy(target):tempTarget.set(...target);const distance=view.camera.getWorldPosition(position).distanceTo(tempTarget);if(view.camera instanceof three.OrthographicCamera)return{width:width/view.camera.zoom,height:height/view.camera.zoom,factor:1,distance,aspect};{const fov=view.camera.fov*Math.PI/180,h=2*Math.tan(fov/2)*distance,w=h*(width/height);return{width:w,height:h,factor:width/w,distance,aspect}}}__name(getCurrentViewport,"getCurrentViewport");function traverseMaterials(object,callback){object.traverse(node=>{node instanceof three.Mesh&&node.material&&(Array.isArray(node.material)?node.material:[node.material]).forEach(callback)})}__name(traverseMaterials,"traverseMaterials");function traverseMeshes(object,callback){object.traverse(node=>{node instanceof three.Mesh&&callback(node)})}__name(traverseMeshes,"traverseMeshes");exports.En3=En3;exports.En3Clip=En3Clip;exports.En3View=En3View;exports.coverTexture=coverTexture;exports.dispose=dispose;exports.getCurrentViewport=getCurrentViewport;exports.traverseMaterials=traverseMaterials;exports.traverseMeshes=traverseMeshes;
@@ -1,5 +1,6 @@
1
1
  export { En3, type En3Options } from './En3';
2
- export { En3View, type En3ViewOptions, type En3AttachedObject3D, type En3AttachOptions, type En3ViewBeforeRenderCallback, } from './En3View';
2
+ export { En3View, type En3AttachOptions, type En3AttachedObject3D, type En3ViewBeforeRenderCallback, type En3ViewOptions, } from './En3View';
3
+ export { En3Clip } from './objects/En3Clip';
3
4
  export { coverTexture } from './utils/coverTexture';
4
5
  export { dispose } from './utils/dispose';
5
6
  export { getCurrentViewport } from './utils/getCurrentViewport';
package/lib/en3/index.js CHANGED
@@ -15,14 +15,42 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
15
15
  }, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)), __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
16
16
  var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
17
17
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
18
- import { RESIZE_ORDER, TICK_ORDER } from "../order/index.js";
18
+ import { TICK_ORDER, RESIZE_ORDER } from "../order/index.js";
19
19
  import { t as ticker } from "../index-ClTMVKJp.js";
20
20
  import { g as getElement } from "../dom-D8D-_9ty.js";
21
21
  import "construct-style-sheets-polyfill";
22
22
  import { windowResizer } from "../window-resizer/index.js";
23
- import { Mesh, OrthographicCamera, PerspectiveCamera, Scene, REVISION, WebGLRenderer, Vector3 } from "three";
23
+ import { Plane, Vector3, Mesh, OrthographicCamera, PerspectiveCamera, Scene, REVISION, WebGLRenderer } from "three";
24
24
  import { LayoutBox } from "../layout-box/index.js";
25
25
  import { d as debounce } from "../function-UmbPrOHm.js";
26
+ var _layoutBox, _planes, _tickListener;
27
+ const _En3Clip = class _En3Clip {
28
+ constructor(material, elementOrSelector) {
29
+ __privateAdd(this, _layoutBox, null);
30
+ __privateAdd(this, _planes, []);
31
+ __privateAdd(this, _tickListener, /* @__PURE__ */ __name(() => {
32
+ const scrollValueX = __privateGet(this, _layoutBox).position.x - __privateGet(this, _layoutBox).left, scrollValueY = __privateGet(this, _layoutBox).position.y - __privateGet(this, _layoutBox).top;
33
+ __privateGet(this, _planes)[0].constant = __privateGet(this, _layoutBox).scale.y / 2 + scrollValueY * -1, __privateGet(this, _planes)[1].constant = __privateGet(this, _layoutBox).scale.y / 2 + scrollValueY, __privateGet(this, _planes)[2].constant = __privateGet(this, _layoutBox).scale.x / 2 + scrollValueX, __privateGet(this, _planes)[3].constant = __privateGet(this, _layoutBox).scale.x / 2 + scrollValueX * -1;
34
+ }, "#tickListener"));
35
+ __privateSet(this, _layoutBox, new LayoutBox(elementOrSelector, { cartesian: !1 })), __privateSet(this, _planes, [
36
+ new Plane(new Vector3(0, -1, 0)),
37
+ new Plane(new Vector3(0, 1, 0)),
38
+ new Plane(new Vector3(-1, 0, 0)),
39
+ new Plane(new Vector3(1, 0, 0))
40
+ ]), material.clippingPlanes = __privateGet(this, _planes), ticker.subscribe(__privateGet(this, _tickListener), { order: TICK_ORDER.LAYOUT_BOX });
41
+ }
42
+ get planes() {
43
+ return __privateGet(this, _planes);
44
+ }
45
+ get layoutBox() {
46
+ return __privateGet(this, _layoutBox);
47
+ }
48
+ destroy() {
49
+ ticker.unsubscribe(__privateGet(this, _tickListener)), __privateGet(this, _layoutBox).destroy();
50
+ }
51
+ };
52
+ _layoutBox = new WeakMap(), _planes = new WeakMap(), _tickListener = new WeakMap(), __name(_En3Clip, "En3Clip");
53
+ let En3Clip = _En3Clip;
26
54
  function dispose(object3d) {
27
55
  const cleanMaterial = /* @__PURE__ */ __name((material) => {
28
56
  material.dispose();
@@ -117,10 +145,20 @@ const _En3View = class _En3View {
117
145
  cartesian: !0,
118
146
  scrollStep: !this.isClipped
119
147
  }));
120
- return box.bindObject(object), object.userData.box = box, __privateGet(this, _attachedObjects).push(object), object;
148
+ if (box.bindObject(object), object.userData.box = box, options != null && options.clip && "material" in object) {
149
+ const clip = new En3Clip(object.material, element);
150
+ object.userData.clip = clip;
151
+ }
152
+ return __privateGet(this, _attachedObjects).push(object), object;
121
153
  }
122
154
  detachFromHTMLElement(object) {
123
- __privateSet(this, _attachedObjects, __privateGet(this, _attachedObjects).filter((o) => o === object ? (object.userData.box.destroy(), !1) : !0));
155
+ __privateSet(this, _attachedObjects, __privateGet(this, _attachedObjects).filter((o) => {
156
+ if (o === object) {
157
+ const { box, clip } = object.userData;
158
+ return box.destroy(), clip == null || clip.destroy(), !1;
159
+ }
160
+ return !0;
161
+ }));
124
162
  }
125
163
  add(...args) {
126
164
  const object = args[0], element = args[1], options = args[2];
@@ -132,7 +170,7 @@ const _En3View = class _En3View {
132
170
  };
133
171
  _en3 = new WeakMap(), _name = new WeakMap(), _camera = new WeakMap(), _scene = new WeakMap(), _attachedObjects = new WeakMap(), _cameraDistance = new WeakMap(), _cameraFov = new WeakMap(), _sizeElement = new WeakMap(), _box = new WeakMap(), _debouncedResize = new WeakMap(), __name(_En3View, "En3View");
134
172
  let En3View = _En3View;
135
- var _CDNVersion, _containerElement, _webglRenderer, _views, _width, _height, _pixelRatio, _maxPixelRatio, _isCreated, _composer, _resizeListener, _tickListener;
173
+ var _CDNVersion, _containerElement, _webglRenderer, _views, _width, _height, _pixelRatio, _maxPixelRatio, _isCreated, _composer, _resizeListener, _tickListener2;
136
174
  const _En3 = class _En3 {
137
175
  constructor() {
138
176
  __privateAdd(this, _CDNVersion, `https://unpkg.com/three@0.${REVISION}.x`);
@@ -148,7 +186,7 @@ const _En3 = class _En3 {
148
186
  __privateAdd(this, _resizeListener, /* @__PURE__ */ __name((e) => {
149
187
  e instanceof CustomEvent || (__privateSet(this, _width, __privateGet(this, _containerElement).clientWidth), __privateSet(this, _height, __privateGet(this, _containerElement).clientHeight), __privateSet(this, _pixelRatio, Math.min(__privateGet(this, _maxPixelRatio), devicePixelRatio || 1)), __privateGet(this, _webglRenderer).setPixelRatio(__privateGet(this, _pixelRatio)), __privateGet(this, _webglRenderer).setSize(__privateGet(this, _width), __privateGet(this, _height)), __privateGet(this, _composer) && (__privateGet(this, _composer).setPixelRatio(__privateGet(this, _pixelRatio)), __privateGet(this, _composer).setSize(__privateGet(this, _width), __privateGet(this, _height))));
150
188
  }, "#resizeListener"));
151
- __privateAdd(this, _tickListener, /* @__PURE__ */ __name(() => {
189
+ __privateAdd(this, _tickListener2, /* @__PURE__ */ __name(() => {
152
190
  __privateGet(this, _webglRenderer).setRenderTarget(null), __privateGet(this, _views).forEach((view) => {
153
191
  this.render(view);
154
192
  });
@@ -204,14 +242,14 @@ const _En3 = class _En3 {
204
242
  }, options == null ? void 0 : options.view))
205
243
  ), options != null && options.composer && (__privateSet(this, _composer, new options.composer(__privateGet(this, _webglRenderer))), this.render = () => {
206
244
  __privateGet(this, _composer).render();
207
- }), __privateSet(this, _isCreated, !0), windowResizer.subscribe(__privateGet(this, _resizeListener), RESIZE_ORDER.CANVAS), ticker.subscribe(__privateGet(this, _tickListener), {
245
+ }), __privateSet(this, _isCreated, !0), windowResizer.subscribe(__privateGet(this, _resizeListener), RESIZE_ORDER.CANVAS), ticker.subscribe(__privateGet(this, _tickListener2), {
208
246
  order: TICK_ORDER.CANVAS,
209
247
  culling: __privateGet(this, _containerElement)
210
248
  });
211
249
  }
212
250
  destroy() {
213
251
  var _a;
214
- __privateGet(this, _isCreated) && (windowResizer.unsubscribe(__privateGet(this, _resizeListener)), ticker.unsubscribe(__privateGet(this, _tickListener)), __privateGet(this, _views).forEach((view) => {
252
+ __privateGet(this, _isCreated) && (windowResizer.unsubscribe(__privateGet(this, _resizeListener)), ticker.unsubscribe(__privateGet(this, _tickListener2)), __privateGet(this, _views).forEach((view) => {
215
253
  view.destroy();
216
254
  }), __privateGet(this, _views).clear(), __privateGet(this, _webglRenderer).dispose(), __privateGet(this, _webglRenderer).domElement.remove(), __privateSet(this, _webglRenderer, null), (_a = __privateGet(this, _composer)) == null || _a.dispose(), __privateSet(this, _composer, null), __privateSet(this, _isCreated, !1));
217
255
  }
@@ -240,7 +278,7 @@ const _En3 = class _En3 {
240
278
  (_a = view.beforeRenderCallback) == null || _a.call(view), __privateGet(this, _webglRenderer).render(view.scene, view.camera);
241
279
  }
242
280
  };
243
- _CDNVersion = new WeakMap(), _containerElement = new WeakMap(), _webglRenderer = new WeakMap(), _views = new WeakMap(), _width = new WeakMap(), _height = new WeakMap(), _pixelRatio = new WeakMap(), _maxPixelRatio = new WeakMap(), _isCreated = new WeakMap(), _composer = new WeakMap(), _resizeListener = new WeakMap(), _tickListener = new WeakMap(), __name(_En3, "En3");
281
+ _CDNVersion = new WeakMap(), _containerElement = new WeakMap(), _webglRenderer = new WeakMap(), _views = new WeakMap(), _width = new WeakMap(), _height = new WeakMap(), _pixelRatio = new WeakMap(), _maxPixelRatio = new WeakMap(), _isCreated = new WeakMap(), _composer = new WeakMap(), _resizeListener = new WeakMap(), _tickListener2 = new WeakMap(), __name(_En3, "En3");
244
282
  let En3 = _En3;
245
283
  function coverTexture(texture, planeSize, aspect) {
246
284
  const width = planeSize.x, height = planeSize.y, _aspect = aspect || texture.image.width / texture.image.height;
@@ -281,6 +319,7 @@ function traverseMeshes(object, callback) {
281
319
  __name(traverseMeshes, "traverseMeshes");
282
320
  export {
283
321
  En3,
322
+ En3Clip,
284
323
  En3View,
285
324
  coverTexture,
286
325
  dispose,
@@ -0,0 +1,10 @@
1
+ import { LayoutBox } from '../../layout-box';
2
+ import { ElementOrSelector } from '../../utils';
3
+ import { Material, Plane } from 'three';
4
+ export declare class En3Clip {
5
+ #private;
6
+ constructor(material: Material, elementOrSelector: ElementOrSelector<HTMLElement>);
7
+ get planes(): Plane[];
8
+ get layoutBox(): LayoutBox;
9
+ destroy(): void;
10
+ }
@@ -1 +1 @@
1
- "use strict";var __defProp=Object.defineProperty;var __getOwnPropSymbols=Object.getOwnPropertySymbols,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__reflectGet=Reflect.get;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);var __superGet=(cls,obj,key)=>__reflectGet(__getProtoOf(cls),key,obj);var __async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Store=require("../Store-DZnOrofs.cjs"),intersector_index=require("../index-DZ44osDT.cjs"),easings=require("../easings-BWq0pPLq.cjs"),element=require("../element-CqD0jqBJ.cjs"),events=require("../events-UlGk63iC.cjs"),_function=require("../function-H4b_gTg6.cjs"),layout=require("../layout-CnGLl7oe.cjs"),math=require("../math-C-knY2TL.cjs"),number=require("../number-Bu4sGvW7.cjs"),stylesheet$1=require("../stylesheet-xM7sMeuo.cjs"),order_index=require("../order/index.cjs"),Damped=require("../Damped-BHm2IuyN.cjs"),Tweened=require("../Tweened-3UYSwrvs.cjs"),DragControls=require("../DragControls-XC4E7seK.cjs"),cssProperty_index=require("../css-property/index.cjs"),cssUnitParser_index=require("../css-unit-parser/index.cjs"),Viewport=require("../Viewport-D26fEJOk.cjs"),elementResizer_index=require("../element-resizer/index.cjs"),scrollEntries_index=require("../scroll-entries/index.cjs"),windowResizer_index=require("../window-resizer/index.cjs");require("construct-style-sheets-polyfill");const gestures=require("../gestures-DtYbQr49.cjs"),dom=require("../dom-B40i6NXw.cjs");var _element,_index,_scrollElement,_width,_height,_size,_position,_currentMark,_transformPosition,_ScrollSection_instances,setVar_fn;const _ScrollSection=class _ScrollSection{constructor(element2,index,scrollElement){__privateAdd(this,_ScrollSection_instances);__privateAdd(this,_element);__privateAdd(this,_index);__privateAdd(this,_scrollElement);__privateAdd(this,_width,0);__privateAdd(this,_height,0);__privateAdd(this,_size,0);__privateAdd(this,_position,0);__privateAdd(this,_currentMark,null);__privateAdd(this,_transformPosition,0);__privateSet(this,_element,element2),__privateSet(this,_index,index),__privateSet(this,_scrollElement,scrollElement),scrollEntries_index.scrollEntries.register(__privateGet(this,_element)),this.setIndex(__privateGet(this,_index))}get element(){return __privateGet(this,_element)}get index(){return __privateGet(this,_index)}get size(){return __privateGet(this,_size)}get width(){return __privateGet(this,_width)}get height(){return __privateGet(this,_height)}get position(){return __privateGet(this,_position)}get transformPosition(){return __privateGet(this,_transformPosition)}destroy(){scrollEntries_index.scrollEntries.unregister(__privateGet(this,_element)),this.unsetTransform()}unsetTransform(){__privateGet(this,_element).style.transform="",this.setMark(null),this.setIndex(null),this.setCurrentIndex(null),this.setCurrentIndexArc(null),this.setCurrentIndexArcAbs(null),this.setOffsetIndex(null),this.setMiddle(!1),this.setSize()}setSize(value){value?(__privateGet(this,_element).style.setProperty("--size",value+"px"),__privateGet(this,_scrollElement).axisCSSProperty.current==="x"?(__privateGet(this,_element).style.width=value+"px",__privateGet(this,_element).style.height=""):(__privateGet(this,_element).style.height=value+"px",__privateGet(this,_element).style.width="")):(__privateGet(this,_element).style.width="",__privateGet(this,_element).style.height="",__privateGet(this,_element).style.removeProperty("--size"))}resize(){__privateSet(this,_width,__privateGet(this,_element).offsetWidth),__privateSet(this,_height,__privateGet(this,_element).offsetHeight),__privateSet(this,_size,__privateGet(this,_scrollElement).vertical?__privateGet(this,_element).offsetHeight:__privateGet(this,_element).offsetWidth),__privateSet(this,_position,__privateGet(this,_scrollElement).vertical?layout.getCumulativeOffsetTop(__privateGet(this,_element)):layout.getCumulativeOffsetLeft(__privateGet(this,_element))),__privateSet(this,_position,__privateGet(this,_position)-__privateGet(this,_scrollElement).contentPosition)}transform(){const cssOffset=__privateGet(this,_scrollElement).shiftSectionPositionCSSProperty.current;let offset=cssOffset;const distanceAddition=__privateGet(this,_scrollElement).viewportSize*__privateGet(this,_scrollElement).sectionDistanceScaleCSSProperty.current;__privateGet(this,_scrollElement).loopCSSProperty.current&&__privateGet(this,_position)+__privateGet(this,_size)<=__privateGet(this,_scrollElement).currentScrollValue-cssOffset/2&&(offset=(__privateGet(this,_scrollElement).distance-cssOffset)*-1-__privateGet(this,_scrollElement).gap),scrollEntries_index.scrollEntries.update(__privateGet(this,_element),__privateGet(this,_scrollElement).axisCSSProperty.current,offset);const valueToClamp=__privateGet(this,_scrollElement).currentScrollValue+offset,min=__privateGet(this,_position)-__privateGet(this,_scrollElement).viewportSize-distanceAddition,max=__privateGet(this,_position)+__privateGet(this,_size)+distanceAddition,value=number.preciseNumber(math.clamp(valueToClamp,min,max),3);__privateSet(this,_transformPosition,value*-1),__privateGet(this,_scrollElement).vertical?__privateGet(this,_element).style.transform=`translate3d(0px, ${__privateGet(this,_transformPosition)}px, 0px)`:__privateGet(this,_element).style.transform=`translate3d(${__privateGet(this,_transformPosition)}px, 0px, 0px)`}setMark(mark){__privateGet(this,_currentMark)!==mark&&(__privateGet(this,_currentMark)&&__privateGet(this,_element).classList.remove(__privateGet(this,_currentMark)),mark&&__privateGet(this,_element).classList.add(mark),__privateSet(this,_currentMark,mark),events.dispatchEvent(__privateGet(this,_element),"scrollSectionMarkChange",{composed:!0,detail:{mark:__privateGet(this,_currentMark)},custom:!0}))}setMiddle(bool){__privateGet(this,_element).classList.toggle("middle",bool)}setIndex(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"index",value)}setCurrentIndex(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"current-index",value)}setCurrentIndexArc(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"current-index-arc",value)}setOffsetIndex(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"offset-index",value)}setCurrentIndexArcAbs(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"current-index-arc-abs",value)}};_element=new WeakMap,_index=new WeakMap,_scrollElement=new WeakMap,_width=new WeakMap,_height=new WeakMap,_size=new WeakMap,_position=new WeakMap,_currentMark=new WeakMap,_transformPosition=new WeakMap,_ScrollSection_instances=new WeakSet,setVar_fn=__name(function(name,value){value!==null?(__privateGet(this,_element).style.setProperty(`--${name}`,value.toString()),__privateGet(this,_element).setAttribute(`data-${name}`,value.toString())):(__privateGet(this,_element).style.removeProperty(`--${name}`),__privateGet(this,_element).removeAttribute(`data-${name}`))},"#setVar"),__name(_ScrollSection,"ScrollSection");let ScrollSection=_ScrollSection;const stylesheet=stylesheet$1.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"var(--content-wrapper-width, 100%)",height:"var(--content-wrapper-height, 100%)",overflow:"var(--overflow, initial)",borderRadius:"var(--border-radius, unset)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var _damped,_controlsCSSProperty,_axisCSSProperty,_reverseCSSProperty,_directionCSSProperty,_pagesCSSProperty,_splitCSSProperty,_sectionalCSSProperty,_easingCSSProperty,_durationCSSProperty,_autoSizeCSSProperty,_wheelMaxDeltaCSSProperty,_dragInertionCSSProperty,_sectionsInViewCSSProperty,_loopCSSProperty,_dampingCSSProperty,_massCSSProperty,_stiffnessCSSProperty,_mouseDragCSSProperty,_sectionDistanceScaleCSSProperty,_startSectionCSSProperty,_autoplayCSSProperty,_autoplayPauseDurationCSSProperty,_autoplayUserDirectionCSSProperty,_classesCSSProperty,_currentIndexStartOffsetCSSProperty,_currentIndexEndOffsetCSSProperty,_shiftSectionPositionCSSProperty,_focusDelayCSSProperty,_focusDurationCSSProperty,_shiftLimitCSSProperty,_disabledCSSProperty,_hibernatedCSSProperty,_contentWrapperElement,_contentElement,_slotElement,_sections,_visibleSections,_position2,_contentPosition,_viewportSize,_scrollSize,_gap,_wheelControls,_keyboardControls,_dragControls,_autoplayControls,_counter,_overscroll,_distance,_hasOverflow,_disabled,_hibernated,_focusTimeoutId,_tweenTimeoutId,_setTween,_isGrabbing,_scrollLine,_isConnected,_mutationObserver,_currentSections,_skipNextResize,_maxSectionSizeTimeoutId,_ScrollElement_instances,updateAxis_fn,split_fn,unsplit_fn,disable_fn,enable_fn,hibernate_fn,awake_fn,_resizeListener,_animatedChangeListener,clampCounter_fn,_notAutoplayControlListener,_controlsListener,processAutoplay_fn,getScrollValue_fn,updateMarks_fn,updateIndexes_fn,_updateMaxSectionsSize,getNearestSectionIndex_fn,_connectListener;const _ScrollElement=class _ScrollElement extends HTMLElement{constructor(){super();__privateAdd(this,_ScrollElement_instances);__privateAdd(this,_damped,null);__privateAdd(this,_controlsCSSProperty,new cssProperty_index.CSSProperty(this,"--controls",!0));__privateAdd(this,_axisCSSProperty,new cssProperty_index.CSSProperty(this,"--axis","y"));__privateAdd(this,_reverseCSSProperty,new cssProperty_index.CSSProperty(this,"--reverse",!1));__privateAdd(this,_directionCSSProperty,new cssProperty_index.CSSProperty(this,"--direction",0));__privateAdd(this,_pagesCSSProperty,new cssProperty_index.CSSProperty(this,"--pages",0,{validate:__name(v=>Math.max(0,v-1),"validate")}));__privateAdd(this,_splitCSSProperty,new cssProperty_index.CSSProperty(this,"--split",!1));__privateAdd(this,_sectionalCSSProperty,new cssProperty_index.CSSProperty(this,"--sectional",!1));__privateAdd(this,_easingCSSProperty,new cssProperty_index.CSSProperty(this,"--tween-easing",!1));__privateAdd(this,_durationCSSProperty,new cssProperty_index.CSSProperty(this,"--tween-duration",!1));__privateAdd(this,_autoSizeCSSProperty,new cssProperty_index.CSSProperty(this,"--auto-size",!1));__privateAdd(this,_wheelMaxDeltaCSSProperty,new cssProperty_index.CSSProperty(this,"--wheel-max-delta",!1));__privateAdd(this,_dragInertionCSSProperty,new cssProperty_index.CSSProperty(this,"--drag-inertion",1));__privateAdd(this,_sectionsInViewCSSProperty,new cssProperty_index.CSSProperty(this,"--sections-in-view",1));__privateAdd(this,_loopCSSProperty,new cssProperty_index.CSSProperty(this,"--loop",!1));__privateAdd(this,_dampingCSSProperty,new cssProperty_index.CSSProperty(this,"--damping",20));__privateAdd(this,_massCSSProperty,new cssProperty_index.CSSProperty(this,"--mass",0));__privateAdd(this,_stiffnessCSSProperty,new cssProperty_index.CSSProperty(this,"--stiffness",0));__privateAdd(this,_mouseDragCSSProperty,new cssProperty_index.CSSProperty(this,"--mouse-drag",!1));__privateAdd(this,_sectionDistanceScaleCSSProperty,new cssProperty_index.CSSProperty(this,"--section-distance-scale",.5));__privateAdd(this,_startSectionCSSProperty,new cssProperty_index.CSSProperty(this,"--start-section",0));__privateAdd(this,_autoplayCSSProperty,new cssProperty_index.CSSProperty(this,"--autoplay",0));__privateAdd(this,_autoplayPauseDurationCSSProperty,new cssProperty_index.CSSProperty(this,"--autoplay-pause-duration",0));__privateAdd(this,_autoplayUserDirectionCSSProperty,new cssProperty_index.CSSProperty(this,"--autoplay-user-direction",!1));__privateAdd(this,_classesCSSProperty,new cssProperty_index.CSSProperty(this,"--classes",!1));__privateAdd(this,_currentIndexStartOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--current-index-start-offset",0));__privateAdd(this,_currentIndexEndOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--current-index-end-offset",0));__privateAdd(this,_shiftSectionPositionCSSProperty,new cssProperty_index.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));__privateAdd(this,_focusDelayCSSProperty,new cssProperty_index.CSSProperty(this,"--focus-delay",0));__privateAdd(this,_focusDurationCSSProperty,new cssProperty_index.CSSProperty(this,"--focus-duration",3e3));__privateAdd(this,_shiftLimitCSSProperty,new cssProperty_index.CSSProperty(this,"--shift-limit",0));__privateAdd(this,_disabledCSSProperty,new cssProperty_index.CSSProperty(this,"--disabled",!1));__privateAdd(this,_hibernatedCSSProperty,new cssProperty_index.CSSProperty(this,"--hibernate",!1));__privateAdd(this,_contentWrapperElement,null);__privateAdd(this,_contentElement,null);__privateAdd(this,_slotElement,null);__privateAdd(this,_sections,[]);__privateAdd(this,_visibleSections,[]);__privateAdd(this,_position2,0);__privateAdd(this,_contentPosition,0);__privateAdd(this,_viewportSize,0);__privateAdd(this,_scrollSize,0);__privateAdd(this,_gap,0);__privateAdd(this,_wheelControls,null);__privateAdd(this,_keyboardControls,null);__privateAdd(this,_dragControls,null);__privateAdd(this,_autoplayControls,null);__privateAdd(this,_counter,new Store.Store(0));__privateAdd(this,_overscroll,0);__privateAdd(this,_distance,0);__privateAdd(this,_hasOverflow,!1);__privateAdd(this,_disabled,!0);__privateAdd(this,_hibernated,!0);__privateAdd(this,_focusTimeoutId);__privateAdd(this,_tweenTimeoutId);__privateAdd(this,_setTween,new Tweened.Tweened);__privateAdd(this,_isGrabbing,!1);__privateAdd(this,_scrollLine,null);__privateAdd(this,_isConnected,!1);__privateAdd(this,_mutationObserver,null);__privateAdd(this,_currentSections,[]);__privateAdd(this,_skipNextResize,!1);__privateAdd(this,_maxSectionSizeTimeoutId);__privateAdd(this,_resizeListener,__name(e=>{if(e&&__privateGet(this,_skipNextResize)){__privateSet(this,_skipNextResize,!1);return}this.resize()},"#resizeListener"));__privateAdd(this,_animatedChangeListener,__name(()=>{if(!__privateGet(this,_hasOverflow)||__privateGet(this,_hibernated)||__privateGet(this,_disabled))return;const currentScrollValue=this.currentScrollValue;if(__privateSet(this,_overscroll,Math.max(0,currentScrollValue-__privateGet(this,_scrollSize))),__privateGet(this,_visibleSections).length){for(let i=0;i<__privateGet(this,_sections).length;i++)__privateGet(this,_sections)[i].transform();(__privateGet(this,_isGrabbing)||!__privateGet(this,_sectionalCSSProperty).current)&&(__privateGet(this,_counter).current=__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this))}else this.vertical?__privateGet(this,_contentElement).style.transform=`translate3d(0px, ${currentScrollValue*-1}px, 0px)`:__privateGet(this,_contentElement).style.transform=`translate3d(${currentScrollValue*-1}px, 0px, 0px)`;__privateMethod(this,_ScrollElement_instances,updateIndexes_fn).call(this),scrollEntries_index.scrollEntries.update(this,__privateGet(this,_axisCSSProperty).current,currentScrollValue)},"#animatedChangeListener"));__privateAdd(this,_notAutoplayControlListener,__name((type,value)=>{__privateGet(this,_controlsCSSProperty).current&&(__privateMethod(this,_ScrollElement_instances,processAutoplay_fn).call(this,Math.sign(value)||1),__privateGet(this,_controlsListener).call(this,type,value))},"#notAutoplayControlListener"));__privateAdd(this,_controlsListener,__name((type,value)=>{if(!__privateGet(this,_tweenTimeoutId)){if(__privateGet(this,_directionCSSProperty).current){if(__privateGet(this,_directionCSSProperty).current<0&&value>0)return;if(__privateGet(this,_directionCSSProperty).current>0&&value<0)return}if(!__privateGet(this,_autoplayCSSProperty).current&&__privateGet(this,_focusDelayCSSProperty).current&&(clearInterval(__privateGet(this,_focusTimeoutId)),__privateSet(this,_focusTimeoutId,setTimeout(()=>{const section=__privateGet(this,_visibleSections)[__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this)];section&&this.scrollToSection(section.index,{tween:{duration:__privateGet(this,_focusDurationCSSProperty).current,easing:easings.easeInOutExpo}})},__privateGet(this,_focusDelayCSSProperty).current))),!(type.includes("drag")&&!Viewport.device.isTouch&&!__privateGet(this,_mouseDragCSSProperty).current)){if(__privateGet(this,_sectionalCSSProperty).current&&type!=="drag"){const direction=Math.sign(value);__privateGet(this,_visibleSections).length?__privateGet(this,_isGrabbing)?this.scrollToSection(__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this,!0)):this.shiftSections(direction,{tween:__privateGet(this,_easingCSSProperty).current||__privateGet(this,_durationCSSProperty).current?{easing:__privateGet(this,_easingCSSProperty).current||"easeInOutCubic",duration:__privateGet(this,_durationCSSProperty).current||500}:void 0}):__privateGet(this,_damped).shift(direction*__privateGet(this,_viewportSize))}else __privateGet(this,_damped).shift(value);__privateSet(this,_isGrabbing,type==="drag")}}},"#controlsListener"));__privateAdd(this,_updateMaxSectionsSize,_function.debounce(()=>{const maxSectionSize=__privateGet(this,_currentSections).reduce((p,c)=>{const s=this.vertical?c.width:c.height;return s>p?s:p},0);clearTimeout(__privateGet(this,_maxSectionSizeTimeoutId)),__privateSet(this,_skipNextResize,!0),this.style.setProperty("--max-section-size",""),__privateSet(this,_maxSectionSizeTimeoutId,setTimeout(()=>{__privateSet(this,_skipNextResize,!0),this.style.setProperty("--max-section-size",maxSectionSize+"px")},10))},20));__privateAdd(this,_connectListener,__name(()=>{__privateSet(this,_isConnected,!0),this.hibernatedCSSProperty.current||__privateMethod(this,_ScrollElement_instances,awake_fn).call(this),elementResizer_index.elementResizer.subscribe(this,__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_connectListener))},"#connectListener"));if(intersector_index.isBrowser){const shadow=this.attachShadow({mode:"open"});shadow.adoptedStyleSheets=[stylesheet];const staticElement=document.createElement("div");staticElement.className="static",staticElement.innerHTML='<slot name="static"></slot>',shadow.appendChild(staticElement),__privateSet(this,_contentWrapperElement,document.createElement("div")),__privateGet(this,_contentWrapperElement).className="content-wrapper",__privateSet(this,_contentElement,document.createElement("div")),__privateGet(this,_contentElement).className="content",__privateSet(this,_slotElement,document.createElement("slot")),__privateGet(this,_contentElement).appendChild(__privateGet(this,_slotElement)),__privateGet(this,_contentWrapperElement).appendChild(__privateGet(this,_contentElement)),shadow.appendChild(__privateGet(this,_contentWrapperElement)),__privateSet(this,_mutationObserver,new MutationObserver(_function.debounce(()=>{this.tryResplit()},10)))}}get damped(){return __privateGet(this,_damped)}get controlsCSSProperty(){return __privateGet(this,_controlsCSSProperty)}get axisCSSProperty(){return __privateGet(this,_axisCSSProperty)}get reverseCSSProperty(){return __privateGet(this,_reverseCSSProperty)}get directionCSSProperty(){return __privateGet(this,_directionCSSProperty)}get pagesCSSProperty(){return __privateGet(this,_pagesCSSProperty)}get splitCSSProperty(){return __privateGet(this,_splitCSSProperty)}get sectionalCSSProperty(){return __privateGet(this,_sectionalCSSProperty)}get easingCSSProperty(){return __privateGet(this,_easingCSSProperty)}get durationCSSProperty(){return __privateGet(this,_durationCSSProperty)}get autoSizeCSSProperty(){return __privateGet(this,_autoSizeCSSProperty)}get wheelMaxDeltaCSSProperty(){return __privateGet(this,_wheelMaxDeltaCSSProperty)}get dragInertionCSSProperty(){return __privateGet(this,_dragInertionCSSProperty)}get sectionsInViewCSSProperty(){return __privateGet(this,_sectionsInViewCSSProperty)}get loopCSSProperty(){return __privateGet(this,_loopCSSProperty)}get dampingCSSProperty(){return __privateGet(this,_dampingCSSProperty)}get massCSSProperty(){return __privateGet(this,_massCSSProperty)}get stiffnessCSSProperty(){return __privateGet(this,_stiffnessCSSProperty)}get mouseDragCSSProperty(){return __privateGet(this,_mouseDragCSSProperty)}get sectionDistanceScaleCSSProperty(){return __privateGet(this,_sectionDistanceScaleCSSProperty)}get startSectionCSSProperty(){return __privateGet(this,_startSectionCSSProperty)}get autoplayCSSProperty(){return __privateGet(this,_autoplayCSSProperty)}get autoplayPauseDurationCSSProperty(){return __privateGet(this,_autoplayPauseDurationCSSProperty)}get autoplayUserDirectionCSSProperty(){return __privateGet(this,_autoplayUserDirectionCSSProperty)}get classesCSSProperty(){return __privateGet(this,_classesCSSProperty)}get currentIndexStartOffsetCSSProperty(){return __privateGet(this,_currentIndexStartOffsetCSSProperty)}get currentIndexEndOffsetCSSProperty(){return __privateGet(this,_currentIndexEndOffsetCSSProperty)}get shiftSectionPositionCSSProperty(){return __privateGet(this,_shiftSectionPositionCSSProperty)}get focusDelayCSSProperty(){return __privateGet(this,_focusDelayCSSProperty)}get focusDurationCSSProperty(){return __privateGet(this,_focusDurationCSSProperty)}get shiftLimitCSSProperty(){return __privateGet(this,_shiftLimitCSSProperty)}get disabledCSSProperty(){return __privateGet(this,_disabledCSSProperty)}get hibernatedCSSProperty(){return __privateGet(this,_hibernatedCSSProperty)}get currentScrollValue(){return __privateMethod(this,_ScrollElement_instances,getScrollValue_fn).call(this,"current")}get targetScrollValue(){return __privateMethod(this,_ScrollElement_instances,getScrollValue_fn).call(this,"target")}get contentWrapperElement(){return __privateGet(this,_contentWrapperElement)}get contentElement(){return __privateGet(this,_contentElement)}get sections(){return __privateGet(this,_sections)}get visibleSections(){return __privateGet(this,_visibleSections)}get position(){return __privateGet(this,_position2)}get contentPosition(){return __privateGet(this,_contentPosition)}get viewportSize(){return __privateGet(this,_viewportSize)}get scrollSize(){return __privateGet(this,_scrollSize)}get gap(){return __privateGet(this,_gap)}get counter(){return __privateGet(this,_counter)}get limit(){return Math.ceil(__privateGet(this,_visibleSections).length-__privateGet(this,_sectionsInViewCSSProperty).current+__privateGet(this,_shiftLimitCSSProperty).current)}get distance(){return __privateGet(this,_distance)}get loopDistance(){return __privateGet(this,_loopCSSProperty).current?__privateGet(this,_distance)+__privateGet(this,_gap):__privateGet(this,_distance)}get hasOverflow(){return __privateGet(this,_hasOverflow)}get overscroll(){return __privateGet(this,_overscroll)}get scrollLine(){return __privateGet(this,_scrollLine)}get vertical(){return __privateGet(this,_axisCSSProperty).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return __privateGet(this,_axisCSSProperty).current==="y"?0:__privateGet(this,_damped).distance}get scrollHeight(){return __privateGet(this,_axisCSSProperty).current==="x"?0:__privateGet(this,_damped).distance}tryResplit(){!__privateGet(this,_hibernated)&&(__privateGet(this,_loopCSSProperty).current||__privateGet(this,_splitCSSProperty).current||__privateGet(this,_loopCSSProperty).current||__privateGet(this,_autoSizeCSSProperty).current||__privateGet(this,_sectionalCSSProperty).current)&&__privateMethod(this,_ScrollElement_instances,split_fn).call(this)}onScroll(...parameters){return __privateGet(this,_damped).subscribe(...parameters)}offScroll(...parameters){__privateGet(this,_damped).unsubscribe(...parameters)}range(from,distance,margin=0){const start=from-margin,end=start+distance+margin*2;return this.currentProgress<start?0:this.currentProgress>end?1:(this.currentProgress-start)/(end-start)}curve(from,distance,margin=0){return Math.sin(this.range(from,distance,margin)*Math.PI)}visible(from,distance,margin=0){const start=from-margin,end=start+distance+margin*2;return this.currentProgress>=start&&this.currentProgress<=end}scrollToSection(sectionIndex,options){if(!__privateGet(this,_visibleSections).length||__privateGet(this,_hibernated)||__privateGet(this,_tweenTimeoutId))return;const previousCounter=__privateGet(this,_counter).current,newCounterValue=__privateMethod(this,_ScrollElement_instances,clampCounter_fn).call(this,sectionIndex);__privateGet(this,_isGrabbing)||(__privateGet(this,_counter).current=newCounterValue);const previousSection=__privateGet(this,_visibleSections)[previousCounter],currentSection=__privateGet(this,_visibleSections)[newCounterValue];if(console.log(newCounterValue),previousSection&&currentSection){let shiftValue=0;const nearestSectionIndex=__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this),nearestSection=__privateGet(this,_visibleSections)[nearestSectionIndex];let scrolledFromNearestSection=nearestSection?this.targetScrollValue-nearestSection.position:0;__privateGet(this,_loopCSSProperty).current?newCounterValue===0&&previousCounter===__privateGet(this,_visibleSections).length-1?(shiftValue=__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize)-previousSection.position+__privateGet(this,_gap),__privateGet(this,_isGrabbing)||(scrolledFromNearestSection=0)):newCounterValue===__privateGet(this,_visibleSections).length-1&&previousCounter===0?shiftValue=currentSection.position-(__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize)+__privateGet(this,_gap)):shiftValue=currentSection.position-previousSection.position:shiftValue=currentSection.position-previousSection.position,this.shiftPosition(shiftValue-scrolledFromNearestSection,options)}}shiftSections(step,options){__privateGet(this,_visibleSections).length&&this.scrollToSection(__privateGet(this,_counter).current+step,options)}setPosition(value,options){__privateGet(this,_hibernated)||(__privateMethod(this,_ScrollElement_instances,processAutoplay_fn).call(this,Math.sign(value)||1),options!=null&&options.tween?(clearTimeout(__privateGet(this,_tweenTimeoutId)),__privateGet(this,_setTween).set(__privateGet(this,_damped).current,{equalize:!0}),__privateGet(this,_setTween).set(value,__spreadValues({},options.tween)),__privateSet(this,_tweenTimeoutId,setTimeout(()=>{__privateSet(this,_tweenTimeoutId,void 0)},options.tween.duration||0))):__privateGet(this,_damped).set(value,{equalize:(options==null?void 0:options.behaviour)==="instant"}))}shiftPosition(value,options){this.setPosition(__privateGet(this,_damped).target+value,options)}resize(){if(__privateGet(this,_hibernatedCSSProperty).current)return;__privateSet(this,_visibleSections,__privateGet(this,_sections).filter(s=>element.isElementVisible(s.element))),this.style.setProperty("--sections",__privateGet(this,_visibleSections).length.toString()),__privateGet(this,_damped).unlistenAnimationFrame();const prevProgress=this.currentScrollValue/__privateGet(this,_scrollSize)||0,prevCounter=__privateGet(this,_counter).current;if(__privateSet(this,_position2,this.vertical?layout.getCumulativeOffsetTop(this):layout.getCumulativeOffsetLeft(this)),__privateSet(this,_contentPosition,this.vertical?layout.getCumulativeOffsetTop(__privateGet(this,_contentElement)):layout.getCumulativeOffsetLeft(__privateGet(this,_contentElement))),__privateSet(this,_viewportSize,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?__privateSet(this,_gap,cssUnitParser_index.cssUnitParser.parse(getComputedStyle(__privateGet(this,_contentElement)).rowGap)):__privateSet(this,_gap,cssUnitParser_index.cssUnitParser.parse(getComputedStyle(__privateGet(this,_contentElement)).columnGap)),__privateGet(this,_autoSizeCSSProperty).current&&__privateGet(this,_visibleSections).length){const ivc=__privateGet(this,_sectionsInViewCSSProperty).current,sectionSize=(__privateGet(this,_viewportSize)-__privateGet(this,_gap)*(ivc-1))/ivc;__privateGet(this,_visibleSections).forEach(section=>{section.setSize(sectionSize)})}else __privateGet(this,_visibleSections).forEach(section=>{section.setSize()});if(__privateGet(this,_visibleSections).forEach(section=>{section.resize()}),__privateGet(this,_pagesCSSProperty).current){__privateSet(this,_scrollSize,__privateGet(this,_viewportSize)*__privateGet(this,_pagesCSSProperty).current);const contentSize=__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize);this.vertical?(__privateGet(this,_contentElement).style.width=contentSize+"px",__privateGet(this,_contentElement).style.height="100%"):(__privateGet(this,_contentElement).style.height=contentSize+"px",__privateGet(this,_contentElement).style.width="100%")}else this.vertical?(__privateGet(this,_contentElement).style.width="100%",__privateGet(this,_contentElement).style.height="max-content",__privateSet(this,_scrollSize,__privateGet(this,_contentElement).offsetHeight-__privateGet(this,_viewportSize))):(__privateGet(this,_contentElement).style.width="max-content",__privateGet(this,_contentElement).style.height="100%",__privateSet(this,_scrollSize,__privateGet(this,_contentElement).offsetWidth-__privateGet(this,_viewportSize)));if(!__privateGet(this,_loopCSSProperty).current){const cs=getComputedStyle(this),padding=this.vertical?parseFloat(cs.paddingBlockStart)+parseFloat(cs.paddingBlockEnd):parseFloat(cs.paddingInlineStart)+parseFloat(cs.paddingInlineEnd);__privateSet(this,_scrollSize,__privateGet(this,_scrollSize)+padding),__privateGet(this,_damped).max=__privateGet(this,_scrollSize)}if(__privateGet(this,_loopCSSProperty).current&&__privateGet(this,_visibleSections).length){const lastSection=__privateGet(this,_visibleSections)[__privateGet(this,_visibleSections).length-1],lastSectionMax=lastSection.position+lastSection.size-__privateGet(this,_viewportSize),lastSectionMargin=__privateGet(this,_scrollSize)-lastSectionMax;__privateSet(this,_distance,lastSection.position+lastSection.size+lastSectionMargin)}else __privateSet(this,_distance,__privateGet(this,_scrollSize));if(__privateGet(this,_sectionalCSSProperty).current&&__privateGet(this,_visibleSections).length){const section=__privateGet(this,_visibleSections)[prevCounter];__privateGet(this,_damped).set(section.position,{equalize:!0})}else __privateGet(this,_damped).set(prevProgress*__privateGet(this,_scrollSize),{equalize:!0});__privateSet(this,_hasOverflow,(this.vertical?__privateGet(this,_contentElement).offsetHeight:__privateGet(this,_contentElement).offsetWidth)>__privateGet(this,_viewportSize)),this.classList.toggle("has-overflow",__privateGet(this,_hasOverflow)),__privateGet(this,_hasOverflow)?__privateGet(this,_disabledCSSProperty).current||__privateMethod(this,_ScrollElement_instances,enable_fn).call(this):__privateMethod(this,_ScrollElement_instances,disable_fn).call(this),__privateGet(this,_updateMaxSectionsSize).call(this),events.dispatchEvent(this,"scrollResize",{custom:!0}),__privateGet(this,_damped).notify()}connectedCallback(){scrollEntries_index.scrollEntries.register(this),__privateSet(this,_damped,new Damped.Damped(0,{damping:.01,min:0,order:order_index.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),__privateSet(this,_wheelControls,new DragControls.WheelControls({element:__privateGet(this,_contentElement)})),__privateGet(this,_wheelControls).changeEvent.subscribe(__privateGet(this,_notAutoplayControlListener)),__privateSet(this,_keyboardControls,new DragControls.KeyboardControls({element:this})),__privateGet(this,_keyboardControls).changeEvent.subscribe(__privateGet(this,_notAutoplayControlListener)),__privateSet(this,_dragControls,new DragControls.DragControls({element:__privateGet(this,_contentElement),rootElement:this})),__privateGet(this,_dragControls).changeEvent.subscribe(__privateGet(this,_notAutoplayControlListener)),__privateSet(this,_autoplayControls,new DragControls.AutoplayControls({culling:this})),__privateGet(this,_autoplayControls).changeEvent.subscribe(__privateGet(this,_controlsListener)),__privateGet(this,_axisCSSProperty).subscribe(()=>{__privateMethod(this,_ScrollElement_instances,updateAxis_fn).call(this)}),__privateGet(this,_reverseCSSProperty).subscribe(()=>{__privateMethod(this,_ScrollElement_instances,updateAxis_fn).call(this)}),__privateGet(this,_wheelMaxDeltaCSSProperty).subscribe(e=>{__privateGet(this,_wheelControls).axis=e.current?"max":__privateGet(this,_axisCSSProperty).current}),__privateGet(this,_dragInertionCSSProperty).subscribe(e=>{__privateGet(this,_dragControls).inertion=typeof e.current=="number"?e.current:1}),__privateGet(this,_pagesCSSProperty).subscribe(()=>{__privateGet(this,_isConnected)&&__privateGet(this,_resizeListener).call(this)}),__privateGet(this,_splitCSSProperty).subscribe(({current})=>{__privateGet(this,_isConnected)&&(current?__privateMethod(this,_ScrollElement_instances,split_fn).call(this):__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this))}),__privateGet(this,_sectionalCSSProperty).subscribe(e=>{__privateGet(this,_wheelControls).debounce=e.current,__privateGet(this,_dragControls).swipe=e.current,__privateGet(this,_autoplayControls).interval=e.current,__privateGet(this,_isConnected)&&(e.current&&!e.previous&&!__privateGet(this,_visibleSections).length?__privateMethod(this,_ScrollElement_instances,split_fn).call(this):!e.current&&e.previous&&__privateGet(this,_visibleSections).length&&__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this))}),__privateGet(this,_autoSizeCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&(__privateGet(this,_resizeListener).call(this),e.current&&!e.previous&&!__privateGet(this,_visibleSections).length?__privateMethod(this,_ScrollElement_instances,split_fn).call(this):!e.current&&e.previous&&__privateGet(this,_visibleSections).length&&__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this))}),__privateGet(this,_sectionsInViewCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&(__privateGet(this,_resizeListener).call(this),__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this))}),__privateGet(this,_loopCSSProperty).subscribe(e=>{e.current?(__privateGet(this,_isConnected)&&(__privateGet(this,_visibleSections).length||(__privateGet(this,_splitCSSProperty).current=!0)),__privateGet(this,_damped).max=1/0,__privateGet(this,_damped).min=-1/0):(__privateSet(this,_overscroll,0),__privateGet(this,_damped).max=__privateGet(this,_scrollSize),__privateGet(this,_damped).min=0),this.classList.toggle("loop",!!e.current)}),__privateGet(this,_dampingCSSProperty).subscribe(e=>{__privateGet(this,_damped).damping=e.current}),__privateGet(this,_massCSSProperty).subscribe(e=>{__privateGet(this,_damped).mass=e.current}),__privateGet(this,_stiffnessCSSProperty).subscribe(e=>{__privateGet(this,_damped).stiffness=e.current}),__privateGet(this,_autoplayCSSProperty).subscribe(e=>{__privateGet(this,_autoplayControls).speed=e.current,!__privateGet(this,_disabled)&&e.current&&!e.previous?__privateGet(this,_autoplayControls).connect():!e.current&&e.previous&&__privateGet(this,_autoplayControls).disconnect()}),__privateGet(this,_autoplayUserDirectionCSSProperty).subscribe(e=>{e.current||(__privateGet(this,_autoplayControls).direction=1)}),__privateGet(this,_classesCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)}),__privateGet(this,_currentIndexStartOffsetCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateGet(this,_classesCSSProperty).current&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)}),__privateGet(this,_currentIndexEndOffsetCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateGet(this,_classesCSSProperty).current&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)}),__privateGet(this,_shiftSectionPositionCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateGet(this,_damped).notify()}),__privateGet(this,_damped).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),__privateGet(this,_counter).subscribe(e=>{__privateGet(this,_hibernated)||(__privateGet(this,_visibleSections).length&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this),this.style.setProperty("--counter",e.current+""))}),__privateGet(this,_setTween).subscribe(e=>{__privateGet(this,_setTween).isRunning.current&&__privateGet(this,_damped).set(e.current,{equalize:!0})}),__privateGet(this,_disabledCSSProperty).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),__privateMethod(this,_ScrollElement_instances,disable_fn).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),__privateMethod(this,_ScrollElement_instances,enable_fn).call(this))}),__privateGet(this,_hibernatedCSSProperty).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),__privateMethod(this,_ScrollElement_instances,hibernate_fn).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),__privateMethod(this,_ScrollElement_instances,awake_fn).call(this))}),__privateGet(this,_controlsCSSProperty).observe(),__privateGet(this,_axisCSSProperty).observe(),__privateGet(this,_reverseCSSProperty).observe(),__privateGet(this,_directionCSSProperty).observe(),__privateGet(this,_pagesCSSProperty).observe(),__privateGet(this,_splitCSSProperty).observe(),__privateGet(this,_sectionalCSSProperty).observe(),__privateGet(this,_easingCSSProperty).observe(),__privateGet(this,_durationCSSProperty).observe(),__privateGet(this,_autoSizeCSSProperty).observe(),__privateGet(this,_wheelMaxDeltaCSSProperty).observe(),__privateGet(this,_dragInertionCSSProperty).observe(),__privateGet(this,_sectionsInViewCSSProperty).observe(),__privateGet(this,_loopCSSProperty).observe(),__privateGet(this,_dampingCSSProperty).observe(),__privateGet(this,_massCSSProperty).observe(),__privateGet(this,_stiffnessCSSProperty).observe(),__privateGet(this,_mouseDragCSSProperty).observe(),__privateGet(this,_sectionDistanceScaleCSSProperty).observe(),__privateGet(this,_startSectionCSSProperty).observe(),__privateGet(this,_autoplayCSSProperty).observe(),__privateGet(this,_autoplayCSSProperty).observe(),__privateGet(this,_autoplayPauseDurationCSSProperty).observe(),__privateGet(this,_autoplayUserDirectionCSSProperty).observe(),__privateGet(this,_classesCSSProperty).observe(),__privateGet(this,_currentIndexStartOffsetCSSProperty).observe(),__privateGet(this,_currentIndexEndOffsetCSSProperty).observe(),__privateGet(this,_shiftSectionPositionCSSProperty).observe(),__privateGet(this,_focusDelayCSSProperty).observe(),__privateGet(this,_focusDurationCSSProperty).observe(),__privateGet(this,_shiftLimitCSSProperty).observe(),__privateGet(this,_disabledCSSProperty).observe(),__privateGet(this,_hibernatedCSSProperty).observe(),windowResizer_index.windowResizer.subscribe(__privateGet(this,_connectListener),order_index.RESIZE_ORDER.LAST),__privateGet(this,_mutationObserver).observe(this,{childList:!0})}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),__privateGet(this,_controlsCSSProperty).unobserve(),__privateGet(this,_axisCSSProperty).unobserve(),__privateGet(this,_reverseCSSProperty).unobserve(),__privateGet(this,_directionCSSProperty).unobserve(),__privateGet(this,_pagesCSSProperty).unobserve(),__privateGet(this,_splitCSSProperty).unobserve(),__privateGet(this,_sectionalCSSProperty).unobserve(),__privateGet(this,_easingCSSProperty).unobserve(),__privateGet(this,_durationCSSProperty).unobserve(),__privateGet(this,_autoSizeCSSProperty).unobserve(),__privateGet(this,_wheelMaxDeltaCSSProperty).unobserve(),__privateGet(this,_dragInertionCSSProperty).unobserve(),__privateGet(this,_sectionsInViewCSSProperty).unobserve(),__privateGet(this,_loopCSSProperty).unobserve(),__privateGet(this,_dampingCSSProperty).unobserve(),__privateGet(this,_massCSSProperty).unobserve(),__privateGet(this,_stiffnessCSSProperty).unobserve(),__privateGet(this,_mouseDragCSSProperty).unobserve(),__privateGet(this,_sectionDistanceScaleCSSProperty).unobserve(),__privateGet(this,_startSectionCSSProperty).unobserve(),__privateGet(this,_autoplayCSSProperty).unobserve(),__privateGet(this,_autoplayPauseDurationCSSProperty).unobserve(),__privateGet(this,_autoplayUserDirectionCSSProperty).unobserve(),__privateGet(this,_classesCSSProperty).unobserve(),__privateGet(this,_currentIndexStartOffsetCSSProperty).unobserve(),__privateGet(this,_currentIndexEndOffsetCSSProperty).unobserve(),__privateGet(this,_shiftSectionPositionCSSProperty).unobserve(),__privateGet(this,_focusDelayCSSProperty).unobserve(),__privateGet(this,_focusDurationCSSProperty).unobserve(),__privateGet(this,_shiftLimitCSSProperty).unobserve(),__privateGet(this,_disabledCSSProperty).unobserve(),__privateGet(this,_hibernatedCSSProperty).unobserve(),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_connectListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener)),__privateMethod(this,_ScrollElement_instances,hibernate_fn).call(this),__privateGet(this,_mutationObserver).disconnect()}};_damped=new WeakMap,_controlsCSSProperty=new WeakMap,_axisCSSProperty=new WeakMap,_reverseCSSProperty=new WeakMap,_directionCSSProperty=new WeakMap,_pagesCSSProperty=new WeakMap,_splitCSSProperty=new WeakMap,_sectionalCSSProperty=new WeakMap,_easingCSSProperty=new WeakMap,_durationCSSProperty=new WeakMap,_autoSizeCSSProperty=new WeakMap,_wheelMaxDeltaCSSProperty=new WeakMap,_dragInertionCSSProperty=new WeakMap,_sectionsInViewCSSProperty=new WeakMap,_loopCSSProperty=new WeakMap,_dampingCSSProperty=new WeakMap,_massCSSProperty=new WeakMap,_stiffnessCSSProperty=new WeakMap,_mouseDragCSSProperty=new WeakMap,_sectionDistanceScaleCSSProperty=new WeakMap,_startSectionCSSProperty=new WeakMap,_autoplayCSSProperty=new WeakMap,_autoplayPauseDurationCSSProperty=new WeakMap,_autoplayUserDirectionCSSProperty=new WeakMap,_classesCSSProperty=new WeakMap,_currentIndexStartOffsetCSSProperty=new WeakMap,_currentIndexEndOffsetCSSProperty=new WeakMap,_shiftSectionPositionCSSProperty=new WeakMap,_focusDelayCSSProperty=new WeakMap,_focusDurationCSSProperty=new WeakMap,_shiftLimitCSSProperty=new WeakMap,_disabledCSSProperty=new WeakMap,_hibernatedCSSProperty=new WeakMap,_contentWrapperElement=new WeakMap,_contentElement=new WeakMap,_slotElement=new WeakMap,_sections=new WeakMap,_visibleSections=new WeakMap,_position2=new WeakMap,_contentPosition=new WeakMap,_viewportSize=new WeakMap,_scrollSize=new WeakMap,_gap=new WeakMap,_wheelControls=new WeakMap,_keyboardControls=new WeakMap,_dragControls=new WeakMap,_autoplayControls=new WeakMap,_counter=new WeakMap,_overscroll=new WeakMap,_distance=new WeakMap,_hasOverflow=new WeakMap,_disabled=new WeakMap,_hibernated=new WeakMap,_focusTimeoutId=new WeakMap,_tweenTimeoutId=new WeakMap,_setTween=new WeakMap,_isGrabbing=new WeakMap,_scrollLine=new WeakMap,_isConnected=new WeakMap,_mutationObserver=new WeakMap,_currentSections=new WeakMap,_skipNextResize=new WeakMap,_maxSectionSizeTimeoutId=new WeakMap,_ScrollElement_instances=new WeakSet,updateAxis_fn=__name(function(){const axis=__privateGet(this,_axisCSSProperty).current,reverse=__privateGet(this,_reverseCSSProperty).current?"-reverse":"";__privateGet(this,_contentElement).style.flexDirection=axis==="x"?`row${reverse}`:`column${reverse}`,__privateGet(this,_wheelControls).axis=__privateGet(this,_wheelMaxDeltaCSSProperty).current?"max":axis,__privateGet(this,_keyboardControls).dimension=axis==="x"?"width":"height",__privateGet(this,_dragControls).axis=axis,axis==="x"?this.style.touchAction="pan-y":axis==="y"&&(this.style.touchAction="pan-x"),__privateGet(this,_isConnected)&&__privateGet(this,_resizeListener).call(this)},"#updateAxis"),split_fn=__name(function(){__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this),__privateGet(this,_slotElement).assignedElements().forEach((element2,i)=>{element2 instanceof HTMLElement&&element2.tagName!=="SCRIPT"&&__privateGet(this,_sections).push(new ScrollSection(element2,i,this))}),__privateSet(this,_visibleSections,[...__privateGet(this,_sections)]),__privateGet(this,_contentElement).style.transform="",events.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),__privateGet(this,_resizeListener).call(this),__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)},"#split"),unsplit_fn=__name(function(){__privateGet(this,_sections).forEach(section=>{section.destroy()}),__privateSet(this,_sections,[]),__privateSet(this,_visibleSections,[]),__privateGet(this,_counter).reset(),__privateGet(this,_damped).reset(),this.style.removeProperty("--max-section-size"),events.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},"#unsplit"),disable_fn=__name(function(){__privateGet(this,_disabled)||(__privateSet(this,_disabled,!0),__privateGet(this,_damped).unsubscribe(__privateGet(this,_animatedChangeListener)),__privateGet(this,_damped).unlistenAnimationFrame(),clearInterval(__privateGet(this,_focusTimeoutId)),clearInterval(__privateGet(this,_tweenTimeoutId)),__privateGet(this,_setTween).unlistenAnimationFrame(),__privateGet(this,_wheelControls).disconnect(),__privateGet(this,_keyboardControls).disconnect(),__privateGet(this,_dragControls).disconnect(),__privateGet(this,_autoplayControls).disconnect(),__privateGet(this,_hasOverflow)||(this.sections.forEach(section=>{section.unsetTransform()}),__privateGet(this,_resizeListener).call(this)))},"#disable"),enable_fn=__name(function(){__privateGet(this,_disabled)&&(__privateSet(this,_disabled,!1),__privateGet(this,_damped).subscribe(__privateGet(this,_animatedChangeListener),-1e4),__privateGet(this,_damped).notify(),__privateGet(this,_wheelControls).connect(),__privateGet(this,_keyboardControls).connect(),__privateGet(this,_dragControls).connect(),__privateGet(this,_autoplayCSSProperty).current&&__privateGet(this,_autoplayControls).connect())},"#enable"),hibernate_fn=__name(function(){__privateGet(this,_hibernated)||(__privateSet(this,_hibernated,!0),clearTimeout(__privateGet(this,_maxSectionSizeTimeoutId)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),__privateMethod(this,_ScrollElement_instances,disable_fn).call(this),__privateGet(this,_contentElement).style.transform="",__privateGet(this,_contentElement).style.height="",__privateGet(this,_contentElement).style.width="",this.classList.remove("has-overflow","start","end"),this.style.removeProperty("--counter"),__privateGet(this,_sections).length?__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this):(__privateGet(this,_counter).reset(),__privateGet(this,_damped).reset()),scrollEntries_index.scrollEntries.unregister(this))},"#hibernate"),awake_fn=__name(function(){__privateGet(this,_hibernated)&&(__privateSet(this,_hibernated,!1),scrollEntries_index.scrollEntries.register(this),this.tryResplit(),__privateMethod(this,_ScrollElement_instances,enable_fn).call(this),this.scrollToSection(__privateGet(this,_startSectionCSSProperty).current,{behaviour:"instant"}),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener),order_index.RESIZE_ORDER.SCROLL))},"#awake"),_resizeListener=new WeakMap,_animatedChangeListener=new WeakMap,clampCounter_fn=__name(function(value){let counter=__privateGet(this,_counter).current;return __privateGet(this,_loopCSSProperty).current?counter=number.loopNumber(value,__privateGet(this,_visibleSections).length):counter=math.clamp(value,0,this.limit),counter},"#clampCounter"),_notAutoplayControlListener=new WeakMap,_controlsListener=new WeakMap,processAutoplay_fn=__name(function(direction=1){__privateGet(this,_autoplayUserDirectionCSSProperty).current&&(__privateGet(this,_autoplayControls).direction=direction),__privateGet(this,_autoplayCSSProperty).current&&__privateGet(this,_autoplayControls).pauseAndContinue(__privateGet(this,_autoplayPauseDurationCSSProperty).current,this.sectionalCSSProperty.current)},"#processAutoplay"),getScrollValue_fn=__name(function(type="current"){if(__privateGet(this,_loopCSSProperty).current&&__privateGet(this,_visibleSections).length){const mod=Math.floor(__privateGet(this,_damped)[type])%Math.floor(__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize)+__privateGet(this,_gap));return mod<0?__privateGet(this,_scrollSize)+mod+__privateGet(this,_viewportSize)+__privateGet(this,_gap):mod}else return __privateGet(this,_damped)[type]},"#getScrollValue"),updateMarks_fn=__name(function(){if(__privateGet(this,_visibleSections).length){const counter=__privateGet(this,_counter).current+__privateGet(this,_currentIndexStartOffsetCSSProperty).current;if(counter===__privateGet(this,_currentIndexStartOffsetCSSProperty).current?__privateSet(this,_scrollLine,"start"):counter===this.limit?__privateSet(this,_scrollLine,"end"):__privateSet(this,_scrollLine,null),events.dispatchEvent(this,"scrollLine",{detail:{line:__privateGet(this,_scrollLine)}}),__privateGet(this,_classesCSSProperty).current){this.classList.remove("end","start"),__privateGet(this,_scrollLine)&&this.classList.add(__privateGet(this,_scrollLine));const sectionsInView=__privateGet(this,_sectionsInViewCSSProperty).current+__privateGet(this,_currentIndexEndOffsetCSSProperty).current;__privateSet(this,_currentSections,[]),__privateGet(this,_visibleSections).forEach((section,index)=>{section.setCurrentIndex(null),section.setCurrentIndexArc(null),section.setCurrentIndexArcAbs(null),section.setMiddle(!1);const overflow=counter-this.limit-1+__privateGet(this,_currentIndexEndOffsetCSSProperty).current,currentRange=counter+sectionsInView,vv=this.sections.length-currentRange;index>=counter&&index<currentRange||index<=overflow?(section.setMark("current"),__privateGet(this,_currentSections).push(section)):index>=currentRange&&index<currentRange+vv/2||index<=overflow+sectionsInView?section.setMark("next"):section.setMark("previous")}),__privateGet(this,_updateMaxSectionsSize).call(this)}}},"#updateMarks"),updateIndexes_fn=__name(function(){if(__privateGet(this,_classesCSSProperty).current){const middle=Math.floor(__privateGet(this,_currentSections).length/2);__privateGet(this,_currentSections).sort((a,b)=>a.element.getBoundingClientRect().left-b.element.getBoundingClientRect().left),__privateGet(this,_currentSections).forEach((section,i)=>{const arcIndex=i-middle;section.setCurrentIndex(i),section.setCurrentIndexArc(arcIndex),section.setCurrentIndexArcAbs(Math.abs(arcIndex)),section.setMiddle(i===middle)}),__privateGet(this,_visibleSections).forEach((section,i)=>{section.setOffsetIndex(i-(__privateGet(this,_counter).current+__privateGet(this,_sectionsInViewCSSProperty).current))})}},"#updateIndexes"),_updateMaxSectionsSize=new WeakMap,getNearestSectionIndex_fn=__name(function(NAMEIT=!1){let scrollValue=this.targetScrollValue,minDiff=1/0,nearestIndex=0;const dir=__privateGet(this,_damped).direction;for(let i=0;i<__privateGet(this,_visibleSections).length;i++){const section=__privateGet(this,_visibleSections)[i];let offset=__privateGet(this,_isGrabbing)?section.size*dir*-1*.4:0,position=section.position;this.overscroll&&position===0&&NAMEIT&&(position=__privateGet(this,_distance));let diff=Math.abs(position+offset-scrollValue);diff<=minDiff&&(minDiff=diff,nearestIndex=i)}return nearestIndex},"#getNearestSectionIndex"),_connectListener=new WeakMap,__name(_ScrollElement,"ScrollElement");let ScrollElement=_ScrollElement;intersector_index.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",ScrollElement);var _scrollElement2;const _ScrollUserElement=class _ScrollUserElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_scrollElement2,null)}get scrollElement(){return __privateGet(this,_scrollElement2)}connectedCallback(){const scrollElement=dom.findParentElement(this,ScrollElement);scrollElement instanceof ScrollElement?__privateSet(this,_scrollElement2,scrollElement):console.error(this,"e-scroll not found")}};_scrollElement2=new WeakMap,__name(_ScrollUserElement,"ScrollUserElement");let ScrollUserElement=_ScrollUserElement;var _slotElement2,_thumbElement,_isHorisontal,_thumbSize,_thumbScrollSize,_position3,_resizeListener2,_scrollListener,_axisListener,_grabListener;const _ScrollScrollbarElement=class _ScrollScrollbarElement extends ScrollUserElement{constructor(){super();__privateAdd(this,_slotElement2,null);__privateAdd(this,_thumbElement,null);__privateAdd(this,_isHorisontal,!1);__privateAdd(this,_thumbSize,0);__privateAdd(this,_thumbScrollSize,0);__privateAdd(this,_position3,0);__privateAdd(this,_resizeListener2,__name(()=>{__privateSet(this,_isHorisontal,this.offsetWidth>this.offsetHeight);const barSize=__privateGet(this,_isHorisontal)?this.offsetWidth:this.offsetHeight;__privateSet(this,_thumbSize,barSize/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/barSize)),__privateSet(this,_thumbSize,Math.max(__privateGet(this,_thumbSize),30)),__privateGet(this,_isHorisontal)?(__privateGet(this,_thumbElement).style.width=__privateGet(this,_thumbSize)+"px",__privateGet(this,_thumbElement).style.height="100%"):(__privateGet(this,_thumbElement).style.width="100%",__privateGet(this,_thumbElement).style.height=__privateGet(this,_thumbSize)+"px"),__privateSet(this,_thumbScrollSize,barSize-__privateGet(this,_thumbSize)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",__privateGet(this,_scrollListener).call(this)},"#resizeListener"));__privateAdd(this,_scrollListener,__name(()=>{__privateSet(this,_position3,this.scrollElement.currentProgress*__privateGet(this,_thumbScrollSize)),__privateGet(this,_isHorisontal)?__privateGet(this,_thumbElement).style.transform=`translate3d(${__privateGet(this,_position3)}px, 0px, 0px)`:__privateGet(this,_thumbElement).style.transform=`translate3d(0px, ${__privateGet(this,_position3)}px, 0px)`},"#scrollListener"));__privateAdd(this,_axisListener,__name(()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)},"#axisListener"));__privateAdd(this,_grabListener,__name(grabEvent=>{gestures.setupDrag(moveEvent=>{const moveCursor=__privateGet(this,_isHorisontal)?moveEvent.x:moveEvent.y,mult=this.scrollElement.distance/__privateGet(this,_thumbScrollSize),delta=(moveCursor-grabCursor)*mult;this.scrollElement.setPosition(startValue+delta)});const startValue=this.scrollElement.damped.target,grabCursor=__privateGet(this,_isHorisontal)?grabEvent.x:grabEvent.y},"#grabListener"));if(intersector_index.isBrowser){const shadow=this.attachShadow({mode:"open"});shadow.adoptedStyleSheets=[stylesheet$1.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],__privateSet(this,_slotElement2,document.createElement("slot")),__privateGet(this,_slotElement2).innerHTML='<div class="default-thumb"></div>',shadow.appendChild(__privateGet(this,_slotElement2))}}get thumbElement(){return __privateGet(this,_thumbElement)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const slottedThumb=__privateGet(this,_slotElement2).assignedElements()[0]||__privateGet(this,_slotElement2).firstElementChild;__privateSet(this,_thumbElement,slottedThumb),__privateGet(this,_thumbElement).addEventListener("pointerdown",__privateGet(this,_grabListener)),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener2),order_index.RESIZE_ORDER.SCROLL),elementResizer_index.elementResizer.subscribe(this,__privateGet(this,_resizeListener2)),elementResizer_index.elementResizer.subscribe(this.scrollElement,__privateGet(this,_resizeListener2)),this.scrollElement.onScroll(__privateGet(this,_scrollListener)),this.scrollElement.axisCSSProperty.subscribe(__privateGet(this,_axisListener))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",__privateGet(this,_thumbElement).removeEventListener("pointerdown",__privateGet(this,_grabListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener2)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener2)),this.scrollElement.offScroll(__privateGet(this,_scrollListener)),this.scrollElement.axisCSSProperty.unsubscribe(__privateGet(this,_axisListener))}};_slotElement2=new WeakMap,_thumbElement=new WeakMap,_isHorisontal=new WeakMap,_thumbSize=new WeakMap,_thumbScrollSize=new WeakMap,_position3=new WeakMap,_resizeListener2=new WeakMap,_scrollListener=new WeakMap,_axisListener=new WeakMap,_grabListener=new WeakMap,__name(_ScrollScrollbarElement,"ScrollScrollbarElement");let ScrollScrollbarElement=_ScrollScrollbarElement;intersector_index.isBrowser&&!customElements.get("e-scroll-scrollbar")&&customElements.define("e-scroll-scrollbar",ScrollScrollbarElement);var _behaviour,_easing,_duration;const _ScrollButtonElement=class _ScrollButtonElement extends ScrollUserElement{constructor(){super();__privateAdd(this,_behaviour,new cssProperty_index.CSSProperty(this,"--behaviour","smooth"));__privateAdd(this,_easing,new cssProperty_index.CSSProperty(this,"--tween-easing",!1));__privateAdd(this,_duration,new cssProperty_index.CSSProperty(this,"--tween-duration",0));intersector_index.isBrowser&&this.addEventListener("click",()=>{const behaviour=__privateGet(this,_behaviour).current,easing=__privateGet(this,_easing).current,duration=__privateGet(this,_duration).current;this.handleClick({behaviour,tween:easing||duration?{easing,duration}:void 0})})}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),__privateGet(this,_behaviour).observe(),__privateGet(this,_easing).observe(),__privateGet(this,_duration).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),this.removeAttribute("role"),__privateGet(this,_behaviour).close(),__privateGet(this,_easing).close(),__privateGet(this,_duration).close()}};_behaviour=new WeakMap,_easing=new WeakMap,_duration=new WeakMap,__name(_ScrollButtonElement,"ScrollButtonElement");let ScrollButtonElement=_ScrollButtonElement;var _set;const _ScrollSetButtonElement=class _ScrollSetButtonElement extends ScrollButtonElement{constructor(){super(...arguments);__privateAdd(this,_set,new cssProperty_index.CSSProperty(this,"--set",1))}handleClick(options){this.scrollElement.scrollToSection(__privateGet(this,_set).current,options)}connectedCallback(){super.connectedCallback(),__privateGet(this,_set).observe()}disconnectedCallback(){super.disconnectedCallback(),__privateGet(this,_set).close()}};_set=new WeakMap,__name(_ScrollSetButtonElement,"ScrollSetButtonElement");let ScrollSetButtonElement=_ScrollSetButtonElement;intersector_index.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",ScrollSetButtonElement);var _step,_scrollLineListener;const _ScrollStepButtonElement=class _ScrollStepButtonElement extends ScrollButtonElement{constructor(){super(...arguments);__privateAdd(this,_step,new cssProperty_index.CSSProperty(this,"--step",1));__privateAdd(this,_scrollLineListener,__name(()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):__privateGet(this,_step).current>0&&this.scrollElement.scrollLine==="end"||__privateGet(this,_step).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")},"#scrollLineListener"))}handleClick(options){this.scrollElement.shiftSections(__privateGet(this,_step).current,options)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(__privateGet(this,_step).subscribe(()=>{__privateGet(this,_scrollLineListener).call(this)}),__privateGet(this,_step).observe(),this.scrollElement.addEventListener("scrollLine",__privateGet(this,_scrollLineListener)),__privateGet(this,_scrollLineListener).call(this))}disconnectedCallback(){super.disconnectedCallback(),__privateGet(this,_step).close(),this.removeAttribute("disabled")}};_step=new WeakMap,_scrollLineListener=new WeakMap,__name(_ScrollStepButtonElement,"ScrollStepButtonElement");let ScrollStepButtonElement=_ScrollStepButtonElement;intersector_index.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",ScrollStepButtonElement);var _element2,_scrollElement3,_index2,_behaviour2,_clickListener,_counterChangeListener;const _BulletButton=class _BulletButton{constructor(scrollElement,index,behaviour){__privateAdd(this,_element2,null);__privateAdd(this,_scrollElement3,null);__privateAdd(this,_index2,null);__privateAdd(this,_behaviour2,null);__privateAdd(this,_clickListener,__name(()=>{__privateGet(this,_scrollElement3).scrollToSection(__privateGet(this,_index2),{behaviour:__privateGet(this,_behaviour2)})},"#clickListener"));__privateAdd(this,_counterChangeListener,__name(()=>{__privateGet(this,_element2).classList.toggle("current",__privateGet(this,_scrollElement3).counter.current===__privateGet(this,_index2))},"#counterChangeListener"));intersector_index.isBrowser&&(__privateSet(this,_element2,document.createElement("button")),__privateGet(this,_element2).setAttribute("aria-label",`Go to section ${index+1}`),__privateSet(this,_scrollElement3,scrollElement),__privateSet(this,_behaviour2,behaviour),__privateSet(this,_index2,index),__privateGet(this,_element2).addEventListener("click",__privateGet(this,_clickListener)),__privateGet(this,_scrollElement3).counter.subscribe(__privateGet(this,_counterChangeListener)),__privateGet(this,_counterChangeListener).call(this))}get element(){return __privateGet(this,_element2)}destroy(){__privateGet(this,_element2).removeEventListener("click",__privateGet(this,_clickListener)),__privateGet(this,_scrollElement3).counter.unsubscribe(__privateGet(this,_counterChangeListener)),__privateGet(this,_element2).remove()}};_element2=new WeakMap,_scrollElement3=new WeakMap,_index2=new WeakMap,_behaviour2=new WeakMap,_clickListener=new WeakMap,_counterChangeListener=new WeakMap,__name(_BulletButton,"BulletButton");let BulletButton=_BulletButton;var _contentElement2,_buttons,_sectionsChangeListener;const _ScrollBulletButtonsElement=class _ScrollBulletButtonsElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_contentElement2,null);__privateAdd(this,_buttons,[]);__privateAdd(this,_sectionsChangeListener,_function.debounce(()=>{__privateGet(this,_buttons).forEach(b=>b.destroy()),__privateSet(this,_buttons,[]);let length=0;this.scrollElement.loopCSSProperty.current?length=this.scrollElement.visibleSections.length:length=this.scrollElement.visibleSections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let index=0;index<length;index++){const button=new BulletButton(this.scrollElement,index,this.getAttribute("behaviour")||"smooth");__privateGet(this,_contentElement2).appendChild(button.element),__privateGet(this,_buttons).push(button)}},0))}connectedCallback(){super.connectedCallback(),this.innerHTML="",__privateSet(this,_contentElement2,document.createElement("div")),this.appendChild(__privateGet(this,_contentElement2)),this.scrollElement.addEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener)),this.scrollElement.sectionsInViewCSSProperty.subscribe(__privateGet(this,_sectionsChangeListener)),this.scrollElement.loopCSSProperty.subscribe(__privateGet(this,_sectionsChangeListener)),__privateGet(this,_sectionsChangeListener).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(__privateGet(this,_sectionsChangeListener)),this.scrollElement.loopCSSProperty.unsubscribe(__privateGet(this,_sectionsChangeListener)),__privateGet(this,_buttons).forEach(b=>b.destroy()),__privateSet(this,_buttons,[]),__privateGet(this,_contentElement2).remove()}};_contentElement2=new WeakMap,_buttons=new WeakMap,_sectionsChangeListener=new WeakMap,__name(_ScrollBulletButtonsElement,"ScrollBulletButtonsElement");let ScrollBulletButtonsElement=_ScrollBulletButtonsElement;intersector_index.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",ScrollBulletButtonsElement);var _dampingCSSProperty2,_massCSSProperty2,_stiffnessCSSProperty2,_targetCSSProperty,_disabledCSSProperty2,_distanceOffsetCSSProperty,_startOffsetCSSProperty,_captureOnceCSSProperty,_capturedCSSProperty,_releasedCSSProperty,_capturedFromStartCSSProperty,_capturedFromFinishCSSProperty,_releasedFromStartCSSProperty,_releasedFromFinishCSSProperty,_passedVarCSSProperty,_progressVarCSSProperty,_progressArcVarCSSProperty,_progressArcMultCSSProperty,_animationVarTypeCSSProperty,_distanceVarCSSProperty,_startVarCSSProperty,_finishVarCSSProperty,_isCaptured,_isReleased,_isCapturedFromStart,_isReleasedFromStart,_isCapturedFromFinish,_isReleasedFromFinish,_anotherScrollEntries,_targetElement,_directionPosition,_directionSize,_moverDirectionSize,_passed,_progress,_start,_distance2,_finish,_isResized,_isCapturedOnce,_isDisabled,_skipPassNotification,_ScrollSegmentElement_instances,captureListener_fn,releaseListener_fn,captureFromStartListener_fn,captureFromFinishListener_fn,releaseFromStartListener_fn,releaseFromFinishListener_fn,_resizeListener3,_tickListener,updateProgress_fn,handleClassSetting_fn,removeClasses_fn,removeVars_fn,removeCurrentMarks_fn;const _ScrollSegmentElement=class _ScrollSegmentElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_ScrollSegmentElement_instances);__privateAdd(this,_dampingCSSProperty2);__privateAdd(this,_massCSSProperty2);__privateAdd(this,_stiffnessCSSProperty2);__privateAdd(this,_targetCSSProperty);__privateAdd(this,_disabledCSSProperty2);__privateAdd(this,_distanceOffsetCSSProperty);__privateAdd(this,_startOffsetCSSProperty);__privateAdd(this,_captureOnceCSSProperty);__privateAdd(this,_capturedCSSProperty);__privateAdd(this,_releasedCSSProperty);__privateAdd(this,_capturedFromStartCSSProperty);__privateAdd(this,_capturedFromFinishCSSProperty);__privateAdd(this,_releasedFromStartCSSProperty);__privateAdd(this,_releasedFromFinishCSSProperty);__privateAdd(this,_passedVarCSSProperty);__privateAdd(this,_progressVarCSSProperty);__privateAdd(this,_progressArcVarCSSProperty);__privateAdd(this,_progressArcMultCSSProperty);__privateAdd(this,_animationVarTypeCSSProperty);__privateAdd(this,_distanceVarCSSProperty);__privateAdd(this,_startVarCSSProperty);__privateAdd(this,_finishVarCSSProperty);__privateAdd(this,_isCaptured);__privateAdd(this,_isReleased);__privateAdd(this,_isCapturedFromStart);__privateAdd(this,_isReleasedFromStart);__privateAdd(this,_isCapturedFromFinish);__privateAdd(this,_isReleasedFromFinish);__privateAdd(this,_anotherScrollEntries);__privateAdd(this,_targetElement);__privateAdd(this,_directionPosition);__privateAdd(this,_directionSize);__privateAdd(this,_moverDirectionSize);__privateAdd(this,_passed);__privateAdd(this,_progress);__privateAdd(this,_start);__privateAdd(this,_distance2);__privateAdd(this,_finish);__privateAdd(this,_isResized);__privateAdd(this,_isCapturedOnce);__privateAdd(this,_isDisabled);__privateAdd(this,_skipPassNotification);__privateAdd(this,_resizeListener3);__privateAdd(this,_tickListener);__privateSet(this,_dampingCSSProperty2,new cssProperty_index.CSSProperty(this,"--damping",20)),__privateSet(this,_massCSSProperty2,new cssProperty_index.CSSProperty(this,"--mass",0)),__privateSet(this,_stiffnessCSSProperty2,new cssProperty_index.CSSProperty(this,"--stiffness",0)),__privateSet(this,_targetCSSProperty,new cssProperty_index.CSSProperty(this,"--target","")),__privateSet(this,_disabledCSSProperty2,new cssProperty_index.CSSProperty(this,"--disabled",!1)),__privateSet(this,_distanceOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),__privateSet(this,_startOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),__privateSet(this,_captureOnceCSSProperty,new cssProperty_index.CSSProperty(this,"--capture-once",!1)),__privateSet(this,_capturedCSSProperty,new cssProperty_index.CSSProperty(this,"--captured","")),__privateSet(this,_releasedCSSProperty,new cssProperty_index.CSSProperty(this,"--released","")),__privateSet(this,_capturedFromStartCSSProperty,new cssProperty_index.CSSProperty(this,"--captured-from-start","")),__privateSet(this,_capturedFromFinishCSSProperty,new cssProperty_index.CSSProperty(this,"--captured-from-finish","")),__privateSet(this,_releasedFromStartCSSProperty,new cssProperty_index.CSSProperty(this,"--released-from-start","")),__privateSet(this,_releasedFromFinishCSSProperty,new cssProperty_index.CSSProperty(this,"--released-from-finish","")),__privateSet(this,_passedVarCSSProperty,new cssProperty_index.CSSProperty(this,"--passed-var","")),__privateSet(this,_progressVarCSSProperty,new cssProperty_index.CSSProperty(this,"--progress-var","")),__privateSet(this,_progressArcVarCSSProperty,new cssProperty_index.CSSProperty(this,"--progress-arc-var","")),__privateSet(this,_progressArcMultCSSProperty,new cssProperty_index.CSSProperty(this,"--progress-arc-mult",1)),__privateSet(this,_animationVarTypeCSSProperty,new cssProperty_index.CSSProperty(this,"--animation-var-type","target")),__privateSet(this,_distanceVarCSSProperty,new cssProperty_index.CSSProperty(this,"--distance-var","")),__privateSet(this,_startVarCSSProperty,new cssProperty_index.CSSProperty(this,"--start-var","")),__privateSet(this,_finishVarCSSProperty,new cssProperty_index.CSSProperty(this,"--finish-var","")),__privateSet(this,_isCaptured,new Store.Store(!1)),__privateSet(this,_isReleased,new Store.Store(!1)),__privateSet(this,_isCapturedFromStart,new Store.Store(!1)),__privateSet(this,_isReleasedFromStart,new Store.Store(!1)),__privateSet(this,_isCapturedFromFinish,new Store.Store(!1)),__privateSet(this,_isReleasedFromFinish,new Store.Store(!1)),__privateSet(this,_anotherScrollEntries,[]),__privateSet(this,_targetElement,this),__privateSet(this,_directionPosition,0),__privateSet(this,_directionSize,0),__privateSet(this,_moverDirectionSize,0),__privateSet(this,_passed,new Damped.Damped(0,{order:order_index.TICK_ORDER.SEGMENT,min:0,max:1})),__privateSet(this,_progress,0),__privateSet(this,_start,0),__privateSet(this,_distance2,0),__privateSet(this,_finish,0),__privateSet(this,_isResized,!1),__privateSet(this,_isCapturedOnce,!1),__privateSet(this,_isDisabled,!0),__privateSet(this,_skipPassNotification,!1),this.resize=()=>{__privateSet(this,_directionSize,this.scrollElement.vertical?this.offsetHeight:this.offsetWidth),__privateSet(this,_directionPosition,this.scrollElement.vertical?layout.getCumulativeOffsetTop(this,this.scrollElement):layout.getCumulativeOffsetLeft(this,this.scrollElement));const stickyOffset=layout.getStickyOffset(this,this.scrollElement.vertical?"top":"left");__privateSet(this,_directionPosition,__privateGet(this,_directionPosition)-stickyOffset),__privateSet(this,_start,this.getStart()),__privateSet(this,_distance2,this.getDistance()),__privateSet(this,_start,__privateGet(this,_start)+__privateGet(this,_startOffsetCSSProperty).current),__privateSet(this,_distance2,__privateGet(this,_distance2)+__privateGet(this,_distanceOffsetCSSProperty).current),__privateSet(this,_finish,__privateGet(this,_start)+__privateGet(this,_distance2)),this.scrollElement.currentScrollValue>__privateGet(this,_finish)&&!__privateGet(this,_isCaptured).current&&!__privateGet(this,_isReleased).current&&(__privateGet(this,_isCaptured).current=!0),this.setVar(__privateGet(this,_startVarCSSProperty).current,__privateGet(this,_start)),this.setVar(__privateGet(this,_finishVarCSSProperty).current,__privateGet(this,_finish)),this.setVar(__privateGet(this,_distanceVarCSSProperty).current,__privateGet(this,_distance2)),__privateGet(this,_passed).max=__privateGet(this,_distance2),__privateSet(this,_isResized,!0),__privateGet(this,_tickListener).call(this)},this.findAnotherScrollEntries=_function.debounce(()=>{const allScrollEntriesAbove=scrollEntries_index.scrollEntries.getAll(this).reverse();let scrollIndex=0;allScrollEntriesAbove.forEach((entry,i)=>{entry.element===this.scrollElement&&(scrollIndex=i)}),__privateSet(this,_anotherScrollEntries,allScrollEntriesAbove.slice(scrollIndex+1)),this.tick()},0),__privateSet(this,_resizeListener3,()=>{__privateGet(this,_isDisabled)||this.resize()}),__privateSet(this,_tickListener,()=>{!__privateGet(this,_isDisabled)&&__privateGet(this,_isResized)&&this.tick()})}get distanceOffsetCSSProperty(){return __privateGet(this,_distanceOffsetCSSProperty)}get startOffsetCSSProperty(){return __privateGet(this,_startOffsetCSSProperty)}get captureOnceCSSProperty(){return __privateGet(this,_captureOnceCSSProperty)}get capturedCSSProperty(){return __privateGet(this,_capturedCSSProperty)}get releasedCSSProperty(){return __privateGet(this,_releasedCSSProperty)}get capturedFromStartCSSProperty(){return __privateGet(this,_capturedFromStartCSSProperty)}get capturedFromFinishCSSProperty(){return __privateGet(this,_capturedFromFinishCSSProperty)}get releasedFromStartCSSProperty(){return __privateGet(this,_releasedFromStartCSSProperty)}get releasedFromFinishCSSProperty(){return __privateGet(this,_releasedFromFinishCSSProperty)}get passedVarCSSProperty(){return __privateGet(this,_passedVarCSSProperty)}get progressVarCSSProperty(){return __privateGet(this,_progressVarCSSProperty)}get progressArcVarCSSProperty(){return __privateGet(this,_progressArcVarCSSProperty)}get progressArcMultCSSProperty(){return __privateGet(this,_progressArcMultCSSProperty)}get animationVarTypeCSSProperty(){return __privateGet(this,_animationVarTypeCSSProperty)}get distanceVarCSSProperty(){return __privateGet(this,_distanceVarCSSProperty)}get startVarCSSProperty(){return __privateGet(this,_startVarCSSProperty)}get finishVarCSSProperty(){return __privateGet(this,_finishVarCSSProperty)}get disabledCSSProperty(){return __privateGet(this,_disabledCSSProperty2)}get dampingCSSProperty(){return __privateGet(this,_dampingCSSProperty2)}get massCSSProperty(){return __privateGet(this,_massCSSProperty2)}get stiffnessCSSProperty(){return __privateGet(this,_stiffnessCSSProperty2)}get targetCSSProperty(){return __privateGet(this,_targetCSSProperty)}get isCaptured(){return __privateGet(this,_isCaptured)}get isReleased(){return __privateGet(this,_isReleased)}get isCapturedFromStart(){return __privateGet(this,_isCapturedFromStart)}get isReleasedFromStart(){return __privateGet(this,_isReleasedFromStart)}get isCapturedFromFinish(){return __privateGet(this,_isCapturedFromFinish)}get isReleasedFromFinish(){return __privateGet(this,_isReleasedFromFinish)}get directionPosition(){return __privateGet(this,_directionPosition)}get directionSize(){return __privateGet(this,_directionSize)}get passed(){return __privateGet(this,_passed)}get progress(){return __privateGet(this,_progress)}get progressArc(){return Math.abs(Math.cos(__privateGet(this,_progress)*Math.PI))*__privateGet(this,_progressArcMultCSSProperty).current}get start(){return __privateGet(this,_start)}get finish(){return __privateGet(this,_finish)}get distance(){return __privateGet(this,_distance2)}get isCapturedOnce(){return __privateGet(this,_isCapturedOnce)}get isDisabled(){return __privateGet(this,_isDisabled)}tick(){let scrollValue=this.scrollElement.currentScrollValue;__privateGet(this,_anotherScrollEntries).forEach(se=>{scrollValue+=se.value});const delta=scrollValue-__privateGet(this,_start);__privateGet(this,_skipPassNotification)||__privateSet(this,_skipPassNotification,__privateGet(this,_passed).previous?Math.abs(__privateGet(this,_passed).previous-delta)>1e3:!1),__privateGet(this,_passed).set(delta);const fscrollValue=Math.round(scrollValue);__privateGet(this,_isCaptured).current&&(fscrollValue>=__privateGet(this,_start)?__privateGet(this,_isCapturedFromStart).current||__privateMethod(this,_ScrollSegmentElement_instances,captureFromStartListener_fn).call(this):__privateGet(this,_isCapturedFromStart).current&&!__privateGet(this,_isReleasedFromStart).current&&__privateMethod(this,_ScrollSegmentElement_instances,releaseFromStartListener_fn).call(this),fscrollValue<__privateGet(this,_finish)?__privateGet(this,_isReleasedFromFinish).current&&!__privateGet(this,_isCapturedFromFinish).current&&__privateMethod(this,_ScrollSegmentElement_instances,captureFromFinishListener_fn).call(this):__privateGet(this,_isCapturedFromStart).current&&!__privateGet(this,_isReleasedFromFinish).current&&__privateMethod(this,_ScrollSegmentElement_instances,releaseFromFinishListener_fn).call(this)),fscrollValue>=__privateGet(this,_start)&&fscrollValue<__privateGet(this,_finish)?__privateGet(this,_isCaptured).current||__privateMethod(this,_ScrollSegmentElement_instances,captureListener_fn).call(this):__privateGet(this,_isCaptured).current&&(__privateGet(this,_passed).set(math.step(__privateGet(this,_distance2)/2,__privateGet(this,_passed).target,0,__privateGet(this,_distance2))),__privateMethod(this,_ScrollSegmentElement_instances,releaseListener_fn).call(this)),__privateGet(this,_isCapturedOnce)&&__privateGet(this,_captureOnceCSSProperty).current&&(__privateGet(this,_capturedCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedCSSProperty).current),__privateSet(this,_isDisabled,!0))}disable(){this.style.cssText="",__privateSet(this,_directionPosition,0),__privateSet(this,_directionSize,0),__privateGet(this,_passed).reset(),__privateSet(this,_progress,0),__privateSet(this,_start,0),__privateSet(this,_distance2,0),__privateSet(this,_finish,0),__privateSet(this,_isResized,!1),__privateGet(this,_isCaptured).current=!1,__privateGet(this,_isReleased).current=!1,__privateGet(this,_isCapturedFromStart).current=!1,__privateGet(this,_isReleasedFromStart).current=!1,__privateGet(this,_isCapturedFromFinish).current=!1,__privateGet(this,_isReleasedFromFinish).current=!1,__privateSet(this,_isCapturedOnce,!1),__privateSet(this,_isDisabled,!0),__privateMethod(this,_ScrollSegmentElement_instances,removeCurrentMarks_fn).call(this)}enable(){__privateSet(this,_isDisabled,!1)}connectedCallback(){super.connectedCallback(),__privateGet(this,_isCaptured).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),__privateGet(this,_isCapturedFromStart).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),__privateGet(this,_isCapturedFromFinish).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),__privateGet(this,_isReleased).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),__privateGet(this,_isReleasedFromStart).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),__privateGet(this,_isReleasedFromFinish).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),__privateGet(this,_dampingCSSProperty2).observe(),__privateGet(this,_massCSSProperty2).observe(),__privateGet(this,_stiffnessCSSProperty2).observe(),__privateGet(this,_targetCSSProperty).observe(),__privateGet(this,_disabledCSSProperty2).observe(),__privateGet(this,_distanceOffsetCSSProperty).observe(),__privateGet(this,_startOffsetCSSProperty).observe(),__privateGet(this,_captureOnceCSSProperty).observe(),__privateGet(this,_capturedCSSProperty).observe(),__privateGet(this,_releasedCSSProperty).observe(),__privateGet(this,_capturedFromStartCSSProperty).observe(),__privateGet(this,_capturedFromFinishCSSProperty).observe(),__privateGet(this,_releasedFromStartCSSProperty).observe(),__privateGet(this,_releasedFromFinishCSSProperty).observe(),__privateGet(this,_passedVarCSSProperty).observe(),__privateGet(this,_progressVarCSSProperty).observe(),__privateGet(this,_progressArcVarCSSProperty).observe(),__privateGet(this,_progressArcMultCSSProperty).observe(),__privateGet(this,_animationVarTypeCSSProperty).observe(),__privateGet(this,_distanceVarCSSProperty).observe(),__privateGet(this,_startVarCSSProperty).observe(),__privateGet(this,_finishVarCSSProperty).observe();let isConnected=!1;this.findAnotherScrollEntries(),__privateGet(this,_disabledCSSProperty2).current||this.enable(),__privateGet(this,_dampingCSSProperty2).subscribe(e=>{__privateGet(this,_passed).damping=e.current}),__privateGet(this,_massCSSProperty2).subscribe(e=>{__privateGet(this,_passed).mass=e.current}),__privateGet(this,_stiffnessCSSProperty2).subscribe(e=>{__privateGet(this,_passed).stiffness=e.current}),__privateGet(this,_targetCSSProperty).subscribe(e=>{e.previous&&__privateMethod(this,_ScrollSegmentElement_instances,removeCurrentMarks_fn).call(this),e.current?e.current==="parent"?__privateSet(this,_targetElement,this.parentElement||this):__privateSet(this,_targetElement,document.querySelector(e.current)||this):__privateSet(this,_targetElement,this)}),__privateGet(this,_disabledCSSProperty2).subscribe(e=>{e.current&&!e.previous?this.disable():!e.current&&e.previous&&(this.resize(),this.enable())}),__privateGet(this,_startOffsetCSSProperty).subscribe(()=>{isConnected&&!__privateGet(this,_isDisabled)&&this.resize()}),__privateGet(this,_distanceOffsetCSSProperty).subscribe(()=>{isConnected&&!__privateGet(this,_isDisabled)&&this.resize()}),__privateGet(this,_capturedCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_capturedFromStartCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_capturedFromFinishCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_releasedCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_releasedFromStartCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_releasedFromFinishCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_captureOnceCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||!v.current&&v.previous&&(this.resize(),this.enable())}),__privateGet(this,_passedVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,this.passed.current))}),__privateGet(this,_progressVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_progress)))}),__privateGet(this,_progressArcVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,this.progressArc))}),__privateGet(this,_progressArcMultCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||__privateMethod(this,_ScrollSegmentElement_instances,updateProgress_fn).call(this)}),__privateGet(this,_startVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_start)))}),__privateGet(this,_finishVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_finish)))}),__privateGet(this,_distanceVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_distance2)))}),__privateGet(this,_passed).subscribe(e=>{if(__privateGet(this,_skipPassNotification)){__privateSet(this,_skipPassNotification,!1);return}__privateMethod(this,_ScrollSegmentElement_instances,updateProgress_fn).call(this)}),this.scrollElement.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollElement.addEventListener("scrollResize",this.resize),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener3),order_index.RESIZE_ORDER.SCROLL+1),this.scrollElement.onScroll(__privateGet(this,_tickListener)),isConnected=!0}disconnectedCallback(){windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener3)),this.scrollElement.offScroll(__privateGet(this,_tickListener)),this.scrollElement.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollElement.removeEventListener("scrollResize",this.resize),__privateGet(this,_dampingCSSProperty2).close(),__privateGet(this,_massCSSProperty2).close(),__privateGet(this,_stiffnessCSSProperty2).close(),__privateGet(this,_targetCSSProperty).close(),__privateGet(this,_disabledCSSProperty2).close(),__privateGet(this,_distanceOffsetCSSProperty).close(),__privateGet(this,_startOffsetCSSProperty).close(),__privateGet(this,_captureOnceCSSProperty).close(),__privateGet(this,_capturedCSSProperty).close(),__privateGet(this,_releasedCSSProperty).close(),__privateGet(this,_capturedFromStartCSSProperty).close(),__privateGet(this,_capturedFromFinishCSSProperty).close(),__privateGet(this,_releasedFromStartCSSProperty).close(),__privateGet(this,_releasedFromFinishCSSProperty).close(),__privateGet(this,_passedVarCSSProperty).close(),__privateGet(this,_progressVarCSSProperty).close(),__privateGet(this,_progressArcVarCSSProperty).close(),__privateGet(this,_progressArcMultCSSProperty).close(),__privateGet(this,_distanceVarCSSProperty).close(),__privateGet(this,_startVarCSSProperty).close(),__privateGet(this,_finishVarCSSProperty).close(),__privateGet(this,_isCaptured).close(),__privateGet(this,_isReleased).close(),__privateGet(this,_isCapturedFromStart).close(),__privateGet(this,_isReleasedFromStart).close(),__privateGet(this,_isCapturedFromFinish).close(),__privateGet(this,_isReleasedFromFinish).close(),this.disable(),__privateGet(this,_passed).close()}removeVar(name){name&&__privateGet(this,_targetElement).style.removeProperty(`--${name}`)}setVar(name,value){if(name){const v=typeof value=="number"?value.toFixed(6):value;__privateGet(this,_targetElement).style.setProperty(`--${name}`,v)}}getDistance(){return __privateGet(this,_directionSize)+__privateGet(this,_moverDirectionSize)}getStart(){return __privateGet(this,_directionPosition)-__privateGet(this,_moverDirectionSize)}};_dampingCSSProperty2=new WeakMap,_massCSSProperty2=new WeakMap,_stiffnessCSSProperty2=new WeakMap,_targetCSSProperty=new WeakMap,_disabledCSSProperty2=new WeakMap,_distanceOffsetCSSProperty=new WeakMap,_startOffsetCSSProperty=new WeakMap,_captureOnceCSSProperty=new WeakMap,_capturedCSSProperty=new WeakMap,_releasedCSSProperty=new WeakMap,_capturedFromStartCSSProperty=new WeakMap,_capturedFromFinishCSSProperty=new WeakMap,_releasedFromStartCSSProperty=new WeakMap,_releasedFromFinishCSSProperty=new WeakMap,_passedVarCSSProperty=new WeakMap,_progressVarCSSProperty=new WeakMap,_progressArcVarCSSProperty=new WeakMap,_progressArcMultCSSProperty=new WeakMap,_animationVarTypeCSSProperty=new WeakMap,_distanceVarCSSProperty=new WeakMap,_startVarCSSProperty=new WeakMap,_finishVarCSSProperty=new WeakMap,_isCaptured=new WeakMap,_isReleased=new WeakMap,_isCapturedFromStart=new WeakMap,_isReleasedFromStart=new WeakMap,_isCapturedFromFinish=new WeakMap,_isReleasedFromFinish=new WeakMap,_anotherScrollEntries=new WeakMap,_targetElement=new WeakMap,_directionPosition=new WeakMap,_directionSize=new WeakMap,_moverDirectionSize=new WeakMap,_passed=new WeakMap,_progress=new WeakMap,_start=new WeakMap,_distance2=new WeakMap,_finish=new WeakMap,_isResized=new WeakMap,_isCapturedOnce=new WeakMap,_isDisabled=new WeakMap,_skipPassNotification=new WeakMap,_ScrollSegmentElement_instances=new WeakSet,captureListener_fn=__name(function(){__privateGet(this,_isCaptured).current=!0,__privateGet(this,_isReleased).current=!1,__privateSet(this,_isCapturedOnce,!0),__privateGet(this,_releasedCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_releasedCSSProperty).current),__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_releasedFromFinishCSSProperty).current),__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_releasedFromFinishCSSProperty).current),__privateGet(this,_capturedCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedCSSProperty).current)},"#captureListener"),releaseListener_fn=__name(function(){__privateGet(this,_isReleased).current=!0,__privateGet(this,_isCaptured).current=!1,__privateSet(this,_isCapturedOnce,!0),__privateGet(this,_capturedCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_capturedCSSProperty).current),__privateGet(this,_capturedFromStartCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_capturedFromStartCSSProperty).current),__privateGet(this,_capturedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_capturedFromFinishCSSProperty).current),__privateGet(this,_releasedCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_releasedCSSProperty).current)},"#releaseListener"),captureFromStartListener_fn=__name(function(){__privateGet(this,_isCaptured).current=!0,__privateGet(this,_isCapturedFromStart).current=!0,__privateGet(this,_isReleasedFromStart).current=!1,__privateGet(this,_capturedFromStartCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedFromStartCSSProperty).current)},"#captureFromStartListener"),captureFromFinishListener_fn=__name(function(){__privateGet(this,_isCaptured).current=!0,__privateGet(this,_isCapturedFromFinish).current=!0,__privateGet(this,_isReleasedFromFinish).current=!1,__privateGet(this,_capturedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedFromFinishCSSProperty).current)},"#captureFromFinishListener"),releaseFromStartListener_fn=__name(function(){__privateGet(this,_isReleased).current=!0,__privateGet(this,_isReleasedFromStart).current=!0,__privateGet(this,_isCapturedFromStart).current=!1,__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_releasedFromFinishCSSProperty).current)},"#releaseFromStartListener"),releaseFromFinishListener_fn=__name(function(){__privateGet(this,_isReleased).current=!0,__privateGet(this,_isReleasedFromFinish).current=!0,__privateGet(this,_isCapturedFromFinish).current=!1,__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_releasedFromFinishCSSProperty).current)},"#releaseFromFinishListener"),_resizeListener3=new WeakMap,_tickListener=new WeakMap,updateProgress_fn=__name(function(){const passedValue=__privateGet(this,_passed)[__privateGet(this,_animationVarTypeCSSProperty).current];this.setVar(__privateGet(this,_passedVarCSSProperty).current,passedValue),__privateSet(this,_progress,passedValue/__privateGet(this,_distance2)||0),this.setVar(__privateGet(this,_progressVarCSSProperty).current,__privateGet(this,_progress)),__privateGet(this,_progressArcVarCSSProperty).current&&this.setVar(__privateGet(this,_progressArcVarCSSProperty).current,this.progressArc)},"#updateProgress"),handleClassSetting_fn=__name(function(e){if(__privateGet(this,_isDisabled)){e.previous&&__privateGet(this,_targetElement).classList.remove(e.previous),e.current&&__privateGet(this,_targetElement).classList.remove(e.current);return}e.current&&__privateGet(this,_isCaptured).current?(e.previous&&__privateGet(this,_targetElement).classList.remove(e.previous),__privateGet(this,_targetElement).classList.add(e.current)):!e.current&&e.previous&&__privateGet(this,_targetElement).classList.remove(e.previous)},"#handleClassSetting"),removeClasses_fn=__name(function(...className){className.forEach(c=>{c&&__privateGet(this,_targetElement).classList.remove(c)})},"#removeClasses"),removeVars_fn=__name(function(...vars){vars.forEach(v=>{v&&__privateGet(this,_targetElement).style.removeProperty(`--${v}`)})},"#removeVars"),removeCurrentMarks_fn=__name(function(){__privateMethod(this,_ScrollSegmentElement_instances,removeClasses_fn).call(this,__privateGet(this,_capturedCSSProperty).current,__privateGet(this,_capturedFromStartCSSProperty).current,__privateGet(this,_capturedFromFinishCSSProperty).current,__privateGet(this,_releasedCSSProperty).current,__privateGet(this,_releasedFromStartCSSProperty).current,__privateGet(this,_releasedFromFinishCSSProperty).current),__privateMethod(this,_ScrollSegmentElement_instances,removeVars_fn).call(this,__privateGet(this,_passedVarCSSProperty).current,__privateGet(this,_progressVarCSSProperty).current,__privateGet(this,_progressArcVarCSSProperty).current,__privateGet(this,_distanceVarCSSProperty).current,__privateGet(this,_startVarCSSProperty).current,__privateGet(this,_finishVarCSSProperty).current)},"#removeCurrentMarks"),__name(_ScrollSegmentElement,"ScrollSegmentElement");let ScrollSegmentElement=_ScrollSegmentElement;intersector_index.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",ScrollSegmentElement);const _ScrollSectionButtonElement=class _ScrollSectionButtonElement extends ScrollButtonElement{handleClick(options){this.scrollElement.setPosition(this.scrollElement.vertical?layout.getCumulativeOffsetTop(this):layout.getCumulativeOffsetLeft(this),options)}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}};__name(_ScrollSectionButtonElement,"ScrollSectionButtonElement");let ScrollSectionButtonElement=_ScrollSectionButtonElement;intersector_index.isBrowser&&!customElements.get("e-scroll-section-button")&&customElements.define("e-scroll-section-button",ScrollSectionButtonElement);var _counterChangeListener2;const _ScrollCounterElement=class _ScrollCounterElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_counterChangeListener2,__name(()=>{const value=this.scrollElement.counter.current+1,pad=parseInt(this.getAttribute("pad")||"0");this.textContent=value.toString().padStart(pad,"0")},"#counterChangeListener"))}connectedCallback(){return __async(this,null,function*(){__superGet(_ScrollCounterElement.prototype,this,"connectedCallback").call(this),this.scrollElement.counter.subscribe(__privateGet(this,_counterChangeListener2))})}disconnectedCallback(){this.scrollElement.counter.unsubscribe(__privateGet(this,_counterChangeListener2))}};_counterChangeListener2=new WeakMap,__name(_ScrollCounterElement,"ScrollCounterElement");let ScrollCounterElement=_ScrollCounterElement;intersector_index.isBrowser&&!customElements.get("e-scroll-counter")&&customElements.define("e-scroll-counter",ScrollCounterElement);var _sectionsChangeListener2;const _ScrollTotalElement=class _ScrollTotalElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_sectionsChangeListener2,__name(()=>{const value=this.scrollElement.limit+1,pad=parseInt(this.getAttribute("pad")||"0");this.textContent=value.toString().padStart(pad,"0")},"#sectionsChangeListener"))}connectedCallback(){return __async(this,null,function*(){__superGet(_ScrollTotalElement.prototype,this,"connectedCallback").call(this),this.scrollElement.sectionsInViewCSSProperty.subscribe(__privateGet(this,_sectionsChangeListener2)),this.scrollElement.addEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener2)),__privateGet(this,_sectionsChangeListener2).call(this)})}disconnectedCallback(){this.scrollElement.sectionsInViewCSSProperty.unsubscribe(__privateGet(this,_sectionsChangeListener2)),this.scrollElement.removeEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener2))}};_sectionsChangeListener2=new WeakMap,__name(_ScrollTotalElement,"ScrollTotalElement");let ScrollTotalElement=_ScrollTotalElement;intersector_index.isBrowser&&!customElements.get("e-scroll-total")&&customElements.define("e-scroll-total",ScrollTotalElement);exports.ScrollBulletButtonsElement=ScrollBulletButtonsElement;exports.ScrollCounterElement=ScrollCounterElement;exports.ScrollElement=ScrollElement;exports.ScrollScrollbarElement=ScrollScrollbarElement;exports.ScrollSectionButtonElement=ScrollSectionButtonElement;exports.ScrollSegmentElement=ScrollSegmentElement;exports.ScrollSetButtonElement=ScrollSetButtonElement;exports.ScrollStepButtonElement=ScrollStepButtonElement;exports.ScrollTotalElement=ScrollTotalElement;
1
+ "use strict";var __defProp=Object.defineProperty;var __getOwnPropSymbols=Object.getOwnPropertySymbols,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__reflectGet=Reflect.get;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);var __superGet=(cls,obj,key)=>__reflectGet(__getProtoOf(cls),key,obj);var __async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Store=require("../Store-DZnOrofs.cjs"),intersector_index=require("../index-DZ44osDT.cjs"),easings=require("../easings-BWq0pPLq.cjs"),element=require("../element-CqD0jqBJ.cjs"),events=require("../events-UlGk63iC.cjs"),_function=require("../function-H4b_gTg6.cjs"),layout=require("../layout-CnGLl7oe.cjs"),math=require("../math-C-knY2TL.cjs"),number=require("../number-Bu4sGvW7.cjs"),stylesheet$1=require("../stylesheet-xM7sMeuo.cjs"),order_index=require("../order/index.cjs"),Damped=require("../Damped-BHm2IuyN.cjs"),Tweened=require("../Tweened-3UYSwrvs.cjs"),DragControls=require("../DragControls-XC4E7seK.cjs"),cssProperty_index=require("../css-property/index.cjs"),cssUnitParser_index=require("../css-unit-parser/index.cjs"),Viewport=require("../Viewport-D26fEJOk.cjs"),elementResizer_index=require("../element-resizer/index.cjs"),scrollEntries_index=require("../scroll-entries/index.cjs"),windowResizer_index=require("../window-resizer/index.cjs");require("construct-style-sheets-polyfill");const gestures=require("../gestures-DtYbQr49.cjs"),dom=require("../dom-B40i6NXw.cjs");var _element,_index,_scrollElement,_width,_height,_size,_position,_currentMark,_transformPosition,_ScrollSection_instances,setVar_fn;const _ScrollSection=class _ScrollSection{constructor(element2,index,scrollElement){__privateAdd(this,_ScrollSection_instances);__privateAdd(this,_element);__privateAdd(this,_index);__privateAdd(this,_scrollElement);__privateAdd(this,_width,0);__privateAdd(this,_height,0);__privateAdd(this,_size,0);__privateAdd(this,_position,0);__privateAdd(this,_currentMark,null);__privateAdd(this,_transformPosition,0);__privateSet(this,_element,element2),__privateSet(this,_index,index),__privateSet(this,_scrollElement,scrollElement),scrollEntries_index.scrollEntries.register(__privateGet(this,_element)),this.setIndex(__privateGet(this,_index))}get element(){return __privateGet(this,_element)}get index(){return __privateGet(this,_index)}get size(){return __privateGet(this,_size)}get width(){return __privateGet(this,_width)}get height(){return __privateGet(this,_height)}get position(){return __privateGet(this,_position)}get transformPosition(){return __privateGet(this,_transformPosition)}destroy(){scrollEntries_index.scrollEntries.unregister(__privateGet(this,_element)),this.unsetTransform()}unsetTransform(){__privateGet(this,_element).style.transform="",this.setMark(null),this.setIndex(null),this.setCurrentIndex(null),this.setCurrentIndexArc(null),this.setCurrentIndexArcAbs(null),this.setOffsetIndex(null),this.setMiddle(!1),this.setSize()}setSize(value){value?(__privateGet(this,_element).style.setProperty("--size",value+"px"),__privateGet(this,_scrollElement).axisCSSProperty.current==="x"?(__privateGet(this,_element).style.width=value+"px",__privateGet(this,_element).style.height=""):(__privateGet(this,_element).style.height=value+"px",__privateGet(this,_element).style.width="")):(__privateGet(this,_element).style.width="",__privateGet(this,_element).style.height="",__privateGet(this,_element).style.removeProperty("--size"))}resize(){__privateSet(this,_width,__privateGet(this,_element).offsetWidth),__privateSet(this,_height,__privateGet(this,_element).offsetHeight),__privateSet(this,_size,__privateGet(this,_scrollElement).vertical?__privateGet(this,_element).offsetHeight:__privateGet(this,_element).offsetWidth),__privateSet(this,_position,__privateGet(this,_scrollElement).vertical?layout.getCumulativeOffsetTop(__privateGet(this,_element)):layout.getCumulativeOffsetLeft(__privateGet(this,_element))),__privateSet(this,_position,__privateGet(this,_position)-__privateGet(this,_scrollElement).contentPosition)}transform(){const cssOffset=__privateGet(this,_scrollElement).shiftSectionPositionCSSProperty.current;let offset=cssOffset;const distanceAddition=__privateGet(this,_scrollElement).viewportSize*__privateGet(this,_scrollElement).sectionDistanceScaleCSSProperty.current;__privateGet(this,_scrollElement).loopCSSProperty.current&&__privateGet(this,_position)+__privateGet(this,_size)<=__privateGet(this,_scrollElement).currentScrollValue-cssOffset/2&&(offset=(__privateGet(this,_scrollElement).distance-cssOffset)*-1-__privateGet(this,_scrollElement).gap),scrollEntries_index.scrollEntries.update(__privateGet(this,_element),__privateGet(this,_scrollElement).axisCSSProperty.current,offset);const valueToClamp=__privateGet(this,_scrollElement).currentScrollValue+offset,min=__privateGet(this,_position)-__privateGet(this,_scrollElement).viewportSize-distanceAddition,max=__privateGet(this,_position)+__privateGet(this,_size)+distanceAddition,value=number.preciseNumber(math.clamp(valueToClamp,min,max),3);__privateSet(this,_transformPosition,value*-1),__privateGet(this,_scrollElement).vertical?__privateGet(this,_element).style.transform=`translate3d(0px, ${__privateGet(this,_transformPosition)}px, 0px)`:__privateGet(this,_element).style.transform=`translate3d(${__privateGet(this,_transformPosition)}px, 0px, 0px)`}setMark(mark){__privateGet(this,_currentMark)!==mark&&(__privateGet(this,_currentMark)&&__privateGet(this,_element).classList.remove(__privateGet(this,_currentMark)),mark&&__privateGet(this,_element).classList.add(mark),__privateSet(this,_currentMark,mark),events.dispatchEvent(__privateGet(this,_element),"scrollSectionMarkChange",{composed:!0,detail:{mark:__privateGet(this,_currentMark)},custom:!0}))}setMiddle(bool){__privateGet(this,_element).classList.toggle("middle",bool)}setIndex(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"index",value)}setCurrentIndex(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"current-index",value)}setCurrentIndexArc(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"current-index-arc",value)}setOffsetIndex(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"offset-index",value)}setCurrentIndexArcAbs(value){__privateMethod(this,_ScrollSection_instances,setVar_fn).call(this,"current-index-arc-abs",value)}};_element=new WeakMap,_index=new WeakMap,_scrollElement=new WeakMap,_width=new WeakMap,_height=new WeakMap,_size=new WeakMap,_position=new WeakMap,_currentMark=new WeakMap,_transformPosition=new WeakMap,_ScrollSection_instances=new WeakSet,setVar_fn=__name(function(name,value){value!==null?(__privateGet(this,_element).style.setProperty(`--${name}`,value.toString()),__privateGet(this,_element).setAttribute(`data-${name}`,value.toString())):(__privateGet(this,_element).style.removeProperty(`--${name}`),__privateGet(this,_element).removeAttribute(`data-${name}`))},"#setVar"),__name(_ScrollSection,"ScrollSection");let ScrollSection=_ScrollSection;const stylesheet=stylesheet$1.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"var(--content-wrapper-width, 100%)",height:"var(--content-wrapper-height, 100%)",overflow:"var(--overflow, initial)",borderRadius:"var(--border-radius, unset)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var _damped,_controlsCSSProperty,_axisCSSProperty,_reverseCSSProperty,_directionCSSProperty,_pagesCSSProperty,_splitCSSProperty,_sectionalCSSProperty,_easingCSSProperty,_durationCSSProperty,_autoSizeCSSProperty,_wheelMaxDeltaCSSProperty,_dragInertionCSSProperty,_sectionsInViewCSSProperty,_loopCSSProperty,_dampingCSSProperty,_massCSSProperty,_stiffnessCSSProperty,_mouseDragCSSProperty,_sectionDistanceScaleCSSProperty,_startSectionCSSProperty,_autoplayCSSProperty,_autoplayPauseDurationCSSProperty,_autoplayUserDirectionCSSProperty,_classesCSSProperty,_currentIndexStartOffsetCSSProperty,_currentIndexEndOffsetCSSProperty,_shiftSectionPositionCSSProperty,_focusDelayCSSProperty,_focusDurationCSSProperty,_shiftLimitCSSProperty,_disabledCSSProperty,_hibernatedCSSProperty,_contentWrapperElement,_contentElement,_slotElement,_sections,_visibleSections,_position2,_contentPosition,_viewportSize,_scrollSize,_gap,_wheelControls,_keyboardControls,_dragControls,_autoplayControls,_counter,_overscroll,_distance,_hasOverflow,_disabled,_hibernated,_focusTimeoutId,_tweenTimeoutId,_setTween,_isGrabbing,_scrollLine,_isConnected,_mutationObserver,_currentSections,_skipNextResize,_maxSectionSizeTimeoutId,_ScrollElement_instances,updateAxis_fn,split_fn,unsplit_fn,disable_fn,enable_fn,hibernate_fn,awake_fn,_resizeListener,_animatedChangeListener,clampCounter_fn,_notAutoplayControlListener,_controlsListener,processAutoplay_fn,getScrollValue_fn,updateMarks_fn,updateIndexes_fn,_updateMaxSectionsSize,getNearestSectionIndex_fn,_connectListener;const _ScrollElement=class _ScrollElement extends HTMLElement{constructor(){super();__privateAdd(this,_ScrollElement_instances);__privateAdd(this,_damped,null);__privateAdd(this,_controlsCSSProperty,new cssProperty_index.CSSProperty(this,"--controls",!0));__privateAdd(this,_axisCSSProperty,new cssProperty_index.CSSProperty(this,"--axis","y"));__privateAdd(this,_reverseCSSProperty,new cssProperty_index.CSSProperty(this,"--reverse",!1));__privateAdd(this,_directionCSSProperty,new cssProperty_index.CSSProperty(this,"--direction",0));__privateAdd(this,_pagesCSSProperty,new cssProperty_index.CSSProperty(this,"--pages",0,{validate:__name(v=>Math.max(0,v-1),"validate")}));__privateAdd(this,_splitCSSProperty,new cssProperty_index.CSSProperty(this,"--split",!1));__privateAdd(this,_sectionalCSSProperty,new cssProperty_index.CSSProperty(this,"--sectional",!1));__privateAdd(this,_easingCSSProperty,new cssProperty_index.CSSProperty(this,"--tween-easing",!1));__privateAdd(this,_durationCSSProperty,new cssProperty_index.CSSProperty(this,"--tween-duration",!1));__privateAdd(this,_autoSizeCSSProperty,new cssProperty_index.CSSProperty(this,"--auto-size",!1));__privateAdd(this,_wheelMaxDeltaCSSProperty,new cssProperty_index.CSSProperty(this,"--wheel-max-delta",!1));__privateAdd(this,_dragInertionCSSProperty,new cssProperty_index.CSSProperty(this,"--drag-inertion",1));__privateAdd(this,_sectionsInViewCSSProperty,new cssProperty_index.CSSProperty(this,"--sections-in-view",1));__privateAdd(this,_loopCSSProperty,new cssProperty_index.CSSProperty(this,"--loop",!1));__privateAdd(this,_dampingCSSProperty,new cssProperty_index.CSSProperty(this,"--damping",20));__privateAdd(this,_massCSSProperty,new cssProperty_index.CSSProperty(this,"--mass",0));__privateAdd(this,_stiffnessCSSProperty,new cssProperty_index.CSSProperty(this,"--stiffness",0));__privateAdd(this,_mouseDragCSSProperty,new cssProperty_index.CSSProperty(this,"--mouse-drag",!1));__privateAdd(this,_sectionDistanceScaleCSSProperty,new cssProperty_index.CSSProperty(this,"--section-distance-scale",.5));__privateAdd(this,_startSectionCSSProperty,new cssProperty_index.CSSProperty(this,"--start-section",0));__privateAdd(this,_autoplayCSSProperty,new cssProperty_index.CSSProperty(this,"--autoplay",0));__privateAdd(this,_autoplayPauseDurationCSSProperty,new cssProperty_index.CSSProperty(this,"--autoplay-pause-duration",0));__privateAdd(this,_autoplayUserDirectionCSSProperty,new cssProperty_index.CSSProperty(this,"--autoplay-user-direction",!1));__privateAdd(this,_classesCSSProperty,new cssProperty_index.CSSProperty(this,"--classes",!1));__privateAdd(this,_currentIndexStartOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--current-index-start-offset",0));__privateAdd(this,_currentIndexEndOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--current-index-end-offset",0));__privateAdd(this,_shiftSectionPositionCSSProperty,new cssProperty_index.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));__privateAdd(this,_focusDelayCSSProperty,new cssProperty_index.CSSProperty(this,"--focus-delay",0));__privateAdd(this,_focusDurationCSSProperty,new cssProperty_index.CSSProperty(this,"--focus-duration",3e3));__privateAdd(this,_shiftLimitCSSProperty,new cssProperty_index.CSSProperty(this,"--shift-limit",0));__privateAdd(this,_disabledCSSProperty,new cssProperty_index.CSSProperty(this,"--disabled",!1));__privateAdd(this,_hibernatedCSSProperty,new cssProperty_index.CSSProperty(this,"--hibernate",!1));__privateAdd(this,_contentWrapperElement,null);__privateAdd(this,_contentElement,null);__privateAdd(this,_slotElement,null);__privateAdd(this,_sections,[]);__privateAdd(this,_visibleSections,[]);__privateAdd(this,_position2,0);__privateAdd(this,_contentPosition,0);__privateAdd(this,_viewportSize,0);__privateAdd(this,_scrollSize,0);__privateAdd(this,_gap,0);__privateAdd(this,_wheelControls,null);__privateAdd(this,_keyboardControls,null);__privateAdd(this,_dragControls,null);__privateAdd(this,_autoplayControls,null);__privateAdd(this,_counter,new Store.Store(0));__privateAdd(this,_overscroll,0);__privateAdd(this,_distance,0);__privateAdd(this,_hasOverflow,!1);__privateAdd(this,_disabled,!0);__privateAdd(this,_hibernated,!0);__privateAdd(this,_focusTimeoutId);__privateAdd(this,_tweenTimeoutId);__privateAdd(this,_setTween,new Tweened.Tweened);__privateAdd(this,_isGrabbing,!1);__privateAdd(this,_scrollLine,null);__privateAdd(this,_isConnected,!1);__privateAdd(this,_mutationObserver,null);__privateAdd(this,_currentSections,[]);__privateAdd(this,_skipNextResize,!1);__privateAdd(this,_maxSectionSizeTimeoutId);__privateAdd(this,_resizeListener,__name(e=>{if(e&&__privateGet(this,_skipNextResize)){__privateSet(this,_skipNextResize,!1);return}this.resize()},"#resizeListener"));__privateAdd(this,_animatedChangeListener,__name(()=>{if(!__privateGet(this,_hasOverflow)||__privateGet(this,_hibernated)||__privateGet(this,_disabled))return;const currentScrollValue=this.currentScrollValue;if(__privateSet(this,_overscroll,Math.max(0,currentScrollValue-__privateGet(this,_scrollSize))),__privateGet(this,_visibleSections).length){for(let i=0;i<__privateGet(this,_sections).length;i++)__privateGet(this,_sections)[i].transform();(__privateGet(this,_isGrabbing)||!__privateGet(this,_sectionalCSSProperty).current)&&(__privateGet(this,_counter).current=__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this))}else this.vertical?__privateGet(this,_contentElement).style.transform=`translate3d(0px, ${currentScrollValue*-1}px, 0px)`:__privateGet(this,_contentElement).style.transform=`translate3d(${currentScrollValue*-1}px, 0px, 0px)`;__privateMethod(this,_ScrollElement_instances,updateIndexes_fn).call(this),scrollEntries_index.scrollEntries.update(this,__privateGet(this,_axisCSSProperty).current,currentScrollValue)},"#animatedChangeListener"));__privateAdd(this,_notAutoplayControlListener,__name((type,value)=>{__privateGet(this,_controlsCSSProperty).current&&(__privateMethod(this,_ScrollElement_instances,processAutoplay_fn).call(this,Math.sign(value)||1),__privateGet(this,_controlsListener).call(this,type,value))},"#notAutoplayControlListener"));__privateAdd(this,_controlsListener,__name((type,value)=>{if(!__privateGet(this,_tweenTimeoutId)){if(__privateGet(this,_directionCSSProperty).current){if(__privateGet(this,_directionCSSProperty).current<0&&value>0)return;if(__privateGet(this,_directionCSSProperty).current>0&&value<0)return}if(!__privateGet(this,_autoplayCSSProperty).current&&__privateGet(this,_focusDelayCSSProperty).current&&(clearInterval(__privateGet(this,_focusTimeoutId)),__privateSet(this,_focusTimeoutId,setTimeout(()=>{const section=__privateGet(this,_visibleSections)[__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this)];section&&this.scrollToSection(section.index,{tween:{duration:__privateGet(this,_focusDurationCSSProperty).current,easing:easings.easeInOutExpo}})},__privateGet(this,_focusDelayCSSProperty).current))),!(type.includes("drag")&&!Viewport.device.isTouch&&!__privateGet(this,_mouseDragCSSProperty).current)){if(__privateGet(this,_sectionalCSSProperty).current&&type!=="drag"){const direction=Math.sign(value);__privateGet(this,_visibleSections).length?__privateGet(this,_isGrabbing)?this.scrollToSection(__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this,!0)):this.shiftSections(direction,{tween:__privateGet(this,_easingCSSProperty).current||__privateGet(this,_durationCSSProperty).current?{easing:__privateGet(this,_easingCSSProperty).current||"easeInOutCubic",duration:__privateGet(this,_durationCSSProperty).current||500}:void 0}):__privateGet(this,_damped).shift(direction*__privateGet(this,_viewportSize))}else __privateGet(this,_damped).shift(value);__privateSet(this,_isGrabbing,type==="drag")}}},"#controlsListener"));__privateAdd(this,_updateMaxSectionsSize,_function.debounce(()=>{const maxSectionSize=__privateGet(this,_currentSections).reduce((p,c)=>{const s=this.vertical?c.width:c.height;return s>p?s:p},0);clearTimeout(__privateGet(this,_maxSectionSizeTimeoutId)),__privateSet(this,_skipNextResize,!0),this.style.setProperty("--max-section-size",""),__privateSet(this,_maxSectionSizeTimeoutId,setTimeout(()=>{__privateSet(this,_skipNextResize,!0),this.style.setProperty("--max-section-size",maxSectionSize+"px")},10))},20));__privateAdd(this,_connectListener,__name(()=>{__privateSet(this,_isConnected,!0),this.hibernatedCSSProperty.current||__privateMethod(this,_ScrollElement_instances,awake_fn).call(this),elementResizer_index.elementResizer.subscribe(this,__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_connectListener))},"#connectListener"));if(intersector_index.isBrowser){const shadow=this.attachShadow({mode:"open"});shadow.adoptedStyleSheets=[stylesheet];const staticElement=document.createElement("div");staticElement.className="static",staticElement.innerHTML='<slot name="static"></slot>',shadow.appendChild(staticElement),__privateSet(this,_contentWrapperElement,document.createElement("div")),__privateGet(this,_contentWrapperElement).className="content-wrapper",__privateSet(this,_contentElement,document.createElement("div")),__privateGet(this,_contentElement).className="content",__privateSet(this,_slotElement,document.createElement("slot")),__privateGet(this,_contentElement).appendChild(__privateGet(this,_slotElement)),__privateGet(this,_contentWrapperElement).appendChild(__privateGet(this,_contentElement)),shadow.appendChild(__privateGet(this,_contentWrapperElement)),__privateSet(this,_mutationObserver,new MutationObserver(_function.debounce(()=>{this.tryResplit()},10)))}}get damped(){return __privateGet(this,_damped)}get controlsCSSProperty(){return __privateGet(this,_controlsCSSProperty)}get axisCSSProperty(){return __privateGet(this,_axisCSSProperty)}get reverseCSSProperty(){return __privateGet(this,_reverseCSSProperty)}get directionCSSProperty(){return __privateGet(this,_directionCSSProperty)}get pagesCSSProperty(){return __privateGet(this,_pagesCSSProperty)}get splitCSSProperty(){return __privateGet(this,_splitCSSProperty)}get sectionalCSSProperty(){return __privateGet(this,_sectionalCSSProperty)}get easingCSSProperty(){return __privateGet(this,_easingCSSProperty)}get durationCSSProperty(){return __privateGet(this,_durationCSSProperty)}get autoSizeCSSProperty(){return __privateGet(this,_autoSizeCSSProperty)}get wheelMaxDeltaCSSProperty(){return __privateGet(this,_wheelMaxDeltaCSSProperty)}get dragInertionCSSProperty(){return __privateGet(this,_dragInertionCSSProperty)}get sectionsInViewCSSProperty(){return __privateGet(this,_sectionsInViewCSSProperty)}get loopCSSProperty(){return __privateGet(this,_loopCSSProperty)}get dampingCSSProperty(){return __privateGet(this,_dampingCSSProperty)}get massCSSProperty(){return __privateGet(this,_massCSSProperty)}get stiffnessCSSProperty(){return __privateGet(this,_stiffnessCSSProperty)}get mouseDragCSSProperty(){return __privateGet(this,_mouseDragCSSProperty)}get sectionDistanceScaleCSSProperty(){return __privateGet(this,_sectionDistanceScaleCSSProperty)}get startSectionCSSProperty(){return __privateGet(this,_startSectionCSSProperty)}get autoplayCSSProperty(){return __privateGet(this,_autoplayCSSProperty)}get autoplayPauseDurationCSSProperty(){return __privateGet(this,_autoplayPauseDurationCSSProperty)}get autoplayUserDirectionCSSProperty(){return __privateGet(this,_autoplayUserDirectionCSSProperty)}get classesCSSProperty(){return __privateGet(this,_classesCSSProperty)}get currentIndexStartOffsetCSSProperty(){return __privateGet(this,_currentIndexStartOffsetCSSProperty)}get currentIndexEndOffsetCSSProperty(){return __privateGet(this,_currentIndexEndOffsetCSSProperty)}get shiftSectionPositionCSSProperty(){return __privateGet(this,_shiftSectionPositionCSSProperty)}get focusDelayCSSProperty(){return __privateGet(this,_focusDelayCSSProperty)}get focusDurationCSSProperty(){return __privateGet(this,_focusDurationCSSProperty)}get shiftLimitCSSProperty(){return __privateGet(this,_shiftLimitCSSProperty)}get disabledCSSProperty(){return __privateGet(this,_disabledCSSProperty)}get hibernatedCSSProperty(){return __privateGet(this,_hibernatedCSSProperty)}get currentScrollValue(){return __privateMethod(this,_ScrollElement_instances,getScrollValue_fn).call(this,"current")}get targetScrollValue(){return __privateMethod(this,_ScrollElement_instances,getScrollValue_fn).call(this,"target")}get contentWrapperElement(){return __privateGet(this,_contentWrapperElement)}get contentElement(){return __privateGet(this,_contentElement)}get sections(){return __privateGet(this,_sections)}get visibleSections(){return __privateGet(this,_visibleSections)}get position(){return __privateGet(this,_position2)}get contentPosition(){return __privateGet(this,_contentPosition)}get viewportSize(){return __privateGet(this,_viewportSize)}get scrollSize(){return __privateGet(this,_scrollSize)}get gap(){return __privateGet(this,_gap)}get counter(){return __privateGet(this,_counter)}get limit(){return Math.ceil(__privateGet(this,_visibleSections).length-__privateGet(this,_sectionsInViewCSSProperty).current+__privateGet(this,_shiftLimitCSSProperty).current)}get distance(){return __privateGet(this,_distance)}get loopDistance(){return __privateGet(this,_loopCSSProperty).current?__privateGet(this,_distance)+__privateGet(this,_gap):__privateGet(this,_distance)}get hasOverflow(){return __privateGet(this,_hasOverflow)}get overscroll(){return __privateGet(this,_overscroll)}get scrollLine(){return __privateGet(this,_scrollLine)}get vertical(){return __privateGet(this,_axisCSSProperty).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return __privateGet(this,_axisCSSProperty).current==="y"?0:__privateGet(this,_damped).distance}get scrollHeight(){return __privateGet(this,_axisCSSProperty).current==="x"?0:__privateGet(this,_damped).distance}tryResplit(){!__privateGet(this,_hibernated)&&(__privateGet(this,_loopCSSProperty).current||__privateGet(this,_splitCSSProperty).current||__privateGet(this,_loopCSSProperty).current||__privateGet(this,_autoSizeCSSProperty).current||__privateGet(this,_sectionalCSSProperty).current)&&__privateMethod(this,_ScrollElement_instances,split_fn).call(this)}onScroll(...parameters){return __privateGet(this,_damped).subscribe(...parameters)}offScroll(...parameters){__privateGet(this,_damped).unsubscribe(...parameters)}range(from,distance,margin=0){const start=from-margin,end=start+distance+margin*2;return this.currentProgress<start?0:this.currentProgress>end?1:(this.currentProgress-start)/(end-start)}curve(from,distance,margin=0){return Math.sin(this.range(from,distance,margin)*Math.PI)}visible(from,distance,margin=0){const start=from-margin,end=start+distance+margin*2;return this.currentProgress>=start&&this.currentProgress<=end}scrollToSection(sectionIndex,options){if(!__privateGet(this,_visibleSections).length||__privateGet(this,_hibernated)||__privateGet(this,_tweenTimeoutId))return;const previousCounter=__privateGet(this,_counter).current,newCounterValue=__privateMethod(this,_ScrollElement_instances,clampCounter_fn).call(this,sectionIndex);__privateGet(this,_isGrabbing)||(__privateGet(this,_counter).current=newCounterValue);const previousSection=__privateGet(this,_visibleSections)[previousCounter],currentSection=__privateGet(this,_visibleSections)[newCounterValue];if(previousSection&&currentSection){let shiftValue=0;const nearestSectionIndex=__privateMethod(this,_ScrollElement_instances,getNearestSectionIndex_fn).call(this),nearestSection=__privateGet(this,_visibleSections)[nearestSectionIndex];let scrolledFromNearestSection=nearestSection?this.targetScrollValue-nearestSection.position:0;__privateGet(this,_loopCSSProperty).current?newCounterValue===0&&previousCounter===__privateGet(this,_visibleSections).length-1?(shiftValue=__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize)-previousSection.position+__privateGet(this,_gap),__privateGet(this,_isGrabbing)||(scrolledFromNearestSection=0)):newCounterValue===__privateGet(this,_visibleSections).length-1&&previousCounter===0?shiftValue=currentSection.position-(__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize)+__privateGet(this,_gap)):shiftValue=currentSection.position-previousSection.position:shiftValue=currentSection.position-previousSection.position,this.shiftPosition(shiftValue-scrolledFromNearestSection,options)}}shiftSections(step,options){__privateGet(this,_visibleSections).length&&this.scrollToSection(__privateGet(this,_counter).current+step,options)}setPosition(value,options){__privateGet(this,_hibernated)||(__privateMethod(this,_ScrollElement_instances,processAutoplay_fn).call(this,Math.sign(value)||1),options!=null&&options.tween?(clearTimeout(__privateGet(this,_tweenTimeoutId)),__privateGet(this,_setTween).set(__privateGet(this,_damped).current,{equalize:!0}),__privateGet(this,_setTween).set(value,__spreadValues({},options.tween)),__privateSet(this,_tweenTimeoutId,setTimeout(()=>{__privateSet(this,_tweenTimeoutId,void 0)},options.tween.duration||0))):__privateGet(this,_damped).set(value,{equalize:(options==null?void 0:options.behaviour)==="instant"}))}shiftPosition(value,options){this.setPosition(__privateGet(this,_damped).target+value,options)}resize(){if(__privateGet(this,_hibernatedCSSProperty).current)return;__privateSet(this,_visibleSections,__privateGet(this,_sections).filter(s=>element.isElementVisible(s.element))),this.style.setProperty("--sections",__privateGet(this,_visibleSections).length.toString()),__privateGet(this,_damped).unlistenAnimationFrame();const prevProgress=this.currentScrollValue/__privateGet(this,_scrollSize)||0,prevCounter=__privateGet(this,_counter).current;if(__privateSet(this,_position2,this.vertical?layout.getCumulativeOffsetTop(this):layout.getCumulativeOffsetLeft(this)),__privateSet(this,_contentPosition,this.vertical?layout.getCumulativeOffsetTop(__privateGet(this,_contentElement)):layout.getCumulativeOffsetLeft(__privateGet(this,_contentElement))),__privateSet(this,_viewportSize,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?__privateSet(this,_gap,cssUnitParser_index.cssUnitParser.parse(getComputedStyle(__privateGet(this,_contentElement)).rowGap)):__privateSet(this,_gap,cssUnitParser_index.cssUnitParser.parse(getComputedStyle(__privateGet(this,_contentElement)).columnGap)),__privateGet(this,_autoSizeCSSProperty).current&&__privateGet(this,_visibleSections).length){const ivc=__privateGet(this,_sectionsInViewCSSProperty).current,sectionSize=(__privateGet(this,_viewportSize)-__privateGet(this,_gap)*(ivc-1))/ivc;__privateGet(this,_visibleSections).forEach(section=>{section.setSize(sectionSize)})}else __privateGet(this,_visibleSections).forEach(section=>{section.setSize()});if(__privateGet(this,_visibleSections).forEach(section=>{section.resize()}),__privateGet(this,_pagesCSSProperty).current){__privateSet(this,_scrollSize,__privateGet(this,_viewportSize)*__privateGet(this,_pagesCSSProperty).current);const contentSize=__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize);this.vertical?(__privateGet(this,_contentElement).style.width=contentSize+"px",__privateGet(this,_contentElement).style.height="100%"):(__privateGet(this,_contentElement).style.height=contentSize+"px",__privateGet(this,_contentElement).style.width="100%")}else this.vertical?(__privateGet(this,_contentElement).style.width="100%",__privateGet(this,_contentElement).style.height="max-content",__privateSet(this,_scrollSize,__privateGet(this,_contentElement).offsetHeight-__privateGet(this,_viewportSize))):(__privateGet(this,_contentElement).style.width="max-content",__privateGet(this,_contentElement).style.height="100%",__privateSet(this,_scrollSize,__privateGet(this,_contentElement).offsetWidth-__privateGet(this,_viewportSize)));if(!__privateGet(this,_loopCSSProperty).current){const cs=getComputedStyle(this),padding=this.vertical?parseFloat(cs.paddingBlockStart)+parseFloat(cs.paddingBlockEnd):parseFloat(cs.paddingInlineStart)+parseFloat(cs.paddingInlineEnd);__privateSet(this,_scrollSize,__privateGet(this,_scrollSize)+padding),__privateGet(this,_damped).max=__privateGet(this,_scrollSize)}if(__privateGet(this,_loopCSSProperty).current&&__privateGet(this,_visibleSections).length){const lastSection=__privateGet(this,_visibleSections)[__privateGet(this,_visibleSections).length-1],lastSectionMax=lastSection.position+lastSection.size-__privateGet(this,_viewportSize),lastSectionMargin=__privateGet(this,_scrollSize)-lastSectionMax;__privateSet(this,_distance,lastSection.position+lastSection.size+lastSectionMargin)}else __privateSet(this,_distance,__privateGet(this,_scrollSize));if(__privateGet(this,_sectionalCSSProperty).current&&__privateGet(this,_visibleSections).length){const section=__privateGet(this,_visibleSections)[prevCounter];__privateGet(this,_damped).set(section.position,{equalize:!0})}else __privateGet(this,_damped).set(prevProgress*__privateGet(this,_scrollSize),{equalize:!0});__privateSet(this,_hasOverflow,(this.vertical?__privateGet(this,_contentElement).offsetHeight:__privateGet(this,_contentElement).offsetWidth)>__privateGet(this,_viewportSize)),this.classList.toggle("has-overflow",__privateGet(this,_hasOverflow)),__privateGet(this,_hasOverflow)?__privateGet(this,_disabledCSSProperty).current||__privateMethod(this,_ScrollElement_instances,enable_fn).call(this):__privateMethod(this,_ScrollElement_instances,disable_fn).call(this),__privateGet(this,_updateMaxSectionsSize).call(this),events.dispatchEvent(this,"scrollResize",{custom:!0}),__privateGet(this,_damped).notify()}connectedCallback(){scrollEntries_index.scrollEntries.register(this),__privateSet(this,_damped,new Damped.Damped(0,{damping:.01,min:0,order:order_index.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),__privateSet(this,_wheelControls,new DragControls.WheelControls({element:__privateGet(this,_contentElement)})),__privateGet(this,_wheelControls).changeEvent.subscribe(__privateGet(this,_notAutoplayControlListener)),__privateSet(this,_keyboardControls,new DragControls.KeyboardControls({element:this})),__privateGet(this,_keyboardControls).changeEvent.subscribe(__privateGet(this,_notAutoplayControlListener)),__privateSet(this,_dragControls,new DragControls.DragControls({element:__privateGet(this,_contentElement),rootElement:this})),__privateGet(this,_dragControls).changeEvent.subscribe(__privateGet(this,_notAutoplayControlListener)),__privateSet(this,_autoplayControls,new DragControls.AutoplayControls({culling:this})),__privateGet(this,_autoplayControls).changeEvent.subscribe(__privateGet(this,_controlsListener)),__privateGet(this,_axisCSSProperty).subscribe(()=>{__privateMethod(this,_ScrollElement_instances,updateAxis_fn).call(this)}),__privateGet(this,_reverseCSSProperty).subscribe(()=>{__privateMethod(this,_ScrollElement_instances,updateAxis_fn).call(this)}),__privateGet(this,_wheelMaxDeltaCSSProperty).subscribe(e=>{__privateGet(this,_wheelControls).axis=e.current?"max":__privateGet(this,_axisCSSProperty).current}),__privateGet(this,_dragInertionCSSProperty).subscribe(e=>{__privateGet(this,_dragControls).inertion=typeof e.current=="number"?e.current:1}),__privateGet(this,_pagesCSSProperty).subscribe(()=>{__privateGet(this,_isConnected)&&__privateGet(this,_resizeListener).call(this)}),__privateGet(this,_splitCSSProperty).subscribe(({current})=>{__privateGet(this,_isConnected)&&(current?__privateMethod(this,_ScrollElement_instances,split_fn).call(this):__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this))}),__privateGet(this,_sectionalCSSProperty).subscribe(e=>{__privateGet(this,_wheelControls).debounce=e.current,__privateGet(this,_dragControls).swipe=e.current,__privateGet(this,_autoplayControls).interval=e.current,__privateGet(this,_isConnected)&&(e.current&&!e.previous&&!__privateGet(this,_visibleSections).length?__privateMethod(this,_ScrollElement_instances,split_fn).call(this):!e.current&&e.previous&&__privateGet(this,_visibleSections).length&&__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this))}),__privateGet(this,_autoSizeCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&(__privateGet(this,_resizeListener).call(this),e.current&&!e.previous&&!__privateGet(this,_visibleSections).length?__privateMethod(this,_ScrollElement_instances,split_fn).call(this):!e.current&&e.previous&&__privateGet(this,_visibleSections).length&&__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this))}),__privateGet(this,_sectionsInViewCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&(__privateGet(this,_resizeListener).call(this),__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this))}),__privateGet(this,_loopCSSProperty).subscribe(e=>{e.current?(__privateGet(this,_isConnected)&&(__privateGet(this,_visibleSections).length||(__privateGet(this,_splitCSSProperty).current=!0)),__privateGet(this,_damped).max=1/0,__privateGet(this,_damped).min=-1/0):(__privateSet(this,_overscroll,0),__privateGet(this,_damped).max=__privateGet(this,_scrollSize),__privateGet(this,_damped).min=0),this.classList.toggle("loop",!!e.current)}),__privateGet(this,_dampingCSSProperty).subscribe(e=>{__privateGet(this,_damped).damping=e.current}),__privateGet(this,_massCSSProperty).subscribe(e=>{__privateGet(this,_damped).mass=e.current}),__privateGet(this,_stiffnessCSSProperty).subscribe(e=>{__privateGet(this,_damped).stiffness=e.current}),__privateGet(this,_autoplayCSSProperty).subscribe(e=>{__privateGet(this,_autoplayControls).speed=e.current,!__privateGet(this,_disabled)&&e.current&&!e.previous?__privateGet(this,_autoplayControls).connect():!e.current&&e.previous&&__privateGet(this,_autoplayControls).disconnect()}),__privateGet(this,_autoplayUserDirectionCSSProperty).subscribe(e=>{e.current||(__privateGet(this,_autoplayControls).direction=1)}),__privateGet(this,_classesCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)}),__privateGet(this,_currentIndexStartOffsetCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateGet(this,_classesCSSProperty).current&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)}),__privateGet(this,_currentIndexEndOffsetCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateGet(this,_classesCSSProperty).current&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)}),__privateGet(this,_shiftSectionPositionCSSProperty).subscribe(e=>{__privateGet(this,_isConnected)&&__privateGet(this,_damped).notify()}),__privateGet(this,_damped).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),__privateGet(this,_counter).subscribe(e=>{__privateGet(this,_hibernated)||(__privateGet(this,_visibleSections).length&&__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this),this.style.setProperty("--counter",e.current+""))}),__privateGet(this,_setTween).subscribe(e=>{__privateGet(this,_setTween).isRunning.current&&__privateGet(this,_damped).set(e.current,{equalize:!0})}),__privateGet(this,_disabledCSSProperty).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),__privateMethod(this,_ScrollElement_instances,disable_fn).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),__privateMethod(this,_ScrollElement_instances,enable_fn).call(this))}),__privateGet(this,_hibernatedCSSProperty).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),__privateMethod(this,_ScrollElement_instances,hibernate_fn).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),__privateMethod(this,_ScrollElement_instances,awake_fn).call(this))}),__privateGet(this,_controlsCSSProperty).observe(),__privateGet(this,_axisCSSProperty).observe(),__privateGet(this,_reverseCSSProperty).observe(),__privateGet(this,_directionCSSProperty).observe(),__privateGet(this,_pagesCSSProperty).observe(),__privateGet(this,_splitCSSProperty).observe(),__privateGet(this,_sectionalCSSProperty).observe(),__privateGet(this,_easingCSSProperty).observe(),__privateGet(this,_durationCSSProperty).observe(),__privateGet(this,_autoSizeCSSProperty).observe(),__privateGet(this,_wheelMaxDeltaCSSProperty).observe(),__privateGet(this,_dragInertionCSSProperty).observe(),__privateGet(this,_sectionsInViewCSSProperty).observe(),__privateGet(this,_loopCSSProperty).observe(),__privateGet(this,_dampingCSSProperty).observe(),__privateGet(this,_massCSSProperty).observe(),__privateGet(this,_stiffnessCSSProperty).observe(),__privateGet(this,_mouseDragCSSProperty).observe(),__privateGet(this,_sectionDistanceScaleCSSProperty).observe(),__privateGet(this,_startSectionCSSProperty).observe(),__privateGet(this,_autoplayCSSProperty).observe(),__privateGet(this,_autoplayCSSProperty).observe(),__privateGet(this,_autoplayPauseDurationCSSProperty).observe(),__privateGet(this,_autoplayUserDirectionCSSProperty).observe(),__privateGet(this,_classesCSSProperty).observe(),__privateGet(this,_currentIndexStartOffsetCSSProperty).observe(),__privateGet(this,_currentIndexEndOffsetCSSProperty).observe(),__privateGet(this,_shiftSectionPositionCSSProperty).observe(),__privateGet(this,_focusDelayCSSProperty).observe(),__privateGet(this,_focusDurationCSSProperty).observe(),__privateGet(this,_shiftLimitCSSProperty).observe(),__privateGet(this,_disabledCSSProperty).observe(),__privateGet(this,_hibernatedCSSProperty).observe(),windowResizer_index.windowResizer.subscribe(__privateGet(this,_connectListener),order_index.RESIZE_ORDER.LAST),__privateGet(this,_mutationObserver).observe(this,{childList:!0})}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),__privateGet(this,_controlsCSSProperty).unobserve(),__privateGet(this,_axisCSSProperty).unobserve(),__privateGet(this,_reverseCSSProperty).unobserve(),__privateGet(this,_directionCSSProperty).unobserve(),__privateGet(this,_pagesCSSProperty).unobserve(),__privateGet(this,_splitCSSProperty).unobserve(),__privateGet(this,_sectionalCSSProperty).unobserve(),__privateGet(this,_easingCSSProperty).unobserve(),__privateGet(this,_durationCSSProperty).unobserve(),__privateGet(this,_autoSizeCSSProperty).unobserve(),__privateGet(this,_wheelMaxDeltaCSSProperty).unobserve(),__privateGet(this,_dragInertionCSSProperty).unobserve(),__privateGet(this,_sectionsInViewCSSProperty).unobserve(),__privateGet(this,_loopCSSProperty).unobserve(),__privateGet(this,_dampingCSSProperty).unobserve(),__privateGet(this,_massCSSProperty).unobserve(),__privateGet(this,_stiffnessCSSProperty).unobserve(),__privateGet(this,_mouseDragCSSProperty).unobserve(),__privateGet(this,_sectionDistanceScaleCSSProperty).unobserve(),__privateGet(this,_startSectionCSSProperty).unobserve(),__privateGet(this,_autoplayCSSProperty).unobserve(),__privateGet(this,_autoplayPauseDurationCSSProperty).unobserve(),__privateGet(this,_autoplayUserDirectionCSSProperty).unobserve(),__privateGet(this,_classesCSSProperty).unobserve(),__privateGet(this,_currentIndexStartOffsetCSSProperty).unobserve(),__privateGet(this,_currentIndexEndOffsetCSSProperty).unobserve(),__privateGet(this,_shiftSectionPositionCSSProperty).unobserve(),__privateGet(this,_focusDelayCSSProperty).unobserve(),__privateGet(this,_focusDurationCSSProperty).unobserve(),__privateGet(this,_shiftLimitCSSProperty).unobserve(),__privateGet(this,_disabledCSSProperty).unobserve(),__privateGet(this,_hibernatedCSSProperty).unobserve(),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_connectListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener)),__privateMethod(this,_ScrollElement_instances,hibernate_fn).call(this),__privateGet(this,_mutationObserver).disconnect()}};_damped=new WeakMap,_controlsCSSProperty=new WeakMap,_axisCSSProperty=new WeakMap,_reverseCSSProperty=new WeakMap,_directionCSSProperty=new WeakMap,_pagesCSSProperty=new WeakMap,_splitCSSProperty=new WeakMap,_sectionalCSSProperty=new WeakMap,_easingCSSProperty=new WeakMap,_durationCSSProperty=new WeakMap,_autoSizeCSSProperty=new WeakMap,_wheelMaxDeltaCSSProperty=new WeakMap,_dragInertionCSSProperty=new WeakMap,_sectionsInViewCSSProperty=new WeakMap,_loopCSSProperty=new WeakMap,_dampingCSSProperty=new WeakMap,_massCSSProperty=new WeakMap,_stiffnessCSSProperty=new WeakMap,_mouseDragCSSProperty=new WeakMap,_sectionDistanceScaleCSSProperty=new WeakMap,_startSectionCSSProperty=new WeakMap,_autoplayCSSProperty=new WeakMap,_autoplayPauseDurationCSSProperty=new WeakMap,_autoplayUserDirectionCSSProperty=new WeakMap,_classesCSSProperty=new WeakMap,_currentIndexStartOffsetCSSProperty=new WeakMap,_currentIndexEndOffsetCSSProperty=new WeakMap,_shiftSectionPositionCSSProperty=new WeakMap,_focusDelayCSSProperty=new WeakMap,_focusDurationCSSProperty=new WeakMap,_shiftLimitCSSProperty=new WeakMap,_disabledCSSProperty=new WeakMap,_hibernatedCSSProperty=new WeakMap,_contentWrapperElement=new WeakMap,_contentElement=new WeakMap,_slotElement=new WeakMap,_sections=new WeakMap,_visibleSections=new WeakMap,_position2=new WeakMap,_contentPosition=new WeakMap,_viewportSize=new WeakMap,_scrollSize=new WeakMap,_gap=new WeakMap,_wheelControls=new WeakMap,_keyboardControls=new WeakMap,_dragControls=new WeakMap,_autoplayControls=new WeakMap,_counter=new WeakMap,_overscroll=new WeakMap,_distance=new WeakMap,_hasOverflow=new WeakMap,_disabled=new WeakMap,_hibernated=new WeakMap,_focusTimeoutId=new WeakMap,_tweenTimeoutId=new WeakMap,_setTween=new WeakMap,_isGrabbing=new WeakMap,_scrollLine=new WeakMap,_isConnected=new WeakMap,_mutationObserver=new WeakMap,_currentSections=new WeakMap,_skipNextResize=new WeakMap,_maxSectionSizeTimeoutId=new WeakMap,_ScrollElement_instances=new WeakSet,updateAxis_fn=__name(function(){const axis=__privateGet(this,_axisCSSProperty).current,reverse=__privateGet(this,_reverseCSSProperty).current?"-reverse":"";__privateGet(this,_contentElement).style.flexDirection=axis==="x"?`row${reverse}`:`column${reverse}`,__privateGet(this,_wheelControls).axis=__privateGet(this,_wheelMaxDeltaCSSProperty).current?"max":axis,__privateGet(this,_keyboardControls).dimension=axis==="x"?"width":"height",__privateGet(this,_dragControls).axis=axis,axis==="x"?this.style.touchAction="pan-y":axis==="y"&&(this.style.touchAction="pan-x"),__privateGet(this,_isConnected)&&__privateGet(this,_resizeListener).call(this)},"#updateAxis"),split_fn=__name(function(){__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this),__privateGet(this,_slotElement).assignedElements().forEach((element2,i)=>{element2 instanceof HTMLElement&&element2.tagName!=="SCRIPT"&&__privateGet(this,_sections).push(new ScrollSection(element2,i,this))}),__privateSet(this,_visibleSections,[...__privateGet(this,_sections)]),__privateGet(this,_contentElement).style.transform="",events.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),__privateGet(this,_resizeListener).call(this),__privateMethod(this,_ScrollElement_instances,updateMarks_fn).call(this)},"#split"),unsplit_fn=__name(function(){__privateGet(this,_sections).forEach(section=>{section.destroy()}),__privateSet(this,_sections,[]),__privateSet(this,_visibleSections,[]),__privateGet(this,_counter).reset(),__privateGet(this,_damped).reset(),this.style.removeProperty("--max-section-size"),events.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},"#unsplit"),disable_fn=__name(function(){__privateGet(this,_disabled)||(__privateSet(this,_disabled,!0),__privateGet(this,_damped).unsubscribe(__privateGet(this,_animatedChangeListener)),__privateGet(this,_damped).unlistenAnimationFrame(),clearInterval(__privateGet(this,_focusTimeoutId)),clearInterval(__privateGet(this,_tweenTimeoutId)),__privateGet(this,_setTween).unlistenAnimationFrame(),__privateGet(this,_wheelControls).disconnect(),__privateGet(this,_keyboardControls).disconnect(),__privateGet(this,_dragControls).disconnect(),__privateGet(this,_autoplayControls).disconnect(),__privateGet(this,_hasOverflow)||(this.sections.forEach(section=>{section.unsetTransform()}),__privateGet(this,_resizeListener).call(this)))},"#disable"),enable_fn=__name(function(){__privateGet(this,_disabled)&&(__privateSet(this,_disabled,!1),__privateGet(this,_damped).subscribe(__privateGet(this,_animatedChangeListener),-1e4),__privateGet(this,_damped).notify(),__privateGet(this,_wheelControls).connect(),__privateGet(this,_keyboardControls).connect(),__privateGet(this,_dragControls).connect(),__privateGet(this,_autoplayCSSProperty).current&&__privateGet(this,_autoplayControls).connect())},"#enable"),hibernate_fn=__name(function(){__privateGet(this,_hibernated)||(__privateSet(this,_hibernated,!0),clearTimeout(__privateGet(this,_maxSectionSizeTimeoutId)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),__privateMethod(this,_ScrollElement_instances,disable_fn).call(this),__privateGet(this,_contentElement).style.transform="",__privateGet(this,_contentElement).style.height="",__privateGet(this,_contentElement).style.width="",this.classList.remove("has-overflow","start","end"),this.style.removeProperty("--counter"),__privateGet(this,_sections).length?__privateMethod(this,_ScrollElement_instances,unsplit_fn).call(this):(__privateGet(this,_counter).reset(),__privateGet(this,_damped).reset()),scrollEntries_index.scrollEntries.unregister(this))},"#hibernate"),awake_fn=__name(function(){__privateGet(this,_hibernated)&&(__privateSet(this,_hibernated,!1),scrollEntries_index.scrollEntries.register(this),this.tryResplit(),__privateMethod(this,_ScrollElement_instances,enable_fn).call(this),this.scrollToSection(__privateGet(this,_startSectionCSSProperty).current,{behaviour:"instant"}),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener),order_index.RESIZE_ORDER.SCROLL))},"#awake"),_resizeListener=new WeakMap,_animatedChangeListener=new WeakMap,clampCounter_fn=__name(function(value){let counter=__privateGet(this,_counter).current;return __privateGet(this,_loopCSSProperty).current?counter=number.loopNumber(value,__privateGet(this,_visibleSections).length):counter=math.clamp(value,0,this.limit),counter},"#clampCounter"),_notAutoplayControlListener=new WeakMap,_controlsListener=new WeakMap,processAutoplay_fn=__name(function(direction=1){__privateGet(this,_autoplayUserDirectionCSSProperty).current&&(__privateGet(this,_autoplayControls).direction=direction),__privateGet(this,_autoplayCSSProperty).current&&__privateGet(this,_autoplayControls).pauseAndContinue(__privateGet(this,_autoplayPauseDurationCSSProperty).current,this.sectionalCSSProperty.current)},"#processAutoplay"),getScrollValue_fn=__name(function(type="current"){if(__privateGet(this,_loopCSSProperty).current&&__privateGet(this,_visibleSections).length){const mod=Math.floor(__privateGet(this,_damped)[type])%Math.floor(__privateGet(this,_scrollSize)+__privateGet(this,_viewportSize)+__privateGet(this,_gap));return mod<0?__privateGet(this,_scrollSize)+mod+__privateGet(this,_viewportSize)+__privateGet(this,_gap):mod}else return __privateGet(this,_damped)[type]},"#getScrollValue"),updateMarks_fn=__name(function(){if(__privateGet(this,_visibleSections).length){const counter=__privateGet(this,_counter).current+__privateGet(this,_currentIndexStartOffsetCSSProperty).current;if(counter===__privateGet(this,_currentIndexStartOffsetCSSProperty).current?__privateSet(this,_scrollLine,"start"):counter===this.limit?__privateSet(this,_scrollLine,"end"):__privateSet(this,_scrollLine,null),events.dispatchEvent(this,"scrollLine",{detail:{line:__privateGet(this,_scrollLine)}}),__privateGet(this,_classesCSSProperty).current){this.classList.remove("end","start"),__privateGet(this,_scrollLine)&&this.classList.add(__privateGet(this,_scrollLine));const sectionsInView=__privateGet(this,_sectionsInViewCSSProperty).current+__privateGet(this,_currentIndexEndOffsetCSSProperty).current;__privateSet(this,_currentSections,[]),__privateGet(this,_visibleSections).forEach((section,index)=>{section.setCurrentIndex(null),section.setCurrentIndexArc(null),section.setCurrentIndexArcAbs(null),section.setMiddle(!1);const overflow=counter-this.limit-1+__privateGet(this,_currentIndexEndOffsetCSSProperty).current,currentRange=counter+sectionsInView,vv=this.sections.length-currentRange;index>=counter&&index<currentRange||index<=overflow?(section.setMark("current"),__privateGet(this,_currentSections).push(section)):index>=currentRange&&index<currentRange+vv/2||index<=overflow+sectionsInView?section.setMark("next"):section.setMark("previous")}),__privateGet(this,_updateMaxSectionsSize).call(this)}}},"#updateMarks"),updateIndexes_fn=__name(function(){if(__privateGet(this,_classesCSSProperty).current){const middle=Math.floor(__privateGet(this,_currentSections).length/2);__privateGet(this,_currentSections).sort((a,b)=>a.element.getBoundingClientRect().left-b.element.getBoundingClientRect().left),__privateGet(this,_currentSections).forEach((section,i)=>{const arcIndex=i-middle;section.setCurrentIndex(i),section.setCurrentIndexArc(arcIndex),section.setCurrentIndexArcAbs(Math.abs(arcIndex)),section.setMiddle(i===middle)}),__privateGet(this,_visibleSections).forEach((section,i)=>{section.setOffsetIndex(i-(__privateGet(this,_counter).current+__privateGet(this,_sectionsInViewCSSProperty).current))})}},"#updateIndexes"),_updateMaxSectionsSize=new WeakMap,getNearestSectionIndex_fn=__name(function(NAMEIT=!1){let scrollValue=this.targetScrollValue,minDiff=1/0,nearestIndex=0;const dir=__privateGet(this,_damped).direction;for(let i=0;i<__privateGet(this,_visibleSections).length;i++){const section=__privateGet(this,_visibleSections)[i];let offset=__privateGet(this,_isGrabbing)?section.size*dir*-1*.4:0,position=section.position;this.overscroll&&position===0&&NAMEIT&&(position=__privateGet(this,_distance));let diff=Math.abs(position+offset-scrollValue);diff<=minDiff&&(minDiff=diff,nearestIndex=i)}return nearestIndex},"#getNearestSectionIndex"),_connectListener=new WeakMap,__name(_ScrollElement,"ScrollElement");let ScrollElement=_ScrollElement;intersector_index.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",ScrollElement);var _scrollElement2;const _ScrollUserElement=class _ScrollUserElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_scrollElement2,null)}get scrollElement(){return __privateGet(this,_scrollElement2)}connectedCallback(){const scrollElement=dom.findParentElement(this,ScrollElement);scrollElement instanceof ScrollElement?__privateSet(this,_scrollElement2,scrollElement):console.error(this,"e-scroll not found")}};_scrollElement2=new WeakMap,__name(_ScrollUserElement,"ScrollUserElement");let ScrollUserElement=_ScrollUserElement;var _slotElement2,_thumbElement,_isHorisontal,_thumbSize,_thumbScrollSize,_position3,_resizeListener2,_scrollListener,_axisListener,_grabListener;const _ScrollScrollbarElement=class _ScrollScrollbarElement extends ScrollUserElement{constructor(){super();__privateAdd(this,_slotElement2,null);__privateAdd(this,_thumbElement,null);__privateAdd(this,_isHorisontal,!1);__privateAdd(this,_thumbSize,0);__privateAdd(this,_thumbScrollSize,0);__privateAdd(this,_position3,0);__privateAdd(this,_resizeListener2,__name(()=>{__privateSet(this,_isHorisontal,this.offsetWidth>this.offsetHeight);const barSize=__privateGet(this,_isHorisontal)?this.offsetWidth:this.offsetHeight;__privateSet(this,_thumbSize,barSize/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/barSize)),__privateSet(this,_thumbSize,Math.max(__privateGet(this,_thumbSize),30)),__privateGet(this,_isHorisontal)?(__privateGet(this,_thumbElement).style.width=__privateGet(this,_thumbSize)+"px",__privateGet(this,_thumbElement).style.height="100%"):(__privateGet(this,_thumbElement).style.width="100%",__privateGet(this,_thumbElement).style.height=__privateGet(this,_thumbSize)+"px"),__privateSet(this,_thumbScrollSize,barSize-__privateGet(this,_thumbSize)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",__privateGet(this,_scrollListener).call(this)},"#resizeListener"));__privateAdd(this,_scrollListener,__name(()=>{__privateSet(this,_position3,this.scrollElement.currentProgress*__privateGet(this,_thumbScrollSize)),__privateGet(this,_isHorisontal)?__privateGet(this,_thumbElement).style.transform=`translate3d(${__privateGet(this,_position3)}px, 0px, 0px)`:__privateGet(this,_thumbElement).style.transform=`translate3d(0px, ${__privateGet(this,_position3)}px, 0px)`},"#scrollListener"));__privateAdd(this,_axisListener,__name(()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)},"#axisListener"));__privateAdd(this,_grabListener,__name(grabEvent=>{gestures.setupDrag(moveEvent=>{const moveCursor=__privateGet(this,_isHorisontal)?moveEvent.x:moveEvent.y,mult=this.scrollElement.distance/__privateGet(this,_thumbScrollSize),delta=(moveCursor-grabCursor)*mult;this.scrollElement.setPosition(startValue+delta)});const startValue=this.scrollElement.damped.target,grabCursor=__privateGet(this,_isHorisontal)?grabEvent.x:grabEvent.y},"#grabListener"));if(intersector_index.isBrowser){const shadow=this.attachShadow({mode:"open"});shadow.adoptedStyleSheets=[stylesheet$1.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],__privateSet(this,_slotElement2,document.createElement("slot")),__privateGet(this,_slotElement2).innerHTML='<div class="default-thumb"></div>',shadow.appendChild(__privateGet(this,_slotElement2))}}get thumbElement(){return __privateGet(this,_thumbElement)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const slottedThumb=__privateGet(this,_slotElement2).assignedElements()[0]||__privateGet(this,_slotElement2).firstElementChild;__privateSet(this,_thumbElement,slottedThumb),__privateGet(this,_thumbElement).addEventListener("pointerdown",__privateGet(this,_grabListener)),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener2),order_index.RESIZE_ORDER.SCROLL),elementResizer_index.elementResizer.subscribe(this,__privateGet(this,_resizeListener2)),elementResizer_index.elementResizer.subscribe(this.scrollElement,__privateGet(this,_resizeListener2)),this.scrollElement.onScroll(__privateGet(this,_scrollListener)),this.scrollElement.axisCSSProperty.subscribe(__privateGet(this,_axisListener))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",__privateGet(this,_thumbElement).removeEventListener("pointerdown",__privateGet(this,_grabListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener2)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener2)),this.scrollElement.offScroll(__privateGet(this,_scrollListener)),this.scrollElement.axisCSSProperty.unsubscribe(__privateGet(this,_axisListener))}};_slotElement2=new WeakMap,_thumbElement=new WeakMap,_isHorisontal=new WeakMap,_thumbSize=new WeakMap,_thumbScrollSize=new WeakMap,_position3=new WeakMap,_resizeListener2=new WeakMap,_scrollListener=new WeakMap,_axisListener=new WeakMap,_grabListener=new WeakMap,__name(_ScrollScrollbarElement,"ScrollScrollbarElement");let ScrollScrollbarElement=_ScrollScrollbarElement;intersector_index.isBrowser&&!customElements.get("e-scroll-scrollbar")&&customElements.define("e-scroll-scrollbar",ScrollScrollbarElement);var _behaviour,_easing,_duration;const _ScrollButtonElement=class _ScrollButtonElement extends ScrollUserElement{constructor(){super();__privateAdd(this,_behaviour,new cssProperty_index.CSSProperty(this,"--behaviour","smooth"));__privateAdd(this,_easing,new cssProperty_index.CSSProperty(this,"--tween-easing",!1));__privateAdd(this,_duration,new cssProperty_index.CSSProperty(this,"--tween-duration",0));intersector_index.isBrowser&&this.addEventListener("click",()=>{const behaviour=__privateGet(this,_behaviour).current,easing=__privateGet(this,_easing).current,duration=__privateGet(this,_duration).current;this.handleClick({behaviour,tween:easing||duration?{easing,duration}:void 0})})}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),__privateGet(this,_behaviour).observe(),__privateGet(this,_easing).observe(),__privateGet(this,_duration).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),this.removeAttribute("role"),__privateGet(this,_behaviour).close(),__privateGet(this,_easing).close(),__privateGet(this,_duration).close()}};_behaviour=new WeakMap,_easing=new WeakMap,_duration=new WeakMap,__name(_ScrollButtonElement,"ScrollButtonElement");let ScrollButtonElement=_ScrollButtonElement;var _set;const _ScrollSetButtonElement=class _ScrollSetButtonElement extends ScrollButtonElement{constructor(){super(...arguments);__privateAdd(this,_set,new cssProperty_index.CSSProperty(this,"--set",1))}handleClick(options){this.scrollElement.scrollToSection(__privateGet(this,_set).current,options)}connectedCallback(){super.connectedCallback(),__privateGet(this,_set).observe()}disconnectedCallback(){super.disconnectedCallback(),__privateGet(this,_set).close()}};_set=new WeakMap,__name(_ScrollSetButtonElement,"ScrollSetButtonElement");let ScrollSetButtonElement=_ScrollSetButtonElement;intersector_index.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",ScrollSetButtonElement);var _step,_scrollLineListener;const _ScrollStepButtonElement=class _ScrollStepButtonElement extends ScrollButtonElement{constructor(){super(...arguments);__privateAdd(this,_step,new cssProperty_index.CSSProperty(this,"--step",1));__privateAdd(this,_scrollLineListener,__name(()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):__privateGet(this,_step).current>0&&this.scrollElement.scrollLine==="end"||__privateGet(this,_step).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")},"#scrollLineListener"))}handleClick(options){this.scrollElement.shiftSections(__privateGet(this,_step).current,options)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(__privateGet(this,_step).subscribe(()=>{__privateGet(this,_scrollLineListener).call(this)}),__privateGet(this,_step).observe(),this.scrollElement.addEventListener("scrollLine",__privateGet(this,_scrollLineListener)),__privateGet(this,_scrollLineListener).call(this))}disconnectedCallback(){super.disconnectedCallback(),__privateGet(this,_step).close(),this.removeAttribute("disabled")}};_step=new WeakMap,_scrollLineListener=new WeakMap,__name(_ScrollStepButtonElement,"ScrollStepButtonElement");let ScrollStepButtonElement=_ScrollStepButtonElement;intersector_index.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",ScrollStepButtonElement);var _element2,_scrollElement3,_index2,_behaviour2,_clickListener,_counterChangeListener;const _BulletButton=class _BulletButton{constructor(scrollElement,index,behaviour){__privateAdd(this,_element2,null);__privateAdd(this,_scrollElement3,null);__privateAdd(this,_index2,null);__privateAdd(this,_behaviour2,null);__privateAdd(this,_clickListener,__name(()=>{__privateGet(this,_scrollElement3).scrollToSection(__privateGet(this,_index2),{behaviour:__privateGet(this,_behaviour2)})},"#clickListener"));__privateAdd(this,_counterChangeListener,__name(()=>{__privateGet(this,_element2).classList.toggle("current",__privateGet(this,_scrollElement3).counter.current===__privateGet(this,_index2))},"#counterChangeListener"));intersector_index.isBrowser&&(__privateSet(this,_element2,document.createElement("button")),__privateGet(this,_element2).setAttribute("aria-label",`Go to section ${index+1}`),__privateSet(this,_scrollElement3,scrollElement),__privateSet(this,_behaviour2,behaviour),__privateSet(this,_index2,index),__privateGet(this,_element2).addEventListener("click",__privateGet(this,_clickListener)),__privateGet(this,_scrollElement3).counter.subscribe(__privateGet(this,_counterChangeListener)),__privateGet(this,_counterChangeListener).call(this))}get element(){return __privateGet(this,_element2)}destroy(){__privateGet(this,_element2).removeEventListener("click",__privateGet(this,_clickListener)),__privateGet(this,_scrollElement3).counter.unsubscribe(__privateGet(this,_counterChangeListener)),__privateGet(this,_element2).remove()}};_element2=new WeakMap,_scrollElement3=new WeakMap,_index2=new WeakMap,_behaviour2=new WeakMap,_clickListener=new WeakMap,_counterChangeListener=new WeakMap,__name(_BulletButton,"BulletButton");let BulletButton=_BulletButton;var _contentElement2,_buttons,_sectionsChangeListener;const _ScrollBulletButtonsElement=class _ScrollBulletButtonsElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_contentElement2,null);__privateAdd(this,_buttons,[]);__privateAdd(this,_sectionsChangeListener,_function.debounce(()=>{__privateGet(this,_buttons).forEach(b=>b.destroy()),__privateSet(this,_buttons,[]);let length=0;this.scrollElement.loopCSSProperty.current?length=this.scrollElement.visibleSections.length:length=this.scrollElement.visibleSections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let index=0;index<length;index++){const button=new BulletButton(this.scrollElement,index,this.getAttribute("behaviour")||"smooth");__privateGet(this,_contentElement2).appendChild(button.element),__privateGet(this,_buttons).push(button)}},0))}connectedCallback(){super.connectedCallback(),this.innerHTML="",__privateSet(this,_contentElement2,document.createElement("div")),this.appendChild(__privateGet(this,_contentElement2)),this.scrollElement.addEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener)),this.scrollElement.sectionsInViewCSSProperty.subscribe(__privateGet(this,_sectionsChangeListener)),this.scrollElement.loopCSSProperty.subscribe(__privateGet(this,_sectionsChangeListener)),__privateGet(this,_sectionsChangeListener).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(__privateGet(this,_sectionsChangeListener)),this.scrollElement.loopCSSProperty.unsubscribe(__privateGet(this,_sectionsChangeListener)),__privateGet(this,_buttons).forEach(b=>b.destroy()),__privateSet(this,_buttons,[]),__privateGet(this,_contentElement2).remove()}};_contentElement2=new WeakMap,_buttons=new WeakMap,_sectionsChangeListener=new WeakMap,__name(_ScrollBulletButtonsElement,"ScrollBulletButtonsElement");let ScrollBulletButtonsElement=_ScrollBulletButtonsElement;intersector_index.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",ScrollBulletButtonsElement);var _dampingCSSProperty2,_massCSSProperty2,_stiffnessCSSProperty2,_targetCSSProperty,_disabledCSSProperty2,_distanceOffsetCSSProperty,_startOffsetCSSProperty,_captureOnceCSSProperty,_capturedCSSProperty,_releasedCSSProperty,_capturedFromStartCSSProperty,_capturedFromFinishCSSProperty,_releasedFromStartCSSProperty,_releasedFromFinishCSSProperty,_passedVarCSSProperty,_progressVarCSSProperty,_progressArcVarCSSProperty,_progressArcMultCSSProperty,_animationVarTypeCSSProperty,_distanceVarCSSProperty,_startVarCSSProperty,_finishVarCSSProperty,_isCaptured,_isReleased,_isCapturedFromStart,_isReleasedFromStart,_isCapturedFromFinish,_isReleasedFromFinish,_anotherScrollEntries,_targetElement,_directionPosition,_directionSize,_moverDirectionSize,_passed,_progress,_start,_distance2,_finish,_isResized,_isCapturedOnce,_isDisabled,_skipPassNotification,_ScrollSegmentElement_instances,captureListener_fn,releaseListener_fn,captureFromStartListener_fn,captureFromFinishListener_fn,releaseFromStartListener_fn,releaseFromFinishListener_fn,_resizeListener3,_tickListener,updateProgress_fn,handleClassSetting_fn,removeClasses_fn,removeVars_fn,removeCurrentMarks_fn;const _ScrollSegmentElement=class _ScrollSegmentElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_ScrollSegmentElement_instances);__privateAdd(this,_dampingCSSProperty2);__privateAdd(this,_massCSSProperty2);__privateAdd(this,_stiffnessCSSProperty2);__privateAdd(this,_targetCSSProperty);__privateAdd(this,_disabledCSSProperty2);__privateAdd(this,_distanceOffsetCSSProperty);__privateAdd(this,_startOffsetCSSProperty);__privateAdd(this,_captureOnceCSSProperty);__privateAdd(this,_capturedCSSProperty);__privateAdd(this,_releasedCSSProperty);__privateAdd(this,_capturedFromStartCSSProperty);__privateAdd(this,_capturedFromFinishCSSProperty);__privateAdd(this,_releasedFromStartCSSProperty);__privateAdd(this,_releasedFromFinishCSSProperty);__privateAdd(this,_passedVarCSSProperty);__privateAdd(this,_progressVarCSSProperty);__privateAdd(this,_progressArcVarCSSProperty);__privateAdd(this,_progressArcMultCSSProperty);__privateAdd(this,_animationVarTypeCSSProperty);__privateAdd(this,_distanceVarCSSProperty);__privateAdd(this,_startVarCSSProperty);__privateAdd(this,_finishVarCSSProperty);__privateAdd(this,_isCaptured);__privateAdd(this,_isReleased);__privateAdd(this,_isCapturedFromStart);__privateAdd(this,_isReleasedFromStart);__privateAdd(this,_isCapturedFromFinish);__privateAdd(this,_isReleasedFromFinish);__privateAdd(this,_anotherScrollEntries);__privateAdd(this,_targetElement);__privateAdd(this,_directionPosition);__privateAdd(this,_directionSize);__privateAdd(this,_moverDirectionSize);__privateAdd(this,_passed);__privateAdd(this,_progress);__privateAdd(this,_start);__privateAdd(this,_distance2);__privateAdd(this,_finish);__privateAdd(this,_isResized);__privateAdd(this,_isCapturedOnce);__privateAdd(this,_isDisabled);__privateAdd(this,_skipPassNotification);__privateAdd(this,_resizeListener3);__privateAdd(this,_tickListener);__privateSet(this,_dampingCSSProperty2,new cssProperty_index.CSSProperty(this,"--damping",20)),__privateSet(this,_massCSSProperty2,new cssProperty_index.CSSProperty(this,"--mass",0)),__privateSet(this,_stiffnessCSSProperty2,new cssProperty_index.CSSProperty(this,"--stiffness",0)),__privateSet(this,_targetCSSProperty,new cssProperty_index.CSSProperty(this,"--target","")),__privateSet(this,_disabledCSSProperty2,new cssProperty_index.CSSProperty(this,"--disabled",!1)),__privateSet(this,_distanceOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),__privateSet(this,_startOffsetCSSProperty,new cssProperty_index.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),__privateSet(this,_captureOnceCSSProperty,new cssProperty_index.CSSProperty(this,"--capture-once",!1)),__privateSet(this,_capturedCSSProperty,new cssProperty_index.CSSProperty(this,"--captured","")),__privateSet(this,_releasedCSSProperty,new cssProperty_index.CSSProperty(this,"--released","")),__privateSet(this,_capturedFromStartCSSProperty,new cssProperty_index.CSSProperty(this,"--captured-from-start","")),__privateSet(this,_capturedFromFinishCSSProperty,new cssProperty_index.CSSProperty(this,"--captured-from-finish","")),__privateSet(this,_releasedFromStartCSSProperty,new cssProperty_index.CSSProperty(this,"--released-from-start","")),__privateSet(this,_releasedFromFinishCSSProperty,new cssProperty_index.CSSProperty(this,"--released-from-finish","")),__privateSet(this,_passedVarCSSProperty,new cssProperty_index.CSSProperty(this,"--passed-var","")),__privateSet(this,_progressVarCSSProperty,new cssProperty_index.CSSProperty(this,"--progress-var","")),__privateSet(this,_progressArcVarCSSProperty,new cssProperty_index.CSSProperty(this,"--progress-arc-var","")),__privateSet(this,_progressArcMultCSSProperty,new cssProperty_index.CSSProperty(this,"--progress-arc-mult",1)),__privateSet(this,_animationVarTypeCSSProperty,new cssProperty_index.CSSProperty(this,"--animation-var-type","target")),__privateSet(this,_distanceVarCSSProperty,new cssProperty_index.CSSProperty(this,"--distance-var","")),__privateSet(this,_startVarCSSProperty,new cssProperty_index.CSSProperty(this,"--start-var","")),__privateSet(this,_finishVarCSSProperty,new cssProperty_index.CSSProperty(this,"--finish-var","")),__privateSet(this,_isCaptured,new Store.Store(!1)),__privateSet(this,_isReleased,new Store.Store(!1)),__privateSet(this,_isCapturedFromStart,new Store.Store(!1)),__privateSet(this,_isReleasedFromStart,new Store.Store(!1)),__privateSet(this,_isCapturedFromFinish,new Store.Store(!1)),__privateSet(this,_isReleasedFromFinish,new Store.Store(!1)),__privateSet(this,_anotherScrollEntries,[]),__privateSet(this,_targetElement,this),__privateSet(this,_directionPosition,0),__privateSet(this,_directionSize,0),__privateSet(this,_moverDirectionSize,0),__privateSet(this,_passed,new Damped.Damped(0,{order:order_index.TICK_ORDER.SEGMENT,min:0,max:1})),__privateSet(this,_progress,0),__privateSet(this,_start,0),__privateSet(this,_distance2,0),__privateSet(this,_finish,0),__privateSet(this,_isResized,!1),__privateSet(this,_isCapturedOnce,!1),__privateSet(this,_isDisabled,!0),__privateSet(this,_skipPassNotification,!1),this.resize=()=>{__privateSet(this,_directionSize,this.scrollElement.vertical?this.offsetHeight:this.offsetWidth),__privateSet(this,_directionPosition,this.scrollElement.vertical?layout.getCumulativeOffsetTop(this,this.scrollElement):layout.getCumulativeOffsetLeft(this,this.scrollElement));const stickyOffset=layout.getStickyOffset(this,this.scrollElement.vertical?"top":"left");__privateSet(this,_directionPosition,__privateGet(this,_directionPosition)-stickyOffset),__privateSet(this,_start,this.getStart()),__privateSet(this,_distance2,this.getDistance()),__privateSet(this,_start,__privateGet(this,_start)+__privateGet(this,_startOffsetCSSProperty).current),__privateSet(this,_distance2,__privateGet(this,_distance2)+__privateGet(this,_distanceOffsetCSSProperty).current),__privateSet(this,_finish,__privateGet(this,_start)+__privateGet(this,_distance2)),this.scrollElement.currentScrollValue>__privateGet(this,_finish)&&!__privateGet(this,_isCaptured).current&&!__privateGet(this,_isReleased).current&&(__privateGet(this,_isCaptured).current=!0),this.setVar(__privateGet(this,_startVarCSSProperty).current,__privateGet(this,_start)),this.setVar(__privateGet(this,_finishVarCSSProperty).current,__privateGet(this,_finish)),this.setVar(__privateGet(this,_distanceVarCSSProperty).current,__privateGet(this,_distance2)),__privateGet(this,_passed).max=__privateGet(this,_distance2),__privateSet(this,_isResized,!0),__privateGet(this,_tickListener).call(this)},this.findAnotherScrollEntries=_function.debounce(()=>{const allScrollEntriesAbove=scrollEntries_index.scrollEntries.getAll(this).reverse();let scrollIndex=0;allScrollEntriesAbove.forEach((entry,i)=>{entry.element===this.scrollElement&&(scrollIndex=i)}),__privateSet(this,_anotherScrollEntries,allScrollEntriesAbove.slice(scrollIndex+1)),this.tick()},0),__privateSet(this,_resizeListener3,()=>{__privateGet(this,_isDisabled)||this.resize()}),__privateSet(this,_tickListener,()=>{!__privateGet(this,_isDisabled)&&__privateGet(this,_isResized)&&this.tick()})}get distanceOffsetCSSProperty(){return __privateGet(this,_distanceOffsetCSSProperty)}get startOffsetCSSProperty(){return __privateGet(this,_startOffsetCSSProperty)}get captureOnceCSSProperty(){return __privateGet(this,_captureOnceCSSProperty)}get capturedCSSProperty(){return __privateGet(this,_capturedCSSProperty)}get releasedCSSProperty(){return __privateGet(this,_releasedCSSProperty)}get capturedFromStartCSSProperty(){return __privateGet(this,_capturedFromStartCSSProperty)}get capturedFromFinishCSSProperty(){return __privateGet(this,_capturedFromFinishCSSProperty)}get releasedFromStartCSSProperty(){return __privateGet(this,_releasedFromStartCSSProperty)}get releasedFromFinishCSSProperty(){return __privateGet(this,_releasedFromFinishCSSProperty)}get passedVarCSSProperty(){return __privateGet(this,_passedVarCSSProperty)}get progressVarCSSProperty(){return __privateGet(this,_progressVarCSSProperty)}get progressArcVarCSSProperty(){return __privateGet(this,_progressArcVarCSSProperty)}get progressArcMultCSSProperty(){return __privateGet(this,_progressArcMultCSSProperty)}get animationVarTypeCSSProperty(){return __privateGet(this,_animationVarTypeCSSProperty)}get distanceVarCSSProperty(){return __privateGet(this,_distanceVarCSSProperty)}get startVarCSSProperty(){return __privateGet(this,_startVarCSSProperty)}get finishVarCSSProperty(){return __privateGet(this,_finishVarCSSProperty)}get disabledCSSProperty(){return __privateGet(this,_disabledCSSProperty2)}get dampingCSSProperty(){return __privateGet(this,_dampingCSSProperty2)}get massCSSProperty(){return __privateGet(this,_massCSSProperty2)}get stiffnessCSSProperty(){return __privateGet(this,_stiffnessCSSProperty2)}get targetCSSProperty(){return __privateGet(this,_targetCSSProperty)}get isCaptured(){return __privateGet(this,_isCaptured)}get isReleased(){return __privateGet(this,_isReleased)}get isCapturedFromStart(){return __privateGet(this,_isCapturedFromStart)}get isReleasedFromStart(){return __privateGet(this,_isReleasedFromStart)}get isCapturedFromFinish(){return __privateGet(this,_isCapturedFromFinish)}get isReleasedFromFinish(){return __privateGet(this,_isReleasedFromFinish)}get directionPosition(){return __privateGet(this,_directionPosition)}get directionSize(){return __privateGet(this,_directionSize)}get passed(){return __privateGet(this,_passed)}get progress(){return __privateGet(this,_progress)}get progressArc(){return Math.abs(Math.cos(__privateGet(this,_progress)*Math.PI))*__privateGet(this,_progressArcMultCSSProperty).current}get start(){return __privateGet(this,_start)}get finish(){return __privateGet(this,_finish)}get distance(){return __privateGet(this,_distance2)}get isCapturedOnce(){return __privateGet(this,_isCapturedOnce)}get isDisabled(){return __privateGet(this,_isDisabled)}tick(){let scrollValue=this.scrollElement.currentScrollValue;__privateGet(this,_anotherScrollEntries).forEach(se=>{scrollValue+=se.value});const delta=scrollValue-__privateGet(this,_start);__privateGet(this,_skipPassNotification)||__privateSet(this,_skipPassNotification,__privateGet(this,_passed).previous?Math.abs(__privateGet(this,_passed).previous-delta)>1e3:!1),__privateGet(this,_passed).set(delta);const fscrollValue=Math.round(scrollValue);__privateGet(this,_isCaptured).current&&(fscrollValue>=__privateGet(this,_start)?__privateGet(this,_isCapturedFromStart).current||__privateMethod(this,_ScrollSegmentElement_instances,captureFromStartListener_fn).call(this):__privateGet(this,_isCapturedFromStart).current&&!__privateGet(this,_isReleasedFromStart).current&&__privateMethod(this,_ScrollSegmentElement_instances,releaseFromStartListener_fn).call(this),fscrollValue<__privateGet(this,_finish)?__privateGet(this,_isReleasedFromFinish).current&&!__privateGet(this,_isCapturedFromFinish).current&&__privateMethod(this,_ScrollSegmentElement_instances,captureFromFinishListener_fn).call(this):__privateGet(this,_isCapturedFromStart).current&&!__privateGet(this,_isReleasedFromFinish).current&&__privateMethod(this,_ScrollSegmentElement_instances,releaseFromFinishListener_fn).call(this)),fscrollValue>=__privateGet(this,_start)&&fscrollValue<__privateGet(this,_finish)?__privateGet(this,_isCaptured).current||__privateMethod(this,_ScrollSegmentElement_instances,captureListener_fn).call(this):__privateGet(this,_isCaptured).current&&(__privateGet(this,_passed).set(math.step(__privateGet(this,_distance2)/2,__privateGet(this,_passed).target,0,__privateGet(this,_distance2))),__privateMethod(this,_ScrollSegmentElement_instances,releaseListener_fn).call(this)),__privateGet(this,_isCapturedOnce)&&__privateGet(this,_captureOnceCSSProperty).current&&(__privateGet(this,_capturedCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedCSSProperty).current),__privateSet(this,_isDisabled,!0))}disable(){this.style.cssText="",__privateSet(this,_directionPosition,0),__privateSet(this,_directionSize,0),__privateGet(this,_passed).reset(),__privateSet(this,_progress,0),__privateSet(this,_start,0),__privateSet(this,_distance2,0),__privateSet(this,_finish,0),__privateSet(this,_isResized,!1),__privateGet(this,_isCaptured).current=!1,__privateGet(this,_isReleased).current=!1,__privateGet(this,_isCapturedFromStart).current=!1,__privateGet(this,_isReleasedFromStart).current=!1,__privateGet(this,_isCapturedFromFinish).current=!1,__privateGet(this,_isReleasedFromFinish).current=!1,__privateSet(this,_isCapturedOnce,!1),__privateSet(this,_isDisabled,!0),__privateMethod(this,_ScrollSegmentElement_instances,removeCurrentMarks_fn).call(this)}enable(){__privateSet(this,_isDisabled,!1)}connectedCallback(){super.connectedCallback(),__privateGet(this,_isCaptured).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),__privateGet(this,_isCapturedFromStart).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),__privateGet(this,_isCapturedFromFinish).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),__privateGet(this,_isReleased).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),__privateGet(this,_isReleasedFromStart).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),__privateGet(this,_isReleasedFromFinish).subscribe(state=>{state.current&&events.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),__privateGet(this,_dampingCSSProperty2).observe(),__privateGet(this,_massCSSProperty2).observe(),__privateGet(this,_stiffnessCSSProperty2).observe(),__privateGet(this,_targetCSSProperty).observe(),__privateGet(this,_disabledCSSProperty2).observe(),__privateGet(this,_distanceOffsetCSSProperty).observe(),__privateGet(this,_startOffsetCSSProperty).observe(),__privateGet(this,_captureOnceCSSProperty).observe(),__privateGet(this,_capturedCSSProperty).observe(),__privateGet(this,_releasedCSSProperty).observe(),__privateGet(this,_capturedFromStartCSSProperty).observe(),__privateGet(this,_capturedFromFinishCSSProperty).observe(),__privateGet(this,_releasedFromStartCSSProperty).observe(),__privateGet(this,_releasedFromFinishCSSProperty).observe(),__privateGet(this,_passedVarCSSProperty).observe(),__privateGet(this,_progressVarCSSProperty).observe(),__privateGet(this,_progressArcVarCSSProperty).observe(),__privateGet(this,_progressArcMultCSSProperty).observe(),__privateGet(this,_animationVarTypeCSSProperty).observe(),__privateGet(this,_distanceVarCSSProperty).observe(),__privateGet(this,_startVarCSSProperty).observe(),__privateGet(this,_finishVarCSSProperty).observe();let isConnected=!1;this.findAnotherScrollEntries(),__privateGet(this,_disabledCSSProperty2).current||this.enable(),__privateGet(this,_dampingCSSProperty2).subscribe(e=>{__privateGet(this,_passed).damping=e.current}),__privateGet(this,_massCSSProperty2).subscribe(e=>{__privateGet(this,_passed).mass=e.current}),__privateGet(this,_stiffnessCSSProperty2).subscribe(e=>{__privateGet(this,_passed).stiffness=e.current}),__privateGet(this,_targetCSSProperty).subscribe(e=>{e.previous&&__privateMethod(this,_ScrollSegmentElement_instances,removeCurrentMarks_fn).call(this),e.current?e.current==="parent"?__privateSet(this,_targetElement,this.parentElement||this):__privateSet(this,_targetElement,document.querySelector(e.current)||this):__privateSet(this,_targetElement,this)}),__privateGet(this,_disabledCSSProperty2).subscribe(e=>{e.current&&!e.previous?this.disable():!e.current&&e.previous&&(this.resize(),this.enable())}),__privateGet(this,_startOffsetCSSProperty).subscribe(()=>{isConnected&&!__privateGet(this,_isDisabled)&&this.resize()}),__privateGet(this,_distanceOffsetCSSProperty).subscribe(()=>{isConnected&&!__privateGet(this,_isDisabled)&&this.resize()}),__privateGet(this,_capturedCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_capturedFromStartCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_capturedFromFinishCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_releasedCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_releasedFromStartCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_releasedFromFinishCSSProperty).subscribe(e=>{__privateMethod(this,_ScrollSegmentElement_instances,handleClassSetting_fn).call(this,e)}),__privateGet(this,_captureOnceCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||!v.current&&v.previous&&(this.resize(),this.enable())}),__privateGet(this,_passedVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,this.passed.current))}),__privateGet(this,_progressVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_progress)))}),__privateGet(this,_progressArcVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,this.progressArc))}),__privateGet(this,_progressArcMultCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||__privateMethod(this,_ScrollSegmentElement_instances,updateProgress_fn).call(this)}),__privateGet(this,_startVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_start)))}),__privateGet(this,_finishVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_finish)))}),__privateGet(this,_distanceVarCSSProperty).subscribe(v=>{__privateGet(this,_isDisabled)||(this.removeVar(v.previous),this.setVar(v.current,__privateGet(this,_distance2)))}),__privateGet(this,_passed).subscribe(e=>{if(__privateGet(this,_skipPassNotification)){__privateSet(this,_skipPassNotification,!1);return}__privateMethod(this,_ScrollSegmentElement_instances,updateProgress_fn).call(this)}),this.scrollElement.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollElement.addEventListener("scrollResize",this.resize),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener3),order_index.RESIZE_ORDER.SCROLL+1),this.scrollElement.onScroll(__privateGet(this,_tickListener)),isConnected=!0}disconnectedCallback(){windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener3)),this.scrollElement.offScroll(__privateGet(this,_tickListener)),this.scrollElement.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollElement.removeEventListener("scrollResize",this.resize),__privateGet(this,_dampingCSSProperty2).close(),__privateGet(this,_massCSSProperty2).close(),__privateGet(this,_stiffnessCSSProperty2).close(),__privateGet(this,_targetCSSProperty).close(),__privateGet(this,_disabledCSSProperty2).close(),__privateGet(this,_distanceOffsetCSSProperty).close(),__privateGet(this,_startOffsetCSSProperty).close(),__privateGet(this,_captureOnceCSSProperty).close(),__privateGet(this,_capturedCSSProperty).close(),__privateGet(this,_releasedCSSProperty).close(),__privateGet(this,_capturedFromStartCSSProperty).close(),__privateGet(this,_capturedFromFinishCSSProperty).close(),__privateGet(this,_releasedFromStartCSSProperty).close(),__privateGet(this,_releasedFromFinishCSSProperty).close(),__privateGet(this,_passedVarCSSProperty).close(),__privateGet(this,_progressVarCSSProperty).close(),__privateGet(this,_progressArcVarCSSProperty).close(),__privateGet(this,_progressArcMultCSSProperty).close(),__privateGet(this,_distanceVarCSSProperty).close(),__privateGet(this,_startVarCSSProperty).close(),__privateGet(this,_finishVarCSSProperty).close(),__privateGet(this,_isCaptured).close(),__privateGet(this,_isReleased).close(),__privateGet(this,_isCapturedFromStart).close(),__privateGet(this,_isReleasedFromStart).close(),__privateGet(this,_isCapturedFromFinish).close(),__privateGet(this,_isReleasedFromFinish).close(),this.disable(),__privateGet(this,_passed).close()}removeVar(name){name&&__privateGet(this,_targetElement).style.removeProperty(`--${name}`)}setVar(name,value){if(name){const v=typeof value=="number"?value.toFixed(6):value;__privateGet(this,_targetElement).style.setProperty(`--${name}`,v)}}getDistance(){return __privateGet(this,_directionSize)+__privateGet(this,_moverDirectionSize)}getStart(){return __privateGet(this,_directionPosition)-__privateGet(this,_moverDirectionSize)}};_dampingCSSProperty2=new WeakMap,_massCSSProperty2=new WeakMap,_stiffnessCSSProperty2=new WeakMap,_targetCSSProperty=new WeakMap,_disabledCSSProperty2=new WeakMap,_distanceOffsetCSSProperty=new WeakMap,_startOffsetCSSProperty=new WeakMap,_captureOnceCSSProperty=new WeakMap,_capturedCSSProperty=new WeakMap,_releasedCSSProperty=new WeakMap,_capturedFromStartCSSProperty=new WeakMap,_capturedFromFinishCSSProperty=new WeakMap,_releasedFromStartCSSProperty=new WeakMap,_releasedFromFinishCSSProperty=new WeakMap,_passedVarCSSProperty=new WeakMap,_progressVarCSSProperty=new WeakMap,_progressArcVarCSSProperty=new WeakMap,_progressArcMultCSSProperty=new WeakMap,_animationVarTypeCSSProperty=new WeakMap,_distanceVarCSSProperty=new WeakMap,_startVarCSSProperty=new WeakMap,_finishVarCSSProperty=new WeakMap,_isCaptured=new WeakMap,_isReleased=new WeakMap,_isCapturedFromStart=new WeakMap,_isReleasedFromStart=new WeakMap,_isCapturedFromFinish=new WeakMap,_isReleasedFromFinish=new WeakMap,_anotherScrollEntries=new WeakMap,_targetElement=new WeakMap,_directionPosition=new WeakMap,_directionSize=new WeakMap,_moverDirectionSize=new WeakMap,_passed=new WeakMap,_progress=new WeakMap,_start=new WeakMap,_distance2=new WeakMap,_finish=new WeakMap,_isResized=new WeakMap,_isCapturedOnce=new WeakMap,_isDisabled=new WeakMap,_skipPassNotification=new WeakMap,_ScrollSegmentElement_instances=new WeakSet,captureListener_fn=__name(function(){__privateGet(this,_isCaptured).current=!0,__privateGet(this,_isReleased).current=!1,__privateSet(this,_isCapturedOnce,!0),__privateGet(this,_releasedCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_releasedCSSProperty).current),__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_releasedFromFinishCSSProperty).current),__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_releasedFromFinishCSSProperty).current),__privateGet(this,_capturedCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedCSSProperty).current)},"#captureListener"),releaseListener_fn=__name(function(){__privateGet(this,_isReleased).current=!0,__privateGet(this,_isCaptured).current=!1,__privateSet(this,_isCapturedOnce,!0),__privateGet(this,_capturedCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_capturedCSSProperty).current),__privateGet(this,_capturedFromStartCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_capturedFromStartCSSProperty).current),__privateGet(this,_capturedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.remove(__privateGet(this,_capturedFromFinishCSSProperty).current),__privateGet(this,_releasedCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_releasedCSSProperty).current)},"#releaseListener"),captureFromStartListener_fn=__name(function(){__privateGet(this,_isCaptured).current=!0,__privateGet(this,_isCapturedFromStart).current=!0,__privateGet(this,_isReleasedFromStart).current=!1,__privateGet(this,_capturedFromStartCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedFromStartCSSProperty).current)},"#captureFromStartListener"),captureFromFinishListener_fn=__name(function(){__privateGet(this,_isCaptured).current=!0,__privateGet(this,_isCapturedFromFinish).current=!0,__privateGet(this,_isReleasedFromFinish).current=!1,__privateGet(this,_capturedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_capturedFromFinishCSSProperty).current)},"#captureFromFinishListener"),releaseFromStartListener_fn=__name(function(){__privateGet(this,_isReleased).current=!0,__privateGet(this,_isReleasedFromStart).current=!0,__privateGet(this,_isCapturedFromStart).current=!1,__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_releasedFromFinishCSSProperty).current)},"#releaseFromStartListener"),releaseFromFinishListener_fn=__name(function(){__privateGet(this,_isReleased).current=!0,__privateGet(this,_isReleasedFromFinish).current=!0,__privateGet(this,_isCapturedFromFinish).current=!1,__privateGet(this,_releasedFromFinishCSSProperty).current&&__privateGet(this,_targetElement).classList.add(__privateGet(this,_releasedFromFinishCSSProperty).current)},"#releaseFromFinishListener"),_resizeListener3=new WeakMap,_tickListener=new WeakMap,updateProgress_fn=__name(function(){const passedValue=__privateGet(this,_passed)[__privateGet(this,_animationVarTypeCSSProperty).current];this.setVar(__privateGet(this,_passedVarCSSProperty).current,passedValue),__privateSet(this,_progress,passedValue/__privateGet(this,_distance2)||0),this.setVar(__privateGet(this,_progressVarCSSProperty).current,__privateGet(this,_progress)),__privateGet(this,_progressArcVarCSSProperty).current&&this.setVar(__privateGet(this,_progressArcVarCSSProperty).current,this.progressArc)},"#updateProgress"),handleClassSetting_fn=__name(function(e){if(__privateGet(this,_isDisabled)){e.previous&&__privateGet(this,_targetElement).classList.remove(e.previous),e.current&&__privateGet(this,_targetElement).classList.remove(e.current);return}e.current&&__privateGet(this,_isCaptured).current?(e.previous&&__privateGet(this,_targetElement).classList.remove(e.previous),__privateGet(this,_targetElement).classList.add(e.current)):!e.current&&e.previous&&__privateGet(this,_targetElement).classList.remove(e.previous)},"#handleClassSetting"),removeClasses_fn=__name(function(...className){className.forEach(c=>{c&&__privateGet(this,_targetElement).classList.remove(c)})},"#removeClasses"),removeVars_fn=__name(function(...vars){vars.forEach(v=>{v&&__privateGet(this,_targetElement).style.removeProperty(`--${v}`)})},"#removeVars"),removeCurrentMarks_fn=__name(function(){__privateMethod(this,_ScrollSegmentElement_instances,removeClasses_fn).call(this,__privateGet(this,_capturedCSSProperty).current,__privateGet(this,_capturedFromStartCSSProperty).current,__privateGet(this,_capturedFromFinishCSSProperty).current,__privateGet(this,_releasedCSSProperty).current,__privateGet(this,_releasedFromStartCSSProperty).current,__privateGet(this,_releasedFromFinishCSSProperty).current),__privateMethod(this,_ScrollSegmentElement_instances,removeVars_fn).call(this,__privateGet(this,_passedVarCSSProperty).current,__privateGet(this,_progressVarCSSProperty).current,__privateGet(this,_progressArcVarCSSProperty).current,__privateGet(this,_distanceVarCSSProperty).current,__privateGet(this,_startVarCSSProperty).current,__privateGet(this,_finishVarCSSProperty).current)},"#removeCurrentMarks"),__name(_ScrollSegmentElement,"ScrollSegmentElement");let ScrollSegmentElement=_ScrollSegmentElement;intersector_index.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",ScrollSegmentElement);const _ScrollSectionButtonElement=class _ScrollSectionButtonElement extends ScrollButtonElement{handleClick(options){this.scrollElement.setPosition(this.scrollElement.vertical?layout.getCumulativeOffsetTop(this):layout.getCumulativeOffsetLeft(this),options)}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}};__name(_ScrollSectionButtonElement,"ScrollSectionButtonElement");let ScrollSectionButtonElement=_ScrollSectionButtonElement;intersector_index.isBrowser&&!customElements.get("e-scroll-section-button")&&customElements.define("e-scroll-section-button",ScrollSectionButtonElement);var _counterChangeListener2;const _ScrollCounterElement=class _ScrollCounterElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_counterChangeListener2,__name(()=>{const value=this.scrollElement.counter.current+1,pad=parseInt(this.getAttribute("pad")||"0");this.textContent=value.toString().padStart(pad,"0")},"#counterChangeListener"))}connectedCallback(){return __async(this,null,function*(){__superGet(_ScrollCounterElement.prototype,this,"connectedCallback").call(this),this.scrollElement.counter.subscribe(__privateGet(this,_counterChangeListener2))})}disconnectedCallback(){this.scrollElement.counter.unsubscribe(__privateGet(this,_counterChangeListener2))}};_counterChangeListener2=new WeakMap,__name(_ScrollCounterElement,"ScrollCounterElement");let ScrollCounterElement=_ScrollCounterElement;intersector_index.isBrowser&&!customElements.get("e-scroll-counter")&&customElements.define("e-scroll-counter",ScrollCounterElement);var _sectionsChangeListener2;const _ScrollTotalElement=class _ScrollTotalElement extends ScrollUserElement{constructor(){super(...arguments);__privateAdd(this,_sectionsChangeListener2,__name(()=>{const value=this.scrollElement.limit+1,pad=parseInt(this.getAttribute("pad")||"0");this.textContent=value.toString().padStart(pad,"0")},"#sectionsChangeListener"))}connectedCallback(){return __async(this,null,function*(){__superGet(_ScrollTotalElement.prototype,this,"connectedCallback").call(this),this.scrollElement.sectionsInViewCSSProperty.subscribe(__privateGet(this,_sectionsChangeListener2)),this.scrollElement.addEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener2)),__privateGet(this,_sectionsChangeListener2).call(this)})}disconnectedCallback(){this.scrollElement.sectionsInViewCSSProperty.unsubscribe(__privateGet(this,_sectionsChangeListener2)),this.scrollElement.removeEventListener("scrollSectionsChange",__privateGet(this,_sectionsChangeListener2))}};_sectionsChangeListener2=new WeakMap,__name(_ScrollTotalElement,"ScrollTotalElement");let ScrollTotalElement=_ScrollTotalElement;intersector_index.isBrowser&&!customElements.get("e-scroll-total")&&customElements.define("e-scroll-total",ScrollTotalElement);exports.ScrollBulletButtonsElement=ScrollBulletButtonsElement;exports.ScrollCounterElement=ScrollCounterElement;exports.ScrollElement=ScrollElement;exports.ScrollScrollbarElement=ScrollScrollbarElement;exports.ScrollSectionButtonElement=ScrollSectionButtonElement;exports.ScrollSegmentElement=ScrollSegmentElement;exports.ScrollSetButtonElement=ScrollSetButtonElement;exports.ScrollStepButtonElement=ScrollStepButtonElement;exports.ScrollTotalElement=ScrollTotalElement;
@@ -577,7 +577,7 @@ const _ScrollElement = class _ScrollElement extends HTMLElement {
577
577
  const previousCounter = __privateGet(this, _counter).current, newCounterValue = __privateMethod(this, _ScrollElement_instances, clampCounter_fn).call(this, sectionIndex);
578
578
  __privateGet(this, _isGrabbing) || (__privateGet(this, _counter).current = newCounterValue);
579
579
  const previousSection = __privateGet(this, _visibleSections)[previousCounter], currentSection = __privateGet(this, _visibleSections)[newCounterValue];
580
- if (console.log(newCounterValue), previousSection && currentSection) {
580
+ if (previousSection && currentSection) {
581
581
  let shiftValue = 0;
582
582
  const nearestSectionIndex = __privateMethod(this, _ScrollElement_instances, getNearestSectionIndex_fn).call(this), nearestSection = __privateGet(this, _visibleSections)[nearestSectionIndex];
583
583
  let scrolledFromNearestSection = nearestSection ? this.targetScrollValue - nearestSection.position : 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.85.0",
3
+ "version": "0.86.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"