aptechka 0.50.12 → 0.50.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Animation-ChZNIOTS.cjs +1 -0
- package/lib/Animation-FtUeV8dp.js +107 -0
- package/lib/{Damped-DbaLw6w1.cjs → Damped-B1lXa9nb.cjs} +1 -1
- package/lib/{Damped-CucKOQsI.js → Damped-BXsGpI-B.js} +1 -1
- package/lib/{Tweened-CcPeZ0UE.js → Tweened-BhDWLNF0.js} +1 -1
- package/lib/{Tweened-Dm6Avip9.cjs → Tweened-cJ36zq1A.cjs} +1 -1
- package/lib/animation/Animation.d.ts +1 -0
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/controls/Controls.d.ts +1 -1
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +64 -62
- package/lib/custom-scrollbar/index.cjs +1 -1
- package/lib/custom-scrollbar/index.js +1 -1
- package/lib/gestures-C7gbKx11.cjs +1 -0
- package/lib/gestures-CcXV6fCp.js +11 -0
- package/lib/need_redo_tweaker/index.cjs +1 -1
- package/lib/need_redo_tweaker/index.js +1 -1
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +1 -1
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +3 -3
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.js +1 -1
- package/lib/utils/gestures.d.ts +1 -1
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +1 -1
- package/package.json +1 -1
- package/lib/Animation-CKBO5DMV.js +0 -107
- package/lib/Animation-CwizHYX9.cjs +0 -1
- package/lib/gestures-D2Fdra_G.js +0 -11
- package/lib/gestures-DHLrn6Q8.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var C=i=>{throw TypeError(i)};var S=(i,s,t)=>s.has(i)||C("Cannot "+t);var e=(i,s,t)=>(S(i,s,"read from private field"),t?t.call(i):s.get(i)),u=(i,s,t)=>s.has(i)?C("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),r=(i,s,t,a)=>(S(i,s,"write to private field"),a?a.call(i,t):s.set(i,t),t),M=(i,s,t)=>(S(i,s,"access private method"),t);const y=require("./Store-DRp_K37w.cjs"),N=require("./math-GDWEqu7y.cjs"),I=require("./number-0243DApo.cjs"),q=require("./polyfills-Df4r-ETT.cjs");require("./index-Cqw2NKev.cjs");const P=require("./ticker/index.cjs"),O=require("./order/index.cjs");var d,f,b,m,A,h,n,c,l,g,x,z,F;class R extends y.Store{constructor(t,a){super(t||0,a);u(this,x);u(this,d);u(this,f,O.TICK_ORDER.ANIMATION);u(this,b);u(this,m,new y.Store(!1));u(this,A,0);u(this,h,0);u(this,n,-1/0);u(this,c,1/0);u(this,l,0);u(this,g,null);u(this,F,t=>{this.handleAnimationFrame(t)});r(this,h,this.current)}get direction(){return e(this,A)}get target(){return e(this,h)}get min(){return e(this,n)}set min(t){r(this,n,t),this.set(e(this,h),{equalize:!0})}get max(){return e(this,c)}set max(t){r(this,c,t),this.set(e(this,h),{equalize:!0})}get from(){return e(this,l)}get isRunning(){return e(this,m)}get delta(){return Math.abs(e(this,h)-e(this,l))}get deltaProgress(){return this.delta?I.preciseNumber(Math.abs(this.current-e(this,l))/this.delta,6):0}get distance(){return Math.abs(e(this,c)-e(this,n))}get distanceProgress(){return this.distance?I.preciseNumber(Math.abs(this.current-e(this,n))/this.distance,6):0}set(t,a){(e(this,h)!==t||a!=null&&a.restart)&&(r(this,g,t),this.updateOptions(a),r(this,g,null),e(this,h)!==this.current&&this.start())}shift(t,a){this.set(e(this,h)+t,a)}reset(){super.reset(),this.set(this.initial,{equalize:!0})}close(){super.close(),this.reset(),this.unlistenAnimationFrame()}listenAnimationFrame(){e(this,m).current||(e(this,m).current=!0,P.ticker.subscribe(e(this,F),{maxFPS:e(this,d),order:e(this,f),culling:e(this,b)}))}unlistenAnimationFrame(){e(this,m).current&&(e(this,m).current=!1,P.ticker.unsubscribe(e(this,F)))}updateOptions(t){r(this,d,q.nullishCoalescing(t==null?void 0:t.maxFPS,e(this,d))),r(this,f,q.nullishCoalescing(t==null?void 0:t.order,e(this,f))),r(this,b,q.nullishCoalescing(t==null?void 0:t.culling,e(this,b))),r(this,n,q.nullishCoalescing(t==null?void 0:t.min,e(this,n))),r(this,c,q.nullishCoalescing(t==null?void 0:t.max,e(this,c))),M(this,x,z).call(this,typeof e(this,g)=="number"?e(this,g):e(this,h)),t!=null&&t.equalize&&(this.unlistenAnimationFrame(),this.current=r(this,l,e(this,h))),t!=null&&t.restart&&(this.unlistenAnimationFrame(),this.current=r(this,l,this.initial)),typeof(t==null?void 0:t.current)=="number"&&r(this,l,this.current=t.current)}start(){this.listenAnimationFrame()}}d=new WeakMap,f=new WeakMap,b=new WeakMap,m=new WeakMap,A=new WeakMap,h=new WeakMap,n=new WeakMap,c=new WeakMap,l=new WeakMap,g=new WeakMap,x=new WeakSet,z=function(t){r(this,A,Math.sign(t-e(this,h))),r(this,h,N.clamp(t,e(this,n),e(this,c))),r(this,l,this.current)},F=new WeakMap;exports.Animation=R;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
var I = (i) => {
|
|
2
|
+
throw TypeError(i);
|
|
3
|
+
};
|
|
4
|
+
var S = (i, s, t) => s.has(i) || I("Cannot " + t);
|
|
5
|
+
var e = (i, s, t) => (S(i, s, "read from private field"), t ? t.call(i) : s.get(i)), a = (i, s, t) => s.has(i) ? I("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, t), r = (i, s, t, u) => (S(i, s, "write to private field"), u ? u.call(i, t) : s.set(i, t), t), P = (i, s, t) => (S(i, s, "access private method"), t);
|
|
6
|
+
import { S as q } from "./Store-D2xCXENW.js";
|
|
7
|
+
import { c as R } from "./math-BOBiC4TN.js";
|
|
8
|
+
import { p as y } from "./number-DwCxt_Ck.js";
|
|
9
|
+
import { n as A } from "./polyfills-DJrTJQky.js";
|
|
10
|
+
import "./index-euf5anj6.js";
|
|
11
|
+
import { ticker as z } from "./ticker/index.js";
|
|
12
|
+
import { TICK_ORDER as N } from "./order/index.js";
|
|
13
|
+
var g, d, b, l, F, h, m, c, n, f, M, O, x;
|
|
14
|
+
class V extends q {
|
|
15
|
+
constructor(t, u) {
|
|
16
|
+
super(t || 0, u);
|
|
17
|
+
a(this, M);
|
|
18
|
+
a(this, g);
|
|
19
|
+
a(this, d, N.ANIMATION);
|
|
20
|
+
a(this, b);
|
|
21
|
+
a(this, l, new q(!1));
|
|
22
|
+
a(this, F, 0);
|
|
23
|
+
a(this, h, 0);
|
|
24
|
+
a(this, m, -1 / 0);
|
|
25
|
+
a(this, c, 1 / 0);
|
|
26
|
+
a(this, n, 0);
|
|
27
|
+
a(this, f, null);
|
|
28
|
+
a(this, x, (t) => {
|
|
29
|
+
this.handleAnimationFrame(t);
|
|
30
|
+
});
|
|
31
|
+
r(this, h, this.current);
|
|
32
|
+
}
|
|
33
|
+
get direction() {
|
|
34
|
+
return e(this, F);
|
|
35
|
+
}
|
|
36
|
+
get target() {
|
|
37
|
+
return e(this, h);
|
|
38
|
+
}
|
|
39
|
+
get min() {
|
|
40
|
+
return e(this, m);
|
|
41
|
+
}
|
|
42
|
+
set min(t) {
|
|
43
|
+
r(this, m, t), this.set(e(this, h), {
|
|
44
|
+
equalize: !0
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
get max() {
|
|
48
|
+
return e(this, c);
|
|
49
|
+
}
|
|
50
|
+
set max(t) {
|
|
51
|
+
r(this, c, t), this.set(e(this, h), {
|
|
52
|
+
equalize: !0
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
get from() {
|
|
56
|
+
return e(this, n);
|
|
57
|
+
}
|
|
58
|
+
get isRunning() {
|
|
59
|
+
return e(this, l);
|
|
60
|
+
}
|
|
61
|
+
get delta() {
|
|
62
|
+
return Math.abs(e(this, h) - e(this, n));
|
|
63
|
+
}
|
|
64
|
+
get deltaProgress() {
|
|
65
|
+
return this.delta ? y(Math.abs(this.current - e(this, n)) / this.delta, 6) : 0;
|
|
66
|
+
}
|
|
67
|
+
get distance() {
|
|
68
|
+
return Math.abs(e(this, c) - e(this, m));
|
|
69
|
+
}
|
|
70
|
+
get distanceProgress() {
|
|
71
|
+
return this.distance ? y(Math.abs(this.current - e(this, m)) / this.distance, 6) : 0;
|
|
72
|
+
}
|
|
73
|
+
set(t, u) {
|
|
74
|
+
(e(this, h) !== t || u != null && u.restart) && (r(this, f, t), this.updateOptions(u), r(this, f, null), e(this, h) !== this.current && this.start());
|
|
75
|
+
}
|
|
76
|
+
shift(t, u) {
|
|
77
|
+
this.set(e(this, h) + t, u);
|
|
78
|
+
}
|
|
79
|
+
reset() {
|
|
80
|
+
super.reset(), this.set(this.initial, { equalize: !0 });
|
|
81
|
+
}
|
|
82
|
+
close() {
|
|
83
|
+
super.close(), this.reset(), this.unlistenAnimationFrame();
|
|
84
|
+
}
|
|
85
|
+
listenAnimationFrame() {
|
|
86
|
+
e(this, l).current || (e(this, l).current = !0, z.subscribe(e(this, x), {
|
|
87
|
+
maxFPS: e(this, g),
|
|
88
|
+
order: e(this, d),
|
|
89
|
+
culling: e(this, b)
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
unlistenAnimationFrame() {
|
|
93
|
+
e(this, l).current && (e(this, l).current = !1, z.unsubscribe(e(this, x)));
|
|
94
|
+
}
|
|
95
|
+
updateOptions(t) {
|
|
96
|
+
r(this, g, A(t == null ? void 0 : t.maxFPS, e(this, g))), r(this, d, A(t == null ? void 0 : t.order, e(this, d))), r(this, b, A(t == null ? void 0 : t.culling, e(this, b))), r(this, m, A(t == null ? void 0 : t.min, e(this, m))), r(this, c, A(t == null ? void 0 : t.max, e(this, c))), P(this, M, O).call(this, typeof e(this, f) == "number" ? e(this, f) : e(this, h)), t != null && t.equalize && (this.unlistenAnimationFrame(), this.current = r(this, n, e(this, h))), t != null && t.restart && (this.unlistenAnimationFrame(), this.current = r(this, n, this.initial)), typeof (t == null ? void 0 : t.current) == "number" && r(this, n, this.current = t.current);
|
|
97
|
+
}
|
|
98
|
+
start() {
|
|
99
|
+
this.listenAnimationFrame();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
g = new WeakMap(), d = new WeakMap(), b = new WeakMap(), l = new WeakMap(), F = new WeakMap(), h = new WeakMap(), m = new WeakMap(), c = new WeakMap(), n = new WeakMap(), f = new WeakMap(), M = new WeakSet(), O = function(t) {
|
|
103
|
+
r(this, F, Math.sign(t - e(this, h))), r(this, h, R(t, e(this, m), e(this, c))), r(this, n, this.current);
|
|
104
|
+
}, x = new WeakMap();
|
|
105
|
+
export {
|
|
106
|
+
V as A
|
|
107
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var y=Object.defineProperty,C=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var g=t=>{throw TypeError(t)};var d=(t,e,s)=>e in t?y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,f=(t,e)=>{for(var s in e||(e={}))v.call(e,s)&&d(t,s,e[s]);if(l)for(var s of l(e))w.call(e,s)&&d(t,s,e[s]);return t},p=(t,e)=>C(t,O(e));var q=(t,e,s)=>e.has(t)||g("Cannot "+s);var a=(t,e,s)=>(q(t,e,"read from private field"),s?s.call(t):e.get(t)),c=(t,e,s)=>e.has(t)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),n=(t,e,s,r)=>(q(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s);const B=require("./math-GDWEqu7y.cjs"),b=require("./number-0243DApo.cjs"),m=require("./polyfills-Df4r-ETT.cjs");require("./index-Cqw2NKev.cjs");const D=require("./Animation-
|
|
1
|
+
"use strict";var y=Object.defineProperty,C=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var g=t=>{throw TypeError(t)};var d=(t,e,s)=>e in t?y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,f=(t,e)=>{for(var s in e||(e={}))v.call(e,s)&&d(t,s,e[s]);if(l)for(var s of l(e))w.call(e,s)&&d(t,s,e[s]);return t},p=(t,e)=>C(t,O(e));var q=(t,e,s)=>e.has(t)||g("Cannot "+s);var a=(t,e,s)=>(q(t,e,"read from private field"),s?s.call(t):e.get(t)),c=(t,e,s)=>e.has(t)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),n=(t,e,s,r)=>(q(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s);const B=require("./math-GDWEqu7y.cjs"),b=require("./number-0243DApo.cjs"),m=require("./polyfills-Df4r-ETT.cjs");require("./index-Cqw2NKev.cjs");const D=require("./Animation-ChZNIOTS.cjs");var i,h;class N extends D.Animation{constructor(s,r){super(s,r);c(this,i);c(this,h);this.damping=20,this.stiffness=0,this.mass=0,n(this,i,0),n(this,h,0),this.updateOptions(p(f({},r),{equalize:!0}))}get velocity(){return a(this,i)}get speed(){return a(this,h)}updateOptions(s){this.damping=m.nullishCoalescing(s==null?void 0:s.damping,this.damping),this.mass=m.nullishCoalescing(s==null?void 0:s.mass,this.mass),this.stiffness=m.nullishCoalescing(s==null?void 0:s.stiffness,this.stiffness),super.updateOptions(s)}handleAnimationFrame(s){b.preciseNumber(this.current,6)===b.preciseNumber(this.target,6)&&(this.unlistenAnimationFrame(),this.current=this.target);const r=this.current,A=Math.abs(r-this.target);n(this,h,A/s.timeBetweenFrames);const u=s.timeBetweenFrames/1e3;if(this.mass||this.stiffness){const F=(this.target-this.current)*this.stiffness-a(this,i)*this.damping;n(this,i,a(this,i)+F/this.mass*u),this.current+=a(this,i)*u}else this.current=B.damp(this.current,this.target,this.damping,u)}}i=new WeakMap,h=new WeakMap;exports.Damped=N;
|
|
@@ -19,7 +19,7 @@ import { d as D } from "./math-BOBiC4TN.js";
|
|
|
19
19
|
import { p as F } from "./number-DwCxt_Ck.js";
|
|
20
20
|
import { n as u } from "./polyfills-DJrTJQky.js";
|
|
21
21
|
import "./index-euf5anj6.js";
|
|
22
|
-
import { A as q } from "./Animation-
|
|
22
|
+
import { A as q } from "./Animation-FtUeV8dp.js";
|
|
23
23
|
var i, h;
|
|
24
24
|
class E extends q {
|
|
25
25
|
constructor(t, r) {
|
|
@@ -20,7 +20,7 @@ import { c as q } from "./math-BOBiC4TN.js";
|
|
|
20
20
|
import { p as w } from "./number-DwCxt_Ck.js";
|
|
21
21
|
import { n as z } from "./polyfills-DJrTJQky.js";
|
|
22
22
|
import "./index-euf5anj6.js";
|
|
23
|
-
import { A as C } from "./Animation-
|
|
23
|
+
import { A as C } from "./Animation-FtUeV8dp.js";
|
|
24
24
|
var s, t;
|
|
25
25
|
class G extends C {
|
|
26
26
|
constructor(e, i) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var F=Object.defineProperty,b=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var d=i=>{throw TypeError(i)};var h=(i,r,e)=>r in i?F(i,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[r]=e,g=(i,r)=>{for(var e in r||(r={}))O.call(r,e)&&h(i,e,r[e]);if(m)for(var e of m(r))w.call(r,e)&&h(i,e,r[e]);return i},f=(i,r)=>b(i,y(r));var q=(i,r,e)=>r.has(i)||d("Cannot "+e);var s=(i,r,e)=>(q(i,r,"read from private field"),e?e.call(i):r.get(i)),c=(i,r,e)=>r.has(i)?d("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,e),l=(i,r,e,a)=>(q(i,r,"write to private field"),a?a.call(i,e):r.set(i,e),e);const u=require("./easings-GegIwET5.cjs"),S=require("./math-GDWEqu7y.cjs"),T=require("./number-0243DApo.cjs"),x=require("./polyfills-Df4r-ETT.cjs");require("./index-Cqw2NKev.cjs");const z=require("./Animation-
|
|
1
|
+
"use strict";var F=Object.defineProperty,b=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var d=i=>{throw TypeError(i)};var h=(i,r,e)=>r in i?F(i,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[r]=e,g=(i,r)=>{for(var e in r||(r={}))O.call(r,e)&&h(i,e,r[e]);if(m)for(var e of m(r))w.call(r,e)&&h(i,e,r[e]);return i},f=(i,r)=>b(i,y(r));var q=(i,r,e)=>r.has(i)||d("Cannot "+e);var s=(i,r,e)=>(q(i,r,"read from private field"),e?e.call(i):r.get(i)),c=(i,r,e)=>r.has(i)?d("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,e),l=(i,r,e,a)=>(q(i,r,"write to private field"),a?a.call(i,e):r.set(i,e),e);const u=require("./easings-GegIwET5.cjs"),S=require("./math-GDWEqu7y.cjs"),T=require("./number-0243DApo.cjs"),x=require("./polyfills-Df4r-ETT.cjs");require("./index-Cqw2NKev.cjs");const z=require("./Animation-ChZNIOTS.cjs");var n,t;class C extends z.Animation{constructor(e,a){super(e||0,a);c(this,n,u.linear);c(this,t,1e3);this.updateOptions(f(g({},a),{equalize:!0}))}updateOptions(e){super.updateOptions(e),l(this,n,typeof(e==null?void 0:e.easing)=="function"?e.easing:typeof(e==null?void 0:e.easing)=="string"&&u.easings[e.easing]||u.linear),l(this,t,(e==null?void 0:e.duration)===!1?0:x.nullishCoalescing(e==null?void 0:e.duration,s(this,t)))}handleAnimationFrame(e){const a=e.timeElapsedSinceSubscription/1e3/(s(this,t)/1e3)||0,A=s(this,n).call(this,S.clamp(a,0,1));this.current=T.preciseNumber(this.from+(this.target-this.from)*A,6),a>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),this.listenAnimationFrame()}}n=new WeakMap,t=new WeakMap;exports.Tweened=C;
|
|
@@ -5,6 +5,7 @@ export interface AnimationOptions extends TickerAddOptions {
|
|
|
5
5
|
max?: number;
|
|
6
6
|
equalize?: boolean;
|
|
7
7
|
restart?: boolean;
|
|
8
|
+
current?: number;
|
|
8
9
|
}
|
|
9
10
|
export type AnimationConstructorOptions<Options extends AnimationOptions> = StoreOptions<number> & Options;
|
|
10
11
|
export declare abstract class Animation<Options extends AnimationOptions = AnimationOptions> extends Store<number> {
|
package/lib/animation/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Animation-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Animation-ChZNIOTS.cjs"),n=require("../Damped-B1lXa9nb.cjs"),i=require("../Tweened-cJ36zq1A.cjs");exports.Animation=e.Animation;exports.Damped=n.Damped;exports.Tweened=i.Tweened;
|
package/lib/animation/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as r } from "../Animation-
|
|
2
|
-
import { D as m } from "../Damped-
|
|
3
|
-
import { T as t } from "../Tweened-
|
|
1
|
+
import { A as r } from "../Animation-FtUeV8dp.js";
|
|
2
|
+
import { D as m } from "../Damped-BXsGpI-B.js";
|
|
3
|
+
import { T as t } from "../Tweened-BhDWLNF0.js";
|
|
4
4
|
export {
|
|
5
5
|
r as Animation,
|
|
6
6
|
m as Damped,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Notifier } from '../notifier';
|
|
2
|
-
export type ControlsCallback = (type: string, value: number) => void;
|
|
2
|
+
export type ControlsCallback = (type: string, value: number, event: any) => void;
|
|
3
3
|
export declare abstract class Controls {
|
|
4
4
|
#private;
|
|
5
5
|
get changeEvent(): Notifier<ControlsCallback>;
|
package/lib/controls/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var V=h=>{throw TypeError(h)};var F=(h,n,e)=>n.has(h)||V("Cannot "+e);var t=(h,n,e)=>(F(h,n,"read from private field"),e?e.call(h):n.get(h)),s=(h,n,e)=>n.has(h)?V("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(h):n.set(h,e),i=(h,n,e,r)=>(F(h,n,"write to private field"),r?r.call(h,e):n.set(h,e),e),k=(h,n,e)=>(F(h,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("../notifier/index.cjs"),
|
|
1
|
+
"use strict";var V=h=>{throw TypeError(h)};var F=(h,n,e)=>n.has(h)||V("Cannot "+e);var t=(h,n,e)=>(F(h,n,"read from private field"),e?e.call(h):n.get(h)),s=(h,n,e)=>n.has(h)?V("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(h):n.set(h,e),i=(h,n,e,r)=>(F(h,n,"write to private field"),r?r.call(h,e):n.set(h,e),e),k=(h,n,e)=>(F(h,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("../notifier/index.cjs"),w=require("../index-Cqw2NKev.cjs"),Q=require("../dom-JBOkFLTh.cjs"),q=require("../ticker/index.cjs");require("../Store-DRp_K37w.cjs");const J=require("../easings-GegIwET5.cjs"),Z=require("../Tweened-cJ36zq1A.cjs"),_=require("../gestures-C7gbKx11.cjs"),$=require("../number-0243DApo.cjs"),p=require("../order/index.cjs");var R;class Y{constructor(){s(this,R,new G.Notifier)}get changeEvent(){return t(this,R)}}R=new WeakMap;var b,c,u,H;class ee extends Y{constructor(e){super();s(this,b,null);s(this,c,null);s(this,u,"offsetHeight");s(this,H,e=>{const r=e.shiftKey?-1:1;let a;e.code==="Space"?a=r*t(this,c)[t(this,u)]*.4:e.code==="ArrowLeft"?a=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowRight"?a=1*t(this,c)[t(this,u)]*.2:e.code==="ArrowUp"?a=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowDown"?a=1*t(this,c)[t(this,u)]*.2:e.code==="PageUp"?a=-1*t(this,c)[t(this,u)]:e.code==="PageDown"?a=1*t(this,c)[t(this,u)]:e.code==="Home"?a=0:e.code==="End"&&(a=t(this,u)==="offsetWidth"?t(this,c).scrollWidth:t(this,c).scrollHeight),a&&(e.stopPropagation(),this.changeEvent.notify("keyboard",a,e))});w.isBrowser&&(i(this,b,e!=null&&e.element&&Q.getElement(e.element)||window),i(this,c,t(this,b)instanceof HTMLElement?t(this,b):document.documentElement),this.dimension=e==null?void 0:e.dimension)}set dimension(e){i(this,u,e==="width"?"offsetWidth":"offsetHeight")}connect(){w.isBrowser&&t(this,b).addEventListener("keydown",t(this,H))}disconnect(){w.isBrowser&&t(this,b).removeEventListener("keydown",t(this,H))}}b=new WeakMap,c=new WeakMap,u=new WeakMap,H=new WeakMap;var y,v,P,z,d,T,f,g,O,U,C,W,B;class te extends Y{constructor(e){super();s(this,g);s(this,y);s(this,v);s(this,P);s(this,z);s(this,d);s(this,T);s(this,f);s(this,C);s(this,W);s(this,B);this.direction=1,i(this,d,new Z.Tweened(0,{easing:J.easeInQuad})),i(this,f,!1),i(this,C,r=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",r.timeBetweenFrames*t(this,y)*this.direction*(1-t(this,d).current),r)}),i(this,W,()=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",Math.sign(t(this,y))*this.direction*(1-t(this,d).current),null)}),i(this,B,()=>{t(this,v)&&(document.hidden?t(this,d).set(1,{equalize:!0}):t(this,d).set(0,{equalize:!0}))}),i(this,y,(e==null?void 0:e.speed)||1),i(this,v,(e==null?void 0:e.interval)||!1),i(this,P,e)}set interval(e){i(this,v,e),t(this,f)&&k(this,g,O).call(this)}set speed(e){i(this,y,e),t(this,f)&&k(this,g,O).call(this)}connect(){t(this,f)||(i(this,f,!0),k(this,g,O).call(this))}disconnect(){t(this,f)&&(i(this,f,!1),k(this,g,U).call(this))}pauseAndContinue(e,r){t(this,f)&&e&&(clearTimeout(t(this,T)),t(this,d).set(1,{duration:Math.min(e,1e3),equalize:r}),i(this,T,setTimeout(()=>{t(this,d).set(0,{duration:Math.min(e,5e3),equalize:r})},e)))}}y=new WeakMap,v=new WeakMap,P=new WeakMap,z=new WeakMap,d=new WeakMap,T=new WeakMap,f=new WeakMap,g=new WeakSet,O=function(){k(this,g,U).call(this),t(this,v)?i(this,z,setInterval(t(this,W),Math.abs(t(this,y)))):q.ticker.subscribe(t(this,C),t(this,P)),document.addEventListener("visibilitychange",t(this,B))},U=function(){clearInterval(t(this,z)),q.ticker.unsubscribe(t(this,C)),clearTimeout(t(this,T)),t(this,d).close(),document.removeEventListener("visibilitychange",t(this,B))},C=new WeakMap,W=new WeakMap,B=new WeakMap;var A,L,D,X;class ie extends Y{constructor(e){super();s(this,A,null);s(this,L);s(this,D);s(this,X,e=>{let r=0;if(!(this.axis==="x"&&Math.abs(e.deltaY)>Math.abs(e.deltaX)*1||this.axis==="y"&&Math.abs(e.deltaX)>Math.abs(e.deltaY)*1))if(e.preventDefault(),r=(this.axis==="max"?Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY:this.axis==="x"?e.deltaX:e.deltaY)*this.speed,e.stopPropagation(),this.debounce){const a=Date.now();if(a-t(this,D)>40&&(r=100*Math.sign(r)),i(this,D,a),Math.abs(r)<100||t(this,L))return;this.changeEvent.notify("wheel",r,e),i(this,L,setTimeout(()=>{i(this,L,void 0)},80))}else this.changeEvent.notify("wheel",r,e)});this.axis=(e==null?void 0:e.axis)||"y",this.speed=(e==null?void 0:e.speed)||1,this.debounce=(e==null?void 0:e.debounce)||!1,i(this,D,Date.now()),w.isBrowser&&i(this,A,e!=null&&e.element&&Q.getElement(e.element)||window)}connect(){w.isBrowser&&t(this,A).addEventListener("wheel",t(this,X),{passive:!1})}disconnect(){w.isBrowser&&(t(this,A).removeEventListener("wheel",t(this,X)),clearTimeout(t(this,L)))}}A=new WeakMap,L=new WeakMap,D=new WeakMap,X=new WeakMap;var M,o,l,I,E;const x=class x extends Y{constructor(e){super();s(this,o);s(this,l);s(this,I);s(this,E);this.inertion=1,i(this,o,null),i(this,l,0),i(this,I,r=>{if(r.composedPath().find(m=>m instanceof HTMLElement&&m.hasAttribute("drag-dead-zone")))return;this.swipe||q.ticker.unsubscribe(t(this,E));let a=r,S=!1;i(this,l,0),document.documentElement.classList.add("grabbing");let K=0,N=0;_.setupDrag(m=>{t(x,M)&&t(x,M)!==t(this,o)||(K=a.x-m.x,N=a.y-m.y,this.axis==="x"?i(this,l,K):i(this,l,N),a=m,S=this.axis==="x"&&Math.abs(K)>Math.abs(N)||this.axis==="y"&&Math.abs(N)>Math.abs(K),S&&(document.documentElement.classList.add("dragging"),i(x,M,t(this,o)),this.changeEvent.notify("drag",t(this,l),m)))},m=>{i(x,M,null),S&&!this.swipe&&this.inertion?(i(this,l,t(this,l)*this.inertion),q.ticker.subscribe(t(this,E),{order:p.TICK_ORDER.CONTROLS-1})):this.swipe&&this.changeEvent.notify("drag-end",t(this,l),m),document.documentElement.classList.remove("grabbing"),document.documentElement.classList.remove("dragging")})}),i(this,E,()=>{Math.floor(Math.abs(t(this,l)))||q.ticker.unsubscribe(t(this,E)),i(this,l,t(this,l)*.95),i(this,l,$.preciseNumber(t(this,l),3)),this.changeEvent.notify("drag",t(this,l),null)}),this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,w.isBrowser&&i(this,o,e!=null&&e.element&&Q.getElement(e.element)||document.documentElement)}connect(){w.isBrowser&&t(this,o).addEventListener("pointerdown",t(this,I))}disconnect(){w.isBrowser&&(t(this,o).removeEventListener("pointerdown",t(this,I)),q.ticker.unsubscribe(t(this,E)))}};M=new WeakMap,o=new WeakMap,l=new WeakMap,I=new WeakMap,E=new WeakMap,s(x,M,null);let j=x;exports.AutoplayControls=te;exports.Controls=Y;exports.DragControls=j;exports.KeyboardControls=ee;exports.WheelControls=ie;
|
package/lib/controls/index.js
CHANGED
|
@@ -4,13 +4,13 @@ var V = (h) => {
|
|
|
4
4
|
var S = (h, n, e) => n.has(h) || V("Cannot " + e);
|
|
5
5
|
var t = (h, n, e) => (S(h, n, "read from private field"), e ? e.call(h) : n.get(h)), s = (h, n, e) => n.has(h) ? V("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(h) : n.set(h, e), i = (h, n, e, a) => (S(h, n, "write to private field"), a ? a.call(h, e) : n.set(h, e), e), T = (h, n, e) => (S(h, n, "access private method"), e);
|
|
6
6
|
import { Notifier as G } from "../notifier/index.js";
|
|
7
|
-
import { i as
|
|
7
|
+
import { i as b } from "../index-euf5anj6.js";
|
|
8
8
|
import { g as Q } from "../dom-CVWzyXPH.js";
|
|
9
9
|
import { ticker as k } from "../ticker/index.js";
|
|
10
10
|
import "../Store-D2xCXENW.js";
|
|
11
11
|
import { b as J } from "../easings-Bni3YAAW.js";
|
|
12
|
-
import { T as Z } from "../Tweened-
|
|
13
|
-
import { s as $ } from "../gestures-
|
|
12
|
+
import { T as Z } from "../Tweened-BhDWLNF0.js";
|
|
13
|
+
import { s as $ } from "../gestures-CcXV6fCp.js";
|
|
14
14
|
import { p } from "../number-DwCxt_Ck.js";
|
|
15
15
|
import { TICK_ORDER as _ } from "../order/index.js";
|
|
16
16
|
var O;
|
|
@@ -23,44 +23,44 @@ class B {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
O = new WeakMap();
|
|
26
|
-
var
|
|
27
|
-
class
|
|
26
|
+
var w, d, u, P;
|
|
27
|
+
class ue extends B {
|
|
28
28
|
constructor(e) {
|
|
29
29
|
super();
|
|
30
|
-
s(this,
|
|
30
|
+
s(this, w, null);
|
|
31
31
|
s(this, d, null);
|
|
32
|
-
s(this,
|
|
32
|
+
s(this, u, "offsetHeight");
|
|
33
33
|
s(this, P, (e) => {
|
|
34
34
|
const a = e.shiftKey ? -1 : 1;
|
|
35
35
|
let r;
|
|
36
|
-
e.code === "Space" ? r = a * t(this, d)[t(this,
|
|
36
|
+
e.code === "Space" ? r = a * t(this, d)[t(this, u)] * 0.4 : e.code === "ArrowLeft" ? r = -1 * t(this, d)[t(this, u)] * 0.2 : e.code === "ArrowRight" ? r = 1 * t(this, d)[t(this, u)] * 0.2 : e.code === "ArrowUp" ? r = -1 * t(this, d)[t(this, u)] * 0.2 : e.code === "ArrowDown" ? r = 1 * t(this, d)[t(this, u)] * 0.2 : e.code === "PageUp" ? r = -1 * t(this, d)[t(this, u)] : e.code === "PageDown" ? r = 1 * t(this, d)[t(this, u)] : e.code === "Home" ? r = 0 : e.code === "End" && (r = t(this, u) === "offsetWidth" ? t(this, d).scrollWidth : t(this, d).scrollHeight), r && (e.stopPropagation(), this.changeEvent.notify("keyboard", r, e));
|
|
37
37
|
});
|
|
38
|
-
|
|
38
|
+
b && (i(this, w, e != null && e.element && Q(e.element) || window), i(this, d, t(this, w) instanceof HTMLElement ? t(this, w) : document.documentElement), this.dimension = e == null ? void 0 : e.dimension);
|
|
39
39
|
}
|
|
40
40
|
set dimension(e) {
|
|
41
|
-
i(this,
|
|
41
|
+
i(this, u, e === "width" ? "offsetWidth" : "offsetHeight");
|
|
42
42
|
}
|
|
43
43
|
connect() {
|
|
44
|
-
|
|
44
|
+
b && t(this, w).addEventListener(
|
|
45
45
|
"keydown",
|
|
46
46
|
t(this, P)
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
disconnect() {
|
|
50
|
-
|
|
50
|
+
b && t(this, w).removeEventListener(
|
|
51
51
|
"keydown",
|
|
52
52
|
t(this, P)
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
var
|
|
56
|
+
w = new WeakMap(), d = new WeakMap(), u = new WeakMap(), P = new WeakMap();
|
|
57
|
+
var E, L, X, Y, c, C, f, g, K, U, A, q, I;
|
|
58
58
|
class fe extends B {
|
|
59
59
|
constructor(e) {
|
|
60
60
|
super();
|
|
61
|
-
s(this,
|
|
62
|
-
s(this,
|
|
63
|
-
s(this,
|
|
61
|
+
s(this, g);
|
|
62
|
+
s(this, E);
|
|
63
|
+
s(this, L);
|
|
64
64
|
s(this, X);
|
|
65
65
|
s(this, Y);
|
|
66
66
|
s(this, c);
|
|
@@ -72,28 +72,30 @@ class fe extends B {
|
|
|
72
72
|
this.direction = 1, i(this, c, new Z(0, { easing: J })), i(this, f, !1), i(this, A, (a) => {
|
|
73
73
|
t(this, c).current !== 1 && this.changeEvent.notify(
|
|
74
74
|
"autoplay",
|
|
75
|
-
a.timeBetweenFrames * t(this,
|
|
75
|
+
a.timeBetweenFrames * t(this, E) * this.direction * (1 - t(this, c).current),
|
|
76
|
+
a
|
|
76
77
|
);
|
|
77
78
|
}), i(this, q, () => {
|
|
78
79
|
t(this, c).current !== 1 && this.changeEvent.notify(
|
|
79
80
|
"autoplay",
|
|
80
|
-
Math.sign(t(this,
|
|
81
|
+
Math.sign(t(this, E)) * this.direction * (1 - t(this, c).current),
|
|
82
|
+
null
|
|
81
83
|
);
|
|
82
84
|
}), i(this, I, () => {
|
|
83
|
-
t(this,
|
|
84
|
-
}), i(this,
|
|
85
|
+
t(this, L) && (document.hidden ? t(this, c).set(1, { equalize: !0 }) : t(this, c).set(0, { equalize: !0 }));
|
|
86
|
+
}), i(this, E, (e == null ? void 0 : e.speed) || 1), i(this, L, (e == null ? void 0 : e.interval) || !1), i(this, X, e);
|
|
85
87
|
}
|
|
86
88
|
set interval(e) {
|
|
87
|
-
i(this,
|
|
89
|
+
i(this, L, e), t(this, f) && T(this, g, K).call(this);
|
|
88
90
|
}
|
|
89
91
|
set speed(e) {
|
|
90
|
-
i(this,
|
|
92
|
+
i(this, E, e), t(this, f) && T(this, g, K).call(this);
|
|
91
93
|
}
|
|
92
94
|
connect() {
|
|
93
|
-
t(this, f) || (i(this, f, !0), T(this,
|
|
95
|
+
t(this, f) || (i(this, f, !0), T(this, g, K).call(this));
|
|
94
96
|
}
|
|
95
97
|
disconnect() {
|
|
96
|
-
t(this, f) && (i(this, f, !1), T(this,
|
|
98
|
+
t(this, f) && (i(this, f, !1), T(this, g, U).call(this));
|
|
97
99
|
}
|
|
98
100
|
pauseAndContinue(e, a) {
|
|
99
101
|
t(this, f) && e && (clearTimeout(t(this, C)), t(this, c).set(1, {
|
|
@@ -107,10 +109,10 @@ class fe extends B {
|
|
|
107
109
|
}, e)));
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
|
-
|
|
111
|
-
T(this,
|
|
112
|
+
E = new WeakMap(), L = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), c = new WeakMap(), C = new WeakMap(), f = new WeakMap(), g = new WeakSet(), K = function() {
|
|
113
|
+
T(this, g, U).call(this), t(this, L) ? i(this, Y, setInterval(
|
|
112
114
|
t(this, q),
|
|
113
|
-
Math.abs(t(this,
|
|
115
|
+
Math.abs(t(this, E))
|
|
114
116
|
)) : k.subscribe(t(this, A), t(this, X)), document.addEventListener(
|
|
115
117
|
"visibilitychange",
|
|
116
118
|
t(this, I)
|
|
@@ -121,30 +123,30 @@ w = new WeakMap(), v = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), c =
|
|
|
121
123
|
t(this, I)
|
|
122
124
|
);
|
|
123
125
|
}, A = new WeakMap(), q = new WeakMap(), I = new WeakMap();
|
|
124
|
-
var D,
|
|
125
|
-
class
|
|
126
|
+
var D, v, H, N;
|
|
127
|
+
class me extends B {
|
|
126
128
|
constructor(e) {
|
|
127
129
|
super();
|
|
128
130
|
s(this, D, null);
|
|
129
|
-
s(this,
|
|
131
|
+
s(this, v);
|
|
130
132
|
s(this, H);
|
|
131
133
|
s(this, N, (e) => {
|
|
132
134
|
let a = 0;
|
|
133
135
|
if (!(this.axis === "x" && Math.abs(e.deltaY) > Math.abs(e.deltaX) * 1 || this.axis === "y" && Math.abs(e.deltaX) > Math.abs(e.deltaY) * 1))
|
|
134
136
|
if (e.preventDefault(), a = (this.axis === "max" ? Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY : this.axis === "x" ? e.deltaX : e.deltaY) * this.speed, e.stopPropagation(), this.debounce) {
|
|
135
137
|
const r = Date.now();
|
|
136
|
-
if (r - t(this, H) > 40 && (a = 100 * Math.sign(a)), i(this, H, r), Math.abs(a) < 100 || t(this,
|
|
138
|
+
if (r - t(this, H) > 40 && (a = 100 * Math.sign(a)), i(this, H, r), Math.abs(a) < 100 || t(this, v))
|
|
137
139
|
return;
|
|
138
|
-
this.changeEvent.notify("wheel", a), i(this,
|
|
139
|
-
i(this,
|
|
140
|
+
this.changeEvent.notify("wheel", a, e), i(this, v, setTimeout(() => {
|
|
141
|
+
i(this, v, void 0);
|
|
140
142
|
}, 80));
|
|
141
143
|
} else
|
|
142
|
-
this.changeEvent.notify("wheel", a);
|
|
144
|
+
this.changeEvent.notify("wheel", a, e);
|
|
143
145
|
});
|
|
144
|
-
this.axis = (e == null ? void 0 : e.axis) || "y", this.speed = (e == null ? void 0 : e.speed) || 1, this.debounce = (e == null ? void 0 : e.debounce) || !1, i(this, H, Date.now()),
|
|
146
|
+
this.axis = (e == null ? void 0 : e.axis) || "y", this.speed = (e == null ? void 0 : e.speed) || 1, this.debounce = (e == null ? void 0 : e.debounce) || !1, i(this, H, Date.now()), b && i(this, D, e != null && e.element && Q(e.element) || window);
|
|
145
147
|
}
|
|
146
148
|
connect() {
|
|
147
|
-
|
|
149
|
+
b && t(this, D).addEventListener(
|
|
148
150
|
"wheel",
|
|
149
151
|
t(this, N),
|
|
150
152
|
{
|
|
@@ -153,60 +155,60 @@ class ue extends B {
|
|
|
153
155
|
);
|
|
154
156
|
}
|
|
155
157
|
disconnect() {
|
|
156
|
-
|
|
158
|
+
b && (t(this, D).removeEventListener(
|
|
157
159
|
"wheel",
|
|
158
160
|
t(this, N)
|
|
159
|
-
), clearTimeout(t(this,
|
|
161
|
+
), clearTimeout(t(this, v)));
|
|
160
162
|
}
|
|
161
163
|
}
|
|
162
|
-
D = new WeakMap(),
|
|
163
|
-
var
|
|
164
|
-
const
|
|
164
|
+
D = new WeakMap(), v = new WeakMap(), H = new WeakMap(), N = new WeakMap();
|
|
165
|
+
var M, o, l, z, y;
|
|
166
|
+
const x = class x extends B {
|
|
165
167
|
constructor(e) {
|
|
166
168
|
super();
|
|
167
|
-
s(this,
|
|
169
|
+
s(this, o);
|
|
168
170
|
s(this, l);
|
|
169
171
|
s(this, z);
|
|
170
|
-
s(this,
|
|
171
|
-
this.inertion = 1, i(this,
|
|
172
|
+
s(this, y);
|
|
173
|
+
this.inertion = 1, i(this, o, null), i(this, l, 0), i(this, z, (a) => {
|
|
172
174
|
if (a.composedPath().find(
|
|
173
|
-
(
|
|
175
|
+
(m) => m instanceof HTMLElement && m.hasAttribute("drag-dead-zone")
|
|
174
176
|
))
|
|
175
177
|
return;
|
|
176
|
-
this.swipe || k.unsubscribe(t(this,
|
|
178
|
+
this.swipe || k.unsubscribe(t(this, y));
|
|
177
179
|
let r = a, F = !1;
|
|
178
180
|
i(this, l, 0), document.documentElement.classList.add("grabbing");
|
|
179
181
|
let R = 0, W = 0;
|
|
180
182
|
$(
|
|
181
|
-
(
|
|
182
|
-
t(
|
|
183
|
+
(m) => {
|
|
184
|
+
t(x, M) && t(x, M) !== t(this, o) || (R = r.x - m.x, W = r.y - m.y, this.axis === "x" ? i(this, l, R) : i(this, l, W), r = m, F = this.axis === "x" && Math.abs(R) > Math.abs(W) || this.axis === "y" && Math.abs(W) > Math.abs(R), F && (document.documentElement.classList.add("dragging"), i(x, M, t(this, o)), this.changeEvent.notify("drag", t(this, l), m)));
|
|
183
185
|
},
|
|
184
|
-
() => {
|
|
185
|
-
i(
|
|
186
|
+
(m) => {
|
|
187
|
+
i(x, M, null), F && !this.swipe && this.inertion ? (i(this, l, t(this, l) * this.inertion), k.subscribe(t(this, y), {
|
|
186
188
|
order: _.CONTROLS - 1
|
|
187
|
-
})) : this.swipe && this.changeEvent.notify("drag-end", t(this, l)), document.documentElement.classList.remove("grabbing"), document.documentElement.classList.remove("dragging");
|
|
189
|
+
})) : this.swipe && this.changeEvent.notify("drag-end", t(this, l), m), document.documentElement.classList.remove("grabbing"), document.documentElement.classList.remove("dragging");
|
|
188
190
|
}
|
|
189
191
|
);
|
|
190
|
-
}), i(this,
|
|
191
|
-
Math.floor(Math.abs(t(this, l))) || k.unsubscribe(t(this,
|
|
192
|
-
}), this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1,
|
|
192
|
+
}), i(this, y, () => {
|
|
193
|
+
Math.floor(Math.abs(t(this, l))) || k.unsubscribe(t(this, y)), i(this, l, t(this, l) * 0.95), i(this, l, p(t(this, l), 3)), this.changeEvent.notify("drag", t(this, l), null);
|
|
194
|
+
}), this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1, b && i(this, o, e != null && e.element && Q(e.element) || document.documentElement);
|
|
193
195
|
}
|
|
194
196
|
connect() {
|
|
195
|
-
|
|
197
|
+
b && t(this, o).addEventListener("pointerdown", t(this, z));
|
|
196
198
|
}
|
|
197
199
|
disconnect() {
|
|
198
|
-
|
|
200
|
+
b && (t(this, o).removeEventListener(
|
|
199
201
|
"pointerdown",
|
|
200
202
|
t(this, z)
|
|
201
|
-
), k.unsubscribe(t(this,
|
|
203
|
+
), k.unsubscribe(t(this, y)));
|
|
202
204
|
}
|
|
203
205
|
};
|
|
204
|
-
|
|
205
|
-
let j =
|
|
206
|
+
M = new WeakMap(), o = new WeakMap(), l = new WeakMap(), z = new WeakMap(), y = new WeakMap(), s(x, M, null);
|
|
207
|
+
let j = x;
|
|
206
208
|
export {
|
|
207
209
|
fe as AutoplayControls,
|
|
208
210
|
B as Controls,
|
|
209
211
|
j as DragControls,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
+
ue as KeyboardControls,
|
|
213
|
+
me as WheelControls
|
|
212
214
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var g=s=>{throw TypeError(s)};var E=(s,r,t)=>r.has(s)||g("Cannot "+t);var e=(s,r,t)=>(E(s,r,"read from private field"),t?t.call(s):r.get(s)),n=(s,r,t)=>r.has(s)?g("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),a=(s,r,t,l)=>(E(s,r,"write to private field"),l?l.call(s,t):r.set(s,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../element-resizer/index.cjs"),p=require("../window-resizer/index.cjs"),S=require("../index-Cqw2NKev.cjs"),x=require("../dom-JBOkFLTh.cjs"),T=require("../gestures-
|
|
1
|
+
"use strict";var g=s=>{throw TypeError(s)};var E=(s,r,t)=>r.has(s)||g("Cannot "+t);var e=(s,r,t)=>(E(s,r,"read from private field"),t?t.call(s):r.get(s)),n=(s,r,t)=>r.has(s)?g("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),a=(s,r,t,l)=>(E(s,r,"write to private field"),l?l.call(s,t):r.set(s,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../element-resizer/index.cjs"),p=require("../window-resizer/index.cjs"),S=require("../index-Cqw2NKev.cjs"),x=require("../dom-JBOkFLTh.cjs"),T=require("../gestures-C7gbKx11.cjs");var i,o,m,c,u,d,h,b;class v extends HTMLElement{constructor(){super(...arguments);n(this,i,null);n(this,o,null);n(this,m,0);n(this,c,0);n(this,u);n(this,d,()=>{this.classList.add("active"),clearTimeout(e(this,u));const t=e(this,i).scrollTop/e(this,c)*e(this,m);e(this,o).style.transform=`translate3d(0px, ${t}px, 0px)`,a(this,u,setTimeout(()=>{this.classList.remove("active")},1e3))});n(this,h,()=>{const t=this.offsetHeight;a(this,c,e(this,i).scrollHeight-e(this,i).offsetHeight);let l=t/(e(this,c)/t);l=Math.max(l,30),e(this,o).style.width="100%",e(this,o).style.height=l+"px",a(this,m,t-l),e(this,i).scrollHeight>e(this,i).offsetHeight||(this.style.display="none")});n(this,b,t=>{document.documentElement.classList.add("grabbing"),T.setupDrag(w=>{const y=e(this,c)/e(this,m),z=(w.y-L)*y;e(this,i).scroll({top:l+z,behavior:"instant"})},()=>{document.documentElement.classList.remove("grabbing")});const l=e(this,i).scrollTop,L=t.y})}connectedCallback(){const t=x.findScrollParentElement(this),l=this.querySelector("[data-thumb]");t&&l&&(a(this,i,t),a(this,o,l),f.elementResizer.subscribe(e(this,i),e(this,h)),p.windowResizer.subscribe(e(this,h)),e(this,i).addEventListener("scroll",e(this,d)),e(this,o).addEventListener("pointerdown",e(this,b)))}disconnectedCallback(){f.elementResizer.unsubscribe(e(this,h)),p.windowResizer.unsubscribe(e(this,h)),e(this,i).removeEventListener("scroll",e(this,d)),e(this,o).removeEventListener("pointerdown",e(this,b)),clearTimeout(e(this,u))}}i=new WeakMap,o=new WeakMap,m=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,h=new WeakMap,b=new WeakMap;S.isBrowser&&!customElements.get("e-custom-scrollbar")&&customElements.define("e-custom-scrollbar",v);exports.CustomScrollbarElement=v;
|
|
@@ -7,7 +7,7 @@ import { elementResizer as E } from "../element-resizer/index.js";
|
|
|
7
7
|
import { windowResizer as g } from "../window-resizer/index.js";
|
|
8
8
|
import { i as S } from "../index-euf5anj6.js";
|
|
9
9
|
import { f as T } from "../dom-CVWzyXPH.js";
|
|
10
|
-
import { s as w } from "../gestures-
|
|
10
|
+
import { s as w } from "../gestures-CcXV6fCp.js";
|
|
11
11
|
var i, n, a, h, u, d, c, b;
|
|
12
12
|
class z extends HTMLElement {
|
|
13
13
|
constructor() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function s(t,n){const i=r=>{t==null||t(r)},e=r=>{removeEventListener("pointermove",i),removeEventListener("pointerup",e),removeEventListener("touchend",e),n==null||n(r)};addEventListener("pointermove",i),addEventListener("pointerup",e),addEventListener("touchend",e)}exports.setupDrag=s;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function s(t, n) {
|
|
2
|
+
const i = (r) => {
|
|
3
|
+
t == null || t(r);
|
|
4
|
+
}, e = (r) => {
|
|
5
|
+
removeEventListener("pointermove", i), removeEventListener("pointerup", e), removeEventListener("touchend", e), n == null || n(r);
|
|
6
|
+
};
|
|
7
|
+
addEventListener("pointermove", i), addEventListener("pointerup", e), addEventListener("touchend", e);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
s
|
|
11
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var wt=r=>{throw TypeError(r)};var Ge=(r,s,t)=>s.has(r)||wt("Cannot "+t);var e=(r,s,t)=>(Ge(r,s,"read from private field"),t?t.call(r):s.get(r)),o=(r,s,t)=>s.has(r)?wt("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(r):s.set(r,t),c=(r,s,t,i)=>(Ge(r,s,"write to private field"),i?i.call(r,t):s.set(r,t),t),l=(r,s,t)=>(Ge(r,s,"access private method"),t);const p=require("../index-Cqw2NKev.cjs"),m=require("../Store-DRp_K37w.cjs"),Yt=require("../file-DSpfWdd9.cjs"),Gt=require("../function-MthRj-GJ.cjs"),St=require("../gestures-DHLrn6Q8.cjs");require("../ticker/index.cjs");const pe=require("../string-DhgS_iFl.cjs"),bt=require("../object-CCiXnER2.cjs"),Ut=require("../connector/index.cjs"),Xt=require("../device/index.cjs"),Qt=require("../math-GDWEqu7y.cjs"),jt=require("../number-0243DApo.cjs"),vt=require("../polyfills-Df4r-ETT.cjs"),yt=require("../element-resizer/index.cjs"),es=require("../style-At6aDoqG.cjs"),ts=new Set(["animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","listener","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","text","textPath","title","tspan","view","use"]);var d,B,S,we,I,H,a,kt,Et,xt,Ue,Xe,Ct,Tt,Lt,zt,Qe,je,Rt,et,tt,Mt,st,qe,it,nt,ot,Ke,Oe;const Ze=class Ze{constructor(...s){o(this,a);o(this,d,null);o(this,B,new Set);o(this,S,new Set);o(this,we);o(this,I);o(this,H);o(this,Ke,s=>{e(this,B).forEach(t=>{t(s)}),e(this,B).clear()});o(this,Oe,(s,t)=>{e(this,S).forEach(i=>{i(s,t)}),e(this,S).clear(),l(this,a,tt).call(this)});if(p.isBrowser){const t=s[0],i=s[1];c(this,d,l(this,a,kt).call(this,t,i==null?void 0:i.forceSvg)),l(this,a,xt).call(this,i)}}get node(){return e(this,d)}set node(s){var t;l(this,a,tt).call(this),c(this,d,s),(t=e(this,we))==null||t.call(this),e(this,d)instanceof Element&&c(this,I,[...e(this,d).querySelectorAll("store-root")]),l(this,a,et).call(this),l(this,a,Ue).call(this)}};d=new WeakMap,B=new WeakMap,S=new WeakMap,we=new WeakMap,I=new WeakMap,H=new WeakMap,a=new WeakSet,kt=function(s,t){let i=null;if(s instanceof Node)i=s;else if(typeof s=="string")if(!s.includes("<")&&s.includes("-"))i=new(customElements.get(s));else if(s.includes("<")){const n=document.createElement("div");n.innerHTML=s,i=n.firstElementChild}else ts.has(s)||t?i=document.createElementNS("http://www.w3.org/2000/svg",s):i=document.createElement(s);else i=document.createElement("div");return i},Et=function(s){return s instanceof HTMLElement||s instanceof SVGElement},xt=function(s){if(!s)return;const t=l(this,a,Et).call(this,e(this,d)),i=s.ref;delete s.ref,s!=null&&s.onConnect&&(e(this,B).add(s.onConnect),delete s.onConnect),s!=null&&s.onDisconnect&&(e(this,S).add(s.onDisconnect),delete s.onDisconnect);let n,h;for(const u in s){const g=s[u];u==="class"&&t?l(this,a,Xe).call(this,g):u==="style"&&t?l(this,a,Lt).call(this,g):u==="lightChildren"?l(this,a,qe).call(this,e(this,d),g):u==="children"?l(this,a,qe).call(this,e(this,d)instanceof Element?e(this,d).shadowRoot||e(this,d):e(this,d),g):u==="connectedClass"?e(this,B).add(()=>{requestAnimationFrame(()=>{e(this,d).classList.add(typeof g=="boolean"?"connected":g)})}):u.startsWith("on")?(h||(h={}),h[u]=g):(n||(n={}),n[u]=g)}l(this,a,Mt).call(this,n),l(this,a,Rt).call(this,h),i&&(typeof i=="function"?i(e(this,d)):i.current=e(this,d)),l(this,a,Ue).call(this)},Ue=function(){if(p.isBrowser&&(e(this,S).size||e(this,B).size)){const s=e(this,d)instanceof DocumentFragment?e(this,d).firstChild:e(this,d);c(this,we,Ut.connector.subscribe(s,{connectCallback:e(this,Ke),disconnectCallback:e(this,Oe),unsubscribeAfterDisconnect:!0,maxWaitSec:20}))}},Xe=function(s){if(s){if(typeof s=="string")e(this,d).classList.add(s);else if(Array.isArray(s))s.forEach(t=>{t&&l(this,a,Xe).call(this,t)});else if(typeof s=="object")if(s instanceof m.Store)l(this,a,Ct).call(this,s);else for(const t in s){const i=s[t];i instanceof m.Store?l(this,a,Tt).call(this,t,i):i?e(this,d).classList.add(t):e(this,d).classList.remove(t)}}else return},Ct=function(s){e(this,S).add(s.subscribe(({current:t,previous:i})=>{i&&[i].flat().forEach(n=>{n&&e(this,d).classList.remove(n)}),t&&[t].flat().forEach(n=>{n&&e(this,d).classList.add(n)})}))},Tt=function(s,t){e(this,S).add(t.subscribe(({current:i})=>{i?e(this,d).classList.add(s):e(this,d).classList.remove(s)}))},Lt=function(s){if(!s)return;e(this,d).tagName==="style"||e(this,d).tagName==="STYLE"?l(this,a,Qe).call(this,s):l(this,a,zt).call(this,s)},zt=function(s){for(const t in s){const i=t,n=s[i];n instanceof m.Store?e(this,S).add(n.subscribe(({current:h})=>{l(this,a,je).call(this,i,h)})):l(this,a,je).call(this,i,n)}},Qe=function(s){for(const t in s){const i=s[t];if(typeof i=="object"&&!(i instanceof m.Store))e(this,d).appendChild(document.createTextNode(`${t} {`)),l(this,a,Qe).call(this,i),e(this,d).appendChild(document.createTextNode("}"));else if(i instanceof m.Store){const n=document.createTextNode("");e(this,S).add(i.subscribe(h=>{h.current?n.nodeValue=`${pe.camelToKebab(t)}: ${h.current};`:n.nodeValue=""})),e(this,d).appendChild(n)}else e(this,d).appendChild(document.createTextNode(`${pe.camelToKebab(t)}: ${i};`))}},je=function(s,t){s.includes("--")?t?e(this,d).style.setProperty(s,t.toString()):e(this,d).style.removeProperty(s):t?e(this,d).style[s]=t.toString():e(this,d).style[s]=""},Rt=function(s){if(s){e(this,H)||c(this,H,[]);for(const t in s){const i=t,n=pe.uncapitalize(i.split("on").slice(1).join("on")),h=s[i];typeof h=="object"?e(this,H).push({name:n,callback:h.callback,options:h.options}):typeof h=="function"&&e(this,H).push({name:n,callback:h})}l(this,a,et).call(this)}},et=function(){var s;(s=e(this,H))==null||s.forEach(t=>{e(this,d).addEventListener(t.name,t.callback,t.options)})},tt=function(){var s;(s=e(this,H))==null||s.forEach(t=>{e(this,d).removeEventListener(t.name,t.callback,t.options)})},Mt=function(s){for(const t in s){const i=s[t];i instanceof m.Store?e(this,S).add(i.subscribe(({current:n})=>{l(this,a,st).call(this,t,n)})):l(this,a,st).call(this,t,i)}},st=function(s,t){var n,h;const i=e(this,d);if(s in i&&!((h=(n=i.constructor)==null?void 0:n.observedAttributes)!=null&&h.includes(s)))t!=null&&(i[s]=t.toString());else if(t!=null){const u=t.toString();s.includes("xlink")?i.setAttributeNS("http://www.w3.org/1999/xlink",s,u):i.setAttribute(s,u)}},qe=function(s,t){t&&(t=[t].flat(),t.forEach(i=>{if(i instanceof m.Store){const n=document.createElement("div");n.style.display="contents",s.appendChild(n),e(this,I)||c(this,I,[]);const h=e(this,I).length;n.setAttribute("store-root",""),e(this,I).push(n),e(this,S).add(i.subscribe(({current:u,previous:g})=>{const E=e(this,I)[h];E.dispatchEvent(new CustomEvent("beforeChildrenChange",{bubbles:!0,composed:!0}));const L=Array.from(E.childNodes),y=Array.isArray(u)?u:[u],ge=Array.isArray(g)?g:[g],De=[],C=[];L.length&&ge.forEach((F,P)=>{y.includes(F)?C.push(F):De.push(L[P])}),y.forEach((F,P)=>{if(C[P]!=null){if(F!==C[P]){const V=l(this,a,nt).call(this,F),Z=L[P];V instanceof Node&&!Z.isEqualNode(V)?E.replaceChild(V,Z):E.removeChild(Z)}}else{const V=l(this,a,nt).call(this,F);V instanceof Node&&n.appendChild(V)}}),De.forEach(F=>{E.removeChild(F)}),E.dispatchEvent(new CustomEvent("afterChildrenChange",{bubbles:!0,composed:!0}))}))}else if(i instanceof Ze)l(this,a,it).call(this,s,i.node);else if(i instanceof Function)l(this,a,qe).call(this,s,bt.isESClass(i)?new i:i());else{const n=l(this,a,ot).call(this,i);n instanceof Node&&l(this,a,it).call(this,s,n)}}))},it=function(s,t){!(s instanceof ShadowRoot)&&t instanceof HTMLElement&&t.tagName==="STYLE"?(e(this,B).add(()=>{[...document.head.querySelectorAll("style")].find(n=>n.outerHTML===t.outerHTML)||document.head.appendChild(t)}),e(this,S).add(()=>{t.remove()})):s.appendChild(t)},nt=function(s){return s instanceof Ze?s.node:typeof s=="function"?bt.isESClass(s)?new s:s():l(this,a,ot).call(this,s)},ot=function(s){if(s instanceof Node)return s;if(s!=null){const t=String(s);if(t.trim().startsWith("<")&&t.trim().endsWith(">")){const i=document.createElement("div");return i.innerHTML=t,i.firstElementChild}else return document.createTextNode(t)}else return},Ke=new WeakMap,Oe=new WeakMap;let N=Ze;function w(...r){return new N(...r)}function ss(r){return new N("a",r)}function Q(r){return new N("button",r)}function v(r){return new N("div",r)}function He(r){return new N("input",r)}function At(r){return new N("label",r)}function ue(r){return new N("slot",r)}function rt(r){return new N("span",r)}function Nt(r){return new N("style",{style:r})}function x(r){const s=new CSSStyleSheet;return s.replaceSync(Nt(r).node.innerHTML),s}function is(r,s){const t=s==null?void 0:s.prefix,i={style:{}};for(const n in r)i[n]={var:`var(--${t}${pe.camelToKebab(n)})`,value:r[n]},i.style[`--${t}${pe.camelToKebab(n)}`]=r[n];return i}const f=is({colorMain:"#1c1c1c",colorMainAux:"#282828",colorFont:"#ffffff",colorActive:"#00E5B0",borderRadius:"12px",borderRadiusSmall:"4px"},{prefix:"aptechka-"});if(p.isBrowser){const r=Nt({":root":f.style}).node;r.setAttribute("data-permanent",""),document.head.appendChild(r)}const Ft='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M20.536 3.464C19.07 2 16.714 2 12 2C7.286 2 4.929 2 3.464 3.464C2 4.93 2 7.286 2 12c0 4.714 0 7.071 1.464 8.535C4.93 22 7.286 22 12 22c4.714 0 7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536M16.75 12a.75.75 0 0 1-.75.75H9.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 1 1 1.06 1.06l-1.72 1.72H16a.75.75 0 0 1 .75.75" clip-rule="evenodd"/></svg>',$t='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M15.24 2h-3.894c-1.764 0-3.162 0-4.255.148c-1.126.152-2.037.472-2.755 1.193c-.719.721-1.038 1.636-1.189 2.766C3 7.205 3 8.608 3 10.379v5.838c0 1.508.92 2.8 2.227 3.342c-.067-.91-.067-2.185-.067-3.247v-5.01c0-1.281 0-2.386.118-3.27c.127-.948.413-1.856 1.147-2.593c.734-.737 1.639-1.024 2.583-1.152c.88-.118 1.98-.118 3.257-.118h3.07c1.276 0 2.374 0 3.255.118A3.601 3.601 0 0 0 15.24 2Z"/><path d="M6.6 11.397c0-2.726 0-4.089.844-4.936c.843-.847 2.2-.847 4.916-.847h2.88c2.715 0 4.073 0 4.917.847c.843.847.843 2.21.843 4.936v4.82c0 2.726 0 4.089-.843 4.936c-.844.847-2.202.847-4.917.847h-2.88c-2.715 0-4.073 0-4.916-.847c-.844-.847-.844-2.21-.844-4.936v-4.82Z"/></svg>',ns='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10-5.75a.75.75 0 0 1 .75.75v5.19l1.72-1.72a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 1 1 1.06-1.06l1.72 1.72V7a.75.75 0 0 1 .75-.75Zm-4 10a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5H8Z" clip-rule="evenodd"/></svg>',os='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10 5.75a.75.75 0 0 0 .75-.75v-5.19l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72V17c0 .414.336.75.75.75Zm-4-10a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 0 1.5H8Z" clip-rule="evenodd"/></svg>',Pt=`<svg
|
|
1
|
+
"use strict";var wt=r=>{throw TypeError(r)};var Ge=(r,s,t)=>s.has(r)||wt("Cannot "+t);var e=(r,s,t)=>(Ge(r,s,"read from private field"),t?t.call(r):s.get(r)),o=(r,s,t)=>s.has(r)?wt("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(r):s.set(r,t),c=(r,s,t,i)=>(Ge(r,s,"write to private field"),i?i.call(r,t):s.set(r,t),t),l=(r,s,t)=>(Ge(r,s,"access private method"),t);const p=require("../index-Cqw2NKev.cjs"),m=require("../Store-DRp_K37w.cjs"),Yt=require("../file-DSpfWdd9.cjs"),Gt=require("../function-MthRj-GJ.cjs"),St=require("../gestures-C7gbKx11.cjs");require("../ticker/index.cjs");const pe=require("../string-DhgS_iFl.cjs"),bt=require("../object-CCiXnER2.cjs"),Ut=require("../connector/index.cjs"),Xt=require("../device/index.cjs"),Qt=require("../math-GDWEqu7y.cjs"),jt=require("../number-0243DApo.cjs"),vt=require("../polyfills-Df4r-ETT.cjs"),yt=require("../element-resizer/index.cjs"),es=require("../style-At6aDoqG.cjs"),ts=new Set(["animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","listener","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","text","textPath","title","tspan","view","use"]);var d,B,S,we,I,H,a,kt,Et,xt,Ue,Xe,Ct,Tt,Lt,zt,Qe,je,Rt,et,tt,Mt,st,qe,it,nt,ot,Ke,Oe;const Ze=class Ze{constructor(...s){o(this,a);o(this,d,null);o(this,B,new Set);o(this,S,new Set);o(this,we);o(this,I);o(this,H);o(this,Ke,s=>{e(this,B).forEach(t=>{t(s)}),e(this,B).clear()});o(this,Oe,(s,t)=>{e(this,S).forEach(i=>{i(s,t)}),e(this,S).clear(),l(this,a,tt).call(this)});if(p.isBrowser){const t=s[0],i=s[1];c(this,d,l(this,a,kt).call(this,t,i==null?void 0:i.forceSvg)),l(this,a,xt).call(this,i)}}get node(){return e(this,d)}set node(s){var t;l(this,a,tt).call(this),c(this,d,s),(t=e(this,we))==null||t.call(this),e(this,d)instanceof Element&&c(this,I,[...e(this,d).querySelectorAll("store-root")]),l(this,a,et).call(this),l(this,a,Ue).call(this)}};d=new WeakMap,B=new WeakMap,S=new WeakMap,we=new WeakMap,I=new WeakMap,H=new WeakMap,a=new WeakSet,kt=function(s,t){let i=null;if(s instanceof Node)i=s;else if(typeof s=="string")if(!s.includes("<")&&s.includes("-"))i=new(customElements.get(s));else if(s.includes("<")){const n=document.createElement("div");n.innerHTML=s,i=n.firstElementChild}else ts.has(s)||t?i=document.createElementNS("http://www.w3.org/2000/svg",s):i=document.createElement(s);else i=document.createElement("div");return i},Et=function(s){return s instanceof HTMLElement||s instanceof SVGElement},xt=function(s){if(!s)return;const t=l(this,a,Et).call(this,e(this,d)),i=s.ref;delete s.ref,s!=null&&s.onConnect&&(e(this,B).add(s.onConnect),delete s.onConnect),s!=null&&s.onDisconnect&&(e(this,S).add(s.onDisconnect),delete s.onDisconnect);let n,h;for(const u in s){const g=s[u];u==="class"&&t?l(this,a,Xe).call(this,g):u==="style"&&t?l(this,a,Lt).call(this,g):u==="lightChildren"?l(this,a,qe).call(this,e(this,d),g):u==="children"?l(this,a,qe).call(this,e(this,d)instanceof Element?e(this,d).shadowRoot||e(this,d):e(this,d),g):u==="connectedClass"?e(this,B).add(()=>{requestAnimationFrame(()=>{e(this,d).classList.add(typeof g=="boolean"?"connected":g)})}):u.startsWith("on")?(h||(h={}),h[u]=g):(n||(n={}),n[u]=g)}l(this,a,Mt).call(this,n),l(this,a,Rt).call(this,h),i&&(typeof i=="function"?i(e(this,d)):i.current=e(this,d)),l(this,a,Ue).call(this)},Ue=function(){if(p.isBrowser&&(e(this,S).size||e(this,B).size)){const s=e(this,d)instanceof DocumentFragment?e(this,d).firstChild:e(this,d);c(this,we,Ut.connector.subscribe(s,{connectCallback:e(this,Ke),disconnectCallback:e(this,Oe),unsubscribeAfterDisconnect:!0,maxWaitSec:20}))}},Xe=function(s){if(s){if(typeof s=="string")e(this,d).classList.add(s);else if(Array.isArray(s))s.forEach(t=>{t&&l(this,a,Xe).call(this,t)});else if(typeof s=="object")if(s instanceof m.Store)l(this,a,Ct).call(this,s);else for(const t in s){const i=s[t];i instanceof m.Store?l(this,a,Tt).call(this,t,i):i?e(this,d).classList.add(t):e(this,d).classList.remove(t)}}else return},Ct=function(s){e(this,S).add(s.subscribe(({current:t,previous:i})=>{i&&[i].flat().forEach(n=>{n&&e(this,d).classList.remove(n)}),t&&[t].flat().forEach(n=>{n&&e(this,d).classList.add(n)})}))},Tt=function(s,t){e(this,S).add(t.subscribe(({current:i})=>{i?e(this,d).classList.add(s):e(this,d).classList.remove(s)}))},Lt=function(s){if(!s)return;e(this,d).tagName==="style"||e(this,d).tagName==="STYLE"?l(this,a,Qe).call(this,s):l(this,a,zt).call(this,s)},zt=function(s){for(const t in s){const i=t,n=s[i];n instanceof m.Store?e(this,S).add(n.subscribe(({current:h})=>{l(this,a,je).call(this,i,h)})):l(this,a,je).call(this,i,n)}},Qe=function(s){for(const t in s){const i=s[t];if(typeof i=="object"&&!(i instanceof m.Store))e(this,d).appendChild(document.createTextNode(`${t} {`)),l(this,a,Qe).call(this,i),e(this,d).appendChild(document.createTextNode("}"));else if(i instanceof m.Store){const n=document.createTextNode("");e(this,S).add(i.subscribe(h=>{h.current?n.nodeValue=`${pe.camelToKebab(t)}: ${h.current};`:n.nodeValue=""})),e(this,d).appendChild(n)}else e(this,d).appendChild(document.createTextNode(`${pe.camelToKebab(t)}: ${i};`))}},je=function(s,t){s.includes("--")?t?e(this,d).style.setProperty(s,t.toString()):e(this,d).style.removeProperty(s):t?e(this,d).style[s]=t.toString():e(this,d).style[s]=""},Rt=function(s){if(s){e(this,H)||c(this,H,[]);for(const t in s){const i=t,n=pe.uncapitalize(i.split("on").slice(1).join("on")),h=s[i];typeof h=="object"?e(this,H).push({name:n,callback:h.callback,options:h.options}):typeof h=="function"&&e(this,H).push({name:n,callback:h})}l(this,a,et).call(this)}},et=function(){var s;(s=e(this,H))==null||s.forEach(t=>{e(this,d).addEventListener(t.name,t.callback,t.options)})},tt=function(){var s;(s=e(this,H))==null||s.forEach(t=>{e(this,d).removeEventListener(t.name,t.callback,t.options)})},Mt=function(s){for(const t in s){const i=s[t];i instanceof m.Store?e(this,S).add(i.subscribe(({current:n})=>{l(this,a,st).call(this,t,n)})):l(this,a,st).call(this,t,i)}},st=function(s,t){var n,h;const i=e(this,d);if(s in i&&!((h=(n=i.constructor)==null?void 0:n.observedAttributes)!=null&&h.includes(s)))t!=null&&(i[s]=t.toString());else if(t!=null){const u=t.toString();s.includes("xlink")?i.setAttributeNS("http://www.w3.org/1999/xlink",s,u):i.setAttribute(s,u)}},qe=function(s,t){t&&(t=[t].flat(),t.forEach(i=>{if(i instanceof m.Store){const n=document.createElement("div");n.style.display="contents",s.appendChild(n),e(this,I)||c(this,I,[]);const h=e(this,I).length;n.setAttribute("store-root",""),e(this,I).push(n),e(this,S).add(i.subscribe(({current:u,previous:g})=>{const E=e(this,I)[h];E.dispatchEvent(new CustomEvent("beforeChildrenChange",{bubbles:!0,composed:!0}));const L=Array.from(E.childNodes),y=Array.isArray(u)?u:[u],ge=Array.isArray(g)?g:[g],De=[],C=[];L.length&&ge.forEach((F,P)=>{y.includes(F)?C.push(F):De.push(L[P])}),y.forEach((F,P)=>{if(C[P]!=null){if(F!==C[P]){const V=l(this,a,nt).call(this,F),Z=L[P];V instanceof Node&&!Z.isEqualNode(V)?E.replaceChild(V,Z):E.removeChild(Z)}}else{const V=l(this,a,nt).call(this,F);V instanceof Node&&n.appendChild(V)}}),De.forEach(F=>{E.removeChild(F)}),E.dispatchEvent(new CustomEvent("afterChildrenChange",{bubbles:!0,composed:!0}))}))}else if(i instanceof Ze)l(this,a,it).call(this,s,i.node);else if(i instanceof Function)l(this,a,qe).call(this,s,bt.isESClass(i)?new i:i());else{const n=l(this,a,ot).call(this,i);n instanceof Node&&l(this,a,it).call(this,s,n)}}))},it=function(s,t){!(s instanceof ShadowRoot)&&t instanceof HTMLElement&&t.tagName==="STYLE"?(e(this,B).add(()=>{[...document.head.querySelectorAll("style")].find(n=>n.outerHTML===t.outerHTML)||document.head.appendChild(t)}),e(this,S).add(()=>{t.remove()})):s.appendChild(t)},nt=function(s){return s instanceof Ze?s.node:typeof s=="function"?bt.isESClass(s)?new s:s():l(this,a,ot).call(this,s)},ot=function(s){if(s instanceof Node)return s;if(s!=null){const t=String(s);if(t.trim().startsWith("<")&&t.trim().endsWith(">")){const i=document.createElement("div");return i.innerHTML=t,i.firstElementChild}else return document.createTextNode(t)}else return},Ke=new WeakMap,Oe=new WeakMap;let N=Ze;function w(...r){return new N(...r)}function ss(r){return new N("a",r)}function Q(r){return new N("button",r)}function v(r){return new N("div",r)}function He(r){return new N("input",r)}function At(r){return new N("label",r)}function ue(r){return new N("slot",r)}function rt(r){return new N("span",r)}function Nt(r){return new N("style",{style:r})}function x(r){const s=new CSSStyleSheet;return s.replaceSync(Nt(r).node.innerHTML),s}function is(r,s){const t=s==null?void 0:s.prefix,i={style:{}};for(const n in r)i[n]={var:`var(--${t}${pe.camelToKebab(n)})`,value:r[n]},i.style[`--${t}${pe.camelToKebab(n)}`]=r[n];return i}const f=is({colorMain:"#1c1c1c",colorMainAux:"#282828",colorFont:"#ffffff",colorActive:"#00E5B0",borderRadius:"12px",borderRadiusSmall:"4px"},{prefix:"aptechka-"});if(p.isBrowser){const r=Nt({":root":f.style}).node;r.setAttribute("data-permanent",""),document.head.appendChild(r)}const Ft='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M20.536 3.464C19.07 2 16.714 2 12 2C7.286 2 4.929 2 3.464 3.464C2 4.93 2 7.286 2 12c0 4.714 0 7.071 1.464 8.535C4.93 22 7.286 22 12 22c4.714 0 7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536M16.75 12a.75.75 0 0 1-.75.75H9.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 1 1 1.06 1.06l-1.72 1.72H16a.75.75 0 0 1 .75.75" clip-rule="evenodd"/></svg>',$t='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M15.24 2h-3.894c-1.764 0-3.162 0-4.255.148c-1.126.152-2.037.472-2.755 1.193c-.719.721-1.038 1.636-1.189 2.766C3 7.205 3 8.608 3 10.379v5.838c0 1.508.92 2.8 2.227 3.342c-.067-.91-.067-2.185-.067-3.247v-5.01c0-1.281 0-2.386.118-3.27c.127-.948.413-1.856 1.147-2.593c.734-.737 1.639-1.024 2.583-1.152c.88-.118 1.98-.118 3.257-.118h3.07c1.276 0 2.374 0 3.255.118A3.601 3.601 0 0 0 15.24 2Z"/><path d="M6.6 11.397c0-2.726 0-4.089.844-4.936c.843-.847 2.2-.847 4.916-.847h2.88c2.715 0 4.073 0 4.917.847c.843.847.843 2.21.843 4.936v4.82c0 2.726 0 4.089-.843 4.936c-.844.847-2.202.847-4.917.847h-2.88c-2.715 0-4.073 0-4.916-.847c-.844-.847-.844-2.21-.844-4.936v-4.82Z"/></svg>',ns='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10-5.75a.75.75 0 0 1 .75.75v5.19l1.72-1.72a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 1 1 1.06-1.06l1.72 1.72V7a.75.75 0 0 1 .75-.75Zm-4 10a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5H8Z" clip-rule="evenodd"/></svg>',os='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10 5.75a.75.75 0 0 0 .75-.75v-5.19l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72V17c0 .414.336.75.75.75Zm-4-10a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 0 1.5H8Z" clip-rule="evenodd"/></svg>',Pt=`<svg
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg"
|
|
3
3
|
width="32"
|
|
4
4
|
height="32"
|
|
@@ -7,7 +7,7 @@ import { i as p } from "../index-euf5anj6.js";
|
|
|
7
7
|
import { S as $, s as K, a as j } from "../Store-D2xCXENW.js";
|
|
8
8
|
import { c as Ut } from "../file-GHShUlue.js";
|
|
9
9
|
import { d as Xt } from "../function-C10DGppn.js";
|
|
10
|
-
import { s as Et } from "../gestures-
|
|
10
|
+
import { s as Et } from "../gestures-CcXV6fCp.js";
|
|
11
11
|
import "../ticker/index.js";
|
|
12
12
|
import { c as Oe, u as Qt } from "../string-f0Dnk0L1.js";
|
|
13
13
|
import { i as yt } from "../object-D6MVWB4l.js";
|
package/lib/pointer/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var A=Object.defineProperty;var D=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var M=i=>{throw TypeError(i)};var _=(i,s,t)=>s in i?A(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,T=(i,s)=>{for(var t in s||(s={}))F.call(s,t)&&_(i,t,s[t]);if(D)for(var t of D(s))G.call(s,t)&&_(i,t,s[t]);return i};var k=(i,s,t)=>s.has(i)||M("Cannot "+t);var e=(i,s,t)=>(k(i,s,"read from private field"),t?t.call(i):s.get(i)),n=(i,s,t)=>s.has(i)?M("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),c=(i,s,t,m)=>(k(i,s,"write to private field"),m?m.call(i,t):s.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-DRp_K37w.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),I=require("../dom-JBOkFLTh.cjs"),B=require("../math-GDWEqu7y.cjs"),J=require("../index-Cqw2NKev.cjs");require("../ticker/index.cjs");const R=require("../Damped-
|
|
1
|
+
"use strict";var A=Object.defineProperty;var D=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var M=i=>{throw TypeError(i)};var _=(i,s,t)=>s in i?A(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,T=(i,s)=>{for(var t in s||(s={}))F.call(s,t)&&_(i,t,s[t]);if(D)for(var t of D(s))G.call(s,t)&&_(i,t,s[t]);return i};var k=(i,s,t)=>s.has(i)||M("Cannot "+t);var e=(i,s,t)=>(k(i,s,"read from private field"),t?t.call(i):s.get(i)),n=(i,s,t)=>s.has(i)?M("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),c=(i,s,t,m)=>(k(i,s,"write to private field"),m?m.call(i,t):s.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-DRp_K37w.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),I=require("../dom-JBOkFLTh.cjs"),B=require("../math-GDWEqu7y.cjs"),J=require("../index-Cqw2NKev.cjs");require("../ticker/index.cjs");const R=require("../Damped-B1lXa9nb.cjs"),H=require("../element-resizer/index.cjs"),j=require("../window-resizer/index.cjs"),P=require("../css-property/index.cjs");var o,a,u,p,y,l,b,x,f,w,C,d;class O{constructor(s){n(this,o);n(this,a);n(this,u);n(this,p);n(this,y);n(this,l);n(this,b,0);n(this,x,0);n(this,f,s=>{e(this,p).set(1)});n(this,w,s=>{e(this,p).set(0)});n(this,C,s=>{const t=q.getPointerPosition(s,e(this,o).getBoundingClientRect()),m={width:e(this,b),height:e(this,x)},h={x:t.x,y:t.y};if(e(this,y)){const z=q.screenToCartesian(h,m);h.x=z.x,h.y=z.y}if(e(this,l)){const z=q.normalize(h,m);h.x=B.clamp(z.x*2,-1,1),h.y=B.clamp(z.y*2,-1,1)}e(this,a).set(h.x),e(this,u).set(h.y)});n(this,d,()=>{c(this,b,this.element.clientWidth),c(this,x,this.element.clientHeight);let s=0,t=0,m=0,h=0;e(this,y)?e(this,l)?(s=-1,t=1,m=-1,h=1):(s=e(this,b)/2*-1,t=e(this,b)/2*1,m=e(this,x)/2*-1,h=e(this,x)/2*1):e(this,l)?(s=0,t=1,m=0,h=1):(s=0,t=e(this,b),m=0,h=e(this,x)),e(this,a).min=s,e(this,a).max=t,e(this,u).min=m,e(this,u).max=h});c(this,o,I.getElement(s.element)),c(this,a,new R.Damped(0,s.damped)),c(this,u,new R.Damped(0,s.damped)),c(this,p,new R.Damped(0,T({min:0,max:1},s.damped))),c(this,y,s.cartesian||!1),c(this,l,s.normalize||!1)}get element(){return e(this,o)}get x(){return e(this,a)}get y(){return e(this,u)}get z(){return e(this,p)}get cartesian(){return e(this,y)}set cartesian(s){c(this,y,s),e(this,d).call(this)}get normalize(){return e(this,l)}set normalize(s){c(this,l,s),e(this,d).call(this)}connect(){e(this,o).addEventListener("pointerenter",e(this,f)),e(this,o).addEventListener("pointerleave",e(this,w)),e(this,o).addEventListener("pointermove",e(this,C)),H.elementResizer.subscribe(e(this,o),e(this,d)),j.windowResizer.subscribe(e(this,d))}disconnect(){e(this,o).removeEventListener("pointerenter",e(this,f)),e(this,o).removeEventListener("pointerleave",e(this,w)),e(this,o).removeEventListener("pointermove",e(this,C)),H.elementResizer.unsubscribe(e(this,d)),j.windowResizer.unsubscribe(e(this,d)),e(this,a).reset(),e(this,u).reset(),e(this,p).reset()}}o=new WeakMap,a=new WeakMap,u=new WeakMap,p=new WeakMap,y=new WeakMap,l=new WeakMap,b=new WeakMap,x=new WeakMap,f=new WeakMap,w=new WeakMap,C=new WeakMap,d=new WeakMap;var r,g,v,S,E,L;class W extends HTMLElement{constructor(){super();n(this,r);n(this,g,new P.CSSProperty(this,"--damping",20));n(this,v,new P.CSSProperty(this,"--mass",0));n(this,S,new P.CSSProperty(this,"--stiffness",0));n(this,E,new P.CSSProperty(this,"--cartesian",!1));n(this,L,new P.CSSProperty(this,"--normalize",!1));c(this,r,new O({element:this})),e(this,g).subscribe(t=>{e(this,r).x.damping=t.current,e(this,r).y.damping=t.current,e(this,r).z.damping=t.current}),e(this,E).subscribe(t=>{e(this,r).cartesian=t.current}),e(this,L).subscribe(t=>{e(this,r).normalize=t.current}),e(this,v).subscribe(t=>{e(this,r).x.mass=t.current,e(this,r).y.mass=t.current,e(this,r).z.mass=t.current}),e(this,S).subscribe(t=>{e(this,r).x.stiffness=t.current,e(this,r).y.stiffness=t.current,e(this,r).z.stiffness=t.current}),e(this,r).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,r).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,r).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,r)}connectedCallback(){e(this,r).connect(),e(this,g).observe(),e(this,v).observe(),e(this,S).observe()}disconnectedCallback(){e(this,r).disconnect(),e(this,g).unobserve(),e(this,v).unobserve(),e(this,S).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}r=new WeakMap,g=new WeakMap,v=new WeakMap,S=new WeakMap,E=new WeakMap,L=new WeakMap;J.isBrowser&&!customElements.get("e-pointer")&&customElements.define("e-pointer",W);exports.Pointer=O;exports.PointerElement=W;
|
package/lib/pointer/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import { g as K } from "../dom-CVWzyXPH.js";
|
|
|
20
20
|
import { c as T } from "../math-BOBiC4TN.js";
|
|
21
21
|
import { i as N } from "../index-euf5anj6.js";
|
|
22
22
|
import "../ticker/index.js";
|
|
23
|
-
import { D as R } from "../Damped-
|
|
23
|
+
import { D as R } from "../Damped-BXsGpI-B.js";
|
|
24
24
|
import { elementResizer as W } from "../element-resizer/index.js";
|
|
25
25
|
import { windowResizer as j } from "../window-resizer/index.js";
|
|
26
26
|
import { CSSProperty as P } from "../css-property/index.js";
|
package/lib/scroll/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _e=Object.defineProperty;var Pe=Object.getOwnPropertySymbols;var He=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable;var xe=u=>{throw TypeError(u)};var Ee=(u,h,e)=>h in u?_e(u,h,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[h]=e,Le=(u,h)=>{for(var e in h||(h={}))He.call(h,e)&&Ee(u,e,h[e]);if(Pe)for(var e of Pe(h))We.call(h,e)&&Ee(u,e,h[e]);return u};var fe=(u,h,e)=>h.has(u)||xe("Cannot "+e);var t=(u,h,e)=>(fe(u,h,"read from private field"),e?e.call(u):h.get(u)),s=(u,h,e)=>h.has(u)?xe("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(u):h.set(u,e),n=(u,h,e,i)=>(fe(u,h,"write to private field"),i?i.call(u,e):h.set(u,e),e),c=(u,h,e)=>(fe(u,h,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Fe=require("../Store-DRp_K37w.cjs"),B=require("../index-Cqw2NKev.cjs"),$e=require("../easings-GegIwET5.cjs"),ue=require("../events-KVanG9sR.cjs"),ke=require("../jss-BXAMRO12.cjs"),Rt=require("../layout-Ctc2p3uz.cjs"),Re=require("../math-GDWEqu7y.cjs"),Ne=require("../number-0243DApo.cjs");require("../ticker/index.cjs");const ae=require("../order/index.cjs"),Ue=require("../Damped-DbaLw6w1.cjs"),Ge=require("../Tweened-Dm6Avip9.cjs"),ce=require("../controls/index.cjs"),It=require("../window-resizer/index.cjs"),mt=require("../scroll-entries/index.cjs"),ze=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),Ze=require("../device/index.cjs"),Qt=require("../element-resizer/index.cjs"),je=require("../gestures-DHLrn6Q8.cjs"),Ie=require("../dom-JBOkFLTh.cjs"),Ke=require("../function-MthRj-GJ.cjs"),Je=require("../scroll-segment/index.cjs");var f,Xt,g,gt,V,X;class Qe{constructor(h,e,i){s(this,f);s(this,Xt);s(this,g);s(this,gt,0);s(this,V,0);s(this,X,null);n(this,f,h),n(this,Xt,e),n(this,g,i),mt.scrollEntries.register(t(this,f))}get index(){return t(this,Xt)}get size(){return t(this,gt)}get position(){return t(this,V)}destroy(){mt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null),this.setSize()}setSize(h){h?(t(this,f).style.setProperty("--size",h+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,f).style.width=h+"px",t(this,f).style.height=""):(t(this,f).style.height=h+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){n(this,gt,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),n(this,V,t(this,g).vertical?Rt.getCumulativeOffsetTop(t(this,f)):Rt.getCumulativeOffsetLeft(t(this,f))),n(this,V,t(this,V)-t(this,g).contentPosition)}transform(){let h=0;const e=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,g).overscroll&&t(this,V)+t(this,gt)<t(this,g).currentScrollValue&&(h=t(this,g).distance*-1-t(this,g).gap),mt.scrollEntries.update(t(this,f),t(this,g).axisCSSProperty.current,h);const i=t(this,g).currentScrollValue+h,r=t(this,V)-t(this,g).viewportSize-e,d=t(this,V)+t(this,gt)+e,b=Re.clamp(i,r,d);t(this,g).vertical?t(this,f).style.transform=`translate3d(0px, ${b*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${b*-1}px, 0px, 0px)`}mark(h){t(this,X)!==h&&(t(this,X)&&t(this,f).classList.remove(t(this,X)),h&&t(this,f).classList.add(h),n(this,X,h),ue.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,X)},custom:!0}))}}f=new WeakMap,Xt=new WeakMap,g=new WeakMap,gt=new WeakMap,V=new WeakMap,X=new WeakMap;const Xe=ke.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:"100%",height:"100%",overflow:"var(--overflow, initial)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,yt,x,Y,_,H,W,T,tt,et,F,st,vt,q,v,Ct,wt,Pt,Et,Tt,I,xt,it,D,rt,$,nt,Lt,ht,ot,lt,p,qt,l,Yt,te,y,m,k,A,ct,M,w,P,Dt,ut,N,U,G,At,at,Z,Mt,O,E,ee,o,me,Jt,kt,de,Se,ge,ye,L,Ot,Te,Bt,se,ve,Ce,ft,pe,ie;class jt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,yt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,Y,new S.CSSProperty(this,"--reverse",!1));s(this,_,new S.CSSProperty(this,"--direction",0));s(this,H,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,W,new S.CSSProperty(this,"--split",!1));s(this,T,new S.CSSProperty(this,"--sectional",!1));s(this,tt,new S.CSSProperty(this,"--tween-easing",!1));s(this,et,new S.CSSProperty(this,"--tween-duration",!1));s(this,F,new S.CSSProperty(this,"--auto-size",!1));s(this,st,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,vt,new S.CSSProperty(this,"--drag-inertion",1));s(this,q,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,Ct,new S.CSSProperty(this,"--damping",20));s(this,wt,new S.CSSProperty(this,"--mass",0));s(this,Pt,new S.CSSProperty(this,"--stiffness",0));s(this,Et,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Tt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,I,new S.CSSProperty(this,"--autoplay",0));s(this,xt,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,it,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,D,new S.CSSProperty(this,"--classes",!1));s(this,rt,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,$,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,nt,new S.CSSProperty(this,"--focus-delay",0));s(this,Lt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,ht,new S.CSSProperty(this,"--disabled",!1));s(this,ot,new S.CSSProperty(this,"--hibernate",!1));s(this,lt,null);s(this,p,null);s(this,qt,null);s(this,l,[]);s(this,Yt,0);s(this,te,0);s(this,y,0);s(this,m,0);s(this,k,0);s(this,A,null);s(this,ct,null);s(this,M,null);s(this,w,null);s(this,P,new Fe.Store(0));s(this,Dt,0);s(this,ut,0);s(this,N,!1);s(this,U,!0);s(this,G,!0);s(this,At);s(this,at);s(this,Z,new Ge.Tweened);s(this,Mt,!1);s(this,O,null);s(this,E,!1);s(this,ee,null);s(this,L,()=>{if(t(this,ot).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,P).current;if(n(this,Yt,this.vertical?Rt.getCumulativeOffsetTop(this):Rt.getCumulativeOffsetLeft(this)),n(this,te,this.vertical?Rt.getCumulativeOffsetTop(t(this,p)):Rt.getCumulativeOffsetLeft(t(this,p))),n(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?n(this,k,ze.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):n(this,k,ze.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,F).current&&t(this,l).length){const r=t(this,q).current,d=(t(this,y)-t(this,k)*(r-1))/r;t(this,l).forEach(b=>{b.setSize(d)})}else t(this,l).forEach(r=>{r.setSize()});if(t(this,l).forEach(r=>{r.resize()}),t(this,H).current){n(this,m,t(this,y)*t(this,H).current);const r=t(this,m)+t(this,y);this.vertical?(t(this,p).style.width=r+"px",t(this,p).style.height="100%"):(t(this,p).style.height=r+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",n(this,m,t(this,p).offsetHeight-t(this,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",n(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const r=getComputedStyle(this),d=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);n(this,m,t(this,m)+d),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const r=t(this,l)[t(this,l).length-1],d=r.position+r.size-t(this,y),b=t(this,m)-d;n(this,ut,r.position+r.size+b)}else n(this,ut,t(this,m));if(t(this,T).current&&t(this,l).length){const r=t(this,l)[i];t(this,a).set(r.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});n(this,N,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,y)),this.classList.toggle("has-overflow",t(this,N)),t(this,N)?t(this,ht).current||c(this,o,Se).call(this):c(this,o,de).call(this),t(this,Ot).call(this)});s(this,Ot,()=>{if(!t(this,N)||t(this,G)||t(this,U))return;const e=this.currentScrollValue;if(n(this,Dt,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,P).current=c(this,o,pe).call(this)}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;mt.scrollEntries.update(this,t(this,x).current,e)});s(this,Bt,(e,i)=>{t(this,yt).current&&(c(this,o,ve).call(this,Math.sign(i)||1),t(this,se).call(this,e,i))});s(this,se,(e,i)=>{if(t(this,_).current){if(t(this,_).current<0&&i>0)return;if(t(this,_).current>0&&i<0)return}if(t(this,at)||t(this,Z).unlistenAnimationFrame(),!t(this,I).current&&t(this,nt).current&&(clearInterval(t(this,At)),n(this,At,setTimeout(()=>{const r=t(this,l)[c(this,o,pe).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,Lt).current,easing:$e.easeInOutExpo}})},t(this,nt).current))),!(e.includes("drag")&&!Ze.device.isTouch&&!t(this,Et).current)){if(t(this,T).current&&e!=="drag"){const r=Math.sign(i);if(t(this,l).length){const d={tween:t(this,tt).current||t(this,et).current?{easing:t(this,tt).current||"easeInOutCubic",duration:t(this,et).current||500}:void 0};t(this,Mt)?this.scrollToSection(t(this,P).current,d):this.shiftSections(r,d)}else t(this,a).shift(r*t(this,y))}else t(this,a).shift(i);n(this,Mt,e==="drag")}});s(this,ie,()=>{n(this,E,!0),this.hibernatedCSSProperty.current||c(this,o,ye).call(this)});if(B.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Xe];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),n(this,lt,document.createElement("div")),t(this,lt).className="content-wrapper",n(this,p,document.createElement("div")),t(this,p).className="content",n(this,qt,document.createElement("slot")),t(this,p).appendChild(t(this,qt)),t(this,lt).appendChild(t(this,p)),e.appendChild(t(this,lt)),n(this,ee,new MutationObserver(r=>{this.tryResplit()}))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,yt)}get axisCSSProperty(){return t(this,x)}get reverseCSSProperty(){return t(this,Y)}get directionCSSProperty(){return t(this,_)}get pagesCSSProperty(){return t(this,H)}get splitCSSProperty(){return t(this,W)}get sectionalCSSProperty(){return t(this,T)}get easingCSSProperty(){return t(this,tt)}get durationCSSProperty(){return t(this,et)}get autoSizeCSSProperty(){return t(this,F)}get wheelMaxDeltaCSSProperty(){return t(this,st)}get dragInertionCSSProperty(){return t(this,vt)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,Ct)}get massCSSProperty(){return t(this,wt)}get stiffnessCSSProperty(){return t(this,Pt)}get mouseDragCSSProperty(){return t(this,Et)}get sectionDistanceScaleCSSProperty(){return t(this,Tt)}get autoplayCSSProperty(){return t(this,I)}get autoplayPauseDurationCSSProperty(){return t(this,xt)}get autoplayUserDirectionCSSProperty(){return t(this,it)}get classesCSSProperty(){return t(this,D)}get currentIndexStartOffsetCSSProperty(){return t(this,rt)}get currentIndexEndOffsetCSSProperty(){return t(this,$)}get focusDelayCSSProperty(){return t(this,nt)}get focusDurationCSSProperty(){return t(this,Lt)}get disabledCSSProperty(){return t(this,ht)}get hibernatedCSSProperty(){return t(this,ot)}get currentScrollValue(){return c(this,o,Ce).call(this,"current")}get targetScrollValue(){return c(this,o,Ce).call(this,"target")}get contentWrapperElement(){return t(this,lt)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,Yt)}get contentPosition(){return t(this,te)}get viewportSize(){return t(this,y)}get scrollSize(){return t(this,m)}get gap(){return t(this,k)}get counter(){return t(this,P)}get limit(){return Math.ceil(t(this,l).length-t(this,q).current)}get distance(){return t(this,ut)}get loopDistance(){return t(this,v).current?t(this,ut)+t(this,k):t(this,ut)}get hasOverflow(){return t(this,N)}get overscroll(){return t(this,Dt)}get scrollLine(){return t(this,O)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}tryResplit(){!t(this,G)&&(t(this,v).current||t(this,W).current||t(this,v).current||t(this,F).current||t(this,T).current)&&c(this,o,Jt).call(this)}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,r=0){const d=e-r,b=d+i+r*2;return this.currentProgress<d?0:this.currentProgress>b?1:(this.currentProgress-d)/(b-d)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const d=e-r,b=d+i+r*2;return this.currentProgress>=d&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const r=t(this,P).current,d=c(this,o,Te).call(this,e),b=t(this,l)[r],C=t(this,l)[d];if(b&&C){let R=0;const be=c(this,o,pe).call(this),Kt=t(this,l)[be],Ve=Kt?this.targetScrollValue-Kt.position:0;t(this,v).current?d===0&&r===t(this,l).length-1?R=t(this,m)+t(this,y)-b.position+t(this,k):d===t(this,l).length-1&&r===0?R=C.position-(t(this,m)+t(this,y)+t(this,k)):R=C.position-b.position:R=C.position-b.position,this.shiftPosition(R-Ve,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,P).current+e,i)}setPosition(e,i){c(this,o,ve).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,at)||(t(this,Z).set(t(this,a).current,{equalize:!0}),t(this,Z).set(e,Le({},i.tween)),n(this,at,setTimeout(()=>{n(this,at,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){mt.scrollEntries.register(this),n(this,a,new Ue.Damped(0,{damping:.01,min:0,order:ae.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),n(this,A,new ce.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Bt)),n(this,ct,new ce.KeyboardControls({element:this})),t(this,ct).changeEvent.subscribe(t(this,Bt)),n(this,M,new ce.DragControls({element:t(this,p)})),t(this,M).changeEvent.subscribe(t(this,Bt)),n(this,w,new ce.AutoplayControls({culling:this})),t(this,w).changeEvent.subscribe(t(this,se)),t(this,x).subscribe(()=>{c(this,o,me).call(this)}),t(this,Y).subscribe(()=>{c(this,o,me).call(this)}),t(this,st).subscribe(e=>{t(this,A).axis=e.current?"max":t(this,x).current}),t(this,vt).subscribe(e=>{t(this,M).inertion=typeof e.current=="number"?e.current:1}),t(this,H).subscribe(()=>{t(this,E)&&t(this,L).call(this)}),t(this,W).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,Jt).call(this):c(this,o,kt).call(this))}),t(this,T).subscribe(e=>{t(this,A).debounce=e.current,t(this,M).swipe=e.current,t(this,w).interval=e.current,t(this,E)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,Jt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,kt).call(this))}),t(this,F).subscribe(e=>{t(this,E)&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,Jt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,kt).call(this))}),t(this,q).subscribe(e=>{t(this,E)&&(t(this,L).call(this),c(this,o,ft).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,E)&&(t(this,l).length||(t(this,W).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(n(this,Dt,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,Ct).subscribe(e=>{t(this,a).damping=e.current}),t(this,wt).subscribe(e=>{t(this,a).mass=e.current}),t(this,Pt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,I).subscribe(e=>{t(this,w).speed=e.current,!t(this,U)&&e.current&&!e.previous?t(this,w).connect():!e.current&&e.previous&&t(this,w).disconnect()}),t(this,it).subscribe(e=>{e.current||(t(this,w).direction=1)}),t(this,D).subscribe(e=>{t(this,E)&&c(this,o,ft).call(this)}),t(this,rt).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,ft).call(this)}),t(this,$).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,ft).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,P).subscribe(e=>{t(this,l).length&&c(this,o,ft).call(this)}),t(this,Z).subscribe(e=>{t(this,Z).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,ht).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,de).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,Se).call(this))}),t(this,ot).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,ge).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,ye).call(this))}),t(this,yt).observe(),t(this,x).observe(),t(this,Y).observe(),t(this,_).observe(),t(this,H).observe(),t(this,W).observe(),t(this,T).observe(),t(this,tt).observe(),t(this,et).observe(),t(this,F).observe(),t(this,st).observe(),t(this,vt).observe(),t(this,q).observe(),t(this,v).observe(),t(this,Ct).observe(),t(this,wt).observe(),t(this,Pt).observe(),t(this,Et).observe(),t(this,Tt).observe(),t(this,I).observe(),t(this,I).observe(),t(this,xt).observe(),t(this,it).observe(),t(this,D).observe(),t(this,rt).observe(),t(this,$).observe(),t(this,nt).observe(),t(this,Lt).observe(),t(this,ht).observe(),t(this,ot).observe(),It.windowResizer.subscribe(t(this,ie),ae.RESIZE_ORDER.LAST)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,yt).unobserve(),t(this,x).unobserve(),t(this,Y).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,W).unobserve(),t(this,T).unobserve(),t(this,tt).unobserve(),t(this,et).unobserve(),t(this,F).unobserve(),t(this,st).unobserve(),t(this,vt).unobserve(),t(this,q).unobserve(),t(this,v).unobserve(),t(this,Ct).unobserve(),t(this,wt).unobserve(),t(this,Pt).unobserve(),t(this,Et).unobserve(),t(this,Tt).unobserve(),t(this,I).unobserve(),t(this,xt).unobserve(),t(this,it).unobserve(),t(this,D).unobserve(),t(this,rt).unobserve(),t(this,$).unobserve(),t(this,nt).unobserve(),t(this,Lt).unobserve(),t(this,ht).unobserve(),t(this,ot).unobserve(),It.windowResizer.unsubscribe(t(this,ie)),c(this,o,ge).call(this),t(this,ee).disconnect()}}a=new WeakMap,yt=new WeakMap,x=new WeakMap,Y=new WeakMap,_=new WeakMap,H=new WeakMap,W=new WeakMap,T=new WeakMap,tt=new WeakMap,et=new WeakMap,F=new WeakMap,st=new WeakMap,vt=new WeakMap,q=new WeakMap,v=new WeakMap,Ct=new WeakMap,wt=new WeakMap,Pt=new WeakMap,Et=new WeakMap,Tt=new WeakMap,I=new WeakMap,xt=new WeakMap,it=new WeakMap,D=new WeakMap,rt=new WeakMap,$=new WeakMap,nt=new WeakMap,Lt=new WeakMap,ht=new WeakMap,ot=new WeakMap,lt=new WeakMap,p=new WeakMap,qt=new WeakMap,l=new WeakMap,Yt=new WeakMap,te=new WeakMap,y=new WeakMap,m=new WeakMap,k=new WeakMap,A=new WeakMap,ct=new WeakMap,M=new WeakMap,w=new WeakMap,P=new WeakMap,Dt=new WeakMap,ut=new WeakMap,N=new WeakMap,U=new WeakMap,G=new WeakMap,At=new WeakMap,at=new WeakMap,Z=new WeakMap,Mt=new WeakMap,O=new WeakMap,E=new WeakMap,ee=new WeakMap,o=new WeakSet,me=function(){const e=t(this,x).current,i=t(this,Y).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,A).axis=t(this,st).current?"max":e,t(this,ct).dimension=e==="x"?"width":"height",t(this,M).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,L).call(this)},Jt=function(){c(this,o,kt).call(this),t(this,qt).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Qe(e,i,this))}),t(this,p).style.transform="",ue.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),c(this,o,ft).call(this)},kt=function(){t(this,l).forEach(e=>{e.destroy()}),n(this,l,[]),t(this,P).reset(),t(this,a).reset(),ue.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},de=function(){t(this,U)||(n(this,U,!0),t(this,a).unsubscribe(t(this,Ot)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,At)),clearInterval(t(this,at)),t(this,Z).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,ct).disconnect(),t(this,M).disconnect(),t(this,w).disconnect(),t(this,N)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,L).call(this)))},Se=function(){t(this,U)&&(n(this,U,!1),t(this,a).subscribe(t(this,Ot)),t(this,A).connect(),t(this,ct).connect(),t(this,M).connect(),t(this,I).current&&t(this,w).connect())},ge=function(){t(this,G)||(n(this,G,!0),It.windowResizer.unsubscribe(t(this,L)),Qt.elementResizer.unsubscribe(t(this,L)),c(this,o,de).call(this),t(this,p).style.transform="",t(this,p).style.height="",t(this,p).style.width="",this.classList.remove("has-overflow","start","end"),t(this,l).length?c(this,o,kt).call(this):(t(this,P).reset(),t(this,a).reset()),mt.scrollEntries.unregister(this))},ye=function(){t(this,G)&&(n(this,G,!1),mt.scrollEntries.register(this),this.tryResplit(),c(this,o,Se).call(this),It.windowResizer.subscribe(t(this,L),ae.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,Ot=new WeakMap,Te=function(e){let i=t(this,P).current;return t(this,v).current?i=Ne.loopNumber(e,t(this,l).length):i=Re.clamp(e,0,this.limit),i},Bt=new WeakMap,se=new WeakMap,ve=function(e=1){t(this,it).current&&(t(this,w).direction=e),t(this,I).current&&t(this,w).pauseAndContinue(t(this,xt).current,this.sectionalCSSProperty.current)},Ce=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,m)+t(this,y)+t(this,k));return i<0?t(this,m)+i+t(this,y)+t(this,k):i}else return t(this,a)[e]},ft=function(){if(t(this,l).length){const e=t(this,P).current+t(this,rt).current;if(e===0?n(this,O,"start"):e===this.limit?n(this,O,"end"):n(this,O,null),ue.dispatchEvent(this,"scrollLine",{detail:{line:t(this,O)}}),t(this,D).current){this.classList.remove("end","start"),t(this,O)&&this.classList.add(t(this,O));const i=t(this,q).current+t(this,$).current;t(this,l).forEach((r,d)=>{const b=e-this.limit-1+t(this,$).current,C=e+i,R=this.sections.length-C;d>=e&&d<C||d<=b?r.mark("current"):d>=C&&d<C+R/2||d<=b+i?r.mark("next"):r.mark("previous")})}}},pe=function(){let e=this.targetScrollValue,i=1/0,r=0;const d=t(this,a).direction;for(let b=0;b<t(this,l).length;b++){const C=t(this,l)[b];let R=t(this,Mt)?C.size*d*-1*.4:0,be=C.position;const Kt=Math.abs(be+R-e);Kt<i&&(i=Kt,r=b)}return r},ie=new WeakMap;B.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",jt);var re;class we extends HTMLElement{constructor(){super(...arguments);s(this,re,null)}get scrollElement(){return t(this,re)}connectedCallback(){const e=Ie.findParentElement(this,jt);e instanceof jt?n(this,re,e):console.error(this,"e-scroll not found")}}re=new WeakMap;var dt,z,j,K,Vt,_t,St,Ht,ne,he;class qe extends we{constructor(){super();s(this,dt,null);s(this,z,null);s(this,j,!1);s(this,K,0);s(this,Vt,0);s(this,_t,0);s(this,St,()=>{n(this,j,this.offsetWidth>this.offsetHeight);const e=t(this,j)?this.offsetWidth:this.offsetHeight;n(this,K,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),n(this,K,Math.max(t(this,K),30)),t(this,j)?(t(this,z).style.width=t(this,K)+"px",t(this,z).style.height="100%"):(t(this,z).style.width="100%",t(this,z).style.height=t(this,K)+"px"),n(this,Vt,e-t(this,K)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Ht).call(this)});s(this,Ht,()=>{n(this,_t,this.scrollElement.currentProgress*t(this,Vt)),t(this,j)?t(this,z).style.transform=`translate3d(${t(this,_t)}px, 0px, 0px)`:t(this,z).style.transform=`translate3d(0px, ${t(this,_t)}px, 0px)`});s(this,ne,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,he,e=>{document.documentElement.classList.add("grabbing"),je.setupDrag(d=>{const b=t(this,j)?d.x:d.y,C=this.scrollElement.distance/t(this,Vt),R=(b-r)*C;this.scrollElement.setPosition(i+R)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,j)?e.x:e.y});if(B.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[ke.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"}})],n(this,dt,document.createElement("slot")),t(this,dt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,dt))}}get thumbElement(){return t(this,z)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,dt).assignedElements()[0]||t(this,dt).firstElementChild;n(this,z,e),t(this,z).addEventListener("pointerdown",t(this,he)),It.windowResizer.subscribe(t(this,St),ae.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,St)),Qt.elementResizer.subscribe(this.scrollElement,t(this,St)),this.scrollElement.onScroll(t(this,Ht)),this.scrollElement.axisCSSProperty.subscribe(t(this,ne))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,z).removeEventListener("pointerdown",t(this,he)),It.windowResizer.unsubscribe(t(this,St)),Qt.elementResizer.unsubscribe(t(this,St)),this.scrollElement.offScroll(t(this,Ht)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,ne))}}dt=new WeakMap,z=new WeakMap,j=new WeakMap,K=new WeakMap,Vt=new WeakMap,_t=new WeakMap,St=new WeakMap,Ht=new WeakMap,ne=new WeakMap,he=new WeakMap;B.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",qe);var Wt,Ft,$t;class De extends we{constructor(){super();s(this,Wt,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Ft,new S.CSSProperty(this,"--tween-easing",!1));s(this,$t,new S.CSSProperty(this,"--tween-duration",0));B.isBrowser&&this.addEventListener("click",()=>{const e=t(this,Wt).current,i=t(this,Ft).current,r=t(this,$t).current;this.handleClick({behaviour:e,tween:i||r?{easing:i,duration:r}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,Wt).observe(),t(this,Ft).observe(),t(this,$t).observe()}disconnectedCallback(){t(this,Wt).close(),t(this,Ft).close(),t(this,$t).close()}}Wt=new WeakMap,Ft=new WeakMap,$t=new WeakMap;var Nt;class Ae extends De{constructor(){super(...arguments);s(this,Nt,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Nt).current,e)}connectedCallback(){super.connectedCallback(),t(this,Nt).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Nt).close()}}Nt=new WeakMap;B.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",Ae);var J,Ut;class Me extends De{constructor(){super(...arguments);s(this,J,new S.CSSProperty(this,"--step",1));s(this,Ut,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,J).current>0&&this.scrollElement.scrollLine==="end"||t(this,J).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,J).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,J).subscribe(()=>{t(this,Ut).call(this)}),t(this,J).observe(),this.scrollElement.addEventListener("scrollLine",t(this,Ut)),t(this,Ut).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,J).close(),this.removeAttribute("disabled")}}J=new WeakMap,Ut=new WeakMap;B.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",Me);var Q,pt,Gt,oe,le,Zt;class Ye{constructor(h,e,i){s(this,Q,null);s(this,pt,null);s(this,Gt,null);s(this,oe,null);s(this,le,()=>{t(this,pt).scrollToSection(t(this,Gt),{behaviour:t(this,oe)})});s(this,Zt,()=>{t(this,Q).classList.toggle("current",t(this,pt).counter.current===t(this,Gt))});B.isBrowser&&(n(this,Q,document.createElement("button")),n(this,pt,h),n(this,oe,i),n(this,Gt,e),t(this,Q).addEventListener("click",t(this,le)),t(this,pt).counter.subscribe(t(this,Zt)),t(this,Zt).call(this))}get element(){return t(this,Q)}destroy(){t(this,Q).removeEventListener("click",t(this,le)),t(this,pt).counter.unsubscribe(t(this,Zt)),t(this,Q).remove()}}Q=new WeakMap,pt=new WeakMap,Gt=new WeakMap,oe=new WeakMap,le=new WeakMap,Zt=new WeakMap;var bt,zt;class Oe extends we{constructor(){super(...arguments);s(this,bt,[]);s(this,zt,Ke.debounce(()=>{t(this,bt).forEach(i=>i.destroy()),n(this,bt,[]);const e=this.scrollElement.sections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new Ye(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");this.appendChild(r.element),t(this,bt).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,zt)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,zt))}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,zt)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,zt)),t(this,bt).forEach(e=>e.destroy()),n(this,bt,[])}}bt=new WeakMap,zt=new WeakMap;B.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Oe);class Be extends Je.ScrollSegmentElement{connectedCallback(){const h=Ie.findParentElement(this,jt);h instanceof jt?(this.scrollContainer=h,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}B.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",Be);exports.ScrollBulletButtonsElement=Oe;exports.ScrollElement=jt;exports.ScrollSegmentElement=Be;exports.ScrollSetButtonElement=Ae;exports.ScrollStepButtonElement=Me;exports.ScrollbarElement=qe;
|
|
1
|
+
"use strict";var _e=Object.defineProperty;var Pe=Object.getOwnPropertySymbols;var He=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable;var xe=u=>{throw TypeError(u)};var Ee=(u,h,e)=>h in u?_e(u,h,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[h]=e,Le=(u,h)=>{for(var e in h||(h={}))He.call(h,e)&&Ee(u,e,h[e]);if(Pe)for(var e of Pe(h))We.call(h,e)&&Ee(u,e,h[e]);return u};var fe=(u,h,e)=>h.has(u)||xe("Cannot "+e);var t=(u,h,e)=>(fe(u,h,"read from private field"),e?e.call(u):h.get(u)),s=(u,h,e)=>h.has(u)?xe("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(u):h.set(u,e),n=(u,h,e,i)=>(fe(u,h,"write to private field"),i?i.call(u,e):h.set(u,e),e),c=(u,h,e)=>(fe(u,h,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Fe=require("../Store-DRp_K37w.cjs"),B=require("../index-Cqw2NKev.cjs"),$e=require("../easings-GegIwET5.cjs"),ue=require("../events-KVanG9sR.cjs"),ke=require("../jss-BXAMRO12.cjs"),Rt=require("../layout-Ctc2p3uz.cjs"),Re=require("../math-GDWEqu7y.cjs"),Ne=require("../number-0243DApo.cjs");require("../ticker/index.cjs");const ae=require("../order/index.cjs"),Ue=require("../Damped-B1lXa9nb.cjs"),Ge=require("../Tweened-cJ36zq1A.cjs"),ce=require("../controls/index.cjs"),It=require("../window-resizer/index.cjs"),mt=require("../scroll-entries/index.cjs"),ze=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),Ze=require("../device/index.cjs"),Qt=require("../element-resizer/index.cjs"),je=require("../gestures-C7gbKx11.cjs"),Ie=require("../dom-JBOkFLTh.cjs"),Ke=require("../function-MthRj-GJ.cjs"),Je=require("../scroll-segment/index.cjs");var f,Xt,g,gt,V,X;class Qe{constructor(h,e,i){s(this,f);s(this,Xt);s(this,g);s(this,gt,0);s(this,V,0);s(this,X,null);n(this,f,h),n(this,Xt,e),n(this,g,i),mt.scrollEntries.register(t(this,f))}get index(){return t(this,Xt)}get size(){return t(this,gt)}get position(){return t(this,V)}destroy(){mt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null),this.setSize()}setSize(h){h?(t(this,f).style.setProperty("--size",h+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,f).style.width=h+"px",t(this,f).style.height=""):(t(this,f).style.height=h+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){n(this,gt,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),n(this,V,t(this,g).vertical?Rt.getCumulativeOffsetTop(t(this,f)):Rt.getCumulativeOffsetLeft(t(this,f))),n(this,V,t(this,V)-t(this,g).contentPosition)}transform(){let h=0;const e=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,g).overscroll&&t(this,V)+t(this,gt)<t(this,g).currentScrollValue&&(h=t(this,g).distance*-1-t(this,g).gap),mt.scrollEntries.update(t(this,f),t(this,g).axisCSSProperty.current,h);const i=t(this,g).currentScrollValue+h,r=t(this,V)-t(this,g).viewportSize-e,d=t(this,V)+t(this,gt)+e,b=Re.clamp(i,r,d);t(this,g).vertical?t(this,f).style.transform=`translate3d(0px, ${b*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${b*-1}px, 0px, 0px)`}mark(h){t(this,X)!==h&&(t(this,X)&&t(this,f).classList.remove(t(this,X)),h&&t(this,f).classList.add(h),n(this,X,h),ue.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,X)},custom:!0}))}}f=new WeakMap,Xt=new WeakMap,g=new WeakMap,gt=new WeakMap,V=new WeakMap,X=new WeakMap;const Xe=ke.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:"100%",height:"100%",overflow:"var(--overflow, initial)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,yt,x,Y,_,H,W,T,tt,et,F,st,vt,q,v,Ct,wt,Pt,Et,Tt,I,xt,it,D,rt,$,nt,Lt,ht,ot,lt,p,qt,l,Yt,te,y,m,k,A,ct,M,w,P,Dt,ut,N,U,G,At,at,Z,Mt,O,E,ee,o,me,Jt,kt,de,Se,ge,ye,L,Ot,Te,Bt,se,ve,Ce,ft,pe,ie;class jt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,yt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,Y,new S.CSSProperty(this,"--reverse",!1));s(this,_,new S.CSSProperty(this,"--direction",0));s(this,H,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,W,new S.CSSProperty(this,"--split",!1));s(this,T,new S.CSSProperty(this,"--sectional",!1));s(this,tt,new S.CSSProperty(this,"--tween-easing",!1));s(this,et,new S.CSSProperty(this,"--tween-duration",!1));s(this,F,new S.CSSProperty(this,"--auto-size",!1));s(this,st,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,vt,new S.CSSProperty(this,"--drag-inertion",1));s(this,q,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,Ct,new S.CSSProperty(this,"--damping",20));s(this,wt,new S.CSSProperty(this,"--mass",0));s(this,Pt,new S.CSSProperty(this,"--stiffness",0));s(this,Et,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Tt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,I,new S.CSSProperty(this,"--autoplay",0));s(this,xt,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,it,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,D,new S.CSSProperty(this,"--classes",!1));s(this,rt,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,$,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,nt,new S.CSSProperty(this,"--focus-delay",0));s(this,Lt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,ht,new S.CSSProperty(this,"--disabled",!1));s(this,ot,new S.CSSProperty(this,"--hibernate",!1));s(this,lt,null);s(this,p,null);s(this,qt,null);s(this,l,[]);s(this,Yt,0);s(this,te,0);s(this,y,0);s(this,m,0);s(this,k,0);s(this,A,null);s(this,ct,null);s(this,M,null);s(this,w,null);s(this,P,new Fe.Store(0));s(this,Dt,0);s(this,ut,0);s(this,N,!1);s(this,U,!0);s(this,G,!0);s(this,At);s(this,at);s(this,Z,new Ge.Tweened);s(this,Mt,!1);s(this,O,null);s(this,E,!1);s(this,ee,null);s(this,L,()=>{if(t(this,ot).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,P).current;if(n(this,Yt,this.vertical?Rt.getCumulativeOffsetTop(this):Rt.getCumulativeOffsetLeft(this)),n(this,te,this.vertical?Rt.getCumulativeOffsetTop(t(this,p)):Rt.getCumulativeOffsetLeft(t(this,p))),n(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?n(this,k,ze.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):n(this,k,ze.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,F).current&&t(this,l).length){const r=t(this,q).current,d=(t(this,y)-t(this,k)*(r-1))/r;t(this,l).forEach(b=>{b.setSize(d)})}else t(this,l).forEach(r=>{r.setSize()});if(t(this,l).forEach(r=>{r.resize()}),t(this,H).current){n(this,m,t(this,y)*t(this,H).current);const r=t(this,m)+t(this,y);this.vertical?(t(this,p).style.width=r+"px",t(this,p).style.height="100%"):(t(this,p).style.height=r+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",n(this,m,t(this,p).offsetHeight-t(this,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",n(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const r=getComputedStyle(this),d=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);n(this,m,t(this,m)+d),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const r=t(this,l)[t(this,l).length-1],d=r.position+r.size-t(this,y),b=t(this,m)-d;n(this,ut,r.position+r.size+b)}else n(this,ut,t(this,m));if(t(this,T).current&&t(this,l).length){const r=t(this,l)[i];t(this,a).set(r.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});n(this,N,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,y)),this.classList.toggle("has-overflow",t(this,N)),t(this,N)?t(this,ht).current||c(this,o,Se).call(this):c(this,o,de).call(this),t(this,Ot).call(this)});s(this,Ot,()=>{if(!t(this,N)||t(this,G)||t(this,U))return;const e=this.currentScrollValue;if(n(this,Dt,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,P).current=c(this,o,pe).call(this)}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;mt.scrollEntries.update(this,t(this,x).current,e)});s(this,Bt,(e,i)=>{t(this,yt).current&&(c(this,o,ve).call(this,Math.sign(i)||1),t(this,se).call(this,e,i))});s(this,se,(e,i)=>{if(t(this,_).current){if(t(this,_).current<0&&i>0)return;if(t(this,_).current>0&&i<0)return}if(t(this,at)||t(this,Z).unlistenAnimationFrame(),!t(this,I).current&&t(this,nt).current&&(clearInterval(t(this,At)),n(this,At,setTimeout(()=>{const r=t(this,l)[c(this,o,pe).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,Lt).current,easing:$e.easeInOutExpo}})},t(this,nt).current))),!(e.includes("drag")&&!Ze.device.isTouch&&!t(this,Et).current)){if(t(this,T).current&&e!=="drag"){const r=Math.sign(i);if(t(this,l).length){const d={tween:t(this,tt).current||t(this,et).current?{easing:t(this,tt).current||"easeInOutCubic",duration:t(this,et).current||500}:void 0};t(this,Mt)?this.scrollToSection(t(this,P).current,d):this.shiftSections(r,d)}else t(this,a).shift(r*t(this,y))}else t(this,a).shift(i);n(this,Mt,e==="drag")}});s(this,ie,()=>{n(this,E,!0),this.hibernatedCSSProperty.current||c(this,o,ye).call(this)});if(B.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Xe];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),n(this,lt,document.createElement("div")),t(this,lt).className="content-wrapper",n(this,p,document.createElement("div")),t(this,p).className="content",n(this,qt,document.createElement("slot")),t(this,p).appendChild(t(this,qt)),t(this,lt).appendChild(t(this,p)),e.appendChild(t(this,lt)),n(this,ee,new MutationObserver(r=>{this.tryResplit()}))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,yt)}get axisCSSProperty(){return t(this,x)}get reverseCSSProperty(){return t(this,Y)}get directionCSSProperty(){return t(this,_)}get pagesCSSProperty(){return t(this,H)}get splitCSSProperty(){return t(this,W)}get sectionalCSSProperty(){return t(this,T)}get easingCSSProperty(){return t(this,tt)}get durationCSSProperty(){return t(this,et)}get autoSizeCSSProperty(){return t(this,F)}get wheelMaxDeltaCSSProperty(){return t(this,st)}get dragInertionCSSProperty(){return t(this,vt)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,Ct)}get massCSSProperty(){return t(this,wt)}get stiffnessCSSProperty(){return t(this,Pt)}get mouseDragCSSProperty(){return t(this,Et)}get sectionDistanceScaleCSSProperty(){return t(this,Tt)}get autoplayCSSProperty(){return t(this,I)}get autoplayPauseDurationCSSProperty(){return t(this,xt)}get autoplayUserDirectionCSSProperty(){return t(this,it)}get classesCSSProperty(){return t(this,D)}get currentIndexStartOffsetCSSProperty(){return t(this,rt)}get currentIndexEndOffsetCSSProperty(){return t(this,$)}get focusDelayCSSProperty(){return t(this,nt)}get focusDurationCSSProperty(){return t(this,Lt)}get disabledCSSProperty(){return t(this,ht)}get hibernatedCSSProperty(){return t(this,ot)}get currentScrollValue(){return c(this,o,Ce).call(this,"current")}get targetScrollValue(){return c(this,o,Ce).call(this,"target")}get contentWrapperElement(){return t(this,lt)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,Yt)}get contentPosition(){return t(this,te)}get viewportSize(){return t(this,y)}get scrollSize(){return t(this,m)}get gap(){return t(this,k)}get counter(){return t(this,P)}get limit(){return Math.ceil(t(this,l).length-t(this,q).current)}get distance(){return t(this,ut)}get loopDistance(){return t(this,v).current?t(this,ut)+t(this,k):t(this,ut)}get hasOverflow(){return t(this,N)}get overscroll(){return t(this,Dt)}get scrollLine(){return t(this,O)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}tryResplit(){!t(this,G)&&(t(this,v).current||t(this,W).current||t(this,v).current||t(this,F).current||t(this,T).current)&&c(this,o,Jt).call(this)}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,r=0){const d=e-r,b=d+i+r*2;return this.currentProgress<d?0:this.currentProgress>b?1:(this.currentProgress-d)/(b-d)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const d=e-r,b=d+i+r*2;return this.currentProgress>=d&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const r=t(this,P).current,d=c(this,o,Te).call(this,e),b=t(this,l)[r],C=t(this,l)[d];if(b&&C){let R=0;const be=c(this,o,pe).call(this),Kt=t(this,l)[be],Ve=Kt?this.targetScrollValue-Kt.position:0;t(this,v).current?d===0&&r===t(this,l).length-1?R=t(this,m)+t(this,y)-b.position+t(this,k):d===t(this,l).length-1&&r===0?R=C.position-(t(this,m)+t(this,y)+t(this,k)):R=C.position-b.position:R=C.position-b.position,this.shiftPosition(R-Ve,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,P).current+e,i)}setPosition(e,i){c(this,o,ve).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,at)||(t(this,Z).set(t(this,a).current,{equalize:!0}),t(this,Z).set(e,Le({},i.tween)),n(this,at,setTimeout(()=>{n(this,at,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){mt.scrollEntries.register(this),n(this,a,new Ue.Damped(0,{damping:.01,min:0,order:ae.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),n(this,A,new ce.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Bt)),n(this,ct,new ce.KeyboardControls({element:this})),t(this,ct).changeEvent.subscribe(t(this,Bt)),n(this,M,new ce.DragControls({element:t(this,p)})),t(this,M).changeEvent.subscribe(t(this,Bt)),n(this,w,new ce.AutoplayControls({culling:this})),t(this,w).changeEvent.subscribe(t(this,se)),t(this,x).subscribe(()=>{c(this,o,me).call(this)}),t(this,Y).subscribe(()=>{c(this,o,me).call(this)}),t(this,st).subscribe(e=>{t(this,A).axis=e.current?"max":t(this,x).current}),t(this,vt).subscribe(e=>{t(this,M).inertion=typeof e.current=="number"?e.current:1}),t(this,H).subscribe(()=>{t(this,E)&&t(this,L).call(this)}),t(this,W).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,Jt).call(this):c(this,o,kt).call(this))}),t(this,T).subscribe(e=>{t(this,A).debounce=e.current,t(this,M).swipe=e.current,t(this,w).interval=e.current,t(this,E)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,Jt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,kt).call(this))}),t(this,F).subscribe(e=>{t(this,E)&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,Jt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,kt).call(this))}),t(this,q).subscribe(e=>{t(this,E)&&(t(this,L).call(this),c(this,o,ft).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,E)&&(t(this,l).length||(t(this,W).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(n(this,Dt,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,Ct).subscribe(e=>{t(this,a).damping=e.current}),t(this,wt).subscribe(e=>{t(this,a).mass=e.current}),t(this,Pt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,I).subscribe(e=>{t(this,w).speed=e.current,!t(this,U)&&e.current&&!e.previous?t(this,w).connect():!e.current&&e.previous&&t(this,w).disconnect()}),t(this,it).subscribe(e=>{e.current||(t(this,w).direction=1)}),t(this,D).subscribe(e=>{t(this,E)&&c(this,o,ft).call(this)}),t(this,rt).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,ft).call(this)}),t(this,$).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,ft).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,P).subscribe(e=>{t(this,l).length&&c(this,o,ft).call(this)}),t(this,Z).subscribe(e=>{t(this,Z).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,ht).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,de).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,Se).call(this))}),t(this,ot).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,ge).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,ye).call(this))}),t(this,yt).observe(),t(this,x).observe(),t(this,Y).observe(),t(this,_).observe(),t(this,H).observe(),t(this,W).observe(),t(this,T).observe(),t(this,tt).observe(),t(this,et).observe(),t(this,F).observe(),t(this,st).observe(),t(this,vt).observe(),t(this,q).observe(),t(this,v).observe(),t(this,Ct).observe(),t(this,wt).observe(),t(this,Pt).observe(),t(this,Et).observe(),t(this,Tt).observe(),t(this,I).observe(),t(this,I).observe(),t(this,xt).observe(),t(this,it).observe(),t(this,D).observe(),t(this,rt).observe(),t(this,$).observe(),t(this,nt).observe(),t(this,Lt).observe(),t(this,ht).observe(),t(this,ot).observe(),It.windowResizer.subscribe(t(this,ie),ae.RESIZE_ORDER.LAST)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,yt).unobserve(),t(this,x).unobserve(),t(this,Y).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,W).unobserve(),t(this,T).unobserve(),t(this,tt).unobserve(),t(this,et).unobserve(),t(this,F).unobserve(),t(this,st).unobserve(),t(this,vt).unobserve(),t(this,q).unobserve(),t(this,v).unobserve(),t(this,Ct).unobserve(),t(this,wt).unobserve(),t(this,Pt).unobserve(),t(this,Et).unobserve(),t(this,Tt).unobserve(),t(this,I).unobserve(),t(this,xt).unobserve(),t(this,it).unobserve(),t(this,D).unobserve(),t(this,rt).unobserve(),t(this,$).unobserve(),t(this,nt).unobserve(),t(this,Lt).unobserve(),t(this,ht).unobserve(),t(this,ot).unobserve(),It.windowResizer.unsubscribe(t(this,ie)),c(this,o,ge).call(this),t(this,ee).disconnect()}}a=new WeakMap,yt=new WeakMap,x=new WeakMap,Y=new WeakMap,_=new WeakMap,H=new WeakMap,W=new WeakMap,T=new WeakMap,tt=new WeakMap,et=new WeakMap,F=new WeakMap,st=new WeakMap,vt=new WeakMap,q=new WeakMap,v=new WeakMap,Ct=new WeakMap,wt=new WeakMap,Pt=new WeakMap,Et=new WeakMap,Tt=new WeakMap,I=new WeakMap,xt=new WeakMap,it=new WeakMap,D=new WeakMap,rt=new WeakMap,$=new WeakMap,nt=new WeakMap,Lt=new WeakMap,ht=new WeakMap,ot=new WeakMap,lt=new WeakMap,p=new WeakMap,qt=new WeakMap,l=new WeakMap,Yt=new WeakMap,te=new WeakMap,y=new WeakMap,m=new WeakMap,k=new WeakMap,A=new WeakMap,ct=new WeakMap,M=new WeakMap,w=new WeakMap,P=new WeakMap,Dt=new WeakMap,ut=new WeakMap,N=new WeakMap,U=new WeakMap,G=new WeakMap,At=new WeakMap,at=new WeakMap,Z=new WeakMap,Mt=new WeakMap,O=new WeakMap,E=new WeakMap,ee=new WeakMap,o=new WeakSet,me=function(){const e=t(this,x).current,i=t(this,Y).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,A).axis=t(this,st).current?"max":e,t(this,ct).dimension=e==="x"?"width":"height",t(this,M).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,L).call(this)},Jt=function(){c(this,o,kt).call(this),t(this,qt).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Qe(e,i,this))}),t(this,p).style.transform="",ue.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),c(this,o,ft).call(this)},kt=function(){t(this,l).forEach(e=>{e.destroy()}),n(this,l,[]),t(this,P).reset(),t(this,a).reset(),ue.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},de=function(){t(this,U)||(n(this,U,!0),t(this,a).unsubscribe(t(this,Ot)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,At)),clearInterval(t(this,at)),t(this,Z).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,ct).disconnect(),t(this,M).disconnect(),t(this,w).disconnect(),t(this,N)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,L).call(this)))},Se=function(){t(this,U)&&(n(this,U,!1),t(this,a).subscribe(t(this,Ot)),t(this,A).connect(),t(this,ct).connect(),t(this,M).connect(),t(this,I).current&&t(this,w).connect())},ge=function(){t(this,G)||(n(this,G,!0),It.windowResizer.unsubscribe(t(this,L)),Qt.elementResizer.unsubscribe(t(this,L)),c(this,o,de).call(this),t(this,p).style.transform="",t(this,p).style.height="",t(this,p).style.width="",this.classList.remove("has-overflow","start","end"),t(this,l).length?c(this,o,kt).call(this):(t(this,P).reset(),t(this,a).reset()),mt.scrollEntries.unregister(this))},ye=function(){t(this,G)&&(n(this,G,!1),mt.scrollEntries.register(this),this.tryResplit(),c(this,o,Se).call(this),It.windowResizer.subscribe(t(this,L),ae.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,L)))},L=new WeakMap,Ot=new WeakMap,Te=function(e){let i=t(this,P).current;return t(this,v).current?i=Ne.loopNumber(e,t(this,l).length):i=Re.clamp(e,0,this.limit),i},Bt=new WeakMap,se=new WeakMap,ve=function(e=1){t(this,it).current&&(t(this,w).direction=e),t(this,I).current&&t(this,w).pauseAndContinue(t(this,xt).current,this.sectionalCSSProperty.current)},Ce=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,m)+t(this,y)+t(this,k));return i<0?t(this,m)+i+t(this,y)+t(this,k):i}else return t(this,a)[e]},ft=function(){if(t(this,l).length){const e=t(this,P).current+t(this,rt).current;if(e===0?n(this,O,"start"):e===this.limit?n(this,O,"end"):n(this,O,null),ue.dispatchEvent(this,"scrollLine",{detail:{line:t(this,O)}}),t(this,D).current){this.classList.remove("end","start"),t(this,O)&&this.classList.add(t(this,O));const i=t(this,q).current+t(this,$).current;t(this,l).forEach((r,d)=>{const b=e-this.limit-1+t(this,$).current,C=e+i,R=this.sections.length-C;d>=e&&d<C||d<=b?r.mark("current"):d>=C&&d<C+R/2||d<=b+i?r.mark("next"):r.mark("previous")})}}},pe=function(){let e=this.targetScrollValue,i=1/0,r=0;const d=t(this,a).direction;for(let b=0;b<t(this,l).length;b++){const C=t(this,l)[b];let R=t(this,Mt)?C.size*d*-1*.4:0,be=C.position;const Kt=Math.abs(be+R-e);Kt<i&&(i=Kt,r=b)}return r},ie=new WeakMap;B.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",jt);var re;class we extends HTMLElement{constructor(){super(...arguments);s(this,re,null)}get scrollElement(){return t(this,re)}connectedCallback(){const e=Ie.findParentElement(this,jt);e instanceof jt?n(this,re,e):console.error(this,"e-scroll not found")}}re=new WeakMap;var dt,z,j,K,Vt,_t,St,Ht,ne,he;class qe extends we{constructor(){super();s(this,dt,null);s(this,z,null);s(this,j,!1);s(this,K,0);s(this,Vt,0);s(this,_t,0);s(this,St,()=>{n(this,j,this.offsetWidth>this.offsetHeight);const e=t(this,j)?this.offsetWidth:this.offsetHeight;n(this,K,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),n(this,K,Math.max(t(this,K),30)),t(this,j)?(t(this,z).style.width=t(this,K)+"px",t(this,z).style.height="100%"):(t(this,z).style.width="100%",t(this,z).style.height=t(this,K)+"px"),n(this,Vt,e-t(this,K)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Ht).call(this)});s(this,Ht,()=>{n(this,_t,this.scrollElement.currentProgress*t(this,Vt)),t(this,j)?t(this,z).style.transform=`translate3d(${t(this,_t)}px, 0px, 0px)`:t(this,z).style.transform=`translate3d(0px, ${t(this,_t)}px, 0px)`});s(this,ne,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,he,e=>{document.documentElement.classList.add("grabbing"),je.setupDrag(d=>{const b=t(this,j)?d.x:d.y,C=this.scrollElement.distance/t(this,Vt),R=(b-r)*C;this.scrollElement.setPosition(i+R)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,j)?e.x:e.y});if(B.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[ke.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"}})],n(this,dt,document.createElement("slot")),t(this,dt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,dt))}}get thumbElement(){return t(this,z)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,dt).assignedElements()[0]||t(this,dt).firstElementChild;n(this,z,e),t(this,z).addEventListener("pointerdown",t(this,he)),It.windowResizer.subscribe(t(this,St),ae.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,St)),Qt.elementResizer.subscribe(this.scrollElement,t(this,St)),this.scrollElement.onScroll(t(this,Ht)),this.scrollElement.axisCSSProperty.subscribe(t(this,ne))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,z).removeEventListener("pointerdown",t(this,he)),It.windowResizer.unsubscribe(t(this,St)),Qt.elementResizer.unsubscribe(t(this,St)),this.scrollElement.offScroll(t(this,Ht)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,ne))}}dt=new WeakMap,z=new WeakMap,j=new WeakMap,K=new WeakMap,Vt=new WeakMap,_t=new WeakMap,St=new WeakMap,Ht=new WeakMap,ne=new WeakMap,he=new WeakMap;B.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",qe);var Wt,Ft,$t;class De extends we{constructor(){super();s(this,Wt,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Ft,new S.CSSProperty(this,"--tween-easing",!1));s(this,$t,new S.CSSProperty(this,"--tween-duration",0));B.isBrowser&&this.addEventListener("click",()=>{const e=t(this,Wt).current,i=t(this,Ft).current,r=t(this,$t).current;this.handleClick({behaviour:e,tween:i||r?{easing:i,duration:r}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,Wt).observe(),t(this,Ft).observe(),t(this,$t).observe()}disconnectedCallback(){t(this,Wt).close(),t(this,Ft).close(),t(this,$t).close()}}Wt=new WeakMap,Ft=new WeakMap,$t=new WeakMap;var Nt;class Ae extends De{constructor(){super(...arguments);s(this,Nt,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Nt).current,e)}connectedCallback(){super.connectedCallback(),t(this,Nt).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Nt).close()}}Nt=new WeakMap;B.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",Ae);var J,Ut;class Me extends De{constructor(){super(...arguments);s(this,J,new S.CSSProperty(this,"--step",1));s(this,Ut,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,J).current>0&&this.scrollElement.scrollLine==="end"||t(this,J).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,J).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,J).subscribe(()=>{t(this,Ut).call(this)}),t(this,J).observe(),this.scrollElement.addEventListener("scrollLine",t(this,Ut)),t(this,Ut).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,J).close(),this.removeAttribute("disabled")}}J=new WeakMap,Ut=new WeakMap;B.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",Me);var Q,pt,Gt,oe,le,Zt;class Ye{constructor(h,e,i){s(this,Q,null);s(this,pt,null);s(this,Gt,null);s(this,oe,null);s(this,le,()=>{t(this,pt).scrollToSection(t(this,Gt),{behaviour:t(this,oe)})});s(this,Zt,()=>{t(this,Q).classList.toggle("current",t(this,pt).counter.current===t(this,Gt))});B.isBrowser&&(n(this,Q,document.createElement("button")),n(this,pt,h),n(this,oe,i),n(this,Gt,e),t(this,Q).addEventListener("click",t(this,le)),t(this,pt).counter.subscribe(t(this,Zt)),t(this,Zt).call(this))}get element(){return t(this,Q)}destroy(){t(this,Q).removeEventListener("click",t(this,le)),t(this,pt).counter.unsubscribe(t(this,Zt)),t(this,Q).remove()}}Q=new WeakMap,pt=new WeakMap,Gt=new WeakMap,oe=new WeakMap,le=new WeakMap,Zt=new WeakMap;var bt,zt;class Oe extends we{constructor(){super(...arguments);s(this,bt,[]);s(this,zt,Ke.debounce(()=>{t(this,bt).forEach(i=>i.destroy()),n(this,bt,[]);const e=this.scrollElement.sections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new Ye(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");this.appendChild(r.element),t(this,bt).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,zt)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,zt))}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,zt)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,zt)),t(this,bt).forEach(e=>e.destroy()),n(this,bt,[])}}bt=new WeakMap,zt=new WeakMap;B.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Oe);class Be extends Je.ScrollSegmentElement{connectedCallback(){const h=Ie.findParentElement(this,jt);h instanceof jt?(this.scrollContainer=h,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}B.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",Be);exports.ScrollBulletButtonsElement=Oe;exports.ScrollElement=jt;exports.ScrollSegmentElement=Be;exports.ScrollSetButtonElement=Ae;exports.ScrollStepButtonElement=Me;exports.ScrollbarElement=qe;
|
package/lib/scroll/index.js
CHANGED
|
@@ -24,8 +24,8 @@ import { c as Ie } from "../math-BOBiC4TN.js";
|
|
|
24
24
|
import { l as We } from "../number-DwCxt_Ck.js";
|
|
25
25
|
import "../ticker/index.js";
|
|
26
26
|
import { TICK_ORDER as Fe, RESIZE_ORDER as be } from "../order/index.js";
|
|
27
|
-
import { D as $e } from "../Damped-
|
|
28
|
-
import { T as Ne } from "../Tweened-
|
|
27
|
+
import { D as $e } from "../Damped-BXsGpI-B.js";
|
|
28
|
+
import { T as Ne } from "../Tweened-BhDWLNF0.js";
|
|
29
29
|
import { WheelControls as qe, KeyboardControls as Ue, DragControls as Ge, AutoplayControls as Ke } from "../controls/index.js";
|
|
30
30
|
import { windowResizer as It } from "../window-resizer/index.js";
|
|
31
31
|
import { scrollEntries as St } from "../scroll-entries/index.js";
|
|
@@ -33,7 +33,7 @@ import { cssUnitParser as ke } from "../css-unit-parser/index.js";
|
|
|
33
33
|
import { CSSProperty as p } from "../css-property/index.js";
|
|
34
34
|
import { device as _e } from "../device/index.js";
|
|
35
35
|
import { elementResizer as jt } from "../element-resizer/index.js";
|
|
36
|
-
import { s as Ze } from "../gestures-
|
|
36
|
+
import { s as Ze } from "../gestures-CcXV6fCp.js";
|
|
37
37
|
import { b as Te } from "../dom-CVWzyXPH.js";
|
|
38
38
|
import { d as je } from "../function-C10DGppn.js";
|
|
39
39
|
import { ScrollSegmentElement as Je } from "../scroll-segment/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var St=a=>{throw TypeError(a)};var ct=(a,c,r)=>c.has(a)||St("Cannot "+r);var t=(a,c,r)=>(ct(a,c,"read from private field"),r?r.call(a):c.get(a)),i=(a,c,r)=>c.has(a)?St("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(a):c.set(a,r),s=(a,c,r,e)=>(ct(a,c,"write to private field"),e?e.call(a,r):c.set(a,r),r),o=(a,c,r)=>(ct(a,c,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Lt=require("../dom-JBOkFLTh.cjs"),Rt=require("../index-Cqw2NKev.cjs"),ft=require("../element-resizer/index.cjs"),nt=require("../window-resizer/index.cjs"),u=require("../css-property/index.cjs"),pt=require("../order/index.cjs"),Y=require("../events-KVanG9sR.cjs"),zt=require("../function-MthRj-GJ.cjs"),ot=require("../layout-Ctc2p3uz.cjs"),Ot=require("../math-GDWEqu7y.cjs"),tt=require("../Store-DRp_K37w.cjs"),qt=require("../scroll-entries/index.cjs");require("../ticker/index.cjs");const xt=require("../Damped-DbaLw6w1.cjs");var V,ht,et,W;class ut{constructor(c){i(this,V,null);i(this,ht);i(this,et,!1);i(this,W,()=>{s(this,et,!(t(this,V).scrollWidth>t(this,V).clientWidth))});s(this,ht,c),s(this,V,Lt.findScrollParentElement(t(this,ht))),ft.elementResizer.subscribe(t(this,V),t(this,W)),nt.windowResizer.subscribe(t(this,W)),t(this,W).call(this)}get element(){return t(this,V)}get currentScrollValue(){return t(this,et)?t(this,V).scrollTop:t(this,V).scrollLeft}get vertical(){return t(this,et)}destroy(){ft.elementResizer.unsubscribe(t(this,W)),nt.windowResizer.unsubscribe(t(this,W))}onScroll(c){t(this,V).addEventListener("scroll",c)}offScroll(c){t(this,V).removeEventListener("scroll",c)}}V=new WeakMap,ht=new WeakMap,et=new WeakMap,W=new WeakMap;var l,j,B,G,K,k,T,_,M,d,g,y,v,A,p,z,O,J,q,x,D,f,P,w,L,R,F,st,n,$,N,rt,m,H,C,b,E,Q,I,S,h,bt,at,Ct,gt,yt,vt,Pt,wt,it,U,Z,Vt,Ft,lt,dt;let mt=(dt=class extends HTMLElement{constructor(){super(...arguments);i(this,h);i(this,l);i(this,j);i(this,B);i(this,G);i(this,K);i(this,k);i(this,T);i(this,_);i(this,M);i(this,d);i(this,g);i(this,y);i(this,v);i(this,A);i(this,p);i(this,z);i(this,O);i(this,J);i(this,q);i(this,x);i(this,D);i(this,f);i(this,P);i(this,w);i(this,L);i(this,R);i(this,F);i(this,st);i(this,n);i(this,$);i(this,N);i(this,rt);i(this,m);i(this,H);i(this,C);i(this,b);i(this,E);i(this,Q);i(this,I);i(this,S);i(this,it);i(this,U);s(this,l,null),s(this,j,new u.CSSProperty(this,"--damping",20)),s(this,B,new u.CSSProperty(this,"--mass",0)),s(this,G,new u.CSSProperty(this,"--stiffness",0)),s(this,K,new u.CSSProperty(this,"--target","")),s(this,k,new u.CSSProperty(this,"--disabled",!1)),s(this,T,new u.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),s(this,_,new u.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),s(this,M,new u.CSSProperty(this,"--capture-once",!1)),s(this,d,new u.CSSProperty(this,"--captured","")),s(this,g,new u.CSSProperty(this,"--released","")),s(this,y,new u.CSSProperty(this,"--captured-from-start","")),s(this,v,new u.CSSProperty(this,"--captured-from-finish","")),s(this,A,new u.CSSProperty(this,"--released-from-start","")),s(this,p,new u.CSSProperty(this,"--released-from-finish","")),s(this,z,new u.CSSProperty(this,"--passed-var","")),s(this,O,new u.CSSProperty(this,"--progress-var","")),s(this,J,new u.CSSProperty(this,"--animation-var-type","current")),s(this,q,new u.CSSProperty(this,"--distance-var","")),s(this,x,new u.CSSProperty(this,"--start-var","")),s(this,D,new u.CSSProperty(this,"--finish-var","")),s(this,f,new tt.Store(!1)),s(this,P,new tt.Store(!1)),s(this,w,new tt.Store(!1)),s(this,L,new tt.Store(!1)),s(this,R,new tt.Store(!1)),s(this,F,new tt.Store(!1)),s(this,st,[]),s(this,n,this),s(this,$,0),s(this,N,0),s(this,rt,0),s(this,m,new xt.Damped(0,{order:pt.TICK_ORDER.SEGMENT,min:0,max:1})),s(this,H,0),s(this,C,0),s(this,b,0),s(this,E,0),s(this,Q,!1),s(this,I,!1),s(this,S,!0),this.findAnotherScrollEntries=zt.debounce(()=>{const r=qt.scrollEntries.getAll(this).reverse();let e=0;r.forEach((X,Et)=>{X.element===t(this,l)&&(e=Et)}),s(this,st,r.slice(e+1))},0),s(this,it,()=>{t(this,S)||(this.resize(),t(this,U).call(this))}),s(this,U,()=>{!t(this,S)&&t(this,Q)&&this.tick()})}get scrollContainer(){return t(this,l)}set scrollContainer(r){o(this,h,at).call(this),s(this,l,r),o(this,h,bt).call(this)}get distanceOffsetCSSProperty(){return t(this,T)}get startOffsetCSSProperty(){return t(this,_)}get captureOnceCSSProperty(){return t(this,M)}get capturedCSSProperty(){return t(this,d)}get releasedCSSProperty(){return t(this,g)}get capturedFromStartCSSProperty(){return t(this,y)}get capturedFromFinishCSSProperty(){return t(this,v)}get releasedFromStartCSSProperty(){return t(this,A)}get releasedFromFinishCSSProperty(){return t(this,p)}get passedVarCSSProperty(){return t(this,z)}get progressVarCSSProperty(){return t(this,O)}get animationVarTypeCSSProperty(){return t(this,J)}get distanceVarCSSProperty(){return t(this,q)}get startVarCSSProperty(){return t(this,x)}get finishVarCSSProperty(){return t(this,D)}get disabledCSSProperty(){return t(this,k)}get dampingCSSProperty(){return t(this,j)}get massCSSProperty(){return t(this,B)}get stiffnessCSSProperty(){return t(this,G)}get targetCSSProperty(){return t(this,K)}get isCaptured(){return t(this,f)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,w)}get isReleasedFromStart(){return t(this,L)}get isCapturedFromFinish(){return t(this,R)}get isReleasedFromFinish(){return t(this,F)}get directionPosition(){return t(this,$)}get directionSize(){return t(this,N)}get passed(){return t(this,m)}get progress(){return t(this,H)}get start(){return t(this,C)}get finish(){return t(this,E)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,I)}get isDisabled(){return t(this,S)}resize(){s(this,N,t(this,l).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,l)instanceof HTMLElement?t(this,l):t(this,l).element;s(this,$,t(this,l).vertical?ot.getCumulativeOffsetTop(this,r):ot.getCumulativeOffsetLeft(this,r));const e=ot.getStickyOffset(this,t(this,l).vertical?"top":"left");s(this,$,t(this,$)-e),s(this,C,this.getStart()),s(this,b,this.getDistance()),s(this,C,t(this,C)+t(this,_).current),s(this,b,t(this,b)+t(this,T).current),s(this,E,t(this,C)+t(this,b)),t(this,l).currentScrollValue>t(this,E)&&!t(this,f).current&&!t(this,P).current&&(t(this,f).current=!0),this.setVar(t(this,x).current,t(this,C)),this.setVar(t(this,D).current,t(this,E)),this.setVar(t(this,q).current,t(this,b)),t(this,m).max=t(this,b),s(this,Q,!0)}tick(){let r=t(this,l).currentScrollValue;t(this,st).forEach(X=>{r+=X.value}),t(this,m).set(r-t(this,C));const e=Math.round(r);t(this,f).current&&(e>=t(this,C)?t(this,w).current||o(this,h,yt).call(this):t(this,w).current&&!t(this,L).current&&o(this,h,Pt).call(this),e<t(this,E)?t(this,F).current&&!t(this,R).current&&o(this,h,vt).call(this):t(this,w).current&&!t(this,F).current&&o(this,h,wt).call(this)),e>=t(this,C)&&e<t(this,E)?t(this,f).current||o(this,h,Ct).call(this):t(this,f).current&&(t(this,m).set(Ot.step(t(this,b)/2,t(this,m).target,0,t(this,b))),o(this,h,gt).call(this)),t(this,I)&&t(this,M).current&&(t(this,d).current&&t(this,n).classList.add(t(this,d).current),s(this,S,!0))}disable(){this.style.cssText="",s(this,$,0),s(this,N,0),t(this,m).reset(),s(this,H,0),s(this,C,0),s(this,b,0),s(this,E,0),s(this,Q,!1),t(this,f).current=!1,t(this,P).current=!1,t(this,w).current=!1,t(this,L).current=!1,t(this,R).current=!1,t(this,F).current=!1,s(this,I,!1),s(this,S,!0),o(this,h,lt).call(this)}enable(){s(this,S,!1)}connectedCallback(){this.scrollContainer=new ut(this)}disconnectedCallback(){t(this,l)instanceof ut&&t(this,l).destroy(),o(this,h,at).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,e){r&&t(this,n).style.setProperty(`--${r}`,e.toString())}getDistance(){return t(this,N)+t(this,rt)}getStart(){return t(this,$)-t(this,rt)}},l=new WeakMap,j=new WeakMap,B=new WeakMap,G=new WeakMap,K=new WeakMap,k=new WeakMap,T=new WeakMap,_=new WeakMap,M=new WeakMap,d=new WeakMap,g=new WeakMap,y=new WeakMap,v=new WeakMap,A=new WeakMap,p=new WeakMap,z=new WeakMap,O=new WeakMap,J=new WeakMap,q=new WeakMap,x=new WeakMap,D=new WeakMap,f=new WeakMap,P=new WeakMap,w=new WeakMap,L=new WeakMap,R=new WeakMap,F=new WeakMap,st=new WeakMap,n=new WeakMap,$=new WeakMap,N=new WeakMap,rt=new WeakMap,m=new WeakMap,H=new WeakMap,C=new WeakMap,b=new WeakMap,E=new WeakMap,Q=new WeakMap,I=new WeakMap,S=new WeakMap,h=new WeakSet,bt=function(){if(!t(this,l))return;t(this,f).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,w).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,R).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,L).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,F).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,j).observe(),t(this,B).observe(),t(this,G).observe(),t(this,K).observe(),t(this,k).observe(),t(this,T).observe(),t(this,_).observe(),t(this,M).observe(),t(this,d).observe(),t(this,g).observe(),t(this,y).observe(),t(this,v).observe(),t(this,A).observe(),t(this,p).observe(),t(this,z).observe(),t(this,O).observe(),t(this,J).observe(),t(this,q).observe(),t(this,x).observe(),t(this,D).observe();let r=!1;this.findAnotherScrollEntries(),t(this,k).current||this.enable(),t(this,j).subscribe(e=>{t(this,m).damping=e.current}),t(this,B).subscribe(e=>{t(this,m).mass=e.current}),t(this,G).subscribe(e=>{t(this,m).stiffness=e.current}),t(this,K).subscribe(e=>{e.previous&&o(this,h,lt).call(this),e.current?e.current==="parent"?s(this,n,this.parentElement||this):s(this,n,document.querySelector(e.current)||this):s(this,n,this)}),t(this,k).subscribe(e=>{e.current&&!e.previous?this.disable():!e.current&&e.previous&&(this.resize(),this.enable())}),t(this,_).subscribe(()=>{r&&!t(this,S)&&this.resize()}),t(this,T).subscribe(()=>{r&&!t(this,S)&&this.resize()}),t(this,d).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,y).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,v).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,g).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,A).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,p).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,M).subscribe(e=>{t(this,S)||!e.current&&e.previous&&(this.resize(),this.enable())}),t(this,z).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,this.passed.current))}),t(this,O).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,H)))}),t(this,x).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,C)))}),t(this,D).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,E)))}),t(this,q).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,b)))}),t(this,m).subscribe(e=>{const X=t(this,m)[t(this,J).current];s(this,H,X/t(this,b)||0),this.setVar(t(this,z).current,X.toFixed(6)),this.setVar(t(this,O).current,t(this,H).toFixed(6))}),nt.windowResizer.subscribe(t(this,it),pt.RESIZE_ORDER.SCROLL),this.scrollContainer.onScroll(t(this,U)),r=!0},at=function(){t(this,l)&&(nt.windowResizer.unsubscribe(t(this,it)),this.scrollContainer.offScroll(t(this,U)),t(this,j).close(),t(this,B).close(),t(this,G).close(),t(this,K).close(),t(this,k).close(),t(this,T).close(),t(this,_).close(),t(this,M).close(),t(this,d).close(),t(this,g).close(),t(this,y).close(),t(this,v).close(),t(this,A).close(),t(this,p).close(),t(this,z).close(),t(this,O).close(),t(this,q).close(),t(this,x).close(),t(this,D).close(),t(this,f).close(),t(this,P).close(),t(this,w).close(),t(this,L).close(),t(this,R).close(),t(this,F).close(),this.disable())},Ct=function(){t(this,f).current=!0,t(this,P).current=!1,s(this,I,!0),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,d).current&&t(this,n).classList.add(t(this,d).current)},gt=function(){t(this,P).current=!0,t(this,f).current=!1,s(this,I,!0),t(this,d).current&&t(this,n).classList.remove(t(this,d).current),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,g).current&&t(this,n).classList.add(t(this,g).current)},yt=function(){t(this,f).current=!0,t(this,w).current=!0,t(this,L).current=!1,t(this,y).current&&t(this,n).classList.add(t(this,y).current)},vt=function(){t(this,f).current=!0,t(this,R).current=!0,t(this,F).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},Pt=function(){t(this,P).current=!0,t(this,L).current=!0,t(this,w).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},wt=function(){t(this,P).current=!0,t(this,F).current=!0,t(this,R).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},it=new WeakMap,U=new WeakMap,Z=function(r){if(t(this,S)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,f).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},Vt=function(...r){r.forEach(e=>{e&&t(this,n).classList.remove(e)})},Ft=function(...r){r.forEach(e=>{e&&t(this,n).style.removeProperty(`--${e}`)})},lt=function(){o(this,h,Vt).call(this,t(this,d).current,t(this,y).current,t(this,v).current,t(this,g).current,t(this,A).current,t(this,p).current),o(this,h,Ft).call(this,t(this,z).current,t(this,O).current,t(this,q).current,t(this,x).current,t(this,D).current)},dt);Rt.isBrowser&&!customElements.get("scroll-segment")&&customElements.define("scroll-segment",mt);exports.ScrollSegmentDefaultContainer=ut;exports.ScrollSegmentElement=mt;
|
|
1
|
+
"use strict";var St=a=>{throw TypeError(a)};var ct=(a,c,r)=>c.has(a)||St("Cannot "+r);var t=(a,c,r)=>(ct(a,c,"read from private field"),r?r.call(a):c.get(a)),i=(a,c,r)=>c.has(a)?St("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(a):c.set(a,r),s=(a,c,r,e)=>(ct(a,c,"write to private field"),e?e.call(a,r):c.set(a,r),r),o=(a,c,r)=>(ct(a,c,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Lt=require("../dom-JBOkFLTh.cjs"),Rt=require("../index-Cqw2NKev.cjs"),ft=require("../element-resizer/index.cjs"),nt=require("../window-resizer/index.cjs"),u=require("../css-property/index.cjs"),pt=require("../order/index.cjs"),Y=require("../events-KVanG9sR.cjs"),zt=require("../function-MthRj-GJ.cjs"),ot=require("../layout-Ctc2p3uz.cjs"),Ot=require("../math-GDWEqu7y.cjs"),tt=require("../Store-DRp_K37w.cjs"),qt=require("../scroll-entries/index.cjs");require("../ticker/index.cjs");const xt=require("../Damped-B1lXa9nb.cjs");var V,ht,et,W;class ut{constructor(c){i(this,V,null);i(this,ht);i(this,et,!1);i(this,W,()=>{s(this,et,!(t(this,V).scrollWidth>t(this,V).clientWidth))});s(this,ht,c),s(this,V,Lt.findScrollParentElement(t(this,ht))),ft.elementResizer.subscribe(t(this,V),t(this,W)),nt.windowResizer.subscribe(t(this,W)),t(this,W).call(this)}get element(){return t(this,V)}get currentScrollValue(){return t(this,et)?t(this,V).scrollTop:t(this,V).scrollLeft}get vertical(){return t(this,et)}destroy(){ft.elementResizer.unsubscribe(t(this,W)),nt.windowResizer.unsubscribe(t(this,W))}onScroll(c){t(this,V).addEventListener("scroll",c)}offScroll(c){t(this,V).removeEventListener("scroll",c)}}V=new WeakMap,ht=new WeakMap,et=new WeakMap,W=new WeakMap;var l,j,B,G,K,k,T,_,M,d,g,y,v,A,p,z,O,J,q,x,D,f,P,w,L,R,F,st,n,$,N,rt,m,H,C,b,E,Q,I,S,h,bt,at,Ct,gt,yt,vt,Pt,wt,it,U,Z,Vt,Ft,lt,dt;let mt=(dt=class extends HTMLElement{constructor(){super(...arguments);i(this,h);i(this,l);i(this,j);i(this,B);i(this,G);i(this,K);i(this,k);i(this,T);i(this,_);i(this,M);i(this,d);i(this,g);i(this,y);i(this,v);i(this,A);i(this,p);i(this,z);i(this,O);i(this,J);i(this,q);i(this,x);i(this,D);i(this,f);i(this,P);i(this,w);i(this,L);i(this,R);i(this,F);i(this,st);i(this,n);i(this,$);i(this,N);i(this,rt);i(this,m);i(this,H);i(this,C);i(this,b);i(this,E);i(this,Q);i(this,I);i(this,S);i(this,it);i(this,U);s(this,l,null),s(this,j,new u.CSSProperty(this,"--damping",20)),s(this,B,new u.CSSProperty(this,"--mass",0)),s(this,G,new u.CSSProperty(this,"--stiffness",0)),s(this,K,new u.CSSProperty(this,"--target","")),s(this,k,new u.CSSProperty(this,"--disabled",!1)),s(this,T,new u.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),s(this,_,new u.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),s(this,M,new u.CSSProperty(this,"--capture-once",!1)),s(this,d,new u.CSSProperty(this,"--captured","")),s(this,g,new u.CSSProperty(this,"--released","")),s(this,y,new u.CSSProperty(this,"--captured-from-start","")),s(this,v,new u.CSSProperty(this,"--captured-from-finish","")),s(this,A,new u.CSSProperty(this,"--released-from-start","")),s(this,p,new u.CSSProperty(this,"--released-from-finish","")),s(this,z,new u.CSSProperty(this,"--passed-var","")),s(this,O,new u.CSSProperty(this,"--progress-var","")),s(this,J,new u.CSSProperty(this,"--animation-var-type","current")),s(this,q,new u.CSSProperty(this,"--distance-var","")),s(this,x,new u.CSSProperty(this,"--start-var","")),s(this,D,new u.CSSProperty(this,"--finish-var","")),s(this,f,new tt.Store(!1)),s(this,P,new tt.Store(!1)),s(this,w,new tt.Store(!1)),s(this,L,new tt.Store(!1)),s(this,R,new tt.Store(!1)),s(this,F,new tt.Store(!1)),s(this,st,[]),s(this,n,this),s(this,$,0),s(this,N,0),s(this,rt,0),s(this,m,new xt.Damped(0,{order:pt.TICK_ORDER.SEGMENT,min:0,max:1})),s(this,H,0),s(this,C,0),s(this,b,0),s(this,E,0),s(this,Q,!1),s(this,I,!1),s(this,S,!0),this.findAnotherScrollEntries=zt.debounce(()=>{const r=qt.scrollEntries.getAll(this).reverse();let e=0;r.forEach((X,Et)=>{X.element===t(this,l)&&(e=Et)}),s(this,st,r.slice(e+1))},0),s(this,it,()=>{t(this,S)||(this.resize(),t(this,U).call(this))}),s(this,U,()=>{!t(this,S)&&t(this,Q)&&this.tick()})}get scrollContainer(){return t(this,l)}set scrollContainer(r){o(this,h,at).call(this),s(this,l,r),o(this,h,bt).call(this)}get distanceOffsetCSSProperty(){return t(this,T)}get startOffsetCSSProperty(){return t(this,_)}get captureOnceCSSProperty(){return t(this,M)}get capturedCSSProperty(){return t(this,d)}get releasedCSSProperty(){return t(this,g)}get capturedFromStartCSSProperty(){return t(this,y)}get capturedFromFinishCSSProperty(){return t(this,v)}get releasedFromStartCSSProperty(){return t(this,A)}get releasedFromFinishCSSProperty(){return t(this,p)}get passedVarCSSProperty(){return t(this,z)}get progressVarCSSProperty(){return t(this,O)}get animationVarTypeCSSProperty(){return t(this,J)}get distanceVarCSSProperty(){return t(this,q)}get startVarCSSProperty(){return t(this,x)}get finishVarCSSProperty(){return t(this,D)}get disabledCSSProperty(){return t(this,k)}get dampingCSSProperty(){return t(this,j)}get massCSSProperty(){return t(this,B)}get stiffnessCSSProperty(){return t(this,G)}get targetCSSProperty(){return t(this,K)}get isCaptured(){return t(this,f)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,w)}get isReleasedFromStart(){return t(this,L)}get isCapturedFromFinish(){return t(this,R)}get isReleasedFromFinish(){return t(this,F)}get directionPosition(){return t(this,$)}get directionSize(){return t(this,N)}get passed(){return t(this,m)}get progress(){return t(this,H)}get start(){return t(this,C)}get finish(){return t(this,E)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,I)}get isDisabled(){return t(this,S)}resize(){s(this,N,t(this,l).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,l)instanceof HTMLElement?t(this,l):t(this,l).element;s(this,$,t(this,l).vertical?ot.getCumulativeOffsetTop(this,r):ot.getCumulativeOffsetLeft(this,r));const e=ot.getStickyOffset(this,t(this,l).vertical?"top":"left");s(this,$,t(this,$)-e),s(this,C,this.getStart()),s(this,b,this.getDistance()),s(this,C,t(this,C)+t(this,_).current),s(this,b,t(this,b)+t(this,T).current),s(this,E,t(this,C)+t(this,b)),t(this,l).currentScrollValue>t(this,E)&&!t(this,f).current&&!t(this,P).current&&(t(this,f).current=!0),this.setVar(t(this,x).current,t(this,C)),this.setVar(t(this,D).current,t(this,E)),this.setVar(t(this,q).current,t(this,b)),t(this,m).max=t(this,b),s(this,Q,!0)}tick(){let r=t(this,l).currentScrollValue;t(this,st).forEach(X=>{r+=X.value}),t(this,m).set(r-t(this,C));const e=Math.round(r);t(this,f).current&&(e>=t(this,C)?t(this,w).current||o(this,h,yt).call(this):t(this,w).current&&!t(this,L).current&&o(this,h,Pt).call(this),e<t(this,E)?t(this,F).current&&!t(this,R).current&&o(this,h,vt).call(this):t(this,w).current&&!t(this,F).current&&o(this,h,wt).call(this)),e>=t(this,C)&&e<t(this,E)?t(this,f).current||o(this,h,Ct).call(this):t(this,f).current&&(t(this,m).set(Ot.step(t(this,b)/2,t(this,m).target,0,t(this,b))),o(this,h,gt).call(this)),t(this,I)&&t(this,M).current&&(t(this,d).current&&t(this,n).classList.add(t(this,d).current),s(this,S,!0))}disable(){this.style.cssText="",s(this,$,0),s(this,N,0),t(this,m).reset(),s(this,H,0),s(this,C,0),s(this,b,0),s(this,E,0),s(this,Q,!1),t(this,f).current=!1,t(this,P).current=!1,t(this,w).current=!1,t(this,L).current=!1,t(this,R).current=!1,t(this,F).current=!1,s(this,I,!1),s(this,S,!0),o(this,h,lt).call(this)}enable(){s(this,S,!1)}connectedCallback(){this.scrollContainer=new ut(this)}disconnectedCallback(){t(this,l)instanceof ut&&t(this,l).destroy(),o(this,h,at).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,e){r&&t(this,n).style.setProperty(`--${r}`,e.toString())}getDistance(){return t(this,N)+t(this,rt)}getStart(){return t(this,$)-t(this,rt)}},l=new WeakMap,j=new WeakMap,B=new WeakMap,G=new WeakMap,K=new WeakMap,k=new WeakMap,T=new WeakMap,_=new WeakMap,M=new WeakMap,d=new WeakMap,g=new WeakMap,y=new WeakMap,v=new WeakMap,A=new WeakMap,p=new WeakMap,z=new WeakMap,O=new WeakMap,J=new WeakMap,q=new WeakMap,x=new WeakMap,D=new WeakMap,f=new WeakMap,P=new WeakMap,w=new WeakMap,L=new WeakMap,R=new WeakMap,F=new WeakMap,st=new WeakMap,n=new WeakMap,$=new WeakMap,N=new WeakMap,rt=new WeakMap,m=new WeakMap,H=new WeakMap,C=new WeakMap,b=new WeakMap,E=new WeakMap,Q=new WeakMap,I=new WeakMap,S=new WeakMap,h=new WeakSet,bt=function(){if(!t(this,l))return;t(this,f).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,w).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,R).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,L).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,F).subscribe(e=>{e.current&&Y.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,j).observe(),t(this,B).observe(),t(this,G).observe(),t(this,K).observe(),t(this,k).observe(),t(this,T).observe(),t(this,_).observe(),t(this,M).observe(),t(this,d).observe(),t(this,g).observe(),t(this,y).observe(),t(this,v).observe(),t(this,A).observe(),t(this,p).observe(),t(this,z).observe(),t(this,O).observe(),t(this,J).observe(),t(this,q).observe(),t(this,x).observe(),t(this,D).observe();let r=!1;this.findAnotherScrollEntries(),t(this,k).current||this.enable(),t(this,j).subscribe(e=>{t(this,m).damping=e.current}),t(this,B).subscribe(e=>{t(this,m).mass=e.current}),t(this,G).subscribe(e=>{t(this,m).stiffness=e.current}),t(this,K).subscribe(e=>{e.previous&&o(this,h,lt).call(this),e.current?e.current==="parent"?s(this,n,this.parentElement||this):s(this,n,document.querySelector(e.current)||this):s(this,n,this)}),t(this,k).subscribe(e=>{e.current&&!e.previous?this.disable():!e.current&&e.previous&&(this.resize(),this.enable())}),t(this,_).subscribe(()=>{r&&!t(this,S)&&this.resize()}),t(this,T).subscribe(()=>{r&&!t(this,S)&&this.resize()}),t(this,d).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,y).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,v).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,g).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,A).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,p).subscribe(e=>{o(this,h,Z).call(this,e)}),t(this,M).subscribe(e=>{t(this,S)||!e.current&&e.previous&&(this.resize(),this.enable())}),t(this,z).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,this.passed.current))}),t(this,O).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,H)))}),t(this,x).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,C)))}),t(this,D).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,E)))}),t(this,q).subscribe(e=>{t(this,S)||(this.removeVar(e.previous),this.setVar(e.current,t(this,b)))}),t(this,m).subscribe(e=>{const X=t(this,m)[t(this,J).current];s(this,H,X/t(this,b)||0),this.setVar(t(this,z).current,X.toFixed(6)),this.setVar(t(this,O).current,t(this,H).toFixed(6))}),nt.windowResizer.subscribe(t(this,it),pt.RESIZE_ORDER.SCROLL),this.scrollContainer.onScroll(t(this,U)),r=!0},at=function(){t(this,l)&&(nt.windowResizer.unsubscribe(t(this,it)),this.scrollContainer.offScroll(t(this,U)),t(this,j).close(),t(this,B).close(),t(this,G).close(),t(this,K).close(),t(this,k).close(),t(this,T).close(),t(this,_).close(),t(this,M).close(),t(this,d).close(),t(this,g).close(),t(this,y).close(),t(this,v).close(),t(this,A).close(),t(this,p).close(),t(this,z).close(),t(this,O).close(),t(this,q).close(),t(this,x).close(),t(this,D).close(),t(this,f).close(),t(this,P).close(),t(this,w).close(),t(this,L).close(),t(this,R).close(),t(this,F).close(),this.disable())},Ct=function(){t(this,f).current=!0,t(this,P).current=!1,s(this,I,!0),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,p).current&&t(this,n).classList.remove(t(this,p).current),t(this,d).current&&t(this,n).classList.add(t(this,d).current)},gt=function(){t(this,P).current=!0,t(this,f).current=!1,s(this,I,!0),t(this,d).current&&t(this,n).classList.remove(t(this,d).current),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,g).current&&t(this,n).classList.add(t(this,g).current)},yt=function(){t(this,f).current=!0,t(this,w).current=!0,t(this,L).current=!1,t(this,y).current&&t(this,n).classList.add(t(this,y).current)},vt=function(){t(this,f).current=!0,t(this,R).current=!0,t(this,F).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},Pt=function(){t(this,P).current=!0,t(this,L).current=!0,t(this,w).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},wt=function(){t(this,P).current=!0,t(this,F).current=!0,t(this,R).current=!1,t(this,p).current&&t(this,n).classList.add(t(this,p).current)},it=new WeakMap,U=new WeakMap,Z=function(r){if(t(this,S)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,f).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},Vt=function(...r){r.forEach(e=>{e&&t(this,n).classList.remove(e)})},Ft=function(...r){r.forEach(e=>{e&&t(this,n).style.removeProperty(`--${e}`)})},lt=function(){o(this,h,Vt).call(this,t(this,d).current,t(this,y).current,t(this,v).current,t(this,g).current,t(this,A).current,t(this,p).current),o(this,h,Ft).call(this,t(this,z).current,t(this,O).current,t(this,q).current,t(this,x).current,t(this,D).current)},dt);Rt.isBrowser&&!customElements.get("scroll-segment")&&customElements.define("scroll-segment",mt);exports.ScrollSegmentDefaultContainer=ut;exports.ScrollSegmentElement=mt;
|
|
@@ -16,7 +16,7 @@ import { s as Dt } from "../math-BOBiC4TN.js";
|
|
|
16
16
|
import { S as tt } from "../Store-D2xCXENW.js";
|
|
17
17
|
import { scrollEntries as Tt } from "../scroll-entries/index.js";
|
|
18
18
|
import "../ticker/index.js";
|
|
19
|
-
import { D as xt } from "../Damped-
|
|
19
|
+
import { D as xt } from "../Damped-BXsGpI-B.js";
|
|
20
20
|
var F, ht, st, q;
|
|
21
21
|
class ft {
|
|
22
22
|
constructor(c) {
|
package/lib/utils/gestures.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function setupDrag(onMove: (moveEvent: PointerEvent) => void, onDrop?: () => void): void;
|
|
1
|
+
export declare function setupDrag(onMove: (moveEvent: PointerEvent) => void, onDrop?: (e: PointerEvent | TouchEvent) => void): void;
|
package/lib/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../attributes-Bf2svn4j.cjs"),y=require("../index-Cqw2NKev.cjs"),d=require("../canvas-CU5Xjahf.cjs"),g=require("../coordinates-D8Np3cPD.cjs"),p=require("../dom-JBOkFLTh.cjs"),r=require("../easings-GegIwET5.cjs"),q=require("../events-KVanG9sR.cjs"),C=require("../file-DSpfWdd9.cjs"),I=require("../function-MthRj-GJ.cjs"),w=require("../gestures-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../attributes-Bf2svn4j.cjs"),y=require("../index-Cqw2NKev.cjs"),d=require("../canvas-CU5Xjahf.cjs"),g=require("../coordinates-D8Np3cPD.cjs"),p=require("../dom-JBOkFLTh.cjs"),r=require("../easings-GegIwET5.cjs"),q=require("../events-KVanG9sR.cjs"),C=require("../file-DSpfWdd9.cjs"),I=require("../function-MthRj-GJ.cjs"),w=require("../gestures-C7gbKx11.cjs"),O=require("../jss-BXAMRO12.cjs"),m=require("../layout-Ctc2p3uz.cjs"),i=require("../math-GDWEqu7y.cjs"),f=require("../number-0243DApo.cjs"),c=require("../object-CCiXnER2.cjs"),T=require("../polyfills-Df4r-ETT.cjs"),Q=require("../scroll-H9zqFeML.cjs"),l=require("../string-DhgS_iFl.cjs"),S=require("../style-At6aDoqG.cjs"),u=require("../url-CLvdjbII.cjs");function B(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function D(t,e){const n=t.length;e=e%n;const o=new Array(n);for(let s=0;s<n;s++){const a=(s+e)%n;o[a]=t[s]}return o}function A(t,e=2){if(!+t)return"0 Bytes";const n=1024,o=e<0?0:e,s=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],a=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,a)).toFixed(o))} ${s[a]}`}function R(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(e=>{console.error("Failed to copy text to clipboard:",e)});else{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.top="0",e.style.left="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(n){console.error("Failed to copy text to clipboard:",n)}document.body.removeChild(e)}}function N(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function z(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function x(t,e){const n=t.style.getPropertyValue(e);if(n){const o=n.toString();return o.startsWith("var")?x(t,o.slice(4,-1)):o}}function M(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(o=>{o instanceof CSSStyleRule&&o.selectorText===":root"&&t.forEach(s=>{const a=x(o,s);a&&(e[s]=a)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function j(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function k(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function V(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}function U(t,e){if(t){const o=t.content.cloneNode(!0).firstElementChild;return o&&(e==null||e(o)),o}return null}function F(t,e,n,o){let s,a=!1,b=0;const v=()=>{clearInterval(s),o!=null&&o.restartCounter&&(b=0),a&&(s=setInterval(()=>{n(b++)},e))},E=y.intersector.subscribe(t,P=>{a=P.isIntersecting,v()});return()=>{E(),clearInterval(s)}}exports.parseAttribute=h.parseAttribute;exports.parseAttributeValue=h.parseAttributeValue;exports.isBrowser=y.isBrowser;exports.contain=d.contain;exports.cover=d.cover;exports.fixPosition=d.fixPosition;exports.measureText=d.measureText;exports.getPointerPosition=g.getPointerPosition;exports.normalize=g.normalize;exports.screenToCartesian=g.screenToCartesian;exports.findParentElement=p.findParentElement;exports.findScrollParentElement=p.findScrollParentElement;exports.getAllParentElements=p.getAllParentElements;exports.getElement=p.getElement;exports.easeInCubic=r.easeInCubic;exports.easeInExpo=r.easeInExpo;exports.easeInOutCubic=r.easeInOutCubic;exports.easeInOutExpo=r.easeInOutExpo;exports.easeInOutQuad=r.easeInOutQuad;exports.easeInOutQuart=r.easeInOutQuart;exports.easeInOutQuint=r.easeInOutQuint;exports.easeInQuad=r.easeInQuad;exports.easeInQuart=r.easeInQuart;exports.easeInQuint=r.easeInQuint;exports.easeOutCubic=r.easeOutCubic;exports.easeOutExpo=r.easeOutExpo;exports.easeOutQuad=r.easeOutQuad;exports.easeOutQuart=r.easeOutQuart;exports.easeOutQuint=r.easeOutQuint;exports.linear=r.linear;exports.dispatchEvent=q.dispatchEvent;exports.createJSONAndSave=C.createJSONAndSave;exports.downloadURI=C.downloadURI;exports.debounce=I.debounce;exports.throttle=I.throttle;exports.setupDrag=w.setupDrag;exports.createStylesheet=O.createStylesheet;exports.styleToString=O.styleToString;exports.getCumulativeOffsetLeft=m.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=m.getCumulativeOffsetTop;exports.getCumulativePosition=m.getCumulativePosition;exports.getStickyOffset=m.getStickyOffset;exports.calculateDistance=i.calculateDistance;exports.calculateDistanceWithRadius=i.calculateDistanceWithRadius;exports.clamp=i.clamp;exports.damp=i.damp;exports.lerp=i.lerp;exports.mapRange=i.mapRange;exports.round=i.round;exports.smootherstep=i.smootherstep;exports.smoothstep=i.smoothstep;exports.step=i.step;exports.loopNumber=f.loopNumber;exports.preciseNumber=f.preciseNumber;exports.roundNumberTo=f.roundNumberTo;exports.toStep=f.toStep;exports.cloneDeep=c.cloneDeep;exports.compareObjects=c.compareObjects;exports.isESClass=c.isESClass;exports.isNullish=c.isNullish;exports.isObject=c.isObject;exports.mergeDeep=c.mergeDeep;exports.mixin=c.mixin;exports.omit=c.omit;exports.pick=c.pick;exports.nullishCoalescing=T.nullishCoalescing;exports.requestIdleCallback=T.requestIdleCallback;exports.scrollToElement=Q.scrollToElement;exports.camelToKebab=l.camelToKebab;exports.capitalize=l.capitalize;exports.generateId=l.generateId;exports.isUppercase=l.isUppercase;exports.kebabToCamel=l.kebabToCamel;exports.snakeToDotted=l.snakeToDotted;exports.toPascalCase=l.toPascalCase;exports.uncapitalize=l.uncapitalize;exports.getElementTransitionDurationMS=S.getElementTransitionDurationMS;exports.getElementTransitionDurationS=S.getElementTransitionDurationS;exports.changeHistory=u.changeHistory;exports.normalizeBase=u.normalizeBase;exports.parseSearchParameters=u.parseSearchParameters;exports.splitPath=u.splitPath;exports.updateSearchParameter=u.updateSearchParameter;exports.cloneTemplateContent=U;exports.copyTextToClipboard=R;exports.decode=k;exports.dotCircleCollision=z;exports.dotRectCollision=N;exports.encode=j;exports.formatBytes=A;exports.getRootVariables=M;exports.insert=B;exports.setIntervalOnIntersection=F;exports.shiftArray=D;exports.wait=V;
|
package/lib/utils/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { f as G, p as H, h as J, a as L, d as Y, k as Z, o as X, b as _, i as ee
|
|
|
8
8
|
import { d as le } from "../events-CsVF98U6.js";
|
|
9
9
|
import { c as fe, d as pe } from "../file-GHShUlue.js";
|
|
10
10
|
import { d as me, t as xe } from "../function-C10DGppn.js";
|
|
11
|
-
import { s as be } from "../gestures-
|
|
11
|
+
import { s as be } from "../gestures-CcXV6fCp.js";
|
|
12
12
|
import { c as ye, s as Ce } from "../jss-Chm3yE5y.js";
|
|
13
13
|
import { g as ve, a as Te, b as Se, c as we } from "../layout-DpZo-I0y.js";
|
|
14
14
|
import { e as Oe, f as Pe, c as Be, d as Ae, l as Qe, m as Re, r as De, b as Me, a as Ne, s as ze } from "../math-BOBiC4TN.js";
|
package/package.json
CHANGED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
var I = (e) => {
|
|
2
|
-
throw TypeError(e);
|
|
3
|
-
};
|
|
4
|
-
var S = (e, r, t) => r.has(e) || I("Cannot " + t);
|
|
5
|
-
var i = (e, r, t) => (S(e, r, "read from private field"), t ? t.call(e) : r.get(e)), a = (e, r, t) => r.has(e) ? I("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, t), h = (e, r, t, u) => (S(e, r, "write to private field"), u ? u.call(e, t) : r.set(e, t), t), P = (e, r, t) => (S(e, r, "access private method"), t);
|
|
6
|
-
import { S as q } from "./Store-D2xCXENW.js";
|
|
7
|
-
import { c as y } from "./math-BOBiC4TN.js";
|
|
8
|
-
import { p as z } from "./number-DwCxt_Ck.js";
|
|
9
|
-
import { n as F } from "./polyfills-DJrTJQky.js";
|
|
10
|
-
import "./index-euf5anj6.js";
|
|
11
|
-
import { ticker as O } from "./ticker/index.js";
|
|
12
|
-
import { TICK_ORDER as N } from "./order/index.js";
|
|
13
|
-
var f, d, A, l, b, s, n, m, c, g, M, R, x;
|
|
14
|
-
class V extends q {
|
|
15
|
-
constructor(t, u) {
|
|
16
|
-
super(t || 0, u);
|
|
17
|
-
a(this, M);
|
|
18
|
-
a(this, f);
|
|
19
|
-
a(this, d, N.ANIMATION);
|
|
20
|
-
a(this, A);
|
|
21
|
-
a(this, l, new q(!1));
|
|
22
|
-
a(this, b, 0);
|
|
23
|
-
a(this, s, 0);
|
|
24
|
-
a(this, n, -1 / 0);
|
|
25
|
-
a(this, m, 1 / 0);
|
|
26
|
-
a(this, c, 0);
|
|
27
|
-
a(this, g, null);
|
|
28
|
-
a(this, x, (t) => {
|
|
29
|
-
this.handleAnimationFrame(t);
|
|
30
|
-
});
|
|
31
|
-
h(this, s, this.current);
|
|
32
|
-
}
|
|
33
|
-
get direction() {
|
|
34
|
-
return i(this, b);
|
|
35
|
-
}
|
|
36
|
-
get target() {
|
|
37
|
-
return i(this, s);
|
|
38
|
-
}
|
|
39
|
-
get min() {
|
|
40
|
-
return i(this, n);
|
|
41
|
-
}
|
|
42
|
-
set min(t) {
|
|
43
|
-
h(this, n, t), this.set(i(this, s), {
|
|
44
|
-
equalize: !0
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
get max() {
|
|
48
|
-
return i(this, m);
|
|
49
|
-
}
|
|
50
|
-
set max(t) {
|
|
51
|
-
h(this, m, t), this.set(i(this, s), {
|
|
52
|
-
equalize: !0
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
get from() {
|
|
56
|
-
return i(this, c);
|
|
57
|
-
}
|
|
58
|
-
get isRunning() {
|
|
59
|
-
return i(this, l);
|
|
60
|
-
}
|
|
61
|
-
get delta() {
|
|
62
|
-
return Math.abs(i(this, s) - i(this, c));
|
|
63
|
-
}
|
|
64
|
-
get deltaProgress() {
|
|
65
|
-
return this.delta ? z(Math.abs(this.current - i(this, c)) / this.delta, 6) : 0;
|
|
66
|
-
}
|
|
67
|
-
get distance() {
|
|
68
|
-
return Math.abs(i(this, m) - i(this, n));
|
|
69
|
-
}
|
|
70
|
-
get distanceProgress() {
|
|
71
|
-
return this.distance ? z(Math.abs(this.current - i(this, n)) / this.distance, 6) : 0;
|
|
72
|
-
}
|
|
73
|
-
set(t, u) {
|
|
74
|
-
(i(this, s) !== t || u != null && u.restart) && (h(this, g, t), this.updateOptions(u), h(this, g, null), i(this, s) !== this.current && this.start());
|
|
75
|
-
}
|
|
76
|
-
shift(t, u) {
|
|
77
|
-
this.set(i(this, s) + t, u);
|
|
78
|
-
}
|
|
79
|
-
reset() {
|
|
80
|
-
super.reset(), this.set(this.initial, { equalize: !0 });
|
|
81
|
-
}
|
|
82
|
-
close() {
|
|
83
|
-
super.close(), this.reset(), this.unlistenAnimationFrame();
|
|
84
|
-
}
|
|
85
|
-
listenAnimationFrame() {
|
|
86
|
-
i(this, l).current || (i(this, l).current = !0, O.subscribe(i(this, x), {
|
|
87
|
-
maxFPS: i(this, f),
|
|
88
|
-
order: i(this, d),
|
|
89
|
-
culling: i(this, A)
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
92
|
-
unlistenAnimationFrame() {
|
|
93
|
-
i(this, l).current && (i(this, l).current = !1, O.unsubscribe(i(this, x)));
|
|
94
|
-
}
|
|
95
|
-
updateOptions(t) {
|
|
96
|
-
h(this, f, F(t == null ? void 0 : t.maxFPS, i(this, f))), h(this, d, F(t == null ? void 0 : t.order, i(this, d))), h(this, A, F(t == null ? void 0 : t.culling, i(this, A))), h(this, n, F(t == null ? void 0 : t.min, i(this, n))), h(this, m, F(t == null ? void 0 : t.max, i(this, m))), P(this, M, R).call(this, typeof i(this, g) == "number" ? i(this, g) : i(this, s)), t != null && t.equalize && (this.unlistenAnimationFrame(), this.current = i(this, s)), t != null && t.restart && (this.unlistenAnimationFrame(), this.current = this.initial);
|
|
97
|
-
}
|
|
98
|
-
start() {
|
|
99
|
-
this.listenAnimationFrame();
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
f = new WeakMap(), d = new WeakMap(), A = new WeakMap(), l = new WeakMap(), b = new WeakMap(), s = new WeakMap(), n = new WeakMap(), m = new WeakMap(), c = new WeakMap(), g = new WeakMap(), M = new WeakSet(), R = function(t) {
|
|
103
|
-
h(this, b, Math.sign(t - i(this, s))), h(this, s, y(t, i(this, n), i(this, m))), h(this, c, this.current);
|
|
104
|
-
}, x = new WeakMap();
|
|
105
|
-
export {
|
|
106
|
-
V as A
|
|
107
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var C=i=>{throw TypeError(i)};var S=(i,r,t)=>r.has(i)||C("Cannot "+t);var e=(i,r,t)=>(S(i,r,"read from private field"),t?t.call(i):r.get(i)),a=(i,r,t)=>r.has(i)?C("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,t),h=(i,r,t,n)=>(S(i,r,"write to private field"),n?n.call(i,t):r.set(i,t),t),M=(i,r,t)=>(S(i,r,"access private method"),t);const I=require("./Store-DRp_K37w.cjs"),N=require("./math-GDWEqu7y.cjs"),P=require("./number-0243DApo.cjs"),q=require("./polyfills-Df4r-ETT.cjs");require("./index-Cqw2NKev.cjs");const y=require("./ticker/index.cjs"),O=require("./order/index.cjs");var d,f,b,c,A,s,u,l,m,g,x,z,F;class R extends I.Store{constructor(t,n){super(t||0,n);a(this,x);a(this,d);a(this,f,O.TICK_ORDER.ANIMATION);a(this,b);a(this,c,new I.Store(!1));a(this,A,0);a(this,s,0);a(this,u,-1/0);a(this,l,1/0);a(this,m,0);a(this,g,null);a(this,F,t=>{this.handleAnimationFrame(t)});h(this,s,this.current)}get direction(){return e(this,A)}get target(){return e(this,s)}get min(){return e(this,u)}set min(t){h(this,u,t),this.set(e(this,s),{equalize:!0})}get max(){return e(this,l)}set max(t){h(this,l,t),this.set(e(this,s),{equalize:!0})}get from(){return e(this,m)}get isRunning(){return e(this,c)}get delta(){return Math.abs(e(this,s)-e(this,m))}get deltaProgress(){return this.delta?P.preciseNumber(Math.abs(this.current-e(this,m))/this.delta,6):0}get distance(){return Math.abs(e(this,l)-e(this,u))}get distanceProgress(){return this.distance?P.preciseNumber(Math.abs(this.current-e(this,u))/this.distance,6):0}set(t,n){(e(this,s)!==t||n!=null&&n.restart)&&(h(this,g,t),this.updateOptions(n),h(this,g,null),e(this,s)!==this.current&&this.start())}shift(t,n){this.set(e(this,s)+t,n)}reset(){super.reset(),this.set(this.initial,{equalize:!0})}close(){super.close(),this.reset(),this.unlistenAnimationFrame()}listenAnimationFrame(){e(this,c).current||(e(this,c).current=!0,y.ticker.subscribe(e(this,F),{maxFPS:e(this,d),order:e(this,f),culling:e(this,b)}))}unlistenAnimationFrame(){e(this,c).current&&(e(this,c).current=!1,y.ticker.unsubscribe(e(this,F)))}updateOptions(t){h(this,d,q.nullishCoalescing(t==null?void 0:t.maxFPS,e(this,d))),h(this,f,q.nullishCoalescing(t==null?void 0:t.order,e(this,f))),h(this,b,q.nullishCoalescing(t==null?void 0:t.culling,e(this,b))),h(this,u,q.nullishCoalescing(t==null?void 0:t.min,e(this,u))),h(this,l,q.nullishCoalescing(t==null?void 0:t.max,e(this,l))),M(this,x,z).call(this,typeof e(this,g)=="number"?e(this,g):e(this,s)),t!=null&&t.equalize&&(this.unlistenAnimationFrame(),this.current=e(this,s)),t!=null&&t.restart&&(this.unlistenAnimationFrame(),this.current=this.initial)}start(){this.listenAnimationFrame()}}d=new WeakMap,f=new WeakMap,b=new WeakMap,c=new WeakMap,A=new WeakMap,s=new WeakMap,u=new WeakMap,l=new WeakMap,m=new WeakMap,g=new WeakMap,x=new WeakSet,z=function(t){h(this,A,Math.sign(t-e(this,s))),h(this,s,N.clamp(t,e(this,u),e(this,l))),h(this,m,this.current)},F=new WeakMap;exports.Animation=R;
|
package/lib/gestures-D2Fdra_G.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function s(t, n) {
|
|
2
|
-
const r = (i) => {
|
|
3
|
-
t == null || t(i);
|
|
4
|
-
}, e = () => {
|
|
5
|
-
removeEventListener("pointermove", r), removeEventListener("pointerup", e), removeEventListener("touchend", e), n == null || n();
|
|
6
|
-
};
|
|
7
|
-
addEventListener("pointermove", r), addEventListener("pointerup", e), addEventListener("touchend", e);
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
s
|
|
11
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function s(t,n){const r=i=>{t==null||t(i)},e=()=>{removeEventListener("pointermove",r),removeEventListener("pointerup",e),removeEventListener("touchend",e),n==null||n()};addEventListener("pointermove",r),addEventListener("pointerup",e),addEventListener("touchend",e)}exports.setupDrag=s;
|