@ssgoi/core 3.1.4 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,38 +1,38 @@
1
- var K = Object.defineProperty;
2
- var U = (n, e, t) => e in n ? K(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var d = (n, e, t) => U(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { normalizeToMultiSpring as V, normalizeMultiSpringSchedule as F } from "./types.js";
5
- import { isCssAnimation as Vt, isMultiSpring as bt, isSingleSpring as kt, isTickAnimation as Rt, validateAnimationMode as It, validateSpringItem as Pt } from "./types.js";
6
- import { j as Mt } from "./jaemin-BWkrXq0V.js";
7
- class G {
1
+ var et = Object.defineProperty;
2
+ var nt = (i, e, t) => e in i ? et(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var m = (i, e, t) => nt(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { normalizeToMultiSpring as I, normalizeMultiSpringSchedule as H } from "./types.js";
5
+ import { isCssAnimation as Nt, isMultiSpring as Ht, isSingleSpring as qt, isTickAnimation as Yt, validateAnimationMode as Ut, validateSpringItem as Wt } from "./types.js";
6
+ import { j as $t } from "./jaemin-BWkrXq0V.js";
7
+ class it {
8
8
  constructor() {
9
- d(this, "listeners", /* @__PURE__ */ new Set());
10
- d(this, "rafId", null);
11
- d(this, "isRunning", !1);
9
+ m(this, "listeners", /* @__PURE__ */ new Set());
10
+ m(this, "rafId", null);
11
+ m(this, "isRunning", !1);
12
12
  // Timing
13
- d(this, "startTime", Date.now());
14
- d(this, "lastUpdate", this.startTime);
15
- d(this, "elapsed", 0);
13
+ m(this, "startTime", Date.now());
14
+ m(this, "lastUpdate", this.startTime);
15
+ m(this, "elapsed", 0);
16
16
  // Lag smoothing (mobile optimization)
17
- d(this, "lagThreshold", 500);
17
+ m(this, "lagThreshold", 500);
18
18
  // ms - detect tab switches, backgrounding
19
- d(this, "adjustedLag", 33);
19
+ m(this, "adjustedLag", 33);
20
20
  // ms - max time jump to prevent animation skip
21
- d(this, "maxDeltaTime", 33);
21
+ m(this, "maxDeltaTime", 33);
22
22
  // ms - clamp for physics stability (30fps minimum)
23
23
  // FPS throttling
24
- d(this, "gap", 1e3 / 240);
24
+ m(this, "gap", 1e3 / 240);
25
25
  // max 240fps
26
- d(this, "nextTime", this.gap);
27
- d(this, "tick", () => {
26
+ m(this, "nextTime", this.gap);
27
+ m(this, "tick", () => {
28
28
  const e = Date.now();
29
- let i = e - this.lastUpdate;
30
- i > this.lagThreshold || i < 0 ? (this.startTime += i - this.adjustedLag, i = this.adjustedLag) : i > this.maxDeltaTime && (i = this.maxDeltaTime), this.lastUpdate = e;
31
- const r = e - this.startTime, o = r - this.nextTime;
32
- if (o > 0) {
33
- const c = i / 1e3;
34
- this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((a) => {
35
- a(c, this.elapsed);
29
+ let n = e - this.lastUpdate;
30
+ n > this.lagThreshold || n < 0 ? (this.startTime += n - this.adjustedLag, n = this.adjustedLag) : n > this.maxDeltaTime && (n = this.maxDeltaTime), this.lastUpdate = e;
31
+ const r = e - this.startTime, s = r - this.nextTime;
32
+ if (s > 0) {
33
+ const a = n / 1e3;
34
+ this.elapsed = r / 1e3, this.nextTime += s + (s >= this.gap ? 4 : this.gap - s), this.listeners.forEach((o) => {
35
+ o(a, this.elapsed);
36
36
  });
37
37
  }
38
38
  this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
@@ -68,189 +68,189 @@ class G {
68
68
  return this.elapsed;
69
69
  }
70
70
  }
71
- const x = new G();
72
- function z(n) {
73
- const e = n.stiffness, t = n.damping, i = 1, r = Math.sqrt(e / i), o = t / (2 * Math.sqrt(e * i));
74
- return { omega: r, zeta: o };
71
+ const z = new it();
72
+ function W(i) {
73
+ const e = i.stiffness, t = i.damping, n = 1, r = Math.sqrt(e / n), s = t / (2 * Math.sqrt(e * n));
74
+ return { omega: r, zeta: s };
75
75
  }
76
- function q(n, e, t, i) {
77
- const { omega: r, zeta: o } = t, { position: c, velocity: a } = n, s = Math.min(i, 0.033), l = -2 * s * o * r * a, f = s * r * r * (e - c), w = a + l + f;
76
+ function X(i, e, t, n) {
77
+ const { omega: r, zeta: s } = t, { position: a, velocity: o } = i, c = Math.min(n, 0.033), u = -2 * c * s * r * o, f = c * r * r * (e - a), h = o + u + f;
78
78
  return {
79
- position: c + s * w,
80
- velocity: w
79
+ position: a + c * h,
80
+ velocity: h
81
81
  };
82
82
  }
83
- const B = 0.01, J = 0.01, H = 0.05;
84
- function N(n, e) {
85
- const t = Math.abs(e - n.position), i = Math.abs(n.velocity);
86
- return t < B && i < J;
83
+ const ot = 0.01, rt = 0.01, $ = 0.05;
84
+ function j(i, e) {
85
+ const t = Math.abs(e - i.position), n = Math.abs(i.velocity);
86
+ return t < ot && n < rt;
87
87
  }
88
- function Q(n) {
88
+ function st(i) {
89
89
  const {
90
90
  from: e,
91
91
  to: t,
92
- spring: i,
92
+ spring: n,
93
93
  velocity: r = 0,
94
- onUpdate: o,
95
- onComplete: c,
96
- onStart: a
97
- } = n;
98
- let s = { position: e, velocity: r }, l = !0, f = 0, w = !1;
99
- const u = z(i), h = (p) => {
100
- if (l) {
101
- if (w || (w = !0, a == null || a()), s = q(s, t, u, p), N(s, t)) {
102
- if (f += Math.min(p, 0.033), f >= H) {
103
- s = { position: t, velocity: 0 }, l = !1, o(s.position), x.unsubscribe(h), c();
94
+ onUpdate: s,
95
+ onComplete: a,
96
+ onStart: o
97
+ } = i;
98
+ let c = { position: e, velocity: r }, u = !0, f = 0, h = !1;
99
+ const y = W(n), v = (l) => {
100
+ if (u) {
101
+ if (h || (h = !0, o == null || o()), c = X(c, t, y, l), j(c, t)) {
102
+ if (f += Math.min(l, 0.033), f >= $) {
103
+ c = { position: t, velocity: 0 }, u = !1, s(c.position), z.unsubscribe(v), a();
104
104
  return;
105
105
  }
106
106
  } else
107
107
  f = 0;
108
- o(s.position);
108
+ s(c.position);
109
109
  }
110
110
  };
111
- return x.subscribe(h), {
111
+ return z.subscribe(v), {
112
112
  stop: () => {
113
- l && (l = !1, x.unsubscribe(h));
113
+ u && (u = !1, z.unsubscribe(v));
114
114
  },
115
- getPosition: () => s.position,
116
- getVelocity: () => s.velocity,
117
- isRunning: () => l
115
+ getPosition: () => c.position,
116
+ getVelocity: () => c.velocity,
117
+ isRunning: () => u
118
118
  };
119
119
  }
120
- const b = 1e3 / 60;
121
- function Z(n, e, t, i = 0) {
122
- const r = z(t), o = 600;
123
- let c = { position: n, velocity: i }, a = 0;
124
- const s = [];
125
- for (let l = 0; l < o; l++) {
126
- const f = l * b;
127
- if (s.push({
120
+ const M = 1e3 / 60;
121
+ function ct(i, e, t, n = 0) {
122
+ const r = W(t), s = 600;
123
+ let a = { position: i, velocity: n }, o = 0;
124
+ const c = [];
125
+ for (let u = 0; u < s; u++) {
126
+ const f = u * M;
127
+ if (c.push({
128
128
  time: f,
129
- position: c.position,
130
- velocity: c.velocity
131
- }), c = q(c, e, r, b / 1e3), N(c, e)) {
132
- if (a += b / 1e3, a >= H) {
133
- s.push({
134
- time: (l + 1) * b,
129
+ position: a.position,
130
+ velocity: a.velocity
131
+ }), a = X(a, e, r, M / 1e3), j(a, e)) {
132
+ if (o += M / 1e3, o >= $) {
133
+ c.push({
134
+ time: (u + 1) * M,
135
135
  position: e,
136
136
  velocity: 0
137
137
  });
138
138
  break;
139
139
  }
140
140
  } else
141
- a = 0;
141
+ o = 0;
142
142
  }
143
- return s;
143
+ return c;
144
144
  }
145
- function D(n, e) {
146
- if (n.length === 0)
145
+ function q(i, e) {
146
+ if (i.length === 0)
147
147
  return { position: 0, velocity: 0 };
148
- const t = n[0], i = n[n.length - 1];
148
+ const t = i[0], n = i[i.length - 1];
149
149
  if (e <= 0)
150
150
  return { position: t.position, velocity: t.velocity };
151
- if (e >= i.time)
152
- return { position: i.position, velocity: i.velocity };
153
- let r = 0, o = n.length - 1;
154
- for (; r < o - 1; ) {
155
- const l = Math.floor((r + o) / 2);
156
- n[l].time <= e ? r = l : o = l;
157
- }
158
- const c = n[r], a = n[o], s = (e - c.time) / (a.time - c.time);
151
+ if (e >= n.time)
152
+ return { position: n.position, velocity: n.velocity };
153
+ let r = 0, s = i.length - 1;
154
+ for (; r < s - 1; ) {
155
+ const u = Math.floor((r + s) / 2);
156
+ i[u].time <= e ? r = u : s = u;
157
+ }
158
+ const a = i[r], o = i[s], c = (e - a.time) / (o.time - a.time);
159
159
  return {
160
- position: c.position + (a.position - c.position) * s,
161
- velocity: c.velocity + (a.velocity - c.velocity) * s
160
+ position: a.position + (o.position - a.position) * c,
161
+ velocity: a.velocity + (o.velocity - a.velocity) * c
162
162
  };
163
163
  }
164
- function tt(n, e) {
165
- return n.map((t) => e(t.position));
164
+ function at(i, e) {
165
+ return i.map((t) => e(t.position));
166
166
  }
167
- function et(n) {
167
+ function lt(i) {
168
168
  const {
169
169
  element: e,
170
170
  from: t,
171
- to: i,
171
+ to: n,
172
172
  spring: r,
173
- velocity: o = 0,
174
- style: c,
175
- onComplete: a,
176
- onStart: s
177
- } = n, l = Z(t, i, r, o);
178
- if (l.length === 0)
179
- return s == null || s(), a(), {
173
+ velocity: s = 0,
174
+ style: a,
175
+ onComplete: o,
176
+ onStart: c
177
+ } = i, u = ct(t, n, r, s);
178
+ if (u.length === 0)
179
+ return c == null || c(), o(), {
180
180
  stop: () => {
181
181
  },
182
- getPosition: () => i,
182
+ getPosition: () => n,
183
183
  getVelocity: () => 0,
184
184
  isRunning: () => !1
185
185
  };
186
- const f = tt(l, c), w = l[l.length - 1], u = w.time, h = e.animate(f, {
187
- duration: u,
186
+ const f = at(u, a), h = u[u.length - 1], y = h.time, v = e.animate(f, {
187
+ duration: y,
188
188
  fill: "forwards",
189
189
  easing: "linear"
190
190
  // Spring physics already applied in keyframes
191
191
  });
192
- let p = !0;
193
- const S = performance.now();
194
- return s == null || s(), h.onfinish = () => {
195
- p && (p = !1, a());
192
+ let l = !0;
193
+ const d = performance.now();
194
+ return c == null || c(), v.onfinish = () => {
195
+ l && (l = !1, o());
196
196
  }, {
197
197
  stop: () => {
198
- p && (p = !1, h.cancel());
198
+ l && (l = !1, v.cancel());
199
199
  },
200
200
  getPosition: () => {
201
- if (!p)
202
- return w.position;
203
- const y = performance.now() - S;
204
- return D(l, y).position;
201
+ if (!l)
202
+ return h.position;
203
+ const A = performance.now() - d;
204
+ return q(u, A).position;
205
205
  },
206
206
  getVelocity: () => {
207
- if (!p)
207
+ if (!l)
208
208
  return 0;
209
- const y = performance.now() - S;
210
- return D(l, y).velocity;
209
+ const A = performance.now() - d;
210
+ return q(u, A).velocity;
211
211
  },
212
- isRunning: () => p
212
+ isRunning: () => l
213
213
  };
214
214
  }
215
- function it(n) {
216
- const { from: e, to: t, spring: i, velocity: r, onComplete: o, onStart: c, tick: a, css: s } = n;
217
- if (a && s)
215
+ function ut(i) {
216
+ const { from: e, to: t, spring: n, velocity: r, onComplete: s, onStart: a, tick: o, css: c } = i;
217
+ if (o && c)
218
218
  throw new Error("Cannot use both 'tick' and 'css' options together");
219
- return !a && !s ? (c == null || c(), o(), {
219
+ return !o && !c ? (a == null || a(), s(), {
220
220
  stop: () => {
221
221
  },
222
222
  getPosition: () => t,
223
223
  getVelocity: () => 0,
224
224
  isRunning: () => !1
225
- }) : s ? et({
226
- element: s.element,
225
+ }) : c ? lt({
226
+ element: c.element,
227
227
  from: e,
228
228
  to: t,
229
- spring: i,
229
+ spring: n,
230
230
  velocity: r,
231
- style: s.style,
232
- onComplete: o,
233
- onStart: c
234
- }) : Q({
231
+ style: c.style,
232
+ onComplete: s,
233
+ onStart: a
234
+ }) : st({
235
235
  from: e,
236
236
  to: t,
237
- spring: i,
237
+ spring: n,
238
238
  velocity: r,
239
- onUpdate: a,
240
- onComplete: o,
241
- onStart: c
239
+ onUpdate: o,
240
+ onComplete: s,
241
+ onStart: a
242
242
  });
243
243
  }
244
- class Y {
244
+ class K {
245
245
  }
246
- class I extends Y {
246
+ class F extends K {
247
247
  constructor(t) {
248
248
  super();
249
- d(this, "options");
250
- d(this, "controls", null);
251
- d(this, "isAnimating", !1);
252
- d(this, "currentValue");
253
- d(this, "currentVelocity", 0);
249
+ m(this, "options");
250
+ m(this, "controls", null);
251
+ m(this, "isAnimating", !1);
252
+ m(this, "currentValue");
253
+ m(this, "currentVelocity", 0);
254
254
  if (t.tick && t.css)
255
255
  throw new Error("Cannot use both 'tick' and 'css' options together");
256
256
  this.options = {
@@ -265,7 +265,7 @@ class I extends Y {
265
265
  }, this.currentValue = this.options.from;
266
266
  }
267
267
  runAnimation(t) {
268
- this.isAnimating = !0, this.controls = it({
268
+ this.isAnimating = !0, this.controls = ut({
269
269
  from: this.currentValue,
270
270
  to: t,
271
271
  spring: this.options.spring,
@@ -319,24 +319,24 @@ class I extends Y {
319
319
  updateOptions(t) {
320
320
  this.options = { ...this.options, ...t };
321
321
  }
322
- static fromState(t, i) {
323
- const r = new I(i);
322
+ static fromState(t, n) {
323
+ const r = new F(n);
324
324
  return r.setValue(t.position), r.setVelocity(t.velocity), r;
325
325
  }
326
326
  }
327
- class P extends Y {
327
+ class L extends K {
328
328
  constructor(t) {
329
329
  super();
330
- d(this, "config");
331
- d(this, "animators", /* @__PURE__ */ new Map());
332
- d(this, "springOrder", []);
333
- d(this, "completedCount", 0);
334
- d(this, "completedAnimators", /* @__PURE__ */ new Set());
335
- d(this, "direction", "forward");
336
- d(this, "idCounter", 0);
337
- d(this, "rafId", null);
338
- d(this, "from");
339
- d(this, "to");
330
+ m(this, "config");
331
+ m(this, "animators", /* @__PURE__ */ new Map());
332
+ m(this, "springOrder", []);
333
+ m(this, "completedCount", 0);
334
+ m(this, "completedAnimators", /* @__PURE__ */ new Set());
335
+ m(this, "direction", "forward");
336
+ m(this, "idCounter", 0);
337
+ m(this, "rafId", null);
338
+ m(this, "from");
339
+ m(this, "to");
340
340
  this.config = t.config, this.from = t.from, this.to = t.to, this.initializeAnimators();
341
341
  }
342
342
  generateId() {
@@ -344,21 +344,21 @@ class P extends Y {
344
344
  }
345
345
  initializeAnimators() {
346
346
  this.config.springs.forEach((t) => {
347
- const i = this.generateId(), r = new I({
347
+ const n = this.generateId(), r = new F({
348
348
  from: this.from,
349
349
  to: this.to,
350
350
  spring: t.spring,
351
351
  tick: t.tick,
352
352
  css: t.css,
353
- onComplete: () => this.onAnimatorComplete(i),
353
+ onComplete: () => this.onAnimatorComplete(n),
354
354
  onStart: t.onStart
355
355
  });
356
- this.animators.set(i, {
357
- id: i,
356
+ this.animators.set(n, {
357
+ id: n,
358
358
  item: t,
359
359
  animator: r,
360
360
  started: !1
361
- }), this.springOrder.push(i);
361
+ }), this.springOrder.push(n);
362
362
  });
363
363
  }
364
364
  /**
@@ -366,8 +366,8 @@ class P extends Y {
366
366
  * Progress = |position - from| / |to - from|
367
367
  */
368
368
  getAnimatorProgress(t) {
369
- const i = t.animator.getCurrentState(), r = Math.abs(i.to - i.from);
370
- return r === 0 ? 1 : Math.abs(i.position - i.from) / r;
369
+ const n = t.animator.getCurrentState(), r = Math.abs(n.to - n.from);
370
+ return r === 0 ? 1 : Math.abs(n.position - n.from) / r;
371
371
  }
372
372
  /**
373
373
  * Get order of springs based on direction
@@ -378,9 +378,9 @@ class P extends Y {
378
378
  return this.direction === "forward" ? this.springOrder : [...this.springOrder].reverse();
379
379
  }
380
380
  onAnimatorComplete(t) {
381
- var r, o, c, a, s, l;
382
- const i = this.animators.get(t);
383
- !i || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = i.item).onComplete) == null || o.call(r), (a = (c = this.config).onProgress) == null || a.call(c, this.completedCount, this.config.springs.length), this.completedCount === this.config.springs.length && (this.stopScheduler(), (l = (s = this.config).onEnd) == null || l.call(s)));
381
+ var r, s, a, o, c, u;
382
+ const n = this.animators.get(t);
383
+ !n || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (s = (r = n.item).onComplete) == null || s.call(r), (o = (a = this.config).onProgress) == null || o.call(a, this.completedCount, this.config.springs.length), this.completedCount === this.config.springs.length && (this.stopScheduler(), (u = (c = this.config).onEnd) == null || u.call(c)));
384
384
  }
385
385
  /**
386
386
  * Check and start springs based on previous spring's progress
@@ -388,22 +388,22 @@ class P extends Y {
388
388
  */
389
389
  checkAndStartSprings() {
390
390
  const t = this.getOrderedIds();
391
- for (let i = 0; i < t.length; i++) {
392
- const r = t[i], o = this.animators.get(r);
393
- if (!o || o.started) continue;
394
- if (i === 0) {
391
+ for (let n = 0; n < t.length; n++) {
392
+ const r = t[n], s = this.animators.get(r);
393
+ if (!s || s.started) continue;
394
+ if (n === 0) {
395
395
  this.startAnimator(r);
396
396
  continue;
397
397
  }
398
- const c = t[i - 1], a = this.animators.get(c);
399
- if (!a || !a.started) continue;
400
- const s = this.getAnimatorProgress(a), l = o.item.normalizedOffset;
401
- s >= l && this.startAnimator(r);
398
+ const a = t[n - 1], o = this.animators.get(a);
399
+ if (!o || !o.started) continue;
400
+ const c = this.getAnimatorProgress(o), u = s.item.normalizedOffset;
401
+ c >= u && this.startAnimator(r);
402
402
  }
403
403
  }
404
404
  startAnimator(t) {
405
- const i = this.animators.get(t);
406
- !i || i.started || (i.started = !0, this.direction === "forward" ? i.animator.forward() : i.animator.backward());
405
+ const n = this.animators.get(t);
406
+ !n || n.started || (n.started = !0, this.direction === "forward" ? n.animator.forward() : n.animator.backward());
407
407
  }
408
408
  /**
409
409
  * Start the scheduler loop that checks spring progress
@@ -418,17 +418,17 @@ class P extends Y {
418
418
  this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
419
419
  }
420
420
  getFirstAnimator() {
421
- var i;
421
+ var n;
422
422
  const t = this.springOrder[0];
423
- return t ? ((i = this.animators.get(t)) == null ? void 0 : i.animator) ?? null : null;
423
+ return t ? ((n = this.animators.get(t)) == null ? void 0 : n.animator) ?? null : null;
424
424
  }
425
425
  forward() {
426
- var t, i;
427
- this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (i = (t = this.config).onStart) == null || i.call(t), this.startScheduler();
426
+ var t, n;
427
+ this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (n = (t = this.config).onStart) == null || n.call(t), this.startScheduler();
428
428
  }
429
429
  backward() {
430
- var t, i;
431
- this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (i = (t = this.config).onStart) == null || i.call(t), this.startScheduler();
430
+ var t, n;
431
+ this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (n = (t = this.config).onStart) == null || n.call(t), this.startScheduler();
432
432
  }
433
433
  resetStartedFlags() {
434
434
  this.animators.forEach((t) => {
@@ -444,9 +444,9 @@ class P extends Y {
444
444
  this.direction = this.direction === "forward" ? "backward" : "forward", this.animators.forEach((t) => {
445
445
  if (!t.started)
446
446
  return;
447
- const i = t.animator.getCurrentState();
448
- if (i.position === i.to) {
449
- const o = I.fromState(
447
+ const n = t.animator.getCurrentState();
448
+ if (n.position === n.to) {
449
+ const s = F.fromState(
450
450
  { position: this.to, velocity: 0 },
451
451
  {
452
452
  from: this.to,
@@ -458,7 +458,7 @@ class P extends Y {
458
458
  onStart: t.item.onStart
459
459
  }
460
460
  );
461
- o.forward(), t.animator = o;
461
+ s.forward(), t.animator = s;
462
462
  } else
463
463
  t.animator.reverse();
464
464
  });
@@ -491,16 +491,16 @@ class P extends Y {
491
491
  * TODO: Support per-spring control
492
492
  */
493
493
  setValue(t) {
494
- const i = this.getFirstAnimator();
495
- i == null || i.setValue(t);
494
+ const n = this.getFirstAnimator();
495
+ n == null || n.setValue(t);
496
496
  }
497
497
  /**
498
498
  * Set velocity on first animator
499
499
  * TODO: Support per-spring control
500
500
  */
501
501
  setVelocity(t) {
502
- const i = this.getFirstAnimator();
503
- i == null || i.setVelocity(t);
502
+ const n = this.getFirstAnimator();
503
+ n == null || n.setVelocity(t);
504
504
  }
505
505
  /**
506
506
  * Check if any animation is currently running
@@ -515,20 +515,20 @@ class P extends Y {
515
515
  * Create MultiAnimator from existing state
516
516
  * Uses first animator's state for initialization
517
517
  */
518
- static fromState(t, i) {
519
- const r = new P(i);
518
+ static fromState(t, n) {
519
+ const r = new L(n);
520
520
  return r.setValue(t.position), r.setVelocity(t.velocity), r;
521
521
  }
522
522
  }
523
- const X = Symbol.for("TRANSITION_STRATEGY"), nt = (n) => ({
523
+ const G = Symbol.for("TRANSITION_STRATEGY"), ft = (i) => ({
524
524
  runIn: async (e) => {
525
- const { currentAnimation: t } = n;
525
+ const { currentAnimation: t } = i;
526
526
  if (t && t.direction === "out") {
527
- const r = t.controller.getCurrentValue(), o = t.controller.getVelocity();
527
+ const r = t.controller.getCurrentValue(), s = t.controller.getVelocity();
528
528
  if (t.controller.stop(), e.out)
529
529
  return {
530
530
  config: await e.out,
531
- state: { position: r, velocity: o },
531
+ state: { position: r, velocity: s },
532
532
  from: 1,
533
533
  to: 0,
534
534
  direction: "backward"
@@ -555,13 +555,13 @@ const X = Symbol.for("TRANSITION_STRATEGY"), nt = (n) => ({
555
555
  };
556
556
  },
557
557
  runOut: async (e) => {
558
- const { currentAnimation: t } = n;
558
+ const { currentAnimation: t } = i;
559
559
  if (t && t.direction === "in") {
560
- const r = t.controller.getCurrentValue(), o = t.controller.getVelocity();
560
+ const r = t.controller.getCurrentValue(), s = t.controller.getVelocity();
561
561
  if (t.controller.stop(), e.in)
562
562
  return {
563
563
  config: await e.in,
564
- state: { position: r, velocity: o },
564
+ state: { position: r, velocity: s },
565
565
  from: 0,
566
566
  to: 1,
567
567
  direction: "backward"
@@ -587,9 +587,9 @@ const X = Symbol.for("TRANSITION_STRATEGY"), nt = (n) => ({
587
587
  direction: "forward"
588
588
  };
589
589
  }
590
- }), ot = () => ({
591
- runIn: async (n) => n.in ? {
592
- config: await n.in,
590
+ }), dt = () => ({
591
+ runIn: async (i) => i.in ? {
592
+ config: await i.in,
593
593
  state: {
594
594
  position: 0,
595
595
  velocity: 0
@@ -606,8 +606,8 @@ const X = Symbol.for("TRANSITION_STRATEGY"), nt = (n) => ({
606
606
  to: 1,
607
607
  direction: "forward"
608
608
  },
609
- runOut: async (n) => n.out ? {
610
- config: await n.out,
609
+ runOut: async (i) => i.out ? {
610
+ config: await i.out,
611
611
  state: {
612
612
  position: 1,
613
613
  velocity: 0
@@ -624,226 +624,283 @@ const X = Symbol.for("TRANSITION_STRATEGY"), nt = (n) => ({
624
624
  to: 0,
625
625
  direction: "forward"
626
626
  }
627
- }), $ = "data-ssgoi-scope", j = "data-ssgoi-scope-ready";
628
- function vt() {
629
- return (n) => {
630
- if (n)
631
- return n.setAttribute($, ""), queueMicrotask(() => {
627
+ }), B = "data-ssgoi-scope", J = "data-ssgoi-scope-ready";
628
+ function Pt() {
629
+ return (i) => {
630
+ if (i)
631
+ return i.setAttribute(B, ""), queueMicrotask(() => {
632
632
  queueMicrotask(() => {
633
- n.setAttribute(j, "true");
633
+ i.setAttribute(J, "true");
634
634
  });
635
635
  }), () => {
636
636
  };
637
637
  };
638
638
  }
639
- function rt(n) {
640
- return n.hasAttribute(j);
639
+ function mt(i) {
640
+ return i.hasAttribute(J);
641
641
  }
642
- function st(n) {
643
- return n.closest(`[${$}]`);
642
+ function ht(i) {
643
+ return i.closest(`[${B}]`);
644
644
  }
645
- function ct(n, e) {
646
- var w;
647
- let t = null, i = null, r = null, o = null;
648
- const c = {
645
+ function gt(i, e) {
646
+ var v;
647
+ let t = null, n = null, r = null, s = null;
648
+ const a = {
649
649
  get currentAnimation() {
650
650
  return t;
651
651
  }
652
- }, a = ((w = e == null ? void 0 : e.strategy) == null ? void 0 : w.call(e, c)) || nt(c), s = async (u) => {
652
+ }, o = ((v = e == null ? void 0 : e.strategy) == null ? void 0 : v.call(e, a)) || ft(a), c = async (l) => {
653
653
  var E;
654
- i && (i.remove(), i = null);
655
- const h = n(), p = h.in && h.in(u), S = !(e != null && e.strategy) && h.out ? h.out(u) : void 0;
656
- if (!p)
654
+ n && (n.remove(), n = null);
655
+ const d = i(), A = d.in && d.in(l), k = !(e != null && e.strategy) && d.out ? d.out(l) : void 0;
656
+ if (!A)
657
657
  return;
658
- const y = {
659
- in: V(p),
660
- out: S ? V(S) : void 0
661
- }, m = await a.runIn(y);
662
- if (!m.config) {
658
+ const V = {
659
+ in: I(A),
660
+ out: k ? I(k) : void 0
661
+ }, S = await o.runIn(V);
662
+ if (!S.config) {
663
663
  t && (t.direction = "in");
664
664
  return;
665
665
  }
666
- const g = m.config;
667
- (E = g.prepare) == null || E.call(g, u), g.wait && await g.wait();
668
- const C = F(
666
+ const p = S.config;
667
+ (E = p.prepare) == null || E.call(p, l), p.wait && await p.wait();
668
+ const w = H(
669
669
  {
670
- ...g,
670
+ ...p,
671
671
  onEnd: () => {
672
- var A;
673
- t = null, (A = g.onEnd) == null || A.call(g);
672
+ var C;
673
+ t = null, (C = p.onEnd) == null || C.call(p);
674
674
  }
675
675
  },
676
- u
677
- ), v = P.fromState(m.state, {
678
- config: C,
679
- from: m.from,
680
- to: m.to
676
+ l
677
+ ), g = L.fromState(S.state, {
678
+ config: w,
679
+ from: S.from,
680
+ to: S.to
681
681
  });
682
- t = { controller: v, direction: "in" }, m.direction === "forward" ? v.forward() : v.backward();
683
- }, l = async (u) => {
684
- var A;
685
- i = u;
686
- const h = n(), p = !(e != null && e.strategy) && h.in ? h.in(u) : void 0, S = h.out && h.out(u);
687
- if (!S)
682
+ t = { controller: g, direction: "in" }, S.direction === "forward" ? g.forward() : g.backward();
683
+ }, u = async (l) => {
684
+ var C;
685
+ n = l;
686
+ const d = i(), A = !(e != null && e.strategy) && d.in ? d.in(l) : void 0, k = d.out && d.out(l);
687
+ if (!k)
688
688
  return;
689
- const y = {
690
- in: p ? V(p) : void 0,
691
- out: V(S)
692
- }, m = await a.runOut(y);
693
- if (!m.config) {
694
- t && (t.direction = "out"), i && (i.remove(), i = null);
689
+ const V = {
690
+ in: A ? I(A) : void 0,
691
+ out: I(k)
692
+ }, S = await o.runOut(V);
693
+ if (!S.config) {
694
+ t && (t.direction = "out"), n && (n.remove(), n = null);
695
695
  return;
696
696
  }
697
- const g = m.config;
698
- (A = g.prepare) == null || A.call(g, u), E(), g.wait && await g.wait();
699
- const C = F(
697
+ const p = S.config;
698
+ (C = p.prepare) == null || C.call(p, l), E(), p.wait && await p.wait();
699
+ const w = H(
700
700
  {
701
- ...g,
701
+ ...p,
702
702
  onEnd: () => {
703
- var T, O;
704
- (T = g.onEnd) == null || T.call(g), i && (i.remove(), i = null), t = null, (O = e == null ? void 0 : e.onCleanupEnd) == null || O.call(e);
703
+ var R, P;
704
+ (R = p.onEnd) == null || R.call(p), n && (n.remove(), n = null), t = null, (P = e == null ? void 0 : e.onCleanupEnd) == null || P.call(e);
705
705
  }
706
706
  },
707
- u
708
- ), v = P.fromState(m.state, {
709
- config: C,
710
- from: m.from,
711
- to: m.to
707
+ l
708
+ ), g = L.fromState(S.state, {
709
+ config: w,
710
+ from: S.from,
711
+ to: S.to
712
712
  });
713
- t = { controller: v, direction: "out" }, m.direction === "forward" ? v.forward() : v.backward();
713
+ t = { controller: g, direction: "out" }, S.direction === "forward" ? g.forward() : g.backward();
714
714
  function E() {
715
- !r || !i || (o && r.contains(o) ? r.insertBefore(i, o) : r.appendChild(i));
715
+ !r || !n || (s && r.contains(s) ? r.insertBefore(n, s) : r.appendChild(n));
716
716
  }
717
717
  };
718
- let f = null;
719
- return (u) => {
720
- if (u)
721
- return r = u.parentElement, o = u.nextElementSibling, (e == null ? void 0 : e.scope) === "local" ? queueMicrotask(() => {
722
- f = st(u), !(f && !rt(f)) && s(u);
723
- }) : s(u), () => {
724
- const h = u.isConnected ? u.cloneNode(!0) : u;
725
- f ? queueMicrotask(() => {
726
- document.contains(f) && l(h);
727
- }) : l(h);
728
- };
718
+ let f = null, h = !1;
719
+ const y = (l) => () => {
720
+ if (h) return;
721
+ h = !0;
722
+ const d = l.cloneNode(!0);
723
+ f ? queueMicrotask(() => {
724
+ document.contains(f) && u(d);
725
+ }) : u(d);
726
+ };
727
+ return (l) => {
728
+ if (l)
729
+ return r = l.parentElement, s = l.nextElementSibling, h = !1, (e == null ? void 0 : e.scope) === "local" ? queueMicrotask(() => {
730
+ f = ht(l), !(f && !mt(f)) && c(l);
731
+ }) : c(l), y(l);
729
732
  };
730
733
  }
731
- const at = 3, lt = (n) => {
732
- if (!n) return null;
733
- const e = n.split(`
734
+ const pt = 3, wt = (i) => {
735
+ if (!i) return null;
736
+ const e = i.split(`
734
737
  `).map((t) => t.trim());
735
- for (let t = at; t < Math.min(e.length, 6); t++) {
736
- const i = e[t], r = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
738
+ for (let t = pt; t < Math.min(e.length, 6); t++) {
739
+ const n = e[t], r = n == null ? void 0 : n.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
737
740
  if (!r)
738
741
  continue;
739
- const o = r[1] ?? "", c = r[2] ?? "0", a = r[3] ?? "0";
740
- return { file: o.split(/[\\/]/).pop() || o, line: c, column: a };
742
+ const s = r[1] ?? "", a = r[2] ?? "0", o = r[3] ?? "0";
743
+ return { file: s.split(/[\\/]/).pop() || s, line: a, column: o };
741
744
  }
742
745
  return null;
743
- }, R = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
744
- function ut(n, e, t) {
745
- R.set(n, e);
746
- let i = M.get(n);
747
- if (i)
748
- return i;
746
+ }, O = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
747
+ function yt(i, e, t) {
748
+ O.set(i, e);
749
+ let n = _.get(i);
750
+ if (n)
751
+ return n;
749
752
  const r = e;
750
- return i = ct(
753
+ return n = gt(
751
754
  () => {
752
- const o = R.get(n);
753
- return o || (console.warn(`Transition "${String(n)}" not found`), {});
755
+ const s = O.get(i);
756
+ return s || (console.warn(`Transition "${String(i)}" not found`), {});
754
757
  },
755
758
  {
756
759
  strategy: t == null ? void 0 : t.strategy,
757
760
  scope: t == null ? void 0 : t.scope,
758
761
  onCleanupEnd: () => {
759
- R.get(n) === r && W(n);
762
+ O.get(i) === r && Q(i);
760
763
  }
761
764
  }
762
- ), M.set(n, i), i;
765
+ ), _.set(i, n), n;
763
766
  }
764
- function W(n) {
765
- R.delete(n), M.delete(n);
767
+ function Q(i) {
768
+ O.delete(i), _.delete(i);
766
769
  }
767
- function ft() {
768
- const n = lt(new Error().stack);
769
- return n ? `auto_${n.file}_${n.line}_${n.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
770
+ function vt() {
771
+ const i = wt(new Error().stack);
772
+ return i ? `auto_${i.file}_${i.line}_${i.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
770
773
  }
771
- const L = globalThis.FinalizationRegistry, _ = L ? (
774
+ const Y = globalThis.FinalizationRegistry, U = Y ? (
772
775
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
773
- new L((n) => {
776
+ new Y((i) => {
774
777
  try {
775
- W(n);
778
+ Q(i);
776
779
  } catch {
777
780
  }
778
781
  })
779
782
  ) : void 0;
780
- function Ct(n) {
781
- const e = n.key ?? ft();
782
- if (n.ref && _)
783
+ function It(i) {
784
+ const e = i.key ?? vt();
785
+ if (i.ref && U)
783
786
  try {
784
- _.register(n.ref, e);
787
+ U.register(i.ref, e);
785
788
  } catch {
786
789
  }
787
- return ut(
790
+ return yt(
788
791
  e,
789
792
  {
790
- in: n.in,
791
- out: n.out
793
+ in: i.in,
794
+ out: i.out
792
795
  },
793
796
  {
794
- strategy: n[X],
795
- scope: n.scope
797
+ strategy: i[G],
798
+ scope: i.scope
796
799
  }
797
800
  );
798
801
  }
799
- function dt(n) {
800
- const e = n.filter((t) => t.symmetric).map((t) => ({
802
+ const b = /* @__PURE__ */ new Map();
803
+ let T = null, N = !1;
804
+ function Z(i) {
805
+ if (i instanceof HTMLElement && b.has(i)) {
806
+ const t = b.get(i);
807
+ b.delete(i), queueMicrotask(() => {
808
+ t();
809
+ });
810
+ }
811
+ const e = i.childNodes;
812
+ for (let t = 0; t < e.length; t++) {
813
+ const n = e[t];
814
+ n && Z(n);
815
+ }
816
+ }
817
+ function St() {
818
+ N || typeof document > "u" || (N = !0, T = new MutationObserver((i) => {
819
+ for (const e of i) {
820
+ const t = e.removedNodes;
821
+ for (let n = 0; n < t.length; n++) {
822
+ const r = t[n];
823
+ r && Z(r);
824
+ }
825
+ }
826
+ }), document.body ? T.observe(document.body, {
827
+ childList: !0,
828
+ subtree: !0
829
+ }) : document.addEventListener(
830
+ "DOMContentLoaded",
831
+ () => {
832
+ T == null || T.observe(document.body, {
833
+ childList: !0,
834
+ subtree: !0
835
+ });
836
+ },
837
+ { once: !0 }
838
+ ));
839
+ }
840
+ function Mt(i, e) {
841
+ St(), b.set(i, e);
842
+ }
843
+ function xt(i) {
844
+ return b.has(i);
845
+ }
846
+ function Ot() {
847
+ return b.size;
848
+ }
849
+ function Ft(i) {
850
+ const e = b.get(i);
851
+ return e ? (b.delete(i), e(), !0) : !1;
852
+ }
853
+ function Lt() {
854
+ b.clear(), T == null || T.disconnect(), T = null, N = !1;
855
+ }
856
+ function Ct(i) {
857
+ const e = i.filter((t) => t.symmetric).map((t) => ({
801
858
  from: t.to,
802
859
  to: t.from,
803
860
  transition: t.transition
804
861
  }));
805
- return [...n, ...e];
806
- }
807
- function mt(n) {
808
- let e = !1, t = 0, i = 0, r = !1;
809
- const o = 50, c = (p) => {
810
- if (!n) return;
811
- const S = p.touches[0];
812
- S && (r = S.clientX < o, r && (t = S.clientX, i = S.clientY));
813
- }, a = (p) => {
814
- if (!n || !r) return;
815
- const S = p.touches[0];
816
- if (!S) return;
817
- const y = S.clientX - t, m = S.clientY - i;
818
- y > window.outerWidth / 2 - 5 && Math.abs(y) > Math.abs(m) ? e = !0 : e = !1;
819
- }, s = () => {
820
- n && (r = !1, t = 0, i = 0);
821
- }, l = () => e, f = () => {
822
- typeof window > "u" || n && (window.addEventListener("touchstart", c, { passive: !0 }), window.addEventListener("touchmove", a, { passive: !0 }), window.addEventListener("touchend", s, { passive: !0 }));
823
- }, w = () => {
824
- typeof window > "u" || (window.removeEventListener("touchstart", c), window.removeEventListener("touchmove", a), window.removeEventListener("touchend", s));
862
+ return [...i, ...e];
863
+ }
864
+ function At(i) {
865
+ let e = !1, t = 0, n = 0, r = !1;
866
+ const s = 50, a = (l) => {
867
+ if (!i) return;
868
+ const d = l.touches[0];
869
+ d && (r = d.clientX < s, r && (t = d.clientX, n = d.clientY));
870
+ }, o = (l) => {
871
+ if (!i || !r) return;
872
+ const d = l.touches[0];
873
+ if (!d) return;
874
+ const A = d.clientX - t, k = d.clientY - n;
875
+ A > window.outerWidth / 2 - 5 && Math.abs(A) > Math.abs(k) ? e = !0 : e = !1;
876
+ }, c = () => {
877
+ i && (r = !1, t = 0, n = 0);
878
+ }, u = () => e, f = () => {
879
+ typeof window > "u" || i && (window.addEventListener("touchstart", a, { passive: !0 }), window.addEventListener("touchmove", o, { passive: !0 }), window.addEventListener("touchend", c, { passive: !0 }));
880
+ }, h = () => {
881
+ typeof window > "u" || (window.removeEventListener("touchstart", a), window.removeEventListener("touchmove", o), window.removeEventListener("touchend", c));
825
882
  };
826
- let u = 0;
883
+ let y = 0;
827
884
  return {
828
885
  initialize: f,
829
- cleanup: w,
830
- isSwipePending: l,
886
+ cleanup: h,
887
+ isSwipePending: u,
831
888
  resetSwipeDetection: () => {
832
- u++, u > 1 && (u = 0, e = !1);
889
+ y++, y > 1 && (y = 0, e = !1);
833
890
  }
834
891
  };
835
892
  }
836
- const ht = (n) => {
837
- let e = n.parentElement;
893
+ const Et = (i) => {
894
+ let e = i.parentElement;
838
895
  for (; e && e !== document.body; ) {
839
- const t = window.getComputedStyle(e), i = t.overflow + t.overflowY + t.overflowX;
840
- if (i.includes("auto") || i.includes("scroll") || e.scrollHeight > e.clientHeight || e.scrollWidth > e.clientWidth)
896
+ const t = window.getComputedStyle(e), n = t.overflow + t.overflowY + t.overflowX;
897
+ if (n.includes("auto") || n.includes("scroll") || e.scrollHeight > e.clientHeight || e.scrollWidth > e.clientWidth)
841
898
  return e;
842
899
  e = e.parentElement;
843
900
  }
844
901
  return document.documentElement;
845
- }, gt = (n) => {
846
- let e = n.parentElement;
902
+ }, Tt = (i) => {
903
+ let e = i.parentElement;
847
904
  for (; e && e !== document.body; ) {
848
905
  const t = window.getComputedStyle(e).position;
849
906
  if (t === "relative" || t === "absolute" || t === "fixed" || t === "sticky")
@@ -852,142 +909,154 @@ const ht = (n) => {
852
909
  }
853
910
  return document.body;
854
911
  };
855
- function pt() {
856
- let n = null, e = null;
912
+ function bt() {
913
+ let i = null, e = null;
857
914
  const t = /* @__PURE__ */ new Map();
858
- let i = null;
915
+ let n = null;
859
916
  const r = () => {
860
- n && i && t.set(i, {
861
- x: n.scrollLeft,
862
- y: n.scrollTop
917
+ i && n && t.set(n, {
918
+ x: i.scrollLeft,
919
+ y: i.scrollTop
863
920
  });
864
921
  };
865
922
  return {
866
- initializeContext: (f, w) => {
867
- e = f, n || (n = ht(f), (n === document.documentElement ? window : n).addEventListener("scroll", r, {
923
+ initializeContext: (f, h) => {
924
+ e = f, i || (i = Et(f), (i === document.documentElement ? window : i).addEventListener("scroll", r, {
868
925
  passive: !0
869
- })), i = w;
926
+ })), n = h;
870
927
  },
871
- calculateScrollOffset: (f, w) => {
872
- const u = f && t.has(f) ? t.get(f) : { x: 0, y: 0 }, h = w && t.has(w) ? t.get(w) : { x: 0, y: 0 };
928
+ calculateScrollOffset: (f, h) => {
929
+ const y = f && t.has(f) ? t.get(f) : { x: 0, y: 0 }, v = h && t.has(h) ? t.get(h) : { x: 0, y: 0 };
873
930
  return {
874
- x: -h.x + u.x,
875
- y: -h.y + u.y
931
+ x: -v.x + y.x,
932
+ y: -v.y + y.y
876
933
  };
877
934
  },
878
- getScrollContainer: () => n,
879
- getPositionedParentElement: () => e ? gt(e) : document.body,
935
+ getScrollContainer: () => i,
936
+ getPositionedParentElement: () => e ? Tt(e) : document.body,
880
937
  getScrollPosition: (f) => f && t.has(f) ? t.get(f) : { x: 0, y: 0 }
881
938
  };
882
939
  }
883
- function k(n, e) {
940
+ function x(i, e) {
884
941
  if (e === "*")
885
942
  return !0;
886
943
  if (e.endsWith("/*")) {
887
944
  const t = e.slice(0, -2);
888
- return n === t || n.startsWith(t + "/");
945
+ return i === t || i.startsWith(t + "/");
889
946
  }
890
- return n === e;
947
+ return i === e;
891
948
  }
892
- function wt(n, e, t) {
893
- for (const i of t)
894
- if (k(n, i.from) && k(e, i.to))
895
- return i.transition;
896
- for (const i of t)
897
- if ((i.from === "*" || k(n, i.from)) && (i.to === "*" || k(e, i.to)))
898
- return i.transition;
949
+ function kt(i, e, t) {
950
+ for (const n of t)
951
+ if (x(i, n.from) && x(e, n.to))
952
+ return n.transition;
953
+ for (const n of t)
954
+ if ((n.from === "*" || x(i, n.from)) && (n.to === "*" || x(e, n.to)))
955
+ return n.transition;
899
956
  return null;
900
957
  }
901
- function At(n) {
958
+ function Dt(i, e) {
902
959
  const {
903
- transitions: e = [],
904
- defaultTransition: t,
905
- middleware: i = (y, m) => ({ from: y, to: m }),
960
+ transitions: t = [],
961
+ defaultTransition: n,
962
+ middleware: r = (w, g) => ({ from: w, to: g }),
906
963
  // Identity function as default
907
- skipOnIosSwipe: r = !0
964
+ skipOnIosSwipe: s = !0
908
965
  // Default to true - skip animations on iOS swipe
909
- } = n;
966
+ } = i, { outFirst: a = !0 } = e || {};
910
967
  let o = null;
911
- const c = dt(e), {
912
- initializeContext: a,
913
- calculateScrollOffset: s,
914
- getScrollContainer: l,
915
- getPositionedParentElement: f,
916
- getScrollPosition: w
917
- } = pt(), u = mt(r);
918
- u.initialize();
919
- function h() {
968
+ const c = Ct(t), {
969
+ initializeContext: u,
970
+ calculateScrollOffset: f,
971
+ getScrollContainer: h,
972
+ getPositionedParentElement: y,
973
+ getScrollPosition: v
974
+ } = bt(), l = At(s);
975
+ l.initialize();
976
+ function d() {
920
977
  if (o != null && o.from && (o != null && o.to)) {
921
- const { from: y, to: m } = i(
978
+ const { from: w, to: g } = r(
922
979
  o.from,
923
980
  o.to
924
- ), C = wt(
925
- y,
926
- m,
981
+ ), C = kt(
982
+ w,
983
+ g,
927
984
  c
928
- ) || t, v = s(
985
+ ) || n, R = f(
929
986
  o.from,
930
987
  o.to
931
- ), E = {
932
- scrollOffset: v,
933
- scroll: w(o.from),
988
+ ), P = {
989
+ scrollOffset: R,
990
+ scroll: v(o.from),
934
991
  get scrollingElement() {
935
- return l() || document.documentElement;
992
+ return h() || document.documentElement;
936
993
  },
937
994
  get positionedParent() {
938
- return f();
995
+ return y();
939
996
  }
940
- }, A = {
941
- scrollOffset: v,
997
+ }, tt = {
998
+ scrollOffset: R,
942
999
  get scroll() {
943
- return o ? w(o.to) : { x: 0, y: 0 };
1000
+ return o ? v(o.to) : { x: 0, y: 0 };
944
1001
  },
945
1002
  get scrollingElement() {
946
- return l() || document.documentElement;
1003
+ return h() || document.documentElement;
947
1004
  },
948
1005
  get positionedParent() {
949
- return f();
1006
+ return y();
950
1007
  }
951
1008
  };
952
1009
  C && (C.out && o.outResolve && o.outResolve(
953
- (T) => C.out(T, E)
1010
+ (D) => C.out(D, P)
954
1011
  ), C.in && o.inResolve && o.inResolve(
955
- (T) => C.in(T, A)
1012
+ (D) => C.in(D, tt)
956
1013
  )), o = null;
957
1014
  }
958
1015
  }
959
- const p = async (y, m) => u.isSwipePending() ? (u.resetSwipeDetection(), () => ({})) : m === "in" && (!o || !o.from) ? () => ({}) : (o || (o = {}), m === "out" ? (o.from = y, new Promise((g) => {
960
- o.outResolve = g, h();
961
- })) : (o.to = y, new Promise((g) => {
962
- o.inResolve = g, h();
1016
+ function A() {
1017
+ o && (o.inResolve && o.inResolve(() => ({})), o.outResolve && o.outResolve(() => ({})), o = null);
1018
+ }
1019
+ const S = a ? async (w, g) => l.isSwipePending() ? (l.resetSwipeDetection(), () => ({})) : g === "in" && (!o || !o.from) ? () => ({}) : (o || (o = {}), g === "out" ? (o.from = w, new Promise((E) => {
1020
+ o.outResolve = E, d();
1021
+ })) : (o.to = w, new Promise((E) => {
1022
+ o.inResolve = E, d();
1023
+ }))) : async (w, g) => l.isSwipePending() ? (l.resetSwipeDetection(), () => ({})) : (o && (g === "out" && o.from && o.from !== w || g === "in" && o.to && o.to !== w) && A(), o || (o = {}), g === "out" ? (o.from = w, new Promise((C) => {
1024
+ o.outResolve = C, d();
1025
+ })) : (o.to = w, new Promise((C) => {
1026
+ o.inResolve = C, d();
963
1027
  })));
964
- return (y) => ({
965
- key: y,
966
- in: async (m) => (a(m, y), (await p(y, "in"))(m)),
967
- out: async (m) => (await p(y, "out"))(m),
1028
+ return (w) => ({
1029
+ key: w,
1030
+ in: async (g) => (u(g, w), (await S(w, "in"))(g)),
1031
+ out: async (g) => (await S(w, "out"))(g),
968
1032
  // Add page transition strategy for page-level transitions
969
- [X]: ot
1033
+ [G]: dt
970
1034
  });
971
1035
  }
972
1036
  export {
973
- $ as SCOPE_ATTR,
974
- j as SCOPE_READY_ATTR,
975
- X as TRANSITION_STRATEGY,
976
- nt as createDefaultStrategy,
977
- ot as createPageTransitionStrategy,
978
- At as createSggoiTransitionContext,
979
- vt as createTransitionScope,
980
- st as findScope,
981
- ft as generateAutoKey,
982
- Vt as isCssAnimation,
983
- bt as isMultiSpring,
984
- rt as isScopeReady,
985
- kt as isSingleSpring,
986
- Rt as isTickAnimation,
987
- Mt as jaeminInternal,
988
- F as normalizeMultiSpringSchedule,
989
- V as normalizeToMultiSpring,
990
- Ct as transition,
991
- It as validateAnimationMode,
992
- Pt as validateSpringItem
1037
+ B as SCOPE_ATTR,
1038
+ J as SCOPE_READY_ATTR,
1039
+ G as TRANSITION_STRATEGY,
1040
+ ft as createDefaultStrategy,
1041
+ dt as createPageTransitionStrategy,
1042
+ Dt as createSggoiTransitionContext,
1043
+ Pt as createTransitionScope,
1044
+ ht as findScope,
1045
+ vt as generateAutoKey,
1046
+ Ot as getWatchedCount,
1047
+ Nt as isCssAnimation,
1048
+ Ht as isMultiSpring,
1049
+ mt as isScopeReady,
1050
+ qt as isSingleSpring,
1051
+ Yt as isTickAnimation,
1052
+ xt as isWatched,
1053
+ $t as jaeminInternal,
1054
+ H as normalizeMultiSpringSchedule,
1055
+ I as normalizeToMultiSpring,
1056
+ Lt as resetObserver,
1057
+ It as transition,
1058
+ Ft as triggerUnmount,
1059
+ Ut as validateAnimationMode,
1060
+ Wt as validateSpringItem,
1061
+ Mt as watchUnmount
993
1062
  };