vue-micro-router 1.0.60 → 1.0.62

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.
Files changed (2) hide show
  1. package/dist/index.mjs +525 -512
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,70 +1,70 @@
1
- import { shallowReactive as F, computed as C, defineAsyncComponent as Pe, reactive as we, nextTick as te, ref as ne, inject as V, watch as X, onMounted as Q, onBeforeUnmount as De, provide as O, toRefs as Ue, toRef as Ye, defineComponent as ie, openBlock as G, createBlock as z, resolveDynamicComponent as Ae, mergeProps as Ce, Teleport as Fe, createElementVNode as q, withModifiers as ce, normalizeStyle as Ie, normalizeClass as k, createElementBlock as j, createCommentVNode as Xe, renderSlot as Re, Fragment as oe, createVNode as Te, TransitionGroup as Le, withCtx as fe, renderList as ge, unref as Y } from "vue";
1
+ import { shallowReactive as X, computed as R, defineAsyncComponent as Pe, reactive as we, nextTick as te, ref as ne, inject as V, watch as F, onMounted as Q, onBeforeUnmount as De, provide as O, toRefs as Ue, toRef as Ye, defineComponent as ie, openBlock as N, createBlock as z, resolveDynamicComponent as Ae, mergeProps as Ce, Teleport as Xe, createElementVNode as q, withModifiers as ce, normalizeStyle as _e, normalizeClass as k, createElementBlock as j, createCommentVNode as Fe, renderSlot as Re, Fragment as oe, createVNode as Te, TransitionGroup as Me, withCtx as fe, renderList as ge, unref as Y } from "vue";
2
2
  import { i as Ee, s as Se, g as H, w as ae, p as I, b as W, n as $, u as xe } from "./use-audio-manager.mjs";
