flemo 1.5.1 → 1.5.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/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import { jsx as x, jsxs as yt } from "react/jsx-runtime";
2
- import at, { useEffect as Y, createContext as Et, useContext as St, useReducer as qt, Children as Mt, useImperativeHandle as Bt, useState as ot, useRef as $, useLayoutEffect as Tt, Activity as Ct } from "react";
3
- import { transform as bt, useAnimate as Rt, motion as At, useDragControls as Xt, AnimatePresence as Kt, MotionConfig as Wt } from "motion/react";
4
- var H = {}, Lt;
5
- function zt() {
6
- if (Lt) return H;
7
- Lt = 1, Object.defineProperty(H, "__esModule", { value: !0 }), H.PathError = H.TokenData = void 0, H.parse = l, H.compile = E, H.match = L, H.pathToRegexp = D, H.stringify = Q;
1
+ import { jsx as x, jsxs as mt, Fragment as Xt } from "react/jsx-runtime";
2
+ import st, { useEffect as V, createContext as St, useContext as Pt, useReducer as Kt, Children as Ct, useRef as O, useImperativeHandle as zt, useState as at, useLayoutEffect as Dt } from "react";
3
+ import { transform as Rt, useAnimate as At, motion as bt, useDragControls as Wt, AnimatePresence as Jt, MotionConfig as Zt } from "motion/react";
4
+ var G = {}, Lt;
5
+ function te() {
6
+ if (Lt) return G;
7
+ Lt = 1, Object.defineProperty(G, "__esModule", { value: !0 }), G.PathError = G.TokenData = void 0, G.parse = l, G.compile = w, G.match = L, G.pathToRegexp = D, G.stringify = tt;
8
8
  const n = "/", e = (i) => i, t = /^[$_\p{ID_Start}]$/u, s = /^[$\u200c\u200d\p{ID_Continue}]$/u, r = {
9
9
  // Groups.
10
10
  "{": "{",
@@ -24,250 +24,253 @@ function zt() {
24
24
  function o(i) {
25
25
  return i.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
26
26
  }
27
- class c {
28
- constructor(d, y) {
29
- this.tokens = d, this.originalPath = y;
27
+ class u {
28
+ constructor(p, y) {
29
+ this.tokens = p, this.originalPath = y;
30
30
  }
31
31
  }
32
- H.TokenData = c;
33
- class f extends TypeError {
34
- constructor(d, y) {
35
- let m = d;
32
+ G.TokenData = u;
33
+ class h extends TypeError {
34
+ constructor(p, y) {
35
+ let m = p;
36
36
  y && (m += `: ${y}`), m += "; visit https://git.new/pathToRegexpError for info", super(m), this.originalPath = y;
37
37
  }
38
38
  }
39
- H.PathError = f;
40
- function l(i, d = {}) {
41
- const { encodePath: y = e } = d, m = [...i], h = [];
42
- let p = 0, S = 0;
39
+ G.PathError = h;
40
+ function l(i, p = {}) {
41
+ const { encodePath: y = e } = p, m = [...i], g = [];
42
+ let f = 0, S = 0;
43
43
  function T() {
44
- let w = "";
45
- if (t.test(m[p]))
44
+ let E = "";
45
+ if (t.test(m[f]))
46
46
  do
47
- w += m[p++];
48
- while (s.test(m[p]));
49
- else if (m[p] === '"') {
50
- let R = p;
51
- for (; p++ < m.length; ) {
52
- if (m[p] === '"') {
53
- p++, R = 0;
47
+ E += m[f++];
48
+ while (s.test(m[f]));
49
+ else if (m[f] === '"') {
50
+ let M = f;
51
+ for (; f++ < m.length; ) {
52
+ if (m[f] === '"') {
53
+ f++, M = 0;
54
54
  break;
55
55
  }
56
- m[p] === "\\" && p++, w += m[p];
56
+ m[f] === "\\" && f++, E += m[f];
57
57
  }
58
- if (R)
59
- throw new f(`Unterminated quote at index ${R}`, i);
58
+ if (M)
59
+ throw new h(`Unterminated quote at index ${M}`, i);
60
60
  }
61
- if (!w)
62
- throw new f(`Missing parameter name at index ${p}`, i);
63
- return w;
61
+ if (!E)
62
+ throw new h(`Missing parameter name at index ${f}`, i);
63
+ return E;
64
64
  }
65
- for (; p < m.length; ) {
66
- const w = m[p], R = r[w];
67
- R ? h.push({ type: R, index: p++, value: w }) : w === "\\" ? h.push({ type: "escape", index: p++, value: m[p++] }) : w === ":" ? h.push({ type: "param", index: p++, value: T() }) : w === "*" ? h.push({ type: "wildcard", index: p++, value: T() }) : h.push({ type: "char", index: p++, value: w });
65
+ for (; f < m.length; ) {
66
+ const E = m[f], M = r[E];
67
+ M ? g.push({ type: M, index: f++, value: E }) : E === "\\" ? g.push({ type: "escape", index: f++, value: m[f++] }) : E === ":" ? g.push({ type: "param", index: f++, value: T() }) : E === "*" ? g.push({ type: "wildcard", index: f++, value: T() }) : g.push({ type: "char", index: f++, value: E });
68
68
  }
69
- h.push({ type: "end", index: p, value: "" });
70
- function C(w) {
71
- const R = [];
69
+ g.push({ type: "end", index: f, value: "" });
70
+ function k(E) {
71
+ const M = [];
72
72
  for (; ; ) {
73
- const N = h[S++];
74
- if (N.type === w)
73
+ const N = g[S++];
74
+ if (N.type === E)
75
75
  break;
76
76
  if (N.type === "char" || N.type === "escape") {
77
- let O = N.value, j = h[S];
78
- for (; j.type === "char" || j.type === "escape"; )
79
- O += j.value, j = h[++S];
80
- R.push({
77
+ let R = N.value, H = g[S];
78
+ for (; H.type === "char" || H.type === "escape"; )
79
+ R += H.value, H = g[++S];
80
+ M.push({
81
81
  type: "text",
82
- value: y(O)
82
+ value: y(R)
83
83
  });
84
84
  continue;
85
85
  }
86
86
  if (N.type === "param" || N.type === "wildcard") {
87
- R.push({
87
+ M.push({
88
88
  type: N.type,
89
89
  name: N.value
90
90
  });
91
91
  continue;
92
92
  }
93
93
  if (N.type === "{") {
94
- R.push({
94
+ M.push({
95
95
  type: "group",
96
- tokens: C("}")
96
+ tokens: k("}")
97
97
  });
98
98
  continue;
99
99
  }
100
- throw new f(`Unexpected ${N.type} at index ${N.index}, expected ${w}`, i);
100
+ throw new h(`Unexpected ${N.type} at index ${N.index}, expected ${E}`, i);
101
101
  }
102
- return R;
102
+ return M;
103
103
  }
104
- return new c(C("end"), i);
104
+ return new u(k("end"), i);
105
105
  }
106
- function E(i, d = {}) {
107
- const { encode: y = encodeURIComponent, delimiter: m = n } = d, h = typeof i == "object" ? i : l(i, d), p = g(h.tokens, m, y);
106
+ function w(i, p = {}) {
107
+ const { encode: y = encodeURIComponent, delimiter: m = n } = p, g = typeof i == "object" ? i : l(i, p), f = d(g.tokens, m, y);
108
108
  return function(T = {}) {
109
- const [C, ...w] = p(T);
110
- if (w.length)
111
- throw new TypeError(`Missing parameters: ${w.join(", ")}`);
112
- return C;
109
+ const [k, ...E] = f(T);
110
+ if (E.length)
111
+ throw new TypeError(`Missing parameters: ${E.join(", ")}`);
112
+ return k;
113
113
  };
114
114
  }
115
- function g(i, d, y) {
116
- const m = i.map((h) => u(h, d, y));
117
- return (h) => {
118
- const p = [""];
115
+ function d(i, p, y) {
116
+ const m = i.map((g) => c(g, p, y));
117
+ return (g) => {
118
+ const f = [""];
119
119
  for (const S of m) {
120
- const [T, ...C] = S(h);
121
- p[0] += T, p.push(...C);
120
+ const [T, ...k] = S(g);
121
+ f[0] += T, f.push(...k);
122
122
  }
123
- return p;
123
+ return f;
124
124
  };
125
125
  }
126
- function u(i, d, y) {
126
+ function c(i, p, y) {
127
127
  if (i.type === "text")
128
128
  return () => [i.value];
129
129
  if (i.type === "group") {
130
- const h = g(i.tokens, d, y);
131
- return (p) => {
132
- const [S, ...T] = h(p);
130
+ const g = d(i.tokens, p, y);
131
+ return (f) => {
132
+ const [S, ...T] = g(f);
133
133
  return T.length ? [""] : [S];
134
134
  };
135
135
  }
136
136
  const m = y || e;
137
- return i.type === "wildcard" && y !== !1 ? (h) => {
138
- const p = h[i.name];
139
- if (p == null)
137
+ return i.type === "wildcard" && y !== !1 ? (g) => {
138
+ const f = g[i.name];
139
+ if (f == null)
140
140
  return ["", i.name];
141
- if (!Array.isArray(p) || p.length === 0)
141
+ if (!Array.isArray(f) || f.length === 0)
142
142
  throw new TypeError(`Expected "${i.name}" to be a non-empty array`);
143
143
  return [
144
- p.map((S, T) => {
144
+ f.map((S, T) => {
145
145
  if (typeof S != "string")
146
146
  throw new TypeError(`Expected "${i.name}/${T}" to be a string`);
147
147
  return m(S);
148
- }).join(d)
148
+ }).join(p)
149
149
  ];
150
- } : (h) => {
151
- const p = h[i.name];
152
- if (p == null)
150
+ } : (g) => {
151
+ const f = g[i.name];
152
+ if (f == null)
153
153
  return ["", i.name];
154
- if (typeof p != "string")
154
+ if (typeof f != "string")
155
155
  throw new TypeError(`Expected "${i.name}" to be a string`);
156
- return [m(p)];
156
+ return [m(f)];
157
157
  };
158
158
  }
159
- function L(i, d = {}) {
160
- const { decode: y = decodeURIComponent, delimiter: m = n } = d, { regexp: h, keys: p } = D(i, d), S = p.map((T) => y === !1 ? e : T.type === "param" ? y : (C) => C.split(m).map(y));
161
- return function(C) {
162
- const w = h.exec(C);
163
- if (!w)
159
+ function L(i, p = {}) {
160
+ const { decode: y = decodeURIComponent, delimiter: m = n } = p, { regexp: g, keys: f } = D(i, p), S = f.map((T) => y === !1 ? e : T.type === "param" ? y : (k) => k.split(m).map(y));
161
+ return function(k) {
162
+ const E = g.exec(k);
163
+ if (!E)
164
164
  return !1;
165
- const R = w[0], N = /* @__PURE__ */ Object.create(null);
166
- for (let O = 1; O < w.length; O++) {
167
- if (w[O] === void 0)
165
+ const M = E[0], N = /* @__PURE__ */ Object.create(null);
166
+ for (let R = 1; R < E.length; R++) {
167
+ if (E[R] === void 0)
168
168
  continue;
169
- const j = p[O - 1], ut = S[O - 1];
170
- N[j.name] = ut(w[O]);
169
+ const H = f[R - 1], lt = S[R - 1];
170
+ N[H.name] = lt(E[R]);
171
171
  }
172
- return { path: R, params: N };
172
+ return { path: M, params: N };
173
173
  };
174
174
  }
175
- function D(i, d = {}) {
176
- const { delimiter: y = n, end: m = !0, sensitive: h = !1, trailing: p = !0 } = d, S = [], T = h ? "" : "i", C = [];
175
+ function D(i, p = {}) {
176
+ const { delimiter: y = n, end: m = !0, sensitive: g = !1, trailing: f = !0 } = p, S = [], T = g ? "" : "i", k = [];
177
177
  for (const N of I(i, [])) {
178
- const O = typeof N == "object" ? N : l(N, d);
179
- for (const j of P(O.tokens, 0, []))
180
- C.push(M(j, y, S, O.originalPath));
178
+ const R = typeof N == "object" ? N : l(N, p);
179
+ for (const H of v(R.tokens, 0, []))
180
+ k.push(b(H, y, S, R.originalPath));
181
181
  }
182
- let w = `^(?:${C.join("|")})`;
183
- return p && (w += `(?:${o(y)}$)?`), w += m ? "$" : `(?=${o(y)}|$)`, { regexp: new RegExp(w, T), keys: S };
182
+ let E = `^(?:${k.join("|")})`;
183
+ return f && (E += `(?:${o(y)}$)?`), E += m ? "$" : `(?=${o(y)}|$)`, { regexp: new RegExp(E, T), keys: S };
184
184
  }
185
- function I(i, d) {
185
+ function I(i, p) {
186
186
  if (Array.isArray(i))
187
187
  for (const y of i)
188
- I(y, d);
188
+ I(y, p);
189
189
  else
190
- d.push(i);
191
- return d;
190
+ p.push(i);
191
+ return p;
192
192
  }
193
- function* P(i, d, y) {
194
- if (d === i.length)
193
+ function* v(i, p, y) {
194
+ if (p === i.length)
195
195
  return yield y;
196
- const m = i[d];
196
+ const m = i[p];
197
197
  if (m.type === "group")
198
- for (const h of P(m.tokens, 0, y.slice()))
199
- yield* P(i, d + 1, h);
198
+ for (const g of v(m.tokens, 0, y.slice()))
199
+ yield* v(i, p + 1, g);
200
200
  else
201
201
  y.push(m);
202
- yield* P(i, d + 1, y);
202
+ yield* v(i, p + 1, y);
203
203
  }
204
- function M(i, d, y, m) {
205
- let h = "", p = "", S = !0;
204
+ function b(i, p, y, m) {
205
+ let g = "", f = "", S = !0;
206
206
  for (const T of i) {
207
207
  if (T.type === "text") {
208
- h += o(T.value), p += T.value, S || (S = T.value.includes(d));
208
+ g += o(T.value), f += T.value, S || (S = T.value.includes(p));
209
209
  continue;
210
210
  }
211
211
  if (T.type === "param" || T.type === "wildcard") {
212
- if (!S && !p)
213
- throw new f(`Missing text before "${T.name}" ${T.type}`, m);
214
- T.type === "param" ? h += `(${W(d, S ? "" : p)}+)` : h += "([\\s\\S]+)", y.push(T), p = "", S = !1;
212
+ if (!S && !f)
213
+ throw new h(`Missing text before "${T.name}" ${T.type}`, m);
214
+ T.type === "param" ? g += `(${ut(p, S ? "" : f)}+)` : g += "([\\s\\S]+)", y.push(T), f = "", S = !1;
215
215
  continue;
216
216
  }
217
217
  }
218
- return h;
218
+ return g;
219
219
  }
220
- function W(i, d) {
221
- return d.length < 2 ? i.length < 2 ? `[^${o(i + d)}]` : `(?:(?!${o(i)})[^${o(d)}])` : i.length < 2 ? `(?:(?!${o(d)})[^${o(i)}])` : `(?:(?!${o(d)}|${o(i)})[\\s\\S])`;
220
+ function ut(i, p) {
221
+ return p.length < 2 ? i.length < 2 ? `[^${o(i + p)}]` : `(?:(?!${o(i)})[^${o(p)}])` : i.length < 2 ? `(?:(?!${o(p)})[^${o(i)}])` : `(?:(?!${o(p)}|${o(i)})[\\s\\S])`;
222
222
  }
223
- function _(i) {
224
- let d = "", y = 0;
225
- function m(h) {
226
- return k(h) && b(i[y]) ? h : JSON.stringify(h);
223
+ function W(i) {
224
+ let p = "", y = 0;
225
+ function m(g) {
226
+ return _(g) && q(i[y]) ? g : JSON.stringify(g);
227
227
  }
228
228
  for (; y < i.length; ) {
229
- const h = i[y++];
230
- if (h.type === "text") {
231
- d += a(h.value);
229
+ const g = i[y++];
230
+ if (g.type === "text") {
231
+ p += a(g.value);
232
232
  continue;
233
233
  }
234
- if (h.type === "group") {
235
- d += `{${_(h.tokens)}}`;
234
+ if (g.type === "group") {
235
+ p += `{${W(g.tokens)}}`;
236
236
  continue;
237
237
  }
238
- if (h.type === "param") {
239
- d += `:${m(h.name)}`;
238
+ if (g.type === "param") {
239
+ p += `:${m(g.name)}`;
240
240
  continue;
241
241
  }
242
- if (h.type === "wildcard") {
243
- d += `*${m(h.name)}`;
242
+ if (g.type === "wildcard") {
243
+ p += `*${m(g.name)}`;
244
244
  continue;
245
245
  }
246
- throw new TypeError(`Unknown token type: ${h.type}`);
246
+ throw new TypeError(`Unknown token type: ${g.type}`);
247
247
  }
248
- return d;
248
+ return p;
249
249
  }
250
- function Q(i) {
251
- return _(i.tokens);
250
+ function tt(i) {
251
+ return W(i.tokens);
252
252
  }
253
- function k(i) {
254
- const [d, ...y] = i;
255
- return t.test(d) && y.every((m) => s.test(m));
253
+ function _(i) {
254
+ const [p, ...y] = i;
255
+ return t.test(p) && y.every((m) => s.test(m));
256
256
  }
257
- function b(i) {
257
+ function q(i) {
258
258
  return i && i.type === "text" ? !s.test(i.value[0]) : !0;
259
259
  }
260
- return H;
260
+ return G;
261
+ }
262
+ var J = te();
263
+ function Ot(n, e) {
264
+ return Array.isArray(n) ? n.find((t) => J.pathToRegexp(t).regexp.test(e)) ?? "" : J.pathToRegexp(n).regexp.test(e) ? n : "";
261
265
  }
262
- var K = zt();
263
- function Jt(n, e, t) {
264
- const s = Array.isArray(n) ? n.find((c) => K.pathToRegexp(c).regexp.test(e)) || "" : K.pathToRegexp(n).regexp.test(e) ? n : "", r = K.match(s)(e), a = new URLSearchParams(t), o = Object.fromEntries(a.entries());
266
+ function ee(n, e, t) {
267
+ const s = Ot(n, e), r = J.match(s)(e), a = new URLSearchParams(t), o = Object.fromEntries(a.entries());
265
268
  return r ? { ...r.params, ...o } : {};
266
269
  }
267
- function Dt() {
270
+ function It() {
268
271
  return typeof document > "u";
269
272
  }
270
- class Zt {
273
+ class ne {
271
274
  tasks = /* @__PURE__ */ new Map();
272
275
  instanceId = Date.now().toString();
273
276
  isLocked = !1;
@@ -335,7 +338,7 @@ class Zt {
335
338
  return new Promise((r, a) => {
336
339
  this.taskQueue = this.taskQueue.then(async () => {
337
340
  try {
338
- const { control: o, validate: c, rollback: f, dependencies: l = [], delay: E } = t, g = new AbortController(), u = {
341
+ const { control: o, validate: u, rollback: h, dependencies: l = [], delay: w } = t, d = new AbortController(), c = {
339
342
  id: s,
340
343
  execute: e,
341
344
  timestamp: Date.now(),
@@ -343,67 +346,67 @@ class Zt {
343
346
  status: "PENDING",
344
347
  dependencies: l,
345
348
  instanceId: this.instanceId,
346
- validate: c,
347
- rollback: f,
349
+ validate: u,
350
+ rollback: h,
348
351
  control: o,
349
- abortController: g
352
+ abortController: d
350
353
  };
351
- this.tasks.set(u.id, u), this.pendingTaskQueue.length > 0 && (this.pendingTaskQueue.push(u), await this.waitForPendingTasks(), this.pendingTaskQueue = this.pendingTaskQueue.filter((D) => D.id !== u.id));
354
+ this.tasks.set(c.id, c), this.pendingTaskQueue.length > 0 && (this.pendingTaskQueue.push(c), await this.waitForPendingTasks(), this.pendingTaskQueue = this.pendingTaskQueue.filter((D) => D.id !== c.id));
352
355
  try {
353
- if (!await this.acquireLock(u.id))
354
- throw u.status = "FAILED", new Error("FAILED");
356
+ if (!await this.acquireLock(c.id))
357
+ throw c.status = "FAILED", new Error("FAILED");
355
358
  try {
356
- u.status = "PROCESSING";
357
- for (const P of u.dependencies) {
358
- const M = this.tasks.get(P);
359
- if (!M || M.status !== "COMPLETED")
360
- throw u.status = "FAILED", new Error("FAILED");
359
+ c.status = "PROCESSING";
360
+ for (const v of c.dependencies) {
361
+ const b = this.tasks.get(v);
362
+ if (!b || b.status !== "COMPLETED")
363
+ throw c.status = "FAILED", new Error("FAILED");
361
364
  }
362
- if (u.validate && !await u.validate())
363
- throw u.status = "FAILED", new Error("FAILED");
364
- E && E > 0 && await new Promise((P) => setTimeout(P, E));
365
- const I = await u.execute(u.abortController);
366
- if (u.abortController.signal.aborted) {
367
- u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), r({
365
+ if (c.validate && !await c.validate())
366
+ throw c.status = "FAILED", new Error("FAILED");
367
+ w && w > 0 && await new Promise((v) => setTimeout(v, w));
368
+ const I = await c.execute(c.abortController);
369
+ if (c.abortController.signal.aborted) {
370
+ c.status = "COMPLETED", await this.onTaskStatusChange(c.id, "COMPLETED"), r({
368
371
  success: !0,
369
372
  result: void 0,
370
- taskId: u.id,
373
+ taskId: c.id,
371
374
  timestamp: Date.now(),
372
375
  instanceId: this.instanceId
373
376
  });
374
377
  return;
375
378
  }
376
379
  if (t.control) {
377
- const P = t.control;
378
- if (P.delay && P.delay > 0 && await new Promise((M) => setTimeout(M, P.delay)), P.manual) {
379
- u.status = "MANUAL_PENDING", u.manualResolver = { resolve: r, reject: a, result: I }, this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "MANUAL_PENDING");
380
+ const v = t.control;
381
+ if (v.delay && v.delay > 0 && await new Promise((b) => setTimeout(b, v.delay)), v.manual) {
382
+ c.status = "MANUAL_PENDING", c.manualResolver = { resolve: r, reject: a, result: I }, this.pendingTaskQueue.push(c), await this.onTaskStatusChange(c.id, "MANUAL_PENDING");
380
383
  return;
381
384
  }
382
- if (P.signal) {
383
- u.status = "SIGNAL_PENDING", u.manualResolver = { resolve: r, reject: a, result: I }, this.signalListeners.has(P.signal) || this.signalListeners.set(P.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(P.signal).add(u.id), this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "SIGNAL_PENDING");
385
+ if (v.signal) {
386
+ c.status = "SIGNAL_PENDING", c.manualResolver = { resolve: r, reject: a, result: I }, this.signalListeners.has(v.signal) || this.signalListeners.set(v.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(v.signal).add(c.id), this.pendingTaskQueue.push(c), await this.onTaskStatusChange(c.id, "SIGNAL_PENDING");
384
387
  return;
385
388
  }
386
- if (P.condition && !await P.condition()) {
387
- u.status = "MANUAL_PENDING", u.manualResolver = { resolve: r, reject: a, result: I }, this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "MANUAL_PENDING");
389
+ if (v.condition && !await v.condition()) {
390
+ c.status = "MANUAL_PENDING", c.manualResolver = { resolve: r, reject: a, result: I }, this.pendingTaskQueue.push(c), await this.onTaskStatusChange(c.id, "MANUAL_PENDING");
388
391
  return;
389
392
  }
390
393
  }
391
- u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), r({
394
+ c.status = "COMPLETED", await this.onTaskStatusChange(c.id, "COMPLETED"), r({
392
395
  success: !0,
393
396
  result: I,
394
- taskId: u.id,
397
+ taskId: c.id,
395
398
  timestamp: Date.now(),
396
399
  instanceId: this.instanceId
397
400
  });
398
401
  } catch (I) {
399
- if (u.status = "FAILED", u.rollback)
402
+ if (c.status = "FAILED", c.rollback)
400
403
  try {
401
- await u.rollback(), u.status = "ROLLEDBACK";
404
+ await c.rollback(), c.status = "ROLLEDBACK";
402
405
  } catch {
403
406
  }
404
- throw await this.onTaskStatusChange(u.id, u.status), I;
407
+ throw await this.onTaskStatusChange(c.id, c.status), I;
405
408
  } finally {
406
- this.releaseLock(u.id);
409
+ this.releaseLock(c.id);
407
410
  }
408
411
  } catch (D) {
409
412
  a(D);
@@ -440,29 +443,29 @@ class Zt {
440
443
  await Promise.all(e.map((t) => this.resolveTask(t.id)));
441
444
  }
442
445
  }
443
- const F = new Zt(), It = (n) => {
446
+ const F = new ne(), xt = (n) => {
444
447
  let e;
445
- const t = /* @__PURE__ */ new Set(), s = (l, E) => {
446
- const g = typeof l == "function" ? l(e) : l;
447
- if (!Object.is(g, e)) {
448
- const u = e;
449
- e = E ?? (typeof g != "object" || g === null) ? g : Object.assign({}, e, g), t.forEach((L) => L(e, u));
448
+ const t = /* @__PURE__ */ new Set(), s = (l, w) => {
449
+ const d = typeof l == "function" ? l(e) : l;
450
+ if (!Object.is(d, e)) {
451
+ const c = e;
452
+ e = w ?? (typeof d != "object" || d === null) ? d : Object.assign({}, e, d), t.forEach((L) => L(e, c));
450
453
  }
451
- }, r = () => e, c = { setState: s, getState: r, getInitialState: () => f, subscribe: (l) => (t.add(l), () => t.delete(l)) }, f = e = n(s, r, c);
452
- return c;
453
- }, te = ((n) => n ? It(n) : It), ee = (n) => n;
454
- function ne(n, e = ee) {
455
- const t = at.useSyncExternalStore(
454
+ }, r = () => e, u = { setState: s, getState: r, getInitialState: () => h, subscribe: (l) => (t.add(l), () => t.delete(l)) }, h = e = n(s, r, u);
455
+ return u;
456
+ }, re = ((n) => n ? xt(n) : xt), se = (n) => n;
457
+ function ae(n, e = se) {
458
+ const t = st.useSyncExternalStore(
456
459
  n.subscribe,
457
- at.useCallback(() => e(n.getState()), [n, e]),
458
- at.useCallback(() => e(n.getInitialState()), [n, e])
460
+ st.useCallback(() => e(n.getState()), [n, e]),
461
+ st.useCallback(() => e(n.getInitialState()), [n, e])
459
462
  );
460
- return at.useDebugValue(t), t;
463
+ return st.useDebugValue(t), t;
461
464
  }
462
- const xt = (n) => {
463
- const e = te(n), t = (s) => ne(e, s);
465
+ const Nt = (n) => {
466
+ const e = re(n), t = (s) => ae(e, s);
464
467
  return Object.assign(t, e), t;
465
- }, it = ((n) => n ? xt(n) : xt), q = it((n) => ({
468
+ }, it = ((n) => n ? Nt(n) : Nt), Q = it((n) => ({
466
469
  index: -1,
467
470
  histories: [],
468
471
  addHistory: (e) => n((t) => ({
@@ -477,35 +480,35 @@ const xt = (n) => {
477
480
  index: t.index - 1,
478
481
  histories: t.histories.filter((s, r) => r !== e)
479
482
  }))
480
- })), U = it((n) => ({
483
+ })), $ = it((n) => ({
481
484
  status: "IDLE",
482
485
  setStatus: (e) => n({ status: e })
483
486
  }));
484
- function re() {
485
- return Y(() => {
487
+ function oe() {
488
+ return V(() => {
486
489
  const n = async (e) => {
487
490
  const t = e.state?.id;
488
491
  (await F.addTask(
489
492
  async (s) => {
490
- const r = e.state?.index, a = e.state?.status, o = e.state?.params, c = e.state?.transitionName, f = e.state?.layoutId, l = U.getState().setStatus, { index: E, addHistory: g, popHistory: u } = q.getState(), L = r < E, D = a === "PUSHING" && r > E, I = a === "REPLACING" && r > E, P = window.location.pathname;
493
+ const r = e.state?.index, a = e.state?.status, o = e.state?.params, u = e.state?.transitionName, h = e.state?.layoutId, l = $.getState().setStatus, { index: w, addHistory: d, popHistory: c } = Q.getState(), L = r < w, D = a === "PUSHING" && r > w, I = a === "REPLACING" && r > w, v = window.location.pathname;
491
494
  if (!L && !D && !I) {
492
495
  s.abort();
493
496
  return;
494
497
  }
495
- return L ? l("POPPING") : D ? (l("PUSHING"), g({
498
+ return L ? l("POPPING") : D ? (l("PUSHING"), d({
496
499
  id: t,
497
- pathname: P,
500
+ pathname: v,
498
501
  params: o,
499
- transitionName: c,
500
- layoutId: f
501
- })) : I && (l("REPLACING"), g({
502
+ transitionName: u,
503
+ layoutId: h
504
+ })) : I && (l("REPLACING"), d({
502
505
  id: t,
503
- pathname: P,
506
+ pathname: v,
504
507
  params: o,
505
- transitionName: c,
506
- layoutId: f
508
+ transitionName: u,
509
+ layoutId: h
507
510
  })), async () => {
508
- L && u(r + 1), l("COMPLETED");
511
+ L && c(r + 1), l("COMPLETED");
509
512
  };
510
513
  },
511
514
  {
@@ -521,12 +524,12 @@ function re() {
521
524
  };
522
525
  }, []), null;
523
526
  }
524
- const Ot = Et({}), Gt = Et(() => {
527
+ const Gt = St({}), $t = St(() => {
525
528
  });
526
- function se(n, e) {
529
+ function ie(n, e) {
527
530
  return e.type === "SET" ? e.params : n;
528
531
  }
529
- const $t = Et({
532
+ const Ht = St({
530
533
  id: "",
531
534
  isActive: !1,
532
535
  isRoot: !0,
@@ -536,14 +539,15 @@ const $t = Et({
536
539
  params: {},
537
540
  transitionName: "none",
538
541
  prevTransitionName: "none",
539
- layoutId: null
542
+ layoutId: null,
543
+ routePath: ""
540
544
  });
541
- function Z() {
542
- return St($t);
545
+ function z() {
546
+ return Pt(Ht);
543
547
  }
544
- function ae({ children: n }) {
545
- const { isActive: e, params: t } = Z(), [s, r] = qt(se, t);
546
- return Y(() => {
548
+ function ce({ children: n }) {
549
+ const { isActive: e, params: t } = z(), [s, r] = Kt(ie, t);
550
+ return V(() => {
547
551
  const a = async (o) => {
548
552
  o.state?.step && await F.addTask(async () => {
549
553
  r({ type: "SET", params: o.state?.params || {} });
@@ -552,18 +556,18 @@ function ae({ children: n }) {
552
556
  return e && window.addEventListener("popstate", a), () => {
553
557
  window.removeEventListener("popstate", a);
554
558
  };
555
- }, [e, r]), /* @__PURE__ */ x(Gt.Provider, { value: r, children: /* @__PURE__ */ x(Ot.Provider, { value: s, children: n }) });
559
+ }, [e, r]), /* @__PURE__ */ x($t.Provider, { value: r, children: /* @__PURE__ */ x(Gt.Provider, { value: s, children: n }) });
556
560
  }
557
- function oe({ children: n }) {
558
- const e = q((s) => s.index), t = q((s) => s.histories);
561
+ function ue({ children: n }) {
562
+ const e = Q((s) => s.index), t = Q((s) => s.histories);
559
563
  return t.map(
560
- (s) => Mt.toArray(n).filter(
561
- (r) => K.pathToRegexp(r.props.path).regexp.test(
564
+ (s) => Ct.toArray(n).filter(
565
+ (r) => J.pathToRegexp(r.props.path).regexp.test(
562
566
  s.pathname
563
567
  )
564
568
  )
565
569
  ).map(([s], r) => /* @__PURE__ */ x(
566
- $t.Provider,
570
+ Ht.Provider,
567
571
  {
568
572
  value: {
569
573
  id: t[r].id,
@@ -575,14 +579,18 @@ function oe({ children: n }) {
575
579
  params: t[r].params,
576
580
  transitionName: t[e].transitionName,
577
581
  prevTransitionName: t[e - 1]?.transitionName,
578
- layoutId: t[r].layoutId
582
+ layoutId: t[r].layoutId,
583
+ routePath: Ot(
584
+ s.props.path,
585
+ t[r].pathname
586
+ )
579
587
  },
580
- children: /* @__PURE__ */ x(ae, { children: s })
588
+ children: /* @__PURE__ */ x(ce, { children: s })
581
589
  },
582
590
  t[r].id
583
591
  ));
584
592
  }
585
- function ie({
593
+ function le({
586
594
  name: n,
587
595
  initial: e,
588
596
  enter: t,
@@ -607,7 +615,7 @@ function ie({
607
615
  ...r
608
616
  };
609
617
  }
610
- const ce = ie({
618
+ const de = le({
611
619
  name: "overlay",
612
620
  initial: {
613
621
  opacity: 0,
@@ -660,7 +668,7 @@ const ce = ie({
660
668
  }
661
669
  )
662
670
  }
663
- }), Pt = /* @__PURE__ */ new Map([["overlay", ce]]), mt = it((n) => ({
671
+ }), vt = /* @__PURE__ */ new Map([["overlay", de]]), wt = it((n) => ({
664
672
  defaultTransitionName: "cupertino",
665
673
  setDefaultTransitionName: (e) => n({ defaultTransitionName: e })
666
674
  }));
@@ -672,7 +680,7 @@ function ct({
672
680
  enterBack: r,
673
681
  exit: a,
674
682
  exitBack: o,
675
- options: c
683
+ options: u
676
684
  }) {
677
685
  return {
678
686
  name: n,
@@ -689,10 +697,10 @@ function ct({
689
697
  "COMPLETED-false": a,
690
698
  "COMPLETED-true": s
691
699
  },
692
- ...c
700
+ ...u
693
701
  };
694
702
  }
695
- const ue = ct({
703
+ const pe = ct({
696
704
  name: "cupertino",
697
705
  initial: {
698
706
  x: "100%"
@@ -710,7 +718,7 @@ const ue = ct({
710
718
  x: 0
711
719
  },
712
720
  options: {
713
- duration: 0.3,
721
+ duration: 0.7,
714
722
  ease: [0.32, 0.72, 0, 1]
715
723
  }
716
724
  },
@@ -719,7 +727,7 @@ const ue = ct({
719
727
  x: "100%"
720
728
  },
721
729
  options: {
722
- duration: 0.3,
730
+ duration: 0.6,
723
731
  ease: [0.32, 0.72, 0, 1]
724
732
  }
725
733
  },
@@ -728,7 +736,7 @@ const ue = ct({
728
736
  x: -100
729
737
  },
730
738
  options: {
731
- duration: 0.3,
739
+ duration: 0.7,
732
740
  ease: [0.32, 0.72, 0, 1]
733
741
  }
734
742
  },
@@ -737,7 +745,7 @@ const ue = ct({
737
745
  x: 0
738
746
  },
739
747
  options: {
740
- duration: 0.3,
748
+ duration: 0.6,
741
749
  ease: [0.32, 0.72, 0, 1]
742
750
  }
743
751
  },
@@ -746,11 +754,11 @@ const ue = ct({
746
754
  swipeDirection: "x",
747
755
  onSwipeStart: async () => !0,
748
756
  onSwipe: (n, e, { animate: t, currentScreen: s, prevScreen: r, onProgress: a }) => {
749
- const { offset: o } = e, c = o.x, f = bt(c, [0, window.innerWidth], [0, 100]);
750
- return a?.(!0, f), t(
757
+ const { offset: o } = e, u = o.x, h = Rt(u, [0, window.innerWidth], [0, 100]);
758
+ return a?.(!0, h), t(
751
759
  s,
752
760
  {
753
- x: Math.max(0, c)
761
+ x: Math.max(0, u)
754
762
  },
755
763
  {
756
764
  duration: 0
@@ -758,15 +766,15 @@ const ue = ct({
758
766
  ), t(
759
767
  r,
760
768
  {
761
- x: -100 + f
769
+ x: -100 + h
762
770
  },
763
771
  {
764
772
  duration: 0
765
773
  }
766
- ), f;
774
+ ), h;
767
775
  },
768
776
  onSwipeEnd: async (n, e, { animate: t, currentScreen: s, prevScreen: r, onStart: a }) => {
769
- const { offset: o, velocity: c } = e, l = o.x > 50 || c.x > 20;
777
+ const { offset: o, velocity: u } = e, l = o.x > 50 || u.x > 20;
770
778
  return a?.(l), await Promise.all([
771
779
  t(
772
780
  s,
@@ -791,7 +799,7 @@ const ue = ct({
791
799
  ]), l;
792
800
  }
793
801
  }
794
- }), le = ct({
802
+ }), fe = ct({
795
803
  name: "layout",
796
804
  initial: {
797
805
  opacity: 0.97
@@ -841,12 +849,12 @@ const ue = ct({
841
849
  swipeDirection: "y",
842
850
  onSwipeStart: async () => !0,
843
851
  onSwipe: (n, e, { animate: t, currentScreen: s, onProgress: r }) => {
844
- const { offset: a } = e, o = a.y, c = Math.max(0, Math.min(56, o)), f = bt(c, [0, 56], [1, 0.96]), l = Math.max(0, o - 56), E = Math.min(1, l / 160), g = Math.sqrt(E) * 12, u = Math.max(0, c + g), L = Math.min(56, u);
852
+ const { offset: a } = e, o = a.y, u = Math.max(0, Math.min(56, o)), h = Rt(u, [0, 56], [1, 0.96]), l = Math.max(0, o - 56), w = Math.min(1, l / 160), d = Math.sqrt(w) * 12, c = Math.max(0, u + d), L = Math.min(56, c);
845
853
  return r?.(!0, 100), t(
846
854
  s,
847
855
  {
848
- y: u,
849
- opacity: f
856
+ y: c,
857
+ opacity: h
850
858
  },
851
859
  {
852
860
  duration: 0
@@ -854,7 +862,7 @@ const ue = ct({
854
862
  ), L;
855
863
  },
856
864
  onSwipeEnd: async (n, e, { animate: t, currentScreen: s, prevScreen: r, onStart: a }) => {
857
- const { offset: o, velocity: c } = e, l = o.y > 56 || c.y > 20;
865
+ const { offset: o, velocity: u } = e, l = o.y > 56 || u.y > 20;
858
866
  return a?.(l), await Promise.all([
859
867
  t(
860
868
  s,
@@ -879,7 +887,7 @@ const ue = ct({
879
887
  ]), l;
880
888
  }
881
889
  }
882
- }), de = ct({
890
+ }), he = ct({
883
891
  name: "material",
884
892
  initial: {
885
893
  y: "100%"
@@ -897,7 +905,7 @@ const ue = ct({
897
905
  y: 0
898
906
  },
899
907
  options: {
900
- duration: 0.24,
908
+ duration: 0.35,
901
909
  ease: [0, 0, 0.2, 1]
902
910
  }
903
911
  },
@@ -906,7 +914,7 @@ const ue = ct({
906
914
  y: "100%"
907
915
  },
908
916
  options: {
909
- duration: 0.22,
917
+ duration: 0.25,
910
918
  ease: [0.4, 0, 1, 1]
911
919
  }
912
920
  },
@@ -915,7 +923,7 @@ const ue = ct({
915
923
  y: -56
916
924
  },
917
925
  options: {
918
- duration: 0.22,
926
+ duration: 0.35,
919
927
  ease: [0.4, 0, 1, 1]
920
928
  }
921
929
  },
@@ -924,7 +932,7 @@ const ue = ct({
924
932
  y: 0
925
933
  },
926
934
  options: {
927
- duration: 0.24,
935
+ duration: 0.25,
928
936
  ease: [0, 0, 0.2, 1]
929
937
  }
930
938
  },
@@ -932,11 +940,11 @@ const ue = ct({
932
940
  swipeDirection: "y",
933
941
  onSwipeStart: async () => !0,
934
942
  onSwipe: (n, e, { animate: t, currentScreen: s, prevScreen: r, onProgress: a }) => {
935
- const { offset: o } = e, c = o.y, f = Math.max(0, Math.min(56, c)), l = Math.max(0, c - 56), E = Math.min(1, l / 160), g = Math.sqrt(E) * 12, u = Math.max(0, f + g), L = Math.min(56, u);
943
+ const { offset: o } = e, u = o.y, h = Math.max(0, Math.min(56, u)), l = Math.max(0, u - 56), w = Math.min(1, l / 160), d = Math.sqrt(w) * 12, c = Math.max(0, h + d), L = Math.min(56, c);
936
944
  return a?.(!0, L), t(
937
945
  s,
938
946
  {
939
- y: u
947
+ y: c
940
948
  },
941
949
  {
942
950
  duration: 0
@@ -950,7 +958,7 @@ const ue = ct({
950
958
  ), L;
951
959
  },
952
960
  onSwipeEnd: async (n, e, { animate: t, currentScreen: s, prevScreen: r, onStart: a }) => {
953
- const { offset: o, velocity: c } = e, l = o.y > 56 || c.y > 20;
961
+ const { offset: o, velocity: u } = e, l = o.y > 56 || u.y > 20;
954
962
  return a?.(l), await Promise.all([
955
963
  t(
956
964
  s,
@@ -975,7 +983,7 @@ const ue = ct({
975
983
  ]), l;
976
984
  }
977
985
  }
978
- }), pe = ct({
986
+ }), ge = ct({
979
987
  name: "none",
980
988
  initial: {},
981
989
  idle: {
@@ -1008,38 +1016,38 @@ const ue = ct({
1008
1016
  duration: 0
1009
1017
  }
1010
1018
  }
1011
- }), et = /* @__PURE__ */ new Map([
1012
- ["none", pe],
1013
- ["cupertino", ue],
1014
- ["material", de],
1015
- ["layout", le]
1016
- ]), fe = (() => {
1019
+ }), K = /* @__PURE__ */ new Map([
1020
+ ["none", ge],
1021
+ ["cupertino", pe],
1022
+ ["material", he],
1023
+ ["layout", fe]
1024
+ ]), ye = (() => {
1017
1025
  const n = /* @__PURE__ */ Object.create(null), e = Object.prototype.hasOwnProperty;
1018
- for (const t of et.values()) {
1026
+ for (const t of K.values()) {
1019
1027
  const s = t.variants["IDLE-true"].value;
1020
1028
  for (const r in s)
1021
1029
  e.call(s, r) && (n[r] = s[r]);
1022
1030
  }
1023
1031
  return n;
1024
1032
  })();
1025
- function Se({
1033
+ function Te({
1026
1034
  children: n,
1027
1035
  initPath: e = "/",
1028
1036
  defaultTransitionName: t = "cupertino",
1029
1037
  transitions: s = [],
1030
1038
  decorators: r = []
1031
1039
  }) {
1032
- const a = Dt() ? e || "/" : window.location.pathname, o = Dt() ? a.split("?")[1] || "" : window.location.search;
1033
- return mt.setState({
1040
+ const a = It() ? e || "/" : window.location.pathname, o = It() ? a.split("?")[1] || "" : window.location.search;
1041
+ return wt.setState({
1034
1042
  defaultTransitionName: t
1035
- }), q.setState({
1043
+ }), Q.setState({
1036
1044
  index: 0,
1037
1045
  histories: [
1038
1046
  {
1039
1047
  id: "root",
1040
1048
  pathname: a,
1041
- params: Jt(
1042
- Mt.toArray(n).map((c) => c.props.path).flat(),
1049
+ params: ee(
1050
+ Ct.toArray(n).map((u) => u.props.path).flat(),
1043
1051
  a,
1044
1052
  o
1045
1053
  ),
@@ -1047,10 +1055,8 @@ function Se({
1047
1055
  layoutId: null
1048
1056
  }
1049
1057
  ]
1050
- }), Y(() => {
1051
- if (window.history.state?.index) return;
1052
- const { pathname: c, search: f } = window.location;
1053
- window.history.replaceState(
1058
+ }), V(() => {
1059
+ window.history.state?.index || window.history.replaceState(
1054
1060
  {
1055
1061
  id: "root",
1056
1062
  index: 0,
@@ -1060,66 +1066,58 @@ function Se({
1060
1066
  layoutId: null
1061
1067
  },
1062
1068
  "",
1063
- `${c}${f}`
1069
+ window.location.href
1064
1070
  );
1065
- }, [t]), Y(() => {
1066
- s.forEach((c) => et.set(c.name, c));
1067
- }, [s]), Y(() => {
1068
- r.forEach((c) => Pt.set(c.name, c));
1069
- }, [r]), /* @__PURE__ */ yt(
1070
- "div",
1071
- {
1072
- style: {
1073
- position: "fixed",
1074
- top: 0,
1075
- left: 0,
1076
- width: "100%",
1077
- height: "100%"
1078
- },
1079
- children: [
1080
- /* @__PURE__ */ x(re, {}),
1081
- /* @__PURE__ */ x(oe, { children: n })
1082
- ]
1083
- }
1084
- );
1071
+ }, [t]), V(() => {
1072
+ s.forEach((u) => K.set(u.name, u));
1073
+ }, [s]), V(() => {
1074
+ r.forEach((u) => vt.set(u.name, u));
1075
+ }, [r]), /* @__PURE__ */ mt(Xt, { children: [
1076
+ /* @__PURE__ */ x(oe, {}),
1077
+ /* @__PURE__ */ x(ue, { children: n })
1078
+ ] });
1085
1079
  }
1086
- function Pe({ element: n }) {
1080
+ function De({ element: n }) {
1087
1081
  return n;
1088
1082
  }
1089
- function ve() {
1083
+ function ot(n, e) {
1084
+ const t = e ?? {}, s = J.compile(n), r = Object.fromEntries(
1085
+ Object.entries(t).map(([d, c]) => [d, String(c)])
1086
+ ), a = s(r), u = (typeof n == "string" ? J.parse(n) : n).tokens.filter((d) => d.type === "param").map((d) => d.name), h = Object.fromEntries(
1087
+ Object.entries(t).filter(([d]) => !u.includes(d))
1088
+ ), l = new URLSearchParams(h).toString();
1089
+ return { pathname: `${a}${l ? `?${l}` : ""}`, toPathname: a };
1090
+ }
1091
+ function Le() {
1090
1092
  return {
1091
1093
  push: async (s, r, a = {}) => {
1092
- const { status: o, setStatus: c } = U.getState();
1094
+ const { status: o, setStatus: u } = $.getState();
1093
1095
  if (o !== "COMPLETED" && o !== "IDLE")
1094
1096
  return;
1095
- const { index: f, addHistory: l } = q.getState(), E = mt.getState().defaultTransitionName, { transitionName: g = E, layoutId: u = null } = a, L = F.generateTaskId();
1097
+ const { index: h, addHistory: l } = Q.getState(), w = wt.getState().defaultTransitionName, { transitionName: d = w, layoutId: c = null } = a, L = F.generateTaskId();
1096
1098
  (await F.addTask(
1097
1099
  async () => {
1098
- c("PUSHING");
1099
- const D = K.compile(s), I = Object.fromEntries(
1100
- Object.entries(r).map(([k, b]) => [k, String(b)])
1101
- ), P = D(I), M = K.parse(s).tokens.filter((k) => k.type === "param").map((k) => k.name), W = Object.fromEntries(
1102
- Object.entries(r).filter(([k]) => !M.includes(k))
1103
- ), _ = new URLSearchParams(W).toString(), Q = `${P}${_ ? `?${_}` : ""}`;
1100
+ u("PUSHING");
1101
+ const { pathname: D, toPathname: I } = ot(s, r);
1104
1102
  return window.history.pushState(
1105
1103
  {
1106
1104
  id: L,
1107
- index: f + 1,
1105
+ index: h + 1,
1108
1106
  status: "PUSHING",
1109
1107
  params: r,
1110
- transitionName: g,
1111
- layoutId: u
1108
+ transitionName: d,
1109
+ layoutId: c
1112
1110
  },
1113
1111
  "",
1114
- Q
1112
+ D
1115
1113
  ), l({
1116
1114
  id: L,
1117
- pathname: P,
1115
+ pathname: I,
1118
1116
  params: r,
1119
- transitionName: g,
1120
- layoutId: u
1117
+ transitionName: d,
1118
+ layoutId: c
1121
1119
  }), () => {
1122
- c("COMPLETED");
1120
+ u("COMPLETED");
1123
1121
  };
1124
1122
  },
1125
1123
  {
@@ -1131,37 +1129,33 @@ function ve() {
1131
1129
  )).result?.();
1132
1130
  },
1133
1131
  replace: async (s, r, a = {}) => {
1134
- const { status: o, setStatus: c } = U.getState();
1132
+ const { status: o, setStatus: u } = $.getState();
1135
1133
  if (o !== "COMPLETED" && o !== "IDLE")
1136
1134
  return;
1137
- const { index: f, addHistory: l } = q.getState(), E = q.getState().replaceHistory, g = mt.getState().defaultTransitionName, { transitionName: u = g, layoutId: L = null } = a, D = F.generateTaskId();
1135
+ const { index: h, addHistory: l } = Q.getState(), w = Q.getState().replaceHistory, d = wt.getState().defaultTransitionName, { transitionName: c = d, layoutId: L = null } = a, D = F.generateTaskId();
1138
1136
  (await F.addTask(
1139
1137
  async () => {
1140
- c("REPLACING");
1141
- const I = K.compile(s), P = Object.fromEntries(
1142
- Object.entries(r).map(([b, i]) => [b, String(i)])
1143
- ), M = I(P), W = K.parse(s).tokens.filter((b) => b.type === "param").map((b) => b.name), _ = Object.fromEntries(
1144
- Object.entries(r).filter(([b]) => !W.includes(b))
1145
- ), Q = new URLSearchParams(_).toString(), k = `${M}${Q ? `?${Q}` : ""}`;
1138
+ u("REPLACING");
1139
+ const { pathname: I, toPathname: v } = ot(s, r);
1146
1140
  return window.history.replaceState(
1147
1141
  {
1148
1142
  id: D,
1149
- index: f,
1143
+ index: h,
1150
1144
  status: "REPLACING",
1151
1145
  params: r,
1152
- transitionName: u,
1146
+ transitionName: c,
1153
1147
  layoutId: L
1154
1148
  },
1155
1149
  "",
1156
- k
1150
+ I
1157
1151
  ), l({
1158
1152
  id: D,
1159
- pathname: M,
1153
+ pathname: v,
1160
1154
  params: r,
1161
- transitionName: u,
1155
+ transitionName: c,
1162
1156
  layoutId: L
1163
1157
  }), async () => {
1164
- E(f), c("COMPLETED");
1158
+ w(h), u("COMPLETED");
1165
1159
  };
1166
1160
  },
1167
1161
  {
@@ -1173,18 +1167,18 @@ function ve() {
1173
1167
  )).result?.();
1174
1168
  },
1175
1169
  pop: () => {
1176
- const s = U.getState().status;
1170
+ const s = $.getState().status;
1177
1171
  s !== "COMPLETED" && s !== "IDLE" || window.history.back();
1178
1172
  }
1179
1173
  };
1180
1174
  }
1181
- function Te() {
1182
- const n = St(Gt);
1175
+ function Ie() {
1176
+ const { routePath: n } = z(), e = Pt($t);
1183
1177
  return {
1184
- pushStep: async (r) => {
1185
- const a = U.getState().status;
1186
- a !== "COMPLETED" && a !== "IDLE" || (await F.addTask(async () => {
1187
- const o = new URLSearchParams(r).toString(), c = `${window.location.pathname}${o ? `?${o}` : ""}`;
1178
+ pushStep: async (a) => {
1179
+ const o = $.getState().status;
1180
+ o !== "COMPLETED" && o !== "IDLE" || (await F.addTask(async () => {
1181
+ const { pathname: u } = ot(n, a);
1188
1182
  return window.history.state?.step || window.history.replaceState(
1189
1183
  {
1190
1184
  ...window.history.state,
@@ -1196,38 +1190,38 @@ function Te() {
1196
1190
  {
1197
1191
  ...window.history.state,
1198
1192
  step: !0,
1199
- params: r
1193
+ params: a
1200
1194
  },
1201
1195
  "",
1202
- c
1203
- ), async () => n({ type: "SET", params: r });
1196
+ u
1197
+ ), async () => e({ type: "SET", params: a });
1204
1198
  })).result?.();
1205
1199
  },
1206
- replaceStep: async (r) => {
1207
- const a = U.getState().status;
1208
- a !== "COMPLETED" && a !== "IDLE" || (await F.addTask(async () => {
1209
- const o = new URLSearchParams(r).toString(), c = `${window.location.pathname}${o ? `?${o}` : ""}`;
1200
+ replaceStep: async (a) => {
1201
+ const o = $.getState().status;
1202
+ o !== "COMPLETED" && o !== "IDLE" || (await F.addTask(async () => {
1203
+ const { pathname: u } = ot(n, a);
1210
1204
  return window.history.replaceState(
1211
1205
  {
1212
1206
  ...window.history.state,
1213
1207
  step: !0,
1214
- params: r
1208
+ params: a
1215
1209
  },
1216
1210
  "",
1217
- c
1218
- ), async () => n({ type: "SET", params: r });
1211
+ u
1212
+ ), async () => e({ type: "SET", params: a });
1219
1213
  })).result?.();
1220
1214
  },
1221
1215
  popStep: () => {
1222
- const r = U.getState().status;
1223
- r !== "COMPLETED" && r !== "IDLE" || window.history.back();
1216
+ const a = $.getState().status;
1217
+ a !== "COMPLETED" && a !== "IDLE" || window.history.back();
1224
1218
  }
1225
1219
  };
1226
1220
  }
1227
- function Le() {
1228
- return St(Ot);
1221
+ function xe() {
1222
+ return Pt(Gt);
1229
1223
  }
1230
- function De({
1224
+ function Ne({
1231
1225
  name: n,
1232
1226
  initial: e,
1233
1227
  idle: t,
@@ -1235,11 +1229,11 @@ function De({
1235
1229
  pushOnExit: r,
1236
1230
  replaceOnEnter: a,
1237
1231
  replaceOnExit: o,
1238
- popOnEnter: c,
1239
- popOnExit: f,
1232
+ popOnEnter: u,
1233
+ popOnExit: h,
1240
1234
  completedOnExit: l,
1241
- completedOnEnter: E,
1242
- options: g
1235
+ completedOnEnter: w,
1236
+ options: d
1243
1237
  }) {
1244
1238
  return {
1245
1239
  name: n,
@@ -1251,15 +1245,15 @@ function De({
1251
1245
  "PUSHING-true": s,
1252
1246
  "REPLACING-false": o,
1253
1247
  "REPLACING-true": a,
1254
- "POPPING-false": f,
1255
- "POPPING-true": c,
1248
+ "POPPING-false": h,
1249
+ "POPPING-true": u,
1256
1250
  "COMPLETED-false": l,
1257
- "COMPLETED-true": E
1251
+ "COMPLETED-true": w
1258
1252
  },
1259
- ...g
1253
+ ...d
1260
1254
  };
1261
1255
  }
1262
- function Ie({
1256
+ function ke({
1263
1257
  name: n,
1264
1258
  initial: e,
1265
1259
  idle: t,
@@ -1267,11 +1261,11 @@ function Ie({
1267
1261
  pushOnExit: r,
1268
1262
  replaceOnEnter: a,
1269
1263
  replaceOnExit: o,
1270
- popOnEnter: c,
1271
- popOnExit: f,
1264
+ popOnEnter: u,
1265
+ popOnExit: h,
1272
1266
  completedOnEnter: l,
1273
- completedOnExit: E,
1274
- options: g
1267
+ completedOnExit: w,
1268
+ options: d
1275
1269
  }) {
1276
1270
  return {
1277
1271
  name: n,
@@ -1283,34 +1277,46 @@ function Ie({
1283
1277
  "PUSHING-true": s,
1284
1278
  "REPLACING-false": o,
1285
1279
  "REPLACING-true": a,
1286
- "POPPING-false": f,
1287
- "POPPING-true": c,
1288
- "COMPLETED-false": E,
1280
+ "POPPING-false": h,
1281
+ "POPPING-true": u,
1282
+ "COMPLETED-false": w,
1289
1283
  "COMPLETED-true": l
1290
1284
  },
1291
- ...g
1285
+ ...d
1292
1286
  };
1293
1287
  }
1294
- function Nt(n, e) {
1288
+ function Ut({ freeze: n, children: e }) {
1289
+ const t = O(e);
1290
+ return n || (t.current = e), /* @__PURE__ */ x(
1291
+ "div",
1292
+ {
1293
+ style: {
1294
+ display: n ? "none" : void 0
1295
+ },
1296
+ children: t.current
1297
+ }
1298
+ );
1299
+ }
1300
+ function kt(n, e) {
1295
1301
  const {
1296
1302
  direction: t = "x",
1297
1303
  markerSelector: s = "[data-swipe-at-edge]",
1298
1304
  depthLimit: r = 24,
1299
1305
  verifyByScroll: a = !1
1300
- } = e ?? {}, o = he(n);
1306
+ } = e ?? {}, o = me(n);
1301
1307
  if (!o) return { element: null, hasMarker: !1 };
1302
- const c = o.closest?.(s);
1303
- if (c instanceof HTMLElement && wt(c, t) && (!a || kt(c, t)))
1304
- return { element: c, hasMarker: !0 };
1305
- let f = o, l = 0;
1306
- for (; f && f !== document.body && l < r; ) {
1307
- if (wt(f, t) && (!a || kt(f, t)))
1308
- return { element: f, hasMarker: !1 };
1309
- f = f.parentElement, l++;
1308
+ const u = o.closest?.(s);
1309
+ if (u instanceof HTMLElement && Et(u, t) && (!a || Mt(u, t)))
1310
+ return { element: u, hasMarker: !0 };
1311
+ let h = o, l = 0;
1312
+ for (; h && h !== document.body && l < r; ) {
1313
+ if (Et(h, t) && (!a || Mt(h, t)))
1314
+ return { element: h, hasMarker: !1 };
1315
+ h = h.parentElement, l++;
1310
1316
  }
1311
1317
  return { element: null, hasMarker: !1 };
1312
1318
  }
1313
- function he(n) {
1319
+ function me(n) {
1314
1320
  if (!n) return null;
1315
1321
  const e = n, t = typeof e.composedPath == "function" ? e.composedPath() : void 0;
1316
1322
  if (t && t.length) {
@@ -1319,11 +1325,11 @@ function he(n) {
1319
1325
  }
1320
1326
  return n;
1321
1327
  }
1322
- function wt(n, e) {
1328
+ function Et(n, e) {
1323
1329
  return e === "y" ? n.scrollHeight - n.clientHeight > 1 : n.scrollWidth - n.clientWidth > 1;
1324
1330
  }
1325
- function kt(n, e) {
1326
- if (!wt(n, e)) return !1;
1331
+ function Mt(n, e) {
1332
+ if (!Et(n, e)) return !1;
1327
1333
  if (e === "y") {
1328
1334
  const t = n.scrollTop;
1329
1335
  if (n.scrollTop = t + 1, n.scrollTop !== t)
@@ -1340,19 +1346,19 @@ function kt(n, e) {
1340
1346
  return n.scrollLeft = t, r;
1341
1347
  }
1342
1348
  }
1343
- function ge({ children: n, ref: e, ...t }) {
1344
- const { isActive: s, transitionName: r } = Z(), [a, o] = Rt();
1345
- Bt(e, () => a.current);
1346
- const c = U((u) => u.status), f = et.get(r), { decoratorName: l } = f, { initial: E, variants: g } = Pt.get(l);
1347
- return Y(() => {
1349
+ function we({ children: n, ref: e, ...t }) {
1350
+ const { isActive: s, transitionName: r } = z(), [a, o] = At();
1351
+ zt(e, () => a.current);
1352
+ const u = $((c) => c.status), h = K.get(r) ?? K.get("none"), { decoratorName: l } = h, { initial: w, variants: d } = vt.get(l);
1353
+ return V(() => {
1348
1354
  if (!a.current) return;
1349
- const { value: u, options: L } = g[`${c}-${s}`];
1350
- o(a.current, u, L);
1351
- }, [c, s, o, g, a]), /* @__PURE__ */ x(
1352
- At.div,
1355
+ const { value: c, options: L } = d[`${u}-${s}`];
1356
+ o(a.current, c, L);
1357
+ }, [u, s, o, d, a]), /* @__PURE__ */ x(
1358
+ bt.div,
1353
1359
  {
1354
1360
  ref: a,
1355
- initial: E,
1361
+ initial: w,
1356
1362
  style: {
1357
1363
  position: "absolute",
1358
1364
  top: 0,
@@ -1366,28 +1372,28 @@ function ge({ children: n, ref: e, ...t }) {
1366
1372
  }
1367
1373
  );
1368
1374
  }
1369
- const J = it((n) => ({
1375
+ const X = it((n) => ({
1370
1376
  dragStatus: "IDLE",
1371
1377
  replaceTransitionStatus: "IDLE",
1372
1378
  setDragStatus: (e) => n({ dragStatus: e }),
1373
1379
  setReplaceTransitionStatus: (e) => n({ replaceTransitionStatus: e })
1374
1380
  }));
1375
- let gt = 0;
1376
- function ye() {
1377
- const [n, e] = ot(0), [t, s] = ot(0);
1378
- return Y(() => {
1381
+ let yt = 0;
1382
+ function Ee() {
1383
+ const [n, e] = at(0), [t, s] = at(0);
1384
+ return V(() => {
1379
1385
  const r = () => {
1380
1386
  let a = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
1381
1387
  a = a < 0 ? 0 : a;
1382
- let o = a - gt;
1383
- o = o < 0 ? 0 : o, gt || (gt = a), s(o), e(a);
1388
+ let o = a - yt;
1389
+ o = o < 0 ? 0 : o, yt || (yt = a), s(o), e(a);
1384
1390
  };
1385
1391
  return window.visualViewport?.addEventListener("resize", r), window.visualViewport?.addEventListener("scroll", r), () => {
1386
1392
  window.visualViewport?.removeEventListener("resize", r), window.visualViewport?.removeEventListener("scroll", r);
1387
1393
  };
1388
1394
  }, []), { viewportScrollHeight: n, changedViewportScrollHeight: t };
1389
1395
  }
1390
- function Ht({
1396
+ function _t({
1391
1397
  children: n,
1392
1398
  statusBarHeight: e,
1393
1399
  statusBarColor: t,
@@ -1395,132 +1401,131 @@ function Ht({
1395
1401
  systemNavigationBarColor: r,
1396
1402
  sharedAppBar: a,
1397
1403
  sharedNavigationBar: o,
1398
- appBar: c,
1399
- navigationBar: f,
1404
+ appBar: u,
1405
+ navigationBar: h,
1400
1406
  hideStatusBar: l,
1401
- hideSystemNavigationBar: E,
1402
- backgroundColor: g = "white",
1403
- contentScrollable: u = !0,
1407
+ hideSystemNavigationBar: w,
1408
+ backgroundColor: d = "white",
1409
+ contentScrollable: c = !0,
1404
1410
  ...L
1405
1411
  }) {
1406
- const [D, I] = Rt(), { id: P, isActive: M, isRoot: W, transitionName: _, prevTransitionName: Q } = Z(), k = Xt(), b = U((v) => v.status), i = J((v) => v.dragStatus), d = J.getState().setDragStatus, y = J.getState().setReplaceTransitionStatus, m = et.get(_), { variants: h, initial: p, swipeDirection: S, decoratorName: T } = m, C = Pt.get(T), { viewportScrollHeight: w } = ye(), R = w > 0, [N, O] = ot(0), [j, ut] = ot(0), vt = $(null), nt = $(null), rt = $(null), st = $(null), B = $(!1), tt = $(!1), X = $({
1412
+ const [D, I] = At(), { id: v, isActive: b, isRoot: ut, transitionName: W, prevTransitionName: tt } = z(), _ = Wt(), q = $((P) => P.status), i = X((P) => P.dragStatus), p = X.getState().setDragStatus, y = X.getState().setReplaceTransitionStatus, m = K.get(W) ?? K.get("none"), { variants: g, initial: f, swipeDirection: S, decoratorName: T } = m, k = vt.get(T), { viewportScrollHeight: E } = Ee(), M = E > 0, [N, R] = at(0), [H, lt] = at(0), Tt = O(null), et = O(null), nt = O(null), rt = O(null), j = O(!1), Z = O(!1), Y = O({
1407
1413
  element: null,
1408
1414
  hasMarker: !1
1409
- }), z = $({ element: null, hasMarker: !1 }), lt = $(0), dt = $(0), pt = $(null), ft = $(null), Ut = async (v, G) => {
1410
- if (!S || w > 10)
1415
+ }), B = O({ element: null, hasMarker: !1 }), dt = O(0), pt = O(0), ft = O(null), ht = O(null), Ft = async (P, A) => {
1416
+ if (!S || E > 10)
1411
1417
  return;
1412
- const A = vt.current?.previousSibling;
1413
- nt.current = A?.querySelector("[data-screen]"), st.current = A?.querySelector("[data-decorator]");
1414
- const V = await m?.onSwipeStart(v, G, {
1418
+ const C = Tt.current?.parentElement?.previousElementSibling;
1419
+ et.current = C?.querySelector("[data-screen]"), rt.current = C?.querySelector("[data-decorator]");
1420
+ const U = await m?.onSwipeStart(P, A, {
1415
1421
  animate: I,
1416
1422
  currentScreen: D.current,
1417
- prevScreen: nt.current,
1418
- dragControls: k,
1419
- onStart: (ht) => C?.onSwipeStart?.(ht, {
1423
+ prevScreen: et.current,
1424
+ dragControls: _,
1425
+ onStart: (gt) => k?.onSwipeStart?.(gt, {
1420
1426
  animate: I,
1421
- currentDecorator: rt.current,
1422
- prevDecorator: st.current
1427
+ currentDecorator: nt.current,
1428
+ prevDecorator: rt.current
1423
1429
  })
1424
1430
  });
1425
- d(V ? "PENDING" : "IDLE");
1426
- }, _t = (v, G) => {
1427
- !S || i !== "PENDING" || w > 10 || m?.onSwipe(v, G, {
1431
+ p(U ? "PENDING" : "IDLE");
1432
+ }, Vt = (P, A) => {
1433
+ !S || i !== "PENDING" || E > 10 || m.onSwipe(P, A, {
1428
1434
  animate: I,
1429
1435
  currentScreen: D.current,
1430
- prevScreen: nt.current,
1431
- dragControls: k,
1432
- onProgress: (A, V) => C?.onSwipe?.(A, V, {
1436
+ prevScreen: et.current,
1437
+ dragControls: _,
1438
+ onProgress: (C, U) => k?.onSwipe?.(C, U, {
1433
1439
  animate: I,
1434
- currentDecorator: rt.current,
1435
- prevDecorator: st.current
1440
+ currentDecorator: nt.current,
1441
+ prevDecorator: rt.current
1436
1442
  })
1437
1443
  });
1438
- }, jt = async (v, G) => {
1439
- if (!S || i !== "PENDING" || w > 10)
1444
+ }, Qt = async (P, A) => {
1445
+ if (!S || i !== "PENDING" || E > 10)
1440
1446
  return;
1441
- await m?.onSwipeEnd(v, G, {
1447
+ await m?.onSwipeEnd(P, A, {
1442
1448
  animate: I,
1443
1449
  currentScreen: D.current,
1444
- prevScreen: nt.current,
1445
- onStart: (V) => C?.onSwipeEnd?.(V, {
1450
+ prevScreen: et.current,
1451
+ onStart: (U) => k?.onSwipeEnd?.(U, {
1446
1452
  animate: I,
1447
- currentDecorator: rt.current,
1448
- prevDecorator: st.current
1453
+ currentDecorator: nt.current,
1454
+ prevDecorator: rt.current
1449
1455
  })
1450
- }) ? window.history.back() : d("IDLE");
1451
- }, Vt = (v) => {
1452
- if (!(!W && M && b === "COMPLETED" && i === "IDLE" && !!S && w < 10))
1456
+ }) ? window.history.back() : p("IDLE");
1457
+ }, jt = (P) => {
1458
+ if (!(!ut && b && q === "COMPLETED" && i === "IDLE" && !!S && E < 10))
1453
1459
  return;
1454
- X.current = Nt(v.target, {
1460
+ Y.current = kt(P.target, {
1455
1461
  direction: "x",
1456
1462
  verifyByScroll: !0
1457
- }), z.current = Nt(v.target, {
1463
+ }), B.current = kt(P.target, {
1458
1464
  direction: "y",
1459
1465
  verifyByScroll: !0
1460
- }), lt.current = v.clientX, dt.current = v.clientY, (!X.current.element && !z.current.element || X.current.element || z.current.element) && (B.current = !0);
1461
- }, Qt = (v) => {
1462
- if (w > 10)
1466
+ }), dt.current = P.clientX, pt.current = P.clientY, (!Y.current.element && !B.current.element || Y.current.element || B.current.element) && (j.current = !0);
1467
+ }, Yt = (P) => {
1468
+ if (E > 10)
1463
1469
  return;
1464
- const G = !X.current.element && !z.current.element;
1465
- if (B.current && G) {
1466
- B.current = !1, tt.current = !0;
1467
- const A = v.clientY - dt.current, V = v.clientX - lt.current;
1468
- (S === "y" && A > 0 || S === "x" && V > 0) && k.start(v);
1469
- } else if (B.current && !G) {
1470
- const A = v.clientX - lt.current, V = v.clientY - dt.current, ht = z.current.element && z.current.element.scrollTop <= 0, Yt = X.current.element && X.current.element.scrollLeft <= 0 && X.current.hasMarker;
1471
- (S === "y" && (ht || X.current.element) && V > 0 && Math.abs(A) < 2 || S === "x" && (Yt || z.current.element) && A > 0 && Math.abs(V) < 2) && (B.current = !1, tt.current = !0, k.start(v));
1470
+ const A = !Y.current.element && !B.current.element;
1471
+ if (j.current && A) {
1472
+ j.current = !1, Z.current = !0;
1473
+ const C = P.clientY - pt.current, U = P.clientX - dt.current;
1474
+ (S === "y" && C > 0 || S === "x" && U > 0) && _.start(P);
1475
+ } else if (j.current && !A) {
1476
+ const C = P.clientX - dt.current, U = P.clientY - pt.current, gt = B.current.element && B.current.element.scrollTop <= 0, Bt = Y.current.element && Y.current.element.scrollLeft <= 0 && Y.current.hasMarker;
1477
+ (S === "y" && (gt || Y.current.element) && U > 0 && Math.abs(C) < 2 || S === "x" && (Bt || B.current.element) && C > 0 && Math.abs(U) < 2) && (j.current = !1, Z.current = !0, _.start(P));
1472
1478
  }
1473
- }, Ft = () => {
1474
- B.current = !1, tt.current = !1;
1479
+ }, qt = () => {
1480
+ j.current = !1, Z.current = !1;
1475
1481
  };
1476
- return Y(() => {
1477
- const v = D.current;
1478
- if (!v) return;
1479
- const G = (A) => {
1480
- tt.current && A.preventDefault(), A.target?.dataset.swipeAtEdgeBar === "true" && A.preventDefault();
1482
+ return V(() => {
1483
+ const P = D.current;
1484
+ if (!P) return;
1485
+ const A = (C) => {
1486
+ Z.current && C.preventDefault(), C.target?.dataset.swipeAtEdgeBar === "true" && C.preventDefault();
1481
1487
  };
1482
- return v.addEventListener("touchmove", G, {
1488
+ return P.addEventListener("touchmove", A, {
1483
1489
  passive: !1
1484
1490
  }), () => {
1485
- v.removeEventListener("touchmove", G);
1491
+ P.removeEventListener("touchmove", A);
1486
1492
  };
1487
- }, [D]), Y(() => {
1493
+ }, [D]), V(() => {
1488
1494
  D.current && (async () => {
1489
- const { value: v, options: G } = h[`${b}-${M}`];
1490
- !M && b === "REPLACING" && Q !== _ && (y("PENDING"), await I(D.current, fe, {
1495
+ const { value: P, options: A } = g[`${q}-${b}`];
1496
+ !b && q === "REPLACING" && tt !== W && (y("PENDING"), await I(D.current, ye, {
1491
1497
  duration: 0.1
1492
- })), M && b === "COMPLETED" && (d("IDLE"), y("IDLE")), await I(D.current, v, G), await F.resolveTask(P);
1498
+ })), b && q === "COMPLETED" && (p("IDLE"), y("IDLE")), await I(D.current, P, A), await F.resolveTask(v);
1493
1499
  })();
1494
1500
  }, [
1501
+ q,
1495
1502
  b,
1496
- M,
1497
- P,
1498
- Q,
1499
- _,
1503
+ v,
1504
+ tt,
1505
+ W,
1500
1506
  I,
1501
1507
  D,
1502
- h,
1503
- d,
1508
+ g,
1509
+ p,
1504
1510
  y
1505
- ]), Tt(() => {
1506
- pt.current && O(pt.current.offsetHeight);
1507
- }, [a]), Tt(() => {
1508
- ft.current && ut(ft.current.offsetHeight);
1509
- }, [o]), /* @__PURE__ */ yt(
1511
+ ]), Dt(() => {
1512
+ ft.current && R(ft.current.offsetHeight);
1513
+ }, [a]), Dt(() => {
1514
+ ht.current && lt(ht.current.offsetHeight);
1515
+ }, [o]), /* @__PURE__ */ mt(
1510
1516
  "div",
1511
1517
  {
1512
- ref: vt,
1518
+ ref: Tt,
1513
1519
  style: {
1514
- position: "absolute",
1520
+ position: "fixed",
1515
1521
  top: 0,
1516
1522
  left: 0,
1517
1523
  width: "100%",
1518
1524
  height: "100%",
1519
1525
  display: "flex",
1526
+ contain: "strict",
1520
1527
  flexDirection: "column",
1521
1528
  boxSizing: "border-box",
1522
- isolation: "isolate",
1523
- contain: "strict",
1524
1529
  overscrollBehavior: "contain"
1525
1530
  },
1526
1531
  children: [
@@ -1529,7 +1534,7 @@ function Ht({
1529
1534
  {
1530
1535
  "data-swipe-at-edge-bar": !0,
1531
1536
  style: {
1532
- position: "absolute",
1537
+ position: "fixed",
1533
1538
  top: 0,
1534
1539
  left: 0,
1535
1540
  width: 8,
@@ -1541,9 +1546,9 @@ function Ht({
1541
1546
  a && /* @__PURE__ */ x(
1542
1547
  "div",
1543
1548
  {
1544
- ref: pt,
1549
+ ref: ft,
1545
1550
  style: {
1546
- position: "absolute",
1551
+ position: "fixed",
1547
1552
  top: l ? 0 : e,
1548
1553
  left: 0,
1549
1554
  width: "100%"
@@ -1551,32 +1556,28 @@ function Ht({
1551
1556
  children: a
1552
1557
  }
1553
1558
  ),
1554
- /* @__PURE__ */ yt(
1555
- At.div,
1559
+ /* @__PURE__ */ mt(
1560
+ bt.div,
1556
1561
  {
1557
1562
  ref: D,
1558
1563
  ...L,
1559
- initial: p,
1564
+ initial: f,
1560
1565
  drag: S,
1561
1566
  dragListener: !1,
1562
- dragControls: k,
1563
- onDragStart: Ut,
1564
- onDrag: _t,
1565
- onDragEnd: jt,
1566
- onPointerDown: Vt,
1567
- onPointerMove: Qt,
1568
- onPointerUp: Ft,
1569
- transition: {
1570
- inherit: !0,
1571
- ...L.transition
1572
- },
1567
+ dragControls: _,
1568
+ onDragStart: Ft,
1569
+ onDrag: Vt,
1570
+ onDragEnd: Qt,
1571
+ onPointerDown: jt,
1572
+ onPointerMove: Yt,
1573
+ onPointerUp: qt,
1573
1574
  "data-screen": !0,
1574
1575
  style: {
1575
1576
  display: "flex",
1576
1577
  flexDirection: "column",
1577
1578
  height: "100%",
1578
- backgroundColor: g,
1579
- overflowY: u ? void 0 : "auto",
1579
+ backgroundColor: d,
1580
+ overflowY: c ? void 0 : "auto",
1580
1581
  ...L.style
1581
1582
  },
1582
1583
  children: [
@@ -1601,7 +1602,7 @@ function Ht({
1601
1602
  }
1602
1603
  }
1603
1604
  ),
1604
- c,
1605
+ u,
1605
1606
  /* @__PURE__ */ x(
1606
1607
  "div",
1607
1608
  {
@@ -1609,27 +1610,27 @@ function Ht({
1609
1610
  display: "flex",
1610
1611
  flexDirection: "column",
1611
1612
  flexGrow: 1,
1612
- overflowY: u ? "auto" : void 0
1613
+ overflowY: c ? "auto" : void 0
1613
1614
  },
1614
1615
  children: n
1615
1616
  }
1616
1617
  ),
1617
- f,
1618
+ h,
1618
1619
  o && /* @__PURE__ */ x(
1619
1620
  "div",
1620
1621
  {
1621
1622
  style: {
1622
- display: R ? "none" : void 0,
1623
+ display: M ? "none" : void 0,
1623
1624
  width: "100%",
1624
- minHeight: j
1625
+ minHeight: H
1625
1626
  }
1626
1627
  }
1627
1628
  ),
1628
- !E && s && /* @__PURE__ */ x(
1629
+ !w && s && /* @__PURE__ */ x(
1629
1630
  "div",
1630
1631
  {
1631
1632
  style: {
1632
- display: R ? "none" : void 0,
1633
+ display: M ? "none" : void 0,
1633
1634
  minHeight: s
1634
1635
  },
1635
1636
  children: /* @__PURE__ */ x(
@@ -1652,23 +1653,23 @@ function Ht({
1652
1653
  o && /* @__PURE__ */ x(
1653
1654
  "div",
1654
1655
  {
1655
- ref: ft,
1656
+ ref: ht,
1656
1657
  style: {
1657
- position: "absolute",
1658
- bottom: E ? 0 : s,
1658
+ position: "fixed",
1659
+ bottom: w ? 0 : s,
1659
1660
  left: 0,
1660
1661
  width: "100%"
1661
1662
  },
1662
1663
  children: o
1663
1664
  }
1664
1665
  ),
1665
- C && /* @__PURE__ */ x(ge, { ref: rt }),
1666
+ k && /* @__PURE__ */ x(we, { ref: nt }),
1666
1667
  /* @__PURE__ */ x(
1667
1668
  "div",
1668
1669
  {
1669
1670
  "data-swipe-at-edge-bar": !0,
1670
1671
  style: {
1671
- position: "absolute",
1672
+ position: "fixed",
1672
1673
  top: 0,
1673
1674
  right: 0,
1674
1675
  width: 8,
@@ -1681,28 +1682,28 @@ function Ht({
1681
1682
  }
1682
1683
  );
1683
1684
  }
1684
- function xe({ children: n, ...e }) {
1685
- const { isActive: t, isPrev: s, zIndex: r } = Z(), a = q((g) => g.index), o = U((g) => g.status), c = J((g) => g.dragStatus), f = J((g) => g.replaceTransitionStatus), E = !t && (o === "COMPLETED" && c === "IDLE") || s && a - 2 <= r && f === "IDLE" || s && a - 2 > r;
1686
- return /* @__PURE__ */ x(Ht, { ...e, children: /* @__PURE__ */ x(Ct, { mode: E ? "hidden" : "visible", children: n }) });
1685
+ function Me({ children: n, ...e }) {
1686
+ const { isActive: t, isPrev: s, zIndex: r } = z(), a = Q((d) => d.index), o = $((d) => d.status), u = X((d) => d.dragStatus), h = X((d) => d.replaceTransitionStatus), w = !t && (o === "COMPLETED" && u === "IDLE") || s && a - 2 <= r && h === "IDLE" || s && a - 2 > r;
1687
+ return /* @__PURE__ */ x(Ut, { freeze: w, children: /* @__PURE__ */ x(_t, { ...e, children: n }) });
1687
1688
  }
1688
- function Ne({ children: n, ...e }) {
1689
- const { isActive: t, isPrev: s, zIndex: r } = Z(), a = q((g) => g.index), o = U((g) => g.status), c = J((g) => g.dragStatus), f = J((g) => g.replaceTransitionStatus), E = !t && (o === "COMPLETED" && c === "IDLE") || s && a - 2 <= r && f === "IDLE" || s && a - 2 > r;
1690
- return /* @__PURE__ */ x(
1691
- Ht,
1689
+ function Ce({ children: n, ...e }) {
1690
+ const { isActive: t, isPrev: s, zIndex: r } = z(), a = Q((d) => d.index), o = $((d) => d.status), u = X((d) => d.dragStatus), h = X((d) => d.replaceTransitionStatus), w = !t && (o === "COMPLETED" && u === "IDLE") || s && a - 2 <= r && h === "IDLE" || s && a - 2 > r;
1691
+ return /* @__PURE__ */ x(Ut, { freeze: w, children: /* @__PURE__ */ x(
1692
+ _t,
1692
1693
  {
1693
1694
  ...e,
1694
1695
  style: {
1695
1696
  backgroundColor: "transparent",
1696
1697
  ...e.style
1697
1698
  },
1698
- children: /* @__PURE__ */ x(Kt, { children: /* @__PURE__ */ x(Ct, { mode: E ? "hidden" : "visible", children: n }) })
1699
+ children: /* @__PURE__ */ x(Jt, { children: n })
1699
1700
  }
1700
- );
1701
+ ) });
1701
1702
  }
1702
- function ke({ children: n, ...e }) {
1703
- const { isActive: t, transitionName: s } = Z(), r = U((o) => o.status), a = et.get(s);
1703
+ function Re({ children: n, ...e }) {
1704
+ const { isActive: t, transitionName: s } = z(), r = $((o) => o.status), a = K.get(s);
1704
1705
  return /* @__PURE__ */ x(
1705
- Wt,
1706
+ Zt,
1706
1707
  {
1707
1708
  transition: a?.variants[`${r}-${t}`]?.options,
1708
1709
  ...e,
@@ -1711,18 +1712,18 @@ function ke({ children: n, ...e }) {
1711
1712
  );
1712
1713
  }
1713
1714
  export {
1714
- ke as LayoutConfig,
1715
- Ne as LayoutScreen,
1716
- Pe as Route,
1717
- Se as Router,
1718
- xe as Screen,
1719
- ie as createDecorator,
1720
- Ie as createRawDecorator,
1721
- De as createRawTransition,
1715
+ Re as LayoutConfig,
1716
+ Ce as LayoutScreen,
1717
+ De as Route,
1718
+ Te as Router,
1719
+ Me as Screen,
1720
+ le as createDecorator,
1721
+ ke as createRawDecorator,
1722
+ Ne as createRawTransition,
1722
1723
  ct as createTransition,
1723
- ve as useNavigate,
1724
- Le as useParams,
1725
- Z as useScreen,
1726
- Te as useStep,
1727
- ye as useViewportScrollHeight
1724
+ Le as useNavigate,
1725
+ xe as useParams,
1726
+ z as useScreen,
1727
+ Ie as useStep,
1728
+ Ee as useViewportScrollHeight
1728
1729
  };