@webx-ui/module-admin 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { inject as fe, reactive as ze, defineComponent as K, useModel as ge, ref as A, watch as re, computed as b, openBlock as d, createElementBlock as $, createVNode as x, unref as a, withCtx as g, createElementVNode as M, toDisplayString as C, createBlock as W, createTextVNode as R, createCommentVNode as U, mergeModels as me, mergeProps as et, provide as Ue, normalizeClass as ve, createSlots as Re, nextTick as tt, useId as qt, Fragment as j, onMounted as Ie, renderList as ie, withModifiers as $t, useSlots as Yt, useTemplateRef as St, renderSlot as oe, normalizeProps as Xt, guardReactiveProps as Jt, resolveComponent as ne, watchEffect as Gt, onUnmounted as Qt, isRef as Tt, createApp as Zt, h as xe, onBeforeUnmount as lt, getCurrentScope as el, onScopeDispose as tl, readonly as we, withKeys as Ct } from "vue";
1
+ import { inject as fe, reactive as Ve, defineComponent as q, useModel as ge, ref as A, watch as ie, computed as _, openBlock as d, createElementBlock as S, createVNode as x, unref as a, withCtx as w, createElementVNode as M, toDisplayString as C, createBlock as L, createTextVNode as R, createCommentVNode as E, mergeModels as me, mergeProps as et, provide as Re, normalizeClass as ve, createSlots as Ie, nextTick as tt, useId as qt, Fragment as K, onMounted as Se, renderList as se, withModifiers as St, useSlots as Yt, useTemplateRef as lt, renderSlot as ne, normalizeProps as Xt, guardReactiveProps as Jt, resolveComponent as ae, watchEffect as Gt, onUnmounted as Qt, isRef as Tt, createApp as Zt, h as xe, onBeforeUnmount as at, getCurrentScope as el, onScopeDispose as tl, readonly as we, withKeys as Ct } from "vue";
2
2
  import { RouterLink as ll, useRouter as Me, useRoute as At, createRouter as al, createWebHistory as nl, onBeforeRouteLeave as ol } from "vue-router";
3
- import { WxSortableList as at, WxAction as be, WxBadge as Oe, WxSelect as ke, WxAutocomplete as Xe, WxSwitch as Fe, WxInputNumber as sl, WxButton as ce, WxSegmented as il, WxText as Q, WxInput as Se, WxCheckbox as ft, WxTooltip as Wt, WxEmpty as Ve, WxSkeleton as ye, WxAvatar as Lt, WxDialog as nt, toast as Z, WxActions as rl, WxDropdownItem as ul, useElementWidth as dl, WxHeading as cl, WxIcon as ot, WxTabs as fl, WxCard as Je, WxRichText as ml, useLocales as zt, WxAlert as Pe, WxResult as vl, useResponsiveShell as pl, shellLayoutFor as hl, WxToaster as yl, WebxUI as gl, dateLocaleKey as bl, localesKey as wl, useModal as _l, WxFormItem as xl, WxSpace as kl, createModal as $l, confirm as Ne, localizedValue as Sl, WxBreadcrumb as Tl, WxBreadcrumbItem as mt, WxActionBar as Cl, WxPopover as Al, WxTextarea as vt } from "@webx-ui/core";
3
+ import { WxSortableList as nt, WxAction as be, WxBadge as Pe, WxSelect as ke, WxAutocomplete as Xe, WxSwitch as Fe, WxInputNumber as sl, WxButton as de, WxSegmented as il, WxText as Q, WxInput as Te, WxCheckbox as mt, WxTooltip as Wt, WxEmpty as Ne, WxSkeleton as ye, WxAvatar as Lt, WxDialog as ot, toast as Z, WxActions as rl, WxDropdownItem as ul, useElementWidth as dl, WxHeading as cl, WxIcon as st, WxTabs as fl, WxCard as Je, WxRichText as ml, useLocales as zt, WxAlert as Oe, WxResult as vl, useResponsiveShell as pl, shellLayoutFor as hl, WxToaster as yl, WebxUI as gl, dateLocaleKey as bl, localesKey as wl, useModal as _l, WxFormItem as xl, WxSpace as kl, createModal as $l, confirm as Ee, localizedValue as Sl, WxBreadcrumb as Tl, WxBreadcrumbItem as vt, WxActionBar as Cl, WxPopover as Al, WxTextarea as pt } from "@webx-ui/core";
4
4
  import { watchSystemTheme as Wl, applyTheme as Ll, systemTheme as zl } from "@webx-ui/tokens";
5
5
  import { WxScreenRenderer as Vl } from "@webx-ui/schema";
6
6
  const Be = /* @__PURE__ */ Symbol("webx-i18n");
@@ -12,45 +12,45 @@ function Nl() {
12
12
  }
13
13
  function J(e) {
14
14
  const t = fe(Be, null);
15
- return t === null ? st().scope(e) : t.scope(e);
15
+ return t === null ? it().scope(e) : t.scope(e);
16
16
  }
17
17
  function El(e, t) {
18
18
  e.provide(Be, t);
19
19
  }
