flemo 1.3.1 → 1.3.2
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
|
|
2
|
-
import
|
|
3
|
-
import { transform as
|
|
4
|
-
var G = {},
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
const n = "/", e = (
|
|
1
|
+
import { jsx as N, jsxs as gt } from "react/jsx-runtime";
|
|
2
|
+
import Z, { useEffect as Y, createContext as ot, useContext as it, useReducer as Dt, Children as mt, Suspense as Lt, useImperativeHandle as Nt, useRef as _ } from "react";
|
|
3
|
+
import { transform as ct, useAnimate as Et, motion as z, useDragControls as xt, AnimatePresence as kt, MotionConfig as Mt } from "motion/react";
|
|
4
|
+
var G = {}, lt;
|
|
5
|
+
function Ct() {
|
|
6
|
+
if (lt) return G;
|
|
7
|
+
lt = 1, Object.defineProperty(G, "__esModule", { value: !0 }), G.PathError = G.TokenData = void 0, G.parse = l, G.compile = E, G.match = I, G.pathToRegexp = v, G.stringify = H;
|
|
8
|
+
const n = "/", e = (i) => i, t = /^[$_\p{ID_Start}]$/u, r = /^[$\u200c\u200d\p{ID_Continue}]$/u, s = {
|
|
9
9
|
// Groups.
|
|
10
10
|
"{": "{",
|
|
11
11
|
"}": "}",
|
|
@@ -18,256 +18,256 @@ function xt() {
|
|
|
18
18
|
"?": "?",
|
|
19
19
|
"!": "!"
|
|
20
20
|
};
|
|
21
|
-
function a(
|
|
22
|
-
return
|
|
21
|
+
function a(i) {
|
|
22
|
+
return i.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
|
|
23
23
|
}
|
|
24
|
-
function i
|
|
25
|
-
return
|
|
24
|
+
function o(i) {
|
|
25
|
+
return i.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
|
|
26
26
|
}
|
|
27
|
-
class
|
|
28
|
-
constructor(
|
|
29
|
-
this.tokens =
|
|
27
|
+
class c {
|
|
28
|
+
constructor(h, m) {
|
|
29
|
+
this.tokens = h, this.originalPath = m;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
G.TokenData =
|
|
33
|
-
class
|
|
34
|
-
constructor(
|
|
35
|
-
let
|
|
36
|
-
|
|
32
|
+
G.TokenData = c;
|
|
33
|
+
class y extends TypeError {
|
|
34
|
+
constructor(h, m) {
|
|
35
|
+
let g = h;
|
|
36
|
+
m && (g += `: ${m}`), g += "; visit https://git.new/pathToRegexpError for info", super(g), this.originalPath = m;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
G.PathError =
|
|
40
|
-
function l(
|
|
41
|
-
const { encodePath:
|
|
42
|
-
let d = 0,
|
|
43
|
-
function
|
|
44
|
-
let
|
|
45
|
-
if (t.test(
|
|
39
|
+
G.PathError = y;
|
|
40
|
+
function l(i, h = {}) {
|
|
41
|
+
const { encodePath: m = e } = h, g = [...i], f = [];
|
|
42
|
+
let d = 0, w = 0;
|
|
43
|
+
function P() {
|
|
44
|
+
let T = "";
|
|
45
|
+
if (t.test(g[d]))
|
|
46
46
|
do
|
|
47
|
-
|
|
48
|
-
while (r.test(
|
|
49
|
-
else if (
|
|
47
|
+
T += g[d++];
|
|
48
|
+
while (r.test(g[d]));
|
|
49
|
+
else if (g[d] === '"') {
|
|
50
50
|
let C = d;
|
|
51
|
-
for (; d++ <
|
|
52
|
-
if (
|
|
51
|
+
for (; d++ < g.length; ) {
|
|
52
|
+
if (g[d] === '"') {
|
|
53
53
|
d++, C = 0;
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
g[d] === "\\" && d++, T += g[d];
|
|
57
57
|
}
|
|
58
58
|
if (C)
|
|
59
|
-
throw new
|
|
59
|
+
throw new y(`Unterminated quote at index ${C}`, i);
|
|
60
60
|
}
|
|
61
|
-
if (!
|
|
62
|
-
throw new
|
|
63
|
-
return
|
|
61
|
+
if (!T)
|
|
62
|
+
throw new y(`Missing parameter name at index ${d}`, i);
|
|
63
|
+
return T;
|
|
64
64
|
}
|
|
65
|
-
for (; d <
|
|
66
|
-
const
|
|
67
|
-
C ?
|
|
65
|
+
for (; d < g.length; ) {
|
|
66
|
+
const T = g[d], C = s[T];
|
|
67
|
+
C ? f.push({ type: C, index: d++, value: T }) : T === "\\" ? f.push({ type: "escape", index: d++, value: g[d++] }) : T === ":" ? f.push({ type: "param", index: d++, value: P() }) : T === "*" ? f.push({ type: "wildcard", index: d++, value: P() }) : f.push({ type: "char", index: d++, value: T });
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
function
|
|
69
|
+
f.push({ type: "end", index: d, value: "" });
|
|
70
|
+
function M(T) {
|
|
71
71
|
const C = [];
|
|
72
72
|
for (; ; ) {
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
73
|
+
const x = f[w++];
|
|
74
|
+
if (x.type === T)
|
|
75
75
|
break;
|
|
76
|
-
if (
|
|
77
|
-
let
|
|
78
|
-
for (;
|
|
79
|
-
|
|
76
|
+
if (x.type === "char" || x.type === "escape") {
|
|
77
|
+
let R = x.value, U = f[w];
|
|
78
|
+
for (; U.type === "char" || U.type === "escape"; )
|
|
79
|
+
R += U.value, U = f[++w];
|
|
80
80
|
C.push({
|
|
81
81
|
type: "text",
|
|
82
|
-
value:
|
|
82
|
+
value: m(R)
|
|
83
83
|
});
|
|
84
84
|
continue;
|
|
85
85
|
}
|
|
86
|
-
if (
|
|
86
|
+
if (x.type === "param" || x.type === "wildcard") {
|
|
87
87
|
C.push({
|
|
88
|
-
type:
|
|
89
|
-
name:
|
|
88
|
+
type: x.type,
|
|
89
|
+
name: x.value
|
|
90
90
|
});
|
|
91
91
|
continue;
|
|
92
92
|
}
|
|
93
|
-
if (
|
|
93
|
+
if (x.type === "{") {
|
|
94
94
|
C.push({
|
|
95
95
|
type: "group",
|
|
96
|
-
tokens:
|
|
96
|
+
tokens: M("}")
|
|
97
97
|
});
|
|
98
98
|
continue;
|
|
99
99
|
}
|
|
100
|
-
throw new
|
|
100
|
+
throw new y(`Unexpected ${x.type} at index ${x.index}, expected ${T}`, i);
|
|
101
101
|
}
|
|
102
102
|
return C;
|
|
103
103
|
}
|
|
104
|
-
return new
|
|
104
|
+
return new c(M("end"), i);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
const { encode:
|
|
108
|
-
return function(
|
|
109
|
-
const [
|
|
110
|
-
if (
|
|
111
|
-
throw new TypeError(`Missing parameters: ${
|
|
112
|
-
return
|
|
106
|
+
function E(i, h = {}) {
|
|
107
|
+
const { encode: m = encodeURIComponent, delimiter: g = n } = h, f = typeof i == "object" ? i : l(i, h), d = p(f.tokens, g, m);
|
|
108
|
+
return function(P = {}) {
|
|
109
|
+
const [M, ...T] = d(P);
|
|
110
|
+
if (T.length)
|
|
111
|
+
throw new TypeError(`Missing parameters: ${T.join(", ")}`);
|
|
112
|
+
return M;
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
const
|
|
117
|
-
return (
|
|
115
|
+
function p(i, h, m) {
|
|
116
|
+
const g = i.map((f) => u(f, h, m));
|
|
117
|
+
return (f) => {
|
|
118
118
|
const d = [""];
|
|
119
|
-
for (const
|
|
120
|
-
const [
|
|
121
|
-
d[0] +=
|
|
119
|
+
for (const w of g) {
|
|
120
|
+
const [P, ...M] = w(f);
|
|
121
|
+
d[0] += P, d.push(...M);
|
|
122
122
|
}
|
|
123
123
|
return d;
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
if (
|
|
128
|
-
return () => [
|
|
129
|
-
if (
|
|
130
|
-
const
|
|
126
|
+
function u(i, h, m) {
|
|
127
|
+
if (i.type === "text")
|
|
128
|
+
return () => [i.value];
|
|
129
|
+
if (i.type === "group") {
|
|
130
|
+
const f = p(i.tokens, h, m);
|
|
131
131
|
return (d) => {
|
|
132
|
-
const [
|
|
133
|
-
return
|
|
132
|
+
const [w, ...P] = f(d);
|
|
133
|
+
return P.length ? [""] : [w];
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
const
|
|
137
|
-
return
|
|
138
|
-
const d =
|
|
136
|
+
const g = m || e;
|
|
137
|
+
return i.type === "wildcard" && m !== !1 ? (f) => {
|
|
138
|
+
const d = f[i.name];
|
|
139
139
|
if (d == null)
|
|
140
|
-
return ["",
|
|
140
|
+
return ["", i.name];
|
|
141
141
|
if (!Array.isArray(d) || d.length === 0)
|
|
142
|
-
throw new TypeError(`Expected "${
|
|
142
|
+
throw new TypeError(`Expected "${i.name}" to be a non-empty array`);
|
|
143
143
|
return [
|
|
144
|
-
d.map((
|
|
145
|
-
if (typeof
|
|
146
|
-
throw new TypeError(`Expected "${
|
|
147
|
-
return
|
|
148
|
-
}).join(
|
|
144
|
+
d.map((w, P) => {
|
|
145
|
+
if (typeof w != "string")
|
|
146
|
+
throw new TypeError(`Expected "${i.name}/${P}" to be a string`);
|
|
147
|
+
return g(w);
|
|
148
|
+
}).join(h)
|
|
149
149
|
];
|
|
150
|
-
} : (
|
|
151
|
-
const d =
|
|
150
|
+
} : (f) => {
|
|
151
|
+
const d = f[i.name];
|
|
152
152
|
if (d == null)
|
|
153
|
-
return ["",
|
|
153
|
+
return ["", i.name];
|
|
154
154
|
if (typeof d != "string")
|
|
155
|
-
throw new TypeError(`Expected "${
|
|
156
|
-
return [
|
|
155
|
+
throw new TypeError(`Expected "${i.name}" to be a string`);
|
|
156
|
+
return [g(d)];
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
const { decode:
|
|
161
|
-
return function(
|
|
162
|
-
const
|
|
163
|
-
if (!
|
|
159
|
+
function I(i, h = {}) {
|
|
160
|
+
const { decode: m = decodeURIComponent, delimiter: g = n } = h, { regexp: f, keys: d } = v(i, h), w = d.map((P) => m === !1 ? e : P.type === "param" ? m : (M) => M.split(g).map(m));
|
|
161
|
+
return function(M) {
|
|
162
|
+
const T = f.exec(M);
|
|
163
|
+
if (!T)
|
|
164
164
|
return !1;
|
|
165
|
-
const C =
|
|
166
|
-
for (let
|
|
167
|
-
if (
|
|
165
|
+
const C = T[0], x = /* @__PURE__ */ Object.create(null);
|
|
166
|
+
for (let R = 1; R < T.length; R++) {
|
|
167
|
+
if (T[R] === void 0)
|
|
168
168
|
continue;
|
|
169
|
-
const
|
|
170
|
-
|
|
169
|
+
const U = d[R - 1], nt = w[R - 1];
|
|
170
|
+
x[U.name] = nt(T[R]);
|
|
171
171
|
}
|
|
172
|
-
return { path: C, params:
|
|
172
|
+
return { path: C, params: x };
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
const { delimiter:
|
|
177
|
-
for (const
|
|
178
|
-
const
|
|
179
|
-
for (const
|
|
180
|
-
|
|
175
|
+
function v(i, h = {}) {
|
|
176
|
+
const { delimiter: m = n, end: g = !0, sensitive: f = !1, trailing: d = !0 } = h, w = [], P = f ? "" : "i", M = [];
|
|
177
|
+
for (const x of L(i, [])) {
|
|
178
|
+
const R = typeof x == "object" ? x : l(x, h);
|
|
179
|
+
for (const U of S(R.tokens, 0, []))
|
|
180
|
+
M.push(A(U, m, w, R.originalPath));
|
|
181
181
|
}
|
|
182
|
-
let
|
|
183
|
-
return d && (
|
|
182
|
+
let T = `^(?:${M.join("|")})`;
|
|
183
|
+
return d && (T += `(?:${o(m)}$)?`), T += g ? "$" : `(?=${o(m)}|$)`, { regexp: new RegExp(T, P), keys: w };
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
if (Array.isArray(
|
|
187
|
-
for (const
|
|
188
|
-
|
|
185
|
+
function L(i, h) {
|
|
186
|
+
if (Array.isArray(i))
|
|
187
|
+
for (const m of i)
|
|
188
|
+
L(m, h);
|
|
189
189
|
else
|
|
190
|
-
|
|
191
|
-
return
|
|
190
|
+
h.push(i);
|
|
191
|
+
return h;
|
|
192
192
|
}
|
|
193
|
-
function*
|
|
194
|
-
if (
|
|
195
|
-
return yield
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
198
|
-
for (const
|
|
199
|
-
yield*
|
|
193
|
+
function* S(i, h, m) {
|
|
194
|
+
if (h === i.length)
|
|
195
|
+
return yield m;
|
|
196
|
+
const g = i[h];
|
|
197
|
+
if (g.type === "group")
|
|
198
|
+
for (const f of S(g.tokens, 0, m.slice()))
|
|
199
|
+
yield* S(i, h + 1, f);
|
|
200
200
|
else
|
|
201
|
-
|
|
202
|
-
yield*
|
|
201
|
+
m.push(g);
|
|
202
|
+
yield* S(i, h + 1, m);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
let
|
|
206
|
-
for (const
|
|
207
|
-
if (
|
|
208
|
-
|
|
204
|
+
function A(i, h, m, g) {
|
|
205
|
+
let f = "", d = "", w = !0;
|
|
206
|
+
for (const P of i) {
|
|
207
|
+
if (P.type === "text") {
|
|
208
|
+
f += o(P.value), d += P.value, w || (w = P.value.includes(h));
|
|
209
209
|
continue;
|
|
210
210
|
}
|
|
211
|
-
if (
|
|
212
|
-
if (!
|
|
213
|
-
throw new
|
|
214
|
-
|
|
211
|
+
if (P.type === "param" || P.type === "wildcard") {
|
|
212
|
+
if (!w && !d)
|
|
213
|
+
throw new y(`Missing text before "${P.name}" ${P.type}`, g);
|
|
214
|
+
P.type === "param" ? f += `(${j(h, w ? "" : d)}+)` : f += "([\\s\\S]+)", m.push(P), d = "", w = !1;
|
|
215
215
|
continue;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
return
|
|
218
|
+
return f;
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
return
|
|
220
|
+
function j(i, h) {
|
|
221
|
+
return h.length < 2 ? i.length < 2 ? `[^${o(i + h)}]` : `(?:(?!${o(i)})[^${o(h)}])` : i.length < 2 ? `(?:(?!${o(h)})[^${o(i)}])` : `(?:(?!${o(h)}|${o(i)})[\\s\\S])`;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
let
|
|
225
|
-
function
|
|
226
|
-
return
|
|
223
|
+
function k(i) {
|
|
224
|
+
let h = "", m = 0;
|
|
225
|
+
function g(f) {
|
|
226
|
+
return K(f) && J(i[m]) ? f : JSON.stringify(f);
|
|
227
227
|
}
|
|
228
|
-
for (;
|
|
229
|
-
const
|
|
230
|
-
if (
|
|
231
|
-
|
|
228
|
+
for (; m < i.length; ) {
|
|
229
|
+
const f = i[m++];
|
|
230
|
+
if (f.type === "text") {
|
|
231
|
+
h += a(f.value);
|
|
232
232
|
continue;
|
|
233
233
|
}
|
|
234
|
-
if (
|
|
235
|
-
|
|
234
|
+
if (f.type === "group") {
|
|
235
|
+
h += `{${k(f.tokens)}}`;
|
|
236
236
|
continue;
|
|
237
237
|
}
|
|
238
|
-
if (
|
|
239
|
-
|
|
238
|
+
if (f.type === "param") {
|
|
239
|
+
h += `:${g(f.name)}`;
|
|
240
240
|
continue;
|
|
241
241
|
}
|
|
242
|
-
if (
|
|
243
|
-
|
|
242
|
+
if (f.type === "wildcard") {
|
|
243
|
+
h += `*${g(f.name)}`;
|
|
244
244
|
continue;
|
|
245
245
|
}
|
|
246
|
-
throw new TypeError(`Unknown token type: ${
|
|
246
|
+
throw new TypeError(`Unknown token type: ${f.type}`);
|
|
247
247
|
}
|
|
248
|
-
return
|
|
248
|
+
return h;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
return
|
|
250
|
+
function H(i) {
|
|
251
|
+
return k(i.tokens);
|
|
252
252
|
}
|
|
253
|
-
function
|
|
254
|
-
const [
|
|
255
|
-
return t.test(
|
|
253
|
+
function K(i) {
|
|
254
|
+
const [h, ...m] = i;
|
|
255
|
+
return t.test(h) && m.every((g) => r.test(g));
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
return
|
|
257
|
+
function J(i) {
|
|
258
|
+
return i && i.type === "text" ? !r.test(i.value[0]) : !0;
|
|
259
259
|
}
|
|
260
260
|
return G;
|
|
261
261
|
}
|
|
262
|
-
var
|
|
263
|
-
function
|
|
264
|
-
const r = Array.isArray(n) ? n.find((
|
|
265
|
-
return s ? { ...s.params, ...
|
|
262
|
+
var q = Ct();
|
|
263
|
+
function At(n, e, t) {
|
|
264
|
+
const r = Array.isArray(n) ? n.find((c) => q.pathToRegexp(c).regexp.test(e)) || "" : q.pathToRegexp(n).regexp.test(e) ? n : "", s = q.match(r)(e), a = new URLSearchParams(t), o = Object.fromEntries(a.entries());
|
|
265
|
+
return s ? { ...s.params, ...o } : {};
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function dt() {
|
|
268
268
|
return typeof document > "u";
|
|
269
269
|
}
|
|
270
|
-
class
|
|
270
|
+
class Rt {
|
|
271
271
|
tasks = /* @__PURE__ */ new Map();
|
|
272
272
|
instanceId = Date.now().toString();
|
|
273
273
|
isLocked = !1;
|
|
@@ -335,7 +335,7 @@ class Mt {
|
|
|
335
335
|
return new Promise((s, a) => {
|
|
336
336
|
this.taskQueue = this.taskQueue.then(async () => {
|
|
337
337
|
try {
|
|
338
|
-
const { control:
|
|
338
|
+
const { control: o, validate: c, rollback: y, dependencies: l = [], delay: E } = t, p = new AbortController(), u = {
|
|
339
339
|
id: r,
|
|
340
340
|
execute: e,
|
|
341
341
|
timestamp: Date.now(),
|
|
@@ -343,73 +343,73 @@ class Mt {
|
|
|
343
343
|
status: "PENDING",
|
|
344
344
|
dependencies: l,
|
|
345
345
|
instanceId: this.instanceId,
|
|
346
|
-
validate:
|
|
347
|
-
rollback:
|
|
348
|
-
control:
|
|
349
|
-
abortController:
|
|
346
|
+
validate: c,
|
|
347
|
+
rollback: y,
|
|
348
|
+
control: o,
|
|
349
|
+
abortController: p
|
|
350
350
|
};
|
|
351
|
-
this.tasks.set(
|
|
351
|
+
this.tasks.set(u.id, u), this.pendingTaskQueue.length > 0 && (this.pendingTaskQueue.push(u), await this.waitForPendingTasks(), this.pendingTaskQueue = this.pendingTaskQueue.filter((v) => v.id !== u.id));
|
|
352
352
|
try {
|
|
353
|
-
if (!await this.acquireLock(
|
|
354
|
-
throw
|
|
353
|
+
if (!await this.acquireLock(u.id))
|
|
354
|
+
throw u.status = "FAILED", new Error("FAILED");
|
|
355
355
|
try {
|
|
356
|
-
|
|
357
|
-
for (const
|
|
358
|
-
const
|
|
359
|
-
if (!
|
|
360
|
-
throw
|
|
356
|
+
u.status = "PROCESSING";
|
|
357
|
+
for (const S of u.dependencies) {
|
|
358
|
+
const A = this.tasks.get(S);
|
|
359
|
+
if (!A || A.status !== "COMPLETED")
|
|
360
|
+
throw u.status = "FAILED", new Error("FAILED");
|
|
361
361
|
}
|
|
362
|
-
if (
|
|
363
|
-
throw
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
if (
|
|
367
|
-
|
|
362
|
+
if (u.validate && !await u.validate())
|
|
363
|
+
throw u.status = "FAILED", new Error("FAILED");
|
|
364
|
+
E && E > 0 && await new Promise((S) => setTimeout(S, E));
|
|
365
|
+
const L = await u.execute(u.abortController);
|
|
366
|
+
if (u.abortController.signal.aborted) {
|
|
367
|
+
u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), s({
|
|
368
368
|
success: !0,
|
|
369
369
|
result: void 0,
|
|
370
|
-
taskId:
|
|
370
|
+
taskId: u.id,
|
|
371
371
|
timestamp: Date.now(),
|
|
372
372
|
instanceId: this.instanceId
|
|
373
373
|
});
|
|
374
374
|
return;
|
|
375
375
|
}
|
|
376
376
|
if (t.control) {
|
|
377
|
-
const
|
|
378
|
-
if (
|
|
379
|
-
|
|
377
|
+
const S = t.control;
|
|
378
|
+
if (S.delay && S.delay > 0 && await new Promise((A) => setTimeout(A, S.delay)), S.manual) {
|
|
379
|
+
u.status = "MANUAL_PENDING", u.manualResolver = { resolve: s, reject: a, result: L }, this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "MANUAL_PENDING");
|
|
380
380
|
return;
|
|
381
381
|
}
|
|
382
|
-
if (
|
|
383
|
-
|
|
382
|
+
if (S.signal) {
|
|
383
|
+
u.status = "SIGNAL_PENDING", u.manualResolver = { resolve: s, reject: a, result: L }, this.signalListeners.has(S.signal) || this.signalListeners.set(S.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(S.signal).add(u.id), this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "SIGNAL_PENDING");
|
|
384
384
|
return;
|
|
385
385
|
}
|
|
386
|
-
if (
|
|
387
|
-
|
|
386
|
+
if (S.condition && !await S.condition()) {
|
|
387
|
+
u.status = "MANUAL_PENDING", u.manualResolver = { resolve: s, reject: a, result: L }, this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "MANUAL_PENDING");
|
|
388
388
|
return;
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
|
|
391
|
+
u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), s({
|
|
392
392
|
success: !0,
|
|
393
|
-
result:
|
|
394
|
-
taskId:
|
|
393
|
+
result: L,
|
|
394
|
+
taskId: u.id,
|
|
395
395
|
timestamp: Date.now(),
|
|
396
396
|
instanceId: this.instanceId
|
|
397
397
|
});
|
|
398
|
-
} catch (
|
|
399
|
-
if (
|
|
398
|
+
} catch (L) {
|
|
399
|
+
if (u.status = "FAILED", u.rollback)
|
|
400
400
|
try {
|
|
401
|
-
await
|
|
401
|
+
await u.rollback(), u.status = "ROLLEDBACK";
|
|
402
402
|
} catch {
|
|
403
403
|
}
|
|
404
|
-
throw await this.onTaskStatusChange(
|
|
404
|
+
throw await this.onTaskStatusChange(u.id, u.status), L;
|
|
405
405
|
} finally {
|
|
406
|
-
this.releaseLock(
|
|
406
|
+
this.releaseLock(u.id);
|
|
407
407
|
}
|
|
408
|
-
} catch (
|
|
409
|
-
a(
|
|
408
|
+
} catch (v) {
|
|
409
|
+
a(v);
|
|
410
410
|
}
|
|
411
|
-
} catch (
|
|
412
|
-
a(
|
|
411
|
+
} catch (o) {
|
|
412
|
+
a(o);
|
|
413
413
|
}
|
|
414
414
|
}).catch(a);
|
|
415
415
|
});
|
|
@@ -440,29 +440,29 @@ class Mt {
|
|
|
440
440
|
await Promise.all(e.map((t) => this.resolveTask(t.id)));
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
const
|
|
443
|
+
const F = new Rt(), pt = (n) => {
|
|
444
444
|
let e;
|
|
445
|
-
const t = /* @__PURE__ */ new Set(), r = (l,
|
|
446
|
-
const
|
|
447
|
-
if (!Object.is(
|
|
448
|
-
const
|
|
449
|
-
e =
|
|
445
|
+
const t = /* @__PURE__ */ new Set(), r = (l, E) => {
|
|
446
|
+
const p = typeof l == "function" ? l(e) : l;
|
|
447
|
+
if (!Object.is(p, e)) {
|
|
448
|
+
const u = e;
|
|
449
|
+
e = E ?? (typeof p != "object" || p === null) ? p : Object.assign({}, e, p), t.forEach((I) => I(e, u));
|
|
450
450
|
}
|
|
451
|
-
}, s = () => e,
|
|
452
|
-
return
|
|
453
|
-
},
|
|
454
|
-
function
|
|
455
|
-
const t =
|
|
451
|
+
}, s = () => e, c = { setState: r, getState: s, getInitialState: () => y, subscribe: (l) => (t.add(l), () => t.delete(l)) }, y = e = n(r, s, c);
|
|
452
|
+
return c;
|
|
453
|
+
}, bt = ((n) => n ? pt(n) : pt), Ot = (n) => n;
|
|
454
|
+
function Gt(n, e = Ot) {
|
|
455
|
+
const t = Z.useSyncExternalStore(
|
|
456
456
|
n.subscribe,
|
|
457
|
-
|
|
458
|
-
|
|
457
|
+
Z.useCallback(() => e(n.getState()), [n, e]),
|
|
458
|
+
Z.useCallback(() => e(n.getInitialState()), [n, e])
|
|
459
459
|
);
|
|
460
|
-
return
|
|
460
|
+
return Z.useDebugValue(t), t;
|
|
461
461
|
}
|
|
462
|
-
const
|
|
463
|
-
const e =
|
|
462
|
+
const ft = (n) => {
|
|
463
|
+
const e = bt(n), t = (r) => Gt(e, r);
|
|
464
464
|
return Object.assign(t, e), t;
|
|
465
|
-
},
|
|
465
|
+
}, tt = ((n) => n ? ft(n) : ft), Q = tt((n) => ({
|
|
466
466
|
index: -1,
|
|
467
467
|
histories: [],
|
|
468
468
|
addHistory: (e) => n((t) => ({
|
|
@@ -477,35 +477,35 @@ const ct = (n) => {
|
|
|
477
477
|
index: t.index - 1,
|
|
478
478
|
histories: t.histories.filter((r, s) => s !== e)
|
|
479
479
|
}))
|
|
480
|
-
})), $ =
|
|
480
|
+
})), $ = tt((n) => ({
|
|
481
481
|
status: "IDLE",
|
|
482
482
|
setStatus: (e) => n({ status: e })
|
|
483
483
|
}));
|
|
484
|
-
function
|
|
485
|
-
return
|
|
484
|
+
function $t() {
|
|
485
|
+
return Y(() => {
|
|
486
486
|
const n = async (e) => {
|
|
487
487
|
const t = e.state?.id;
|
|
488
|
-
(await
|
|
488
|
+
(await F.addTask(
|
|
489
489
|
async (r) => {
|
|
490
|
-
const s = e.state?.index, a = e.state?.status,
|
|
491
|
-
if (!
|
|
490
|
+
const s = e.state?.index, a = e.state?.status, o = e.state?.params, c = e.state?.transitionName, y = e.state?.layoutId, l = $.getState().setStatus, { index: E, addHistory: p, popHistory: u } = Q.getState(), I = s < E, v = a === "PUSHING" && s > E, L = a === "REPLACING" && s > E, S = window.location.pathname;
|
|
491
|
+
if (!I && !v && !L) {
|
|
492
492
|
r.abort();
|
|
493
493
|
return;
|
|
494
494
|
}
|
|
495
|
-
return
|
|
495
|
+
return I ? l("POPPING") : v ? (l("PUSHING"), p({
|
|
496
496
|
id: t,
|
|
497
|
-
pathname:
|
|
498
|
-
params:
|
|
499
|
-
transitionName:
|
|
500
|
-
layoutId:
|
|
501
|
-
})) :
|
|
497
|
+
pathname: S,
|
|
498
|
+
params: o,
|
|
499
|
+
transitionName: c,
|
|
500
|
+
layoutId: y
|
|
501
|
+
})) : L && (l("REPLACING"), p({
|
|
502
502
|
id: t,
|
|
503
|
-
pathname:
|
|
504
|
-
params:
|
|
505
|
-
transitionName:
|
|
506
|
-
layoutId:
|
|
503
|
+
pathname: S,
|
|
504
|
+
params: o,
|
|
505
|
+
transitionName: c,
|
|
506
|
+
layoutId: y
|
|
507
507
|
})), async () => {
|
|
508
|
-
|
|
508
|
+
I && u(s + 1), l("COMPLETED");
|
|
509
509
|
};
|
|
510
510
|
},
|
|
511
511
|
{
|
|
@@ -521,9 +521,9 @@ function bt() {
|
|
|
521
521
|
};
|
|
522
522
|
}, []), null;
|
|
523
523
|
}
|
|
524
|
-
const
|
|
524
|
+
const St = ot({}), wt = ot(() => {
|
|
525
525
|
});
|
|
526
|
-
function
|
|
526
|
+
function Ut(n, e) {
|
|
527
527
|
switch (e.type) {
|
|
528
528
|
case "SET":
|
|
529
529
|
return e.params;
|
|
@@ -531,24 +531,7 @@ function Ot(n, e) {
|
|
|
531
531
|
return n;
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
|
|
535
|
-
children: n,
|
|
536
|
-
active: e,
|
|
537
|
-
params: t
|
|
538
|
-
}) {
|
|
539
|
-
const [r, s] = Tt(Ot, t);
|
|
540
|
-
return j(() => {
|
|
541
|
-
const a = async (i) => {
|
|
542
|
-
i.state?.step && await _.addTask(async () => {
|
|
543
|
-
s({ type: "SET", params: i.state?.params || {} });
|
|
544
|
-
});
|
|
545
|
-
};
|
|
546
|
-
return e && window.addEventListener("popstate", a), () => {
|
|
547
|
-
window.removeEventListener("popstate", a);
|
|
548
|
-
};
|
|
549
|
-
}, [e, s]), /* @__PURE__ */ M(gt.Provider, { value: s, children: /* @__PURE__ */ M(yt.Provider, { value: r, children: n }) });
|
|
550
|
-
}
|
|
551
|
-
const mt = et({
|
|
534
|
+
const Pt = ot({
|
|
552
535
|
id: "",
|
|
553
536
|
isActive: !1,
|
|
554
537
|
isRoot: !0,
|
|
@@ -560,16 +543,32 @@ const mt = et({
|
|
|
560
543
|
prevTransitionName: "none",
|
|
561
544
|
layoutId: null
|
|
562
545
|
});
|
|
563
|
-
function
|
|
564
|
-
|
|
546
|
+
function V() {
|
|
547
|
+
return it(Pt);
|
|
548
|
+
}
|
|
549
|
+
function _t({ children: n }) {
|
|
550
|
+
const { isActive: e, params: t } = V(), [r, s] = Dt(Ut, t);
|
|
551
|
+
return Y(() => {
|
|
552
|
+
const a = async (o) => {
|
|
553
|
+
o.state?.step && await F.addTask(async () => {
|
|
554
|
+
s({ type: "SET", params: o.state?.params || {} });
|
|
555
|
+
});
|
|
556
|
+
};
|
|
557
|
+
return e && window.addEventListener("popstate", a), () => {
|
|
558
|
+
window.removeEventListener("popstate", a);
|
|
559
|
+
};
|
|
560
|
+
}, [e, s]), /* @__PURE__ */ N(wt.Provider, { value: s, children: /* @__PURE__ */ N(St.Provider, { value: r, children: n }) });
|
|
561
|
+
}
|
|
562
|
+
function Ht({ children: n }) {
|
|
563
|
+
const e = Q((r) => r.index), t = Q((r) => r.histories);
|
|
565
564
|
return t.map(
|
|
566
|
-
(r) =>
|
|
567
|
-
(s) =>
|
|
565
|
+
(r) => mt.toArray(n).filter(
|
|
566
|
+
(s) => q.pathToRegexp(s.props.path).regexp.test(
|
|
568
567
|
r.pathname
|
|
569
568
|
)
|
|
570
569
|
)
|
|
571
|
-
).map(([r], s) => /* @__PURE__ */
|
|
572
|
-
|
|
570
|
+
).map(([r], s) => /* @__PURE__ */ N(
|
|
571
|
+
Pt.Provider,
|
|
573
572
|
{
|
|
574
573
|
value: {
|
|
575
574
|
id: t[s].id,
|
|
@@ -583,12 +582,12 @@ function $t({ children: n }) {
|
|
|
583
582
|
prevTransitionName: t[e - 1]?.transitionName,
|
|
584
583
|
layoutId: t[s].layoutId
|
|
585
584
|
},
|
|
586
|
-
children: /* @__PURE__ */
|
|
585
|
+
children: /* @__PURE__ */ N(_t, { children: r })
|
|
587
586
|
},
|
|
588
587
|
t[s].id
|
|
589
588
|
));
|
|
590
589
|
}
|
|
591
|
-
function
|
|
590
|
+
function Ft({
|
|
592
591
|
name: n,
|
|
593
592
|
initial: e,
|
|
594
593
|
enter: t,
|
|
@@ -613,7 +612,7 @@ function Ut({
|
|
|
613
612
|
...s
|
|
614
613
|
};
|
|
615
614
|
}
|
|
616
|
-
const
|
|
615
|
+
const Qt = Ft({
|
|
617
616
|
name: "overlay",
|
|
618
617
|
initial: {
|
|
619
618
|
opacity: 0,
|
|
@@ -666,19 +665,19 @@ const _t = Ut({
|
|
|
666
665
|
}
|
|
667
666
|
)
|
|
668
667
|
}
|
|
669
|
-
}),
|
|
668
|
+
}), ut = /* @__PURE__ */ new Map([["overlay", Qt]]), rt = tt((n) => ({
|
|
670
669
|
defaultTransitionName: "cupertino",
|
|
671
670
|
setDefaultTransitionName: (e) => n({ defaultTransitionName: e })
|
|
672
671
|
}));
|
|
673
|
-
function
|
|
672
|
+
function et({
|
|
674
673
|
name: n,
|
|
675
674
|
initial: e,
|
|
676
675
|
idle: t,
|
|
677
676
|
enter: r,
|
|
678
677
|
enterBack: s,
|
|
679
678
|
exit: a,
|
|
680
|
-
exitBack:
|
|
681
|
-
options:
|
|
679
|
+
exitBack: o,
|
|
680
|
+
options: c
|
|
682
681
|
}) {
|
|
683
682
|
return {
|
|
684
683
|
name: n,
|
|
@@ -690,15 +689,15 @@ function J({
|
|
|
690
689
|
"PUSHING-true": r,
|
|
691
690
|
"REPLACING-false": a,
|
|
692
691
|
"REPLACING-true": r,
|
|
693
|
-
"POPPING-false":
|
|
692
|
+
"POPPING-false": o,
|
|
694
693
|
"POPPING-true": s,
|
|
695
694
|
"COMPLETED-false": a,
|
|
696
695
|
"COMPLETED-true": r
|
|
697
696
|
},
|
|
698
|
-
...
|
|
697
|
+
...c
|
|
699
698
|
};
|
|
700
699
|
}
|
|
701
|
-
const
|
|
700
|
+
const jt = et({
|
|
702
701
|
name: "cupertino",
|
|
703
702
|
initial: {
|
|
704
703
|
x: "100%"
|
|
@@ -752,11 +751,11 @@ const Ht = J({
|
|
|
752
751
|
swipeDirection: "x",
|
|
753
752
|
onSwipeStart: async () => !0,
|
|
754
753
|
onSwipe: (n, e, { animate: t, currentScreen: r, prevScreen: s, onProgress: a }) => {
|
|
755
|
-
const { offset:
|
|
756
|
-
return a?.(!0,
|
|
754
|
+
const { offset: o } = e, c = o.x, y = ct(c, [0, window.innerWidth], [0, 100]);
|
|
755
|
+
return a?.(!0, y), t(
|
|
757
756
|
r,
|
|
758
757
|
{
|
|
759
|
-
x: Math.max(0,
|
|
758
|
+
x: Math.max(0, c)
|
|
760
759
|
},
|
|
761
760
|
{
|
|
762
761
|
duration: 0
|
|
@@ -764,15 +763,15 @@ const Ht = J({
|
|
|
764
763
|
), t(
|
|
765
764
|
s,
|
|
766
765
|
{
|
|
767
|
-
x: -100 +
|
|
766
|
+
x: -100 + y
|
|
768
767
|
},
|
|
769
768
|
{
|
|
770
769
|
duration: 0
|
|
771
770
|
}
|
|
772
|
-
),
|
|
771
|
+
), y;
|
|
773
772
|
},
|
|
774
773
|
onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
|
|
775
|
-
const { offset:
|
|
774
|
+
const { offset: o, velocity: c } = e, l = o.x > 50 || c.x > 20;
|
|
776
775
|
return a?.(l), await Promise.all([
|
|
777
776
|
t(
|
|
778
777
|
r,
|
|
@@ -797,7 +796,7 @@ const Ht = J({
|
|
|
797
796
|
]), l;
|
|
798
797
|
}
|
|
799
798
|
}
|
|
800
|
-
}),
|
|
799
|
+
}), Bt = et({
|
|
801
800
|
name: "layout",
|
|
802
801
|
initial: {
|
|
803
802
|
opacity: 0.97
|
|
@@ -847,20 +846,20 @@ const Ht = J({
|
|
|
847
846
|
swipeDirection: "y",
|
|
848
847
|
onSwipeStart: async () => !0,
|
|
849
848
|
onSwipe: (n, e, { animate: t, currentScreen: r, onProgress: s }) => {
|
|
850
|
-
const { offset: a } = e,
|
|
849
|
+
const { offset: a } = e, o = a.y, c = Math.max(0, Math.min(56, o)), y = ct(c, [0, 56], [1, 0.96]), l = Math.max(0, o - 56), E = Math.min(1, l / 160), p = Math.sqrt(E) * 12, u = Math.max(0, c + p), I = Math.min(56, u);
|
|
851
850
|
return s?.(!0, 100), t(
|
|
852
851
|
r,
|
|
853
852
|
{
|
|
854
|
-
y:
|
|
855
|
-
opacity:
|
|
853
|
+
y: u,
|
|
854
|
+
opacity: y
|
|
856
855
|
},
|
|
857
856
|
{
|
|
858
857
|
duration: 0
|
|
859
858
|
}
|
|
860
|
-
),
|
|
859
|
+
), I;
|
|
861
860
|
},
|
|
862
861
|
onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
|
|
863
|
-
const { offset:
|
|
862
|
+
const { offset: o, velocity: c } = e, l = o.y > 56 || c.y > 20;
|
|
864
863
|
return a?.(l), await Promise.all([
|
|
865
864
|
t(
|
|
866
865
|
r,
|
|
@@ -885,7 +884,7 @@ const Ht = J({
|
|
|
885
884
|
]), l;
|
|
886
885
|
}
|
|
887
886
|
}
|
|
888
|
-
}),
|
|
887
|
+
}), qt = et({
|
|
889
888
|
name: "material",
|
|
890
889
|
initial: {
|
|
891
890
|
y: "100%",
|
|
@@ -944,11 +943,11 @@ const Ht = J({
|
|
|
944
943
|
swipeDirection: "y",
|
|
945
944
|
onSwipeStart: async () => !0,
|
|
946
945
|
onSwipe: (n, e, { animate: t, currentScreen: r, prevScreen: s, onProgress: a }) => {
|
|
947
|
-
const { offset:
|
|
948
|
-
return a?.(!0,
|
|
946
|
+
const { offset: o } = e, c = o.y, y = Math.max(0, Math.min(56, c)), l = ct(y, [0, 56], [1, 0.96]), E = Math.max(0, c - 56), p = Math.min(1, E / 160), u = Math.sqrt(p) * 12, I = Math.max(0, y + u), v = Math.min(56, I);
|
|
947
|
+
return a?.(!0, v), t(
|
|
949
948
|
r,
|
|
950
949
|
{
|
|
951
|
-
y:
|
|
950
|
+
y: I,
|
|
952
951
|
opacity: l
|
|
953
952
|
},
|
|
954
953
|
{
|
|
@@ -957,14 +956,14 @@ const Ht = J({
|
|
|
957
956
|
), t(
|
|
958
957
|
s,
|
|
959
958
|
{
|
|
960
|
-
y: -56 +
|
|
961
|
-
opacity:
|
|
959
|
+
y: -56 + v,
|
|
960
|
+
opacity: v / 56
|
|
962
961
|
},
|
|
963
962
|
{ duration: 0 }
|
|
964
|
-
),
|
|
963
|
+
), v;
|
|
965
964
|
},
|
|
966
965
|
onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
|
|
967
|
-
const { offset:
|
|
966
|
+
const { offset: o, velocity: c } = e, l = o.y > 56 || c.y > 20;
|
|
968
967
|
return a?.(l), await Promise.all([
|
|
969
968
|
t(
|
|
970
969
|
r,
|
|
@@ -991,7 +990,7 @@ const Ht = J({
|
|
|
991
990
|
]), l;
|
|
992
991
|
}
|
|
993
992
|
}
|
|
994
|
-
}),
|
|
993
|
+
}), Yt = et({
|
|
995
994
|
name: "none",
|
|
996
995
|
initial: {},
|
|
997
996
|
idle: {
|
|
@@ -1024,46 +1023,46 @@ const Ht = J({
|
|
|
1024
1023
|
duration: 0
|
|
1025
1024
|
}
|
|
1026
1025
|
}
|
|
1027
|
-
}),
|
|
1028
|
-
["none",
|
|
1029
|
-
["cupertino",
|
|
1030
|
-
["material",
|
|
1031
|
-
["layout",
|
|
1032
|
-
]),
|
|
1026
|
+
}), W = /* @__PURE__ */ new Map([
|
|
1027
|
+
["none", Yt],
|
|
1028
|
+
["cupertino", jt],
|
|
1029
|
+
["material", qt],
|
|
1030
|
+
["layout", Bt]
|
|
1031
|
+
]), Xt = (() => {
|
|
1033
1032
|
const n = /* @__PURE__ */ Object.create(null), e = Object.prototype.hasOwnProperty;
|
|
1034
|
-
for (const t of
|
|
1033
|
+
for (const t of W.values()) {
|
|
1035
1034
|
const r = t.variants["IDLE-true"].value;
|
|
1036
1035
|
for (const s in r)
|
|
1037
1036
|
e.call(r, s) && (n[s] = r[s]);
|
|
1038
1037
|
}
|
|
1039
1038
|
return n;
|
|
1040
1039
|
})();
|
|
1041
|
-
function
|
|
1040
|
+
function ee({
|
|
1042
1041
|
children: n,
|
|
1043
1042
|
initPath: e = "/",
|
|
1044
1043
|
defaultTransitionName: t = "cupertino",
|
|
1045
1044
|
transitions: r = [],
|
|
1046
1045
|
decorators: s = []
|
|
1047
1046
|
}) {
|
|
1048
|
-
const a =
|
|
1049
|
-
return
|
|
1047
|
+
const a = dt() ? e || "/" : window.location.pathname, o = dt() ? a.split("?")[1] || "" : window.location.search;
|
|
1048
|
+
return rt.setState({
|
|
1050
1049
|
defaultTransitionName: t
|
|
1051
|
-
}),
|
|
1050
|
+
}), Q.setState({
|
|
1052
1051
|
index: 0,
|
|
1053
1052
|
histories: [
|
|
1054
1053
|
{
|
|
1055
1054
|
id: "root",
|
|
1056
1055
|
pathname: a,
|
|
1057
|
-
params:
|
|
1058
|
-
|
|
1056
|
+
params: At(
|
|
1057
|
+
mt.toArray(n).map((c) => c.props.path).flat(),
|
|
1059
1058
|
a,
|
|
1060
|
-
|
|
1059
|
+
o
|
|
1061
1060
|
),
|
|
1062
1061
|
transitionName: t,
|
|
1063
1062
|
layoutId: null
|
|
1064
1063
|
}
|
|
1065
1064
|
]
|
|
1066
|
-
}),
|
|
1065
|
+
}), Y(() => {
|
|
1067
1066
|
window.history.state?.index || window.history.replaceState(
|
|
1068
1067
|
{
|
|
1069
1068
|
id: "root",
|
|
@@ -1076,11 +1075,11 @@ function Jt({
|
|
|
1076
1075
|
"",
|
|
1077
1076
|
window.location.pathname
|
|
1078
1077
|
);
|
|
1079
|
-
}, [t]),
|
|
1080
|
-
r.forEach((
|
|
1081
|
-
}, [r]),
|
|
1082
|
-
s.forEach((
|
|
1083
|
-
}, [s]), /* @__PURE__ */
|
|
1078
|
+
}, [t]), Y(() => {
|
|
1079
|
+
r.forEach((c) => W.set(c.name, c));
|
|
1080
|
+
}, [r]), Y(() => {
|
|
1081
|
+
s.forEach((c) => ut.set(c.name, c));
|
|
1082
|
+
}, [s]), /* @__PURE__ */ gt(
|
|
1084
1083
|
"div",
|
|
1085
1084
|
{
|
|
1086
1085
|
style: {
|
|
@@ -1091,51 +1090,51 @@ function Jt({
|
|
|
1091
1090
|
height: "100%"
|
|
1092
1091
|
},
|
|
1093
1092
|
children: [
|
|
1094
|
-
/* @__PURE__ */
|
|
1095
|
-
/* @__PURE__ */
|
|
1093
|
+
/* @__PURE__ */ N($t, {}),
|
|
1094
|
+
/* @__PURE__ */ N(Ht, { children: n })
|
|
1096
1095
|
]
|
|
1097
1096
|
}
|
|
1098
1097
|
);
|
|
1099
1098
|
}
|
|
1100
|
-
function
|
|
1099
|
+
function ne({ element: n }) {
|
|
1101
1100
|
return n;
|
|
1102
1101
|
}
|
|
1103
|
-
function
|
|
1102
|
+
function se() {
|
|
1104
1103
|
return {
|
|
1105
1104
|
push: async (r, s, a = {}) => {
|
|
1106
|
-
const { status:
|
|
1107
|
-
if (
|
|
1105
|
+
const { status: o, setStatus: c } = $.getState();
|
|
1106
|
+
if (o !== "COMPLETED" && o !== "IDLE")
|
|
1108
1107
|
return;
|
|
1109
|
-
const { index:
|
|
1110
|
-
(await
|
|
1108
|
+
const { index: y, addHistory: l } = Q.getState(), E = rt.getState().defaultTransitionName, { transitionName: p = E, layoutId: u = null } = a, I = F.generateTaskId();
|
|
1109
|
+
(await F.addTask(
|
|
1111
1110
|
async () => {
|
|
1112
|
-
|
|
1113
|
-
const
|
|
1114
|
-
Object.entries(s).filter(([
|
|
1115
|
-
),
|
|
1111
|
+
c("PUSHING");
|
|
1112
|
+
const v = q.compile(r)(s), L = q.parse(r).tokens.filter((k) => k.type === "param").map((k) => k.name), S = Object.fromEntries(
|
|
1113
|
+
Object.entries(s).filter(([k]) => !L.includes(k))
|
|
1114
|
+
), A = new URLSearchParams(S).toString(), j = `${v}${A ? `?${A}` : ""}`;
|
|
1116
1115
|
return window.history.pushState(
|
|
1117
1116
|
{
|
|
1118
|
-
id:
|
|
1119
|
-
index:
|
|
1117
|
+
id: I,
|
|
1118
|
+
index: y + 1,
|
|
1120
1119
|
status: "PUSHING",
|
|
1121
1120
|
params: s,
|
|
1122
|
-
transitionName:
|
|
1123
|
-
layoutId:
|
|
1121
|
+
transitionName: p,
|
|
1122
|
+
layoutId: u
|
|
1124
1123
|
},
|
|
1125
1124
|
"",
|
|
1126
|
-
|
|
1125
|
+
j
|
|
1127
1126
|
), l({
|
|
1128
|
-
id:
|
|
1129
|
-
pathname:
|
|
1127
|
+
id: I,
|
|
1128
|
+
pathname: v,
|
|
1130
1129
|
params: s,
|
|
1131
|
-
transitionName:
|
|
1132
|
-
layoutId:
|
|
1130
|
+
transitionName: p,
|
|
1131
|
+
layoutId: u
|
|
1133
1132
|
}), () => {
|
|
1134
|
-
|
|
1133
|
+
c("COMPLETED");
|
|
1135
1134
|
};
|
|
1136
1135
|
},
|
|
1137
1136
|
{
|
|
1138
|
-
id:
|
|
1137
|
+
id: I,
|
|
1139
1138
|
control: {
|
|
1140
1139
|
manual: !0
|
|
1141
1140
|
}
|
|
@@ -1143,39 +1142,39 @@ function te() {
|
|
|
1143
1142
|
)).result?.();
|
|
1144
1143
|
},
|
|
1145
1144
|
replace: async (r, s, a = {}) => {
|
|
1146
|
-
const { status:
|
|
1147
|
-
if (
|
|
1145
|
+
const { status: o, setStatus: c } = $.getState();
|
|
1146
|
+
if (o !== "COMPLETED" && o !== "IDLE")
|
|
1148
1147
|
return;
|
|
1149
|
-
const { index:
|
|
1150
|
-
(await
|
|
1148
|
+
const { index: y, addHistory: l } = Q.getState(), E = Q.getState().replaceHistory, p = rt.getState().defaultTransitionName, { transitionName: u = p, layoutId: I = null } = a, v = F.generateTaskId();
|
|
1149
|
+
(await F.addTask(
|
|
1151
1150
|
async () => {
|
|
1152
|
-
|
|
1153
|
-
const
|
|
1154
|
-
Object.entries(s).filter(([
|
|
1155
|
-
),
|
|
1151
|
+
c("REPLACING");
|
|
1152
|
+
const L = q.compile(r)(s), S = q.parse(r).tokens.filter((H) => H.type === "param").map((H) => H.name), A = Object.fromEntries(
|
|
1153
|
+
Object.entries(s).filter(([H]) => !S.includes(H))
|
|
1154
|
+
), j = new URLSearchParams(A).toString(), k = `${L}${j ? `?${j}` : ""}`;
|
|
1156
1155
|
return window.history.replaceState(
|
|
1157
1156
|
{
|
|
1158
|
-
id:
|
|
1159
|
-
index:
|
|
1157
|
+
id: v,
|
|
1158
|
+
index: y,
|
|
1160
1159
|
status: "REPLACING",
|
|
1161
1160
|
params: s,
|
|
1162
|
-
transitionName:
|
|
1163
|
-
layoutId:
|
|
1161
|
+
transitionName: u,
|
|
1162
|
+
layoutId: I
|
|
1164
1163
|
},
|
|
1165
1164
|
"",
|
|
1166
|
-
|
|
1165
|
+
k
|
|
1167
1166
|
), l({
|
|
1168
|
-
id:
|
|
1169
|
-
pathname:
|
|
1167
|
+
id: v,
|
|
1168
|
+
pathname: L,
|
|
1170
1169
|
params: s,
|
|
1171
|
-
transitionName:
|
|
1172
|
-
layoutId:
|
|
1170
|
+
transitionName: u,
|
|
1171
|
+
layoutId: I
|
|
1173
1172
|
}), async () => {
|
|
1174
|
-
|
|
1173
|
+
E(y), c("COMPLETED");
|
|
1175
1174
|
};
|
|
1176
1175
|
},
|
|
1177
1176
|
{
|
|
1178
|
-
id:
|
|
1177
|
+
id: v,
|
|
1179
1178
|
control: {
|
|
1180
1179
|
manual: !0
|
|
1181
1180
|
}
|
|
@@ -1188,13 +1187,13 @@ function te() {
|
|
|
1188
1187
|
}
|
|
1189
1188
|
};
|
|
1190
1189
|
}
|
|
1191
|
-
function
|
|
1192
|
-
const n =
|
|
1190
|
+
function re() {
|
|
1191
|
+
const n = it(wt);
|
|
1193
1192
|
return {
|
|
1194
1193
|
pushStep: async (s) => {
|
|
1195
1194
|
const a = $.getState().status;
|
|
1196
|
-
a !== "COMPLETED" && a !== "IDLE" || (await
|
|
1197
|
-
const
|
|
1195
|
+
a !== "COMPLETED" && a !== "IDLE" || (await F.addTask(async () => {
|
|
1196
|
+
const o = new URLSearchParams(s).toString(), c = `${window.location.pathname}${o ? `?${o}` : ""}`;
|
|
1198
1197
|
return window.history.state?.step || window.history.replaceState(
|
|
1199
1198
|
{
|
|
1200
1199
|
...window.history.state,
|
|
@@ -1209,14 +1208,14 @@ function ee() {
|
|
|
1209
1208
|
params: s
|
|
1210
1209
|
},
|
|
1211
1210
|
"",
|
|
1212
|
-
|
|
1211
|
+
c
|
|
1213
1212
|
), async () => n({ type: "SET", params: s });
|
|
1214
1213
|
})).result?.();
|
|
1215
1214
|
},
|
|
1216
1215
|
replaceStep: async (s) => {
|
|
1217
1216
|
const a = $.getState().status;
|
|
1218
|
-
a !== "COMPLETED" && a !== "IDLE" || (await
|
|
1219
|
-
const
|
|
1217
|
+
a !== "COMPLETED" && a !== "IDLE" || (await F.addTask(async () => {
|
|
1218
|
+
const o = new URLSearchParams(s).toString(), c = `${window.location.pathname}${o ? `?${o}` : ""}`;
|
|
1220
1219
|
return window.history.replaceState(
|
|
1221
1220
|
{
|
|
1222
1221
|
...window.history.state,
|
|
@@ -1224,7 +1223,7 @@ function ee() {
|
|
|
1224
1223
|
params: s
|
|
1225
1224
|
},
|
|
1226
1225
|
"",
|
|
1227
|
-
|
|
1226
|
+
c
|
|
1228
1227
|
), async () => n({ type: "SET", params: s });
|
|
1229
1228
|
})).result?.();
|
|
1230
1229
|
},
|
|
@@ -1234,25 +1233,22 @@ function ee() {
|
|
|
1234
1233
|
}
|
|
1235
1234
|
};
|
|
1236
1235
|
}
|
|
1237
|
-
function
|
|
1238
|
-
return
|
|
1239
|
-
}
|
|
1240
|
-
function ne() {
|
|
1241
|
-
return nt(yt);
|
|
1236
|
+
function ae() {
|
|
1237
|
+
return it(St);
|
|
1242
1238
|
}
|
|
1243
|
-
function
|
|
1239
|
+
function oe({
|
|
1244
1240
|
name: n,
|
|
1245
1241
|
initial: e,
|
|
1246
1242
|
idle: t,
|
|
1247
1243
|
pushOnEnter: r,
|
|
1248
1244
|
pushOnExit: s,
|
|
1249
1245
|
replaceOnEnter: a,
|
|
1250
|
-
replaceOnExit:
|
|
1251
|
-
popOnEnter:
|
|
1252
|
-
popOnExit:
|
|
1246
|
+
replaceOnExit: o,
|
|
1247
|
+
popOnEnter: c,
|
|
1248
|
+
popOnExit: y,
|
|
1253
1249
|
completedOnExit: l,
|
|
1254
|
-
completedOnEnter:
|
|
1255
|
-
options:
|
|
1250
|
+
completedOnEnter: E,
|
|
1251
|
+
options: p
|
|
1256
1252
|
}) {
|
|
1257
1253
|
return {
|
|
1258
1254
|
name: n,
|
|
@@ -1262,29 +1258,29 @@ function se({
|
|
|
1262
1258
|
"IDLE-false": t,
|
|
1263
1259
|
"PUSHING-false": s,
|
|
1264
1260
|
"PUSHING-true": r,
|
|
1265
|
-
"REPLACING-false":
|
|
1261
|
+
"REPLACING-false": o,
|
|
1266
1262
|
"REPLACING-true": a,
|
|
1267
|
-
"POPPING-false":
|
|
1268
|
-
"POPPING-true":
|
|
1263
|
+
"POPPING-false": y,
|
|
1264
|
+
"POPPING-true": c,
|
|
1269
1265
|
"COMPLETED-false": l,
|
|
1270
|
-
"COMPLETED-true":
|
|
1266
|
+
"COMPLETED-true": E
|
|
1271
1267
|
},
|
|
1272
|
-
...
|
|
1268
|
+
...p
|
|
1273
1269
|
};
|
|
1274
1270
|
}
|
|
1275
|
-
function
|
|
1271
|
+
function ie({
|
|
1276
1272
|
name: n,
|
|
1277
1273
|
initial: e,
|
|
1278
1274
|
idle: t,
|
|
1279
1275
|
pushOnEnter: r,
|
|
1280
1276
|
pushOnExit: s,
|
|
1281
1277
|
replaceOnEnter: a,
|
|
1282
|
-
replaceOnExit:
|
|
1283
|
-
popOnEnter:
|
|
1284
|
-
popOnExit:
|
|
1278
|
+
replaceOnExit: o,
|
|
1279
|
+
popOnEnter: c,
|
|
1280
|
+
popOnExit: y,
|
|
1285
1281
|
completedOnEnter: l,
|
|
1286
|
-
completedOnExit:
|
|
1287
|
-
options:
|
|
1282
|
+
completedOnExit: E,
|
|
1283
|
+
options: p
|
|
1288
1284
|
}) {
|
|
1289
1285
|
return {
|
|
1290
1286
|
name: n,
|
|
@@ -1294,49 +1290,49 @@ function re({
|
|
|
1294
1290
|
"IDLE-false": t,
|
|
1295
1291
|
"PUSHING-false": s,
|
|
1296
1292
|
"PUSHING-true": r,
|
|
1297
|
-
"REPLACING-false":
|
|
1293
|
+
"REPLACING-false": o,
|
|
1298
1294
|
"REPLACING-true": a,
|
|
1299
|
-
"POPPING-false":
|
|
1300
|
-
"POPPING-true":
|
|
1301
|
-
"COMPLETED-false":
|
|
1295
|
+
"POPPING-false": y,
|
|
1296
|
+
"POPPING-true": c,
|
|
1297
|
+
"COMPLETED-false": E,
|
|
1302
1298
|
"COMPLETED-true": l
|
|
1303
1299
|
},
|
|
1304
|
-
...
|
|
1300
|
+
...p
|
|
1305
1301
|
};
|
|
1306
1302
|
}
|
|
1307
|
-
const
|
|
1303
|
+
const Kt = { then() {
|
|
1308
1304
|
} };
|
|
1309
|
-
function
|
|
1305
|
+
function Vt({
|
|
1310
1306
|
freeze: n,
|
|
1311
1307
|
children: e
|
|
1312
1308
|
}) {
|
|
1313
1309
|
if (n)
|
|
1314
|
-
throw
|
|
1310
|
+
throw Kt;
|
|
1315
1311
|
return e;
|
|
1316
1312
|
}
|
|
1317
|
-
function
|
|
1318
|
-
return /* @__PURE__ */
|
|
1313
|
+
function Tt({ freeze: n, children: e, placeholder: t }) {
|
|
1314
|
+
return /* @__PURE__ */ N(Lt, { fallback: t, children: /* @__PURE__ */ N(Vt, { freeze: n, children: e }) });
|
|
1319
1315
|
}
|
|
1320
|
-
function
|
|
1316
|
+
function ht(n, e) {
|
|
1321
1317
|
const {
|
|
1322
1318
|
direction: t = "x",
|
|
1323
1319
|
markerSelector: r = "[data-swipe-at-edge]",
|
|
1324
1320
|
depthLimit: s = 24,
|
|
1325
1321
|
verifyByScroll: a = !1
|
|
1326
|
-
} = e ?? {},
|
|
1327
|
-
if (!
|
|
1328
|
-
const
|
|
1329
|
-
if (
|
|
1330
|
-
return { element:
|
|
1331
|
-
let
|
|
1332
|
-
for (;
|
|
1333
|
-
if (
|
|
1334
|
-
return { element:
|
|
1335
|
-
|
|
1322
|
+
} = e ?? {}, o = zt(n);
|
|
1323
|
+
if (!o) return { element: null, hasMarker: !1 };
|
|
1324
|
+
const c = o.closest?.(r);
|
|
1325
|
+
if (c instanceof HTMLElement && at(c, t) && (!a || yt(c, t)))
|
|
1326
|
+
return { element: c, hasMarker: !0 };
|
|
1327
|
+
let y = o, l = 0;
|
|
1328
|
+
for (; y && y !== document.body && l < s; ) {
|
|
1329
|
+
if (at(y, t) && (!a || yt(y, t)))
|
|
1330
|
+
return { element: y, hasMarker: !1 };
|
|
1331
|
+
y = y.parentElement, l++;
|
|
1336
1332
|
}
|
|
1337
1333
|
return { element: null, hasMarker: !1 };
|
|
1338
1334
|
}
|
|
1339
|
-
function
|
|
1335
|
+
function zt(n) {
|
|
1340
1336
|
if (!n) return null;
|
|
1341
1337
|
const e = n, t = typeof e.composedPath == "function" ? e.composedPath() : void 0;
|
|
1342
1338
|
if (t && t.length) {
|
|
@@ -1345,11 +1341,11 @@ function Xt(n) {
|
|
|
1345
1341
|
}
|
|
1346
1342
|
return n;
|
|
1347
1343
|
}
|
|
1348
|
-
function
|
|
1344
|
+
function at(n, e) {
|
|
1349
1345
|
return e === "y" ? n.scrollHeight - n.clientHeight > 1 : n.scrollWidth - n.clientWidth > 1;
|
|
1350
1346
|
}
|
|
1351
|
-
function
|
|
1352
|
-
if (!
|
|
1347
|
+
function yt(n, e) {
|
|
1348
|
+
if (!at(n, e)) return !1;
|
|
1353
1349
|
if (e === "y") {
|
|
1354
1350
|
const t = n.scrollTop;
|
|
1355
1351
|
if (n.scrollTop = t + 1, n.scrollTop !== t)
|
|
@@ -1366,19 +1362,19 @@ function lt(n, e) {
|
|
|
1366
1362
|
return n.scrollLeft = t, s;
|
|
1367
1363
|
}
|
|
1368
1364
|
}
|
|
1369
|
-
function
|
|
1370
|
-
const { isActive: r, transitionName: s } = V(), [a,
|
|
1371
|
-
|
|
1372
|
-
const
|
|
1373
|
-
return
|
|
1365
|
+
function Wt({ children: n, ref: e, ...t }) {
|
|
1366
|
+
const { isActive: r, transitionName: s } = V(), [a, o] = Et();
|
|
1367
|
+
Nt(e, () => a.current);
|
|
1368
|
+
const c = $((u) => u.status), y = W.get(s), { decoratorName: l } = y, { initial: E, variants: p } = ut.get(l);
|
|
1369
|
+
return Y(() => {
|
|
1374
1370
|
if (!a.current) return;
|
|
1375
|
-
const { value:
|
|
1376
|
-
|
|
1377
|
-
}, [
|
|
1378
|
-
|
|
1371
|
+
const { value: u, options: I } = p[`${c}-${r}`];
|
|
1372
|
+
o(a.current, u, I);
|
|
1373
|
+
}, [c, r, o, p, a]), /* @__PURE__ */ N(
|
|
1374
|
+
z.div,
|
|
1379
1375
|
{
|
|
1380
1376
|
ref: a,
|
|
1381
|
-
initial:
|
|
1377
|
+
initial: E,
|
|
1382
1378
|
style: {
|
|
1383
1379
|
position: "absolute",
|
|
1384
1380
|
top: 0,
|
|
@@ -1392,125 +1388,112 @@ function Kt({ children: n, ref: e, ...t }) {
|
|
|
1392
1388
|
}
|
|
1393
1389
|
);
|
|
1394
1390
|
}
|
|
1395
|
-
const
|
|
1391
|
+
const X = tt((n) => ({
|
|
1396
1392
|
dragStatus: "IDLE",
|
|
1397
1393
|
replaceTransitionStatus: "IDLE",
|
|
1398
1394
|
setDragStatus: (e) => n({ dragStatus: e }),
|
|
1399
1395
|
setReplaceTransitionStatus: (e) => n({ replaceTransitionStatus: e })
|
|
1400
1396
|
}));
|
|
1401
|
-
function
|
|
1402
|
-
|
|
1403
|
-
...e
|
|
1404
|
-
}) {
|
|
1405
|
-
const [t, r] = ft(), { id: s, isActive: a, isRoot: i, transitionName: u, prevTransitionName: f } = V(), l = It(), S = $((E) => E.status), h = q((E) => E.dragStatus), c = q.getState().setDragStatus, L = q.getState().setReplaceTransitionStatus, D = K.get(u), { variants: N, initial: w, swipeDirection: x, decoratorName: F } = D, A = rt.get(F), O = U(null), Y = U(null), X = U(null), o = U(!1), p = U(!1), g = U({
|
|
1397
|
+
function vt({ children: n, appBar: e, navigationBar: t, ...r }) {
|
|
1398
|
+
const [s, a] = Et(), { id: o, isActive: c, isRoot: y, transitionName: l, prevTransitionName: E } = V(), p = xt(), u = $((D) => D.status), I = X((D) => D.dragStatus), v = X.getState().setDragStatus, L = X.getState().setReplaceTransitionStatus, S = W.get(l), { variants: A, initial: j, swipeDirection: k, decoratorName: H } = S, K = ut.get(H), J = _(null), i = _(null), h = _(null), m = _(null), g = _(!1), f = _(!1), d = _({
|
|
1406
1399
|
element: null,
|
|
1407
1400
|
hasMarker: !1
|
|
1408
|
-
}),
|
|
1409
|
-
if (!
|
|
1401
|
+
}), w = _({ element: null, hasMarker: !1 }), P = _(0), M = _(0), T = async (D, b) => {
|
|
1402
|
+
if (!k)
|
|
1410
1403
|
return;
|
|
1411
|
-
O
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1404
|
+
const O = J.current?.previousSibling;
|
|
1405
|
+
i.current = O?.querySelector("[data-screen]"), m.current = O?.querySelector("[data-decorator]");
|
|
1406
|
+
const B = await S?.onSwipeStart(D, b, {
|
|
1407
|
+
animate: a,
|
|
1408
|
+
currentScreen: s.current,
|
|
1409
|
+
prevScreen: i.current,
|
|
1410
|
+
dragControls: p,
|
|
1411
|
+
onStart: (st) => K?.onSwipeStart?.(st, {
|
|
1412
|
+
animate: a,
|
|
1413
|
+
currentDecorator: h.current,
|
|
1414
|
+
prevDecorator: m.current
|
|
1421
1415
|
})
|
|
1422
1416
|
});
|
|
1423
|
-
|
|
1424
|
-
},
|
|
1425
|
-
!
|
|
1426
|
-
animate:
|
|
1427
|
-
currentScreen:
|
|
1428
|
-
prevScreen:
|
|
1429
|
-
dragControls:
|
|
1430
|
-
onProgress: (
|
|
1431
|
-
animate:
|
|
1432
|
-
currentDecorator:
|
|
1433
|
-
prevDecorator:
|
|
1417
|
+
v(B ? "PENDING" : "IDLE");
|
|
1418
|
+
}, C = (D, b) => {
|
|
1419
|
+
!k || I !== "PENDING" || S?.onSwipe(D, b, {
|
|
1420
|
+
animate: a,
|
|
1421
|
+
currentScreen: s.current,
|
|
1422
|
+
prevScreen: i.current,
|
|
1423
|
+
dragControls: p,
|
|
1424
|
+
onProgress: (O, B) => K?.onSwipe?.(O, B, {
|
|
1425
|
+
animate: a,
|
|
1426
|
+
currentDecorator: h.current,
|
|
1427
|
+
prevDecorator: m.current
|
|
1434
1428
|
})
|
|
1435
1429
|
});
|
|
1436
|
-
},
|
|
1437
|
-
if (!
|
|
1430
|
+
}, x = async (D, b) => {
|
|
1431
|
+
if (!k || I !== "PENDING")
|
|
1438
1432
|
return;
|
|
1439
|
-
await
|
|
1440
|
-
animate:
|
|
1441
|
-
currentScreen:
|
|
1442
|
-
prevScreen:
|
|
1443
|
-
onStart: (
|
|
1444
|
-
animate:
|
|
1445
|
-
currentDecorator:
|
|
1446
|
-
prevDecorator:
|
|
1433
|
+
await S?.onSwipeEnd(D, b, {
|
|
1434
|
+
animate: a,
|
|
1435
|
+
currentScreen: s.current,
|
|
1436
|
+
prevScreen: i.current,
|
|
1437
|
+
onStart: (B) => K?.onSwipeEnd?.(B, {
|
|
1438
|
+
animate: a,
|
|
1439
|
+
currentDecorator: h.current,
|
|
1440
|
+
prevDecorator: m.current
|
|
1447
1441
|
})
|
|
1448
|
-
}) ? window.history.back() :
|
|
1449
|
-
},
|
|
1450
|
-
if (!(!
|
|
1442
|
+
}) ? window.history.back() : v("IDLE");
|
|
1443
|
+
}, R = (D) => {
|
|
1444
|
+
if (!(!y && c && u === "COMPLETED" && I === "IDLE" && !!k))
|
|
1451
1445
|
return;
|
|
1452
|
-
|
|
1446
|
+
d.current = ht(D.target, {
|
|
1453
1447
|
direction: "x",
|
|
1454
1448
|
verifyByScroll: !0
|
|
1455
|
-
}),
|
|
1449
|
+
}), w.current = ht(D.target, {
|
|
1456
1450
|
direction: "y",
|
|
1457
1451
|
verifyByScroll: !0
|
|
1458
|
-
}),
|
|
1459
|
-
},
|
|
1460
|
-
const
|
|
1461
|
-
if (
|
|
1462
|
-
|
|
1463
|
-
else if (
|
|
1464
|
-
const
|
|
1465
|
-
(
|
|
1452
|
+
}), P.current = D.clientX, M.current = D.clientY, (!d.current.element && !w.current.element || d.current.element || w.current.element) && (g.current = !0);
|
|
1453
|
+
}, U = (D) => {
|
|
1454
|
+
const b = !d.current.element && !w.current.element;
|
|
1455
|
+
if (g.current && b)
|
|
1456
|
+
g.current = !1, f.current = !0, p.start(D);
|
|
1457
|
+
else if (g.current && !b) {
|
|
1458
|
+
const O = D.clientX - P.current, B = D.clientY - M.current, st = w.current.element && w.current.element.scrollTop <= 0 && w.current.hasMarker, It = d.current.element && d.current.element.scrollLeft <= 0 && d.current.hasMarker;
|
|
1459
|
+
(k === "y" && (st || d.current.element) && B > 0 && Math.abs(O) < 4 || k === "x" && (It || w.current.element) && O > 0 && Math.abs(B) < 4) && (g.current = !1, f.current = !0, p.start(D));
|
|
1466
1460
|
}
|
|
1467
|
-
},
|
|
1468
|
-
|
|
1461
|
+
}, nt = () => {
|
|
1462
|
+
g.current = !1, f.current = !1;
|
|
1469
1463
|
};
|
|
1470
|
-
return
|
|
1471
|
-
const
|
|
1472
|
-
if (!
|
|
1473
|
-
const
|
|
1474
|
-
|
|
1464
|
+
return Y(() => {
|
|
1465
|
+
const D = s.current;
|
|
1466
|
+
if (!D) return;
|
|
1467
|
+
const b = (O) => {
|
|
1468
|
+
f.current && O.preventDefault(), O.target?.dataset.swipeAtEdgeBar === "true" && O.preventDefault();
|
|
1475
1469
|
};
|
|
1476
|
-
return
|
|
1470
|
+
return D.addEventListener("touchmove", b, {
|
|
1477
1471
|
passive: !1
|
|
1478
1472
|
}), () => {
|
|
1479
|
-
|
|
1473
|
+
D.removeEventListener("touchmove", b);
|
|
1480
1474
|
};
|
|
1481
|
-
}, [
|
|
1482
|
-
|
|
1483
|
-
const { value:
|
|
1484
|
-
!
|
|
1475
|
+
}, [s]), Y(() => {
|
|
1476
|
+
s.current && (async () => {
|
|
1477
|
+
const { value: D, options: b } = A[`${u}-${c}`];
|
|
1478
|
+
!c && u === "REPLACING" && E !== l && (L("PENDING"), await a(s.current, Xt, {
|
|
1485
1479
|
duration: 0.1
|
|
1486
|
-
})),
|
|
1480
|
+
})), c && u === "COMPLETED" && (v("IDLE"), L("IDLE")), await a(s.current, D, b), await F.resolveTask(o);
|
|
1487
1481
|
})();
|
|
1488
1482
|
}, [
|
|
1489
|
-
S,
|
|
1490
|
-
a,
|
|
1491
|
-
s,
|
|
1492
|
-
f,
|
|
1493
1483
|
u,
|
|
1494
|
-
r,
|
|
1495
|
-
t,
|
|
1496
|
-
N,
|
|
1497
1484
|
c,
|
|
1485
|
+
o,
|
|
1486
|
+
E,
|
|
1487
|
+
l,
|
|
1488
|
+
a,
|
|
1489
|
+
s,
|
|
1490
|
+
A,
|
|
1491
|
+
v,
|
|
1498
1492
|
L
|
|
1499
|
-
]), /* @__PURE__ */
|
|
1500
|
-
|
|
1493
|
+
]), /* @__PURE__ */ gt(
|
|
1494
|
+
z.div,
|
|
1501
1495
|
{
|
|
1502
|
-
ref:
|
|
1503
|
-
...e,
|
|
1504
|
-
initial: w,
|
|
1505
|
-
drag: x,
|
|
1506
|
-
dragListener: !1,
|
|
1507
|
-
dragControls: l,
|
|
1508
|
-
onDragStart: I,
|
|
1509
|
-
onDrag: T,
|
|
1510
|
-
onDragEnd: R,
|
|
1511
|
-
onPointerDown: P,
|
|
1512
|
-
onPointerMove: C,
|
|
1513
|
-
onPointerUp: k,
|
|
1496
|
+
ref: J,
|
|
1514
1497
|
style: {
|
|
1515
1498
|
position: "absolute",
|
|
1516
1499
|
top: 0,
|
|
@@ -1518,17 +1501,10 @@ function St({
|
|
|
1518
1501
|
width: "100%",
|
|
1519
1502
|
height: "100%",
|
|
1520
1503
|
display: "flex",
|
|
1521
|
-
flexDirection: "column"
|
|
1522
|
-
backgroundColor: "white",
|
|
1523
|
-
boxSizing: "border-box",
|
|
1524
|
-
touchAction: "none",
|
|
1525
|
-
isolation: "isolate",
|
|
1526
|
-
contain: "strict",
|
|
1527
|
-
overscrollBehavior: "contain",
|
|
1528
|
-
...e.style
|
|
1504
|
+
flexDirection: "column"
|
|
1529
1505
|
},
|
|
1530
1506
|
children: [
|
|
1531
|
-
/* @__PURE__ */
|
|
1507
|
+
/* @__PURE__ */ N(
|
|
1532
1508
|
"div",
|
|
1533
1509
|
{
|
|
1534
1510
|
"data-swipe-at-edge-bar": !0,
|
|
@@ -1542,21 +1518,40 @@ function St({
|
|
|
1542
1518
|
}
|
|
1543
1519
|
}
|
|
1544
1520
|
),
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
|
|
1521
|
+
e && /* @__PURE__ */ N(z.div, { children: e }),
|
|
1522
|
+
/* @__PURE__ */ N(
|
|
1523
|
+
z.div,
|
|
1547
1524
|
{
|
|
1525
|
+
ref: s,
|
|
1526
|
+
...r,
|
|
1527
|
+
initial: j,
|
|
1528
|
+
drag: k,
|
|
1529
|
+
dragListener: !1,
|
|
1530
|
+
dragControls: p,
|
|
1531
|
+
onDragStart: T,
|
|
1532
|
+
onDrag: C,
|
|
1533
|
+
onDragEnd: x,
|
|
1534
|
+
onPointerDown: R,
|
|
1535
|
+
onPointerMove: U,
|
|
1536
|
+
onPointerUp: nt,
|
|
1537
|
+
"data-screen": !0,
|
|
1548
1538
|
style: {
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1539
|
+
flexGrow: 1,
|
|
1540
|
+
backgroundColor: "white",
|
|
1541
|
+
boxSizing: "border-box",
|
|
1542
|
+
isolation: "isolate",
|
|
1543
|
+
contain: "strict",
|
|
1544
|
+
overscrollBehavior: "contain",
|
|
1545
|
+
overflowY: "auto",
|
|
1546
|
+
touchAction: "none",
|
|
1547
|
+
...r.style
|
|
1554
1548
|
},
|
|
1555
1549
|
children: n
|
|
1556
1550
|
}
|
|
1557
1551
|
),
|
|
1558
|
-
|
|
1559
|
-
/* @__PURE__ */
|
|
1552
|
+
t && /* @__PURE__ */ N(z.div, { children: t }),
|
|
1553
|
+
K && /* @__PURE__ */ N(Wt, { ref: h }),
|
|
1554
|
+
/* @__PURE__ */ N(
|
|
1560
1555
|
"div",
|
|
1561
1556
|
{
|
|
1562
1557
|
"data-swipe-at-edge-bar": !0,
|
|
@@ -1574,34 +1569,28 @@ function St({
|
|
|
1574
1569
|
}
|
|
1575
1570
|
);
|
|
1576
1571
|
}
|
|
1577
|
-
function
|
|
1578
|
-
|
|
1579
|
-
...e
|
|
1580
|
-
}) {
|
|
1581
|
-
const { isActive: t, isPrev: r, zIndex: s } = V(), a = H((h) => h.index), i = $((h) => h.status), u = q((h) => h.dragStatus), f = q((h) => h.replaceTransitionStatus), S = !t && (i === "COMPLETED" && u === "IDLE") || r && a - 2 <= s && f === "IDLE" || r && a - 2 > s;
|
|
1582
|
-
return /* @__PURE__ */ M(Et, { freeze: S, children: /* @__PURE__ */ M(St, { ...e, children: n }) });
|
|
1572
|
+
function ce({ children: n, ...e }) {
|
|
1573
|
+
const { isActive: t, isPrev: r, zIndex: s } = V(), a = Q((p) => p.index), o = $((p) => p.status), c = X((p) => p.dragStatus), y = X((p) => p.replaceTransitionStatus), E = !t && (o === "COMPLETED" && c === "IDLE") || r && a - 2 <= s && y === "IDLE" || r && a - 2 > s;
|
|
1574
|
+
return /* @__PURE__ */ N(Tt, { freeze: E, children: /* @__PURE__ */ N(vt, { ...e, children: n }) });
|
|
1583
1575
|
}
|
|
1584
|
-
function
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
const { isActive: t, isPrev: r, zIndex: s } = V(), a = H((h) => h.index), i = $((h) => h.status), u = q((h) => h.dragStatus), f = q((h) => h.replaceTransitionStatus), S = !t && (i === "COMPLETED" && u === "IDLE") || r && a - 2 <= s && f === "IDLE" || r && a - 2 > s;
|
|
1589
|
-
return /* @__PURE__ */ M(Et, { freeze: S, children: /* @__PURE__ */ M(
|
|
1590
|
-
St,
|
|
1576
|
+
function ue({ children: n, ...e }) {
|
|
1577
|
+
const { isActive: t, isPrev: r, zIndex: s } = V(), a = Q((p) => p.index), o = $((p) => p.status), c = X((p) => p.dragStatus), y = X((p) => p.replaceTransitionStatus), E = !t && (o === "COMPLETED" && c === "IDLE") || r && a - 2 <= s && y === "IDLE" || r && a - 2 > s;
|
|
1578
|
+
return /* @__PURE__ */ N(Tt, { freeze: E, children: /* @__PURE__ */ N(
|
|
1579
|
+
vt,
|
|
1591
1580
|
{
|
|
1592
1581
|
...e,
|
|
1593
1582
|
style: {
|
|
1594
1583
|
backgroundColor: "transparent",
|
|
1595
1584
|
...e.style
|
|
1596
1585
|
},
|
|
1597
|
-
children: /* @__PURE__ */
|
|
1586
|
+
children: /* @__PURE__ */ N(kt, { children: n })
|
|
1598
1587
|
}
|
|
1599
1588
|
) });
|
|
1600
1589
|
}
|
|
1601
|
-
function
|
|
1602
|
-
const { isActive: t, transitionName: r } = V(), s = $((
|
|
1603
|
-
return /* @__PURE__ */
|
|
1604
|
-
|
|
1590
|
+
function le({ children: n, ...e }) {
|
|
1591
|
+
const { isActive: t, transitionName: r } = V(), s = $((o) => o.status), a = W.get(r);
|
|
1592
|
+
return /* @__PURE__ */ N(
|
|
1593
|
+
Mt,
|
|
1605
1594
|
{
|
|
1606
1595
|
transition: a?.variants[`${s}-${t}`]?.options,
|
|
1607
1596
|
...e,
|
|
@@ -1610,17 +1599,17 @@ function ie({ children: n, ...e }) {
|
|
|
1610
1599
|
);
|
|
1611
1600
|
}
|
|
1612
1601
|
export {
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1602
|
+
le as LayoutConfig,
|
|
1603
|
+
ue as LayoutScreen,
|
|
1604
|
+
ne as Route,
|
|
1605
|
+
ee as Router,
|
|
1606
|
+
ce as Screen,
|
|
1607
|
+
Ft as createDecorator,
|
|
1608
|
+
ie as createRawDecorator,
|
|
1609
|
+
oe as createRawTransition,
|
|
1610
|
+
et as createTransition,
|
|
1611
|
+
se as useNavigate,
|
|
1612
|
+
ae as useParams,
|
|
1624
1613
|
V as useScreen,
|
|
1625
|
-
|
|
1614
|
+
re as useStep
|
|
1626
1615
|
};
|