@ssgoi/core 2.5.4 → 2.5.6
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/dist/animator/animate/css-runner.d.ts +17 -0
- package/dist/animator/animate/css-runner.d.ts.map +1 -0
- package/dist/animator/animate/index.d.ts +42 -0
- package/dist/animator/animate/index.d.ts.map +1 -0
- package/dist/animator/animate/tick-runner.d.ts +16 -0
- package/dist/animator/animate/tick-runner.d.ts.map +1 -0
- package/dist/animator/animate/types.d.ts +31 -0
- package/dist/animator/animate/types.d.ts.map +1 -0
- package/dist/animator/animation-scheduler.d.ts +4 -17
- package/dist/animator/animation-scheduler.d.ts.map +1 -1
- package/dist/animator/index.d.ts +32 -32
- package/dist/animator/index.d.ts.map +1 -1
- package/dist/animator/spring-core.d.ts +63 -0
- package/dist/animator/spring-core.d.ts.map +1 -0
- package/dist/animator/ticker.d.ts +1 -0
- package/dist/animator/ticker.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +567 -608
- package/dist/jaemin-BG8HRXG1.cjs +1 -0
- package/dist/{jaemin-BAi8PTrj.js → jaemin-BWkrXq0V.js} +21 -20
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/create-swipe-detector.d.ts +1 -0
- package/dist/ssgoi-transition/create-swipe-detector.d.ts.map +1 -1
- package/dist/transition/create-transition-callback.d.ts +2 -2
- package/dist/transition/create-transition-callback.d.ts.map +1 -1
- package/dist/transition/transition-strategy.d.ts +16 -16
- package/dist/transition/transition-strategy.d.ts.map +1 -1
- package/dist/transition/transition.d.ts +2 -18
- package/dist/transition/transition.d.ts.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +74 -34
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +21 -6
- package/dist/view-transitions/drill.d.ts.map +1 -1
- package/dist/view-transitions/hero.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +7 -7
- package/dist/view-transitions/index.js +298 -284
- package/package.json +1 -1
- package/dist/animator/animate.d.ts +0 -35
- package/dist/animator/animate.d.ts.map +0 -1
- package/dist/jaemin-DL1-g_B5.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { isMultiSpring as
|
|
5
|
-
import { isSingleSpring as
|
|
6
|
-
import { j as
|
|
7
|
-
class
|
|
1
|
+
var $ = Object.defineProperty;
|
|
2
|
+
var j = (n, t, i) => t in n ? $(n, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[t] = i;
|
|
3
|
+
var p = (n, t, i) => j(n, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
+
import { isMultiSpring as M } from "./types.js";
|
|
5
|
+
import { isCssAnimation as vt, isSingleSpring as St, isTickAnimation as Ct, validateAnimationMode as Et } from "./types.js";
|
|
6
|
+
import { j as At } from "./jaemin-BWkrXq0V.js";
|
|
7
|
+
class B {
|
|
8
8
|
constructor() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
p(this, "listeners", /* @__PURE__ */ new Set());
|
|
10
|
+
p(this, "rafId", null);
|
|
11
|
+
p(this, "isRunning", !1);
|
|
12
12
|
// Timing
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
p(this, "startTime", Date.now());
|
|
14
|
+
p(this, "lastUpdate", this.startTime);
|
|
15
|
+
p(this, "elapsed", 0);
|
|
16
16
|
// Lag smoothing (mobile optimization)
|
|
17
|
-
|
|
17
|
+
p(this, "lagThreshold", 500);
|
|
18
18
|
// ms - detect tab switches, backgrounding
|
|
19
|
-
|
|
19
|
+
p(this, "adjustedLag", 33);
|
|
20
20
|
// ms - max time jump to prevent animation skip
|
|
21
|
+
p(this, "maxDeltaTime", 33);
|
|
22
|
+
// ms - clamp for physics stability (30fps minimum)
|
|
21
23
|
// FPS throttling
|
|
22
|
-
|
|
24
|
+
p(this, "gap", 1e3 / 240);
|
|
23
25
|
// max 240fps
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
p(this, "nextTime", this.gap);
|
|
27
|
+
p(this, "tick", () => {
|
|
26
28
|
const t = Date.now();
|
|
27
29
|
let e = t - this.lastUpdate;
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
const
|
|
32
|
-
this.elapsed =
|
|
33
|
-
s
|
|
30
|
+
e > this.lagThreshold || e < 0 ? (this.startTime += e - this.adjustedLag, e = this.adjustedLag) : e > this.maxDeltaTime && (e = this.maxDeltaTime), this.lastUpdate = t;
|
|
31
|
+
const o = t - this.startTime, r = o - this.nextTime;
|
|
32
|
+
if (r > 0) {
|
|
33
|
+
const s = e / 1e3;
|
|
34
|
+
this.elapsed = o / 1e3, this.nextTime += r + (r >= this.gap ? 4 : this.gap - r), this.listeners.forEach((a) => {
|
|
35
|
+
a(s, this.elapsed);
|
|
34
36
|
});
|
|
35
37
|
}
|
|
36
38
|
this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
|
|
@@ -49,8 +51,8 @@ class H {
|
|
|
49
51
|
* @param threshold - Time threshold to detect lag (default: 500ms)
|
|
50
52
|
* @param adjustedLag - Max time jump when lag detected (default: 33ms)
|
|
51
53
|
*/
|
|
52
|
-
lagSmoothing(t,
|
|
53
|
-
this.lagThreshold = t, this.adjustedLag = Math.min(
|
|
54
|
+
lagSmoothing(t, i) {
|
|
55
|
+
this.lagThreshold = t, this.adjustedLag = Math.min(i, t);
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* Set maximum FPS
|
|
@@ -66,189 +68,233 @@ class H {
|
|
|
66
68
|
return this.elapsed;
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
|
-
const I = new
|
|
70
|
-
function
|
|
71
|
+
const I = new B();
|
|
72
|
+
function z(n) {
|
|
73
|
+
const t = n.stiffness, i = n.damping, e = 1, o = Math.sqrt(t / e), r = i / (2 * Math.sqrt(t * e));
|
|
74
|
+
return { omega: o, zeta: r };
|
|
75
|
+
}
|
|
76
|
+
function H(n, t, i, e) {
|
|
77
|
+
const { omega: o, zeta: r } = i, { position: s, velocity: a } = n, c = Math.min(e, 0.033), m = -2 * c * r * o * a, h = c * o * o * (t - s), u = a + m + h;
|
|
78
|
+
return {
|
|
79
|
+
position: s + c * u,
|
|
80
|
+
velocity: u
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const K = 0.01, U = 0.01, N = 0.05;
|
|
84
|
+
function W(n, t) {
|
|
85
|
+
const i = Math.abs(t - n.position), e = Math.abs(n.velocity);
|
|
86
|
+
return i < K && e < U;
|
|
87
|
+
}
|
|
88
|
+
function q(n) {
|
|
71
89
|
const {
|
|
72
90
|
from: t,
|
|
73
|
-
to:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
onComplete: l
|
|
91
|
+
to: i,
|
|
92
|
+
spring: e,
|
|
93
|
+
velocity: o = 0,
|
|
94
|
+
onUpdate: r,
|
|
95
|
+
onComplete: s,
|
|
96
|
+
onStart: a
|
|
80
97
|
} = n;
|
|
81
|
-
let
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
98
|
+
let c = { position: t, velocity: o }, m = !0, h = 0, u = !1;
|
|
99
|
+
const g = z(e), l = (w) => {
|
|
100
|
+
if (m) {
|
|
101
|
+
if (u || (u = !0, a == null || a()), c = H(c, i, g, w), W(c, i)) {
|
|
102
|
+
if (h += Math.min(w, 0.033), h >= N) {
|
|
103
|
+
c = { position: i, velocity: 0 }, m = !1, r(c.position), I.unsubscribe(l), s();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
} else
|
|
107
|
+
h = 0;
|
|
108
|
+
r(c.position);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return I.subscribe(l), {
|
|
112
|
+
stop: () => {
|
|
113
|
+
m && (m = !1, I.unsubscribe(l));
|
|
114
|
+
},
|
|
115
|
+
getPosition: () => c.position,
|
|
116
|
+
getVelocity: () => c.velocity,
|
|
117
|
+
isRunning: () => m
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const x = 1e3 / 60;
|
|
121
|
+
function G(n, t, i, e = 0) {
|
|
122
|
+
const o = z(i), r = 600;
|
|
123
|
+
let s = { position: n, velocity: e }, a = 0;
|
|
124
|
+
const c = [];
|
|
125
|
+
for (let m = 0; m < r; m++) {
|
|
126
|
+
const h = m * x;
|
|
127
|
+
if (c.push({
|
|
128
|
+
time: h,
|
|
129
|
+
position: s.position,
|
|
130
|
+
velocity: s.velocity
|
|
131
|
+
}), s = H(s, t, o, x / 1e3), W(s, t)) {
|
|
132
|
+
if (a += x / 1e3, a >= N) {
|
|
133
|
+
c.push({
|
|
134
|
+
time: (m + 1) * x,
|
|
135
|
+
position: t,
|
|
136
|
+
velocity: 0
|
|
137
|
+
});
|
|
138
|
+
break;
|
|
93
139
|
}
|
|
94
140
|
} else
|
|
95
|
-
|
|
96
|
-
|
|
141
|
+
a = 0;
|
|
142
|
+
}
|
|
143
|
+
return c;
|
|
144
|
+
}
|
|
145
|
+
function D(n, t) {
|
|
146
|
+
if (n.length === 0)
|
|
147
|
+
return { position: 0, velocity: 0 };
|
|
148
|
+
const i = n[0], e = n[n.length - 1];
|
|
149
|
+
if (t <= 0)
|
|
150
|
+
return { position: i.position, velocity: i.velocity };
|
|
151
|
+
if (t >= e.time)
|
|
152
|
+
return { position: e.position, velocity: e.velocity };
|
|
153
|
+
let o = 0, r = n.length - 1;
|
|
154
|
+
for (; o < r - 1; ) {
|
|
155
|
+
const m = Math.floor((o + r) / 2);
|
|
156
|
+
n[m].time <= t ? o = m : r = m;
|
|
157
|
+
}
|
|
158
|
+
const s = n[o], a = n[r], c = (t - s.time) / (a.time - s.time);
|
|
159
|
+
return {
|
|
160
|
+
position: s.position + (a.position - s.position) * c,
|
|
161
|
+
velocity: s.velocity + (a.velocity - s.velocity) * c
|
|
97
162
|
};
|
|
98
|
-
|
|
163
|
+
}
|
|
164
|
+
function J(n, t) {
|
|
165
|
+
return n.map((i) => t(i.position));
|
|
166
|
+
}
|
|
167
|
+
function Q(n) {
|
|
168
|
+
const {
|
|
169
|
+
element: t,
|
|
170
|
+
from: i,
|
|
171
|
+
to: e,
|
|
172
|
+
spring: o,
|
|
173
|
+
velocity: r = 0,
|
|
174
|
+
style: s,
|
|
175
|
+
onComplete: a,
|
|
176
|
+
onStart: c
|
|
177
|
+
} = n, m = G(i, e, o, r);
|
|
178
|
+
if (m.length === 0)
|
|
179
|
+
return c == null || c(), a(), {
|
|
180
|
+
stop: () => {
|
|
181
|
+
},
|
|
182
|
+
getPosition: () => e,
|
|
183
|
+
getVelocity: () => 0,
|
|
184
|
+
isRunning: () => !1
|
|
185
|
+
};
|
|
186
|
+
const h = J(m, s), u = m[m.length - 1], g = u.time, l = t.animate(h, {
|
|
187
|
+
duration: g,
|
|
188
|
+
fill: "forwards",
|
|
189
|
+
easing: "linear"
|
|
190
|
+
// Spring physics already applied in keyframes
|
|
191
|
+
});
|
|
192
|
+
let w = !0;
|
|
193
|
+
const d = performance.now();
|
|
194
|
+
return c == null || c(), l.onfinish = () => {
|
|
195
|
+
w && (w = !1, a());
|
|
196
|
+
}, {
|
|
99
197
|
stop: () => {
|
|
100
|
-
|
|
101
|
-
}
|
|
198
|
+
w && (w = !1, l.cancel());
|
|
199
|
+
},
|
|
200
|
+
getPosition: () => {
|
|
201
|
+
if (!w)
|
|
202
|
+
return u.position;
|
|
203
|
+
const f = performance.now() - d;
|
|
204
|
+
return D(m, f).position;
|
|
205
|
+
},
|
|
206
|
+
getVelocity: () => {
|
|
207
|
+
if (!w)
|
|
208
|
+
return 0;
|
|
209
|
+
const f = performance.now() - d;
|
|
210
|
+
return D(m, f).velocity;
|
|
211
|
+
},
|
|
212
|
+
isRunning: () => w
|
|
102
213
|
};
|
|
103
214
|
}
|
|
104
|
-
|
|
215
|
+
function Z(n) {
|
|
216
|
+
const { from: t, to: i, spring: e, velocity: o, onComplete: r, onStart: s, tick: a, css: c } = n;
|
|
217
|
+
if (a && c)
|
|
218
|
+
throw new Error("Cannot use both 'tick' and 'css' options together");
|
|
219
|
+
return !a && !c ? (s == null || s(), r(), {
|
|
220
|
+
stop: () => {
|
|
221
|
+
},
|
|
222
|
+
getPosition: () => i,
|
|
223
|
+
getVelocity: () => 0,
|
|
224
|
+
isRunning: () => !1
|
|
225
|
+
}) : c ? Q({
|
|
226
|
+
element: c.element,
|
|
227
|
+
from: t,
|
|
228
|
+
to: i,
|
|
229
|
+
spring: e,
|
|
230
|
+
velocity: o,
|
|
231
|
+
style: c.style,
|
|
232
|
+
onComplete: r,
|
|
233
|
+
onStart: s
|
|
234
|
+
}) : q({
|
|
235
|
+
from: t,
|
|
236
|
+
to: i,
|
|
237
|
+
spring: e,
|
|
238
|
+
velocity: o,
|
|
239
|
+
onUpdate: a,
|
|
240
|
+
onComplete: r,
|
|
241
|
+
onStart: s
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
class k {
|
|
105
245
|
constructor(t) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
m(this, "completedAnimations", /* @__PURE__ */ new Set());
|
|
115
|
-
m(this, "updatedProperties", /* @__PURE__ */ new Set());
|
|
116
|
-
m(this, "animate", (t = !1) => {
|
|
117
|
-
!this.isAnimating && this.options.onStart && this.options.onStart(), this.isAnimating = !0;
|
|
118
|
-
const e = t ? this.options.from : this.options.to;
|
|
119
|
-
if (typeof this.currentValue == "object" && this.currentValue !== null) {
|
|
120
|
-
this.animateObject(e);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
let i = this.currentValue, o = performance.now();
|
|
124
|
-
const r = {
|
|
125
|
-
from: this.currentValue,
|
|
126
|
-
to: e,
|
|
127
|
-
stiffness: this.options.spring.stiffness,
|
|
128
|
-
damping: this.options.spring.damping,
|
|
129
|
-
mass: 1
|
|
130
|
-
};
|
|
131
|
-
typeof this.velocity == "number" && (r.velocity = this.velocity * 1e3), this.controls = k({
|
|
132
|
-
...r,
|
|
133
|
-
onUpdate: (s) => {
|
|
134
|
-
const d = performance.now(), l = (d - o) / 1e3;
|
|
135
|
-
if (l > 0) {
|
|
136
|
-
if (typeof s == "number" && typeof i == "number") {
|
|
137
|
-
const h = (s - i) / l;
|
|
138
|
-
this.velocity = h / 1e3;
|
|
139
|
-
} else if (typeof s == "object" && s !== null) {
|
|
140
|
-
const h = {};
|
|
141
|
-
Object.keys(s).forEach((u) => {
|
|
142
|
-
const a = s[u], p = i[u];
|
|
143
|
-
if (typeof a == "number" && typeof p == "number") {
|
|
144
|
-
const c = (a - p) / l;
|
|
145
|
-
h[u] = c / 1e3;
|
|
146
|
-
}
|
|
147
|
-
}), this.velocity = h;
|
|
148
|
-
}
|
|
149
|
-
i = s, o = d;
|
|
150
|
-
}
|
|
151
|
-
this.currentValue = s, this.options.onUpdate(s);
|
|
152
|
-
},
|
|
153
|
-
onComplete: () => {
|
|
154
|
-
this.currentValue = e, this.isAnimating = !1, this.controls = null, typeof this.velocity == "object" && this.velocity !== null ? Object.keys(this.velocity).forEach((s) => {
|
|
155
|
-
this.velocity[s] = 0;
|
|
156
|
-
}) : this.velocity = 0, this.options.onComplete();
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
m(this, "animateObject", (t) => {
|
|
161
|
-
const e = this.currentValue, i = Object.keys(e);
|
|
162
|
-
this.animationMap = /* @__PURE__ */ new Map(), this.activeAnimations.clear(), this.completedAnimations.clear(), this.updatedProperties.clear();
|
|
163
|
-
const o = { ...e }, r = {};
|
|
164
|
-
let s = !1;
|
|
165
|
-
const d = () => {
|
|
166
|
-
const l = i.filter((u) => !this.completedAnimations.has(u));
|
|
167
|
-
if (l.every(
|
|
168
|
-
(u) => this.updatedProperties.has(u)
|
|
169
|
-
) && l.length > 0) {
|
|
170
|
-
if (typeof this.velocity == "object" && this.velocity) {
|
|
171
|
-
const u = performance.now();
|
|
172
|
-
Object.keys(o).forEach((a) => {
|
|
173
|
-
if (r[a]) {
|
|
174
|
-
const p = (u - r[a]) / 1e3, c = this.currentValue[a], g = o[a];
|
|
175
|
-
typeof c == "number" && typeof g == "number" && p > 0 && (this.velocity[a] = (g - c) / p / 1e3);
|
|
176
|
-
}
|
|
177
|
-
r[a] = u;
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
this.currentValue = { ...o }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !s && this.options.onStart && (s = !0, this.options.onStart());
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
i.forEach((l) => {
|
|
184
|
-
this.activeAnimations.add(l);
|
|
185
|
-
const h = {
|
|
186
|
-
from: e[l],
|
|
187
|
-
to: t[l],
|
|
188
|
-
stiffness: this.options.spring.stiffness,
|
|
189
|
-
damping: this.options.spring.damping,
|
|
190
|
-
mass: 1
|
|
191
|
-
};
|
|
192
|
-
typeof this.velocity == "object" && this.velocity && l in this.velocity && (h.velocity = this.velocity[l] * 1e3);
|
|
193
|
-
const u = k({
|
|
194
|
-
...h,
|
|
195
|
-
onUpdate: (a) => {
|
|
196
|
-
o[l] = a, this.updatedProperties.add(l), d();
|
|
197
|
-
},
|
|
198
|
-
onComplete: () => {
|
|
199
|
-
this.completedAnimations.add(l), this.updatedProperties.delete(l), this.completedAnimations.size === i.length && (this.currentValue = t, this.isAnimating = !1, this.animationMap = null, typeof this.velocity == "object" && this.velocity && Object.keys(this.velocity).forEach((a) => {
|
|
200
|
-
this.velocity[a] = 0;
|
|
201
|
-
}), this.options.onComplete());
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
this.animationMap.set(l, u);
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
if (this.options = {
|
|
246
|
+
p(this, "options");
|
|
247
|
+
p(this, "controls", null);
|
|
248
|
+
p(this, "isAnimating", !1);
|
|
249
|
+
p(this, "currentValue");
|
|
250
|
+
p(this, "currentVelocity", 0);
|
|
251
|
+
if (t.tick && t.css)
|
|
252
|
+
throw new Error("Cannot use both 'tick' and 'css' options together");
|
|
253
|
+
this.options = {
|
|
208
254
|
from: t.from ?? 0,
|
|
209
255
|
to: t.to ?? 1,
|
|
210
|
-
spring: t.spring ?? { stiffness:
|
|
211
|
-
|
|
212
|
-
|
|
256
|
+
spring: t.spring ?? { stiffness: 300, damping: 30 },
|
|
257
|
+
tick: t.tick,
|
|
258
|
+
css: t.css,
|
|
213
259
|
onComplete: t.onComplete ?? (() => {
|
|
214
260
|
}),
|
|
215
261
|
onStart: t.onStart
|
|
216
|
-
}, this.currentValue = this.options.from
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
this.
|
|
262
|
+
}, this.currentValue = this.options.from;
|
|
263
|
+
}
|
|
264
|
+
runAnimation(t) {
|
|
265
|
+
this.isAnimating = !0, this.controls = Z({
|
|
266
|
+
from: this.currentValue,
|
|
267
|
+
to: t,
|
|
268
|
+
spring: this.options.spring,
|
|
269
|
+
velocity: this.currentVelocity,
|
|
270
|
+
tick: this.options.tick,
|
|
271
|
+
css: this.options.css,
|
|
272
|
+
onStart: this.options.onStart,
|
|
273
|
+
onComplete: () => {
|
|
274
|
+
this.currentValue = t, this.currentVelocity = 0, this.isAnimating = !1, this.controls = null, this.options.onComplete();
|
|
275
|
+
}
|
|
276
|
+
});
|
|
223
277
|
}
|
|
224
|
-
// Animation control methods
|
|
225
278
|
forward() {
|
|
226
|
-
this.stop(), this.
|
|
279
|
+
this.stop(), this.runAnimation(this.options.to);
|
|
227
280
|
}
|
|
228
281
|
backward() {
|
|
229
|
-
this.stop(), this.
|
|
282
|
+
this.stop(), this.runAnimation(this.options.from);
|
|
230
283
|
}
|
|
231
284
|
reverse() {
|
|
232
285
|
const t = this.options.from;
|
|
233
|
-
|
|
234
|
-
const e = this.shouldReverse();
|
|
235
|
-
this.stop(), this.animate(!e);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
shouldReverse() {
|
|
239
|
-
return typeof this.currentValue == "number" && typeof this.options.from == "number" && typeof this.options.to == "number" ? this.currentValue > (this.options.from + this.options.to) / 2 : !1;
|
|
286
|
+
this.options.from = this.options.to, this.options.to = t, this.isAnimating && (this.stop(), this.runAnimation(this.options.to));
|
|
240
287
|
}
|
|
241
288
|
stop() {
|
|
242
|
-
this.
|
|
243
|
-
t.stop();
|
|
244
|
-
}), this.animationMap.clear(), this.animationMap = null), this.updatedProperties.clear();
|
|
289
|
+
this.controls && (this.currentValue = this.controls.getPosition(), this.currentVelocity = this.controls.getVelocity(), this.controls.stop(), this.controls = null), this.isAnimating = !1;
|
|
245
290
|
}
|
|
246
|
-
// State getters
|
|
247
291
|
getVelocity() {
|
|
248
|
-
|
|
292
|
+
var t;
|
|
293
|
+
return ((t = this.controls) == null ? void 0 : t.getVelocity()) ?? this.currentVelocity;
|
|
249
294
|
}
|
|
250
295
|
getCurrentValue() {
|
|
251
|
-
|
|
296
|
+
var t;
|
|
297
|
+
return ((t = this.controls) == null ? void 0 : t.getPosition()) ?? this.currentValue;
|
|
252
298
|
}
|
|
253
299
|
getIsAnimating() {
|
|
254
300
|
return this.isAnimating;
|
|
@@ -256,42 +302,36 @@ class O {
|
|
|
256
302
|
getCurrentState() {
|
|
257
303
|
return {
|
|
258
304
|
type: "single",
|
|
259
|
-
position: this.
|
|
260
|
-
velocity: this.
|
|
305
|
+
position: this.getCurrentValue(),
|
|
306
|
+
velocity: this.getVelocity(),
|
|
261
307
|
from: this.options.from,
|
|
262
308
|
to: this.options.to
|
|
263
309
|
};
|
|
264
310
|
}
|
|
265
|
-
// State setters
|
|
266
|
-
setVelocity(t) {
|
|
267
|
-
this.velocity = t;
|
|
268
|
-
}
|
|
269
311
|
setValue(t) {
|
|
270
312
|
this.currentValue = t;
|
|
271
313
|
}
|
|
272
|
-
|
|
314
|
+
setVelocity(t) {
|
|
315
|
+
this.currentVelocity = t;
|
|
316
|
+
}
|
|
273
317
|
updateOptions(t) {
|
|
274
|
-
|
|
275
|
-
const e = this.shouldReverse();
|
|
276
|
-
this.stop(), this.animate(!e);
|
|
277
|
-
}
|
|
318
|
+
this.options = { ...this.options, ...t };
|
|
278
319
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return i.setValue(t.position), i.setVelocity(t.velocity), i;
|
|
320
|
+
static fromState(t, i) {
|
|
321
|
+
const e = new k(i);
|
|
322
|
+
return e.setValue(t.position), e.setVelocity(t.velocity), e;
|
|
283
323
|
}
|
|
284
324
|
}
|
|
285
|
-
class
|
|
325
|
+
class L {
|
|
286
326
|
constructor(t) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
327
|
+
p(this, "config");
|
|
328
|
+
p(this, "animators", /* @__PURE__ */ new Map());
|
|
329
|
+
p(this, "springOrder", []);
|
|
330
|
+
p(this, "completedCount", 0);
|
|
331
|
+
p(this, "completedAnimators", /* @__PURE__ */ new Set());
|
|
332
|
+
p(this, "direction", "forward");
|
|
333
|
+
p(this, "idCounter", 0);
|
|
334
|
+
p(this, "timeoutIds", []);
|
|
295
335
|
this.config = t, this.initializeAnimators();
|
|
296
336
|
}
|
|
297
337
|
generateId() {
|
|
@@ -299,168 +339,102 @@ class j {
|
|
|
299
339
|
}
|
|
300
340
|
initializeAnimators() {
|
|
301
341
|
this.config.springs.forEach((t) => {
|
|
302
|
-
const
|
|
342
|
+
const i = this.generateId(), e = new k({
|
|
303
343
|
from: t.from,
|
|
304
344
|
to: t.to,
|
|
305
345
|
spring: t.spring,
|
|
306
|
-
|
|
307
|
-
onComplete: () => this.onAnimatorComplete(
|
|
346
|
+
tick: t.tick,
|
|
347
|
+
onComplete: () => this.onAnimatorComplete(i),
|
|
308
348
|
onStart: t.onStart
|
|
309
349
|
});
|
|
310
|
-
this.animators.set(
|
|
311
|
-
id:
|
|
350
|
+
this.animators.set(i, {
|
|
351
|
+
id: i,
|
|
312
352
|
item: t,
|
|
313
|
-
animator:
|
|
353
|
+
animator: e,
|
|
314
354
|
startTime: null
|
|
315
|
-
}), this.springOrder.push(
|
|
355
|
+
}), this.springOrder.push(i);
|
|
316
356
|
});
|
|
317
357
|
}
|
|
318
|
-
/**
|
|
319
|
-
* Normalize schedule configuration to unified internal representation
|
|
320
|
-
* Uses discriminated union and early return pattern
|
|
321
|
-
*
|
|
322
|
-
* @param direction - "forward" or "backward" direction
|
|
323
|
-
*/
|
|
324
358
|
normalizeSchedule(t) {
|
|
325
|
-
const
|
|
326
|
-
return this.springOrder.map((
|
|
327
|
-
const r = this.animators.get(
|
|
359
|
+
const i = this.config.schedule ?? "overlap";
|
|
360
|
+
return this.springOrder.map((e, o) => {
|
|
361
|
+
const r = this.animators.get(e);
|
|
328
362
|
if (!r)
|
|
329
363
|
throw new Error(
|
|
330
|
-
`AnimationScheduler: animator with id "${
|
|
364
|
+
`AnimationScheduler: animator with id "${e}" not found`
|
|
331
365
|
);
|
|
332
|
-
if (
|
|
333
|
-
return {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
delay: 0
|
|
337
|
-
};
|
|
338
|
-
if (e === "wait")
|
|
339
|
-
return t === "forward" && o === 0 ? {
|
|
340
|
-
type: "offset",
|
|
341
|
-
id: i,
|
|
342
|
-
delay: 0
|
|
343
|
-
} : t === "backward" && o === this.springOrder.length - 1 ? {
|
|
344
|
-
type: "offset",
|
|
345
|
-
id: i,
|
|
346
|
-
delay: 0
|
|
347
|
-
} : {
|
|
348
|
-
type: "wait",
|
|
349
|
-
id: i
|
|
350
|
-
};
|
|
366
|
+
if (i === "overlap")
|
|
367
|
+
return { type: "offset", id: e, delay: 0 };
|
|
368
|
+
if (i === "wait")
|
|
369
|
+
return t === "forward" && o === 0 ? { type: "offset", id: e, delay: 0 } : t === "backward" && o === this.springOrder.length - 1 ? { type: "offset", id: e, delay: 0 } : { type: "wait", id: e };
|
|
351
370
|
const s = r.item.offset ?? 0;
|
|
352
371
|
if (t === "forward")
|
|
353
|
-
return {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
delay: s
|
|
357
|
-
};
|
|
358
|
-
const d = this.animators.size === 0 ? 0 : Math.max(
|
|
359
|
-
...Array.from(this.animators.values()).map(
|
|
360
|
-
(l) => l.item.offset ?? 0
|
|
361
|
-
)
|
|
372
|
+
return { type: "offset", id: e, delay: s };
|
|
373
|
+
const a = Math.max(
|
|
374
|
+
...Array.from(this.animators.values()).map((c) => c.item.offset ?? 0)
|
|
362
375
|
);
|
|
363
|
-
return {
|
|
364
|
-
type: "offset",
|
|
365
|
-
id: i,
|
|
366
|
-
delay: d - s
|
|
367
|
-
};
|
|
376
|
+
return { type: "offset", id: e, delay: a - s };
|
|
368
377
|
});
|
|
369
378
|
}
|
|
370
379
|
onAnimatorComplete(t) {
|
|
371
|
-
var
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
console.warn(
|
|
375
|
-
`AnimationScheduler: animator with id "${t}" not found on completion`
|
|
376
|
-
);
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (i = e.item).onComplete) == null || o.call(i), (s = (r = this.config).onProgress) == null || s.call(r, this.completedCount, this.config.springs.length), this.handleWaitModeChaining(t), this.completedCount === this.config.springs.length && ((l = (d = this.config).onEnd) == null || l.call(d)));
|
|
380
|
+
var e, o, r, s, a, c;
|
|
381
|
+
const i = this.animators.get(t);
|
|
382
|
+
!i || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (e = i.item).onComplete) == null || o.call(e), (s = (r = this.config).onProgress) == null || s.call(r, this.completedCount, this.config.springs.length), this.handleWaitModeChaining(t), this.completedCount === this.config.springs.length && ((c = (a = this.config).onEnd) == null || c.call(a)));
|
|
380
383
|
}
|
|
381
|
-
/**
|
|
382
|
-
* Handle wait mode chaining: start next/previous spring after completion
|
|
383
|
-
*/
|
|
384
384
|
handleWaitModeChaining(t) {
|
|
385
385
|
if (this.config.schedule !== "wait")
|
|
386
386
|
return;
|
|
387
|
-
const
|
|
387
|
+
const i = this.springOrder.indexOf(t);
|
|
388
388
|
if (this.direction === "forward") {
|
|
389
|
-
const
|
|
390
|
-
if (
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
389
|
+
const e = this.springOrder[i + 1];
|
|
390
|
+
if (e) {
|
|
391
|
+
const o = this.animators.get(e);
|
|
392
|
+
o && o.startTime === null && this.startAnimator(e);
|
|
393
|
+
}
|
|
394
|
+
} else {
|
|
395
|
+
const e = this.springOrder[i - 1];
|
|
396
|
+
if (e) {
|
|
397
|
+
const o = this.animators.get(e);
|
|
398
|
+
o && o.startTime === null && this.startBackwardAnimator(e);
|
|
399
|
+
}
|
|
395
400
|
}
|
|
396
|
-
const i = this.springOrder[e - 1];
|
|
397
|
-
if (!i)
|
|
398
|
-
return;
|
|
399
|
-
const o = this.animators.get(i);
|
|
400
|
-
o && o.startTime === null && this.startBackwardAnimator(i);
|
|
401
401
|
}
|
|
402
402
|
startAnimator(t) {
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
console.warn(
|
|
406
|
-
`AnimationScheduler: animator with id "${t}" not found on start`
|
|
407
|
-
);
|
|
408
|
-
return;
|
|
409
|
-
}
|
|
410
|
-
if (e.startTime !== null) {
|
|
411
|
-
console.warn(
|
|
412
|
-
`AnimationScheduler: animator with id "${t}" already started`
|
|
413
|
-
);
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
e.startTime = Date.now(), e.animator.forward();
|
|
403
|
+
const i = this.animators.get(t);
|
|
404
|
+
!i || i.startTime !== null || (i.startTime = Date.now(), i.animator.forward());
|
|
417
405
|
}
|
|
418
406
|
startBackwardAnimator(t) {
|
|
419
|
-
const
|
|
420
|
-
|
|
421
|
-
console.warn(
|
|
422
|
-
`AnimationScheduler: animator with id "${t}" not found on backward start`
|
|
423
|
-
);
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
426
|
-
if (e.startTime !== null) {
|
|
427
|
-
console.warn(
|
|
428
|
-
`AnimationScheduler: animator with id "${t}" already started`
|
|
429
|
-
);
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
e.startTime = Date.now(), e.animator.backward();
|
|
407
|
+
const i = this.animators.get(t);
|
|
408
|
+
!i || i.startTime !== null || (i.startTime = Date.now(), i.animator.backward());
|
|
433
409
|
}
|
|
434
410
|
forward() {
|
|
435
|
-
var
|
|
436
|
-
this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), (
|
|
437
|
-
if (o.type
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
this.timeoutIds.push(r);
|
|
411
|
+
var i, e;
|
|
412
|
+
this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), (e = (i = this.config).onStart) == null || e.call(i), this.normalizeSchedule("forward").forEach((o) => {
|
|
413
|
+
if (o.type !== "wait")
|
|
414
|
+
if (o.delay === 0)
|
|
415
|
+
this.startAnimator(o.id);
|
|
416
|
+
else {
|
|
417
|
+
const r = window.setTimeout(
|
|
418
|
+
() => this.startAnimator(o.id),
|
|
419
|
+
o.delay
|
|
420
|
+
);
|
|
421
|
+
this.timeoutIds.push(r);
|
|
422
|
+
}
|
|
448
423
|
});
|
|
449
424
|
}
|
|
450
425
|
backward() {
|
|
451
|
-
var
|
|
452
|
-
this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), (
|
|
453
|
-
if (o.type
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
this.timeoutIds.push(r);
|
|
426
|
+
var i, e;
|
|
427
|
+
this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), (e = (i = this.config).onStart) == null || e.call(i), this.normalizeSchedule("backward").forEach((o) => {
|
|
428
|
+
if (o.type !== "wait")
|
|
429
|
+
if (o.delay === 0)
|
|
430
|
+
this.startBackwardAnimator(o.id);
|
|
431
|
+
else {
|
|
432
|
+
const r = window.setTimeout(
|
|
433
|
+
() => this.startBackwardAnimator(o.id),
|
|
434
|
+
o.delay
|
|
435
|
+
);
|
|
436
|
+
this.timeoutIds.push(r);
|
|
437
|
+
}
|
|
464
438
|
});
|
|
465
439
|
}
|
|
466
440
|
stop() {
|
|
@@ -468,34 +442,28 @@ class j {
|
|
|
468
442
|
t.animator.stop(), t.startTime = null;
|
|
469
443
|
});
|
|
470
444
|
}
|
|
471
|
-
reverse(
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
), this.direction = this.direction === "forward" ? "backward" : "forward", this.animators.forEach((i) => {
|
|
475
|
-
if (i.startTime === null)
|
|
445
|
+
reverse() {
|
|
446
|
+
this.direction = this.direction === "forward" ? "backward" : "forward", this.animators.forEach((t) => {
|
|
447
|
+
if (t.startTime === null)
|
|
476
448
|
return;
|
|
477
|
-
const
|
|
478
|
-
if (
|
|
449
|
+
const i = t.animator.getCurrentState();
|
|
450
|
+
if (i.type !== "single")
|
|
479
451
|
return;
|
|
480
|
-
if (
|
|
481
|
-
const
|
|
482
|
-
{
|
|
483
|
-
position: 1,
|
|
484
|
-
velocity: 0
|
|
485
|
-
},
|
|
452
|
+
if (i.position === i.to) {
|
|
453
|
+
const o = k.fromState(
|
|
454
|
+
{ position: 1, velocity: 0 },
|
|
486
455
|
{
|
|
487
|
-
from:
|
|
488
|
-
to:
|
|
489
|
-
spring:
|
|
490
|
-
|
|
491
|
-
onComplete: () => this.onAnimatorComplete(
|
|
492
|
-
onStart:
|
|
456
|
+
from: t.item.to ?? 1,
|
|
457
|
+
to: t.item.from ?? 0,
|
|
458
|
+
spring: t.item.spring,
|
|
459
|
+
tick: t.item.tick,
|
|
460
|
+
onComplete: () => this.onAnimatorComplete(t.id),
|
|
461
|
+
onStart: t.item.onStart
|
|
493
462
|
}
|
|
494
463
|
);
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
i.animator.reverse();
|
|
464
|
+
o.forward(), t.animator = o;
|
|
465
|
+
} else
|
|
466
|
+
t.animator.reverse();
|
|
499
467
|
});
|
|
500
468
|
}
|
|
501
469
|
getCurrentState() {
|
|
@@ -507,13 +475,13 @@ class j {
|
|
|
507
475
|
};
|
|
508
476
|
}
|
|
509
477
|
}
|
|
510
|
-
const
|
|
478
|
+
const X = Symbol.for("TRANSITION_STRATEGY"), tt = (n) => ({
|
|
511
479
|
runIn: async (t) => {
|
|
512
|
-
const { currentAnimation:
|
|
513
|
-
if (
|
|
514
|
-
const s =
|
|
515
|
-
if (
|
|
516
|
-
return
|
|
480
|
+
const { currentAnimation: i } = n;
|
|
481
|
+
if (i && i.direction === "out") {
|
|
482
|
+
const s = i.controller.getCurrentState();
|
|
483
|
+
if (i.controller.stop(), s.type === "multi")
|
|
484
|
+
return i.controller.reverse(), {
|
|
517
485
|
state: {
|
|
518
486
|
position: 0,
|
|
519
487
|
velocity: 0
|
|
@@ -523,24 +491,24 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
|
|
|
523
491
|
direction: "forward"
|
|
524
492
|
};
|
|
525
493
|
if (t.out) {
|
|
526
|
-
const
|
|
494
|
+
const a = await t.out, { from: c = 1, to: m = 0 } = a;
|
|
527
495
|
return {
|
|
528
|
-
config:
|
|
496
|
+
config: a,
|
|
529
497
|
state: {
|
|
530
498
|
position: s.position,
|
|
531
499
|
velocity: s.velocity
|
|
532
500
|
},
|
|
533
|
-
from:
|
|
501
|
+
from: c,
|
|
534
502
|
// OUT animation's from
|
|
535
|
-
to:
|
|
503
|
+
to: m,
|
|
536
504
|
// OUT animation's to
|
|
537
505
|
direction: "backward"
|
|
538
|
-
// Will actually go 0→1
|
|
506
|
+
// Will actually go 0→1 (backward means toward 'from')
|
|
539
507
|
};
|
|
540
508
|
}
|
|
541
509
|
}
|
|
542
|
-
const
|
|
543
|
-
if (!
|
|
510
|
+
const e = await t.in;
|
|
511
|
+
if (!e)
|
|
544
512
|
return {
|
|
545
513
|
state: {
|
|
546
514
|
position: 0,
|
|
@@ -550,9 +518,9 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
|
|
|
550
518
|
to: 1,
|
|
551
519
|
direction: "forward"
|
|
552
520
|
};
|
|
553
|
-
if ("springs" in
|
|
521
|
+
if ("springs" in e)
|
|
554
522
|
return {
|
|
555
|
-
config:
|
|
523
|
+
config: e,
|
|
556
524
|
state: {
|
|
557
525
|
position: 0,
|
|
558
526
|
velocity: 0
|
|
@@ -561,9 +529,9 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
|
|
|
561
529
|
to: 1,
|
|
562
530
|
direction: "forward"
|
|
563
531
|
};
|
|
564
|
-
const { from: o = 0, to: r = 1 } =
|
|
532
|
+
const { from: o = 0, to: r = 1 } = e;
|
|
565
533
|
return {
|
|
566
|
-
config:
|
|
534
|
+
config: e,
|
|
567
535
|
state: {
|
|
568
536
|
position: o,
|
|
569
537
|
velocity: 0
|
|
@@ -574,11 +542,11 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
|
|
|
574
542
|
};
|
|
575
543
|
},
|
|
576
544
|
runOut: async (t) => {
|
|
577
|
-
const { currentAnimation:
|
|
578
|
-
if (
|
|
579
|
-
const s =
|
|
580
|
-
if (
|
|
581
|
-
return
|
|
545
|
+
const { currentAnimation: i } = n;
|
|
546
|
+
if (i && i.direction === "in") {
|
|
547
|
+
const s = i.controller.getCurrentState();
|
|
548
|
+
if (i.controller.stop(), s.type === "multi")
|
|
549
|
+
return i.controller.reverse(), {
|
|
582
550
|
state: {
|
|
583
551
|
position: 1,
|
|
584
552
|
velocity: 0
|
|
@@ -588,24 +556,24 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
|
|
|
588
556
|
direction: "forward"
|
|
589
557
|
};
|
|
590
558
|
if (t.in) {
|
|
591
|
-
const
|
|
559
|
+
const a = await t.in, { from: c = 0, to: m = 1 } = a;
|
|
592
560
|
return {
|
|
593
|
-
config:
|
|
561
|
+
config: a,
|
|
594
562
|
state: {
|
|
595
563
|
position: s.position,
|
|
596
564
|
velocity: s.velocity
|
|
597
565
|
},
|
|
598
|
-
from:
|
|
566
|
+
from: c,
|
|
599
567
|
// IN animation's from
|
|
600
|
-
to:
|
|
568
|
+
to: m,
|
|
601
569
|
// IN animation's to
|
|
602
570
|
direction: "backward"
|
|
603
|
-
// Will actually go 1→0
|
|
571
|
+
// Will actually go 1→0 (backward means toward 'from')
|
|
604
572
|
};
|
|
605
573
|
}
|
|
606
574
|
}
|
|
607
|
-
const
|
|
608
|
-
if (!
|
|
575
|
+
const e = await t.out;
|
|
576
|
+
if (!e)
|
|
609
577
|
return {
|
|
610
578
|
state: {
|
|
611
579
|
position: 1,
|
|
@@ -615,9 +583,9 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
|
|
|
615
583
|
to: 0,
|
|
616
584
|
direction: "forward"
|
|
617
585
|
};
|
|
618
|
-
if ("springs" in
|
|
586
|
+
if ("springs" in e)
|
|
619
587
|
return {
|
|
620
|
-
config:
|
|
588
|
+
config: e,
|
|
621
589
|
state: {
|
|
622
590
|
position: 1,
|
|
623
591
|
velocity: 0
|
|
@@ -626,9 +594,9 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
|
|
|
626
594
|
to: 0,
|
|
627
595
|
direction: "forward"
|
|
628
596
|
};
|
|
629
|
-
const { from: o = 1, to: r = 0 } =
|
|
597
|
+
const { from: o = 1, to: r = 0 } = e;
|
|
630
598
|
return {
|
|
631
|
-
config:
|
|
599
|
+
config: e,
|
|
632
600
|
state: {
|
|
633
601
|
position: o,
|
|
634
602
|
velocity: 0
|
|
@@ -638,7 +606,7 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
|
|
|
638
606
|
direction: "forward"
|
|
639
607
|
};
|
|
640
608
|
}
|
|
641
|
-
}),
|
|
609
|
+
}), it = () => ({
|
|
642
610
|
runIn: async (n) => {
|
|
643
611
|
const t = await n.in;
|
|
644
612
|
if (!t)
|
|
@@ -662,15 +630,15 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
|
|
|
662
630
|
to: 1,
|
|
663
631
|
direction: "forward"
|
|
664
632
|
};
|
|
665
|
-
const { from:
|
|
633
|
+
const { from: i = 0, to: e = 1 } = t;
|
|
666
634
|
return {
|
|
667
635
|
config: t,
|
|
668
636
|
state: {
|
|
669
|
-
position:
|
|
637
|
+
position: i,
|
|
670
638
|
velocity: 0
|
|
671
639
|
},
|
|
672
|
-
from:
|
|
673
|
-
to:
|
|
640
|
+
from: i,
|
|
641
|
+
to: e,
|
|
674
642
|
direction: "forward"
|
|
675
643
|
};
|
|
676
644
|
},
|
|
@@ -697,385 +665,376 @@ const z = Symbol.for("TRANSITION_STRATEGY"), F = (n) => ({
|
|
|
697
665
|
to: 0,
|
|
698
666
|
direction: "forward"
|
|
699
667
|
};
|
|
700
|
-
const { from:
|
|
668
|
+
const { from: i = 1, to: e = 0 } = t;
|
|
701
669
|
return {
|
|
702
670
|
config: t,
|
|
703
671
|
state: {
|
|
704
|
-
position:
|
|
672
|
+
position: i,
|
|
705
673
|
velocity: 0
|
|
706
674
|
},
|
|
707
|
-
from:
|
|
708
|
-
to:
|
|
675
|
+
from: i,
|
|
676
|
+
to: e,
|
|
709
677
|
direction: "forward"
|
|
710
678
|
};
|
|
711
679
|
}
|
|
712
680
|
});
|
|
713
|
-
function
|
|
714
|
-
var
|
|
715
|
-
let
|
|
681
|
+
function et(n, t) {
|
|
682
|
+
var h;
|
|
683
|
+
let i = null, e = null, o = null, r = null;
|
|
716
684
|
const s = {
|
|
717
685
|
get currentAnimation() {
|
|
718
|
-
return
|
|
686
|
+
return i;
|
|
719
687
|
}
|
|
720
|
-
},
|
|
721
|
-
var S,
|
|
722
|
-
|
|
723
|
-
const
|
|
724
|
-
if (!
|
|
688
|
+
}, a = ((h = t == null ? void 0 : t.strategy) == null ? void 0 : h.call(t, s)) || tt(s), c = async (u) => {
|
|
689
|
+
var S, E, A;
|
|
690
|
+
e && (e.remove(), e = null);
|
|
691
|
+
const g = n(), l = g.in && await g.in(u), w = !(t != null && t.strategy) && g.out ? g.out(u) : void 0;
|
|
692
|
+
if (!l)
|
|
725
693
|
return;
|
|
726
|
-
if (
|
|
694
|
+
if (M(l)) {
|
|
727
695
|
const v = {
|
|
728
|
-
in: Promise.resolve(
|
|
729
|
-
out:
|
|
696
|
+
in: Promise.resolve(l),
|
|
697
|
+
out: w && Promise.resolve(w)
|
|
730
698
|
};
|
|
731
|
-
if (!(await
|
|
732
|
-
|
|
699
|
+
if (!(await a.runIn(v)).config) {
|
|
700
|
+
i && (i.direction = "in");
|
|
733
701
|
return;
|
|
734
702
|
}
|
|
735
|
-
(S =
|
|
736
|
-
const
|
|
737
|
-
...
|
|
703
|
+
(S = l.prepare) == null || S.call(l, u), l.wait && await l.wait();
|
|
704
|
+
const C = new L({
|
|
705
|
+
...l,
|
|
738
706
|
onEnd: () => {
|
|
739
|
-
var
|
|
740
|
-
|
|
707
|
+
var b;
|
|
708
|
+
i = null, (b = l.onEnd) == null || b.call(l);
|
|
741
709
|
}
|
|
742
710
|
});
|
|
743
|
-
|
|
744
|
-
controller: E,
|
|
745
|
-
direction: "in"
|
|
746
|
-
}, E.forward();
|
|
711
|
+
i = { controller: C, direction: "in" }, C.forward();
|
|
747
712
|
return;
|
|
748
713
|
}
|
|
749
|
-
const
|
|
750
|
-
in: Promise.resolve(
|
|
751
|
-
out:
|
|
752
|
-
}, f = await
|
|
753
|
-
if (!f.config)
|
|
754
|
-
return;
|
|
755
|
-
if ("springs" in f.config) {
|
|
756
|
-
console.error("Unexpected MultiSpringConfig in single-spring path");
|
|
714
|
+
const d = {
|
|
715
|
+
in: Promise.resolve(l),
|
|
716
|
+
out: w && Promise.resolve(w)
|
|
717
|
+
}, f = await a.runIn(d);
|
|
718
|
+
if (!f.config || "springs" in f.config)
|
|
757
719
|
return;
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
const y = O.fromState(f.state, {
|
|
720
|
+
(A = (E = f.config).prepare) == null || A.call(E, u), f.config.wait && await f.config.wait();
|
|
721
|
+
const y = k.fromState(f.state, {
|
|
761
722
|
from: f.from,
|
|
762
723
|
to: f.to,
|
|
763
724
|
spring: f.config.spring,
|
|
725
|
+
tick: f.config.tick,
|
|
726
|
+
css: f.config.css ? { element: u, style: f.config.css } : void 0,
|
|
764
727
|
onStart: f.config.onStart,
|
|
765
|
-
onUpdate: f.config.tick,
|
|
766
728
|
onComplete: () => {
|
|
767
|
-
var v,
|
|
768
|
-
|
|
729
|
+
var v, T;
|
|
730
|
+
i = null, (T = (v = f.config) == null ? void 0 : v.onEnd) == null || T.call(v);
|
|
769
731
|
}
|
|
770
732
|
});
|
|
771
|
-
|
|
772
|
-
},
|
|
773
|
-
var S,
|
|
774
|
-
|
|
775
|
-
const
|
|
776
|
-
if (!
|
|
733
|
+
i = { controller: y, direction: "in" }, f.direction === "forward" ? y.forward() : y.backward();
|
|
734
|
+
}, m = async (u) => {
|
|
735
|
+
var S, E, A;
|
|
736
|
+
e = u;
|
|
737
|
+
const g = n(), l = g.out && await g.out(u);
|
|
738
|
+
if (!l)
|
|
777
739
|
return;
|
|
778
|
-
if (
|
|
740
|
+
if (M(l)) {
|
|
779
741
|
const v = {
|
|
780
742
|
in: void 0,
|
|
781
|
-
|
|
782
|
-
out: Promise.resolve(c)
|
|
743
|
+
out: Promise.resolve(l)
|
|
783
744
|
};
|
|
784
|
-
if (!(await
|
|
785
|
-
|
|
745
|
+
if (!(await a.runOut(v)).config) {
|
|
746
|
+
i && (i.direction = "out"), e && (e.remove(), e = null);
|
|
786
747
|
return;
|
|
787
748
|
}
|
|
788
|
-
(S =
|
|
789
|
-
const
|
|
790
|
-
...
|
|
749
|
+
(S = l.prepare) == null || S.call(l, u), y(), l.wait && await l.wait();
|
|
750
|
+
const C = new L({
|
|
751
|
+
...l,
|
|
791
752
|
onEnd: () => {
|
|
792
|
-
var
|
|
793
|
-
(
|
|
753
|
+
var b, O;
|
|
754
|
+
(b = l.onEnd) == null || b.call(l), e && (e.remove(), e = null), i = null, (O = t == null ? void 0 : t.onCleanupEnd) == null || O.call(t);
|
|
794
755
|
}
|
|
795
756
|
});
|
|
796
|
-
|
|
797
|
-
controller: E,
|
|
798
|
-
direction: "out"
|
|
799
|
-
}, E.forward();
|
|
757
|
+
i = { controller: C, direction: "out" }, C.forward();
|
|
800
758
|
return;
|
|
801
759
|
}
|
|
802
|
-
const
|
|
760
|
+
const w = {
|
|
803
761
|
in: void 0,
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
if (!w.config)
|
|
762
|
+
out: Promise.resolve(l)
|
|
763
|
+
}, d = await a.runOut(w);
|
|
764
|
+
if (!d.config || "springs" in d.config)
|
|
808
765
|
return;
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
spring: w.config.spring,
|
|
818
|
-
onStart: w.config.onStart,
|
|
819
|
-
onUpdate: w.config.tick,
|
|
766
|
+
(A = (E = d.config).prepare) == null || A.call(E, u), y(), d.config.wait && await d.config.wait();
|
|
767
|
+
const f = k.fromState(d.state, {
|
|
768
|
+
from: d.from,
|
|
769
|
+
to: d.to,
|
|
770
|
+
spring: d.config.spring,
|
|
771
|
+
tick: d.config.tick,
|
|
772
|
+
css: d.config.css ? { element: u, style: d.config.css } : void 0,
|
|
773
|
+
onStart: d.config.onStart,
|
|
820
774
|
onComplete: () => {
|
|
821
|
-
var v,
|
|
822
|
-
(
|
|
775
|
+
var v, T, C;
|
|
776
|
+
(T = (v = d.config) == null ? void 0 : v.onEnd) == null || T.call(v), e && (e.remove(), e = null), i = null, (C = t == null ? void 0 : t.onCleanupEnd) == null || C.call(t);
|
|
823
777
|
}
|
|
824
778
|
});
|
|
825
|
-
|
|
779
|
+
i = { controller: f, direction: "out" }, d.direction === "forward" ? f.forward() : f.backward();
|
|
826
780
|
function y() {
|
|
827
|
-
!o || !
|
|
781
|
+
!o || !e || (r && o.contains(r) ? o.insertBefore(e, r) : o.appendChild(e));
|
|
828
782
|
}
|
|
829
783
|
};
|
|
830
|
-
return (
|
|
831
|
-
if (
|
|
832
|
-
return o =
|
|
833
|
-
if (
|
|
834
|
-
const
|
|
835
|
-
|
|
784
|
+
return (u) => {
|
|
785
|
+
if (u)
|
|
786
|
+
return o = u.parentElement, r = u.nextElementSibling, c(u), () => {
|
|
787
|
+
if (u.isConnected) {
|
|
788
|
+
const g = u.cloneNode(!0);
|
|
789
|
+
m(g);
|
|
836
790
|
} else
|
|
837
|
-
|
|
791
|
+
m(u);
|
|
838
792
|
};
|
|
839
793
|
};
|
|
840
794
|
}
|
|
841
|
-
const
|
|
795
|
+
const nt = 3, ot = (n) => {
|
|
842
796
|
if (!n) return null;
|
|
843
797
|
const t = n.split(`
|
|
844
|
-
`).map((
|
|
845
|
-
for (let
|
|
846
|
-
const
|
|
798
|
+
`).map((i) => i.trim());
|
|
799
|
+
for (let i = nt; i < Math.min(t.length, 6); i++) {
|
|
800
|
+
const e = t[i], o = e == null ? void 0 : e.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
|
|
847
801
|
if (!o)
|
|
848
802
|
continue;
|
|
849
|
-
const r = o[1] ?? "", s = o[2] ?? "0",
|
|
850
|
-
return { file: r.split(/[\\/]/).pop() || r, line: s, column:
|
|
803
|
+
const r = o[1] ?? "", s = o[2] ?? "0", a = o[3] ?? "0";
|
|
804
|
+
return { file: r.split(/[\\/]/).pop() || r, line: s, column: a };
|
|
851
805
|
}
|
|
852
806
|
return null;
|
|
853
|
-
},
|
|
854
|
-
function
|
|
855
|
-
|
|
856
|
-
let
|
|
857
|
-
return
|
|
807
|
+
}, R = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map();
|
|
808
|
+
function rt(n, t, i) {
|
|
809
|
+
R.set(n, t);
|
|
810
|
+
let e = V.get(n);
|
|
811
|
+
return e || (e = et(
|
|
858
812
|
() => {
|
|
859
|
-
const o =
|
|
813
|
+
const o = R.get(n);
|
|
860
814
|
return o || (console.warn(`Transition "${String(n)}" not found`), {});
|
|
861
815
|
},
|
|
862
816
|
{
|
|
863
|
-
strategy:
|
|
864
|
-
onCleanupEnd: () =>
|
|
817
|
+
strategy: i,
|
|
818
|
+
onCleanupEnd: () => Y(n)
|
|
865
819
|
}
|
|
866
|
-
),
|
|
820
|
+
), V.set(n, e), e);
|
|
867
821
|
}
|
|
868
|
-
function
|
|
869
|
-
|
|
822
|
+
function Y(n) {
|
|
823
|
+
R.delete(n), V.delete(n);
|
|
870
824
|
}
|
|
871
|
-
function
|
|
872
|
-
const n =
|
|
825
|
+
function st() {
|
|
826
|
+
const n = ot(new Error().stack);
|
|
873
827
|
return n ? `auto_${n.file}_${n.line}_${n.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
|
|
874
828
|
}
|
|
875
|
-
const
|
|
829
|
+
const _ = globalThis.FinalizationRegistry, F = _ ? (
|
|
876
830
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
877
|
-
new
|
|
831
|
+
new _((n) => {
|
|
878
832
|
try {
|
|
879
|
-
|
|
833
|
+
Y(n);
|
|
880
834
|
} catch {
|
|
881
835
|
}
|
|
882
836
|
})
|
|
883
837
|
) : void 0;
|
|
884
|
-
function
|
|
885
|
-
const t = n.key ??
|
|
886
|
-
if (n.ref &&
|
|
838
|
+
function gt(n) {
|
|
839
|
+
const t = n.key ?? st();
|
|
840
|
+
if (n.ref && F)
|
|
887
841
|
try {
|
|
888
|
-
|
|
842
|
+
F.register(n.ref, t);
|
|
889
843
|
} catch {
|
|
890
844
|
}
|
|
891
|
-
return
|
|
845
|
+
return rt(
|
|
892
846
|
t,
|
|
893
847
|
{
|
|
894
848
|
in: n.in,
|
|
895
849
|
out: n.out
|
|
896
850
|
},
|
|
897
|
-
n[
|
|
851
|
+
n[X]
|
|
898
852
|
);
|
|
899
853
|
}
|
|
900
|
-
function
|
|
901
|
-
const t = n.filter((
|
|
902
|
-
from:
|
|
903
|
-
to:
|
|
904
|
-
transition:
|
|
854
|
+
function ct(n) {
|
|
855
|
+
const t = n.filter((i) => i.symmetric).map((i) => ({
|
|
856
|
+
from: i.to,
|
|
857
|
+
to: i.from,
|
|
858
|
+
transition: i.transition
|
|
905
859
|
}));
|
|
906
860
|
return [...n, ...t];
|
|
907
861
|
}
|
|
908
|
-
function
|
|
909
|
-
let t = !1,
|
|
910
|
-
const r = 50, s =
|
|
862
|
+
function at(n) {
|
|
863
|
+
let t = !1, i = 0, e = 0, o = !1;
|
|
864
|
+
const r = 50, s = (w) => {
|
|
911
865
|
if (!n) return;
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
},
|
|
915
|
-
if (!n || !o
|
|
916
|
-
const
|
|
917
|
-
if (!
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
}, h = () => {
|
|
923
|
-
n && (
|
|
866
|
+
const d = w.touches[0];
|
|
867
|
+
d && (o = d.clientX < r, o && (i = d.clientX, e = d.clientY));
|
|
868
|
+
}, a = (w) => {
|
|
869
|
+
if (!n || !o) return;
|
|
870
|
+
const d = w.touches[0];
|
|
871
|
+
if (!d) return;
|
|
872
|
+
const f = d.clientX - i, y = d.clientY - e;
|
|
873
|
+
f > window.outerWidth / 2 - 5 && Math.abs(f) > Math.abs(y) ? t = !0 : t = !1;
|
|
874
|
+
}, c = () => {
|
|
875
|
+
n && (o = !1, i = 0, e = 0);
|
|
876
|
+
}, m = () => t, h = () => {
|
|
877
|
+
typeof window > "u" || n && (window.addEventListener("touchstart", s, { passive: !0 }), window.addEventListener("touchmove", a, { passive: !0 }), window.addEventListener("touchend", c, { passive: !0 }));
|
|
878
|
+
}, u = () => {
|
|
879
|
+
typeof window > "u" || (window.removeEventListener("touchstart", s), window.removeEventListener("touchmove", a), window.removeEventListener("touchend", c));
|
|
924
880
|
};
|
|
881
|
+
let g = 0;
|
|
925
882
|
return {
|
|
926
|
-
initialize:
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
}
|
|
932
|
-
isSwipePending: () => t
|
|
883
|
+
initialize: h,
|
|
884
|
+
cleanup: u,
|
|
885
|
+
isSwipePending: m,
|
|
886
|
+
resetSwipeDetection: () => {
|
|
887
|
+
g++, g > 1 && (g = 0, t = !1);
|
|
888
|
+
}
|
|
933
889
|
};
|
|
934
890
|
}
|
|
935
|
-
const
|
|
891
|
+
const lt = (n) => {
|
|
936
892
|
let t = n.parentElement;
|
|
937
893
|
for (; t && t !== document.body; ) {
|
|
938
|
-
const
|
|
939
|
-
if (
|
|
894
|
+
const i = window.getComputedStyle(t), e = i.overflow + i.overflowY + i.overflowX;
|
|
895
|
+
if (e.includes("auto") || e.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
|
|
940
896
|
return t;
|
|
941
897
|
t = t.parentElement;
|
|
942
898
|
}
|
|
943
899
|
return document.documentElement;
|
|
944
|
-
},
|
|
900
|
+
}, ut = (n) => {
|
|
945
901
|
let t = n.parentElement;
|
|
946
902
|
for (; t && t !== document.body; ) {
|
|
947
|
-
const
|
|
948
|
-
if (
|
|
903
|
+
const i = window.getComputedStyle(t).position;
|
|
904
|
+
if (i === "relative" || i === "absolute" || i === "fixed" || i === "sticky")
|
|
949
905
|
return t;
|
|
950
906
|
t = t.parentElement;
|
|
951
907
|
}
|
|
952
908
|
return document.body;
|
|
953
909
|
};
|
|
954
|
-
function
|
|
910
|
+
function ft() {
|
|
955
911
|
let n = null, t = null;
|
|
956
|
-
const
|
|
957
|
-
let
|
|
912
|
+
const i = /* @__PURE__ */ new Map();
|
|
913
|
+
let e = null;
|
|
958
914
|
const o = () => {
|
|
959
|
-
n &&
|
|
915
|
+
n && e && i.set(e, {
|
|
960
916
|
x: n.scrollLeft,
|
|
961
917
|
y: n.scrollTop
|
|
962
918
|
});
|
|
963
919
|
};
|
|
964
920
|
return {
|
|
965
|
-
initializeContext: (
|
|
966
|
-
t =
|
|
921
|
+
initializeContext: (h, u) => {
|
|
922
|
+
t = h, n || (n = lt(h), (n === document.documentElement ? window : n).addEventListener("scroll", o, {
|
|
967
923
|
passive: !0
|
|
968
|
-
})),
|
|
924
|
+
})), e = u;
|
|
969
925
|
},
|
|
970
|
-
calculateScrollOffset: (
|
|
971
|
-
const
|
|
926
|
+
calculateScrollOffset: (h, u) => {
|
|
927
|
+
const g = h && i.has(h) ? i.get(h) : { x: 0, y: 0 }, l = u && i.has(u) ? i.get(u) : { x: 0, y: 0 };
|
|
972
928
|
return {
|
|
973
|
-
x: -
|
|
974
|
-
y: -
|
|
929
|
+
x: -l.x + g.x,
|
|
930
|
+
y: -l.y + g.y
|
|
975
931
|
};
|
|
976
932
|
},
|
|
977
933
|
getScrollContainer: () => n,
|
|
978
|
-
getPositionedParentElement: () => t ?
|
|
979
|
-
getScrollPosition: (
|
|
934
|
+
getPositionedParentElement: () => t ? ut(t) : document.body,
|
|
935
|
+
getScrollPosition: (h) => h && i.has(h) ? i.get(h) : { x: 0, y: 0 }
|
|
980
936
|
};
|
|
981
937
|
}
|
|
982
938
|
function P(n, t) {
|
|
983
939
|
if (t === "*")
|
|
984
940
|
return !0;
|
|
985
941
|
if (t.endsWith("/*")) {
|
|
986
|
-
const
|
|
987
|
-
return n ===
|
|
942
|
+
const i = t.slice(0, -2);
|
|
943
|
+
return n === i || n.startsWith(i + "/");
|
|
988
944
|
}
|
|
989
945
|
return n === t;
|
|
990
946
|
}
|
|
991
|
-
function
|
|
992
|
-
for (const
|
|
993
|
-
if (P(n,
|
|
994
|
-
return
|
|
995
|
-
for (const
|
|
996
|
-
if ((
|
|
997
|
-
return
|
|
947
|
+
function mt(n, t, i) {
|
|
948
|
+
for (const e of i)
|
|
949
|
+
if (P(n, e.from) && P(t, e.to))
|
|
950
|
+
return e.transition;
|
|
951
|
+
for (const e of i)
|
|
952
|
+
if ((e.from === "*" || P(n, e.from)) && (e.to === "*" || P(t, e.to)))
|
|
953
|
+
return e.transition;
|
|
998
954
|
return null;
|
|
999
955
|
}
|
|
1000
|
-
function
|
|
956
|
+
function pt(n) {
|
|
1001
957
|
const {
|
|
1002
958
|
transitions: t = [],
|
|
1003
|
-
defaultTransition:
|
|
1004
|
-
middleware:
|
|
959
|
+
defaultTransition: i,
|
|
960
|
+
middleware: e = (f, y) => ({ from: f, to: y }),
|
|
1005
961
|
// Identity function as default
|
|
1006
962
|
skipOnIosSwipe: o = !0
|
|
1007
963
|
// Default to true - skip animations on iOS swipe
|
|
1008
964
|
} = n;
|
|
1009
965
|
let r = null;
|
|
1010
|
-
const s =
|
|
1011
|
-
initializeContext:
|
|
1012
|
-
calculateScrollOffset:
|
|
1013
|
-
getScrollContainer:
|
|
1014
|
-
getPositionedParentElement:
|
|
1015
|
-
getScrollPosition:
|
|
1016
|
-
} =
|
|
1017
|
-
|
|
1018
|
-
function
|
|
966
|
+
const s = ct(t), {
|
|
967
|
+
initializeContext: a,
|
|
968
|
+
calculateScrollOffset: c,
|
|
969
|
+
getScrollContainer: m,
|
|
970
|
+
getPositionedParentElement: h,
|
|
971
|
+
getScrollPosition: u
|
|
972
|
+
} = ft(), g = at(o);
|
|
973
|
+
g.initialize();
|
|
974
|
+
function l() {
|
|
1019
975
|
if (r != null && r.from && (r != null && r.to)) {
|
|
1020
|
-
const { from: f, to: y } =
|
|
976
|
+
const { from: f, to: y } = e(
|
|
1021
977
|
r.from,
|
|
1022
978
|
r.to
|
|
1023
|
-
),
|
|
979
|
+
), E = mt(
|
|
1024
980
|
f,
|
|
1025
981
|
y,
|
|
1026
982
|
s
|
|
1027
|
-
) ||
|
|
983
|
+
) || i, A = c(
|
|
1028
984
|
r.from,
|
|
1029
985
|
r.to
|
|
1030
986
|
), v = {
|
|
1031
|
-
scrollOffset:
|
|
1032
|
-
scroll:
|
|
987
|
+
scrollOffset: A,
|
|
988
|
+
scroll: u(r.from),
|
|
1033
989
|
get scrollingElement() {
|
|
1034
|
-
return
|
|
990
|
+
return m() || document.documentElement;
|
|
1035
991
|
},
|
|
1036
992
|
get positionedParent() {
|
|
1037
|
-
return
|
|
993
|
+
return h();
|
|
1038
994
|
}
|
|
1039
|
-
},
|
|
1040
|
-
scrollOffset:
|
|
995
|
+
}, T = {
|
|
996
|
+
scrollOffset: A,
|
|
1041
997
|
get scroll() {
|
|
1042
|
-
return r ?
|
|
998
|
+
return r ? u(r.to) : { x: 0, y: 0 };
|
|
1043
999
|
},
|
|
1044
1000
|
get scrollingElement() {
|
|
1045
|
-
return
|
|
1001
|
+
return m() || document.documentElement;
|
|
1046
1002
|
},
|
|
1047
1003
|
get positionedParent() {
|
|
1048
|
-
return
|
|
1004
|
+
return h();
|
|
1049
1005
|
}
|
|
1050
1006
|
};
|
|
1051
|
-
|
|
1052
|
-
(
|
|
1053
|
-
),
|
|
1054
|
-
(
|
|
1007
|
+
E && (E.out && r.outResolve && r.outResolve(
|
|
1008
|
+
(C) => E.out(C, v)
|
|
1009
|
+
), E.in && r.inResolve && r.inResolve(
|
|
1010
|
+
(C) => E.in(C, T)
|
|
1055
1011
|
)), r = null;
|
|
1056
1012
|
}
|
|
1057
1013
|
}
|
|
1058
|
-
const
|
|
1059
|
-
r.outResolve = S,
|
|
1014
|
+
const w = async (f, y) => g.isSwipePending() ? (g.resetSwipeDetection(), () => ({})) : y === "in" && (!r || !r.from) ? () => ({}) : (r || (r = {}), y === "out" ? (r.from = f, new Promise((S) => {
|
|
1015
|
+
r.outResolve = S, l();
|
|
1060
1016
|
})) : (r.to = f, new Promise((S) => {
|
|
1061
|
-
r.inResolve = S,
|
|
1017
|
+
r.inResolve = S, l();
|
|
1062
1018
|
})));
|
|
1063
1019
|
return (f) => ({
|
|
1064
1020
|
key: f,
|
|
1065
|
-
in: async (y) => (
|
|
1066
|
-
out: async (y) => (await
|
|
1021
|
+
in: async (y) => (a(y, f), (await w(f, "in"))(y)),
|
|
1022
|
+
out: async (y) => (await w(f, "out"))(y),
|
|
1067
1023
|
// Add page transition strategy for page-level transitions
|
|
1068
|
-
[
|
|
1024
|
+
[X]: it
|
|
1069
1025
|
});
|
|
1070
1026
|
}
|
|
1071
1027
|
export {
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1028
|
+
X as TRANSITION_STRATEGY,
|
|
1029
|
+
tt as createDefaultStrategy,
|
|
1030
|
+
it as createPageTransitionStrategy,
|
|
1031
|
+
pt as createSggoiTransitionContext,
|
|
1032
|
+
st as generateAutoKey,
|
|
1033
|
+
vt as isCssAnimation,
|
|
1034
|
+
M as isMultiSpring,
|
|
1035
|
+
St as isSingleSpring,
|
|
1036
|
+
Ct as isTickAnimation,
|
|
1037
|
+
At as jaeminInternal,
|
|
1038
|
+
gt as transition,
|
|
1039
|
+
Et as validateAnimationMode
|
|
1081
1040
|
};
|