@argon-router/core 0.3.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createEffect as K, createStore as B, createEvent as E, sample as S, split as we, attach as J, scopeBind as xe, withFactory as Oe } from "effector";
2
- import { spread as Fe } from "patronum";
1
+ import { createEffect as V, createStore as _, createEvent as $, sample as x, split as ue, attach as J, scopeBind as Oe, withFactory as xe } from "effector";
2
+ import { spread as $e } from "patronum";
3
3
  function Z(e, t) {
4
4
  var r = Object.keys(e);
5
5
  if (Object.getOwnPropertySymbols) {
@@ -14,14 +14,14 @@ function H(e) {
14
14
  for (var t = 1; t < arguments.length; t++) {
15
15
  var r = arguments[t] != null ? arguments[t] : {};
16
16
  t % 2 ? Z(Object(r), !0).forEach(function(n) {
17
- $e(e, n, r[n]);
17
+ Fe(e, n, r[n]);
18
18
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Z(Object(r)).forEach(function(n) {
19
19
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
20
20
  });
21
21
  }
22
22
  return e;
23
23
  }
24
- function $e(e, t, r) {
24
+ function Fe(e, t, r) {
25
25
  return (t = je(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
26
26
  }
27
27
  function je(e) {
@@ -38,26 +38,26 @@ function Se(e, t) {
38
38
  }
39
39
  return (t === "string" ? String : Number)(e);
40
40
  }
41
- function We(e) {
41
+ function Ge(e) {
42
42
  let t;
43
- const r = K(() => {
43
+ const r = V(() => {
44
44
  var y;
45
45
  return (y = t) === null || y === void 0 ? void 0 : y();
46
46
  }, {
47
47
  name: "waitForAsyncBundleFx",
48
48
  sid: "tw7mq7"
49
- }), n = K(async () => {
50
- for (const k of (y = e.beforeOpen) !== null && y !== void 0 ? y : []) {
49
+ }), n = V(async () => {
50
+ for (const R of (y = e.beforeOpen) !== null && y !== void 0 ? y : []) {
51
51
  var y;
52
- await k();
52
+ await R();
53
53
  }
54
54
  }, {
55
55
  name: "beforeOpenFx",
56
56
  sid: "ls74w9"
57
- }), a = K(async (y) => {
57
+ }), a = V(async (y) => {
58
58
  await r(), await n();
59
- const k = e.parent;
60
- return k && await k.internal.openFx(H(H({}, y ?? {
59
+ const R = e.parent;
60
+ return R && await R.internal.openFx(H(H({}, y ?? {
61
61
  params: {}
62
62
  }), {}, {
63
63
  historyIgnore: !0
@@ -65,51 +65,51 @@ function We(e) {
65
65
  }, {
66
66
  name: "openFx",
67
67
  sid: "-hz9h5i"
68
- }), f = B({}, {
68
+ }), u = _({}, {
69
69
  name: "$params",
70
70
  sid: "rstqrf"
71
- }), c = B(!1, {
71
+ }), s = _(!1, {
72
72
  name: "$isOpened",
73
73
  sid: "-zgx6q9"
74
- }), u = a.pending, F = E({
74
+ }), f = a.pending, w = $({
75
75
  name: "open",
76
76
  sid: "-cby6lj"
77
- }), D = E({
77
+ }), E = $({
78
78
  name: "close",
79
79
  sid: "7uwhl1"
80
- }), v = E({
80
+ }), k = $({
81
81
  name: "opened",
82
82
  sid: "44ryfn"
83
- }), P = E({
83
+ }), P = $({
84
84
  name: "openedOnServer",
85
85
  sid: "-prk6y1"
86
- }), A = E({
86
+ }), A = $({
87
87
  name: "openedOnClient",
88
88
  sid: "-fw2mlz"
89
- }), $ = E({
89
+ }), S = $({
90
90
  name: "closed",
91
91
  sid: "10jxi5"
92
92
  });
93
- S({
93
+ x({
94
94
  and: [{
95
- clock: F,
95
+ clock: w,
96
96
  target: a
97
97
  }],
98
98
  or: {
99
99
  sid: "t7vx9v"
100
100
  }
101
101
  });
102
- const j = {};
103
- return S({
102
+ const v = {};
103
+ return x({
104
104
  and: [{
105
105
  clock: a.doneData,
106
- fn: (y) => y && "params" in y ? H({}, y.params) : j,
107
- target: f
106
+ fn: (y) => y && "params" in y ? H({}, y.params) : v,
107
+ target: u
108
108
  }],
109
109
  or: {
110
110
  sid: "tna5vz"
111
111
  }
112
- }), we({
112
+ }), ue({
113
113
  and: [{
114
114
  source: a.doneData,
115
115
  match: () => typeof window > "u" ? "server" : "client",
@@ -121,69 +121,69 @@ function We(e) {
121
121
  or: {
122
122
  sid: "u5fdgw"
123
123
  }
124
- }), S({
124
+ }), x({
125
125
  and: [{
126
126
  clock: [A, P],
127
- target: v
127
+ target: k
128
128
  }],
129
129
  or: {
130
130
  sid: "ylqojg"
131
131
  }
132
- }), S({
132
+ }), x({
133
133
  and: [{
134
- clock: v,
134
+ clock: k,
135
135
  fn: () => !0,
136
- target: c
136
+ target: s
137
137
  }],
138
138
  or: {
139
139
  sid: "yohni9"
140
140
  }
141
- }), S({
141
+ }), x({
142
142
  and: [{
143
- clock: D,
144
- target: $
143
+ clock: E,
144
+ target: S
145
145
  }],
146
146
  or: {
147
147
  sid: "z3c3j0"
148
148
  }
149
- }), S({
149
+ }), x({
150
150
  and: [{
151
- clock: $,
151
+ clock: S,
152
152
  fn: () => !1,
153
- target: c
153
+ target: s
154
154
  }],
155
155
  or: {
156
156
  sid: "z632ht"
157
157
  }
158
158
  }), {
159
- $params: f,
160
- $isOpened: c,
161
- $isPending: u,
162
- open: F,
163
- closed: $,
164
- opened: v,
159
+ $params: u,
160
+ $isOpened: s,
161
+ $isPending: f,
162
+ open: w,
163
+ closed: S,
164
+ opened: k,
165
165
  openedOnClient: A,
166
166
  openedOnServer: P,
167
167
  internal: H({
168
- close: D,
168
+ close: E,
169
169
  openFx: a,
170
170
  setAsyncImport: (y) => t = y
171
171
  }, e),
172
172
  "@@unitShape": () => ({
173
- params: f,
174
- isPending: u,
175
- isOpened: c,
176
- onOpen: F
173
+ params: u,
174
+ isPending: f,
175
+ isOpened: s,
176
+ onOpen: w
177
177
  })
178
178
  };
179
179
  }
180
180
  var C = {}, ee;
181
- function Ee() {
181
+ function ve() {
182
182
  if (ee) return C;
183
183
  ee = 1, Object.defineProperty(C, "__esModule", {
184
184
  value: !0
185
- }), C.TokenData = void 0, C.parse = P, C.compile = A, C.match = y, C.pathToRegexp = k, C.stringify = x;
186
- const e = "/", t = (i) => i, r = /^[$_\p{ID_Start}]$/u, n = /^[$\u200c\u200d\p{ID_Continue}]$/u, a = "https://git.new/pathToRegexpError", f = {
185
+ }), C.TokenData = void 0, C.parse = P, C.compile = A, C.match = y, C.pathToRegexp = R, C.stringify = F;
186
+ const e = "/", t = (c) => c, r = /^[$_\p{ID_Start}]$/u, n = /^[$\u200c\u200d\p{ID_Continue}]$/u, a = "https://git.new/pathToRegexpError", u = {
187
187
  // Groups.
188
188
  "{": "{",
189
189
  "}": "}",
@@ -196,309 +196,309 @@ function Ee() {
196
196
  "?": "?",
197
197
  "!": "!"
198
198
  };
199
- function c(i) {
200
- return i.replace(/[{}()\[\]+?!:*]/g, "\\$&");
199
+ function s(c) {
200
+ return c.replace(/[{}()\[\]+?!:*]/g, "\\$&");
201
201
  }
202
- function u(i) {
203
- return i.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
202
+ function f(c) {
203
+ return c.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
204
204
  }
205
- function* F(i) {
206
- const o = [...i];
207
- let s = 0;
205
+ function* w(c) {
206
+ const i = [...c];
207
+ let o = 0;
208
208
  function p() {
209
209
  let l = "";
210
- if (r.test(o[++s]))
211
- for (l += o[s]; n.test(o[++s]); )
212
- l += o[s];
213
- else if (o[s] === '"') {
214
- let d = s;
215
- for (; s < o.length; ) {
216
- if (o[++s] === '"') {
217
- s++, d = 0;
210
+ if (r.test(i[++o]))
211
+ for (l += i[o]; n.test(i[++o]); )
212
+ l += i[o];
213
+ else if (i[o] === '"') {
214
+ let d = o;
215
+ for (; o < i.length; ) {
216
+ if (i[++o] === '"') {
217
+ o++, d = 0;
218
218
  break;
219
219
  }
220
- o[s] === "\\" ? l += o[++s] : l += o[s];
220
+ i[o] === "\\" ? l += i[++o] : l += i[o];
221
221
  }
222
222
  if (d)
223
223
  throw new TypeError(`Unterminated quote at ${d}: ${a}`);
224
224
  }
225
225
  if (!l)
226
- throw new TypeError(`Missing parameter name at ${s}: ${a}`);
226
+ throw new TypeError(`Missing parameter name at ${o}: ${a}`);
227
227
  return l;
228
228
  }
229
- for (; s < o.length; ) {
230
- const l = o[s], d = f[l];
229
+ for (; o < i.length; ) {
230
+ const l = i[o], d = u[l];
231
231
  if (d)
232
232
  yield {
233
233
  type: d,
234
- index: s++,
234
+ index: o++,
235
235
  value: l
236
236
  };
237
237
  else if (l === "\\")
238
238
  yield {
239
239
  type: "ESCAPED",
240
- index: s++,
241
- value: o[s++]
240
+ index: o++,
241
+ value: i[o++]
242
242
  };
243
243
  else if (l === ":") {
244
- const w = p();
244
+ const O = p();
245
245
  yield {
246
246
  type: "PARAM",
247
- index: s,
248
- value: w
247
+ index: o,
248
+ value: O
249
249
  };
250
250
  } else if (l === "*") {
251
- const w = p();
251
+ const O = p();
252
252
  yield {
253
253
  type: "WILDCARD",
254
- index: s,
255
- value: w
254
+ index: o,
255
+ value: O
256
256
  };
257
257
  } else
258
258
  yield {
259
259
  type: "CHAR",
260
- index: s,
261
- value: o[s++]
260
+ index: o,
261
+ value: i[o++]
262
262
  };
263
263
  }
264
264
  return {
265
265
  type: "END",
266
- index: s,
266
+ index: o,
267
267
  value: ""
268
268
  };
269
269
  }
270
- class D {
271
- constructor(o) {
272
- this.tokens = o;
270
+ class E {
271
+ constructor(i) {
272
+ this.tokens = i;
273
273
  }
274
274
  peek() {
275
275
  if (!this._peek) {
276
- const o = this.tokens.next();
277
- this._peek = o.value;
276
+ const i = this.tokens.next();
277
+ this._peek = i.value;
278
278
  }
279
279
  return this._peek;
280
280
  }
281
- tryConsume(o) {
282
- const s = this.peek();
283
- if (s.type === o)
284
- return this._peek = void 0, s.value;
281
+ tryConsume(i) {
282
+ const o = this.peek();
283
+ if (o.type === i)
284
+ return this._peek = void 0, o.value;
285
285
  }
286
- consume(o) {
287
- const s = this.tryConsume(o);
288
- if (s !== void 0) return s;
286
+ consume(i) {
287
+ const o = this.tryConsume(i);
288
+ if (o !== void 0) return o;
289
289
  const {
290
290
  type: p,
291
291
  index: l
292
292
  } = this.peek();
293
- throw new TypeError(`Unexpected ${p} at ${l}, expected ${o}: ${a}`);
293
+ throw new TypeError(`Unexpected ${p} at ${l}, expected ${i}: ${a}`);
294
294
  }
295
295
  text() {
296
- let o = "", s;
297
- for (; s = this.tryConsume("CHAR") || this.tryConsume("ESCAPED"); )
298
- o += s;
299
- return o;
296
+ let i = "", o;
297
+ for (; o = this.tryConsume("CHAR") || this.tryConsume("ESCAPED"); )
298
+ i += o;
299
+ return i;
300
300
  }
301
301
  }
302
- class v {
303
- constructor(o) {
304
- this.tokens = o;
302
+ class k {
303
+ constructor(i) {
304
+ this.tokens = i;
305
305
  }
306
306
  }
307
- C.TokenData = v;
308
- function P(i, o = {}) {
307
+ C.TokenData = k;
308
+ function P(c, i = {}) {
309
309
  const {
310
- encodePath: s = t
311
- } = o, p = new D(F(i));
312
- function l(w) {
313
- const h = [];
310
+ encodePath: o = t
311
+ } = i, p = new E(w(c));
312
+ function l(O) {
313
+ const g = [];
314
314
  for (; ; ) {
315
315
  const N = p.text();
316
- N && h.push({
316
+ N && g.push({
317
317
  type: "text",
318
- value: s(N)
318
+ value: o(N)
319
319
  });
320
- const R = p.tryConsume("PARAM");
321
- if (R) {
322
- h.push({
320
+ const D = p.tryConsume("PARAM");
321
+ if (D) {
322
+ g.push({
323
323
  type: "param",
324
- name: R
324
+ name: D
325
325
  });
326
326
  continue;
327
327
  }
328
- const z = p.tryConsume("WILDCARD");
329
- if (z) {
330
- h.push({
328
+ const B = p.tryConsume("WILDCARD");
329
+ if (B) {
330
+ g.push({
331
331
  type: "wildcard",
332
- name: z
332
+ name: B
333
333
  });
334
334
  continue;
335
335
  }
336
336
  if (p.tryConsume("{")) {
337
- h.push({
337
+ g.push({
338
338
  type: "group",
339
339
  tokens: l("}")
340
340
  });
341
341
  continue;
342
342
  }
343
- return p.consume(w), h;
343
+ return p.consume(O), g;
344
344
  }
345
345
  }
346
346
  const d = l("END");
347
- return new v(d);
347
+ return new k(d);
348
348
  }
349
- function A(i, o = {}) {
349
+ function A(c, i = {}) {
350
350
  const {
351
- encode: s = encodeURIComponent,
351
+ encode: o = encodeURIComponent,
352
352
  delimiter: p = e
353
- } = o, l = i instanceof v ? i : P(i, o), d = $(l.tokens, p, s);
354
- return function(h = {}) {
355
- const [N, ...R] = d(h);
356
- if (R.length)
357
- throw new TypeError(`Missing parameters: ${R.join(", ")}`);
353
+ } = i, l = c instanceof k ? c : P(c, i), d = S(l.tokens, p, o);
354
+ return function(g = {}) {
355
+ const [N, ...D] = d(g);
356
+ if (D.length)
357
+ throw new TypeError(`Missing parameters: ${D.join(", ")}`);
358
358
  return N;
359
359
  };
360
360
  }
361
- function $(i, o, s) {
362
- const p = i.map((l) => j(l, o, s));
361
+ function S(c, i, o) {
362
+ const p = c.map((l) => v(l, i, o));
363
363
  return (l) => {
364
364
  const d = [""];
365
- for (const w of p) {
366
- const [h, ...N] = w(l);
367
- d[0] += h, d.push(...N);
365
+ for (const O of p) {
366
+ const [g, ...N] = O(l);
367
+ d[0] += g, d.push(...N);
368
368
  }
369
369
  return d;
370
370
  };
371
371
  }
372
- function j(i, o, s) {
373
- if (i.type === "text") return () => [i.value];
374
- if (i.type === "group") {
375
- const l = $(i.tokens, o, s);
372
+ function v(c, i, o) {
373
+ if (c.type === "text") return () => [c.value];
374
+ if (c.type === "group") {
375
+ const l = S(c.tokens, i, o);
376
376
  return (d) => {
377
- const [w, ...h] = l(d);
378
- return h.length ? [""] : [w];
377
+ const [O, ...g] = l(d);
378
+ return g.length ? [""] : [O];
379
379
  };
380
380
  }
381
- const p = s || t;
382
- return i.type === "wildcard" && s !== !1 ? (l) => {
383
- const d = l[i.name];
384
- if (d == null) return ["", i.name];
381
+ const p = o || t;
382
+ return c.type === "wildcard" && o !== !1 ? (l) => {
383
+ const d = l[c.name];
384
+ if (d == null) return ["", c.name];
385
385
  if (!Array.isArray(d) || d.length === 0)
386
- throw new TypeError(`Expected "${i.name}" to be a non-empty array`);
387
- return [d.map((w, h) => {
388
- if (typeof w != "string")
389
- throw new TypeError(`Expected "${i.name}/${h}" to be a string`);
390
- return p(w);
391
- }).join(o)];
386
+ throw new TypeError(`Expected "${c.name}" to be a non-empty array`);
387
+ return [d.map((O, g) => {
388
+ if (typeof O != "string")
389
+ throw new TypeError(`Expected "${c.name}/${g}" to be a string`);
390
+ return p(O);
391
+ }).join(i)];
392
392
  } : (l) => {
393
- const d = l[i.name];
394
- if (d == null) return ["", i.name];
393
+ const d = l[c.name];
394
+ if (d == null) return ["", c.name];
395
395
  if (typeof d != "string")
396
- throw new TypeError(`Expected "${i.name}" to be a string`);
396
+ throw new TypeError(`Expected "${c.name}" to be a string`);
397
397
  return [p(d)];
398
398
  };
399
399
  }
400
- function y(i, o = {}) {
400
+ function y(c, i = {}) {
401
401
  const {
402
- decode: s = decodeURIComponent,
402
+ decode: o = decodeURIComponent,
403
403
  delimiter: p = e
404
- } = o, {
404
+ } = i, {
405
405
  regexp: l,
406
406
  keys: d
407
- } = k(i, o), w = d.map((h) => s === !1 ? t : h.type === "param" ? s : (N) => N.split(p).map(s));
407
+ } = R(c, i), O = d.map((g) => o === !1 ? t : g.type === "param" ? o : (N) => N.split(p).map(o));
408
408
  return function(N) {
409
- const R = l.exec(N);
410
- if (!R) return !1;
411
- const z = R[0], q = /* @__PURE__ */ Object.create(null);
412
- for (let L = 1; L < R.length; L++) {
413
- if (R[L] === void 0) continue;
414
- const M = d[L - 1], V = w[L - 1];
415
- q[M.name] = V(R[L]);
409
+ const D = l.exec(N);
410
+ if (!D) return !1;
411
+ const B = D[0], z = /* @__PURE__ */ Object.create(null);
412
+ for (let L = 1; L < D.length; L++) {
413
+ if (D[L] === void 0) continue;
414
+ const M = d[L - 1], K = O[L - 1];
415
+ z[M.name] = K(D[L]);
416
416
  }
417
417
  return {
418
- path: z,
419
- params: q
418
+ path: B,
419
+ params: z
420
420
  };
421
421
  };
422
422
  }
423
- function k(i, o = {}) {
423
+ function R(c, i = {}) {
424
424
  const {
425
- delimiter: s = e,
425
+ delimiter: o = e,
426
426
  end: p = !0,
427
427
  sensitive: l = !1,
428
428
  trailing: d = !0
429
- } = o, w = [], h = [], N = l ? "" : "i", z = (Array.isArray(i) ? i : [i]).map((M) => M instanceof v ? M : P(M, o));
429
+ } = i, O = [], g = [], N = l ? "" : "i", B = (Array.isArray(c) ? c : [c]).map((M) => M instanceof k ? M : P(M, i));
430
430
  for (const {
431
431
  tokens: M
432
- } of z)
433
- for (const V of g(M, 0, [])) {
434
- const be = b(V, s, w);
435
- h.push(be);
432
+ } of B)
433
+ for (const K of h(M, 0, [])) {
434
+ const we = b(K, o, O);
435
+ g.push(we);
436
436
  }
437
- let q = `^(?:${h.join("|")})`;
438
- return d && (q += `(?:${u(s)}$)?`), q += p ? "$" : `(?=${u(s)}|$)`, {
439
- regexp: new RegExp(q, N),
440
- keys: w
437
+ let z = `^(?:${g.join("|")})`;
438
+ return d && (z += `(?:${f(o)}$)?`), z += p ? "$" : `(?=${f(o)}|$)`, {
439
+ regexp: new RegExp(z, N),
440
+ keys: O
441
441
  };
442
442
  }
443
- function* g(i, o, s) {
444
- if (o === i.length)
445
- return yield s;
446
- const p = i[o];
443
+ function* h(c, i, o) {
444
+ if (i === c.length)
445
+ return yield o;
446
+ const p = c[i];
447
447
  if (p.type === "group") {
448
- const l = s.slice();
449
- for (const d of g(p.tokens, 0, l))
450
- yield* g(i, o + 1, d);
448
+ const l = o.slice();
449
+ for (const d of h(p.tokens, 0, l))
450
+ yield* h(c, i + 1, d);
451
451
  } else
452
- s.push(p);
453
- yield* g(i, o + 1, s);
452
+ o.push(p);
453
+ yield* h(c, i + 1, o);
454
454
  }
455
- function b(i, o, s) {
455
+ function b(c, i, o) {
456
456
  let p = "", l = "", d = !0;
457
- for (let w = 0; w < i.length; w++) {
458
- const h = i[w];
459
- if (h.type === "text") {
460
- p += u(h.value), l += h.value, d || (d = h.value.includes(o));
457
+ for (let O = 0; O < c.length; O++) {
458
+ const g = c[O];
459
+ if (g.type === "text") {
460
+ p += f(g.value), l += g.value, d || (d = g.value.includes(i));
461
461
  continue;
462
462
  }
463
- if (h.type === "param" || h.type === "wildcard") {
463
+ if (g.type === "param" || g.type === "wildcard") {
464
464
  if (!d && !l)
465
- throw new TypeError(`Missing text after "${h.name}": ${a}`);
466
- h.type === "param" ? p += `(${m(o, d ? "" : l)}+)` : p += "([\\s\\S]+)", s.push(h), l = "", d = !1;
465
+ throw new TypeError(`Missing text after "${g.name}": ${a}`);
466
+ g.type === "param" ? p += `(${m(i, d ? "" : l)}+)` : p += "([\\s\\S]+)", o.push(g), l = "", d = !1;
467
467
  continue;
468
468
  }
469
469
  }
470
470
  return p;
471
471
  }
472
- function m(i, o) {
473
- return o.length < 2 ? i.length < 2 ? `[^${u(i + o)}]` : `(?:(?!${u(i)})[^${u(o)}])` : i.length < 2 ? `(?:(?!${u(o)})[^${u(i)}])` : `(?:(?!${u(o)}|${u(i)})[\\s\\S])`;
472
+ function m(c, i) {
473
+ return i.length < 2 ? c.length < 2 ? `[^${f(c + i)}]` : `(?:(?!${f(c)})[^${f(i)}])` : c.length < 2 ? `(?:(?!${f(i)})[^${f(c)}])` : `(?:(?!${f(i)}|${f(c)})[\\s\\S])`;
474
474
  }
475
- function x(i) {
476
- return i.tokens.map(function o(s, p, l) {
477
- if (s.type === "text") return c(s.value);
478
- if (s.type === "group")
479
- return `{${s.tokens.map(o).join("")}}`;
480
- const w = _(s.name) && I(l[p + 1]) ? s.name : JSON.stringify(s.name);
481
- if (s.type === "param") return `:${w}`;
482
- if (s.type === "wildcard") return `*${w}`;
483
- throw new TypeError(`Unexpected token: ${s}`);
475
+ function F(c) {
476
+ return c.tokens.map(function i(o, p, l) {
477
+ if (o.type === "text") return s(o.value);
478
+ if (o.type === "group")
479
+ return `{${o.tokens.map(i).join("")}}`;
480
+ const O = q(o.name) && I(l[p + 1]) ? o.name : JSON.stringify(o.name);
481
+ if (o.type === "param") return `:${O}`;
482
+ if (o.type === "wildcard") return `*${O}`;
483
+ throw new TypeError(`Unexpected token: ${o}`);
484
484
  }).join("");
485
485
  }
486
- function _(i) {
487
- const [o, ...s] = i;
488
- return r.test(o) ? s.every((p) => n.test(p)) : !1;
486
+ function q(c) {
487
+ const [i, ...o] = c;
488
+ return r.test(i) ? o.every((p) => n.test(p)) : !1;
489
489
  }
490
- function I(i) {
491
- return (i == null ? void 0 : i.type) !== "text" ? !0 : !n.test(i.value[0]);
490
+ function I(c) {
491
+ return (c == null ? void 0 : c.type) !== "text" ? !0 : !n.test(c.value[0]);
492
492
  }
493
493
  return C;
494
494
  }
495
- var re = Ee();
496
- const ve = Symbol("any"), Pe = Symbol("number"), Ae = Symbol("string"), ke = Symbol("array"), Ne = Symbol("boolean"), T = {
497
- any: ve,
498
- number: Pe,
499
- string: Ae,
500
- array: ke,
501
- boolean: Ne
495
+ var re = ve();
496
+ const Ee = Symbol("any"), ke = Symbol("number"), Pe = Symbol("string"), Ae = Symbol("array"), Re = Symbol("boolean"), T = {
497
+ any: Ee,
498
+ number: ke,
499
+ string: Pe,
500
+ array: Ae,
501
+ boolean: Re
502
502
  };
503
503
  function te(e, t) {
504
504
  for (const r of e)
@@ -563,28 +563,28 @@ function ne(e, t) {
563
563
  }
564
564
  return !0;
565
565
  }
566
- function Re(e, t) {
566
+ function Ne(e, t) {
567
567
  const r = {};
568
568
  for (const n in t) {
569
- const a = t[n], f = e[n];
569
+ const a = t[n], u = e[n];
570
570
  if (Array.isArray(a)) {
571
- const c = e[n];
572
- r[n] = c;
571
+ const s = e[n];
572
+ r[n] = s;
573
573
  continue;
574
574
  }
575
575
  switch (typeof a) {
576
576
  case "number": {
577
- r[n] = isNaN(parseInt(f)) ? parseFloat(f) : parseInt(f);
577
+ r[n] = isNaN(parseInt(u)) ? parseFloat(u) : parseInt(u);
578
578
  break;
579
579
  }
580
580
  case "object": {
581
- r[n] = JSON.parse(f);
581
+ r[n] = JSON.parse(u);
582
582
  break;
583
583
  }
584
584
  case "string":
585
- r[n] = f;
585
+ r[n] = u;
586
586
  case "boolean": {
587
- r[n] = f === "1" || f === "true";
587
+ r[n] = u === "1" || u === "true";
588
588
  break;
589
589
  }
590
590
  }
@@ -596,13 +596,13 @@ function Re(e, t) {
596
596
  break;
597
597
  }
598
598
  case T.number: {
599
- const c = e[n];
600
- r[n] = isNaN(parseInt(c)) ? parseFloat(c) : parseInt(c);
599
+ const s = e[n];
600
+ r[n] = isNaN(parseInt(s)) ? parseFloat(s) : parseInt(s);
601
601
  break;
602
602
  }
603
603
  case T.boolean: {
604
- const c = e[n];
605
- r[n] = c === "1" || c === "true";
604
+ const s = e[n];
605
+ r[n] = s === "1" || s === "true";
606
606
  break;
607
607
  }
608
608
  }
@@ -616,97 +616,97 @@ function De(e) {
616
616
  $query: n,
617
617
  navigateFx: a
618
618
  } = e;
619
- return (f) => {
619
+ return (u) => {
620
620
  const {
621
- parameters: c,
622
- forRoutes: u
623
- } = f, F = B(!1, {
621
+ parameters: s,
622
+ forRoutes: f
623
+ } = u, w = _(!1, {
624
624
  name: "$entered",
625
625
  sid: "jh7pkx"
626
- }), D = E({
626
+ }), E = $({
627
627
  name: "entered",
628
628
  sid: "-savym4"
629
- }), v = E({
629
+ }), k = $({
630
630
  name: "exited",
631
631
  sid: "m5ggn3"
632
- }), P = E({
632
+ }), P = $({
633
633
  name: "exit",
634
634
  sid: "-bgcxp1"
635
- }), A = E({
635
+ }), A = $({
636
636
  name: "changeEntered",
637
637
  sid: "-2ei1v0"
638
638
  });
639
- return S({
639
+ return x({
640
640
  and: [{
641
641
  clock: A,
642
- target: F
642
+ target: w
643
643
  }],
644
644
  or: {
645
645
  sid: "-hckvl5"
646
646
  }
647
- }), S({
647
+ }), x({
648
648
  and: [{
649
649
  source: {
650
650
  activeRoutes: t,
651
651
  query: n
652
652
  },
653
- filter: ($) => {
653
+ filter: (S) => {
654
654
  let {
655
- activeRoutes: j,
655
+ activeRoutes: v,
656
656
  query: y
657
- } = $;
658
- return (!u || te(u, j)) && ne(y, c);
657
+ } = S;
658
+ return (!f || te(f, v)) && ne(y, s);
659
659
  },
660
- fn: ($) => {
660
+ fn: (S) => {
661
661
  let {
662
- query: j
663
- } = $;
664
- return Re(j, c);
662
+ query: v
663
+ } = S;
664
+ return Ne(v, s);
665
665
  },
666
- target: [D, A.prepend(() => !0)]
666
+ target: [E, A.prepend(() => !0)]
667
667
  }],
668
668
  or: {
669
669
  sid: "-h9twmc"
670
670
  }
671
- }), S({
671
+ }), x({
672
672
  and: [{
673
673
  source: {
674
674
  activeRoutes: t,
675
675
  query: n,
676
- entered: F
676
+ entered: w
677
677
  },
678
- filter: ($) => {
678
+ filter: (S) => {
679
679
  let {
680
- activeRoutes: j,
680
+ activeRoutes: v,
681
681
  query: y,
682
- entered: k
683
- } = $;
684
- return k && !((!u || te(u, j)) && ne(y, c));
682
+ entered: R
683
+ } = S;
684
+ return R && !((!f || te(f, v)) && ne(y, s));
685
685
  },
686
- target: [v.prepend(() => {
686
+ target: [k.prepend(() => {
687
687
  }), A.prepend(() => !1)]
688
688
  }],
689
689
  or: {
690
690
  sid: "-gtc2ti"
691
691
  }
692
- }), S({
692
+ }), x({
693
693
  and: [{
694
694
  clock: P,
695
695
  source: {
696
696
  path: r,
697
697
  query: n
698
698
  },
699
- fn: ($, j) => {
699
+ fn: (S, v) => {
700
700
  let {
701
701
  path: y,
702
- query: k
703
- } = $;
704
- if (j && j.ignoreParams) {
705
- const g = {};
706
- for (const b of j.ignoreParams)
707
- k[b] && (g[b] = k[b]);
702
+ query: R
703
+ } = S;
704
+ if (v && v.ignoreParams) {
705
+ const h = {};
706
+ for (const b of v.ignoreParams)
707
+ R[b] && (h[b] = R[b]);
708
708
  return {
709
- query: g,
709
+ query: h,
710
710
  path: y
711
711
  };
712
712
  }
@@ -721,8 +721,8 @@ function De(e) {
721
721
  sid: "-fyjlla"
722
722
  }
723
723
  }), {
724
- entered: D,
725
- exited: v,
724
+ entered: E,
725
+ exited: k,
726
726
  exit: P
727
727
  };
728
728
  };
@@ -790,13 +790,13 @@ function Ue(e, t) {
790
790
  for (const n of Reflect.ownKeys(e)) {
791
791
  const a = Object.getOwnPropertyDescriptor(e, n);
792
792
  if (a.enumerable) {
793
- const f = e[n];
794
- t(n, f, e) && Object.defineProperty(r, n, a);
793
+ const u = e[n];
794
+ t(n, u, e) && Object.defineProperty(r, n, a);
795
795
  }
796
796
  }
797
797
  return r;
798
798
  }
799
- function ue(e, t) {
799
+ function le(e, t) {
800
800
  if (!(typeof e == "string" && typeof t == "string"))
801
801
  throw new TypeError("Expected the arguments to be of type `string`");
802
802
  if (e === "" || t === "")
@@ -805,28 +805,28 @@ function ue(e, t) {
805
805
  return r === -1 ? [] : [e.slice(0, r), e.slice(r + t.length)];
806
806
  }
807
807
  const _e = (e) => e == null, qe = (e) => encodeURIComponent(e).replaceAll(/[!'()*]/g, (t) => `%${t.charCodeAt(0).toString(16).toUpperCase()}`), G = Symbol("encodeFragmentIdentifier");
808
- function Le(e) {
808
+ function ze(e) {
809
809
  switch (e.arrayFormat) {
810
810
  case "index":
811
811
  return (t) => (r, n) => {
812
812
  const a = r.length;
813
- return n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [O(t, e), "[", a, "]"].join("")] : [...r, [O(t, e), "[", O(a, e), "]=", O(n, e)].join("")];
813
+ return n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [j(t, e), "[", a, "]"].join("")] : [...r, [j(t, e), "[", j(a, e), "]=", j(n, e)].join("")];
814
814
  };
815
815
  case "bracket":
816
- return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [O(t, e), "[]"].join("")] : [...r, [O(t, e), "[]=", O(n, e)].join("")];
816
+ return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [j(t, e), "[]"].join("")] : [...r, [j(t, e), "[]=", j(n, e)].join("")];
817
817
  case "colon-list-separator":
818
- return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [O(t, e), ":list="].join("")] : [...r, [O(t, e), ":list=", O(n, e)].join("")];
818
+ return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [j(t, e), ":list="].join("")] : [...r, [j(t, e), ":list=", j(n, e)].join("")];
819
819
  case "comma":
820
820
  case "separator":
821
821
  case "bracket-separator": {
822
822
  const t = e.arrayFormat === "bracket-separator" ? "[]=" : "=";
823
- return (r) => (n, a) => a === void 0 || e.skipNull && a === null || e.skipEmptyString && a === "" ? n : (a = a === null ? "" : a, n.length === 0 ? [[O(r, e), t, O(a, e)].join("")] : [[n, O(a, e)].join(e.arrayFormatSeparator)]);
823
+ return (r) => (n, a) => a === void 0 || e.skipNull && a === null || e.skipEmptyString && a === "" ? n : (a = a === null ? "" : a, n.length === 0 ? [[j(r, e), t, j(a, e)].join("")] : [[n, j(a, e)].join(e.arrayFormatSeparator)]);
824
824
  }
825
825
  default:
826
- return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, O(t, e)] : [...r, [O(t, e), "=", O(n, e)].join("")];
826
+ return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, j(t, e)] : [...r, [j(t, e), "=", j(n, e)].join("")];
827
827
  }
828
828
  }
829
- function Me(e) {
829
+ function Le(e) {
830
830
  let t;
831
831
  switch (e.arrayFormat) {
832
832
  case "index":
@@ -864,24 +864,24 @@ function Me(e) {
864
864
  case "comma":
865
865
  case "separator":
866
866
  return (r, n, a) => {
867
- const f = typeof n == "string" && n.includes(e.arrayFormatSeparator), c = typeof n == "string" && !f && U(n, e).includes(e.arrayFormatSeparator);
868
- n = c ? U(n, e) : n;
869
- const u = f || c ? n.split(e.arrayFormatSeparator).map((F) => U(F, e)) : n === null ? n : U(n, e);
870
- a[r] = u;
867
+ const u = typeof n == "string" && n.includes(e.arrayFormatSeparator), s = typeof n == "string" && !u && U(n, e).includes(e.arrayFormatSeparator);
868
+ n = s ? U(n, e) : n;
869
+ const f = u || s ? n.split(e.arrayFormatSeparator).map((w) => U(w, e)) : n === null ? n : U(n, e);
870
+ a[r] = f;
871
871
  };
872
872
  case "bracket-separator":
873
873
  return (r, n, a) => {
874
- const f = /(\[])$/.test(r);
875
- if (r = r.replace(/\[]$/, ""), !f) {
874
+ const u = /(\[])$/.test(r);
875
+ if (r = r.replace(/\[]$/, ""), !u) {
876
876
  a[r] = n && U(n, e);
877
877
  return;
878
878
  }
879
- const c = n === null ? [] : U(n, e).split(e.arrayFormatSeparator);
879
+ const s = n === null ? [] : U(n, e).split(e.arrayFormatSeparator);
880
880
  if (a[r] === void 0) {
881
- a[r] = c;
881
+ a[r] = s;
882
882
  return;
883
883
  }
884
- a[r] = [...a[r], ...c];
884
+ a[r] = [...a[r], ...s];
885
885
  };
886
886
  default:
887
887
  return (r, n, a) => {
@@ -893,24 +893,24 @@ function Me(e) {
893
893
  };
894
894
  }
895
895
  }
896
- function le(e) {
896
+ function de(e) {
897
897
  if (typeof e != "string" || e.length !== 1)
898
898
  throw new TypeError("arrayFormatSeparator must be single character string");
899
899
  }
900
- function O(e, t) {
900
+ function j(e, t) {
901
901
  return t.encode ? t.strict ? qe(e) : encodeURIComponent(e) : e;
902
902
  }
903
903
  function U(e, t) {
904
904
  return t.decode ? Te(e) : e;
905
905
  }
906
- function de(e) {
907
- return Array.isArray(e) ? e.sort() : typeof e == "object" ? de(Object.keys(e)).sort((t, r) => Number(t) - Number(r)).map((t) => e[t]) : e;
908
- }
909
906
  function pe(e) {
907
+ return Array.isArray(e) ? e.sort() : typeof e == "object" ? pe(Object.keys(e)).sort((t, r) => Number(t) - Number(r)).map((t) => e[t]) : e;
908
+ }
909
+ function me(e) {
910
910
  const t = e.indexOf("#");
911
911
  return t !== -1 && (e = e.slice(0, t)), e;
912
912
  }
913
- function Be(e) {
913
+ function Me(e) {
914
914
  let t = "";
915
915
  const r = e.indexOf("#");
916
916
  return r !== -1 && (t = e.slice(r)), t;
@@ -919,7 +919,7 @@ function oe(e, t, r) {
919
919
  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;
920
920
  }
921
921
  function X(e) {
922
- e = pe(e);
922
+ e = me(e);
923
923
  const t = e.indexOf("?");
924
924
  return t === -1 ? "" : e.slice(t + 1);
925
925
  }
@@ -933,30 +933,30 @@ function Y(e, t) {
933
933
  parseBooleans: !1,
934
934
  types: /* @__PURE__ */ Object.create(null),
935
935
  ...t
936
- }, le(t.arrayFormatSeparator);
937
- const r = Me(t), n = /* @__PURE__ */ Object.create(null);
936
+ }, de(t.arrayFormatSeparator);
937
+ const r = Le(t), n = /* @__PURE__ */ Object.create(null);
938
938
  if (typeof e != "string" || (e = e.trim().replace(/^[?#&]/, ""), !e))
939
939
  return n;
940
940
  for (const a of e.split("&")) {
941
941
  if (a === "")
942
942
  continue;
943
- const f = t.decode ? a.replaceAll("+", " ") : a;
944
- let [c, u] = ue(f, "=");
945
- c === void 0 && (c = f), u = u === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(t.arrayFormat) ? u : U(u, t), r(U(c, t), u, n);
943
+ const u = t.decode ? a.replaceAll("+", " ") : a;
944
+ let [s, f] = le(u, "=");
945
+ s === void 0 && (s = u), f = f === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(t.arrayFormat) ? f : U(f, t), r(U(s, t), f, n);
946
946
  }
947
- for (const [a, f] of Object.entries(n))
948
- if (typeof f == "object" && f !== null && t.types[a] !== "string")
949
- for (const [c, u] of Object.entries(f)) {
950
- const F = t.types[a] ? t.types[a].replace("[]", "") : void 0;
951
- f[c] = oe(u, t, F);
947
+ for (const [a, u] of Object.entries(n))
948
+ if (typeof u == "object" && u !== null && t.types[a] !== "string")
949
+ for (const [s, f] of Object.entries(u)) {
950
+ const w = t.types[a] ? t.types[a].replace("[]", "") : void 0;
951
+ u[s] = oe(f, t, w);
952
952
  }
953
- else typeof f == "object" && f !== null && t.types[a] === "string" ? n[a] = Object.values(f).join(t.arrayFormatSeparator) : n[a] = oe(f, t, t.types[a]);
954
- return t.sort === !1 ? n : (t.sort === !0 ? Object.keys(n).sort() : Object.keys(n).sort(t.sort)).reduce((a, f) => {
955
- const c = n[f];
956
- return a[f] = c && typeof c == "object" && !Array.isArray(c) ? de(c) : c, a;
953
+ else typeof u == "object" && u !== null && t.types[a] === "string" ? n[a] = Object.values(u).join(t.arrayFormatSeparator) : n[a] = oe(u, t, t.types[a]);
954
+ return t.sort === !1 ? n : (t.sort === !0 ? Object.keys(n).sort() : Object.keys(n).sort(t.sort)).reduce((a, u) => {
955
+ const s = n[u];
956
+ return a[u] = s && typeof s == "object" && !Array.isArray(s) ? pe(s) : s, a;
957
957
  }, /* @__PURE__ */ Object.create(null));
958
958
  }
959
- function me(e, t) {
959
+ function ye(e, t) {
960
960
  if (!e)
961
961
  return "";
962
962
  t = {
@@ -965,23 +965,23 @@ function me(e, t) {
965
965
  arrayFormat: "none",
966
966
  arrayFormatSeparator: ",",
967
967
  ...t
968
- }, le(t.arrayFormatSeparator);
969
- const r = (c) => t.skipNull && _e(e[c]) || t.skipEmptyString && e[c] === "", n = Le(t), a = {};
970
- for (const [c, u] of Object.entries(e))
971
- r(c) || (a[c] = u);
972
- const f = Object.keys(a);
973
- return t.sort !== !1 && f.sort(t.sort), f.map((c) => {
974
- const u = e[c];
975
- return u === void 0 ? "" : u === null ? O(c, t) : Array.isArray(u) ? u.length === 0 && t.arrayFormat === "bracket-separator" ? O(c, t) + "[]" : u.reduce(n(c), []).join("&") : O(c, t) + "=" + O(u, t);
976
- }).filter((c) => c.length > 0).join("&");
968
+ }, de(t.arrayFormatSeparator);
969
+ const r = (s) => t.skipNull && _e(e[s]) || t.skipEmptyString && e[s] === "", n = ze(t), a = {};
970
+ for (const [s, f] of Object.entries(e))
971
+ r(s) || (a[s] = f);
972
+ const u = Object.keys(a);
973
+ return t.sort !== !1 && u.sort(t.sort), u.map((s) => {
974
+ const f = e[s];
975
+ return f === void 0 ? "" : f === null ? j(s, t) : Array.isArray(f) ? f.length === 0 && t.arrayFormat === "bracket-separator" ? j(s, t) + "[]" : f.reduce(n(s), []).join("&") : j(s, t) + "=" + j(f, t);
976
+ }).filter((s) => s.length > 0).join("&");
977
977
  }
978
- function ye(e, t) {
978
+ function ge(e, t) {
979
979
  var a;
980
980
  t = {
981
981
  decode: !0,
982
982
  ...t
983
983
  };
984
- let [r, n] = ue(e, "#");
984
+ let [r, n] = le(e, "#");
985
985
  return r === void 0 && (r = e), {
986
986
  url: ((a = r == null ? void 0 : r.split("?")) == null ? void 0 : a[0]) ?? "",
987
987
  query: Y(X(e), t),
@@ -997,22 +997,22 @@ function he(e, t) {
997
997
  [G]: !0,
998
998
  ...t
999
999
  };
1000
- const r = pe(e.url).split("?")[0] || "", n = X(e.url), a = {
1000
+ const r = me(e.url).split("?")[0] || "", n = X(e.url), a = {
1001
1001
  ...Y(n, {
1002
1002
  sort: !1
1003
1003
  }),
1004
1004
  ...e.query
1005
1005
  };
1006
- let f = me(a, t);
1007
- f && (f = `?${f}`);
1008
- let c = Be(e.url);
1006
+ let u = ye(a, t);
1007
+ u && (u = `?${u}`);
1008
+ let s = Me(e.url);
1009
1009
  if (typeof e.fragmentIdentifier == "string") {
1010
- const u = new URL(r);
1011
- u.hash = e.fragmentIdentifier, c = t[G] ? u.hash : `#${e.fragmentIdentifier}`;
1010
+ const f = new URL(r);
1011
+ f.hash = e.fragmentIdentifier, s = t[G] ? f.hash : `#${e.fragmentIdentifier}`;
1012
1012
  }
1013
- return `${r}${f}${c}`;
1013
+ return `${r}${u}${s}`;
1014
1014
  }
1015
- function ge(e, t, r) {
1015
+ function be(e, t, r) {
1016
1016
  r = {
1017
1017
  parseFragmentIdentifier: !0,
1018
1018
  [G]: !1,
@@ -1021,26 +1021,26 @@ function ge(e, t, r) {
1021
1021
  const {
1022
1022
  url: n,
1023
1023
  query: a,
1024
- fragmentIdentifier: f
1025
- } = ye(e, r);
1024
+ fragmentIdentifier: u
1025
+ } = ge(e, r);
1026
1026
  return he({
1027
1027
  url: n,
1028
1028
  query: Ue(a, t),
1029
- fragmentIdentifier: f
1029
+ fragmentIdentifier: u
1030
1030
  }, r);
1031
1031
  }
1032
- function ze(e, t, r) {
1033
- const n = Array.isArray(t) ? (a) => !t.includes(a) : (a, f) => !t(a, f);
1034
- return ge(e, n, r);
1032
+ function Be(e, t, r) {
1033
+ const n = Array.isArray(t) ? (a) => !t.includes(a) : (a, u) => !t(a, u);
1034
+ return be(e, n, r);
1035
1035
  }
1036
1036
  const Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1037
1037
  __proto__: null,
1038
- exclude: ze,
1038
+ exclude: Be,
1039
1039
  extract: X,
1040
1040
  parse: Y,
1041
- parseUrl: ye,
1042
- pick: ge,
1043
- stringify: me,
1041
+ parseUrl: ge,
1042
+ pick: be,
1043
+ stringify: ye,
1044
1044
  stringifyUrl: he
1045
1045
  }, Symbol.toStringTag, { value: "Module" }));
1046
1046
  function ie(e, t) {
@@ -1081,88 +1081,88 @@ function Ke(e, t) {
1081
1081
  }
1082
1082
  return (t === "string" ? String : Number)(e);
1083
1083
  }
1084
- function Ge(e) {
1084
+ function Xe(e) {
1085
1085
  const {
1086
1086
  base: t = "/",
1087
1087
  routes: r
1088
- } = e, n = B({
1088
+ } = e, n = _({
1089
1089
  skipUpdate: !1
1090
1090
  }, {
1091
1091
  name: "$meta",
1092
1092
  sid: "ku65ys"
1093
- }), a = B(null, {
1093
+ }), a = _(null, {
1094
1094
  and: {
1095
1095
  serialize: "ignore"
1096
1096
  },
1097
1097
  name: "$history",
1098
1098
  sid: "23j1rc"
1099
- }), f = B({}, {
1099
+ }), u = _({}, {
1100
1100
  name: "$query",
1101
1101
  sid: "3deub8"
1102
- }), c = B(null, {
1102
+ }), s = _(null, {
1103
1103
  name: "$path",
1104
1104
  sid: "ld3nhr"
1105
- }), u = E({
1105
+ }), f = $({
1106
1106
  name: "setHistory",
1107
1107
  sid: "hzl7xm"
1108
- }), F = E({
1108
+ }), w = $({
1109
1109
  name: "navigate",
1110
1110
  sid: "-82vbjo"
1111
- }), D = E({
1111
+ }), E = $({
1112
1112
  name: "back",
1113
1113
  sid: "-icnnoo"
1114
- }), v = E({
1114
+ }), k = $({
1115
1115
  name: "forward",
1116
1116
  sid: "-72o1my"
1117
- }), P = E({
1117
+ }), P = $({
1118
1118
  name: "locationUpdated",
1119
1119
  sid: "d8lu52"
1120
- }), A = r.map((g) => {
1121
- let b = g;
1120
+ }), A = r.map((h) => {
1121
+ let b = h;
1122
1122
  const m = [];
1123
1123
  for (m.unshift(b.internal.path); b.internal.parent; )
1124
1124
  b = b.internal.parent, b.internal.path !== "/" && m.unshift(b.internal.path);
1125
- const x = t === "/" ? m.join("") : [t, ...m].join("");
1125
+ const F = t === "/" ? m.join("") : [t, ...m].join("");
1126
1126
  return {
1127
- route: g,
1128
- path: x,
1129
- toPath: re.compile(x),
1130
- fromPath: re.match(x)
1127
+ route: h,
1128
+ path: F,
1129
+ toPath: re.compile(F),
1130
+ fromPath: re.match(F)
1131
1131
  };
1132
- }), $ = c.map((g) => {
1132
+ }), S = s.map((h) => {
1133
1133
  const b = [];
1134
1134
  for (const {
1135
1135
  route: m,
1136
- fromPath: x
1136
+ fromPath: F
1137
1137
  } of A)
1138
- x(g) && b.push(m);
1138
+ F(h) && b.push(m);
1139
1139
  return b;
1140
- }), j = J({
1140
+ }), v = J({
1141
1141
  and: {
1142
1142
  source: {
1143
1143
  history: a,
1144
1144
  meta: n
1145
1145
  },
1146
- effect: async (g, b) => {
1146
+ effect: async (h, b) => {
1147
1147
  let {
1148
1148
  history: m,
1149
- meta: x
1150
- } = g, {
1151
- path: _,
1149
+ meta: F
1150
+ } = h, {
1151
+ path: q,
1152
1152
  query: I,
1153
- replace: i
1153
+ replace: c
1154
1154
  } = b;
1155
1155
  if (!m)
1156
1156
  throw new Error("history not found");
1157
- if (x.skipUpdate) {
1158
- x.skipUpdate = !1;
1157
+ if (F.skipUpdate) {
1158
+ F.skipUpdate = !1;
1159
1159
  return;
1160
1160
  }
1161
- const o = {
1162
- pathname: _,
1161
+ const i = {
1162
+ pathname: q,
1163
1163
  search: "?".concat(Q.stringify(I))
1164
1164
  };
1165
- i ? m.replace(o) : m.push(o, {
1165
+ c ? m.replace(i) : m.push(i, {
1166
1166
  skipUpdate: !0
1167
1167
  });
1168
1168
  }
@@ -1174,25 +1174,25 @@ function Ge(e) {
1174
1174
  }), y = J({
1175
1175
  and: {
1176
1176
  source: n,
1177
- effect: (g, b) => {
1177
+ effect: (h, b) => {
1178
1178
  var m;
1179
- const x = xe(P);
1180
- if (x({
1179
+ const F = Oe(P);
1180
+ if (F({
1181
1181
  pathname: b.location.pathname,
1182
1182
  query: ce({}, Q.parse(b.location.search)),
1183
1183
  state: (m = b.location.state) !== null && m !== void 0 ? m : {}
1184
1184
  }), !b)
1185
1185
  throw new Error();
1186
- b.listen((_) => {
1186
+ b.listen((q) => {
1187
1187
  var I;
1188
1188
  let {
1189
- location: i
1190
- } = _;
1191
- const o = (I = i.state) !== null && I !== void 0 ? I : {};
1192
- o.skipUpdate && (g.skipUpdate = !0), x({
1193
- pathname: i.pathname,
1194
- query: ce({}, Q.parse(i.search)),
1195
- state: o
1189
+ location: c
1190
+ } = q;
1191
+ const i = (I = c.state) !== null && I !== void 0 ? I : {};
1192
+ i.skipUpdate && (h.skipUpdate = !0), F({
1193
+ pathname: c.pathname,
1194
+ query: ce({}, Q.parse(c.search)),
1195
+ state: i
1196
1196
  });
1197
1197
  });
1198
1198
  }
@@ -1201,30 +1201,30 @@ function Ge(e) {
1201
1201
  name: "subscribeHistoryFx",
1202
1202
  sid: "-9srjw2"
1203
1203
  }
1204
- }), k = J({
1204
+ }), R = J({
1205
1205
  and: {
1206
1206
  source: {
1207
- query: f,
1208
- path: c
1207
+ query: u,
1208
+ path: s
1209
1209
  },
1210
- effect: async (g) => {
1210
+ effect: async (h) => {
1211
1211
  let {
1212
1212
  query: b,
1213
1213
  path: m
1214
- } = g;
1214
+ } = h;
1215
1215
  for (const {
1216
- route: x,
1217
- fromPath: _
1216
+ route: F,
1217
+ fromPath: q
1218
1218
  } of A) {
1219
- const I = _(m);
1219
+ const I = q(m);
1220
1220
  if (I)
1221
- await x.internal.openFx({
1221
+ await F.internal.openFx({
1222
1222
  query: b,
1223
1223
  params: I.params,
1224
1224
  historyIgnore: !0
1225
1225
  });
1226
1226
  else {
1227
- x.internal.close();
1227
+ F.internal.close();
1228
1228
  continue;
1229
1229
  }
1230
1230
  }
@@ -1236,36 +1236,36 @@ function Ge(e) {
1236
1236
  }
1237
1237
  });
1238
1238
  for (const {
1239
- route: g,
1239
+ route: h,
1240
1240
  toPath: b
1241
1241
  } of A)
1242
- S({
1242
+ x({
1243
1243
  and: [{
1244
- clock: g.opened,
1244
+ clock: h.opened,
1245
1245
  filter: (m) => !(m != null && m.historyIgnore),
1246
1246
  fn: (m) => {
1247
- var x;
1247
+ var F;
1248
1248
  return {
1249
1249
  path: b(m && "params" in m ? m.params : void 0),
1250
- query: (x = m == null ? void 0 : m.query) !== null && x !== void 0 ? x : {},
1250
+ query: (F = m == null ? void 0 : m.query) !== null && F !== void 0 ? F : {},
1251
1251
  replace: m == null ? void 0 : m.replace
1252
1252
  };
1253
1253
  },
1254
- target: F
1254
+ target: w
1255
1255
  }],
1256
1256
  or: {
1257
1257
  sid: "gfvtvu"
1258
1258
  }
1259
1259
  });
1260
- return S({
1260
+ return x({
1261
1261
  and: [{
1262
- clock: u,
1262
+ clock: f,
1263
1263
  target: a
1264
1264
  }],
1265
1265
  or: {
1266
1266
  sid: "hbrw92"
1267
1267
  }
1268
- }), S({
1268
+ }), x({
1269
1269
  and: [{
1270
1270
  clock: a,
1271
1271
  filter: Boolean,
@@ -1274,19 +1274,19 @@ function Ge(e) {
1274
1274
  or: {
1275
1275
  sid: "heiv7v"
1276
1276
  }
1277
- }), S({
1277
+ }), x({
1278
1278
  and: [{
1279
1279
  clock: P,
1280
- fn: (g) => ({
1281
- path: g.pathname,
1282
- query: g.query
1280
+ fn: (h) => ({
1281
+ path: h.pathname,
1282
+ query: h.query
1283
1283
  }),
1284
- target: Oe({
1284
+ target: xe({
1285
1285
  sid: "-f70n8p",
1286
- fn: () => Fe({
1286
+ fn: () => $e({
1287
1287
  targets: {
1288
- path: c,
1289
- query: f
1288
+ path: s,
1289
+ query: u
1290
1290
  }
1291
1291
  }),
1292
1292
  name: "target",
@@ -1296,67 +1296,207 @@ function Ge(e) {
1296
1296
  or: {
1297
1297
  sid: "htdb8m"
1298
1298
  }
1299
- }), S({
1299
+ }), x({
1300
1300
  and: [{
1301
1301
  clock: P,
1302
- fn: (g) => ({
1303
- path: g.pathname,
1304
- query: g.query
1302
+ fn: (h) => ({
1303
+ path: h.pathname,
1304
+ query: h.query
1305
1305
  }),
1306
- target: k
1306
+ target: R
1307
1307
  }],
1308
1308
  or: {
1309
1309
  sid: "icm409"
1310
1310
  }
1311
- }), S({
1311
+ }), x({
1312
1312
  and: [{
1313
- clock: F,
1314
- target: j
1313
+ clock: w,
1314
+ target: v
1315
1315
  }],
1316
1316
  or: {
1317
1317
  sid: "sr2036"
1318
1318
  }
1319
- }), S({
1319
+ }), x({
1320
1320
  and: [{
1321
- clock: [f, c],
1321
+ clock: [u, s],
1322
1322
  source: {
1323
- query: f,
1324
- path: c
1323
+ query: u,
1324
+ path: s
1325
1325
  },
1326
- fn: (g) => g,
1327
- target: F
1326
+ fn: (h) => h,
1327
+ target: w
1328
1328
  }],
1329
1329
  or: {
1330
1330
  sid: "t5cnik"
1331
1331
  }
1332
1332
  }), {
1333
- $query: f,
1334
- $path: c,
1335
- $activeRoutes: $,
1336
- back: D,
1337
- forward: v,
1338
- navigate: F,
1333
+ $query: u,
1334
+ $path: s,
1335
+ $activeRoutes: S,
1336
+ back: E,
1337
+ forward: k,
1338
+ navigate: w,
1339
1339
  routes: r,
1340
- setHistory: u,
1340
+ setHistory: f,
1341
1341
  mappedRoutes: A,
1342
1342
  trackQuery: De({
1343
- $activeRoutes: $,
1344
- $path: c,
1345
- $query: f,
1346
- navigateFx: j
1343
+ $activeRoutes: S,
1344
+ $path: s,
1345
+ $query: u,
1346
+ navigateFx: v
1347
1347
  }),
1348
1348
  "@@unitShape": () => ({
1349
- query: f,
1350
- path: c,
1351
- activeRoutes: $,
1352
- onBack: D,
1353
- onForward: v,
1354
- onNavigate: F
1349
+ query: u,
1350
+ path: s,
1351
+ activeRoutes: S,
1352
+ onBack: E,
1353
+ onForward: k,
1354
+ onNavigate: w
1355
1355
  })
1356
1356
  };
1357
1357
  }
1358
+ function Je(e) {
1359
+ const t = _(null, {
1360
+ name: "$params",
1361
+ sid: "-ui6zqo"
1362
+ }), r = _(!1, {
1363
+ name: "$isOpened",
1364
+ sid: "p6gokr"
1365
+ }), n = e, a = $({
1366
+ name: "open",
1367
+ sid: "55xtzu"
1368
+ }), u = $({
1369
+ name: "opened",
1370
+ sid: "tidivr"
1371
+ }), s = $({
1372
+ name: "openedOnServer",
1373
+ sid: "8drh93"
1374
+ }), f = $({
1375
+ name: "openedOnClient",
1376
+ sid: "-pj4ssy"
1377
+ }), w = $({
1378
+ name: "close",
1379
+ sid: "-9osjjv"
1380
+ }), E = $({
1381
+ name: "closed",
1382
+ sid: "hnb5jj"
1383
+ });
1384
+ return x({
1385
+ and: [{
1386
+ clock: a,
1387
+ target: u
1388
+ }],
1389
+ or: {
1390
+ sid: "-v1zz6f"
1391
+ }
1392
+ }), ue({
1393
+ and: [{
1394
+ source: u,
1395
+ match: () => typeof window > "u" ? "server" : "client",
1396
+ cases: {
1397
+ server: s,
1398
+ client: f
1399
+ }
1400
+ }],
1401
+ or: {
1402
+ sid: "-unpbr1"
1403
+ }
1404
+ }), x({
1405
+ and: [{
1406
+ clock: w,
1407
+ target: E
1408
+ }],
1409
+ or: {
1410
+ sid: "-u77hy7"
1411
+ }
1412
+ }), x({
1413
+ and: [{
1414
+ clock: [u.map(() => !0), E.map(() => !1)],
1415
+ target: r
1416
+ }],
1417
+ or: {
1418
+ sid: "-u4gize"
1419
+ }
1420
+ }), {
1421
+ $params: t,
1422
+ $isOpened: r,
1423
+ $isPending: n,
1424
+ open: a,
1425
+ opened: u,
1426
+ openedOnClient: f,
1427
+ openedOnServer: s,
1428
+ close: w,
1429
+ closed: E,
1430
+ "@@unitShape": () => ({
1431
+ params: t,
1432
+ isOpened: r,
1433
+ isPending: n,
1434
+ onOpen: a
1435
+ })
1436
+ };
1437
+ }
1438
+ function Ye(e) {
1439
+ const {
1440
+ route: t,
1441
+ beforeOpen: r,
1442
+ openOn: n,
1443
+ cancelOn: a
1444
+ } = e, u = V(async (f) => {
1445
+ for (const w of [].concat(r))
1446
+ await w(f);
1447
+ }, {
1448
+ name: "openFx",
1449
+ sid: "14ykg2"
1450
+ }), s = Je(u.pending);
1451
+ return x({
1452
+ and: [{
1453
+ clock: t.opened,
1454
+ target: u
1455
+ }],
1456
+ or: {
1457
+ sid: "-s8ttzz"
1458
+ }
1459
+ }), x({
1460
+ and: [{
1461
+ clock: t.opened,
1462
+ fn: (f) => f && "params" in f ? f.params : null,
1463
+ target: s.$params
1464
+ }],
1465
+ or: {
1466
+ sid: "-1t3nrm"
1467
+ }
1468
+ }), n && x({
1469
+ and: [{
1470
+ clock: n,
1471
+ source: {
1472
+ params: s.$params
1473
+ },
1474
+ fn: (f) => {
1475
+ let {
1476
+ params: w
1477
+ } = f;
1478
+ return {
1479
+ params: w
1480
+ };
1481
+ },
1482
+ target: s.open
1483
+ }],
1484
+ or: {
1485
+ sid: "-1cltx2"
1486
+ }
1487
+ }), a && x({
1488
+ and: [{
1489
+ clock: [t.closed].concat(a),
1490
+ target: s.close
1491
+ }],
1492
+ or: {
1493
+ sid: "-w4048"
1494
+ }
1495
+ }), s;
1496
+ }
1358
1497
  export {
1359
- We as createRoute,
1360
- Ge as createRouter,
1498
+ Ye as chainRoute,
1499
+ Ge as createRoute,
1500
+ Xe as createRouter,
1361
1501
  T as parameters
1362
1502
  };