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