@ssgoi/core 2.4.0 → 2.5.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,108 +1,109 @@
1
- var M = Object.defineProperty;
2
- var U = (o, t, n) => t in o ? M(o, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[t] = n;
3
- var g = (o, t, n) => U(o, typeof t != "symbol" ? t + "" : t, n);
4
- import { animate as T } from "popmotion";
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";
5
6
  class A {
6
7
  constructor(t) {
7
- g(this, "options");
8
- g(this, "currentValue");
9
- g(this, "velocity");
10
- g(this, "isAnimating", !1);
11
- g(this, "controls", null);
8
+ v(this, "options");
9
+ v(this, "currentValue");
10
+ v(this, "velocity");
11
+ v(this, "isAnimating", !1);
12
+ v(this, "controls", null);
12
13
  // For object animations
13
- g(this, "animationMap", null);
14
- g(this, "activeAnimations", /* @__PURE__ */ new Set());
15
- g(this, "completedAnimations", /* @__PURE__ */ new Set());
16
- g(this, "updatedProperties", /* @__PURE__ */ new Set());
17
- g(this, "animate", (t = !1) => {
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) => {
18
19
  !this.isAnimating && this.options.onStart && this.options.onStart(), this.isAnimating = !0;
19
20
  const n = t ? this.options.from : this.options.to;
20
21
  if (typeof this.currentValue == "object" && this.currentValue !== null) {
21
22
  this.animateObject(n);
22
23
  return;
23
24
  }
24
- let e = this.currentValue, i = performance.now();
25
- const f = {
25
+ let o = this.currentValue, s = performance.now();
26
+ const i = {
26
27
  from: this.currentValue,
27
28
  to: n,
28
29
  stiffness: this.options.spring.stiffness,
29
30
  damping: this.options.spring.damping,
30
31
  mass: 1
31
32
  };
32
- typeof this.velocity == "number" && (f.velocity = this.velocity * 1e3), this.controls = T({
33
- ...f,
34
- onUpdate: (l) => {
35
- const h = performance.now(), a = (h - i) / 1e3;
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;
36
37
  if (a > 0) {
37
- if (typeof l == "number" && typeof e == "number") {
38
- const p = (l - e) / a;
39
- this.velocity = p / 1e3;
40
- } else if (typeof l == "object" && l !== null) {
41
- const p = {};
42
- Object.keys(l).forEach((c) => {
43
- const s = l[c], u = e[c];
44
- if (typeof s == "number" && typeof u == "number") {
45
- const d = (s - u) / a;
46
- p[c] = d / 1e3;
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;
47
48
  }
48
- }), this.velocity = p;
49
+ }), this.velocity = m;
49
50
  }
50
- e = l, i = h;
51
+ o = u, s = d;
51
52
  }
52
- this.currentValue = l, this.options.onUpdate(l);
53
+ this.currentValue = u, this.options.onUpdate(u);
53
54
  },
54
55
  onComplete: () => {
55
- this.currentValue = n, this.isAnimating = !1, this.controls = null, typeof this.velocity == "object" && this.velocity !== null ? Object.keys(this.velocity).forEach((l) => {
56
- this.velocity[l] = 0;
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;
57
58
  }) : this.velocity = 0, this.options.onComplete();
58
59
  }
59
60
  });
60
61
  });
61
- g(this, "animateObject", (t) => {
62
- const n = this.currentValue, e = Object.keys(n);
62
+ v(this, "animateObject", (t) => {
63
+ const n = this.currentValue, o = Object.keys(n);
63
64
  this.animationMap = /* @__PURE__ */ new Map(), this.activeAnimations.clear(), this.completedAnimations.clear(), this.updatedProperties.clear();
64
- const i = { ...n }, f = {};
65
- let l = !1;
66
- const h = () => {
67
- const a = e.filter((c) => !this.completedAnimations.has(c));
65
+ const s = { ...n }, i = {};
66
+ let u = !1;
67
+ const d = () => {
68
+ const a = o.filter((l) => !this.completedAnimations.has(l));
68
69
  if (a.every(
69
- (c) => this.updatedProperties.has(c)
70
+ (l) => this.updatedProperties.has(l)
70
71
  ) && a.length > 0) {
71
72
  if (typeof this.velocity == "object" && this.velocity) {
72
- const c = performance.now();
73
- Object.keys(i).forEach((s) => {
74
- if (f[s]) {
75
- const u = (c - f[s]) / 1e3, d = this.currentValue[s], r = i[s];
76
- typeof d == "number" && typeof r == "number" && u > 0 && (this.velocity[s] = (r - d) / u / 1e3);
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);
77
78
  }
78
- f[s] = c;
79
+ i[r] = l;
79
80
  });
80
81
  }
81
- this.currentValue = { ...i }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !l && this.options.onStart && (l = !0, this.options.onStart());
82
+ this.currentValue = { ...s }, this.options.onUpdate(this.currentValue), this.updatedProperties.clear(), !u && this.options.onStart && (u = !0, this.options.onStart());
82
83
  }
83
84
  };
84
- e.forEach((a) => {
85
+ o.forEach((a) => {
85
86
  this.activeAnimations.add(a);
86
- const p = {
87
+ const m = {
87
88
  from: n[a],
88
89
  to: t[a],
89
90
  stiffness: this.options.spring.stiffness,
90
91
  damping: this.options.spring.damping,
91
92
  mass: 1
92
93
  };
93
- typeof this.velocity == "object" && this.velocity && a in this.velocity && (p.velocity = this.velocity[a] * 1e3);
94
- const c = T({
95
- ...p,
96
- onUpdate: (s) => {
97
- i[a] = s, this.updatedProperties.add(a), h();
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();
98
99
  },
99
100
  onComplete: () => {
100
- this.completedAnimations.add(a), this.updatedProperties.delete(a), this.completedAnimations.size === e.length && (this.currentValue = t, this.isAnimating = !1, this.animationMap = null, typeof this.velocity == "object" && this.velocity && Object.keys(this.velocity).forEach((s) => {
101
- this.velocity[s] = 0;
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;
102
103
  }), this.options.onComplete());
103
104
  }
104
105
  });
105
- this.animationMap.set(a, c);
106
+ this.animationMap.set(a, l);
106
107
  });
107
108
  });
108
109
  if (this.options = {
@@ -116,8 +117,8 @@ class A {
116
117
  onStart: t.onStart
117
118
  }, this.currentValue = this.options.from, typeof this.options.from == "object" && this.options.from !== null) {
118
119
  const n = {};
119
- Object.keys(this.options.from).forEach((e) => {
120
- n[e] = 0;
120
+ Object.keys(this.options.from).forEach((o) => {
121
+ n[o] = 0;
121
122
  }), this.velocity = n;
122
123
  } else
123
124
  this.velocity = 0;
@@ -178,31 +179,31 @@ class A {
178
179
  }
179
180
  // Static factory method
180
181
  static fromState(t, n) {
181
- const e = new A(n);
182
- return e.setValue(t.position), e.setVelocity(t.velocity), e;
182
+ const o = new A(n);
183
+ return o.setValue(t.position), o.setVelocity(t.velocity), o;
183
184
  }
184
185
  }
185
- const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
186
+ const j = Symbol.for("TRANSITION_STRATEGY"), D = (e) => ({
186
187
  runIn: async (t) => {
187
- const { currentAnimation: n } = o;
188
+ const { currentAnimation: n } = e;
188
189
  if (n && n.direction === "out") {
189
- const l = n.animator.getCurrentState();
190
+ const u = n.animator.getCurrentState();
190
191
  if (n.animator.stop(), t.out) {
191
- const h = await t.out, { from: a = 1, to: p = 0 } = h;
192
+ const d = await t.out, { from: a = 1, to: m = 0 } = d;
192
193
  return {
193
- config: h,
194
- state: l,
194
+ config: d,
195
+ state: u,
195
196
  from: a,
196
197
  // OUT animation's from
197
- to: p,
198
+ to: m,
198
199
  // OUT animation's to
199
200
  direction: "backward"
200
201
  // Will actually go 0→1
201
202
  };
202
203
  }
203
204
  }
204
- const e = await t.in;
205
- if (!e)
205
+ const o = await t.in;
206
+ if (!o)
206
207
  return {
207
208
  state: {
208
209
  position: 0,
@@ -212,41 +213,41 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
212
213
  to: 1,
213
214
  direction: "forward"
214
215
  };
215
- const { from: i = 0, to: f = 1 } = e;
216
+ const { from: s = 0, to: i = 1 } = o;
216
217
  return {
217
- config: e,
218
+ config: o,
218
219
  state: {
219
- position: i,
220
+ position: s,
220
221
  velocity: 0
221
222
  },
222
- from: i,
223
- to: f,
223
+ from: s,
224
+ to: i,
224
225
  direction: "forward"
225
226
  };
226
227
  },
227
228
  runOut: async (t) => {
228
- const { currentAnimation: n } = o;
229
+ const { currentAnimation: n } = e;
229
230
  if (n && n.direction === "in") {
230
- const l = n.animator.getCurrentState();
231
+ const u = n.animator.getCurrentState();
231
232
  if (n.animator.stop(), t.in) {
232
- const h = await t.in, { from: a = 0, to: p = 1 } = h;
233
+ const d = await t.in, { from: a = 0, to: m = 1 } = d;
233
234
  return {
234
- config: h,
235
+ config: d,
235
236
  state: {
236
- position: l.position,
237
- velocity: l.velocity
237
+ position: u.position,
238
+ velocity: u.velocity
238
239
  },
239
240
  from: a,
240
241
  // IN animation's from
241
- to: p,
242
+ to: m,
242
243
  // IN animation's to
243
244
  direction: "backward"
244
245
  // Will actually go 1→0
245
246
  };
246
247
  }
247
248
  }
248
- const e = await t.out;
249
- if (!e)
249
+ const o = await t.out;
250
+ if (!o)
250
251
  return {
251
252
  state: {
252
253
  position: 1,
@@ -256,21 +257,21 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
256
257
  to: 0,
257
258
  direction: "forward"
258
259
  };
259
- const { from: i = 1, to: f = 0 } = e;
260
+ const { from: s = 1, to: i = 0 } = o;
260
261
  return {
261
- config: e,
262
+ config: o,
262
263
  state: {
263
- position: i,
264
+ position: s,
264
265
  velocity: 0
265
266
  },
266
- from: i,
267
- to: f,
267
+ from: s,
268
+ to: i,
268
269
  direction: "forward"
269
270
  };
270
271
  }
271
- }), I = () => ({
272
- runIn: async (o) => {
273
- const t = await o.in;
272
+ }), z = () => ({
273
+ runIn: async (e) => {
274
+ const t = await e.in;
274
275
  if (!t)
275
276
  return {
276
277
  state: {
@@ -281,7 +282,7 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
281
282
  to: 1,
282
283
  direction: "forward"
283
284
  };
284
- const { from: n = 0, to: e = 1 } = t;
285
+ const { from: n = 0, to: o = 1 } = t;
285
286
  return {
286
287
  config: t,
287
288
  state: {
@@ -289,12 +290,12 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
289
290
  velocity: 0
290
291
  },
291
292
  from: n,
292
- to: e,
293
+ to: o,
293
294
  direction: "forward"
294
295
  };
295
296
  },
296
- runOut: async (o) => {
297
- const t = await o.out;
297
+ runOut: async (e) => {
298
+ const t = await e.out;
298
299
  if (!t)
299
300
  return {
300
301
  state: {
@@ -305,7 +306,7 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
305
306
  to: 0,
306
307
  direction: "forward"
307
308
  };
308
- const { from: n = 1, to: e = 0 } = t;
309
+ const { from: n = 1, to: o = 0 } = t;
309
310
  return {
310
311
  config: t,
311
312
  state: {
@@ -313,141 +314,141 @@ const O = Symbol.for("TRANSITION_STRATEGY"), _ = (o) => ({
313
314
  velocity: 0
314
315
  },
315
316
  from: n,
316
- to: e,
317
+ to: o,
317
318
  direction: "forward"
318
319
  };
319
320
  }
320
321
  });
321
- function N(o, t) {
322
- var c;
323
- let n = null, e = null, i = null, f = null;
324
- const l = {
322
+ function N(e, t) {
323
+ var l;
324
+ let n = null, o = null, s = null, i = null;
325
+ const u = {
325
326
  get currentAnimation() {
326
327
  return n;
327
328
  }
328
- }, h = ((c = t == null ? void 0 : t.strategy) == null ? void 0 : c.call(t, l)) || _(l), a = async (s) => {
329
- var y, v;
330
- e && (e.remove(), e = null);
331
- const u = o(), d = {
332
- in: u.in && Promise.resolve(u.in(s)),
333
- out: u.out && Promise.resolve(u.out(s))
334
- }, r = await h.runIn(d);
335
- if (!r.config)
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)
336
337
  return;
337
- (v = (y = r.config).prepare) == null || v.call(y, s), r.config.wait && await r.config.wait();
338
- const m = A.fromState(r.state, {
339
- from: r.from,
340
- to: r.to,
341
- spring: r.config.spring,
342
- onStart: r.config.onStart,
343
- onUpdate: r.config.tick,
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,
344
345
  onComplete: () => {
345
- var w, S;
346
- n = null, (S = (w = r.config) == null ? void 0 : w.onEnd) == null || S.call(w);
346
+ var y, w;
347
+ n = null, (w = (y = c.config) == null ? void 0 : y.onEnd) == null || w.call(y);
347
348
  }
348
349
  });
349
- n = { animator: m, direction: "in" }, r.direction === "forward" ? m.forward() : m.backward();
350
- }, p = async (s) => {
351
- var v, w;
352
- e = s;
353
- const u = o(), d = {
354
- in: u.in && Promise.resolve(u.in(s)),
355
- out: u.out && Promise.resolve(u.out(s))
356
- }, r = await h.runOut(d);
357
- if (!r.config)
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)
358
359
  return;
359
- (w = (v = r.config).prepare) == null || w.call(v, s), y(), r.config.wait && await r.config.wait();
360
- const m = A.fromState(r.state, {
361
- from: r.from,
362
- to: r.to,
363
- spring: r.config.spring,
364
- onStart: r.config.onStart,
365
- onUpdate: r.config.tick,
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,
366
367
  onComplete: () => {
367
- var S, C, b;
368
- (C = (S = r.config) == null ? void 0 : S.onEnd) == null || C.call(S), e && (e.remove(), e = null), n = null, (b = t == null ? void 0 : t.onCleanupEnd) == null || b.call(t);
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);
369
370
  }
370
371
  });
371
- n = { animator: m, direction: "out" }, r.direction === "forward" ? m.forward() : m.backward();
372
- function y() {
373
- !i || !e || (f && i.contains(f) ? i.insertBefore(e, f) : i.appendChild(e));
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));
374
375
  }
375
376
  };
376
- return (s) => {
377
- if (s)
378
- return i = s.parentElement, f = s.nextElementSibling, a(s), () => {
379
- const u = s.cloneNode(!0);
380
- p(u);
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);
381
382
  };
382
383
  };
383
384
  }
384
- const D = 3, z = (o) => {
385
- if (!o) return null;
386
- const t = o.split(`
385
+ const L = 3, $ = (e) => {
386
+ if (!e) return null;
387
+ const t = e.split(`
387
388
  `).map((n) => n.trim());
388
- for (let n = D; n < Math.min(t.length, 6); n++) {
389
- const e = t[n], i = e == null ? void 0 : e.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
390
- if (!i)
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)
391
392
  continue;
392
- const f = i[1] ?? "", l = i[2] ?? "0", h = i[3] ?? "0";
393
- return { file: f.split(/[\\/]/).pop() || f, line: l, column: h };
393
+ const i = s[1] ?? "", u = s[2] ?? "0", d = s[3] ?? "0";
394
+ return { file: i.split(/[\\/]/).pop() || i, line: u, column: d };
394
395
  }
395
396
  return null;
396
- }, V = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map();
397
- function $(o, t, n) {
398
- V.set(o, t);
399
- let e = P.get(o);
400
- return e || (e = N(
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(
401
402
  () => {
402
- const i = V.get(o);
403
- return i || (console.warn(`Transition "${String(o)}" not found`), {});
403
+ const s = V.get(e);
404
+ return s || (console.warn(`Transition "${String(e)}" not found`), {});
404
405
  },
405
406
  {
406
407
  strategy: n,
407
- onCleanupEnd: () => j(o)
408
+ onCleanupEnd: () => M(e)
408
409
  }
409
- ), P.set(o, e), e);
410
+ ), T.set(e, o), o);
410
411
  }
411
- function j(o) {
412
- V.delete(o), P.delete(o);
412
+ function M(e) {
413
+ V.delete(e), T.delete(e);
413
414
  }
414
415
  function F() {
415
- const o = z(new Error().stack);
416
- return o ? `auto_${o.file}_${o.line}_${o.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
416
+ const e = $(new Error().stack);
417
+ return e ? `auto_${e.file}_${e.line}_${e.column}` : Symbol(`ssgoi_auto_${Date.now()}`);
417
418
  }
418
- const x = globalThis.FinalizationRegistry, R = x ? new x((o) => {
419
+ const O = globalThis.FinalizationRegistry, R = O ? new O((e) => {
419
420
  try {
420
- j(o);
421
+ M(e);
421
422
  } catch {
422
423
  }
423
424
  }) : void 0;
424
- function X(o) {
425
- const t = o.key ?? F();
426
- if (o.ref && R)
425
+ function J(e) {
426
+ const t = e.key ?? F();
427
+ if (e.ref && R)
427
428
  try {
428
- R.register(o.ref, t);
429
+ R.register(e.ref, t);
429
430
  } catch {
430
431
  }
431
- return $(
432
+ return k(
432
433
  t,
433
434
  {
434
- in: o.in,
435
- out: o.out
435
+ in: e.in,
436
+ out: e.out
436
437
  },
437
- o[O]
438
+ e[j]
438
439
  );
439
440
  }
440
- const K = (o) => {
441
- let t = o.parentElement;
441
+ const K = (e) => {
442
+ let t = e.parentElement;
442
443
  for (; t && t !== document.body; ) {
443
- const n = window.getComputedStyle(t), e = n.overflow + n.overflowY + n.overflowX;
444
- if (e.includes("auto") || e.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
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)
445
446
  return t;
446
447
  t = t.parentElement;
447
448
  }
448
449
  return document.documentElement;
449
- }, W = (o) => {
450
- let t = o.parentElement;
450
+ }, W = (e) => {
451
+ let t = e.parentElement;
451
452
  for (; t && t !== document.body; ) {
452
453
  const n = window.getComputedStyle(t).position;
453
454
  if (n === "relative" || n === "absolute" || n === "fixed" || n === "sticky")
@@ -456,133 +457,158 @@ const K = (o) => {
456
457
  }
457
458
  return document.body;
458
459
  };
459
- function k(o) {
460
- const t = o.filter((n) => n.symmetric).map((n) => ({
460
+ function X(e) {
461
+ const t = e.filter((n) => n.symmetric).map((n) => ({
461
462
  from: n.to,
462
463
  to: n.from,
463
464
  transition: n.transition
464
465
  }));
465
- return [...o, ...t];
466
+ return [...e, ...t];
466
467
  }
467
- function L() {
468
- let o = null, t = null;
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(() => {
476
+ t = !1;
477
+ }, 500)), n = !1);
478
+ };
479
+ return {
480
+ initialize: () => {
481
+ typeof window > "u" || e && (window.addEventListener("touchstart", o, { passive: !0 }), window.addEventListener("touchend", s, { passive: !0 }));
482
+ },
483
+ cleanup: () => {
484
+ typeof window > "u" || (window.removeEventListener("touchstart", o), window.removeEventListener("touchend", s));
485
+ },
486
+ isSwipePending: () => t
487
+ };
488
+ }
489
+ function G() {
490
+ let e = null, t = null;
469
491
  const n = /* @__PURE__ */ new Map();
470
- let e = null;
471
- const i = () => {
472
- o && e && n.set(e, {
473
- x: o.scrollLeft,
474
- y: o.scrollTop
492
+ let o = null;
493
+ const s = () => {
494
+ e && o && n.set(o, {
495
+ x: e.scrollLeft,
496
+ y: e.scrollTop
475
497
  });
476
498
  };
477
499
  return {
478
- initializeContext: (c, s) => {
479
- t = c, o || (o = K(c), (o === document.documentElement ? window : o).addEventListener("scroll", i, {
500
+ initializeContext: (l, r) => {
501
+ t = l, e || (e = K(l), (e === document.documentElement ? window : e).addEventListener("scroll", s, {
480
502
  passive: !0
481
- })), e = s;
503
+ })), o = r;
482
504
  },
483
- calculateScrollOffset: (c, s) => {
484
- const u = c && n.has(c) ? n.get(c) : { x: 0, y: 0 }, d = s && n.has(s) ? n.get(s) : { x: 0, y: 0 };
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 };
485
507
  return {
486
- x: -d.x + u.x,
487
- y: -d.y + u.y
508
+ x: -g.x + f.x,
509
+ y: -g.y + f.y
488
510
  };
489
511
  },
490
- getScrollContainer: () => o,
512
+ getScrollContainer: () => e,
491
513
  getPositionedParentElement: () => t ? W(t) : document.body,
492
- getScrollPosition: (c) => c && n.has(c) ? n.get(c) : { x: 0, y: 0 }
514
+ getScrollPosition: (l) => l && n.has(l) ? n.get(l) : { x: 0, y: 0 }
493
515
  };
494
516
  }
495
- function B(o) {
517
+ function Q(e) {
496
518
  const {
497
519
  transitions: t = [],
498
520
  defaultTransition: n,
499
- middleware: e = (r, m) => ({ from: r, to: m })
521
+ middleware: o = (p, h) => ({ from: p, to: h }),
500
522
  // Identity function as default
501
- } = o;
523
+ skipOnIosSwipe: s = !0
524
+ // Default to true - skip animations on iOS swipe
525
+ } = e;
502
526
  let i = null;
503
- const f = k(t), {
504
- initializeContext: l,
505
- calculateScrollOffset: h,
506
- getScrollContainer: a,
507
- getPositionedParentElement: p,
508
- getScrollPosition: c
509
- } = L();
510
- function s() {
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() {
511
536
  if (i != null && i.from && (i != null && i.to)) {
512
- const { from: r, to: m } = e(
537
+ const { from: p, to: h } = o(
513
538
  i.from,
514
539
  i.to
515
- ), v = Y(
516
- r,
517
- m,
518
- f
519
- ) || n, w = h(
540
+ ), w = H(
541
+ p,
542
+ h,
543
+ u
544
+ ) || n, b = a(
520
545
  i.from,
521
546
  i.to
522
- ), S = {
523
- scrollOffset: w,
524
- scroll: c(i.from),
547
+ ), C = {
548
+ scrollOffset: b,
549
+ scroll: r(i.from),
525
550
  get scrollingElement() {
526
- return a() || document.documentElement;
551
+ return m() || document.documentElement;
527
552
  },
528
553
  get positionedParent() {
529
- return p();
554
+ return l();
530
555
  }
531
- }, C = {
532
- scrollOffset: w,
556
+ }, U = {
557
+ scrollOffset: b,
533
558
  get scroll() {
534
- return i ? c(i.to) : { x: 0, y: 0 };
559
+ return i ? r(i.to) : { x: 0, y: 0 };
535
560
  },
536
561
  get scrollingElement() {
537
- return a() || document.documentElement;
562
+ return m() || document.documentElement;
538
563
  },
539
564
  get positionedParent() {
540
- return p();
565
+ return l();
541
566
  }
542
567
  };
543
- v && (v.out && i.outResolve && i.outResolve(
544
- (b) => v.out(b, S)
545
- ), v.in && i.inResolve && i.inResolve(
546
- (b) => v.in(b, C)
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)
547
572
  )), i = null;
548
573
  }
549
574
  }
550
- const u = async (r, m) => m === "in" && (!i || !i.from) ? () => ({}) : (i || (i = {}), m === "out" ? (i.from = r, new Promise((y) => {
551
- i.outResolve = y, s();
552
- })) : (i.to = r, new Promise((y) => {
553
- i.inResolve = y, s();
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();
554
579
  })));
555
- return (r) => ({
556
- key: r,
557
- in: async (m) => (l(m, r), (await u(r, "in"))(m)),
558
- out: async (m) => (await u(r, "out"))(m),
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),
559
584
  // Add page transition strategy for page-level transitions
560
- [O]: I
585
+ [j]: z
561
586
  });
562
587
  }
563
- function Y(o, t, n) {
564
- for (const e of n)
565
- if (E(o, e.from) && E(t, e.to))
566
- return e.transition;
567
- for (const e of n)
568
- if ((e.from === "*" || E(o, e.from)) && (e.to === "*" || E(t, e.to)))
569
- return e.transition;
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;
570
595
  return null;
571
596
  }
572
- function E(o, t) {
597
+ function E(e, t) {
573
598
  if (t === "*")
574
599
  return !0;
575
600
  if (t.endsWith("/*")) {
576
601
  const n = t.slice(0, -2);
577
- return o === n || o.startsWith(n + "/");
602
+ return e === n || e.startsWith(n + "/");
578
603
  }
579
- return o === t;
604
+ return e === t;
580
605
  }
581
606
  export {
582
- O as TRANSITION_STRATEGY,
583
- _ as createDefaultStrategy,
584
- I as createPageTransitionStrategy,
585
- B as createSggoiTransitionContext,
607
+ j as TRANSITION_STRATEGY,
608
+ D as createDefaultStrategy,
609
+ z as createPageTransitionStrategy,
610
+ Q as createSggoiTransitionContext,
586
611
  F as generateAutoKey,
587
- X as transition
612
+ nt as jaeminInternal,
613
+ J as transition
588
614
  };