@ssgoi/core 7.0.0-beta.1 → 7.0.0-beta.3

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 Ae } 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) {
14
+ attach(e) {
15
15
  const o = this.child;
16
- if (this.child = n, this._settled = !1, o) {
16
+ if (this.child = e, this._settled = !1, o) {
17
17
  const a = o.getPose();
18
- o.complete(), n.matchInto(a);
18
+ o.complete(), e.matchInto(a);
19
19
  }
20
- n.playbackRate = this.playbackRate;
21
- const s = n.onComplete;
22
- n.onComplete = () => {
23
- s == null || s(), 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 = (a) => {
27
- var l;
28
- i == null || i(a), (l = this.onUpdate) == null || l.call(this, a), 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,752 +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) {
65
+ findTimeForProgress(e) {
66
66
  var o;
67
- return ((o = this.child) == null ? void 0 : o.findTimeForProgress(n)) ?? null;
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) {
83
+ matchInto(e) {
84
84
  var o;
85
- (o = this.child) == null || o.matchInto(n);
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) => {
123
+ function Ut(t) {
124
+ const n = Object.keys(t);
125
+ return Promise.all(n.map((e) => t[e])).then((e) => {
126
126
  const o = {};
127
- return e.forEach((s, i) => {
128
- o[s] = n[i];
127
+ return n.forEach((r, i) => {
128
+ o[r] = e[i];
129
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("#"), o = e.indexOf("?"), s = [n, o].filter((i) => i >= 0).reduce((i, a) => Math.min(i, a), e.length);
135
- return e.slice(0, s);
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 o = (e.startsWith("/") ? e : `/${e}`).replace(/\/+/g, "/");
145
- return (o.length > 1 ? o.replace(/\/+$/g, "") : o) || "/";
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 At(t, e) {
158
- const n = V(t), o = Yt(e);
159
- if (n === o)
160
- return {
161
- matched: !0,
162
- specificity: Gt + at(o).length * Et,
163
- pattern: e
164
- };
165
- const s = at(n), i = at(o);
166
- let a = 0;
167
- for (let l = 0; l < i.length; l++) {
168
- const f = i[l], u = s[l], y = l === i.length - 1;
169
- if (f === "**")
170
- return {
171
- matched: y && s.length >= l,
172
- specificity: a,
173
- pattern: e
174
- };
175
- if (u === void 0 || f === void 0)
176
- return { matched: !1, specificity: 0, pattern: e };
177
- if (f === "*") {
178
- a += qt;
179
- continue;
180
- }
181
- if (Zt(f)) {
182
- a += Ut;
183
- continue;
184
- }
185
- if (f !== u)
186
- return { matched: !1, specificity: 0, pattern: e };
187
- a += Et;
188
- }
189
- return {
190
- matched: s.length === i.length,
191
- specificity: a,
192
- pattern: e
193
- };
194
- }
195
- function N(t, e) {
196
- const n = typeof e == "string" ? [e] : e;
197
- let o = null;
198
- for (const s of n) {
199
- const i = At(t, s);
200
- i.matched && (!o || i.specificity > o.specificity) && (o = i);
201
- }
202
- return o;
203
- }
204
- function Qt(t, e) {
205
- return At(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, o = typeof e == "function" ? e : () => e;
213
- let s = null, i = !1, a = !1;
214
- const l = () => {
215
- const v = (s == null ? void 0 : s.clientWidth) ?? 0, g = v > 0 ? v : typeof window < "u" ? window.innerWidth : 0;
216
- return g > 0 && g < jt;
217
- }, f = () => (a || (i = l(), a = !0), i), u = (v) => {
218
- var _;
219
- const g = n(v), b = o(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 h = null;
232
- const p = /* @__PURE__ */ new Map();
233
- let S = null, R = !1, A = 0;
234
- const L = () => {
235
- s && S && !R && p.set(u(S).storageKey, {
236
- x: s.scrollLeft,
237
- y: s.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 (!s) return;
241
- const g = u(v);
242
- if (g.preserves && g.shared && !p.has(g.storageKey))
243
- return;
244
- const b = g.preserves && p.has(g.storageKey) ? p.get(g.storageKey) : { x: 0, y: 0 };
245
- let P = 0;
246
- const C = () => {
247
- if (!s) return;
248
- s.scrollTo({
249
- top: b.y,
250
- left: b.x
251
- }), !(Math.abs(s.scrollTop - b.y) < 1 && Math.abs(s.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
- R = !0;
258
- const b = ++A;
259
- h = v, s || (s = Kt(v), i = l(), a = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
260
- i = l();
261
- }).observe(s), (s === document.documentElement ? window : s).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
- })), S = g, K(g);
264
- let P = 0;
265
- const C = () => {
266
- b === A && (P++, P >= te ? R = !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 && p.has(b) ? p.get(b) : { x: 0, y: 0 }, C = g ? u(g) : null, _ = C != null && C.preserves ? C.storageKey : null, D = _ && p.has(_) ? p.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
- p.delete(u(v).storageKey);
190
+ evictScrollPosition: (g) => {
191
+ l.delete(u(g));
279
192
  },
280
- shouldPreserve: y,
281
- getScrollContainer: () => s,
282
- getPositionedParentElement: () => h ? Xt(h) : document.body,
283
- getScrollPosition: (v) => {
284
- const g = v ? u(v).storageKey : null;
285
- return g && p.has(g) ? p.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, o = null, s = null, i = !1;
295
- const a = (E, w) => {
296
- for (let T = 0; T < E.length; T++) {
297
- const k = E.item(T);
298
- if (k && k.identifier === w) return k;
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
- }, l = () => {
213
+ }, u = () => {
302
214
  o !== null && (clearTimeout(o), o = null);
303
215
  }, f = () => {
304
- s !== null && (clearTimeout(s), s = null);
305
- }, u = () => {
306
- e = !0, n = !0, l(), f(), o = setTimeout(() => {
307
- e = !1, n = !1, o = null;
308
- }, ne);
309
- }, y = (E) => {
310
- if (E.touches.length !== 1) {
216
+ r !== null && (clearTimeout(r), r = null);
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 w = E.touches.item(0);
315
- if (!w) {
226
+ const b = v.touches.item(0);
227
+ if (!b) {
316
228
  t = null;
317
229
  return;
318
230
  }
319
- const T = window.innerWidth, k = w.clientX <= bt, W = w.clientX >= T - bt;
320
- if (!k && !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: w.identifier,
326
- startX: w.clientX,
327
- startY: w.clientY,
328
- fromLeftEdge: k,
237
+ identifier: b.identifier,
238
+ startX: b.clientX,
239
+ startY: b.clientY,
240
+ fromLeftEdge: R,
329
241
  moved: !1
330
242
  };
331
- }, h = (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 w = a(E.touches, t.identifier);
338
- if (!w) {
249
+ const b = a(v.touches, t.identifier);
250
+ if (!b) {
339
251
  t = null;
340
252
  return;
341
253
  }
342
- const T = w.clientX - t.startX, k = w.clientY - t.startY, W = Math.abs(T), F = Math.abs(k);
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
- }, p = (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 w = a(E.changedTouches, t.identifier);
352
- if (!w) {
263
+ const b = a(v.changedTouches, t.identifier);
264
+ if (!b) {
353
265
  t = null;
354
266
  return;
355
267
  }
356
- const T = w.clientX - t.startX, k = t.fromLeftEdge ? T > 0 : T < 0;
357
- if (t.moved && k && 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
- }, S = () => {
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", h, E), window.addEventListener("touchend", p, E), window.addEventListener("touchcancel", S, 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", h, E), window.removeEventListener("touchend", p, E), window.removeEventListener("touchcancel", S, E), l(), 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 && l(), E;
288
+ const v = n || e;
289
+ return v && u(), v;
378
290
  }, onPageEnter: () => {
379
- e = !1, l(), f(), s = setTimeout(() => {
380
- n = !1, s = 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);
386
314
  }
387
- function oe(t, e, n, o) {
388
- let s = null;
389
- return n.forEach((i, a) => {
390
- const l = i.priority ?? 0;
315
+ function dt(t) {
316
+ return t === "/" ? [] : t.slice(1).split("/");
317
+ }
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) {
382
+ let r = null;
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, h = u ? null : N(t, i.on), p = y ? null : N(e, i.on);
394
- if (h || p) {
395
- const S = !h && p ? "forward" : h && !p ? "backward" : o;
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: S,
392
+ direction: E,
399
393
  ruleIndex: a,
400
- priority: l,
394
+ priority: u,
401
395
  specificity: Math.max(
402
396
  (h == null ? void 0 : h.specificity) ?? 0,
403
- (p == null ? void 0 : p.specificity) ?? 0
397
+ (y == null ? void 0 : y.specificity) ?? 0
404
398
  ),
405
- reason: !h && p ? "on-enter" : h && !p ? "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, h = -1, p = -1;
410
- i.ordered.forEach((S, R) => {
411
- const A = N(t, S);
412
- A && A.specificity > h && (u = R, h = A.specificity);
413
- const L = N(e, S);
414
- L && L.specificity > p && (y = R, p = L.specificity);
415
- }), u >= 0 && y >= 0 && u !== y && (f = {
416
- transition: i.transition,
417
- direction: u < y ? "forward" : "backward",
418
- ruleIndex: a,
419
- priority: l,
420
- specificity: h + p,
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), h = i.bidirectional === !1 ? null : N(t, i.to), p = i.bidirectional === !1 ? null : N(e, i.from), S = u && y, R = h && p;
425
- if (S || R) {
426
- const A = S ? u.specificity + y.specificity : -1, L = R ? h.specificity + p.specificity : -1, K = S && R && A === L ? o : 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,
434
+ direction: X,
430
435
  ruleIndex: a,
431
- priority: l,
432
- specificity: Math.max(A, L),
433
- reason: "pair"
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
- f && se(f, s) && (s = f);
438
- }), s;
446
+ f && se(f, r) && (r = f);
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(o, s) {
448
- const i = V(o), a = V(s);
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 l = t[t.length - 2], f = e || l === a ? "backward" : "forward";
456
- if (e = !1, f === "backward") {
457
- const u = t.lastIndexOf(a);
458
- u >= 0 ? t.splice(u + 1) : t.push(a);
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);
459
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;
469
- function n() {
470
- var s, i;
471
- e && ((s = e.out) == null || s.resolve(null), (i = e.in) == null || i.resolve(null), e = null);
472
- }
476
+ function le(t = {}) {
477
+ let n = null, e = null;
473
478
  function o() {
474
- if (e != null && e.out && e.in) {
475
- if (e.out.path === e.in.path) {
476
- n();
479
+ var i, a;
480
+ n && ((i = n.out) == null || i.resolve(null), (a = n.in) == null || a.resolve(null), n = null);
481
+ }
482
+ function r() {
483
+ if (n != null && n.out && n.in) {
484
+ if (n.out.path === n.in.path) {
485
+ o();
477
486
  return;
478
487
  }
479
- const s = {
480
- from: e.out.path,
481
- to: e.in.path,
482
- out: e.out.payload,
483
- in: e.in.payload
488
+ const i = {
489
+ from: n.out.path,
490
+ to: n.in.path,
491
+ out: n.out.payload,
492
+ in: n.in.payload
484
493
  };
485
- e.out.resolve(s), e.in.resolve(s), e = null;
494
+ e = i, n.out.resolve(i), n.in.resolve(i), n = null;
486
495
  }
487
496
  }
488
497
  return {
489
- arrive(s, i, a) {
490
- return new Promise((l) => {
491
- var y, h;
492
- i === "out" && ((y = e == null ? void 0 : e.in) == null ? void 0 : y.path) === s && !e.out && (e.in.resolve(null), e.in = void 0);
493
- const f = e == null ? void 0 : e[i];
494
- f && f.path !== s && n(), e || (e = {});
495
- const u = e[i];
496
- if (u) {
497
- if (((h = t.keepCurrent) == null ? void 0 : h.call(t, {
498
- type: i,
499
- path: s,
500
- current: u.payload,
501
- next: a
498
+ arrive(i, a, u) {
499
+ return new Promise((f) => {
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) {
503
+ f(null);
504
+ return;
505
+ }
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,
513
+ path: i,
514
+ current: h.payload,
515
+ next: u
502
516
  })) ?? !1) {
503
- l(null);
517
+ f(null);
504
518
  return;
505
519
  }
506
- u.resolve(null);
520
+ h.resolve(null);
507
521
  }
508
- e[i] = { path: s, payload: a, resolve: l }, o();
522
+ n[a] = { path: i, payload: u, resolve: f }, r();
509
523
  });
510
524
  },
511
- cancel(s) {
512
- (e != null && e.out && s(e.out.payload) || e != null && e.in && s(e.in.payload)) && n();
525
+ cancel(i) {
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);
513
527
  }
514
528
  };
515
529
  }
516
- const le = {}, $ = /* @__PURE__ */ new Map();
517
- let J = null, Pt = !1;
518
- function kt(t, e, n) {
519
- t instanceof HTMLElement && $.has(t) && !t.isConnected && n.set(t, { entry: $.get(t), anchor: e });
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 });
520
534
  for (const o of Array.from(t.childNodes))
521
- kt(o, e, n);
535
+ kt(o, n, e);
522
536
  }
523
- function ae(t) {
524
- const e = new Set(
525
- Array.from(t.values(), ({ entry: n }) => n)
537
+ function ue(t) {
538
+ const n = new Set(
539
+ Array.from(t.values(), ({ entry: e }) => e)
526
540
  );
527
- for (const [n, { entry: o, anchor: s }] of t) {
528
- $.delete(n);
541
+ for (const [e, { entry: o, anchor: r }] of t) {
542
+ V.delete(e);
529
543
  let i = o.parent, a = !1;
530
544
  for (; i; ) {
531
- if (i.group === o.group && e.has(i)) {
545
+ if (i.group === o.group && n.has(i)) {
532
546
  a = !0;
533
547
  break;
534
548
  }
535
549
  i = i.parent;
536
550
  }
537
- queueMicrotask(() => o.callback(s, { emit: !a }));
551
+ queueMicrotask(() => o.callback(r, { emit: !a }));
538
552
  }
539
553
  }
540
- function ue() {
541
- if (Pt || typeof document > "u") return;
542
- Pt = !0, J = new MutationObserver((e) => {
543
- const n = /* @__PURE__ */ new Map();
544
- for (const o of e) {
545
- const s = {
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) {
559
+ const r = {
546
560
  parent: o.target,
547
561
  nextSibling: o.nextSibling
548
562
  };
549
563
  for (const i of Array.from(o.removedNodes))
550
- kt(i, s, n);
564
+ kt(i, r, e);
551
565
  }
552
- ae(n);
566
+ ue(e);
553
567
  });
554
568
  const t = () => {
555
- J == null || J.observe(document.body, { childList: !0, subtree: !0 });
569
+ et == null || et.observe(document.body, { childList: !0, subtree: !0 });
556
570
  };
557
571
  document.body ? t() : document.addEventListener("DOMContentLoaded", t, { once: !0 });
558
572
  }
559
- function de(t, e, n = le) {
560
- ue();
561
- let o = t.parentElement, s = null;
573
+ function fe(t, n, e = ae) {
574
+ de();
575
+ let o = t.parentElement, r = null;
562
576
  for (; o; ) {
563
- const i = $.get(o);
564
- if ((i == null ? void 0 : i.group) === n) {
565
- s = i;
577
+ const i = V.get(o);
578
+ if ((i == null ? void 0 : i.group) === e) {
579
+ r = i;
566
580
  break;
567
581
  }
568
582
  o = o.parentElement;
569
583
  }
570
- return $.set(t, {
584
+ return V.set(t, {
571
585
  element: t,
572
- callback: e,
573
- group: n,
574
- parent: s
586
+ callback: n,
587
+ group: e,
588
+ parent: r
575
589
  }), () => {
576
- $.delete(t);
590
+ V.delete(t);
577
591
  };
578
592
  }
579
- const ut = /* @__PURE__ */ new WeakMap();
580
- let tt = null;
581
- const et = "none !important";
582
- function q(t) {
583
- const e = t.style.getPropertyValue("display");
584
- 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;
585
599
  }
586
- function fe() {
587
- return tt || (tt = new MutationObserver((t) => {
588
- for (const e of t) {
589
- const n = e.target, o = ut.get(n);
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);
590
604
  if (!o) continue;
591
- const s = q(n);
592
- s !== o.accounted && (o.accounted = s, s === et ? (o.reactHidden = !0, o.onHide()) : s !== "none" && o.reactHidden && (o.reactHidden = !1, o.onShow()));
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()));
593
607
  }
594
- }), tt);
608
+ }), nt);
595
609
  }
596
- function he(t, e) {
597
- const n = q(t), o = {
598
- accounted: n,
599
- reactHidden: n === et,
600
- onHide: e.onHide,
601
- 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
602
616
  };
603
- return ut.set(t, o), fe().observe(t, {
617
+ return pt.set(t, o), pe().observe(t, {
604
618
  attributes: !0,
605
619
  attributeFilter: ["style"]
606
620
  }), {
607
621
  get isHidden() {
608
- return q(t) === et;
622
+ return Q(t) === it;
609
623
  },
610
- setDisplay(s, i = !1) {
611
- s === null ? t.style.removeProperty("display") : t.style.setProperty(
624
+ setDisplay(r, i = !1) {
625
+ r === null ? t.style.removeProperty("display") : t.style.setProperty(
612
626
  "display",
613
- s,
627
+ r,
614
628
  i ? "important" : ""
615
- ), o.accounted = q(t);
629
+ ), o.accounted = Q(t);
616
630
  },
617
631
  sync() {
618
- o.accounted = q(t), o.reactHidden = o.accounted === et;
632
+ o.accounted = Q(t), o.reactHidden = o.accounted === it;
619
633
  },
620
634
  stop() {
621
- ut.delete(t);
635
+ pt.delete(t);
622
636
  }
623
637
  };
624
638
  }
625
- function Te(t, e = {}) {
626
- const {
627
- transitions: n = [],
628
- middleware: o = (r, c) => ({ from: r, to: c }),
629
- preserveScroll: s = (r) => r
630
- } = t, i = e.host ?? new Ft(), a = {}, l = 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({
631
641
  // Nested boundaries can be discovered in separate MutationObserver
632
642
  // batches (notably when Suspense reveals a child later). When the same
633
643
  // side/path repeats before pairing, the outermost DOM boundary owns it.
634
- keepCurrent: ({ current: r, next: c }) => r.element.contains(c.element)
635
- }), f = re(), u = typeof n == "function" ? n : () => n, y = ie();
636
- y.initialize();
637
- const h = /* @__PURE__ */ new Map(), p = (r) => {
638
- let c = h.get(r);
639
- return c === void 0 && (c = o(r, r).from, h.set(r, 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;
640
650
  }, {
641
- initializeContext: S,
642
- calculateScrollOffset: R,
643
- evictScrollPosition: A,
644
- shouldPreserve: L,
645
- getScrollContainer: K,
646
- getPositionedParentElement: E,
647
- getScrollPosition: w,
648
- getIsMobile: T
649
- } = ee({ preserveScroll: s, resolvePath: p }), k = /* @__PURE__ */ new Map(), W = () => {
650
- const r = T();
651
- let c = k.get(r);
652
- return c || (c = u({ isMobile: r }), k.set(r, c)), c;
653
- }, F = /* @__PURE__ */ new WeakMap(), v = (r) => {
654
- F.set(r, {
655
- parent: r.parentNode,
656
- nextSibling: r.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
657
666
  });
658
- }, g = (r) => {
659
- const c = F.get(r);
667
+ }, g = (s) => {
668
+ const c = R.get(s);
660
669
  return c || {
661
- parent: r.parentNode,
662
- nextSibling: r.nextSibling
670
+ parent: s.parentNode,
671
+ nextSibling: s.nextSibling
663
672
  };
664
- }, b = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap();
665
- let C = 0;
666
- const _ = (r) => {
667
- const c = typeof getComputedStyle < "u" ? getComputedStyle(r).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 : "";
668
677
  return c && c !== "none" ? c : "block";
669
- }, D = (r, c) => {
670
- c.visibleDisplay = r.style.getPropertyValue("display"), c.computedDisplay = _(r);
671
- }, dt = (r, c) => {
672
- if (P.get(r) !== c) return;
673
- P.delete(r);
674
- const d = b.get(r);
675
- d && (d.savedCss !== null && (r.style.cssText = d.savedCss, d.savedCss = null), d.intent === "hidden" ? d.vis.setDisplay("none", !0) : d.visibleDisplay ? (d.vis.setDisplay(d.visibleDisplay, !1), D(r, d)) : (d.vis.setDisplay(null), D(r, d)));
676
- }, Lt = (r, c, d, M, m, O) => {
677
- 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 = R(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 = {
678
691
  direction: c,
679
- scrollOffset: Q,
680
- from: { scroll: w(d) },
681
- to: { scroll: w(M) },
692
+ scrollOffset: J,
693
+ from: { scroll: X(d) },
694
+ to: {
695
+ scroll: X(M, A.to)
696
+ },
682
697
  get scrollingElement() {
683
- return K() || document.documentElement;
698
+ return x() || document.documentElement;
684
699
  },
685
700
  get positionedParent() {
686
- return E();
701
+ return _();
687
702
  }
688
703
  };
689
- let I;
690
- if (B) {
691
- I = x, I.style.top = `${-1 * ((Q == null ? void 0 : Q.y) ?? 0)}px`;
692
- const z = b.get(H);
693
- 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);
694
709
  } else
695
- I = x, zt(I, st);
696
- L(d) || A(d);
697
- const j = B ? ++C : 0;
698
- B && (P.set(H, j), P.set(x, j));
699
- const yt = Promise.resolve(I), mt = Promise.resolve(H), gt = [], It = {
700
- from: yt,
701
- to: mt,
702
- context: st,
703
- createElement: ((z, ot = "div") => {
704
- const G = document.createElement(ot);
705
- 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;
706
721
  })
707
722
  }, Nt = Promise.resolve(
708
- r.prepare ? r.prepare(It) : {}
723
+ s.prepare ? s.prepare(It) : {}
709
724
  );
710
- $t({
711
- from: yt,
712
- to: mt,
725
+ Ut({
726
+ from: vt,
727
+ to: St,
713
728
  extras: Nt
714
- }).then(({ from: z, to: ot, extras: G }) => {
715
- !B && Z && (it && Z.contains(it) ? Z.insertBefore(I, it) : Z.appendChild(I));
716
- const rt = r.animation({
717
- from: z,
718
- to: ot,
719
- context: st,
720
- ...G
721
- }), ct = rt.onComplete;
722
- rt.onComplete = () => {
723
- ct == null || ct(), B ? (dt(x, j), dt(H, j)) : I.parentNode && I.parentNode.removeChild(I);
724
- for (const lt of gt)
725
- lt.parentNode && lt.parentNode.removeChild(lt);
726
- }, 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);
727
742
  });
728
- }, Y = (r, c, d) => {
729
- const M = y.isSwipeBack();
730
- l.arrive(r, c, d).then((m) => {
731
- if (c === "in" && y.onPageEnter(), !m) return;
732
- if (M && c === "in") {
733
- const B = o(m.from, m.to);
734
- f.resolve(B.from, B.to);
735
- }
736
- if (M) {
737
- c === "out" && m.from && !L(m.from) && A(m.from);
738
- return;
739
- }
740
- if (c !== "in") return;
741
- const { from: O, to: x } = o(
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(
742
749
  m.from,
743
750
  m.to
744
- ), H = f.resolve(
745
- O,
746
- x
747
- ), X = oe(
748
- O,
749
- x,
750
- W(),
751
- H
751
+ ), W = u.resolve(
752
+ L,
753
+ A
754
+ ), k = re(
755
+ L,
756
+ A,
757
+ T(),
758
+ W
752
759
  );
753
- X && Lt(
754
- X.transition,
755
- 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,
756
771
  m.from,
757
772
  m.to,
758
773
  m.out,
759
- m.in
774
+ m.in,
775
+ k.preserveScroll
760
776
  );
761
777
  });
762
- }, Ot = (r, c) => {
763
- const d = b.get(r);
778
+ }, $ = (s, c) => {
779
+ const d = S.get(s);
764
780
  if (!d) return;
765
781
  const M = d.intent === "hidden";
766
- if (d.intent = "hidden", d.savedCss === null && (d.savedCss = r.style.cssText), d.vis.setDisplay(d.computedDisplay || "block", !0), r.style.position = "absolute", r.style.width = "100%", r.style.left = "0", M) return;
767
- const m = g(r), O = {
768
- element: r,
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,
769
785
  parent: m.parent,
770
786
  nextSibling: m.nextSibling,
771
787
  mode: "hidden"
772
- }, x = r.getAttribute("data-ssgoi-transition") ?? c;
773
- Y(x, "out", O);
774
- }, _t = (r, c) => {
775
- const d = b.get(r);
788
+ }, A = s.getAttribute("data-ssgoi-transition") ?? c;
789
+ B(A, "out", L);
790
+ }, ht = (s, c) => {
791
+ const d = S.get(s);
776
792
  if (!d || d.intent === "visible") return;
777
- d.intent = "visible", D(r, d), d.savedCss !== null && (r.style.cssText = d.savedCss, d.visibleDisplay ? d.vis.setDisplay(d.visibleDisplay, !1) : d.vis.setDisplay(null)), S(r, c);
778
- const M = {
779
- element: r,
780
- parent: r.parentElement,
781
- nextSibling: r.nextElementSibling
782
- }, m = r.getAttribute("data-ssgoi-transition") ?? c;
783
- Y(m, "in", M);
784
- }, Dt = (r, c, d, M = !0) => {
785
- const m = b.get(r);
786
- if (m && (m.vis.stop(), b.delete(r), P.delete(r), m.intent === "hidden")) {
787
- l.cancel((X) => X.element === r);
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);
788
805
  return;
789
806
  }
790
807
  if (!M) return;
791
- const O = d ?? g(r), x = {
792
- element: r,
793
- parent: O.parent,
794
- nextSibling: O.nextSibling,
808
+ const L = d ?? g(s), A = {
809
+ element: s,
810
+ parent: L.parent,
811
+ nextSibling: L.nextSibling,
795
812
  mode: "unmount"
796
- }, H = r.getAttribute("data-ssgoi-transition") ?? c;
797
- Y(H, "out", x);
798
- }, ft = /* @__PURE__ */ new WeakSet(), ht = (r, c, { enter: d = !0 } = {}) => {
799
- if (ft.has(c)) return;
800
- 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);
801
818
  const M = he(c, {
802
- onHide: () => Ot(c, r),
803
- onShow: () => _t(c, r)
819
+ onHide: () => $(c, s),
820
+ onShow: () => ht(c, s)
804
821
  }), m = {
805
822
  vis: M,
806
823
  savedCss: null,
@@ -808,105 +825,105 @@ function Te(t, e = {}) {
808
825
  visibleDisplay: "",
809
826
  computedDisplay: "block"
810
827
  };
811
- if (b.set(c, m), !M.isHidden && (D(c, m), d)) {
812
- S(c, r);
813
- const O = {
828
+ if (S.set(c, m), !M.isHidden && (P(c, m), d)) {
829
+ const L = y(c, s), A = {
814
830
  element: c,
815
831
  parent: c.parentElement,
816
- nextSibling: c.nextElementSibling
832
+ nextSibling: c.nextElementSibling,
833
+ applyScrollPolicy: L
817
834
  };
818
- Y(r, "in", O);
835
+ B(s, "in", A);
819
836
  }
820
- de(
837
+ fe(
821
838
  c,
822
- (O, x) => Dt(c, r, O, (x == null ? void 0 : x.emit) ?? !0),
823
- a
839
+ (L, A) => Dt(c, s, L, (A == null ? void 0 : A.emit) ?? !0),
840
+ i
824
841
  );
825
- }, pt = /* @__PURE__ */ new Map();
826
- return { register: ht, refFor: (r) => {
827
- let c = pt.get(r);
842
+ }, gt = /* @__PURE__ */ new Map();
843
+ return { register: mt, refFor: (s) => {
844
+ let c = gt.get(s);
828
845
  return c || (c = (d) => {
829
- d && ht(r, d);
830
- }, pt.set(r, c)), c;
846
+ d && mt(s, d);
847
+ }, gt.set(s, c)), c;
831
848
  } };
832
849
  }
833
- const Rt = "data-ssgoi-root", pe = `[${Rt}]`, nt = "data-ssgoi-transition", xt = `[${nt}]`, ye = "[data-ssgoi-clone]";
834
- function me() {
850
+ const _t = "data-ssgoi-root", ye = `[${_t}]`, ot = "data-ssgoi-transition", Lt = `[${ot}]`, me = "[data-ssgoi-clone]";
851
+ function ge() {
835
852
  return typeof MutationObserver < "u" && typeof HTMLElement < "u" && typeof Node < "u";
836
853
  }
837
- function ge(t) {
854
+ function ve(t) {
838
855
  return t.nodeType === Node.ELEMENT_NODE;
839
856
  }
840
- function ve(t) {
857
+ function Se(t) {
841
858
  return t instanceof HTMLElement;
842
859
  }
843
- function Ct(t) {
844
- let e = 0, n = t.parentElement;
845
- for (; n; )
846
- e++, n = n.parentElement;
847
- return e;
860
+ function Rt(t) {
861
+ let n = 0, e = t.parentElement;
862
+ for (; e; )
863
+ n++, e = e.parentElement;
864
+ return n;
848
865
  }
849
- function Mt(t, e, n = t) {
866
+ function Ot(t, n, e = t) {
850
867
  const o = Array.from(t).sort(
851
- (s, i) => Ct(s) - Ct(i)
868
+ (r, i) => Rt(r) - Rt(i)
852
869
  );
853
- for (const s of o) {
854
- const i = s.getAttribute(nt);
870
+ for (const r of o) {
871
+ const i = r.getAttribute(ot);
855
872
  if (i === null) continue;
856
- let a = s.parentElement, l = !1;
873
+ let a = r.parentElement, u = !1;
857
874
  for (; a; ) {
858
- if (n.has(a)) {
859
- l = !0;
875
+ if (e.has(a)) {
876
+ u = !0;
860
877
  break;
861
878
  }
862
879
  a = a.parentElement;
863
880
  }
864
- e.register(i, s, { enter: !l });
881
+ n.register(i, r, { enter: !u });
865
882
  }
866
883
  }
867
- function Pe(t, e) {
868
- if (!me()) return () => {
884
+ function xe(t, n) {
885
+ if (!ge()) return () => {
869
886
  };
870
- t.setAttribute(Rt, "");
871
- const n = (l) => l.closest(pe) === t, o = (l) => !ve(l) || !n(l) || l.closest(ye) || l.getAttribute(nt) === null ? null : l, s = (l, f) => {
872
- if (ge(l)) {
873
- if (l.matches(xt)) {
874
- const u = o(l);
875
- 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);
876
893
  }
877
- for (const u of l.querySelectorAll(xt)) {
878
- const y = o(u);
879
- y && f.add(y);
894
+ for (const l of u.querySelectorAll(Lt)) {
895
+ const p = o(l);
896
+ p && f.add(p);
880
897
  }
881
898
  }
882
- }, i = new MutationObserver((l) => {
883
- const f = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
884
- for (const y of l) {
885
- if (y.type === "attributes") {
886
- const h = o(y.target);
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);
887
904
  h && f.add(h);
888
905
  continue;
889
906
  }
890
- for (const h of y.addedNodes)
891
- s(h, u);
907
+ for (const h of p.addedNodes)
908
+ r(h, l);
892
909
  }
893
- for (const y of u) f.add(y);
894
- Mt(f, e, u);
910
+ for (const p of l) f.add(p);
911
+ Ot(f, n, l);
895
912
  });
896
913
  i.observe(t, {
897
914
  childList: !0,
898
915
  subtree: !0,
899
916
  attributes: !0,
900
- attributeFilter: [nt]
917
+ attributeFilter: [ot]
901
918
  });
902
919
  const a = /* @__PURE__ */ new Set();
903
- return s(t, a), Mt(a, e), () => i.disconnect();
920
+ return r(t, a), Ot(a, n), () => i.disconnect();
904
921
  }
905
922
  export {
906
- Bt as Animation,
907
- Ft as HostAnimation,
923
+ Ft as Animation,
924
+ Bt as HostAnimation,
908
925
  Me as MultiAnimation,
909
- Ae as WebAnimation,
910
- Te as createSggoiTransitionContext,
911
- Pe as observeSsgoiTransitions
926
+ Le as WebAnimation,
927
+ Pe as createSggoiTransitionContext,
928
+ xe as observeSsgoiTransitions
912
929
  };