3
- const Be = Symbol("micro-router");
4
- function Et() {
3
+ const Ie = Symbol("micro-router");
4
+ function bt() {
5
5
  return Symbol("micro-router-nested");
6
6
  }
7
- const me = Symbol("micro-router-root"), Ge = Symbol("micro-route-path"), Ne = Symbol("micro-dialog-path"), Oe = Symbol("micro-control-name"), se = Symbol("micro-attrs-read"), re = Symbol("micro-attrs-write"), ze = 550;
7
+ const me = Symbol("micro-router-root"), Be = Symbol("micro-route-path"), Ne = Symbol("micro-dialog-path"), Ge = Symbol("micro-control-name"), se = Symbol("micro-attrs-read"), re = Symbol("micro-attrs-write"), ze = 550;
8
8
  function be() {
9
9
  const e = /* @__PURE__ */ new Set();
10
- function n(i, t) {
10
+ function o(i, t) {
11
11
  const l = setTimeout(() => {
12
12
  e.delete(l), i();
13
13
  }, t);
14
14
  return e.add(l), l;
15
15
  }
16
- function o() {
16
+ function n() {
17
17
  e.forEach(clearTimeout), e.clear();
18
18
  }
19
- return { schedule: n, cleanup: o };
19
+ return { schedule: o, cleanup: n };
20
20
  }
21
21
  function de(e) {
22
- return new Promise((n) => setTimeout(n, e));
22
+ return new Promise((o) => setTimeout(o, e));
23
23
  }
24
- function Ve(e, n) {
25
- const o = e.defaultControlName, i = e.onboardingControlName, t = 300, l = be();
24
+ function Ve(e, o) {
25
+ const n = e.defaultControlName, i = e.onboardingControlName, t = 300, l = be();
26
26
  let u = !1;
27
- const r = F(/* @__PURE__ */ new Map()), c = F(
27
+ const r = X(/* @__PURE__ */ new Map()), c = X(
28
28
  /* @__PURE__ */ new Map()
29
- ), a = C(() => {
29
+ ), a = R(() => {
30
30
  const s = [];
31
31
  for (const f of r.values())
32
32
  f.activated && s.push(f);
33
33
  return s;
34
- }), d = a, R = C(
35
- () => a.value.some((s) => s.name !== o)
36
- ), T = C(() => {
37
- const s = a.value.find((f) => f.name !== o);
38
- return (s == null ? void 0 : s.name) ?? o;
34
+ }), v = a, C = R(
35
+ () => a.value.some((s) => s.name !== n)
36
+ ), M = R(() => {
37
+ const s = a.value.find((f) => f.name !== n);
38
+ return (s == null ? void 0 : s.name) ?? n;
39
39
  });
40
- function M(s, f, p) {
41
- var v, A, y;
40
+ function T(s, f, A) {
41
+ var d, w, y;
42
42
  if (!(f && u)) {
43
43
  f && (u = !0);
44
44
  try {
45
45
  const h = r.get(s);
46
46
  if (!h) return;
47
- const m = r.get(o), D = s === o || s === i;
47
+ const m = r.get(n), D = s === n || s === i;
48
48
  if (f)
49
- (v = n == null ? void 0 : n.trackGuiEnter) == null || v.call(n, s), D ? r.forEach((w) => {
50
- var b;
51
- w.name !== o && w.activated && ((b = n == null ? void 0 : n.trackGuiLeave) == null || b.call(n, w.name), r.set(w.name, {
52
- ...w,
49
+ (d = o == null ? void 0 : o.trackGuiEnter) == null || d.call(o, s), D ? r.forEach((P) => {
50
+ var S;
51
+ P.name !== n && P.activated && ((S = o == null ? void 0 : o.trackGuiLeave) == null || S.call(o, P.name), r.set(P.name, {
52
+ ...P,
53
53
  activated: !1,
54
54
  attrs: void 0
55
55
  }));
56
- }) : m != null && m.activated && ((A = n == null ? void 0 : n.trackGuiLeave) == null || A.call(n, o), r.set(o, { ...m, activated: !1 })), p && c.set(s, { ...p }), r.set(s, {
56
+ }) : m != null && m.activated && ((w = o == null ? void 0 : o.trackGuiLeave) == null || w.call(o, n), r.set(n, { ...m, activated: !1 })), A && c.set(s, { ...A }), r.set(s, {
57
57
  ...h,
58
58
  activated: !0,
59
59
  componentKey: (h.componentKey || 0) + 1,
60
- attrs: p ? { ...p } : void 0
60
+ attrs: A ? { ...A } : void 0
61
61
  });
62
62
  else {
63
- (y = n == null ? void 0 : n.trackGuiLeave) == null || y.call(n, s), c.delete(s), r.set(s, { ...h, activated: !1, attrs: void 0 });
64
- const w = r.get(o);
65
- if (!D && w && !w.activated) {
66
- if (w.name === i) return;
67
- r.set(o, { ...w, activated: !0 });
63
+ (y = o == null ? void 0 : o.trackGuiLeave) == null || y.call(o, s), c.delete(s), r.set(s, { ...h, activated: !1, attrs: void 0 });
64
+ const P = r.get(n);
65
+ if (!D && P && !P.activated) {
66
+ if (P.name === i) return;
67
+ r.set(n, { ...P, activated: !0 });
68
68
  }
69
69
  }
70
70
  } finally {
@@ -88,51 +88,51 @@ function Ve(e, n) {
88
88
  function g(s) {
89
89
  return c.get(s);
90
90
  }
91
- function P(s, f) {
92
- const p = c.get(s);
93
- c.set(s, { ...p, ...f });
91
+ function p(s, f) {
92
+ const A = c.get(s);
93
+ c.set(s, { ...A, ...f });
94
94
  }
95
95
  return {
96
- resolveControls: d,
97
- activeControl: R,
98
- currentControl: T,
99
- toggleControl: M,
96
+ resolveControls: v,
97
+ activeControl: C,
98
+ currentControl: M,
99
+ toggleControl: T,
100
100
  registerControl: L,
101
101
  registerControls: _,
102
102
  getControlAttrs: g,
103
- updateControlAttrs: P,
103
+ updateControlAttrs: p,
104
104
  cleanup: l.cleanup
105
105
  };
106
106
  }
107
107
  const ve = "micro-router-inspector", je = "micro-router-events";
108
108
  async function qe(e) {
109
109
  if (typeof import.meta < "u") return;
110
- let n;
110
+ let o;
111
111
  try {
112
- n = (await import(
112
+ o = (await import(
113
113
  /* @vite-ignore */
114
114
  "@vue/devtools-api"
115
115
  )).setupDevtoolsPlugin;
116
116
  } catch {
117
117
  return;
118
118
  }
119
- n && n(
119
+ o && o(
120
120
  {
121
121
  id: "vue-micro-router",
122
122
  label: "Micro Router",
123
123
  packageName: "vue-micro-router",
124
124
  homepage: "https://github.com/danh121097/vue-micro-router"
125
125
  },
126
- (o) => {
127
- o.addInspector({
126
+ (n) => {
127
+ n.addInspector({
128
128
  id: ve,
129
129
  label: "Micro Router",
130
130
  icon: "route"
131
- }), o.addTimelineLayer({
131
+ }), n.addTimelineLayer({
132
132
  id: je,
133
133
  label: "Micro Router",
134
134
  color: 4372611
135
- }), o.on.getInspectorTree((i) => {
135
+ }), n.on.getInspectorTree((i) => {
136
136
  i.inspectorId === ve && (i.rootNodes = [
137
137
  {
138
138
  id: "routes",
@@ -159,7 +159,7 @@ async function qe(e) {
159
159
  }))
160
160
  }
161
161
  ]);
162
- }), o.on.getInspectorState((i) => {
162
+ }), n.on.getInspectorState((i) => {
163
163
  if (i.inspectorId === ve) {
164
164
  if (i.nodeId === "routes")
165
165
  i.state = {
@@ -201,10 +201,10 @@ async function qe(e) {
201
201
  );
202
202
  }
203
203
  function He(e) {
204
- const n = e.activePath.value.split("/").filter(Boolean), o = {};
205
- for (const r of n) {
204
+ const o = e.activePath.value.split("/").filter(Boolean), n = {};
205
+ for (const r of o) {
206
206
  const c = e.getRouteAttrs(r);
207
- c && (o[r] = { ...c });
207
+ c && (n[r] = { ...c });
208
208
  }
209
209
  const i = [], t = {};
210
210
  for (const r of e.resolveDialogs.value) {
@@ -221,48 +221,66 @@ function He(e) {
221
221
  }
222
222
  return {
223
223
  version: 1,
224
- navigation: { activePath: e.activePath.value, routeAttrs: o },
224
+ navigation: { activePath: e.activePath.value, routeAttrs: n },
225
225
  dialogs: { stack: i, attrs: t },
226
226
  controls: { active: l, attrs: u }
227
227
  };
228
228
  }
229
- async function Je(e, n) {
230
- if (n.version !== 1) {
231
- console.warn("[vue-micro-router] Unknown serialized state version:", n.version);
229
+ async function Je(e, o) {
230
+ if (o.version !== 1) {
231
+ console.warn("[vue-micro-router] Unknown serialized state version:", o.version);
232
232
  return;
233
233
  }
234
- const { activePath: o, routeAttrs: i } = n.navigation;
235
- await e.push(o);
234
+ const { activePath: n, routeAttrs: i } = o.navigation;
235
+ await e.push(n);
236
236
  for (const [t, l] of Object.entries(i))
237
237
  e.updateRouteAttrs(t, l);
238
- for (const t of n.dialogs.stack) {
239
- const l = n.dialogs.attrs[t];
238
+ for (const t of o.dialogs.stack) {
239
+ const l = o.dialogs.attrs[t];
240
240
  e.openDialog(t, l);
241
241
  }
242
- for (const t of n.controls.active) {
243
- const l = n.controls.attrs[t];
242
+ for (const t of o.controls.active) {
243
+ const l = o.controls.attrs[t];
244
244
  e.toggleControl(t, !0, l);
245
245
  }
246
246
  }
247
- const Qe = /* @__PURE__ */ new Set(["A", "BUTTON", "INPUT", "SELECT", "TEXTAREA"]), Ze = /iPhone|iPad|iPod|Android/i;
247
+ const Qe = /* @__PURE__ */ new Set(["A", "BUTTON", "INPUT", "SELECT", "TEXTAREA"]), Ze = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA"]), ke = "input[autofocus],textarea[autofocus]", et = /iPhone|iPad|iPod|Android/i, tt = 12;
248
248
  let B = null, J = null, pe = !1;
249
- function ke(e) {
249
+ function Oe(e) {
250
250
  return !(!Qe.has(e.tagName) && !e.hasAttribute("tabindex") || e.tagName === "A" && !e.hasAttribute("href") || e.hidden || e.closest("[hidden],[inert]") || e.getAttribute("aria-hidden") === "true" || e.getAttribute("tabindex") === "-1" || e.hasAttribute("disabled") || e instanceof HTMLInputElement && e.type === "hidden");
251
251
  }
252
- function Me(e) {
252
+ function nt(e) {
253
253
  return Array.from(
254
254
  e.querySelectorAll("*")
255
- ).filter(ke);
255
+ ).filter(Oe);
256
256
  }
257
- function et(e) {
258
- return Me(e).find((n) => n.hasAttribute("autofocus"));
257
+ function ot(e) {
258
+ return Array.from(e.querySelectorAll(ke)).find(
259
+ (o) => Ze.has(o.tagName) && Oe(o)
260
+ );
259
261
  }
260
- function tt(e) {
261
- const n = Me(e);
262
- return n.find((o) => o.hasAttribute("autofocus")) ?? n[0] ?? e;
262
+ function at(e, o = !0, n = !0, i = () => !0) {
263
+ let t = !1;
264
+ const l = (u = 0) => {
265
+ const r = e();
266
+ if (t || !r || !i()) return;
267
+ const c = ot(r);
268
+ if (c) {
269
+ c.focus(), n && he();
270
+ return;
271
+ }
272
+ if (o && u < tt) {
273
+ requestAnimationFrame(() => l(u + 1));
274
+ return;
275
+ }
276
+ n && he();
277
+ };
278
+ return requestAnimationFrame(() => l()), () => {
279
+ t = !0;
280
+ };
263
281
  }
264
- function nt() {
265
- typeof document > "u" || typeof navigator > "u" || !Ze.test(navigator.userAgent) || (pe = !0, B == null || B.remove(), B = document.createElement("input"), B.setAttribute("aria-hidden", "true"), B.setAttribute("tabindex", "-1"), B.style.cssText = [
282
+ function it() {
283
+ typeof document > "u" || typeof navigator > "u" || !et.test(navigator.userAgent) || (pe = !0, B == null || B.remove(), B = document.createElement("input"), B.setAttribute("aria-label", "Keyboard input"), B.setAttribute("tabindex", "-1"), B.setAttribute("autocomplete", "off"), B.style.cssText = [
266
284
  "position:fixed",
267
285
  "top:0",
268
286
  "left:0",
@@ -281,8 +299,8 @@ function nt() {
281
299
  function he() {
282
300
  !pe && !B || (pe = !1, J && (clearTimeout(J), J = null), B == null || B.remove(), B = null);
283
301
  }
284
- function ot(e) {
285
- const o = be();
302
+ function st(e) {
303
+ const n = be();
286
304
  let i = !1;
287
305
  const t = we({
288
306
  activeDialog: "",
@@ -291,26 +309,26 @@ function ot(e) {
291
309
  /** Open order stack — last entry = topmost dialog. Used for z-index and focus management. */
292
310
  dialogStack: [],
293
311
  /** Dialog definitions. Re-set on open/close to trigger shallowReactive reactivity. */
294
- dialogs: F(/* @__PURE__ */ new Map()),
312
+ dialogs: X(/* @__PURE__ */ new Map()),
295
313
  /** Attrs stored separately for useMicroState access inside dialog components */
296
- dialogAttrs: F(/* @__PURE__ */ new Map())
297
- }), l = C(() => {
298
- const g = [], P = /* @__PURE__ */ new Set();
314
+ dialogAttrs: X(/* @__PURE__ */ new Map())
315
+ }), l = R(() => {
316
+ const g = [], p = /* @__PURE__ */ new Set();
299
317
  for (const s of t.dialogStack) {
300
318
  const f = t.dialogs.get(s);
301
- f && (f.activated || f.closing) && (g.push(f), P.add(s));
319
+ f && (f.activated || f.closing) && (g.push(f), p.add(s));
302
320
  }
303
321
  for (const s of t.dialogs.values())
304
- s.closing && !P.has(s.path) && g.push(s);
322
+ s.closing && !p.has(s.path) && g.push(s);
305
323
  return g;
306
- }), u = o.schedule;
307
- function r(g, P) {
308
- return { path: g, attrs: P };
324
+ }), u = n.schedule;
325
+ function r(g, p) {
326
+ return { path: g, attrs: p };
309
327
  }
310
- function c({ path: g, open: P, attrs: s }) {
328
+ function c({ path: g, open: p, attrs: s }) {
311
329
  const f = t.dialogs.get(g);
312
330
  return f && te(() => {
313
- if (P)
331
+ if (p)
314
332
  t.fromDialog = t.activeDialog, t.toDialog = g, t.dialogStack.includes(g) || t.dialogStack.push(g), t.activeDialog = g, s && t.dialogAttrs.set(g, { ...s }), t.dialogs.set(g, {
315
333
  ...f,
316
334
  activated: !0,
@@ -320,107 +338,107 @@ function ot(e) {
320
338
  path: g,
321
339
  ...s,
322
340
  onClose: () => {
323
- d(g), s != null && s.onClose && typeof s.onClose == "function" && s.onClose();
341
+ v(g), s != null && s.onClose && typeof s.onClose == "function" && s.onClose();
324
342
  }
325
343
  }
326
344
  });
327
345
  else {
328
346
  t.fromDialog = t.activeDialog;
329
- const p = t.dialogStack.indexOf(g);
330
- p > -1 && t.dialogStack.splice(p, 1), t.activeDialog = t.dialogStack.at(-1) ?? "", t.toDialog = t.activeDialog;
331
- const v = f.transitionDuration ?? (f.transition === "slide" ? 500 : 300);
347
+ const A = t.dialogStack.indexOf(g);
348
+ A > -1 && t.dialogStack.splice(A, 1), t.activeDialog = t.dialogStack.at(-1) ?? "", t.toDialog = t.activeDialog;
349
+ const d = f.transitionDuration ?? (f.transition === "slide" ? 500 : 300);
332
350
  t.dialogs.set(g, {
333
351
  ...f,
334
352
  activated: !1,
335
353
  closing: !0,
336
354
  attrs: void 0
337
355
  }), u(() => {
338
- const A = t.dialogs.get(g);
339
- A && !A.activated && t.dialogs.set(g, { ...A, closing: !1 });
340
- }, v + 200);
356
+ const w = t.dialogs.get(g);
357
+ w && !w.activated && t.dialogs.set(g, { ...w, closing: !1 });
358
+ }, d + 200);
341
359
  }
342
360
  }), r(g, s);
343
361
  }
344
- function a(g, P) {
362
+ function a(g, p) {
345
363
  var s, f;
346
- if (i) return r(g, P);
347
- (s = t.dialogs.get(g)) != null && s.focusInput && nt(), i = !0;
364
+ if (i) return r(g, p);
365
+ (s = t.dialogs.get(g)) != null && s.focusInput && it(), i = !0;
348
366
  try {
349
- const p = t.activeDialog || "";
350
- (f = e == null ? void 0 : e.trackDialogEnter) == null || f.call(e, g, p, g);
351
- const v = c({ path: g, open: !0, attrs: P });
367
+ const A = t.activeDialog || "";
368
+ (f = e == null ? void 0 : e.trackDialogEnter) == null || f.call(e, g, A, g);
369
+ const d = c({ path: g, open: !0, attrs: p });
352
370
  return u(() => {
353
371
  i = !1;
354
- }, 300), v;
355
- } catch (p) {
356
- throw i = !1, p;
372
+ }, 300), d;
373
+ } catch (A) {
374
+ throw i = !1, A;
357
375
  }
358
376
  }
359
- function d(g) {
360
- var P;
361
- (P = e == null ? void 0 : e.trackDialogLeave) == null || P.call(e, g, g, ""), t.dialogAttrs.delete(g), c({ path: g, open: !1 });
377
+ function v(g) {
378
+ var p;
379
+ (p = e == null ? void 0 : e.trackDialogLeave) == null || p.call(e, g, g, ""), t.dialogAttrs.delete(g), c({ path: g, open: !1 });
362
380
  }
363
- function R() {
364
- const g = [], P = [];
381
+ function C() {
382
+ const g = [], p = [];
365
383
  t.dialogs.forEach((s, f) => {
366
- var p, v;
384
+ var A, d;
367
385
  if (s.activated) {
368
- (p = e == null ? void 0 : e.trackDialogLeave) == null || p.call(e, f, f, "");
369
- const A = (v = s.attrs) == null ? void 0 : v.onClose;
370
- typeof A == "function" && P.push(A), t.dialogs.set(f, {
386
+ (A = e == null ? void 0 : e.trackDialogLeave) == null || A.call(e, f, f, "");
387
+ const w = (d = s.attrs) == null ? void 0 : d.onClose;
388
+ typeof w == "function" && p.push(w), t.dialogs.set(f, {
371
389
  ...s,
372
390
  activated: !1,
373
391
  closing: !0,
374
392
  attrs: void 0
375
393
  }), g.push(f);
376
394
  }
377
- }), P.forEach((s) => s()), t.dialogAttrs.clear(), t.fromDialog = t.activeDialog, t.toDialog = "", t.activeDialog = "", t.dialogStack = [], u(() => {
395
+ }), p.forEach((s) => s()), t.dialogAttrs.clear(), t.fromDialog = t.activeDialog, t.toDialog = "", t.activeDialog = "", t.dialogStack = [], u(() => {
378
396
  g.forEach((s) => {
379
397
  const f = t.dialogs.get(s);
380
398
  f && !f.activated && t.dialogs.set(s, { ...f, closing: !1 });
381
399
  });
382
400
  }, 500);
383
401
  }
384
- function T(g) {
402
+ function M(g) {
385
403
  t.dialogs.has(g.path) && console.warn(`[vue-micro-router] Dialog "${g.path}" already registered. Overwriting.`);
386
- let { component: P } = g;
387
- Ee(P) && (P = Pe(P)), t.dialogs.set(g.path, {
404
+ let { component: p } = g;
405
+ Ee(p) && (p = Pe(p)), t.dialogs.set(g.path, {
388
406
  persistent: !0,
389
407
  ...g,
390
- component: Se(P)
408
+ component: Se(p)
391
409
  });
392
410
  }
393
- function M(g) {
394
- g.forEach(T);
411
+ function T(g) {
412
+ g.forEach(M);
395
413
  }
396
414
  function L(g) {
397
415
  return t.dialogAttrs.get(g);
398
416
  }
399
- function _(g, P) {
417
+ function _(g, p) {
400
418
  const s = t.dialogAttrs.get(g);
401
- t.dialogAttrs.set(g, { ...s, ...P });
419
+ t.dialogAttrs.set(g, { ...s, ...p });
402
420
  }
403
421
  return {
404
- activeDialog: C(() => t.activeDialog),
405
- fromDialog: C(() => t.fromDialog),
406
- toDialog: C(() => t.toDialog),
422
+ activeDialog: R(() => t.activeDialog),
423
+ fromDialog: R(() => t.fromDialog),
424
+ toDialog: R(() => t.toDialog),
407
425
  resolveDialogs: l,
408
426
  openDialog: a,
409
- closeDialog: d,
410
- closeAllDialogs: R,
411
- registerDialog: T,
412
- registerDialogs: M,
427
+ closeDialog: v,
428
+ closeAllDialogs: C,
429
+ registerDialog: M,
430
+ registerDialogs: T,
413
431
  getDialogAttrs: L,
414
432
  updateDialogAttrs: _,
415
- cleanup: o.cleanup
433
+ cleanup: n.cleanup
416
434
  };
417
435
  }
418
436
  const Ke = 5e3;
419
- async function ye(e, n, o, i) {
437
+ async function ye(e, o, n, i) {
420
438
  let t;
421
439
  try {
422
440
  const l = await Promise.race([
423
- Promise.resolve(e(n, o)),
441
+ Promise.resolve(e(o, n)),
424
442
  new Promise((u, r) => {
425
443
  t = setTimeout(() => r(new Error("Navigation guard timed out")), i);
426
444
  })
@@ -430,102 +448,102 @@ async function ye(e, n, o, i) {
430
448
  return clearTimeout(t), !1;
431
449
  }
432
450
  }
433
- async function at(e, n, o, i = Ke) {
451
+ async function rt(e, o, n, i = Ke) {
434
452
  for (const t of e)
435
- if (!await ye(t, n, o, i)) return !1;
453
+ if (!await ye(t, o, n, i)) return !1;
436
454
  return !0;
437
455
  }
438
- async function _e(e, n, o, i) {
456
+ async function Le(e, o, n, i) {
439
457
  var r;
440
- const t = o.guardTimeout ?? Ke;
441
- if ((r = o.beforeEach) != null && r.length && !await at(o.beforeEach, e, n, t))
458
+ const t = n.guardTimeout ?? Ke;
459
+ if ((r = n.beforeEach) != null && r.length && !await rt(n.beforeEach, e, o, t))
442
460
  return !1;
443
461
  const l = H(e);
444
462
  if (l) {
445
463
  const c = i.getRoute(l);
446
- if (c != null && c.beforeEnter && !await ye(c.beforeEnter, e, n, t))
464
+ if (c != null && c.beforeEnter && !await ye(c.beforeEnter, e, o, t))
447
465
  return !1;
448
466
  }
449
- const u = H(n);
467
+ const u = H(o);
450
468
  if (u) {
451
469
  const c = i.getRoute(u);
452
- if (c != null && c.beforeLeave && !await ye(c.beforeLeave, e, n, t))
470
+ if (c != null && c.beforeLeave && !await ye(c.beforeLeave, e, o, t))
453
471
  return !1;
454
472
  }
455
473
  return !0;
456
474
  }
457
- function it(e, n, o) {
458
- if (o != null && o.length)
459
- for (const i of o)
475
+ function lt(e, o, n) {
476
+ if (n != null && n.length)
477
+ for (const i of n)
460
478
  try {
461
- i(e, n);
479
+ i(e, o);
462
480
  } catch {
463
481
  }
464
482
  }
465
- function st(e, n) {
466
- const o = e.maxEntries ?? 50, i = [];
483
+ function ut(e, o) {
484
+ const n = e.maxEntries ?? 50, i = [];
467
485
  let t = -1, l = !1;
468
486
  const u = ne(0);
469
- function r(g, P) {
470
- !e.enabled || l || (t < i.length - 1 && i.splice(t + 1), i.push({ path: g, timestamp: Date.now(), props: P ? { ...P } : void 0 }), t = i.length - 1, i.length > o && (i.shift(), t--), u.value++);
487
+ function r(g, p) {
488
+ !e.enabled || l || (t < i.length - 1 && i.splice(t + 1), i.push({ path: g, timestamp: Date.now(), props: p ? { ...p } : void 0 }), t = i.length - 1, i.length > n && (i.shift(), t--), u.value++);
471
489
  }
472
- const c = C(() => (u.value, [...i])), a = C(() => (u.value, t > 0)), d = C(() => (u.value, t < i.length - 1));
473
- async function R(g) {
490
+ const c = R(() => (u.value, [...i])), a = R(() => (u.value, t > 0)), v = R(() => (u.value, t < i.length - 1));
491
+ async function C(g) {
474
492
  if (g < 0 || g >= i.length) return;
475
- const P = i[g];
476
- if (P) {
493
+ const p = i[g];
494
+ if (p) {
477
495
  t = g, l = !0, u.value++;
478
496
  try {
479
- await n(P.path);
497
+ await o(p.path);
480
498
  } finally {
481
499
  l = !1;
482
500
  }
483
501
  }
484
502
  }
485
- async function T() {
486
- a.value && await R(t - 1);
487
- }
488
503
  async function M() {
489
- d.value && await R(t + 1);
504
+ a.value && await C(t - 1);
505
+ }
506
+ async function T() {
507
+ v.value && await C(t + 1);
490
508
  }
491
509
  async function L(g) {
492
- const P = t + g;
493
- await R(P);
510
+ const p = t + g;
511
+ await C(p);
494
512
  }
495
513
  function _() {
496
514
  i.length = 0, t = -1, u.value++;
497
515
  }
498
- return { entries: c, canGoBack: a, canGoForward: d, back: T, forward: M, go: L, clear: _, record: r };
516
+ return { entries: c, canGoBack: a, canGoForward: v, back: M, forward: T, go: L, clear: _, record: r };
499
517
  }
500
- function rt() {
501
- const e = F(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Map();
502
- function o(u) {
518
+ function ct() {
519
+ const e = X(/* @__PURE__ */ new Map()), o = /* @__PURE__ */ new Map();
520
+ function n(u) {
503
521
  e.has(u.path) && console.warn(`[vue-micro-router] Route "${u.path}" already registered. Overwriting.`);
504
522
  let { component: r } = u;
505
- Ee(r) && (n.set(u.path, r), r = Pe(r)), e.set(u.path, {
523
+ Ee(r) && (o.set(u.path, r), r = Pe(r)), e.set(u.path, {
506
524
  ...u,
507
525
  component: Se(r)
508
- }), u.preload === "eager" && n.has(u.path) && ae(n.get(u.path));
526
+ }), u.preload === "eager" && o.has(u.path) && ae(o.get(u.path));
509
527
  }
510
528
  function i(u) {
511
- u.forEach(o);
529
+ u.forEach(n);
512
530
  }
513
531
  async function t(u) {
514
- const r = n.get(u);
532
+ const r = o.get(u);
515
533
  r && await ae(r);
516
534
  }
517
535
  function l(u) {
518
536
  for (const [r, c] of e.entries())
519
537
  if (c.preload === "adjacent" && !u.includes(r)) {
520
- const a = n.get(r);
538
+ const a = o.get(r);
521
539
  a && ae(a);
522
540
  }
523
541
  }
524
- return { routes: e, asyncLoaders: n, registerRoute: o, registerRoutes: i, preloadRoute: t, preloadAdjacent: l };
542
+ return { routes: e, asyncLoaders: o, registerRoute: n, registerRoutes: i, preloadRoute: t, preloadAdjacent: l };
525
543
  }
526
- function lt(e) {
527
- const n = e.stepWiseDelay ?? Math.max(e.stepDelay * 1.2, e.stepDelay + 100);
528
- async function o(t, l) {
544
+ function ft(e) {
545
+ const o = e.stepWiseDelay ?? Math.max(e.stepDelay * 1.2, e.stepDelay + 100);
546
+ async function n(t, l) {
529
547
  if (!t || e.isLocked()) return;
530
548
  const u = $(t);
531
549
  if (e.getActivePath() !== u) {
@@ -541,24 +559,24 @@ function lt(e) {
541
559
  const r = I(e.getActivePath()), c = I(u);
542
560
  if (t.startsWith("/"))
543
561
  for (let a = 0; a < c.length; a++) {
544
- const d = W(
562
+ const v = W(
545
563
  c.slice(0, a + 1)
546
564
  );
547
- if (e.getActivePath() === d) continue;
548
- const R = a === c.length - 1;
549
- await e.pushCore(d, R ? l : void 0), R || await de(n);
565
+ if (e.getActivePath() === v) continue;
566
+ const C = a === c.length - 1;
567
+ await e.pushCore(v, C ? l : void 0), C || await de(o);
550
568
  }
551
569
  else {
552
570
  const a = c.filter(
553
- (d) => !r.includes(d)
571
+ (v) => !r.includes(v)
554
572
  );
555
573
  if (a.length === 0) {
556
574
  await e.pushCore(t, l), e.scheduleUnlock();
557
575
  return;
558
576
  }
559
- for (let d = 0; d < a.length; d++) {
560
- const R = d === a.length - 1;
561
- await e.pushCore(a[d], R ? l : void 0), R || await de(n);
577
+ for (let v = 0; v < a.length; v++) {
578
+ const C = v === a.length - 1;
579
+ await e.pushCore(a[v], C ? l : void 0), C || await de(o);
562
580
  }
563
581
  }
564
582
  e.scheduleUnlock();
@@ -581,69 +599,69 @@ function lt(e) {
581
599
  }
582
600
  }
583
601
  for (let r = 0; r < u; r++)
584
- await e.pushCore(-1), r < u - 1 && await de(n);
602
+ await e.pushCore(-1), r < u - 1 && await de(o);
585
603
  e.scheduleUnlock();
586
604
  } catch (r) {
587
605
  throw e.unlock(), r;
588
606
  }
589
607
  }
590
608
  }
591
- return { stepWisePush: o, stepWiseBack: i };
609
+ return { stepWisePush: n, stepWiseBack: i };
592
610
  }
593
- function ut(e, n) {
594
- const o = e.defaultPath, i = e.stepDelay ?? ze, t = e.guards ?? {}, l = e.history ?? {}, u = be(), r = rt(), c = ne(!1), a = we({
595
- activePath: o,
596
- fromPath: o,
597
- toPath: o,
611
+ function gt(e, o) {
612
+ const n = e.defaultPath, i = e.stepDelay ?? ze, t = e.guards ?? {}, l = e.history ?? {}, u = be(), r = ct(), c = ne(!1), a = we({
613
+ activePath: n,
614
+ fromPath: n,
615
+ toPath: n,
598
616
  /** Attrs stored separately — changes here do NOT invalidate resolveRoutes computed */
599
- routeAttrs: F(/* @__PURE__ */ new Map()),
617
+ routeAttrs: X(/* @__PURE__ */ new Map()),
600
618
  /** Version stamp per segment — incremented on re-navigation to same segment (forces transition) */
601
- routeKeys: F(/* @__PURE__ */ new Map()),
619
+ routeKeys: X(/* @__PURE__ */ new Map()),
602
620
  /** Component key per segment — incremented to force Vue full remount (resets local state) */
603
- componentKeys: F(/* @__PURE__ */ new Map())
604
- }), d = /* @__PURE__ */ new Map(), R = C(() => {
621
+ componentKeys: X(/* @__PURE__ */ new Map())
622
+ }), v = /* @__PURE__ */ new Map(), C = R(() => {
605
623
  const y = I(a.activePath), h = [];
606
624
  for (const m of y) {
607
625
  const D = r.routes.get(m);
608
626
  if (!D) continue;
609
- const w = a.routeKeys.get(m) || 0, b = a.componentKeys.get(m) || 0, S = `${D.path}-${w}`, E = d.get(m);
610
- if (E && E.key === S && E.componentKey === b)
627
+ const P = a.routeKeys.get(m) || 0, S = a.componentKeys.get(m) || 0, b = `${D.path}-${P}`, E = v.get(m);
628
+ if (E && E.key === b && E.componentKey === S)
611
629
  h.push(E);
612
630
  else {
613
- const K = { ...D, key: S, componentKey: b };
614
- d.set(m, K), h.push(K);
631
+ const K = { ...D, key: b, componentKey: S };
632
+ v.set(m, K), h.push(K);
615
633
  }
616
634
  }
617
- for (const m of d.keys())
618
- y.includes(m) || d.delete(m);
635
+ for (const m of v.keys())
636
+ y.includes(m) || v.delete(m);
619
637
  return h;
620
638
  });
621
- function T(y, h) {
622
- var K, N;
639
+ function M(y, h) {
640
+ var K, G;
623
641
  const m = I(a.activePath), D = Math.min(y, m.length - 1);
624
642
  if (D <= 0) return;
625
- const w = m.slice(0, -D), b = W(w);
643
+ const P = m.slice(0, -D), S = W(P);
626
644
  for (let U = m.length - D; U < m.length; U++)
627
645
  a.routeAttrs.delete(m[U]);
628
- const S = w.at(-1);
629
- if (S && h) {
630
- const U = a.routeAttrs.get(S);
631
- a.routeAttrs.set(S, { ...U, ...h }), a.componentKeys.set(
632
- S,
633
- (a.componentKeys.get(S) || 0) + 1
646
+ const b = P.at(-1);
647
+ if (b && h) {
648
+ const U = a.routeAttrs.get(b);
649
+ a.routeAttrs.set(b, { ...U, ...h }), a.componentKeys.set(
650
+ b,
651
+ (a.componentKeys.get(b) || 0) + 1
634
652
  );
635
653
  }
636
654
  const E = a.activePath;
637
- (K = n == null ? void 0 : n.trackPageLeave) == null || K.call(n, E, E, b), a.fromPath = E, a.toPath = b, a.activePath = b, (N = n == null ? void 0 : n.trackPageEnter) == null || N.call(n, b, E, b);
655
+ (K = o == null ? void 0 : o.trackPageLeave) == null || K.call(o, E, E, S), a.fromPath = E, a.toPath = S, a.activePath = S, (G = o == null ? void 0 : o.trackPageEnter) == null || G.call(o, S, E, S);
638
656
  }
639
- async function M(y, h) {
640
- var b, S;
657
+ async function T(y, h) {
658
+ var S, b;
641
659
  const m = $(y), D = I(m);
642
660
  await Promise.all(
643
661
  D.map((E) => r.asyncLoaders.get(E)).filter((E) => !!E).map((E) => ae(E))
644
662
  );
645
- const w = a.activePath;
646
- w !== m && ((b = n == null ? void 0 : n.trackPageLeave) == null || b.call(n, w, w, m)), a.fromPath = w, a.toPath = m, a.activePath = m, h && L(m, h), (S = n == null ? void 0 : n.trackPageEnter) == null || S.call(n, m, w, m);
663
+ const P = a.activePath;
664
+ P !== m && ((S = o == null ? void 0 : o.trackPageLeave) == null || S.call(o, P, P, m)), a.fromPath = P, a.toPath = m, a.activePath = m, h && L(m, h), (b = o == null ? void 0 : o.trackPageEnter) == null || b.call(o, m, P, m);
647
665
  }
648
666
  function L(y, h) {
649
667
  const m = I(y).at(-1);
@@ -658,57 +676,57 @@ function ut(e, n) {
658
676
  function g(y) {
659
677
  return a.routeAttrs.get(y);
660
678
  }
661
- async function P(y, h) {
679
+ async function p(y, h) {
662
680
  if (!y && y !== 0) return;
663
681
  if (typeof y == "number" && y < 0) {
664
- T(Math.abs(y), h);
682
+ M(Math.abs(y), h);
665
683
  return;
666
684
  }
667
685
  const m = y.toString();
668
686
  if (m.startsWith("/")) {
669
- const S = I(m), E = I(a.activePath);
670
- if (S.length < E.length && S.every((U, le) => E[le] === U)) {
671
- if (E.length - S.length === 1)
672
- T(1, h);
687
+ const b = I(m), E = I(a.activePath);
688
+ if (b.length < E.length && b.every((U, le) => E[le] === U)) {
689
+ if (E.length - b.length === 1)
690
+ M(1, h);
673
691
  else {
674
- const le = E.slice(0, S.length + 1), $e = W(le);
675
- for (let ue = S.length + 1; ue < E.length; ue++)
692
+ const le = E.slice(0, b.length + 1), $e = W(le);
693
+ for (let ue = b.length + 1; ue < E.length; ue++)
676
694
  a.routeAttrs.delete(E[ue]);
677
- a.activePath = $e, await te(), T(1, h);
695
+ a.activePath = $e, await te(), M(1, h);
678
696
  }
679
697
  return;
680
698
  }
681
- const N = S.at(-1);
682
- N && E.at(-1) === N && a.routeKeys.set(
683
- N,
684
- (a.routeKeys.get(N) || 0) + 1
685
- ), await M(m, h);
699
+ const G = b.at(-1);
700
+ G && E.at(-1) === G && a.routeKeys.set(
701
+ G,
702
+ (a.routeKeys.get(G) || 0) + 1
703
+ ), await T(m, h);
686
704
  return;
687
705
  }
688
- const D = I(a.activePath), w = D.indexOf(m);
689
- if (w !== -1) {
690
- const S = D.length - (w + 1);
691
- if (S === 1)
692
- T(1, h);
693
- else if (S > 1) {
694
- const E = D.slice(0, w + 2), K = W(E);
695
- for (let N = w + 2; N < D.length; N++)
696
- a.routeAttrs.delete(D[N]);
697
- a.activePath = K, await te(), T(1, h);
706
+ const D = I(a.activePath), P = D.indexOf(m);
707
+ if (P !== -1) {
708
+ const b = D.length - (P + 1);
709
+ if (b === 1)
710
+ M(1, h);
711
+ else if (b > 1) {
712
+ const E = D.slice(0, P + 2), K = W(E);
713
+ for (let G = P + 2; G < D.length; G++)
714
+ a.routeAttrs.delete(D[G]);
715
+ a.activePath = K, await te(), M(1, h);
698
716
  } else
699
- a.routeKeys.set(m, (a.routeKeys.get(m) || 0) + 1), await M(
700
- W(D.slice(0, w + 1)),
717
+ a.routeKeys.set(m, (a.routeKeys.get(m) || 0) + 1), await T(
718
+ W(D.slice(0, P + 1)),
701
719
  h
702
720
  );
703
721
  return;
704
722
  }
705
- const b = W([...D, m]);
706
- await M(b, h);
723
+ const S = W([...D, m]);
724
+ await T(S, h);
707
725
  }
708
726
  function s(y) {
709
727
  if (typeof y == "number" && y < 0) {
710
- const w = I(a.activePath), b = Math.min(Math.abs(y), w.length - 1);
711
- return b <= 0 ? a.activePath : W(w.slice(0, -b));
728
+ const P = I(a.activePath), S = Math.min(Math.abs(y), P.length - 1);
729
+ return S <= 0 ? a.activePath : W(P.slice(0, -S));
712
730
  }
713
731
  const h = y.toString();
714
732
  if (h.startsWith("/")) return $(h);
@@ -716,23 +734,23 @@ function ut(e, n) {
716
734
  return D !== -1 ? W(m.slice(0, D + 1)) : W([...m, h]);
717
735
  }
718
736
  const f = { getRoute: (y) => r.routes.get(y) };
719
- async function p(y, h) {
737
+ async function A(y, h) {
720
738
  var m;
721
739
  if (!c.value) {
722
740
  c.value = !0;
723
741
  try {
724
- const D = (((m = t.beforeEach) == null ? void 0 : m.length) ?? 0) > 0, w = r.routes.size > 0;
725
- if ((D || w) && y) {
742
+ const D = (((m = t.beforeEach) == null ? void 0 : m.length) ?? 0) > 0, P = r.routes.size > 0;
743
+ if ((D || P) && y) {
726
744
  const E = s(y), K = $(a.activePath);
727
- if (!await _e(E, K, t, f)) {
745
+ if (!await Le(E, K, t, f)) {
728
746
  c.value = !1;
729
747
  return;
730
748
  }
731
749
  }
732
- const b = $(a.activePath);
733
- await P(y, h);
734
750
  const S = $(a.activePath);
735
- v == null || v.record(S, h), it(S, b, t.afterEach), r.preloadAdjacent(I(a.activePath)), u.schedule(() => {
751
+ await p(y, h);
752
+ const b = $(a.activePath);
753
+ d == null || d.record(b, h), lt(b, S, t.afterEach), r.preloadAdjacent(I(a.activePath)), u.schedule(() => {
736
754
  c.value = !1;
737
755
  }, i);
738
756
  } catch (D) {
@@ -740,19 +758,19 @@ function ut(e, n) {
740
758
  }
741
759
  }
742
760
  }
743
- const v = l.enabled ? st(l, async (y) => {
761
+ const d = l.enabled ? ut(l, async (y) => {
744
762
  const h = I(a.activePath), m = I(y);
745
- if (m.length < h.length && m.every((w, b) => h[b] === w)) {
746
- const w = h.length - m.length;
747
- await p(-w);
763
+ if (m.length < h.length && m.every((P, S) => h[S] === P)) {
764
+ const P = h.length - m.length;
765
+ await A(-P);
748
766
  } else
749
- await p(y);
767
+ await A(y);
750
768
  }) : void 0;
751
- v && v.record($(o));
752
- const A = lt({
769
+ d && d.record($(n));
770
+ const w = ft({
753
771
  getActivePath: () => a.activePath,
754
- pushCore: P,
755
- runGuards: (y, h) => _e(y, h, t, f),
772
+ pushCore: p,
773
+ runGuards: (y, h) => Le(y, h, t, f),
756
774
  scheduleUnlock: () => u.schedule(() => {
757
775
  c.value = !1;
758
776
  }, i),
@@ -766,30 +784,30 @@ function ut(e, n) {
766
784
  stepDelay: i
767
785
  });
768
786
  return {
769
- activePath: C(() => a.activePath),
770
- fromPath: C(() => a.fromPath),
771
- toPath: C(() => a.toPath),
772
- activePage: C(() => H(a.activePath)),
773
- fromPage: C(() => H(a.fromPath)),
774
- toPage: C(() => H(a.toPath)),
775
- isNavigating: C(() => c.value),
776
- resolveRoutes: R,
777
- push: p,
778
- stepWisePush: A.stepWisePush,
779
- stepWiseBack: A.stepWiseBack,
787
+ activePath: R(() => a.activePath),
788
+ fromPath: R(() => a.fromPath),
789
+ toPath: R(() => a.toPath),
790
+ activePage: R(() => H(a.activePath)),
791
+ fromPage: R(() => H(a.fromPath)),
792
+ toPage: R(() => H(a.toPath)),
793
+ isNavigating: R(() => c.value),
794
+ resolveRoutes: C,
795
+ push: A,
796
+ stepWisePush: w.stepWisePush,
797
+ stepWiseBack: w.stepWiseBack,
780
798
  registerRoute: r.registerRoute,
781
799
  registerRoutes: r.registerRoutes,
782
800
  updateRouteAttrs: _,
783
801
  getRouteAttrs: g,
784
802
  preloadRoute: r.preloadRoute,
785
803
  routes: r.routes,
786
- history: v,
804
+ history: d,
787
805
  cleanup: u.cleanup
788
806
  };
789
807
  }
790
808
  const x = () => {
791
809
  };
792
- function ct(e) {
810
+ function dt(e) {
793
811
  return {
794
812
  trackPageEnter: (e == null ? void 0 : e.trackPageEnter) ?? x,
795
813
  trackPageLeave: (e == null ? void 0 : e.trackPageLeave) ?? x,
@@ -800,55 +818,55 @@ function ct(e) {
800
818
  cleanupAllSessions: (e == null ? void 0 : e.cleanupAllSessions) ?? x
801
819
  };
802
820
  }
803
- function ft(e) {
804
- const n = ct(e.tracker), o = ut(
821
+ function vt(e) {
822
+ const o = dt(e.tracker), n = gt(
805
823
  {
806
824
  defaultPath: e.defaultPath,
807
825
  stepDelay: e.stepDelay,
808
826
  guards: e.guards,
809
827
  history: e.history
810
828
  },
811
- n
812
- ), i = ot(n), t = Ve(
829
+ o
830
+ ), i = st(o), t = Ve(
813
831
  {
814
832
  defaultControlName: e.defaultControlName,
815
833
  onboardingControlName: e.onboardingControlName
816
834
  },
817
- n
835
+ o
818
836
  ), l = e.volumeRef ? xe({
819
837
  volumeRef: e.volumeRef,
820
838
  defaultBgm: e.defaultBgm
821
839
  }) : null, u = {
822
840
  // Navigation
823
- activePath: o.activePath,
824
- fromPath: o.fromPath,
825
- toPath: o.toPath,
826
- activePage: o.activePage,
827
- fromPage: o.fromPage,
828
- toPage: o.toPage,
829
- isNavigating: o.isNavigating,
830
- resolveRoutes: o.resolveRoutes,
831
- push: async (a, d) => {
832
- await o.push(a, d), l && l.updateBackgroundMusic(o.activePath.value, o.routes);
841
+ activePath: n.activePath,
842
+ fromPath: n.fromPath,
843
+ toPath: n.toPath,
844
+ activePage: n.activePage,
845
+ fromPage: n.fromPage,
846
+ toPage: n.toPage,
847
+ isNavigating: n.isNavigating,
848
+ resolveRoutes: n.resolveRoutes,
849
+ push: async (a, v) => {
850
+ await n.push(a, v), l && l.updateBackgroundMusic(n.activePath.value, n.routes);
833
851
  },
834
- stepWisePush: async (a, d) => {
835
- await o.stepWisePush(a, d), l && l.updateBackgroundMusic(o.activePath.value, o.routes);
852
+ stepWisePush: async (a, v) => {
853
+ await n.stepWisePush(a, v), l && l.updateBackgroundMusic(n.activePath.value, n.routes);
836
854
  },
837
855
  stepWiseBack: async (a) => {
838
- await o.stepWiseBack(a), l && l.updateBackgroundMusic(o.activePath.value, o.routes);
856
+ await n.stepWiseBack(a), l && l.updateBackgroundMusic(n.activePath.value, n.routes);
839
857
  },
840
- registerRoute: o.registerRoute,
841
- registerRoutes: o.registerRoutes,
842
- updateRouteAttrs: o.updateRouteAttrs,
843
- getRouteAttrs: o.getRouteAttrs,
844
- preloadRoute: o.preloadRoute,
858
+ registerRoute: n.registerRoute,
859
+ registerRoutes: n.registerRoutes,
860
+ updateRouteAttrs: n.updateRouteAttrs,
861
+ getRouteAttrs: n.getRouteAttrs,
862
+ preloadRoute: n.preloadRoute,
845
863
  // History (conditional — only if enabled)
846
- ...o.history ? {
847
- canGoBack: o.history.canGoBack,
848
- canGoForward: o.history.canGoForward,
849
- historyBack: o.history.back,
850
- historyForward: o.history.forward,
851
- historyGo: o.history.go
864
+ ...n.history ? {
865
+ canGoBack: n.history.canGoBack,
866
+ canGoForward: n.history.canGoForward,
867
+ historyBack: n.history.back,
868
+ historyForward: n.history.forward,
869
+ historyGo: n.history.go
852
870
  } : {},
853
871
  // Dialogs
854
872
  activeDialog: i.activeDialog,
@@ -883,42 +901,42 @@ function ft(e) {
883
901
  updateBackgroundMusic: l.updateBackgroundMusic
884
902
  } : {}
885
903
  }, r = H(e.defaultPath);
886
- return X(o.activePage, (a, d) => {
887
- if (!d) return;
888
- const R = t.currentControl.value;
889
- d === r && a !== r && n.trackGuiLeave(R), a === r && d !== r && n.trackGuiEnter(R);
890
- }), l && e.defaultBgm && e.bgmStartRef && X(e.bgmStartRef, (a) => {
904
+ return F(n.activePage, (a, v) => {
905
+ if (!v) return;
906
+ const C = t.currentControl.value;
907
+ v === r && a !== r && o.trackGuiLeave(C), a === r && v !== r && o.trackGuiEnter(C);
908
+ }), l && e.defaultBgm && e.bgmStartRef && F(e.bgmStartRef, (a) => {
891
909
  a && !l.isStarted() && l.playSoundSync(e.defaultBgm, !0);
892
910
  }, { flush: "sync" }), Q(async () => {
893
- await te(), t.toggleControl(e.defaultControlName, !0), n.trackPageEnter(
894
- o.activePath.value,
911
+ await te(), t.toggleControl(e.defaultControlName, !0), o.trackPageEnter(
912
+ n.activePath.value,
895
913
  void 0,
896
- o.activePath.value
914
+ n.activePath.value
897
915
  ), l && document.addEventListener("visibilitychange", l.handleVisibilityChange), qe(u);
898
916
  }), De(() => {
899
- n.cleanupAllSessions(), o.cleanup(), i.cleanup(), t.cleanup(), l && (document.removeEventListener("visibilitychange", l.handleVisibilityChange), l.cleanup());
900
- }), O(Be, u), V(me, null) || O(me, u), u;
917
+ o.cleanupAllSessions(), n.cleanup(), i.cleanup(), t.cleanup(), l && (document.removeEventListener("visibilitychange", l.handleVisibilityChange), l.cleanup());
918
+ }), O(Ie, u), V(me, null) || O(me, u), u;
901
919
  }
902
920
  function Z(e) {
903
- const n = e != null && e.root ? me : Be, o = V(n);
904
- if (!o)
921
+ const o = e != null && e.root ? me : Ie, n = V(o);
922
+ if (!n)
905
923
  throw new Error(
906
924
  e != null && e.root ? "[vue-micro-router] useMicroRouter({ root: true }) failed — no root <MicroRouterView> found." : "[vue-micro-router] useMicroRouter() must be called inside <MicroRouterView>. Did you forget to wrap your app with <MicroRouterView>?"
907
925
  );
908
- return o;
926
+ return n;
909
927
  }
910
- function St(e) {
911
- const n = V(se), o = V(re);
912
- !n && !e && console.warn(
928
+ function Tt(e) {
929
+ const o = V(se), n = V(re);
930
+ !o && !e && console.warn(
913
931
  "[vue-micro-router] useMicroState() called without provider and no defaults. Ensure component is inside <RoutePage>, <MicroDialog>, or <MicroControlWrapper>."
914
932
  );
915
- const i = (n == null ? void 0 : n()) ?? {}, t = e ? { ...e } : {};
933
+ const i = (o == null ? void 0 : o()) ?? {}, t = e ? { ...e } : {};
916
934
  for (const r of Object.keys(i))
917
935
  t[r] = i[r];
918
936
  const l = we(t);
919
- o && X(
937
+ n && F(
920
938
  l,
921
- (r) => o({ ...r }),
939
+ (r) => n({ ...r }),
922
940
  { deep: !0, flush: "post" }
923
941
  );
924
942
  const u = Ue(l);
@@ -928,73 +946,73 @@ function St(e) {
928
946
  }
929
947
  });
930
948
  }
931
- function bt(e) {
932
- const n = V(Ge);
933
- if (!n) {
949
+ function Mt(e) {
950
+ const o = V(Be);
951
+ if (!o) {
934
952
  console.warn(
935
953
  "[vue-micro-router] useRouteLifecycle() must be called inside a route component rendered by <MicroRouterView>."
936
954
  );
937
955
  return;
938
956
  }
939
- const { activePage: o } = Z();
940
- let i = o.value === n;
957
+ const { activePage: n } = Z();
958
+ let i = n.value === o;
941
959
  i && Q(() => {
942
960
  var t;
943
961
  return (t = e.onRouteEnter) == null ? void 0 : t.call(e);
944
- }), X(o, (t) => {
962
+ }), F(n, (t) => {
945
963
  var u, r;
946
- const l = t === n;
964
+ const l = t === o;
947
965
  l && !i ? (u = e.onRouteEnter) == null || u.call(e) : !l && i && ((r = e.onRouteLeave) == null || r.call(e)), i = l;
948
966
  });
949
967
  }
950
- function Mt(e) {
951
- const n = V(Ne);
952
- if (!n) {
968
+ function Lt(e) {
969
+ const o = V(Ne);
970
+ if (!o) {
953
971
  console.warn(
954
972
  "[vue-micro-router] useDialogLifecycle() must be called inside a dialog component rendered by <MicroDialog>."
955
973
  );
956
974
  return;
957
975
  }
958
- const { activeDialog: o } = Z();
959
- let i = o.value === n;
976
+ const { activeDialog: n } = Z();
977
+ let i = n.value === o;
960
978
  i && Q(() => {
961
979
  var t;
962
980
  return (t = e.onDialogEnter) == null ? void 0 : t.call(e);
963
- }), X(o, (t) => {
981
+ }), F(n, (t) => {
964
982
  var u, r;
965
- const l = t === n;
983
+ const l = t === o;
966
984
  l && !i ? (u = e.onDialogEnter) == null || u.call(e) : !l && i && ((r = e.onDialogLeave) == null || r.call(e)), i = l;
967
985
  });
968
986
  }
969
- function Tt(e) {
970
- const n = V(Oe);
971
- if (!n) {
987
+ function _t(e) {
988
+ const o = V(Ge);
989
+ if (!o) {
972
990
  console.warn(
973
991
  "[vue-micro-router] useControlLifecycle() must be called inside a control component rendered by <MicroControlWrapper>."
974
992
  );
975
993
  return;
976
994
  }
977
- const { currentControl: o } = Z();
978
- let i = o.value === n;
995
+ const { currentControl: n } = Z();
996
+ let i = n.value === o;
979
997
  i && Q(() => {
980
998
  var t;
981
999
  return (t = e.onControlEnter) == null ? void 0 : t.call(e);
982
- }), X(o, (t) => {
1000
+ }), F(n, (t) => {
983
1001
  var u, r;
984
- const l = t === n;
1002
+ const l = t === o;
985
1003
  l && !i ? (u = e.onControlEnter) == null || u.call(e) : !l && i && ((r = e.onControlLeave) == null || r.call(e)), i = l;
986
1004
  });
987
1005
  }
988
- function gt(e, n) {
1006
+ function mt(e, o) {
989
1007
  if (!e.enabled) return;
990
- const o = e.edgeWidth ?? 20, i = e.threshold ?? 0.3, t = e.velocityThreshold ?? 0.5;
991
- let l = 0, u = 0, r = 0, c = !1, a = null, d = null;
992
- function R() {
993
- const s = n.containerRef.value;
1008
+ const n = e.edgeWidth ?? 20, i = e.threshold ?? 0.3, t = e.velocityThreshold ?? 0.5;
1009
+ let l = 0, u = 0, r = 0, c = !1, a = null, v = null;
1010
+ function C() {
1011
+ const s = o.containerRef.value;
994
1012
  return s ? "$el" in s ? s.$el : s : null;
995
1013
  }
996
- function T() {
997
- const s = R();
1014
+ function M() {
1015
+ const s = C();
998
1016
  if (!s) return { current: null, previous: null };
999
1017
  const f = s.querySelectorAll(".route-page");
1000
1018
  return f.length < 2 ? { current: f[f.length - 1] ?? null, previous: null } : {
@@ -1002,14 +1020,14 @@ function gt(e, n) {
1002
1020
  previous: f[f.length - 2]
1003
1021
  };
1004
1022
  }
1005
- function M(s) {
1006
- var A;
1007
- if (!n.canGoBack() || s.clientX > o) return;
1008
- const { current: f, previous: p } = T();
1023
+ function T(s) {
1024
+ var w;
1025
+ if (!o.canGoBack() || s.clientX > n) return;
1026
+ const { current: f, previous: A } = M();
1009
1027
  if (!f) return;
1010
- c = !0, l = s.clientX, u = s.clientY, r = Date.now(), a = f, d = p;
1011
- const v = R();
1012
- (A = v == null ? void 0 : v.setPointerCapture) == null || A.call(v, s.pointerId), a.style.willChange = "transform", d && (d.style.willChange = "transform", d.style.transition = "none"), a.style.transition = "none";
1028
+ c = !0, l = s.clientX, u = s.clientY, r = Date.now(), a = f, v = A;
1029
+ const d = C();
1030
+ (w = d == null ? void 0 : d.setPointerCapture) == null || w.call(d, s.pointerId), a.style.willChange = "transform", v && (v.style.willChange = "transform", v.style.transition = "none"), a.style.transition = "none";
1013
1031
  }
1014
1032
  function L(s) {
1015
1033
  if (!c || !a) return;
@@ -1018,184 +1036,179 @@ function gt(e, n) {
1018
1036
  g();
1019
1037
  return;
1020
1038
  }
1021
- const v = f / window.innerWidth;
1022
- if (a.style.transform = `translateX(${f}px)`, d) {
1023
- const A = -20 + 20 * v;
1024
- d.style.transform = `translateX(${A}%)`;
1039
+ const d = f / window.innerWidth;
1040
+ if (a.style.transform = `translateX(${f}px)`, v) {
1041
+ const w = -20 + 20 * d;
1042
+ v.style.transform = `translateX(${w}%)`;
1025
1043
  }
1026
1044
  }
1027
1045
  function _(s) {
1028
1046
  if (!c || !a) return;
1029
1047
  if (!a.isConnected) {
1030
- P(), c = !1;
1048
+ p(), c = !1;
1031
1049
  return;
1032
1050
  }
1033
- const f = s.clientX - l, p = Date.now() - r, v = f / p;
1034
- f / window.innerWidth > i || v > t ? (a.style.transition = "transform 0.2s ease-out", a.style.transform = "translateX(100%)", d && (d.style.transition = "transform 0.2s ease-out", d.style.transform = "translateX(0)"), setTimeout(() => {
1035
- P(), n.goBack();
1036
- }, 200)) : (a.style.transition = "transform 0.2s ease-out", a.style.transform = "translateX(0)", d && (d.style.transition = "transform 0.2s ease-out", d.style.transform = "translateX(-20%)"), setTimeout(P, 200)), c = !1;
1051
+ const f = s.clientX - l, A = Date.now() - r, d = f / A;
1052
+ f / window.innerWidth > i || d > t ? (a.style.transition = "transform 0.2s ease-out", a.style.transform = "translateX(100%)", v && (v.style.transition = "transform 0.2s ease-out", v.style.transform = "translateX(0)"), setTimeout(() => {
1053
+ p(), o.goBack();
1054
+ }, 200)) : (a.style.transition = "transform 0.2s ease-out", a.style.transform = "translateX(0)", v && (v.style.transition = "transform 0.2s ease-out", v.style.transform = "translateX(-20%)"), setTimeout(p, 200)), c = !1;
1037
1055
  }
1038
1056
  function g() {
1039
- c && (a && (a.style.transition = "transform 0.15s ease-out", a.style.transform = "translateX(0)"), d && (d.style.transition = "transform 0.15s ease-out", d.style.transform = "translateX(-20%)"), setTimeout(P, 150), c = !1);
1057
+ c && (a && (a.style.transition = "transform 0.15s ease-out", a.style.transform = "translateX(0)"), v && (v.style.transition = "transform 0.15s ease-out", v.style.transform = "translateX(-20%)"), setTimeout(p, 150), c = !1);
1040
1058
  }
1041
- function P() {
1042
- a && (a.style.willChange = "", a.style.transition = "", a.style.transform = ""), d && (d.style.willChange = "", d.style.transition = "", d.style.transform = ""), a = null, d = null;
1059
+ function p() {
1060
+ a && (a.style.willChange = "", a.style.transition = "", a.style.transform = ""), v && (v.style.willChange = "", v.style.transition = "", v.style.transform = ""), a = null, v = null;
1043
1061
  }
1044
1062
  Q(() => {
1045
- const s = R();
1046
- s != null && s.addEventListener && (s.addEventListener("pointerdown", M, { passive: !0 }), s.addEventListener("pointermove", L, { passive: !0 }), s.addEventListener("pointerup", _, { passive: !0 }), s.addEventListener("pointercancel", g, { passive: !0 }));
1063
+ const s = C();
1064
+ s != null && s.addEventListener && (s.addEventListener("pointerdown", T, { passive: !0 }), s.addEventListener("pointermove", L, { passive: !0 }), s.addEventListener("pointerup", _, { passive: !0 }), s.addEventListener("pointercancel", g, { passive: !0 }));
1047
1065
  }), De(() => {
1048
- const s = R();
1049
- s != null && s.removeEventListener && (s.removeEventListener("pointerdown", M), s.removeEventListener("pointermove", L), s.removeEventListener("pointerup", _), s.removeEventListener("pointercancel", g));
1066
+ const s = C();
1067
+ s != null && s.removeEventListener && (s.removeEventListener("pointerdown", T), s.removeEventListener("pointermove", L), s.removeEventListener("pointerup", _), s.removeEventListener("pointercancel", g));
1050
1068
  });
1051
1069
  }
1052
- function Lt(e) {
1070
+ function It(e) {
1053
1071
  return { ...e };
1054
1072
  }
1055
- function dt(e, n) {
1056
- var o, i, t;
1073
+ function pt(e, o) {
1074
+ var n, i, t;
1057
1075
  for (const l of e)
1058
- (o = l.routes) != null && o.length && n.registerRoutes(l.routes), (i = l.dialogs) != null && i.length && n.registerDialogs(l.dialogs), (t = l.controls) != null && t.length && n.registerControls(l.controls);
1076
+ (n = l.routes) != null && n.length && o.registerRoutes(l.routes), (i = l.dialogs) != null && i.length && o.registerDialogs(l.dialogs), (t = l.controls) != null && t.length && o.registerControls(l.controls);
1059
1077
  }
1060
- const vt = /* @__PURE__ */ ie({
1078
+ const ht = /* @__PURE__ */ ie({
1061
1079
  __name: "MicroControlWrapper",
1062
1080
  props: {
1063
1081
  control: {}
1064
1082
  },
1065
1083
  setup(e) {
1066
- const n = e, { getControlAttrs: o, updateControlAttrs: i } = Z();
1067
- return O(Oe, n.control.name), O(se, () => o(n.control.name)), O(re, (t) => {
1068
- i(n.control.name, t);
1069
- }), (t, l) => (G(), z(Ae(e.control.component), Ce({
1084
+ const o = e, { getControlAttrs: n, updateControlAttrs: i } = Z();
1085
+ return O(Ge, o.control.name), O(se, () => n(o.control.name)), O(re, (t) => {
1086
+ i(o.control.name, t);
1087
+ }), (t, l) => (N(), z(Ae(e.control.component), Ce({
1070
1088
  key: e.control.componentKey || 0
1071
1089
  }, e.control.attrs), null, 16));
1072
1090
  }
1073
1091
  });
1074
1092
  let ee = 0, We = "";
1075
- function mt() {
1093
+ function yt() {
1076
1094
  ee === 0 && (We = document.body.style.overflow, document.body.style.overflow = "hidden"), ee++;
1077
1095
  }
1078
- function pt() {
1096
+ function Pt() {
1079
1097
  ee = Math.max(0, ee - 1), ee === 0 && (document.body.style.overflow = We);
1080
1098
  }
1081
- const ht = 12, yt = /* @__PURE__ */ ie({
1099
+ const wt = /* @__PURE__ */ ie({
1082
1100
  __name: "MicroDialog",
1083
1101
  props: {
1084
1102
  dialog: {},
1085
1103
  stackIndex: {}
1086
1104
  },
1087
1105
  emits: ["close"],
1088
- setup(e, { emit: n }) {
1089
- const o = e, i = n, { getDialogAttrs: t, updateDialogAttrs: l } = Z();
1090
- let u = !1, r = 0;
1091
- const c = ne(null), a = ne(null), d = C(() => o.dialog.transition ?? "scale"), R = C(() => o.dialog.transitionDuration != null ? o.dialog.transitionDuration : d.value === "slide" ? 500 : 300), T = C(() => o.dialog.position ?? "standard"), M = C(() => o.dialog.seamless ?? !1);
1092
- function L() {
1093
- return c.value ? Me(c.value) : [];
1106
+ setup(e, { emit: o }) {
1107
+ const n = e, i = o, { getDialogAttrs: t, updateDialogAttrs: l } = Z();
1108
+ let u = !1, r = 0, c = null;
1109
+ const a = ne(null), v = ne(null), C = R(() => n.dialog.transition ?? "scale"), M = R(() => n.dialog.transitionDuration != null ? n.dialog.transitionDuration : C.value === "slide" ? 500 : 300), T = R(() => n.dialog.position ?? "standard"), L = R(() => n.dialog.seamless ?? !1);
1110
+ function _() {
1111
+ return a.value ? nt(a.value) : [];
1094
1112
  }
1095
- function _(p) {
1096
- var D, w;
1097
- if (p.key === "Escape") {
1098
- if (o.dialog.persistent) return;
1099
- p.preventDefault(), p.stopPropagation(), i("close", o.dialog.path);
1113
+ function g(d) {
1114
+ var P, S;
1115
+ if (d.key === "Escape") {
1116
+ if (n.dialog.persistent) return;
1117
+ d.preventDefault(), d.stopPropagation(), i("close", n.dialog.path);
1100
1118
  return;
1101
1119
  }
1102
- if (p.key !== "Tab") return;
1103
- const v = L();
1104
- if (v.length === 0) {
1105
- p.preventDefault(), (D = c.value) == null || D.focus();
1120
+ if (d.key !== "Tab") return;
1121
+ const w = _();
1122
+ if (w.length === 0) {
1123
+ d.preventDefault(), (P = a.value) == null || P.focus();
1106
1124
  return;
1107
1125
  }
1108
- const A = v[0], y = v[v.length - 1], h = document.activeElement, m = !!((w = c.value) != null && w.contains(h));
1109
- p.shiftKey ? (!m || h === A) && (p.preventDefault(), y.focus()) : (!m || h === y) && (p.preventDefault(), A.focus());
1126
+ const y = w[0], h = w[w.length - 1], m = document.activeElement, D = !!((S = a.value) != null && S.contains(m));
1127
+ d.shiftKey ? (!D || m === y) && (d.preventDefault(), h.focus()) : (!D || m === h) && (d.preventDefault(), y.focus());
1110
1128
  }
1111
- function g(p) {
1112
- o.dialog.persistent || p.target === p.currentTarget && i("close", o.dialog.path);
1129
+ function p(d) {
1130
+ n.dialog.persistent || d.target === d.currentTarget && i("close", n.dialog.path);
1113
1131
  }
1114
- function P(p) {
1115
- const v = ++r, A = (y = 0) => {
1116
- if (!c.value || !o.dialog.activated || v !== r) return;
1117
- const h = et(c.value);
1118
- if (h) {
1119
- h.focus(), he();
1120
- return;
1121
- }
1122
- if (p && y < ht) {
1123
- requestAnimationFrame(() => A(y + 1));
1124
- return;
1125
- }
1126
- tt(c.value).focus(), he();
1127
- };
1128
- te(() => A());
1132
+ function s(d) {
1133
+ const w = ++r;
1134
+ c == null || c(), te(() => {
1135
+ c = at(
1136
+ () => a.value,
1137
+ d,
1138
+ !0,
1139
+ () => n.dialog.activated && w === r
1140
+ );
1141
+ });
1129
1142
  }
1130
- function s() {
1143
+ function f() {
1131
1144
  if (u) {
1132
- P(o.dialog.focusInput ?? !1);
1145
+ s(n.dialog.focusInput ?? !1);
1133
1146
  return;
1134
1147
  }
1135
- u = !0, a.value = document.activeElement, mt(), P(o.dialog.focusInput ?? !1);
1148
+ u = !0, v.value = document.activeElement, yt(), s(n.dialog.focusInput ?? !1);
1136
1149
  }
1137
- function f() {
1138
- var h;
1150
+ function A() {
1151
+ var m;
1139
1152
  if (!u) return;
1140
- r++, u = !1, pt();
1141
- const p = a.value;
1142
- a.value = null;
1143
- const v = document.activeElement, A = !!((h = c.value) != null && h.contains(v)), y = !v || v === document.body;
1144
- p && typeof p.focus == "function" && document.contains(p) && (A || y) && p.focus();
1153
+ r++, c == null || c(), c = null, u = !1, Pt();
1154
+ const d = v.value;
1155
+ v.value = null;
1156
+ const w = document.activeElement, y = !!((m = a.value) != null && m.contains(w)), h = !w || w === document.body;
1157
+ d && typeof d.focus == "function" && document.contains(d) && (y || h) && d.focus();
1145
1158
  }
1146
- return O(Ne, o.dialog.path), O(se, () => t(o.dialog.path)), O(re, (p) => {
1147
- l(o.dialog.path, p);
1148
- }), X(
1149
- () => o.dialog.activated,
1150
- (p) => {
1151
- p && s();
1159
+ return O(Ne, n.dialog.path), O(se, () => t(n.dialog.path)), O(re, (d) => {
1160
+ l(n.dialog.path, d);
1161
+ }), F(
1162
+ () => n.dialog.activated,
1163
+ (d) => {
1164
+ d && f();
1152
1165
  }
1153
- ), X(
1154
- () => o.dialog.closing,
1155
- (p) => {
1156
- !p && !o.dialog.activated && u && f();
1166
+ ), F(
1167
+ () => n.dialog.closing,
1168
+ (d) => {
1169
+ !d && !n.dialog.activated && u && A();
1157
1170
  }
1158
1171
  ), Q(() => {
1159
- o.dialog.activated && s();
1172
+ n.dialog.activated && f();
1160
1173
  }), De(() => {
1161
- u && f();
1162
- }), (p, v) => (G(), z(Fe, { to: "body" }, [
1174
+ u && A();
1175
+ }), (d, w) => (N(), z(Xe, { to: "body" }, [
1163
1176
  q("div", {
1164
1177
  class: k(["micro-dialog-portal", [
1165
1178
  `micro-dialog--${T.value}`,
1166
1179
  e.dialog.fullscreen && "micro-dialog--fullscreen",
1167
- M.value && "micro-dialog--seamless"
1180
+ L.value && "micro-dialog--seamless"
1168
1181
  ]]),
1169
- style: Ie({
1182
+ style: _e({
1170
1183
  zIndex: 100 + e.stackIndex,
1171
- "--dialog-duration": `${R.value}ms`
1184
+ "--dialog-duration": `${M.value}ms`
1172
1185
  }),
1173
- onClick: ce(g, ["self"])
1186
+ onClick: ce(p, ["self"])
1174
1187
  }, [
1175
- M.value ? Xe("", !0) : (G(), j("div", {
1188
+ L.value ? Fe("", !0) : (N(), j("div", {
1176
1189
  key: 0,
1177
1190
  class: k(["micro-dialog-backdrop", e.dialog.closing && "micro-dialog-backdrop--closing"])
1178
1191
  }, null, 2)),
1179
1192
  q("div", {
1180
1193
  ref_key: "wrapperRef",
1181
- ref: c,
1194
+ ref: a,
1182
1195
  role: "dialog",
1183
1196
  "aria-modal": "true",
1184
1197
  tabindex: "-1",
1185
1198
  class: k(["micro-dialog", [
1186
- `dialog-transition-${d.value}`,
1199
+ `dialog-transition-${C.value}`,
1187
1200
  e.dialog.closing && "micro-dialog--closing"
1188
1201
  ]]),
1189
- onClick: ce(g, ["self"]),
1190
- onKeydown: _
1202
+ onClick: ce(p, ["self"]),
1203
+ onKeydown: g
1191
1204
  }, [
1192
1205
  q("div", {
1193
1206
  class: "micro-dialog__content",
1194
- onClick: v[0] || (v[0] = ce(() => {
1207
+ onClick: w[0] || (w[0] = ce(() => {
1195
1208
  }, ["stop"]))
1196
1209
  }, [
1197
- Re(p.$slots, "default"),
1198
- (G(), z(Ae(e.dialog.component), Ce({
1210
+ Re(d.$slots, "default"),
1211
+ (N(), z(Ae(e.dialog.component), Ce({
1199
1212
  key: e.dialog.componentKey
1200
1213
  }, e.dialog.attrs), null, 16))
1201
1214
  ])
@@ -1203,28 +1216,28 @@ const ht = 12, yt = /* @__PURE__ */ ie({
1203
1216
  ], 6)
1204
1217
  ]));
1205
1218
  }
1206
- }), Pt = { class: "route-page" }, wt = { class: "route-page__body" }, Dt = /* @__PURE__ */ ie({
1219
+ }), Dt = { class: "route-page" }, At = { class: "route-page__body" }, Ct = /* @__PURE__ */ ie({
1207
1220
  __name: "RoutePage",
1208
1221
  props: {
1209
1222
  routePath: {}
1210
1223
  },
1211
1224
  setup(e) {
1212
- const n = e;
1213
- if (n.routePath) {
1214
- const o = n.routePath;
1215
- O(Ge, o);
1225
+ const o = e;
1226
+ if (o.routePath) {
1227
+ const n = o.routePath;
1228
+ O(Be, n);
1216
1229
  const { updateRouteAttrs: i, getRouteAttrs: t } = Z();
1217
- O(se, () => t(o)), O(re, (l) => {
1218
- i(o, l);
1230
+ O(se, () => t(n)), O(re, (l) => {
1231
+ i(n, l);
1219
1232
  });
1220
1233
  }
1221
- return (o, i) => (G(), j("div", Pt, [
1222
- q("div", wt, [
1223
- Re(o.$slots, "default")
1234
+ return (n, i) => (N(), j("div", Dt, [
1235
+ q("div", At, [
1236
+ Re(n.$slots, "default")
1224
1237
  ])
1225
1238
  ]));
1226
1239
  }
1227
- }), At = { class: "micro-router-content-layer" }, _t = /* @__PURE__ */ ie({
1240
+ }), Rt = { class: "micro-router-content-layer" }, Bt = /* @__PURE__ */ ie({
1228
1241
  __name: "MicroRouterView",
1229
1242
  props: {
1230
1243
  config: {},
@@ -1232,9 +1245,9 @@ const ht = 12, yt = /* @__PURE__ */ ie({
1232
1245
  nested: { type: Boolean }
1233
1246
  },
1234
1247
  setup(e) {
1235
- var P, s;
1236
- const n = e, o = ft(n.config);
1237
- (P = n.plugins) != null && P.length && dt(n.plugins, o);
1248
+ var p, s;
1249
+ const o = e, n = vt(o.config);
1250
+ (p = o.plugins) != null && p.length && pt(o.plugins, n);
1238
1251
  const {
1239
1252
  resolveRoutes: i,
1240
1253
  resolveDialogs: t,
@@ -1243,73 +1256,73 @@ const ht = 12, yt = /* @__PURE__ */ ie({
1243
1256
  toPath: r,
1244
1257
  isNavigating: c,
1245
1258
  closeDialog: a
1246
- } = o, d = ne(null), R = C(() => {
1247
- const f = u.value.split("/").filter(Boolean), p = new Set(r.value.split("/").filter(Boolean));
1248
- return f.some((v) => p.has(v));
1249
- }), T = C(() => l.value.length > 0), M = C(() => {
1259
+ } = n, v = ne(null), C = R(() => {
1260
+ const f = u.value.split("/").filter(Boolean), A = new Set(r.value.split("/").filter(Boolean));
1261
+ return f.some((d) => A.has(d));
1262
+ }), M = R(() => l.value.length > 0), T = R(() => {
1250
1263
  const f = i.value.at(-1);
1251
1264
  return (f == null ? void 0 : f.transition) ?? "slide";
1252
- }), L = C(() => M.value === "none" ? "" : M.value === "fade" ? "page-fade" : "page-slide"), _ = C(() => {
1265
+ }), L = R(() => T.value === "none" ? "" : T.value === "fade" ? "page-fade" : "page-slide"), _ = R(() => {
1253
1266
  const f = i.value.at(-1);
1254
- return f != null && f.transitionDuration ? f.transitionDuration : M.value === "fade" ? 300 : 500;
1255
- }), g = C(
1256
- () => R.value && M.value !== "none"
1267
+ return f != null && f.transitionDuration ? f.transitionDuration : T.value === "fade" ? 300 : 500;
1268
+ }), g = R(
1269
+ () => C.value && T.value !== "none"
1257
1270
  );
1258
- return (s = n.config.gesture) != null && s.enabled && gt(n.config.gesture, {
1259
- containerRef: d,
1260
- goBack: () => o.push(-1),
1271
+ return (s = o.config.gesture) != null && s.enabled && mt(o.config.gesture, {
1272
+ containerRef: v,
1273
+ goBack: () => n.push(-1),
1261
1274
  canGoBack: () => i.value.length > 1
1262
- }), (f, p) => (G(), j(oe, null, [
1263
- Te(Le, {
1275
+ }), (f, A) => (N(), j(oe, null, [
1276
+ Te(Me, {
1264
1277
  ref_key: "pageContainerRef",
1265
- ref: d,
1278
+ ref: v,
1266
1279
  name: L.value,
1267
1280
  css: g.value
1268
1281
  }, {
1269
1282
  default: fe(() => [
1270
- (G(!0), j(oe, null, ge(Y(i), (v, A) => (G(), z(Dt, {
1271
- key: v.key || v.path,
1272
- "route-path": v.path,
1283
+ (N(!0), j(oe, null, ge(Y(i), (d, w) => (N(), z(Ct, {
1284
+ key: d.key || d.path,
1285
+ "route-path": d.path,
1273
1286
  class: k({
1274
- deactivate: Y(i).length > 1 && A !== Y(i).length - 1,
1287
+ deactivate: Y(i).length > 1 && w !== Y(i).length - 1,
1275
1288
  "micro-router--navigating": Y(c)
1276
1289
  }),
1277
- style: Ie({
1290
+ style: _e({
1278
1291
  transition: g.value ? `transform ${_.value}ms cubic-bezier(0.65, 0, 0.35, 1), opacity ${_.value}ms ease` : "none",
1279
- zIndex: 10 + A,
1292
+ zIndex: 10 + w,
1280
1293
  "--mr-page-height": e.nested ? "100%" : "100dvh"
1281
1294
  })
1282
1295
  }, {
1283
1296
  default: fe(() => [
1284
- (G(), z(Ae(v.component), Ce({
1285
- key: v.componentKey
1286
- }, { ref_for: !0 }, Y(o).getRouteAttrs(v.path)), null, 16))
1297
+ (N(), z(Ae(d.component), Ce({
1298
+ key: d.componentKey
1299
+ }, { ref_for: !0 }, Y(n).getRouteAttrs(d.path)), null, 16))
1287
1300
  ]),
1288
1301
  _: 2
1289
1302
  }, 1032, ["route-path", "class", "style"]))), 128))
1290
1303
  ]),
1291
1304
  _: 1
1292
1305
  }, 8, ["name", "css"]),
1293
- q("div", At, [
1306
+ q("div", Rt, [
1294
1307
  Re(f.$slots, "default")
1295
1308
  ]),
1296
1309
  q("div", {
1297
- class: k(["micro-router-gui-layer", { "gui-visible": T.value }])
1310
+ class: k(["micro-router-gui-layer", { "gui-visible": M.value }])
1298
1311
  }, [
1299
- Te(Le, { name: "control-fade" }, {
1312
+ Te(Me, { name: "control-fade" }, {
1300
1313
  default: fe(() => [
1301
- (G(!0), j(oe, null, ge(Y(l), (v) => (G(), z(vt, {
1302
- key: v.name + "-" + (v.componentKey || 0),
1303
- control: v
1314
+ (N(!0), j(oe, null, ge(Y(l), (d) => (N(), z(ht, {
1315
+ key: d.name + "-" + (d.componentKey || 0),
1316
+ control: d
1304
1317
  }, null, 8, ["control"]))), 128))
1305
1318
  ]),
1306
1319
  _: 1
1307
1320
  })
1308
1321
  ], 2),
1309
- (G(!0), j(oe, null, ge(Y(t), (v, A) => (G(), z(yt, {
1310
- key: "dialog-" + v.path,
1311
- dialog: v,
1312
- "stack-index": A,
1322
+ (N(!0), j(oe, null, ge(Y(t), (d, w) => (N(), z(wt, {
1323
+ key: "dialog-" + d.path,
1324
+ dialog: d,
1325
+ "stack-index": w,
1313
1326
  onClose: Y(a)
1314
1327
  }, null, 8, ["dialog", "stack-index", "onClose"]))), 128))
1315
1328
  ], 64));
@@ -1318,34 +1331,34 @@ const ht = 12, yt = /* @__PURE__ */ ie({
1318
1331
  export {
1319
1332
  se as MICRO_ATTRS_READ_KEY,
1320
1333
  re as MICRO_ATTRS_WRITE_KEY,
1321
- Oe as MICRO_CONTROL_NAME_KEY,
1334
+ Ge as MICRO_CONTROL_NAME_KEY,
1322
1335
  Ne as MICRO_DIALOG_PATH_KEY,
1323
- Be as MICRO_ROUTER_KEY,
1336
+ Ie as MICRO_ROUTER_KEY,
1324
1337
  me as MICRO_ROUTER_ROOT_KEY,
1325
- Ge as MICRO_ROUTE_PATH_KEY,
1326
- vt as MicroControlWrapper,
1327
- yt as MicroDialogComponent,
1328
- _t as MicroRouterView,
1329
- Dt as RoutePage,
1338
+ Be as MICRO_ROUTE_PATH_KEY,
1339
+ ht as MicroControlWrapper,
1340
+ wt as MicroDialogComponent,
1341
+ Bt as MicroRouterView,
1342
+ Ct as RoutePage,
1330
1343
  ze as STEP_DELAY,
1331
1344
  W as buildPathFromSegments,
1332
- Et as createRouterKey,
1333
- Lt as defineFeaturePlugin,
1345
+ bt as createRouterKey,
1346
+ It as defineFeaturePlugin,
1334
1347
  H as getLastSegment,
1335
1348
  Ee as isAsyncLoader,
1336
1349
  $ as normalizePath,
1337
1350
  I as parsePathSegments,
1338
- dt as registerFeaturePlugins,
1351
+ pt as registerFeaturePlugins,
1339
1352
  Se as safeMarkRaw,
1340
- Tt as useControlLifecycle,
1353
+ _t as useControlLifecycle,
1341
1354
  Ve as useControlManager,
1342
- Mt as useDialogLifecycle,
1343
- ot as useDialogManager,
1344
- gt as useGestureNavigation,
1345
- ft as useGlobalMicroRouter,
1355
+ Lt as useDialogLifecycle,
1356
+ st as useDialogManager,
1357
+ mt as useGestureNavigation,
1358
+ vt as useGlobalMicroRouter,
1346
1359
  Z as useMicroRouter,
1347
- St as useMicroState,
1348
- ut as useNavigation,
1349
- ct as usePageTracker,
1350
- bt as useRouteLifecycle
1360
+ Tt as useMicroState,
1361
+ gt as useNavigation,
1362
+ dt as usePageTracker,
1363
+ Mt as useRouteLifecycle
1351
1364
  };