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

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