flemo 1.3.4 → 1.3.6

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.
Files changed (2) hide show
  1. package/dist/index.mjs +1368 -1186
  2. package/package.json +7 -5
package/dist/index.mjs CHANGED
@@ -1,11 +1,12 @@
1
- import { jsx as D, jsxs as ct } from "react/jsx-runtime";
2
- import nt, { useEffect as K, createContext as dt, useContext as pt, useReducer as Ht, Children as It, Suspense as _t, useImperativeHandle as Ft, useState as mt, useRef as H, useLayoutEffect as Et } from "react";
3
- import { transform as ft, useAnimate as Lt, motion as z, useDragControls as Qt, AnimatePresence as jt, MotionConfig as qt } from "motion/react";
4
- var _ = {}, wt;
5
- function Yt() {
6
- if (wt) return _;
7
- wt = 1, Object.defineProperty(_, "__esModule", { value: !0 }), _.PathError = _.TokenData = void 0, _.parse = l, _.compile = m, _.match = P, _.pathToRegexp = I, _.stringify = $;
8
- const n = "/", e = (i) => i, t = /^[$_\p{ID_Start}]$/u, r = /^[$\u200c\u200d\p{ID_Continue}]$/u, s = {
1
+ import { jsx as x, jsxs as Xt } from "react/jsx-runtime";
2
+ import { c as j } from "react/compiler-runtime";
3
+ import _t, { useEffect as J, createContext as zt, useContext as Wt, useReducer as we, Children as le, Suspense as Ee, useImperativeHandle as Pe, useState as ne, useRef as B, useLayoutEffect as se } from "react";
4
+ import { transform as Jt, useAnimate as fe, motion as Z, useDragControls as Te, AnimatePresence as ve, MotionConfig as De } from "motion/react";
5
+ var F = {}, re;
6
+ function Ie() {
7
+ if (re) return F;
8
+ re = 1, Object.defineProperty(F, "__esModule", { value: !0 }), F.PathError = F.TokenData = void 0, F.parse = a, F.compile = d, F.match = p, F.pathToRegexp = w, F.stringify = C;
9
+ const e = "/", t = (f) => f, n = /^[$_\p{ID_Start}]$/u, s = /^[$\u200c\u200d\p{ID_Continue}]$/u, r = {
9
10
  // Groups.
10
11
  "{": "{",
11
12
  "}": "}",
@@ -18,283 +19,281 @@ function Yt() {
18
19
  "?": "?",
19
20
  "!": "!"
20
21
  };
21
- function a(i) {
22
- return i.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
22
+ function c(f) {
23
+ return f.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
23
24
  }
24
- function o(i) {
25
- return i.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
25
+ function i(f) {
26
+ return f.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
26
27
  }
27
- class c {
28
- constructor(y, g) {
29
- this.tokens = y, this.originalPath = g;
28
+ class u {
29
+ constructor(m, P) {
30
+ this.tokens = m, this.originalPath = P;
30
31
  }
31
32
  }
32
- _.TokenData = c;
33
- class h extends TypeError {
34
- constructor(y, g) {
35
- let E = y;
36
- g && (E += `: ${g}`), E += "; visit https://git.new/pathToRegexpError for info", super(E), this.originalPath = g;
33
+ F.TokenData = u;
34
+ class l extends TypeError {
35
+ constructor(m, P) {
36
+ let h = m;
37
+ P && (h += `: ${P}`), h += "; visit https://git.new/pathToRegexpError for info", super(h), this.originalPath = P;
37
38
  }
38
39
  }
39
- _.PathError = h;
40
- function l(i, y = {}) {
41
- const { encodePath: g = e } = y, E = [...i], p = [];
42
- let f = 0, L = 0;
43
- function T() {
44
- let S = "";
45
- if (t.test(E[f]))
40
+ F.PathError = l;
41
+ function a(f, m = {}) {
42
+ const { encodePath: P = t } = m, h = [...f], S = [];
43
+ let y = 0, v = 0;
44
+ function N() {
45
+ let I = "";
46
+ if (n.test(h[y]))
46
47
  do
47
- S += E[f++];
48
- while (r.test(E[f]));
49
- else if (E[f] === '"') {
50
- let M = f;
51
- for (; f++ < E.length; ) {
52
- if (E[f] === '"') {
53
- f++, M = 0;
48
+ I += h[y++];
49
+ while (s.test(h[y]));
50
+ else if (h[y] === '"') {
51
+ let _ = y;
52
+ for (; y++ < h.length; ) {
53
+ if (h[y] === '"') {
54
+ y++, _ = 0;
54
55
  break;
55
56
  }
56
- E[f] === "\\" && f++, S += E[f];
57
+ h[y] === "\\" && y++, I += h[y];
57
58
  }
58
- if (M)
59
- throw new h(`Unterminated quote at index ${M}`, i);
59
+ if (_)
60
+ throw new l(`Unterminated quote at index ${_}`, f);
60
61
  }
61
- if (!S)
62
- throw new h(`Missing parameter name at index ${f}`, i);
63
- return S;
62
+ if (!I)
63
+ throw new l(`Missing parameter name at index ${y}`, f);
64
+ return I;
64
65
  }
65
- for (; f < E.length; ) {
66
- const S = E[f], M = s[S];
67
- M ? p.push({ type: M, index: f++, value: S }) : S === "\\" ? p.push({ type: "escape", index: f++, value: E[f++] }) : S === ":" ? p.push({ type: "param", index: f++, value: T() }) : S === "*" ? p.push({ type: "wildcard", index: f++, value: T() }) : p.push({ type: "char", index: f++, value: S });
66
+ for (; y < h.length; ) {
67
+ const I = h[y], _ = r[I];
68
+ _ ? S.push({ type: _, index: y++, value: I }) : I === "\\" ? S.push({ type: "escape", index: y++, value: h[y++] }) : I === ":" ? S.push({ type: "param", index: y++, value: N() }) : I === "*" ? S.push({ type: "wildcard", index: y++, value: N() }) : S.push({ type: "char", index: y++, value: I });
68
69
  }
69
- p.push({ type: "end", index: f, value: "" });
70
- function R(S) {
71
- const M = [];
70
+ S.push({ type: "end", index: y, value: "" });
71
+ function H(I) {
72
+ const _ = [];
72
73
  for (; ; ) {
73
- const x = p[L++];
74
- if (x.type === S)
74
+ const $ = S[v++];
75
+ if ($.type === I)
75
76
  break;
76
- if (x.type === "char" || x.type === "escape") {
77
- let C = x.value, A = p[L];
78
- for (; A.type === "char" || A.type === "escape"; )
79
- C += A.value, A = p[++L];
80
- M.push({
77
+ if ($.type === "char" || $.type === "escape") {
78
+ let A = $.value, U = S[v];
79
+ for (; U.type === "char" || U.type === "escape"; )
80
+ A += U.value, U = S[++v];
81
+ _.push({
81
82
  type: "text",
82
- value: g(C)
83
+ value: P(A)
83
84
  });
84
85
  continue;
85
86
  }
86
- if (x.type === "param" || x.type === "wildcard") {
87
- M.push({
88
- type: x.type,
89
- name: x.value
87
+ if ($.type === "param" || $.type === "wildcard") {
88
+ _.push({
89
+ type: $.type,
90
+ name: $.value
90
91
  });
91
92
  continue;
92
93
  }
93
- if (x.type === "{") {
94
- M.push({
94
+ if ($.type === "{") {
95
+ _.push({
95
96
  type: "group",
96
- tokens: R("}")
97
+ tokens: H("}")
97
98
  });
98
99
  continue;
99
100
  }
100
- throw new h(`Unexpected ${x.type} at index ${x.index}, expected ${S}`, i);
101
+ throw new l(`Unexpected ${$.type} at index ${$.index}, expected ${I}`, f);
101
102
  }
102
- return M;
103
+ return _;
103
104
  }
104
- return new c(R("end"), i);
105
+ return new u(H("end"), f);
105
106
  }
106
- function m(i, y = {}) {
107
- const { encode: g = encodeURIComponent, delimiter: E = n } = y, p = typeof i == "object" ? i : l(i, y), f = d(p.tokens, E, g);
108
- return function(T = {}) {
109
- const [R, ...S] = f(T);
110
- if (S.length)
111
- throw new TypeError(`Missing parameters: ${S.join(", ")}`);
112
- return R;
107
+ function d(f, m = {}) {
108
+ const { encode: P = encodeURIComponent, delimiter: h = e } = m, S = typeof f == "object" ? f : a(f, m), y = g(S.tokens, h, P);
109
+ return function(N = {}) {
110
+ const [H, ...I] = y(N);
111
+ if (I.length)
112
+ throw new TypeError(`Missing parameters: ${I.join(", ")}`);
113
+ return H;
113
114
  };
114
115
  }
115
- function d(i, y, g) {
116
- const E = i.map((p) => u(p, y, g));
117
- return (p) => {
118
- const f = [""];
119
- for (const L of E) {
120
- const [T, ...R] = L(p);
121
- f[0] += T, f.push(...R);
116
+ function g(f, m, P) {
117
+ const h = f.map((S) => o(S, m, P));
118
+ return (S) => {
119
+ const y = [""];
120
+ for (const v of h) {
121
+ const [N, ...H] = v(S);
122
+ y[0] += N, y.push(...H);
122
123
  }
123
- return f;
124
+ return y;
124
125
  };
125
126
  }
126
- function u(i, y, g) {
127
- if (i.type === "text")
128
- return () => [i.value];
129
- if (i.type === "group") {
130
- const p = d(i.tokens, y, g);
131
- return (f) => {
132
- const [L, ...T] = p(f);
133
- return T.length ? [""] : [L];
127
+ function o(f, m, P) {
128
+ if (f.type === "text")
129
+ return () => [f.value];
130
+ if (f.type === "group") {
131
+ const S = g(f.tokens, m, P);
132
+ return (y) => {
133
+ const [v, ...N] = S(y);
134
+ return N.length ? [""] : [v];
134
135
  };
135
136
  }
136
- const E = g || e;
137
- return i.type === "wildcard" && g !== !1 ? (p) => {
138
- const f = p[i.name];
139
- if (f == null)
140
- return ["", i.name];
141
- if (!Array.isArray(f) || f.length === 0)
142
- throw new TypeError(`Expected "${i.name}" to be a non-empty array`);
137
+ const h = P || t;
138
+ return f.type === "wildcard" && P !== !1 ? (S) => {
139
+ const y = S[f.name];
140
+ if (y == null)
141
+ return ["", f.name];
142
+ if (!Array.isArray(y) || y.length === 0)
143
+ throw new TypeError(`Expected "${f.name}" to be a non-empty array`);
143
144
  return [
144
- f.map((L, T) => {
145
- if (typeof L != "string")
146
- throw new TypeError(`Expected "${i.name}/${T}" to be a string`);
147
- return E(L);
148
- }).join(y)
145
+ y.map((v, N) => {
146
+ if (typeof v != "string")
147
+ throw new TypeError(`Expected "${f.name}/${N}" to be a string`);
148
+ return h(v);
149
+ }).join(m)
149
150
  ];
150
- } : (p) => {
151
- const f = p[i.name];
152
- if (f == null)
153
- return ["", i.name];
154
- if (typeof f != "string")
155
- throw new TypeError(`Expected "${i.name}" to be a string`);
156
- return [E(f)];
151
+ } : (S) => {
152
+ const y = S[f.name];
153
+ if (y == null)
154
+ return ["", f.name];
155
+ if (typeof y != "string")
156
+ throw new TypeError(`Expected "${f.name}" to be a string`);
157
+ return [h(y)];
157
158
  };
158
159
  }
159
- function P(i, y = {}) {
160
- const { decode: g = decodeURIComponent, delimiter: E = n } = y, { regexp: p, keys: f } = I(i, y), L = f.map((T) => g === !1 ? e : T.type === "param" ? g : (R) => R.split(E).map(g));
161
- return function(R) {
162
- const S = p.exec(R);
163
- if (!S)
160
+ function p(f, m = {}) {
161
+ const { decode: P = decodeURIComponent, delimiter: h = e } = m, { regexp: S, keys: y } = w(f, m), v = y.map((N) => P === !1 ? t : N.type === "param" ? P : (H) => H.split(h).map(P));
162
+ return function(H) {
163
+ const I = S.exec(H);
164
+ if (!I)
164
165
  return !1;
165
- const M = S[0], x = /* @__PURE__ */ Object.create(null);
166
- for (let C = 1; C < S.length; C++) {
167
- if (S[C] === void 0)
166
+ const _ = I[0], $ = /* @__PURE__ */ Object.create(null);
167
+ for (let A = 1; A < I.length; A++) {
168
+ if (I[A] === void 0)
168
169
  continue;
169
- const A = f[C - 1], V = L[C - 1];
170
- x[A.name] = V(S[C]);
170
+ const U = y[A - 1], et = v[A - 1];
171
+ $[U.name] = et(I[A]);
171
172
  }
172
- return { path: M, params: x };
173
+ return { path: _, params: $ };
173
174
  };
174
175
  }
175
- function I(i, y = {}) {
176
- const { delimiter: g = n, end: E = !0, sensitive: p = !1, trailing: f = !0 } = y, L = [], T = p ? "" : "i", R = [];
177
- for (const x of N(i, [])) {
178
- const C = typeof x == "object" ? x : l(x, y);
179
- for (const A of w(C.tokens, 0, []))
180
- R.push(k(A, g, L, C.originalPath));
176
+ function w(f, m = {}) {
177
+ const { delimiter: P = e, end: h = !0, sensitive: S = !1, trailing: y = !0 } = m, v = [], N = S ? "" : "i", H = [];
178
+ for (const $ of E(f, [])) {
179
+ const A = typeof $ == "object" ? $ : a($, m);
180
+ for (const U of T(A.tokens, 0, []))
181
+ H.push(L(U, P, v, A.originalPath));
181
182
  }
182
- let S = `^(?:${R.join("|")})`;
183
- return f && (S += `(?:${o(g)}$)?`), S += E ? "$" : `(?=${o(g)}|$)`, { regexp: new RegExp(S, T), keys: L };
183
+ let I = `^(?:${H.join("|")})`;
184
+ return y && (I += `(?:${i(P)}$)?`), I += h ? "$" : `(?=${i(P)}|$)`, { regexp: new RegExp(I, N), keys: v };
184
185
  }
185
- function N(i, y) {
186
- if (Array.isArray(i))
187
- for (const g of i)
188
- N(g, y);
186
+ function E(f, m) {
187
+ if (Array.isArray(f))
188
+ for (const P of f)
189
+ E(P, m);
189
190
  else
190
- y.push(i);
191
- return y;
191
+ m.push(f);
192
+ return m;
192
193
  }
193
- function* w(i, y, g) {
194
- if (y === i.length)
195
- return yield g;
196
- const E = i[y];
197
- if (E.type === "group")
198
- for (const p of w(E.tokens, 0, g.slice()))
199
- yield* w(i, y + 1, p);
194
+ function* T(f, m, P) {
195
+ if (m === f.length)
196
+ return yield P;
197
+ const h = f[m];
198
+ if (h.type === "group")
199
+ for (const S of T(h.tokens, 0, P.slice()))
200
+ yield* T(f, m + 1, S);
200
201
  else
201
- g.push(E);
202
- yield* w(i, y + 1, g);
202
+ P.push(h);
203
+ yield* T(f, m + 1, P);
203
204
  }
204
- function k(i, y, g, E) {
205
- let p = "", f = "", L = !0;
206
- for (const T of i) {
207
- if (T.type === "text") {
208
- p += o(T.value), f += T.value, L || (L = T.value.includes(y));
205
+ function L(f, m, P, h) {
206
+ let S = "", y = "", v = !0;
207
+ for (const N of f) {
208
+ if (N.type === "text") {
209
+ S += i(N.value), y += N.value, v || (v = N.value.includes(m));
209
210
  continue;
210
211
  }
211
- if (T.type === "param" || T.type === "wildcard") {
212
- if (!L && !f)
213
- throw new h(`Missing text before "${T.name}" ${T.type}`, E);
214
- T.type === "param" ? p += `(${U(y, L ? "" : f)}+)` : p += "([\\s\\S]+)", g.push(T), f = "", L = !1;
212
+ if (N.type === "param" || N.type === "wildcard") {
213
+ if (!v && !y)
214
+ throw new l(`Missing text before "${N.name}" ${N.type}`, h);
215
+ N.type === "param" ? S += `(${M(m, v ? "" : y)}+)` : S += "([\\s\\S]+)", P.push(N), y = "", v = !1;
215
216
  continue;
216
217
  }
217
218
  }
218
- return p;
219
+ return S;
219
220
  }
220
- function U(i, y) {
221
- return y.length < 2 ? i.length < 2 ? `[^${o(i + y)}]` : `(?:(?!${o(i)})[^${o(y)}])` : i.length < 2 ? `(?:(?!${o(y)})[^${o(i)}])` : `(?:(?!${o(y)}|${o(i)})[\\s\\S])`;
221
+ function M(f, m) {
222
+ return m.length < 2 ? f.length < 2 ? `[^${i(f + m)}]` : `(?:(?!${i(f)})[^${i(m)}])` : f.length < 2 ? `(?:(?!${i(m)})[^${i(f)}])` : `(?:(?!${i(m)}|${i(f)})[\\s\\S])`;
222
223
  }
223
- function b(i) {
224
- let y = "", g = 0;
225
- function E(p) {
226
- return tt(p) && J(i[g]) ? p : JSON.stringify(p);
224
+ function D(f) {
225
+ let m = "", P = 0;
226
+ function h(S) {
227
+ return R(S) && b(f[P]) ? S : JSON.stringify(S);
227
228
  }
228
- for (; g < i.length; ) {
229
- const p = i[g++];
230
- if (p.type === "text") {
231
- y += a(p.value);
229
+ for (; P < f.length; ) {
230
+ const S = f[P++];
231
+ if (S.type === "text") {
232
+ m += c(S.value);
232
233
  continue;
233
234
  }
234
- if (p.type === "group") {
235
- y += `{${b(p.tokens)}}`;
235
+ if (S.type === "group") {
236
+ m += `{${D(S.tokens)}}`;
236
237
  continue;
237
238
  }
238
- if (p.type === "param") {
239
- y += `:${E(p.name)}`;
239
+ if (S.type === "param") {
240
+ m += `:${h(S.name)}`;
240
241
  continue;
241
242
  }
242
- if (p.type === "wildcard") {
243
- y += `*${E(p.name)}`;
243
+ if (S.type === "wildcard") {
244
+ m += `*${h(S.name)}`;
244
245
  continue;
245
246
  }
246
- throw new TypeError(`Unknown token type: ${p.type}`);
247
+ throw new TypeError(`Unknown token type: ${S.type}`);
247
248
  }
248
- return y;
249
+ return m;
249
250
  }
250
- function $(i) {
251
- return b(i.tokens);
251
+ function C(f) {
252
+ return D(f.tokens);
252
253
  }
253
- function tt(i) {
254
- const [y, ...g] = i;
255
- return t.test(y) && g.every((E) => r.test(E));
254
+ function R(f) {
255
+ const [m, ...P] = f;
256
+ return n.test(m) && P.every((h) => s.test(h));
256
257
  }
257
- function J(i) {
258
- return i && i.type === "text" ? !r.test(i.value[0]) : !0;
258
+ function b(f) {
259
+ return f && f.type === "text" ? !s.test(f.value[0]) : !0;
259
260
  }
260
- return _;
261
+ return F;
261
262
  }
262
- var X = Yt();
263
- function Bt(n, e, t) {
264
- const r = Array.isArray(n) ? n.find((c) => X.pathToRegexp(c).regexp.test(e)) || "" : X.pathToRegexp(n).regexp.test(e) ? n : "", s = X.match(r)(e), a = new URLSearchParams(t), o = Object.fromEntries(a.entries());
265
- return s ? { ...s.params, ...o } : {};
263
+ var W = Ie();
264
+ function Le(e, t, n) {
265
+ const s = Array.isArray(e) ? e.find((u) => W.pathToRegexp(u).regexp.test(t)) || "" : W.pathToRegexp(e).regexp.test(t) ? e : "", r = W.match(s)(t), c = new URLSearchParams(n), i = Object.fromEntries(c.entries());
266
+ return r ? {
267
+ ...r.params,
268
+ ...i
269
+ } : {};
266
270
  }
267
- function St() {
271
+ function ae() {
268
272
  return typeof document > "u";
269
273
  }
270
- class Xt {
271
- tasks = /* @__PURE__ */ new Map();
272
- instanceId = Date.now().toString();
273
- isLocked = !1;
274
- currentTaskId = null;
275
- taskQueue = Promise.resolve();
276
- signalListeners = /* @__PURE__ */ new Map();
277
- pendingTaskQueue = [];
278
- isProcessingPending = !1;
279
- async acquireLock(e) {
280
- for (let s = 0; s < 10; s++) {
274
+ class Ne {
275
+ constructor() {
276
+ this.tasks = /* @__PURE__ */ new Map(), this.instanceId = Date.now().toString(), this.isLocked = !1, this.currentTaskId = null, this.taskQueue = Promise.resolve(), this.signalListeners = /* @__PURE__ */ new Map(), this.pendingTaskQueue = [], this.isProcessingPending = !1;
277
+ }
278
+ async acquireLock(t) {
279
+ for (let r = 0; r < 10; r++) {
281
280
  if (!this.isLocked)
282
- return this.isLocked = !0, this.currentTaskId = e, !0;
283
- await new Promise((a) => setTimeout(a, 100));
281
+ return this.isLocked = !0, this.currentTaskId = t, !0;
282
+ await new Promise((c) => setTimeout(c, 100));
284
283
  }
285
284
  return !1;
286
285
  }
287
- releaseLock(e) {
288
- this.currentTaskId === e && (this.isLocked = !1, this.currentTaskId = null);
286
+ releaseLock(t) {
287
+ this.currentTaskId === t && (this.isLocked = !1, this.currentTaskId = null);
289
288
  }
290
289
  generateTaskId() {
291
290
  return `${this.instanceId}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
292
291
  }
293
- emitSignal(e) {
294
- const t = this.signalListeners.get(e);
295
- t && (t.forEach((r) => {
296
- this.resolveTask(r);
297
- }), this.signalListeners.delete(e));
292
+ emitSignal(t) {
293
+ const n = this.signalListeners.get(t);
294
+ n && (n.forEach((s) => {
295
+ this.resolveTask(s);
296
+ }), this.signalListeners.delete(t));
298
297
  }
299
298
  // 대기 중인 태스크들을 처리하는 메서드
300
299
  async processPendingTasks() {
@@ -302,12 +301,12 @@ class Xt {
302
301
  this.isProcessingPending = !0;
303
302
  try {
304
303
  for (; this.pendingTaskQueue.length > 0; ) {
305
- const e = this.pendingTaskQueue[0];
306
- if (e.status === "COMPLETED" || e.status === "FAILED" || e.status === "ROLLEDBACK") {
304
+ const t = this.pendingTaskQueue[0];
305
+ if (t.status === "COMPLETED" || t.status === "FAILED" || t.status === "ROLLEDBACK") {
307
306
  this.pendingTaskQueue.shift();
308
307
  continue;
309
308
  }
310
- if (e.status === "MANUAL_PENDING" || e.status === "SIGNAL_PENDING" || e.status === "PROCESSING" || e.status === "PENDING")
309
+ if (t.status === "MANUAL_PENDING" || t.status === "SIGNAL_PENDING" || t.status === "PROCESSING" || t.status === "PENDING")
311
310
  break;
312
311
  }
313
312
  } finally {
@@ -317,221 +316,242 @@ class Xt {
317
316
  }
318
317
  // 모든 대기 중인 태스크가 완료될 때까지 대기
319
318
  async waitForPendingTasks() {
320
- return new Promise((e) => {
321
- const t = () => {
322
- this.pendingTaskQueue.filter(
323
- (s) => s.status === "MANUAL_PENDING" || s.status === "SIGNAL_PENDING"
324
- ).length === 0 ? e() : setTimeout(t, 100);
319
+ return new Promise((t) => {
320
+ const n = () => {
321
+ this.pendingTaskQueue.filter((r) => r.status === "MANUAL_PENDING" || r.status === "SIGNAL_PENDING").length === 0 ? t() : setTimeout(n, 100);
325
322
  };
326
- t();
323
+ n();
327
324
  });
328
325
  }
329
326
  // 태스크 상태 변경 시 대기 큐 처리
330
- async onTaskStatusChange(e, t) {
331
- (t === "COMPLETED" || t === "FAILED" || t === "ROLLEDBACK") && (this.pendingTaskQueue = this.pendingTaskQueue.filter((r) => r.id !== e), await this.processPendingTasks());
327
+ async onTaskStatusChange(t, n) {
328
+ (n === "COMPLETED" || n === "FAILED" || n === "ROLLEDBACK") && (this.pendingTaskQueue = this.pendingTaskQueue.filter((s) => s.id !== t), await this.processPendingTasks());
332
329
  }
333
- async addTask(e, t = {}) {
334
- const r = t.id || this.generateTaskId();
335
- return new Promise((s, a) => {
330
+ async addTask(t, n = {}) {
331
+ const s = n.id || this.generateTaskId();
332
+ return new Promise((r, c) => {
336
333
  this.taskQueue = this.taskQueue.then(async () => {
337
334
  try {
338
- const { control: o, validate: c, rollback: h, dependencies: l = [], delay: m } = t, d = new AbortController(), u = {
339
- id: r,
340
- execute: e,
335
+ const {
336
+ control: i,
337
+ validate: u,
338
+ rollback: l,
339
+ dependencies: a = [],
340
+ delay: d
341
+ } = n, g = new AbortController(), o = {
342
+ id: s,
343
+ execute: t,
341
344
  timestamp: Date.now(),
342
345
  retryCount: 0,
343
346
  status: "PENDING",
344
- dependencies: l,
347
+ dependencies: a,
345
348
  instanceId: this.instanceId,
346
- validate: c,
347
- rollback: h,
348
- control: o,
349
- abortController: d
349
+ validate: u,
350
+ rollback: l,
351
+ control: i,
352
+ abortController: g
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((I) => I.id !== u.id));
354
+ this.tasks.set(o.id, o), this.pendingTaskQueue.length > 0 && (this.pendingTaskQueue.push(o), await this.waitForPendingTasks(), this.pendingTaskQueue = this.pendingTaskQueue.filter((w) => w.id !== o.id));
352
355
  try {
353
- if (!await this.acquireLock(u.id))
354
- throw u.status = "FAILED", new Error("FAILED");
356
+ if (!await this.acquireLock(o.id))
357
+ throw o.status = "FAILED", new Error("FAILED");
355
358
  try {
356
- u.status = "PROCESSING";
357
- for (const w of u.dependencies) {
358
- const k = this.tasks.get(w);
359
- if (!k || k.status !== "COMPLETED")
360
- throw u.status = "FAILED", new Error("FAILED");
359
+ o.status = "PROCESSING";
360
+ for (const T of o.dependencies) {
361
+ const L = this.tasks.get(T);
362
+ if (!L || L.status !== "COMPLETED")
363
+ throw o.status = "FAILED", new Error("FAILED");
361
364
  }
362
- if (u.validate && !await u.validate())
363
- throw u.status = "FAILED", new Error("FAILED");
364
- m && m > 0 && await new Promise((w) => setTimeout(w, m));
365
- const N = await u.execute(u.abortController);
366
- if (u.abortController.signal.aborted) {
367
- u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), s({
365
+ if (o.validate && !await o.validate())
366
+ throw o.status = "FAILED", new Error("FAILED");
367
+ d && d > 0 && await new Promise((T) => setTimeout(T, d));
368
+ const E = await o.execute(o.abortController);
369
+ if (o.abortController.signal.aborted) {
370
+ o.status = "COMPLETED", await this.onTaskStatusChange(o.id, "COMPLETED"), r({
368
371
  success: !0,
369
372
  result: void 0,
370
- taskId: u.id,
373
+ taskId: o.id,
371
374
  timestamp: Date.now(),
372
375
  instanceId: this.instanceId
373
376
  });
374
377
  return;
375
378
  }
376
- if (t.control) {
377
- const w = t.control;
378
- if (w.delay && w.delay > 0 && await new Promise((k) => setTimeout(k, w.delay)), w.manual) {
379
- u.status = "MANUAL_PENDING", u.manualResolver = { resolve: s, reject: a, result: N }, this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "MANUAL_PENDING");
379
+ if (n.control) {
380
+ const T = n.control;
381
+ if (T.delay && T.delay > 0 && await new Promise((L) => setTimeout(L, T.delay)), T.manual) {
382
+ o.status = "MANUAL_PENDING", o.manualResolver = {
383
+ resolve: r,
384
+ reject: c,
385
+ result: E
386
+ }, this.pendingTaskQueue.push(o), await this.onTaskStatusChange(o.id, "MANUAL_PENDING");
380
387
  return;
381
388
  }
382
- if (w.signal) {
383
- u.status = "SIGNAL_PENDING", u.manualResolver = { resolve: s, reject: a, result: N }, this.signalListeners.has(w.signal) || this.signalListeners.set(w.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(w.signal).add(u.id), this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "SIGNAL_PENDING");
389
+ if (T.signal) {
390
+ o.status = "SIGNAL_PENDING", o.manualResolver = {
391
+ resolve: r,
392
+ reject: c,
393
+ result: E
394
+ }, this.signalListeners.has(T.signal) || this.signalListeners.set(T.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(T.signal).add(o.id), this.pendingTaskQueue.push(o), await this.onTaskStatusChange(o.id, "SIGNAL_PENDING");
384
395
  return;
385
396
  }
386
- if (w.condition && !await w.condition()) {
387
- u.status = "MANUAL_PENDING", u.manualResolver = { resolve: s, reject: a, result: N }, this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "MANUAL_PENDING");
397
+ if (T.condition && !await T.condition()) {
398
+ o.status = "MANUAL_PENDING", o.manualResolver = {
399
+ resolve: r,
400
+ reject: c,
401
+ result: E
402
+ }, this.pendingTaskQueue.push(o), await this.onTaskStatusChange(o.id, "MANUAL_PENDING");
388
403
  return;
389
404
  }
390
405
  }
391
- u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), s({
406
+ o.status = "COMPLETED", await this.onTaskStatusChange(o.id, "COMPLETED"), r({
392
407
  success: !0,
393
- result: N,
394
- taskId: u.id,
408
+ result: E,
409
+ taskId: o.id,
395
410
  timestamp: Date.now(),
396
411
  instanceId: this.instanceId
397
412
  });
398
- } catch (N) {
399
- if (u.status = "FAILED", u.rollback)
413
+ } catch (E) {
414
+ if (o.status = "FAILED", o.rollback)
400
415
  try {
401
- await u.rollback(), u.status = "ROLLEDBACK";
416
+ await o.rollback(), o.status = "ROLLEDBACK";
402
417
  } catch {
403
418
  }
404
- throw await this.onTaskStatusChange(u.id, u.status), N;
419
+ throw await this.onTaskStatusChange(o.id, o.status), E;
405
420
  } finally {
406
- this.releaseLock(u.id);
421
+ this.releaseLock(o.id);
407
422
  }
408
- } catch (I) {
409
- a(I);
423
+ } catch (w) {
424
+ c(w);
410
425
  }
411
- } catch (o) {
412
- a(o);
426
+ } catch (i) {
427
+ c(i);
413
428
  }
414
- }).catch(a);
429
+ }).catch(c);
415
430
  });
416
431
  }
417
- async resolveTask(e) {
418
- const t = this.tasks.get(e);
419
- if (!t || t.status !== "MANUAL_PENDING")
432
+ async resolveTask(t) {
433
+ const n = this.tasks.get(t);
434
+ if (!n || n.status !== "MANUAL_PENDING")
420
435
  return !1;
421
- if (t.manualResolver) {
422
- if (t.control?.condition && !await t.control.condition())
436
+ if (n.manualResolver) {
437
+ if (n.control?.condition && !await n.control.condition())
423
438
  return !1;
424
- t.status = "COMPLETED";
425
- const r = t.manualResolver;
426
- return r.resolve({
439
+ n.status = "COMPLETED";
440
+ const s = n.manualResolver;
441
+ return s.resolve({
427
442
  success: !0,
428
- result: r.result,
429
- taskId: t.id,
443
+ result: s.result,
444
+ taskId: n.id,
430
445
  timestamp: Date.now(),
431
446
  instanceId: this.instanceId
432
- }), delete t.manualResolver, await this.onTaskStatusChange(e, "COMPLETED"), !0;
447
+ }), delete n.manualResolver, await this.onTaskStatusChange(t, "COMPLETED"), !0;
433
448
  }
434
449
  return !1;
435
450
  }
436
451
  async resolveAllPending() {
437
- const e = Array.from(this.tasks.values()).filter(
438
- (t) => ["PENDING", "MANUAL_PENDING", "SIGNAL_PENDING"].includes(t.status)
439
- );
440
- await Promise.all(e.map((t) => this.resolveTask(t.id)));
452
+ const t = Array.from(this.tasks.values()).filter((n) => ["PENDING", "MANUAL_PENDING", "SIGNAL_PENDING"].includes(n.status));
453
+ await Promise.all(t.map((n) => this.resolveTask(n.id)));
441
454
  }
442
455
  }
443
- const Q = new Xt(), Pt = (n) => {
444
- let e;
445
- const t = /* @__PURE__ */ new Set(), r = (l, m) => {
446
- const d = typeof l == "function" ? l(e) : l;
447
- if (!Object.is(d, e)) {
448
- const u = e;
449
- e = m ?? (typeof d != "object" || d === null) ? d : Object.assign({}, e, d), t.forEach((P) => P(e, u));
456
+ const Y = new Ne(), ie = (e) => {
457
+ let t;
458
+ const n = /* @__PURE__ */ new Set(), s = (a, d) => {
459
+ const g = typeof a == "function" ? a(t) : a;
460
+ if (!Object.is(g, t)) {
461
+ const o = t;
462
+ t = d ?? (typeof g != "object" || g === null) ? g : Object.assign({}, t, g), n.forEach((p) => p(t, o));
450
463
  }
451
- }, s = () => e, c = { setState: r, getState: s, getInitialState: () => h, subscribe: (l) => (t.add(l), () => t.delete(l)) }, h = e = n(r, s, c);
452
- return c;
453
- }, Kt = ((n) => n ? Pt(n) : Pt), Vt = (n) => n;
454
- function zt(n, e = Vt) {
455
- const t = nt.useSyncExternalStore(
456
- n.subscribe,
457
- nt.useCallback(() => e(n.getState()), [n, e]),
458
- nt.useCallback(() => e(n.getInitialState()), [n, e])
464
+ }, r = () => t, u = { setState: s, getState: r, getInitialState: () => l, subscribe: (a) => (n.add(a), () => n.delete(a)) }, l = t = e(s, r, u);
465
+ return u;
466
+ }, xe = ((e) => e ? ie(e) : ie), ke = (e) => e;
467
+ function Me(e, t = ke) {
468
+ const n = _t.useSyncExternalStore(
469
+ e.subscribe,
470
+ _t.useCallback(() => t(e.getState()), [e, t]),
471
+ _t.useCallback(() => t(e.getInitialState()), [e, t])
459
472
  );
460
- return nt.useDebugValue(t), t;
473
+ return _t.useDebugValue(n), n;
461
474
  }
462
- const Tt = (n) => {
463
- const e = Kt(n), t = (r) => zt(e, r);
464
- return Object.assign(t, e), t;
465
- }, st = ((n) => n ? Tt(n) : Tt), j = st((n) => ({
475
+ const oe = (e) => {
476
+ const t = xe(e), n = (s) => Me(t, s);
477
+ return Object.assign(n, t), n;
478
+ }, Ot = ((e) => e ? oe(e) : oe), X = Ot((e) => ({
466
479
  index: -1,
467
480
  histories: [],
468
- addHistory: (e) => n((t) => ({
469
- index: t.index + 1,
470
- histories: t.histories.concat(e)
481
+ addHistory: (t) => e((n) => ({
482
+ index: n.index + 1,
483
+ histories: n.histories.concat(t)
471
484
  })),
472
- replaceHistory: (e) => n((t) => (t.histories.splice(e, 1), {
473
- index: t.index - 1,
474
- histories: t.histories
485
+ replaceHistory: (t) => e((n) => (n.histories.splice(t, 1), {
486
+ index: n.index - 1,
487
+ histories: n.histories
475
488
  })),
476
- popHistory: (e) => n((t) => ({
477
- index: t.index - 1,
478
- histories: t.histories.filter((r, s) => s !== e)
489
+ popHistory: (t) => e((n) => ({
490
+ index: n.index - 1,
491
+ histories: n.histories.filter((s, r) => r !== t)
479
492
  }))
480
- })), F = st((n) => ({
493
+ })), Q = Ot((e) => ({
481
494
  status: "IDLE",
482
- setStatus: (e) => n({ status: e })
495
+ setStatus: (t) => e({
496
+ status: t
497
+ })
483
498
  }));
484
- function Wt() {
485
- return K(() => {
486
- const n = async (e) => {
487
- const t = e.state?.id;
488
- (await Q.addTask(
489
- async (r) => {
490
- const s = e.state?.index, a = e.state?.status, o = e.state?.params, c = e.state?.transitionName, h = e.state?.layoutId, l = F.getState().setStatus, { index: m, addHistory: d, popHistory: u } = j.getState(), P = s < m, I = a === "PUSHING" && s > m, N = a === "REPLACING" && s > m, w = window.location.pathname;
491
- if (!P && !I && !N) {
492
- r.abort();
493
- return;
494
- }
495
- return P ? l("POPPING") : I ? (l("PUSHING"), d({
496
- id: t,
497
- pathname: w,
498
- params: o,
499
- transitionName: c,
500
- layoutId: h
501
- })) : N && (l("REPLACING"), d({
502
- id: t,
503
- pathname: w,
504
- params: o,
505
- transitionName: c,
506
- layoutId: h
507
- })), async () => {
508
- P && u(s + 1), l("COMPLETED");
509
- };
510
- },
511
- {
512
- id: t,
513
- control: {
514
- manual: !0
515
- }
516
- }
517
- )).result?.();
518
- };
519
- return window.addEventListener("popstate", n), () => {
520
- window.removeEventListener("popstate", n);
499
+ function Ce() {
500
+ const e = j(1);
501
+ let t;
502
+ return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = [], e[0] = t) : t = e[0], J($e, t), null;
503
+ }
504
+ function $e() {
505
+ const e = be;
506
+ return window.addEventListener("popstate", e), () => {
507
+ window.removeEventListener("popstate", e);
508
+ };
509
+ }
510
+ async function be(e) {
511
+ const t = e.state?.id;
512
+ (await Y.addTask(async (n) => {
513
+ const s = e.state?.index, r = e.state?.status, c = e.state?.params, i = e.state?.transitionName, u = e.state?.layoutId, l = Q.getState().setStatus, {
514
+ index: a,
515
+ addHistory: d,
516
+ popHistory: g
517
+ } = X.getState(), o = s < a, p = r === "PUSHING" && s > a, w = r === "REPLACING" && s > a, E = window.location.pathname;
518
+ if (!o && !p && !w) {
519
+ n.abort();
520
+ return;
521
+ }
522
+ return o ? l("POPPING") : p ? (l("PUSHING"), d({
523
+ id: t,
524
+ pathname: E,
525
+ params: c,
526
+ transitionName: i,
527
+ layoutId: u
528
+ })) : w && (l("REPLACING"), d({
529
+ id: t,
530
+ pathname: E,
531
+ params: c,
532
+ transitionName: i,
533
+ layoutId: u
534
+ })), async () => {
535
+ o && g(s + 1), l("COMPLETED");
521
536
  };
522
- }, []), null;
537
+ }, {
538
+ id: t,
539
+ control: {
540
+ manual: !0
541
+ }
542
+ })).result?.();
523
543
  }
524
- const xt = dt({}), Nt = dt(() => {
544
+ const de = zt({}), pe = zt(() => {
525
545
  });
526
- function Jt(n, e) {
527
- switch (e.type) {
546
+ function Ae(e, t) {
547
+ switch (t.type) {
528
548
  case "SET":
529
- return e.params;
549
+ return t.params;
530
550
  default:
531
- return n;
551
+ return e;
532
552
  }
533
553
  }
534
- const kt = dt({
554
+ const he = zt({
535
555
  id: "",
536
556
  isActive: !1,
537
557
  isRoot: !0,
@@ -543,76 +563,93 @@ const kt = dt({
543
563
  prevTransitionName: "none",
544
564
  layoutId: null
545
565
  });
546
- function Z() {
547
- return pt(kt);
566
+ function dt() {
567
+ return Wt(he);
548
568
  }
549
- function Zt({ children: n }) {
550
- const { isActive: e, params: t } = Z(), [r, s] = Ht(Jt, t);
551
- return K(() => {
552
- const a = async (o) => {
553
- o.state?.step && await Q.addTask(async () => {
554
- s({ type: "SET", params: o.state?.params || {} });
569
+ function Re(e) {
570
+ const t = j(6), {
571
+ children: n
572
+ } = e, {
573
+ isActive: s,
574
+ params: r
575
+ } = dt(), [c, i] = we(Ae, r);
576
+ let u, l;
577
+ t[0] !== s ? (u = () => {
578
+ const d = async (g) => {
579
+ g.state?.step && await Y.addTask(async () => {
580
+ i({
581
+ type: "SET",
582
+ params: g.state?.params || {}
583
+ });
555
584
  });
556
585
  };
557
- return e && window.addEventListener("popstate", a), () => {
558
- window.removeEventListener("popstate", a);
586
+ return s && window.addEventListener("popstate", d), () => {
587
+ window.removeEventListener("popstate", d);
559
588
  };
560
- }, [e, s]), /* @__PURE__ */ D(Nt.Provider, { value: s, children: /* @__PURE__ */ D(xt.Provider, { value: r, children: n }) });
589
+ }, l = [s, i], t[0] = s, t[1] = u, t[2] = l) : (u = t[1], l = t[2]), J(u, l);
590
+ let a;
591
+ return t[3] !== n || t[4] !== c ? (a = /* @__PURE__ */ x(pe.Provider, { value: i, children: /* @__PURE__ */ x(de.Provider, { value: c, children: n }) }), t[3] = n, t[4] = c, t[5] = a) : a = t[5], a;
561
592
  }
562
- function te({ children: n }) {
563
- const e = j((r) => r.index), t = j((r) => r.histories);
564
- return t.map(
565
- (r) => It.toArray(n).filter(
566
- (s) => X.pathToRegexp(s.props.path).regexp.test(
567
- r.pathname
568
- )
569
- )
570
- ).map(([r], s) => /* @__PURE__ */ D(
571
- kt.Provider,
572
- {
573
- value: {
574
- id: t[s].id,
575
- isActive: s === e,
576
- isRoot: s === 0,
577
- isPrev: s < e - 1,
578
- zIndex: s,
579
- pathname: t[s].pathname,
580
- params: t[s].params,
581
- transitionName: t[e].transitionName,
582
- prevTransitionName: t[e - 1]?.transitionName,
583
- layoutId: t[s].layoutId
584
- },
585
- children: /* @__PURE__ */ D(Zt, { children: r })
586
- },
587
- t[s].id
588
- ));
593
+ function _e(e) {
594
+ const t = j(9), {
595
+ children: n
596
+ } = e, s = X(Ge), r = X(Oe);
597
+ let c;
598
+ if (t[0] !== n || t[1] !== r || t[2] !== s) {
599
+ let i;
600
+ t[4] !== n ? (i = (l) => le.toArray(n).filter((a) => W.pathToRegexp(a.props.path).regexp.test(l.pathname)), t[4] = n, t[5] = i) : i = t[5];
601
+ let u;
602
+ t[6] !== r || t[7] !== s ? (u = (l, a) => {
603
+ const [d] = l;
604
+ return /* @__PURE__ */ x(he.Provider, { value: {
605
+ id: r[a].id,
606
+ isActive: a === s,
607
+ isRoot: a === 0,
608
+ isPrev: a < s - 1,
609
+ zIndex: a,
610
+ pathname: r[a].pathname,
611
+ params: r[a].params,
612
+ transitionName: r[s].transitionName,
613
+ prevTransitionName: r[s - 1]?.transitionName,
614
+ layoutId: r[a].layoutId
615
+ }, children: /* @__PURE__ */ x(Re, { children: d }) }, r[a].id);
616
+ }, t[6] = r, t[7] = s, t[8] = u) : u = t[8], c = r.map(i).map(u), t[0] = n, t[1] = r, t[2] = s, t[3] = c;
617
+ } else
618
+ c = t[3];
619
+ return c;
620
+ }
621
+ function Oe(e) {
622
+ return e.histories;
589
623
  }
590
- function ee({
591
- name: n,
592
- initial: e,
593
- enter: t,
594
- exit: r,
595
- options: s
624
+ function Ge(e) {
625
+ return e.index;
626
+ }
627
+ function He({
628
+ name: e,
629
+ initial: t,
630
+ enter: n,
631
+ exit: s,
632
+ options: r
596
633
  }) {
597
634
  return {
598
- name: n,
599
- initial: e,
635
+ name: e,
636
+ initial: t,
600
637
  variants: {
601
- "IDLE-true": t,
602
- "IDLE-false": t,
603
- "PUSHING-false": r,
604
- "PUSHING-true": t,
605
- "REPLACING-false": r,
606
- "REPLACING-true": t,
607
- "POPPING-false": t,
608
- "POPPING-true": t,
609
- "COMPLETED-false": r,
610
- "COMPLETED-true": t
638
+ "IDLE-true": n,
639
+ "IDLE-false": n,
640
+ "PUSHING-false": s,
641
+ "PUSHING-true": n,
642
+ "REPLACING-false": s,
643
+ "REPLACING-true": n,
644
+ "POPPING-false": n,
645
+ "POPPING-true": n,
646
+ "COMPLETED-false": s,
647
+ "COMPLETED-true": n
611
648
  },
612
- ...s
649
+ ...r
613
650
  };
614
651
  }
615
- const ne = ee({
652
+ const Ue = He({
616
653
  name: "overlay",
617
654
  initial: {
618
655
  opacity: 0,
@@ -637,67 +674,66 @@ const ne = ee({
637
674
  }
638
675
  },
639
676
  options: {
640
- onSwipeStart: (n, { animate: e, prevDecorator: t }) => e(
641
- t,
642
- {
643
- opacity: n ? 1 : 0
644
- },
645
- {
646
- duration: 0.3
647
- }
648
- ),
649
- onSwipe: (n, e, { animate: t, prevDecorator: r }) => t(
650
- r,
651
- {
652
- opacity: Math.max(0, 1 - e / 100)
653
- },
654
- {
655
- duration: 0
656
- }
657
- ),
658
- onSwipeEnd: (n, { animate: e, prevDecorator: t }) => e(
659
- t,
660
- {
661
- opacity: n ? 0 : 1
662
- },
663
- {
664
- duration: 0.3
665
- }
666
- )
677
+ onSwipeStart: (e, {
678
+ animate: t,
679
+ prevDecorator: n
680
+ }) => t(n, {
681
+ opacity: e ? 1 : 0
682
+ }, {
683
+ duration: 0.3
684
+ }),
685
+ onSwipe: (e, t, {
686
+ animate: n,
687
+ prevDecorator: s
688
+ }) => n(s, {
689
+ opacity: Math.max(0, 1 - t / 100)
690
+ }, {
691
+ duration: 0
692
+ }),
693
+ onSwipeEnd: (e, {
694
+ animate: t,
695
+ prevDecorator: n
696
+ }) => t(n, {
697
+ opacity: e ? 0 : 1
698
+ }, {
699
+ duration: 0.3
700
+ })
667
701
  }
668
- }), ht = /* @__PURE__ */ new Map([["overlay", ne]]), ut = st((n) => ({
702
+ }), Zt = /* @__PURE__ */ new Map([["overlay", Ue]]), Kt = Ot((e) => ({
669
703
  defaultTransitionName: "cupertino",
670
- setDefaultTransitionName: (e) => n({ defaultTransitionName: e })
704
+ setDefaultTransitionName: (t) => e({
705
+ defaultTransitionName: t
706
+ })
671
707
  }));
672
- function rt({
673
- name: n,
674
- initial: e,
675
- idle: t,
676
- enter: r,
677
- enterBack: s,
678
- exit: a,
679
- exitBack: o,
680
- options: c
708
+ function Gt({
709
+ name: e,
710
+ initial: t,
711
+ idle: n,
712
+ enter: s,
713
+ enterBack: r,
714
+ exit: c,
715
+ exitBack: i,
716
+ options: u
681
717
  }) {
682
718
  return {
683
- name: n,
684
- initial: e,
719
+ name: e,
720
+ initial: t,
685
721
  variants: {
686
- "IDLE-true": t,
687
- "IDLE-false": t,
688
- "PUSHING-false": a,
689
- "PUSHING-true": r,
690
- "REPLACING-false": a,
691
- "REPLACING-true": r,
692
- "POPPING-false": o,
693
- "POPPING-true": s,
694
- "COMPLETED-false": a,
695
- "COMPLETED-true": r
722
+ "IDLE-true": n,
723
+ "IDLE-false": n,
724
+ "PUSHING-false": c,
725
+ "PUSHING-true": s,
726
+ "REPLACING-false": c,
727
+ "REPLACING-true": s,
728
+ "POPPING-false": i,
729
+ "POPPING-true": r,
730
+ "COMPLETED-false": c,
731
+ "COMPLETED-true": s
696
732
  },
697
- ...c
733
+ ...u
698
734
  };
699
735
  }
700
- const se = rt({
736
+ const Be = Gt({
701
737
  name: "cupertino",
702
738
  initial: {
703
739
  x: "100%"
@@ -750,53 +786,49 @@ const se = rt({
750
786
  decoratorName: "overlay",
751
787
  swipeDirection: "x",
752
788
  onSwipeStart: async () => !0,
753
- onSwipe: (n, e, { animate: t, currentScreen: r, prevScreen: s, onProgress: a }) => {
754
- const { offset: o } = e, c = o.x, h = ft(c, [0, window.innerWidth], [0, 100]);
755
- return a?.(!0, h), t(
756
- r,
757
- {
758
- x: Math.max(0, c)
759
- },
760
- {
761
- duration: 0
762
- }
763
- ), t(
764
- s,
765
- {
766
- x: -100 + h
767
- },
768
- {
769
- duration: 0
770
- }
771
- ), h;
789
+ onSwipe: (e, t, {
790
+ animate: n,
791
+ currentScreen: s,
792
+ prevScreen: r,
793
+ onProgress: c
794
+ }) => {
795
+ const {
796
+ offset: i
797
+ } = t, u = i.x, l = Jt(u, [0, window.innerWidth], [0, 100]);
798
+ return c?.(!0, l), n(s, {
799
+ x: Math.max(0, u)
800
+ }, {
801
+ duration: 0
802
+ }), n(r, {
803
+ x: -100 + l
804
+ }, {
805
+ duration: 0
806
+ }), l;
772
807
  },
773
- onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
774
- const { offset: o, velocity: c } = e, l = o.x > 50 || c.x > 20;
775
- return a?.(l), await Promise.all([
776
- t(
777
- r,
778
- {
779
- x: l ? "100%" : 0
780
- },
781
- {
782
- duration: 0.3,
783
- ease: [0.32, 0.72, 0, 1]
784
- }
785
- ),
786
- t(
787
- s,
788
- {
789
- x: l ? 0 : -100
790
- },
791
- {
792
- duration: 0.3,
793
- ease: [0.32, 0.72, 0, 1]
794
- }
795
- )
796
- ]), l;
808
+ onSwipeEnd: async (e, t, {
809
+ animate: n,
810
+ currentScreen: s,
811
+ prevScreen: r,
812
+ onStart: c
813
+ }) => {
814
+ const {
815
+ offset: i,
816
+ velocity: u
817
+ } = t, a = i.x > 50 || u.x > 20;
818
+ return c?.(a), await Promise.all([n(s, {
819
+ x: a ? "100%" : 0
820
+ }, {
821
+ duration: 0.3,
822
+ ease: [0.32, 0.72, 0, 1]
823
+ }), n(r, {
824
+ x: a ? 0 : -100
825
+ }, {
826
+ duration: 0.3,
827
+ ease: [0.32, 0.72, 0, 1]
828
+ })]), a;
797
829
  }
798
830
  }
799
- }), re = rt({
831
+ }), Fe = Gt({
800
832
  name: "layout",
801
833
  initial: {
802
834
  opacity: 0.97
@@ -845,46 +877,45 @@ const se = rt({
845
877
  decoratorName: "overlay",
846
878
  swipeDirection: "y",
847
879
  onSwipeStart: async () => !0,
848
- onSwipe: (n, e, { animate: t, currentScreen: r, onProgress: s }) => {
849
- const { offset: a } = e, o = a.y, c = Math.max(0, Math.min(56, o)), h = ft(c, [0, 56], [1, 0.96]), l = Math.max(0, o - 56), m = Math.min(1, l / 160), d = Math.sqrt(m) * 12, u = Math.max(0, c + d), P = Math.min(56, u);
850
- return s?.(!0, 100), t(
851
- r,
852
- {
853
- y: u,
854
- opacity: h
855
- },
856
- {
857
- duration: 0
858
- }
859
- ), P;
880
+ onSwipe: (e, t, {
881
+ animate: n,
882
+ currentScreen: s,
883
+ onProgress: r
884
+ }) => {
885
+ const {
886
+ offset: c
887
+ } = t, i = c.y, u = Math.max(0, Math.min(56, i)), l = Jt(u, [0, 56], [1, 0.96]), a = Math.max(0, i - 56), d = Math.min(1, a / 160), g = Math.sqrt(d) * 12, o = Math.max(0, u + g), p = Math.min(56, o);
888
+ return r?.(!0, 100), n(s, {
889
+ y: o,
890
+ opacity: l
891
+ }, {
892
+ duration: 0
893
+ }), p;
860
894
  },
861
- onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
862
- const { offset: o, velocity: c } = e, l = o.y > 56 || c.y > 20;
863
- return a?.(l), await Promise.all([
864
- t(
865
- r,
866
- {
867
- y: l ? "100%" : 0,
868
- opacity: l ? 0.96 : 1
869
- },
870
- {
871
- duration: 0.3
872
- }
873
- ),
874
- t(
875
- s,
876
- {
877
- y: 0,
878
- opacity: l ? 1 : 0.97
879
- },
880
- {
881
- duration: 0.3
882
- }
883
- )
884
- ]), l;
895
+ onSwipeEnd: async (e, t, {
896
+ animate: n,
897
+ currentScreen: s,
898
+ prevScreen: r,
899
+ onStart: c
900
+ }) => {
901
+ const {
902
+ offset: i,
903
+ velocity: u
904
+ } = t, a = i.y > 56 || u.y > 20;
905
+ return c?.(a), await Promise.all([n(s, {
906
+ y: a ? "100%" : 0,
907
+ opacity: a ? 0.96 : 1
908
+ }, {
909
+ duration: 0.3
910
+ }), n(r, {
911
+ y: 0,
912
+ opacity: a ? 1 : 0.97
913
+ }, {
914
+ duration: 0.3
915
+ })]), a;
885
916
  }
886
917
  }
887
- }), ae = rt({
918
+ }), Qe = Gt({
888
919
  name: "material",
889
920
  initial: {
890
921
  y: "100%",
@@ -942,55 +973,53 @@ const se = rt({
942
973
  options: {
943
974
  swipeDirection: "y",
944
975
  onSwipeStart: async () => !0,
945
- onSwipe: (n, e, { animate: t, currentScreen: r, prevScreen: s, onProgress: a }) => {
946
- const { offset: o } = e, c = o.y, h = Math.max(0, Math.min(56, c)), l = ft(h, [0, 56], [1, 0.96]), m = Math.max(0, c - 56), d = Math.min(1, m / 160), u = Math.sqrt(d) * 12, P = Math.max(0, h + u), I = Math.min(56, P);
947
- return a?.(!0, I), t(
948
- r,
949
- {
950
- y: P,
951
- opacity: l
952
- },
953
- {
954
- duration: 0
955
- }
956
- ), t(
957
- s,
958
- {
959
- y: -56 + I,
960
- opacity: I / 56
961
- },
962
- { duration: 0 }
963
- ), I;
976
+ onSwipe: (e, t, {
977
+ animate: n,
978
+ currentScreen: s,
979
+ prevScreen: r,
980
+ onProgress: c
981
+ }) => {
982
+ const {
983
+ offset: i
984
+ } = t, u = i.y, l = Math.max(0, Math.min(56, u)), a = Jt(l, [0, 56], [1, 0.96]), d = Math.max(0, u - 56), g = Math.min(1, d / 160), o = Math.sqrt(g) * 12, p = Math.max(0, l + o), w = Math.min(56, p);
985
+ return c?.(!0, w), n(s, {
986
+ y: p,
987
+ opacity: a
988
+ }, {
989
+ duration: 0
990
+ }), n(r, {
991
+ y: -56 + w,
992
+ opacity: w / 56
993
+ }, {
994
+ duration: 0
995
+ }), w;
964
996
  },
965
- onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
966
- const { offset: o, velocity: c } = e, l = o.y > 56 || c.y > 20;
967
- return a?.(l), await Promise.all([
968
- t(
969
- r,
970
- {
971
- y: l ? "100%" : 0,
972
- opacity: l ? 0.96 : 1
973
- },
974
- {
975
- duration: l ? 0.22 : 0.24,
976
- ease: l ? [0.4, 0, 1, 1] : [0, 0, 0.2, 1]
977
- }
978
- ),
979
- t(
980
- s,
981
- {
982
- y: l ? 0 : -56,
983
- opacity: l ? 1 : 0.96
984
- },
985
- {
986
- duration: l ? 0.22 : 0.24,
987
- ease: l ? [0, 0, 0.2, 1] : [0.4, 0, 1, 1]
988
- }
989
- )
990
- ]), l;
997
+ onSwipeEnd: async (e, t, {
998
+ animate: n,
999
+ currentScreen: s,
1000
+ prevScreen: r,
1001
+ onStart: c
1002
+ }) => {
1003
+ const {
1004
+ offset: i,
1005
+ velocity: u
1006
+ } = t, a = i.y > 56 || u.y > 20;
1007
+ return c?.(a), await Promise.all([n(s, {
1008
+ y: a ? "100%" : 0,
1009
+ opacity: a ? 0.96 : 1
1010
+ }, {
1011
+ duration: a ? 0.22 : 0.24,
1012
+ ease: a ? [0.4, 0, 1, 1] : [0, 0, 0.2, 1]
1013
+ }), n(r, {
1014
+ y: a ? 0 : -56,
1015
+ opacity: a ? 1 : 0.96
1016
+ }, {
1017
+ duration: a ? 0.22 : 0.24,
1018
+ ease: a ? [0, 0, 0.2, 1] : [0.4, 0, 1, 1]
1019
+ })]), a;
991
1020
  }
992
1021
  }
993
- }), oe = rt({
1022
+ }), je = Gt({
994
1023
  name: "none",
995
1024
  initial: {},
996
1025
  idle: {
@@ -1023,677 +1052,830 @@ const se = rt({
1023
1052
  duration: 0
1024
1053
  }
1025
1054
  }
1026
- }), et = /* @__PURE__ */ new Map([
1027
- ["none", oe],
1028
- ["cupertino", se],
1029
- ["material", ae],
1030
- ["layout", re]
1031
- ]), ie = (() => {
1032
- const n = /* @__PURE__ */ Object.create(null), e = Object.prototype.hasOwnProperty;
1033
- for (const t of et.values()) {
1034
- const r = t.variants["IDLE-true"].value;
1035
- for (const s in r)
1036
- e.call(r, s) && (n[s] = r[s]);
1055
+ }), ht = /* @__PURE__ */ new Map([["none", je], ["cupertino", Be], ["material", Qe], ["layout", Fe]]), qe = (() => {
1056
+ const e = /* @__PURE__ */ Object.create(null), t = Object.prototype.hasOwnProperty;
1057
+ for (const n of ht.values()) {
1058
+ const s = n.variants["IDLE-true"].value;
1059
+ for (const r in s)
1060
+ t.call(s, r) && (e[r] = s[r]);
1037
1061
  }
1038
- return n;
1062
+ return e;
1039
1063
  })();
1040
- function ye({
1041
- children: n,
1042
- initPath: e = "/",
1043
- defaultTransitionName: t = "cupertino",
1044
- transitions: r = [],
1045
- decorators: s = []
1046
- }) {
1047
- const a = St() ? e || "/" : window.location.pathname, o = St() ? a.split("?")[1] || "" : window.location.search;
1048
- return ut.setState({
1049
- defaultTransitionName: t
1050
- }), j.setState({
1064
+ function Pn(e) {
1065
+ const t = j(17), {
1066
+ children: n,
1067
+ initPath: s,
1068
+ defaultTransitionName: r,
1069
+ transitions: c,
1070
+ decorators: i
1071
+ } = e, u = s === void 0 ? "/" : s, l = r === void 0 ? "cupertino" : r;
1072
+ let a;
1073
+ t[0] !== c ? (a = c === void 0 ? [] : c, t[0] = c, t[1] = a) : a = t[1];
1074
+ const d = a;
1075
+ let g;
1076
+ t[2] !== i ? (g = i === void 0 ? [] : i, t[2] = i, t[3] = g) : g = t[3];
1077
+ const o = g, p = ae() ? u || "/" : window.location.pathname, w = ae() ? p.split("?")[1] || "" : window.location.search;
1078
+ Ve().setState({
1079
+ defaultTransitionName: l
1080
+ }), ze().setState({
1051
1081
  index: 0,
1052
- histories: [
1053
- {
1054
- id: "root",
1055
- pathname: a,
1056
- params: Bt(
1057
- It.toArray(n).map((c) => c.props.path).flat(),
1058
- a,
1059
- o
1060
- ),
1061
- transitionName: t,
1062
- layoutId: null
1063
- }
1064
- ]
1065
- }), K(() => {
1066
- window.history.state?.index || window.history.replaceState(
1067
- {
1068
- id: "root",
1069
- index: 0,
1070
- status: "IDLE",
1071
- params: {},
1072
- transitionName: t,
1073
- layoutId: null
1074
- },
1075
- "",
1076
- window.location.pathname
1077
- );
1078
- }, [t]), K(() => {
1079
- r.forEach((c) => et.set(c.name, c));
1080
- }, [r]), K(() => {
1081
- s.forEach((c) => ht.set(c.name, c));
1082
- }, [s]), /* @__PURE__ */ ct(
1083
- "div",
1084
- {
1085
- style: {
1086
- position: "fixed",
1087
- top: 0,
1088
- left: 0,
1089
- width: "100%",
1090
- height: "100%"
1091
- },
1092
- children: [
1093
- /* @__PURE__ */ D(Wt, {}),
1094
- /* @__PURE__ */ D(te, { children: n })
1095
- ]
1096
- }
1097
- );
1082
+ histories: [{
1083
+ id: "root",
1084
+ pathname: p,
1085
+ params: Le(le.toArray(n).map(Ke).flat(), p, w),
1086
+ transitionName: l,
1087
+ layoutId: null
1088
+ }]
1089
+ });
1090
+ let E, T;
1091
+ t[4] !== l ? (E = () => {
1092
+ window.history.state?.index || window.history.replaceState({
1093
+ id: "root",
1094
+ index: 0,
1095
+ status: "IDLE",
1096
+ params: {},
1097
+ transitionName: l,
1098
+ layoutId: null
1099
+ }, "", window.location.pathname);
1100
+ }, T = [l], t[4] = l, t[5] = E, t[6] = T) : (E = t[5], T = t[6]), J(E, T);
1101
+ let L, M;
1102
+ t[7] !== d ? (M = () => {
1103
+ d.forEach(Xe);
1104
+ }, L = [d], t[7] = d, t[8] = L, t[9] = M) : (L = t[8], M = t[9]), J(M, L);
1105
+ let D, C;
1106
+ t[10] !== o ? (D = () => {
1107
+ o.forEach(Ye);
1108
+ }, C = [o], t[10] = o, t[11] = D, t[12] = C) : (D = t[11], C = t[12]), J(D, C);
1109
+ let R, b;
1110
+ t[13] === Symbol.for("react.memo_cache_sentinel") ? (R = {
1111
+ position: "fixed",
1112
+ top: 0,
1113
+ left: 0,
1114
+ width: "100%",
1115
+ height: "100%"
1116
+ }, b = /* @__PURE__ */ x(Ce, {}), t[13] = R, t[14] = b) : (R = t[13], b = t[14]);
1117
+ let f;
1118
+ return t[15] !== n ? (f = /* @__PURE__ */ Xt("div", { style: R, children: [
1119
+ b,
1120
+ /* @__PURE__ */ x(_e, { children: n })
1121
+ ] }), t[15] = n, t[16] = f) : f = t[16], f;
1098
1122
  }
1099
- function ge({ element: n }) {
1100
- return n;
1123
+ function Ye(e) {
1124
+ return Zt.set(e.name, e);
1101
1125
  }
1102
- function me() {
1126
+ function Xe(e) {
1127
+ return ht.set(e.name, e);
1128
+ }
1129
+ function Ke(e) {
1130
+ return e.props.path;
1131
+ }
1132
+ function Ve() {
1133
+ return Kt;
1134
+ }
1135
+ function ze() {
1136
+ return X;
1137
+ }
1138
+ function Tn({
1139
+ element: e
1140
+ }) {
1141
+ return e;
1142
+ }
1143
+ function vn() {
1103
1144
  return {
1104
- push: async (r, s, a = {}) => {
1105
- const { status: o, setStatus: c } = F.getState();
1106
- if (o !== "COMPLETED" && o !== "IDLE")
1145
+ push: async (s, r, c = {}) => {
1146
+ const {
1147
+ status: i,
1148
+ setStatus: u
1149
+ } = Q.getState();
1150
+ if (i !== "COMPLETED" && i !== "IDLE")
1107
1151
  return;
1108
- const { index: h, addHistory: l } = j.getState(), m = ut.getState().defaultTransitionName, { transitionName: d = m, layoutId: u = null } = a, P = Q.generateTaskId();
1109
- (await Q.addTask(
1110
- async () => {
1111
- c("PUSHING");
1112
- const I = X.compile(r)(s), N = X.parse(r).tokens.filter((b) => b.type === "param").map((b) => b.name), w = Object.fromEntries(
1113
- Object.entries(s).filter(([b]) => !N.includes(b))
1114
- ), k = new URLSearchParams(w).toString(), U = `${I}${k ? `?${k}` : ""}`;
1115
- return window.history.pushState(
1116
- {
1117
- id: P,
1118
- index: h + 1,
1119
- status: "PUSHING",
1120
- params: s,
1121
- transitionName: d,
1122
- layoutId: u
1123
- },
1124
- "",
1125
- U
1126
- ), l({
1127
- id: P,
1128
- pathname: I,
1129
- params: s,
1130
- transitionName: d,
1131
- layoutId: u
1132
- }), () => {
1133
- c("COMPLETED");
1134
- };
1135
- },
1136
- {
1137
- id: P,
1138
- control: {
1139
- manual: !0
1140
- }
1152
+ const {
1153
+ index: l,
1154
+ addHistory: a
1155
+ } = X.getState(), d = Kt.getState().defaultTransitionName, {
1156
+ transitionName: g = d,
1157
+ layoutId: o = null
1158
+ } = c, p = Y.generateTaskId();
1159
+ (await Y.addTask(async () => {
1160
+ u("PUSHING");
1161
+ const w = W.compile(s)(r), E = W.parse(s).tokens.filter((D) => D.type === "param").map((D) => D.name), T = Object.fromEntries(Object.entries(r).filter(([D]) => !E.includes(D))), L = new URLSearchParams(T).toString(), M = `${w}${L ? `?${L}` : ""}`;
1162
+ return window.history.pushState({
1163
+ id: p,
1164
+ index: l + 1,
1165
+ status: "PUSHING",
1166
+ params: r,
1167
+ transitionName: g,
1168
+ layoutId: o
1169
+ }, "", M), a({
1170
+ id: p,
1171
+ pathname: w,
1172
+ params: r,
1173
+ transitionName: g,
1174
+ layoutId: o
1175
+ }), () => {
1176
+ u("COMPLETED");
1177
+ };
1178
+ }, {
1179
+ id: p,
1180
+ control: {
1181
+ manual: !0
1141
1182
  }
1142
- )).result?.();
1183
+ })).result?.();
1143
1184
  },
1144
- replace: async (r, s, a = {}) => {
1145
- const { status: o, setStatus: c } = F.getState();
1146
- if (o !== "COMPLETED" && o !== "IDLE")
1185
+ replace: async (s, r, c = {}) => {
1186
+ const {
1187
+ status: i,
1188
+ setStatus: u
1189
+ } = Q.getState();
1190
+ if (i !== "COMPLETED" && i !== "IDLE")
1147
1191
  return;
1148
- const { index: h, addHistory: l } = j.getState(), m = j.getState().replaceHistory, d = ut.getState().defaultTransitionName, { transitionName: u = d, layoutId: P = null } = a, I = Q.generateTaskId();
1149
- (await Q.addTask(
1150
- async () => {
1151
- c("REPLACING");
1152
- const N = X.compile(r)(s), w = X.parse(r).tokens.filter(($) => $.type === "param").map(($) => $.name), k = Object.fromEntries(
1153
- Object.entries(s).filter(([$]) => !w.includes($))
1154
- ), U = new URLSearchParams(k).toString(), b = `${N}${U ? `?${U}` : ""}`;
1155
- return window.history.replaceState(
1156
- {
1157
- id: I,
1158
- index: h,
1159
- status: "REPLACING",
1160
- params: s,
1161
- transitionName: u,
1162
- layoutId: P
1163
- },
1164
- "",
1165
- b
1166
- ), l({
1167
- id: I,
1168
- pathname: N,
1169
- params: s,
1170
- transitionName: u,
1171
- layoutId: P
1172
- }), async () => {
1173
- m(h), c("COMPLETED");
1174
- };
1175
- },
1176
- {
1177
- id: I,
1178
- control: {
1179
- manual: !0
1180
- }
1192
+ const {
1193
+ index: l,
1194
+ addHistory: a
1195
+ } = X.getState(), d = X.getState().replaceHistory, g = Kt.getState().defaultTransitionName, {
1196
+ transitionName: o = g,
1197
+ layoutId: p = null
1198
+ } = c, w = Y.generateTaskId();
1199
+ (await Y.addTask(async () => {
1200
+ u("REPLACING");
1201
+ const E = W.compile(s)(r), T = W.parse(s).tokens.filter((C) => C.type === "param").map((C) => C.name), L = Object.fromEntries(Object.entries(r).filter(([C]) => !T.includes(C))), M = new URLSearchParams(L).toString(), D = `${E}${M ? `?${M}` : ""}`;
1202
+ return window.history.replaceState({
1203
+ id: w,
1204
+ index: l,
1205
+ status: "REPLACING",
1206
+ params: r,
1207
+ transitionName: o,
1208
+ layoutId: p
1209
+ }, "", D), a({
1210
+ id: w,
1211
+ pathname: E,
1212
+ params: r,
1213
+ transitionName: o,
1214
+ layoutId: p
1215
+ }), async () => {
1216
+ d(l), u("COMPLETED");
1217
+ };
1218
+ }, {
1219
+ id: w,
1220
+ control: {
1221
+ manual: !0
1181
1222
  }
1182
- )).result?.();
1183
- },
1184
- pop: () => {
1185
- const r = F.getState().status;
1186
- r !== "COMPLETED" && r !== "IDLE" || window.history.back();
1187
- }
1188
- };
1189
- }
1190
- function Ee() {
1191
- const n = pt(Nt);
1192
- return {
1193
- pushStep: async (s) => {
1194
- const a = F.getState().status;
1195
- a !== "COMPLETED" && a !== "IDLE" || (await Q.addTask(async () => {
1196
- const o = new URLSearchParams(s).toString(), c = `${window.location.pathname}${o ? `?${o}` : ""}`;
1197
- return window.history.state?.step || window.history.replaceState(
1198
- {
1199
- ...window.history.state,
1200
- step: !0
1201
- },
1202
- "",
1203
- window.location.pathname
1204
- ), window.history.pushState(
1205
- {
1206
- ...window.history.state,
1207
- step: !0,
1208
- params: s
1209
- },
1210
- "",
1211
- c
1212
- ), async () => n({ type: "SET", params: s });
1213
1223
  })).result?.();
1214
1224
  },
1215
- replaceStep: async (s) => {
1216
- const a = F.getState().status;
1217
- a !== "COMPLETED" && a !== "IDLE" || (await Q.addTask(async () => {
1218
- const o = new URLSearchParams(s).toString(), c = `${window.location.pathname}${o ? `?${o}` : ""}`;
1219
- return window.history.replaceState(
1220
- {
1221
- ...window.history.state,
1222
- step: !0,
1223
- params: s
1224
- },
1225
- "",
1226
- c
1227
- ), async () => n({ type: "SET", params: s });
1228
- })).result?.();
1229
- },
1230
- popStep: () => {
1231
- const s = F.getState().status;
1225
+ pop: () => {
1226
+ const s = Q.getState().status;
1232
1227
  s !== "COMPLETED" && s !== "IDLE" || window.history.back();
1233
1228
  }
1234
1229
  };
1235
1230
  }
1236
- function we() {
1237
- return pt(xt);
1231
+ function Dn() {
1232
+ const e = j(7), t = Wt(pe);
1233
+ let n;
1234
+ e[0] !== t ? (n = async (l) => {
1235
+ const a = Q.getState().status;
1236
+ a !== "COMPLETED" && a !== "IDLE" || (await Y.addTask(async () => {
1237
+ const d = new URLSearchParams(l).toString(), g = `${window.location.pathname}${d ? `?${d}` : ""}`;
1238
+ return window.history.state?.step || window.history.replaceState({
1239
+ ...window.history.state,
1240
+ step: !0
1241
+ }, "", window.location.pathname), window.history.pushState({
1242
+ ...window.history.state,
1243
+ step: !0,
1244
+ params: l
1245
+ }, "", g), async () => t({
1246
+ type: "SET",
1247
+ params: l
1248
+ });
1249
+ })).result?.();
1250
+ }, e[0] = t, e[1] = n) : n = e[1];
1251
+ const s = n;
1252
+ let r;
1253
+ e[2] !== t ? (r = async (l) => {
1254
+ const a = Q.getState().status;
1255
+ a !== "COMPLETED" && a !== "IDLE" || (await Y.addTask(async () => {
1256
+ const d = new URLSearchParams(l).toString(), g = `${window.location.pathname}${d ? `?${d}` : ""}`;
1257
+ return window.history.replaceState({
1258
+ ...window.history.state,
1259
+ step: !0,
1260
+ params: l
1261
+ }, "", g), async () => t({
1262
+ type: "SET",
1263
+ params: l
1264
+ });
1265
+ })).result?.();
1266
+ }, e[2] = t, e[3] = r) : r = e[3];
1267
+ const c = r, i = We;
1268
+ let u;
1269
+ return e[4] !== s || e[5] !== c ? (u = {
1270
+ pushStep: s,
1271
+ replaceStep: c,
1272
+ popStep: i
1273
+ }, e[4] = s, e[5] = c, e[6] = u) : u = e[6], u;
1238
1274
  }
1239
- function Se({
1240
- name: n,
1241
- initial: e,
1242
- idle: t,
1243
- pushOnEnter: r,
1244
- pushOnExit: s,
1245
- replaceOnEnter: a,
1246
- replaceOnExit: o,
1247
- popOnEnter: c,
1248
- popOnExit: h,
1249
- completedOnExit: l,
1250
- completedOnEnter: m,
1251
- options: d
1275
+ function We() {
1276
+ const e = Q.getState().status;
1277
+ e !== "COMPLETED" && e !== "IDLE" || window.history.back();
1278
+ }
1279
+ function In() {
1280
+ return Wt(de);
1281
+ }
1282
+ function Ln({
1283
+ name: e,
1284
+ initial: t,
1285
+ idle: n,
1286
+ pushOnEnter: s,
1287
+ pushOnExit: r,
1288
+ replaceOnEnter: c,
1289
+ replaceOnExit: i,
1290
+ popOnEnter: u,
1291
+ popOnExit: l,
1292
+ completedOnExit: a,
1293
+ completedOnEnter: d,
1294
+ options: g
1252
1295
  }) {
1253
1296
  return {
1254
- name: n,
1255
- initial: e,
1297
+ name: e,
1298
+ initial: t,
1256
1299
  variants: {
1257
- "IDLE-true": t,
1258
- "IDLE-false": t,
1259
- "PUSHING-false": s,
1260
- "PUSHING-true": r,
1261
- "REPLACING-false": o,
1262
- "REPLACING-true": a,
1263
- "POPPING-false": h,
1264
- "POPPING-true": c,
1265
- "COMPLETED-false": l,
1266
- "COMPLETED-true": m
1300
+ "IDLE-true": n,
1301
+ "IDLE-false": n,
1302
+ "PUSHING-false": r,
1303
+ "PUSHING-true": s,
1304
+ "REPLACING-false": i,
1305
+ "REPLACING-true": c,
1306
+ "POPPING-false": l,
1307
+ "POPPING-true": u,
1308
+ "COMPLETED-false": a,
1309
+ "COMPLETED-true": d
1267
1310
  },
1268
- ...d
1311
+ ...g
1269
1312
  };
1270
1313
  }
1271
- function Pe({
1272
- name: n,
1273
- initial: e,
1274
- idle: t,
1275
- pushOnEnter: r,
1276
- pushOnExit: s,
1277
- replaceOnEnter: a,
1278
- replaceOnExit: o,
1279
- popOnEnter: c,
1280
- popOnExit: h,
1281
- completedOnEnter: l,
1282
- completedOnExit: m,
1283
- options: d
1314
+ function Nn({
1315
+ name: e,
1316
+ initial: t,
1317
+ idle: n,
1318
+ pushOnEnter: s,
1319
+ pushOnExit: r,
1320
+ replaceOnEnter: c,
1321
+ replaceOnExit: i,
1322
+ popOnEnter: u,
1323
+ popOnExit: l,
1324
+ completedOnEnter: a,
1325
+ completedOnExit: d,
1326
+ options: g
1284
1327
  }) {
1285
1328
  return {
1286
- name: n,
1287
- initial: e,
1329
+ name: e,
1330
+ initial: t,
1288
1331
  variants: {
1289
- "IDLE-true": t,
1290
- "IDLE-false": t,
1291
- "PUSHING-false": s,
1292
- "PUSHING-true": r,
1293
- "REPLACING-false": o,
1294
- "REPLACING-true": a,
1295
- "POPPING-false": h,
1296
- "POPPING-true": c,
1297
- "COMPLETED-false": m,
1298
- "COMPLETED-true": l
1332
+ "IDLE-true": n,
1333
+ "IDLE-false": n,
1334
+ "PUSHING-false": r,
1335
+ "PUSHING-true": s,
1336
+ "REPLACING-false": i,
1337
+ "REPLACING-true": c,
1338
+ "POPPING-false": l,
1339
+ "POPPING-true": u,
1340
+ "COMPLETED-false": d,
1341
+ "COMPLETED-true": a
1299
1342
  },
1300
- ...d
1343
+ ...g
1301
1344
  };
1302
1345
  }
1303
- const ce = { then() {
1304
- } };
1305
- function ue({
1306
- freeze: n,
1307
- children: e
1346
+ const Je = {
1347
+ then() {
1348
+ }
1349
+ };
1350
+ function Ze({
1351
+ freeze: e,
1352
+ children: t
1308
1353
  }) {
1309
- if (n)
1310
- throw ce;
1311
- return e;
1354
+ if (e)
1355
+ throw Je;
1356
+ return t;
1312
1357
  }
1313
- function Mt({ freeze: n, children: e, placeholder: t }) {
1314
- return /* @__PURE__ */ D(_t, { fallback: t, children: /* @__PURE__ */ D(ue, { freeze: n, children: e }) });
1358
+ function me(e) {
1359
+ const t = j(6), {
1360
+ freeze: n,
1361
+ children: s,
1362
+ placeholder: r
1363
+ } = e;
1364
+ let c;
1365
+ t[0] !== s || t[1] !== n ? (c = /* @__PURE__ */ x(Ze, { freeze: n, children: s }), t[0] = s, t[1] = n, t[2] = c) : c = t[2];
1366
+ let i;
1367
+ return t[3] !== r || t[4] !== c ? (i = /* @__PURE__ */ x(Ee, { fallback: r, children: c }), t[3] = r, t[4] = c, t[5] = i) : i = t[5], i;
1315
1368
  }
1316
- function vt(n, e) {
1369
+ function ce(e, t) {
1317
1370
  const {
1318
- direction: t = "x",
1319
- markerSelector: r = "[data-swipe-at-edge]",
1320
- depthLimit: s = 24,
1321
- verifyByScroll: a = !1
1322
- } = e ?? {}, o = le(n);
1323
- if (!o) return { element: null, hasMarker: !1 };
1324
- const c = o.closest?.(r);
1325
- if (c instanceof HTMLElement && lt(c, t) && (!a || Dt(c, t)))
1326
- return { element: c, hasMarker: !0 };
1327
- let h = o, l = 0;
1328
- for (; h && h !== document.body && l < s; ) {
1329
- if (lt(h, t) && (!a || Dt(h, t)))
1330
- return { element: h, hasMarker: !1 };
1331
- h = h.parentElement, l++;
1371
+ direction: n = "x",
1372
+ markerSelector: s = "[data-swipe-at-edge]",
1373
+ depthLimit: r = 24,
1374
+ verifyByScroll: c = !1
1375
+ } = t ?? {}, i = tn(e);
1376
+ if (!i) return {
1377
+ element: null,
1378
+ hasMarker: !1
1379
+ };
1380
+ const u = i.closest?.(s);
1381
+ if (u instanceof HTMLElement && Vt(u, n) && (!c || ue(u, n)))
1382
+ return {
1383
+ element: u,
1384
+ hasMarker: !0
1385
+ };
1386
+ let l = i, a = 0;
1387
+ for (; l && l !== document.body && a < r; ) {
1388
+ if (Vt(l, n) && (!c || ue(l, n)))
1389
+ return {
1390
+ element: l,
1391
+ hasMarker: !1
1392
+ };
1393
+ l = l.parentElement, a++;
1332
1394
  }
1333
- return { element: null, hasMarker: !1 };
1395
+ return {
1396
+ element: null,
1397
+ hasMarker: !1
1398
+ };
1334
1399
  }
1335
- function le(n) {
1336
- if (!n) return null;
1337
- const e = n, t = typeof e.composedPath == "function" ? e.composedPath() : void 0;
1338
- if (t && t.length) {
1339
- for (const r of t)
1340
- if (r instanceof HTMLElement) return r;
1400
+ function tn(e) {
1401
+ if (!e) return null;
1402
+ const t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
1403
+ if (n && n.length) {
1404
+ for (const s of n)
1405
+ if (s instanceof HTMLElement) return s;
1341
1406
  }
1342
- return n;
1407
+ return e;
1343
1408
  }
1344
- function lt(n, e) {
1345
- return e === "y" ? n.scrollHeight - n.clientHeight > 1 : n.scrollWidth - n.clientWidth > 1;
1409
+ function Vt(e, t) {
1410
+ return t === "y" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
1346
1411
  }
1347
- function Dt(n, e) {
1348
- if (!lt(n, e)) return !1;
1349
- if (e === "y") {
1350
- const t = n.scrollTop;
1351
- if (n.scrollTop = t + 1, n.scrollTop !== t)
1352
- return n.scrollTop = t, !0;
1353
- n.scrollTop = t - 1;
1354
- const s = n.scrollTop !== t;
1355
- return n.scrollTop = t, s;
1412
+ function ue(e, t) {
1413
+ if (!Vt(e, t)) return !1;
1414
+ if (t === "y") {
1415
+ const n = e.scrollTop;
1416
+ if (e.scrollTop = n + 1, e.scrollTop !== n)
1417
+ return e.scrollTop = n, !0;
1418
+ e.scrollTop = n - 1;
1419
+ const r = e.scrollTop !== n;
1420
+ return e.scrollTop = n, r;
1356
1421
  } else {
1357
- const t = n.scrollLeft;
1358
- if (n.scrollLeft = t + 1, n.scrollLeft !== t)
1359
- return n.scrollLeft = t, !0;
1360
- n.scrollLeft = t - 1;
1361
- const s = n.scrollLeft !== t;
1362
- return n.scrollLeft = t, s;
1422
+ const n = e.scrollLeft;
1423
+ if (e.scrollLeft = n + 1, e.scrollLeft !== n)
1424
+ return e.scrollLeft = n, !0;
1425
+ e.scrollLeft = n - 1;
1426
+ const r = e.scrollLeft !== n;
1427
+ return e.scrollLeft = n, r;
1363
1428
  }
1364
1429
  }
1365
- function de({ children: n, ref: e, ...t }) {
1366
- const { isActive: r, transitionName: s } = Z(), [a, o] = Lt();
1367
- Ft(e, () => a.current);
1368
- const c = F((u) => u.status), h = et.get(s), { decoratorName: l } = h, { initial: m, variants: d } = ht.get(l);
1369
- return K(() => {
1370
- if (!a.current) return;
1371
- const { value: u, options: P } = d[`${c}-${r}`];
1372
- o(a.current, u, P);
1373
- }, [c, r, o, d, a]), /* @__PURE__ */ D(
1374
- z.div,
1375
- {
1376
- ref: a,
1377
- initial: m,
1378
- style: {
1379
- position: "absolute",
1380
- top: 0,
1381
- left: 0,
1382
- width: "100%",
1383
- height: "100%",
1384
- pointerEvents: "none",
1385
- ...t.style
1386
- },
1387
- "data-decorator": !0
1388
- }
1389
- );
1430
+ function en(e) {
1431
+ const t = j(20);
1432
+ let n, s;
1433
+ if (t[0] !== e) {
1434
+ const {
1435
+ children: L,
1436
+ ref: M,
1437
+ ...D
1438
+ } = e;
1439
+ s = M, n = D, t[0] = e, t[1] = n, t[2] = s;
1440
+ } else
1441
+ n = t[1], s = t[2];
1442
+ const {
1443
+ isActive: r,
1444
+ transitionName: c
1445
+ } = dt(), [i, u] = fe();
1446
+ let l;
1447
+ t[3] !== i ? (l = () => i.current, t[3] = i, t[4] = l) : l = t[4], Pe(s, l);
1448
+ const a = Q(nn);
1449
+ let d;
1450
+ if (t[5] !== c) {
1451
+ const L = ht.get(c), {
1452
+ decoratorName: M
1453
+ } = L;
1454
+ d = Zt.get(M), t[5] = c, t[6] = d;
1455
+ } else
1456
+ d = t[6];
1457
+ const {
1458
+ initial: g,
1459
+ variants: o
1460
+ } = d;
1461
+ let p, w;
1462
+ t[7] !== u || t[8] !== r || t[9] !== i || t[10] !== a || t[11] !== o ? (p = () => {
1463
+ if (!i.current)
1464
+ return;
1465
+ const {
1466
+ value: L,
1467
+ options: M
1468
+ } = o[`${a}-${r}`];
1469
+ u(i.current, L, M);
1470
+ }, w = [a, r, u, o, i], t[7] = u, t[8] = r, t[9] = i, t[10] = a, t[11] = o, t[12] = p, t[13] = w) : (p = t[12], w = t[13]), J(p, w);
1471
+ let E;
1472
+ t[14] !== n.style ? (E = {
1473
+ position: "absolute",
1474
+ top: 0,
1475
+ left: 0,
1476
+ width: "100%",
1477
+ height: "100%",
1478
+ pointerEvents: "none",
1479
+ ...n.style
1480
+ }, t[14] = n.style, t[15] = E) : E = t[15];
1481
+ let T;
1482
+ return t[16] !== g || t[17] !== i || t[18] !== E ? (T = /* @__PURE__ */ x(Z.div, { ref: i, initial: g, style: E, "data-decorator": !0 }), t[16] = g, t[17] = i, t[18] = E, t[19] = T) : T = t[19], T;
1390
1483
  }
1391
- const W = st((n) => ({
1484
+ function nn(e) {
1485
+ return e.status;
1486
+ }
1487
+ const tt = Ot((e) => ({
1392
1488
  dragStatus: "IDLE",
1393
1489
  replaceTransitionStatus: "IDLE",
1394
- setDragStatus: (e) => n({ dragStatus: e }),
1395
- setReplaceTransitionStatus: (e) => n({ replaceTransitionStatus: e })
1490
+ setDragStatus: (t) => e({
1491
+ dragStatus: t
1492
+ }),
1493
+ setReplaceTransitionStatus: (t) => e({
1494
+ replaceTransitionStatus: t
1495
+ })
1396
1496
  }));
1397
- function Ct({
1398
- children: n,
1399
- statusBarHeight: e,
1400
- statusBarColor: t = "transparent",
1401
- systemNavigationBarHeight: r,
1402
- systemNavigationBarColor: s = "transparent",
1403
- appBar: a,
1404
- navigationBar: o,
1405
- hideStatusBar: c,
1406
- hideSystemNavigationBar: h,
1407
- ...l
1408
- }) {
1409
- const [m, d] = Lt(), { id: u, isActive: P, isRoot: I, transitionName: N, prevTransitionName: w } = Z(), k = Qt(), U = F((v) => v.status), b = W((v) => v.dragStatus), $ = W.getState().setDragStatus, tt = W.getState().setReplaceTransitionStatus, J = et.get(N), { variants: i, initial: y, swipeDirection: g, decoratorName: E } = J, p = ht.get(E), [f, L] = mt(0), [T, R] = mt(0), S = H(null), M = H(null), x = H(null), C = H(null), A = H(!1), V = H(!1), q = H({
1497
+ function ye(e) {
1498
+ const t = j(128);
1499
+ let n, s, r, c, i, u, l, a, d, g;
1500
+ t[0] !== e ? ({
1501
+ children: s,
1502
+ statusBarHeight: a,
1503
+ statusBarColor: l,
1504
+ systemNavigationBarHeight: g,
1505
+ systemNavigationBarColor: d,
1506
+ appBar: n,
1507
+ navigationBar: i,
1508
+ hideStatusBar: r,
1509
+ hideSystemNavigationBar: c,
1510
+ ...u
1511
+ } = e, t[0] = e, t[1] = n, t[2] = s, t[3] = r, t[4] = c, t[5] = i, t[6] = u, t[7] = l, t[8] = a, t[9] = d, t[10] = g) : (n = t[1], s = t[2], r = t[3], c = t[4], i = t[5], u = t[6], l = t[7], a = t[8], d = t[9], g = t[10]);
1512
+ const [o, p] = fe(), {
1513
+ id: w,
1514
+ isActive: E,
1515
+ isRoot: T,
1516
+ transitionName: L,
1517
+ prevTransitionName: M
1518
+ } = dt(), D = Te(), C = Q(on), R = tt(an), b = tt(rn), f = tt(sn);
1519
+ let m, P, h, S, y;
1520
+ if (t[11] !== L) {
1521
+ m = ht.get(L);
1522
+ const {
1523
+ variants: k,
1524
+ initial: O,
1525
+ swipeDirection: G,
1526
+ decoratorName: q
1527
+ } = m;
1528
+ y = k, P = O, h = G, S = Zt.get(q), t[11] = L, t[12] = m, t[13] = P, t[14] = h, t[15] = S, t[16] = y;
1529
+ } else
1530
+ m = t[12], P = t[13], h = t[14], S = t[15], y = t[16];
1531
+ const v = S, [N, H] = ne(0), [I, _] = ne(0), $ = B(null), A = B(null), U = B(null), et = B(null), K = B(!1), pt = B(!1);
1532
+ let mt;
1533
+ t[17] === Symbol.for("react.memo_cache_sentinel") ? (mt = {
1410
1534
  element: null,
1411
1535
  hasMarker: !1
1412
- }), Y = H({ element: null, hasMarker: !1 }), yt = H(0), gt = H(0), at = H(null), ot = H(null), At = async (v, O) => {
1413
- if (!g)
1536
+ }, t[17] = mt) : mt = t[17];
1537
+ const V = B(mt);
1538
+ let yt;
1539
+ t[18] === Symbol.for("react.memo_cache_sentinel") ? (yt = {
1540
+ element: null,
1541
+ hasMarker: !1
1542
+ }, t[18] = yt) : yt = t[18];
1543
+ const z = B(yt), te = B(0), ee = B(0), Ht = B(null), Ut = B(null);
1544
+ let gt;
1545
+ t[19] !== p || t[20] !== m || t[21] !== v || t[22] !== D || t[23] !== o || t[24] !== b || t[25] !== h ? (gt = async (k, O) => {
1546
+ if (!h)
1414
1547
  return;
1415
- const G = S.current?.previousSibling;
1416
- M.current = G?.querySelector("[data-screen]"), C.current = G?.querySelector("[data-decorator]");
1417
- const B = await J?.onSwipeStart(v, O, {
1418
- animate: d,
1419
- currentScreen: m.current,
1420
- prevScreen: M.current,
1421
- dragControls: k,
1422
- onStart: (it) => p?.onSwipeStart?.(it, {
1423
- animate: d,
1424
- currentDecorator: x.current,
1425
- prevDecorator: C.current
1548
+ const G = $.current?.previousSibling;
1549
+ A.current = G?.querySelector("[data-screen]"), et.current = G?.querySelector("[data-decorator]");
1550
+ const q = await m?.onSwipeStart(k, O, {
1551
+ animate: p,
1552
+ currentScreen: o.current,
1553
+ prevScreen: A.current,
1554
+ dragControls: D,
1555
+ onStart: (Yt) => v?.onSwipeStart?.(Yt, {
1556
+ animate: p,
1557
+ currentDecorator: U.current,
1558
+ prevDecorator: et.current
1426
1559
  })
1427
1560
  });
1428
- $(B ? "PENDING" : "IDLE");
1429
- }, Rt = (v, O) => {
1430
- !g || b !== "PENDING" || J?.onSwipe(v, O, {
1431
- animate: d,
1432
- currentScreen: m.current,
1433
- prevScreen: M.current,
1434
- dragControls: k,
1435
- onProgress: (G, B) => p?.onSwipe?.(G, B, {
1436
- animate: d,
1437
- currentDecorator: x.current,
1438
- prevDecorator: C.current
1561
+ b(q ? "PENDING" : "IDLE");
1562
+ }, t[19] = p, t[20] = m, t[21] = v, t[22] = D, t[23] = o, t[24] = b, t[25] = h, t[26] = gt) : gt = t[26];
1563
+ const Bt = gt;
1564
+ let St;
1565
+ t[27] !== p || t[28] !== m || t[29] !== v || t[30] !== D || t[31] !== R || t[32] !== o || t[33] !== h ? (St = (k, O) => {
1566
+ !h || R !== "PENDING" || m?.onSwipe(k, O, {
1567
+ animate: p,
1568
+ currentScreen: o.current,
1569
+ prevScreen: A.current,
1570
+ dragControls: D,
1571
+ onProgress: (G, q) => v?.onSwipe?.(G, q, {
1572
+ animate: p,
1573
+ currentDecorator: U.current,
1574
+ prevDecorator: et.current
1439
1575
  })
1440
1576
  });
1441
- }, bt = async (v, O) => {
1442
- if (!g || b !== "PENDING")
1577
+ }, t[27] = p, t[28] = m, t[29] = v, t[30] = D, t[31] = R, t[32] = o, t[33] = h, t[34] = St) : St = t[34];
1578
+ const Ft = St;
1579
+ let wt;
1580
+ t[35] !== p || t[36] !== m || t[37] !== v || t[38] !== R || t[39] !== o || t[40] !== b || t[41] !== h ? (wt = async (k, O) => {
1581
+ if (!h || R !== "PENDING")
1443
1582
  return;
1444
- await J?.onSwipeEnd(v, O, {
1445
- animate: d,
1446
- currentScreen: m.current,
1447
- prevScreen: M.current,
1448
- onStart: (B) => p?.onSwipeEnd?.(B, {
1449
- animate: d,
1450
- currentDecorator: x.current,
1451
- prevDecorator: C.current
1583
+ await m?.onSwipeEnd(k, O, {
1584
+ animate: p,
1585
+ currentScreen: o.current,
1586
+ prevScreen: A.current,
1587
+ onStart: (q) => v?.onSwipeEnd?.(q, {
1588
+ animate: p,
1589
+ currentDecorator: U.current,
1590
+ prevDecorator: et.current
1452
1591
  })
1453
- }) ? window.history.back() : $("IDLE");
1454
- }, Ot = (v) => {
1455
- if (!(!I && P && U === "COMPLETED" && b === "IDLE" && !!g))
1592
+ }) ? window.history.back() : b("IDLE");
1593
+ }, t[35] = p, t[36] = m, t[37] = v, t[38] = R, t[39] = o, t[40] = b, t[41] = h, t[42] = wt) : wt = t[42];
1594
+ const Qt = wt;
1595
+ let Et;
1596
+ t[43] !== R || t[44] !== E || t[45] !== T || t[46] !== C || t[47] !== h ? (Et = (k) => {
1597
+ if (!(!T && E && C === "COMPLETED" && R === "IDLE" && !!h))
1456
1598
  return;
1457
- q.current = vt(v.target, {
1599
+ V.current = ce(k.target, {
1458
1600
  direction: "x",
1459
1601
  verifyByScroll: !0
1460
- }), Y.current = vt(v.target, {
1602
+ }), z.current = ce(k.target, {
1461
1603
  direction: "y",
1462
1604
  verifyByScroll: !0
1463
- }), yt.current = v.clientX, gt.current = v.clientY, (!q.current.element && !Y.current.element || q.current.element || Y.current.element) && (A.current = !0);
1464
- }, Gt = (v) => {
1465
- const O = !q.current.element && !Y.current.element;
1466
- if (A.current && O)
1467
- A.current = !1, V.current = !0, k.start(v);
1468
- else if (A.current && !O) {
1469
- const G = v.clientX - yt.current, B = v.clientY - gt.current, it = Y.current.element && Y.current.element.scrollTop <= 0 && Y.current.hasMarker, Ut = q.current.element && q.current.element.scrollLeft <= 0 && q.current.hasMarker;
1470
- (g === "y" && (it || q.current.element) && B > 0 && Math.abs(G) < 4 || g === "x" && (Ut || Y.current.element) && G > 0 && Math.abs(B) < 4) && (A.current = !1, V.current = !0, k.start(v));
1605
+ }), te.current = k.clientX, ee.current = k.clientY, (!V.current.element && !z.current.element || V.current.element || z.current.element) && (K.current = !0);
1606
+ }, t[43] = R, t[44] = E, t[45] = T, t[46] = C, t[47] = h, t[48] = Et) : Et = t[48];
1607
+ const jt = Et;
1608
+ let Pt;
1609
+ t[49] !== D || t[50] !== h ? (Pt = (k) => {
1610
+ const O = !V.current.element && !z.current.element;
1611
+ if (K.current && O)
1612
+ K.current = !1, pt.current = !0, D.start(k);
1613
+ else if (K.current && !O) {
1614
+ const G = k.clientX - te.current, q = k.clientY - ee.current, Yt = z.current.element && z.current.element.scrollTop <= 0 && z.current.hasMarker, Se = V.current.element && V.current.element.scrollLeft <= 0 && V.current.hasMarker;
1615
+ (h === "y" && (Yt || V.current.element) && q > 0 && Math.abs(G) < 4 || h === "x" && (Se || z.current.element) && G > 0 && Math.abs(q) < 4) && (K.current = !1, pt.current = !0, D.start(k));
1471
1616
  }
1472
- }, $t = () => {
1473
- A.current = !1, V.current = !1;
1474
- };
1475
- return K(() => {
1476
- const v = m.current;
1477
- if (!v) return;
1617
+ }, t[49] = D, t[50] = h, t[51] = Pt) : Pt = t[51];
1618
+ const qt = Pt;
1619
+ let Tt;
1620
+ t[52] === Symbol.for("react.memo_cache_sentinel") ? (Tt = () => {
1621
+ K.current = !1, pt.current = !1;
1622
+ }, t[52] = Tt) : Tt = t[52];
1623
+ const ge = Tt;
1624
+ let vt, Dt;
1625
+ t[53] !== o ? (vt = () => {
1626
+ const k = o.current;
1627
+ if (!k)
1628
+ return;
1478
1629
  const O = (G) => {
1479
- V.current && G.preventDefault(), G.target?.dataset.swipeAtEdgeBar === "true" && G.preventDefault();
1630
+ pt.current && G.preventDefault(), G.target?.dataset.swipeAtEdgeBar === "true" && G.preventDefault();
1480
1631
  };
1481
- return v.addEventListener("touchmove", O, {
1632
+ return k.addEventListener("touchmove", O, {
1482
1633
  passive: !1
1483
1634
  }), () => {
1484
- v.removeEventListener("touchmove", O);
1635
+ k.removeEventListener("touchmove", O);
1485
1636
  };
1486
- }, [m]), K(() => {
1487
- m.current && (async () => {
1488
- const { value: v, options: O } = i[`${U}-${P}`];
1489
- !P && U === "REPLACING" && w !== N && (tt("PENDING"), await d(m.current, ie, {
1637
+ }, Dt = [o], t[53] = o, t[54] = vt, t[55] = Dt) : (vt = t[54], Dt = t[55]), J(vt, Dt);
1638
+ let It, Lt;
1639
+ t[56] !== p || t[57] !== w || t[58] !== E || t[59] !== M || t[60] !== o || t[61] !== b || t[62] !== f || t[63] !== C || t[64] !== L || t[65] !== y ? (It = () => {
1640
+ o.current && (async () => {
1641
+ const {
1642
+ value: k,
1643
+ options: O
1644
+ } = y[`${C}-${E}`];
1645
+ !E && C === "REPLACING" && M !== L && (f("PENDING"), await p(o.current, qe, {
1490
1646
  duration: 0.1
1491
- })), P && U === "COMPLETED" && ($("IDLE"), tt("IDLE")), await d(m.current, v, O), await Q.resolveTask(u);
1647
+ })), E && C === "COMPLETED" && (b("IDLE"), f("IDLE")), await p(o.current, k, O), await Y.resolveTask(w);
1492
1648
  })();
1493
- }, [
1494
- U,
1495
- P,
1496
- u,
1497
- w,
1498
- N,
1499
- d,
1500
- m,
1501
- i,
1502
- $,
1503
- tt
1504
- ]), Et(() => {
1505
- at.current && L(at.current.offsetHeight);
1506
- }, [a]), Et(() => {
1507
- ot.current && R(ot.current.offsetHeight);
1508
- }, [o]), /* @__PURE__ */ ct(
1509
- z.div,
1510
- {
1511
- ref: S,
1512
- style: {
1513
- position: "absolute",
1514
- top: 0,
1515
- left: 0,
1516
- width: "100%",
1517
- height: "100%",
1518
- display: "flex",
1519
- flexDirection: "column",
1520
- boxSizing: "border-box",
1521
- isolation: "isolate",
1522
- contain: "strict",
1523
- overscrollBehavior: "contain"
1524
- },
1525
- children: [
1526
- /* @__PURE__ */ D(
1527
- "div",
1528
- {
1529
- "data-swipe-at-edge-bar": !0,
1530
- style: {
1531
- position: "absolute",
1532
- top: 0,
1533
- left: 0,
1534
- width: 8,
1535
- height: "100%",
1536
- zIndex: 1
1537
- }
1538
- }
1539
- ),
1540
- a && /* @__PURE__ */ D(
1541
- z.div,
1542
- {
1543
- ref: at,
1544
- style: {
1545
- position: "absolute",
1546
- top: c ? 0 : e,
1547
- left: 0,
1548
- width: "100%"
1549
- },
1550
- children: a
1551
- }
1552
- ),
1553
- /* @__PURE__ */ ct(
1554
- z.div,
1555
- {
1556
- ref: m,
1557
- ...l,
1558
- initial: y,
1559
- drag: g,
1560
- dragListener: !1,
1561
- dragControls: k,
1562
- onDragStart: At,
1563
- onDrag: Rt,
1564
- onDragEnd: bt,
1565
- onPointerDown: Ot,
1566
- onPointerMove: Gt,
1567
- onPointerUp: $t,
1568
- "data-screen": !0,
1569
- style: {
1570
- display: "flex",
1571
- flexDirection: "column",
1572
- height: "100%",
1573
- backgroundColor: "white",
1574
- touchAction: "none",
1575
- ...l.style
1576
- },
1577
- children: [
1578
- !c && e && /* @__PURE__ */ D(
1579
- z.div,
1580
- {
1581
- animate: {
1582
- backgroundColor: t
1583
- },
1584
- style: {
1585
- width: "100%",
1586
- minHeight: e
1587
- }
1588
- }
1589
- ),
1590
- a && /* @__PURE__ */ D(
1591
- "div",
1592
- {
1593
- style: {
1594
- width: "100%",
1595
- minHeight: f
1596
- }
1597
- }
1598
- ),
1599
- /* @__PURE__ */ D("div", { style: { display: "flex", flexDirection: "column", flexGrow: 1, overflowY: "auto" }, children: n }),
1600
- o && /* @__PURE__ */ D(
1601
- "div",
1602
- {
1603
- style: {
1604
- width: "100%",
1605
- minHeight: T
1606
- }
1607
- }
1608
- ),
1609
- !h && r && /* @__PURE__ */ D(
1610
- z.div,
1611
- {
1612
- animate: {
1613
- backgroundColor: s
1614
- },
1615
- style: {
1616
- width: "100%",
1617
- minHeight: r
1618
- }
1619
- }
1620
- )
1621
- ]
1622
- }
1623
- ),
1624
- o && /* @__PURE__ */ D(
1625
- z.div,
1626
- {
1627
- ref: ot,
1628
- style: {
1629
- position: "absolute",
1630
- bottom: h ? 0 : r,
1631
- left: 0,
1632
- width: "100%"
1633
- },
1634
- children: o
1635
- }
1636
- ),
1637
- p && /* @__PURE__ */ D(de, { ref: x }),
1638
- /* @__PURE__ */ D(
1639
- "div",
1640
- {
1641
- "data-swipe-at-edge-bar": !0,
1642
- style: {
1643
- position: "absolute",
1644
- top: 0,
1645
- right: 0,
1646
- width: 8,
1647
- height: "100%",
1648
- zIndex: 1
1649
- }
1650
- }
1651
- )
1652
- ]
1653
- }
1654
- );
1649
+ }, Lt = [C, E, w, M, L, p, o, y, b, f], t[56] = p, t[57] = w, t[58] = E, t[59] = M, t[60] = o, t[61] = b, t[62] = f, t[63] = C, t[64] = L, t[65] = y, t[66] = It, t[67] = Lt) : (It = t[66], Lt = t[67]), J(It, Lt);
1650
+ let Nt;
1651
+ t[68] === Symbol.for("react.memo_cache_sentinel") ? (Nt = () => {
1652
+ Ht.current && H(Ht.current.offsetHeight);
1653
+ }, t[68] = Nt) : Nt = t[68];
1654
+ let xt;
1655
+ t[69] !== n ? (xt = [n], t[69] = n, t[70] = xt) : xt = t[70], se(Nt, xt);
1656
+ let kt;
1657
+ t[71] === Symbol.for("react.memo_cache_sentinel") ? (kt = () => {
1658
+ Ut.current && _(Ut.current.offsetHeight);
1659
+ }, t[71] = kt) : kt = t[71];
1660
+ let Mt;
1661
+ t[72] !== i ? (Mt = [i], t[72] = i, t[73] = Mt) : Mt = t[73], se(kt, Mt);
1662
+ let Ct;
1663
+ t[74] === Symbol.for("react.memo_cache_sentinel") ? (Ct = {
1664
+ position: "absolute",
1665
+ top: 0,
1666
+ left: 0,
1667
+ width: "100%",
1668
+ height: "100%",
1669
+ display: "flex",
1670
+ flexDirection: "column",
1671
+ boxSizing: "border-box",
1672
+ isolation: "isolate",
1673
+ contain: "strict",
1674
+ overscrollBehavior: "contain"
1675
+ }, t[74] = Ct) : Ct = t[74];
1676
+ let $t;
1677
+ t[75] === Symbol.for("react.memo_cache_sentinel") ? ($t = /* @__PURE__ */ x("div", { "data-swipe-at-edge-bar": !0, style: {
1678
+ position: "absolute",
1679
+ top: 0,
1680
+ left: 0,
1681
+ width: 8,
1682
+ height: "100%",
1683
+ zIndex: 1
1684
+ } }), t[75] = $t) : $t = t[75];
1685
+ let nt;
1686
+ t[76] !== n || t[77] !== r || t[78] !== a ? (nt = n && /* @__PURE__ */ x(Z.div, { ref: Ht, style: {
1687
+ position: "absolute",
1688
+ top: r ? 0 : a,
1689
+ left: 0,
1690
+ width: "100%"
1691
+ }, children: n }), t[76] = n, t[77] = r, t[78] = a, t[79] = nt) : nt = t[79];
1692
+ let st;
1693
+ t[80] !== u.style ? (st = {
1694
+ display: "flex",
1695
+ flexDirection: "column",
1696
+ height: "100%",
1697
+ backgroundColor: "white",
1698
+ touchAction: "none",
1699
+ overflowY: "auto",
1700
+ ...u.style
1701
+ }, t[80] = u.style, t[81] = st) : st = t[81];
1702
+ let rt;
1703
+ t[82] !== r || t[83] !== l || t[84] !== a ? (rt = !r && a && /* @__PURE__ */ x(Z.div, { animate: {
1704
+ backgroundColor: l
1705
+ }, style: {
1706
+ width: "100%",
1707
+ minHeight: a
1708
+ } }), t[82] = r, t[83] = l, t[84] = a, t[85] = rt) : rt = t[85];
1709
+ let at;
1710
+ t[86] !== n || t[87] !== N ? (at = n && /* @__PURE__ */ x("div", { style: {
1711
+ width: "100%",
1712
+ minHeight: N
1713
+ } }), t[86] = n, t[87] = N, t[88] = at) : at = t[88];
1714
+ let bt;
1715
+ t[89] === Symbol.for("react.memo_cache_sentinel") ? (bt = {
1716
+ display: "flex",
1717
+ flexDirection: "column",
1718
+ flexGrow: 1
1719
+ }, t[89] = bt) : bt = t[89];
1720
+ let it;
1721
+ t[90] !== s ? (it = /* @__PURE__ */ x("div", { style: bt, children: s }), t[90] = s, t[91] = it) : it = t[91];
1722
+ let ot;
1723
+ t[92] !== i || t[93] !== I ? (ot = i && /* @__PURE__ */ x("div", { style: {
1724
+ width: "100%",
1725
+ minHeight: I
1726
+ } }), t[92] = i, t[93] = I, t[94] = ot) : ot = t[94];
1727
+ let ct;
1728
+ t[95] !== c || t[96] !== d || t[97] !== g ? (ct = !c && g && /* @__PURE__ */ x(Z.div, { animate: {
1729
+ backgroundColor: d
1730
+ }, style: {
1731
+ width: "100%",
1732
+ minHeight: g
1733
+ } }), t[95] = c, t[96] = d, t[97] = g, t[98] = ct) : ct = t[98];
1734
+ let ut;
1735
+ t[99] !== D || t[100] !== Ft || t[101] !== Qt || t[102] !== Bt || t[103] !== jt || t[104] !== qt || t[105] !== P || t[106] !== u || t[107] !== o || t[108] !== h || t[109] !== st || t[110] !== rt || t[111] !== at || t[112] !== it || t[113] !== ot || t[114] !== ct ? (ut = /* @__PURE__ */ Xt(Z.div, { ref: o, ...u, initial: P, drag: h, dragListener: !1, dragControls: D, onDragStart: Bt, onDrag: Ft, onDragEnd: Qt, onPointerDown: jt, onPointerMove: qt, onPointerUp: ge, "data-screen": !0, style: st, children: [
1736
+ rt,
1737
+ at,
1738
+ it,
1739
+ ot,
1740
+ ct
1741
+ ] }), t[99] = D, t[100] = Ft, t[101] = Qt, t[102] = Bt, t[103] = jt, t[104] = qt, t[105] = P, t[106] = u, t[107] = o, t[108] = h, t[109] = st, t[110] = rt, t[111] = at, t[112] = it, t[113] = ot, t[114] = ct, t[115] = ut) : ut = t[115];
1742
+ let lt;
1743
+ t[116] !== c || t[117] !== i || t[118] !== g ? (lt = i && /* @__PURE__ */ x(Z.div, { ref: Ut, style: {
1744
+ position: "absolute",
1745
+ bottom: c ? 0 : g,
1746
+ left: 0,
1747
+ width: "100%"
1748
+ }, children: i }), t[116] = c, t[117] = i, t[118] = g, t[119] = lt) : lt = t[119];
1749
+ let ft;
1750
+ t[120] !== v ? (ft = v && /* @__PURE__ */ x(en, { ref: U }), t[120] = v, t[121] = ft) : ft = t[121];
1751
+ let At;
1752
+ t[122] === Symbol.for("react.memo_cache_sentinel") ? (At = /* @__PURE__ */ x("div", { "data-swipe-at-edge-bar": !0, style: {
1753
+ position: "absolute",
1754
+ top: 0,
1755
+ right: 0,
1756
+ width: 8,
1757
+ height: "100%",
1758
+ zIndex: 1
1759
+ } }), t[122] = At) : At = t[122];
1760
+ let Rt;
1761
+ return t[123] !== nt || t[124] !== ut || t[125] !== lt || t[126] !== ft ? (Rt = /* @__PURE__ */ Xt(Z.div, { ref: $, style: Ct, children: [
1762
+ $t,
1763
+ nt,
1764
+ ut,
1765
+ lt,
1766
+ ft,
1767
+ At
1768
+ ] }), t[123] = nt, t[124] = ut, t[125] = lt, t[126] = ft, t[127] = Rt) : Rt = t[127], Rt;
1655
1769
  }
1656
- function Te({ children: n, ...e }) {
1657
- const { isActive: t, isPrev: r, zIndex: s } = Z(), a = j((d) => d.index), o = F((d) => d.status), c = W((d) => d.dragStatus), h = W((d) => d.replaceTransitionStatus), m = !t && (o === "COMPLETED" && c === "IDLE") || r && a - 2 <= s && h === "IDLE" || r && a - 2 > s;
1658
- return /* @__PURE__ */ D(Mt, { freeze: m, children: /* @__PURE__ */ D(Ct, { ...e, children: n }) });
1770
+ function sn(e) {
1771
+ return e.setReplaceTransitionStatus;
1659
1772
  }
1660
- function ve({ children: n, ...e }) {
1661
- const { isActive: t, isPrev: r, zIndex: s } = Z(), a = j((d) => d.index), o = F((d) => d.status), c = W((d) => d.dragStatus), h = W((d) => d.replaceTransitionStatus), m = !t && (o === "COMPLETED" && c === "IDLE") || r && a - 2 <= s && h === "IDLE" || r && a - 2 > s;
1662
- return /* @__PURE__ */ D(Mt, { freeze: m, children: /* @__PURE__ */ D(
1663
- Ct,
1664
- {
1665
- ...e,
1666
- style: {
1667
- backgroundColor: "transparent",
1668
- ...e.style
1669
- },
1670
- children: /* @__PURE__ */ D(jt, { children: n })
1671
- }
1672
- ) });
1773
+ function rn(e) {
1774
+ return e.setDragStatus;
1673
1775
  }
1674
- function De({ children: n, ...e }) {
1675
- const { isActive: t, transitionName: r } = Z(), s = F((o) => o.status), a = et.get(r);
1676
- return /* @__PURE__ */ D(
1677
- qt,
1678
- {
1679
- transition: a?.variants[`${s}-${t}`]?.options,
1680
- ...e,
1681
- children: n
1682
- }
1683
- );
1776
+ function an(e) {
1777
+ return e.dragStatus;
1778
+ }
1779
+ function on(e) {
1780
+ return e.status;
1781
+ }
1782
+ function xn(e) {
1783
+ const t = j(9);
1784
+ let n, s;
1785
+ t[0] !== e ? ({
1786
+ children: n,
1787
+ ...s
1788
+ } = e, t[0] = e, t[1] = n, t[2] = s) : (n = t[1], s = t[2]);
1789
+ const {
1790
+ isActive: r,
1791
+ isPrev: c,
1792
+ zIndex: i
1793
+ } = dt(), u = X(fn), l = Q(ln), a = tt(un), d = tt(cn), o = !r && (l === "COMPLETED" && a === "IDLE") || c && u - 2 <= i && d === "IDLE" || c && u - 2 > i;
1794
+ let p;
1795
+ t[3] !== n || t[4] !== s ? (p = /* @__PURE__ */ x(ye, { ...s, children: n }), t[3] = n, t[4] = s, t[5] = p) : p = t[5];
1796
+ let w;
1797
+ return t[6] !== o || t[7] !== p ? (w = /* @__PURE__ */ x(me, { freeze: o, children: p }), t[6] = o, t[7] = p, t[8] = w) : w = t[8], w;
1798
+ }
1799
+ function cn(e) {
1800
+ return e.replaceTransitionStatus;
1801
+ }
1802
+ function un(e) {
1803
+ return e.dragStatus;
1804
+ }
1805
+ function ln(e) {
1806
+ return e.status;
1807
+ }
1808
+ function fn(e) {
1809
+ return e.index;
1810
+ }
1811
+ function kn(e) {
1812
+ const t = j(14);
1813
+ let n, s;
1814
+ t[0] !== e ? ({
1815
+ children: n,
1816
+ ...s
1817
+ } = e, t[0] = e, t[1] = n, t[2] = s) : (n = t[1], s = t[2]);
1818
+ const {
1819
+ isActive: r,
1820
+ isPrev: c,
1821
+ zIndex: i
1822
+ } = dt(), u = X(mn), l = Q(hn), a = tt(pn), d = tt(dn), o = !r && (l === "COMPLETED" && a === "IDLE") || c && u - 2 <= i && d === "IDLE" || c && u - 2 > i;
1823
+ let p;
1824
+ t[3] !== s.style ? (p = {
1825
+ backgroundColor: "transparent",
1826
+ ...s.style
1827
+ }, t[3] = s.style, t[4] = p) : p = t[4];
1828
+ let w;
1829
+ t[5] !== n ? (w = /* @__PURE__ */ x(ve, { children: n }), t[5] = n, t[6] = w) : w = t[6];
1830
+ let E;
1831
+ t[7] !== s || t[8] !== p || t[9] !== w ? (E = /* @__PURE__ */ x(ye, { ...s, style: p, children: w }), t[7] = s, t[8] = p, t[9] = w, t[10] = E) : E = t[10];
1832
+ let T;
1833
+ return t[11] !== o || t[12] !== E ? (T = /* @__PURE__ */ x(me, { freeze: o, children: E }), t[11] = o, t[12] = E, t[13] = T) : T = t[13], T;
1834
+ }
1835
+ function dn(e) {
1836
+ return e.replaceTransitionStatus;
1837
+ }
1838
+ function pn(e) {
1839
+ return e.dragStatus;
1840
+ }
1841
+ function hn(e) {
1842
+ return e.status;
1843
+ }
1844
+ function mn(e) {
1845
+ return e.index;
1846
+ }
1847
+ function Mn(e) {
1848
+ const t = j(9);
1849
+ let n, s;
1850
+ t[0] !== e ? ({
1851
+ children: n,
1852
+ ...s
1853
+ } = e, t[0] = e, t[1] = n, t[2] = s) : (n = t[1], s = t[2]);
1854
+ const {
1855
+ isActive: r,
1856
+ transitionName: c
1857
+ } = dt(), i = Q(yn);
1858
+ let u;
1859
+ t[3] !== c ? (u = ht.get(c), t[3] = c, t[4] = u) : u = t[4];
1860
+ const a = u?.variants[`${i}-${r}`]?.options;
1861
+ let d;
1862
+ return t[5] !== n || t[6] !== s || t[7] !== a ? (d = /* @__PURE__ */ x(De, { transition: a, ...s, children: n }), t[5] = n, t[6] = s, t[7] = a, t[8] = d) : d = t[8], d;
1863
+ }
1864
+ function yn(e) {
1865
+ return e.status;
1684
1866
  }
1685
1867
  export {
1686
- De as LayoutConfig,
1687
- ve as LayoutScreen,
1688
- ge as Route,
1689
- ye as Router,
1690
- Te as Screen,
1691
- ee as createDecorator,
1692
- Pe as createRawDecorator,
1693
- Se as createRawTransition,
1694
- rt as createTransition,
1695
- me as useNavigate,
1696
- we as useParams,
1697
- Z as useScreen,
1698
- Ee as useStep
1868
+ Mn as LayoutConfig,
1869
+ kn as LayoutScreen,
1870
+ Tn as Route,
1871
+ Pn as Router,
1872
+ xn as Screen,
1873
+ He as createDecorator,
1874
+ Nn as createRawDecorator,
1875
+ Ln as createRawTransition,
1876
+ Gt as createTransition,
1877
+ vn as useNavigate,
1878
+ In as useParams,
1879
+ dt as useScreen,
1880
+ Dn as useStep
1699
1881
  };