@ssgoi/core 2.5.0 → 2.5.2

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