vue3-router-tab 1.3.3 → 1.3.5

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.
@@ -1,7 +1,7 @@
1
1
  import './vue3-router-tab.css';
2
- import { reactive as me, ref as S, shallowRef as bt, computed as k, watch as P, nextTick as j, inject as Pe, getCurrentInstance as je, onMounted as ge, defineComponent as Oe, provide as pt, onBeforeUnmount as mt, resolveComponent as gt, createElementBlock as x, openBlock as C, createElementVNode as L, withDirectives as vt, normalizeClass as H, renderSlot as re, createVNode as Ae, TransitionGroup as yt, mergeProps as le, withCtx as se, Fragment as ue, renderList as Ee, withModifiers as ce, createCommentVNode as fe, toDisplayString as Ie, createBlock as J, normalizeProps as ht, Transition as Tt, resolveDynamicComponent as de, KeepAlive as kt, normalizeStyle as wt, vShow as Ct, isRef as Rt, isReadonly as Kt } from "vue";
2
+ import { reactive as pe, ref as B, shallowRef as bt, computed as k, watch as A, nextTick as M, inject as Ee, getCurrentInstance as je, onMounted as ge, defineComponent as Oe, provide as pt, onErrorCaptured as gt, onBeforeUnmount as mt, resolveComponent as vt, createElementBlock as S, openBlock as E, createElementVNode as O, withDirectives as ht, normalizeClass as H, renderSlot as le, createVNode as Ae, TransitionGroup as yt, mergeProps as se, withCtx as ue, Fragment as Pe, renderList as Ie, withModifiers as ce, createCommentVNode as q, toDisplayString as $e, createBlock as W, normalizeProps as Tt, Transition as kt, resolveDynamicComponent as fe, KeepAlive as wt, normalizeStyle as Rt, vShow as Ct, isRef as Et, isReadonly as At } from "vue";
3
3
  import { RouterView as Pt } from "vue-router";
