@ssgoi/core 7.0.0-beta.2 → 7.0.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/internal.js CHANGED
@@ -1,52 +1,52 @@
1
1
  var Ht = Object.defineProperty;
2
- var Wt = (t, e, n) => e in t ? Ht(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var U = (t, e, n) => Wt(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { A as Bt } from "./multi-animation-ZFZBDBGr.js";
5
- import { M as Me, W as ke } from "./multi-animation-ZFZBDBGr.js";
6
- class Ft extends Bt {
2
+ var Wt = (t, n, e) => n in t ? Ht(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
+ var Z = (t, n, e) => Wt(t, typeof n != "symbol" ? n + "" : n, e);
4
+ import { A as Ft } from "./multi-animation-ZFZBDBGr.js";
5
+ import { M as Me, W as Le } from "./multi-animation-ZFZBDBGr.js";
6
+ class Bt extends Ft {
7
7
  constructor() {
8
8
  super(...arguments);
9
- U(this, "child", null);
10
- U(this, "_state", "idle");
11
- U(this, "_settled", !1);
12
- U(this, "listeners", /* @__PURE__ */ new Set());
9
+ Z(this, "child", null);
10
+ Z(this, "_state", "idle");
11
+ Z(this, "_settled", !1);
12
+ Z(this, "listeners", /* @__PURE__ */ new Set());
13
13
  }
14
- attach(n) {
15
- const s = this.child;
16
- if (this.child = n, this._settled = !1, s) {
17
- const l = s.getPose();
18
- s.complete(), n.matchInto(l);
14
+ attach(e) {
15
+ const o = this.child;
16
+ if (this.child = e, this._settled = !1, o) {
17
+ const a = o.getPose();
18
+ o.complete(), e.matchInto(a);
19
19
  }
20
- n.playbackRate = this.playbackRate;
21
- const r = n.onComplete;
22
- n.onComplete = () => {
23
- r == null || r(), this.child === n && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
20
+ e.playbackRate = this.playbackRate;
21
+ const r = e.onComplete;
22
+ e.onComplete = () => {
23
+ r == null || r(), this.child === e && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
24
24
  };
25
- const i = n.onUpdate;
26
- n.onUpdate = (l) => {
27
- var a;
28
- i == null || i(l), (a = this.onUpdate) == null || a.call(this, l), this.notify();
29
- }, this._state === "paused" ? n.pause() : this._state === "reversing" ? n.reverse() : (this._state = "playing", n.play()), this.notify();
25
+ const i = e.onUpdate;
26
+ e.onUpdate = (a) => {
27
+ var u;
28
+ i == null || i(a), (u = this.onUpdate) == null || u.call(this, a), this.notify();
29
+ }, this._state === "paused" ? e.pause() : this._state === "reversing" ? e.reverse() : (this._state = "playing", e.play()), this.notify();
30
30
  }
31
31
  play() {
32
- var n;
33
- this._state = "playing", this._settled = !1, (n = this.child) == null || n.play(), this.notify();
32
+ var e;
33
+ this._state = "playing", this._settled = !1, (e = this.child) == null || e.play(), this.notify();
34
34
  }
35
35
  reverse() {
36
- var n;
37
- this._state = "reversing", this._settled = !1, (n = this.child) == null || n.reverse(), this.notify();
36
+ var e;
37
+ this._state = "reversing", this._settled = !1, (e = this.child) == null || e.reverse(), this.notify();
38
38
  }
39
39
  pause() {
40
- var n;
41
- this._state = "paused", (n = this.child) == null || n.pause(), this.notify();
40
+ var e;
41
+ this._state = "paused", (e = this.child) == null || e.pause(), this.notify();
42
42
  }
43
43
  complete() {
44
- var n;
45
- (n = this.child) == null || n.complete(), this.notify();
44
+ var e;
45
+ (e = this.child) == null || e.complete(), this.notify();
46
46
  }
47
47
  get isAnimating() {
48
- var n;
49
- return ((n = this.child) == null ? void 0 : n.isAnimating) ?? !1;
48
+ var e;
49
+ return ((e = this.child) == null ? void 0 : e.isAnimating) ?? !1;
50
50
  }
51
51
  get isPaused() {
52
52
  return this._state === "paused";
@@ -55,757 +55,769 @@ class Ft extends Bt {
55
55
  return this._settled && !this.child;
56
56
  }
57
57
  get isReversing() {
58
- var n;
59
- return ((n = this.child) == null ? void 0 : n.isReversing) ?? this._state === "reversing";
58
+ var e;
59
+ return ((e = this.child) == null ? void 0 : e.isReversing) ?? this._state === "reversing";
60
60
  }
61
61
  get progress() {
62
- var n;
63
- return ((n = this.child) == null ? void 0 : n.progress) ?? 0;
62
+ var e;
63
+ return ((e = this.child) == null ? void 0 : e.progress) ?? 0;
64
64
  }
65
- findTimeForProgress(n) {
66
- var s;
67
- return ((s = this.child) == null ? void 0 : s.findTimeForProgress(n)) ?? null;
65
+ findTimeForProgress(e) {
66
+ var o;
67
+ return ((o = this.child) == null ? void 0 : o.findTimeForProgress(e)) ?? null;
68
68
  }
69
69
  get playbackRate() {
70
70
  return super.playbackRate;
71
71
  }
72
- set playbackRate(n) {
73
- super.playbackRate = n, this.child && (this.child.playbackRate = n), this.notify();
72
+ set playbackRate(e) {
73
+ super.playbackRate = e, this.child && (this.child.playbackRate = e), this.notify();
74
74
  }
75
75
  getPose() {
76
- var n;
77
- return ((n = this.child) == null ? void 0 : n.getPose()) ?? [];
76
+ var e;
77
+ return ((e = this.child) == null ? void 0 : e.getPose()) ?? [];
78
78
  }
79
79
  getTimeline() {
80
- var n;
81
- return ((n = this.child) == null ? void 0 : n.getTimeline()) ?? [];
80
+ var e;
81
+ return ((e = this.child) == null ? void 0 : e.getTimeline()) ?? [];
82
82
  }
83
- matchInto(n) {
84
- var s;
85
- (s = this.child) == null || s.matchInto(n);
83
+ matchInto(e) {
84
+ var o;
85
+ (o = this.child) == null || o.matchInto(e);
86
86
  }
87
87
  /** Currently attached child, or null when nothing is playing. */
88
88
  get activeChild() {
89
89
  return this.child;
90
90
  }
91
91
  /** Subscribe to host state changes. Returns an unsubscribe fn. */
92
- subscribe(n) {
93
- return this.listeners.add(n), () => {
94
- this.listeners.delete(n);
92
+ subscribe(e) {
93
+ return this.listeners.add(e), () => {
94
+ this.listeners.delete(e);
95
95
  };
96
96
  }
97
97
  notify() {
98
- for (const n of this.listeners) n();
98
+ for (const e of this.listeners) e();
99
99
  }
100
100
  }
101
- const zt = (t, e) => {
102
- var n;
103
- t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((n = e == null ? void 0 : e.scrollOffset) == null ? void 0 : n.y) ?? 0)}px`, t.style.left = "0";
104
- }, vt = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), Kt = (t) => {
105
- let e = t.parentElement;
106
- for (; e && e !== document.body; ) {
107
- const n = window.getComputedStyle(e);
108
- if (vt.has(n.overflowY) || vt.has(n.overflowX))
109
- return e;
110
- e = e.parentElement;
101
+ const zt = (t, n) => {
102
+ var e;
103
+ t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((e = n == null ? void 0 : n.scrollOffset) == null ? void 0 : e.y) ?? 0)}px`, t.style.left = "0";
104
+ }, bt = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), Xt = (t) => {
105
+ let n = t.parentElement;
106
+ for (; n && n !== document.body; ) {
107
+ const e = window.getComputedStyle(n);
108
+ if (bt.has(e.overflowY) || bt.has(e.overflowX))
109
+ return n;
110
+ n = n.parentElement;
111
111
  }
112
112
  return document.documentElement;
113
- }, Xt = (t) => {
114
- let e = t.parentElement;
115
- for (; e && e !== document.body; ) {
116
- const n = window.getComputedStyle(e).position;
117
- if (n === "relative" || n === "absolute" || n === "fixed" || n === "sticky")
118
- return e;
119
- e = e.parentElement;
113
+ }, Gt = (t) => {
114
+ let n = t.parentElement;
115
+ for (; n && n !== document.body; ) {
116
+ const e = window.getComputedStyle(n).position;
117
+ if (e === "relative" || e === "absolute" || e === "fixed" || e === "sticky")
118
+ return n;
119
+ n = n.parentElement;
120
120
  }
121
121
  return document.body;
122
122
  };
123
- function $t(t) {
124
- const e = Object.keys(t);
125
- return Promise.all(e.map((n) => t[n])).then((n) => {
126
- const s = {};
127
- return e.forEach((r, i) => {
128
- s[r] = n[i];
129
- }), s;
123
+ function Ut(t) {
124
+ const n = Object.keys(t);
125
+ return Promise.all(n.map((e) => t[e])).then((e) => {
126
+ const o = {};
127
+ return n.forEach((r, i) => {
128
+ o[r] = e[i];
129
+ }), o;
130
130
  });
131
131
  }
132
- const Gt = 1e6, Et = 100, Ut = 10, qt = 1;
133
- function Vt(t) {
134
- const e = t.trim(), n = e.indexOf("#"), s = e.indexOf("?"), r = [n, s].filter((i) => i >= 0).reduce((i, l) => Math.min(i, l), e.length);
135
- return e.slice(0, r);
136
- }
137
- function V(t) {
138
- const e = Vt(t);
139
- try {
140
- if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e))
141
- return V(new URL(e).pathname);
142
- } catch {
143
- }
144
- const s = (e.startsWith("/") ? e : `/${e}`).replace(/\/+/g, "/");
145
- return (s.length > 1 ? s.replace(/\/+$/g, "") : s) || "/";
146
- }
147
- function Yt(t) {
148
- const e = t.trim();
149
- return e === "*" ? "/**" : V(e);
150
- }
151
- function at(t) {
152
- return t === "/" ? [] : t.slice(1).split("/");
153
- }
154
- function Zt(t) {
155
- return t.startsWith(":") || t.startsWith("[") && t.endsWith("]") || t.startsWith("{") && t.endsWith("}");
156
- }
157
- function kt(t, e) {
158
- const n = V(t), s = Yt(e);
159
- if (n === s)
160
- return {
161
- matched: !0,
162
- specificity: Gt + at(s).length * Et,
163
- pattern: e
164
- };
165
- const r = at(n), i = at(s);
166
- let l = 0;
167
- for (let a = 0; a < i.length; a++) {
168
- const f = i[a], u = r[a], y = a === i.length - 1;
169
- if (f === "**")
170
- return {
171
- matched: y && r.length >= a,
172
- specificity: l,
173
- pattern: e
174
- };
175
- if (u === void 0 || f === void 0)
176
- return { matched: !1, specificity: 0, pattern: e };
177
- if (f === "*") {
178
- l += qt;
179
- continue;
180
- }
181
- if (Zt(f)) {
182
- l += Ut;
183
- continue;
184
- }
185
- if (f !== u)
186
- return { matched: !1, specificity: 0, pattern: e };
187
- l += Et;
188
- }
189
- return {
190
- matched: r.length === i.length,
191
- specificity: l,
192
- pattern: e
193
- };
194
- }
195
- function N(t, e) {
196
- const n = typeof e == "string" ? [e] : e;
197
- let s = null;
198
- for (const r of n) {
199
- const i = kt(t, r);
200
- i.matched && (!s || i.specificity > s.specificity) && (s = i);
201
- }
202
- return s;
203
- }
204
- function Qt(t, e) {
205
- return kt(t, e).matched;
206
- }
207
- const jt = 768, Jt = 10, te = 10;
208
- function ee(t = {}) {
209
- const {
210
- preserveScroll: e = (v) => v,
211
- resolvePath: n = (v) => v
212
- } = t, s = typeof e == "function" ? e : () => e;
213
- let r = null, i = !1, l = !1;
214
- const a = () => {
215
- const v = (r == null ? void 0 : r.clientWidth) ?? 0, g = v > 0 ? v : typeof window < "u" ? window.innerWidth : 0;
216
- return g > 0 && g < jt;
217
- }, f = () => (l || (i = a(), l = !0), i), u = (v) => {
218
- var _;
219
- const g = n(v), b = s(f());
220
- if (b === !1)
221
- return { preserves: !1, shared: !1, storageKey: `path:${g}` };
222
- if (b === !0)
223
- return { preserves: !0, shared: !1, storageKey: `path:${g}` };
224
- const P = ((_ = b.exclude) == null ? void 0 : _.some((D) => Qt(g, D))) ?? !1, C = !P && !!b.key;
225
- return {
226
- preserves: !P,
227
- shared: C,
228
- storageKey: C ? `shared:${b.key}` : `path:${g}`
229
- };
230
- }, y = (v) => u(v).preserves;
231
- let p = null;
232
- const h = /* @__PURE__ */ new Map();
233
- let w = null, k = !1, A = 0;
234
- const L = () => {
235
- r && w && !k && h.set(u(w).storageKey, {
236
- x: r.scrollLeft,
237
- y: r.scrollTop
132
+ const qt = 768, Kt = 10, Vt = 10;
133
+ function $t(t = {}) {
134
+ const { resolvePath: n = (g) => g } = t;
135
+ let e = null, o = !1, r = !1;
136
+ const i = () => {
137
+ const g = (e == null ? void 0 : e.clientWidth) ?? 0, S = g > 0 ? g : typeof window < "u" ? window.innerWidth : 0;
138
+ return S > 0 && S < qt;
139
+ }, a = () => (r || (o = i(), r = !0), o), u = (g) => `path:${n(g)}`;
140
+ let f = null;
141
+ const l = /* @__PURE__ */ new Map();
142
+ let p = null, h = !1, y = 0, E = 0, w = 0;
143
+ const x = () => {
144
+ e && p && !h && l.set(u(p), {
145
+ x: e.scrollLeft,
146
+ y: e.scrollTop
238
147
  });
239
- }, K = (v) => {
240
- if (!r) return;
241
- const g = u(v);
242
- if (g.preserves && g.shared && !h.has(g.storageKey))
243
- return;
244
- const b = g.preserves && h.has(g.storageKey) ? h.get(g.storageKey) : { x: 0, y: 0 };
245
- let P = 0;
246
- const C = () => {
247
- if (!r) return;
248
- r.scrollTo({
249
- top: b.y,
250
- left: b.x
251
- }), !(Math.abs(r.scrollTop - b.y) < 1 && Math.abs(r.scrollLeft - b.x) < 1) && P < Jt && (P++, requestAnimationFrame(C));
148
+ }, _ = (g, S, C) => {
149
+ if (!e) return;
150
+ const O = ++E, I = u(g), P = S && l.has(I) ? l.get(I) : { x: 0, y: 0 };
151
+ let D = 0;
152
+ const G = () => {
153
+ if (!e || C !== y || O !== E)
154
+ return;
155
+ S || l.set(I, P), e.scrollTo({
156
+ top: P.y,
157
+ left: P.x
158
+ }), !(Math.abs(e.scrollTop - P.y) < 1 && Math.abs(e.scrollLeft - P.x) < 1) && D < Kt && (D++, requestAnimationFrame(G));
252
159
  };
253
- requestAnimationFrame(C);
160
+ requestAnimationFrame(G);
254
161
  };
255
162
  return {
256
- initializeContext: (v, g) => {
257
- k = !0;
258
- const b = ++A;
259
- p = v, r || (r = Kt(v), i = a(), l = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
260
- i = a();
261
- }).observe(r), (r === document.documentElement ? window : r).addEventListener("scroll", L, {
163
+ initializeContext: (g, S, C) => {
164
+ h = !0;
165
+ const O = p === S ? y : ++y;
166
+ f = g, e || (e = Xt(g), o = i(), r = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
167
+ o = i();
168
+ }).observe(e), (e === document.documentElement ? window : e).addEventListener("scroll", x, {
262
169
  passive: !0
263
- })), w = g, K(g);
264
- let P = 0;
265
- const C = () => {
266
- b === A && (P++, P >= te ? k = !1 : requestAnimationFrame(C));
170
+ })), p = S;
171
+ const I = u(S), P = l.get(I), D = ($) => {
172
+ O === y && (w = O, $ && P && l.set(I, P), _(S, $, O));
267
173
  };
268
- requestAnimationFrame(C);
174
+ C !== void 0 ? D(C) : requestAnimationFrame(() => {
175
+ w !== O && O === y && D(!1);
176
+ });
177
+ let G = 0;
178
+ const B = () => {
179
+ O === y && (G++, G >= Vt ? h = !1 : requestAnimationFrame(B));
180
+ };
181
+ return requestAnimationFrame(B), D;
269
182
  },
270
- calculateScrollOffset: (v, g) => {
271
- const b = v ? u(v).storageKey : null, P = b && h.has(b) ? h.get(b) : { x: 0, y: 0 }, C = g ? u(g) : null, _ = C != null && C.preserves ? C.storageKey : null, D = _ && h.has(_) ? h.get(_) : { x: 0, y: 0 };
183
+ calculateScrollOffset: (g, S, C = !1) => {
184
+ const O = g ? u(g) : null, I = O && l.has(O) ? l.get(O) : { x: 0, y: 0 }, P = S && C ? u(S) : null, D = P && l.has(P) ? l.get(P) : { x: 0, y: 0 };
272
185
  return {
273
- x: -D.x + P.x,
274
- y: -D.y + P.y
186
+ x: -D.x + I.x,
187
+ y: -D.y + I.y
275
188
  };
276
189
  },
277
- evictScrollPosition: (v) => {
278
- h.delete(u(v).storageKey);
190
+ evictScrollPosition: (g) => {
191
+ l.delete(u(g));
279
192
  },
280
- shouldPreserve: y,
281
- getScrollContainer: () => r,
282
- getPositionedParentElement: () => p ? Xt(p) : document.body,
283
- getScrollPosition: (v) => {
284
- const g = v ? u(v).storageKey : null;
285
- return g && h.has(g) ? h.get(g) : { x: 0, y: 0 };
193
+ getScrollContainer: () => e,
194
+ getPositionedParentElement: () => f ? Gt(f) : document.body,
195
+ getScrollPosition: (g, S = !0) => {
196
+ if (!S) return { x: 0, y: 0 };
197
+ const C = g ? u(g) : null;
198
+ return C && l.has(C) ? l.get(C) : { x: 0, y: 0 };
286
199
  },
287
- // Same measurement that drives `preserveScroll`'s `isMobile`, exposed so a
288
- // functional `transitions` config can branch on it too.
289
- getIsMobile: f
200
+ // Exposed so a functional `transitions` config can branch on device class.
201
+ getIsMobile: a
290
202
  };
291
203
  }
292
- const bt = 30, wt = 8, St = 1.2, Tt = 30, ne = 600;
293
- function ie() {
294
- let t = null, e = !1, n = !1, s = null, r = null, i = !1;
295
- const l = (E, S) => {
296
- for (let T = 0; T < E.length; T++) {
297
- const R = E.item(T);
298
- if (R && R.identifier === S) return R;
204
+ const wt = 30, Tt = 8, Pt = 1.2, xt = 30, Yt = 600;
205
+ function Zt() {
206
+ let t = null, n = !1, e = !1, o = null, r = null, i = !1;
207
+ const a = (v, b) => {
208
+ for (let T = 0; T < v.length; T++) {
209
+ const R = v.item(T);
210
+ if (R && R.identifier === b) return R;
299
211
  }
300
212
  return null;
301
- }, a = () => {
302
- s !== null && (clearTimeout(s), s = null);
213
+ }, u = () => {
214
+ o !== null && (clearTimeout(o), o = null);
303
215
  }, f = () => {
304
216
  r !== null && (clearTimeout(r), r = null);
305
- }, u = () => {
306
- e = !0, n = !0, a(), f(), s = setTimeout(() => {
307
- e = !1, n = !1, s = null;
308
- }, ne);
309
- }, y = (E) => {
310
- if (E.touches.length !== 1) {
217
+ }, l = () => {
218
+ n = !0, e = !0, u(), f(), o = setTimeout(() => {
219
+ n = !1, e = !1, o = null;
220
+ }, Yt);
221
+ }, p = (v) => {
222
+ if (v.touches.length !== 1) {
311
223
  t = null;
312
224
  return;
313
225
  }
314
- const S = E.touches.item(0);
315
- if (!S) {
226
+ const b = v.touches.item(0);
227
+ if (!b) {
316
228
  t = null;
317
229
  return;
318
230
  }
319
- const T = window.innerWidth, R = S.clientX <= bt, W = S.clientX >= T - bt;
320
- if (!R && !W) {
231
+ const T = window.innerWidth, R = b.clientX <= wt, F = b.clientX >= T - wt;
232
+ if (!R && !F) {
321
233
  t = null;
322
234
  return;
323
235
  }
324
236
  t = {
325
- identifier: S.identifier,
326
- startX: S.clientX,
327
- startY: S.clientY,
237
+ identifier: b.identifier,
238
+ startX: b.clientX,
239
+ startY: b.clientY,
328
240
  fromLeftEdge: R,
329
241
  moved: !1
330
242
  };
331
- }, p = (E) => {
243
+ }, h = (v) => {
332
244
  if (!t) return;
333
- if (E.touches.length !== 1) {
245
+ if (v.touches.length !== 1) {
334
246
  t = null;
335
247
  return;
336
248
  }
337
- const S = l(E.touches, t.identifier);
338
- if (!S) {
249
+ const b = a(v.touches, t.identifier);
250
+ if (!b) {
339
251
  t = null;
340
252
  return;
341
253
  }
342
- const T = S.clientX - t.startX, R = S.clientY - t.startY, W = Math.abs(T), F = Math.abs(R);
343
- if (F > wt && F > W * St) {
254
+ const T = b.clientX - t.startX, R = b.clientY - t.startY, F = Math.abs(T), g = Math.abs(R);
255
+ if (g > Tt && g > F * Pt) {
344
256
  t = null;
345
257
  return;
346
258
  }
347
- const v = t.fromLeftEdge ? T > 0 : T < 0;
348
- W > wt && W > F * St && v && (t.moved = !0);
349
- }, h = (E) => {
259
+ const S = t.fromLeftEdge ? T > 0 : T < 0;
260
+ F > Tt && F > g * Pt && S && (t.moved = !0);
261
+ }, y = (v) => {
350
262
  if (!t) return;
351
- const S = l(E.changedTouches, t.identifier);
352
- if (!S) {
263
+ const b = a(v.changedTouches, t.identifier);
264
+ if (!b) {
353
265
  t = null;
354
266
  return;
355
267
  }
356
- const T = S.clientX - t.startX, R = t.fromLeftEdge ? T > 0 : T < 0;
357
- if (t.moved && R && Math.abs(T) >= Tt) {
358
- u(), t = null;
268
+ const T = b.clientX - t.startX, R = t.fromLeftEdge ? T > 0 : T < 0;
269
+ if (t.moved && R && Math.abs(T) >= xt) {
270
+ l(), t = null;
359
271
  return;
360
272
  }
361
- t.moved && Math.abs(T) >= Tt && u(), t = null;
362
- }, w = () => {
363
- t && (t.moved && u(), t = null);
273
+ t.moved && Math.abs(T) >= xt && l(), t = null;
274
+ }, E = () => {
275
+ t && (t.moved && l(), t = null);
364
276
  };
365
277
  return { initialize: () => {
366
278
  if (typeof window > "u" || i) return;
367
279
  i = !0;
368
- const E = { passive: !0, capture: !0 };
369
- window.addEventListener("touchstart", y, E), window.addEventListener("touchmove", p, E), window.addEventListener("touchend", h, E), window.addEventListener("touchcancel", w, E);
280
+ const v = { passive: !0, capture: !0 };
281
+ window.addEventListener("touchstart", p, v), window.addEventListener("touchmove", h, v), window.addEventListener("touchend", y, v), window.addEventListener("touchcancel", E, v);
370
282
  }, destroy: () => {
371
283
  if (typeof window > "u" || !i) return;
372
284
  i = !1;
373
- const E = { capture: !0 };
374
- window.removeEventListener("touchstart", y, E), window.removeEventListener("touchmove", p, E), window.removeEventListener("touchend", h, E), window.removeEventListener("touchcancel", w, E), a(), f(), t = null, e = !1, n = !1;
285
+ const v = { capture: !0 };
286
+ window.removeEventListener("touchstart", p, v), window.removeEventListener("touchmove", h, v), window.removeEventListener("touchend", y, v), window.removeEventListener("touchcancel", E, v), u(), f(), t = null, n = !1, e = !1;
375
287
  }, isSwipeBack: () => {
376
- const E = e || n;
377
- return E && a(), E;
288
+ const v = n || e;
289
+ return v && u(), v;
378
290
  }, onPageEnter: () => {
379
- e = !1, a(), f(), r = setTimeout(() => {
380
- n = !1, r = null;
291
+ n = !1, u(), f(), r = setTimeout(() => {
292
+ e = !1, r = null;
381
293
  }, 0);
382
294
  } };
383
295
  }
384
- function se(t, e) {
385
- return e ? t.priority !== e.priority ? t.priority > e.priority : t.specificity !== e.specificity ? t.specificity > e.specificity : t.ruleIndex < e.ruleIndex : !0;
296
+ const Qt = 1e6, Ct = 100, jt = 10, Jt = 1;
297
+ function te(t) {
298
+ const n = t.trim(), e = n.indexOf("#"), o = n.indexOf("?"), r = [e, o].filter((i) => i >= 0).reduce((i, a) => Math.min(i, a), n.length);
299
+ return n.slice(0, r);
300
+ }
301
+ function j(t) {
302
+ const n = te(t);
303
+ try {
304
+ if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))
305
+ return j(new URL(n).pathname);
306
+ } catch {
307
+ }
308
+ const o = (n.startsWith("/") ? n : `/${n}`).replace(/\/+/g, "/");
309
+ return (o.length > 1 ? o.replace(/\/+$/g, "") : o) || "/";
310
+ }
311
+ function ee(t) {
312
+ const n = t.trim();
313
+ return n === "*" ? "/**" : j(n);
314
+ }
315
+ function dt(t) {
316
+ return t === "/" ? [] : t.slice(1).split("/");
386
317
  }
387
- function oe(t, e, n, s) {
318
+ function ne(t) {
319
+ return t.startsWith(":") || t.startsWith("[") && t.endsWith("]") || t.startsWith("{") && t.endsWith("}");
320
+ }
321
+ function ie(t, n) {
322
+ const e = j(t), o = ee(n);
323
+ if (e === o)
324
+ return {
325
+ matched: !0,
326
+ specificity: Qt + dt(o).length * Ct,
327
+ pattern: n
328
+ };
329
+ const r = dt(e), i = dt(o);
330
+ let a = 0;
331
+ for (let u = 0; u < i.length; u++) {
332
+ const f = i[u], l = r[u], p = u === i.length - 1;
333
+ if (f === "**")
334
+ return {
335
+ matched: p && r.length >= u,
336
+ specificity: a,
337
+ pattern: n
338
+ };
339
+ if (l === void 0 || f === void 0)
340
+ return { matched: !1, specificity: 0, pattern: n };
341
+ if (f === "*") {
342
+ a += Jt;
343
+ continue;
344
+ }
345
+ if (ne(f)) {
346
+ a += jt;
347
+ continue;
348
+ }
349
+ if (f !== l)
350
+ return { matched: !1, specificity: 0, pattern: n };
351
+ a += Ct;
352
+ }
353
+ return {
354
+ matched: r.length === i.length,
355
+ specificity: a,
356
+ pattern: n
357
+ };
358
+ }
359
+ function H(t, n) {
360
+ const e = typeof n == "string" ? [n] : n;
361
+ let o = null;
362
+ for (const r of e) {
363
+ const i = ie(t, r);
364
+ i.matched && (!o || i.specificity > o.specificity) && (o = i);
365
+ }
366
+ return o;
367
+ }
368
+ const At = {
369
+ from: !0,
370
+ to: !1
371
+ }, oe = {
372
+ from: !0,
373
+ to: !0
374
+ };
375
+ function se(t, n) {
376
+ return n ? t.priority !== n.priority ? t.priority > n.priority : t.specificity !== n.specificity ? t.specificity > n.specificity : t.ruleIndex < n.ruleIndex : !0;
377
+ }
378
+ function ft(t, n) {
379
+ return n === "forward" ? { from: t.from, to: t.to } : { from: t.to, to: t.from };
380
+ }
381
+ function re(t, n, e, o) {
388
382
  let r = null;
389
- return n.forEach((i, l) => {
390
- const a = i.priority ?? 0;
383
+ return e.forEach((i, a) => {
384
+ const u = i.priority ?? 0;
391
385
  let f = null;
392
386
  if (i.on !== void 0) {
393
- const u = i.except !== void 0 && N(t, i.except) !== null, y = i.except !== void 0 && N(e, i.except) !== null, p = u ? null : N(t, i.on), h = y ? null : N(e, i.on);
394
- if (p || h) {
395
- const w = !p && h ? "forward" : p && !h ? "backward" : s;
387
+ const l = i.except !== void 0 && H(t, i.except) !== null, p = i.except !== void 0 && H(n, i.except) !== null, h = l ? null : H(t, i.on), y = p ? null : H(n, i.on);
388
+ if (h || y) {
389
+ const E = !h && y ? "forward" : h && !y ? "backward" : o, w = !h && y ? "on-enter" : h && !y ? "on-leave" : "on-history", x = i.preserveScroll ?? At;
396
390
  f = {
397
391
  transition: i.transition,
398
- direction: w,
399
- ruleIndex: l,
400
- priority: a,
392
+ direction: E,
393
+ ruleIndex: a,
394
+ priority: u,
401
395
  specificity: Math.max(
402
- (p == null ? void 0 : p.specificity) ?? 0,
403
- (h == null ? void 0 : h.specificity) ?? 0
396
+ (h == null ? void 0 : h.specificity) ?? 0,
397
+ (y == null ? void 0 : y.specificity) ?? 0
404
398
  ),
405
- reason: !p && h ? "on-enter" : p && !h ? "on-leave" : "on-history"
399
+ reason: w,
400
+ // Both endpoints of an in-scope history navigation are semantic
401
+ // `to` pages. Enter/leave maps the outside and inside endpoints
402
+ // according to the resolved direction.
403
+ preserveScroll: w === "on-history" ? { from: x.to, to: x.to } : ft(x, E)
406
404
  };
407
405
  }
408
406
  } else if (i.ordered !== void 0) {
409
- let u = -1, y = -1, p = -1, h = -1;
410
- i.ordered.forEach((w, k) => {
411
- const A = N(t, w);
412
- A && A.specificity > p && (u = k, p = A.specificity);
413
- const L = N(e, w);
414
- L && L.specificity > h && (y = k, h = L.specificity);
415
- }), u >= 0 && y >= 0 && u !== y && (f = {
416
- transition: i.transition,
417
- direction: u < y ? "forward" : "backward",
418
- ruleIndex: l,
419
- priority: a,
420
- specificity: p + h,
421
- reason: "ordered"
422
- });
407
+ let l = -1, p = -1, h = -1, y = -1;
408
+ if (i.ordered.forEach((E, w) => {
409
+ const x = H(t, E);
410
+ x && x.specificity > h && (l = w, h = x.specificity);
411
+ const _ = H(n, E);
412
+ _ && _.specificity > y && (p = w, y = _.specificity);
413
+ }), l >= 0 && p >= 0 && l !== p) {
414
+ const E = l < p ? "forward" : "backward";
415
+ f = {
416
+ transition: i.transition,
417
+ direction: E,
418
+ ruleIndex: a,
419
+ priority: u,
420
+ specificity: h + y,
421
+ reason: "ordered",
422
+ preserveScroll: ft(
423
+ i.preserveScroll ?? oe,
424
+ E
425
+ )
426
+ };
427
+ }
423
428
  } else {
424
- const u = N(t, i.from), y = N(e, i.to), p = i.bidirectional === !1 ? null : N(t, i.to), h = i.bidirectional === !1 ? null : N(e, i.from), w = u && y, k = p && h;
425
- if (w || k) {
426
- const A = w ? u.specificity + y.specificity : -1, L = k ? p.specificity + h.specificity : -1, K = w && k && A === L ? s : A >= L ? "forward" : "backward";
429
+ const l = H(t, i.from), p = H(n, i.to), h = i.bidirectional === !1 ? null : H(t, i.to), y = i.bidirectional === !1 ? null : H(n, i.from), E = l && p, w = h && y;
430
+ if (E || w) {
431
+ const x = E ? l.specificity + p.specificity : -1, _ = w ? h.specificity + y.specificity : -1, X = E && w && x === _ ? o : x >= _ ? "forward" : "backward";
427
432
  f = {
428
433
  transition: i.transition,
429
- direction: K,
430
- ruleIndex: l,
431
- priority: a,
432
- specificity: Math.max(A, L),
433
- reason: "pair"
434
+ direction: X,
435
+ ruleIndex: a,
436
+ priority: u,
437
+ specificity: Math.max(x, _),
438
+ reason: "pair",
439
+ preserveScroll: ft(
440
+ i.preserveScroll ?? At,
441
+ X
442
+ )
434
443
  };
435
444
  }
436
445
  }
437
446
  f && se(f, r) && (r = f);
438
447
  }), r;
439
448
  }
440
- function re() {
449
+ function ce() {
441
450
  const t = [];
442
- let e = !1;
443
- const n = () => {
444
- e = !0;
451
+ let n = !1;
452
+ const e = () => {
453
+ n = !0;
445
454
  };
446
- return typeof window < "u" && window.addEventListener("popstate", n), {
447
- resolve(s, r) {
448
- const i = V(s), l = V(r);
455
+ return typeof window < "u" && window.addEventListener("popstate", e), {
456
+ resolve(o, r) {
457
+ const i = j(o), a = j(r);
449
458
  if (t.length === 0)
450
459
  t.push(i);
451
460
  else if (t[t.length - 1] !== i) {
452
- const u = t.lastIndexOf(i);
453
- u >= 0 ? t.splice(u + 1) : t.push(i);
461
+ const l = t.lastIndexOf(i);
462
+ l >= 0 ? t.splice(l + 1) : t.push(i);
454
463
  }
455
- const a = t[t.length - 2], f = e || a === l ? "backward" : "forward";
456
- if (e = !1, f === "backward") {
457
- const u = t.lastIndexOf(l);
458
- u >= 0 ? t.splice(u + 1) : t.push(l);
459
- } else t[t.length - 1] !== l && t.push(l);
464
+ const u = t[t.length - 2], f = n || u === a ? "backward" : "forward";
465
+ if (n = !1, f === "backward") {
466
+ const l = t.lastIndexOf(a);
467
+ l >= 0 ? t.splice(l + 1) : t.push(a);
468
+ } else t[t.length - 1] !== a && t.push(a);
460
469
  return f;
461
470
  },
462
471
  dispose() {
463
- typeof window < "u" && window.removeEventListener("popstate", n);
472
+ typeof window < "u" && window.removeEventListener("popstate", e);
464
473
  }
465
474
  };
466
475
  }
467
- function ce(t = {}) {
468
- let e = null, n = null;
469
- function s() {
470
- var i, l;
471
- e && ((i = e.out) == null || i.resolve(null), (l = e.in) == null || l.resolve(null), e = null);
476
+ function le(t = {}) {
477
+ let n = null, e = null;
478
+ function o() {
479
+ var i, a;
480
+ n && ((i = n.out) == null || i.resolve(null), (a = n.in) == null || a.resolve(null), n = null);
472
481
  }
473
482
  function r() {
474
- if (e != null && e.out && e.in) {
475
- if (e.out.path === e.in.path) {
476
- s();
483
+ if (n != null && n.out && n.in) {
484
+ if (n.out.path === n.in.path) {
485
+ o();
477
486
  return;
478
487
  }
479
488
  const i = {
480
- from: e.out.path,
481
- to: e.in.path,
482
- out: e.out.payload,
483
- in: e.in.payload
489
+ from: n.out.path,
490
+ to: n.in.path,
491
+ out: n.out.payload,
492
+ in: n.in.payload
484
493
  };
485
- n = i, e.out.resolve(i), e.in.resolve(i), e = null;
494
+ e = i, n.out.resolve(i), n.in.resolve(i), n = null;
486
495
  }
487
496
  }
488
497
  return {
489
- arrive(i, l, a) {
498
+ arrive(i, a, u) {
490
499
  return new Promise((f) => {
491
- var h, w;
492
- const u = n === null ? null : l === "out" ? { path: n.from, payload: n.out } : { path: n.to, payload: n.in };
493
- if ((u == null ? void 0 : u.path) === i) {
500
+ var y, E;
501
+ const l = e === null ? null : a === "out" ? { path: e.from, payload: e.out } : { path: e.to, payload: e.in };
502
+ if ((l == null ? void 0 : l.path) === i) {
494
503
  f(null);
495
504
  return;
496
505
  }
497
- l === "out" && ((h = e == null ? void 0 : e.in) == null ? void 0 : h.path) === i && !e.out && (e.in.resolve(null), e.in = void 0);
498
- const y = e == null ? void 0 : e[l];
499
- y && y.path !== i && s(), e || (e = {});
500
- const p = e[l];
501
- if (p) {
502
- if (((w = t.keepCurrent) == null ? void 0 : w.call(t, {
503
- type: l,
506
+ a === "out" && ((y = n == null ? void 0 : n.in) == null ? void 0 : y.path) === i && !n.out && (n.in.resolve(null), n.in = void 0);
507
+ const p = n == null ? void 0 : n[a];
508
+ p && p.path !== i && o(), n || (n = {});
509
+ const h = n[a];
510
+ if (h) {
511
+ if (((E = t.keepCurrent) == null ? void 0 : E.call(t, {
512
+ type: a,
504
513
  path: i,
505
- current: p.payload,
506
- next: a
514
+ current: h.payload,
515
+ next: u
507
516
  })) ?? !1) {
508
517
  f(null);
509
518
  return;
510
519
  }
511
- p.resolve(null);
520
+ h.resolve(null);
512
521
  }
513
- e[l] = { path: i, payload: a, resolve: f }, r();
522
+ n[a] = { path: i, payload: u, resolve: f }, r();
514
523
  });
515
524
  },
516
525
  cancel(i) {
517
- (e != null && e.out && i(e.out.payload) || e != null && e.in && i(e.in.payload)) && s(), (n && i(n.out) || n && i(n.in)) && (n = null);
526
+ (n != null && n.out && i(n.out.payload) || n != null && n.in && i(n.in.payload)) && o(), (e && i(e.out) || e && i(e.in)) && (e = null);
518
527
  }
519
528
  };
520
529
  }
521
- const le = {}, $ = /* @__PURE__ */ new Map();
522
- let J = null, Pt = !1;
523
- function At(t, e, n) {
524
- t instanceof HTMLElement && $.has(t) && !t.isConnected && n.set(t, { entry: $.get(t), anchor: e });
525
- for (const s of Array.from(t.childNodes))
526
- At(s, e, n);
530
+ const ae = {}, V = /* @__PURE__ */ new Map();
531
+ let et = null, Mt = !1;
532
+ function kt(t, n, e) {
533
+ t instanceof HTMLElement && V.has(t) && !t.isConnected && e.set(t, { entry: V.get(t), anchor: n });
534
+ for (const o of Array.from(t.childNodes))
535
+ kt(o, n, e);
527
536
  }
528
- function ae(t) {
529
- const e = new Set(
530
- Array.from(t.values(), ({ entry: n }) => n)
537
+ function ue(t) {
538
+ const n = new Set(
539
+ Array.from(t.values(), ({ entry: e }) => e)
531
540
  );
532
- for (const [n, { entry: s, anchor: r }] of t) {
533
- $.delete(n);
534
- let i = s.parent, l = !1;
541
+ for (const [e, { entry: o, anchor: r }] of t) {
542
+ V.delete(e);
543
+ let i = o.parent, a = !1;
535
544
  for (; i; ) {
536
- if (i.group === s.group && e.has(i)) {
537
- l = !0;
545
+ if (i.group === o.group && n.has(i)) {
546
+ a = !0;
538
547
  break;
539
548
  }
540
549
  i = i.parent;
541
550
  }
542
- queueMicrotask(() => s.callback(r, { emit: !l }));
551
+ queueMicrotask(() => o.callback(r, { emit: !a }));
543
552
  }
544
553
  }
545
- function ue() {
546
- if (Pt || typeof document > "u") return;
547
- Pt = !0, J = new MutationObserver((e) => {
548
- const n = /* @__PURE__ */ new Map();
549
- for (const s of e) {
554
+ function de() {
555
+ if (Mt || typeof document > "u") return;
556
+ Mt = !0, et = new MutationObserver((n) => {
557
+ const e = /* @__PURE__ */ new Map();
558
+ for (const o of n) {
550
559
  const r = {
551
- parent: s.target,
552
- nextSibling: s.nextSibling
560
+ parent: o.target,
561
+ nextSibling: o.nextSibling
553
562
  };
554
- for (const i of Array.from(s.removedNodes))
555
- At(i, r, n);
563
+ for (const i of Array.from(o.removedNodes))
564
+ kt(i, r, e);
556
565
  }
557
- ae(n);
566
+ ue(e);
558
567
  });
559
568
  const t = () => {
560
- J == null || J.observe(document.body, { childList: !0, subtree: !0 });
569
+ et == null || et.observe(document.body, { childList: !0, subtree: !0 });
561
570
  };
562
571
  document.body ? t() : document.addEventListener("DOMContentLoaded", t, { once: !0 });
563
572
  }
564
- function de(t, e, n = le) {
565
- ue();
566
- let s = t.parentElement, r = null;
567
- for (; s; ) {
568
- const i = $.get(s);
569
- if ((i == null ? void 0 : i.group) === n) {
573
+ function fe(t, n, e = ae) {
574
+ de();
575
+ let o = t.parentElement, r = null;
576
+ for (; o; ) {
577
+ const i = V.get(o);
578
+ if ((i == null ? void 0 : i.group) === e) {
570
579
  r = i;
571
580
  break;
572
581
  }
573
- s = s.parentElement;
582
+ o = o.parentElement;
574
583
  }
575
- return $.set(t, {
584
+ return V.set(t, {
576
585
  element: t,
577
- callback: e,
578
- group: n,
586
+ callback: n,
587
+ group: e,
579
588
  parent: r
580
589
  }), () => {
581
- $.delete(t);
590
+ V.delete(t);
582
591
  };
583
592
  }
584
- const ut = /* @__PURE__ */ new WeakMap();
585
- let tt = null;
586
- const et = "none !important";
587
- function q(t) {
588
- const e = t.style.getPropertyValue("display");
589
- return t.style.getPropertyPriority("display") ? `${e} !important` : e;
593
+ const pt = /* @__PURE__ */ new WeakMap();
594
+ let nt = null;
595
+ const it = "none !important";
596
+ function Q(t) {
597
+ const n = t.style.getPropertyValue("display");
598
+ return t.style.getPropertyPriority("display") ? `${n} !important` : n;
590
599
  }
591
- function fe() {
592
- return tt || (tt = new MutationObserver((t) => {
593
- for (const e of t) {
594
- const n = e.target, s = ut.get(n);
595
- if (!s) continue;
596
- const r = q(n);
597
- r !== s.accounted && (s.accounted = r, r === et ? (s.reactHidden = !0, s.onHide()) : r !== "none" && s.reactHidden && (s.reactHidden = !1, s.onShow()));
600
+ function pe() {
601
+ return nt || (nt = new MutationObserver((t) => {
602
+ for (const n of t) {
603
+ const e = n.target, o = pt.get(e);
604
+ if (!o) continue;
605
+ const r = Q(e);
606
+ r !== o.accounted && (o.accounted = r, r === it ? (o.reactHidden = !0, o.onHide()) : r !== "none" && o.reactHidden && (o.reactHidden = !1, o.onShow()));
598
607
  }
599
- }), tt);
608
+ }), nt);
600
609
  }
601
- function he(t, e) {
602
- const n = q(t), s = {
603
- accounted: n,
604
- reactHidden: n === et,
605
- onHide: e.onHide,
606
- onShow: e.onShow
610
+ function he(t, n) {
611
+ const e = Q(t), o = {
612
+ accounted: e,
613
+ reactHidden: e === it,
614
+ onHide: n.onHide,
615
+ onShow: n.onShow
607
616
  };
608
- return ut.set(t, s), fe().observe(t, {
617
+ return pt.set(t, o), pe().observe(t, {
609
618
  attributes: !0,
610
619
  attributeFilter: ["style"]
611
620
  }), {
612
621
  get isHidden() {
613
- return q(t) === et;
622
+ return Q(t) === it;
614
623
  },
615
624
  setDisplay(r, i = !1) {
616
625
  r === null ? t.style.removeProperty("display") : t.style.setProperty(
617
626
  "display",
618
627
  r,
619
628
  i ? "important" : ""
620
- ), s.accounted = q(t);
629
+ ), o.accounted = Q(t);
621
630
  },
622
631
  sync() {
623
- s.accounted = q(t), s.reactHidden = s.accounted === et;
632
+ o.accounted = Q(t), o.reactHidden = o.accounted === it;
624
633
  },
625
634
  stop() {
626
- ut.delete(t);
635
+ pt.delete(t);
627
636
  }
628
637
  };
629
638
  }
630
- function Te(t, e = {}) {
631
- const {
632
- transitions: n = [],
633
- middleware: s = (o, c) => ({ from: o, to: c }),
634
- preserveScroll: r = (o) => o
635
- } = t, i = e.host ?? new Ft(), l = {}, a = ce({
639
+ function Pe(t, n = {}) {
640
+ const { transitions: e = [], middleware: o = (s, c) => ({ from: s, to: c }) } = t, r = n.host ?? new Bt(), i = {}, a = le({
636
641
  // Nested boundaries can be discovered in separate MutationObserver
637
642
  // batches (notably when Suspense reveals a child later). When the same
638
643
  // side/path repeats before pairing, the outermost DOM boundary owns it.
639
- keepCurrent: ({ current: o, next: c }) => o.element.contains(c.element)
640
- }), f = re(), u = typeof n == "function" ? n : () => n, y = ie();
641
- y.initialize();
642
- const p = /* @__PURE__ */ new Map(), h = (o) => {
643
- let c = p.get(o);
644
- return c === void 0 && (c = s(o, o).from, p.set(o, c)), c;
644
+ keepCurrent: ({ current: s, next: c }) => s.element.contains(c.element)
645
+ }), u = ce(), f = typeof e == "function" ? e : () => e, l = Zt();
646
+ l.initialize();
647
+ const p = /* @__PURE__ */ new Map(), h = (s) => {
648
+ let c = p.get(s);
649
+ return c === void 0 && (c = o(s, s).from, p.set(s, c)), c;
645
650
  }, {
646
- initializeContext: w,
647
- calculateScrollOffset: k,
648
- evictScrollPosition: A,
649
- shouldPreserve: L,
650
- getScrollContainer: K,
651
- getPositionedParentElement: E,
652
- getScrollPosition: S,
653
- getIsMobile: T
654
- } = ee({ preserveScroll: r, resolvePath: h }), R = /* @__PURE__ */ new Map(), W = () => {
655
- const o = T();
656
- let c = R.get(o);
657
- return c || (c = u({ isMobile: o }), R.set(o, c)), c;
658
- }, F = /* @__PURE__ */ new WeakMap(), v = (o) => {
659
- F.set(o, {
660
- parent: o.parentNode,
661
- nextSibling: o.nextSibling
651
+ initializeContext: y,
652
+ calculateScrollOffset: E,
653
+ evictScrollPosition: w,
654
+ getScrollContainer: x,
655
+ getPositionedParentElement: _,
656
+ getScrollPosition: X,
657
+ getIsMobile: v
658
+ } = $t({ resolvePath: h }), b = /* @__PURE__ */ new Map(), T = () => {
659
+ const s = v();
660
+ let c = b.get(s);
661
+ return c || (c = f({ isMobile: s }), b.set(s, c)), c;
662
+ }, R = /* @__PURE__ */ new WeakMap(), F = (s) => {
663
+ R.set(s, {
664
+ parent: s.parentNode,
665
+ nextSibling: s.nextSibling
662
666
  });
663
- }, g = (o) => {
664
- const c = F.get(o);
667
+ }, g = (s) => {
668
+ const c = R.get(s);
665
669
  return c || {
666
- parent: o.parentNode,
667
- nextSibling: o.nextSibling
670
+ parent: s.parentNode,
671
+ nextSibling: s.nextSibling
668
672
  };
669
- }, b = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap();
670
- let C = 0;
671
- const _ = (o) => {
672
- const c = typeof getComputedStyle < "u" ? getComputedStyle(o).display : "";
673
+ }, S = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap();
674
+ let O = 0;
675
+ const I = (s) => {
676
+ const c = typeof getComputedStyle < "u" ? getComputedStyle(s).display : "";
673
677
  return c && c !== "none" ? c : "block";
674
- }, D = (o, c) => {
675
- c.visibleDisplay = o.style.getPropertyValue("display"), c.computedDisplay = _(o);
676
- }, dt = (o, c) => {
677
- if (P.get(o) !== c) return;
678
- P.delete(o);
679
- const d = b.get(o);
680
- d && (d.savedCss !== null && (o.style.cssText = d.savedCss, d.savedCss = null), d.intent === "hidden" ? d.vis.setDisplay("none", !0) : d.visibleDisplay ? (d.vis.setDisplay(d.visibleDisplay, !1), D(o, d)) : (d.vis.setDisplay(null), D(o, d)));
681
- }, Lt = (o, c, d, M, m, O) => {
682
- const x = m.element, H = O.element, B = (m.mode ?? "unmount") === "hidden", { parent: Z, nextSibling: it } = m.parent ? { parent: m.parent, nextSibling: m.nextSibling } : g(x), Q = k(d, M), st = {
678
+ }, P = (s, c) => {
679
+ c.visibleDisplay = s.style.getPropertyValue("display"), c.computedDisplay = I(s);
680
+ }, D = (s, c) => {
681
+ if (C.get(s) !== c) return;
682
+ C.delete(s);
683
+ const d = S.get(s);
684
+ d && (d.savedCss !== null && (s.style.cssText = d.savedCss, d.savedCss = null), d.intent === "hidden" ? d.vis.setDisplay("none", !0) : d.visibleDisplay ? (d.vis.setDisplay(d.visibleDisplay, !1), P(s, d)) : (d.vis.setDisplay(null), P(s, d)));
685
+ }, G = (s, c, d, M, m, L, A) => {
686
+ const W = m.element, k = L.element, z = (m.mode ?? "unmount") === "hidden", { parent: U, nextSibling: K } = m.parent ? { parent: m.parent, nextSibling: m.nextSibling } : g(W), J = E(
687
+ d,
688
+ M,
689
+ A.to
690
+ ), rt = {
683
691
  direction: c,
684
- scrollOffset: Q,
685
- from: { scroll: S(d) },
686
- to: { scroll: S(M) },
692
+ scrollOffset: J,
693
+ from: { scroll: X(d) },
694
+ to: {
695
+ scroll: X(M, A.to)
696
+ },
687
697
  get scrollingElement() {
688
- return K() || document.documentElement;
698
+ return x() || document.documentElement;
689
699
  },
690
700
  get positionedParent() {
691
- return E();
701
+ return _();
692
702
  }
693
703
  };
694
- let I;
695
- if (B) {
696
- I = x, I.style.top = `${-1 * ((Q == null ? void 0 : Q.y) ?? 0)}px`;
697
- const z = b.get(H);
698
- z && z.savedCss === null && (z.savedCss = H.style.cssText);
704
+ let N;
705
+ if (z) {
706
+ N = W, N.style.top = `${-1 * ((J == null ? void 0 : J.y) ?? 0)}px`;
707
+ const q = S.get(k);
708
+ q && q.savedCss === null && (q.savedCss = k.style.cssText);
699
709
  } else
700
- I = x, zt(I, st);
701
- L(d) || A(d);
702
- const j = B ? ++C : 0;
703
- B && (P.set(H, j), P.set(x, j));
704
- const yt = Promise.resolve(I), mt = Promise.resolve(H), gt = [], It = {
705
- from: yt,
706
- to: mt,
707
- context: st,
708
- createElement: ((z, ot = "div") => {
709
- const G = document.createElement(ot);
710
- return G.setAttribute("data-ssgoi-id", z), gt.push(G), G;
710
+ N = W, zt(N, rt);
711
+ A.from || w(d);
712
+ const tt = z ? ++O : 0;
713
+ z && (C.set(k, tt), C.set(W, tt));
714
+ const vt = Promise.resolve(N), St = Promise.resolve(k), Et = [], It = {
715
+ from: vt,
716
+ to: St,
717
+ context: rt,
718
+ createElement: ((q, ct = "div") => {
719
+ const Y = document.createElement(ct);
720
+ return Y.setAttribute("data-ssgoi-id", q), Et.push(Y), Y;
711
721
  })
712
722
  }, Nt = Promise.resolve(
713
- o.prepare ? o.prepare(It) : {}
723
+ s.prepare ? s.prepare(It) : {}
714
724
  );
715
- $t({
716
- from: yt,
717
- to: mt,
725
+ Ut({
726
+ from: vt,
727
+ to: St,
718
728
  extras: Nt
719
- }).then(({ from: z, to: ot, extras: G }) => {
720
- !B && Z && (it && Z.contains(it) ? Z.insertBefore(I, it) : Z.appendChild(I));
721
- const rt = o.animation({
722
- from: z,
723
- to: ot,
724
- context: st,
725
- ...G
726
- }), ct = rt.onComplete;
727
- rt.onComplete = () => {
728
- ct == null || ct(), B ? (dt(x, j), dt(H, j)) : I.parentNode && I.parentNode.removeChild(I);
729
- for (const lt of gt)
730
- lt.parentNode && lt.parentNode.removeChild(lt);
731
- }, i.attach(rt);
729
+ }).then(({ from: q, to: ct, extras: Y }) => {
730
+ !z && U && (K && U.contains(K) ? U.insertBefore(N, K) : U.appendChild(N));
731
+ const lt = s.animation({
732
+ from: q,
733
+ to: ct,
734
+ context: rt,
735
+ ...Y
736
+ }), at = lt.onComplete;
737
+ lt.onComplete = () => {
738
+ at == null || at(), z ? (D(W, tt), D(k, tt)) : N.parentNode && N.parentNode.removeChild(N);
739
+ for (const ut of Et)
740
+ ut.parentNode && ut.parentNode.removeChild(ut);
741
+ }, r.attach(lt);
732
742
  });
733
- }, Y = (o, c, d) => {
734
- const M = y.isSwipeBack();
735
- a.arrive(o, c, d).then((m) => {
736
- if (c === "in" && y.onPageEnter(), !m) return;
737
- if (M && c === "in") {
738
- const B = s(m.from, m.to);
739
- f.resolve(B.from, B.to);
740
- }
741
- if (M) {
742
- c === "out" && m.from && !L(m.from) && A(m.from);
743
- return;
744
- }
745
- if (c !== "in") return;
746
- const { from: O, to: x } = s(
743
+ }, B = (s, c, d) => {
744
+ const M = l.isSwipeBack();
745
+ a.arrive(s, c, d).then((m) => {
746
+ var st, z, U, K;
747
+ if (c === "in" && l.onPageEnter(), !m || c !== "in") return;
748
+ const { from: L, to: A } = o(
747
749
  m.from,
748
750
  m.to
749
- ), H = f.resolve(
750
- O,
751
- x
752
- ), X = oe(
753
- O,
754
- x,
755
- W(),
756
- H
751
+ ), W = u.resolve(
752
+ L,
753
+ A
754
+ ), k = re(
755
+ L,
756
+ A,
757
+ T(),
758
+ W
757
759
  );
758
- X && Lt(
759
- X.transition,
760
- X.direction,
760
+ if (!k) {
761
+ (z = (st = m.in).applyScrollPolicy) == null || z.call(st, !1), w(m.from);
762
+ return;
763
+ }
764
+ if ((K = (U = m.in).applyScrollPolicy) == null || K.call(U, k.preserveScroll.to), M) {
765
+ k.preserveScroll.from || w(m.from);
766
+ return;
767
+ }
768
+ G(
769
+ k.transition,
770
+ k.direction,
761
771
  m.from,
762
772
  m.to,
763
773
  m.out,
764
- m.in
774
+ m.in,
775
+ k.preserveScroll
765
776
  );
766
777
  });
767
- }, Ot = (o, c) => {
768
- const d = b.get(o);
778
+ }, $ = (s, c) => {
779
+ const d = S.get(s);
769
780
  if (!d) return;
770
781
  const M = d.intent === "hidden";
771
- if (d.intent = "hidden", d.savedCss === null && (d.savedCss = o.style.cssText), d.vis.setDisplay(d.computedDisplay || "block", !0), o.style.position = "absolute", o.style.width = "100%", o.style.left = "0", M) return;
772
- const m = g(o), O = {
773
- element: o,
782
+ if (d.intent = "hidden", d.savedCss === null && (d.savedCss = s.style.cssText), d.vis.setDisplay(d.computedDisplay || "block", !0), s.style.position = "absolute", s.style.width = "100%", s.style.left = "0", M) return;
783
+ const m = g(s), L = {
784
+ element: s,
774
785
  parent: m.parent,
775
786
  nextSibling: m.nextSibling,
776
787
  mode: "hidden"
777
- }, x = o.getAttribute("data-ssgoi-transition") ?? c;
778
- Y(x, "out", O);
779
- }, _t = (o, c) => {
780
- const d = b.get(o);
788
+ }, A = s.getAttribute("data-ssgoi-transition") ?? c;
789
+ B(A, "out", L);
790
+ }, ht = (s, c) => {
791
+ const d = S.get(s);
781
792
  if (!d || d.intent === "visible") return;
782
- d.intent = "visible", D(o, d), d.savedCss !== null && (o.style.cssText = d.savedCss, d.visibleDisplay ? d.vis.setDisplay(d.visibleDisplay, !1) : d.vis.setDisplay(null)), w(o, c);
783
- const M = {
784
- element: o,
785
- parent: o.parentElement,
786
- nextSibling: o.nextElementSibling
787
- }, m = o.getAttribute("data-ssgoi-transition") ?? c;
788
- Y(m, "in", M);
789
- }, Dt = (o, c, d, M = !0) => {
790
- const m = b.get(o);
791
- if (m && (m.vis.stop(), b.delete(o), P.delete(o), m.intent === "hidden")) {
792
- a.cancel((X) => X.element === o);
793
+ d.intent = "visible", P(s, d), d.savedCss !== null && (s.style.cssText = d.savedCss, d.visibleDisplay ? d.vis.setDisplay(d.visibleDisplay, !1) : d.vis.setDisplay(null));
794
+ const M = s.getAttribute("data-ssgoi-transition") ?? c, m = y(s, M), L = {
795
+ element: s,
796
+ parent: s.parentElement,
797
+ nextSibling: s.nextElementSibling,
798
+ applyScrollPolicy: m
799
+ };
800
+ B(M, "in", L);
801
+ }, Dt = (s, c, d, M = !0) => {
802
+ const m = S.get(s);
803
+ if (m && (m.vis.stop(), S.delete(s), C.delete(s), m.intent === "hidden")) {
804
+ a.cancel((k) => k.element === s);
793
805
  return;
794
806
  }
795
807
  if (!M) return;
796
- const O = d ?? g(o), x = {
797
- element: o,
798
- parent: O.parent,
799
- nextSibling: O.nextSibling,
808
+ const L = d ?? g(s), A = {
809
+ element: s,
810
+ parent: L.parent,
811
+ nextSibling: L.nextSibling,
800
812
  mode: "unmount"
801
- }, H = o.getAttribute("data-ssgoi-transition") ?? c;
802
- Y(H, "out", x);
803
- }, ft = /* @__PURE__ */ new WeakSet(), ht = (o, c, { enter: d = !0 } = {}) => {
804
- if (ft.has(c)) return;
805
- ft.add(c), v(c);
813
+ }, W = s.getAttribute("data-ssgoi-transition") ?? c;
814
+ B(W, "out", A);
815
+ }, yt = /* @__PURE__ */ new WeakSet(), mt = (s, c, { enter: d = !0 } = {}) => {
816
+ if (yt.has(c)) return;
817
+ yt.add(c), F(c);
806
818
  const M = he(c, {
807
- onHide: () => Ot(c, o),
808
- onShow: () => _t(c, o)
819
+ onHide: () => $(c, s),
820
+ onShow: () => ht(c, s)
809
821
  }), m = {
810
822
  vis: M,
811
823
  savedCss: null,
@@ -813,105 +825,105 @@ function Te(t, e = {}) {
813
825
  visibleDisplay: "",
814
826
  computedDisplay: "block"
815
827
  };
816
- if (b.set(c, m), !M.isHidden && (D(c, m), d)) {
817
- w(c, o);
818
- const O = {
828
+ if (S.set(c, m), !M.isHidden && (P(c, m), d)) {
829
+ const L = y(c, s), A = {
819
830
  element: c,
820
831
  parent: c.parentElement,
821
- nextSibling: c.nextElementSibling
832
+ nextSibling: c.nextElementSibling,
833
+ applyScrollPolicy: L
822
834
  };
823
- Y(o, "in", O);
835
+ B(s, "in", A);
824
836
  }
825
- de(
837
+ fe(
826
838
  c,
827
- (O, x) => Dt(c, o, O, (x == null ? void 0 : x.emit) ?? !0),
828
- l
839
+ (L, A) => Dt(c, s, L, (A == null ? void 0 : A.emit) ?? !0),
840
+ i
829
841
  );
830
- }, pt = /* @__PURE__ */ new Map();
831
- return { register: ht, refFor: (o) => {
832
- let c = pt.get(o);
842
+ }, gt = /* @__PURE__ */ new Map();
843
+ return { register: mt, refFor: (s) => {
844
+ let c = gt.get(s);
833
845
  return c || (c = (d) => {
834
- d && ht(o, d);
835
- }, pt.set(o, c)), c;
846
+ d && mt(s, d);
847
+ }, gt.set(s, c)), c;
836
848
  } };
837
849
  }
838
- const Rt = "data-ssgoi-root", pe = `[${Rt}]`, nt = "data-ssgoi-transition", xt = `[${nt}]`, ye = "[data-ssgoi-clone]";
839
- function me() {
850
+ const _t = "data-ssgoi-root", ye = `[${_t}]`, ot = "data-ssgoi-transition", Lt = `[${ot}]`, me = "[data-ssgoi-clone]";
851
+ function ge() {
840
852
  return typeof MutationObserver < "u" && typeof HTMLElement < "u" && typeof Node < "u";
841
853
  }
842
- function ge(t) {
854
+ function ve(t) {
843
855
  return t.nodeType === Node.ELEMENT_NODE;
844
856
  }
845
- function ve(t) {
857
+ function Se(t) {
846
858
  return t instanceof HTMLElement;
847
859
  }
848
- function Ct(t) {
849
- let e = 0, n = t.parentElement;
850
- for (; n; )
851
- e++, n = n.parentElement;
852
- return e;
860
+ function Rt(t) {
861
+ let n = 0, e = t.parentElement;
862
+ for (; e; )
863
+ n++, e = e.parentElement;
864
+ return n;
853
865
  }
854
- function Mt(t, e, n = t) {
855
- const s = Array.from(t).sort(
856
- (r, i) => Ct(r) - Ct(i)
866
+ function Ot(t, n, e = t) {
867
+ const o = Array.from(t).sort(
868
+ (r, i) => Rt(r) - Rt(i)
857
869
  );
858
- for (const r of s) {
859
- const i = r.getAttribute(nt);
870
+ for (const r of o) {
871
+ const i = r.getAttribute(ot);
860
872
  if (i === null) continue;
861
- let l = r.parentElement, a = !1;
862
- for (; l; ) {
863
- if (n.has(l)) {
864
- a = !0;
873
+ let a = r.parentElement, u = !1;
874
+ for (; a; ) {
875
+ if (e.has(a)) {
876
+ u = !0;
865
877
  break;
866
878
  }
867
- l = l.parentElement;
879
+ a = a.parentElement;
868
880
  }
869
- e.register(i, r, { enter: !a });
881
+ n.register(i, r, { enter: !u });
870
882
  }
871
883
  }
872
- function Pe(t, e) {
873
- if (!me()) return () => {
884
+ function xe(t, n) {
885
+ if (!ge()) return () => {
874
886
  };
875
- t.setAttribute(Rt, "");
876
- const n = (a) => a.closest(pe) === t, s = (a) => !ve(a) || !n(a) || a.closest(ye) || a.getAttribute(nt) === null ? null : a, r = (a, f) => {
877
- if (ge(a)) {
878
- if (a.matches(xt)) {
879
- const u = s(a);
880
- u && f.add(u);
887
+ t.setAttribute(_t, "");
888
+ const e = (u) => u.closest(ye) === t, o = (u) => !Se(u) || !e(u) || u.closest(me) || u.getAttribute(ot) === null ? null : u, r = (u, f) => {
889
+ if (ve(u)) {
890
+ if (u.matches(Lt)) {
891
+ const l = o(u);
892
+ l && f.add(l);
881
893
  }
882
- for (const u of a.querySelectorAll(xt)) {
883
- const y = s(u);
884
- y && f.add(y);
894
+ for (const l of u.querySelectorAll(Lt)) {
895
+ const p = o(l);
896
+ p && f.add(p);
885
897
  }
886
898
  }
887
- }, i = new MutationObserver((a) => {
888
- const f = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
889
- for (const y of a) {
890
- if (y.type === "attributes") {
891
- const p = s(y.target);
892
- p && f.add(p);
899
+ }, i = new MutationObserver((u) => {
900
+ const f = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
901
+ for (const p of u) {
902
+ if (p.type === "attributes") {
903
+ const h = o(p.target);
904
+ h && f.add(h);
893
905
  continue;
894
906
  }
895
- for (const p of y.addedNodes)
896
- r(p, u);
907
+ for (const h of p.addedNodes)
908
+ r(h, l);
897
909
  }
898
- for (const y of u) f.add(y);
899
- Mt(f, e, u);
910
+ for (const p of l) f.add(p);
911
+ Ot(f, n, l);
900
912
  });
901
913
  i.observe(t, {
902
914
  childList: !0,
903
915
  subtree: !0,
904
916
  attributes: !0,
905
- attributeFilter: [nt]
917
+ attributeFilter: [ot]
906
918
  });
907
- const l = /* @__PURE__ */ new Set();
908
- return r(t, l), Mt(l, e), () => i.disconnect();
919
+ const a = /* @__PURE__ */ new Set();
920
+ return r(t, a), Ot(a, n), () => i.disconnect();
909
921
  }
910
922
  export {
911
- Bt as Animation,
912
- Ft as HostAnimation,
923
+ Ft as Animation,
924
+ Bt as HostAnimation,
913
925
  Me as MultiAnimation,
914
- ke as WebAnimation,
915
- Te as createSggoiTransitionContext,
916
- Pe as observeSsgoiTransitions
926
+ Le as WebAnimation,
927
+ Pe as createSggoiTransitionContext,
928
+ xe as observeSsgoiTransitions
917
929
  };