vue-micro-router 1.0.47 → 1.0.48

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