4
- function At(e = {}) {
4
+ function It(e = {}) {
5
5
  return {
6
6
  initialTabs: e.initialTabs ?? [],
7
7
  keepAlive: e.keepAlive ?? !0,
@@ -11,35 +11,35 @@ function At(e = {}) {
11
11
  defaultRoute: e.defaultRoute ?? "/"
12
12
  };
13
13
  }
14
- function V(e, n) {
14
+ function N(e, n) {
15
15
  const o = e.resolve(n);
16
16
  if (!o || !o.matched.length)
17
17
  throw new Error(`[RouterTabs] Unable to resolve route: ${String(n)}`);
18
18
  return o;
19
19
  }
20
- const Et = {
20
+ const $t = {
21
21
  path: (e) => e.path,
22
22
  fullpath: (e) => e.fullPath,
23
23
  fullname: (e) => e.fullPath,
24
24
  full: (e) => e.fullPath,
25
25
  name: (e) => e.name ? String(e.name) : e.fullPath
26
26
  };
27
- function N(e) {
27
+ function z(e) {
28
28
  const n = e.meta?.key;
29
29
  if (typeof n == "function") {
30
30
  const o = n(e);
31
31
  if (typeof o == "string" && o.length) return o;
32
32
  } else if (typeof n == "string" && n.length) {
33
- const o = Et[n.toLowerCase()];
33
+ const o = $t[n.toLowerCase()];
34
34
  return o ? o(e) : n;
35
35
  }
36
36
  return e.fullPath;
37
37
  }
38
- function ve(e, n) {
38
+ function me(e, n) {
39
39
  const o = e.meta?.keepAlive;
40
40
  return typeof o == "boolean" ? o : n;
41
41
  }
42
- function ye(e, n) {
42
+ function ve(e, n) {
43
43
  const o = e.meta?.reuse;
44
44
  return typeof o == "boolean" ? o : n;
45
45
  }
@@ -47,44 +47,44 @@ function Ue(e) {
47
47
  const n = e.meta ?? {}, o = {};
48
48
  return "title" in n && (o.title = n.title), "tips" in n && (o.tips = n.tips), "icon" in n && (o.icon = n.icon), "closable" in n && (o.closable = n.closable), "tabClass" in n && (o.tabClass = n.tabClass), "target" in n && (o.target = n.target), "href" in n && (o.href = n.href), o;
49
49
  }
50
- function q(e, n, o) {
50
+ function Q(e, n, o) {
51
51
  const l = Ue(e);
52
52
  return {
53
- id: N(e),
53
+ id: z(e),
54
54
  to: e.fullPath,
55
55
  fullPath: e.fullPath,
56
56
  matched: e,
57
- alive: ve(e, o),
58
- reusable: ye(e, !1),
57
+ alive: me(e, o),
58
+ reusable: ve(e, !1),
59
59
  closable: l.closable ?? !0,
60
60
  renderKey: typeof n.renderKey == "number" ? n.renderKey : 0,
61
61
  ...l,
62
62
  ...n
63
63
  };
64
64
  }
65
- function be(e, n, o, l) {
66
- if (!e.find((p) => p.id === n.id)) {
65
+ function de(e, n, o, l) {
66
+ if (!e.find((g) => g.id === n.id)) {
67
67
  if (o === "next" && l) {
68
- const p = e.findIndex((T) => T.id === l);
69
- if (p !== -1) {
70
- e.splice(p + 1, 0, n);
68
+ const g = e.findIndex((T) => T.id === l);
69
+ if (g !== -1) {
70
+ e.splice(g + 1, 0, n);
71
71
  return;
72
72
  }
73
73
  }
74
74
  e.push(n);
75
75
  }
76
76
  }
77
- function xe(e, n, o) {
77
+ function Ke(e, n, o) {
78
78
  if (!n || n <= 0) return;
79
- const l = e.filter((i) => i.alive);
79
+ const l = e.filter((a) => a.alive);
80
80
  for (; l.length > n; ) {
81
- const i = l.shift();
82
- if (!i || i.id === o) continue;
83
- const p = e.findIndex((T) => T.id === i.id);
84
- p > -1 && (e[p].alive = !1);
81
+ const a = l.shift();
82
+ if (!a || a.id === o) continue;
83
+ const g = e.findIndex((T) => T.id === a.id);
84
+ g > -1 && (e[g].alive = !1);
85
85
  }
86
86
  }
87
- function It(e) {
87
+ function Kt(e) {
88
88
  return {
89
89
  to: e.to,
90
90
  title: e.title,
@@ -99,145 +99,145 @@ function xt(e) {
99
99
  const n = {};
100
100
  return "title" in e && (n.title = e.title), "tips" in e && (n.tips = e.tips), "icon" in e && (n.icon = e.icon), "tabClass" in e && (n.tabClass = e.tabClass), "closable" in e && (n.closable = e.closable), "renderKey" in e && typeof e.renderKey == "number" && (n.renderKey = e.renderKey), n;
101
101
  }
102
- function $t(e, n = {}) {
103
- const o = At(n), l = me([]), i = S(null), p = bt(), T = S(null), s = k(
104
- () => l.filter((r) => r.alive).map((r) => `${r.id}::${r.renderKey ?? 0}`)
102
+ function Dt(e, n = {}) {
103
+ const o = It(n), l = pe([]), a = B(null), g = bt(), T = B(null), s = k(
104
+ () => l.filter((i) => i.alive).map((i) => `${i.id}::${i.renderKey ?? 0}`)
105
105
  );
106
- let c = !1;
107
- function m(r) {
108
- const b = typeof r.matched == "object" ? r : V(e, r);
106
+ let f = !1;
107
+ function v(i) {
108
+ const b = typeof i.matched == "object" ? i : N(e, i);
109
109
  return {
110
- key: N(b),
110
+ key: z(b),
111
111
  fullPath: b.fullPath,
112
- alive: ve(b, o.keepAlive),
113
- reusable: ye(b, !1),
112
+ alive: me(b, o.keepAlive),
113
+ reusable: ve(b, !1),
114
114
  matched: b
115
115
  };
116
116
  }
117
- function K(r) {
118
- const b = N(r);
119
- let d = l.find((h) => h.id === b);
120
- return d ? (d.fullPath = r.fullPath, d.to = r.fullPath, d.matched = r, d.alive = ve(r, o.keepAlive), d.reusable = ye(r, d.reusable), typeof d.renderKey != "number" && (d.renderKey = 0), Object.assign(d, Ue(r)), d) : (d = q(r, {}, o.keepAlive), be(l, d, o.appendPosition, i.value), xe(l, o.maxAlive, i.value), d);
117
+ function C(i) {
118
+ const b = z(i);
119
+ let d = l.find((y) => y.id === b);
120
+ return d ? (d.fullPath = i.fullPath, d.to = i.fullPath, d.matched = i, d.alive = me(i, o.keepAlive), d.reusable = ve(i, d.reusable), typeof d.renderKey != "number" && (d.renderKey = 0), Object.assign(d, Ue(i)), d) : (d = Q(i, {}, o.keepAlive), de(l, d, o.appendPosition, a.value), Ke(l, o.maxAlive, a.value), d);
121
121
  }
122
- async function $(r, b = !1, d = !0) {
123
- const h = V(e, r), w = N(h), A = i.value === w;
124
- d === "sameTab" && (d = A), d && await O(w, !0), await e[b ? "replace" : "push"](h), A && await y();
122
+ async function $(i, b = !1, d = !0) {
123
+ const y = N(e, i), w = z(y), P = a.value === w;
124
+ d === "sameTab" && (d = P), d && await U(w, !0), await e[b ? "replace" : "push"](y), P && await h();
125
125
  }
126
- function B(r) {
127
- const b = l.findIndex((I) => I.id === r);
126
+ function L(i) {
127
+ const b = l.findIndex((x) => x.id === i);
128
128
  if (b === -1) return o.defaultRoute;
129
- const d = l[b + 1], h = l[b - 1], w = l.find((I) => I.id !== r), A = d || h || w;
130
- return A ? A.to : o.defaultRoute;
129
+ const d = l[b + 1], y = l[b - 1], w = l.find((x) => x.id !== i), P = d || y || w;
130
+ return P ? P.to : o.defaultRoute;
131
131
  }
132
- async function z(r = i.value, b = {}) {
133
- if (!r) return;
132
+ async function Y(i = a.value, b = {}) {
133
+ if (!i) return;
134
134
  if (!b.force && o.keepLastTab && l.length === 1)
135
135
  throw new Error("[RouterTabs] Unable to close the final tab when keepLastTab is true.");
136
- const h = i.value === r && b.redirect !== null, w = h ? b.redirect ?? B(r) : null;
137
- await _(r, { force: b.force }), b.redirect !== null && h && w && await e.replace(w);
136
+ const y = a.value === i && b.redirect !== null, w = y ? b.redirect ?? L(i) : null;
137
+ await K(i, { force: b.force }), b.redirect !== null && y && w && await e.replace(w);
138
138
  }
139
- async function _(r, b = {}) {
140
- const d = l.findIndex((h) => h.id === r);
141
- d !== -1 && (l.splice(d, 1), T.value === r && (T.value = null), i.value === r && (i.value = null, p.value = void 0));
139
+ async function K(i, b = {}) {
140
+ const d = l.findIndex((y) => y.id === i);
141
+ d !== -1 && (l.splice(d, 1), T.value === i && (T.value = null), a.value === i && (a.value = null, g.value = void 0));
142
142
  }
143
- async function O(r = i.value ?? void 0, b = !1) {
144
- if (!r) return;
145
- const d = l.find((w) => w.id === r);
143
+ async function U(i = a.value ?? void 0, b = !1) {
144
+ if (!i) return;
145
+ const d = l.find((w) => w.id === i);
146
146
  if (!d) return;
147
- const h = o.keepAlive && d.alive;
148
- h && (d.alive = !1, await j()), d.renderKey = (d.renderKey ?? 0) + 1, h && (d.alive = !0), T.value = r, await j(), b || await j(), T.value = null;
147
+ const y = o.keepAlive && d.alive;
148
+ y && (d.alive = !1, await M()), d.renderKey = (d.renderKey ?? 0) + 1, y && (d.alive = !0), T.value = i, await M(), b || await M(), T.value = null;
149
149
  }
150
- async function te(r = !1) {
150
+ async function ne(i = !1) {
151
151
  for (const b of l)
152
- await O(b.id, r);
152
+ await U(b.id, i);
153
153
  }
154
- async function ne(r = o.defaultRoute) {
155
- l.splice(0, l.length), i.value = null, p.value = void 0;
154
+ async function oe(i = o.defaultRoute) {
155
+ l.splice(0, l.length), a.value = null, g.value = void 0;
156
156
  for (const b of o.initialTabs) {
157
- const d = V(e, b.to), h = q(d, b, o.keepAlive);
158
- l.push(h);
157
+ const d = N(e, b.to), y = Q(d, b, o.keepAlive);
158
+ l.push(y);
159
159
  }
160
- await e.replace(r);
160
+ await e.replace(i);
161
161
  }
162
- async function y() {
163
- const r = i.value;
164
- r && await O(r, !0);
162
+ async function h() {
163
+ const i = a.value;
164
+ i && await U(i, !0);
165
165
  }
166
- function G(r) {
167
- return typeof r.matched == "object" ? N(r) : N(V(e, r));
166
+ function G(i) {
167
+ return typeof i.matched == "object" ? z(i) : z(N(e, i));
168
168
  }
169
- function M() {
170
- const r = l.find((b) => b.id === i.value);
169
+ function j() {
170
+ const i = l.find((b) => b.id === a.value);
171
171
  return {
172
- tabs: l.map(It),
173
- active: r ? r.to : null
172
+ tabs: l.map(Kt),
173
+ active: i ? i.to : null
174
174
  };
175
175
  }
176
- async function D(r) {
177
- c = !0, l.splice(0, l.length), i.value = null, p.value = void 0;
178
- const b = r?.tabs ?? [];
179
- for (const h of b)
176
+ async function D(i) {
177
+ f = !0, l.splice(0, l.length), a.value = null, g.value = void 0;
178
+ const b = i?.tabs ?? [];
179
+ for (const y of b)
180
180
  try {
181
- const w = V(e, h.to), A = xt(h), I = q(w, A, o.keepAlive);
182
- be(l, I, "last", null);
181
+ const w = N(e, y.to), P = xt(y), x = Q(w, P, o.keepAlive);
182
+ de(l, x, "last", null);
183
183
  } catch {
184
184
  }
185
- c = !1;
186
- const d = r?.active ?? b[b.length - 1]?.to ?? o.defaultRoute;
185
+ f = !1;
186
+ const d = i?.active ?? b[b.length - 1]?.to ?? o.defaultRoute;
187
187
  if (d)
188
188
  try {
189
189
  await e.replace(d);
190
190
  } catch {
191
191
  }
192
192
  }
193
- return P(
193
+ return A(
194
194
  () => e.currentRoute.value,
195
- (r) => {
196
- if (c) return;
197
- const b = K(r);
198
- i.value = b.id, p.value = b, xe(l, o.maxAlive, i.value);
195
+ (i) => {
196
+ if (f) return;
197
+ const b = C(i);
198
+ a.value = b.id, g.value = b, Ke(l, o.maxAlive, a.value);
199
199
  },
200
200
  { immediate: !0 }
201
- ), o.initialTabs.length && o.initialTabs.forEach((r) => {
202
- const b = V(e, r.to), d = q(b, r, o.keepAlive);
203
- be(l, d, "last", null);
201
+ ), o.initialTabs.length && o.initialTabs.forEach((i) => {
202
+ const b = N(e, i.to), d = Q(b, i, o.keepAlive);
203
+ de(l, d, "last", null);
204
204
  }), {
205
205
  options: o,
206
206
  tabs: l,
207
- activeId: i,
208
- current: p,
207
+ activeId: a,
208
+ current: g,
209
209
  includeKeys: s,
210
210
  refreshingKey: T,
211
211
  openTab: $,
212
- closeTab: z,
213
- removeTab: _,
214
- refreshTab: O,
215
- refreshAll: te,
216
- reset: ne,
217
- reload: y,
212
+ closeTab: Y,
213
+ removeTab: K,
214
+ refreshTab: U,
215
+ refreshAll: ne,
216
+ reset: oe,
217
+ reload: h,
218
218
  getRouteKey: G,
219
- matchRoute: m,
220
- snapshot: M,
219
+ matchRoute: v,
220
+ snapshot: j,
221
221
  hydrate: D
222
222
  };
223
223
  }
224
- function $e(e) {
224
+ function xe(e) {
225
225
  return e ? typeof e == "string" ? { name: e } : e : {};
226
226
  }
227
- const ee = Symbol("RouterTabsContext"), Z = "router-tabs:snapshot";
227
+ const te = Symbol("RouterTabsContext"), ee = "router-tabs:snapshot";
228
228
  function De(e = {}) {
229
- const { optional: n = !1 } = e, o = Pe(ee, null);
229
+ const { optional: n = !1 } = e, o = Ee(te, null);
230
230
  if (o) return o;
231
- const l = Pe("$tabs", null);
231
+ const l = Ee("$tabs", null);
232
232
  if (l) return l;
233
- const p = je()?.appContext.config.globalProperties.$tabs;
234
- if (p) return p;
233
+ const g = je()?.appContext.config.globalProperties.$tabs;
234
+ if (g) return g;
235
235
  if (!n)
236
236
  throw new Error("[RouterTabs] useRouterTabs must be used within <router-tab>.");
237
237
  return null;
238
238
  }
239
- const Dt = 864e5;
240
- function St(e) {
239
+ const St = 864e5;
240
+ function Bt(e) {
241
241
  if (typeof document > "u") return null;
242
242
  const n = `${encodeURIComponent(e)}=`, o = document.cookie ? document.cookie.split("; ") : [];
243
243
  for (const l of o)
@@ -249,23 +249,23 @@ function Se(e, n, o) {
249
249
  if (typeof document > "u") return;
250
250
  const {
251
251
  expiresInDays: l = 7,
252
- path: i = "/",
253
- domain: p,
252
+ path: a = "/",
253
+ domain: g,
254
254
  secure: T,
255
255
  sameSite: s = "lax"
256
- } = o, c = [`${encodeURIComponent(e)}=${encodeURIComponent(n)}`];
256
+ } = o, f = [`${encodeURIComponent(e)}=${encodeURIComponent(n)}`];
257
257
  if (l !== 1 / 0) {
258
- const m = new Date(Date.now() + l * Dt).toUTCString();
259
- c.push(`Expires=${m}`);
258
+ const v = new Date(Date.now() + l * St).toUTCString();
259
+ f.push(`Expires=${v}`);
260
260
  }
261
- i && c.push(`Path=${i}`), p && c.push(`Domain=${p}`), T && c.push("Secure"), s && c.push(`SameSite=${s.charAt(0).toUpperCase()}${s.slice(1)}`), document.cookie = c.join("; ");
261
+ a && f.push(`Path=${a}`), g && f.push(`Domain=${g}`), T && f.push("Secure"), s && f.push(`SameSite=${s.charAt(0).toUpperCase()}${s.slice(1)}`), document.cookie = f.join("; ");
262
262
  }
263
263
  function Be(e, n) {
264
264
  if (typeof document > "u") return;
265
- const { path: o = "/", domain: l } = n, i = [`${encodeURIComponent(e)}=`];
266
- i.push("Expires=Thu, 01 Jan 1970 00:00:01 GMT"), o && i.push(`Path=${o}`), l && i.push(`Domain=${l}`), document.cookie = i.join("; ");
265
+ const { path: o = "/", domain: l } = n, a = [`${encodeURIComponent(e)}=`];
266
+ a.push("Expires=Thu, 01 Jan 1970 00:00:01 GMT"), o && a.push(`Path=${o}`), l && a.push(`Domain=${l}`), document.cookie = a.join("; ");
267
267
  }
268
- const Bt = (e) => JSON.stringify(e ?? null), Mt = (e) => {
268
+ const Mt = (e) => JSON.stringify(e ?? null), Lt = (e) => {
269
269
  if (!e) return null;
270
270
  try {
271
271
  return JSON.parse(e);
@@ -275,61 +275,61 @@ const Bt = (e) => JSON.stringify(e ?? null), Mt = (e) => {
275
275
  };
276
276
  function Ve(e = {}) {
277
277
  const {
278
- cookieKey: n = Z,
279
- serialize: o = Bt,
280
- deserialize: l = Mt
281
- } = e, i = De({ optional: !0 }), p = S(!0), T = (s) => {
278
+ cookieKey: n = ee,
279
+ serialize: o = Mt,
280
+ deserialize: l = Lt
281
+ } = e, a = De({ optional: !0 }), g = B(!0), T = (s) => {
282
282
  ge(async () => {
283
- const c = l(St(n));
284
- if (c && c.tabs?.length)
283
+ const f = l(Bt(n));
284
+ if (f && f.tabs?.length)
285
285
  try {
286
- if (p.value = !0, await s.hydrate(c), c.active) {
287
- await j();
288
- const K = s.tabs.find(($) => $.to === c.active);
289
- K && (s.activeId.value = K.id, s.current.value = K);
286
+ if (g.value = !0, await s.hydrate(f), f.active) {
287
+ await M();
288
+ const C = s.tabs.find(($) => $.to === f.active);
289
+ C && (s.activeId.value = C.id, s.current.value = C);
290
290
  }
291
291
  } finally {
292
- p.value = !1;
292
+ g.value = !1;
293
293
  }
294
294
  else if (Object.prototype.hasOwnProperty.call(e, "fallbackRoute"))
295
295
  try {
296
- p.value = !0;
297
- const K = e.fallbackRoute ?? s.options.defaultRoute;
298
- await s.reset(K);
296
+ g.value = !0;
297
+ const C = e.fallbackRoute ?? s.options.defaultRoute;
298
+ await s.reset(C);
299
299
  } finally {
300
- p.value = !1;
300
+ g.value = !1;
301
301
  }
302
302
  else
303
- p.value = !1;
304
- const m = s.snapshot();
305
- m.tabs.length ? Se(n, o(m), e) : Be(n, e), p.value = !1;
306
- }), P(
303
+ g.value = !1;
304
+ const v = s.snapshot();
305
+ v.tabs.length ? Se(n, o(v), e) : Be(n, e), g.value = !1;
306
+ }), A(
307
307
  () => ({
308
- tabs: s.tabs.map((c) => ({
309
- to: c.to,
310
- title: c.title,
311
- tips: c.tips,
312
- icon: c.icon,
313
- tabClass: c.tabClass,
314
- closable: c.closable,
315
- renderKey: c.renderKey
308
+ tabs: s.tabs.map((f) => ({
309
+ to: f.to,
310
+ title: f.title,
311
+ tips: f.tips,
312
+ icon: f.icon,
313
+ tabClass: f.tabClass,
314
+ closable: f.closable,
315
+ renderKey: f.renderKey
316
316
  })),
317
317
  active: s.activeId.value
318
318
  }),
319
319
  () => {
320
- if (p.value) return;
321
- const c = s.snapshot();
322
- c.tabs.length ? Se(n, o(c), e) : Be(n, e);
320
+ if (g.value) return;
321
+ const f = s.snapshot();
322
+ f.tabs.length ? Se(n, o(f), e) : Be(n, e);
323
323
  },
324
324
  { deep: !0 }
325
325
  );
326
326
  };
327
- i ? T(i) : ge(() => {
327
+ a ? T(a) : ge(() => {
328
328
  const s = De({ optional: !0 });
329
329
  s && T(s);
330
330
  });
331
331
  }
332
- const Lt = Oe({
332
+ const jt = Oe({
333
333
  name: "RouterTab",
334
334
  components: { RouterView: Pt },
335
335
  props: {
@@ -371,7 +371,7 @@ const Lt = Oe({
371
371
  },
372
372
  cookieKey: {
373
373
  type: String,
374
- default: Z
374
+ default: ee
375
375
  },
376
376
  persistence: {
377
377
  type: Object,
@@ -390,7 +390,7 @@ const Lt = Oe({
390
390
  const l = o.appContext.app.config.globalProperties.$router;
391
391
  if (!l)
392
392
  throw new Error("[RouterTab] Vue Router is required. Make sure to call app.use(router) before RouterTab.");
393
- const i = $t(l, {
393
+ const a = Dt(l, {
394
394
  initialTabs: e.tabs,
395
395
  keepAlive: e.keepAlive,
396
396
  maxAlive: e.maxAlive,
@@ -398,100 +398,143 @@ const Lt = Oe({
398
398
  appendPosition: e.append,
399
399
  defaultRoute: e.defaultPage
400
400
  });
401
- pt(ee, i), o.appContext.config.globalProperties.$tabs = i;
402
- const p = k(() => !!o?.slots?.default), T = k(() => !!o?.slots?.start), s = k(() => !!o?.slots?.end), c = S(0), m = k(() => {
403
- c.value;
401
+ pt(te, a), o.appContext.config.globalProperties.$tabs = a;
402
+ const g = k(() => !!o?.slots?.default), T = k(() => !!o?.slots?.start), s = k(() => !!o?.slots?.end), f = B(0), v = k(() => {
403
+ f.value;
404
404
  const t = {};
405
- return i.tabs.forEach((a) => {
406
- const f = typeof a.title == "string" ? a.title : String(a.title || oe(a));
407
- t[a.id] = f;
405
+ return a.tabs.forEach((r) => {
406
+ const u = typeof r.title == "string" ? r.title : String(r.title || re(r));
407
+ t[r.id] = u;
408
408
  }), t;
409
409
  });
410
- function K() {
411
- c.value++;
410
+ function C() {
411
+ f.value++;
412
412
  }
413
- const $ = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
414
- function z(t, a) {
415
- if (!a || $.has(t)) return;
416
- $.set(t, a);
417
- const f = i.tabs.find((v) => i.getRouteKey(v.to) === t);
418
- if (!f) return;
419
- const g = [];
420
- if (a.routeTabTitle !== void 0) {
421
- const v = P(
422
- () => {
423
- const u = a.routeTabTitle;
424
- return u && typeof u == "object" && "value" in u ? u.value : u;
425
- },
426
- (u) => {
427
- if (u != null) {
428
- const U = String(u);
429
- f.title = U, K();
413
+ const $ = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Map();
414
+ function Y(t, r) {
415
+ if (!(!r || $.has(t)))
416
+ try {
417
+ $.set(t, r);
418
+ const u = a.tabs.find((p) => a.getRouteKey(p.to) === t);
419
+ if (!u) {
420
+ console.warn(`[RouterTab] Cannot setup watching: tab not found for ${t}`);
421
+ return;
422
+ }
423
+ const m = [];
424
+ if (r.routeTabTitle !== void 0)
425
+ try {
426
+ const p = A(
427
+ () => {
428
+ const c = r.routeTabTitle;
429
+ return c && typeof c == "object" && "value" in c ? c.value : c;
430
+ },
431
+ (c) => {
432
+ if (c != null) {
433
+ const V = String(c);
434
+ u.title = V, C();
435
+ }
436
+ },
437
+ { immediate: !0 }
438
+ );
439
+ m.push(p);
440
+ } catch (p) {
441
+ console.error(`[RouterTab] Error watching routeTabTitle for ${t}:`, p);
430
442
  }
431
- },
432
- { immediate: !0 }
433
- );
434
- g.push(v);
435
- }
436
- if (a.routeTabIcon !== void 0) {
437
- const v = P(
438
- () => {
439
- const u = a.routeTabIcon;
440
- return u && typeof u == "object" && "value" in u ? u.value : u;
441
- },
442
- (u) => {
443
- u != null && (f.icon = String(u), K());
444
- },
445
- { immediate: !0 }
446
- );
447
- g.push(v);
448
- }
449
- if (a.routeTabClosable !== void 0) {
450
- const v = P(
451
- () => {
452
- const u = a.routeTabClosable;
453
- return u && typeof u == "object" && "value" in u ? u.value : u;
454
- },
455
- (u) => {
456
- u != null && (f.closable = !!u, K());
457
- },
458
- { immediate: !0 }
459
- );
460
- g.push(v);
461
- }
462
- if (a.routeTabMeta !== void 0) {
463
- const v = P(
464
- () => {
465
- const u = a.routeTabMeta;
466
- return u && typeof u == "object" && "value" in u ? u.value : u;
467
- },
468
- (u) => {
469
- u && typeof u == "object" && (Object.assign(f, u), K());
470
- },
471
- { immediate: !0, deep: !0 }
472
- );
473
- g.push(v);
474
- }
475
- B.set(t, g);
443
+ if (r.routeTabIcon !== void 0)
444
+ try {
445
+ const p = A(
446
+ () => {
447
+ const c = r.routeTabIcon;
448
+ return c && typeof c == "object" && "value" in c ? c.value : c;
449
+ },
450
+ (c) => {
451
+ c != null && (u.icon = String(c), C());
452
+ },
453
+ { immediate: !0 }
454
+ );
455
+ m.push(p);
456
+ } catch (p) {
457
+ console.error(`[RouterTab] Error watching routeTabIcon for ${t}:`, p);
458
+ }
459
+ if (r.routeTabClosable !== void 0)
460
+ try {
461
+ const p = A(
462
+ () => {
463
+ const c = r.routeTabClosable;
464
+ return c && typeof c == "object" && "value" in c ? c.value : c;
465
+ },
466
+ (c) => {
467
+ c != null && (u.closable = !!c, C());
468
+ },
469
+ { immediate: !0 }
470
+ );
471
+ m.push(p);
472
+ } catch (p) {
473
+ console.error(`[RouterTab] Error watching routeTabClosable for ${t}:`, p);
474
+ }
475
+ if (r.routeTabMeta !== void 0)
476
+ try {
477
+ const p = A(
478
+ () => {
479
+ const c = r.routeTabMeta;
480
+ return c && typeof c == "object" && "value" in c ? c.value : c;
481
+ },
482
+ (c) => {
483
+ c && typeof c == "object" && (Object.assign(u, c), C());
484
+ },
485
+ { immediate: !0, deep: !0 }
486
+ );
487
+ m.push(p);
488
+ } catch (p) {
489
+ console.error(`[RouterTab] Error watching routeTabMeta for ${t}:`, p);
490
+ }
491
+ L.set(t, m);
492
+ } catch (u) {
493
+ console.error(`[RouterTab] Error in setupComponentWatching for ${t}:`, u), K(t);
494
+ }
476
495
  }
477
- function _(t) {
478
- const a = B.get(t);
479
- a && (a.forEach((f) => f()), B.delete(t)), $.delete(t);
496
+ function K(t) {
497
+ try {
498
+ const r = L.get(t);
499
+ r && (r.forEach((u) => {
500
+ try {
501
+ u();
502
+ } catch (m) {
503
+ console.error(`[RouterTab] Error cleaning up watcher for ${t}:`, m);
504
+ }
505
+ }), L.delete(t)), $.delete(t);
506
+ } catch (r) {
507
+ console.error(`[RouterTab] Error in cleanupComponentWatching for ${t}:`, r);
508
+ }
480
509
  }
481
- function O(t, a) {
482
- t ? t.routeTabTitle !== void 0 || t.routeTabIcon !== void 0 || t.routeTabClosable !== void 0 ? z(a, t) : t.$ && (t.$.routeTabTitle !== void 0 || t.$.routeTabIcon !== void 0 || t.$.routeTabClosable !== void 0) && z(a, t.$) : t === null && _(a);
510
+ function U(t, r) {
511
+ try {
512
+ t ? t.routeTabTitle !== void 0 || t.routeTabIcon !== void 0 || t.routeTabClosable !== void 0 ? Y(r, t) : t.$ && (t.$.routeTabTitle !== void 0 || t.$.routeTabIcon !== void 0 || t.$.routeTabClosable !== void 0) && Y(r, t.$) : t === null && K(r);
513
+ } catch (u) {
514
+ console.error(`[RouterTab] Error handling component ref for ${r}:`, u), K(r);
515
+ }
483
516
  }
484
- if (e.cookieKey !== null || e.persistence) {
517
+ if (gt((t, r, u) => {
518
+ if (console.error("[RouterTab] Error captured from component:", t, u), r && a.activeId.value) {
519
+ const m = a.activeId.value;
520
+ K(m);
521
+ const p = a.tabs.find((c) => c.id === m);
522
+ p && p.alive && (console.warn(`[RouterTab] Removing errored component ${m} from KeepAlive cache`), p.alive = !1, M(() => {
523
+ p.alive = !0;
524
+ }));
525
+ }
526
+ return !1;
527
+ }), e.cookieKey !== null || e.persistence) {
485
528
  const t = {
486
529
  ...e.persistence ?? {}
487
530
  };
488
- e.cookieKey !== null ? t.cookieKey = e.cookieKey || Z : t.cookieKey || (t.cookieKey = Z), Ve(t);
531
+ e.cookieKey !== null ? t.cookieKey = e.cookieKey || ee : t.cookieKey || (t.cookieKey = ee), Ve(t);
489
532
  }
490
- const te = k(() => $e(e.tabTransition)), ne = k(() => $e(e.pageTransition)), y = me({
533
+ const ne = k(() => xe(e.tabTransition)), oe = k(() => xe(e.pageTransition)), h = pe({
491
534
  visible: !1,
492
535
  target: null,
493
536
  position: { x: 0, y: 0 }
494
- }), G = S(null), M = S([]), D = S(-1), r = me({
537
+ }), G = B(null), j = B([]), D = B(-1), i = pe({
495
538
  dragging: !1,
496
539
  dragIndex: -1,
497
540
  dropIndex: -1,
@@ -505,135 +548,134 @@ const Lt = Oe({
505
548
  "closeOthers"
506
549
  ];
507
550
  function d(t) {
508
- return i.tabs.findIndex((a) => a.id === t);
551
+ return a.tabs.findIndex((r) => r.id === t);
509
552
  }
510
- function h(t) {
511
- const a = d(t.id);
512
- return a > 0 ? i.tabs.slice(0, a) : [];
553
+ function y(t) {
554
+ const r = d(t.id);
555
+ return r > 0 ? a.tabs.slice(0, r) : [];
513
556
  }
514
557
  function w(t) {
515
- const a = d(t.id);
516
- return a > -1 ? i.tabs.slice(a + 1) : [];
558
+ const r = d(t.id);
559
+ return r > -1 ? a.tabs.slice(r + 1) : [];
517
560
  }
518
- function A(t) {
519
- return i.tabs.filter((a) => a.id !== t.id);
561
+ function P(t) {
562
+ return a.tabs.filter((r) => r.id !== t.id);
520
563
  }
521
- async function I(t, a) {
522
- const f = t.filter((g) => g.closable !== !1);
523
- if (f.length) {
524
- for (const g of f)
525
- i.activeId.value === g.id ? await i.closeTab(g.id, { redirect: a.to, force: !0 }) : await i.removeTab(g.id, { force: !0 });
526
- i.activeId.value !== a.id && await i.openTab(a.to, !0, !1);
564
+ async function x(t, r) {
565
+ const u = t.filter((m) => m.closable !== !1);
566
+ if (u.length) {
567
+ for (const m of u)
568
+ a.activeId.value === m.id ? await a.closeTab(m.id, { redirect: r.to, force: !0 }) : await a.removeTab(m.id, { force: !0 });
569
+ a.activeId.value !== r.id && await a.openTab(r.to, !0, !1);
527
570
  }
528
571
  }
529
572
  const Fe = {
530
573
  refresh: {
531
574
  label: "Refresh",
532
575
  handler: async ({ target: t }) => {
533
- await i.refreshTab(t.id, !0);
576
+ await a.refreshTab(t.id, !0);
534
577
  }
535
578
  },
536
579
  refreshAll: {
537
580
  label: "Refresh All",
538
581
  handler: async () => {
539
- await i.refreshAll(!0);
582
+ await a.refreshAll(!0);
540
583
  }
541
584
  },
542
585
  close: {
543
586
  label: "Close",
544
587
  handler: async ({ target: t }) => {
545
- await i.closeTab(t.id);
588
+ await a.closeTab(t.id);
546
589
  },
547
590
  enable: ({ target: t }) => ae(t)
548
591
  },
549
592
  closeLefts: {
550
593
  label: "Close to the Left",
551
594
  handler: async ({ target: t }) => {
552
- await I(h(t), t);
595
+ await x(y(t), t);
553
596
  },
554
- enable: ({ target: t }) => h(t).some((a) => a.closable !== !1)
597
+ enable: ({ target: t }) => y(t).some((r) => r.closable !== !1)
555
598
  },
556
599
  closeRights: {
557
600
  label: "Close to the Right",
558
601
  handler: async ({ target: t }) => {
559
- await I(w(t), t);
602
+ await x(w(t), t);
560
603
  },
561
- enable: ({ target: t }) => w(t).some((a) => a.closable !== !1)
604
+ enable: ({ target: t }) => w(t).some((r) => r.closable !== !1)
562
605
  },
563
606
  closeOthers: {
564
607
  label: "Close Others",
565
608
  handler: async ({ target: t }) => {
566
- await I(A(t), t);
609
+ await x(P(t), t);
567
610
  },
568
- enable: ({ target: t }) => A(t).some((a) => a.closable !== !1)
611
+ enable: ({ target: t }) => P(t).some((r) => r.closable !== !1)
569
612
  }
570
613
  };
571
- function E() {
572
- y.visible = !1, y.target = null, D.value = -1, M.value = [];
614
+ function I() {
615
+ h.visible = !1, h.target = null, D.value = -1, j.value = [];
573
616
  }
574
- function He(t, a) {
575
- e.contextmenu && (y.target = t, y.position.x = a.clientX, y.position.y = a.clientY, j(() => {
576
- y.visible = !0, document.addEventListener("click", E, { once: !0 }), j(() => {
577
- We();
617
+ function He(t, r) {
618
+ e.contextmenu && (h.target = t, h.position.x = r.clientX, h.position.y = r.clientY, M(() => {
619
+ h.visible = !0, document.addEventListener("click", I, { once: !0 }), M(() => {
620
+ Je();
578
621
  });
579
622
  }));
580
623
  }
581
- function Je(t, a) {
582
- const f = typeof t == "string" ? { id: t } : t, g = Fe[f.id], v = f.label ?? g?.label ?? String(f.id), u = f.visible ?? g?.visible ?? !0;
583
- if (!(typeof u == "function" ? u(a) : u !== !1)) return null;
584
- const ie = f.enable ?? g?.enable ?? !0, ft = typeof ie == "function" ? ie(a) : ie !== !1, Ke = f.handler ?? g?.handler;
585
- if (!Ke) return null;
624
+ function We(t, r) {
625
+ const u = typeof t == "string" ? { id: t } : t, m = Fe[u.id], p = u.label ?? m?.label ?? String(u.id), c = u.visible ?? m?.visible ?? !0;
626
+ if (!(typeof c == "function" ? c(r) : c !== !1)) return null;
627
+ const ie = u.enable ?? m?.enable ?? !0, ft = typeof ie == "function" ? ie(r) : ie !== !1, Ce = u.handler ?? m?.handler;
628
+ if (!Ce) return null;
586
629
  const dt = async () => {
587
- await Promise.resolve(Ke(a));
630
+ await Promise.resolve(Ce(r));
588
631
  };
589
632
  return {
590
- id: String(f.id),
591
- label: v,
633
+ id: String(u.id),
634
+ label: p,
592
635
  disabled: !ft,
593
636
  action: dt
594
637
  };
595
638
  }
596
- const Y = k(() => {
597
- if (!y.visible || !y.target || e.contextmenu === !1) return [];
598
- const t = Array.isArray(e.contextmenu) ? e.contextmenu : b, a = { target: y.target, controller: i };
599
- return t.map((f) => Je(f, a)).filter((f) => !!f);
639
+ const _ = k(() => {
640
+ if (!h.visible || !h.target || e.contextmenu === !1) return [];
641
+ const t = Array.isArray(e.contextmenu) ? e.contextmenu : b, r = { target: h.target, controller: a };
642
+ return t.map((u) => We(u, r)).filter((u) => !!u);
600
643
  });
601
- function We() {
644
+ function Je() {
602
645
  const t = G.value;
603
646
  if (!t) return;
604
- const a = 8, { innerWidth: f, innerHeight: g } = window, v = t.getBoundingClientRect();
605
- let u = y.position.x, U = y.position.y;
606
- v.right > f - a && (u = Math.max(a, f - v.width - a)), v.bottom > g - a && (U = Math.max(a, g - v.height - a)), (u !== y.position.x || U !== y.position.y) && (y.position.x = u, y.position.y = U);
647
+ const r = 8, { innerWidth: u, innerHeight: m } = window, p = t.getBoundingClientRect();
648
+ let c = h.position.x, V = h.position.y;
649
+ p.right > u - r && (c = Math.max(r, u - p.width - r)), p.bottom > m - r && (V = Math.max(r, m - p.height - r)), (c !== h.position.x || V !== h.position.y) && (h.position.x = c, h.position.y = V);
607
650
  }
608
- function Ge(t, a) {
609
- const f = t?.$el || t;
610
- M.value[a] = f ?? null;
651
+ function Ge(t, r) {
652
+ j.value[r] = t ?? null;
611
653
  }
612
654
  function Xe(t) {
613
655
  if (t < 0) return;
614
- M.value[t]?.focus({ preventScroll: !0 });
656
+ j.value[t]?.focus({ preventScroll: !0 });
615
657
  }
616
- function X(t, a, f = Y.value) {
617
- if (!f.length) return -1;
618
- const g = f.length;
619
- let v = t;
620
- for (let u = 0; u < g; u++)
621
- if (v = (v + a + g) % g, !f[v].disabled) return v;
658
+ function X(t, r, u = _.value) {
659
+ if (!u.length) return -1;
660
+ const m = u.length;
661
+ let p = t;
662
+ for (let c = 0; c < m; c++)
663
+ if (p = (p + r + m) % m, !u[p].disabled) return p;
622
664
  return -1;
623
665
  }
624
666
  function F(t) {
625
- D.value = t, !(t < 0) && j(() => Xe(t));
667
+ D.value = t, !(t < 0) && M(() => Xe(t));
626
668
  }
627
- function ke(t) {
628
- const a = X(D.value, t);
629
- a !== -1 && F(a);
669
+ function Te(t) {
670
+ const r = X(D.value, t);
671
+ r !== -1 && F(r);
630
672
  }
631
673
  function qe(t) {
632
- if (!y.visible) return;
633
- const a = t.key, f = Y.value;
634
- if (!f.length) return;
635
- if (a === "Tab") {
636
- E();
674
+ if (!h.visible) return;
675
+ const r = t.key, u = _.value;
676
+ if (!u.length) return;
677
+ if (r === "Tab") {
678
+ I();
637
679
  return;
638
680
  }
639
681
  if ([
@@ -647,107 +689,107 @@ const Lt = Oe({
647
689
  " ",
648
690
  "Spacebar",
649
691
  "Escape"
650
- ].includes(a))
651
- switch (t.preventDefault(), a) {
692
+ ].includes(r))
693
+ switch (t.preventDefault(), r) {
652
694
  case "ArrowDown":
653
695
  case "ArrowRight":
654
- ke(1);
696
+ Te(1);
655
697
  break;
656
698
  case "ArrowUp":
657
699
  case "ArrowLeft":
658
- ke(-1);
700
+ Te(-1);
659
701
  break;
660
702
  case "Home":
661
703
  F(X(-1, 1));
662
704
  break;
663
705
  case "End":
664
- F(X(f.length, -1));
706
+ F(X(u.length, -1));
665
707
  break;
666
708
  case "Enter":
667
709
  case " ":
668
710
  case "Spacebar": {
669
- const v = D.value;
670
- if (v > -1) {
671
- const u = f[v];
672
- u.disabled || we(u);
711
+ const p = D.value;
712
+ if (p > -1) {
713
+ const c = u[p];
714
+ c.disabled || ke(c);
673
715
  }
674
716
  break;
675
717
  }
676
718
  case "Escape":
677
- E();
719
+ I();
678
720
  break;
679
721
  }
680
722
  }
681
- async function we(t) {
682
- t.disabled || (E(), await t.action());
723
+ async function ke(t) {
724
+ t.disabled || (I(), await t.action());
683
725
  }
684
- function oe(t) {
726
+ function re(t) {
685
727
  return typeof t.title == "string" && t.title.trim() ? t.title : Array.isArray(t.title) && t.title.length && String(t.title[0]).trim() ? String(t.title[0]) : "Untitled";
686
728
  }
687
729
  function Qe(t) {
688
- return m.value[t.id] || oe(t);
730
+ return v.value[t.id] || re(t);
689
731
  }
690
- function Ce(t) {
691
- const a = i.getRouteKey(t), f = i.tabs.find((v) => v.id === a);
692
- if (!f)
693
- return console.warn(`[RouterTab] Tab not found for key: ${a}. This may cause rendering issues.`), `${a}::0`;
694
- const g = f.renderKey ?? 0;
695
- return `${a}::${g}`;
732
+ function we(t) {
733
+ const r = a.getRouteKey(t), u = a.tabs.find((p) => p.id === r);
734
+ if (!u)
735
+ return console.warn("[RouterTab] Tab not found for route:", r), `${r}::0`;
736
+ const m = u.renderKey ?? 0;
737
+ return `${r}::${m}`;
696
738
  }
697
739
  function Ze(t) {
698
- return `${Ce(t)}::refresh`;
740
+ return `${we(t)}::refresh`;
699
741
  }
700
742
  function ae(t) {
701
- return !(t.closable === !1 || i.options.keepLastTab && i.tabs.length <= 1);
743
+ return !(t.closable === !1 || a.options.keepLastTab && a.tabs.length <= 1);
702
744
  }
703
745
  async function et(t) {
704
- await i.closeTab(t.id);
746
+ await a.closeTab(t.id);
705
747
  }
706
748
  function tt(t) {
707
749
  if (t.href && typeof window < "u") {
708
750
  t.target && t.target !== "_self" ? window.open(t.href, t.target) : window.location.assign(t.href);
709
751
  return;
710
752
  }
711
- i.activeId.value !== t.id && i.openTab(t.to, !1);
753
+ a.activeId.value !== t.id && a.openTab(t.to, !1);
712
754
  }
713
755
  function nt(t) {
714
756
  return [
715
757
  "router-tab__item",
716
758
  {
717
- "is-active": i.activeId.value === t.id,
759
+ "is-active": a.activeId.value === t.id,
718
760
  "is-closable": ae(t),
719
- "is-dragging": r.dragging && r.dragTab?.id === t.id,
720
- "is-drag-over": r.dropIndex === d(t.id)
761
+ "is-dragging": i.dragging && i.dragTab?.id === t.id,
762
+ "is-drag-over": i.dropIndex === d(t.id)
721
763
  },
722
764
  t.tabClass
723
765
  ];
724
766
  }
725
767
  function ot(t) {
726
- return i.refreshingKey.value === i.getRouteKey(t);
768
+ return a.refreshingKey.value === a.getRouteKey(t);
727
769
  }
728
- function at(t) {
729
- const a = i.getRouteKey(t);
730
- return i.tabs.some((f) => f.id === a);
770
+ function rt(t) {
771
+ const r = a.getRouteKey(t);
772
+ return a.tabs.some((u) => u.id === r);
731
773
  }
732
- function it(t, a, f) {
733
- e.sortable && (r.dragging = !0, r.dragIndex = a, r.dragTab = t, f.dataTransfer && (f.dataTransfer.effectAllowed = "move", f.dataTransfer.setData("text/plain", t.id)), n("tab-sort", { tab: t, index: a }));
774
+ function at(t, r, u) {
775
+ e.sortable && (i.dragging = !0, i.dragIndex = r, i.dragTab = t, u.dataTransfer && (u.dataTransfer.effectAllowed = "move", u.dataTransfer.setData("text/plain", t.id)), n("tab-sort", { tab: t, index: r }));
734
776
  }
735
- function rt(t, a) {
736
- !e.sortable || !r.dragging || (a.preventDefault(), a.dataTransfer && (a.dataTransfer.dropEffect = "move"));
777
+ function it(t, r) {
778
+ !e.sortable || !i.dragging || (r.preventDefault(), r.dataTransfer && (r.dataTransfer.dropEffect = "move"));
737
779
  }
738
780
  function lt(t) {
739
- !e.sortable || !r.dragging || (r.dropIndex = t);
781
+ !e.sortable || !i.dragging || (i.dropIndex = t);
740
782
  }
741
783
  function st() {
742
- !e.sortable || r.dragging;
784
+ !e.sortable || i.dragging;
743
785
  }
744
- function ut(t, a) {
745
- if (!(!e.sortable || !r.dragging)) {
746
- if (a.preventDefault(), r.dragIndex !== -1 && r.dragIndex !== t) {
747
- const f = i.tabs.splice(r.dragIndex, 1)[0];
748
- i.tabs.splice(t, 0, f), n("tab-sorted", {
749
- tab: f,
750
- fromIndex: r.dragIndex,
786
+ function ut(t, r) {
787
+ if (!(!e.sortable || !i.dragging)) {
788
+ if (r.preventDefault(), i.dragIndex !== -1 && i.dragIndex !== t) {
789
+ const u = a.tabs.splice(i.dragIndex, 1)[0];
790
+ a.tabs.splice(t, 0, u), n("tab-sorted", {
791
+ tab: u,
792
+ fromIndex: i.dragIndex,
751
793
  toIndex: t
752
794
  });
753
795
  }
@@ -755,80 +797,94 @@ const Lt = Oe({
755
797
  }
756
798
  }
757
799
  function Re() {
758
- r.dragging = !1, r.dragIndex = -1, r.dropIndex = -1, r.dragTab = null;
800
+ i.dragging = !1, i.dragIndex = -1, i.dropIndex = -1, i.dragTab = null;
759
801
  }
760
802
  ge(() => {
761
- document.addEventListener("keydown", E);
803
+ document.addEventListener("keydown", I);
762
804
  }), mt(() => {
763
- document.removeEventListener("keydown", E), o.appContext.config.globalProperties.$tabs = null, B.forEach((t) => {
764
- t.forEach((a) => a());
765
- }), B.clear(), $.clear();
766
- }), P(
805
+ document.removeEventListener("keydown", I), o.appContext.config.globalProperties.$tabs = null, L.forEach((t) => {
806
+ t.forEach((r) => {
807
+ try {
808
+ r();
809
+ } catch (u) {
810
+ console.error("[RouterTab] Error during cleanup:", u);
811
+ }
812
+ });
813
+ }), L.clear(), $.clear();
814
+ }), A(
767
815
  () => e.keepAlive,
768
816
  (t) => {
769
- i.options.keepAlive = t;
817
+ a.options.keepAlive = t;
770
818
  }
771
- ), P(
772
- () => i.activeId.value,
773
- () => E()
774
- ), P(
819
+ ), A(
820
+ () => a.activeId.value,
821
+ () => I()
822
+ ), A(
823
+ () => a.tabs.length,
824
+ () => {
825
+ const t = new Set(a.tabs.map((u) => u.id));
826
+ Array.from($.keys()).forEach((u) => {
827
+ t.has(u) || (console.log(`[RouterTab] Cleaning up stale component instance: ${u}`), K(u));
828
+ });
829
+ }
830
+ ), A(
775
831
  () => e.contextmenu,
776
832
  (t) => {
777
- t || E();
833
+ t || I();
778
834
  }
779
- ), P(
780
- () => Y.value.length,
835
+ ), A(
836
+ () => _.value.length,
781
837
  (t) => {
782
- y.visible && t === 0 && E();
838
+ h.visible && t === 0 && I();
783
839
  },
784
840
  { flush: "post" }
785
841
  // Run after component updates to prevent blocking render
786
- ), P(Y, (t) => {
787
- if (!y.visible) return;
788
- M.value = new Array(t.length).fill(null);
789
- const a = X(-1, 1, t);
790
- F(a);
791
- }, { flush: "post" }), P(
792
- () => y.visible,
842
+ ), A(_, (t) => {
843
+ if (!h.visible) return;
844
+ j.value = new Array(t.length).fill(null);
845
+ const r = X(-1, 1, t);
846
+ F(r);
847
+ }, { flush: "post" }), A(
848
+ () => h.visible,
793
849
  (t) => {
794
- t || (D.value = -1, M.value = []);
850
+ t || (D.value = -1, j.value = []);
795
851
  }
796
852
  );
797
- const ct = i.includeKeys;
853
+ const ct = a.includeKeys;
798
854
  return {
799
- controller: i,
800
- tabs: i.tabs,
855
+ controller: a,
856
+ tabs: a.tabs,
801
857
  includeKeys: ct,
802
- tabTransitionProps: te,
803
- pageTransitionProps: ne,
858
+ tabTransitionProps: ne,
859
+ pageTransitionProps: oe,
804
860
  buildTabClass: nt,
805
861
  activate: tt,
806
862
  close: et,
807
- context: y,
808
- menuItems: Y,
809
- handleMenuAction: we,
863
+ context: h,
864
+ menuItems: _,
865
+ handleMenuAction: ke,
810
866
  showContextMenu: He,
811
- hideContextMenu: E,
812
- getTabTitle: oe,
867
+ hideContextMenu: I,
868
+ getTabTitle: re,
813
869
  isClosable: ae,
814
870
  isRefreshing: ot,
815
- isTabReady: at,
816
- hasCustomSlot: p,
871
+ isTabReady: rt,
872
+ hasCustomSlot: g,
817
873
  hasStartSlot: T,
818
874
  hasEndSlot: s,
819
- onDragStart: it,
820
- onDragOver: rt,
875
+ onDragStart: at,
876
+ onDragOver: it,
821
877
  onDragEnter: lt,
822
878
  onDragLeave: st,
823
879
  onDrop: ut,
824
880
  onDragEnd: Re,
825
- setupComponentWatching: z,
826
- cleanupComponentWatching: _,
827
- handleComponentRef: O,
881
+ setupComponentWatching: Y,
882
+ cleanupComponentWatching: K,
883
+ handleComponentRef: U,
828
884
  getReactiveTabTitle: Qe,
829
- getComponentCacheKey: Ce,
885
+ getComponentCacheKey: we,
830
886
  getRefreshComponentKey: Ze,
831
- triggerTabUpdate: K,
887
+ triggerTabUpdate: C,
832
888
  menuRef: G,
833
889
  highlightedIndex: D,
834
890
  setMenuItemRef: Ge,
@@ -836,97 +892,95 @@ const Lt = Oe({
836
892
  highlightMenuIndex: F
837
893
  };
838
894
  }
839
- }), jt = (e, n) => {
895
+ }), Ot = (e, n) => {
840
896
  const o = e.__vccOpts || e;
841
- for (const [l, i] of n)
842
- o[l] = i;
897
+ for (const [l, a] of n)
898
+ o[l] = a;
843
899
  return o;
844
- }, Ot = { class: "router-tab" }, Ut = { class: "router-tab__header" }, Vt = { class: "router-tab__scroll" }, Nt = ["data-title", "draggable", "onClick", "onAuxclick", "onContextmenu", "onDragstart", "onDragover", "onDragenter", "onDrop"], zt = ["title"], _t = ["onClick"], Yt = { class: "router-tab__container" }, Ft = ["aria-disabled", "disabled", "tabindex", "onMouseenter", "onClick"];
845
- function Ht(e, n, o, l, i, p) {
846
- const T = gt("RouterView");
847
- return C(), x("div", Ot, [
848
- L("header", Ut, [
849
- L("div", {
900
+ }, Ut = { class: "router-tab" }, Vt = { class: "router-tab__header" }, Nt = { class: "router-tab__scroll" }, zt = ["data-title", "draggable", "onClick", "onAuxclick", "onContextmenu", "onDragstart", "onDragover", "onDragenter", "onDrop"], Yt = ["title"], _t = ["onClick"], Ft = { class: "router-tab__container" }, Ht = ["aria-disabled", "disabled", "tabindex", "onMouseenter", "onClick"];
901
+ function Wt(e, n, o, l, a, g) {
902
+ const T = vt("RouterView");
903
+ return E(), S("div", Ut, [
904
+ O("header", Vt, [
905
+ O("div", {
850
906
  class: H(["router-tab__slot-start", { "has-content": e.hasStartSlot }])
851
907
  }, [
852
- re(e.$slots, "start")
908
+ le(e.$slots, "start")
853
909
  ], 2),
854
- L("div", Vt, [
855
- Ae(yt, le({
910
+ O("div", Nt, [
911
+ Ae(yt, se({
856
912
  tag: "ul",
857
913
  class: "router-tab__nav"
858
914
  }, e.tabTransitionProps), {
859
- default: se(() => [
860
- (C(!0), x(ue, null, Ee(e.tabs, (s, c) => (C(), x("li", {
915
+ default: ue(() => [
916
+ (E(!0), S(Pe, null, Ie(e.tabs, (s, f) => (E(), S("li", {
861
917
  key: s.id,
862
918
  class: H(e.buildTabClass(s)),
863
919
  "data-title": e.getTabTitle(s),
864
920
  draggable: e.sortable,
865
- onClick: (m) => e.activate(s),
866
- onAuxclick: ce((m) => e.close(s), ["middle", "prevent"]),
867
- onContextmenu: ce((m) => e.showContextMenu(s, m), ["prevent"]),
868
- onDragstart: (m) => e.onDragStart(s, c, m),
869
- onDragover: (m) => e.onDragOver(c, m),
870
- onDragenter: (m) => e.onDragEnter(c),
871
- onDragleave: n[0] || (n[0] = (...m) => e.onDragLeave && e.onDragLeave(...m)),
872
- onDrop: (m) => e.onDrop(c, m),
873
- onDragend: n[1] || (n[1] = (...m) => e.onDragEnd && e.onDragEnd(...m))
921
+ onClick: (v) => e.activate(s),
922
+ onAuxclick: ce((v) => e.close(s), ["middle", "prevent"]),
923
+ onContextmenu: ce((v) => e.showContextMenu(s, v), ["prevent"]),
924
+ onDragstart: (v) => e.onDragStart(s, f, v),
925
+ onDragover: (v) => e.onDragOver(f, v),
926
+ onDragenter: (v) => e.onDragEnter(f),
927
+ onDragleave: n[0] || (n[0] = (...v) => e.onDragLeave && e.onDragLeave(...v)),
928
+ onDrop: (v) => e.onDrop(f, v),
929
+ onDragend: n[1] || (n[1] = (...v) => e.onDragEnd && e.onDragEnd(...v))
874
930
  }, [
875
- s.icon ? (C(), x("i", {
931
+ s.icon ? (E(), S("i", {
876
932
  key: 0,
877
933
  class: H(["router-tab__item-icon", s.icon])
878
- }, null, 2)) : fe("", !0),
879
- L("span", {
934
+ }, null, 2)) : q("", !0),
935
+ O("span", {
880
936
  class: "router-tab__item-title",
881
937
  title: e.getReactiveTabTitle(s)
882
- }, Ie(e.getReactiveTabTitle(s)), 9, zt),
883
- e.isClosable(s) ? (C(), x("a", {
938
+ }, $e(e.getReactiveTabTitle(s)), 9, Yt),
939
+ e.isClosable(s) ? (E(), S("a", {
884
940
  key: 1,
885
941
  class: "router-tab__item-close",
886
- onClick: ce((m) => e.close(s), ["stop"])
887
- }, null, 8, _t)) : fe("", !0)
888
- ], 42, Nt))), 128))
942
+ onClick: ce((v) => e.close(s), ["stop"])
943
+ }, null, 8, _t)) : q("", !0)
944
+ ], 42, zt))), 128))
889
945
  ]),
890
946
  _: 1
891
947
  }, 16)
892
948
  ]),
893
- L("div", {
949
+ O("div", {
894
950
  class: H(["router-tab__slot-end", { "has-content": e.hasEndSlot }])
895
951
  }, [
896
- re(e.$slots, "end")
952
+ le(e.$slots, "end")
897
953
  ], 2)
898
954
  ]),
899
- L("div", Yt, [
955
+ O("div", Ft, [
900
956
  Ae(T, null, {
901
- default: se((s) => [
902
- e.hasCustomSlot ? re(e.$slots, "default", ht(le({ key: 0 }, {
957
+ default: ue((s) => [
958
+ e.hasCustomSlot ? le(e.$slots, "default", Tt(se({ key: 0 }, {
903
959
  ...s,
904
960
  controller: e.controller,
905
961
  // Expose a ref binder so custom slots can keep reactivity
906
- pageRef: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route))
907
- }))) : (C(), J(Tt, le({ key: 1 }, e.pageTransitionProps, { appear: "" }), {
908
- default: se(() => [
909
- s.Component && e.isTabReady(s.route) ? (C(), x(ue, { key: 0 }, [
910
- e.isRefreshing(s.route) ? (C(), J(de(s.Component), {
911
- key: e.getRefreshComponentKey(s.route),
912
- ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
913
- class: "router-tab-page"
914
- })) : e.controller.options.keepAlive ? (C(), J(kt, {
915
- key: 1,
916
- include: e.includeKeys,
917
- max: e.controller.options.maxAlive || void 0
918
- }, [
919
- (C(), J(de(s.Component), {
920
- key: e.getComponentCacheKey(s.route),
921
- ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
922
- class: "router-tab-page"
923
- }))
924
- ], 1032, ["include", "max"])) : (C(), J(de(s.Component), {
962
+ pageRef: (f) => e.handleComponentRef(f, e.controller.getRouteKey(s.route))
963
+ }))) : (E(), W(kt, se({ key: 1 }, e.pageTransitionProps, { appear: "" }), {
964
+ default: ue(() => [
965
+ e.isRefreshing(s.route) ? (E(), W(fe(s.Component), {
966
+ key: e.getRefreshComponentKey(s.route),
967
+ ref: (f) => e.handleComponentRef(f, e.controller.getRouteKey(s.route)),
968
+ class: "router-tab-page"
969
+ })) : e.controller.options.keepAlive ? (E(), W(wt, {
970
+ key: 1,
971
+ include: e.includeKeys,
972
+ max: e.controller.options.maxAlive || void 0
973
+ }, [
974
+ e.isTabReady(s.route) ? (E(), W(fe(s.Component), {
925
975
  key: e.getComponentCacheKey(s.route),
926
- ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
976
+ ref: (f) => e.handleComponentRef(f, e.controller.getRouteKey(s.route)),
927
977
  class: "router-tab-page"
928
- }))
929
- ], 64)) : fe("", !0)
978
+ })) : q("", !0)
979
+ ], 1032, ["include", "max"])) : e.isTabReady(s.route) ? (E(), W(fe(s.Component), {
980
+ key: e.getComponentCacheKey(s.route),
981
+ ref: (f) => e.handleComponentRef(f, e.controller.getRouteKey(s.route)),
982
+ class: "router-tab-page"
983
+ })) : q("", !0)
930
984
  ]),
931
985
  _: 2
932
986
  }, 1040))
@@ -934,34 +988,34 @@ function Ht(e, n, o, l, i, p) {
934
988
  _: 3
935
989
  })
936
990
  ]),
937
- vt(L("div", {
991
+ ht(O("div", {
938
992
  ref: "menuRef",
939
993
  class: "router-tab__contextmenu",
940
994
  role: "menu",
941
995
  onKeydown: n[2] || (n[2] = (...s) => e.onMenuKeydown && e.onMenuKeydown(...s)),
942
- style: wt({ left: e.context.position.x + "px", top: e.context.position.y + "px" })
996
+ style: Rt({ left: e.context.position.x + "px", top: e.context.position.y + "px" })
943
997
  }, [
944
- (C(!0), x(ue, null, Ee(e.menuItems, (s, c) => (C(), x("a", {
998
+ (E(!0), S(Pe, null, Ie(e.menuItems, (s, f) => (E(), S("a", {
945
999
  key: s.id,
946
1000
  role: "menuitem",
947
- class: H(["router-tab__contextmenu-item", { "is-focused": c === e.highlightedIndex }]),
1001
+ class: H(["router-tab__contextmenu-item", { "is-focused": f === e.highlightedIndex }]),
948
1002
  "aria-disabled": s.disabled,
949
1003
  disabled: s.disabled,
950
- tabindex: s.disabled ? -1 : c === e.highlightedIndex ? 0 : -1,
1004
+ tabindex: s.disabled ? -1 : f === e.highlightedIndex ? 0 : -1,
951
1005
  ref_for: !0,
952
- ref: (m) => e.setMenuItemRef(m, c),
953
- onMouseenter: (m) => !s.disabled && e.highlightMenuIndex(c),
954
- onClick: (m) => e.handleMenuAction(s)
955
- }, Ie(s.label), 43, Ft))), 128))
1006
+ ref: (v) => e.setMenuItemRef(v, f),
1007
+ onMouseenter: (v) => !s.disabled && e.highlightMenuIndex(f),
1008
+ onClick: (v) => e.handleMenuAction(s)
1009
+ }, $e(s.label), 43, Ht))), 128))
956
1010
  ], 36), [
957
1011
  [Ct, e.context.visible && e.context.target]
958
1012
  ])
959
1013
  ]);
960
1014
  }
961
- const Me = /* @__PURE__ */ jt(Lt, [["render", Ht]]), Jt = {
1015
+ const Me = /* @__PURE__ */ Ot(jt, [["render", Wt]]), Jt = {
962
1016
  class: "router-tabs",
963
1017
  "aria-hidden": "true"
964
- }, pe = /* @__PURE__ */ Oe({
1018
+ }, be = /* @__PURE__ */ Oe({
965
1019
  name: "RouterTabs",
966
1020
  __name: "RouterTabs",
967
1021
  props: {
@@ -976,10 +1030,10 @@ const Me = /* @__PURE__ */ jt(Lt, [["render", Ht]]), Jt = {
976
1030
  fallbackRoute: {}
977
1031
  },
978
1032
  setup(e) {
979
- return Ve(e), (o, l) => (C(), x("span", Jt));
1033
+ return Ve(e), (o, l) => (E(), S("span", Jt));
980
1034
  }
981
- }), Ne = "tab-theme-style", ze = "tab-theme-primary-color", Wt = "system", _e = "(prefers-color-scheme: dark)";
982
- let W = null;
1035
+ }), Ne = "tab-theme-style", ze = "tab-theme-primary-color", Gt = "system", Ye = "(prefers-color-scheme: dark)";
1036
+ let J = null;
983
1037
  const R = {
984
1038
  primary: "#034960",
985
1039
  background: "#ffffff",
@@ -994,7 +1048,7 @@ const R = {
994
1048
  activeButtonBackground: "#034960",
995
1049
  activeButtonColor: "#ffffff",
996
1050
  iconColor: "#475569"
997
- }, Gt = {
1051
+ }, Xt = {
998
1052
  primary: "#38bdf8",
999
1053
  background: "#0f172a",
1000
1054
  text: "#f1f5f9",
@@ -1010,7 +1064,7 @@ const R = {
1010
1064
  activeButtonColor: "#0f172a",
1011
1065
  iconColor: "#cbd5e1"
1012
1066
  };
1013
- function Xt(e) {
1067
+ function qt(e) {
1014
1068
  if (typeof window > "u") return null;
1015
1069
  const n = window.localStorage.getItem(e);
1016
1070
  if (!n) return null;
@@ -1024,47 +1078,47 @@ function Xt(e) {
1024
1078
  function he(e) {
1025
1079
  typeof document > "u" || (document.documentElement.style.setProperty("--router-tab-primary", e.primary ?? R.primary), document.documentElement.style.setProperty("--router-tab-header-bg", e.headerBackground ?? R.headerBackground), document.documentElement.style.setProperty("--router-tab-background", e.background ?? R.background), document.documentElement.style.setProperty("--router-tab-active-background", e.activeBackground ?? R.activeBackground), document.documentElement.style.setProperty("--router-tab-text", e.text ?? R.text), document.documentElement.style.setProperty("--router-tab-active-text", e.activeText ?? R.activeText), document.documentElement.style.setProperty("--router-tab-border", e.border ?? R.border), document.documentElement.style.setProperty("--router-tab-active-border", e.activeBorder ?? R.activeBorder), document.documentElement.style.setProperty("--router-tab-button-color", e.buttonColor ?? R.buttonColor), document.documentElement.style.setProperty("--router-tab-active-button-color", e.activeButtonColor ?? R.activeButtonColor), document.documentElement.style.setProperty("--router-tab-button-background", e.buttonBackground ?? R.buttonBackground), document.documentElement.style.setProperty("--router-tab-active-button-background", e.activeButtonBackground ?? R.activeButtonBackground), document.documentElement.style.setProperty("--router-tab-icon-color", e.iconColor ?? R.iconColor));
1026
1080
  }
1027
- function Ye(e) {
1081
+ function _e(e) {
1028
1082
  if (typeof document > "u") return;
1029
- const n = document.documentElement, o = window.matchMedia(_e), l = () => {
1083
+ const n = document.documentElement, o = window.matchMedia(Ye), l = () => {
1030
1084
  n.dataset.theme = o.matches ? "dark" : "light";
1031
1085
  };
1032
- W && (o.removeEventListener("change", W), W = null), e === "system" ? (l(), W = () => l(), o.addEventListener("change", W)) : n.dataset.theme = e;
1086
+ J && (o.removeEventListener("change", J), J = null), e === "system" ? (l(), J = () => l(), o.addEventListener("change", J)) : n.dataset.theme = e;
1033
1087
  }
1034
- function qt(e = {}) {
1088
+ function Qt(e = {}) {
1035
1089
  if (typeof window > "u") return;
1036
1090
  const {
1037
1091
  styleKey: n = Ne,
1038
1092
  primaryKey: o = ze,
1039
- defaultStyle: l = Wt,
1040
- defaultPrimary: i
1041
- } = e, p = window.localStorage.getItem(n) ?? l;
1042
- Ye(p);
1043
- const s = p === "dark" || p === "system" && window.matchMedia(_e).matches ? { ...Gt } : { ...R };
1044
- i && (s.primary = i);
1045
- const c = Xt(o);
1046
- he(c ? {
1093
+ defaultStyle: l = Gt,
1094
+ defaultPrimary: a
1095
+ } = e, g = window.localStorage.getItem(n) ?? l;
1096
+ _e(g);
1097
+ const s = g === "dark" || g === "system" && window.matchMedia(Ye).matches ? { ...Xt } : { ...R };
1098
+ a && (s.primary = a);
1099
+ const f = qt(o);
1100
+ he(f ? {
1047
1101
  ...s,
1048
- ...c
1102
+ ...f
1049
1103
  } : s);
1050
1104
  }
1051
- function en(e, n) {
1105
+ function tn(e, n) {
1052
1106
  if (typeof window > "u") return;
1053
1107
  const o = n?.styleKey ?? Ne;
1054
- window.localStorage.setItem(o, e), Ye(e);
1108
+ window.localStorage.setItem(o, e), _e(e);
1055
1109
  }
1056
- function tn(e, n) {
1110
+ function nn(e, n) {
1057
1111
  if (typeof window > "u") return;
1058
1112
  const o = n?.primaryKey ?? ze;
1059
1113
  window.localStorage.setItem(o, JSON.stringify(e)), he(e);
1060
1114
  }
1061
- function Q(e, n) {
1062
- if (Rt(e)) {
1063
- const l = !Kt(e);
1115
+ function Z(e, n) {
1116
+ if (Et(e)) {
1117
+ const l = !At(e);
1064
1118
  return {
1065
1119
  value: e,
1066
- update: l ? (i) => {
1067
- e.value = i;
1120
+ update: l ? (a) => {
1121
+ e.value = a;
1068
1122
  } : () => {
1069
1123
  }
1070
1124
  };
@@ -1075,7 +1129,7 @@ function Q(e, n) {
1075
1129
  update: () => {
1076
1130
  }
1077
1131
  };
1078
- const o = S(
1132
+ const o = B(
1079
1133
  e === void 0 ? n : e
1080
1134
  );
1081
1135
  return {
@@ -1085,28 +1139,28 @@ function Q(e, n) {
1085
1139
  }
1086
1140
  };
1087
1141
  }
1088
- function Te(e = {}) {
1089
- const n = Q(e.title, "Untitled"), o = Q(e.icon, ""), l = Q(e.closable, !0), i = Q(e.meta, {});
1142
+ function ye(e = {}) {
1143
+ const n = Z(e.title, "Untitled"), o = Z(e.icon, ""), l = Z(e.closable, !0), a = Z(e.meta, {});
1090
1144
  return {
1091
1145
  routeTabTitle: n.value,
1092
1146
  routeTabIcon: o.value,
1093
1147
  routeTabClosable: l.value,
1094
- routeTabMeta: i.value,
1148
+ routeTabMeta: a.value,
1095
1149
  updateTitle: n.update,
1096
1150
  updateIcon: o.update,
1097
1151
  updateClosable: l.update,
1098
- updateMeta: i.update
1152
+ updateMeta: a.update
1099
1153
  };
1100
1154
  }
1101
- function nn(e, n = "Page") {
1102
- return Te({
1155
+ function on(e, n = "Page") {
1156
+ return ye({
1103
1157
  title: k(() => e.value ? "Loading..." : n),
1104
1158
  icon: k(() => e.value ? "mdi-loading mdi-spin" : "mdi-page"),
1105
1159
  closable: k(() => !e.value)
1106
1160
  });
1107
1161
  }
1108
- function on(e, n = "Page", o = "mdi-page") {
1109
- return Te({
1162
+ function rn(e, n = "Page", o = "mdi-page") {
1163
+ return ye({
1110
1164
  title: k(() => e.value > 0 ? `${n} (${e.value})` : n),
1111
1165
  icon: k(() => e.value > 0 ? "mdi-bell-badge" : o)
1112
1166
  });
@@ -1118,46 +1172,46 @@ function an(e, n = "Page") {
1118
1172
  error: { suffix: " - Error", icon: "mdi-alert" },
1119
1173
  success: { suffix: " - Success", icon: "mdi-check-circle" }
1120
1174
  };
1121
- return Te({
1175
+ return ye({
1122
1176
  title: k(() => n + o[e.value].suffix),
1123
1177
  icon: k(() => o[e.value].icon),
1124
1178
  closable: k(() => e.value !== "loading")
1125
1179
  });
1126
1180
  }
1127
1181
  let Le = !1;
1128
- const rn = {
1182
+ const ln = {
1129
1183
  install(e, n) {
1130
1184
  if (Le) return;
1131
1185
  Le = !0;
1132
1186
  const {
1133
1187
  initTheme: o = !0,
1134
1188
  themeOptions: l,
1135
- componentName: i = Me.name || "RouterTab",
1136
- tabsComponentName: p = pe.name || "RouterTabs"
1189
+ componentName: a = Me.name || "RouterTab",
1190
+ tabsComponentName: g = be.name || "RouterTabs"
1137
1191
  } = n ?? {};
1138
- o && qt(l ?? {}), e.component(i, Me), e.component(p, pe), p.toLowerCase() !== "router-tabs" && e.component("router-tabs", pe), Object.defineProperty(e.config.globalProperties, "$tabs", {
1192
+ o && Qt(l ?? {}), e.component(a, Me), e.component(g, be), g.toLowerCase() !== "router-tabs" && e.component("router-tabs", be), Object.defineProperty(e.config.globalProperties, "$tabs", {
1139
1193
  configurable: !0,
1140
1194
  enumerable: !1,
1141
1195
  get() {
1142
- return e._context.provides[ee];
1196
+ return e._context.provides[te];
1143
1197
  },
1144
1198
  set(T) {
1145
- T && e.provide(ee, T);
1199
+ T && e.provide(te, T);
1146
1200
  }
1147
1201
  });
1148
1202
  }
1149
1203
  };
1150
1204
  export {
1151
1205
  Me as RouterTab,
1152
- pe as RouterTabs,
1153
- rn as default,
1154
- qt as initRouterTabsTheme,
1155
- ee as routerTabsKey,
1156
- tn as setRouterTabsPrimary,
1157
- en as setRouterTabsTheme,
1158
- nn as useLoadingTab,
1159
- on as useNotificationTab,
1160
- Te as useReactiveTab,
1206
+ be as RouterTabs,
1207
+ ln as default,
1208
+ Qt as initRouterTabsTheme,
1209
+ te as routerTabsKey,
1210
+ nn as setRouterTabsPrimary,
1211
+ tn as setRouterTabsTheme,
1212
+ on as useLoadingTab,
1213
+ rn as useNotificationTab,
1214
+ ye as useReactiveTab,
1161
1215
  De as useRouterTabs,
1162
1216
  Ve as useRouterTabsPersistence,
1163
1217
  an as useStatusTab