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