flemo 1.3.8 → 1.3.10

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