aptechka 0.5.30 → 0.5.32

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.
@@ -0,0 +1,30 @@
1
+ import { ShaderPass } from './ShaderPass';
2
+ import { Texture, Vector2, WebGLRenderTarget } from 'three';
3
+
4
+ export interface AdvectionParameters {
5
+ cellScale: Vector2;
6
+ fboSize: Vector2;
7
+ dt: number;
8
+ src: WebGLRenderTarget<Texture>;
9
+ dst: WebGLRenderTarget<Texture>;
10
+ BFECC: boolean;
11
+ }
12
+ export interface AdvectionUpdateParameters {
13
+ dt: number;
14
+ isBounce: boolean;
15
+ BFECC: boolean;
16
+ }
17
+ export interface AdvectionUniforms {
18
+ boundarySpace: Vector2;
19
+ px: Vector2;
20
+ fboSize: Vector2;
21
+ velocity: Texture;
22
+ dt: number;
23
+ isBFECC: boolean;
24
+ }
25
+ export declare class Advection extends ShaderPass<AdvectionUniforms> {
26
+ #private;
27
+ constructor(parameters: AdvectionParameters);
28
+ update(parameters: AdvectionUpdateParameters): void;
29
+ protected init(): void;
30
+ }
@@ -0,0 +1,23 @@
1
+ import { ShaderPass } from './ShaderPass';
2
+ import { Texture, Vector2, WebGLRenderTarget } from 'three';
3
+
4
+ export interface DivergenceParameters {
5
+ boundarySpace: Vector2;
6
+ src: WebGLRenderTarget<Texture>;
7
+ cellScale: Vector2;
8
+ dt: number;
9
+ dst: WebGLRenderTarget<Texture>;
10
+ }
11
+ export interface DivergenceUpdateParameters {
12
+ vel: WebGLRenderTarget<Texture>;
13
+ }
14
+ export interface DivergenceUniforms {
15
+ boundarySpace: Vector2;
16
+ velocity: Texture;
17
+ px: Vector2;
18
+ dt: number;
19
+ }
20
+ export declare class Divergence extends ShaderPass<DivergenceUniforms> {
21
+ constructor(parameters: DivergenceParameters);
22
+ update(parameters: DivergenceUpdateParameters): void;
23
+ }
@@ -0,0 +1,16 @@
1
+ import { Store } from '../../../store';
2
+ import { Mesh, PlaneGeometry, RawShaderMaterial } from 'three';
3
+
4
+ export declare class En3Fluid extends Mesh<PlaneGeometry, RawShaderMaterial> {
5
+ #private;
6
+ colorTweenDuration: number;
7
+ constructor();
8
+ get backgroundColor(): Store<string, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<string>>;
9
+ get backgroundMixThreshold(): Store<number, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<number>>;
10
+ get backgroundOpacity(): Store<number, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<number>>;
11
+ get fluidColor(): Store<string, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<string>>;
12
+ get fluidOpacity(): Store<number, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<number>>;
13
+ resize(): void;
14
+ update(): void;
15
+ dispose(): void;
16
+ }
@@ -0,0 +1,14 @@
1
+ import { En3Fluid } from './En3Fluid';
2
+ import { CustomElement } from '../../../custom-element';
3
+
4
+ export declare class En3FluidElement extends CustomElement {
5
+ #private;
6
+ get fluid(): En3Fluid;
7
+ protected connectedCallback(): void;
8
+ protected disconnectedCallback(): void;
9
+ }
10
+ declare global {
11
+ interface HTMLElementTagNameMap {
12
+ 'e-fluid': En3FluidElement;
13
+ }
14
+ }
@@ -0,0 +1,13 @@
1
+ import * as THREE from 'three';
2
+ declare class En3FluidPointer {
3
+ #private;
4
+ disabled: boolean;
5
+ init(): void;
6
+ dispose(): void;
7
+ get coords(): THREE.Vector2;
8
+ get diff(): THREE.Vector2;
9
+ updateCoords(x?: number, y?: number): void;
10
+ update(): void;
11
+ }
12
+ export declare const en3FluidPointer: En3FluidPointer;
13
+ export {};
@@ -0,0 +1,19 @@
1
+ import { ShaderPass } from './ShaderPass';
2
+ import { Texture, Vector2, WebGLRenderTarget } from 'three';
3
+
4
+ export interface ExternalForceParameters {
5
+ cellScale: Vector2;
6
+ pointerSize: number;
7
+ dst: WebGLRenderTarget<Texture>;
8
+ }
9
+ export interface ExternalForceUpdateParameters {
10
+ cellScale: Vector2;
11
+ pointerForce: number;
12
+ pointerSize: number;
13
+ }
14
+ export declare class ExternalForce extends ShaderPass {
15
+ #private;
16
+ constructor(parameters: ExternalForceParameters);
17
+ update(parameters: ExternalForceUpdateParameters): void;
18
+ protected init(parameters: ExternalForceParameters): void;
19
+ }
@@ -0,0 +1,24 @@
1
+ import { ShaderPass } from './ShaderPass';
2
+ import { Texture, Vector2, WebGLRenderTarget } from 'three';
3
+
4
+ export interface PoissonParameters {
5
+ boundarySpace: Vector2;
6
+ dst: WebGLRenderTarget<Texture>;
7
+ dst_: WebGLRenderTarget<Texture>;
8
+ src: WebGLRenderTarget<Texture>;
9
+ cellScale: Vector2;
10
+ }
11
+ export interface PoissonUpdateParameters {
12
+ iterations: number;
13
+ }
14
+ export interface PoissonUniforms {
15
+ boundarySpace: Vector2;
16
+ pressure: Texture;
17
+ divergence: Texture;
18
+ px: Vector2;
19
+ }
20
+ export declare class Poisson extends ShaderPass<PoissonUniforms> {
21
+ #private;
22
+ constructor(parameters: PoissonParameters);
23
+ update(parameters: PoissonUpdateParameters): WebGLRenderTarget<Texture>;
24
+ }
@@ -0,0 +1,26 @@
1
+ import { ShaderPass } from './ShaderPass';
2
+ import { Texture, Vector2, WebGLRenderTarget } from 'three';
3
+
4
+ export interface PressureParameters {
5
+ boundarySpace: Vector2;
6
+ srcP: WebGLRenderTarget<Texture>;
7
+ srcV: WebGLRenderTarget<Texture>;
8
+ dst: WebGLRenderTarget<Texture>;
9
+ cellScale: Vector2;
10
+ dt: number;
11
+ }
12
+ export interface PressureUpdateParameters {
13
+ vel: WebGLRenderTarget<Texture>;
14
+ pressure: WebGLRenderTarget<Texture>;
15
+ }
16
+ export interface PressureUniforms {
17
+ boundarySpace: Vector2;
18
+ pressure: Texture;
19
+ velocity: Texture;
20
+ px: Vector2;
21
+ dt: number;
22
+ }
23
+ export declare class Pressure extends ShaderPass<PressureUniforms> {
24
+ constructor(parameters: PressureParameters);
25
+ update(parameters: PressureUpdateParameters): void;
26
+ }
@@ -0,0 +1,24 @@
1
+ import { Camera, Scene, ShaderMaterialParameters, Texture, WebGLRenderTarget } from 'three';
2
+
3
+ export interface ShaderPassParameters<Uniforms extends ShaderPassDefaultUniforms = ShaderPassDefaultUniforms> {
4
+ material?: Omit<ShaderMaterialParameters, 'uniforms'> & {
5
+ uniforms?: Uniforms;
6
+ };
7
+ output: WebGLRenderTarget<Texture>;
8
+ }
9
+ export type ShaderPassDefaultUniforms = {
10
+ [key: string]: any;
11
+ };
12
+ export declare class ShaderPass<Uniforms extends ShaderPassDefaultUniforms = ShaderPassDefaultUniforms> {
13
+ #private;
14
+ output: WebGLRenderTarget<Texture>;
15
+ constructor(parameters: ShaderPassParameters<Uniforms>);
16
+ get scene(): Scene;
17
+ get camera(): Camera;
18
+ get uniforms(): { [K in keyof Uniforms]: {
19
+ value: Uniforms[K];
20
+ }; };
21
+ update(..._args: any[]): void;
22
+ dispose(): void;
23
+ protected init(..._args: any[]): void;
24
+ }
@@ -0,0 +1,33 @@
1
+ import { WebGLRenderTarget } from 'three';
2
+ import { Store } from '../../../store';
3
+
4
+ export interface SimulationFBOS {
5
+ vel0: WebGLRenderTarget;
6
+ vel1: WebGLRenderTarget;
7
+ velViscous0: WebGLRenderTarget;
8
+ velViscous1: WebGLRenderTarget;
9
+ div: WebGLRenderTarget;
10
+ pressure0: WebGLRenderTarget;
11
+ pressure1: WebGLRenderTarget;
12
+ }
13
+ export declare class Simulation {
14
+ #private;
15
+ constructor();
16
+ get parameters(): {
17
+ isViscous: Store<boolean, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<boolean>>;
18
+ viscous: Store<number, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<number>>;
19
+ iterationsViscous: Store<number, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<number>>;
20
+ pointerForce: Store<number, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<number>>;
21
+ pointerSize: Store<number, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<number>>;
22
+ dt: Store<number, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<number>>;
23
+ iterationsPoisson: Store<number, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<number>>;
24
+ resolution: Store<number, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<number>>;
25
+ isBounce: Store<boolean, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<boolean>>;
26
+ BFECC: Store<boolean, keyof import('../../../store').StoreManagers, import('../../../store').StoreEntry<boolean>>;
27
+ };
28
+ get fbos(): SimulationFBOS;
29
+ resize(): void;
30
+ update(): void;
31
+ dispose(): void;
32
+ protected init(): void;
33
+ }
@@ -0,0 +1,30 @@
1
+ import { Texture, Vector2, WebGLRenderTarget } from 'three';
2
+ import { ShaderPass } from './ShaderPass';
3
+
4
+ export interface ViscousParameters {
5
+ boundarySpace: Vector2;
6
+ src: WebGLRenderTarget<Texture>;
7
+ dst_: WebGLRenderTarget<Texture>;
8
+ viscous: number;
9
+ cellScale: Vector2;
10
+ dt: number;
11
+ dst: WebGLRenderTarget<Texture>;
12
+ }
13
+ export interface ViscousUpdateParameters {
14
+ viscous: number;
15
+ iterations: number;
16
+ dt: number;
17
+ }
18
+ export interface ViscousUniforms {
19
+ boundarySpace: Vector2;
20
+ velocity: Texture;
21
+ velocity_new: Texture;
22
+ v: number;
23
+ px: Vector2;
24
+ dt: number;
25
+ }
26
+ export declare class Viscous extends ShaderPass<ViscousUniforms> {
27
+ #private;
28
+ constructor(parameters: ViscousParameters);
29
+ update(parameters: ViscousUpdateParameters): WebGLRenderTarget<Texture>;
30
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Based on https://github.com/mnmxmx/fluid-three
3
+ */
4
+ export { En3Fluid } from './En3Fluid';
5
+ export { En3FluidElement } from './En3FluidElement';
6
+ export { en3FluidPointer } from './En3FluidPointer';
@@ -1 +1 @@
1
- "use strict";var at=(r,t)=>(t=Symbol[r])?t:Symbol.for("Symbol."+r);var Q=(r,t,s)=>{if(!t.has(r))throw TypeError("Cannot "+s)};var e=(r,t,s)=>(Q(r,t,"read from private field"),s?s.call(r):t.get(r)),a=(r,t,s)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,s)},l=(r,t,s,n)=>(Q(r,t,"write to private field"),n?n.call(r,s):t.set(r,s),s);var p=(r,t,s)=>(Q(r,t,"access private method"),s);var H=(r,t,s)=>new Promise((n,i)=>{var c=d=>{try{u(s.next(d))}catch(m){i(m)}},f=d=>{try{u(s.throw(d))}catch(m){i(m)}},u=d=>d.done?n(d.value):Promise.resolve(d.value).then(c,f);u((s=s.apply(r,t)).next())});var ht=(r,t,s)=>(t=r[at("asyncIterator")])?t.call(r):(r=r[at("iterator")](),t={},s=(n,i)=>(i=r[n])&&(t[n]=c=>new Promise((f,u,d)=>(c=i.call(r,c),d=c.done,Promise.resolve(c.value).then(m=>f({value:m,done:d}),u)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ot=require("../notifier/index.cjs"),pt=require("../browser-CpzFX2xg.cjs");var y,o,g,S,A,k,M;class gt{constructor(t,s){a(this,y,void 0);a(this,o,void 0);a(this,g,void 0);a(this,S,void 0);a(this,A,void 0);a(this,k,t=>{t.preventDefault(),e(this,y).links.forEach(s=>{var n;e(this,g)===e(s,g)||(n=e(s,A))!=null&&n.includes(e(this,g))?e(s,o).classList.add("clicked"):e(s,o).classList.remove("clicked")}),e(this,y).navigate(e(this,g),e(this,S))});a(this,M,()=>{e(this,y).prefetch(e(this,g)),e(this,o).removeEventListener("pointerenter",e(this,M))});var c,f;l(this,y,s),l(this,o,t),l(this,g,e(this,o).getAttribute("href")||"/"),l(this,S,e(this,o).getAttribute("data-history-action")||"push"),e(this,o).addEventListener("click",e(this,k));const n=s.normalizePath(e(this,g)),i=s.normalizePath(location.pathname);l(this,A,(c=e(this,o).getAttribute("data-match-paths"))==null?void 0:c.split(",").map(u=>s.normalizePath(u.trim()).pathname)),e(this,o).hasAttribute("data-include")?i.pathname.includes(n.pathname)&&e(this,o).classList.add("current"):n.pathname===i.pathname||(f=e(this,A))!=null&&f.includes(i.pathname)?(e(this,o).classList.add("current"),e(this,o).classList.add("clicked")):e(this,o).classList.remove("clicked"),e(this,o).hasAttribute("data-prefetch")&&e(this,o).addEventListener("pointerenter",e(this,M))}destroy(){e(this,o).removeEventListener("click",e(this,k)),e(this,o).removeEventListener("pointerenter",e(this,M)),e(this,o).classList.remove("current")}}y=new WeakMap,o=new WeakMap,g=new WeakMap,S=new WeakMap,A=new WeakMap,k=new WeakMap,M=new WeakMap;var E,C,z,D,T,B,P,L,w,W,x,R,U,q,V,F,X,K,ct,I,Z,Y;class Et{constructor(t){a(this,R);a(this,q);a(this,F);a(this,K);a(this,I);a(this,E,null);a(this,C,null);a(this,z,null);a(this,D,null);a(this,T,[]);a(this,B,new DOMParser);a(this,P,new Map);a(this,L,void 0);a(this,w,null);a(this,W,new ot.Notifier);a(this,x,new ot.Notifier);a(this,Y,t=>{t.state&&this.navigate(t.state,"none")});pt.isBrowser&&new Date().getTime()<17183988e5&&(l(this,E,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(l(this,E,t.base),t.base.endsWith("/")||l(this,E,e(this,E)+"/")):l(this,E,"/"),l(this,C,(t==null?void 0:t.waitForHeadToLoad)!==!1),l(this,z,(t==null?void 0:t.cachePages)!==!1),l(this,D,p(this,F,X).call(this,document.body)),l(this,w,this.normalizePath(location.pathname).pathname),document.documentElement.setAttribute("data-current-pathname",e(this,w)),p(this,q,V).call(this),addEventListener("popstate",e(this,Y)))}get currentPathname(){return e(this,w)}get links(){return e(this,T)}normalizePath(t){t=t.replace(e(this,E),""),t.startsWith("/")&&(t=t.slice(1));const s=t.split("#"),n=s[0].split("?"),i=n[0].endsWith("/")?n[0].slice(0,-1):n[0],c=e(this,E)+i,f=n==null?void 0:n[1],u=s==null?void 0:s[1];return{leaf:i,pathname:c,parameters:f,hash:u}}beforeNavigationEvent(t){return e(this,W).subscribe(t)}afterNavigationEvent(t){return e(this,x).subscribe(t)}prefetch(t){return H(this,null,function*(){const s=this.normalizePath(t);return p(this,R,U).call(this,s.pathname)})}navigate(t,s="push"){return H(this,null,function*(){var d;if(new Date().getTime()>17183988e5)return;const n=this.normalizePath(t);let{pathname:i,hash:c,parameters:f}=n;if(e(this,L)===i||e(this,w)===i)return;l(this,L,i);const u=e(this,P).has(i);try{let m=!0;if(e(this,W).notify({pathname:i,isCached:u}),this.preprocessor)try{yield new Promise((h,b)=>{var v;(v=this.preprocessor)==null||v.call(this,{pathname:i,resolve:h,reject:b,isCached:u})})}catch(h){h?console.error(h):console.log("Route change canceled"),m=!1}if(!m||e(this,L)!==i)return;const tt=e(this,P).get(i)||(yield p(this,R,U).call(this,i));if(e(this,L)!==i)return;const et=Array.from(document.head.children),st=Array.from(tt.head.cloneNode(!0).children),it=p(this,K,ct).call(this,et,st),lt=p(this,I,Z).call(this,et,it),O=p(this,I,Z).call(this,st,it);O.forEach((h,b)=>{if(h.tagName==="SCRIPT"&&h.getAttribute("src")){const v=document.createElement("script");v.type="module",v.src=h.getAttribute("src"),O[b]=v}}),O.forEach(h=>{document.head.appendChild(h)});const _=O.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");e(this,C)&&_.length&&(yield new Promise(h=>H(this,null,function*(){let b=0;try{for(var v=ht(_),mt,G,j;mt=!(G=yield v.next()).done;mt=!1){const N=G.value;N.onload=()=>{b++,b===_.length&&h()}}}catch(G){j=[G]}finally{try{mt&&(G=v.return)&&(yield G.call(v))}finally{if(j)throw j[0]}}}))),lt.forEach(h=>{h.hasAttribute("data-permanent")||h.remove()}),l(this,w,i);const $=f||location.search,ut=c?c.startsWith("#")?c:"#"+c:"",dt=$?$.startsWith("?")?$:"?"+$:"",nt=`${i}${ut}${dt}`;s==="push"?history.pushState(i,"",nt):s==="replace"&&history.replaceState(i,"",nt);const ft=p(this,F,X).call(this,tt.body.cloneNode(!0));e(this,D).forEach((h,b)=>{const v=ft[b];let mt=[...h.childNodes],G=[...v.childNodes];mt.forEach(j=>{if(j instanceof HTMLElement){const N=j.getAttribute("data-remain");let rt;G=G.filter(J=>J instanceof HTMLElement&&N&&J.getAttribute("data-remain")===N?(rt=J,!1):!0),N&&rt||j.remove()}else j.remove()}),h.append(...G)}),p(this,q,V).call(this),document.documentElement.setAttribute("data-current-pathname",i),(d=this.postprocessor)==null||d.call(this,{pathname:i,isCached:u}),e(this,x).notify({pathname:i,isCached:u})}catch(m){console.error(m)}l(this,L,void 0)})}}E=new WeakMap,C=new WeakMap,z=new WeakMap,D=new WeakMap,T=new WeakMap,B=new WeakMap,P=new WeakMap,L=new WeakMap,w=new WeakMap,W=new WeakMap,x=new WeakMap,R=new WeakSet,U=function(t){return H(this,null,function*(){const s=e(this,P).get(t);if(s)return s;const i=yield(yield fetch(t)).text(),c=e(this,B).parseFromString(i,"text/html");return e(this,z)&&e(this,P).set(t,c),c})},q=new WeakSet,V=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(s=>{var n;return(n=s.getAttribute("href"))==null?void 0:n.startsWith("/")});e(this,T).forEach(s=>s.destroy()),l(this,T,t.map(s=>new gt(s,this)))},F=new WeakSet,X=function(t){return[...t.querySelectorAll("[data-morph]")]},K=new WeakSet,ct=function(t,s){return t.filter(n=>s.find(i=>i.outerHTML===n.outerHTML))},I=new WeakSet,Z=function(t,s){return t.filter(n=>!s.find(i=>i.outerHTML===n.outerHTML))},Y=new WeakMap;exports.Morph=Et;
1
+ "use strict";var at=(r,t)=>(t=Symbol[r])?t:Symbol.for("Symbol."+r);var Q=(r,t,s)=>{if(!t.has(r))throw TypeError("Cannot "+s)};var e=(r,t,s)=>(Q(r,t,"read from private field"),s?s.call(r):t.get(r)),a=(r,t,s)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,s)},l=(r,t,s,n)=>(Q(r,t,"write to private field"),n?n.call(r,s):t.set(r,s),s);var p=(r,t,s)=>(Q(r,t,"access private method"),s);var H=(r,t,s)=>new Promise((n,i)=>{var c=d=>{try{u(s.next(d))}catch(m){i(m)}},f=d=>{try{u(s.throw(d))}catch(m){i(m)}},u=d=>d.done?n(d.value):Promise.resolve(d.value).then(c,f);u((s=s.apply(r,t)).next())});var ht=(r,t,s)=>(t=r[at("asyncIterator")])?t.call(r):(r=r[at("iterator")](),t={},s=(n,i)=>(i=r[n])&&(t[n]=c=>new Promise((f,u,d)=>(c=i.call(r,c),d=c.done,Promise.resolve(c.value).then(m=>f({value:m,done:d}),u)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ot=require("../notifier/index.cjs"),pt=require("../browser-CpzFX2xg.cjs");var y,o,g,S,A,k,M;class gt{constructor(t,s){a(this,y,void 0);a(this,o,void 0);a(this,g,void 0);a(this,S,void 0);a(this,A,void 0);a(this,k,t=>{t.preventDefault(),e(this,y).links.forEach(s=>{var n;e(this,g)===e(s,g)||(n=e(s,A))!=null&&n.includes(e(this,g))?e(s,o).classList.add("clicked"):e(s,o).classList.remove("clicked")}),e(this,y).navigate(e(this,g),e(this,S))});a(this,M,()=>{e(this,y).prefetch(e(this,g)),e(this,o).removeEventListener("pointerenter",e(this,M))});var c,f;l(this,y,s),l(this,o,t),l(this,g,e(this,o).getAttribute("href")||"/"),l(this,S,e(this,o).getAttribute("data-history-action")||"push"),e(this,o).addEventListener("click",e(this,k));const n=s.normalizePath(e(this,g)),i=s.normalizePath(location.pathname);l(this,A,(c=e(this,o).getAttribute("data-match-paths"))==null?void 0:c.split(",").map(u=>s.normalizePath(u.trim()).pathname)),e(this,o).hasAttribute("data-include")?i.pathname.includes(n.pathname)&&e(this,o).classList.add("current"):n.pathname===i.pathname||(f=e(this,A))!=null&&f.includes(i.pathname)?(e(this,o).classList.add("current"),e(this,o).classList.add("clicked")):e(this,o).classList.remove("clicked"),e(this,o).hasAttribute("data-prefetch")&&e(this,o).addEventListener("pointerenter",e(this,M))}destroy(){e(this,o).removeEventListener("click",e(this,k)),e(this,o).removeEventListener("pointerenter",e(this,M)),e(this,o).classList.remove("current")}}y=new WeakMap,o=new WeakMap,g=new WeakMap,S=new WeakMap,A=new WeakMap,k=new WeakMap,M=new WeakMap;var E,C,z,W,N,B,P,L,w,x,D,R,U,q,V,F,X,K,ct,I,Z,Y;class Et{constructor(t){a(this,R);a(this,q);a(this,F);a(this,K);a(this,I);a(this,E,null);a(this,C,null);a(this,z,null);a(this,W,null);a(this,N,[]);a(this,B,new DOMParser);a(this,P,new Map);a(this,L,void 0);a(this,w,null);a(this,x,new ot.Notifier);a(this,D,new ot.Notifier);a(this,Y,t=>{t.state&&this.navigate(t.state,"none")});pt.isBrowser&&(l(this,E,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(l(this,E,t.base),t.base.endsWith("/")||l(this,E,e(this,E)+"/")):l(this,E,"/"),l(this,C,(t==null?void 0:t.waitForHeadToLoad)!==!1),l(this,z,(t==null?void 0:t.cachePages)!==!1),l(this,W,p(this,F,X).call(this,document.body)),l(this,w,this.normalizePath(location.pathname).pathname),document.documentElement.setAttribute("data-current-pathname",e(this,w)),p(this,q,V).call(this),addEventListener("popstate",e(this,Y)))}get currentPathname(){return e(this,w)}get links(){return e(this,N)}normalizePath(t){t=t.replace(e(this,E),""),t.startsWith("/")&&(t=t.slice(1));const s=t.split("#"),n=s[0].split("?"),i=n[0].endsWith("/")?n[0].slice(0,-1):n[0],c=e(this,E)+i,f=n==null?void 0:n[1],u=s==null?void 0:s[1];return{leaf:i,pathname:c,parameters:f,hash:u}}beforeNavigationEvent(t){return e(this,x).subscribe(t)}afterNavigationEvent(t){return e(this,D).subscribe(t)}prefetch(t){return H(this,null,function*(){const s=this.normalizePath(t);return p(this,R,U).call(this,s.pathname)})}navigate(t,s="push"){return H(this,null,function*(){var d;const n=this.normalizePath(t);let{pathname:i,hash:c,parameters:f}=n;if(e(this,L)===i||e(this,w)===i)return;l(this,L,i);const u=e(this,P).has(i);try{let m=!0;if(e(this,x).notify({pathname:i,isCached:u}),this.preprocessor)try{yield new Promise((h,b)=>{var v;(v=this.preprocessor)==null||v.call(this,{pathname:i,resolve:h,reject:b,isCached:u})})}catch(h){h?console.error(h):console.log("Route change canceled"),m=!1}if(!m||e(this,L)!==i)return;const tt=e(this,P).get(i)||(yield p(this,R,U).call(this,i));if(e(this,L)!==i)return;const et=Array.from(document.head.children),st=Array.from(tt.head.cloneNode(!0).children),it=p(this,K,ct).call(this,et,st),lt=p(this,I,Z).call(this,et,it),O=p(this,I,Z).call(this,st,it);O.forEach((h,b)=>{if(h.tagName==="SCRIPT"&&h.getAttribute("src")){const v=document.createElement("script");v.type="module",v.src=h.getAttribute("src"),O[b]=v}}),O.forEach(h=>{document.head.appendChild(h)});const _=O.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");e(this,C)&&_.length&&(yield new Promise(h=>H(this,null,function*(){let b=0;try{for(var v=ht(_),mt,G,j;mt=!(G=yield v.next()).done;mt=!1){const T=G.value;T.onload=()=>{b++,b===_.length&&h()}}}catch(G){j=[G]}finally{try{mt&&(G=v.return)&&(yield G.call(v))}finally{if(j)throw j[0]}}}))),lt.forEach(h=>{h.hasAttribute("data-permanent")||h.remove()}),l(this,w,i);const $=f||location.search,ut=c?c.startsWith("#")?c:"#"+c:"",dt=$?$.startsWith("?")?$:"?"+$:"",nt=`${i}${ut}${dt}`;s==="push"?history.pushState(i,"",nt):s==="replace"&&history.replaceState(i,"",nt);const ft=p(this,F,X).call(this,tt.body.cloneNode(!0));e(this,W).forEach((h,b)=>{const v=ft[b];let mt=[...h.childNodes],G=[...v.childNodes];mt.forEach(j=>{if(j instanceof HTMLElement){const T=j.getAttribute("data-remain");let rt;G=G.filter(J=>J instanceof HTMLElement&&T&&J.getAttribute("data-remain")===T?(rt=J,!1):!0),T&&rt||j.remove()}else j.remove()}),h.append(...G)}),p(this,q,V).call(this),document.documentElement.setAttribute("data-current-pathname",i),(d=this.postprocessor)==null||d.call(this,{pathname:i,isCached:u}),e(this,D).notify({pathname:i,isCached:u})}catch(m){console.error(m)}l(this,L,void 0)})}}E=new WeakMap,C=new WeakMap,z=new WeakMap,W=new WeakMap,N=new WeakMap,B=new WeakMap,P=new WeakMap,L=new WeakMap,w=new WeakMap,x=new WeakMap,D=new WeakMap,R=new WeakSet,U=function(t){return H(this,null,function*(){const s=e(this,P).get(t);if(s)return s;const i=yield(yield fetch(t)).text(),c=e(this,B).parseFromString(i,"text/html");return e(this,z)&&e(this,P).set(t,c),c})},q=new WeakSet,V=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(s=>{var n;return(n=s.getAttribute("href"))==null?void 0:n.startsWith("/")});e(this,N).forEach(s=>s.destroy()),l(this,N,t.map(s=>new gt(s,this)))},F=new WeakSet,X=function(t){return[...t.querySelectorAll("[data-morph]")]},K=new WeakSet,ct=function(t,s){return t.filter(n=>s.find(i=>i.outerHTML===n.outerHTML))},I=new WeakSet,Z=function(t,s){return t.filter(n=>!s.find(i=>i.outerHTML===n.outerHTML))},Y=new WeakMap;exports.Morph=Et;
@@ -9,7 +9,7 @@ var e = (r, t, s) => (U(r, t, "read from private field"), s ? s.call(r) : t.get(
9
9
  t instanceof WeakSet ? t.add(r) : t.set(r, s);
10
10
  }, l = (r, t, s, n) => (U(r, t, "write to private field"), n ? n.call(r, s) : t.set(r, s), s);
11
11
  var p = (r, t, s) => (U(r, t, "access private method"), s);
12
- var N = (r, t, s) => new Promise((n, i) => {
12
+ var T = (r, t, s) => new Promise((n, i) => {
13
13
  var c = (d) => {
14
14
  try {
15
15
  u(s.next(d));
@@ -28,7 +28,7 @@ var N = (r, t, s) => new Promise((n, i) => {
28
28
  var ht = (r, t, s) => (t = r[at("asyncIterator")]) ? t.call(r) : (r = r[at("iterator")](), t = {}, s = (n, i) => (i = r[n]) && (t[n] = (c) => new Promise((f, u, d) => (c = i.call(r, c), d = c.done, Promise.resolve(c.value).then((m) => f({ value: m, done: d }), u)))), s("next"), s("return"), t);
29
29
  import { Notifier as ot } from "../notifier/index.js";
30
30
  import { i as pt } from "../browser-0zX67oeU.js";
31
- var y, o, g, k, A, C, T;
31
+ var y, o, g, k, A, C, M;
32
32
  class gt {
33
33
  constructor(t, s) {
34
34
  a(this, y, void 0);
@@ -42,22 +42,22 @@ class gt {
42
42
  e(this, g) === e(s, g) || (n = e(s, A)) != null && n.includes(e(this, g)) ? e(s, o).classList.add("clicked") : e(s, o).classList.remove("clicked");
43
43
  }), e(this, y).navigate(e(this, g), e(this, k));
44
44
  });
45
- a(this, T, () => {
46
- e(this, y).prefetch(e(this, g)), e(this, o).removeEventListener("pointerenter", e(this, T));
45
+ a(this, M, () => {
46
+ e(this, y).prefetch(e(this, g)), e(this, o).removeEventListener("pointerenter", e(this, M));
47
47
  });
48
48
  var c, f;
49
49
  l(this, y, s), l(this, o, t), l(this, g, e(this, o).getAttribute("href") || "/"), l(this, k, e(this, o).getAttribute(
50
50
  "data-history-action"
51
51
  ) || "push"), e(this, o).addEventListener("click", e(this, C));
52
52
  const n = s.normalizePath(e(this, g)), i = s.normalizePath(location.pathname);
53
- l(this, A, (c = e(this, o).getAttribute("data-match-paths")) == null ? void 0 : c.split(",").map((u) => s.normalizePath(u.trim()).pathname)), e(this, o).hasAttribute("data-include") ? i.pathname.includes(n.pathname) && e(this, o).classList.add("current") : n.pathname === i.pathname || (f = e(this, A)) != null && f.includes(i.pathname) ? (e(this, o).classList.add("current"), e(this, o).classList.add("clicked")) : e(this, o).classList.remove("clicked"), e(this, o).hasAttribute("data-prefetch") && e(this, o).addEventListener("pointerenter", e(this, T));
53
+ l(this, A, (c = e(this, o).getAttribute("data-match-paths")) == null ? void 0 : c.split(",").map((u) => s.normalizePath(u.trim()).pathname)), e(this, o).hasAttribute("data-include") ? i.pathname.includes(n.pathname) && e(this, o).classList.add("current") : n.pathname === i.pathname || (f = e(this, A)) != null && f.includes(i.pathname) ? (e(this, o).classList.add("current"), e(this, o).classList.add("clicked")) : e(this, o).classList.remove("clicked"), e(this, o).hasAttribute("data-prefetch") && e(this, o).addEventListener("pointerenter", e(this, M));
54
54
  }
55
55
  destroy() {
56
- e(this, o).removeEventListener("click", e(this, C)), e(this, o).removeEventListener("pointerenter", e(this, T)), e(this, o).classList.remove("current");
56
+ e(this, o).removeEventListener("click", e(this, C)), e(this, o).removeEventListener("pointerenter", e(this, M)), e(this, o).classList.remove("current");
57
57
  }
58
58
  }
59
- y = new WeakMap(), o = new WeakMap(), g = new WeakMap(), k = new WeakMap(), A = new WeakMap(), C = new WeakMap(), T = new WeakMap();
60
- var E, S, z, D, M, K, P, b, w, W, x, R, V, F, X, I, Z, Y, ct, $, _, j;
59
+ y = new WeakMap(), o = new WeakMap(), g = new WeakMap(), k = new WeakMap(), A = new WeakMap(), C = new WeakMap(), M = new WeakMap();
60
+ var E, S, z, W, H, K, P, b, w, x, D, R, V, F, X, I, Z, Y, ct, $, _, j;
61
61
  class bt {
62
62
  constructor(t) {
63
63
  a(this, R);
@@ -68,18 +68,18 @@ class bt {
68
68
  a(this, E, null);
69
69
  a(this, S, null);
70
70
  a(this, z, null);
71
- a(this, D, null);
72
- a(this, M, []);
71
+ a(this, W, null);
72
+ a(this, H, []);
73
73
  a(this, K, new DOMParser());
74
74
  a(this, P, /* @__PURE__ */ new Map());
75
75
  a(this, b, void 0);
76
76
  a(this, w, null);
77
- a(this, W, new ot());
78
77
  a(this, x, new ot());
78
+ a(this, D, new ot());
79
79
  a(this, j, (t) => {
80
80
  t.state && this.navigate(t.state, "none");
81
81
  });
82
- pt && (/* @__PURE__ */ new Date()).getTime() < 17183988e5 && (l(this, E, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (l(this, E, t.base), t.base.endsWith("/") || l(this, E, e(this, E) + "/")) : l(this, E, "/"), l(this, S, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), l(this, z, (t == null ? void 0 : t.cachePages) !== !1), l(this, D, p(this, I, Z).call(this, document.body)), l(this, w, this.normalizePath(location.pathname).pathname), document.documentElement.setAttribute(
82
+ pt && (l(this, E, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (l(this, E, t.base), t.base.endsWith("/") || l(this, E, e(this, E) + "/")) : l(this, E, "/"), l(this, S, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), l(this, z, (t == null ? void 0 : t.cachePages) !== !1), l(this, W, p(this, I, Z).call(this, document.body)), l(this, w, this.normalizePath(location.pathname).pathname), document.documentElement.setAttribute(
83
83
  "data-current-pathname",
84
84
  e(this, w)
85
85
  ), p(this, F, X).call(this), addEventListener("popstate", e(this, j)));
@@ -88,7 +88,7 @@ class bt {
88
88
  return e(this, w);
89
89
  }
90
90
  get links() {
91
- return e(this, M);
91
+ return e(this, H);
92
92
  }
93
93
  normalizePath(t) {
94
94
  t = t.replace(e(this, E), ""), t.startsWith("/") && (t = t.slice(1));
@@ -101,22 +101,20 @@ class bt {
101
101
  };
102
102
  }
103
103
  beforeNavigationEvent(t) {
104
- return e(this, W).subscribe(t);
104
+ return e(this, x).subscribe(t);
105
105
  }
106
106
  afterNavigationEvent(t) {
107
- return e(this, x).subscribe(t);
107
+ return e(this, D).subscribe(t);
108
108
  }
109
109
  prefetch(t) {
110
- return N(this, null, function* () {
110
+ return T(this, null, function* () {
111
111
  const s = this.normalizePath(t);
112
112
  return p(this, R, V).call(this, s.pathname);
113
113
  });
114
114
  }
115
115
  navigate(t, s = "push") {
116
- return N(this, null, function* () {
116
+ return T(this, null, function* () {
117
117
  var d;
118
- if ((/* @__PURE__ */ new Date()).getTime() > 17183988e5)
119
- return;
120
118
  const n = this.normalizePath(t);
121
119
  let { pathname: i, hash: c, parameters: f } = n;
122
120
  if (e(this, b) === i || e(this, w) === i)
@@ -125,7 +123,7 @@ class bt {
125
123
  const u = e(this, P).has(i);
126
124
  try {
127
125
  let m = !0;
128
- if (e(this, W).notify({
126
+ if (e(this, x).notify({
129
127
  pathname: i,
130
128
  isCached: u
131
129
  }), this.preprocessor)
@@ -156,12 +154,12 @@ class bt {
156
154
  const G = q.filter(
157
155
  (h) => h.tagName === "STYLE" || h.tagName === "SCRIPT" || h.tagName === "LINK"
158
156
  );
159
- e(this, S) && G.length && (yield new Promise((h) => N(this, null, function* () {
157
+ e(this, S) && G.length && (yield new Promise((h) => T(this, null, function* () {
160
158
  let L = 0;
161
159
  try {
162
160
  for (var v = ht(G), mt, J, B; mt = !(J = yield v.next()).done; mt = !1) {
163
- const H = J.value;
164
- H.onload = () => {
161
+ const N = J.value;
162
+ N.onload = () => {
165
163
  L++, L === G.length && h();
166
164
  };
167
165
  }
@@ -181,20 +179,20 @@ class bt {
181
179
  const O = f || location.search, ut = c ? c.startsWith("#") ? c : "#" + c : "", dt = O ? O.startsWith("?") ? O : "?" + O : "", nt = `${i}${ut}${dt}`;
182
180
  s === "push" ? history.pushState(i, "", nt) : s === "replace" && history.replaceState(i, "", nt);
183
181
  const ft = p(this, I, Z).call(this, tt.body.cloneNode(!0));
184
- e(this, D).forEach((h, L) => {
182
+ e(this, W).forEach((h, L) => {
185
183
  const v = ft[L];
186
184
  let mt = [...h.childNodes], J = [...v.childNodes];
187
185
  mt.forEach((B) => {
188
186
  if (B instanceof HTMLElement) {
189
- const H = B.getAttribute("data-remain");
187
+ const N = B.getAttribute("data-remain");
190
188
  let rt;
191
189
  J = J.filter(
192
- (Q) => Q instanceof HTMLElement && H && Q.getAttribute("data-remain") === H ? (rt = Q, !1) : !0
193
- ), H && rt || B.remove();
190
+ (Q) => Q instanceof HTMLElement && N && Q.getAttribute("data-remain") === N ? (rt = Q, !1) : !0
191
+ ), N && rt || B.remove();
194
192
  } else
195
193
  B.remove();
196
194
  }), h.append(...J);
197
- }), p(this, F, X).call(this), document.documentElement.setAttribute("data-current-pathname", i), (d = this.postprocessor) == null || d.call(this, { pathname: i, isCached: u }), e(this, x).notify({ pathname: i, isCached: u });
195
+ }), p(this, F, X).call(this), document.documentElement.setAttribute("data-current-pathname", i), (d = this.postprocessor) == null || d.call(this, { pathname: i, isCached: u }), e(this, D).notify({ pathname: i, isCached: u });
198
196
  } catch (m) {
199
197
  console.error(m);
200
198
  }
@@ -202,8 +200,8 @@ class bt {
202
200
  });
203
201
  }
204
202
  }
205
- E = new WeakMap(), S = new WeakMap(), z = new WeakMap(), D = new WeakMap(), M = new WeakMap(), K = new WeakMap(), P = new WeakMap(), b = new WeakMap(), w = new WeakMap(), W = new WeakMap(), x = new WeakMap(), R = new WeakSet(), V = function(t) {
206
- return N(this, null, function* () {
203
+ E = new WeakMap(), S = new WeakMap(), z = new WeakMap(), W = new WeakMap(), H = new WeakMap(), K = new WeakMap(), P = new WeakMap(), b = new WeakMap(), w = new WeakMap(), x = new WeakMap(), D = new WeakMap(), R = new WeakSet(), V = function(t) {
204
+ return T(this, null, function* () {
207
205
  const s = e(this, P).get(t);
208
206
  if (s)
209
207
  return s;
@@ -217,7 +215,7 @@ E = new WeakMap(), S = new WeakMap(), z = new WeakMap(), D = new WeakMap(), M =
217
215
  var n;
218
216
  return (n = s.getAttribute("href")) == null ? void 0 : n.startsWith("/");
219
217
  });
220
- e(this, M).forEach((s) => s.destroy()), l(this, M, t.map((s) => new gt(s, this)));
218
+ e(this, H).forEach((s) => s.destroy()), l(this, H, t.map((s) => new gt(s, this)));
221
219
  }, I = new WeakSet(), Z = function(t) {
222
220
  return [...t.querySelectorAll("[data-morph]")];
223
221
  }, Y = new WeakSet(), ct = function(t, s) {
@@ -1 +1 @@
1
- "use strict";var J=Object.defineProperty;var D=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var k=(i,e,s)=>e in i?J(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s,O=(i,e)=>{for(var s in e||(e={}))K.call(e,s)&&k(i,s,e[s]);if(D)for(var s of D(e))N.call(e,s)&&k(i,s,e[s]);return i};var T=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var t=(i,e,s)=>(T(i,e,"read from private field"),s?s.call(i):e.get(i)),a=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},l=(i,e,s,o)=>(T(i,e,"write to private field"),o?o.call(i,s):e.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-C-1ruEIm.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),Q=require("../dom-JBOkFLTh.cjs"),A=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const M=require("../Damped-DxwUBxOC.cjs"),B=require("../element-resizer/index.cjs"),G=require("../window-resizer/index.cjs"),H=require("../custom-element/index.cjs"),S=require("../css-property/index.cjs");var c,u,m,v,f,d,P,w,_,C,E,y;class F{constructor(e){a(this,c,void 0);a(this,u,void 0);a(this,m,void 0);a(this,v,void 0);a(this,f,void 0);a(this,d,void 0);a(this,P,0);a(this,w,0);a(this,_,e=>{t(this,v).set(1)});a(this,C,e=>{t(this,v).set(0)});a(this,E,e=>{const s=q.getPointerPosition(e,t(this,c).getBoundingClientRect()),o={width:t(this,P),height:t(this,w)},n={x:s.x,y:s.y};if(t(this,f)){const p=q.screenToCartesian(n,o);n.x=p.x,n.y=p.y}if(t(this,d)){const p=q.normalize(n,o);n.x=A.clamp(p.x*2,-1,1),n.y=A.clamp(p.y*2,-1,1)}t(this,u).set(n.x),t(this,m).set(n.y)});a(this,y,()=>{l(this,P,this.element.clientWidth),l(this,w,this.element.clientHeight);let e=0,s=0,o=0,n=0;t(this,f)?t(this,d)?(e=-1,s=1,o=-1,n=1):(e=t(this,P)/2*-1,s=t(this,P)/2*1,o=t(this,w)/2*-1,n=t(this,w)/2*1):t(this,d)?(e=0,s=1,o=0,n=1):(e=0,s=t(this,P),o=0,n=t(this,w)),t(this,u).min=e,t(this,u).max=s,t(this,m).min=o,t(this,m).max=n});l(this,c,Q.getElement(e.element)),l(this,u,new M.Damped(0,e.damped)),l(this,m,new M.Damped(0,e.damped)),l(this,v,new M.Damped(0,O({min:0,max:1},e.damped))),l(this,f,e.cartesian||!1),l(this,d,e.normalize||!1)}get element(){return t(this,c)}get x(){return t(this,u)}get y(){return t(this,m)}get z(){return t(this,v)}get cartesian(){return t(this,f)}set cartesian(e){l(this,f,e),t(this,y).call(this)}get normalize(){return t(this,d)}set normalize(e){l(this,d,e),t(this,y).call(this)}connect(){t(this,c).addEventListener("pointerenter",t(this,_)),t(this,c).addEventListener("pointerleave",t(this,C)),t(this,c).addEventListener("pointermove",t(this,E)),B.elementResizer.subscribe(t(this,c),t(this,y)),G.windowResizer.subscribe(t(this,y))}disconnect(){t(this,c).removeEventListener("pointerenter",t(this,_)),t(this,c).removeEventListener("pointerleave",t(this,C)),t(this,c).removeEventListener("pointermove",t(this,E)),B.elementResizer.unsubscribe(t(this,y)),G.windowResizer.unsubscribe(t(this,y)),t(this,u).reset(),t(this,m).reset(),t(this,v).reset()}}c=new WeakMap,u=new WeakMap,m=new WeakMap,v=new WeakMap,f=new WeakMap,d=new WeakMap,P=new WeakMap,w=new WeakMap,_=new WeakMap,C=new WeakMap,E=new WeakMap,y=new WeakMap;var U=Object.defineProperty,V=Object.getOwnPropertyDescriptor,X=(i,e,s,o)=>{for(var n=o>1?void 0:o?V(e,s):e,p=i.length-1,L;p>=0;p--)(L=i[p])&&(n=(o?L(e,s,n):L(n))||n);return o&&n&&U(e,s,n),n},I=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},r=(i,e,s)=>(I(i,e,"read from private field"),s?s.call(i):e.get(i)),x=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},Y=(i,e,s,o)=>(I(i,e,"write to private field"),o?o.call(i,s):e.set(i,s),s),h,b,g,z,W,R;exports.PointerElement=class extends H.CustomElement{constructor(){super(),x(this,h,void 0),x(this,b,new S.CSSProperty(this,"--damping",20)),x(this,g,new S.CSSProperty(this,"--mass",0)),x(this,z,new S.CSSProperty(this,"--stiffness",0)),x(this,W,new S.CSSProperty(this,"--cartesian",!1)),x(this,R,new S.CSSProperty(this,"--normalize",!1)),Y(this,h,new F({element:this})),r(this,b).subscribe(e=>{r(this,h).x.damping=e.current,r(this,h).y.damping=e.current,r(this,h).z.damping=e.current}),r(this,W).subscribe(e=>{r(this,h).cartesian=e.current}),r(this,R).subscribe(e=>{r(this,h).normalize=e.current}),r(this,g).subscribe(e=>{r(this,h).x.mass=e.current,r(this,h).y.mass=e.current,r(this,h).z.mass=e.current}),r(this,z).subscribe(e=>{r(this,h).x.stiffness=e.current,r(this,h).y.stiffness=e.current,r(this,h).z.stiffness=e.current}),r(this,h).x.subscribe(e=>{this.style.setProperty("--x",e.current.toString())}),r(this,h).y.subscribe(e=>{this.style.setProperty("--y",e.current.toString())}),r(this,h).z.subscribe(e=>{this.style.setProperty("--z",e.current.toString())})}get pointer(){return r(this,h)}connectedCallback(){r(this,h).connect(),r(this,b).observe(),r(this,g).observe(),r(this,z).observe()}disconnectedCallback(){r(this,h).disconnect(),r(this,b).unobserve(),r(this,g).unobserve(),r(this,z).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}};h=new WeakMap;b=new WeakMap;g=new WeakMap;z=new WeakMap;W=new WeakMap;R=new WeakMap;exports.PointerElement=X([H.define("e-pointer")],exports.PointerElement);exports.Pointer=F;
1
+ "use strict";var J=Object.defineProperty;var D=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var k=(i,e,s)=>e in i?J(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s,O=(i,e)=>{for(var s in e||(e={}))K.call(e,s)&&k(i,s,e[s]);if(D)for(var s of D(e))N.call(e,s)&&k(i,s,e[s]);return i};var T=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var t=(i,e,s)=>(T(i,e,"read from private field"),s?s.call(i):e.get(i)),a=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},l=(i,e,s,o)=>(T(i,e,"write to private field"),o?o.call(i,s):e.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-C-1ruEIm.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),Q=require("../dom-JBOkFLTh.cjs"),A=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const M=require("../Damped-3daHRLIW.cjs"),B=require("../element-resizer/index.cjs"),G=require("../window-resizer/index.cjs"),H=require("../custom-element/index.cjs"),S=require("../css-property/index.cjs");var c,u,m,v,f,d,P,w,_,C,E,y;class F{constructor(e){a(this,c,void 0);a(this,u,void 0);a(this,m,void 0);a(this,v,void 0);a(this,f,void 0);a(this,d,void 0);a(this,P,0);a(this,w,0);a(this,_,e=>{t(this,v).set(1)});a(this,C,e=>{t(this,v).set(0)});a(this,E,e=>{const s=q.getPointerPosition(e,t(this,c).getBoundingClientRect()),o={width:t(this,P),height:t(this,w)},n={x:s.x,y:s.y};if(t(this,f)){const p=q.screenToCartesian(n,o);n.x=p.x,n.y=p.y}if(t(this,d)){const p=q.normalize(n,o);n.x=A.clamp(p.x*2,-1,1),n.y=A.clamp(p.y*2,-1,1)}t(this,u).set(n.x),t(this,m).set(n.y)});a(this,y,()=>{l(this,P,this.element.clientWidth),l(this,w,this.element.clientHeight);let e=0,s=0,o=0,n=0;t(this,f)?t(this,d)?(e=-1,s=1,o=-1,n=1):(e=t(this,P)/2*-1,s=t(this,P)/2*1,o=t(this,w)/2*-1,n=t(this,w)/2*1):t(this,d)?(e=0,s=1,o=0,n=1):(e=0,s=t(this,P),o=0,n=t(this,w)),t(this,u).min=e,t(this,u).max=s,t(this,m).min=o,t(this,m).max=n});l(this,c,Q.getElement(e.element)),l(this,u,new M.Damped(0,e.damped)),l(this,m,new M.Damped(0,e.damped)),l(this,v,new M.Damped(0,O({min:0,max:1},e.damped))),l(this,f,e.cartesian||!1),l(this,d,e.normalize||!1)}get element(){return t(this,c)}get x(){return t(this,u)}get y(){return t(this,m)}get z(){return t(this,v)}get cartesian(){return t(this,f)}set cartesian(e){l(this,f,e),t(this,y).call(this)}get normalize(){return t(this,d)}set normalize(e){l(this,d,e),t(this,y).call(this)}connect(){t(this,c).addEventListener("pointerenter",t(this,_)),t(this,c).addEventListener("pointerleave",t(this,C)),t(this,c).addEventListener("pointermove",t(this,E)),B.elementResizer.subscribe(t(this,c),t(this,y)),G.windowResizer.subscribe(t(this,y))}disconnect(){t(this,c).removeEventListener("pointerenter",t(this,_)),t(this,c).removeEventListener("pointerleave",t(this,C)),t(this,c).removeEventListener("pointermove",t(this,E)),B.elementResizer.unsubscribe(t(this,y)),G.windowResizer.unsubscribe(t(this,y)),t(this,u).reset(),t(this,m).reset(),t(this,v).reset()}}c=new WeakMap,u=new WeakMap,m=new WeakMap,v=new WeakMap,f=new WeakMap,d=new WeakMap,P=new WeakMap,w=new WeakMap,_=new WeakMap,C=new WeakMap,E=new WeakMap,y=new WeakMap;var U=Object.defineProperty,V=Object.getOwnPropertyDescriptor,X=(i,e,s,o)=>{for(var n=o>1?void 0:o?V(e,s):e,p=i.length-1,L;p>=0;p--)(L=i[p])&&(n=(o?L(e,s,n):L(n))||n);return o&&n&&U(e,s,n),n},I=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},r=(i,e,s)=>(I(i,e,"read from private field"),s?s.call(i):e.get(i)),x=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},Y=(i,e,s,o)=>(I(i,e,"write to private field"),o?o.call(i,s):e.set(i,s),s),h,b,g,z,W,R;exports.PointerElement=class extends H.CustomElement{constructor(){super(),x(this,h,void 0),x(this,b,new S.CSSProperty(this,"--damping",20)),x(this,g,new S.CSSProperty(this,"--mass",0)),x(this,z,new S.CSSProperty(this,"--stiffness",0)),x(this,W,new S.CSSProperty(this,"--cartesian",!1)),x(this,R,new S.CSSProperty(this,"--normalize",!1)),Y(this,h,new F({element:this})),r(this,b).subscribe(e=>{r(this,h).x.damping=e.current,r(this,h).y.damping=e.current,r(this,h).z.damping=e.current}),r(this,W).subscribe(e=>{r(this,h).cartesian=e.current}),r(this,R).subscribe(e=>{r(this,h).normalize=e.current}),r(this,g).subscribe(e=>{r(this,h).x.mass=e.current,r(this,h).y.mass=e.current,r(this,h).z.mass=e.current}),r(this,z).subscribe(e=>{r(this,h).x.stiffness=e.current,r(this,h).y.stiffness=e.current,r(this,h).z.stiffness=e.current}),r(this,h).x.subscribe(e=>{this.style.setProperty("--x",e.current.toString())}),r(this,h).y.subscribe(e=>{this.style.setProperty("--y",e.current.toString())}),r(this,h).z.subscribe(e=>{this.style.setProperty("--z",e.current.toString())})}get pointer(){return r(this,h)}connectedCallback(){r(this,h).connect(),r(this,b).observe(),r(this,g).observe(),r(this,z).observe()}disconnectedCallback(){r(this,h).disconnect(),r(this,b).unobserve(),r(this,g).unobserve(),r(this,z).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}};h=new WeakMap;b=new WeakMap;g=new WeakMap;z=new WeakMap;W=new WeakMap;R=new WeakMap;exports.PointerElement=X([H.define("e-pointer")],exports.PointerElement);exports.Pointer=F;
@@ -23,7 +23,7 @@ import { g as K, s as N, n as Q } from "../coordinates-CgdGoSYs.js";
23
23
  import { g as U } from "../dom-0S_WDL4g.js";
24
24
  import { c as A } from "../math-BOBiC4TN.js";
25
25
  import "../ticker/index.js";
26
- import { D as W } from "../Damped-QZAoXO5Z.js";
26
+ import { D as W } from "../Damped-CH96byE8.js";
27
27
  import { elementResizer as B } from "../element-resizer/index.js";
28
28
  import { windowResizer as G } from "../window-resizer/index.js";
29
29
  import { CustomElement as V, define as X } from "../custom-element/index.js";