20
- function st(e = {}) {
21
- const t = e.fallback ?? "en", l = ze({
20
+ function it(e = {}) {
21
+ const t = e.fallback ?? "en", l = Ve({
22
22
  locale: e.locale ?? t,
23
23
  fallback: t,
24
24
  panelLocales: [],
25
25
  contentLocales: []
26
- }), s = {}, n = ze({ value: {} });
27
- function i(r, u, m) {
28
- let v = r[u]?.[m[0] ?? ""];
29
- for (const f of m.slice(1)) {
30
- if (typeof v != "object" || v === null)
26
+ }), s = {}, n = Ve({ value: {} });
27
+ function i(r, c, v) {
28
+ let h = r[c]?.[v[0] ?? ""];
29
+ for (const m of v.slice(1)) {
30
+ if (typeof h != "object" || h === null)
31
31
  return null;
32
- v = v[f];
32
+ h = h[m];
33
33
  }
34
- return typeof v == "string" ? v : null;
34
+ return typeof h == "string" ? h : null;
35
35
  }
36
- function o(r, u, m) {
37
- const [v, f] = u.includes("::") ? u.split("::", 2) : [r, u], c = f.split("."), h = i(n.value, v, c) ?? i(s, v, c) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
36
+ function o(r, c, v) {
37
+ const [h, m] = c.includes("::") ? c.split("::", 2) : [r, c], u = m.split("."), f = i(n.value, h, u) ?? i(s, h, u) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
38
38
  // label says nothing to anybody trying to fix it.
39
- u;
40
- return m === void 0 ? h : Ul(h, m);
39
+ c;
40
+ return v === void 0 ? f : Ul(f, v);
41
41
  }
42
42
  return {
43
43
  state: l,
44
- defaults(r, u) {
45
- s[r] = { ...s[r], ...u };
44
+ defaults(r, c) {
45
+ s[r] = { ...s[r], ...c };
46
46
  },
47
- load(r, u, m) {
48
- n.value = r ?? {}, l.locale = u ?? l.locale, m !== void 0 && (l.fallback = m);
47
+ load(r, c, v) {
48
+ n.value = r ?? {}, l.locale = c ?? l.locale, v !== void 0 && (l.fallback = v);
49
49
  },
50
50
  scope(r) {
51
- return (u, m) => o(r, u, m);
51
+ return (c, v) => o(r, c, v);
52
52
  },
53
- t: (r, u) => o("", r, u)
53
+ t: (r, c) => o("", r, c)
54
54
  };
55
55
  }
56
56
  function Ul(e, t) {
@@ -81,7 +81,7 @@ function Rl(e, t, l, s = null) {
81
81
  return e.http.post(`${n}/reorder`, s === null ? { ids: l } : { ids: l, category: s }).then(() => {
82
82
  });
83
83
  }
84
- const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field__name" }, Ol = /* @__PURE__ */ K({
84
+ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field__name" }, Pl = /* @__PURE__ */ q({
85
85
  name: "WxCategoriesField",
86
86
  __name: "CategoriesField",
87
87
  props: /* @__PURE__ */ me({
@@ -99,37 +99,37 @@ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field_
99
99
  }),
100
100
  emits: ["update:modelValue"],
101
101
  setup(e) {
102
- const t = e, l = ge(e, "modelValue"), s = te(), n = J("webx-admin"), i = A([]);
103
- re(
102
+ const t = e, l = ge(e, "modelValue"), s = ee(), n = J("webx-admin"), i = A([]);
103
+ ie(
104
104
  () => t.source,
105
- async (c) => {
105
+ async (u) => {
106
106
  try {
107
- const h = await _e(s, c).list();
108
- i.value = h.data.map((y) => ({ id: y.id, name: y.name }));
107
+ const f = await _e(s, u).list();
108
+ i.value = f.data.map((k) => ({ id: k.id, name: k.name }));
109
109
  } catch {
110
110
  i.value = [];
111
111
  }
112
112
  },
113
113
  { immediate: !0 }
114
114
  );
115
- const o = b(() => Array.isArray(l.value) ? l.value : []), r = b(() => new Map(i.value.map((c) => [c.id, c.name]))), u = b({
116
- get: () => o.value.map((c) => ({ id: c, name: r.value.get(c) ?? `#${c}` })),
117
- set: (c) => {
118
- l.value = c.map((h) => h.id);
115
+ const o = _(() => Array.isArray(l.value) ? l.value : []), r = _(() => new Map(i.value.map((u) => [u.id, u.name]))), c = _({
116
+ get: () => o.value.map((u) => ({ id: u, name: r.value.get(u) ?? `#${u}` })),
117
+ set: (u) => {
118
+ l.value = u.map((f) => f.id);
119
119
  }
120
- }), m = b(
121
- () => i.value.filter((c) => !o.value.includes(c.id)).map((c) => ({ label: c.name, value: c.id }))
120
+ }), v = _(
121
+ () => i.value.filter((u) => !o.value.includes(u.id)).map((u) => ({ label: u.name, value: u.id }))
122
122
  );
123
- function v(c) {
124
- typeof c != "number" || o.value.includes(c) || (l.value = [...o.value, c]);
123
+ function h(u) {
124
+ typeof u != "number" || o.value.includes(u) || (l.value = [...o.value, u]);
125
125
  }
126
- function f(c) {
127
- l.value = o.value.filter((h) => h !== c);
126
+ function m(u) {
127
+ l.value = o.value.filter((f) => f !== u);
128
128
  }
129
- return (c, h) => (d(), $("div", Il, [
130
- x(a(at), {
131
- modelValue: u.value,
132
- "onUpdate:modelValue": h[0] || (h[0] = (y) => u.value = y),
129
+ return (u, f) => (d(), S("div", Il, [
130
+ x(a(nt), {
131
+ modelValue: c.value,
132
+ "onUpdate:modelValue": f[0] || (f[0] = (k) => c.value = k),
133
133
  plain: "",
134
134
  size: "sm",
135
135
  "item-key": "id",
@@ -137,48 +137,48 @@ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field_
137
137
  disabled: t.disabled,
138
138
  "empty-text": t.emptyText ?? a(n)("categories.field-empty")
139
139
  }, {
140
- default: g(({ item: y, index: p }) => [
141
- M("span", Ml, C(y.name), 1),
142
- t.main && p === 0 ? (d(), W(a(Oe), {
140
+ default: w(({ item: k, index: p }) => [
141
+ M("span", Ml, C(k.name), 1),
142
+ t.main && p === 0 ? (d(), L(a(Pe), {
143
143
  key: 0,
144
144
  type: "primary"
145
145
  }, {
146
- default: g(() => [
146
+ default: w(() => [
147
147
  R(C(t.mainText ?? a(n)("categories.field-main")), 1)
148
148
  ]),
149
149
  _: 1
150
- })) : U("", !0)
150
+ })) : E("", !0)
151
151
  ]),
152
- actions: g(({ item: y }) => [
152
+ actions: w(({ item: k }) => [
153
153
  x(a(be), {
154
154
  type: "remove",
155
155
  size: "sm",
156
156
  disabled: t.disabled,
157
157
  title: t.removeText ?? a(n)("categories.field-remove"),
158
- onClick: (p) => f(y.id)
158
+ onClick: (p) => m(k.id)
159
159
  }, null, 8, ["disabled", "title", "onClick"])
160
160
  ]),
161
161
  _: 1
162
162
  }, 8, ["modelValue", "disabled", "empty-text"]),
163
163
  x(a(ke), {
164
164
  "model-value": null,
165
- options: m.value,
165
+ options: v.value,
166
166
  placeholder: t.addText ?? a(n)("categories.field-add"),
167
- disabled: t.disabled || m.value.length === 0,
167
+ disabled: t.disabled || v.value.length === 0,
168
168
  "empty-text": t.noneLeftText ?? a(n)("categories.field-none-left"),
169
169
  filterable: "",
170
170
  teleport: "",
171
171
  "aria-label": t.addText ?? a(n)("categories.field-add"),
172
- "onUpdate:modelValue": v
172
+ "onUpdate:modelValue": h
173
173
  }, null, 8, ["options", "placeholder", "disabled", "empty-text", "aria-label"])
174
174
  ]));
175
175
  }
176
- }), se = (e, t) => {
176
+ }), oe = (e, t) => {
177
177
  const l = e.__vccOpts || e;
178
178
  for (const [s, n] of t)
179
179
  l[s] = n;
180
180
  return l;
181
- }, Pl = /* @__PURE__ */ se(Ol, [["__scopeId", "data-v-640cd836"]]), Bl = /* @__PURE__ */ K({
181
+ }, Ol = /* @__PURE__ */ oe(Pl, [["__scopeId", "data-v-640cd836"]]), Bl = /* @__PURE__ */ q({
182
182
  name: "WxSourceSelect",
183
183
  inheritAttrs: !1,
184
184
  __name: "SourceSelect",
@@ -187,8 +187,8 @@ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field_
187
187
  options: { default: () => [] }
188
188
  },
189
189
  setup(e) {
190
- const t = e, l = te(), s = A([]);
191
- re(
190
+ const t = e, l = ee(), s = A([]);
191
+ ie(
192
192
  () => t.source,
193
193
  async (i) => {
194
194
  if (!i) {
@@ -204,8 +204,8 @@ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field_
204
204
  },
205
205
  { immediate: !0 }
206
206
  );
207
- const n = b(() => t.source ? s.value : t.options);
208
- return (i, o) => (d(), W(a(ke), et(i.$attrs, { options: n.value }), null, 16, ["options"]));
207
+ const n = _(() => t.source ? s.value : t.options);
208
+ return (i, o) => (d(), L(a(ke), et(i.$attrs, { options: n.value }), null, 16, ["options"]));
209
209
  }
210
210
  });
211
211
  class $e extends Error {
@@ -231,51 +231,51 @@ const Dl = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
231
231
  function Fl(e = {}) {
232
232
  const t = (e.baseUrl ?? "").replace(/\/$/, ""), l = e.csrfUrl ?? "/api/cms/auth/csrf-cookie", s = e.fetch ?? globalThis.fetch.bind(globalThis), n = e.onUnauthenticated, i = e.headers;
233
233
  let o = !1;
234
- async function r(v = !1) {
235
- o && !v && pt("XSRF-TOKEN") !== null || (await s(l, { credentials: "same-origin" }), o = !0);
234
+ async function r(h = !1) {
235
+ o && !h && ht("XSRF-TOKEN") !== null || (await s(l, { credentials: "same-origin" }), o = !0);
236
236
  }
237
- async function u(v, f, c = {}, h = !1) {
238
- const y = Dl.has(v);
239
- y && await r();
237
+ async function c(h, m, u = {}, f = !1) {
238
+ const k = Dl.has(h);
239
+ k && await r();
240
240
  const p = {
241
241
  Accept: "application/json",
242
242
  "X-Requested-With": "XMLHttpRequest",
243
243
  // Standing headers first, so a caller can still override one for a single request.
244
244
  ...i?.(),
245
- ...c.headers
245
+ ...u.headers
246
246
  };
247
- if (y) {
248
- const S = pt("XSRF-TOKEN");
249
- S !== null && (p["X-XSRF-TOKEN"] = S);
247
+ if (k) {
248
+ const b = ht("XSRF-TOKEN");
249
+ b !== null && (p["X-XSRF-TOKEN"] = b);
250
250
  }
251
- c.json === !0 && (p["Content-Type"] = "application/json");
252
- const _ = await s(Hl(t, f, c.query), {
253
- method: v,
251
+ u.json === !0 && (p["Content-Type"] = "application/json");
252
+ const $ = await s(Hl(t, m, u.query), {
253
+ method: h,
254
254
  credentials: "same-origin",
255
255
  headers: p,
256
- signal: c.signal,
257
- body: c.body ?? void 0
256
+ signal: u.signal,
257
+ body: u.body ?? void 0
258
258
  });
259
- return _.status === 419 && y && !h ? (await r(!0), u(v, f, c, !0)) : (_.status === 401 && n?.(), _);
259
+ return $.status === 419 && k && !f ? (await r(!0), c(h, m, u, !0)) : ($.status === 401 && n?.(), $);
260
260
  }
261
- async function m(v, f, c, h = {}) {
262
- const y = await u(v, f, {
263
- ...h,
264
- json: c !== void 0,
265
- body: c === void 0 ? void 0 : JSON.stringify(c)
261
+ async function v(h, m, u, f = {}) {
262
+ const k = await c(h, m, {
263
+ ...f,
264
+ json: u !== void 0,
265
+ body: u === void 0 ? void 0 : JSON.stringify(u)
266
266
  });
267
- if (!y.ok)
268
- throw await Ge(y);
269
- if (y.status !== 204)
270
- return await y.json();
267
+ if (!k.ok)
268
+ throw await Ge(k);
269
+ if (k.status !== 204)
270
+ return await k.json();
271
271
  }
272
272
  return {
273
- get: (v, f) => m("GET", v, void 0, f),
274
- post: (v, f, c) => m("POST", v, f, c),
275
- put: (v, f, c) => m("PUT", v, f, c),
276
- patch: (v, f, c) => m("PATCH", v, f, c),
277
- delete: (v, f) => m("DELETE", v, void 0, f),
278
- send: (v, f, c) => u(v.toUpperCase(), f, c)
273
+ get: (h, m) => v("GET", h, void 0, m),
274
+ post: (h, m, u) => v("POST", h, m, u),
275
+ put: (h, m, u) => v("PUT", h, m, u),
276
+ patch: (h, m, u) => v("PATCH", h, m, u),
277
+ delete: (h, m) => v("DELETE", h, void 0, m),
278
+ send: (h, m, u) => c(h.toUpperCase(), m, u)
279
279
  };
280
280
  }
281
281
  async function Ge(e) {
@@ -298,12 +298,12 @@ function Hl(e, t, l) {
298
298
  if (l === void 0)
299
299
  return n;
300
300
  const i = new URLSearchParams();
301
- for (const [r, u] of Object.entries(l))
302
- u != null && i.set(r, String(u));
301
+ for (const [r, c] of Object.entries(l))
302
+ c != null && i.set(r, String(c));
303
303
  const o = i.toString();
304
304
  return o === "" ? n : `${n}${n.includes("?") ? "&" : "?"}${o}`;
305
305
  }
306
- function pt(e) {
306
+ function ht(e) {
307
307
  if (typeof document > "u")
308
308
  return null;
309
309
  for (const t of document.cookie.split(";")) {
@@ -325,7 +325,7 @@ function Kl(e) {
325
325
  }
326
326
  const Vt = /* @__PURE__ */ Symbol("wx-relation-owner");
327
327
  function Ro(e) {
328
- Ue(Vt, e);
328
+ Re(Vt, e);
329
329
  }
330
330
  function ql() {
331
331
  return fe(Vt, null);
@@ -339,7 +339,7 @@ const Yl = ["src"], Xl = { class: "wx-relations-field__text" }, Jl = { class: "w
339
339
  }, Zl = {
340
340
  key: 1,
341
341
  class: "wx-relations-field__add"
342
- }, ea = /* @__PURE__ */ K({
342
+ }, ea = /* @__PURE__ */ q({
343
343
  name: "WxRelationsField",
344
344
  __name: "RelationsField",
345
345
  props: /* @__PURE__ */ me({
@@ -355,143 +355,143 @@ const Yl = ["src"], Xl = { class: "wx-relations-field__text" }, Jl = { class: "w
355
355
  }),
356
356
  emits: ["update:modelValue"],
357
357
  setup(e) {
358
- const t = e, l = ge(e, "modelValue"), s = te(), n = ql(), i = J("webx-admin"), o = b(() => jl(s, t.target)), r = A(/* @__PURE__ */ new Map()), u = A(/* @__PURE__ */ new Set()), m = A(!1), v = A([]), f = A(!1), c = A(""), h = b(() => Kl(l.value));
359
- function y(V) {
360
- const I = new Map(r.value);
361
- for (const O of V) I.set(O.id, O);
362
- r.value = I;
358
+ const t = e, l = ge(e, "modelValue"), s = ee(), n = ql(), i = J("webx-admin"), o = _(() => jl(s, t.target)), r = A(/* @__PURE__ */ new Map()), c = A(/* @__PURE__ */ new Set()), v = A(!1), h = A([]), m = A(!1), u = A(""), f = _(() => Kl(l.value));
359
+ function k(V) {
360
+ const U = new Map(r.value);
361
+ for (const O of V) U.set(O.id, O);
362
+ r.value = U;
363
363
  }
364
364
  async function p(V) {
365
- const I = V.filter((O) => !r.value.has(O) && !u.value.has(O));
366
- if (!(I.length === 0 || m.value))
365
+ const U = V.filter((O) => !r.value.has(O) && !c.value.has(O));
366
+ if (!(U.length === 0 || v.value))
367
367
  try {
368
- const O = await o.value.named(I);
369
- y(O);
370
- const le = new Set(O.map((ue) => ue.id));
371
- u.value = /* @__PURE__ */ new Set([...u.value, ...I.filter((ue) => !le.has(ue))]);
368
+ const O = await o.value.named(U);
369
+ k(O);
370
+ const te = new Set(O.map((re) => re.id));
371
+ c.value = /* @__PURE__ */ new Set([...c.value, ...U.filter((re) => !te.has(re))]);
372
372
  } catch (O) {
373
- O instanceof $e && O.status === 403 && (m.value = !0);
373
+ O instanceof $e && O.status === 403 && (v.value = !0);
374
374
  }
375
375
  }
376
- re(
376
+ ie(
377
377
  () => t.target,
378
378
  () => {
379
- r.value = /* @__PURE__ */ new Map(), u.value = /* @__PURE__ */ new Set(), m.value = !1, v.value = [], p(h.value);
379
+ r.value = /* @__PURE__ */ new Map(), c.value = /* @__PURE__ */ new Set(), v.value = !1, h.value = [], p(f.value);
380
380
  }
381
- ), re(h, (V) => {
381
+ ), ie(f, (V) => {
382
382
  p(V);
383
383
  }, { immediate: !0 });
384
- const _ = b({
385
- get: () => h.value.map((V) => {
386
- const I = r.value.get(V) ?? null;
387
- return { id: V, title: I?.title || `#${V}`, candidate: I };
384
+ const $ = _({
385
+ get: () => f.value.map((V) => {
386
+ const U = r.value.get(V) ?? null;
387
+ return { id: V, title: U?.title || `#${V}`, candidate: U };
388
388
  }),
389
389
  set: (V) => {
390
- l.value = V.map((I) => I.id);
390
+ l.value = V.map((U) => U.id);
391
391
  }
392
- }), S = b(() => t.max !== null && h.value.length >= t.max), F = b(() => n !== null && n.type === t.target ? n.id.value : null), Y = b(
393
- () => v.value.filter((V) => V.id !== F.value && !h.value.includes(V.id)).map((V) => ({
392
+ }), b = _(() => t.max !== null && f.value.length >= t.max), P = _(() => n !== null && n.type === t.target ? n.id.value : null), H = _(
393
+ () => h.value.filter((V) => V.id !== P.value && !f.value.includes(V.id)).map((V) => ({
394
394
  value: V.title,
395
- description: [V.subtitle, V.visible ? null : i("relations.field-hidden")].filter((I) => typeof I == "string" && I !== "").join(" · "),
395
+ description: [V.subtitle, V.visible ? null : i("relations.field-hidden")].filter((U) => typeof U == "string" && U !== "").join(" · "),
396
396
  id: V.id
397
397
  }))
398
398
  );
399
- async function D(V) {
400
- f.value = !0;
399
+ async function j(V) {
400
+ m.value = !0;
401
401
  try {
402
- const I = await o.value.search(V);
403
- v.value = I, y(I);
404
- } catch (I) {
405
- v.value = [], I instanceof $e && I.status === 403 && (m.value = !0);
402
+ const U = await o.value.search(V);
403
+ h.value = U, k(U);
404
+ } catch (U) {
405
+ h.value = [], U instanceof $e && U.status === 403 && (v.value = !0);
406
406
  } finally {
407
- f.value = !1;
407
+ m.value = !1;
408
408
  }
409
409
  }
410
- function L(V) {
411
- const I = Number(V.id);
412
- !Number.isInteger(I) || h.value.includes(I) || S.value || (l.value = [...h.value, I], tt(() => {
413
- c.value = "";
410
+ function F(V) {
411
+ const U = Number(V.id);
412
+ !Number.isInteger(U) || f.value.includes(U) || b.value || (l.value = [...f.value, U], tt(() => {
413
+ u.value = "";
414
414
  }));
415
415
  }
416
- function T(V) {
417
- l.value = h.value.filter((I) => I !== V);
416
+ function y(V) {
417
+ l.value = f.value.filter((U) => U !== V);
418
418
  }
419
- const z = b(() => t.disabled || m.value), k = b(
420
- () => S.value ? i("relations.field-full", { max: String(t.max) }) : t.addText ?? i("relations.field-add")
419
+ const W = _(() => t.disabled || v.value), T = _(
420
+ () => b.value ? i("relations.field-full", { max: String(t.max) }) : t.addText ?? i("relations.field-add")
421
421
  );
422
- function H(V) {
423
- return V.candidate === null ? u.value.has(V.id) ? i("relations.field-missing") : null : V.candidate.trashed === !0 ? i("relations.field-trashed") : V.candidate.visible ? null : i("relations.field-hidden");
422
+ function I(V) {
423
+ return V.candidate === null ? c.value.has(V.id) ? i("relations.field-missing") : null : V.candidate.trashed === !0 ? i("relations.field-trashed") : V.candidate.visible ? null : i("relations.field-hidden");
424
424
  }
425
- return (V, I) => (d(), $("div", {
425
+ return (V, U) => (d(), S("div", {
426
426
  class: ve(["wx-relations-field", { "is-unordered": !t.sortable }])
427
427
  }, [
428
- x(a(at), {
429
- modelValue: _.value,
430
- "onUpdate:modelValue": I[0] || (I[0] = (O) => _.value = O),
428
+ x(a(nt), {
429
+ modelValue: $.value,
430
+ "onUpdate:modelValue": U[0] || (U[0] = (O) => $.value = O),
431
431
  plain: "",
432
432
  size: "sm",
433
433
  "item-key": "id",
434
434
  "item-label": "title",
435
- disabled: z.value || !t.sortable,
435
+ disabled: W.value || !t.sortable,
436
436
  "empty-text": t.emptyText ?? a(i)("relations.field-empty"),
437
437
  "drag-label": a(i)("relations.field-drag")
438
- }, Re({
439
- default: g(({ item: O }) => [
440
- O.candidate?.thumb ? (d(), $("img", {
438
+ }, Ie({
439
+ default: w(({ item: O }) => [
440
+ O.candidate?.thumb ? (d(), S("img", {
441
441
  key: 0,
442
442
  class: "wx-relations-field__thumb",
443
443
  src: O.candidate.thumb,
444
444
  alt: ""
445
- }, null, 8, Yl)) : U("", !0),
445
+ }, null, 8, Yl)) : E("", !0),
446
446
  M("span", Xl, [
447
447
  M("span", Jl, C(O.title), 1),
448
- O.candidate?.subtitle ? (d(), $("span", Gl, C(O.candidate.subtitle), 1)) : U("", !0)
448
+ O.candidate?.subtitle ? (d(), S("span", Gl, C(O.candidate.subtitle), 1)) : E("", !0)
449
449
  ]),
450
- H(O) ? (d(), W(a(Oe), {
450
+ I(O) ? (d(), L(a(Pe), {
451
451
  key: 1,
452
452
  type: "warning"
453
453
  }, {
454
- default: g(() => [
455
- R(C(H(O)), 1)
454
+ default: w(() => [
455
+ R(C(I(O)), 1)
456
456
  ]),
457
457
  _: 2
458
- }, 1024)) : U("", !0)
458
+ }, 1024)) : E("", !0)
459
459
  ]),
460
460
  _: 2
461
461
  }, [
462
- z.value ? void 0 : {
462
+ W.value ? void 0 : {
463
463
  name: "actions",
464
- fn: g(({ item: O }) => [
464
+ fn: w(({ item: O }) => [
465
465
  x(a(be), {
466
466
  type: "remove",
467
467
  size: "sm",
468
468
  title: a(i)("relations.field-remove"),
469
- onClick: (le) => T(O.id)
469
+ onClick: (te) => y(O.id)
470
470
  }, null, 8, ["title", "onClick"])
471
471
  ]),
472
472
  key: "0"
473
473
  }
474
474
  ]), 1032, ["modelValue", "disabled", "empty-text", "drag-label"]),
475
- m.value ? (d(), $("p", Ql, C(a(i)("relations.field-forbidden")), 1)) : (d(), $("div", Zl, [
475
+ v.value ? (d(), S("p", Ql, C(a(i)("relations.field-forbidden")), 1)) : (d(), S("div", Zl, [
476
476
  x(a(Xe), {
477
- modelValue: c.value,
478
- "onUpdate:modelValue": I[1] || (I[1] = (O) => c.value = O),
479
- options: Y.value,
477
+ modelValue: u.value,
478
+ "onUpdate:modelValue": U[1] || (U[1] = (O) => u.value = O),
479
+ options: H.value,
480
480
  remote: "",
481
481
  teleport: "",
482
- loading: f.value,
482
+ loading: m.value,
483
483
  "loading-text": a(i)("relations.field-searching"),
484
484
  "empty-text": a(i)("relations.field-nothing"),
485
- placeholder: k.value,
486
- "aria-label": k.value,
487
- disabled: t.disabled || S.value,
488
- onSearch: D,
489
- onSelect: L
485
+ placeholder: T.value,
486
+ "aria-label": T.value,
487
+ disabled: t.disabled || b.value,
488
+ onSearch: j,
489
+ onSelect: F
490
490
  }, null, 8, ["modelValue", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
491
491
  ]))
492
492
  ], 2));
493
493
  }
494
- }), Nt = /* @__PURE__ */ se(ea, [["__scopeId", "data-v-5ecf0e47"]]), Et = 100, He = /* @__PURE__ */ new WeakMap();
494
+ }), Nt = /* @__PURE__ */ oe(ea, [["__scopeId", "data-v-5ecf0e47"]]), Et = 100, He = /* @__PURE__ */ new WeakMap();
495
495
  function ta(e) {
496
496
  let t = He.get(e);
497
497
  return t === void 0 && (t = e.http.get(`${e.apiPath}/collections`).then((l) => l.data.map((s) => ({ ...s, relations: la(s) }))), t.catch(() => He.delete(e)), He.set(e, t)), t;
@@ -523,7 +523,7 @@ function aa(e) {
523
523
  const n = Ut(l);
524
524
  return typeof t == "string" && t !== "" && n.length > 0 ? { type: t, ids: n } : null;
525
525
  }
526
- function ht(e) {
526
+ function yt(e) {
527
527
  const t = typeof e == "object" && e !== null && !Array.isArray(e) ? e : {}, l = typeof t.limit == "number" && Number.isInteger(t.limit) ? t.limit : null;
528
528
  return {
529
529
  categories: Ut(t.categories),
@@ -533,7 +533,7 @@ function ht(e) {
533
533
  markup: typeof t.markup == "boolean" ? t.markup : null
534
534
  };
535
535
  }
536
- function yt(e) {
536
+ function gt(e) {
537
537
  return e.categories.length === 0 && e.related === null;
538
538
  }
539
539
  const na = ["aria-busy"], oa = {
@@ -548,7 +548,7 @@ const na = ["aria-busy"], oa = {
548
548
  }, da = { class: "wx-collection-field__label" }, ca = { class: "wx-collection-field__hint" }, fa = { class: "wx-collection-field__row" }, ma = ["for"], va = { class: "wx-collection-field__limit" }, pa = {
549
549
  key: 3,
550
550
  class: "wx-collection-field__markup"
551
- }, ha = { class: "wx-collection-field__hint" }, ya = /* @__PURE__ */ K({
551
+ }, ha = { class: "wx-collection-field__hint" }, ya = /* @__PURE__ */ q({
552
552
  name: "WxCollectionField",
553
553
  __name: "CollectionField",
554
554
  props: /* @__PURE__ */ me({
@@ -560,125 +560,125 @@ const na = ["aria-busy"], oa = {
560
560
  }),
561
561
  emits: ["update:modelValue"],
562
562
  setup(e) {
563
- const t = e, l = ge(e, "modelValue"), s = te(), n = J("webx-admin"), i = qt(), o = A(void 0), r = A([]);
564
- re(
563
+ const t = e, l = ge(e, "modelValue"), s = ee(), n = J("webx-admin"), i = qt(), o = A(void 0), r = A([]);
564
+ ie(
565
565
  () => t.source,
566
- async (T) => {
566
+ async (y) => {
567
567
  o.value = void 0, r.value = [];
568
568
  try {
569
- o.value = (await ta(s)).find((z) => z.key === T) ?? null;
569
+ o.value = (await ta(s)).find((W) => W.key === y) ?? null;
570
570
  } catch {
571
571
  o.value = null;
572
572
  }
573
573
  if (o.value?.categories)
574
574
  try {
575
- const z = await _e(s, o.value.categories).list();
576
- r.value = z.data.map((k) => ({ label: k.name, value: k.id }));
575
+ const W = await _e(s, o.value.categories).list();
576
+ r.value = W.data.map((T) => ({ label: T.name, value: T.id }));
577
577
  } catch {
578
578
  r.value = [];
579
579
  }
580
580
  },
581
581
  { immediate: !0 }
582
582
  );
583
- const u = b(() => ht(l.value));
584
- function m(T) {
585
- l.value = ht({ ...u.value, ...T });
583
+ const c = _(() => yt(l.value));
584
+ function v(y) {
585
+ l.value = yt({ ...c.value, ...y });
586
586
  }
587
- const v = b(() => {
588
- const T = new Set(r.value.map((k) => k.value)), z = u.value.categories.filter((k) => !T.has(k)).map((k) => ({ label: `#${k}`, value: k }));
589
- return [...r.value, ...z];
587
+ const h = _(() => {
588
+ const y = new Set(r.value.map((T) => T.value)), W = c.value.categories.filter((T) => !y.has(T)).map((T) => ({ label: `#${T}`, value: T }));
589
+ return [...r.value, ...W];
590
590
  });
591
- function f(T) {
592
- m({ categories: Array.isArray(T) ? T.map(Number) : [] });
591
+ function m(y) {
592
+ v({ categories: Array.isArray(y) ? y.map(Number) : [] });
593
593
  }
594
- function c(T) {
595
- m({ limit: T ?? null });
594
+ function u(y) {
595
+ v({ limit: y ?? null });
596
596
  }
597
- const h = A(null), y = b(
598
- () => (o.value?.relations ?? []).map((T) => ({ label: T.title, value: T.key }))
599
- ), p = b(() => {
600
- const T = o.value?.relations ?? [];
601
- if (T.length === 1) return T[0];
602
- const z = u.value.related?.type ?? h.value;
603
- return T.find((k) => k.key === z) ?? null;
597
+ const f = A(null), k = _(
598
+ () => (o.value?.relations ?? []).map((y) => ({ label: y.title, value: y.key }))
599
+ ), p = _(() => {
600
+ const y = o.value?.relations ?? [];
601
+ if (y.length === 1) return y[0];
602
+ const W = c.value.related?.type ?? f.value;
603
+ return y.find((T) => T.key === W) ?? null;
604
604
  });
605
- function _(T) {
606
- h.value = typeof T == "string" ? T : null, m({ related: null });
605
+ function $(y) {
606
+ f.value = typeof y == "string" ? y : null, v({ related: null });
607
607
  }
608
- function S(T) {
609
- const z = p.value?.key;
610
- m({ related: z && T && T.length > 0 ? { type: z, ids: T } : null });
608
+ function b(y) {
609
+ const W = p.value?.key;
610
+ v({ related: W && y && y.length > 0 ? { type: W, ids: y } : null });
611
611
  }
612
- function F(T) {
613
- const z = p.value?.key;
614
- m({ related: T && z ? { type: z, ids: [], current: !0 } : null });
612
+ function P(y) {
613
+ const W = p.value?.key;
614
+ v({ related: y && W ? { type: W, ids: [], current: !0 } : null });
615
615
  }
616
- const Y = b(() => u.value.markup ?? yt(u.value));
617
- function D(T) {
618
- m({ markup: T === !0 });
616
+ const H = _(() => c.value.markup ?? gt(c.value));
617
+ function j(y) {
618
+ v({ markup: y === !0 });
619
619
  }
620
- const L = b(
620
+ const F = _(
621
621
  () => n(
622
- yt(u.value) ? "collections.field-markup-auto-on" : "collections.field-markup-auto-off"
622
+ gt(c.value) ? "collections.field-markup-auto-on" : "collections.field-markup-auto-off"
623
623
  )
624
624
  );
625
- return (T, z) => (d(), $("div", {
625
+ return (y, W) => (d(), S("div", {
626
626
  class: "wx-collection-field",
627
627
  "aria-busy": o.value === void 0
628
628
  }, [
629
- o.value === null ? (d(), $("p", oa, C(a(n)("collections.field-unavailable", { source: t.source })), 1)) : o.value ? (d(), $(j, { key: 1 }, [
629
+ o.value === null ? (d(), S("p", oa, C(a(n)("collections.field-unavailable", { source: t.source })), 1)) : o.value ? (d(), S(K, { key: 1 }, [
630
630
  M("p", sa, C(a(n)("collections.field-source", { source: o.value.title })), 1),
631
- o.value.categories ? (d(), $("div", ia, [
631
+ o.value.categories ? (d(), S("div", ia, [
632
632
  M("label", {
633
633
  class: "wx-collection-field__label",
634
634
  for: `${a(i)}-categories`
635
635
  }, C(a(n)("collections.field-categories")), 9, ra),
636
636
  x(a(ke), {
637
637
  id: `${a(i)}-categories`,
638
- "model-value": u.value.categories,
639
- options: v.value,
640
- placeholder: u.value.categories.length === 0 ? a(n)("collections.field-all") : "",
638
+ "model-value": c.value.categories,
639
+ options: h.value,
640
+ placeholder: c.value.categories.length === 0 ? a(n)("collections.field-all") : "",
641
641
  "empty-text": a(n)("collections.field-no-categories"),
642
642
  disabled: t.disabled,
643
643
  multiple: "",
644
644
  filterable: "",
645
645
  clearable: "",
646
646
  teleport: "",
647
- "onUpdate:modelValue": f
647
+ "onUpdate:modelValue": m
648
648
  }, null, 8, ["id", "model-value", "options", "placeholder", "empty-text", "disabled"])
649
- ])) : U("", !0),
650
- o.value.relations.length > 0 ? (d(), $("div", ua, [
649
+ ])) : E("", !0),
650
+ o.value.relations.length > 0 ? (d(), S("div", ua, [
651
651
  M("span", da, C(o.value.relations.length === 1 ? a(n)("relations.collection-related-to", { target: o.value.relations[0].title }) : a(n)("relations.collection-related")), 1),
652
- o.value.relations.length > 1 ? (d(), W(a(ke), {
652
+ o.value.relations.length > 1 ? (d(), L(a(ke), {
653
653
  key: 0,
654
654
  "model-value": p.value?.key ?? null,
655
- options: y.value,
655
+ options: k.value,
656
656
  placeholder: a(n)("relations.collection-related-type"),
657
657
  "aria-label": a(n)("relations.collection-related-type"),
658
658
  disabled: t.disabled,
659
659
  clearable: "",
660
660
  teleport: "",
661
- "onUpdate:modelValue": _
662
- }, null, 8, ["model-value", "options", "placeholder", "aria-label", "disabled"])) : U("", !0),
663
- p.value ? (d(), $(j, { key: 1 }, [
661
+ "onUpdate:modelValue": $
662
+ }, null, 8, ["model-value", "options", "placeholder", "aria-label", "disabled"])) : E("", !0),
663
+ p.value ? (d(), S(K, { key: 1 }, [
664
664
  x(a(Fe), {
665
- "model-value": u.value.related?.current === !0,
665
+ "model-value": c.value.related?.current === !0,
666
666
  label: a(n)("relations.collection-related-current"),
667
667
  disabled: t.disabled,
668
- "onUpdate:modelValue": z[0] || (z[0] = (k) => F(k === !0))
668
+ "onUpdate:modelValue": W[0] || (W[0] = (T) => P(T === !0))
669
669
  }, null, 8, ["model-value", "label", "disabled"]),
670
670
  M("p", ca, C(a(n)("relations.collection-related-current-hint", { target: p.value.title })), 1)
671
- ], 64)) : U("", !0),
672
- p.value && u.value.related?.current !== !0 ? (d(), W(Nt, {
671
+ ], 64)) : E("", !0),
672
+ p.value && c.value.related?.current !== !0 ? (d(), L(Nt, {
673
673
  key: 2,
674
- "model-value": u.value.related?.ids ?? [],
674
+ "model-value": c.value.related?.ids ?? [],
675
675
  target: p.value.key,
676
676
  sortable: !1,
677
677
  "empty-text": a(n)("relations.collection-related-any"),
678
678
  disabled: t.disabled,
679
- "onUpdate:modelValue": S
680
- }, null, 8, ["model-value", "target", "empty-text", "disabled"])) : U("", !0)
681
- ])) : U("", !0),
679
+ "onUpdate:modelValue": b
680
+ }, null, 8, ["model-value", "target", "empty-text", "disabled"])) : E("", !0)
681
+ ])) : E("", !0),
682
682
  M("div", fa, [
683
683
  M("label", {
684
684
  class: "wx-collection-field__label",
@@ -687,50 +687,50 @@ const na = ["aria-busy"], oa = {
687
687
  M("div", va, [
688
688
  x(a(sl), {
689
689
  id: `${a(i)}-limit`,
690
- "model-value": u.value.limit,
690
+ "model-value": c.value.limit,
691
691
  min: 1,
692
692
  max: a(Et),
693
693
  step: 1,
694
694
  precision: 0,
695
695
  placeholder: a(n)("collections.field-limit-all"),
696
696
  disabled: t.disabled,
697
- "onUpdate:modelValue": c
697
+ "onUpdate:modelValue": u
698
698
  }, null, 8, ["id", "model-value", "max", "placeholder", "disabled"])
699
699
  ])
700
700
  ]),
701
- o.value.categories ? (d(), W(a(Fe), {
701
+ o.value.categories ? (d(), L(a(Fe), {
702
702
  key: 2,
703
- "model-value": u.value.filter,
703
+ "model-value": c.value.filter,
704
704
  label: a(n)("collections.field-filter"),
705
705
  disabled: t.disabled,
706
- "onUpdate:modelValue": z[1] || (z[1] = (k) => m({ filter: k === !0 }))
707
- }, null, 8, ["model-value", "label", "disabled"])) : U("", !0),
708
- o.value.markup ? (d(), $("div", pa, [
706
+ "onUpdate:modelValue": W[1] || (W[1] = (T) => v({ filter: T === !0 }))
707
+ }, null, 8, ["model-value", "label", "disabled"])) : E("", !0),
708
+ o.value.markup ? (d(), S("div", pa, [
709
709
  x(a(Fe), {
710
- "model-value": Y.value,
710
+ "model-value": H.value,
711
711
  label: a(n)("collections.field-markup"),
712
712
  disabled: t.disabled,
713
- "onUpdate:modelValue": D
713
+ "onUpdate:modelValue": j
714
714
  }, null, 8, ["model-value", "label", "disabled"]),
715
- M("p", ha, C(L.value), 1),
716
- u.value.markup !== null ? (d(), W(a(ce), {
715
+ M("p", ha, C(F.value), 1),
716
+ c.value.markup !== null ? (d(), L(a(de), {
717
717
  key: 0,
718
718
  class: "wx-collection-field__reset",
719
719
  variant: "text",
720
720
  size: "sm",
721
721
  disabled: t.disabled,
722
- onClick: z[2] || (z[2] = (k) => m({ markup: null }))
722
+ onClick: W[2] || (W[2] = (T) => v({ markup: null }))
723
723
  }, {
724
- default: g(() => [
724
+ default: w(() => [
725
725
  R(C(a(n)("collections.field-markup-reset")), 1)
726
726
  ]),
727
727
  _: 1
728
- }, 8, ["disabled"])) : U("", !0)
729
- ])) : U("", !0)
730
- ], 64)) : U("", !0)
728
+ }, 8, ["disabled"])) : E("", !0)
729
+ ])) : E("", !0)
730
+ ], 64)) : E("", !0)
731
731
  ], 8, na));
732
732
  }
733
- }), ga = /* @__PURE__ */ se(ya, [["__scopeId", "data-v-023ad095"]]);
733
+ }), ga = /* @__PURE__ */ oe(ya, [["__scopeId", "data-v-023ad095"]]);
734
734
  function ba() {
735
735
  return {
736
736
  target: "entity",
@@ -763,7 +763,7 @@ const _a = { class: "wx-link-picker" }, xa = {
763
763
  }, Sa = {
764
764
  key: 3,
765
765
  class: "wx-link-picker__attributes"
766
- }, Ta = { class: "wx-link-picker__rel" }, Ca = /* @__PURE__ */ K({
766
+ }, Ta = { class: "wx-link-picker__rel" }, Ca = /* @__PURE__ */ q({
767
767
  name: "WxLinkPicker",
768
768
  __name: "LinkPicker",
769
769
  props: /* @__PURE__ */ me({
@@ -776,158 +776,158 @@ const _a = { class: "wx-link-picker" }, xa = {
776
776
  }),
777
777
  emits: ["update:modelValue"],
778
778
  setup(e) {
779
- const t = e, l = ge(e, "modelValue"), s = te(), n = Nl(), i = wa(s), o = J("webx-admin"), r = A([]), u = A([]), m = A([]), v = A(!1), f = A(null), c = A(""), h = A(null);
780
- let y = null;
781
- const p = b(() => l.value ?? ba()), _ = b(() => {
782
- const w = [
779
+ const t = e, l = ge(e, "modelValue"), s = ee(), n = Nl(), i = wa(s), o = J("webx-admin"), r = A([]), c = A([]), v = A([]), h = A(!1), m = A(null), u = A(""), f = A(null);
780
+ let k = null;
781
+ const p = _(() => l.value ?? ba()), $ = _(() => {
782
+ const g = [
783
783
  { value: "entity", label: o("links.target-entity") },
784
784
  { value: "url", label: o("links.target-url") }
785
785
  ];
786
- return t.allowNone ? [...w, { value: "none", label: o("links.target-none") }] : w;
787
- }), S = b(
788
- () => r.value.map((w) => ({ value: w.type, label: w.title }))
789
- ), F = b(
790
- () => u.value.map((w) => ({
791
- value: w.title,
792
- description: P(w),
793
- id: w.id
786
+ return t.allowNone ? [...g, { value: "none", label: o("links.target-none") }] : g;
787
+ }), b = _(
788
+ () => r.value.map((g) => ({ value: g.type, label: g.title }))
789
+ ), P = _(
790
+ () => c.value.map((g) => ({
791
+ value: g.title,
792
+ description: ce(g),
793
+ id: g.id
794
794
  }))
795
- ), Y = b(
796
- () => m.value.map((w) => ({ value: w.path, description: w.name }))
795
+ ), H = _(
796
+ () => v.value.map((g) => ({ value: g.path, description: g.name }))
797
797
  );
798
- Ie(async () => {
799
- r.value = await i.sources(), f.value = p.value.entity_type ?? r.value[0]?.type ?? null, await Promise.all([D(), L()]);
800
- }), re(
798
+ Se(async () => {
799
+ r.value = await i.sources(), m.value = p.value.entity_type ?? r.value[0]?.type ?? null, await Promise.all([j(), F()]);
800
+ }), ie(
801
801
  () => [p.value.entity_type, p.value.entity_id].join(":"),
802
802
  () => {
803
- D();
803
+ j();
804
804
  }
805
805
  );
806
- async function D() {
807
- const { entity_type: w, entity_id: N } = p.value;
808
- if (w === null || N === null) {
809
- h.value = null, c.value = "";
806
+ async function j() {
807
+ const { entity_type: g, entity_id: z } = p.value;
808
+ if (g === null || z === null) {
809
+ f.value = null, u.value = "";
810
810
  return;
811
811
  }
812
- if (h.value?.id === N)
812
+ if (f.value?.id === z)
813
813
  return;
814
- const [E] = await i.resolve([{ type: w, id: N }], n.state.locale);
815
- h.value = E ?? null, c.value = E?.title ?? o("links.missing"), y = c.value;
814
+ const [N] = await i.resolve([{ type: g, id: z }], n.state.locale);
815
+ f.value = N ?? null, u.value = N?.title ?? o("links.missing"), k = u.value;
816
816
  }
817
- async function L() {
818
- m.value = await i.routes();
817
+ async function F() {
818
+ v.value = await i.routes();
819
819
  }
820
- async function T(w) {
821
- if (w === y) {
822
- y = null;
820
+ async function y(g) {
821
+ if (g === k) {
822
+ k = null;
823
823
  return;
824
824
  }
825
- if (y = null, f.value !== null) {
826
- v.value = !0;
825
+ if (k = null, m.value !== null) {
826
+ h.value = !0;
827
827
  try {
828
- u.value = await i.search(f.value, w, n.state.locale);
828
+ c.value = await i.search(m.value, g, n.state.locale);
829
829
  } finally {
830
- v.value = !1;
830
+ h.value = !1;
831
831
  }
832
832
  }
833
833
  }
834
- function z(w) {
835
- w !== void 0 && (l.value = { ...p.value, target: w });
834
+ function W(g) {
835
+ g !== void 0 && (l.value = { ...p.value, target: g });
836
836
  }
837
- function k(w) {
838
- f.value = w == null ? null : String(w), u.value = [], T("");
837
+ function T(g) {
838
+ m.value = g == null ? null : String(g), c.value = [], y("");
839
839
  }
840
- function H(w) {
841
- const N = u.value.find((E) => E.id === w.id);
842
- N === void 0 || f.value === null || (h.value = N, c.value = N.title, l.value = { ...p.value, entity_type: f.value, entity_id: N.id });
840
+ function I(g) {
841
+ const z = c.value.find((N) => N.id === g.id);
842
+ z === void 0 || m.value === null || (f.value = z, u.value = z.title, l.value = { ...p.value, entity_type: m.value, entity_id: z.id });
843
843
  }
844
844
  function V() {
845
- h.value = null, c.value = "", u.value = [], l.value = { ...p.value, entity_type: null, entity_id: null };
845
+ f.value = null, u.value = "", c.value = [], l.value = { ...p.value, entity_type: null, entity_id: null };
846
846
  }
847
- function I(w) {
848
- l.value = { ...p.value, url: w === "" ? null : w };
847
+ function U(g) {
848
+ l.value = { ...p.value, url: g === "" ? null : g };
849
849
  }
850
- function O(w) {
851
- const N = (typeof w == "string" || typeof w == "number" ? String(w) : "").replace(/^#+/, "").trim();
852
- l.value = { ...p.value, hash: N === "" ? null : N };
850
+ function O(g) {
851
+ const z = (typeof g == "string" || typeof g == "number" ? String(g) : "").replace(/^#+/, "").trim();
852
+ l.value = { ...p.value, hash: z === "" ? null : z };
853
853
  }
854
- function le(w) {
855
- l.value = { ...p.value, new_tab: w };
854
+ function te(g) {
855
+ l.value = { ...p.value, new_tab: g };
856
856
  }
857
- function ue(w, N) {
858
- const E = p.value.rel.filter((X) => X !== w);
859
- l.value = { ...p.value, rel: N ? [...E, w] : E };
857
+ function re(g, z) {
858
+ const N = p.value.rel.filter((X) => X !== g);
859
+ l.value = { ...p.value, rel: z ? [...N, g] : N };
860
860
  }
861
- function P(w) {
862
- const N = [w.hint, w.url ?? void 0].filter(
863
- (E) => typeof E == "string" && E !== ""
861
+ function ce(g) {
862
+ const z = [g.hint, g.url ?? void 0].filter(
863
+ (N) => typeof N == "string" && N !== ""
864
864
  );
865
- return w.available || N.push(o("links.unavailable")), N.join(" · ");
865
+ return g.available || z.push(o("links.unavailable")), z.join(" · ");
866
866
  }
867
- const ee = ["nofollow", "sponsored", "ugc"];
868
- return (w, N) => (d(), $("div", _a, [
867
+ const B = ["nofollow", "sponsored", "ugc"];
868
+ return (g, z) => (d(), S("div", _a, [
869
869
  x(a(il), {
870
- options: _.value,
870
+ options: $.value,
871
871
  "model-value": p.value.target,
872
872
  disabled: t.disabled,
873
873
  "aria-label": a(o)("links.target-entity"),
874
- "onUpdate:modelValue": z
874
+ "onUpdate:modelValue": W
875
875
  }, null, 8, ["options", "model-value", "disabled", "aria-label"]),
876
- p.value.target === "entity" ? (d(), $("div", xa, [
877
- S.value.length > 1 ? (d(), W(a(ke), {
876
+ p.value.target === "entity" ? (d(), S("div", xa, [
877
+ b.value.length > 1 ? (d(), L(a(ke), {
878
878
  key: 0,
879
879
  class: "wx-link-picker__section",
880
- options: S.value,
881
- "model-value": f.value,
880
+ options: b.value,
881
+ "model-value": m.value,
882
882
  disabled: t.disabled,
883
883
  "aria-label": a(o)("links.section"),
884
- "onUpdate:modelValue": k
885
- }, null, 8, ["options", "model-value", "disabled", "aria-label"])) : U("", !0),
884
+ "onUpdate:modelValue": T
885
+ }, null, 8, ["options", "model-value", "disabled", "aria-label"])) : E("", !0),
886
886
  x(a(Xe), {
887
887
  class: "wx-link-picker__search",
888
- "model-value": c.value,
889
- options: F.value,
888
+ "model-value": u.value,
889
+ options: P.value,
890
890
  remote: "",
891
891
  clearable: "",
892
- loading: v.value,
892
+ loading: h.value,
893
893
  "loading-text": a(o)("links.searching"),
894
894
  "empty-text": a(o)("links.empty"),
895
895
  placeholder: a(o)("links.search"),
896
896
  "aria-label": a(o)("links.search"),
897
897
  disabled: t.disabled,
898
- "onUpdate:modelValue": N[0] || (N[0] = (E) => c.value = E),
899
- onSearch: T,
900
- onSelect: H,
898
+ "onUpdate:modelValue": z[0] || (z[0] = (N) => u.value = N),
899
+ onSearch: y,
900
+ onSelect: I,
901
901
  onClear: V
902
902
  }, null, 8, ["model-value", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
903
- ])) : p.value.target === "url" ? (d(), $("div", ka, [
903
+ ])) : p.value.target === "url" ? (d(), S("div", ka, [
904
904
  x(a(Xe), {
905
905
  "model-value": p.value.url ?? "",
906
- options: Y.value,
906
+ options: H.value,
907
907
  clearable: "",
908
908
  "open-on-focus": "",
909
909
  "empty-text": a(o)("links.url-routes"),
910
910
  placeholder: a(o)("links.url-placeholder"),
911
911
  "aria-label": a(o)("links.url-label"),
912
912
  disabled: t.disabled,
913
- "onUpdate:modelValue": I
913
+ "onUpdate:modelValue": U
914
914
  }, null, 8, ["model-value", "options", "empty-text", "placeholder", "aria-label", "disabled"])
915
- ])) : U("", !0),
916
- p.value.target !== "none" ? (d(), $("label", $a, [
915
+ ])) : E("", !0),
916
+ p.value.target !== "none" ? (d(), S("label", $a, [
917
917
  x(a(Q), {
918
918
  size: "sm",
919
919
  tone: "muted"
920
920
  }, {
921
- default: g(() => [
921
+ default: w(() => [
922
922
  R(C(a(o)("links.hash")), 1)
923
923
  ]),
924
924
  _: 1
925
925
  }),
926
- N[2] || (N[2] = M("span", {
926
+ z[2] || (z[2] = M("span", {
927
927
  class: "wx-link-picker__sign",
928
928
  "aria-hidden": "true"
929
929
  }, "#", -1)),
930
- x(a(Se), {
930
+ x(a(Te), {
931
931
  "model-value": p.value.hash ?? "",
932
932
  placeholder: a(o)("links.hash-placeholder"),
933
933
  "aria-label": a(o)("links.hash"),
@@ -935,14 +935,14 @@ const _a = { class: "wx-link-picker" }, xa = {
935
935
  clearable: "",
936
936
  "onUpdate:modelValue": O
937
937
  }, null, 8, ["model-value", "placeholder", "aria-label", "disabled"])
938
- ])) : U("", !0),
939
- t.attributes && p.value.target !== "none" ? (d(), $("div", Sa, [
940
- x(a(ft), {
938
+ ])) : E("", !0),
939
+ t.attributes && p.value.target !== "none" ? (d(), S("div", Sa, [
940
+ x(a(mt), {
941
941
  "model-value": p.value.new_tab,
942
942
  disabled: t.disabled,
943
- "onUpdate:modelValue": N[1] || (N[1] = (E) => le(E))
943
+ "onUpdate:modelValue": z[1] || (z[1] = (N) => te(N))
944
944
  }, {
945
- default: g(() => [
945
+ default: w(() => [
946
946
  R(C(a(o)("links.new-tab")), 1)
947
947
  ]),
948
948
  _: 1
@@ -952,27 +952,27 @@ const _a = { class: "wx-link-picker" }, xa = {
952
952
  size: "sm",
953
953
  tone: "muted"
954
954
  }, {
955
- default: g(() => [
955
+ default: w(() => [
956
956
  R(C(a(o)("links.rel")), 1)
957
957
  ]),
958
958
  _: 1
959
959
  }),
960
- (d(), $(j, null, ie(ee, (E) => x(a(ft), {
961
- key: E,
962
- "model-value": p.value.rel.includes(E),
960
+ (d(), S(K, null, se(B, (N) => x(a(mt), {
961
+ key: N,
962
+ "model-value": p.value.rel.includes(N),
963
963
  disabled: t.disabled,
964
- "onUpdate:modelValue": (X) => ue(E, X)
964
+ "onUpdate:modelValue": (X) => re(N, X)
965
965
  }, {
966
- default: g(() => [
967
- R(C(a(o)(`links.rel-${E}`)), 1)
966
+ default: w(() => [
967
+ R(C(a(o)(`links.rel-${N}`)), 1)
968
968
  ]),
969
969
  _: 2
970
970
  }, 1032, ["model-value", "disabled", "onUpdate:modelValue"])), 64))
971
971
  ])
972
- ])) : U("", !0)
972
+ ])) : E("", !0)
973
973
  ]));
974
974
  }
975
- }), Aa = /* @__PURE__ */ se(Ca, [["__scopeId", "data-v-e54022e5"]]), Wa = /* @__PURE__ */ K({
975
+ }), Aa = /* @__PURE__ */ oe(Ca, [["__scopeId", "data-v-e54022e5"]]), Wa = /* @__PURE__ */ q({
976
976
  name: "WxLinkField",
977
977
  inheritAttrs: !1,
978
978
  __name: "LinkField",
@@ -987,7 +987,7 @@ const _a = { class: "wx-link-picker" }, xa = {
987
987
  emits: ["update:modelValue"],
988
988
  setup(e) {
989
989
  const t = e, l = ge(e, "modelValue");
990
- return (s, n) => (d(), W(Aa, et({
990
+ return (s, n) => (d(), L(Aa, et({
991
991
  modelValue: l.value,
992
992
  "onUpdate:modelValue": n[0] || (n[0] = (i) => l.value = i)
993
993
  }, s.$attrs, {
@@ -1292,18 +1292,18 @@ const _a = { class: "wx-link-picker" }, xa = {
1292
1292
  function La(e) {
1293
1293
  const t = e.scope("webx-admin"), l = /* @__PURE__ */ new Map();
1294
1294
  function s(i, o, r) {
1295
- const u = e.state.locale, m = `${u}:${i}`;
1296
- let v = l.get(m);
1297
- return v === void 0 && (v = new Intl.DateTimeFormat(u, o), l.set(m, v)), v.format(r);
1295
+ const c = e.state.locale, v = `${c}:${i}`;
1296
+ let h = l.get(v);
1297
+ return h === void 0 && (h = new Intl.DateTimeFormat(c, o), l.set(v, h)), h.format(r);
1298
1298
  }
1299
1299
  const n = (i) => s("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, i);
1300
1300
  return {
1301
1301
  short(i) {
1302
- const o = Ce(i);
1302
+ const o = Ae(i);
1303
1303
  if (o === null)
1304
1304
  return t("dates.never");
1305
- const r = /* @__PURE__ */ new Date(), u = gt(o, r);
1306
- return u === 0 ? t("dates.today", { time: n(o) }) : u === -1 ? t("dates.yesterday", { time: n(o) }) : o.getFullYear() === r.getFullYear() ? s(
1305
+ const r = /* @__PURE__ */ new Date(), c = bt(o, r);
1306
+ return c === 0 ? t("dates.today", { time: n(o) }) : c === -1 ? t("dates.yesterday", { time: n(o) }) : o.getFullYear() === r.getFullYear() ? s(
1307
1307
  "this-year",
1308
1308
  {
1309
1309
  day: "numeric",
@@ -1316,18 +1316,18 @@ function La(e) {
1316
1316
  ) : s("earlier", { day: "numeric", month: "long", year: "numeric" }, o);
1317
1317
  },
1318
1318
  compact(i) {
1319
- const o = Ce(i);
1319
+ const o = Ae(i);
1320
1320
  if (o === null)
1321
1321
  return t("dates.never");
1322
1322
  const r = /* @__PURE__ */ new Date();
1323
- return gt(o, r) === 0 ? n(o) : o.getFullYear() === r.getFullYear() ? s("compact", { day: "numeric", month: "short" }, o) : s("compact-earlier", { dateStyle: "short" }, o);
1323
+ return bt(o, r) === 0 ? n(o) : o.getFullYear() === r.getFullYear() ? s("compact", { day: "numeric", month: "short" }, o) : s("compact-earlier", { dateStyle: "short" }, o);
1324
1324
  },
1325
1325
  exact(i) {
1326
- const o = Ce(i);
1326
+ const o = Ae(i);
1327
1327
  return o === null ? "" : s("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, o);
1328
1328
  },
1329
1329
  iso(i) {
1330
- const o = Ce(i);
1330
+ const o = Ae(i);
1331
1331
  return o === null ? "" : o.toISOString();
1332
1332
  }
1333
1333
  };
@@ -1336,21 +1336,21 @@ function It() {
1336
1336
  const e = fe(Be, null);
1337
1337
  return La(e ?? za());
1338
1338
  }
1339
- let Te = null;
1339
+ let Ce = null;
1340
1340
  function za() {
1341
- return Te === null && (Te = st(), Te.defaults("webx-admin", Rt)), Te;
1341
+ return Ce === null && (Ce = it(), Ce.defaults("webx-admin", Rt)), Ce;
1342
1342
  }
1343
- function Ce(e) {
1343
+ function Ae(e) {
1344
1344
  if (e == null || e === "")
1345
1345
  return null;
1346
1346
  const t = e instanceof Date ? e : new Date(e);
1347
1347
  return Number.isNaN(t.getTime()) ? null : t;
1348
1348
  }
1349
- function gt(e, t) {
1349
+ function bt(e, t) {
1350
1350
  const l = (s) => Date.UTC(s.getFullYear(), s.getMonth(), s.getDate());
1351
1351
  return Math.round((l(e) - l(t)) / 864e5);
1352
1352
  }
1353
- const Ee = /* @__PURE__ */ K({
1353
+ const Ue = /* @__PURE__ */ q({
1354
1354
  name: "WxDate",
1355
1355
  __name: "DateText",
1356
1356
  props: {
@@ -1360,31 +1360,31 @@ const Ee = /* @__PURE__ */ K({
1360
1360
  tone: { default: "muted" }
1361
1361
  },
1362
1362
  setup(e) {
1363
- const t = e, l = It(), s = b(() => t.compact ? l.compact(t.value) : l.short(t.value)), n = b(() => l.exact(t.value)), i = b(() => l.iso(t.value));
1364
- return (o, r) => n.value ? (d(), W(a(Wt), {
1363
+ const t = e, l = It(), s = _(() => t.compact ? l.compact(t.value) : l.short(t.value)), n = _(() => l.exact(t.value)), i = _(() => l.iso(t.value));
1364
+ return (o, r) => n.value ? (d(), L(a(Wt), {
1365
1365
  key: 0,
1366
1366
  content: n.value
1367
1367
  }, {
1368
- default: g(() => [
1368
+ default: w(() => [
1369
1369
  x(a(Q), {
1370
1370
  as: "time",
1371
1371
  datetime: i.value,
1372
1372
  size: e.size,
1373
1373
  tone: e.tone
1374
1374
  }, {
1375
- default: g(() => [
1375
+ default: w(() => [
1376
1376
  R(C(s.value), 1)
1377
1377
  ]),
1378
1378
  _: 1
1379
1379
  }, 8, ["datetime", "size", "tone"])
1380
1380
  ]),
1381
1381
  _: 1
1382
- }, 8, ["content"])) : (d(), W(a(Q), {
1382
+ }, 8, ["content"])) : (d(), L(a(Q), {
1383
1383
  key: 1,
1384
1384
  size: e.size,
1385
1385
  tone: e.tone
1386
1386
  }, {
1387
- default: g(() => [
1387
+ default: w(() => [
1388
1388
  R(C(s.value), 1)
1389
1389
  ]),
1390
1390
  _: 1
@@ -1427,21 +1427,21 @@ function Ua(e, t, l) {
1427
1427
  }
1428
1428
  const Mt = /* @__PURE__ */ Symbol("wx-history-subject");
1429
1429
  function Ra(e) {
1430
- Ue(Mt, e);
1430
+ Re(Mt, e);
1431
1431
  }
1432
1432
  function Ia() {
1433
1433
  return fe(Mt, null);
1434
1434
  }
1435
1435
  function je(e, t, l = 120) {
1436
- return e == null || e === "" ? t : typeof e == "boolean" ? e ? "✓" : "✗" : typeof e == "string" ? bt(e, l) : typeof e == "number" ? String(e) : bt(JSON.stringify(e), l);
1436
+ return e == null || e === "" ? t : typeof e == "boolean" ? e ? "✓" : "✗" : typeof e == "string" ? wt(e, l) : typeof e == "number" ? String(e) : wt(JSON.stringify(e), l);
1437
1437
  }
1438
- function bt(e, t) {
1438
+ function wt(e, t) {
1439
1439
  return e.length > t ? `${e.slice(0, t - 1)}…` : e;
1440
1440
  }
1441
- const Ma = { class: "wx-history" }, Oa = {
1441
+ const Ma = { class: "wx-history" }, Pa = {
1442
1442
  key: 4,
1443
1443
  class: "wx-history__list"
1444
- }, Pa = { class: "wx-history-entry__body" }, Ba = { class: "wx-history-entry__head" }, Da = {
1444
+ }, Oa = { class: "wx-history-entry__body" }, Ba = { class: "wx-history-entry__head" }, Da = {
1445
1445
  key: 0,
1446
1446
  class: "wx-history-entry__changes"
1447
1447
  }, Fa = { class: "wx-history-change__label" }, Ha = {
@@ -1462,7 +1462,7 @@ const Ma = { class: "wx-history" }, Oa = {
1462
1462
  }, ln = { class: "wx-history-change__from" }, an = { class: "wx-history-change__to" }, nn = {
1463
1463
  key: 2,
1464
1464
  class: "wx-history__more"
1465
- }, on = /* @__PURE__ */ K({
1465
+ }, on = /* @__PURE__ */ q({
1466
1466
  name: "WxHistory",
1467
1467
  __name: "HistoryFeed",
1468
1468
  props: {
@@ -1471,303 +1471,303 @@ const Ma = { class: "wx-history" }, Oa = {
1471
1471
  title: { default: void 0 }
1472
1472
  },
1473
1473
  setup(e, { expose: t }) {
1474
- const l = e, s = te(), n = J("webx-admin"), i = De(), o = Ia(), r = A([]), u = A(1), m = A(1), v = A(!1), f = A(!1), c = b(() => l.id ?? o?.id.value ?? null), h = b(
1475
- () => c.value === null ? null : Ua(s, l.type, c.value)
1476
- ), y = b(() => l.title ?? n("history.title"));
1474
+ const l = e, s = ee(), n = J("webx-admin"), i = De(), o = Ia(), r = A([]), c = A(1), v = A(1), h = A(!1), m = A(!1), u = _(() => l.id ?? o?.id.value ?? null), f = _(
1475
+ () => u.value === null ? null : Ua(s, l.type, u.value)
1476
+ ), k = _(() => l.title ?? n("history.title"));
1477
1477
  async function p() {
1478
- if (r.value = [], u.value = 1, m.value = 1, h.value !== null) {
1479
- v.value = !0;
1478
+ if (r.value = [], c.value = 1, v.value = 1, f.value !== null) {
1479
+ h.value = !0;
1480
1480
  try {
1481
- const w = await h.value.list(1);
1482
- r.value = w.data, m.value = w.last_page;
1483
- } catch (w) {
1484
- Z.danger(i(w));
1481
+ const g = await f.value.list(1);
1482
+ r.value = g.data, v.value = g.last_page;
1483
+ } catch (g) {
1484
+ Z.danger(i(g));
1485
1485
  } finally {
1486
- v.value = !1;
1486
+ h.value = !1;
1487
1487
  }
1488
1488
  }
1489
1489
  }
1490
- async function _() {
1491
- if (!(h.value === null || f.value)) {
1492
- f.value = !0;
1490
+ async function $() {
1491
+ if (!(f.value === null || m.value)) {
1492
+ m.value = !0;
1493
1493
  try {
1494
- const w = await h.value.list(u.value + 1);
1495
- r.value = [...r.value, ...w.data], u.value = w.current_page, m.value = w.last_page;
1496
- } catch (w) {
1497
- Z.danger(i(w));
1494
+ const g = await f.value.list(c.value + 1);
1495
+ r.value = [...r.value, ...g.data], c.value = g.current_page, v.value = g.last_page;
1496
+ } catch (g) {
1497
+ Z.danger(i(g));
1498
1498
  } finally {
1499
- f.value = !1;
1499
+ m.value = !1;
1500
1500
  }
1501
1501
  }
1502
1502
  }
1503
- re([() => l.type, c], () => {
1503
+ ie([() => l.type, u], () => {
1504
1504
  p();
1505
1505
  }, { immediate: !0 }), t({ reload: p });
1506
- function S(w) {
1507
- return w.admin?.name ?? n("history.unknown-author");
1506
+ function b(g) {
1507
+ return g.admin?.name ?? n("history.unknown-author");
1508
1508
  }
1509
- function F(w) {
1510
- return `${n(`history.event-${w.event}`)} · ${n(`history.source-${w.source}`)}`;
1509
+ function P(g) {
1510
+ return `${n(`history.event-${g.event}`)} · ${n(`history.source-${g.source}`)}`;
1511
1511
  }
1512
- function Y(w) {
1513
- return je(w.from, n("history.empty-value"));
1512
+ function H(g) {
1513
+ return je(g.from, n("history.empty-value"));
1514
1514
  }
1515
- function D(w) {
1516
- return je(w.to, n("history.empty-value"));
1515
+ function j(g) {
1516
+ return je(g.to, n("history.empty-value"));
1517
1517
  }
1518
- function L(w) {
1518
+ function F(g) {
1519
1519
  return n("history.long", {
1520
- from: String(w.from_length ?? 0),
1521
- to: String(w.to_length ?? 0)
1520
+ from: String(g.from_length ?? 0),
1521
+ to: String(g.to_length ?? 0)
1522
1522
  });
1523
1523
  }
1524
- function T(w) {
1525
- const N = w.run?.summary?.what;
1526
- return typeof N == "string" && N !== "" ? `${n("history.run")} · ${N}` : n("history.run");
1524
+ function y(g) {
1525
+ const z = g.run?.summary?.what;
1526
+ return typeof z == "string" && z !== "" ? `${n("history.run")} · ${z}` : n("history.run");
1527
1527
  }
1528
- const z = A(!1), k = A(null), H = A(null), V = A(""), I = A(!1);
1528
+ const W = A(!1), T = A(null), I = A(null), V = A(""), U = A(!1);
1529
1529
  let O = 0;
1530
- async function le(w, N = 1) {
1531
- if (h.value === null) return;
1532
- I.value = !0;
1533
- const E = ++O;
1530
+ async function te(g, z = 1) {
1531
+ if (f.value === null) return;
1532
+ U.value = !0;
1533
+ const N = ++O;
1534
1534
  try {
1535
- const X = /^\d+$/.test(V.value.trim()) ? Number(V.value.trim()) : null, pe = await h.value.run(w, N, X);
1536
- if (E !== O) return;
1537
- k.value = N === 1 || k.value === null ? pe : {
1535
+ const X = /^\d+$/.test(V.value.trim()) ? Number(V.value.trim()) : null, pe = await f.value.run(g, z, X);
1536
+ if (N !== O) return;
1537
+ T.value = z === 1 || T.value === null ? pe : {
1538
1538
  run: pe.run,
1539
- rows: { ...pe.rows, data: [...k.value.rows.data, ...pe.rows.data] }
1539
+ rows: { ...pe.rows, data: [...T.value.rows.data, ...pe.rows.data] }
1540
1540
  };
1541
1541
  } catch (X) {
1542
1542
  Z.danger(i(X));
1543
1543
  } finally {
1544
- I.value = !1;
1544
+ U.value = !1;
1545
1545
  }
1546
1546
  }
1547
- function ue(w) {
1548
- H.value = w, k.value = null, V.value = "", z.value = !0, le(w);
1547
+ function re(g) {
1548
+ I.value = g, T.value = null, V.value = "", W.value = !0, te(g);
1549
1549
  }
1550
- re(V, () => {
1551
- H.value !== null && z.value && le(H.value);
1550
+ ie(V, () => {
1551
+ I.value !== null && W.value && te(I.value);
1552
1552
  });
1553
- const P = b(() => {
1554
- const w = k.value?.run.summary ?? {};
1555
- return Object.entries(w).filter(([N]) => N !== "rows" && N !== "failed").map(([N, E]) => ({ key: N, value: je(E, n("history.empty-value")) }));
1556
- }), ee = b(() => {
1557
- const w = k.value?.run.summary?.failed;
1558
- return typeof w == "string" ? w : null;
1553
+ const ce = _(() => {
1554
+ const g = T.value?.run.summary ?? {};
1555
+ return Object.entries(g).filter(([z]) => z !== "rows" && z !== "failed").map(([z, N]) => ({ key: z, value: je(N, n("history.empty-value")) }));
1556
+ }), B = _(() => {
1557
+ const g = T.value?.run.summary?.failed;
1558
+ return typeof g == "string" ? g : null;
1559
1559
  });
1560
- return (w, N) => (d(), $("section", Ma, [
1561
- y.value ? (d(), W(a(Q), {
1560
+ return (g, z) => (d(), S("section", Ma, [
1561
+ k.value ? (d(), L(a(Q), {
1562
1562
  key: 0,
1563
1563
  weight: "medium",
1564
1564
  class: "wx-history__title"
1565
1565
  }, {
1566
- default: g(() => [
1567
- R(C(y.value), 1)
1566
+ default: w(() => [
1567
+ R(C(k.value), 1)
1568
1568
  ]),
1569
1569
  _: 1
1570
- })) : U("", !0),
1571
- c.value === null ? (d(), W(a(Ve), {
1570
+ })) : E("", !0),
1571
+ u.value === null ? (d(), L(a(Ne), {
1572
1572
  key: 1,
1573
1573
  size: "sm",
1574
1574
  description: a(n)("history.unsaved")
1575
- }, null, 8, ["description"])) : v.value ? (d(), W(a(ye), {
1575
+ }, null, 8, ["description"])) : h.value ? (d(), L(a(ye), {
1576
1576
  key: 2,
1577
1577
  rows: 3
1578
- })) : r.value.length === 0 ? (d(), W(a(Ve), {
1578
+ })) : r.value.length === 0 ? (d(), L(a(Ne), {
1579
1579
  key: 3,
1580
1580
  size: "sm",
1581
1581
  description: a(n)("history.empty")
1582
- }, null, 8, ["description"])) : (d(), $("ul", Oa, [
1583
- (d(!0), $(j, null, ie(r.value, (E) => (d(), $("li", {
1584
- key: E.id,
1582
+ }, null, 8, ["description"])) : (d(), S("ul", Pa, [
1583
+ (d(!0), S(K, null, se(r.value, (N) => (d(), S("li", {
1584
+ key: N.id,
1585
1585
  class: "wx-history-entry"
1586
1586
  }, [
1587
1587
  x(a(Lt), {
1588
- name: S(E),
1588
+ name: b(N),
1589
1589
  size: "sm",
1590
1590
  tone: "auto"
1591
1591
  }, null, 8, ["name"]),
1592
- M("div", Pa, [
1592
+ M("div", Oa, [
1593
1593
  M("div", Ba, [
1594
1594
  x(a(Q), {
1595
1595
  size: "sm",
1596
1596
  weight: "medium",
1597
1597
  truncate: ""
1598
1598
  }, {
1599
- default: g(() => [
1600
- R(C(S(E)), 1)
1599
+ default: w(() => [
1600
+ R(C(b(N)), 1)
1601
1601
  ]),
1602
1602
  _: 2
1603
1603
  }, 1024),
1604
- x(Ee, {
1605
- value: E.created_at
1604
+ x(Ue, {
1605
+ value: N.created_at
1606
1606
  }, null, 8, ["value"])
1607
1607
  ]),
1608
1608
  x(a(Q), {
1609
1609
  size: "sm",
1610
1610
  tone: "muted"
1611
1611
  }, {
1612
- default: g(() => [
1613
- R(C(F(E)), 1)
1612
+ default: w(() => [
1613
+ R(C(P(N)), 1)
1614
1614
  ]),
1615
1615
  _: 2
1616
1616
  }, 1024),
1617
- E.changes.length > 0 ? (d(), $("ul", Da, [
1618
- (d(!0), $(j, null, ie(E.changes, (X) => (d(), $("li", {
1617
+ N.changes.length > 0 ? (d(), S("ul", Da, [
1618
+ (d(!0), S(K, null, se(N.changes, (X) => (d(), S("li", {
1619
1619
  key: X.field,
1620
1620
  class: "wx-history-change"
1621
1621
  }, [
1622
1622
  M("span", Fa, C(X.label) + ":", 1),
1623
- X.long ? (d(), $("span", Ha, C(L(X)), 1)) : (d(), $(j, { key: 1 }, [
1624
- M("span", ja, C(Y(X)), 1),
1625
- N[3] || (N[3] = M("span", {
1623
+ X.long ? (d(), S("span", Ha, C(F(X)), 1)) : (d(), S(K, { key: 1 }, [
1624
+ M("span", ja, C(H(X)), 1),
1625
+ z[3] || (z[3] = M("span", {
1626
1626
  class: "wx-history-change__arrow",
1627
1627
  "aria-hidden": "true"
1628
1628
  }, "→", -1)),
1629
- M("span", Ka, C(D(X)), 1)
1629
+ M("span", Ka, C(j(X)), 1)
1630
1630
  ], 64))
1631
1631
  ]))), 128))
1632
- ])) : U("", !0),
1633
- E.run ? (d(), $("button", {
1632
+ ])) : E("", !0),
1633
+ N.run ? (d(), S("button", {
1634
1634
  key: 1,
1635
1635
  type: "button",
1636
1636
  class: "wx-history-entry__run",
1637
- onClick: (X) => ue(E.run.id)
1638
- }, C(T(E)), 9, qa)) : U("", !0)
1637
+ onClick: (X) => re(N.run.id)
1638
+ }, C(y(N)), 9, qa)) : E("", !0)
1639
1639
  ])
1640
1640
  ]))), 128))
1641
1641
  ])),
1642
- u.value < m.value ? (d(), $("div", Ya, [
1643
- x(a(ce), {
1642
+ c.value < v.value ? (d(), S("div", Ya, [
1643
+ x(a(de), {
1644
1644
  size: "sm",
1645
- loading: f.value,
1646
- onClick: _
1645
+ loading: m.value,
1646
+ onClick: $
1647
1647
  }, {
1648
- default: g(() => [
1648
+ default: w(() => [
1649
1649
  R(C(a(n)("history.more")), 1)
1650
1650
  ]),
1651
1651
  _: 1
1652
1652
  }, 8, ["loading"])
1653
- ])) : U("", !0),
1654
- x(a(nt), {
1655
- open: z.value,
1656
- "onUpdate:open": N[2] || (N[2] = (E) => z.value = E),
1653
+ ])) : E("", !0),
1654
+ x(a(ot), {
1655
+ open: W.value,
1656
+ "onUpdate:open": z[2] || (z[2] = (N) => W.value = N),
1657
1657
  title: a(n)("history.run-title"),
1658
1658
  width: 640
1659
1659
  }, {
1660
- default: g(() => [
1661
- k.value === null ? (d(), W(a(ye), {
1660
+ default: w(() => [
1661
+ T.value === null ? (d(), L(a(ye), {
1662
1662
  key: 0,
1663
1663
  rows: 4
1664
- })) : (d(), $("div", Xa, [
1664
+ })) : (d(), S("div", Xa, [
1665
1665
  M("div", Ja, [
1666
1666
  x(a(Q), {
1667
1667
  size: "sm",
1668
1668
  weight: "medium"
1669
1669
  }, {
1670
- default: g(() => [
1671
- R(C(S(k.value.run)), 1)
1670
+ default: w(() => [
1671
+ R(C(b(T.value.run)), 1)
1672
1672
  ]),
1673
1673
  _: 1
1674
1674
  }),
1675
- x(Ee, {
1676
- value: k.value.run.created_at
1675
+ x(Ue, {
1676
+ value: T.value.run.created_at
1677
1677
  }, null, 8, ["value"])
1678
1678
  ]),
1679
1679
  x(a(Q), {
1680
1680
  size: "sm",
1681
1681
  tone: "muted"
1682
1682
  }, {
1683
- default: g(() => [
1684
- R(C(F(k.value.run)), 1)
1683
+ default: w(() => [
1684
+ R(C(P(T.value.run)), 1)
1685
1685
  ]),
1686
1686
  _: 1
1687
1687
  }),
1688
- P.value.length > 0 ? (d(), $("dl", Ga, [
1689
- (d(!0), $(j, null, ie(P.value, (E) => (d(), $(j, {
1690
- key: E.key
1688
+ ce.value.length > 0 ? (d(), S("dl", Ga, [
1689
+ (d(!0), S(K, null, se(ce.value, (N) => (d(), S(K, {
1690
+ key: N.key
1691
1691
  }, [
1692
- M("dt", null, C(E.key), 1),
1693
- M("dd", null, C(E.value), 1)
1692
+ M("dt", null, C(N.key), 1),
1693
+ M("dd", null, C(N.value), 1)
1694
1694
  ], 64))), 128))
1695
- ])) : U("", !0),
1695
+ ])) : E("", !0),
1696
1696
  x(a(Q), { size: "sm" }, {
1697
- default: g(() => [
1698
- R(C(a(n)("history.run-rows", { count: String(k.value.run.rows ?? 0) })), 1)
1697
+ default: w(() => [
1698
+ R(C(a(n)("history.run-rows", { count: String(T.value.run.rows ?? 0) })), 1)
1699
1699
  ]),
1700
1700
  _: 1
1701
1701
  }),
1702
- ee.value ? (d(), W(a(Q), {
1702
+ B.value ? (d(), L(a(Q), {
1703
1703
  key: 1,
1704
1704
  size: "sm",
1705
1705
  tone: "danger"
1706
1706
  }, {
1707
- default: g(() => [
1708
- R(C(a(n)("history.run-failed", { message: ee.value })), 1)
1707
+ default: w(() => [
1708
+ R(C(a(n)("history.run-failed", { message: B.value })), 1)
1709
1709
  ]),
1710
1710
  _: 1
1711
- })) : U("", !0),
1712
- x(a(Se), {
1711
+ })) : E("", !0),
1712
+ x(a(Te), {
1713
1713
  modelValue: V.value,
1714
- "onUpdate:modelValue": N[0] || (N[0] = (E) => V.value = E),
1714
+ "onUpdate:modelValue": z[0] || (z[0] = (N) => V.value = N),
1715
1715
  size: "sm",
1716
1716
  inputmode: "numeric",
1717
1717
  placeholder: a(n)("history.search"),
1718
1718
  clearable: ""
1719
1719
  }, null, 8, ["modelValue", "placeholder"]),
1720
1720
  M("ul", Qa, [
1721
- (d(!0), $(j, null, ie(k.value.rows.data, (E) => (d(), $("li", {
1722
- key: E.id,
1721
+ (d(!0), S(K, null, se(T.value.rows.data, (N) => (d(), S("li", {
1722
+ key: N.id,
1723
1723
  class: "wx-history-run__row"
1724
1724
  }, [
1725
1725
  x(a(Q), {
1726
1726
  size: "sm",
1727
1727
  weight: "medium"
1728
1728
  }, {
1729
- default: g(() => [
1730
- R("#" + C(E.subject.id), 1)
1729
+ default: w(() => [
1730
+ R("#" + C(N.subject.id), 1)
1731
1731
  ]),
1732
1732
  _: 2
1733
1733
  }, 1024),
1734
1734
  M("ul", Za, [
1735
- (d(!0), $(j, null, ie(E.changes, (X) => (d(), $("li", {
1735
+ (d(!0), S(K, null, se(N.changes, (X) => (d(), S("li", {
1736
1736
  key: X.field,
1737
1737
  class: "wx-history-change"
1738
1738
  }, [
1739
1739
  M("span", en, C(X.label) + ":", 1),
1740
- X.long ? (d(), $("span", tn, C(L(X)), 1)) : (d(), $(j, { key: 1 }, [
1741
- M("span", ln, C(Y(X)), 1),
1742
- N[4] || (N[4] = M("span", {
1740
+ X.long ? (d(), S("span", tn, C(F(X)), 1)) : (d(), S(K, { key: 1 }, [
1741
+ M("span", ln, C(H(X)), 1),
1742
+ z[4] || (z[4] = M("span", {
1743
1743
  class: "wx-history-change__arrow",
1744
1744
  "aria-hidden": "true"
1745
1745
  }, "→", -1)),
1746
- M("span", an, C(D(X)), 1)
1746
+ M("span", an, C(j(X)), 1)
1747
1747
  ], 64))
1748
1748
  ]))), 128))
1749
1749
  ])
1750
1750
  ]))), 128))
1751
1751
  ]),
1752
- k.value.rows.current_page < k.value.rows.last_page ? (d(), $("div", nn, [
1753
- x(a(ce), {
1752
+ T.value.rows.current_page < T.value.rows.last_page ? (d(), S("div", nn, [
1753
+ x(a(de), {
1754
1754
  size: "sm",
1755
- loading: I.value,
1756
- onClick: N[1] || (N[1] = (E) => H.value !== null && le(H.value, k.value.rows.current_page + 1))
1755
+ loading: U.value,
1756
+ onClick: z[1] || (z[1] = (N) => I.value !== null && te(I.value, T.value.rows.current_page + 1))
1757
1757
  }, {
1758
- default: g(() => [
1758
+ default: w(() => [
1759
1759
  R(C(a(n)("history.more")), 1)
1760
1760
  ]),
1761
1761
  _: 1
1762
1762
  }, 8, ["loading"])
1763
- ])) : U("", !0)
1763
+ ])) : E("", !0)
1764
1764
  ]))
1765
1765
  ]),
1766
1766
  _: 1
1767
1767
  }, 8, ["open", "title"])
1768
1768
  ]));
1769
1769
  }
1770
- }), sn = /* @__PURE__ */ se(on, [["__scopeId", "data-v-68eae472"]]), rn = /* @__PURE__ */ K({
1770
+ }), sn = /* @__PURE__ */ oe(on, [["__scopeId", "data-v-68eae472"]]), rn = /* @__PURE__ */ q({
1771
1771
  __name: "BackButton",
1772
1772
  props: {
1773
1773
  to: {},
@@ -1775,8 +1775,8 @@ const Ma = { class: "wx-history" }, Oa = {
1775
1775
  size: { default: "sm" }
1776
1776
  },
1777
1777
  setup(e) {
1778
- const t = e, l = J("webx-admin"), s = b(() => t.label ?? l("editor.back"));
1779
- return (n, i) => (d(), W(a(be), {
1778
+ const t = e, l = J("webx-admin"), s = _(() => t.label ?? l("editor.back"));
1779
+ return (n, i) => (d(), L(a(be), {
1780
1780
  icon: "arrow-left",
1781
1781
  class: "wx-back-button",
1782
1782
  as: a(ll),
@@ -1789,7 +1789,7 @@ const Ma = { class: "wx-history" }, Oa = {
1789
1789
  }), un = {
1790
1790
  key: 0,
1791
1791
  class: "wx-dropdown__divider"
1792
- }, dn = /* @__PURE__ */ K({
1792
+ }, dn = /* @__PURE__ */ q({
1793
1793
  __name: "RowMenu",
1794
1794
  props: {
1795
1795
  actions: {},
@@ -1797,44 +1797,44 @@ const Ma = { class: "wx-history" }, Oa = {
1797
1797
  size: { default: "sm" }
1798
1798
  },
1799
1799
  setup(e) {
1800
- const t = J("webx-admin"), l = e, s = b(() => [
1800
+ const t = J("webx-admin"), l = e, s = _(() => [
1801
1801
  ...l.actions.filter((i) => !i.danger),
1802
1802
  ...l.actions.filter((i) => i.danger)
1803
- ]), n = b(() => {
1803
+ ]), n = _(() => {
1804
1804
  const i = s.value.find((o) => o.danger);
1805
1805
  return i && s.value[0] !== i ? i.key : null;
1806
1806
  });
1807
- return (i, o) => s.value.length > 0 ? (d(), W(a(rl), {
1807
+ return (i, o) => s.value.length > 0 ? (d(), L(a(rl), {
1808
1808
  key: 0,
1809
1809
  class: "wx-row-menu",
1810
1810
  collapse: "always",
1811
1811
  align: "end",
1812
1812
  size: e.size,
1813
1813
  "aria-label": e.label,
1814
- onClick: o[0] || (o[0] = $t(() => {
1814
+ onClick: o[0] || (o[0] = St(() => {
1815
1815
  }, ["stop"]))
1816
1816
  }, {
1817
- trigger: g(() => [
1817
+ trigger: w(() => [
1818
1818
  x(a(be), {
1819
1819
  type: "more",
1820
1820
  size: e.size,
1821
1821
  title: a(t)("editor.more")
1822
1822
  }, null, 8, ["size", "title"])
1823
1823
  ]),
1824
- collapsed: g(() => [
1825
- (d(!0), $(j, null, ie(s.value, (r) => (d(), $(j, {
1824
+ collapsed: w(() => [
1825
+ (d(!0), S(K, null, se(s.value, (r) => (d(), S(K, {
1826
1826
  key: r.key
1827
1827
  }, [
1828
- r.key === n.value ? (d(), $("hr", un)) : U("", !0),
1828
+ r.key === n.value ? (d(), S("hr", un)) : E("", !0),
1829
1829
  x(a(ul), {
1830
1830
  icon: r.icon,
1831
1831
  tone: r.danger ? "danger" : "default",
1832
1832
  href: r.href,
1833
1833
  target: r.href ? r.target ?? "_blank" : void 0,
1834
1834
  disabled: r.disabled,
1835
- onClick: (u) => r.run?.()
1835
+ onClick: (c) => r.run?.()
1836
1836
  }, {
1837
- default: g(() => [
1837
+ default: w(() => [
1838
1838
  R(C(r.label), 1)
1839
1839
  ]),
1840
1840
  _: 2
@@ -1842,15 +1842,15 @@ const Ma = { class: "wx-history" }, Oa = {
1842
1842
  ], 64))), 128))
1843
1843
  ]),
1844
1844
  _: 1
1845
- }, 8, ["size", "aria-label"])) : U("", !0);
1845
+ }, 8, ["size", "aria-label"])) : E("", !0);
1846
1846
  }
1847
- }), it = /* @__PURE__ */ se(dn, [["__scopeId", "data-v-cab01f7f"]]), cn = ["data-level"], fn = {
1847
+ }), rt = /* @__PURE__ */ oe(dn, [["__scopeId", "data-v-cab01f7f"]]), cn = ["data-level"], fn = {
1848
1848
  key: 0,
1849
1849
  class: "wx-screen-head__trail"
1850
1850
  }, mn = { class: "wx-screen-head__name" }, vn = {
1851
1851
  key: 4,
1852
1852
  class: "wx-screen-head__actions"
1853
- }, pn = /* @__PURE__ */ K({
1853
+ }, pn = /* @__PURE__ */ q({
1854
1854
  __name: "ScreenHead",
1855
1855
  props: {
1856
1856
  title: { default: void 0 },
@@ -1864,109 +1864,109 @@ const Ma = { class: "wx-history" }, Oa = {
1864
1864
  },
1865
1865
  emits: ["back"],
1866
1866
  setup(e, { emit: t }) {
1867
- const l = e, s = t, n = J("webx-admin"), i = Yt(), o = St("root"), r = dl(o), u = b(() => r.value > 0 && r.value < l.collapseBelow), m = b(() => l.actions ?? []), v = b(
1868
- () => m.value.find((p) => p.primary) ?? null
1869
- ), f = b(() => u.value ? v.value ? [v.value] : [] : m.value.filter((p) => !p.menu && !p.danger)), c = b(() => u.value ? m.value.filter((p) => p !== v.value) : m.value.filter((p) => p.menu || p.danger)), h = b(
1867
+ const l = e, s = t, n = J("webx-admin"), i = Yt(), o = lt("root"), r = dl(o), c = _(() => r.value > 0 && r.value < l.collapseBelow), v = _(() => l.actions ?? []), h = _(
1868
+ () => v.value.find((p) => p.primary) ?? null
1869
+ ), m = _(() => c.value ? h.value ? [h.value] : [] : v.value.filter((p) => !p.menu && !p.danger)), u = _(() => c.value ? v.value.filter((p) => p !== h.value) : v.value.filter((p) => p.menu || p.danger)), f = _(
1870
1870
  () => l.back && l.back !== !0 ? l.back : null
1871
- ), y = b(
1872
- () => f.value.length > 0 || c.value.length > 0 || !!i.extra
1871
+ ), k = _(
1872
+ () => m.value.length > 0 || u.value.length > 0 || !!i.extra
1873
1873
  );
1874
- return (p, _) => (d(), $("div", {
1874
+ return (p, $) => (d(), S("div", {
1875
1875
  ref_key: "root",
1876
1876
  ref: o,
1877
1877
  class: ve(["wx-screen-head", {
1878
- "is-narrow": u.value,
1879
- "has-button": f.value.length > 0,
1878
+ "is-narrow": c.value,
1879
+ "has-button": m.value.length > 0,
1880
1880
  "has-trail": !!p.$slots.trail,
1881
1881
  "has-divider": e.divider
1882
1882
  }]),
1883
1883
  "data-level": e.level
1884
1884
  }, [
1885
- p.$slots.trail ? (d(), $("div", fn, [
1886
- oe(p.$slots, "trail", {}, void 0, !0)
1887
- ])) : U("", !0),
1888
- h.value ? (d(), W(rn, {
1885
+ p.$slots.trail ? (d(), S("div", fn, [
1886
+ ne(p.$slots, "trail", {}, void 0, !0)
1887
+ ])) : E("", !0),
1888
+ f.value ? (d(), L(rn, {
1889
1889
  key: 1,
1890
1890
  class: "wx-screen-head__back",
1891
- to: h.value,
1891
+ to: f.value,
1892
1892
  label: e.backLabel,
1893
1893
  "tooltip-side": "bottom"
1894
- }, null, 8, ["to", "label"])) : e.back ? (d(), W(a(be), {
1894
+ }, null, 8, ["to", "label"])) : e.back ? (d(), L(a(be), {
1895
1895
  key: 2,
1896
1896
  class: "wx-screen-head__back",
1897
1897
  icon: "arrow-left",
1898
1898
  size: "sm",
1899
1899
  "tooltip-side": "bottom",
1900
1900
  title: e.backLabel ?? a(n)("editor.back"),
1901
- onClick: _[0] || (_[0] = (S) => s("back"))
1902
- }, null, 8, ["title"])) : U("", !0),
1901
+ onClick: $[0] || ($[0] = (b) => s("back"))
1902
+ }, null, 8, ["title"])) : E("", !0),
1903
1903
  M("div", mn, [
1904
- e.title ? (d(), W(a(cl), {
1904
+ e.title ? (d(), L(a(cl), {
1905
1905
  key: 0,
1906
1906
  level: e.level,
1907
1907
  truncate: "",
1908
1908
  class: "wx-screen-head__title"
1909
1909
  }, {
1910
- default: g(() => [
1910
+ default: w(() => [
1911
1911
  R(C(e.title), 1)
1912
1912
  ]),
1913
1913
  _: 1
1914
- }, 8, ["level"])) : U("", !0),
1915
- oe(p.$slots, "title-after", {}, void 0, !0)
1914
+ }, 8, ["level"])) : E("", !0),
1915
+ ne(p.$slots, "title-after", {}, void 0, !0)
1916
1916
  ]),
1917
- e.subtitle || p.$slots.subtitle ? (d(), W(a(Q), {
1917
+ e.subtitle || p.$slots.subtitle ? (d(), L(a(Q), {
1918
1918
  key: 3,
1919
1919
  class: "wx-screen-head__subtitle",
1920
1920
  size: "sm",
1921
1921
  tone: "muted",
1922
1922
  truncate: ""
1923
1923
  }, {
1924
- default: g(() => [
1925
- oe(p.$slots, "subtitle", {}, () => [
1924
+ default: w(() => [
1925
+ ne(p.$slots, "subtitle", {}, () => [
1926
1926
  R(C(e.subtitle), 1)
1927
1927
  ], !0)
1928
1928
  ]),
1929
1929
  _: 3
1930
- })) : U("", !0),
1931
- y.value ? (d(), $("div", vn, [
1932
- oe(p.$slots, "extra", {}, void 0, !0),
1933
- (d(!0), $(j, null, ie(f.value, (S) => (d(), W(a(ce), {
1934
- key: S.key,
1935
- class: ve(["wx-screen-head__button", { "is-primary": S.primary }]),
1936
- type: S.primary ? "primary" : "default",
1937
- variant: S.primary ? "solid" : S.variant ?? "outline",
1938
- loading: S.loading,
1939
- disabled: S.disabled,
1940
- href: S.href,
1941
- target: S.href ? S.target ?? "_blank" : void 0,
1942
- rel: S.href ? "noopener" : void 0,
1943
- onClick: (F) => S.run?.()
1944
- }, Re({
1945
- default: g(() => [
1946
- R(" " + C(S.label), 1)
1930
+ })) : E("", !0),
1931
+ k.value ? (d(), S("div", vn, [
1932
+ ne(p.$slots, "extra", {}, void 0, !0),
1933
+ (d(!0), S(K, null, se(m.value, (b) => (d(), L(a(de), {
1934
+ key: b.key,
1935
+ class: ve(["wx-screen-head__button", { "is-primary": b.primary }]),
1936
+ type: b.primary ? "primary" : "default",
1937
+ variant: b.primary ? "solid" : b.variant ?? "outline",
1938
+ loading: b.loading,
1939
+ disabled: b.disabled,
1940
+ href: b.href,
1941
+ target: b.href ? b.target ?? "_blank" : void 0,
1942
+ rel: b.href ? "noopener" : void 0,
1943
+ onClick: (P) => b.run?.()
1944
+ }, Ie({
1945
+ default: w(() => [
1946
+ R(" " + C(b.label), 1)
1947
1947
  ]),
1948
1948
  _: 2
1949
1949
  }, [
1950
- S.icon ? {
1950
+ b.icon ? {
1951
1951
  name: "icon",
1952
- fn: g(() => [
1953
- x(a(ot), {
1954
- name: S.icon
1952
+ fn: w(() => [
1953
+ x(a(st), {
1954
+ name: b.icon
1955
1955
  }, null, 8, ["name"])
1956
1956
  ]),
1957
1957
  key: "0"
1958
1958
  } : void 0
1959
1959
  ]), 1032, ["class", "type", "variant", "loading", "disabled", "href", "target", "rel", "onClick"]))), 128)),
1960
- c.value.length > 0 ? (d(), W(it, {
1960
+ u.value.length > 0 ? (d(), L(rt, {
1961
1961
  key: 0,
1962
- actions: c.value,
1962
+ actions: u.value,
1963
1963
  size: "lg",
1964
1964
  label: e.title ?? a(n)("editor.more")
1965
- }, null, 8, ["actions", "label"])) : U("", !0)
1966
- ])) : U("", !0)
1965
+ }, null, 8, ["actions", "label"])) : E("", !0)
1966
+ ])) : E("", !0)
1967
1967
  ], 10, cn));
1968
1968
  }
1969
- }), Ot = /* @__PURE__ */ se(pn, [["__scopeId", "data-v-9ebd5372"]]), hn = ["data-wx-fill"], yn = /* @__PURE__ */ K({
1969
+ }), Pt = /* @__PURE__ */ oe(pn, [["__scopeId", "data-v-9ebd5372"]]), hn = ["data-wx-fill"], yn = /* @__PURE__ */ q({
1970
1970
  __name: "ListScreen",
1971
1971
  props: /* @__PURE__ */ me({
1972
1972
  title: { default: void 0 },
@@ -1986,11 +1986,11 @@ const Ma = { class: "wx-history" }, Oa = {
1986
1986
  emits: ["update:view"],
1987
1987
  setup(e) {
1988
1988
  const t = ge(e, "view");
1989
- return (l, s) => (d(), $("div", {
1989
+ return (l, s) => (d(), S("div", {
1990
1990
  class: ve(["wx-list-screen", { "is-fill": e.fill }]),
1991
1991
  "data-wx-fill": e.fill ? "" : void 0
1992
1992
  }, [
1993
- e.title || e.actions || l.$slots.actions ? (d(), W(Ot, {
1993
+ e.title || e.actions || l.$slots.actions ? (d(), L(Pt, {
1994
1994
  key: 0,
1995
1995
  class: "wx-list-screen__head",
1996
1996
  title: e.title,
@@ -1999,16 +1999,16 @@ const Ma = { class: "wx-history" }, Oa = {
1999
1999
  "back-label": e.backLabel,
2000
2000
  actions: e.actions,
2001
2001
  "collapse-below": 480
2002
- }, Re({ _: 2 }, [
2002
+ }, Ie({ _: 2 }, [
2003
2003
  l.$slots.actions ? {
2004
2004
  name: "extra",
2005
- fn: g(() => [
2006
- oe(l.$slots, "actions", {}, void 0, !0)
2005
+ fn: w(() => [
2006
+ ne(l.$slots, "actions", {}, void 0, !0)
2007
2007
  ]),
2008
2008
  key: "0"
2009
2009
  } : void 0
2010
- ]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : U("", !0),
2011
- e.views && e.views.length > 0 ? (d(), W(a(fl), {
2010
+ ]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : E("", !0),
2011
+ e.views && e.views.length > 0 ? (d(), L(a(fl), {
2012
2012
  key: 1,
2013
2013
  modelValue: t.value,
2014
2014
  "onUpdate:modelValue": s[0] || (s[0] = (n) => t.value = n),
@@ -2017,39 +2017,39 @@ const Ma = { class: "wx-history" }, Oa = {
2017
2017
  "collapse-below": e.collapseBelow,
2018
2018
  "aria-label": e.title
2019
2019
  }, {
2020
- default: g(() => [
2021
- e.card ? (d(), W(a(Je), {
2020
+ default: w(() => [
2021
+ e.card ? (d(), L(a(Je), {
2022
2022
  key: 0,
2023
2023
  class: "wx-list-screen__card",
2024
2024
  padding: e.padding
2025
2025
  }, {
2026
- default: g(() => [
2027
- oe(l.$slots, "default", {}, void 0, !0)
2026
+ default: w(() => [
2027
+ ne(l.$slots, "default", {}, void 0, !0)
2028
2028
  ]),
2029
2029
  _: 3
2030
- }, 8, ["padding"])) : oe(l.$slots, "default", {}, void 0, !0, 1)
2030
+ }, 8, ["padding"])) : ne(l.$slots, "default", {}, void 0, !0, 1)
2031
2031
  ]),
2032
2032
  _: 3
2033
- }, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (d(), $(j, { key: 2 }, [
2034
- e.card ? (d(), W(a(Je), {
2033
+ }, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (d(), S(K, { key: 2 }, [
2034
+ e.card ? (d(), L(a(Je), {
2035
2035
  key: 0,
2036
2036
  class: "wx-list-screen__card",
2037
2037
  padding: e.padding
2038
2038
  }, {
2039
- default: g(() => [
2040
- oe(l.$slots, "default", {}, void 0, !0)
2039
+ default: w(() => [
2040
+ ne(l.$slots, "default", {}, void 0, !0)
2041
2041
  ]),
2042
2042
  _: 3
2043
- }, 8, ["padding"])) : oe(l.$slots, "default", {}, void 0, !0, 1)
2043
+ }, 8, ["padding"])) : ne(l.$slots, "default", {}, void 0, !0, 1)
2044
2044
  ], 64))
2045
2045
  ], 10, hn));
2046
2046
  }
2047
- }), Pt = /* @__PURE__ */ se(yn, [["__scopeId", "data-v-8c7e5ad1"]]), gn = /* @__PURE__ */ K({
2047
+ }), Ot = /* @__PURE__ */ oe(yn, [["__scopeId", "data-v-8c7e5ad1"]]), gn = /* @__PURE__ */ q({
2048
2048
  name: "WxRichTextField",
2049
2049
  inheritAttrs: !1,
2050
2050
  __name: "RichTextField",
2051
2051
  setup(e) {
2052
- const t = te(), l = J("webx-admin"), s = b(() => t.pickImage ?? void 0), n = b(() => ({
2052
+ const t = ee(), l = J("webx-admin"), s = _(() => t.pickImage ?? void 0), n = _(() => ({
2053
2053
  bold: l("rich-text.bold"),
2054
2054
  italic: l("rich-text.italic"),
2055
2055
  strike: l("rich-text.strike"),
@@ -2082,171 +2082,171 @@ const Ma = { class: "wx-history" }, Oa = {
2082
2082
  cancel: l("rich-text.cancel"),
2083
2083
  uploading: l("rich-text.uploading")
2084
2084
  }));
2085
- return (i, o) => (d(), W(a(ml), et(i.$attrs, {
2085
+ return (i, o) => (d(), L(a(ml), et(i.$attrs, {
2086
2086
  labels: n.value,
2087
2087
  "pick-image": s.value
2088
2088
  }), null, 16, ["labels", "pick-image"]));
2089
2089
  }
2090
2090
  }), Bt = /* @__PURE__ */ Symbol("wx-record-address");
2091
2091
  function bn(e) {
2092
- Ue(Bt, e);
2092
+ Re(Bt, e);
2093
2093
  }
2094
2094
  function wn() {
2095
2095
  return fe(Bt, null);
2096
2096
  }
2097
- const _n = { class: "wx-slug" }, xn = { class: "wx-slug__prefix" }, kn = /* @__PURE__ */ K({
2097
+ const _n = { class: "wx-slug" }, xn = { class: "wx-slug__prefix" }, kn = /* @__PURE__ */ q({
2098
2098
  name: "WxSlugField",
2099
2099
  inheritAttrs: !1,
2100
2100
  __name: "SlugField",
2101
2101
  setup(e) {
2102
- const t = wn(), l = zt(), s = b(() => {
2102
+ const t = wn(), l = zt(), s = _(() => {
2103
2103
  const o = t?.prefix.value ?? "";
2104
2104
  return o === "" ? "/" : `/${o}/`;
2105
- }), n = b(() => {
2105
+ }), n = _(() => {
2106
2106
  const o = t?.values.value.slug;
2107
2107
  return typeof o == "string" ? o : o?.[l.active.value] ?? "";
2108
- }), i = b(() => {
2108
+ }), i = _(() => {
2109
2109
  const o = t?.path.value;
2110
2110
  return typeof o == "string" && n.value !== "" && `${s.value}${n.value}` != `/${o}`;
2111
2111
  });
2112
- return (o, r) => (d(), $("div", _n, [
2113
- x(a(Se), Xt(Jt(o.$attrs)), {
2114
- prefix: g(() => [
2112
+ return (o, r) => (d(), S("div", _n, [
2113
+ x(a(Te), Xt(Jt(o.$attrs)), {
2114
+ prefix: w(() => [
2115
2115
  M("span", xn, C(s.value), 1)
2116
2116
  ]),
2117
2117
  _: 1
2118
2118
  }, 16),
2119
- i.value && a(t) ? (d(), W(a(Pe), {
2119
+ i.value && a(t) ? (d(), L(a(Oe), {
2120
2120
  key: 0,
2121
2121
  type: "info",
2122
2122
  variant: "soft",
2123
2123
  description: a(t).moving()
2124
- }, null, 8, ["description"])) : U("", !0)
2124
+ }, null, 8, ["description"])) : E("", !0)
2125
2125
  ]));
2126
2126
  }
2127
- }), wt = /* @__PURE__ */ se(kn, [["__scopeId", "data-v-5921c0dd"]]), $n = {
2128
- "wx-list": { component: Pt, kind: "layout", labelProp: "title" },
2127
+ }), _t = /* @__PURE__ */ oe(kn, [["__scopeId", "data-v-5921c0dd"]]), $n = {
2128
+ "wx-list": { component: Ot, kind: "layout", labelProp: "title" },
2129
2129
  // Full width: an editor shares a row with nothing, and a form of two columns would give it
2130
2130
  // half a line to write a page of text in.
2131
2131
  "wx-rich-text": { component: gn, kind: "field", wide: !0 },
2132
2132
  // Wide as well: a row of the picker is a segmented switch, a section and a search box, and half
2133
2133
  // a form's width leaves the search box too narrow to read a page title in.
2134
2134
  "wx-link": { component: Wa, kind: "field", wide: !0 },
2135
- "wx-categories": { component: Pl, kind: "field" },
2135
+ "wx-categories": { component: Ol, kind: "field" },
2136
2136
  "wx-select": { component: Bl, kind: "field" },
2137
2137
  // Wide: four controls in a column, and half a line leaves the category chips one to a row.
2138
2138
  "wx-collection": { component: ga, kind: "field", wide: !0 },
2139
2139
  // Wide: a row carries a picture, a name with a line under it and a mark, and the search box
2140
2140
  // under the list reads titles.
2141
2141
  "wx-relations": { component: Nt, kind: "field", wide: !0 },
2142
- "wx-slug": { component: wt, kind: "field" },
2143
- "wx-category-slug": { component: wt, kind: "field" },
2142
+ "wx-slug": { component: _t, kind: "field" },
2143
+ "wx-category-slug": { component: _t, kind: "field" },
2144
2144
  // The node's label is the feed's heading; inside a tab that already names it, `props.title: ""`.
2145
2145
  "wx-history": { component: sn, kind: "display", labelProp: "title" }
2146
2146
  }, Dt = /* @__PURE__ */ Symbol("webx-admin");
2147
- function te() {
2147
+ function ee() {
2148
2148
  const e = fe(Dt, null);
2149
2149
  if (e === null)
2150
2150
  throw new Error("useAdmin() was called outside a panel created by createAdmin().");
2151
2151
  return e;
2152
2152
  }
2153
2153
  function Sn(e) {
2154
- const t = ze({
2154
+ const t = Ve({
2155
2155
  status: "loading",
2156
2156
  manifest: null,
2157
2157
  user: null,
2158
2158
  error: null
2159
- }), l = b(() => {
2160
- const h = t.manifest;
2161
- if (h === null)
2159
+ }), l = _(() => {
2160
+ const f = t.manifest;
2161
+ if (f === null)
2162
2162
  return [];
2163
- const y = [];
2164
- for (const p of h.modules) {
2165
- const _ = e.modules.find((F) => F.id === p.id);
2166
- if (_ === void 0)
2163
+ const k = [];
2164
+ for (const p of f.modules) {
2165
+ const $ = e.modules.find((P) => P.id === p.id);
2166
+ if ($ === void 0)
2167
2167
  continue;
2168
- const S = _.path ?? _.routes?.[0]?.path;
2169
- S !== void 0 && y.push({
2168
+ const b = $.path ?? $.routes?.[0]?.path;
2169
+ b !== void 0 && k.push({
2170
2170
  id: p.id,
2171
2171
  title: p.title,
2172
2172
  icon: p.icon,
2173
- path: S,
2173
+ path: b,
2174
2174
  group: p.group ?? null,
2175
2175
  section: p.section ?? null
2176
2176
  });
2177
2177
  }
2178
- return y;
2179
- }), s = b(() => {
2180
- const h = t.manifest?.groups ?? [], y = [], p = /* @__PURE__ */ new Map();
2181
- for (const _ of l.value)
2182
- if (_.group !== null && h.some((S) => S.id === _.group)) {
2183
- const S = p.get(_.group) ?? [];
2184
- S.push(_), p.set(_.group, S);
2178
+ return k;
2179
+ }), s = _(() => {
2180
+ const f = t.manifest?.groups ?? [], k = [], p = /* @__PURE__ */ new Map();
2181
+ for (const $ of l.value)
2182
+ if ($.group !== null && f.some((b) => b.id === $.group)) {
2183
+ const b = p.get($.group) ?? [];
2184
+ b.push($), p.set($.group, b);
2185
2185
  } else
2186
- y.push(_);
2186
+ k.push($);
2187
2187
  return {
2188
- top: y,
2189
- groups: h.filter((_) => p.has(_.id)).map((_) => {
2190
- const S = p.get(_.id) ?? [], F = _.sections ?? [], Y = (D) => F.some((L) => L.id === D.section);
2188
+ top: k,
2189
+ groups: f.filter(($) => p.has($.id)).map(($) => {
2190
+ const b = p.get($.id) ?? [], P = $.sections ?? [], H = (j) => P.some((F) => F.id === j.section);
2191
2191
  return {
2192
- id: _.id,
2193
- title: _.title,
2194
- icon: _.icon ?? null,
2195
- entries: S.filter((D) => !Y(D)),
2196
- sections: F.map((D) => ({
2197
- id: D.id,
2198
- title: D.title,
2199
- entries: S.filter((L) => L.section === D.id)
2200
- })).filter((D) => D.entries.length > 0)
2192
+ id: $.id,
2193
+ title: $.title,
2194
+ icon: $.icon ?? null,
2195
+ entries: b.filter((j) => !H(j)),
2196
+ sections: P.map((j) => ({
2197
+ id: j.id,
2198
+ title: j.title,
2199
+ entries: b.filter((F) => F.section === j.id)
2200
+ })).filter((j) => j.entries.length > 0)
2201
2201
  };
2202
2202
  })
2203
2203
  };
2204
2204
  }), n = { ...$n };
2205
- for (const h of e.modules)
2206
- Object.assign(n, h.types);
2205
+ for (const f of e.modules)
2206
+ Object.assign(n, f.types);
2207
2207
  Object.assign(n, e.types);
2208
- const i = e.modules.find((h) => h.pickImage !== void 0)?.pickImage, o = /* @__PURE__ */ new Map();
2209
- async function r(h) {
2210
- const y = `${e.i18n.state.locale}:${h}`;
2211
- let p = o.get(y);
2212
- return p === void 0 && (p = e.http.get(`${e.apiPath}/screens/${h}`).then((_) => _.data.root).catch((_) => {
2213
- throw o.delete(y), _;
2214
- }), o.set(y, p)), p;
2208
+ const i = e.modules.find((f) => f.pickImage !== void 0)?.pickImage, o = /* @__PURE__ */ new Map();
2209
+ async function r(f) {
2210
+ const k = `${e.i18n.state.locale}:${f}`;
2211
+ let p = o.get(k);
2212
+ return p === void 0 && (p = e.http.get(`${e.apiPath}/screens/${f}`).then(($) => $.data.root).catch(($) => {
2213
+ throw o.delete(k), $;
2214
+ }), o.set(k, p)), p;
2215
2215
  }
2216
- let u = null;
2217
- async function m() {
2216
+ let c = null;
2217
+ async function v() {
2218
2218
  t.status = "loading", t.error = null;
2219
2219
  try {
2220
- if (u !== null && (t.user = await u(), f(t.user), t.user === null)) {
2220
+ if (c !== null && (t.user = await c(), m(t.user), t.user === null)) {
2221
2221
  t.manifest = null, t.status = "unauthenticated";
2222
2222
  return;
2223
2223
  }
2224
- const h = await e.loadManifest();
2225
- t.manifest = h, e.i18n.state.contentLocales = h.locales ?? [], e.i18n.state.panelLocales = h.panelLocales ?? e.i18n.state.panelLocales, h.locale !== void 0 && h.locale !== e.i18n.state.locale && await c(h.locale), t.status = "ready";
2226
- } catch (h) {
2227
- if (Cn(h)) {
2224
+ const f = await e.loadManifest();
2225
+ t.manifest = f, e.i18n.state.contentLocales = f.locales ?? [], e.i18n.state.panelLocales = f.panelLocales ?? e.i18n.state.panelLocales, f.locale !== void 0 && f.locale !== e.i18n.state.locale && await u(f.locale), t.status = "ready";
2226
+ } catch (f) {
2227
+ if (Cn(f)) {
2228
2228
  t.manifest = null, t.user = null, t.status = "unauthenticated";
2229
2229
  return;
2230
2230
  }
2231
- t.error = h instanceof Error ? h.message : String(h), t.status = "error";
2231
+ t.error = f instanceof Error ? f.message : String(f), t.status = "error";
2232
2232
  }
2233
2233
  }
2234
- async function v() {
2234
+ async function h() {
2235
2235
  if (t.manifest !== null)
2236
2236
  try {
2237
2237
  t.manifest = await e.loadManifest();
2238
2238
  } catch {
2239
2239
  }
2240
2240
  }
2241
- function f(h) {
2242
- h !== null && e.theme?.adopt(h.theme);
2241
+ function m(f) {
2242
+ f !== null && e.theme?.adopt(f.theme);
2243
2243
  }
2244
- async function c(h) {
2244
+ async function u(f) {
2245
2245
  if (e.loadDictionary === void 0) {
2246
- e.i18n.state.locale = h;
2246
+ e.i18n.state.locale = f;
2247
2247
  return;
2248
2248
  }
2249
- await e.loadDictionary(h), await v();
2249
+ await e.loadDictionary(f), await h();
2250
2250
  }
2251
2251
  return {
2252
2252
  http: e.http,
@@ -2259,22 +2259,22 @@ function Sn(e) {
2259
2259
  groups: s,
2260
2260
  types: n,
2261
2261
  pickImage: i ?? null,
2262
- reload: m,
2263
- refreshManifest: v,
2264
- setLocale: c,
2265
- setUser(h) {
2266
- t.user = h, f(h);
2262
+ reload: v,
2263
+ refreshManifest: h,
2264
+ setLocale: u,
2265
+ setUser(f) {
2266
+ t.user = f, m(f);
2267
2267
  },
2268
- useSessionLoader(h) {
2269
- u = h;
2268
+ useSessionLoader(f) {
2269
+ c = f;
2270
2270
  },
2271
- can(h) {
2272
- const y = t.user;
2273
- return y === null ? !1 : y.isSuper || y.permissions.includes(h);
2271
+ can(f) {
2272
+ const k = t.user;
2273
+ return k === null ? !1 : k.isSuper || k.permissions.includes(f);
2274
2274
  },
2275
2275
  loadScreen: r,
2276
- screenPatch(h) {
2277
- return e.screens?.[h] ?? [];
2276
+ screenPatch(f) {
2277
+ return e.screens?.[f] ?? [];
2278
2278
  }
2279
2279
  };
2280
2280
  }
@@ -2284,87 +2284,94 @@ function Tn(e, t) {
2284
2284
  function Cn(e) {
2285
2285
  return typeof e == "object" && e !== null && "status" in e && e.status === 401;
2286
2286
  }
2287
- const An = /* @__PURE__ */ K({
2287
+ const An = /* @__PURE__ */ q({
2288
2288
  __name: "AdminLanding",
2289
2289
  props: {
2290
2290
  landing: { default: null }
2291
2291
  },
2292
2292
  setup(e) {
2293
- const t = e, l = te(), s = Me(), n = J("webx-admin"), i = b(() => {
2293
+ const t = e, l = ee(), s = Me(), n = J("webx-admin"), i = _(() => {
2294
2294
  const o = l.nav.value;
2295
- return o.length === 0 ? null : ((t.landing === null ? void 0 : o.find((u) => u.path === t.landing)) ?? o[0])?.path ?? null;
2295
+ return o.length === 0 ? null : ((t.landing === null ? void 0 : o.find((c) => c.path === t.landing)) ?? o[0])?.path ?? null;
2296
2296
  });
2297
- return re(
2297
+ return ie(
2298
2298
  i,
2299
2299
  (o) => {
2300
2300
  o !== null && s.replace(o);
2301
2301
  },
2302
2302
  { immediate: !0 }
2303
- ), (o, r) => i.value === null && a(l).state.status === "ready" ? (d(), W(a(vl), {
2303
+ ), (o, r) => i.value === null && a(l).state.status === "ready" ? (d(), L(a(vl), {
2304
2304
  key: 0,
2305
2305
  status: "info",
2306
2306
  title: a(n)("shell.empty-title"),
2307
2307
  description: a(n)("shell.empty-description")
2308
- }, null, 8, ["title", "description"])) : U("", !0);
2308
+ }, null, 8, ["title", "description"])) : E("", !0);
2309
2309
  }
2310
- }), Wn = /* @__PURE__ */ K({
2310
+ }), Wn = /* @__PURE__ */ q({
2311
2311
  __name: "AdminNav",
2312
2312
  props: {
2313
2313
  collapsed: { type: Boolean }
2314
2314
  },
2315
2315
  emits: ["select"],
2316
2316
  setup(e, { emit: t }) {
2317
- const l = t, s = te(), n = J("webx-admin"), i = Me(), o = At(), r = b({
2317
+ const l = t, s = ee(), n = J("webx-admin"), i = Me(), o = At(), r = _({
2318
2318
  /*
2319
2319
  * The longest path that contains this one, on a segment boundary: a section may live inside
2320
2320
  * another's path (`/services/categories` under `/services`), and the first match in the order
2321
2321
  * of the menu would light up the outer one.
2322
2322
  */
2323
- get: () => s.nav.value.filter((m) => o.path === m.path || o.path.startsWith(`${m.path}/`)).sort((m, v) => v.path.length - m.path.length)[0]?.id ?? "",
2324
- set: (u) => {
2325
- const m = s.nav.value.find((v) => v.id === u);
2326
- m !== void 0 && i.push(m.path);
2323
+ get: () => s.nav.value.filter((u) => o.path === u.path || o.path.startsWith(`${u.path}/`)).sort((u, f) => f.path.length - u.path.length)[0]?.id ?? "",
2324
+ set: (m) => {
2325
+ const u = s.nav.value.find((f) => f.id === m);
2326
+ u !== void 0 && i.push(u.path);
2327
2327
  }
2328
- });
2329
- return (u, m) => {
2330
- const v = ne("wx-menu-item"), f = ne("wx-menu-group"), c = ne("wx-submenu"), h = ne("wx-menu");
2331
- return d(), W(h, {
2328
+ }), c = lt("root");
2329
+ let v = !1;
2330
+ async function h() {
2331
+ const m = c.value?.$el;
2332
+ v || r.value === "" || !(m instanceof HTMLElement) || (v = !0, await Promise.allSettled((m.getAnimations?.({ subtree: !0 }) ?? []).map((u) => u.finished)), m.querySelector(".wx-menu-row.is-active")?.scrollIntoView?.({ block: "center" }));
2333
+ }
2334
+ return Se(h), ie(r, h, { flush: "post" }), (m, u) => {
2335
+ const f = ae("wx-menu-item"), k = ae("wx-menu-group"), p = ae("wx-submenu"), $ = ae("wx-menu");
2336
+ return d(), L($, {
2337
+ ref_key: "root",
2338
+ ref: c,
2332
2339
  modelValue: r.value,
2333
- "onUpdate:modelValue": m[0] || (m[0] = (y) => r.value = y),
2340
+ "onUpdate:modelValue": u[0] || (u[0] = (b) => r.value = b),
2334
2341
  collapsed: e.collapsed,
2335
2342
  label: a(n)("nav.sections"),
2336
- onSelect: m[1] || (m[1] = (y) => l("select"))
2343
+ onSelect: u[1] || (u[1] = (b) => l("select"))
2337
2344
  }, {
2338
- default: g(() => [
2339
- (d(!0), $(j, null, ie(a(s).groups.value.top, (y) => (d(), W(v, {
2340
- key: y.id,
2341
- value: y.id,
2342
- icon: y.icon ?? void 0,
2343
- label: y.title
2345
+ default: w(() => [
2346
+ (d(!0), S(K, null, se(a(s).groups.value.top, (b) => (d(), L(f, {
2347
+ key: b.id,
2348
+ value: b.id,
2349
+ icon: b.icon ?? void 0,
2350
+ label: b.title
2344
2351
  }, null, 8, ["value", "icon", "label"]))), 128)),
2345
- (d(!0), $(j, null, ie(a(s).groups.value.groups, (y) => (d(), W(c, {
2346
- key: y.id,
2347
- value: `group:${y.id}`,
2348
- title: y.title,
2349
- icon: y.icon ?? "gear"
2352
+ (d(!0), S(K, null, se(a(s).groups.value.groups, (b) => (d(), L(p, {
2353
+ key: b.id,
2354
+ value: `group:${b.id}`,
2355
+ title: b.title,
2356
+ icon: b.icon ?? "gear"
2350
2357
  }, {
2351
- default: g(() => [
2352
- (d(!0), $(j, null, ie(y.entries, (p) => (d(), W(v, {
2353
- key: p.id,
2354
- value: p.id,
2355
- icon: p.icon ?? void 0,
2356
- label: p.title
2358
+ default: w(() => [
2359
+ (d(!0), S(K, null, se(b.entries, (P) => (d(), L(f, {
2360
+ key: P.id,
2361
+ value: P.id,
2362
+ icon: P.icon ?? void 0,
2363
+ label: P.title
2357
2364
  }, null, 8, ["value", "icon", "label"]))), 128)),
2358
- (d(!0), $(j, null, ie(y.sections, (p) => (d(), W(f, {
2359
- key: p.id,
2360
- title: p.title
2365
+ (d(!0), S(K, null, se(b.sections, (P) => (d(), L(k, {
2366
+ key: P.id,
2367
+ title: P.title
2361
2368
  }, {
2362
- default: g(() => [
2363
- (d(!0), $(j, null, ie(p.entries, (_) => (d(), W(v, {
2364
- key: _.id,
2365
- value: _.id,
2366
- icon: _.icon ?? void 0,
2367
- label: _.title
2369
+ default: w(() => [
2370
+ (d(!0), S(K, null, se(P.entries, (H) => (d(), L(f, {
2371
+ key: H.id,
2372
+ value: H.id,
2373
+ icon: H.icon ?? void 0,
2374
+ label: H.title
2368
2375
  }, null, 8, ["value", "icon", "label"]))), 128))
2369
2376
  ]),
2370
2377
  _: 2
@@ -2386,39 +2393,39 @@ const An = /* @__PURE__ */ K({
2386
2393
  }, Vn = {
2387
2394
  key: 2,
2388
2395
  class: "wx-root wx-admin-plain"
2389
- }, Nn = ["src", "alt", "width", "height"], En = ["src", "alt", "width", "height"], Un = ["src", "alt"], Rn = { class: "wx-admin__user" }, In = { class: "wx-admin__user wx-admin__user--drawer" }, Mn = /* @__PURE__ */ K({
2396
+ }, Nn = ["src", "alt", "width", "height"], En = ["src", "alt", "width", "height"], Un = ["src", "alt"], Rn = { class: "wx-admin__user" }, In = { class: "wx-admin__user wx-admin__user--drawer" }, Mn = /* @__PURE__ */ q({
2390
2397
  __name: "AdminShell",
2391
2398
  setup(e) {
2392
- const t = te(), l = J("webx-admin"), s = A(null), { width: n, layout: i, collapsed: o, showAside: r, drawerOpen: u, toggle: m, close: v } = pl(
2399
+ const t = ee(), l = J("webx-admin"), s = A(null), { width: n, layout: i, collapsed: o, showAside: r, drawerOpen: c, toggle: v, close: h } = pl(
2393
2400
  s,
2394
2401
  { persist: "webx-admin-shell" }
2395
- ), f = b(() => t.state.manifest?.title ?? ""), c = b(() => t.state.manifest?.branding?.logo ?? null), h = b(() => t.state.manifest?.branding?.mark ?? null), y = b(() => hl(n.value, null));
2402
+ ), m = _(() => t.state.manifest?.title ?? ""), u = _(() => t.state.manifest?.branding?.logo ?? null), f = _(() => t.state.manifest?.branding?.mark ?? null), k = _(() => hl(n.value, null));
2396
2403
  return Gt(() => {
2397
- typeof document > "u" || (document.documentElement.dataset.wxShell = y.value);
2404
+ typeof document > "u" || (document.documentElement.dataset.wxShell = k.value);
2398
2405
  }), Qt(() => {
2399
2406
  typeof document < "u" && delete document.documentElement.dataset.wxShell;
2400
- }), (p, _) => {
2401
- const S = ne("router-view"), F = ne("wx-loading"), Y = ne("wx-button"), D = ne("wx-result"), L = ne("wx-action"), T = ne("wx-text"), z = ne("wx-header"), k = ne("wx-aside"), H = ne("wx-main"), V = ne("wx-container"), I = ne("wx-drawer");
2402
- return d(), $(j, null, [
2407
+ }), (p, $) => {
2408
+ const b = ae("router-view"), P = ae("wx-loading"), H = ae("wx-button"), j = ae("wx-result"), F = ae("wx-action"), y = ae("wx-text"), W = ae("wx-header"), T = ae("wx-aside"), I = ae("wx-main"), V = ae("wx-container"), U = ae("wx-drawer");
2409
+ return d(), S(K, null, [
2403
2410
  x(a(yl), { placement: "bottom-center" }),
2404
- a(t).state.status === "unauthenticated" ? (d(), $("div", Ln, [
2405
- x(S)
2406
- ])) : a(t).state.status === "loading" ? (d(), $("div", zn, [
2407
- x(F, {
2411
+ a(t).state.status === "unauthenticated" ? (d(), S("div", Ln, [
2412
+ x(b)
2413
+ ])) : a(t).state.status === "loading" ? (d(), S("div", zn, [
2414
+ x(P, {
2408
2415
  label: a(l)("shell.loading")
2409
2416
  }, null, 8, ["label"])
2410
- ])) : a(t).state.status === "error" ? (d(), $("div", Vn, [
2411
- x(D, {
2417
+ ])) : a(t).state.status === "error" ? (d(), S("div", Vn, [
2418
+ x(j, {
2412
2419
  status: "error",
2413
2420
  title: a(l)("shell.error-title"),
2414
2421
  description: a(t).state.error
2415
2422
  }, {
2416
- default: g(() => [
2417
- x(Y, {
2423
+ default: w(() => [
2424
+ x(H, {
2418
2425
  type: "primary",
2419
- onClick: _[0] || (_[0] = (O) => a(t).reload())
2426
+ onClick: $[0] || ($[0] = (O) => a(t).reload())
2420
2427
  }, {
2421
- default: g(() => [
2428
+ default: w(() => [
2422
2429
  R(C(a(l)("shell.retry")), 1)
2423
2430
  ]),
2424
2431
  _: 1
@@ -2426,19 +2433,19 @@ const An = /* @__PURE__ */ K({
2426
2433
  ]),
2427
2434
  _: 1
2428
2435
  }, 8, ["title", "description"])
2429
- ])) : (d(), $("div", {
2436
+ ])) : (d(), S("div", {
2430
2437
  key: 3,
2431
2438
  ref_key: "shellEl",
2432
2439
  ref: s,
2433
- class: ve(["wx-root wx-admin", `wx-admin--${y.value}`])
2440
+ class: ve(["wx-root wx-admin", `wx-admin--${k.value}`])
2434
2441
  }, [
2435
2442
  x(V, {
2436
2443
  direction: a(i) === "drawer" ? "vertical" : "horizontal",
2437
2444
  "full-height": "",
2438
2445
  class: "wx-admin__frame"
2439
2446
  }, {
2440
- default: g(() => [
2441
- a(i) === "drawer" ? (d(), W(z, {
2447
+ default: w(() => [
2448
+ a(i) === "drawer" ? (d(), L(W, {
2442
2449
  key: 0,
2443
2450
  class: "wx-admin__header",
2444
2451
  floating: "",
@@ -2447,38 +2454,38 @@ const An = /* @__PURE__ */ K({
2447
2454
  padding: "sm",
2448
2455
  height: "var(--wx-admin-header-height)"
2449
2456
  }, {
2450
- end: g(() => [
2451
- oe(p.$slots, "user", { expanded: !1 }, void 0, !0)
2457
+ end: w(() => [
2458
+ ne(p.$slots, "user", { expanded: !1 }, void 0, !0)
2452
2459
  ]),
2453
- default: g(() => [
2454
- x(L, {
2460
+ default: w(() => [
2461
+ x(F, {
2455
2462
  icon: "menu",
2456
2463
  title: a(l)("nav.menu"),
2457
- onClick: a(m)
2464
+ onClick: a(v)
2458
2465
  }, null, 8, ["title", "onClick"]),
2459
- oe(p.$slots, "brand", {}, () => [
2460
- c.value ? (d(), $("img", {
2466
+ ne(p.$slots, "brand", {}, () => [
2467
+ u.value ? (d(), S("img", {
2461
2468
  key: 0,
2462
2469
  class: "wx-admin__logo",
2463
- src: c.value.url,
2464
- alt: f.value,
2465
- width: c.value.width ?? void 0,
2466
- height: c.value.height ?? void 0
2467
- }, null, 8, Nn)) : (d(), W(T, {
2470
+ src: u.value.url,
2471
+ alt: m.value,
2472
+ width: u.value.width ?? void 0,
2473
+ height: u.value.height ?? void 0
2474
+ }, null, 8, Nn)) : (d(), L(y, {
2468
2475
  key: 1,
2469
2476
  weight: "semibold",
2470
2477
  truncate: ""
2471
2478
  }, {
2472
- default: g(() => [
2473
- R(C(f.value), 1)
2479
+ default: w(() => [
2480
+ R(C(m.value), 1)
2474
2481
  ]),
2475
2482
  _: 1
2476
2483
  }))
2477
2484
  ], !0)
2478
2485
  ]),
2479
2486
  _: 3
2480
- })) : U("", !0),
2481
- a(r) ? (d(), W(k, {
2487
+ })) : E("", !0),
2488
+ a(r) ? (d(), L(T, {
2482
2489
  key: 1,
2483
2490
  class: "wx-admin__aside",
2484
2491
  sticky: "",
@@ -2489,85 +2496,85 @@ const An = /* @__PURE__ */ K({
2489
2496
  width: 220,
2490
2497
  "collapsed-width": 56
2491
2498
  }, {
2492
- top: g(() => [
2499
+ top: w(() => [
2493
2500
  M("div", {
2494
- class: ve(["wx-admin__brand", { "wx-admin__brand--stacked": a(o) && h.value }])
2501
+ class: ve(["wx-admin__brand", { "wx-admin__brand--stacked": a(o) && f.value }])
2495
2502
  }, [
2496
- a(o) ? h.value ? (d(), $("img", {
2503
+ a(o) ? f.value ? (d(), S("img", {
2497
2504
  key: 1,
2498
2505
  class: "wx-admin__mark",
2499
- src: h.value.url,
2500
- alt: f.value
2501
- }, null, 8, Un)) : U("", !0) : oe(p.$slots, "brand", {}, () => [
2502
- c.value ? (d(), $("img", {
2506
+ src: f.value.url,
2507
+ alt: m.value
2508
+ }, null, 8, Un)) : E("", !0) : ne(p.$slots, "brand", {}, () => [
2509
+ u.value ? (d(), S("img", {
2503
2510
  key: 0,
2504
2511
  class: "wx-admin__logo",
2505
- src: c.value.url,
2506
- alt: f.value,
2507
- width: c.value.width ?? void 0,
2508
- height: c.value.height ?? void 0
2509
- }, null, 8, En)) : (d(), W(T, {
2512
+ src: u.value.url,
2513
+ alt: m.value,
2514
+ width: u.value.width ?? void 0,
2515
+ height: u.value.height ?? void 0
2516
+ }, null, 8, En)) : (d(), L(y, {
2510
2517
  key: 1,
2511
2518
  weight: "semibold",
2512
2519
  truncate: "",
2513
2520
  class: "wx-admin__title"
2514
2521
  }, {
2515
- default: g(() => [
2516
- R(C(f.value), 1)
2522
+ default: w(() => [
2523
+ R(C(m.value), 1)
2517
2524
  ]),
2518
2525
  _: 1
2519
2526
  }))
2520
2527
  ], !0, 0),
2521
- x(L, {
2528
+ x(F, {
2522
2529
  icon: "sidebar",
2523
2530
  title: a(o) ? a(l)("nav.expand") : a(l)("nav.collapse"),
2524
- onClick: a(m)
2531
+ onClick: a(v)
2525
2532
  }, null, 8, ["title", "onClick"])
2526
2533
  ], 2)
2527
2534
  ]),
2528
- bottom: g(() => [
2535
+ bottom: w(() => [
2529
2536
  M("div", Rn, [
2530
- oe(p.$slots, "user", {
2537
+ ne(p.$slots, "user", {
2531
2538
  expanded: !a(o)
2532
2539
  }, void 0, !0)
2533
2540
  ])
2534
2541
  ]),
2535
- default: g(() => [
2536
- oe(p.$slots, "nav", { collapsed: a(o) }, void 0, !0)
2542
+ default: w(() => [
2543
+ ne(p.$slots, "nav", { collapsed: a(o) }, void 0, !0)
2537
2544
  ]),
2538
2545
  _: 3
2539
- }, 8, ["collapsed"])) : U("", !0),
2540
- x(H, {
2546
+ }, 8, ["collapsed"])) : E("", !0),
2547
+ x(I, {
2541
2548
  padding: "none",
2542
2549
  class: "wx-admin__screen"
2543
2550
  }, {
2544
- default: g(() => [
2545
- x(S)
2551
+ default: w(() => [
2552
+ x(b)
2546
2553
  ]),
2547
2554
  _: 1
2548
2555
  })
2549
2556
  ]),
2550
2557
  _: 3
2551
2558
  }, 8, ["direction"]),
2552
- x(I, {
2553
- open: a(u),
2554
- "onUpdate:open": _[1] || (_[1] = (O) => Tt(u) ? u.value = O : null),
2559
+ x(U, {
2560
+ open: a(c),
2561
+ "onUpdate:open": $[1] || ($[1] = (O) => Tt(c) ? c.value = O : null),
2555
2562
  class: "wx-admin__drawer",
2556
- title: f.value === "" ? a(l)("nav.menu") : f.value,
2563
+ title: m.value === "" ? a(l)("nav.menu") : m.value,
2557
2564
  side: "left",
2558
2565
  size: 260,
2559
2566
  "full-screen": !1,
2560
2567
  closable: ""
2561
2568
  }, {
2562
- footer: g(() => [
2569
+ footer: w(() => [
2563
2570
  M("div", In, [
2564
- oe(p.$slots, "user", { expanded: !0 }, void 0, !0)
2571
+ ne(p.$slots, "user", { expanded: !0 }, void 0, !0)
2565
2572
  ])
2566
2573
  ]),
2567
- default: g(() => [
2568
- oe(p.$slots, "nav", {
2574
+ default: w(() => [
2575
+ ne(p.$slots, "nav", {
2569
2576
  collapsed: !1,
2570
- select: a(v)
2577
+ select: a(h)
2571
2578
  }, void 0, !0)
2572
2579
  ]),
2573
2580
  _: 3
@@ -2576,7 +2583,7 @@ const An = /* @__PURE__ */ K({
2576
2583
  ], 64);
2577
2584
  };
2578
2585
  }
2579
- }), On = /* @__PURE__ */ se(Mn, [["__scopeId", "data-v-819885ab"]]), Pn = "webx.theme", Ft = /* @__PURE__ */ Symbol("webx-theme");
2586
+ }), Pn = /* @__PURE__ */ oe(Mn, [["__scopeId", "data-v-819885ab"]]), On = "webx.theme", Ft = /* @__PURE__ */ Symbol("webx-theme");
2580
2587
  function Io() {
2581
2588
  const e = fe(Ft, null);
2582
2589
  if (e === null)
@@ -2587,7 +2594,7 @@ function Bn(e, t) {
2587
2594
  e.provide(Ft, t);
2588
2595
  }
2589
2596
  function Dn(e = {}) {
2590
- const t = e.storageKey === void 0 ? Pn : e.storageKey, l = ze({
2597
+ const t = e.storageKey === void 0 ? On : e.storageKey, l = Ve({
2591
2598
  preference: Fn(t) ?? "system",
2592
2599
  resolved: "light"
2593
2600
  });
@@ -2599,17 +2606,17 @@ function Dn(e = {}) {
2599
2606
  }), {
2600
2607
  state: l,
2601
2608
  set(n) {
2602
- l.preference = n, s(), _t(t, n);
2609
+ l.preference = n, s(), xt(t, n);
2603
2610
  },
2604
2611
  adopt(n) {
2605
2612
  if (n === void 0)
2606
2613
  return;
2607
2614
  const i = n ?? "system";
2608
- i !== l.preference && (l.preference = i, s(), _t(t, i));
2615
+ i !== l.preference && (l.preference = i, s(), xt(t, i));
2609
2616
  }
2610
2617
  };
2611
2618
  }
2612
- function _t(e, t) {
2619
+ function xt(e, t) {
2613
2620
  if (e !== null)
2614
2621
  try {
2615
2622
  localStorage.setItem(e, t);
@@ -2629,25 +2636,25 @@ function Fn(e) {
2629
2636
  const Ht = "webx.locale";
2630
2637
  function Mo(e = {}) {
2631
2638
  const t = e.manifestUrl ?? Xn() ?? "/api/cms/manifest", l = e.apiPath ?? t.replace(/\/manifest\/?$/, ""), s = e.basePath ?? "/cms", n = e.modules ?? [], i = [...e.routes ?? []];
2632
- for (const _ of n)
2633
- i.push(..._.routes ?? []);
2634
- if (!i.some((_) => _.path === "/")) {
2635
- const _ = n.find((S) => S.landing === !0);
2639
+ for (const $ of n)
2640
+ i.push(...$.routes ?? []);
2641
+ if (!i.some(($) => $.path === "/")) {
2642
+ const $ = n.find((b) => b.landing === !0);
2636
2643
  i.push({
2637
2644
  path: "/",
2638
2645
  name: "webx.home",
2639
2646
  component: An,
2640
- props: { landing: _?.path ?? _?.routes?.[0]?.path ?? null }
2647
+ props: { landing: $?.path ?? $?.routes?.[0]?.path ?? null }
2641
2648
  });
2642
2649
  }
2643
2650
  const o = al({
2644
2651
  history: nl(s),
2645
2652
  routes: i
2646
- }), r = st({ locale: e.locale ?? jn() }), u = Dn(), m = e.http ?? Fl({
2653
+ }), r = it({ locale: e.locale ?? jn() }), c = Dn(), v = e.http ?? Fl({
2647
2654
  baseUrl: "",
2648
2655
  csrfUrl: `${l}/auth/csrf-cookie`,
2649
2656
  onUnauthenticated: () => {
2650
- f.setUser(null), f.state.status = "unauthenticated";
2657
+ m.setUser(null), m.state.status = "unauthenticated";
2651
2658
  },
2652
2659
  // Every request says which language the panel is currently showing. It decides what
2653
2660
  // the server writes its own messages in — a 422 under a field — for anybody who has
@@ -2656,59 +2663,59 @@ function Mo(e = {}) {
2656
2663
  headers: () => ({ "X-Webx-Locale": r.state.locale })
2657
2664
  });
2658
2665
  r.defaults("webx-admin", Rt);
2659
- async function v(_) {
2660
- const S = await m.get(`${l}/translations/${_}`);
2661
- r.load(S.data.namespaces, S.data.locale, S.data.fallback), Kn(S.data.locale), Yn(S.data.locale, r.state.panelLocales);
2666
+ async function h($) {
2667
+ const b = await v.get(`${l}/translations/${$}`);
2668
+ r.load(b.data.namespaces, b.data.locale, b.data.fallback), Kn(b.data.locale), Yn(b.data.locale, r.state.panelLocales);
2662
2669
  }
2663
- const f = Sn({
2664
- http: m,
2665
- theme: u,
2670
+ const m = Sn({
2671
+ http: v,
2672
+ theme: c,
2666
2673
  basePath: s,
2667
2674
  apiPath: l,
2668
2675
  modules: n,
2669
2676
  i18n: r,
2670
- loadDictionary: v,
2677
+ loadDictionary: h,
2671
2678
  types: e.types,
2672
2679
  screens: e.screens,
2673
- loadManifest: async () => (await m.get(t)).data
2674
- }), c = Zt(Hn(e));
2675
- c.use(gl), Tn(c, f), El(c, r), Bn(c, u);
2676
- const h = A("");
2677
- c.provide(
2680
+ loadManifest: async () => (await v.get(t)).data
2681
+ }), u = Zt(Hn(e));
2682
+ u.use(gl), Tn(u, m), El(u, r), Bn(u, c);
2683
+ const f = A("");
2684
+ u.provide(
2678
2685
  bl,
2679
- b(() => r.state.locale)
2680
- ), c.provide(wl, {
2681
- list: b(
2682
- () => r.state.contentLocales.map((_) => ({
2683
- code: _.code,
2684
- label: _.code.toUpperCase()
2686
+ _(() => r.state.locale)
2687
+ ), u.provide(wl, {
2688
+ list: _(
2689
+ () => r.state.contentLocales.map(($) => ({
2690
+ code: $.code,
2691
+ label: $.code.toUpperCase()
2685
2692
  }))
2686
2693
  ),
2687
- active: b({
2688
- get: () => h.value || (r.state.contentLocales[0]?.code ?? ""),
2689
- set: (_) => {
2690
- h.value = _;
2694
+ active: _({
2695
+ get: () => f.value || (r.state.contentLocales[0]?.code ?? ""),
2696
+ set: ($) => {
2697
+ f.value = $;
2691
2698
  }
2692
2699
  })
2693
2700
  });
2694
- const y = {
2695
- app: c,
2701
+ const k = {
2702
+ app: u,
2696
2703
  router: o,
2697
- context: f,
2704
+ context: m,
2698
2705
  i18n: r,
2699
- theme: u,
2706
+ theme: c,
2700
2707
  async mount() {
2701
- await Promise.all([p(), v(r.state.locale)]).catch(() => {
2702
- }), c.mount(e.el ?? "#webx-app"), await f.reload();
2708
+ await Promise.all([p(), h(r.state.locale)]).catch(() => {
2709
+ }), u.mount(e.el ?? "#webx-app"), await m.reload();
2703
2710
  }
2704
2711
  };
2705
2712
  async function p() {
2706
- const _ = await m.get(`${l}/locales`);
2707
- r.state.panelLocales = _.data.panel, r.state.contentLocales = _.data.content;
2713
+ const $ = await v.get(`${l}/locales`);
2714
+ r.state.panelLocales = $.data.panel, r.state.contentLocales = $.data.content;
2708
2715
  }
2709
- for (const _ of e.plugins ?? [])
2710
- _.install(y);
2711
- return c.use(o), y;
2716
+ for (const $ of e.plugins ?? [])
2717
+ $.install(k);
2718
+ return u.use(o), k;
2712
2719
  }
2713
2720
  function Hn(e) {
2714
2721
  const t = {
@@ -2718,7 +2725,7 @@ function Hn(e) {
2718
2725
  // reader has to dismiss by hand.
2719
2726
  nav: (l) => xe(Wn, { collapsed: l.collapsed === !0, onSelect: l.select })
2720
2727
  };
2721
- return e.brand !== void 0 && (t.brand = () => xe(e.brand)), e.userMenu !== void 0 && (t.user = (l) => xe(e.userMenu, { expanded: l.expanded === !0 })), { render: () => xe(On, null, t) };
2728
+ return e.brand !== void 0 && (t.brand = () => xe(e.brand)), e.userMenu !== void 0 && (t.user = (l) => xe(e.userMenu, { expanded: l.expanded === !0 })), { render: () => xe(Pn, null, t) };
2722
2729
  }
2723
2730
  function jn() {
2724
2731
  const e = qn(Ht);
@@ -2755,53 +2762,53 @@ function Jn(e) {
2755
2762
  continue;
2756
2763
  }
2757
2764
  if (/^```([\w-]*)\s*$/.exec(n)) {
2758
- const u = [];
2765
+ const c = [];
2759
2766
  for (s += 1; s < t.length && !/^```\s*$/.test(t[s] ?? ""); )
2760
- u.push(t[s] ?? ""), s += 1;
2761
- s += 1, l.push(`<pre><code>${Qe(u.join(`
2767
+ c.push(t[s] ?? ""), s += 1;
2768
+ s += 1, l.push(`<pre><code>${Qe(c.join(`
2762
2769
  `))}</code></pre>`);
2763
2770
  continue;
2764
2771
  }
2765
2772
  const o = /^(#{1,4})\s+(.*)$/.exec(n);
2766
2773
  if (o) {
2767
- const u = Math.min(o[1].length + 1, 5);
2768
- l.push(`<h${u}>${Ke(o[2] ?? "")}</h${u}>`), s += 1;
2774
+ const c = Math.min(o[1].length + 1, 5);
2775
+ l.push(`<h${c}>${Ke(o[2] ?? "")}</h${c}>`), s += 1;
2769
2776
  continue;
2770
2777
  }
2771
- if (We(n)) {
2772
- const u = /^\s*\d+[.)]\s+/.test(n), m = [];
2773
- for (; s < t.length && We(t[s] ?? ""); )
2774
- for (m.push((t[s] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), s += 1; s < t.length; ) {
2775
- const f = t[s] ?? "";
2776
- if (f.trim() === "" || We(f) || /^(#{1,4})\s/.test(f) || /^```/.test(f))
2778
+ if (Le(n)) {
2779
+ const c = /^\s*\d+[.)]\s+/.test(n), v = [];
2780
+ for (; s < t.length && Le(t[s] ?? ""); )
2781
+ for (v.push((t[s] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), s += 1; s < t.length; ) {
2782
+ const m = t[s] ?? "";
2783
+ if (m.trim() === "" || Le(m) || /^(#{1,4})\s/.test(m) || /^```/.test(m))
2777
2784
  break;
2778
- m[m.length - 1] += ` ${f.trim()}`, s += 1;
2785
+ v[v.length - 1] += ` ${m.trim()}`, s += 1;
2779
2786
  }
2780
- const v = u ? "ol" : "ul";
2781
- l.push(`<${v}>${m.map((f) => `<li>${Ke(f)}</li>`).join("")}</${v}>`);
2787
+ const h = c ? "ol" : "ul";
2788
+ l.push(`<${h}>${v.map((m) => `<li>${Ke(m)}</li>`).join("")}</${h}>`);
2782
2789
  continue;
2783
2790
  }
2784
2791
  const r = [];
2785
2792
  for (; s < t.length; ) {
2786
- const u = t[s] ?? "";
2787
- if (u.trim() === "" || We(u) || /^(#{1,4})\s/.test(u) || /^```/.test(u)) break;
2788
- r.push(u.trim()), s += 1;
2793
+ const c = t[s] ?? "";
2794
+ if (c.trim() === "" || Le(c) || /^(#{1,4})\s/.test(c) || /^```/.test(c)) break;
2795
+ r.push(c.trim()), s += 1;
2789
2796
  }
2790
2797
  l.push(`<p>${Ke(r.join(" "))}</p>`);
2791
2798
  }
2792
2799
  return l.join("");
2793
2800
  }
2794
- const Ae = "\0";
2795
- function We(e) {
2801
+ const We = "\0";
2802
+ function Le(e) {
2796
2803
  return /^\s*(?:[-*+]|\d+[.)])\s+/.test(e);
2797
2804
  }
2798
2805
  function Ke(e) {
2799
- const t = [], l = e.replace(/`([^`]+)`/g, (n, i) => (t.push(`<code>${Qe(i)}</code>`), `${Ae}${t.length - 1}${Ae}`));
2806
+ const t = [], l = e.replace(/`([^`]+)`/g, (n, i) => (t.push(`<code>${Qe(i)}</code>`), `${We}${t.length - 1}${We}`));
2800
2807
  return Qe(l).replace(
2801
2808
  /\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
2802
2809
  '<a href="$2" target="_blank" rel="noopener">$1</a>'
2803
2810
  ).replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(
2804
- new RegExp(`${Ae}(\\d+)${Ae}`, "g"),
2811
+ new RegExp(`${We}(\\d+)${We}`, "g"),
2805
2812
  (n, i) => t[Number(i)] ?? ""
2806
2813
  );
2807
2814
  }
@@ -2812,7 +2819,7 @@ function Gn(e) {
2812
2819
  function t(l) {
2813
2820
  (l.target === document.body || l.target === document.documentElement) && e(l);
2814
2821
  }
2815
- Ie(() => window.addEventListener("keydown", t)), lt(() => window.removeEventListener("keydown", t));
2822
+ Se(() => window.addEventListener("keydown", t)), at(() => window.removeEventListener("keydown", t));
2816
2823
  }
2817
2824
  function Qn(e, t, l) {
2818
2825
  const s = `${e.apiPath}/entities/${t}/${l}/notes`, n = (o) => `${e.apiPath}/notes/${o}`, i = (o) => o.data;
@@ -2824,210 +2831,210 @@ function Qn(e, t, l) {
2824
2831
  })
2825
2832
  };
2826
2833
  }
2827
- const Le = 256 * 1024, Ze = "webx:uploads", Zn = 8e3;
2834
+ const ze = 256 * 1024, Ze = "webx:uploads", Zn = 8e3;
2828
2835
  function qe(e) {
2829
2836
  return `${e.name}|${e.size}|${e.lastModified}`;
2830
2837
  }
2831
- function Oo(e, t = rt()) {
2832
- return ut(t).filter((l) => e === void 0 || l.purpose === e);
2838
+ function Po(e, t = ut()) {
2839
+ return dt(t).filter((l) => e === void 0 || l.purpose === e);
2833
2840
  }
2834
- function eo(e, t, l = rt()) {
2841
+ function eo(e, t, l = ut()) {
2835
2842
  jt(
2836
2843
  l,
2837
- ut(l).filter(
2844
+ dt(l).filter(
2838
2845
  (s) => s.fingerprint !== e || s.purpose !== t
2839
2846
  )
2840
2847
  );
2841
2848
  }
2842
- function Po(e = {}) {
2843
- const t = e.admin ?? te(), l = e.storage === void 0 ? rt() : e.storage, s = e.retries ?? 3, n = e.retryDelay ?? 1e3, i = `${t.apiPath}/uploads`, o = A("idle"), r = A(0), u = A(0), m = A(0), v = A(null), f = A(null), c = b(() => u.value > 0 ? Math.min(1, r.value / u.value) : 0), h = b(
2844
- () => m.value > 0 ? Math.ceil((u.value - r.value) / m.value) : null
2849
+ function Oo(e = {}) {
2850
+ const t = e.admin ?? ee(), l = e.storage === void 0 ? ut() : e.storage, s = e.retries ?? 3, n = e.retryDelay ?? 1e3, i = `${t.apiPath}/uploads`, o = A("idle"), r = A(0), c = A(0), v = A(0), h = A(null), m = A(null), u = _(() => c.value > 0 ? Math.min(1, r.value / c.value) : 0), f = _(
2851
+ () => v.value > 0 ? Math.ceil((c.value - r.value) / v.value) : null
2845
2852
  );
2846
- let y = null, p = "", _ = Le, S = 0, F = null, Y = [], D = null, L = null;
2847
- function T(B, q, G = {}) {
2848
- return to(t.http, B, q, G);
2853
+ let k = null, p = "", $ = ze, b = 0, P = null, H = [], j = null, F = null;
2854
+ function y(D, Y, G = {}) {
2855
+ return to(t.http, D, Y, G);
2849
2856
  }
2850
- function z() {
2851
- return L === null && (L = new Promise((B, q) => {
2852
- D = { resolve: B, reject: q };
2853
- }), L.catch(() => {
2854
- })), L;
2857
+ function W() {
2858
+ return F === null && (F = new Promise((D, Y) => {
2859
+ j = { resolve: D, reject: Y };
2860
+ }), F.catch(() => {
2861
+ })), F;
2855
2862
  }
2856
- function k(B, q) {
2857
- const G = D;
2858
- D = null, L = null, q !== void 0 ? G?.reject(q) : G?.resolve(B);
2863
+ function T(D, Y) {
2864
+ const G = j;
2865
+ j = null, F = null, Y !== void 0 ? G?.reject(Y) : G?.resolve(D);
2859
2866
  }
2860
- function H(B) {
2861
- f.value = B instanceof Error ? B : new Error(String(B)), o.value = "failed", m.value = 0, k(null, f.value);
2867
+ function I(D) {
2868
+ m.value = D instanceof Error ? D : new Error(String(D)), o.value = "failed", v.value = 0, T(null, m.value);
2862
2869
  }
2863
- function V(B) {
2864
- r.value = Math.min(B, u.value);
2865
- const q = Date.now();
2866
- Y.push({ at: q, bytes: r.value }), Y = Y.filter((ae) => q - ae.at <= Zn);
2867
- const G = Y[0], de = G === void 0 ? 0 : (q - G.at) / 1e3;
2868
- m.value = G !== void 0 && de > 0 ? (r.value - G.bytes) / de : 0, y !== null && I(y, p, r.value);
2870
+ function V(D) {
2871
+ r.value = Math.min(D, c.value);
2872
+ const Y = Date.now();
2873
+ H.push({ at: Y, bytes: r.value }), H = H.filter((le) => Y - le.at <= Zn);
2874
+ const G = H[0], ue = G === void 0 ? 0 : (Y - G.at) / 1e3;
2875
+ v.value = G !== void 0 && ue > 0 ? (r.value - G.bytes) / ue : 0, k !== null && U(k, p, r.value);
2869
2876
  }
2870
- function I(B, q, G) {
2871
- const de = qe(B), ae = ut(l).filter(
2872
- (he) => he.fingerprint !== de || he.purpose !== q
2877
+ function U(D, Y, G) {
2878
+ const ue = qe(D), le = dt(l).filter(
2879
+ (he) => he.fingerprint !== ue || he.purpose !== Y
2873
2880
  );
2874
2881
  jt(l, [
2875
- ...ae,
2882
+ ...le,
2876
2883
  {
2877
- fingerprint: de,
2878
- purpose: q,
2879
- name: B.name,
2880
- size: B.size,
2884
+ fingerprint: ue,
2885
+ purpose: Y,
2886
+ name: D.name,
2887
+ size: D.size,
2881
2888
  offset: G,
2882
2889
  updatedAt: Date.now()
2883
2890
  }
2884
2891
  ]);
2885
2892
  }
2886
2893
  function O() {
2887
- y !== null && eo(qe(y), p, l);
2894
+ k !== null && eo(qe(k), p, l);
2888
2895
  }
2889
- function le() {
2890
- S += 1, F?.abort(), F = null, m.value = 0, Y = [];
2896
+ function te() {
2897
+ b += 1, P?.abort(), P = null, v.value = 0, H = [];
2891
2898
  }
2892
- async function ue(B, q) {
2899
+ async function re(D, Y) {
2893
2900
  if (o.value === "uploading" || o.value === "paused" || o.value === "offline")
2894
2901
  throw new Error("This upload is still going; cancel it before starting another.");
2895
- le(), y = B, p = q, v.value = null, f.value = null, r.value = 0, u.value = B.size, o.value = "uploading";
2896
- const G = z(), de = S;
2902
+ te(), k = D, p = Y, h.value = null, m.value = null, r.value = 0, c.value = D.size, o.value = "uploading";
2903
+ const G = W(), ue = b;
2897
2904
  try {
2898
- const ae = await t.http.post(i, {
2899
- name: B.name,
2900
- size: B.size,
2901
- type: B.type,
2902
- fingerprint: qe(B),
2903
- purpose: q
2905
+ const le = await t.http.post(i, {
2906
+ name: D.name,
2907
+ size: D.size,
2908
+ type: D.type,
2909
+ fingerprint: qe(D),
2910
+ purpose: Y
2904
2911
  });
2905
- if (de !== S)
2912
+ if (ue !== b)
2906
2913
  return G;
2907
- v.value = ae.data.id, _ = Math.max(Le, ae.data.chunk_size), V(ae.data.offset), ee();
2908
- } catch (ae) {
2909
- de === S && H(ae);
2914
+ h.value = le.data.id, $ = Math.max(ze, le.data.chunk_size), V(le.data.offset), B();
2915
+ } catch (le) {
2916
+ ue === b && I(le);
2910
2917
  }
2911
2918
  return G;
2912
2919
  }
2913
- async function P() {
2914
- const B = await T("HEAD", `${i}/${v.value}`);
2915
- if (!B.ok)
2916
- return H(await Ge(B)), !1;
2917
- const q = Ye(B);
2918
- return q !== null && V(q), !0;
2920
+ async function ce() {
2921
+ const D = await y("HEAD", `${i}/${h.value}`);
2922
+ if (!D.ok)
2923
+ return I(await Ge(D)), !1;
2924
+ const Y = Ye(D);
2925
+ return Y !== null && V(Y), !0;
2919
2926
  }
2920
- async function ee() {
2921
- const B = S;
2922
- let q = 0;
2923
- for (o.value = "uploading"; B === S && y !== null && v.value !== null; ) {
2924
- if (r.value >= u.value) {
2925
- o.value = "done", m.value = 0, O(), k(v.value);
2927
+ async function B() {
2928
+ const D = b;
2929
+ let Y = 0;
2930
+ for (o.value = "uploading"; D === b && k !== null && h.value !== null; ) {
2931
+ if (r.value >= c.value) {
2932
+ o.value = "done", v.value = 0, O(), T(h.value);
2926
2933
  return;
2927
2934
  }
2928
- const G = r.value, de = Math.min(u.value, G + _);
2929
- F = new AbortController();
2930
- let ae;
2935
+ const G = r.value, ue = Math.min(c.value, G + $);
2936
+ P = new AbortController();
2937
+ let le;
2931
2938
  try {
2932
- ae = await T("PATCH", `${i}/${v.value}`, {
2933
- body: y.slice(G, de),
2939
+ le = await y("PATCH", `${i}/${h.value}`, {
2940
+ body: k.slice(G, ue),
2934
2941
  headers: {
2935
2942
  "Upload-Offset": String(G),
2936
2943
  "Content-Type": "application/offset+octet-stream"
2937
2944
  },
2938
- signal: F.signal
2945
+ signal: P.signal
2939
2946
  });
2940
2947
  } catch (he) {
2941
- if (B !== S)
2948
+ if (D !== b)
2942
2949
  return;
2943
- if (xt()) {
2944
- N();
2950
+ if (kt()) {
2951
+ z();
2945
2952
  return;
2946
2953
  }
2947
- if (q += 1, q > s) {
2948
- H(he);
2954
+ if (Y += 1, Y > s) {
2955
+ I(he);
2949
2956
  return;
2950
2957
  }
2951
- if (await lo(n * 2 ** (q - 1)), B !== S)
2958
+ if (await lo(n * 2 ** (Y - 1)), D !== b)
2952
2959
  return;
2953
2960
  try {
2954
- if (!await P())
2961
+ if (!await ce())
2955
2962
  return;
2956
2963
  } catch {
2957
2964
  }
2958
2965
  continue;
2959
2966
  }
2960
- if (B !== S)
2967
+ if (D !== b)
2961
2968
  return;
2962
- if (ae.ok) {
2963
- q = 0, V(Ye(ae) ?? de);
2969
+ if (le.ok) {
2970
+ Y = 0, V(Ye(le) ?? ue);
2964
2971
  continue;
2965
2972
  }
2966
- if (ae.status === 409) {
2967
- const he = Ye(ae);
2973
+ if (le.status === 409) {
2974
+ const he = Ye(le);
2968
2975
  if (he !== null) {
2969
2976
  V(he);
2970
2977
  continue;
2971
2978
  }
2972
2979
  }
2973
- if (ae.status === 413 && _ > Le) {
2974
- _ = Math.max(Le, Math.floor(_ / 2));
2980
+ if (le.status === 413 && $ > ze) {
2981
+ $ = Math.max(ze, Math.floor($ / 2));
2975
2982
  continue;
2976
2983
  }
2977
- H(await Ge(ae));
2984
+ I(await Ge(le));
2978
2985
  return;
2979
2986
  }
2980
2987
  }
2981
- function w() {
2982
- o.value === "uploading" && (le(), o.value = "paused");
2988
+ function g() {
2989
+ o.value === "uploading" && (te(), o.value = "paused");
2983
2990
  }
2984
- function N() {
2985
- le(), o.value = "offline";
2991
+ function z() {
2992
+ te(), o.value = "offline";
2986
2993
  }
2987
- async function E() {
2994
+ async function N() {
2988
2995
  if (o.value === "uploading" || o.value === "done" || o.value === "idle")
2989
- return L ?? Promise.resolve(o.value === "done" ? v.value : null);
2990
- if (y === null)
2996
+ return F ?? Promise.resolve(o.value === "done" ? h.value : null);
2997
+ if (k === null)
2991
2998
  return Promise.resolve(null);
2992
- if (v.value === null)
2993
- return o.value = "idle", ue(y, p);
2994
- le(), f.value = null, o.value = "uploading";
2995
- const B = z(), q = S;
2999
+ if (h.value === null)
3000
+ return o.value = "idle", re(k, p);
3001
+ te(), m.value = null, o.value = "uploading";
3002
+ const D = W(), Y = b;
2996
3003
  try {
2997
- await P() && q === S && ee();
3004
+ await ce() && Y === b && B();
2998
3005
  } catch (G) {
2999
- q === S && (xt() ? N() : H(G));
3006
+ Y === b && (kt() ? z() : I(G));
3000
3007
  }
3001
- return B;
3008
+ return D;
3002
3009
  }
3003
3010
  async function X() {
3004
- const B = v.value;
3005
- if (le(), O(), o.value = "idle", r.value = 0, v.value = null, k(null), B !== null)
3011
+ const D = h.value;
3012
+ if (te(), O(), o.value = "idle", r.value = 0, h.value = null, T(null), D !== null)
3006
3013
  try {
3007
- await T("DELETE", `${i}/${B}`);
3014
+ await y("DELETE", `${i}/${D}`);
3008
3015
  } catch {
3009
3016
  }
3010
3017
  }
3011
3018
  function pe() {
3012
- o.value === "uploading" && N();
3019
+ o.value === "uploading" && z();
3013
3020
  }
3014
- function ct() {
3015
- o.value === "offline" && E();
3021
+ function ft() {
3022
+ o.value === "offline" && N();
3016
3023
  }
3017
- return typeof window < "u" && (window.addEventListener("offline", pe), window.addEventListener("online", ct)), el() !== void 0 && tl(() => {
3018
- typeof window < "u" && (window.removeEventListener("offline", pe), window.removeEventListener("online", ct)), w();
3024
+ return typeof window < "u" && (window.addEventListener("offline", pe), window.addEventListener("online", ft)), el() !== void 0 && tl(() => {
3025
+ typeof window < "u" && (window.removeEventListener("offline", pe), window.removeEventListener("online", ft)), g();
3019
3026
  }), {
3020
3027
  state: we(o),
3021
- progress: c,
3028
+ progress: u,
3022
3029
  uploaded: we(r),
3023
- total: we(u),
3024
- speed: we(m),
3025
- remaining: h,
3026
- id: we(v),
3027
- error: we(f),
3028
- start: ue,
3029
- pause: w,
3030
- resume: E,
3030
+ total: we(c),
3031
+ speed: we(v),
3032
+ remaining: f,
3033
+ id: we(h),
3034
+ error: we(m),
3035
+ start: re,
3036
+ pause: g,
3037
+ resume: N,
3031
3038
  cancel: X
3032
3039
  };
3033
3040
  }
@@ -3044,20 +3051,20 @@ function Ye(e) {
3044
3051
  const t = e.headers.get("Upload-Offset");
3045
3052
  return t === null || !/^\d+$/.test(t) ? null : Number.parseInt(t, 10);
3046
3053
  }
3047
- function xt() {
3054
+ function kt() {
3048
3055
  return typeof navigator < "u" && navigator.onLine === !1;
3049
3056
  }
3050
3057
  function lo(e) {
3051
3058
  return new Promise((t) => setTimeout(t, e));
3052
3059
  }
3053
- function rt() {
3060
+ function ut() {
3054
3061
  try {
3055
3062
  return typeof localStorage > "u" ? null : localStorage;
3056
3063
  } catch {
3057
3064
  return null;
3058
3065
  }
3059
3066
  }
3060
- function ut(e) {
3067
+ function dt(e) {
3061
3068
  if (e === null)
3062
3069
  return [];
3063
3070
  try {
@@ -3076,7 +3083,7 @@ function jt(e, t) {
3076
3083
  }
3077
3084
  const Kt = /* @__PURE__ */ Symbol("wx-category-editor");
3078
3085
  function ao(e) {
3079
- Ue(Kt, e);
3086
+ Re(Kt, e);
3080
3087
  }
3081
3088
  function Bo() {
3082
3089
  return fe(Kt, null);
@@ -3085,70 +3092,70 @@ function no(e) {
3085
3092
  return (e.q ?? "").trim() !== "" || e.filtered ? "locked" : e.category == null ? "all" : "category";
3086
3093
  }
3087
3094
  function Do(e, t) {
3088
- const l = te(), s = J("webx-admin"), n = b(() => no(t()));
3095
+ const l = ee(), s = J("webx-admin"), n = _(() => no(t()));
3089
3096
  return {
3090
3097
  mode: n,
3091
- sortable: b(() => n.value !== "locked"),
3092
- hint: b(() => s(`categories.order-${n.value}`)),
3098
+ sortable: _(() => n.value !== "locked"),
3099
+ hint: _(() => s(`categories.order-${n.value}`)),
3093
3100
  move: (i) => Rl(l, e, i, n.value === "category" ? t().category ?? null : null)
3094
3101
  };
3095
3102
  }
3096
- function dt(e = {}) {
3103
+ function ct(e = {}) {
3097
3104
  const t = J("webx-admin");
3098
3105
  return (l, s) => t(e[l] ?? `webx-admin::categories.${l}`, s);
3099
3106
  }
3100
- const oo = /* @__PURE__ */ K({
3107
+ const oo = /* @__PURE__ */ q({
3101
3108
  name: "WxCategoryCreateDialog",
3102
3109
  __name: "CategoryCreateDialog",
3103
3110
  props: {
3104
3111
  options: {}
3105
3112
  },
3106
3113
  setup(e) {
3107
- const t = e, { open: l, resolve: s, dismiss: n } = _l(), i = _e(te(), t.options.api), o = dt(t.options.words), r = A(""), u = A(!1), m = A({}), v = St("field");
3108
- Ie(async () => {
3109
- await tt(), v.value?.querySelector("input")?.focus();
3114
+ const t = e, { open: l, resolve: s, dismiss: n } = _l(), i = _e(ee(), t.options.api), o = ct(t.options.words), r = A(""), c = A(!1), v = A({}), h = lt("field");
3115
+ Se(async () => {
3116
+ await tt(), h.value?.querySelector("input")?.focus();
3110
3117
  });
3111
- function f(h) {
3112
- const y = Object.keys(m.value).find((p) => p === h || p.startsWith(`${h}.`));
3113
- return y === void 0 ? void 0 : m.value[y]?.[0];
3118
+ function m(f) {
3119
+ const k = Object.keys(v.value).find((p) => p === f || p.startsWith(`${f}.`));
3120
+ return k === void 0 ? void 0 : v.value[k]?.[0];
3114
3121
  }
3115
- async function c() {
3116
- if (!(r.value.trim() === "" || u.value)) {
3117
- u.value = !0, m.value = {};
3122
+ async function u() {
3123
+ if (!(r.value.trim() === "" || c.value)) {
3124
+ c.value = !0, v.value = {};
3118
3125
  try {
3119
3126
  s(await i.create({ title: r.value.trim() }));
3120
- } catch (h) {
3121
- m.value = h.body?.errors ?? {};
3127
+ } catch (f) {
3128
+ v.value = f.body?.errors ?? {};
3122
3129
  } finally {
3123
- u.value = !1;
3130
+ c.value = !1;
3124
3131
  }
3125
3132
  }
3126
3133
  }
3127
- return (h, y) => (d(), W(a(nt), {
3134
+ return (f, k) => (d(), L(a(ot), {
3128
3135
  open: a(l),
3129
- "onUpdate:open": y[2] || (y[2] = (p) => Tt(l) ? l.value = p : null),
3136
+ "onUpdate:open": k[2] || (k[2] = (p) => Tt(l) ? l.value = p : null),
3130
3137
  title: a(o)("new"),
3131
3138
  width: 440
3132
3139
  }, {
3133
- footer: g(() => [
3140
+ footer: w(() => [
3134
3141
  x(a(kl), { size: "sm" }, {
3135
- default: g(() => [
3136
- x(a(ce), {
3142
+ default: w(() => [
3143
+ x(a(de), {
3137
3144
  variant: "outline",
3138
- onClick: y[1] || (y[1] = (p) => a(n)())
3145
+ onClick: k[1] || (k[1] = (p) => a(n)())
3139
3146
  }, {
3140
- default: g(() => [
3147
+ default: w(() => [
3141
3148
  R(C(a(o)("cancel")), 1)
3142
3149
  ]),
3143
3150
  _: 1
3144
3151
  }),
3145
- x(a(ce), {
3152
+ x(a(de), {
3146
3153
  type: "primary",
3147
- loading: u.value,
3154
+ loading: c.value,
3148
3155
  disabled: r.value.trim() === "",
3149
- onClick: c
3156
+ onClick: u
3150
3157
  }, {
3151
- default: g(() => [
3158
+ default: w(() => [
3152
3159
  R(C(a(o)("create")), 1)
3153
3160
  ]),
3154
3161
  _: 1
@@ -3157,22 +3164,22 @@ const oo = /* @__PURE__ */ K({
3157
3164
  _: 1
3158
3165
  })
3159
3166
  ]),
3160
- default: g(() => [
3167
+ default: w(() => [
3161
3168
  x(a(xl), {
3162
3169
  label: a(o)("field-title"),
3163
- error: f("title") ?? f("slug"),
3170
+ error: m("title") ?? m("slug"),
3164
3171
  required: ""
3165
3172
  }, {
3166
- default: g(() => [
3173
+ default: w(() => [
3167
3174
  M("div", {
3168
3175
  ref_key: "field",
3169
- ref: v
3176
+ ref: h
3170
3177
  }, [
3171
- x(a(Se), {
3178
+ x(a(Te), {
3172
3179
  modelValue: r.value,
3173
- "onUpdate:modelValue": y[0] || (y[0] = (p) => r.value = p),
3180
+ "onUpdate:modelValue": k[0] || (k[0] = (p) => r.value = p),
3174
3181
  "aria-label": a(o)("field-title"),
3175
- onKeyup: Ct(c, ["enter"])
3182
+ onKeyup: Ct(u, ["enter"])
3176
3183
  }, null, 8, ["modelValue", "aria-label"])
3177
3184
  ], 512)
3178
3185
  ]),
@@ -3182,136 +3189,138 @@ const oo = /* @__PURE__ */ K({
3182
3189
  _: 1
3183
3190
  }, 8, ["open", "title"]));
3184
3191
  }
3185
- }), so = { class: "wx-category-row__name" }, io = /* @__PURE__ */ K({
3192
+ }), so = { class: "wx-category-row__name" }, io = /* @__PURE__ */ q({
3186
3193
  name: "WxCategoriesPage",
3187
3194
  __name: "CategoriesPage",
3188
3195
  props: {
3189
3196
  options: {}
3190
3197
  },
3191
3198
  setup(e) {
3192
- const t = e, l = te(), s = _e(l, t.options.api), n = Me(), i = dt(t.options.words), o = De(), r = A([]), u = A(!0), m = A(!0), v = b(() => l.can(t.options.manage)), f = b(
3193
- () => l.state.manifest?.modules.find((L) => L.id === t.options.module)?.title ?? ""
3194
- ), c = $l(oo), h = b(
3195
- () => v.value ? [{ key: "new", label: i("new"), icon: "plus", primary: !0, run: () => {
3196
- S();
3199
+ const t = e, l = ee(), s = _e(l, t.options.api), n = Me(), i = ct(t.options.words), o = J("webx-admin"), r = De(), c = A([]), v = A(!0), h = A(!0), m = _(() => l.can(t.options.manage)), u = _(
3200
+ () => t.options.title ? o(t.options.title) : l.state.manifest?.modules.find((y) => y.id === t.options.module)?.title ?? ""
3201
+ ), f = $l(oo), k = _(
3202
+ () => m.value ? [{ key: "new", label: i("new"), icon: "plus", primary: !0, run: () => {
3203
+ P();
3197
3204
  } }] : []
3198
3205
  );
3199
- function y(L) {
3200
- return Number(L[t.options.count] ?? 0);
3206
+ function p(y) {
3207
+ return Number(y[t.options.count] ?? 0);
3201
3208
  }
3202
- async function p() {
3203
- u.value = !0;
3209
+ async function $() {
3210
+ v.value = !0;
3204
3211
  try {
3205
- const L = await s.list();
3206
- r.value = L.data, m.value = L.prefix !== null;
3207
- } catch (L) {
3208
- Z.danger(o(L));
3212
+ const y = await s.list();
3213
+ c.value = y.data, h.value = y.prefix !== null;
3214
+ } catch (y) {
3215
+ Z.danger(r(y));
3209
3216
  } finally {
3210
- u.value = !1;
3217
+ v.value = !1;
3211
3218
  }
3212
3219
  }
3213
- p();
3214
- function _(L) {
3215
- n.push(`${t.options.path}/${L.id}`);
3220
+ $();
3221
+ function b(y) {
3222
+ n.push(`${t.options.path}/${y.id}`);
3216
3223
  }
3217
- async function S() {
3218
- const L = await c({ options: t.options });
3219
- L !== void 0 && _(L);
3224
+ async function P() {
3225
+ const y = await f({ options: t.options });
3226
+ y !== void 0 && b(y);
3220
3227
  }
3221
- async function F(L) {
3222
- if (y(L) > 0) {
3228
+ async function H(y) {
3229
+ if (p(y) > 0) {
3223
3230
  Z.warning(i("delete-blocked"));
3224
3231
  return;
3225
3232
  }
3226
- if (await Ne({
3227
- title: i("delete-title", { name: L.name }),
3233
+ if (await Ee({
3234
+ title: i("delete-title", { name: y.name }),
3228
3235
  message: i("delete-text"),
3229
3236
  confirmText: i("delete"),
3230
3237
  cancelText: i("cancel"),
3231
3238
  tone: "danger"
3232
3239
  }))
3233
3240
  try {
3234
- await s.remove(L.id), Z.success(i("deleted")), await p();
3235
- } catch (z) {
3236
- Z.danger(o(z));
3241
+ await s.remove(y.id), Z.success(i("deleted")), await $();
3242
+ } catch (T) {
3243
+ Z.danger(r(T));
3237
3244
  }
3238
3245
  }
3239
- function Y(L) {
3240
- const T = [{ key: "edit", label: i("edit"), icon: "edit", run: () => _(L) }], z = t.options.items;
3241
- return z && y(L) > 0 && T.push({
3246
+ function j(y) {
3247
+ const W = [{ key: "edit", label: i("edit"), icon: "edit", run: () => b(y) }], T = t.options.items;
3248
+ return T && p(y) > 0 && W.push({
3242
3249
  key: "items",
3243
3250
  label: i("show-items"),
3244
3251
  icon: "file-txt",
3245
3252
  run: () => {
3246
- n.push(z(L.id));
3253
+ n.push(T(y.id));
3247
3254
  }
3248
- }), L.url && L.is_visible && T.push({ key: "site", label: i("open-on-site"), icon: "link", href: L.url }), v.value && T.push({
3255
+ }), y.url && y.is_visible && W.push({ key: "site", label: i("open-on-site"), icon: "link", href: y.url }), m.value && W.push({
3249
3256
  key: "delete",
3250
3257
  label: i("delete"),
3251
3258
  icon: "trash",
3252
3259
  danger: !0,
3253
3260
  run: () => {
3254
- F(L);
3261
+ H(y);
3255
3262
  }
3256
- }), T;
3263
+ }), W;
3257
3264
  }
3258
- async function D() {
3265
+ async function F() {
3259
3266
  try {
3260
- await s.reorder(r.value.map((L) => L.id));
3261
- } catch (L) {
3262
- Z.danger(o(L, i("reorder-failed"))), await p();
3267
+ await s.reorder(c.value.map((y) => y.id));
3268
+ } catch (y) {
3269
+ Z.danger(r(y, i("reorder-failed"))), await $();
3263
3270
  }
3264
3271
  }
3265
- return (L, T) => {
3266
- const z = ne("router-link");
3267
- return d(), W(Pt, {
3272
+ return (y, W) => {
3273
+ const T = ae("router-link");
3274
+ return d(), L(Ot, {
3268
3275
  class: "wx-categories",
3269
- title: f.value,
3270
- actions: h.value,
3276
+ title: u.value,
3277
+ back: t.options.back?.path,
3278
+ "back-label": t.options.back ? a(o)(t.options.back.label) : void 0,
3279
+ actions: k.value,
3271
3280
  padding: "sm"
3272
3281
  }, {
3273
- default: g(() => [
3274
- u.value ? (d(), W(a(ye), {
3282
+ default: w(() => [
3283
+ v.value ? (d(), L(a(ye), {
3275
3284
  key: 0,
3276
3285
  class: "wx-categories__loading",
3277
3286
  rows: 5
3278
- })) : r.value.length === 0 ? (d(), W(a(Ve), {
3287
+ })) : c.value.length === 0 ? (d(), L(a(Ne), {
3279
3288
  key: 1,
3280
3289
  title: a(i)("empty"),
3281
3290
  description: a(i)("empty-help")
3282
- }, null, 8, ["title", "description"])) : (d(), $(j, { key: 2 }, [
3283
- x(a(at), {
3284
- modelValue: r.value,
3285
- "onUpdate:modelValue": T[0] || (T[0] = (k) => r.value = k),
3291
+ }, null, 8, ["title", "description"])) : (d(), S(K, { key: 2 }, [
3292
+ x(a(nt), {
3293
+ modelValue: c.value,
3294
+ "onUpdate:modelValue": W[0] || (W[0] = (I) => c.value = I),
3286
3295
  class: "wx-categories__list",
3287
3296
  plain: "",
3288
3297
  "item-key": "id",
3289
- "item-label": (k) => k.name,
3290
- disabled: !v.value,
3291
- onMove: D
3298
+ "item-label": (I) => I.name,
3299
+ disabled: !m.value,
3300
+ onMove: F
3292
3301
  }, {
3293
- default: g(({ item: k }) => [
3294
- x(z, {
3295
- class: ve(["wx-category-row", { "is-hidden": !k.is_visible }]),
3296
- to: `${t.options.path}/${k.id}`
3302
+ default: w(({ item: I }) => [
3303
+ x(T, {
3304
+ class: ve(["wx-category-row", { "is-hidden": !I.is_visible }]),
3305
+ to: `${t.options.path}/${I.id}`
3297
3306
  }, {
3298
- default: g(() => [
3307
+ default: w(() => [
3299
3308
  M("span", so, [
3300
3309
  x(a(Q), {
3301
3310
  truncate: "",
3302
3311
  weight: "medium"
3303
3312
  }, {
3304
- default: g(() => [
3305
- R(C(k.name), 1)
3313
+ default: w(() => [
3314
+ R(C(I.name), 1)
3306
3315
  ]),
3307
3316
  _: 2
3308
3317
  }, 1024),
3309
- k.is_visible ? U("", !0) : (d(), W(a(Wt), {
3318
+ I.is_visible ? E("", !0) : (d(), L(a(Wt), {
3310
3319
  key: 0,
3311
3320
  content: a(i)("hidden")
3312
3321
  }, {
3313
- default: g(() => [
3314
- x(a(ot), {
3322
+ default: w(() => [
3323
+ x(a(st), {
3315
3324
  name: "eye-off",
3316
3325
  size: "sm"
3317
3326
  })
@@ -3319,40 +3328,40 @@ const oo = /* @__PURE__ */ K({
3319
3328
  _: 1
3320
3329
  }, 8, ["content"]))
3321
3330
  ]),
3322
- m.value ? (d(), W(a(Q), {
3331
+ h.value ? (d(), L(a(Q), {
3323
3332
  key: 0,
3324
3333
  size: "sm",
3325
3334
  tone: "muted",
3326
3335
  truncate: ""
3327
3336
  }, {
3328
- default: g(() => [
3329
- R(C(k.path === null ? a(i)("no-address") : `/${k.path}`), 1)
3337
+ default: w(() => [
3338
+ R(C(I.path === null ? a(i)("no-address") : `/${I.path}`), 1)
3330
3339
  ]),
3331
3340
  _: 2
3332
- }, 1024)) : U("", !0)
3341
+ }, 1024)) : E("", !0)
3333
3342
  ]),
3334
3343
  _: 2
3335
3344
  }, 1032, ["class", "to"])
3336
3345
  ]),
3337
- actions: g(({ item: k }) => [
3346
+ actions: w(({ item: I }) => [
3338
3347
  x(a(Q), {
3339
3348
  class: "wx-category-row__count",
3340
3349
  size: "sm",
3341
3350
  tone: "muted"
3342
3351
  }, {
3343
- default: g(() => [
3344
- R(C(a(i)("count", { count: y(k) })), 1)
3352
+ default: w(() => [
3353
+ R(C(a(i)("count", { count: p(I) })), 1)
3345
3354
  ]),
3346
3355
  _: 2
3347
3356
  }, 1024),
3348
- x(it, {
3349
- actions: Y(k),
3350
- label: k.name
3357
+ x(rt, {
3358
+ actions: j(I),
3359
+ label: I.name
3351
3360
  }, null, 8, ["actions", "label"])
3352
3361
  ]),
3353
3362
  _: 1
3354
3363
  }, 8, ["modelValue", "item-label", "disabled"]),
3355
- x(a(Pe), {
3364
+ x(a(Oe), {
3356
3365
  class: "wx-categories__note",
3357
3366
  type: "info",
3358
3367
  description: a(i)("order")
@@ -3360,14 +3369,14 @@ const oo = /* @__PURE__ */ K({
3360
3369
  ], 64))
3361
3370
  ]),
3362
3371
  _: 1
3363
- }, 8, ["title", "actions"]);
3372
+ }, 8, ["title", "back", "back-label", "actions"]);
3364
3373
  };
3365
3374
  }
3366
3375
  }), ro = {
3367
3376
  class: "wx-save-state",
3368
3377
  role: "status",
3369
3378
  "aria-live": "polite"
3370
- }, uo = /* @__PURE__ */ K({
3379
+ }, uo = /* @__PURE__ */ q({
3371
3380
  __name: "SaveState",
3372
3381
  props: {
3373
3382
  state: {},
@@ -3376,7 +3385,7 @@ const oo = /* @__PURE__ */ K({
3376
3385
  setup(e) {
3377
3386
  const t = e, l = J("webx-admin"), s = A(!1);
3378
3387
  let n = null;
3379
- re(
3388
+ ie(
3380
3389
  () => t.state,
3381
3390
  (o, r) => {
3382
3391
  n !== null && clearTimeout(n), s.value = r === "saving" && o === "saved", s.value && (n = window.setTimeout(() => {
@@ -3384,22 +3393,22 @@ const oo = /* @__PURE__ */ K({
3384
3393
  }, t.linger));
3385
3394
  }
3386
3395
  );
3387
- const i = b(
3396
+ const i = _(
3388
3397
  () => t.state === "saving" ? "saving" : s.value ? "saved" : null
3389
3398
  );
3390
- return lt(() => {
3399
+ return at(() => {
3391
3400
  n !== null && clearTimeout(n);
3392
- }), (o, r) => (d(), $("span", ro, [
3393
- i.value ? (d(), W(a(ot), {
3401
+ }), (o, r) => (d(), S("span", ro, [
3402
+ i.value ? (d(), L(a(st), {
3394
3403
  key: 0,
3395
3404
  class: ve(["wx-save-state__mark", { "is-saved": i.value === "saved" }]),
3396
3405
  name: i.value === "saving" ? "loader" : "check",
3397
3406
  spin: i.value === "saving",
3398
3407
  label: a(l)(`editor.${i.value}`)
3399
- }, null, 8, ["class", "name", "spin", "label"])) : U("", !0)
3408
+ }, null, 8, ["class", "name", "spin", "label"])) : E("", !0)
3400
3409
  ]));
3401
3410
  }
3402
- }), co = /* @__PURE__ */ se(uo, [["__scopeId", "data-v-216e5e44"]]), fo = { class: "wx-screen-host" }, mo = /* @__PURE__ */ K({
3411
+ }), co = /* @__PURE__ */ oe(uo, [["__scopeId", "data-v-216e5e44"]]), fo = { class: "wx-screen-host" }, mo = /* @__PURE__ */ q({
3403
3412
  __name: "Screen",
3404
3413
  props: /* @__PURE__ */ me({
3405
3414
  name: {},
@@ -3414,32 +3423,32 @@ const oo = /* @__PURE__ */ K({
3414
3423
  }),
3415
3424
  emits: /* @__PURE__ */ me(["loaded"], ["update:modelValue"]),
3416
3425
  setup(e, { expose: t, emit: l }) {
3417
- const s = e, n = l, i = ge(e, "modelValue"), o = te(), r = J("webx-admin"), u = A(null), m = A(null);
3418
- async function v() {
3419
- u.value = null, m.value = null;
3426
+ const s = e, n = l, i = ge(e, "modelValue"), o = ee(), r = J("webx-admin"), c = A(null), v = A(null);
3427
+ async function h() {
3428
+ c.value = null, v.value = null;
3420
3429
  try {
3421
- const f = await o.loadScreen(s.name);
3422
- u.value = f, n("loaded", f);
3423
- } catch (f) {
3424
- m.value = f instanceof Error ? f.message : String(f);
3430
+ const m = await o.loadScreen(s.name);
3431
+ c.value = m, n("loaded", m);
3432
+ } catch (m) {
3433
+ v.value = m instanceof Error ? m.message : String(m);
3425
3434
  }
3426
3435
  }
3427
- return re([() => s.name, () => o.i18n.state.locale], () => {
3428
- v();
3429
- }, { immediate: !0 }), t({ reload: v }), (f, c) => (d(), $("div", fo, [
3430
- m.value ? (d(), W(a(Pe), {
3436
+ return ie([() => s.name, () => o.i18n.state.locale], () => {
3437
+ h();
3438
+ }, { immediate: !0 }), t({ reload: h }), (m, u) => (d(), S("div", fo, [
3439
+ v.value ? (d(), L(a(Oe), {
3431
3440
  key: 0,
3432
3441
  type: "danger",
3433
3442
  title: a(r)("shell.error-title"),
3434
- description: m.value
3435
- }, null, 8, ["title", "description"])) : u.value === null ? (d(), W(a(ye), {
3443
+ description: v.value
3444
+ }, null, 8, ["title", "description"])) : c.value === null ? (d(), L(a(ye), {
3436
3445
  key: 1,
3437
3446
  rows: 4
3438
- })) : (d(), W(a(Vl), {
3447
+ })) : (d(), L(a(Vl), {
3439
3448
  key: 2,
3440
3449
  modelValue: i.value,
3441
- "onUpdate:modelValue": c[0] || (c[0] = (h) => i.value = h),
3442
- root: u.value,
3450
+ "onUpdate:modelValue": u[0] || (u[0] = (f) => i.value = f),
3451
+ root: c.value,
3443
3452
  patch: a(o).screenPatch(e.name),
3444
3453
  types: a(o).types,
3445
3454
  errors: e.errors,
@@ -3452,141 +3461,141 @@ const oo = /* @__PURE__ */ K({
3452
3461
  }, null, 8, ["modelValue", "root", "patch", "types", "errors", "translate", "can", "disabled", "label-position", "label-width", "size"]))
3453
3462
  ]));
3454
3463
  }
3455
- }), vo = /* @__PURE__ */ K({
3464
+ }), vo = /* @__PURE__ */ q({
3456
3465
  name: "WxCategoryEditorPage",
3457
3466
  __name: "CategoryEditorPage",
3458
3467
  props: {
3459
3468
  options: {}
3460
3469
  },
3461
3470
  setup(e) {
3462
- const t = e, l = te(), s = _e(l, t.options.api), n = At(), i = Me(), o = zt(), r = dt(t.options.words), u = De(), m = b(() => Number(n.params.id)), v = b(() => t.options.path), f = A(null), c = A({}), h = A(null), y = A(""), p = A(!0), _ = A(!1), S = A({}), F = b(() => l.can(t.options.manage)), Y = b(() => JSON.stringify(c.value)), D = b(() => y.value !== "" && Y.value !== y.value), L = b(() => _.value ? "saving" : D.value ? "unsaved" : "saved"), T = b(
3463
- () => l.state.manifest?.modules.find((P) => P.id === t.options.module)?.title ?? ""
3464
- ), z = b(() => {
3465
- const P = c.value.title;
3466
- return Sl(P, o.active.value, f.value?.name ?? "") || r("untitled");
3471
+ const t = e, l = ee(), s = _e(l, t.options.api), n = At(), i = Me(), o = zt(), r = ct(t.options.words), c = J("webx-admin"), v = De(), h = _(() => Number(n.params.id)), m = _(() => t.options.path), u = A(null), f = A({}), k = A(null), p = A(""), $ = A(!0), b = A(!1), P = A({}), H = _(() => l.can(t.options.manage)), j = _(() => JSON.stringify(f.value)), F = _(() => p.value !== "" && j.value !== p.value), y = _(() => b.value ? "saving" : F.value ? "unsaved" : "saved"), W = _(
3472
+ () => t.options.title ? c(t.options.title) : l.state.manifest?.modules.find((B) => B.id === t.options.module)?.title ?? ""
3473
+ ), T = _(() => {
3474
+ const B = f.value.title;
3475
+ return Sl(B, o.active.value, u.value?.name ?? "") || r("untitled");
3467
3476
  });
3468
- ao({ category: f, values: c, prefix: h, moving: () => r("address-moving") }), Ra({ id: b(() => f.value?.id ?? null) }), bn({
3469
- values: c,
3470
- prefix: h,
3471
- path: b(() => f.value?.path),
3477
+ ao({ category: u, values: f, prefix: k, moving: () => r("address-moving") }), Ra({ id: _(() => u.value?.id ?? null) }), bn({
3478
+ values: f,
3479
+ prefix: k,
3480
+ path: _(() => u.value?.path),
3472
3481
  moving: () => r("address-moving")
3473
3482
  });
3474
- function k(P) {
3475
- f.value = P.category, c.value = P.values, h.value = P.prefix, y.value = JSON.stringify(P.values);
3483
+ function I(B) {
3484
+ u.value = B.category, f.value = B.values, k.value = B.prefix, p.value = JSON.stringify(B.values);
3476
3485
  }
3477
- async function H() {
3478
- p.value = !0;
3486
+ async function V() {
3487
+ $.value = !0;
3479
3488
  try {
3480
- k(await s.get(m.value));
3481
- } catch (P) {
3482
- Z.danger(u(P)), i.push(v.value);
3489
+ I(await s.get(h.value));
3490
+ } catch (B) {
3491
+ Z.danger(v(B)), i.push(m.value);
3483
3492
  } finally {
3484
- p.value = !1;
3493
+ $.value = !1;
3485
3494
  }
3486
3495
  }
3487
- async function V() {
3488
- if (!(!f.value || _.value || !F.value)) {
3489
- _.value = !0, S.value = {};
3496
+ async function U() {
3497
+ if (!(!u.value || b.value || !H.value)) {
3498
+ b.value = !0, P.value = {};
3490
3499
  try {
3491
- k(await s.save(f.value.id, c.value)), Z.success(r("saved"));
3492
- } catch (P) {
3493
- const ee = P.body;
3494
- ee?.errors ? (S.value = ee.errors, Z.danger(r("save-failed"))) : Z.danger(u(P));
3500
+ I(await s.save(u.value.id, f.value)), Z.success(r("saved"));
3501
+ } catch (B) {
3502
+ const g = B.body;
3503
+ g?.errors ? (P.value = g.errors, Z.danger(r("save-failed"))) : Z.danger(v(B));
3495
3504
  } finally {
3496
- _.value = !1;
3505
+ b.value = !1;
3497
3506
  }
3498
3507
  }
3499
3508
  }
3500
- async function I() {
3501
- const P = f.value;
3502
- if (!(!P || !await Ne({
3503
- title: r("delete-title", { name: P.name }),
3509
+ async function O() {
3510
+ const B = u.value;
3511
+ if (!(!B || !await Ee({
3512
+ title: r("delete-title", { name: B.name }),
3504
3513
  message: r("delete-text"),
3505
3514
  confirmText: r("delete"),
3506
3515
  cancelText: r("cancel"),
3507
3516
  tone: "danger"
3508
3517
  })))
3509
3518
  try {
3510
- await s.remove(P.id), Z.success(r("deleted")), y.value = Y.value, i.push(v.value);
3511
- } catch (w) {
3512
- Z.danger(u(w));
3519
+ await s.remove(B.id), Z.success(r("deleted")), p.value = j.value, i.push(m.value);
3520
+ } catch (z) {
3521
+ Z.danger(v(z));
3513
3522
  }
3514
3523
  }
3515
- function O(P) {
3516
- D.value && P.preventDefault();
3524
+ function te(B) {
3525
+ F.value && B.preventDefault();
3517
3526
  }
3518
- function le(P) {
3519
- (P.ctrlKey || P.metaKey) && P.key.toLowerCase() === "s" && (P.preventDefault(), D.value && V());
3527
+ function re(B) {
3528
+ (B.ctrlKey || B.metaKey) && B.key.toLowerCase() === "s" && (B.preventDefault(), F.value && U());
3520
3529
  }
3521
- Gn(le), re(m, () => {
3522
- H();
3523
- }), Ie(() => {
3524
- H(), window.addEventListener("beforeunload", O);
3525
- }), lt(() => {
3526
- window.removeEventListener("beforeunload", O);
3527
- }), ol(async () => !D.value || !F.value ? !0 : await Ne({
3530
+ Gn(re), ie(h, () => {
3531
+ V();
3532
+ }), Se(() => {
3533
+ V(), window.addEventListener("beforeunload", te);
3534
+ }), at(() => {
3535
+ window.removeEventListener("beforeunload", te);
3536
+ }), ol(async () => !F.value || !H.value ? !0 : await Ee({
3528
3537
  title: r("leave-title"),
3529
3538
  message: r("leave-text"),
3530
3539
  confirmText: r("leave"),
3531
3540
  cancelText: r("cancel"),
3532
3541
  tone: "danger"
3533
3542
  }));
3534
- const ue = b(() => {
3535
- const P = f.value, ee = [];
3536
- return P && (P.url && P.is_visible && ee.push({ key: "site", label: r("open-on-site"), icon: "link", href: P.url }), F.value && ee.push({
3543
+ const ce = _(() => {
3544
+ const B = u.value, g = [];
3545
+ return B && (B.url && B.is_visible && g.push({ key: "site", label: r("open-on-site"), icon: "link", href: B.url }), H.value && g.push({
3537
3546
  key: "delete",
3538
3547
  label: r("delete"),
3539
3548
  icon: "trash",
3540
3549
  danger: !0,
3541
3550
  menu: !0,
3542
3551
  run: () => {
3543
- I();
3552
+ O();
3544
3553
  }
3545
- })), ee;
3554
+ })), g;
3546
3555
  });
3547
- return (P, ee) => (d(), $("div", {
3556
+ return (B, g) => (d(), S("div", {
3548
3557
  class: "wx-category-editor",
3549
- onKeydown: le
3558
+ onKeydown: re
3550
3559
  }, [
3551
- p.value || !f.value ? (d(), $(j, { key: 0 }, [
3560
+ $.value || !u.value ? (d(), S(K, { key: 0 }, [
3552
3561
  x(a(ye), {
3553
3562
  class: "wx-category-editor__ghost",
3554
3563
  title: "",
3555
3564
  rows: 1
3556
3565
  }),
3557
3566
  x(a(Je), null, {
3558
- default: g(() => [
3567
+ default: w(() => [
3559
3568
  x(a(ye), { rows: 6 })
3560
3569
  ]),
3561
3570
  _: 1
3562
3571
  })
3563
- ], 64)) : (d(), $(j, { key: 1 }, [
3564
- x(Ot, {
3572
+ ], 64)) : (d(), S(K, { key: 1 }, [
3573
+ x(Pt, {
3565
3574
  divider: "",
3566
- back: v.value,
3567
- "back-label": T.value,
3568
- title: z.value,
3569
- subtitle: f.value.path === null ? void 0 : `/${f.value.path}`,
3570
- actions: ue.value
3571
- }, Re({
3572
- trail: g(() => [
3575
+ back: m.value,
3576
+ "back-label": W.value,
3577
+ title: T.value,
3578
+ subtitle: u.value.path === null ? void 0 : `/${u.value.path}`,
3579
+ actions: ce.value
3580
+ }, Ie({
3581
+ trail: w(() => [
3573
3582
  x(a(Tl), {
3574
3583
  size: "sm",
3575
3584
  label: a(r)("trail")
3576
3585
  }, {
3577
- default: g(() => [
3578
- x(a(mt), {
3586
+ default: w(() => [
3587
+ x(a(vt), {
3579
3588
  as: "router-link",
3580
- to: v.value
3589
+ to: m.value
3581
3590
  }, {
3582
- default: g(() => [
3583
- R(C(T.value), 1)
3591
+ default: w(() => [
3592
+ R(C(W.value), 1)
3584
3593
  ]),
3585
3594
  _: 1
3586
3595
  }, 8, ["to"]),
3587
- x(a(mt), { current: "" }, {
3588
- default: g(() => [
3589
- R(C(z.value), 1)
3596
+ x(a(vt), { current: "" }, {
3597
+ default: w(() => [
3598
+ R(C(T.value), 1)
3590
3599
  ]),
3591
3600
  _: 1
3592
3601
  })
@@ -3596,11 +3605,11 @@ const oo = /* @__PURE__ */ K({
3596
3605
  ]),
3597
3606
  _: 2
3598
3607
  }, [
3599
- f.value.is_visible ? void 0 : {
3608
+ u.value.is_visible ? void 0 : {
3600
3609
  name: "title-after",
3601
- fn: g(() => [
3602
- x(a(Oe), { dot: "" }, {
3603
- default: g(() => [
3610
+ fn: w(() => [
3611
+ x(a(Pe), { dot: "" }, {
3612
+ default: w(() => [
3604
3613
  R(C(a(r)("hidden")), 1)
3605
3614
  ]),
3606
3615
  _: 1
@@ -3610,58 +3619,58 @@ const oo = /* @__PURE__ */ K({
3610
3619
  }
3611
3620
  ]), 1032, ["back", "back-label", "title", "subtitle", "actions"]),
3612
3621
  x(mo, {
3613
- modelValue: c.value,
3614
- "onUpdate:modelValue": ee[0] || (ee[0] = (w) => c.value = w),
3622
+ modelValue: f.value,
3623
+ "onUpdate:modelValue": g[0] || (g[0] = (z) => f.value = z),
3615
3624
  name: t.options.screen,
3616
- errors: S.value,
3617
- disabled: !F.value || _.value
3625
+ errors: P.value,
3626
+ disabled: !H.value || b.value
3618
3627
  }, null, 8, ["modelValue", "name", "errors", "disabled"]),
3619
- F.value ? (d(), W(a(Cl), { key: 0 }, {
3620
- state: g(() => [
3621
- x(co, { state: L.value }, null, 8, ["state"])
3628
+ H.value ? (d(), L(a(Cl), { key: 0 }, {
3629
+ state: w(() => [
3630
+ x(co, { state: y.value }, null, 8, ["state"])
3622
3631
  ]),
3623
- default: g(() => [
3624
- x(a(ce), {
3632
+ default: w(() => [
3633
+ x(a(de), {
3625
3634
  type: "primary",
3626
- loading: _.value,
3627
- disabled: !D.value,
3628
- onClick: V
3635
+ loading: b.value,
3636
+ disabled: !F.value,
3637
+ onClick: U
3629
3638
  }, {
3630
- default: g(() => [
3639
+ default: w(() => [
3631
3640
  R(C(a(r)("save")), 1)
3632
3641
  ]),
3633
3642
  _: 1
3634
3643
  }, 8, ["loading", "disabled"])
3635
3644
  ]),
3636
3645
  _: 1
3637
- })) : U("", !0)
3646
+ })) : E("", !0)
3638
3647
  ], 64))
3639
3648
  ], 32));
3640
3649
  }
3641
- }), po = /* @__PURE__ */ se(vo, [["__scopeId", "data-v-c245c468"]]);
3642
- function kt(e, t) {
3643
- return K({
3650
+ }), po = /* @__PURE__ */ oe(vo, [["__scopeId", "data-v-55265992"]]);
3651
+ function $t(e, t) {
3652
+ return q({
3644
3653
  name: "WxCategoriesView",
3645
3654
  setup: () => () => xe(e, { options: t })
3646
3655
  });
3647
3656
  }
3648
3657
  function Fo(e) {
3649
3658
  return [
3650
- { path: e.path, name: e.name, component: kt(io, e) },
3659
+ { path: e.path, name: e.name, component: $t(io, e) },
3651
3660
  {
3652
3661
  path: `${e.path}/:id(\\d+)`,
3653
3662
  name: `${e.name}.edit`,
3654
- component: kt(po, e)
3663
+ component: $t(po, e)
3655
3664
  }
3656
3665
  ];
3657
3666
  }
3658
- const Ho = 76, jo = /* @__PURE__ */ K({
3667
+ const Ho = 76, jo = /* @__PURE__ */ q({
3659
3668
  __name: "FilterChips",
3660
3669
  props: {
3661
3670
  filters: {}
3662
3671
  },
3663
3672
  setup(e) {
3664
- return (t, l) => (d(!0), $(j, null, ie(e.filters, (s) => (d(), W(a(Oe), {
3673
+ return (t, l) => (d(!0), S(K, null, se(e.filters, (s) => (d(), L(a(Pe), {
3665
3674
  key: s.key,
3666
3675
  class: "wx-filter-chip",
3667
3676
  size: "sm",
@@ -3669,13 +3678,13 @@ const Ho = 76, jo = /* @__PURE__ */ K({
3669
3678
  closable: "",
3670
3679
  onClose: (n) => s.clear()
3671
3680
  }, {
3672
- default: g(() => [
3681
+ default: w(() => [
3673
3682
  R(C(s.label), 1)
3674
3683
  ]),
3675
3684
  _: 2
3676
3685
  }, 1032, ["onClose"]))), 128));
3677
3686
  }
3678
- }), ho = { class: "wx-rename__footer" }, yo = /* @__PURE__ */ K({
3687
+ }), ho = { class: "wx-rename__footer" }, yo = /* @__PURE__ */ q({
3679
3688
  __name: "RenameButton",
3680
3689
  props: {
3681
3690
  name: { default: "" },
@@ -3686,56 +3695,56 @@ const Ho = 76, jo = /* @__PURE__ */ K({
3686
3695
  },
3687
3696
  emits: ["rename"],
3688
3697
  setup(e, { emit: t }) {
3689
- const l = e, s = t, n = J("webx-admin"), i = A(!1), o = A(l.name), r = A(null), u = b(() => l.label ?? n("editor.rename"));
3690
- re(i, async (v) => {
3691
- v && (o.value = l.name, await tt(), r.value?.focus(), r.value?.select());
3698
+ const l = e, s = t, n = J("webx-admin"), i = A(!1), o = A(l.name), r = A(null), c = _(() => l.label ?? n("editor.rename"));
3699
+ ie(i, async (h) => {
3700
+ h && (o.value = l.name, await tt(), r.value?.focus(), r.value?.select());
3692
3701
  });
3693
- function m() {
3694
- const v = o.value.trim();
3695
- if (v === "" || v === l.name) {
3702
+ function v() {
3703
+ const h = o.value.trim();
3704
+ if (h === "" || h === l.name) {
3696
3705
  i.value = !1;
3697
3706
  return;
3698
3707
  }
3699
- s("rename", v), i.value = !1;
3708
+ s("rename", h), i.value = !1;
3700
3709
  }
3701
- return (v, f) => (d(), W(a(Al), {
3710
+ return (h, m) => (d(), L(a(Al), {
3702
3711
  open: i.value,
3703
- "onUpdate:open": f[2] || (f[2] = (c) => i.value = c),
3704
- title: u.value,
3712
+ "onUpdate:open": m[2] || (m[2] = (u) => i.value = u),
3713
+ title: c.value,
3705
3714
  width: 320,
3706
3715
  side: "bottom",
3707
3716
  align: "start",
3708
3717
  teleport: ""
3709
3718
  }, {
3710
- trigger: g(() => [
3719
+ trigger: w(() => [
3711
3720
  x(a(be), {
3712
3721
  type: "edit",
3713
- title: u.value,
3722
+ title: c.value,
3714
3723
  size: e.size,
3715
3724
  disabled: e.disabled
3716
3725
  }, null, 8, ["title", "size", "disabled"])
3717
3726
  ]),
3718
- default: g(() => [
3727
+ default: w(() => [
3719
3728
  M("form", {
3720
3729
  class: "wx-rename",
3721
- onSubmit: $t(m, ["prevent"])
3730
+ onSubmit: St(v, ["prevent"])
3722
3731
  }, [
3723
- x(a(Se), {
3732
+ x(a(Te), {
3724
3733
  ref_key: "field",
3725
3734
  ref: r,
3726
3735
  modelValue: o.value,
3727
- "onUpdate:modelValue": f[0] || (f[0] = (c) => o.value = c),
3728
- "aria-label": u.value,
3736
+ "onUpdate:modelValue": m[0] || (m[0] = (u) => o.value = u),
3737
+ "aria-label": c.value,
3729
3738
  placeholder: e.placeholder,
3730
- onKeydown: f[1] || (f[1] = Ct((c) => i.value = !1, ["esc"]))
3739
+ onKeydown: m[1] || (m[1] = Ct((u) => i.value = !1, ["esc"]))
3731
3740
  }, null, 8, ["modelValue", "aria-label", "placeholder"]),
3732
3741
  M("div", ho, [
3733
- x(a(ce), {
3742
+ x(a(de), {
3734
3743
  type: "primary",
3735
3744
  size: "sm",
3736
3745
  "native-type": "submit"
3737
3746
  }, {
3738
- default: g(() => [
3747
+ default: w(() => [
3739
3748
  R(C(a(n)("editor.save")), 1)
3740
3749
  ]),
3741
3750
  _: 1
@@ -3746,7 +3755,7 @@ const Ho = 76, jo = /* @__PURE__ */ K({
3746
3755
  _: 1
3747
3756
  }, 8, ["open", "title"]));
3748
3757
  }
3749
- }), Ko = /* @__PURE__ */ se(yo, [["__scopeId", "data-v-d879e8d3"]]), go = ["innerHTML"], bo = /* @__PURE__ */ K({
3758
+ }), Ko = /* @__PURE__ */ oe(yo, [["__scopeId", "data-v-d879e8d3"]]), go = ["innerHTML"], bo = /* @__PURE__ */ q({
3750
3759
  __name: "HelpButton",
3751
3760
  props: {
3752
3761
  body: {},
@@ -3756,23 +3765,23 @@ const Ho = 76, jo = /* @__PURE__ */ K({
3756
3765
  width: { default: 720 }
3757
3766
  },
3758
3767
  setup(e) {
3759
- const t = e, l = J("webx-admin"), s = A(!1), n = b(() => t.title ?? l("help.title")), i = b(() => Jn(t.body));
3760
- return (o, r) => (d(), $(j, null, [
3768
+ const t = e, l = J("webx-admin"), s = A(!1), n = _(() => t.title ?? l("help.title")), i = _(() => Jn(t.body));
3769
+ return (o, r) => (d(), S(K, null, [
3761
3770
  x(a(be), {
3762
3771
  type: "details",
3763
3772
  icon: "question",
3764
3773
  tone: "neutral",
3765
3774
  size: e.size,
3766
3775
  title: e.label ?? n.value,
3767
- onClick: r[0] || (r[0] = (u) => s.value = !0)
3776
+ onClick: r[0] || (r[0] = (c) => s.value = !0)
3768
3777
  }, null, 8, ["size", "title"]),
3769
- x(a(nt), {
3778
+ x(a(ot), {
3770
3779
  open: s.value,
3771
- "onUpdate:open": r[1] || (r[1] = (u) => s.value = u),
3780
+ "onUpdate:open": r[1] || (r[1] = (c) => s.value = c),
3772
3781
  title: n.value,
3773
3782
  width: e.width
3774
3783
  }, {
3775
- default: g(() => [
3784
+ default: w(() => [
3776
3785
  M("div", {
3777
3786
  class: "wx-help",
3778
3787
  innerHTML: i.value
@@ -3782,7 +3791,7 @@ const Ho = 76, jo = /* @__PURE__ */ K({
3782
3791
  }, 8, ["open", "title", "width"])
3783
3792
  ], 64));
3784
3793
  }
3785
- }), qo = /* @__PURE__ */ se(bo, [["__scopeId", "data-v-6c280d42"]]), wo = { class: "wx-notes" }, _o = {
3794
+ }), qo = /* @__PURE__ */ oe(bo, [["__scopeId", "data-v-6c280d42"]]), wo = { class: "wx-notes" }, _o = {
3786
3795
  key: 3,
3787
3796
  class: "wx-notes__list"
3788
3797
  }, xo = { class: "wx-note__body" }, ko = { class: "wx-note__head" }, $o = { class: "wx-note__buttons" }, So = {
@@ -3791,7 +3800,7 @@ const Ho = 76, jo = /* @__PURE__ */ K({
3791
3800
  }, To = {
3792
3801
  key: 4,
3793
3802
  class: "wx-notes__new"
3794
- }, Co = /* @__PURE__ */ K({
3803
+ }, Co = /* @__PURE__ */ q({
3795
3804
  name: "WxNotes",
3796
3805
  __name: "NotesFeed",
3797
3806
  props: {
@@ -3802,52 +3811,52 @@ const Ho = 76, jo = /* @__PURE__ */ K({
3802
3811
  },
3803
3812
  emits: ["change"],
3804
3813
  setup(e, { emit: t }) {
3805
- const l = e, s = t, n = te(), i = J("webx-admin"), o = De(), r = A([]), u = A(!0), m = A(""), v = A(!1), f = A(null), c = A(""), h = b(() => Qn(n, l.type, l.id)), y = b(() => l.title ?? i("notes.title"));
3814
+ const l = e, s = t, n = ee(), i = J("webx-admin"), o = De(), r = A([]), c = A(!0), v = A(""), h = A(!1), m = A(null), u = A(""), f = _(() => Qn(n, l.type, l.id)), k = _(() => l.title ?? i("notes.title"));
3806
3815
  async function p() {
3807
- u.value = !0;
3816
+ c.value = !0;
3808
3817
  try {
3809
- r.value = await h.value.list();
3810
- } catch (T) {
3811
- Z.danger(o(T));
3818
+ r.value = await f.value.list();
3819
+ } catch (y) {
3820
+ Z.danger(o(y));
3812
3821
  } finally {
3813
- u.value = !1;
3822
+ c.value = !1;
3814
3823
  }
3815
3824
  }
3816
- re(
3825
+ ie(
3817
3826
  () => [l.type, l.id],
3818
3827
  () => {
3819
- f.value = null, m.value = "", p();
3828
+ m.value = null, v.value = "", p();
3820
3829
  },
3821
3830
  { immediate: !0 }
3822
3831
  );
3823
- async function _() {
3824
- const T = m.value.trim();
3825
- if (!(T === "" || v.value)) {
3826
- v.value = !0;
3832
+ async function $() {
3833
+ const y = v.value.trim();
3834
+ if (!(y === "" || h.value)) {
3835
+ h.value = !0;
3827
3836
  try {
3828
- r.value = [...r.value, await h.value.add(T)], m.value = "", s("change");
3829
- } catch (z) {
3830
- Z.danger(o(z));
3837
+ r.value = [...r.value, await f.value.add(y)], v.value = "", s("change");
3838
+ } catch (W) {
3839
+ Z.danger(o(W));
3831
3840
  } finally {
3832
- v.value = !1;
3841
+ h.value = !1;
3833
3842
  }
3834
3843
  }
3835
3844
  }
3836
- function S(T) {
3837
- f.value = T.id, c.value = T.body;
3845
+ function b(y) {
3846
+ m.value = y.id, u.value = y.body;
3838
3847
  }
3839
- async function F(T) {
3840
- const z = c.value.trim();
3841
- if (z !== "")
3848
+ async function P(y) {
3849
+ const W = u.value.trim();
3850
+ if (W !== "")
3842
3851
  try {
3843
- const k = await h.value.save(T.id, z);
3844
- r.value = r.value.map((H) => H.id === k.id ? k : H), f.value = null, Z.success(i("notes.saved")), s("change");
3845
- } catch (k) {
3846
- Z.danger(o(k));
3852
+ const T = await f.value.save(y.id, W);
3853
+ r.value = r.value.map((I) => I.id === T.id ? T : I), m.value = null, Z.success(i("notes.saved")), s("change");
3854
+ } catch (T) {
3855
+ Z.danger(o(T));
3847
3856
  }
3848
3857
  }
3849
- async function Y(T) {
3850
- if (await Ne({
3858
+ async function H(y) {
3859
+ if (await Ee({
3851
3860
  title: i("notes.delete-title"),
3852
3861
  message: i("notes.delete-text"),
3853
3862
  confirmText: i("notes.delete"),
@@ -3855,53 +3864,53 @@ const Ho = 76, jo = /* @__PURE__ */ K({
3855
3864
  tone: "danger"
3856
3865
  }))
3857
3866
  try {
3858
- await h.value.remove(T.id), r.value = r.value.filter((k) => k.id !== T.id), Z.success(i("notes.deleted")), s("change");
3859
- } catch (k) {
3860
- Z.danger(o(k));
3867
+ await f.value.remove(y.id), r.value = r.value.filter((T) => T.id !== y.id), Z.success(i("notes.deleted")), s("change");
3868
+ } catch (T) {
3869
+ Z.danger(o(T));
3861
3870
  }
3862
3871
  }
3863
- function D(T) {
3864
- return !l.can || !T.is_mine ? [] : [
3865
- { key: "edit", icon: "edit", label: i("notes.edit"), run: () => S(T) },
3872
+ function j(y) {
3873
+ return !l.can || !y.is_mine ? [] : [
3874
+ { key: "edit", icon: "edit", label: i("notes.edit"), run: () => b(y) },
3866
3875
  {
3867
3876
  key: "delete",
3868
3877
  icon: "trash",
3869
3878
  label: i("notes.delete"),
3870
3879
  danger: !0,
3871
3880
  run: () => {
3872
- Y(T);
3881
+ H(y);
3873
3882
  }
3874
3883
  }
3875
3884
  ];
3876
3885
  }
3877
- function L(T) {
3878
- return T.author?.name ?? i("notes.unknown-author");
3886
+ function F(y) {
3887
+ return y.author?.name ?? i("notes.unknown-author");
3879
3888
  }
3880
- return (T, z) => (d(), $("section", wo, [
3881
- y.value ? (d(), W(a(Q), {
3889
+ return (y, W) => (d(), S("section", wo, [
3890
+ k.value ? (d(), L(a(Q), {
3882
3891
  key: 0,
3883
3892
  weight: "medium",
3884
3893
  class: "wx-notes__title"
3885
3894
  }, {
3886
- default: g(() => [
3887
- R(C(y.value), 1)
3895
+ default: w(() => [
3896
+ R(C(k.value), 1)
3888
3897
  ]),
3889
3898
  _: 1
3890
- })) : U("", !0),
3891
- u.value ? (d(), W(a(ye), {
3899
+ })) : E("", !0),
3900
+ c.value ? (d(), L(a(ye), {
3892
3901
  key: 1,
3893
3902
  rows: 2
3894
- })) : r.value.length === 0 ? (d(), W(a(Ve), {
3903
+ })) : r.value.length === 0 ? (d(), L(a(Ne), {
3895
3904
  key: 2,
3896
3905
  size: "sm",
3897
3906
  description: a(i)("notes.empty")
3898
- }, null, 8, ["description"])) : (d(), $("ul", _o, [
3899
- (d(!0), $(j, null, ie(r.value, (k) => (d(), $("li", {
3900
- key: k.id,
3907
+ }, null, 8, ["description"])) : (d(), S("ul", _o, [
3908
+ (d(!0), S(K, null, se(r.value, (T) => (d(), S("li", {
3909
+ key: T.id,
3901
3910
  class: "wx-note"
3902
3911
  }, [
3903
3912
  x(a(Lt), {
3904
- name: L(k),
3913
+ name: F(T),
3905
3914
  size: "sm",
3906
3915
  tone: "auto"
3907
3916
  }, null, 8, ["name"]),
@@ -3912,163 +3921,163 @@ const Ho = 76, jo = /* @__PURE__ */ K({
3912
3921
  weight: "medium",
3913
3922
  truncate: ""
3914
3923
  }, {
3915
- default: g(() => [
3916
- R(C(L(k)), 1)
3924
+ default: w(() => [
3925
+ R(C(F(T)), 1)
3917
3926
  ]),
3918
3927
  _: 2
3919
3928
  }, 1024),
3920
- x(Ee, {
3921
- value: k.created_at
3929
+ x(Ue, {
3930
+ value: T.created_at
3922
3931
  }, null, 8, ["value"]),
3923
- x(it, {
3924
- actions: D(k),
3925
- label: L(k)
3932
+ x(rt, {
3933
+ actions: j(T),
3934
+ label: F(T)
3926
3935
  }, null, 8, ["actions", "label"])
3927
3936
  ]),
3928
- f.value === k.id ? (d(), $(j, { key: 0 }, [
3929
- x(a(vt), {
3930
- modelValue: c.value,
3931
- "onUpdate:modelValue": z[0] || (z[0] = (H) => c.value = H),
3937
+ m.value === T.id ? (d(), S(K, { key: 0 }, [
3938
+ x(a(pt), {
3939
+ modelValue: u.value,
3940
+ "onUpdate:modelValue": W[0] || (W[0] = (I) => u.value = I),
3932
3941
  autosize: { minRows: 2, maxRows: 10 }
3933
3942
  }, null, 8, ["modelValue"]),
3934
3943
  M("div", $o, [
3935
- x(a(ce), {
3944
+ x(a(de), {
3936
3945
  size: "sm",
3937
3946
  type: "primary",
3938
- onClick: (H) => F(k)
3947
+ onClick: (I) => P(T)
3939
3948
  }, {
3940
- default: g(() => [
3949
+ default: w(() => [
3941
3950
  R(C(a(i)("notes.save")), 1)
3942
3951
  ]),
3943
3952
  _: 1
3944
3953
  }, 8, ["onClick"]),
3945
- x(a(ce), {
3954
+ x(a(de), {
3946
3955
  size: "sm",
3947
3956
  variant: "text",
3948
- onClick: z[1] || (z[1] = (H) => f.value = null)
3957
+ onClick: W[1] || (W[1] = (I) => m.value = null)
3949
3958
  }, {
3950
- default: g(() => [
3959
+ default: w(() => [
3951
3960
  R(C(a(i)("notes.cancel")), 1)
3952
3961
  ]),
3953
3962
  _: 1
3954
3963
  })
3955
3964
  ])
3956
- ], 64)) : (d(), $("p", So, C(k.body), 1))
3965
+ ], 64)) : (d(), S("p", So, C(T.body), 1))
3957
3966
  ])
3958
3967
  ]))), 128))
3959
3968
  ])),
3960
- e.can ? (d(), $("div", To, [
3961
- x(a(vt), {
3962
- modelValue: m.value,
3963
- "onUpdate:modelValue": z[2] || (z[2] = (k) => m.value = k),
3969
+ e.can ? (d(), S("div", To, [
3970
+ x(a(pt), {
3971
+ modelValue: v.value,
3972
+ "onUpdate:modelValue": W[2] || (W[2] = (T) => v.value = T),
3964
3973
  placeholder: a(i)("notes.placeholder"),
3965
3974
  autosize: { minRows: 2, maxRows: 8 }
3966
3975
  }, null, 8, ["modelValue", "placeholder"]),
3967
- x(a(ce), {
3976
+ x(a(de), {
3968
3977
  size: "sm",
3969
3978
  type: "primary",
3970
- disabled: m.value.trim() === "",
3971
- loading: v.value,
3972
- onClick: _
3979
+ disabled: v.value.trim() === "",
3980
+ loading: h.value,
3981
+ onClick: $
3973
3982
  }, {
3974
- default: g(() => [
3983
+ default: w(() => [
3975
3984
  R(C(a(i)("notes.add")), 1)
3976
3985
  ]),
3977
3986
  _: 1
3978
3987
  }, 8, ["disabled", "loading"])
3979
- ])) : U("", !0)
3988
+ ])) : E("", !0)
3980
3989
  ]));
3981
3990
  }
3982
- }), Yo = /* @__PURE__ */ se(Co, [["__scopeId", "data-v-71004c1a"]]), Ao = {
3991
+ }), Yo = /* @__PURE__ */ oe(Co, [["__scopeId", "data-v-71004c1a"]]), Ao = {
3983
3992
  key: 1,
3984
3993
  class: "wx-backup-note"
3985
- }, Wo = 48, Lo = /* @__PURE__ */ K({
3994
+ }, Wo = 48, Lo = /* @__PURE__ */ q({
3986
3995
  name: "WxBackupNote",
3987
3996
  __name: "BackupNote",
3988
3997
  setup(e) {
3989
- const t = te(), l = It(), s = J("webx-admin"), n = b(() => t.state.manifest?.backup ?? null), i = b(() => n.value !== null && t.can("settings.view")), o = b(() => {
3990
- const m = n.value?.at;
3991
- if (m == null) return !0;
3992
- const v = new Date(m).getTime();
3993
- return Number.isNaN(v) || Date.now() - v > Wo * 36e5;
3994
- }), r = b(() => {
3995
- const m = n.value?.bytes;
3996
- if (m == null) return "";
3997
- const v = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte"];
3998
- let f = m, c = 0;
3999
- for (; f >= 1024 && c < v.length - 1; )
4000
- f /= 1024, c++;
3998
+ const t = ee(), l = It(), s = J("webx-admin"), n = _(() => t.state.manifest?.backup ?? null), i = _(() => n.value !== null && t.can("settings.view")), o = _(() => {
3999
+ const v = n.value?.at;
4000
+ if (v == null) return !0;
4001
+ const h = new Date(v).getTime();
4002
+ return Number.isNaN(h) || Date.now() - h > Wo * 36e5;
4003
+ }), r = _(() => {
4004
+ const v = n.value?.bytes;
4005
+ if (v == null) return "";
4006
+ const h = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte"];
4007
+ let m = v, u = 0;
4008
+ for (; m >= 1024 && u < h.length - 1; )
4009
+ m /= 1024, u++;
4001
4010
  return new Intl.NumberFormat(t.i18n.state.locale, {
4002
4011
  style: "unit",
4003
- unit: v[c],
4012
+ unit: h[u],
4004
4013
  unitDisplay: "short",
4005
- maximumFractionDigits: f >= 10 || c === 0 ? 0 : 1
4006
- }).format(f);
4007
- }), u = b(
4014
+ maximumFractionDigits: m >= 10 || u === 0 ? 0 : 1
4015
+ }).format(m);
4016
+ }), c = _(
4008
4017
  () => n.value?.at == null ? s("backup.never") : s("backup.stale", { date: l.short(n.value.at) })
4009
4018
  );
4010
- return (m, v) => i.value && o.value ? (d(), W(a(Pe), {
4019
+ return (v, h) => i.value && o.value ? (d(), L(a(Oe), {
4011
4020
  key: 0,
4012
4021
  type: "warning",
4013
4022
  variant: "soft",
4014
- description: u.value
4015
- }, null, 8, ["description"])) : i.value ? (d(), $("p", Ao, [
4023
+ description: c.value
4024
+ }, null, 8, ["description"])) : i.value ? (d(), S("p", Ao, [
4016
4025
  x(a(Q), {
4017
4026
  size: "sm",
4018
4027
  tone: "muted"
4019
4028
  }, {
4020
- default: g(() => [
4029
+ default: w(() => [
4021
4030
  R(C(a(s)("backup.title")), 1)
4022
4031
  ]),
4023
4032
  _: 1
4024
4033
  }),
4025
- x(Ee, {
4034
+ x(Ue, {
4026
4035
  value: n.value?.at
4027
4036
  }, null, 8, ["value"]),
4028
- r.value ? (d(), W(a(Q), {
4037
+ r.value ? (d(), L(a(Q), {
4029
4038
  key: 0,
4030
4039
  size: "sm",
4031
4040
  tone: "muted"
4032
4041
  }, {
4033
- default: g(() => [
4042
+ default: w(() => [
4034
4043
  R("· " + C(r.value), 1)
4035
4044
  ]),
4036
4045
  _: 1
4037
- })) : U("", !0)
4038
- ])) : U("", !0);
4046
+ })) : E("", !0)
4047
+ ])) : E("", !0);
4039
4048
  }
4040
- }), Xo = /* @__PURE__ */ se(Lo, [["__scopeId", "data-v-beeee67e"]]);
4049
+ }), Xo = /* @__PURE__ */ oe(Lo, [["__scopeId", "data-v-beeee67e"]]);
4041
4050
  export {
4042
4051
  An as AdminLanding,
4043
4052
  Wn as AdminNav,
4044
- On as AdminShell,
4053
+ Pn as AdminShell,
4045
4054
  Et as COLLECTION_MAX_LIMIT,
4046
4055
  $e as HttpError,
4047
- Le as MIN_CHUNK,
4056
+ ze as MIN_CHUNK,
4048
4057
  rn as WxBackButton,
4049
4058
  Xo as WxBackupNote,
4050
- Pl as WxCategoriesField,
4059
+ Ol as WxCategoriesField,
4051
4060
  io as WxCategoriesPage,
4052
4061
  oo as WxCategoryCreateDialog,
4053
4062
  po as WxCategoryEditorPage,
4054
- wt as WxCategorySlug,
4063
+ _t as WxCategorySlug,
4055
4064
  ga as WxCollectionField,
4056
- Ee as WxDate,
4065
+ Ue as WxDate,
4057
4066
  jo as WxFilterChips,
4058
4067
  qo as WxHelpButton,
4059
4068
  sn as WxHistory,
4060
4069
  Wa as WxLinkField,
4061
4070
  Aa as WxLinkPicker,
4062
- Pt as WxListScreen,
4071
+ Ot as WxListScreen,
4063
4072
  Yo as WxNotes,
4064
4073
  Nt as WxRelationsField,
4065
4074
  Ko as WxRenameButton,
4066
4075
  gn as WxRichTextField,
4067
- it as WxRowMenu,
4076
+ rt as WxRowMenu,
4068
4077
  co as WxSaveState,
4069
4078
  mo as WxScreen,
4070
- Ot as WxScreenHead,
4071
- wt as WxSlugField,
4079
+ Pt as WxScreenHead,
4080
+ _t as WxSlugField,
4072
4081
  Bl as WxSourceSelect,
4073
4082
  Dt as adminKey,
4074
4083
  Rt as adminMessages,
@@ -4082,12 +4091,12 @@ export {
4082
4091
  La as createDates,
4083
4092
  Ua as createHistoryApi,
4084
4093
  Fl as createHttp,
4085
- st as createI18n,
4094
+ it as createI18n,
4086
4095
  wa as createLinksApi,
4087
4096
  Qn as createNotesApi,
4088
4097
  jl as createRelationsApi,
4089
4098
  Dn as createTheme,
4090
- yt as defaultMarkup,
4099
+ gt as defaultMarkup,
4091
4100
  ba as emptyLink,
4092
4101
  Va as errorText,
4093
4102
  eo as forgetUnfinishedUpload,
@@ -4095,7 +4104,7 @@ export {
4095
4104
  je as historyValue,
4096
4105
  Be as i18nKey,
4097
4106
  no as itemOrderMode,
4098
- ht as normaliseCollection,
4107
+ yt as normaliseCollection,
4099
4108
  Kl as normaliseRelations,
4100
4109
  Tn as provideAdmin,
4101
4110
  ao as provideCategoryEditor,
@@ -4104,20 +4113,20 @@ export {
4104
4113
  bn as provideRecordAddress,
4105
4114
  Ro as provideRelationOwner,
4106
4115
  Bn as provideTheme,
4107
- pt as readCookie,
4116
+ ht as readCookie,
4108
4117
  Bt as recordAddressKey,
4109
4118
  Vt as relationOwnerKey,
4110
4119
  Jn as renderMarkdown,
4111
4120
  Rl as reorderItems,
4112
4121
  Ho as rowMenuWidth,
4113
4122
  Ft as themeKey,
4114
- Oo as unfinishedUploads,
4123
+ Po as unfinishedUploads,
4115
4124
  qe as uploadFingerprint,
4116
- te as useAdmin,
4125
+ ee as useAdmin,
4117
4126
  Gn as useBodyKeys,
4118
4127
  Bo as useCategoryEditor,
4119
- dt as useCategoryWords,
4120
- Po as useChunkedUpload,
4128
+ ct as useCategoryWords,
4129
+ Oo as useChunkedUpload,
4121
4130
  It as useDates,
4122
4131
  De as useErrorText,
4123
4132
  Ia as useHistorySubject,