@argon-router/core 0.3.1 → 0.3.2

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