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