@argon-router/core 0.5.1 → 0.6.1
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/README.md +2 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +134 -8
- package/dist/index.js +710 -797
- package/package.json +4 -5
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { createEffect as
|
|
2
|
-
|
|
3
|
-
function re(e, t) {
|
|
1
|
+
import { createEffect as A, createStore as v, createEvent as m, sample as y, split as Q, attach as B, scopeBind as E } from "effector";
|
|
2
|
+
function _(e, t) {
|
|
4
3
|
var r = Object.keys(e);
|
|
5
4
|
if (Object.getOwnPropertySymbols) {
|
|
6
5
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -10,25 +9,25 @@ function re(e, t) {
|
|
|
10
9
|
}
|
|
11
10
|
return r;
|
|
12
11
|
}
|
|
13
|
-
function
|
|
12
|
+
function $(e) {
|
|
14
13
|
for (var t = 1; t < arguments.length; t++) {
|
|
15
14
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
16
|
-
t % 2 ?
|
|
17
|
-
|
|
18
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
15
|
+
t % 2 ? _(Object(r), !0).forEach(function(n) {
|
|
16
|
+
ie(e, n, r[n]);
|
|
17
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : _(Object(r)).forEach(function(n) {
|
|
19
18
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
20
19
|
});
|
|
21
20
|
}
|
|
22
21
|
return e;
|
|
23
22
|
}
|
|
24
|
-
function
|
|
25
|
-
return (t =
|
|
23
|
+
function ie(e, t, r) {
|
|
24
|
+
return (t = se(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
26
25
|
}
|
|
27
|
-
function
|
|
28
|
-
var t =
|
|
26
|
+
function se(e) {
|
|
27
|
+
var t = ce(e, "string");
|
|
29
28
|
return typeof t == "symbol" ? t : t + "";
|
|
30
29
|
}
|
|
31
|
-
function
|
|
30
|
+
function ce(e, t) {
|
|
32
31
|
if (typeof e != "object" || !e) return e;
|
|
33
32
|
var r = e[Symbol.toPrimitive];
|
|
34
33
|
if (r !== void 0) {
|
|
@@ -38,469 +37,154 @@ function Se(e, t) {
|
|
|
38
37
|
}
|
|
39
38
|
return (t === "string" ? String : Number)(e);
|
|
40
39
|
}
|
|
41
|
-
function
|
|
40
|
+
function Be(e) {
|
|
42
41
|
let t;
|
|
43
|
-
const r =
|
|
44
|
-
var
|
|
45
|
-
return (
|
|
42
|
+
const r = A(() => {
|
|
43
|
+
var g;
|
|
44
|
+
return (g = t) === null || g === void 0 ? void 0 : g();
|
|
46
45
|
}, {
|
|
47
46
|
name: "waitForAsyncBundleFx",
|
|
48
|
-
sid: "
|
|
49
|
-
}), n =
|
|
50
|
-
for (const
|
|
51
|
-
var
|
|
52
|
-
await
|
|
47
|
+
sid: "-au0m0h"
|
|
48
|
+
}), n = A(async () => {
|
|
49
|
+
for (const u of (g = e.beforeOpen) !== null && g !== void 0 ? g : []) {
|
|
50
|
+
var g;
|
|
51
|
+
await u();
|
|
53
52
|
}
|
|
54
53
|
}, {
|
|
55
54
|
name: "beforeOpenFx",
|
|
56
|
-
sid: "
|
|
57
|
-
}), a =
|
|
55
|
+
sid: "-iy13uf"
|
|
56
|
+
}), a = A(async (g) => {
|
|
58
57
|
await r(), await n();
|
|
59
|
-
const
|
|
60
|
-
return
|
|
58
|
+
const u = e.parent;
|
|
59
|
+
return u && await u.internal.openFx($($({}, g ?? {
|
|
61
60
|
params: {}
|
|
62
61
|
}), {}, {
|
|
63
62
|
navigate: !1
|
|
64
|
-
})),
|
|
63
|
+
})), g;
|
|
65
64
|
}, {
|
|
66
65
|
name: "openFx",
|
|
67
|
-
sid: "
|
|
68
|
-
}),
|
|
66
|
+
sid: "cbmc2y"
|
|
67
|
+
}), o = v({}, {
|
|
69
68
|
name: "$params",
|
|
70
|
-
sid: "
|
|
71
|
-
}),
|
|
69
|
+
sid: "-cxehz9"
|
|
70
|
+
}), i = v(!1, {
|
|
72
71
|
name: "$isOpened",
|
|
73
|
-
sid: "-
|
|
74
|
-
}),
|
|
72
|
+
sid: "-561dht"
|
|
73
|
+
}), s = a.pending, c = m({
|
|
75
74
|
name: "open",
|
|
76
|
-
sid: "
|
|
77
|
-
}),
|
|
75
|
+
sid: "hyxmmx"
|
|
76
|
+
}), p = m({
|
|
78
77
|
name: "close",
|
|
79
|
-
sid: "
|
|
80
|
-
}),
|
|
78
|
+
sid: "-wvbr5n"
|
|
79
|
+
}), w = m({
|
|
81
80
|
name: "opened",
|
|
82
|
-
sid: "
|
|
83
|
-
}),
|
|
81
|
+
sid: "-qni80y"
|
|
82
|
+
}), f = m({
|
|
84
83
|
name: "openedOnServer",
|
|
85
|
-
sid: "
|
|
86
|
-
}),
|
|
84
|
+
sid: "eh9oki"
|
|
85
|
+
}), O = m({
|
|
87
86
|
name: "openedOnClient",
|
|
88
|
-
sid: "
|
|
89
|
-
}),
|
|
87
|
+
sid: "eet6mh"
|
|
88
|
+
}), l = m({
|
|
90
89
|
name: "navigated",
|
|
91
|
-
sid: "
|
|
92
|
-
}),
|
|
90
|
+
sid: "-rnvpuc"
|
|
91
|
+
}), F = m({
|
|
93
92
|
name: "closed",
|
|
94
|
-
sid: "
|
|
93
|
+
sid: "w9iziz"
|
|
95
94
|
});
|
|
96
|
-
|
|
95
|
+
y({
|
|
97
96
|
and: [{
|
|
98
|
-
clock:
|
|
97
|
+
clock: c,
|
|
99
98
|
target: a
|
|
100
99
|
}],
|
|
101
100
|
or: {
|
|
102
|
-
sid: "
|
|
101
|
+
sid: "u86cfp"
|
|
103
102
|
}
|
|
104
103
|
});
|
|
105
|
-
const
|
|
106
|
-
return
|
|
104
|
+
const S = {};
|
|
105
|
+
return y({
|
|
107
106
|
and: [{
|
|
108
|
-
clock:
|
|
109
|
-
fn: (
|
|
110
|
-
target:
|
|
107
|
+
clock: l,
|
|
108
|
+
fn: (g) => g && "params" in g ? $({}, g.params) : S,
|
|
109
|
+
target: o
|
|
111
110
|
}],
|
|
112
111
|
or: {
|
|
113
|
-
sid: "
|
|
112
|
+
sid: "ymu9q6"
|
|
114
113
|
}
|
|
115
|
-
}),
|
|
114
|
+
}), Q({
|
|
116
115
|
and: [{
|
|
117
|
-
source:
|
|
116
|
+
source: l,
|
|
118
117
|
match: () => typeof window > "u" ? "server" : "client",
|
|
119
118
|
cases: {
|
|
120
|
-
server:
|
|
121
|
-
client:
|
|
119
|
+
server: f,
|
|
120
|
+
client: O
|
|
122
121
|
}
|
|
123
122
|
}],
|
|
124
123
|
or: {
|
|
125
|
-
sid: "
|
|
124
|
+
sid: "z4zhb3"
|
|
126
125
|
}
|
|
127
|
-
}),
|
|
126
|
+
}), y({
|
|
128
127
|
and: [{
|
|
129
|
-
clock: [
|
|
130
|
-
target:
|
|
128
|
+
clock: [O, f],
|
|
129
|
+
target: w
|
|
131
130
|
}],
|
|
132
131
|
or: {
|
|
133
|
-
sid: "
|
|
132
|
+
sid: "-zf2y9u"
|
|
134
133
|
}
|
|
135
|
-
}),
|
|
134
|
+
}), y({
|
|
136
135
|
and: [{
|
|
137
|
-
clock:
|
|
138
|
-
target:
|
|
136
|
+
clock: p,
|
|
137
|
+
target: F
|
|
139
138
|
}],
|
|
140
139
|
or: {
|
|
141
|
-
sid: "
|
|
140
|
+
sid: "-z0saug"
|
|
142
141
|
}
|
|
143
|
-
}),
|
|
142
|
+
}), y({
|
|
144
143
|
and: [{
|
|
145
|
-
clock: [
|
|
146
|
-
target:
|
|
144
|
+
clock: [w.map(() => !0), F.map(() => !1)],
|
|
145
|
+
target: i
|
|
147
146
|
}],
|
|
148
147
|
or: {
|
|
149
|
-
sid: "
|
|
148
|
+
sid: "-yy1bvn"
|
|
150
149
|
}
|
|
151
|
-
}), {
|
|
152
|
-
$params:
|
|
153
|
-
$isOpened:
|
|
154
|
-
$isPending:
|
|
155
|
-
open:
|
|
156
|
-
closed:
|
|
157
|
-
opened:
|
|
158
|
-
openedOnClient:
|
|
159
|
-
openedOnServer:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
150
|
+
}), $($({
|
|
151
|
+
$params: o,
|
|
152
|
+
$isOpened: i,
|
|
153
|
+
$isPending: s,
|
|
154
|
+
open: c,
|
|
155
|
+
closed: F,
|
|
156
|
+
opened: w,
|
|
157
|
+
openedOnClient: O,
|
|
158
|
+
openedOnServer: f
|
|
159
|
+
}, e), {}, {
|
|
160
|
+
internal: {
|
|
161
|
+
navigated: l,
|
|
162
|
+
close: p,
|
|
163
163
|
openFx: a,
|
|
164
|
-
setAsyncImport: (
|
|
165
|
-
},
|
|
164
|
+
setAsyncImport: (g) => t = g
|
|
165
|
+
},
|
|
166
166
|
"@@unitShape": () => ({
|
|
167
|
-
params:
|
|
168
|
-
isPending:
|
|
169
|
-
isOpened:
|
|
170
|
-
onOpen:
|
|
167
|
+
params: o,
|
|
168
|
+
isPending: s,
|
|
169
|
+
isOpened: i,
|
|
170
|
+
onOpen: c
|
|
171
171
|
})
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
var C = {}, te;
|
|
175
|
-
function ve() {
|
|
176
|
-
if (te) return C;
|
|
177
|
-
te = 1, Object.defineProperty(C, "__esModule", {
|
|
178
|
-
value: !0
|
|
179
|
-
}), C.TokenData = void 0, C.parse = v, C.compile = j, C.match = k, C.pathToRegexp = l, C.stringify = M;
|
|
180
|
-
const e = "/", t = (c) => c, r = /^[$_\p{ID_Start}]$/u, n = /^[$\u200c\u200d\p{ID_Continue}]$/u, a = "https://git.new/pathToRegexpError", i = {
|
|
181
|
-
// Groups.
|
|
182
|
-
"{": "{",
|
|
183
|
-
"}": "}",
|
|
184
|
-
// Reserved.
|
|
185
|
-
"(": "(",
|
|
186
|
-
")": ")",
|
|
187
|
-
"[": "[",
|
|
188
|
-
"]": "]",
|
|
189
|
-
"+": "+",
|
|
190
|
-
"?": "?",
|
|
191
|
-
"!": "!"
|
|
192
|
-
};
|
|
193
|
-
function o(c) {
|
|
194
|
-
return c.replace(/[{}()\[\]+?!:*]/g, "\\$&");
|
|
195
|
-
}
|
|
196
|
-
function u(c) {
|
|
197
|
-
return c.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
|
|
198
|
-
}
|
|
199
|
-
function* w(c) {
|
|
200
|
-
const f = [...c];
|
|
201
|
-
let s = 0;
|
|
202
|
-
function m() {
|
|
203
|
-
let d = "";
|
|
204
|
-
if (r.test(f[++s]))
|
|
205
|
-
for (d += f[s]; n.test(f[++s]); )
|
|
206
|
-
d += f[s];
|
|
207
|
-
else if (f[s] === '"') {
|
|
208
|
-
let p = s;
|
|
209
|
-
for (; s < f.length; ) {
|
|
210
|
-
if (f[++s] === '"') {
|
|
211
|
-
s++, p = 0;
|
|
212
|
-
break;
|
|
213
|
-
}
|
|
214
|
-
f[s] === "\\" ? d += f[++s] : d += f[s];
|
|
215
|
-
}
|
|
216
|
-
if (p)
|
|
217
|
-
throw new TypeError(`Unterminated quote at ${p}: ${a}`);
|
|
218
|
-
}
|
|
219
|
-
if (!d)
|
|
220
|
-
throw new TypeError(`Missing parameter name at ${s}: ${a}`);
|
|
221
|
-
return d;
|
|
222
|
-
}
|
|
223
|
-
for (; s < f.length; ) {
|
|
224
|
-
const d = f[s], p = i[d];
|
|
225
|
-
if (p)
|
|
226
|
-
yield {
|
|
227
|
-
type: p,
|
|
228
|
-
index: s++,
|
|
229
|
-
value: d
|
|
230
|
-
};
|
|
231
|
-
else if (d === "\\")
|
|
232
|
-
yield {
|
|
233
|
-
type: "ESCAPED",
|
|
234
|
-
index: s++,
|
|
235
|
-
value: f[s++]
|
|
236
|
-
};
|
|
237
|
-
else if (d === ":") {
|
|
238
|
-
const b = m();
|
|
239
|
-
yield {
|
|
240
|
-
type: "PARAM",
|
|
241
|
-
index: s,
|
|
242
|
-
value: b
|
|
243
|
-
};
|
|
244
|
-
} else if (d === "*") {
|
|
245
|
-
const b = m();
|
|
246
|
-
yield {
|
|
247
|
-
type: "WILDCARD",
|
|
248
|
-
index: s,
|
|
249
|
-
value: b
|
|
250
|
-
};
|
|
251
|
-
} else
|
|
252
|
-
yield {
|
|
253
|
-
type: "CHAR",
|
|
254
|
-
index: s,
|
|
255
|
-
value: f[s++]
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
return {
|
|
259
|
-
type: "END",
|
|
260
|
-
index: s,
|
|
261
|
-
value: ""
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
class P {
|
|
265
|
-
constructor(f) {
|
|
266
|
-
this.tokens = f;
|
|
267
|
-
}
|
|
268
|
-
peek() {
|
|
269
|
-
if (!this._peek) {
|
|
270
|
-
const f = this.tokens.next();
|
|
271
|
-
this._peek = f.value;
|
|
272
|
-
}
|
|
273
|
-
return this._peek;
|
|
274
|
-
}
|
|
275
|
-
tryConsume(f) {
|
|
276
|
-
const s = this.peek();
|
|
277
|
-
if (s.type === f)
|
|
278
|
-
return this._peek = void 0, s.value;
|
|
279
|
-
}
|
|
280
|
-
consume(f) {
|
|
281
|
-
const s = this.tryConsume(f);
|
|
282
|
-
if (s !== void 0) return s;
|
|
283
|
-
const {
|
|
284
|
-
type: m,
|
|
285
|
-
index: d
|
|
286
|
-
} = this.peek();
|
|
287
|
-
throw new TypeError(`Unexpected ${m} at ${d}, expected ${f}: ${a}`);
|
|
288
|
-
}
|
|
289
|
-
text() {
|
|
290
|
-
let f = "", s;
|
|
291
|
-
for (; s = this.tryConsume("CHAR") || this.tryConsume("ESCAPED"); )
|
|
292
|
-
f += s;
|
|
293
|
-
return f;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
class E {
|
|
297
|
-
constructor(f) {
|
|
298
|
-
this.tokens = f;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
C.TokenData = E;
|
|
302
|
-
function v(c, f = {}) {
|
|
303
|
-
const {
|
|
304
|
-
encodePath: s = t
|
|
305
|
-
} = f, m = new P(w(c));
|
|
306
|
-
function d(b) {
|
|
307
|
-
const g = [];
|
|
308
|
-
for (; ; ) {
|
|
309
|
-
const N = m.text();
|
|
310
|
-
N && g.push({
|
|
311
|
-
type: "text",
|
|
312
|
-
value: s(N)
|
|
313
|
-
});
|
|
314
|
-
const R = m.tryConsume("PARAM");
|
|
315
|
-
if (R) {
|
|
316
|
-
g.push({
|
|
317
|
-
type: "param",
|
|
318
|
-
name: R
|
|
319
|
-
});
|
|
320
|
-
continue;
|
|
321
|
-
}
|
|
322
|
-
const L = m.tryConsume("WILDCARD");
|
|
323
|
-
if (L) {
|
|
324
|
-
g.push({
|
|
325
|
-
type: "wildcard",
|
|
326
|
-
name: L
|
|
327
|
-
});
|
|
328
|
-
continue;
|
|
329
|
-
}
|
|
330
|
-
if (m.tryConsume("{")) {
|
|
331
|
-
g.push({
|
|
332
|
-
type: "group",
|
|
333
|
-
tokens: d("}")
|
|
334
|
-
});
|
|
335
|
-
continue;
|
|
336
|
-
}
|
|
337
|
-
return m.consume(b), g;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
const p = d("END");
|
|
341
|
-
return new E(p);
|
|
342
|
-
}
|
|
343
|
-
function j(c, f = {}) {
|
|
344
|
-
const {
|
|
345
|
-
encode: s = encodeURIComponent,
|
|
346
|
-
delimiter: m = e
|
|
347
|
-
} = f, d = c instanceof E ? c : v(c, f), p = S(d.tokens, m, s);
|
|
348
|
-
return function(g = {}) {
|
|
349
|
-
const [N, ...R] = p(g);
|
|
350
|
-
if (R.length)
|
|
351
|
-
throw new TypeError(`Missing parameters: ${R.join(", ")}`);
|
|
352
|
-
return N;
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
function S(c, f, s) {
|
|
356
|
-
const m = c.map((d) => A(d, f, s));
|
|
357
|
-
return (d) => {
|
|
358
|
-
const p = [""];
|
|
359
|
-
for (const b of m) {
|
|
360
|
-
const [g, ...N] = b(d);
|
|
361
|
-
p[0] += g, p.push(...N);
|
|
362
|
-
}
|
|
363
|
-
return p;
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
function A(c, f, s) {
|
|
367
|
-
if (c.type === "text") return () => [c.value];
|
|
368
|
-
if (c.type === "group") {
|
|
369
|
-
const d = S(c.tokens, f, s);
|
|
370
|
-
return (p) => {
|
|
371
|
-
const [b, ...g] = d(p);
|
|
372
|
-
return g.length ? [""] : [b];
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
const m = s || t;
|
|
376
|
-
return c.type === "wildcard" && s !== !1 ? (d) => {
|
|
377
|
-
const p = d[c.name];
|
|
378
|
-
if (p == null) return ["", c.name];
|
|
379
|
-
if (!Array.isArray(p) || p.length === 0)
|
|
380
|
-
throw new TypeError(`Expected "${c.name}" to be a non-empty array`);
|
|
381
|
-
return [p.map((b, g) => {
|
|
382
|
-
if (typeof b != "string")
|
|
383
|
-
throw new TypeError(`Expected "${c.name}/${g}" to be a string`);
|
|
384
|
-
return m(b);
|
|
385
|
-
}).join(f)];
|
|
386
|
-
} : (d) => {
|
|
387
|
-
const p = d[c.name];
|
|
388
|
-
if (p == null) return ["", c.name];
|
|
389
|
-
if (typeof p != "string")
|
|
390
|
-
throw new TypeError(`Expected "${c.name}" to be a string`);
|
|
391
|
-
return [m(p)];
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
function k(c, f = {}) {
|
|
395
|
-
const {
|
|
396
|
-
decode: s = decodeURIComponent,
|
|
397
|
-
delimiter: m = e
|
|
398
|
-
} = f, {
|
|
399
|
-
regexp: d,
|
|
400
|
-
keys: p
|
|
401
|
-
} = l(c, f), b = p.map((g) => s === !1 ? t : g.type === "param" ? s : (N) => N.split(m).map(s));
|
|
402
|
-
return function(N) {
|
|
403
|
-
const R = d.exec(N);
|
|
404
|
-
if (!R) return !1;
|
|
405
|
-
const L = R[0], U = /* @__PURE__ */ Object.create(null);
|
|
406
|
-
for (let z = 1; z < R.length; z++) {
|
|
407
|
-
if (R[z] === void 0) continue;
|
|
408
|
-
const q = p[z - 1], K = b[z - 1];
|
|
409
|
-
U[q.name] = K(R[z]);
|
|
410
|
-
}
|
|
411
|
-
return {
|
|
412
|
-
path: L,
|
|
413
|
-
params: U
|
|
414
|
-
};
|
|
415
|
-
};
|
|
416
|
-
}
|
|
417
|
-
function l(c, f = {}) {
|
|
418
|
-
const {
|
|
419
|
-
delimiter: s = e,
|
|
420
|
-
end: m = !0,
|
|
421
|
-
sensitive: d = !1,
|
|
422
|
-
trailing: p = !0
|
|
423
|
-
} = f, b = [], g = [], N = d ? "" : "i", L = (Array.isArray(c) ? c : [c]).map((q) => q instanceof E ? q : v(q, f));
|
|
424
|
-
for (const {
|
|
425
|
-
tokens: q
|
|
426
|
-
} of L)
|
|
427
|
-
for (const K of y(q, 0, [])) {
|
|
428
|
-
const Oe = h(K, s, b);
|
|
429
|
-
g.push(Oe);
|
|
430
|
-
}
|
|
431
|
-
let U = `^(?:${g.join("|")})`;
|
|
432
|
-
return p && (U += `(?:${u(s)}$)?`), U += m ? "$" : `(?=${u(s)}|$)`, {
|
|
433
|
-
regexp: new RegExp(U, N),
|
|
434
|
-
keys: b
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
function* y(c, f, s) {
|
|
438
|
-
if (f === c.length)
|
|
439
|
-
return yield s;
|
|
440
|
-
const m = c[f];
|
|
441
|
-
if (m.type === "group") {
|
|
442
|
-
const d = s.slice();
|
|
443
|
-
for (const p of y(m.tokens, 0, d))
|
|
444
|
-
yield* y(c, f + 1, p);
|
|
445
|
-
} else
|
|
446
|
-
s.push(m);
|
|
447
|
-
yield* y(c, f + 1, s);
|
|
448
|
-
}
|
|
449
|
-
function h(c, f, s) {
|
|
450
|
-
let m = "", d = "", p = !0;
|
|
451
|
-
for (let b = 0; b < c.length; b++) {
|
|
452
|
-
const g = c[b];
|
|
453
|
-
if (g.type === "text") {
|
|
454
|
-
m += u(g.value), d += g.value, p || (p = g.value.includes(f));
|
|
455
|
-
continue;
|
|
456
|
-
}
|
|
457
|
-
if (g.type === "param" || g.type === "wildcard") {
|
|
458
|
-
if (!p && !d)
|
|
459
|
-
throw new TypeError(`Missing text after "${g.name}": ${a}`);
|
|
460
|
-
g.type === "param" ? m += `(${$(f, p ? "" : d)}+)` : m += "([\\s\\S]+)", s.push(g), d = "", p = !1;
|
|
461
|
-
continue;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
return m;
|
|
465
|
-
}
|
|
466
|
-
function $(c, f) {
|
|
467
|
-
return f.length < 2 ? c.length < 2 ? `[^${u(c + f)}]` : `(?:(?!${u(c)})[^${u(f)}])` : c.length < 2 ? `(?:(?!${u(f)})[^${u(c)}])` : `(?:(?!${u(f)}|${u(c)})[\\s\\S])`;
|
|
468
|
-
}
|
|
469
|
-
function M(c) {
|
|
470
|
-
return c.tokens.map(function f(s, m, d) {
|
|
471
|
-
if (s.type === "text") return o(s.value);
|
|
472
|
-
if (s.type === "group")
|
|
473
|
-
return `{${s.tokens.map(f).join("")}}`;
|
|
474
|
-
const b = _(s.name) && V(d[m + 1]) ? s.name : JSON.stringify(s.name);
|
|
475
|
-
if (s.type === "param") return `:${b}`;
|
|
476
|
-
if (s.type === "wildcard") return `*${b}`;
|
|
477
|
-
throw new TypeError(`Unexpected token: ${s}`);
|
|
478
|
-
}).join("");
|
|
479
|
-
}
|
|
480
|
-
function _(c) {
|
|
481
|
-
const [f, ...s] = c;
|
|
482
|
-
return r.test(f) ? s.every((m) => n.test(m)) : !1;
|
|
483
|
-
}
|
|
484
|
-
function V(c) {
|
|
485
|
-
return (c == null ? void 0 : c.type) !== "text" ? !0 : !n.test(c.value[0]);
|
|
486
|
-
}
|
|
487
|
-
return C;
|
|
172
|
+
});
|
|
488
173
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
boolean: Ne
|
|
174
|
+
const ue = Symbol("any"), fe = Symbol("number"), le = Symbol("string"), de = Symbol("array"), pe = Symbol("boolean"), P = {
|
|
175
|
+
any: ue,
|
|
176
|
+
number: fe,
|
|
177
|
+
string: le,
|
|
178
|
+
array: de,
|
|
179
|
+
boolean: pe
|
|
496
180
|
};
|
|
497
|
-
function
|
|
181
|
+
function q(e, t) {
|
|
498
182
|
for (const r of e)
|
|
499
183
|
if (t.includes(r))
|
|
500
184
|
return !0;
|
|
501
185
|
return !1;
|
|
502
186
|
}
|
|
503
|
-
function
|
|
187
|
+
function T(e, t) {
|
|
504
188
|
for (const r in t) {
|
|
505
189
|
const n = t[r];
|
|
506
190
|
if (Array.isArray(n) && (!e[r] || JSON.stringify(n) !== e[r]))
|
|
@@ -528,27 +212,27 @@ function se(e, t) {
|
|
|
528
212
|
}
|
|
529
213
|
}
|
|
530
214
|
switch (n) {
|
|
531
|
-
case
|
|
215
|
+
case P.any: {
|
|
532
216
|
if (!e[r])
|
|
533
217
|
return !1;
|
|
534
218
|
break;
|
|
535
219
|
}
|
|
536
|
-
case
|
|
220
|
+
case P.string: {
|
|
537
221
|
if (!e[r] || Array.isArray(e[r]))
|
|
538
222
|
return !1;
|
|
539
223
|
break;
|
|
540
224
|
}
|
|
541
|
-
case
|
|
225
|
+
case P.array: {
|
|
542
226
|
if (!e[r] || !Array.isArray(e[r]))
|
|
543
227
|
return !1;
|
|
544
228
|
break;
|
|
545
229
|
}
|
|
546
|
-
case
|
|
230
|
+
case P.number: {
|
|
547
231
|
if (!e[r] || Array.isArray(e[r]) || isNaN(parseInt(e[r])) && isNaN(parseFloat(e[r])))
|
|
548
232
|
return !1;
|
|
549
233
|
break;
|
|
550
234
|
}
|
|
551
|
-
case
|
|
235
|
+
case P.boolean: {
|
|
552
236
|
if (!e[r] || Array.isArray(e[r]) || !["0", "1", "false", "true"].includes(e[r]))
|
|
553
237
|
return !1;
|
|
554
238
|
break;
|
|
@@ -557,53 +241,53 @@ function se(e, t) {
|
|
|
557
241
|
}
|
|
558
242
|
return !0;
|
|
559
243
|
}
|
|
560
|
-
function
|
|
244
|
+
function me(e, t) {
|
|
561
245
|
const r = {};
|
|
562
246
|
for (const n in t) {
|
|
563
|
-
const a = t[n],
|
|
247
|
+
const a = t[n], o = e[n];
|
|
564
248
|
if (Array.isArray(a)) {
|
|
565
|
-
const
|
|
566
|
-
r[n] =
|
|
249
|
+
const i = e[n];
|
|
250
|
+
r[n] = i;
|
|
567
251
|
continue;
|
|
568
252
|
}
|
|
569
253
|
switch (typeof a) {
|
|
570
254
|
case "number": {
|
|
571
|
-
r[n] = isNaN(parseInt(
|
|
255
|
+
r[n] = isNaN(parseInt(o)) ? parseFloat(o) : parseInt(o);
|
|
572
256
|
break;
|
|
573
257
|
}
|
|
574
258
|
case "object": {
|
|
575
|
-
r[n] = JSON.parse(
|
|
259
|
+
r[n] = JSON.parse(o);
|
|
576
260
|
break;
|
|
577
261
|
}
|
|
578
262
|
case "string":
|
|
579
|
-
r[n] =
|
|
263
|
+
r[n] = o;
|
|
580
264
|
case "boolean": {
|
|
581
|
-
r[n] =
|
|
265
|
+
r[n] = o === "1" || o === "true";
|
|
582
266
|
break;
|
|
583
267
|
}
|
|
584
268
|
}
|
|
585
269
|
switch (a) {
|
|
586
|
-
case
|
|
587
|
-
case
|
|
588
|
-
case
|
|
270
|
+
case P.any:
|
|
271
|
+
case P.string:
|
|
272
|
+
case P.array: {
|
|
589
273
|
r[n] = e[n];
|
|
590
274
|
break;
|
|
591
275
|
}
|
|
592
|
-
case
|
|
593
|
-
const
|
|
594
|
-
r[n] = isNaN(parseInt(
|
|
276
|
+
case P.number: {
|
|
277
|
+
const i = e[n];
|
|
278
|
+
r[n] = isNaN(parseInt(i)) ? parseFloat(i) : parseInt(i);
|
|
595
279
|
break;
|
|
596
280
|
}
|
|
597
|
-
case
|
|
598
|
-
const
|
|
599
|
-
r[n] =
|
|
281
|
+
case P.boolean: {
|
|
282
|
+
const i = e[n];
|
|
283
|
+
r[n] = i === "1" || i === "true";
|
|
600
284
|
break;
|
|
601
285
|
}
|
|
602
286
|
}
|
|
603
287
|
}
|
|
604
288
|
return r;
|
|
605
289
|
}
|
|
606
|
-
function
|
|
290
|
+
function ye(e) {
|
|
607
291
|
let {
|
|
608
292
|
$activeRoutes: t,
|
|
609
293
|
$query: r,
|
|
@@ -611,88 +295,88 @@ function Ce(e) {
|
|
|
611
295
|
} = e;
|
|
612
296
|
return (a) => {
|
|
613
297
|
const {
|
|
614
|
-
parameters:
|
|
615
|
-
forRoutes:
|
|
616
|
-
} = a,
|
|
298
|
+
parameters: o,
|
|
299
|
+
forRoutes: i
|
|
300
|
+
} = a, s = v(!1, {
|
|
617
301
|
name: "$entered",
|
|
618
|
-
sid: "
|
|
619
|
-
}),
|
|
302
|
+
sid: "lde75p"
|
|
303
|
+
}), c = m({
|
|
620
304
|
name: "entered",
|
|
621
|
-
sid: "-
|
|
622
|
-
}),
|
|
305
|
+
sid: "-ggrer9"
|
|
306
|
+
}), p = m({
|
|
623
307
|
name: "exited",
|
|
624
|
-
sid: "
|
|
625
|
-
}),
|
|
308
|
+
sid: "xzl0hy"
|
|
309
|
+
}), w = m({
|
|
626
310
|
name: "exit",
|
|
627
|
-
sid: "-
|
|
628
|
-
}),
|
|
311
|
+
sid: "-9k6g49"
|
|
312
|
+
}), f = m({
|
|
629
313
|
name: "changeEntered",
|
|
630
|
-
sid: "-
|
|
314
|
+
sid: "-ibka8"
|
|
631
315
|
});
|
|
632
|
-
return
|
|
316
|
+
return y({
|
|
633
317
|
and: [{
|
|
634
|
-
clock:
|
|
635
|
-
target:
|
|
318
|
+
clock: f,
|
|
319
|
+
target: s
|
|
636
320
|
}],
|
|
637
321
|
or: {
|
|
638
|
-
sid: "-
|
|
322
|
+
sid: "-hadp7p"
|
|
639
323
|
}
|
|
640
|
-
}),
|
|
324
|
+
}), y({
|
|
641
325
|
and: [{
|
|
642
326
|
source: {
|
|
643
327
|
activeRoutes: t,
|
|
644
328
|
query: r
|
|
645
329
|
},
|
|
646
|
-
filter: (
|
|
330
|
+
filter: (O) => {
|
|
647
331
|
let {
|
|
648
|
-
activeRoutes:
|
|
649
|
-
query:
|
|
650
|
-
} =
|
|
651
|
-
return (!
|
|
332
|
+
activeRoutes: l,
|
|
333
|
+
query: F
|
|
334
|
+
} = O;
|
|
335
|
+
return (!i || q(i, l)) && T(F, o);
|
|
652
336
|
},
|
|
653
|
-
fn: (
|
|
337
|
+
fn: (O) => {
|
|
654
338
|
let {
|
|
655
|
-
query:
|
|
656
|
-
} =
|
|
657
|
-
return
|
|
339
|
+
query: l
|
|
340
|
+
} = O;
|
|
341
|
+
return me(l, o);
|
|
658
342
|
},
|
|
659
|
-
target: [
|
|
343
|
+
target: [c, f.prepend(() => !0)]
|
|
660
344
|
}],
|
|
661
345
|
or: {
|
|
662
|
-
sid: "-
|
|
346
|
+
sid: "-gw31sb"
|
|
663
347
|
}
|
|
664
|
-
}),
|
|
348
|
+
}), y({
|
|
665
349
|
and: [{
|
|
666
350
|
source: {
|
|
667
351
|
activeRoutes: t,
|
|
668
352
|
query: r,
|
|
669
|
-
entered:
|
|
353
|
+
entered: s
|
|
670
354
|
},
|
|
671
|
-
filter: (
|
|
355
|
+
filter: (O) => {
|
|
672
356
|
let {
|
|
673
|
-
activeRoutes:
|
|
674
|
-
query:
|
|
675
|
-
entered:
|
|
676
|
-
} =
|
|
677
|
-
return
|
|
357
|
+
activeRoutes: l,
|
|
358
|
+
query: F,
|
|
359
|
+
entered: S
|
|
360
|
+
} = O;
|
|
361
|
+
return S && !((!i || q(i, l)) && T(F, o));
|
|
678
362
|
},
|
|
679
|
-
target: [
|
|
680
|
-
}),
|
|
363
|
+
target: [p.prepend(() => {
|
|
364
|
+
}), f.prepend(() => !1)]
|
|
681
365
|
}],
|
|
682
366
|
or: {
|
|
683
|
-
sid: "-
|
|
367
|
+
sid: "-gfl7zh"
|
|
684
368
|
}
|
|
685
|
-
}),
|
|
369
|
+
}), y({
|
|
686
370
|
and: [{
|
|
687
|
-
clock:
|
|
371
|
+
clock: w,
|
|
688
372
|
source: r,
|
|
689
|
-
fn: (
|
|
690
|
-
if (
|
|
691
|
-
const
|
|
692
|
-
for (const
|
|
693
|
-
|
|
373
|
+
fn: (O, l) => {
|
|
374
|
+
if (l && l.ignoreParams) {
|
|
375
|
+
const F = {};
|
|
376
|
+
for (const S of l.ignoreParams)
|
|
377
|
+
O[S] && (F[S] = O[S]);
|
|
694
378
|
return {
|
|
695
|
-
query:
|
|
379
|
+
query: F
|
|
696
380
|
};
|
|
697
381
|
}
|
|
698
382
|
return {
|
|
@@ -702,17 +386,17 @@ function Ce(e) {
|
|
|
702
386
|
target: n
|
|
703
387
|
}],
|
|
704
388
|
or: {
|
|
705
|
-
sid: "-
|
|
389
|
+
sid: "-fwcf7u"
|
|
706
390
|
}
|
|
707
391
|
}), {
|
|
708
|
-
entered:
|
|
709
|
-
exited:
|
|
710
|
-
exit:
|
|
392
|
+
entered: c,
|
|
393
|
+
exited: p,
|
|
394
|
+
exit: w
|
|
711
395
|
};
|
|
712
396
|
};
|
|
713
397
|
}
|
|
714
|
-
const
|
|
715
|
-
function
|
|
398
|
+
const G = "%[a-f0-9]{2}", H = new RegExp("(" + G + ")|([^%]+?)", "gi"), V = new RegExp("(" + G + ")+", "gi");
|
|
399
|
+
function D(e, t) {
|
|
716
400
|
try {
|
|
717
401
|
return [decodeURIComponent(e.join(""))];
|
|
718
402
|
} catch {
|
|
@@ -721,32 +405,32 @@ function G(e, t) {
|
|
|
721
405
|
return e;
|
|
722
406
|
t = t || 1;
|
|
723
407
|
const r = e.slice(0, t), n = e.slice(t);
|
|
724
|
-
return Array.prototype.concat.call([],
|
|
408
|
+
return Array.prototype.concat.call([], D(r), D(n));
|
|
725
409
|
}
|
|
726
|
-
function
|
|
410
|
+
function be(e) {
|
|
727
411
|
try {
|
|
728
412
|
return decodeURIComponent(e);
|
|
729
413
|
} catch {
|
|
730
|
-
let t = e.match(
|
|
414
|
+
let t = e.match(H) || [];
|
|
731
415
|
for (let r = 1; r < t.length; r++)
|
|
732
|
-
e =
|
|
416
|
+
e = D(t, r).join(""), t = e.match(H) || [];
|
|
733
417
|
return e;
|
|
734
418
|
}
|
|
735
419
|
}
|
|
736
|
-
function
|
|
420
|
+
function ge(e) {
|
|
737
421
|
const t = {
|
|
738
422
|
"%FE%FF": "��",
|
|
739
423
|
"%FF%FE": "��"
|
|
740
424
|
};
|
|
741
|
-
let r =
|
|
425
|
+
let r = V.exec(e);
|
|
742
426
|
for (; r; ) {
|
|
743
427
|
try {
|
|
744
428
|
t[r[0]] = decodeURIComponent(r[0]);
|
|
745
429
|
} catch {
|
|
746
|
-
const a =
|
|
430
|
+
const a = be(r[0]);
|
|
747
431
|
a !== r[0] && (t[r[0]] = a);
|
|
748
432
|
}
|
|
749
|
-
r =
|
|
433
|
+
r = V.exec(e);
|
|
750
434
|
}
|
|
751
435
|
t["%C2"] = "�";
|
|
752
436
|
const n = Object.keys(t);
|
|
@@ -754,16 +438,16 @@ function Ie(e) {
|
|
|
754
438
|
e = e.replace(new RegExp(a, "g"), t[a]);
|
|
755
439
|
return e;
|
|
756
440
|
}
|
|
757
|
-
function
|
|
441
|
+
function he(e) {
|
|
758
442
|
if (typeof e != "string")
|
|
759
443
|
throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof e + "`");
|
|
760
444
|
try {
|
|
761
445
|
return decodeURIComponent(e);
|
|
762
446
|
} catch {
|
|
763
|
-
return
|
|
447
|
+
return ge(e);
|
|
764
448
|
}
|
|
765
449
|
}
|
|
766
|
-
function
|
|
450
|
+
function Oe(e, t) {
|
|
767
451
|
const r = {};
|
|
768
452
|
if (Array.isArray(t))
|
|
769
453
|
for (const n of t) {
|
|
@@ -774,13 +458,13 @@ function _e(e, t) {
|
|
|
774
458
|
for (const n of Reflect.ownKeys(e)) {
|
|
775
459
|
const a = Object.getOwnPropertyDescriptor(e, n);
|
|
776
460
|
if (a.enumerable) {
|
|
777
|
-
const
|
|
778
|
-
t(n,
|
|
461
|
+
const o = e[n];
|
|
462
|
+
t(n, o, e) && Object.defineProperty(r, n, a);
|
|
779
463
|
}
|
|
780
464
|
}
|
|
781
465
|
return r;
|
|
782
466
|
}
|
|
783
|
-
function
|
|
467
|
+
function W(e, t) {
|
|
784
468
|
if (!(typeof e == "string" && typeof t == "string"))
|
|
785
469
|
throw new TypeError("Expected the arguments to be of type `string`");
|
|
786
470
|
if (e === "" || t === "")
|
|
@@ -788,29 +472,29 @@ function de(e, t) {
|
|
|
788
472
|
const r = e.indexOf(t);
|
|
789
473
|
return r === -1 ? [] : [e.slice(0, r), e.slice(r + t.length)];
|
|
790
474
|
}
|
|
791
|
-
const
|
|
792
|
-
function
|
|
475
|
+
const we = (e) => e == null, je = (e) => encodeURIComponent(e).replaceAll(/[!'()*]/g, (t) => `%${t.charCodeAt(0).toString(16).toUpperCase()}`), C = Symbol("encodeFragmentIdentifier");
|
|
476
|
+
function Fe(e) {
|
|
793
477
|
switch (e.arrayFormat) {
|
|
794
478
|
case "index":
|
|
795
479
|
return (t) => (r, n) => {
|
|
796
480
|
const a = r.length;
|
|
797
|
-
return n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [
|
|
481
|
+
return n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [h(t, e), "[", a, "]"].join("")] : [...r, [h(t, e), "[", h(a, e), "]=", h(n, e)].join("")];
|
|
798
482
|
};
|
|
799
483
|
case "bracket":
|
|
800
|
-
return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [
|
|
484
|
+
return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [h(t, e), "[]"].join("")] : [...r, [h(t, e), "[]=", h(n, e)].join("")];
|
|
801
485
|
case "colon-list-separator":
|
|
802
|
-
return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [
|
|
486
|
+
return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [h(t, e), ":list="].join("")] : [...r, [h(t, e), ":list=", h(n, e)].join("")];
|
|
803
487
|
case "comma":
|
|
804
488
|
case "separator":
|
|
805
489
|
case "bracket-separator": {
|
|
806
490
|
const t = e.arrayFormat === "bracket-separator" ? "[]=" : "=";
|
|
807
|
-
return (r) => (n, a) => a === void 0 || e.skipNull && a === null || e.skipEmptyString && a === "" ? n : (a = a === null ? "" : a, n.length === 0 ? [[
|
|
491
|
+
return (r) => (n, a) => a === void 0 || e.skipNull && a === null || e.skipEmptyString && a === "" ? n : (a = a === null ? "" : a, n.length === 0 ? [[h(r, e), t, h(a, e)].join("")] : [[n, h(a, e)].join(e.arrayFormatSeparator)]);
|
|
808
492
|
}
|
|
809
493
|
default:
|
|
810
|
-
return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r,
|
|
494
|
+
return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, h(t, e)] : [...r, [h(t, e), "=", h(n, e)].join("")];
|
|
811
495
|
}
|
|
812
496
|
}
|
|
813
|
-
function
|
|
497
|
+
function Se(e) {
|
|
814
498
|
let t;
|
|
815
499
|
switch (e.arrayFormat) {
|
|
816
500
|
case "index":
|
|
@@ -848,24 +532,24 @@ function Le(e) {
|
|
|
848
532
|
case "comma":
|
|
849
533
|
case "separator":
|
|
850
534
|
return (r, n, a) => {
|
|
851
|
-
const
|
|
852
|
-
n =
|
|
853
|
-
const
|
|
854
|
-
a[r] =
|
|
535
|
+
const o = typeof n == "string" && n.includes(e.arrayFormatSeparator), i = typeof n == "string" && !o && k(n, e).includes(e.arrayFormatSeparator);
|
|
536
|
+
n = i ? k(n, e) : n;
|
|
537
|
+
const s = o || i ? n.split(e.arrayFormatSeparator).map((c) => k(c, e)) : n === null ? n : k(n, e);
|
|
538
|
+
a[r] = s;
|
|
855
539
|
};
|
|
856
540
|
case "bracket-separator":
|
|
857
541
|
return (r, n, a) => {
|
|
858
|
-
const
|
|
859
|
-
if (r = r.replace(/\[]$/, ""), !
|
|
860
|
-
a[r] = n &&
|
|
542
|
+
const o = /(\[])$/.test(r);
|
|
543
|
+
if (r = r.replace(/\[]$/, ""), !o) {
|
|
544
|
+
a[r] = n && k(n, e);
|
|
861
545
|
return;
|
|
862
546
|
}
|
|
863
|
-
const
|
|
547
|
+
const i = n === null ? [] : k(n, e).split(e.arrayFormatSeparator);
|
|
864
548
|
if (a[r] === void 0) {
|
|
865
|
-
a[r] =
|
|
549
|
+
a[r] = i;
|
|
866
550
|
return;
|
|
867
551
|
}
|
|
868
|
-
a[r] = [...a[r], ...
|
|
552
|
+
a[r] = [...a[r], ...i];
|
|
869
553
|
};
|
|
870
554
|
default:
|
|
871
555
|
return (r, n, a) => {
|
|
@@ -877,37 +561,37 @@ function Le(e) {
|
|
|
877
561
|
};
|
|
878
562
|
}
|
|
879
563
|
}
|
|
880
|
-
function
|
|
564
|
+
function X(e) {
|
|
881
565
|
if (typeof e != "string" || e.length !== 1)
|
|
882
566
|
throw new TypeError("arrayFormatSeparator must be single character string");
|
|
883
567
|
}
|
|
884
|
-
function
|
|
885
|
-
return t.encode ? t.strict ?
|
|
568
|
+
function h(e, t) {
|
|
569
|
+
return t.encode ? t.strict ? je(e) : encodeURIComponent(e) : e;
|
|
886
570
|
}
|
|
887
|
-
function
|
|
888
|
-
return t.decode ?
|
|
571
|
+
function k(e, t) {
|
|
572
|
+
return t.decode ? he(e) : e;
|
|
889
573
|
}
|
|
890
|
-
function
|
|
891
|
-
return Array.isArray(e) ? e.sort() : typeof e == "object" ?
|
|
574
|
+
function Y(e) {
|
|
575
|
+
return Array.isArray(e) ? e.sort() : typeof e == "object" ? Y(Object.keys(e)).sort((t, r) => Number(t) - Number(r)).map((t) => e[t]) : e;
|
|
892
576
|
}
|
|
893
|
-
function
|
|
577
|
+
function Z(e) {
|
|
894
578
|
const t = e.indexOf("#");
|
|
895
579
|
return t !== -1 && (e = e.slice(0, t)), e;
|
|
896
580
|
}
|
|
897
|
-
function
|
|
581
|
+
function Pe(e) {
|
|
898
582
|
let t = "";
|
|
899
583
|
const r = e.indexOf("#");
|
|
900
584
|
return r !== -1 && (t = e.slice(r)), t;
|
|
901
585
|
}
|
|
902
|
-
function
|
|
586
|
+
function K(e, t, r) {
|
|
903
587
|
return r === "string" && typeof e == "string" ? e : typeof r == "function" && typeof e == "string" ? r(e) : t.parseBooleans && e !== null && (e.toLowerCase() === "true" || e.toLowerCase() === "false") ? e.toLowerCase() === "true" : r === "number" && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" || t.parseNumbers && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" ? Number(e) : e;
|
|
904
588
|
}
|
|
905
|
-
function
|
|
906
|
-
e =
|
|
589
|
+
function z(e) {
|
|
590
|
+
e = Z(e);
|
|
907
591
|
const t = e.indexOf("?");
|
|
908
592
|
return t === -1 ? "" : e.slice(t + 1);
|
|
909
593
|
}
|
|
910
|
-
function
|
|
594
|
+
function U(e, t) {
|
|
911
595
|
t = {
|
|
912
596
|
decode: !0,
|
|
913
597
|
sort: !0,
|
|
@@ -917,30 +601,30 @@ function Z(e, t) {
|
|
|
917
601
|
parseBooleans: !1,
|
|
918
602
|
types: /* @__PURE__ */ Object.create(null),
|
|
919
603
|
...t
|
|
920
|
-
},
|
|
921
|
-
const r =
|
|
604
|
+
}, X(t.arrayFormatSeparator);
|
|
605
|
+
const r = Se(t), n = /* @__PURE__ */ Object.create(null);
|
|
922
606
|
if (typeof e != "string" || (e = e.trim().replace(/^[?#&]/, ""), !e))
|
|
923
607
|
return n;
|
|
924
608
|
for (const a of e.split("&")) {
|
|
925
609
|
if (a === "")
|
|
926
610
|
continue;
|
|
927
|
-
const
|
|
928
|
-
let [
|
|
929
|
-
|
|
611
|
+
const o = t.decode ? a.replaceAll("+", " ") : a;
|
|
612
|
+
let [i, s] = W(o, "=");
|
|
613
|
+
i === void 0 && (i = o), s = s === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(t.arrayFormat) ? s : k(s, t), r(k(i, t), s, n);
|
|
930
614
|
}
|
|
931
|
-
for (const [a,
|
|
932
|
-
if (typeof
|
|
933
|
-
for (const [
|
|
934
|
-
const
|
|
935
|
-
i
|
|
615
|
+
for (const [a, o] of Object.entries(n))
|
|
616
|
+
if (typeof o == "object" && o !== null && t.types[a] !== "string")
|
|
617
|
+
for (const [i, s] of Object.entries(o)) {
|
|
618
|
+
const c = t.types[a] ? t.types[a].replace("[]", "") : void 0;
|
|
619
|
+
o[i] = K(s, t, c);
|
|
936
620
|
}
|
|
937
|
-
else typeof
|
|
938
|
-
return t.sort === !1 ? n : (t.sort === !0 ? Object.keys(n).sort() : Object.keys(n).sort(t.sort)).reduce((a,
|
|
939
|
-
const
|
|
940
|
-
return a[
|
|
621
|
+
else typeof o == "object" && o !== null && t.types[a] === "string" ? n[a] = Object.values(o).join(t.arrayFormatSeparator) : n[a] = K(o, t, t.types[a]);
|
|
622
|
+
return t.sort === !1 ? n : (t.sort === !0 ? Object.keys(n).sort() : Object.keys(n).sort(t.sort)).reduce((a, o) => {
|
|
623
|
+
const i = n[o];
|
|
624
|
+
return a[o] = i && typeof i == "object" && !Array.isArray(i) ? Y(i) : i, a;
|
|
941
625
|
}, /* @__PURE__ */ Object.create(null));
|
|
942
626
|
}
|
|
943
|
-
function
|
|
627
|
+
function ee(e, t) {
|
|
944
628
|
if (!e)
|
|
945
629
|
return "";
|
|
946
630
|
t = {
|
|
@@ -949,85 +633,317 @@ function ge(e, t) {
|
|
|
949
633
|
arrayFormat: "none",
|
|
950
634
|
arrayFormatSeparator: ",",
|
|
951
635
|
...t
|
|
952
|
-
},
|
|
953
|
-
const r = (
|
|
954
|
-
for (const [
|
|
955
|
-
r(
|
|
956
|
-
const
|
|
957
|
-
return t.sort !== !1 &&
|
|
958
|
-
const
|
|
959
|
-
return
|
|
960
|
-
}).filter((
|
|
636
|
+
}, X(t.arrayFormatSeparator);
|
|
637
|
+
const r = (i) => t.skipNull && we(e[i]) || t.skipEmptyString && e[i] === "", n = Fe(t), a = {};
|
|
638
|
+
for (const [i, s] of Object.entries(e))
|
|
639
|
+
r(i) || (a[i] = s);
|
|
640
|
+
const o = Object.keys(a);
|
|
641
|
+
return t.sort !== !1 && o.sort(t.sort), o.map((i) => {
|
|
642
|
+
const s = e[i];
|
|
643
|
+
return s === void 0 ? "" : s === null ? h(i, t) : Array.isArray(s) ? s.length === 0 && t.arrayFormat === "bracket-separator" ? h(i, t) + "[]" : s.reduce(n(i), []).join("&") : h(i, t) + "=" + h(s, t);
|
|
644
|
+
}).filter((i) => i.length > 0).join("&");
|
|
961
645
|
}
|
|
962
|
-
function
|
|
646
|
+
function re(e, t) {
|
|
963
647
|
var a;
|
|
964
648
|
t = {
|
|
965
649
|
decode: !0,
|
|
966
650
|
...t
|
|
967
651
|
};
|
|
968
|
-
let [r, n] =
|
|
652
|
+
let [r, n] = W(e, "#");
|
|
969
653
|
return r === void 0 && (r = e), {
|
|
970
654
|
url: ((a = r == null ? void 0 : r.split("?")) == null ? void 0 : a[0]) ?? "",
|
|
971
|
-
query:
|
|
655
|
+
query: U(z(e), t),
|
|
972
656
|
...t && t.parseFragmentIdentifier && n ? {
|
|
973
|
-
fragmentIdentifier:
|
|
657
|
+
fragmentIdentifier: k(n, t)
|
|
974
658
|
} : {}
|
|
975
659
|
};
|
|
976
660
|
}
|
|
977
|
-
function
|
|
661
|
+
function te(e, t) {
|
|
978
662
|
t = {
|
|
979
663
|
encode: !0,
|
|
980
664
|
strict: !0,
|
|
981
|
-
[
|
|
665
|
+
[C]: !0,
|
|
982
666
|
...t
|
|
983
667
|
};
|
|
984
|
-
const r =
|
|
985
|
-
...
|
|
668
|
+
const r = Z(e.url).split("?")[0] || "", n = z(e.url), a = {
|
|
669
|
+
...U(n, {
|
|
986
670
|
sort: !1
|
|
987
671
|
}),
|
|
988
672
|
...e.query
|
|
989
673
|
};
|
|
990
|
-
let
|
|
991
|
-
|
|
992
|
-
let
|
|
674
|
+
let o = ee(a, t);
|
|
675
|
+
o && (o = `?${o}`);
|
|
676
|
+
let i = Pe(e.url);
|
|
993
677
|
if (typeof e.fragmentIdentifier == "string") {
|
|
994
|
-
const
|
|
995
|
-
|
|
678
|
+
const s = new URL(r);
|
|
679
|
+
s.hash = e.fragmentIdentifier, i = t[C] ? s.hash : `#${e.fragmentIdentifier}`;
|
|
996
680
|
}
|
|
997
|
-
return `${r}${
|
|
681
|
+
return `${r}${o}${i}`;
|
|
998
682
|
}
|
|
999
|
-
function
|
|
683
|
+
function ne(e, t, r) {
|
|
1000
684
|
r = {
|
|
1001
685
|
parseFragmentIdentifier: !0,
|
|
1002
|
-
[
|
|
686
|
+
[C]: !1,
|
|
1003
687
|
...r
|
|
1004
688
|
};
|
|
1005
689
|
const {
|
|
1006
690
|
url: n,
|
|
1007
691
|
query: a,
|
|
1008
|
-
fragmentIdentifier:
|
|
1009
|
-
} =
|
|
1010
|
-
return
|
|
692
|
+
fragmentIdentifier: o
|
|
693
|
+
} = re(e, r);
|
|
694
|
+
return te({
|
|
1011
695
|
url: n,
|
|
1012
|
-
query:
|
|
1013
|
-
fragmentIdentifier:
|
|
696
|
+
query: Oe(a, t),
|
|
697
|
+
fragmentIdentifier: o
|
|
1014
698
|
}, r);
|
|
1015
699
|
}
|
|
1016
|
-
function
|
|
1017
|
-
const n = Array.isArray(t) ? (a) => !t.includes(a) : (a,
|
|
1018
|
-
return
|
|
700
|
+
function ke(e, t, r) {
|
|
701
|
+
const n = Array.isArray(t) ? (a) => !t.includes(a) : (a, o) => !t(a, o);
|
|
702
|
+
return ne(e, n, r);
|
|
1019
703
|
}
|
|
1020
|
-
const
|
|
704
|
+
const R = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1021
705
|
__proto__: null,
|
|
1022
|
-
exclude:
|
|
1023
|
-
extract:
|
|
1024
|
-
parse:
|
|
1025
|
-
parseUrl:
|
|
1026
|
-
pick:
|
|
1027
|
-
stringify:
|
|
1028
|
-
stringifyUrl:
|
|
706
|
+
exclude: ke,
|
|
707
|
+
extract: z,
|
|
708
|
+
parse: U,
|
|
709
|
+
parseUrl: re,
|
|
710
|
+
pick: ne,
|
|
711
|
+
stringify: ee,
|
|
712
|
+
stringifyUrl: te
|
|
1029
713
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1030
|
-
function
|
|
714
|
+
function xe(e) {
|
|
715
|
+
return (t) => {
|
|
716
|
+
const r = t.split("/").filter(Boolean);
|
|
717
|
+
let n = null;
|
|
718
|
+
function a(s, c) {
|
|
719
|
+
n || (n = {}), n[s] = c;
|
|
720
|
+
}
|
|
721
|
+
if (e.length === 0) return r.length === 0 ? {
|
|
722
|
+
path: t,
|
|
723
|
+
params: null
|
|
724
|
+
} : null;
|
|
725
|
+
for (let s = 0; s < e.length; s++) {
|
|
726
|
+
let c = r[s];
|
|
727
|
+
const p = e[s];
|
|
728
|
+
switch (p.type) {
|
|
729
|
+
case "const": {
|
|
730
|
+
if (c !== p.name) return null;
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
case "parameter": {
|
|
734
|
+
const {
|
|
735
|
+
arrayProps: w,
|
|
736
|
+
genericProps: f,
|
|
737
|
+
required: O
|
|
738
|
+
} = p.payload;
|
|
739
|
+
if (w) {
|
|
740
|
+
var o;
|
|
741
|
+
const l = [];
|
|
742
|
+
for (; c && l.length < ((i = w.max) !== null && i !== void 0 ? i : 1 / 0); ) {
|
|
743
|
+
var i;
|
|
744
|
+
switch (f == null ? void 0 : f.type) {
|
|
745
|
+
case "number": {
|
|
746
|
+
if (isNaN(+c)) return null;
|
|
747
|
+
l.push(+c);
|
|
748
|
+
break;
|
|
749
|
+
}
|
|
750
|
+
case "union": {
|
|
751
|
+
if (!f.items.includes(c)) return null;
|
|
752
|
+
l.push(c);
|
|
753
|
+
break;
|
|
754
|
+
}
|
|
755
|
+
default: {
|
|
756
|
+
l.push(c);
|
|
757
|
+
break;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
c = r[s + l.length];
|
|
761
|
+
}
|
|
762
|
+
if (l.length < ((o = w.min) !== null && o !== void 0 ? o : 0) || r[s + l.length] && !e[s + 1]) return null;
|
|
763
|
+
a(p.name, l);
|
|
764
|
+
break;
|
|
765
|
+
}
|
|
766
|
+
if (O && !c) return null;
|
|
767
|
+
if (!c) {
|
|
768
|
+
a(p.name, void 0);
|
|
769
|
+
continue;
|
|
770
|
+
}
|
|
771
|
+
switch (f == null ? void 0 : f.type) {
|
|
772
|
+
case "number": {
|
|
773
|
+
if (isNaN(+c)) return null;
|
|
774
|
+
a(p.name, +c);
|
|
775
|
+
break;
|
|
776
|
+
}
|
|
777
|
+
case "union": {
|
|
778
|
+
if (!f.items.includes(c)) return null;
|
|
779
|
+
a(p.name, c);
|
|
780
|
+
break;
|
|
781
|
+
}
|
|
782
|
+
default: {
|
|
783
|
+
a(p.name, c);
|
|
784
|
+
break;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
return {
|
|
791
|
+
path: t,
|
|
792
|
+
params: n
|
|
793
|
+
};
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
function ve(e) {
|
|
797
|
+
if (!e) return null;
|
|
798
|
+
const t = e[1];
|
|
799
|
+
let r, n, a;
|
|
800
|
+
for (const o of e.slice(2)) if (o) {
|
|
801
|
+
if (o.includes("<")) {
|
|
802
|
+
r = o.replace("<", "").replace(">", "");
|
|
803
|
+
continue;
|
|
804
|
+
}
|
|
805
|
+
if (o.includes("{") && (n = o.replace("{", "").replace("}", "").split(",").map((i) => parseInt(i))), ["*", "?", "+"].includes(o)) {
|
|
806
|
+
a = o;
|
|
807
|
+
continue;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
return {
|
|
811
|
+
name: t,
|
|
812
|
+
genericProps: r,
|
|
813
|
+
arrayProps: n,
|
|
814
|
+
modificator: a
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
function Ne(e) {
|
|
818
|
+
return (t) => {
|
|
819
|
+
const r = [];
|
|
820
|
+
if (e.length === 0) return "/";
|
|
821
|
+
for (const n of e) switch (n.type) {
|
|
822
|
+
case "const": {
|
|
823
|
+
r.push(n.name);
|
|
824
|
+
break;
|
|
825
|
+
}
|
|
826
|
+
case "parameter": {
|
|
827
|
+
if (!t[n.name]) continue;
|
|
828
|
+
if (Array.isArray(t[n.name])) for (const a of t[n.name]) r.push(a.toString());
|
|
829
|
+
else r.push(t[n.name].toString());
|
|
830
|
+
break;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
return "/".concat(r.join("/"));
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
function L(e, t) {
|
|
837
|
+
var r = Object.keys(e);
|
|
838
|
+
if (Object.getOwnPropertySymbols) {
|
|
839
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
840
|
+
t && (n = n.filter(function(a) {
|
|
841
|
+
return Object.getOwnPropertyDescriptor(e, a).enumerable;
|
|
842
|
+
})), r.push.apply(r, n);
|
|
843
|
+
}
|
|
844
|
+
return r;
|
|
845
|
+
}
|
|
846
|
+
function M(e) {
|
|
847
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
848
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
849
|
+
t % 2 ? L(Object(r), !0).forEach(function(n) {
|
|
850
|
+
$e(e, n, r[n]);
|
|
851
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : L(Object(r)).forEach(function(n) {
|
|
852
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
return e;
|
|
856
|
+
}
|
|
857
|
+
function $e(e, t, r) {
|
|
858
|
+
return (t = Ae(t)) in e ? Object.defineProperty(e, t, {
|
|
859
|
+
value: r,
|
|
860
|
+
enumerable: !0,
|
|
861
|
+
configurable: !0,
|
|
862
|
+
writable: !0
|
|
863
|
+
}) : e[t] = r, e;
|
|
864
|
+
}
|
|
865
|
+
function Ae(e) {
|
|
866
|
+
var t = Ee(e, "string");
|
|
867
|
+
return typeof t == "symbol" ? t : t + "";
|
|
868
|
+
}
|
|
869
|
+
function Ee(e, t) {
|
|
870
|
+
if (typeof e != "object" || !e) return e;
|
|
871
|
+
var r = e[Symbol.toPrimitive];
|
|
872
|
+
if (r !== void 0) {
|
|
873
|
+
var n = r.call(e, t);
|
|
874
|
+
if (typeof n != "object") return n;
|
|
875
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
876
|
+
}
|
|
877
|
+
return (t === "string" ? String : Number)(e);
|
|
878
|
+
}
|
|
879
|
+
function Re(e) {
|
|
880
|
+
const t = [], r = /:(\w+)(<[\w|]+>)?({\d+\,\d+})?([+*?])?/, n = e.split("/").filter(Boolean);
|
|
881
|
+
for (let a = 0; a < n.length; a++) {
|
|
882
|
+
const o = n[a];
|
|
883
|
+
if (!o) continue;
|
|
884
|
+
const i = ve(o.match(r));
|
|
885
|
+
if (!i) {
|
|
886
|
+
t.push({
|
|
887
|
+
type: "const",
|
|
888
|
+
name: o,
|
|
889
|
+
payload: void 0
|
|
890
|
+
});
|
|
891
|
+
continue;
|
|
892
|
+
}
|
|
893
|
+
const {
|
|
894
|
+
arrayProps: s,
|
|
895
|
+
genericProps: c,
|
|
896
|
+
modificator: p,
|
|
897
|
+
name: w
|
|
898
|
+
} = i;
|
|
899
|
+
if (!w) throw new Error('Invalid path: "'.concat(e, '". Name for argument must be provided'));
|
|
900
|
+
const f = {
|
|
901
|
+
type: "parameter",
|
|
902
|
+
name: w,
|
|
903
|
+
payload: {
|
|
904
|
+
required: !0
|
|
905
|
+
}
|
|
906
|
+
};
|
|
907
|
+
switch (c && c === "number" && (f.payload.genericProps = {
|
|
908
|
+
type: "number"
|
|
909
|
+
}), c && c.includes("|") && (f.payload.genericProps = {
|
|
910
|
+
type: "union",
|
|
911
|
+
items: c.split("|")
|
|
912
|
+
}), p) {
|
|
913
|
+
case "*": {
|
|
914
|
+
f.payload.arrayProps = {};
|
|
915
|
+
break;
|
|
916
|
+
}
|
|
917
|
+
case "+": {
|
|
918
|
+
f.payload.arrayProps = {
|
|
919
|
+
min: 1
|
|
920
|
+
};
|
|
921
|
+
break;
|
|
922
|
+
}
|
|
923
|
+
case "?": {
|
|
924
|
+
f.payload.required = !1;
|
|
925
|
+
break;
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
s && (f.payload.arrayProps = M(M({}, f.payload.arrayProps), {}, {
|
|
929
|
+
min: s[0],
|
|
930
|
+
max: s[1]
|
|
931
|
+
})), t.push(f);
|
|
932
|
+
}
|
|
933
|
+
return {
|
|
934
|
+
/**
|
|
935
|
+
* @param input Input path
|
|
936
|
+
* @returns `{ path: string; params: Params }` | `null`
|
|
937
|
+
*/
|
|
938
|
+
parse: xe(t),
|
|
939
|
+
/**
|
|
940
|
+
* @param params Route parameters
|
|
941
|
+
* @returns string
|
|
942
|
+
*/
|
|
943
|
+
build: Ne(t)
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
function J(e, t) {
|
|
1031
947
|
var r = Object.keys(e);
|
|
1032
948
|
if (Object.getOwnPropertySymbols) {
|
|
1033
949
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -1037,25 +953,25 @@ function fe(e, t) {
|
|
|
1037
953
|
}
|
|
1038
954
|
return r;
|
|
1039
955
|
}
|
|
1040
|
-
function
|
|
956
|
+
function I(e) {
|
|
1041
957
|
for (var t = 1; t < arguments.length; t++) {
|
|
1042
958
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
1043
|
-
t % 2 ?
|
|
1044
|
-
|
|
1045
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
959
|
+
t % 2 ? J(Object(r), !0).forEach(function(n) {
|
|
960
|
+
Ie(e, n, r[n]);
|
|
961
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : J(Object(r)).forEach(function(n) {
|
|
1046
962
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
1047
963
|
});
|
|
1048
964
|
}
|
|
1049
965
|
return e;
|
|
1050
966
|
}
|
|
1051
|
-
function
|
|
1052
|
-
return (t =
|
|
967
|
+
function Ie(e, t, r) {
|
|
968
|
+
return (t = De(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
1053
969
|
}
|
|
1054
|
-
function
|
|
1055
|
-
var t =
|
|
970
|
+
function De(e) {
|
|
971
|
+
var t = Ce(e, "string");
|
|
1056
972
|
return typeof t == "symbol" ? t : t + "";
|
|
1057
973
|
}
|
|
1058
|
-
function
|
|
974
|
+
function Ce(e, t) {
|
|
1059
975
|
if (typeof e != "object" || !e) return e;
|
|
1060
976
|
var r = e[Symbol.toPrimitive];
|
|
1061
977
|
if (r !== void 0) {
|
|
@@ -1065,293 +981,288 @@ function Ke(e, t) {
|
|
|
1065
981
|
}
|
|
1066
982
|
return (t === "string" ? String : Number)(e);
|
|
1067
983
|
}
|
|
1068
|
-
function
|
|
984
|
+
function _e(e) {
|
|
1069
985
|
const {
|
|
1070
986
|
base: t = "/",
|
|
1071
987
|
routes: r
|
|
1072
|
-
} = e, n =
|
|
988
|
+
} = e, n = v(null, {
|
|
1073
989
|
and: {
|
|
1074
990
|
serialize: "ignore"
|
|
1075
991
|
},
|
|
1076
992
|
name: "$history",
|
|
1077
|
-
sid: "
|
|
1078
|
-
}), a =
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
}
|
|
1082
|
-
name: "$
|
|
1083
|
-
sid: "
|
|
1084
|
-
}), o =
|
|
993
|
+
sid: "-c46cwg"
|
|
994
|
+
}), a = v({
|
|
995
|
+
query: {},
|
|
996
|
+
path: null
|
|
997
|
+
}, {
|
|
998
|
+
name: "$locationState",
|
|
999
|
+
sid: "-xif7zo"
|
|
1000
|
+
}), o = a.map((u) => u.query), i = a.map((u) => u.path), s = m({
|
|
1085
1001
|
name: "setHistory",
|
|
1086
|
-
sid: "
|
|
1087
|
-
}),
|
|
1002
|
+
sid: "5o2aum"
|
|
1003
|
+
}), c = m({
|
|
1088
1004
|
name: "navigate",
|
|
1089
|
-
sid: "-
|
|
1090
|
-
}),
|
|
1005
|
+
sid: "-kee8mo"
|
|
1006
|
+
}), p = m({
|
|
1091
1007
|
name: "back",
|
|
1092
|
-
sid: "-
|
|
1093
|
-
}),
|
|
1008
|
+
sid: "-uo6kro"
|
|
1009
|
+
}), w = m({
|
|
1094
1010
|
name: "forward",
|
|
1095
|
-
sid: "-
|
|
1096
|
-
}),
|
|
1011
|
+
sid: "-je6ypy"
|
|
1012
|
+
}), f = m({
|
|
1097
1013
|
name: "locationUpdated",
|
|
1098
|
-
sid: "
|
|
1099
|
-
}),
|
|
1100
|
-
let
|
|
1101
|
-
const
|
|
1102
|
-
for (
|
|
1103
|
-
|
|
1104
|
-
const
|
|
1014
|
+
sid: "x2x22"
|
|
1015
|
+
}), O = r.map((u) => {
|
|
1016
|
+
let b = u;
|
|
1017
|
+
const d = [];
|
|
1018
|
+
for (d.unshift(b.path); b.parent; )
|
|
1019
|
+
b = b.parent, b.path !== "/" && d.unshift(b.path);
|
|
1020
|
+
const j = t === "/" ? d.join("") : [t, ...d].join(""), {
|
|
1021
|
+
build: N,
|
|
1022
|
+
parse: x
|
|
1023
|
+
} = Re(j);
|
|
1105
1024
|
return {
|
|
1106
|
-
route:
|
|
1107
|
-
path:
|
|
1108
|
-
|
|
1109
|
-
|
|
1025
|
+
route: u,
|
|
1026
|
+
path: j,
|
|
1027
|
+
build: N,
|
|
1028
|
+
parse: x
|
|
1110
1029
|
};
|
|
1111
|
-
}),
|
|
1112
|
-
const
|
|
1030
|
+
}), l = i.map((u) => {
|
|
1031
|
+
const b = [];
|
|
1032
|
+
if (!u)
|
|
1033
|
+
return b;
|
|
1113
1034
|
for (const {
|
|
1114
|
-
route:
|
|
1115
|
-
|
|
1116
|
-
} of
|
|
1117
|
-
|
|
1118
|
-
return
|
|
1119
|
-
}),
|
|
1035
|
+
route: d,
|
|
1036
|
+
parse: j
|
|
1037
|
+
} of O)
|
|
1038
|
+
j(u) && b.push(d);
|
|
1039
|
+
return b;
|
|
1040
|
+
}), F = B({
|
|
1120
1041
|
and: {
|
|
1121
1042
|
source: n,
|
|
1122
|
-
effect: (
|
|
1043
|
+
effect: (u, b) => {
|
|
1123
1044
|
let {
|
|
1124
|
-
path:
|
|
1125
|
-
query:
|
|
1126
|
-
replace:
|
|
1127
|
-
} =
|
|
1128
|
-
if (!
|
|
1045
|
+
path: d,
|
|
1046
|
+
query: j,
|
|
1047
|
+
replace: N
|
|
1048
|
+
} = b;
|
|
1049
|
+
if (!u)
|
|
1129
1050
|
throw new Error("history not found");
|
|
1130
|
-
const
|
|
1131
|
-
pathname:
|
|
1132
|
-
search: "?".concat(
|
|
1051
|
+
const x = {
|
|
1052
|
+
pathname: d,
|
|
1053
|
+
search: "?".concat(R.stringify(j))
|
|
1133
1054
|
};
|
|
1134
|
-
|
|
1055
|
+
N ? u.replace(x) : u.push(x);
|
|
1135
1056
|
}
|
|
1136
1057
|
},
|
|
1137
1058
|
or: {
|
|
1138
1059
|
name: "navigateFx",
|
|
1139
|
-
sid: "
|
|
1060
|
+
sid: "9h4a5f"
|
|
1140
1061
|
}
|
|
1141
|
-
}),
|
|
1142
|
-
const
|
|
1143
|
-
if (
|
|
1144
|
-
pathname:
|
|
1145
|
-
query:
|
|
1146
|
-
}), !
|
|
1062
|
+
}), S = A((u) => {
|
|
1063
|
+
const b = E(f);
|
|
1064
|
+
if (b({
|
|
1065
|
+
pathname: u.location.pathname,
|
|
1066
|
+
query: I({}, R.parse(u.location.search))
|
|
1067
|
+
}), !u)
|
|
1147
1068
|
throw new Error();
|
|
1148
|
-
|
|
1069
|
+
u.listen((d) => {
|
|
1149
1070
|
let {
|
|
1150
|
-
location:
|
|
1151
|
-
} =
|
|
1152
|
-
|
|
1153
|
-
pathname:
|
|
1154
|
-
query:
|
|
1071
|
+
location: j
|
|
1072
|
+
} = d;
|
|
1073
|
+
b({
|
|
1074
|
+
pathname: j.pathname,
|
|
1075
|
+
query: I({}, R.parse(j.search))
|
|
1155
1076
|
});
|
|
1156
1077
|
});
|
|
1157
1078
|
}, {
|
|
1158
1079
|
name: "subscribeHistoryFx",
|
|
1159
|
-
sid: "
|
|
1160
|
-
}),
|
|
1080
|
+
sid: "-o0gyju"
|
|
1081
|
+
}), g = B({
|
|
1161
1082
|
and: {
|
|
1162
1083
|
source: {
|
|
1163
|
-
query:
|
|
1084
|
+
query: o,
|
|
1164
1085
|
path: i
|
|
1165
1086
|
},
|
|
1166
|
-
effect: async (
|
|
1087
|
+
effect: async (u) => {
|
|
1167
1088
|
let {
|
|
1168
|
-
query:
|
|
1169
|
-
path:
|
|
1170
|
-
} =
|
|
1089
|
+
query: b,
|
|
1090
|
+
path: d
|
|
1091
|
+
} = u;
|
|
1171
1092
|
for (const {
|
|
1172
|
-
route:
|
|
1173
|
-
|
|
1174
|
-
} of
|
|
1175
|
-
const
|
|
1176
|
-
|
|
1177
|
-
query:
|
|
1178
|
-
params:
|
|
1179
|
-
}) :
|
|
1093
|
+
route: j,
|
|
1094
|
+
parse: N
|
|
1095
|
+
} of O) {
|
|
1096
|
+
const x = N(d), [ae, oe] = [E(j.internal.close), E(j.internal.navigated)];
|
|
1097
|
+
x ? oe({
|
|
1098
|
+
query: b,
|
|
1099
|
+
params: x.params
|
|
1100
|
+
}) : ae();
|
|
1180
1101
|
}
|
|
1181
1102
|
}
|
|
1182
1103
|
},
|
|
1183
1104
|
or: {
|
|
1184
1105
|
name: "openRoutesByPathFx",
|
|
1185
|
-
sid: "
|
|
1106
|
+
sid: "dzro9q"
|
|
1186
1107
|
}
|
|
1187
1108
|
});
|
|
1188
1109
|
for (const {
|
|
1189
|
-
route:
|
|
1190
|
-
|
|
1191
|
-
} of
|
|
1192
|
-
|
|
1110
|
+
route: u,
|
|
1111
|
+
build: b
|
|
1112
|
+
} of O)
|
|
1113
|
+
y({
|
|
1193
1114
|
and: [{
|
|
1194
|
-
clock:
|
|
1195
|
-
filter: (
|
|
1196
|
-
fn: (
|
|
1197
|
-
var
|
|
1115
|
+
clock: u.internal.openFx.doneData,
|
|
1116
|
+
filter: (d) => (d == null ? void 0 : d.navigate) !== !1,
|
|
1117
|
+
fn: (d) => {
|
|
1118
|
+
var j;
|
|
1198
1119
|
return {
|
|
1199
|
-
path:
|
|
1200
|
-
query: (
|
|
1201
|
-
replace:
|
|
1120
|
+
path: b(d && "params" in d ? d.params : void 0),
|
|
1121
|
+
query: (j = d == null ? void 0 : d.query) !== null && j !== void 0 ? j : {},
|
|
1122
|
+
replace: d == null ? void 0 : d.replace
|
|
1202
1123
|
};
|
|
1203
1124
|
},
|
|
1204
|
-
target:
|
|
1125
|
+
target: c
|
|
1205
1126
|
}],
|
|
1206
1127
|
or: {
|
|
1207
|
-
sid: "
|
|
1128
|
+
sid: "htdbac"
|
|
1208
1129
|
}
|
|
1209
1130
|
});
|
|
1210
|
-
return
|
|
1131
|
+
return y({
|
|
1211
1132
|
and: [{
|
|
1212
|
-
clock:
|
|
1133
|
+
clock: s,
|
|
1213
1134
|
target: n
|
|
1214
1135
|
}],
|
|
1215
1136
|
or: {
|
|
1216
|
-
sid: "
|
|
1137
|
+
sid: "sn7fxn"
|
|
1217
1138
|
}
|
|
1218
|
-
}),
|
|
1139
|
+
}), y({
|
|
1219
1140
|
and: [{
|
|
1220
1141
|
clock: n,
|
|
1221
1142
|
filter: Boolean,
|
|
1222
|
-
target:
|
|
1143
|
+
target: S
|
|
1223
1144
|
}],
|
|
1224
1145
|
or: {
|
|
1225
|
-
sid: "
|
|
1146
|
+
sid: "spyewg"
|
|
1226
1147
|
}
|
|
1227
|
-
}),
|
|
1148
|
+
}), y({
|
|
1228
1149
|
and: [{
|
|
1229
|
-
clock:
|
|
1230
|
-
fn: (
|
|
1231
|
-
path:
|
|
1232
|
-
query:
|
|
1150
|
+
clock: f,
|
|
1151
|
+
fn: (u) => ({
|
|
1152
|
+
path: u.pathname,
|
|
1153
|
+
query: u.query
|
|
1233
1154
|
}),
|
|
1234
|
-
target:
|
|
1235
|
-
sid: "rwfpgy",
|
|
1236
|
-
fn: () => Fe({
|
|
1237
|
-
targets: {
|
|
1238
|
-
path: i,
|
|
1239
|
-
query: a
|
|
1240
|
-
}
|
|
1241
|
-
}),
|
|
1242
|
-
name: "target",
|
|
1243
|
-
method: "spread"
|
|
1244
|
-
})
|
|
1155
|
+
target: a
|
|
1245
1156
|
}],
|
|
1246
1157
|
or: {
|
|
1247
|
-
sid: "
|
|
1158
|
+
sid: "t4sux7"
|
|
1248
1159
|
}
|
|
1249
|
-
}),
|
|
1160
|
+
}), y({
|
|
1250
1161
|
and: [{
|
|
1251
|
-
clock:
|
|
1252
|
-
fn: (
|
|
1253
|
-
path:
|
|
1254
|
-
query:
|
|
1162
|
+
clock: f,
|
|
1163
|
+
fn: (u) => ({
|
|
1164
|
+
path: u.pathname,
|
|
1165
|
+
query: u.query
|
|
1255
1166
|
}),
|
|
1256
|
-
target:
|
|
1167
|
+
target: g
|
|
1257
1168
|
}],
|
|
1258
1169
|
or: {
|
|
1259
|
-
sid: "
|
|
1170
|
+
sid: "tlaoq1"
|
|
1260
1171
|
}
|
|
1261
|
-
}),
|
|
1172
|
+
}), y({
|
|
1262
1173
|
and: [{
|
|
1263
|
-
clock:
|
|
1174
|
+
clock: c,
|
|
1264
1175
|
source: i,
|
|
1265
|
-
fn: (
|
|
1266
|
-
path:
|
|
1267
|
-
},
|
|
1268
|
-
target:
|
|
1176
|
+
fn: (u, b) => I({
|
|
1177
|
+
path: u
|
|
1178
|
+
}, b),
|
|
1179
|
+
target: F
|
|
1269
1180
|
}],
|
|
1270
1181
|
or: {
|
|
1271
|
-
sid: "
|
|
1182
|
+
sid: "u1siiv"
|
|
1272
1183
|
}
|
|
1273
1184
|
}), {
|
|
1274
|
-
$query:
|
|
1185
|
+
$query: o,
|
|
1275
1186
|
$path: i,
|
|
1276
|
-
$activeRoutes:
|
|
1277
|
-
back:
|
|
1278
|
-
forward:
|
|
1279
|
-
navigate:
|
|
1187
|
+
$activeRoutes: l,
|
|
1188
|
+
back: p,
|
|
1189
|
+
forward: w,
|
|
1190
|
+
navigate: c,
|
|
1280
1191
|
routes: r,
|
|
1281
|
-
setHistory:
|
|
1282
|
-
mappedRoutes:
|
|
1283
|
-
trackQuery:
|
|
1284
|
-
$activeRoutes:
|
|
1285
|
-
$query:
|
|
1286
|
-
navigate:
|
|
1192
|
+
setHistory: s,
|
|
1193
|
+
mappedRoutes: O,
|
|
1194
|
+
trackQuery: ye({
|
|
1195
|
+
$activeRoutes: l,
|
|
1196
|
+
$query: o,
|
|
1197
|
+
navigate: c
|
|
1287
1198
|
}),
|
|
1288
1199
|
"@@unitShape": () => ({
|
|
1289
|
-
query:
|
|
1200
|
+
query: o,
|
|
1290
1201
|
path: i,
|
|
1291
|
-
activeRoutes:
|
|
1292
|
-
onBack:
|
|
1293
|
-
onForward:
|
|
1294
|
-
onNavigate:
|
|
1202
|
+
activeRoutes: l,
|
|
1203
|
+
onBack: p,
|
|
1204
|
+
onForward: w,
|
|
1205
|
+
onNavigate: c
|
|
1295
1206
|
})
|
|
1296
1207
|
};
|
|
1297
1208
|
}
|
|
1298
|
-
function
|
|
1299
|
-
const t =
|
|
1209
|
+
function ze(e) {
|
|
1210
|
+
const t = v(null, {
|
|
1300
1211
|
name: "$params",
|
|
1301
1212
|
sid: "-ui6zqo"
|
|
1302
|
-
}), r =
|
|
1213
|
+
}), r = v(!1, {
|
|
1303
1214
|
name: "$isOpened",
|
|
1304
1215
|
sid: "p6gokr"
|
|
1305
|
-
}), n = e, a =
|
|
1216
|
+
}), n = e, a = m({
|
|
1306
1217
|
name: "open",
|
|
1307
1218
|
sid: "55xtzu"
|
|
1308
|
-
}),
|
|
1219
|
+
}), o = m({
|
|
1309
1220
|
name: "opened",
|
|
1310
1221
|
sid: "tidivr"
|
|
1311
|
-
}),
|
|
1222
|
+
}), i = m({
|
|
1312
1223
|
name: "openedOnServer",
|
|
1313
1224
|
sid: "8drh93"
|
|
1314
|
-
}),
|
|
1225
|
+
}), s = m({
|
|
1315
1226
|
name: "openedOnClient",
|
|
1316
1227
|
sid: "-pj4ssy"
|
|
1317
|
-
}),
|
|
1228
|
+
}), c = m({
|
|
1318
1229
|
name: "close",
|
|
1319
1230
|
sid: "-9osjjv"
|
|
1320
|
-
}),
|
|
1231
|
+
}), p = m({
|
|
1321
1232
|
name: "closed",
|
|
1322
1233
|
sid: "hnb5jj"
|
|
1323
1234
|
});
|
|
1324
|
-
return
|
|
1235
|
+
return y({
|
|
1325
1236
|
and: [{
|
|
1326
1237
|
clock: a,
|
|
1327
|
-
target:
|
|
1238
|
+
target: o
|
|
1328
1239
|
}],
|
|
1329
1240
|
or: {
|
|
1330
1241
|
sid: "-v1zz6f"
|
|
1331
1242
|
}
|
|
1332
|
-
}),
|
|
1243
|
+
}), Q({
|
|
1333
1244
|
and: [{
|
|
1334
|
-
source:
|
|
1245
|
+
source: o,
|
|
1335
1246
|
match: () => typeof window > "u" ? "server" : "client",
|
|
1336
1247
|
cases: {
|
|
1337
|
-
server:
|
|
1338
|
-
client:
|
|
1248
|
+
server: i,
|
|
1249
|
+
client: s
|
|
1339
1250
|
}
|
|
1340
1251
|
}],
|
|
1341
1252
|
or: {
|
|
1342
1253
|
sid: "-unpbr1"
|
|
1343
1254
|
}
|
|
1344
|
-
}),
|
|
1255
|
+
}), y({
|
|
1345
1256
|
and: [{
|
|
1346
|
-
clock:
|
|
1347
|
-
target:
|
|
1257
|
+
clock: c,
|
|
1258
|
+
target: p
|
|
1348
1259
|
}],
|
|
1349
1260
|
or: {
|
|
1350
1261
|
sid: "-u77hy7"
|
|
1351
1262
|
}
|
|
1352
|
-
}),
|
|
1263
|
+
}), y({
|
|
1353
1264
|
and: [{
|
|
1354
|
-
clock: [
|
|
1265
|
+
clock: [o.map(() => !0), p.map(() => !1)],
|
|
1355
1266
|
target: r
|
|
1356
1267
|
}],
|
|
1357
1268
|
or: {
|
|
@@ -1362,11 +1273,13 @@ function Je(e) {
|
|
|
1362
1273
|
$isOpened: r,
|
|
1363
1274
|
$isPending: n,
|
|
1364
1275
|
open: a,
|
|
1365
|
-
opened:
|
|
1366
|
-
openedOnClient:
|
|
1367
|
-
openedOnServer:
|
|
1368
|
-
close:
|
|
1369
|
-
closed:
|
|
1276
|
+
opened: o,
|
|
1277
|
+
openedOnClient: s,
|
|
1278
|
+
openedOnServer: i,
|
|
1279
|
+
close: c,
|
|
1280
|
+
closed: p,
|
|
1281
|
+
// @ts-expect-error emulated path for virtual route
|
|
1282
|
+
path: null,
|
|
1370
1283
|
"@@unitShape": () => ({
|
|
1371
1284
|
params: t,
|
|
1372
1285
|
isOpened: r,
|
|
@@ -1375,68 +1288,68 @@ function Je(e) {
|
|
|
1375
1288
|
})
|
|
1376
1289
|
};
|
|
1377
1290
|
}
|
|
1378
|
-
function
|
|
1291
|
+
function qe(e) {
|
|
1379
1292
|
const {
|
|
1380
1293
|
route: t,
|
|
1381
1294
|
beforeOpen: r,
|
|
1382
1295
|
openOn: n,
|
|
1383
1296
|
cancelOn: a
|
|
1384
|
-
} = e,
|
|
1385
|
-
for (const
|
|
1386
|
-
await
|
|
1297
|
+
} = e, o = A(async (s) => {
|
|
1298
|
+
for (const c of [].concat(r))
|
|
1299
|
+
await c(s);
|
|
1387
1300
|
}, {
|
|
1388
1301
|
name: "openFx",
|
|
1389
|
-
sid: "
|
|
1390
|
-
}),
|
|
1391
|
-
return
|
|
1302
|
+
sid: "x22os2"
|
|
1303
|
+
}), i = ze(o.pending);
|
|
1304
|
+
return y({
|
|
1392
1305
|
and: [{
|
|
1393
1306
|
clock: t.open,
|
|
1394
|
-
target:
|
|
1307
|
+
target: o
|
|
1395
1308
|
}],
|
|
1396
1309
|
or: {
|
|
1397
|
-
sid: "
|
|
1310
|
+
sid: "2j17t"
|
|
1398
1311
|
}
|
|
1399
|
-
}),
|
|
1312
|
+
}), y({
|
|
1400
1313
|
and: [{
|
|
1401
1314
|
clock: t.opened,
|
|
1402
|
-
fn: (
|
|
1403
|
-
target:
|
|
1315
|
+
fn: (s) => s && "params" in s ? s.params : null,
|
|
1316
|
+
target: i.$params
|
|
1404
1317
|
}],
|
|
1405
1318
|
or: {
|
|
1406
|
-
sid: "
|
|
1319
|
+
sid: "5a06m"
|
|
1407
1320
|
}
|
|
1408
|
-
}), n &&
|
|
1321
|
+
}), n && y({
|
|
1409
1322
|
and: [{
|
|
1410
1323
|
clock: n,
|
|
1411
1324
|
source: {
|
|
1412
|
-
params:
|
|
1325
|
+
params: i.$params
|
|
1413
1326
|
},
|
|
1414
|
-
fn: (
|
|
1327
|
+
fn: (s) => {
|
|
1415
1328
|
let {
|
|
1416
|
-
params:
|
|
1417
|
-
} =
|
|
1329
|
+
params: c
|
|
1330
|
+
} = s;
|
|
1418
1331
|
return {
|
|
1419
|
-
params:
|
|
1332
|
+
params: c
|
|
1420
1333
|
};
|
|
1421
1334
|
},
|
|
1422
|
-
target:
|
|
1335
|
+
target: i.open
|
|
1423
1336
|
}],
|
|
1424
1337
|
or: {
|
|
1425
|
-
sid: "
|
|
1338
|
+
sid: "lru16"
|
|
1426
1339
|
}
|
|
1427
|
-
}), a &&
|
|
1340
|
+
}), a && y({
|
|
1428
1341
|
and: [{
|
|
1429
1342
|
clock: [t.closed].concat(a),
|
|
1430
|
-
target:
|
|
1343
|
+
target: i.close
|
|
1431
1344
|
}],
|
|
1432
1345
|
or: {
|
|
1433
|
-
sid: "
|
|
1346
|
+
sid: "129nu0"
|
|
1434
1347
|
}
|
|
1435
|
-
}),
|
|
1348
|
+
}), i;
|
|
1436
1349
|
}
|
|
1437
1350
|
export {
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1351
|
+
qe as chainRoute,
|
|
1352
|
+
Be as createRoute,
|
|
1353
|
+
_e as createRouter,
|
|
1354
|
+
P as parameters
|
|
1442
1355
|
};
|