@webx-ui/module-admin 0.22.0 → 0.23.1

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 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";
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 tt, provide as Re, normalizeClass as ve, createSlots as Ie, nextTick as lt, useId as qt, Fragment as K, onMounted as Se, renderList as se, withModifiers as St, useSlots as Yt, useTemplateRef as at, 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 nt, 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 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";
3
+ import { WxSortableList as ot, WxAction as be, WxBadge as Pe, WxSelect as ke, WxAutocomplete as Je, WxSwitch as Fe, WxInputNumber as sl, WxButton as de, WxSegmented as il, WxText as Q, WxInput as Te, WxCheckbox as vt, WxTooltip as Wt, WxEmpty as Ne, WxSkeleton as ye, WxAvatar as Lt, WxDialog as st, toast as Z, WxActions as rl, WxDropdownItem as ul, useElementWidth as dl, WxHeading as cl, WxIcon as it, WxTabs as fl, WxCard as Ge, 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 pt, WxActionBar as Cl, WxPopover as Al, WxTextarea as ht } 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,18 +12,18 @@ function Nl() {
12
12
  }
13
13
  function J(e) {
14
14
  const t = fe(Be, null);
15
- return t === null ? it().scope(e) : t.scope(e);
15
+ return t === null ? rt().scope(e) : t.scope(e);
16
16
  }
17
17
  function El(e, t) {
18
18
  e.provide(Be, t);
19
19
  }
20
- function it(e = {}) {
20
+ function rt(e = {}) {
21
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 = Ve({ value: {} });
26
+ }), n = {}, o = Ve({ value: {} });
27
27
  function i(r, c, v) {
28
28
  let h = r[c]?.[v[0] ?? ""];
29
29
  for (const m of v.slice(1)) {
@@ -33,8 +33,8 @@ function it(e = {}) {
33
33
  }
34
34
  return typeof h == "string" ? h : null;
35
35
  }
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
36
+ function s(r, c, v) {
37
+ const [h, m] = c.includes("::") ? c.split("::", 2) : [r, c], u = m.split("."), f = i(o.value, h, u) ?? i(n, 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
39
  c;
40
40
  return v === void 0 ? f : Ul(f, v);
@@ -42,43 +42,43 @@ function it(e = {}) {
42
42
  return {
43
43
  state: l,
44
44
  defaults(r, c) {
45
- s[r] = { ...s[r], ...c };
45
+ n[r] = { ...n[r], ...c };
46
46
  },
47
47
  load(r, c, v) {
48
- n.value = r ?? {}, l.locale = c ?? l.locale, v !== void 0 && (l.fallback = v);
48
+ o.value = r ?? {}, l.locale = c ?? l.locale, v !== void 0 && (l.fallback = v);
49
49
  },
50
50
  scope(r) {
51
- return (c, v) => o(r, c, v);
51
+ return (c, v) => s(r, c, v);
52
52
  },
53
- t: (r, c) => o("", r, c)
53
+ t: (r, c) => s("", r, c)
54
54
  };
55
55
  }
56
56
  function Ul(e, t) {
57
57
  let l = e;
58
- for (const [s, n] of Object.entries(t))
59
- l = l.replaceAll(`:${s}`, String(n));
58
+ for (const [n, o] of Object.entries(t))
59
+ l = l.replaceAll(`:${n}`, String(o));
60
60
  return l;
61
61
  }
62
62
  function _e(e, t) {
63
- const l = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`, s = (n) => n.data;
63
+ const l = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`, n = (o) => o.data;
64
64
  return {
65
- list: (n = {}) => {
65
+ list: (o = {}) => {
66
66
  const i = new URLSearchParams();
67
- return n.q && i.set("q", n.q), n.visible && i.set("visible", "1"), e.http.get(i.size > 0 ? `${l}?${i}` : l);
67
+ return o.q && i.set("q", o.q), o.visible && i.set("visible", "1"), e.http.get(i.size > 0 ? `${l}?${i}` : l);
68
68
  },
69
- create: (n) => e.http.post(l, n).then(s),
70
- get: (n) => e.http.get(`${l}/${n}`).then(s),
71
- save: (n, i) => e.http.put(`${l}/${n}`, { values: i }).then(s),
72
- remove: (n) => e.http.delete(`${l}/${n}`).then(() => {
69
+ create: (o) => e.http.post(l, o).then(n),
70
+ get: (o) => e.http.get(`${l}/${o}`).then(n),
71
+ save: (o, i) => e.http.put(`${l}/${o}`, { values: i }).then(n),
72
+ remove: (o) => e.http.delete(`${l}/${o}`).then(() => {
73
73
  }),
74
- restore: (n) => e.http.post(`${l}/${n}/restore`, {}).then(s),
75
- reorder: (n) => e.http.post(`${l}/reorder`, { ids: n }).then(() => {
74
+ restore: (o) => e.http.post(`${l}/${o}/restore`, {}).then(n),
75
+ reorder: (o) => e.http.post(`${l}/reorder`, { ids: o }).then(() => {
76
76
  })
77
77
  };
78
78
  }
79
- function Rl(e, t, l, s = null) {
80
- const n = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`;
81
- return e.http.post(`${n}/reorder`, s === null ? { ids: l } : { ids: l, category: s }).then(() => {
79
+ function Rl(e, t, l, n = null) {
80
+ const o = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`;
81
+ return e.http.post(`${o}/reorder`, n === null ? { ids: l } : { ids: l, category: n }).then(() => {
82
82
  });
83
83
  }
84
84
  const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field__name" }, Pl = /* @__PURE__ */ q({
@@ -99,12 +99,12 @@ 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 = ee(), n = J("webx-admin"), i = A([]);
102
+ const t = e, l = ge(e, "modelValue"), n = ee(), o = J("webx-admin"), i = A([]);
103
103
  ie(
104
104
  () => t.source,
105
105
  async (u) => {
106
106
  try {
107
- const f = await _e(s, u).list();
107
+ const f = await _e(n, u).list();
108
108
  i.value = f.data.map((k) => ({ id: k.id, name: k.name }));
109
109
  } catch {
110
110
  i.value = [];
@@ -112,22 +112,22 @@ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field_
112
112
  },
113
113
  { immediate: !0 }
114
114
  );
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}` })),
115
+ const s = _(() => Array.isArray(l.value) ? l.value : []), r = _(() => new Map(i.value.map((u) => [u.id, u.name]))), c = _({
116
+ get: () => s.value.map((u) => ({ id: u, name: r.value.get(u) ?? `#${u}` })),
117
117
  set: (u) => {
118
118
  l.value = u.map((f) => f.id);
119
119
  }
120
120
  }), v = _(
121
- () => i.value.filter((u) => !o.value.includes(u.id)).map((u) => ({ label: u.name, value: u.id }))
121
+ () => i.value.filter((u) => !s.value.includes(u.id)).map((u) => ({ label: u.name, value: u.id }))
122
122
  );
123
123
  function h(u) {
124
- typeof u != "number" || o.value.includes(u) || (l.value = [...o.value, u]);
124
+ typeof u != "number" || s.value.includes(u) || (l.value = [...s.value, u]);
125
125
  }
126
126
  function m(u) {
127
- l.value = o.value.filter((f) => f !== u);
127
+ l.value = s.value.filter((f) => f !== u);
128
128
  }
129
129
  return (u, f) => (d(), S("div", Il, [
130
- x(a(nt), {
130
+ x(a(ot), {
131
131
  modelValue: c.value,
132
132
  "onUpdate:modelValue": f[0] || (f[0] = (k) => c.value = k),
133
133
  plain: "",
@@ -135,7 +135,7 @@ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field_
135
135
  "item-key": "id",
136
136
  "item-label": "name",
137
137
  disabled: t.disabled,
138
- "empty-text": t.emptyText ?? a(n)("categories.field-empty")
138
+ "empty-text": t.emptyText ?? a(o)("categories.field-empty")
139
139
  }, {
140
140
  default: w(({ item: k, index: p }) => [
141
141
  M("span", Ml, C(k.name), 1),
@@ -144,7 +144,7 @@ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field_
144
144
  type: "primary"
145
145
  }, {
146
146
  default: w(() => [
147
- R(C(t.mainText ?? a(n)("categories.field-main")), 1)
147
+ R(C(t.mainText ?? a(o)("categories.field-main")), 1)
148
148
  ]),
149
149
  _: 1
150
150
  })) : E("", !0)
@@ -154,7 +154,7 @@ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field_
154
154
  type: "remove",
155
155
  size: "sm",
156
156
  disabled: t.disabled,
157
- title: t.removeText ?? a(n)("categories.field-remove"),
157
+ title: t.removeText ?? a(o)("categories.field-remove"),
158
158
  onClick: (p) => m(k.id)
159
159
  }, null, 8, ["disabled", "title", "onClick"])
160
160
  ]),
@@ -163,20 +163,20 @@ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field_
163
163
  x(a(ke), {
164
164
  "model-value": null,
165
165
  options: v.value,
166
- placeholder: t.addText ?? a(n)("categories.field-add"),
166
+ placeholder: t.addText ?? a(o)("categories.field-add"),
167
167
  disabled: t.disabled || v.value.length === 0,
168
- "empty-text": t.noneLeftText ?? a(n)("categories.field-none-left"),
168
+ "empty-text": t.noneLeftText ?? a(o)("categories.field-none-left"),
169
169
  filterable: "",
170
170
  teleport: "",
171
- "aria-label": t.addText ?? a(n)("categories.field-add"),
171
+ "aria-label": t.addText ?? a(o)("categories.field-add"),
172
172
  "onUpdate:modelValue": h
173
173
  }, null, 8, ["options", "placeholder", "disabled", "empty-text", "aria-label"])
174
174
  ]));
175
175
  }
176
176
  }), oe = (e, t) => {
177
177
  const l = e.__vccOpts || e;
178
- for (const [s, n] of t)
179
- l[s] = n;
178
+ for (const [n, o] of t)
179
+ l[n] = o;
180
180
  return l;
181
181
  }, Ol = /* @__PURE__ */ oe(Pl, [["__scopeId", "data-v-640cd836"]]), Bl = /* @__PURE__ */ q({
182
182
  name: "WxSourceSelect",
@@ -187,30 +187,30 @@ 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 = ee(), s = A([]);
190
+ const t = e, l = ee(), n = A([]);
191
191
  ie(
192
192
  () => t.source,
193
193
  async (i) => {
194
194
  if (!i) {
195
- s.value = [];
195
+ n.value = [];
196
196
  return;
197
197
  }
198
198
  try {
199
- const o = await _e(l, i).list();
200
- s.value = o.data.map((r) => ({ label: r.name, value: r.id }));
199
+ const s = await _e(l, i).list();
200
+ n.value = s.data.map((r) => ({ label: r.name, value: r.id }));
201
201
  } catch {
202
- s.value = [];
202
+ n.value = [];
203
203
  }
204
204
  },
205
205
  { immediate: !0 }
206
206
  );
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"]));
207
+ const o = _(() => t.source ? n.value : t.options);
208
+ return (i, s) => (d(), L(a(ke), tt(i.$attrs, { options: o.value }), null, 16, ["options"]));
209
209
  }
210
210
  });
211
211
  class $e extends Error {
212
- constructor(t, l, s = {}, n = null, i = null) {
213
- super(t), this.status = l, this.errors = s, this.retryAfter = n, this.body = i, this.name = "HttpError";
212
+ constructor(t, l, n = {}, o = null, i = null) {
213
+ super(t), this.status = l, this.errors = n, this.retryAfter = o, this.body = i, this.name = "HttpError";
214
214
  }
215
215
  status;
216
216
  errors;
@@ -229,10 +229,10 @@ class $e extends Error {
229
229
  }
230
230
  const Dl = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
231
231
  function Fl(e = {}) {
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
- let o = !1;
232
+ const t = (e.baseUrl ?? "").replace(/\/$/, ""), l = e.csrfUrl ?? "/api/cms/auth/csrf-cookie", n = e.fetch ?? globalThis.fetch.bind(globalThis), o = e.onUnauthenticated, i = e.headers;
233
+ let s = !1;
234
234
  async function r(h = !1) {
235
- o && !h && ht("XSRF-TOKEN") !== null || (await s(l, { credentials: "same-origin" }), o = !0);
235
+ s && !h && yt("XSRF-TOKEN") !== null || (await n(l, { credentials: "same-origin" }), s = !0);
236
236
  }
237
237
  async function c(h, m, u = {}, f = !1) {
238
238
  const k = Dl.has(h);
@@ -245,18 +245,18 @@ function Fl(e = {}) {
245
245
  ...u.headers
246
246
  };
247
247
  if (k) {
248
- const b = ht("XSRF-TOKEN");
248
+ const b = yt("XSRF-TOKEN");
249
249
  b !== null && (p["X-XSRF-TOKEN"] = b);
250
250
  }
251
251
  u.json === !0 && (p["Content-Type"] = "application/json");
252
- const $ = await s(Hl(t, m, u.query), {
252
+ const $ = await n(Hl(t, m, u.query), {
253
253
  method: h,
254
254
  credentials: "same-origin",
255
255
  headers: p,
256
256
  signal: u.signal,
257
257
  body: u.body ?? void 0
258
258
  });
259
- return $.status === 419 && k && !f ? (await r(!0), c(h, m, u, !0)) : ($.status === 401 && n?.(), $);
259
+ return $.status === 419 && k && !f ? (await r(!0), c(h, m, u, !0)) : ($.status === 401 && o?.(), $);
260
260
  }
261
261
  async function v(h, m, u, f = {}) {
262
262
  const k = await c(h, m, {
@@ -265,7 +265,7 @@ function Fl(e = {}) {
265
265
  body: u === void 0 ? void 0 : JSON.stringify(u)
266
266
  });
267
267
  if (!k.ok)
268
- throw await Ge(k);
268
+ throw await Qe(k);
269
269
  if (k.status !== 204)
270
270
  return await k.json();
271
271
  }
@@ -278,46 +278,46 @@ function Fl(e = {}) {
278
278
  send: (h, m, u) => c(h.toUpperCase(), m, u)
279
279
  };
280
280
  }
281
- async function Ge(e) {
281
+ async function Qe(e) {
282
282
  let t = null;
283
283
  try {
284
284
  t = await e.json();
285
285
  } catch {
286
286
  }
287
- const l = t ?? {}, s = typeof l.message == "string" && l.message !== "" ? l.message : e.statusText || `Request failed with ${e.status}`, n = l.errors !== null && typeof l.errors == "object" ? l.errors : {}, i = e.headers.get("Retry-After"), o = i === null ? null : Number.parseInt(i, 10);
287
+ const l = t ?? {}, n = typeof l.message == "string" && l.message !== "" ? l.message : e.statusText || `Request failed with ${e.status}`, o = l.errors !== null && typeof l.errors == "object" ? l.errors : {}, i = e.headers.get("Retry-After"), s = i === null ? null : Number.parseInt(i, 10);
288
288
  return new $e(
289
- s,
290
- e.status,
291
289
  n,
292
- Number.isFinite(o) ? o : null,
290
+ e.status,
291
+ o,
292
+ Number.isFinite(s) ? s : null,
293
293
  t
294
294
  );
295
295
  }
296
296
  function Hl(e, t, l) {
297
- const n = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
297
+ const o = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
298
298
  if (l === void 0)
299
- return n;
299
+ return o;
300
300
  const i = new URLSearchParams();
301
301
  for (const [r, c] of Object.entries(l))
302
302
  c != null && i.set(r, String(c));
303
- const o = i.toString();
304
- return o === "" ? n : `${n}${n.includes("?") ? "&" : "?"}${o}`;
303
+ const s = i.toString();
304
+ return s === "" ? o : `${o}${o.includes("?") ? "&" : "?"}${s}`;
305
305
  }
306
- function ht(e) {
306
+ function yt(e) {
307
307
  if (typeof document > "u")
308
308
  return null;
309
309
  for (const t of document.cookie.split(";")) {
310
- const [l, ...s] = t.trim().split("=");
310
+ const [l, ...n] = t.trim().split("=");
311
311
  if (l === e)
312
- return decodeURIComponent(s.join("="));
312
+ return decodeURIComponent(n.join("="));
313
313
  }
314
314
  return null;
315
315
  }
316
316
  function jl(e, t) {
317
317
  const l = `${e.apiPath}/relations/${encodeURIComponent(t)}`;
318
318
  return {
319
- search: (s) => e.http.get(l, { query: { q: s } }).then((n) => n.data),
320
- named: (s) => s.length === 0 ? Promise.resolve([]) : e.http.get(`${l}?${s.map((n) => `ids[]=${n}`).join("&")}`).then((n) => n.data)
319
+ search: (n) => e.http.get(l, { query: { q: n } }).then((o) => o.data),
320
+ named: (n) => n.length === 0 ? Promise.resolve([]) : e.http.get(`${l}?${n.map((o) => `ids[]=${o}`).join("&")}`).then((o) => o.data)
321
321
  };
322
322
  }
323
323
  function Kl(e) {
@@ -355,7 +355,7 @@ 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 = 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));
358
+ const t = e, l = ge(e, "modelValue"), n = ee(), o = ql(), i = J("webx-admin"), s = _(() => jl(n, 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
359
  function k(V) {
360
360
  const U = new Map(r.value);
361
361
  for (const O of V) U.set(O.id, O);
@@ -365,7 +365,7 @@ const Yl = ["src"], Xl = { class: "wx-relations-field__text" }, Jl = { class: "w
365
365
  const U = V.filter((O) => !r.value.has(O) && !c.value.has(O));
366
366
  if (!(U.length === 0 || v.value))
367
367
  try {
368
- const O = await o.value.named(U);
368
+ const O = await s.value.named(U);
369
369
  k(O);
370
370
  const te = new Set(O.map((re) => re.id));
371
371
  c.value = /* @__PURE__ */ new Set([...c.value, ...U.filter((re) => !te.has(re))]);
@@ -389,7 +389,7 @@ const Yl = ["src"], Xl = { class: "wx-relations-field__text" }, Jl = { class: "w
389
389
  set: (V) => {
390
390
  l.value = V.map((U) => U.id);
391
391
  }
392
- }), b = _(() => t.max !== null && f.value.length >= t.max), P = _(() => n !== null && n.type === t.target ? n.id.value : null), H = _(
392
+ }), b = _(() => t.max !== null && f.value.length >= t.max), P = _(() => o !== null && o.type === t.target ? o.id.value : null), H = _(
393
393
  () => h.value.filter((V) => V.id !== P.value && !f.value.includes(V.id)).map((V) => ({
394
394
  value: V.title,
395
395
  description: [V.subtitle, V.visible ? null : i("relations.field-hidden")].filter((U) => typeof U == "string" && U !== "").join(" · "),
@@ -399,7 +399,7 @@ const Yl = ["src"], Xl = { class: "wx-relations-field__text" }, Jl = { class: "w
399
399
  async function j(V) {
400
400
  m.value = !0;
401
401
  try {
402
- const U = await o.value.search(V);
402
+ const U = await s.value.search(V);
403
403
  h.value = U, k(U);
404
404
  } catch (U) {
405
405
  h.value = [], U instanceof $e && U.status === 403 && (v.value = !0);
@@ -409,7 +409,7 @@ const Yl = ["src"], Xl = { class: "wx-relations-field__text" }, Jl = { class: "w
409
409
  }
410
410
  function F(V) {
411
411
  const U = Number(V.id);
412
- !Number.isInteger(U) || f.value.includes(U) || b.value || (l.value = [...f.value, U], tt(() => {
412
+ !Number.isInteger(U) || f.value.includes(U) || b.value || (l.value = [...f.value, U], lt(() => {
413
413
  u.value = "";
414
414
  }));
415
415
  }
@@ -425,7 +425,7 @@ const Yl = ["src"], Xl = { class: "wx-relations-field__text" }, Jl = { class: "w
425
425
  return (V, U) => (d(), S("div", {
426
426
  class: ve(["wx-relations-field", { "is-unordered": !t.sortable }])
427
427
  }, [
428
- x(a(nt), {
428
+ x(a(ot), {
429
429
  modelValue: $.value,
430
430
  "onUpdate:modelValue": U[0] || (U[0] = (O) => $.value = O),
431
431
  plain: "",
@@ -473,7 +473,7 @@ const Yl = ["src"], Xl = { class: "wx-relations-field__text" }, Jl = { class: "w
473
473
  }
474
474
  ]), 1032, ["modelValue", "disabled", "empty-text", "drag-label"]),
475
475
  v.value ? (d(), S("p", Ql, C(a(i)("relations.field-forbidden")), 1)) : (d(), S("div", Zl, [
476
- x(a(Xe), {
476
+ x(a(Je), {
477
477
  modelValue: u.value,
478
478
  "onUpdate:modelValue": U[1] || (U[1] = (O) => u.value = O),
479
479
  options: H.value,
@@ -494,14 +494,14 @@ const Yl = ["src"], Xl = { class: "wx-relations-field__text" }, Jl = { class: "w
494
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
- 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;
497
+ return t === void 0 && (t = e.http.get(`${e.apiPath}/collections`).then((l) => l.data.map((n) => ({ ...n, relations: la(n) }))), t.catch(() => He.delete(e)), He.set(e, t)), t;
498
498
  }
499
499
  function la(e) {
500
500
  return Array.isArray(e.relations) ? e.relations.flatMap((t) => {
501
501
  if (typeof t == "string") return t === "" ? [] : [{ key: t, title: t }];
502
502
  if (typeof t == "object" && t !== null && typeof t.key == "string") {
503
- const { key: l, title: s } = t;
504
- return [{ key: l, title: typeof s == "string" && s !== "" ? s : l }];
503
+ const { key: l, title: n } = t;
504
+ return [{ key: l, title: typeof n == "string" && n !== "" ? n : l }];
505
505
  }
506
506
  return [];
507
507
  }) : [];
@@ -516,14 +516,14 @@ function aa(e) {
516
516
  const {
517
517
  type: t,
518
518
  ids: l,
519
- current: s
519
+ current: n
520
520
  } = e;
521
- if (s === !0 && typeof t == "string" && t !== "")
521
+ if (n === !0 && typeof t == "string" && t !== "")
522
522
  return { type: t, ids: [], current: !0 };
523
- const n = Ut(l);
524
- return typeof t == "string" && t !== "" && n.length > 0 ? { type: t, ids: n } : null;
523
+ const o = Ut(l);
524
+ return typeof t == "string" && t !== "" && o.length > 0 ? { type: t, ids: o } : null;
525
525
  }
526
- function yt(e) {
526
+ function gt(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 yt(e) {
533
533
  markup: typeof t.markup == "boolean" ? t.markup : null
534
534
  };
535
535
  }
536
- function gt(e) {
536
+ function bt(e) {
537
537
  return e.categories.length === 0 && e.related === null;
538
538
  }
539
539
  const na = ["aria-busy"], oa = {
@@ -560,19 +560,19 @@ 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 = ee(), n = J("webx-admin"), i = qt(), o = A(void 0), r = A([]);
563
+ const t = e, l = ge(e, "modelValue"), n = ee(), o = J("webx-admin"), i = qt(), s = A(void 0), r = A([]);
564
564
  ie(
565
565
  () => t.source,
566
566
  async (y) => {
567
- o.value = void 0, r.value = [];
567
+ s.value = void 0, r.value = [];
568
568
  try {
569
- o.value = (await ta(s)).find((W) => W.key === y) ?? null;
569
+ s.value = (await ta(n)).find((W) => W.key === y) ?? null;
570
570
  } catch {
571
- o.value = null;
571
+ s.value = null;
572
572
  }
573
- if (o.value?.categories)
573
+ if (s.value?.categories)
574
574
  try {
575
- const W = await _e(s, o.value.categories).list();
575
+ const W = await _e(n, s.value.categories).list();
576
576
  r.value = W.data.map((T) => ({ label: T.name, value: T.id }));
577
577
  } catch {
578
578
  r.value = [];
@@ -580,9 +580,9 @@ const na = ["aria-busy"], oa = {
580
580
  },
581
581
  { immediate: !0 }
582
582
  );
583
- const c = _(() => yt(l.value));
583
+ const c = _(() => gt(l.value));
584
584
  function v(y) {
585
- l.value = yt({ ...c.value, ...y });
585
+ l.value = gt({ ...c.value, ...y });
586
586
  }
587
587
  const h = _(() => {
588
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 }));
@@ -595,9 +595,9 @@ const na = ["aria-busy"], oa = {
595
595
  v({ limit: y ?? null });
596
596
  }
597
597
  const f = A(null), k = _(
598
- () => (o.value?.relations ?? []).map((y) => ({ label: y.title, value: y.key }))
598
+ () => (s.value?.relations ?? []).map((y) => ({ label: y.title, value: y.key }))
599
599
  ), p = _(() => {
600
- const y = o.value?.relations ?? [];
600
+ const y = s.value?.relations ?? [];
601
601
  if (y.length === 1) return y[0];
602
602
  const W = c.value.related?.type ?? f.value;
603
603
  return y.find((T) => T.key === W) ?? null;
@@ -613,32 +613,32 @@ const na = ["aria-busy"], oa = {
613
613
  const W = p.value?.key;
614
614
  v({ related: y && W ? { type: W, ids: [], current: !0 } : null });
615
615
  }
616
- const H = _(() => c.value.markup ?? gt(c.value));
616
+ const H = _(() => c.value.markup ?? bt(c.value));
617
617
  function j(y) {
618
618
  v({ markup: y === !0 });
619
619
  }
620
620
  const F = _(
621
- () => n(
622
- gt(c.value) ? "collections.field-markup-auto-on" : "collections.field-markup-auto-off"
621
+ () => o(
622
+ bt(c.value) ? "collections.field-markup-auto-on" : "collections.field-markup-auto-off"
623
623
  )
624
624
  );
625
625
  return (y, W) => (d(), S("div", {
626
626
  class: "wx-collection-field",
627
- "aria-busy": o.value === void 0
627
+ "aria-busy": s.value === void 0
628
628
  }, [
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
- M("p", sa, C(a(n)("collections.field-source", { source: o.value.title })), 1),
631
- o.value.categories ? (d(), S("div", ia, [
629
+ s.value === null ? (d(), S("p", oa, C(a(o)("collections.field-unavailable", { source: t.source })), 1)) : s.value ? (d(), S(K, { key: 1 }, [
630
+ M("p", sa, C(a(o)("collections.field-source", { source: s.value.title })), 1),
631
+ s.value.categories ? (d(), S("div", ia, [
632
632
  M("label", {
633
633
  class: "wx-collection-field__label",
634
634
  for: `${a(i)}-categories`
635
- }, C(a(n)("collections.field-categories")), 9, ra),
635
+ }, C(a(o)("collections.field-categories")), 9, ra),
636
636
  x(a(ke), {
637
637
  id: `${a(i)}-categories`,
638
638
  "model-value": c.value.categories,
639
639
  options: h.value,
640
- placeholder: c.value.categories.length === 0 ? a(n)("collections.field-all") : "",
641
- "empty-text": a(n)("collections.field-no-categories"),
640
+ placeholder: c.value.categories.length === 0 ? a(o)("collections.field-all") : "",
641
+ "empty-text": a(o)("collections.field-no-categories"),
642
642
  disabled: t.disabled,
643
643
  multiple: "",
644
644
  filterable: "",
@@ -647,14 +647,14 @@ const na = ["aria-busy"], oa = {
647
647
  "onUpdate:modelValue": m
648
648
  }, null, 8, ["id", "model-value", "options", "placeholder", "empty-text", "disabled"])
649
649
  ])) : E("", !0),
650
- o.value.relations.length > 0 ? (d(), S("div", ua, [
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(), L(a(ke), {
650
+ s.value.relations.length > 0 ? (d(), S("div", ua, [
651
+ M("span", da, C(s.value.relations.length === 1 ? a(o)("relations.collection-related-to", { target: s.value.relations[0].title }) : a(o)("relations.collection-related")), 1),
652
+ s.value.relations.length > 1 ? (d(), L(a(ke), {
653
653
  key: 0,
654
654
  "model-value": p.value?.key ?? null,
655
655
  options: k.value,
656
- placeholder: a(n)("relations.collection-related-type"),
657
- "aria-label": a(n)("relations.collection-related-type"),
656
+ placeholder: a(o)("relations.collection-related-type"),
657
+ "aria-label": a(o)("relations.collection-related-type"),
658
658
  disabled: t.disabled,
659
659
  clearable: "",
660
660
  teleport: "",
@@ -663,18 +663,18 @@ const na = ["aria-busy"], oa = {
663
663
  p.value ? (d(), S(K, { key: 1 }, [
664
664
  x(a(Fe), {
665
665
  "model-value": c.value.related?.current === !0,
666
- label: a(n)("relations.collection-related-current"),
666
+ label: a(o)("relations.collection-related-current"),
667
667
  disabled: t.disabled,
668
668
  "onUpdate:modelValue": W[0] || (W[0] = (T) => P(T === !0))
669
669
  }, null, 8, ["model-value", "label", "disabled"]),
670
- M("p", ca, C(a(n)("relations.collection-related-current-hint", { target: p.value.title })), 1)
670
+ M("p", ca, C(a(o)("relations.collection-related-current-hint", { target: p.value.title })), 1)
671
671
  ], 64)) : E("", !0),
672
672
  p.value && c.value.related?.current !== !0 ? (d(), L(Nt, {
673
673
  key: 2,
674
674
  "model-value": c.value.related?.ids ?? [],
675
675
  target: p.value.key,
676
676
  sortable: !1,
677
- "empty-text": a(n)("relations.collection-related-any"),
677
+ "empty-text": a(o)("relations.collection-related-any"),
678
678
  disabled: t.disabled,
679
679
  "onUpdate:modelValue": b
680
680
  }, null, 8, ["model-value", "target", "empty-text", "disabled"])) : E("", !0)
@@ -683,7 +683,7 @@ const na = ["aria-busy"], oa = {
683
683
  M("label", {
684
684
  class: "wx-collection-field__label",
685
685
  for: `${a(i)}-limit`
686
- }, C(a(n)("collections.field-limit")), 9, ma),
686
+ }, C(a(o)("collections.field-limit")), 9, ma),
687
687
  M("div", va, [
688
688
  x(a(sl), {
689
689
  id: `${a(i)}-limit`,
@@ -692,23 +692,23 @@ const na = ["aria-busy"], oa = {
692
692
  max: a(Et),
693
693
  step: 1,
694
694
  precision: 0,
695
- placeholder: a(n)("collections.field-limit-all"),
695
+ placeholder: a(o)("collections.field-limit-all"),
696
696
  disabled: t.disabled,
697
697
  "onUpdate:modelValue": u
698
698
  }, null, 8, ["id", "model-value", "max", "placeholder", "disabled"])
699
699
  ])
700
700
  ]),
701
- o.value.categories ? (d(), L(a(Fe), {
701
+ s.value.categories ? (d(), L(a(Fe), {
702
702
  key: 2,
703
703
  "model-value": c.value.filter,
704
- label: a(n)("collections.field-filter"),
704
+ label: a(o)("collections.field-filter"),
705
705
  disabled: t.disabled,
706
706
  "onUpdate:modelValue": W[1] || (W[1] = (T) => v({ filter: T === !0 }))
707
707
  }, null, 8, ["model-value", "label", "disabled"])) : E("", !0),
708
- o.value.markup ? (d(), S("div", pa, [
708
+ s.value.markup ? (d(), S("div", pa, [
709
709
  x(a(Fe), {
710
710
  "model-value": H.value,
711
- label: a(n)("collections.field-markup"),
711
+ label: a(o)("collections.field-markup"),
712
712
  disabled: t.disabled,
713
713
  "onUpdate:modelValue": j
714
714
  }, null, 8, ["model-value", "label", "disabled"]),
@@ -722,7 +722,7 @@ const na = ["aria-busy"], oa = {
722
722
  onClick: W[2] || (W[2] = (T) => v({ markup: null }))
723
723
  }, {
724
724
  default: w(() => [
725
- R(C(a(n)("collections.field-markup-reset")), 1)
725
+ R(C(a(o)("collections.field-markup-reset")), 1)
726
726
  ]),
727
727
  _: 1
728
728
  }, 8, ["disabled"])) : E("", !0)
@@ -743,11 +743,11 @@ function ba() {
743
743
  };
744
744
  }
745
745
  function wa(e) {
746
- const t = `${e.apiPath}/links`, l = (s) => s.data;
746
+ const t = `${e.apiPath}/links`, l = (n) => n.data;
747
747
  return {
748
748
  sources: () => e.http.get(`${t}/sources`).then(l),
749
- search: (s, n, i) => e.http.get(`${t}/search`, { query: { type: s, q: n, locale: i } }).then(l),
750
- resolve: (s, n) => e.http.post(`${t}/resolve`, { links: s, locale: n }).then(l),
749
+ search: (n, o, i) => e.http.get(`${t}/search`, { query: { type: n, q: o, locale: i } }).then(l),
750
+ resolve: (n, o) => e.http.post(`${t}/resolve`, { links: n, locale: o }).then(l),
751
751
  routes: () => e.http.get(`${t}/routes`).then(l)
752
752
  };
753
753
  }
@@ -776,14 +776,14 @@ 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 = 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);
779
+ const t = e, l = ge(e, "modelValue"), n = ee(), o = Nl(), i = wa(n), s = J("webx-admin"), r = A([]), c = A([]), v = A([]), h = A(!1), m = A(null), u = A(""), f = A(null);
780
780
  let k = null;
781
781
  const p = _(() => l.value ?? ba()), $ = _(() => {
782
782
  const g = [
783
- { value: "entity", label: o("links.target-entity") },
784
- { value: "url", label: o("links.target-url") }
783
+ { value: "entity", label: s("links.target-entity") },
784
+ { value: "url", label: s("links.target-url") }
785
785
  ];
786
- return t.allowNone ? [...g, { value: "none", label: o("links.target-none") }] : g;
786
+ return t.allowNone ? [...g, { value: "none", label: s("links.target-none") }] : g;
787
787
  }), b = _(
788
788
  () => r.value.map((g) => ({ value: g.type, label: g.title }))
789
789
  ), P = _(
@@ -811,8 +811,8 @@ const _a = { class: "wx-link-picker" }, xa = {
811
811
  }
812
812
  if (f.value?.id === z)
813
813
  return;
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;
814
+ const [N] = await i.resolve([{ type: g, id: z }], o.state.locale);
815
+ f.value = N ?? null, u.value = N?.title ?? s("links.missing"), k = u.value;
816
816
  }
817
817
  async function F() {
818
818
  v.value = await i.routes();
@@ -825,7 +825,7 @@ const _a = { class: "wx-link-picker" }, xa = {
825
825
  if (k = null, m.value !== null) {
826
826
  h.value = !0;
827
827
  try {
828
- c.value = await i.search(m.value, g, n.state.locale);
828
+ c.value = await i.search(m.value, g, o.state.locale);
829
829
  } finally {
830
830
  h.value = !1;
831
831
  }
@@ -862,7 +862,7 @@ const _a = { class: "wx-link-picker" }, xa = {
862
862
  const z = [g.hint, g.url ?? void 0].filter(
863
863
  (N) => typeof N == "string" && N !== ""
864
864
  );
865
- return g.available || z.push(o("links.unavailable")), z.join(" · ");
865
+ return g.available || z.push(s("links.unavailable")), z.join(" · ");
866
866
  }
867
867
  const B = ["nofollow", "sponsored", "ugc"];
868
868
  return (g, z) => (d(), S("div", _a, [
@@ -870,7 +870,7 @@ const _a = { class: "wx-link-picker" }, xa = {
870
870
  options: $.value,
871
871
  "model-value": p.value.target,
872
872
  disabled: t.disabled,
873
- "aria-label": a(o)("links.target-entity"),
873
+ "aria-label": a(s)("links.target-entity"),
874
874
  "onUpdate:modelValue": W
875
875
  }, null, 8, ["options", "model-value", "disabled", "aria-label"]),
876
876
  p.value.target === "entity" ? (d(), S("div", xa, [
@@ -880,20 +880,20 @@ const _a = { class: "wx-link-picker" }, xa = {
880
880
  options: b.value,
881
881
  "model-value": m.value,
882
882
  disabled: t.disabled,
883
- "aria-label": a(o)("links.section"),
883
+ "aria-label": a(s)("links.section"),
884
884
  "onUpdate:modelValue": T
885
885
  }, null, 8, ["options", "model-value", "disabled", "aria-label"])) : E("", !0),
886
- x(a(Xe), {
886
+ x(a(Je), {
887
887
  class: "wx-link-picker__search",
888
888
  "model-value": u.value,
889
889
  options: P.value,
890
890
  remote: "",
891
891
  clearable: "",
892
892
  loading: h.value,
893
- "loading-text": a(o)("links.searching"),
894
- "empty-text": a(o)("links.empty"),
895
- placeholder: a(o)("links.search"),
896
- "aria-label": a(o)("links.search"),
893
+ "loading-text": a(s)("links.searching"),
894
+ "empty-text": a(s)("links.empty"),
895
+ placeholder: a(s)("links.search"),
896
+ "aria-label": a(s)("links.search"),
897
897
  disabled: t.disabled,
898
898
  "onUpdate:modelValue": z[0] || (z[0] = (N) => u.value = N),
899
899
  onSearch: y,
@@ -901,14 +901,14 @@ const _a = { class: "wx-link-picker" }, xa = {
901
901
  onClear: V
902
902
  }, null, 8, ["model-value", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
903
903
  ])) : p.value.target === "url" ? (d(), S("div", ka, [
904
- x(a(Xe), {
904
+ x(a(Je), {
905
905
  "model-value": p.value.url ?? "",
906
906
  options: H.value,
907
907
  clearable: "",
908
908
  "open-on-focus": "",
909
- "empty-text": a(o)("links.url-routes"),
910
- placeholder: a(o)("links.url-placeholder"),
911
- "aria-label": a(o)("links.url-label"),
909
+ "empty-text": a(s)("links.url-routes"),
910
+ placeholder: a(s)("links.url-placeholder"),
911
+ "aria-label": a(s)("links.url-label"),
912
912
  disabled: t.disabled,
913
913
  "onUpdate:modelValue": U
914
914
  }, null, 8, ["model-value", "options", "empty-text", "placeholder", "aria-label", "disabled"])
@@ -919,7 +919,7 @@ const _a = { class: "wx-link-picker" }, xa = {
919
919
  tone: "muted"
920
920
  }, {
921
921
  default: w(() => [
922
- R(C(a(o)("links.hash")), 1)
922
+ R(C(a(s)("links.hash")), 1)
923
923
  ]),
924
924
  _: 1
925
925
  }),
@@ -929,21 +929,21 @@ const _a = { class: "wx-link-picker" }, xa = {
929
929
  }, "#", -1)),
930
930
  x(a(Te), {
931
931
  "model-value": p.value.hash ?? "",
932
- placeholder: a(o)("links.hash-placeholder"),
933
- "aria-label": a(o)("links.hash"),
932
+ placeholder: a(s)("links.hash-placeholder"),
933
+ "aria-label": a(s)("links.hash"),
934
934
  disabled: t.disabled,
935
935
  clearable: "",
936
936
  "onUpdate:modelValue": O
937
937
  }, null, 8, ["model-value", "placeholder", "aria-label", "disabled"])
938
938
  ])) : E("", !0),
939
939
  t.attributes && p.value.target !== "none" ? (d(), S("div", Sa, [
940
- x(a(mt), {
940
+ x(a(vt), {
941
941
  "model-value": p.value.new_tab,
942
942
  disabled: t.disabled,
943
943
  "onUpdate:modelValue": z[1] || (z[1] = (N) => te(N))
944
944
  }, {
945
945
  default: w(() => [
946
- R(C(a(o)("links.new-tab")), 1)
946
+ R(C(a(s)("links.new-tab")), 1)
947
947
  ]),
948
948
  _: 1
949
949
  }, 8, ["model-value", "disabled"]),
@@ -953,18 +953,18 @@ const _a = { class: "wx-link-picker" }, xa = {
953
953
  tone: "muted"
954
954
  }, {
955
955
  default: w(() => [
956
- R(C(a(o)("links.rel")), 1)
956
+ R(C(a(s)("links.rel")), 1)
957
957
  ]),
958
958
  _: 1
959
959
  }),
960
- (d(), S(K, null, se(B, (N) => x(a(mt), {
960
+ (d(), S(K, null, se(B, (N) => x(a(vt), {
961
961
  key: N,
962
962
  "model-value": p.value.rel.includes(N),
963
963
  disabled: t.disabled,
964
964
  "onUpdate:modelValue": (X) => re(N, X)
965
965
  }, {
966
966
  default: w(() => [
967
- R(C(a(o)(`links.rel-${N}`)), 1)
967
+ R(C(a(s)(`links.rel-${N}`)), 1)
968
968
  ]),
969
969
  _: 2
970
970
  }, 1032, ["model-value", "disabled", "onUpdate:modelValue"])), 64))
@@ -987,10 +987,10 @@ 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(), L(Aa, et({
990
+ return (n, o) => (d(), L(Aa, tt({
991
991
  modelValue: l.value,
992
- "onUpdate:modelValue": n[0] || (n[0] = (i) => l.value = i)
993
- }, s.$attrs, {
992
+ "onUpdate:modelValue": o[0] || (o[0] = (i) => l.value = i)
993
+ }, n.$attrs, {
994
994
  "allow-none": t.allowNone,
995
995
  attributes: t.attributes,
996
996
  disabled: t.disabled
@@ -1043,10 +1043,13 @@ const _a = { class: "wx-link-picker" }, xa = {
1043
1043
  // the parts come from `Intl` — only the words that no formatter knows are here.
1044
1044
  // The two words every list needs the moment it has filters: what the funnel is called,
1045
1045
  // and the way out of all of them at once. The names of the filters themselves belong to
1046
- // whatever is being filtered, and travel with that module's own words.
1046
+ // whatever is being filtered, and travel with that module's own words. The checkboxes of a
1047
+ // list that can be selected say what they do to a screen reader, and do it here too.
1047
1048
  filters: {
1048
1049
  title: "Filters",
1049
- reset: "Reset all"
1050
+ reset: "Reset all",
1051
+ "select-row": "Select row",
1052
+ "select-all": "Select every row on this page"
1050
1053
  },
1051
1054
  dates: {
1052
1055
  today: "today at :time",
@@ -1291,19 +1294,19 @@ const _a = { class: "wx-link-picker" }, xa = {
1291
1294
  };
1292
1295
  function La(e) {
1293
1296
  const t = e.scope("webx-admin"), l = /* @__PURE__ */ new Map();
1294
- function s(i, o, r) {
1297
+ function n(i, s, r) {
1295
1298
  const c = e.state.locale, v = `${c}:${i}`;
1296
1299
  let h = l.get(v);
1297
- return h === void 0 && (h = new Intl.DateTimeFormat(c, o), l.set(v, h)), h.format(r);
1300
+ return h === void 0 && (h = new Intl.DateTimeFormat(c, s), l.set(v, h)), h.format(r);
1298
1301
  }
1299
- const n = (i) => s("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, i);
1302
+ const o = (i) => n("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, i);
1300
1303
  return {
1301
1304
  short(i) {
1302
- const o = Ae(i);
1303
- if (o === null)
1305
+ const s = Ae(i);
1306
+ if (s === null)
1304
1307
  return t("dates.never");
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(
1308
+ const r = /* @__PURE__ */ new Date(), c = wt(s, r);
1309
+ return c === 0 ? t("dates.today", { time: o(s) }) : c === -1 ? t("dates.yesterday", { time: o(s) }) : s.getFullYear() === r.getFullYear() ? n(
1307
1310
  "this-year",
1308
1311
  {
1309
1312
  day: "numeric",
@@ -1312,23 +1315,23 @@ function La(e) {
1312
1315
  minute: "2-digit",
1313
1316
  hourCycle: "h23"
1314
1317
  },
1315
- o
1316
- ) : s("earlier", { day: "numeric", month: "long", year: "numeric" }, o);
1318
+ s
1319
+ ) : n("earlier", { day: "numeric", month: "long", year: "numeric" }, s);
1317
1320
  },
1318
1321
  compact(i) {
1319
- const o = Ae(i);
1320
- if (o === null)
1322
+ const s = Ae(i);
1323
+ if (s === null)
1321
1324
  return t("dates.never");
1322
1325
  const r = /* @__PURE__ */ new Date();
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);
1326
+ return wt(s, r) === 0 ? o(s) : s.getFullYear() === r.getFullYear() ? n("compact", { day: "numeric", month: "short" }, s) : n("compact-earlier", { dateStyle: "short" }, s);
1324
1327
  },
1325
1328
  exact(i) {
1326
- const o = Ae(i);
1327
- return o === null ? "" : s("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, o);
1329
+ const s = Ae(i);
1330
+ return s === null ? "" : n("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, s);
1328
1331
  },
1329
1332
  iso(i) {
1330
- const o = Ae(i);
1331
- return o === null ? "" : o.toISOString();
1333
+ const s = Ae(i);
1334
+ return s === null ? "" : s.toISOString();
1332
1335
  }
1333
1336
  };
1334
1337
  }
@@ -1338,7 +1341,7 @@ function It() {
1338
1341
  }
1339
1342
  let Ce = null;
1340
1343
  function za() {
1341
- return Ce === null && (Ce = it(), Ce.defaults("webx-admin", Rt)), Ce;
1344
+ return Ce === null && (Ce = rt(), Ce.defaults("webx-admin", Rt)), Ce;
1342
1345
  }
1343
1346
  function Ae(e) {
1344
1347
  if (e == null || e === "")
@@ -1346,8 +1349,8 @@ function Ae(e) {
1346
1349
  const t = e instanceof Date ? e : new Date(e);
1347
1350
  return Number.isNaN(t.getTime()) ? null : t;
1348
1351
  }
1349
- function bt(e, t) {
1350
- const l = (s) => Date.UTC(s.getFullYear(), s.getMonth(), s.getDate());
1352
+ function wt(e, t) {
1353
+ const l = (n) => Date.UTC(n.getFullYear(), n.getMonth(), n.getDate());
1351
1354
  return Math.round((l(e) - l(t)) / 864e5);
1352
1355
  }
1353
1356
  const Ue = /* @__PURE__ */ q({
@@ -1360,10 +1363,10 @@ const Ue = /* @__PURE__ */ q({
1360
1363
  tone: { default: "muted" }
1361
1364
  },
1362
1365
  setup(e) {
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), {
1366
+ const t = e, l = It(), n = _(() => t.compact ? l.compact(t.value) : l.short(t.value)), o = _(() => l.exact(t.value)), i = _(() => l.iso(t.value));
1367
+ return (s, r) => o.value ? (d(), L(a(Wt), {
1365
1368
  key: 0,
1366
- content: n.value
1369
+ content: o.value
1367
1370
  }, {
1368
1371
  default: w(() => [
1369
1372
  x(a(Q), {
@@ -1373,7 +1376,7 @@ const Ue = /* @__PURE__ */ q({
1373
1376
  tone: e.tone
1374
1377
  }, {
1375
1378
  default: w(() => [
1376
- R(C(s.value), 1)
1379
+ R(C(n.value), 1)
1377
1380
  ]),
1378
1381
  _: 1
1379
1382
  }, 8, ["datetime", "size", "tone"])
@@ -1385,25 +1388,25 @@ const Ue = /* @__PURE__ */ q({
1385
1388
  tone: e.tone
1386
1389
  }, {
1387
1390
  default: w(() => [
1388
- R(C(s.value), 1)
1391
+ R(C(n.value), 1)
1389
1392
  ]),
1390
1393
  _: 1
1391
1394
  }, 8, ["size", "tone"]));
1392
1395
  }
1393
1396
  });
1394
1397
  function Va(e, t, l) {
1395
- const s = e instanceof $e ? e.status : Na(e);
1396
- if (s === 422)
1398
+ const n = e instanceof $e ? e.status : Na(e);
1399
+ if (n === 422)
1397
1400
  return Ea(e) ?? l ?? t("errors.unknown");
1398
- if (s === 401) return t("errors.signed-out");
1399
- if (s === 403) return t("errors.forbidden");
1400
- if (s === 404) return t("errors.gone");
1401
- if (s === 409) return t("errors.conflict");
1402
- if (s === 429) {
1403
- const n = e instanceof $e ? e.retryAfter : null;
1404
- return n === null ? t("errors.throttled") : t("errors.throttled-in", { seconds: n });
1401
+ if (n === 401) return t("errors.signed-out");
1402
+ if (n === 403) return t("errors.forbidden");
1403
+ if (n === 404) return t("errors.gone");
1404
+ if (n === 409) return t("errors.conflict");
1405
+ if (n === 429) {
1406
+ const o = e instanceof $e ? e.retryAfter : null;
1407
+ return o === null ? t("errors.throttled") : t("errors.throttled-in", { seconds: o });
1405
1408
  }
1406
- return s !== null && s >= 500 ? t("errors.server") : s === null ? t("errors.offline") : l ?? t("errors.unknown");
1409
+ return n !== null && n >= 500 ? t("errors.server") : n === null ? t("errors.offline") : l ?? t("errors.unknown");
1407
1410
  }
1408
1411
  function De() {
1409
1412
  const e = J("webx-admin");
@@ -1419,9 +1422,9 @@ function Ea(e) {
1419
1422
  }
1420
1423
  function Ua(e, t, l) {
1421
1424
  return {
1422
- list: (s = 1) => e.http.get(`${e.apiPath}/history/${t}/${l}`, { query: { page: s } }),
1423
- run: (s, n = 1, i = null) => e.http.get(`${e.apiPath}/history/runs/${s}`, {
1424
- query: { page: n, search: i }
1425
+ list: (n = 1) => e.http.get(`${e.apiPath}/history/${t}/${l}`, { query: { page: n } }),
1426
+ run: (n, o = 1, i = null) => e.http.get(`${e.apiPath}/history/runs/${n}`, {
1427
+ query: { page: o, search: i }
1425
1428
  })
1426
1429
  };
1427
1430
  }
@@ -1433,9 +1436,9 @@ function Ia() {
1433
1436
  return fe(Mt, null);
1434
1437
  }
1435
1438
  function je(e, t, l = 120) {
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);
1439
+ return e == null || e === "" ? t : typeof e == "boolean" ? e ? "✓" : "✗" : typeof e == "string" ? Ke(e, l) : typeof e == "number" ? String(e) : Array.isArray(e) && e.every((n) => typeof n == "string" || typeof n == "number") ? e.length === 0 ? t : Ke(e.join(", "), l) : Ke(JSON.stringify(e), l);
1437
1440
  }
1438
- function wt(e, t) {
1441
+ function Ke(e, t) {
1439
1442
  return e.length > t ? `${e.slice(0, t - 1)}…` : e;
1440
1443
  }
1441
1444
  const Ma = { class: "wx-history" }, Pa = {
@@ -1471,9 +1474,9 @@ const Ma = { class: "wx-history" }, Pa = {
1471
1474
  title: { default: void 0 }
1472
1475
  },
1473
1476
  setup(e, { expose: t }) {
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
+ const l = e, n = ee(), o = J("webx-admin"), i = De(), s = Ia(), r = A([]), c = A(1), v = A(1), h = A(!1), m = A(!1), u = _(() => l.id ?? s?.id.value ?? null), f = _(
1478
+ () => u.value === null ? null : Ua(n, l.type, u.value)
1479
+ ), k = _(() => l.title ?? o("history.title"));
1477
1480
  async function p() {
1478
1481
  if (r.value = [], c.value = 1, v.value = 1, f.value !== null) {
1479
1482
  h.value = !0;
@@ -1504,26 +1507,26 @@ const Ma = { class: "wx-history" }, Pa = {
1504
1507
  p();
1505
1508
  }, { immediate: !0 }), t({ reload: p });
1506
1509
  function b(g) {
1507
- return g.admin?.name ?? n("history.unknown-author");
1510
+ return g.admin?.name ?? o("history.unknown-author");
1508
1511
  }
1509
1512
  function P(g) {
1510
- return `${n(`history.event-${g.event}`)} · ${n(`history.source-${g.source}`)}`;
1513
+ return `${o(`history.event-${g.event}`)} · ${o(`history.source-${g.source}`)}`;
1511
1514
  }
1512
1515
  function H(g) {
1513
- return je(g.from, n("history.empty-value"));
1516
+ return je(g.from, o("history.empty-value"));
1514
1517
  }
1515
1518
  function j(g) {
1516
- return je(g.to, n("history.empty-value"));
1519
+ return je(g.to, o("history.empty-value"));
1517
1520
  }
1518
1521
  function F(g) {
1519
- return n("history.long", {
1522
+ return o("history.long", {
1520
1523
  from: String(g.from_length ?? 0),
1521
1524
  to: String(g.to_length ?? 0)
1522
1525
  });
1523
1526
  }
1524
1527
  function y(g) {
1525
1528
  const z = g.run?.summary?.what;
1526
- return typeof z == "string" && z !== "" ? `${n("history.run")} · ${z}` : n("history.run");
1529
+ return typeof z == "string" && z !== "" ? `${o("history.run")} · ${z}` : o("history.run");
1527
1530
  }
1528
1531
  const W = A(!1), T = A(null), I = A(null), V = A(""), U = A(!1);
1529
1532
  let O = 0;
@@ -1552,7 +1555,7 @@ const Ma = { class: "wx-history" }, Pa = {
1552
1555
  });
1553
1556
  const ce = _(() => {
1554
1557
  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")) }));
1558
+ return Object.entries(g).filter(([z]) => z !== "rows" && z !== "failed").map(([z, N]) => ({ key: z, value: je(N, o("history.empty-value")) }));
1556
1559
  }), B = _(() => {
1557
1560
  const g = T.value?.run.summary?.failed;
1558
1561
  return typeof g == "string" ? g : null;
@@ -1571,14 +1574,14 @@ const Ma = { class: "wx-history" }, Pa = {
1571
1574
  u.value === null ? (d(), L(a(Ne), {
1572
1575
  key: 1,
1573
1576
  size: "sm",
1574
- description: a(n)("history.unsaved")
1577
+ description: a(o)("history.unsaved")
1575
1578
  }, null, 8, ["description"])) : h.value ? (d(), L(a(ye), {
1576
1579
  key: 2,
1577
1580
  rows: 3
1578
1581
  })) : r.value.length === 0 ? (d(), L(a(Ne), {
1579
1582
  key: 3,
1580
1583
  size: "sm",
1581
- description: a(n)("history.empty")
1584
+ description: a(o)("history.empty")
1582
1585
  }, null, 8, ["description"])) : (d(), S("ul", Pa, [
1583
1586
  (d(!0), S(K, null, se(r.value, (N) => (d(), S("li", {
1584
1587
  key: N.id,
@@ -1646,15 +1649,15 @@ const Ma = { class: "wx-history" }, Pa = {
1646
1649
  onClick: $
1647
1650
  }, {
1648
1651
  default: w(() => [
1649
- R(C(a(n)("history.more")), 1)
1652
+ R(C(a(o)("history.more")), 1)
1650
1653
  ]),
1651
1654
  _: 1
1652
1655
  }, 8, ["loading"])
1653
1656
  ])) : E("", !0),
1654
- x(a(ot), {
1657
+ x(a(st), {
1655
1658
  open: W.value,
1656
1659
  "onUpdate:open": z[2] || (z[2] = (N) => W.value = N),
1657
- title: a(n)("history.run-title"),
1660
+ title: a(o)("history.run-title"),
1658
1661
  width: 640
1659
1662
  }, {
1660
1663
  default: w(() => [
@@ -1695,7 +1698,7 @@ const Ma = { class: "wx-history" }, Pa = {
1695
1698
  ])) : E("", !0),
1696
1699
  x(a(Q), { size: "sm" }, {
1697
1700
  default: w(() => [
1698
- R(C(a(n)("history.run-rows", { count: String(T.value.run.rows ?? 0) })), 1)
1701
+ R(C(a(o)("history.run-rows", { count: String(T.value.run.rows ?? 0) })), 1)
1699
1702
  ]),
1700
1703
  _: 1
1701
1704
  }),
@@ -1705,7 +1708,7 @@ const Ma = { class: "wx-history" }, Pa = {
1705
1708
  tone: "danger"
1706
1709
  }, {
1707
1710
  default: w(() => [
1708
- R(C(a(n)("history.run-failed", { message: B.value })), 1)
1711
+ R(C(a(o)("history.run-failed", { message: B.value })), 1)
1709
1712
  ]),
1710
1713
  _: 1
1711
1714
  })) : E("", !0),
@@ -1714,7 +1717,7 @@ const Ma = { class: "wx-history" }, Pa = {
1714
1717
  "onUpdate:modelValue": z[0] || (z[0] = (N) => V.value = N),
1715
1718
  size: "sm",
1716
1719
  inputmode: "numeric",
1717
- placeholder: a(n)("history.search"),
1720
+ placeholder: a(o)("history.search"),
1718
1721
  clearable: ""
1719
1722
  }, null, 8, ["modelValue", "placeholder"]),
1720
1723
  M("ul", Qa, [
@@ -1756,7 +1759,7 @@ const Ma = { class: "wx-history" }, Pa = {
1756
1759
  onClick: z[1] || (z[1] = (N) => I.value !== null && te(I.value, T.value.rows.current_page + 1))
1757
1760
  }, {
1758
1761
  default: w(() => [
1759
- R(C(a(n)("history.more")), 1)
1762
+ R(C(a(o)("history.more")), 1)
1760
1763
  ]),
1761
1764
  _: 1
1762
1765
  }, 8, ["loading"])
@@ -1775,13 +1778,13 @@ const Ma = { class: "wx-history" }, Pa = {
1775
1778
  size: { default: "sm" }
1776
1779
  },
1777
1780
  setup(e) {
1778
- const t = e, l = J("webx-admin"), s = _(() => t.label ?? l("editor.back"));
1779
- return (n, i) => (d(), L(a(be), {
1781
+ const t = e, l = J("webx-admin"), n = _(() => t.label ?? l("editor.back"));
1782
+ return (o, i) => (d(), L(a(be), {
1780
1783
  icon: "arrow-left",
1781
1784
  class: "wx-back-button",
1782
1785
  as: a(ll),
1783
1786
  to: e.to,
1784
- title: s.value,
1787
+ title: n.value,
1785
1788
  size: e.size,
1786
1789
  "tooltip-side": "bottom"
1787
1790
  }, null, 8, ["as", "to", "title", "size"]));
@@ -1797,21 +1800,21 @@ const Ma = { class: "wx-history" }, Pa = {
1797
1800
  size: { default: "sm" }
1798
1801
  },
1799
1802
  setup(e) {
1800
- const t = J("webx-admin"), l = e, s = _(() => [
1803
+ const t = J("webx-admin"), l = e, n = _(() => [
1801
1804
  ...l.actions.filter((i) => !i.danger),
1802
1805
  ...l.actions.filter((i) => i.danger)
1803
- ]), n = _(() => {
1804
- const i = s.value.find((o) => o.danger);
1805
- return i && s.value[0] !== i ? i.key : null;
1806
+ ]), o = _(() => {
1807
+ const i = n.value.find((s) => s.danger);
1808
+ return i && n.value[0] !== i ? i.key : null;
1806
1809
  });
1807
- return (i, o) => s.value.length > 0 ? (d(), L(a(rl), {
1810
+ return (i, s) => n.value.length > 0 ? (d(), L(a(rl), {
1808
1811
  key: 0,
1809
1812
  class: "wx-row-menu",
1810
1813
  collapse: "always",
1811
1814
  align: "end",
1812
1815
  size: e.size,
1813
1816
  "aria-label": e.label,
1814
- onClick: o[0] || (o[0] = St(() => {
1817
+ onClick: s[0] || (s[0] = St(() => {
1815
1818
  }, ["stop"]))
1816
1819
  }, {
1817
1820
  trigger: w(() => [
@@ -1822,10 +1825,10 @@ const Ma = { class: "wx-history" }, Pa = {
1822
1825
  }, null, 8, ["size", "title"])
1823
1826
  ]),
1824
1827
  collapsed: w(() => [
1825
- (d(!0), S(K, null, se(s.value, (r) => (d(), S(K, {
1828
+ (d(!0), S(K, null, se(n.value, (r) => (d(), S(K, {
1826
1829
  key: r.key
1827
1830
  }, [
1828
- r.key === n.value ? (d(), S("hr", un)) : E("", !0),
1831
+ r.key === o.value ? (d(), S("hr", un)) : E("", !0),
1829
1832
  x(a(ul), {
1830
1833
  icon: r.icon,
1831
1834
  tone: r.danger ? "danger" : "default",
@@ -1844,7 +1847,7 @@ const Ma = { class: "wx-history" }, Pa = {
1844
1847
  _: 1
1845
1848
  }, 8, ["size", "aria-label"])) : E("", !0);
1846
1849
  }
1847
- }), rt = /* @__PURE__ */ oe(dn, [["__scopeId", "data-v-cab01f7f"]]), cn = ["data-level"], fn = {
1850
+ }), ut = /* @__PURE__ */ oe(dn, [["__scopeId", "data-v-cab01f7f"]]), cn = ["data-level"], fn = {
1848
1851
  key: 0,
1849
1852
  class: "wx-screen-head__trail"
1850
1853
  }, mn = { class: "wx-screen-head__name" }, vn = {
@@ -1864,7 +1867,7 @@ const Ma = { class: "wx-history" }, Pa = {
1864
1867
  },
1865
1868
  emits: ["back"],
1866
1869
  setup(e, { emit: t }) {
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 = _(
1870
+ const l = e, n = t, o = J("webx-admin"), i = Yt(), s = at("root"), r = dl(s), c = _(() => r.value > 0 && r.value < l.collapseBelow), v = _(() => l.actions ?? []), h = _(
1868
1871
  () => v.value.find((p) => p.primary) ?? null
1869
1872
  ), 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
1873
  () => l.back && l.back !== !0 ? l.back : null
@@ -1873,7 +1876,7 @@ const Ma = { class: "wx-history" }, Pa = {
1873
1876
  );
1874
1877
  return (p, $) => (d(), S("div", {
1875
1878
  ref_key: "root",
1876
- ref: o,
1879
+ ref: s,
1877
1880
  class: ve(["wx-screen-head", {
1878
1881
  "is-narrow": c.value,
1879
1882
  "has-button": m.value.length > 0,
@@ -1897,8 +1900,8 @@ const Ma = { class: "wx-history" }, Pa = {
1897
1900
  icon: "arrow-left",
1898
1901
  size: "sm",
1899
1902
  "tooltip-side": "bottom",
1900
- title: e.backLabel ?? a(n)("editor.back"),
1901
- onClick: $[0] || ($[0] = (b) => s("back"))
1903
+ title: e.backLabel ?? a(o)("editor.back"),
1904
+ onClick: $[0] || ($[0] = (b) => n("back"))
1902
1905
  }, null, 8, ["title"])) : E("", !0),
1903
1906
  M("div", mn, [
1904
1907
  e.title ? (d(), L(a(cl), {
@@ -1950,18 +1953,18 @@ const Ma = { class: "wx-history" }, Pa = {
1950
1953
  b.icon ? {
1951
1954
  name: "icon",
1952
1955
  fn: w(() => [
1953
- x(a(st), {
1956
+ x(a(it), {
1954
1957
  name: b.icon
1955
1958
  }, null, 8, ["name"])
1956
1959
  ]),
1957
1960
  key: "0"
1958
1961
  } : void 0
1959
1962
  ]), 1032, ["class", "type", "variant", "loading", "disabled", "href", "target", "rel", "onClick"]))), 128)),
1960
- u.value.length > 0 ? (d(), L(rt, {
1963
+ u.value.length > 0 ? (d(), L(ut, {
1961
1964
  key: 0,
1962
1965
  actions: u.value,
1963
1966
  size: "lg",
1964
- label: e.title ?? a(n)("editor.more")
1967
+ label: e.title ?? a(o)("editor.more")
1965
1968
  }, null, 8, ["actions", "label"])) : E("", !0)
1966
1969
  ])) : E("", !0)
1967
1970
  ], 10, cn));
@@ -1986,7 +1989,7 @@ const Ma = { class: "wx-history" }, Pa = {
1986
1989
  emits: ["update:view"],
1987
1990
  setup(e) {
1988
1991
  const t = ge(e, "view");
1989
- return (l, s) => (d(), S("div", {
1992
+ return (l, n) => (d(), S("div", {
1990
1993
  class: ve(["wx-list-screen", { "is-fill": e.fill }]),
1991
1994
  "data-wx-fill": e.fill ? "" : void 0
1992
1995
  }, [
@@ -2011,14 +2014,14 @@ const Ma = { class: "wx-history" }, Pa = {
2011
2014
  e.views && e.views.length > 0 ? (d(), L(a(fl), {
2012
2015
  key: 1,
2013
2016
  modelValue: t.value,
2014
- "onUpdate:modelValue": s[0] || (s[0] = (n) => t.value = n),
2017
+ "onUpdate:modelValue": n[0] || (n[0] = (o) => t.value = o),
2015
2018
  class: "wx-list-screen__views",
2016
2019
  items: e.views,
2017
2020
  "collapse-below": e.collapseBelow,
2018
2021
  "aria-label": e.title
2019
2022
  }, {
2020
2023
  default: w(() => [
2021
- e.card ? (d(), L(a(Je), {
2024
+ e.card ? (d(), L(a(Ge), {
2022
2025
  key: 0,
2023
2026
  class: "wx-list-screen__card",
2024
2027
  padding: e.padding
@@ -2031,7 +2034,7 @@ const Ma = { class: "wx-history" }, Pa = {
2031
2034
  ]),
2032
2035
  _: 3
2033
2036
  }, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (d(), S(K, { key: 2 }, [
2034
- e.card ? (d(), L(a(Je), {
2037
+ e.card ? (d(), L(a(Ge), {
2035
2038
  key: 0,
2036
2039
  class: "wx-list-screen__card",
2037
2040
  padding: e.padding
@@ -2049,7 +2052,7 @@ const Ma = { class: "wx-history" }, Pa = {
2049
2052
  inheritAttrs: !1,
2050
2053
  __name: "RichTextField",
2051
2054
  setup(e) {
2052
- const t = ee(), l = J("webx-admin"), s = _(() => t.pickImage ?? void 0), n = _(() => ({
2055
+ const t = ee(), l = J("webx-admin"), n = _(() => t.pickImage ?? void 0), o = _(() => ({
2053
2056
  bold: l("rich-text.bold"),
2054
2057
  italic: l("rich-text.italic"),
2055
2058
  strike: l("rich-text.strike"),
@@ -2082,9 +2085,9 @@ const Ma = { class: "wx-history" }, Pa = {
2082
2085
  cancel: l("rich-text.cancel"),
2083
2086
  uploading: l("rich-text.uploading")
2084
2087
  }));
2085
- return (i, o) => (d(), L(a(ml), et(i.$attrs, {
2086
- labels: n.value,
2087
- "pick-image": s.value
2088
+ return (i, s) => (d(), L(a(ml), tt(i.$attrs, {
2089
+ labels: o.value,
2090
+ "pick-image": n.value
2088
2091
  }), null, 16, ["labels", "pick-image"]));
2089
2092
  }
2090
2093
  }), Bt = /* @__PURE__ */ Symbol("wx-record-address");
@@ -2099,20 +2102,20 @@ const _n = { class: "wx-slug" }, xn = { class: "wx-slug__prefix" }, kn = /* @__P
2099
2102
  inheritAttrs: !1,
2100
2103
  __name: "SlugField",
2101
2104
  setup(e) {
2102
- const t = wn(), l = zt(), s = _(() => {
2103
- const o = t?.prefix.value ?? "";
2104
- return o === "" ? "/" : `/${o}/`;
2105
- }), n = _(() => {
2106
- const o = t?.values.value.slug;
2107
- return typeof o == "string" ? o : o?.[l.active.value] ?? "";
2105
+ const t = wn(), l = zt(), n = _(() => {
2106
+ const s = t?.prefix.value ?? "";
2107
+ return s === "" ? "/" : `/${s}/`;
2108
+ }), o = _(() => {
2109
+ const s = t?.values.value.slug;
2110
+ return typeof s == "string" ? s : s?.[l.active.value] ?? "";
2108
2111
  }), i = _(() => {
2109
- const o = t?.path.value;
2110
- return typeof o == "string" && n.value !== "" && `${s.value}${n.value}` != `/${o}`;
2112
+ const s = t?.path.value;
2113
+ return typeof s == "string" && o.value !== "" && `${n.value}${o.value}` != `/${s}`;
2111
2114
  });
2112
- return (o, r) => (d(), S("div", _n, [
2113
- x(a(Te), Xt(Jt(o.$attrs)), {
2115
+ return (s, r) => (d(), S("div", _n, [
2116
+ x(a(Te), Xt(Jt(s.$attrs)), {
2114
2117
  prefix: w(() => [
2115
- M("span", xn, C(s.value), 1)
2118
+ M("span", xn, C(n.value), 1)
2116
2119
  ]),
2117
2120
  _: 1
2118
2121
  }, 16),
@@ -2176,7 +2179,7 @@ function Sn(e) {
2176
2179
  });
2177
2180
  }
2178
2181
  return k;
2179
- }), s = _(() => {
2182
+ }), n = _(() => {
2180
2183
  const f = t.manifest?.groups ?? [], k = [], p = /* @__PURE__ */ new Map();
2181
2184
  for (const $ of l.value)
2182
2185
  if ($.group !== null && f.some((b) => b.id === $.group)) {
@@ -2201,17 +2204,17 @@ function Sn(e) {
2201
2204
  };
2202
2205
  })
2203
2206
  };
2204
- }), n = { ...$n };
2207
+ }), o = { ...$n };
2205
2208
  for (const f of e.modules)
2206
- Object.assign(n, f.types);
2207
- Object.assign(n, e.types);
2208
- const i = e.modules.find((f) => f.pickImage !== void 0)?.pickImage, o = /* @__PURE__ */ new Map();
2209
+ Object.assign(o, f.types);
2210
+ Object.assign(o, e.types);
2211
+ const i = e.modules.find((f) => f.pickImage !== void 0)?.pickImage, s = /* @__PURE__ */ new Map();
2209
2212
  async function r(f) {
2210
2213
  const k = `${e.i18n.state.locale}:${f}`;
2211
- let p = o.get(k);
2214
+ let p = s.get(k);
2212
2215
  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;
2216
+ throw s.delete(k), $;
2217
+ }), s.set(k, p)), p;
2215
2218
  }
2216
2219
  let c = null;
2217
2220
  async function v() {
@@ -2256,8 +2259,8 @@ function Sn(e) {
2256
2259
  i18n: e.i18n,
2257
2260
  modules: e.modules,
2258
2261
  nav: l,
2259
- groups: s,
2260
- types: n,
2262
+ groups: n,
2263
+ types: o,
2261
2264
  pickImage: i ?? null,
2262
2265
  reload: v,
2263
2266
  refreshManifest: h,
@@ -2290,21 +2293,21 @@ const An = /* @__PURE__ */ q({
2290
2293
  landing: { default: null }
2291
2294
  },
2292
2295
  setup(e) {
2293
- const t = e, l = ee(), s = Me(), n = J("webx-admin"), i = _(() => {
2294
- const o = l.nav.value;
2295
- return o.length === 0 ? null : ((t.landing === null ? void 0 : o.find((c) => c.path === t.landing)) ?? o[0])?.path ?? null;
2296
+ const t = e, l = ee(), n = Me(), o = J("webx-admin"), i = _(() => {
2297
+ const s = l.nav.value;
2298
+ return s.length === 0 ? null : ((t.landing === null ? void 0 : s.find((c) => c.path === t.landing)) ?? s[0])?.path ?? null;
2296
2299
  });
2297
2300
  return ie(
2298
2301
  i,
2299
- (o) => {
2300
- o !== null && s.replace(o);
2302
+ (s) => {
2303
+ s !== null && n.replace(s);
2301
2304
  },
2302
2305
  { immediate: !0 }
2303
- ), (o, r) => i.value === null && a(l).state.status === "ready" ? (d(), L(a(vl), {
2306
+ ), (s, r) => i.value === null && a(l).state.status === "ready" ? (d(), L(a(vl), {
2304
2307
  key: 0,
2305
2308
  status: "info",
2306
- title: a(n)("shell.empty-title"),
2307
- description: a(n)("shell.empty-description")
2309
+ title: a(o)("shell.empty-title"),
2310
+ description: a(o)("shell.empty-description")
2308
2311
  }, null, 8, ["title", "description"])) : E("", !0);
2309
2312
  }
2310
2313
  }), Wn = /* @__PURE__ */ q({
@@ -2314,18 +2317,18 @@ const An = /* @__PURE__ */ q({
2314
2317
  },
2315
2318
  emits: ["select"],
2316
2319
  setup(e, { emit: t }) {
2317
- const l = t, s = ee(), n = J("webx-admin"), i = Me(), o = At(), r = _({
2320
+ const l = t, n = ee(), o = J("webx-admin"), i = Me(), s = At(), r = _({
2318
2321
  /*
2319
2322
  * The longest path that contains this one, on a segment boundary: a section may live inside
2320
2323
  * another's path (`/services/categories` under `/services`), and the first match in the order
2321
2324
  * of the menu would light up the outer one.
2322
2325
  */
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 ?? "",
2326
+ get: () => n.nav.value.filter((u) => s.path === u.path || s.path.startsWith(`${u.path}/`)).sort((u, f) => f.path.length - u.path.length)[0]?.id ?? "",
2324
2327
  set: (m) => {
2325
- const u = s.nav.value.find((f) => f.id === m);
2328
+ const u = n.nav.value.find((f) => f.id === m);
2326
2329
  u !== void 0 && i.push(u.path);
2327
2330
  }
2328
- }), c = lt("root");
2331
+ }), c = at("root");
2329
2332
  let v = !1;
2330
2333
  async function h() {
2331
2334
  const m = c.value?.$el;
@@ -2339,17 +2342,17 @@ const An = /* @__PURE__ */ q({
2339
2342
  modelValue: r.value,
2340
2343
  "onUpdate:modelValue": u[0] || (u[0] = (b) => r.value = b),
2341
2344
  collapsed: e.collapsed,
2342
- label: a(n)("nav.sections"),
2345
+ label: a(o)("nav.sections"),
2343
2346
  onSelect: u[1] || (u[1] = (b) => l("select"))
2344
2347
  }, {
2345
2348
  default: w(() => [
2346
- (d(!0), S(K, null, se(a(s).groups.value.top, (b) => (d(), L(f, {
2349
+ (d(!0), S(K, null, se(a(n).groups.value.top, (b) => (d(), L(f, {
2347
2350
  key: b.id,
2348
2351
  value: b.id,
2349
2352
  icon: b.icon ?? void 0,
2350
2353
  label: b.title
2351
2354
  }, null, 8, ["value", "icon", "label"]))), 128)),
2352
- (d(!0), S(K, null, se(a(s).groups.value.groups, (b) => (d(), L(p, {
2355
+ (d(!0), S(K, null, se(a(n).groups.value.groups, (b) => (d(), L(p, {
2353
2356
  key: b.id,
2354
2357
  value: `group:${b.id}`,
2355
2358
  title: b.title,
@@ -2396,10 +2399,10 @@ const An = /* @__PURE__ */ q({
2396
2399
  }, 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({
2397
2400
  __name: "AdminShell",
2398
2401
  setup(e) {
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(
2400
- s,
2402
+ const t = ee(), l = J("webx-admin"), n = A(null), { width: o, layout: i, collapsed: s, showAside: r, drawerOpen: c, toggle: v, close: h } = pl(
2403
+ n,
2401
2404
  { persist: "webx-admin-shell" }
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));
2405
+ ), m = _(() => t.state.manifest?.title ?? ""), u = _(() => t.state.manifest?.branding?.logo ?? null), f = _(() => t.state.manifest?.branding?.mark ?? null), k = _(() => hl(o.value, null));
2403
2406
  return Gt(() => {
2404
2407
  typeof document > "u" || (document.documentElement.dataset.wxShell = k.value);
2405
2408
  }), Qt(() => {
@@ -2436,7 +2439,7 @@ const An = /* @__PURE__ */ q({
2436
2439
  ])) : (d(), S("div", {
2437
2440
  key: 3,
2438
2441
  ref_key: "shellEl",
2439
- ref: s,
2442
+ ref: n,
2440
2443
  class: ve(["wx-root wx-admin", `wx-admin--${k.value}`])
2441
2444
  }, [
2442
2445
  x(V, {
@@ -2492,15 +2495,15 @@ const An = /* @__PURE__ */ q({
2492
2495
  floating: "",
2493
2496
  scroll: "",
2494
2497
  bordered: !1,
2495
- collapsed: a(o),
2498
+ collapsed: a(s),
2496
2499
  width: 220,
2497
2500
  "collapsed-width": 56
2498
2501
  }, {
2499
2502
  top: w(() => [
2500
2503
  M("div", {
2501
- class: ve(["wx-admin__brand", { "wx-admin__brand--stacked": a(o) && f.value }])
2504
+ class: ve(["wx-admin__brand", { "wx-admin__brand--stacked": a(s) && f.value }])
2502
2505
  }, [
2503
- a(o) ? f.value ? (d(), S("img", {
2506
+ a(s) ? f.value ? (d(), S("img", {
2504
2507
  key: 1,
2505
2508
  class: "wx-admin__mark",
2506
2509
  src: f.value.url,
@@ -2527,7 +2530,7 @@ const An = /* @__PURE__ */ q({
2527
2530
  ], !0, 0),
2528
2531
  x(F, {
2529
2532
  icon: "sidebar",
2530
- title: a(o) ? a(l)("nav.expand") : a(l)("nav.collapse"),
2533
+ title: a(s) ? a(l)("nav.expand") : a(l)("nav.collapse"),
2531
2534
  onClick: a(v)
2532
2535
  }, null, 8, ["title", "onClick"])
2533
2536
  ], 2)
@@ -2535,12 +2538,12 @@ const An = /* @__PURE__ */ q({
2535
2538
  bottom: w(() => [
2536
2539
  M("div", Rn, [
2537
2540
  ne(p.$slots, "user", {
2538
- expanded: !a(o)
2541
+ expanded: !a(s)
2539
2542
  }, void 0, !0)
2540
2543
  ])
2541
2544
  ]),
2542
2545
  default: w(() => [
2543
- ne(p.$slots, "nav", { collapsed: a(o) }, void 0, !0)
2546
+ ne(p.$slots, "nav", { collapsed: a(s) }, void 0, !0)
2544
2547
  ]),
2545
2548
  _: 3
2546
2549
  }, 8, ["collapsed"])) : E("", !0),
@@ -2598,21 +2601,21 @@ function Dn(e = {}) {
2598
2601
  preference: Fn(t) ?? "system",
2599
2602
  resolved: "light"
2600
2603
  });
2601
- function s() {
2604
+ function n() {
2602
2605
  Ll(l.preference), l.resolved = l.preference === "system" ? zl() : l.preference;
2603
2606
  }
2604
- return s(), Wl((n) => {
2605
- l.preference === "system" && (l.resolved = n);
2607
+ return n(), Wl((o) => {
2608
+ l.preference === "system" && (l.resolved = o);
2606
2609
  }), {
2607
2610
  state: l,
2608
- set(n) {
2609
- l.preference = n, s(), xt(t, n);
2611
+ set(o) {
2612
+ l.preference = o, n(), xt(t, o);
2610
2613
  },
2611
- adopt(n) {
2612
- if (n === void 0)
2614
+ adopt(o) {
2615
+ if (o === void 0)
2613
2616
  return;
2614
- const i = n ?? "system";
2615
- i !== l.preference && (l.preference = i, s(), xt(t, i));
2617
+ const i = o ?? "system";
2618
+ i !== l.preference && (l.preference = i, n(), xt(t, i));
2616
2619
  }
2617
2620
  };
2618
2621
  }
@@ -2635,11 +2638,11 @@ function Fn(e) {
2635
2638
  }
2636
2639
  const Ht = "webx.locale";
2637
2640
  function Mo(e = {}) {
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 ?? []];
2639
- for (const $ of n)
2641
+ const t = e.manifestUrl ?? Xn() ?? "/api/cms/manifest", l = e.apiPath ?? t.replace(/\/manifest\/?$/, ""), n = e.basePath ?? "/cms", o = e.modules ?? [], i = [...e.routes ?? []];
2642
+ for (const $ of o)
2640
2643
  i.push(...$.routes ?? []);
2641
2644
  if (!i.some(($) => $.path === "/")) {
2642
- const $ = n.find((b) => b.landing === !0);
2645
+ const $ = o.find((b) => b.landing === !0);
2643
2646
  i.push({
2644
2647
  path: "/",
2645
2648
  name: "webx.home",
@@ -2647,10 +2650,10 @@ function Mo(e = {}) {
2647
2650
  props: { landing: $?.path ?? $?.routes?.[0]?.path ?? null }
2648
2651
  });
2649
2652
  }
2650
- const o = al({
2651
- history: nl(s),
2653
+ const s = al({
2654
+ history: nl(n),
2652
2655
  routes: i
2653
- }), r = it({ locale: e.locale ?? jn() }), c = Dn(), v = e.http ?? Fl({
2656
+ }), r = rt({ locale: e.locale ?? jn() }), c = Dn(), v = e.http ?? Fl({
2654
2657
  baseUrl: "",
2655
2658
  csrfUrl: `${l}/auth/csrf-cookie`,
2656
2659
  onUnauthenticated: () => {
@@ -2670,9 +2673,9 @@ function Mo(e = {}) {
2670
2673
  const m = Sn({
2671
2674
  http: v,
2672
2675
  theme: c,
2673
- basePath: s,
2676
+ basePath: n,
2674
2677
  apiPath: l,
2675
- modules: n,
2678
+ modules: o,
2676
2679
  i18n: r,
2677
2680
  loadDictionary: h,
2678
2681
  types: e.types,
@@ -2700,7 +2703,7 @@ function Mo(e = {}) {
2700
2703
  });
2701
2704
  const k = {
2702
2705
  app: u,
2703
- router: o,
2706
+ router: s,
2704
2707
  context: m,
2705
2708
  i18n: r,
2706
2709
  theme: c,
@@ -2715,7 +2718,7 @@ function Mo(e = {}) {
2715
2718
  }
2716
2719
  for (const $ of e.plugins ?? [])
2717
2720
  $.install(k);
2718
- return u.use(o), k;
2721
+ return u.use(s), k;
2719
2722
  }
2720
2723
  function Hn(e) {
2721
2724
  const t = {
@@ -2754,47 +2757,47 @@ function Jn(e) {
2754
2757
  const t = e.replace(/\r\n?/g, `
2755
2758
  `).split(`
2756
2759
  `), l = [];
2757
- let s = 0;
2758
- for (; s < t.length; ) {
2759
- const n = t[s] ?? "";
2760
- if (n.trim() === "") {
2761
- s += 1;
2760
+ let n = 0;
2761
+ for (; n < t.length; ) {
2762
+ const o = t[n] ?? "";
2763
+ if (o.trim() === "") {
2764
+ n += 1;
2762
2765
  continue;
2763
2766
  }
2764
- if (/^```([\w-]*)\s*$/.exec(n)) {
2767
+ if (/^```([\w-]*)\s*$/.exec(o)) {
2765
2768
  const c = [];
2766
- for (s += 1; s < t.length && !/^```\s*$/.test(t[s] ?? ""); )
2767
- c.push(t[s] ?? ""), s += 1;
2768
- s += 1, l.push(`<pre><code>${Qe(c.join(`
2769
+ for (n += 1; n < t.length && !/^```\s*$/.test(t[n] ?? ""); )
2770
+ c.push(t[n] ?? ""), n += 1;
2771
+ n += 1, l.push(`<pre><code>${Ze(c.join(`
2769
2772
  `))}</code></pre>`);
2770
2773
  continue;
2771
2774
  }
2772
- const o = /^(#{1,4})\s+(.*)$/.exec(n);
2773
- if (o) {
2774
- const c = Math.min(o[1].length + 1, 5);
2775
- l.push(`<h${c}>${Ke(o[2] ?? "")}</h${c}>`), s += 1;
2775
+ const s = /^(#{1,4})\s+(.*)$/.exec(o);
2776
+ if (s) {
2777
+ const c = Math.min(s[1].length + 1, 5);
2778
+ l.push(`<h${c}>${qe(s[2] ?? "")}</h${c}>`), n += 1;
2776
2779
  continue;
2777
2780
  }
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] ?? "";
2781
+ if (Le(o)) {
2782
+ const c = /^\s*\d+[.)]\s+/.test(o), v = [];
2783
+ for (; n < t.length && Le(t[n] ?? ""); )
2784
+ for (v.push((t[n] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), n += 1; n < t.length; ) {
2785
+ const m = t[n] ?? "";
2783
2786
  if (m.trim() === "" || Le(m) || /^(#{1,4})\s/.test(m) || /^```/.test(m))
2784
2787
  break;
2785
- v[v.length - 1] += ` ${m.trim()}`, s += 1;
2788
+ v[v.length - 1] += ` ${m.trim()}`, n += 1;
2786
2789
  }
2787
2790
  const h = c ? "ol" : "ul";
2788
- l.push(`<${h}>${v.map((m) => `<li>${Ke(m)}</li>`).join("")}</${h}>`);
2791
+ l.push(`<${h}>${v.map((m) => `<li>${qe(m)}</li>`).join("")}</${h}>`);
2789
2792
  continue;
2790
2793
  }
2791
2794
  const r = [];
2792
- for (; s < t.length; ) {
2793
- const c = t[s] ?? "";
2795
+ for (; n < t.length; ) {
2796
+ const c = t[n] ?? "";
2794
2797
  if (c.trim() === "" || Le(c) || /^(#{1,4})\s/.test(c) || /^```/.test(c)) break;
2795
- r.push(c.trim()), s += 1;
2798
+ r.push(c.trim()), n += 1;
2796
2799
  }
2797
- l.push(`<p>${Ke(r.join(" "))}</p>`);
2800
+ l.push(`<p>${qe(r.join(" "))}</p>`);
2798
2801
  }
2799
2802
  return l.join("");
2800
2803
  }
@@ -2802,52 +2805,52 @@ const We = "\0";
2802
2805
  function Le(e) {
2803
2806
  return /^\s*(?:[-*+]|\d+[.)])\s+/.test(e);
2804
2807
  }
2805
- function Ke(e) {
2806
- const t = [], l = e.replace(/`([^`]+)`/g, (n, i) => (t.push(`<code>${Qe(i)}</code>`), `${We}${t.length - 1}${We}`));
2807
- return Qe(l).replace(
2808
+ function qe(e) {
2809
+ const t = [], l = e.replace(/`([^`]+)`/g, (o, i) => (t.push(`<code>${Ze(i)}</code>`), `${We}${t.length - 1}${We}`));
2810
+ return Ze(l).replace(
2808
2811
  /\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
2809
2812
  '<a href="$2" target="_blank" rel="noopener">$1</a>'
2810
2813
  ).replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(
2811
2814
  new RegExp(`${We}(\\d+)${We}`, "g"),
2812
- (n, i) => t[Number(i)] ?? ""
2815
+ (o, i) => t[Number(i)] ?? ""
2813
2816
  );
2814
2817
  }
2815
- function Qe(e) {
2818
+ function Ze(e) {
2816
2819
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
2817
2820
  }
2818
2821
  function Gn(e) {
2819
2822
  function t(l) {
2820
2823
  (l.target === document.body || l.target === document.documentElement) && e(l);
2821
2824
  }
2822
- Se(() => window.addEventListener("keydown", t)), at(() => window.removeEventListener("keydown", t));
2825
+ Se(() => window.addEventListener("keydown", t)), nt(() => window.removeEventListener("keydown", t));
2823
2826
  }
2824
2827
  function Qn(e, t, l) {
2825
- const s = `${e.apiPath}/entities/${t}/${l}/notes`, n = (o) => `${e.apiPath}/notes/${o}`, i = (o) => o.data;
2828
+ const n = `${e.apiPath}/entities/${t}/${l}/notes`, o = (s) => `${e.apiPath}/notes/${s}`, i = (s) => s.data;
2826
2829
  return {
2827
- list: () => e.http.get(s).then(i),
2828
- add: (o) => e.http.post(s, { body: o }).then(i),
2829
- save: (o, r) => e.http.put(n(o), { body: r }).then(i),
2830
- remove: (o) => e.http.delete(n(o)).then(() => {
2830
+ list: () => e.http.get(n).then(i),
2831
+ add: (s) => e.http.post(n, { body: s }).then(i),
2832
+ save: (s, r) => e.http.put(o(s), { body: r }).then(i),
2833
+ remove: (s) => e.http.delete(o(s)).then(() => {
2831
2834
  })
2832
2835
  };
2833
2836
  }
2834
- const ze = 256 * 1024, Ze = "webx:uploads", Zn = 8e3;
2835
- function qe(e) {
2837
+ const ze = 256 * 1024, et = "webx:uploads", Zn = 8e3;
2838
+ function Ye(e) {
2836
2839
  return `${e.name}|${e.size}|${e.lastModified}`;
2837
2840
  }
2838
- function Po(e, t = ut()) {
2839
- return dt(t).filter((l) => e === void 0 || l.purpose === e);
2841
+ function Po(e, t = dt()) {
2842
+ return ct(t).filter((l) => e === void 0 || l.purpose === e);
2840
2843
  }
2841
- function eo(e, t, l = ut()) {
2844
+ function eo(e, t, l = dt()) {
2842
2845
  jt(
2843
2846
  l,
2844
- dt(l).filter(
2845
- (s) => s.fingerprint !== e || s.purpose !== t
2847
+ ct(l).filter(
2848
+ (n) => n.fingerprint !== e || n.purpose !== t
2846
2849
  )
2847
2850
  );
2848
2851
  }
2849
2852
  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 = _(
2853
+ const t = e.admin ?? ee(), l = e.storage === void 0 ? dt() : e.storage, n = e.retries ?? 3, o = e.retryDelay ?? 1e3, i = `${t.apiPath}/uploads`, s = 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
2854
  () => v.value > 0 ? Math.ceil((c.value - r.value) / v.value) : null
2852
2855
  );
2853
2856
  let k = null, p = "", $ = ze, b = 0, P = null, H = [], j = null, F = null;
@@ -2865,7 +2868,7 @@ function Oo(e = {}) {
2865
2868
  j = null, F = null, Y !== void 0 ? G?.reject(Y) : G?.resolve(D);
2866
2869
  }
2867
2870
  function I(D) {
2868
- m.value = D instanceof Error ? D : new Error(String(D)), o.value = "failed", v.value = 0, T(null, m.value);
2871
+ m.value = D instanceof Error ? D : new Error(String(D)), s.value = "failed", v.value = 0, T(null, m.value);
2869
2872
  }
2870
2873
  function V(D) {
2871
2874
  r.value = Math.min(D, c.value);
@@ -2875,7 +2878,7 @@ function Oo(e = {}) {
2875
2878
  v.value = G !== void 0 && ue > 0 ? (r.value - G.bytes) / ue : 0, k !== null && U(k, p, r.value);
2876
2879
  }
2877
2880
  function U(D, Y, G) {
2878
- const ue = qe(D), le = dt(l).filter(
2881
+ const ue = Ye(D), le = ct(l).filter(
2879
2882
  (he) => he.fingerprint !== ue || he.purpose !== Y
2880
2883
  );
2881
2884
  jt(l, [
@@ -2891,22 +2894,22 @@ function Oo(e = {}) {
2891
2894
  ]);
2892
2895
  }
2893
2896
  function O() {
2894
- k !== null && eo(qe(k), p, l);
2897
+ k !== null && eo(Ye(k), p, l);
2895
2898
  }
2896
2899
  function te() {
2897
2900
  b += 1, P?.abort(), P = null, v.value = 0, H = [];
2898
2901
  }
2899
2902
  async function re(D, Y) {
2900
- if (o.value === "uploading" || o.value === "paused" || o.value === "offline")
2903
+ if (s.value === "uploading" || s.value === "paused" || s.value === "offline")
2901
2904
  throw new Error("This upload is still going; cancel it before starting another.");
2902
- te(), k = D, p = Y, h.value = null, m.value = null, r.value = 0, c.value = D.size, o.value = "uploading";
2905
+ te(), k = D, p = Y, h.value = null, m.value = null, r.value = 0, c.value = D.size, s.value = "uploading";
2903
2906
  const G = W(), ue = b;
2904
2907
  try {
2905
2908
  const le = await t.http.post(i, {
2906
2909
  name: D.name,
2907
2910
  size: D.size,
2908
2911
  type: D.type,
2909
- fingerprint: qe(D),
2912
+ fingerprint: Ye(D),
2910
2913
  purpose: Y
2911
2914
  });
2912
2915
  if (ue !== b)
@@ -2920,16 +2923,16 @@ function Oo(e = {}) {
2920
2923
  async function ce() {
2921
2924
  const D = await y("HEAD", `${i}/${h.value}`);
2922
2925
  if (!D.ok)
2923
- return I(await Ge(D)), !1;
2924
- const Y = Ye(D);
2926
+ return I(await Qe(D)), !1;
2927
+ const Y = Xe(D);
2925
2928
  return Y !== null && V(Y), !0;
2926
2929
  }
2927
2930
  async function B() {
2928
2931
  const D = b;
2929
2932
  let Y = 0;
2930
- for (o.value = "uploading"; D === b && k !== null && h.value !== null; ) {
2933
+ for (s.value = "uploading"; D === b && k !== null && h.value !== null; ) {
2931
2934
  if (r.value >= c.value) {
2932
- o.value = "done", v.value = 0, O(), T(h.value);
2935
+ s.value = "done", v.value = 0, O(), T(h.value);
2933
2936
  return;
2934
2937
  }
2935
2938
  const G = r.value, ue = Math.min(c.value, G + $);
@@ -2951,11 +2954,11 @@ function Oo(e = {}) {
2951
2954
  z();
2952
2955
  return;
2953
2956
  }
2954
- if (Y += 1, Y > s) {
2957
+ if (Y += 1, Y > n) {
2955
2958
  I(he);
2956
2959
  return;
2957
2960
  }
2958
- if (await lo(n * 2 ** (Y - 1)), D !== b)
2961
+ if (await lo(o * 2 ** (Y - 1)), D !== b)
2959
2962
  return;
2960
2963
  try {
2961
2964
  if (!await ce())
@@ -2967,11 +2970,11 @@ function Oo(e = {}) {
2967
2970
  if (D !== b)
2968
2971
  return;
2969
2972
  if (le.ok) {
2970
- Y = 0, V(Ye(le) ?? ue);
2973
+ Y = 0, V(Xe(le) ?? ue);
2971
2974
  continue;
2972
2975
  }
2973
2976
  if (le.status === 409) {
2974
- const he = Ye(le);
2977
+ const he = Xe(le);
2975
2978
  if (he !== null) {
2976
2979
  V(he);
2977
2980
  continue;
@@ -2981,24 +2984,24 @@ function Oo(e = {}) {
2981
2984
  $ = Math.max(ze, Math.floor($ / 2));
2982
2985
  continue;
2983
2986
  }
2984
- I(await Ge(le));
2987
+ I(await Qe(le));
2985
2988
  return;
2986
2989
  }
2987
2990
  }
2988
2991
  function g() {
2989
- o.value === "uploading" && (te(), o.value = "paused");
2992
+ s.value === "uploading" && (te(), s.value = "paused");
2990
2993
  }
2991
2994
  function z() {
2992
- te(), o.value = "offline";
2995
+ te(), s.value = "offline";
2993
2996
  }
2994
2997
  async function N() {
2995
- if (o.value === "uploading" || o.value === "done" || o.value === "idle")
2996
- return F ?? Promise.resolve(o.value === "done" ? h.value : null);
2998
+ if (s.value === "uploading" || s.value === "done" || s.value === "idle")
2999
+ return F ?? Promise.resolve(s.value === "done" ? h.value : null);
2997
3000
  if (k === null)
2998
3001
  return Promise.resolve(null);
2999
3002
  if (h.value === null)
3000
- return o.value = "idle", re(k, p);
3001
- te(), m.value = null, o.value = "uploading";
3003
+ return s.value = "idle", re(k, p);
3004
+ te(), m.value = null, s.value = "uploading";
3002
3005
  const D = W(), Y = b;
3003
3006
  try {
3004
3007
  await ce() && Y === b && B();
@@ -3009,22 +3012,22 @@ function Oo(e = {}) {
3009
3012
  }
3010
3013
  async function X() {
3011
3014
  const D = h.value;
3012
- if (te(), O(), o.value = "idle", r.value = 0, h.value = null, T(null), D !== null)
3015
+ if (te(), O(), s.value = "idle", r.value = 0, h.value = null, T(null), D !== null)
3013
3016
  try {
3014
3017
  await y("DELETE", `${i}/${D}`);
3015
3018
  } catch {
3016
3019
  }
3017
3020
  }
3018
3021
  function pe() {
3019
- o.value === "uploading" && z();
3022
+ s.value === "uploading" && z();
3020
3023
  }
3021
- function ft() {
3022
- o.value === "offline" && N();
3024
+ function mt() {
3025
+ s.value === "offline" && N();
3023
3026
  }
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();
3027
+ return typeof window < "u" && (window.addEventListener("offline", pe), window.addEventListener("online", mt)), el() !== void 0 && tl(() => {
3028
+ typeof window < "u" && (window.removeEventListener("offline", pe), window.removeEventListener("online", mt)), g();
3026
3029
  }), {
3027
- state: we(o),
3030
+ state: we(s),
3028
3031
  progress: u,
3029
3032
  uploaded: we(r),
3030
3033
  total: we(c),
@@ -3038,16 +3041,16 @@ function Oo(e = {}) {
3038
3041
  cancel: X
3039
3042
  };
3040
3043
  }
3041
- async function to(e, t, l, s) {
3042
- return e.send !== void 0 ? e.send(t, l, s) : globalThis.fetch(l, {
3044
+ async function to(e, t, l, n) {
3045
+ return e.send !== void 0 ? e.send(t, l, n) : globalThis.fetch(l, {
3043
3046
  method: t,
3044
3047
  credentials: "same-origin",
3045
- headers: { Accept: "application/json", ...s.headers },
3046
- body: s.body ?? void 0,
3047
- signal: s.signal
3048
+ headers: { Accept: "application/json", ...n.headers },
3049
+ body: n.body ?? void 0,
3050
+ signal: n.signal
3048
3051
  });
3049
3052
  }
3050
- function Ye(e) {
3053
+ function Xe(e) {
3051
3054
  const t = e.headers.get("Upload-Offset");
3052
3055
  return t === null || !/^\d+$/.test(t) ? null : Number.parseInt(t, 10);
3053
3056
  }
@@ -3057,18 +3060,18 @@ function kt() {
3057
3060
  function lo(e) {
3058
3061
  return new Promise((t) => setTimeout(t, e));
3059
3062
  }
3060
- function ut() {
3063
+ function dt() {
3061
3064
  try {
3062
3065
  return typeof localStorage > "u" ? null : localStorage;
3063
3066
  } catch {
3064
3067
  return null;
3065
3068
  }
3066
3069
  }
3067
- function dt(e) {
3070
+ function ct(e) {
3068
3071
  if (e === null)
3069
3072
  return [];
3070
3073
  try {
3071
- const t = JSON.parse(e.getItem(Ze) ?? "[]");
3074
+ const t = JSON.parse(e.getItem(et) ?? "[]");
3072
3075
  return Array.isArray(t) ? t : [];
3073
3076
  } catch {
3074
3077
  return [];
@@ -3077,7 +3080,7 @@ function dt(e) {
3077
3080
  function jt(e, t) {
3078
3081
  if (e !== null)
3079
3082
  try {
3080
- t.length === 0 ? e.removeItem(Ze) : e.setItem(Ze, JSON.stringify(t));
3083
+ t.length === 0 ? e.removeItem(et) : e.setItem(et, JSON.stringify(t));
3081
3084
  } catch {
3082
3085
  }
3083
3086
  }
@@ -3092,17 +3095,17 @@ function no(e) {
3092
3095
  return (e.q ?? "").trim() !== "" || e.filtered ? "locked" : e.category == null ? "all" : "category";
3093
3096
  }
3094
3097
  function Do(e, t) {
3095
- const l = ee(), s = J("webx-admin"), n = _(() => no(t()));
3098
+ const l = ee(), n = J("webx-admin"), o = _(() => no(t()));
3096
3099
  return {
3097
- mode: n,
3098
- sortable: _(() => n.value !== "locked"),
3099
- hint: _(() => s(`categories.order-${n.value}`)),
3100
- move: (i) => Rl(l, e, i, n.value === "category" ? t().category ?? null : null)
3100
+ mode: o,
3101
+ sortable: _(() => o.value !== "locked"),
3102
+ hint: _(() => n(`categories.order-${o.value}`)),
3103
+ move: (i) => Rl(l, e, i, o.value === "category" ? t().category ?? null : null)
3101
3104
  };
3102
3105
  }
3103
- function ct(e = {}) {
3106
+ function ft(e = {}) {
3104
3107
  const t = J("webx-admin");
3105
- return (l, s) => t(e[l] ?? `webx-admin::categories.${l}`, s);
3108
+ return (l, n) => t(e[l] ?? `webx-admin::categories.${l}`, n);
3106
3109
  }
3107
3110
  const oo = /* @__PURE__ */ q({
3108
3111
  name: "WxCategoryCreateDialog",
@@ -3111,9 +3114,9 @@ const oo = /* @__PURE__ */ q({
3111
3114
  options: {}
3112
3115
  },
3113
3116
  setup(e) {
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");
3117
+ const t = e, { open: l, resolve: n, dismiss: o } = _l(), i = _e(ee(), t.options.api), s = ft(t.options.words), r = A(""), c = A(!1), v = A({}), h = at("field");
3115
3118
  Se(async () => {
3116
- await tt(), h.value?.querySelector("input")?.focus();
3119
+ await lt(), h.value?.querySelector("input")?.focus();
3117
3120
  });
3118
3121
  function m(f) {
3119
3122
  const k = Object.keys(v.value).find((p) => p === f || p.startsWith(`${f}.`));
@@ -3123,7 +3126,7 @@ const oo = /* @__PURE__ */ q({
3123
3126
  if (!(r.value.trim() === "" || c.value)) {
3124
3127
  c.value = !0, v.value = {};
3125
3128
  try {
3126
- s(await i.create({ title: r.value.trim() }));
3129
+ n(await i.create({ title: r.value.trim() }));
3127
3130
  } catch (f) {
3128
3131
  v.value = f.body?.errors ?? {};
3129
3132
  } finally {
@@ -3131,10 +3134,10 @@ const oo = /* @__PURE__ */ q({
3131
3134
  }
3132
3135
  }
3133
3136
  }
3134
- return (f, k) => (d(), L(a(ot), {
3137
+ return (f, k) => (d(), L(a(st), {
3135
3138
  open: a(l),
3136
3139
  "onUpdate:open": k[2] || (k[2] = (p) => Tt(l) ? l.value = p : null),
3137
- title: a(o)("new"),
3140
+ title: a(s)("new"),
3138
3141
  width: 440
3139
3142
  }, {
3140
3143
  footer: w(() => [
@@ -3142,10 +3145,10 @@ const oo = /* @__PURE__ */ q({
3142
3145
  default: w(() => [
3143
3146
  x(a(de), {
3144
3147
  variant: "outline",
3145
- onClick: k[1] || (k[1] = (p) => a(n)())
3148
+ onClick: k[1] || (k[1] = (p) => a(o)())
3146
3149
  }, {
3147
3150
  default: w(() => [
3148
- R(C(a(o)("cancel")), 1)
3151
+ R(C(a(s)("cancel")), 1)
3149
3152
  ]),
3150
3153
  _: 1
3151
3154
  }),
@@ -3156,7 +3159,7 @@ const oo = /* @__PURE__ */ q({
3156
3159
  onClick: u
3157
3160
  }, {
3158
3161
  default: w(() => [
3159
- R(C(a(o)("create")), 1)
3162
+ R(C(a(s)("create")), 1)
3160
3163
  ]),
3161
3164
  _: 1
3162
3165
  }, 8, ["loading", "disabled"])
@@ -3166,7 +3169,7 @@ const oo = /* @__PURE__ */ q({
3166
3169
  ]),
3167
3170
  default: w(() => [
3168
3171
  x(a(xl), {
3169
- label: a(o)("field-title"),
3172
+ label: a(s)("field-title"),
3170
3173
  error: m("title") ?? m("slug"),
3171
3174
  required: ""
3172
3175
  }, {
@@ -3178,7 +3181,7 @@ const oo = /* @__PURE__ */ q({
3178
3181
  x(a(Te), {
3179
3182
  modelValue: r.value,
3180
3183
  "onUpdate:modelValue": k[0] || (k[0] = (p) => r.value = p),
3181
- "aria-label": a(o)("field-title"),
3184
+ "aria-label": a(s)("field-title"),
3182
3185
  onKeyup: Ct(u, ["enter"])
3183
3186
  }, null, 8, ["modelValue", "aria-label"])
3184
3187
  ], 512)
@@ -3196,8 +3199,8 @@ const oo = /* @__PURE__ */ q({
3196
3199
  options: {}
3197
3200
  },
3198
3201
  setup(e) {
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 ?? ""
3202
+ const t = e, l = ee(), n = _e(l, t.options.api), o = Me(), i = ft(t.options.words), s = J("webx-admin"), r = De(), c = A([]), v = A(!0), h = A(!0), m = _(() => l.can(t.options.manage)), u = _(
3203
+ () => t.options.title ? s(t.options.title) : l.state.manifest?.modules.find((y) => y.id === t.options.module)?.title ?? ""
3201
3204
  ), f = $l(oo), k = _(
3202
3205
  () => m.value ? [{ key: "new", label: i("new"), icon: "plus", primary: !0, run: () => {
3203
3206
  P();
@@ -3209,7 +3212,7 @@ const oo = /* @__PURE__ */ q({
3209
3212
  async function $() {
3210
3213
  v.value = !0;
3211
3214
  try {
3212
- const y = await s.list();
3215
+ const y = await n.list();
3213
3216
  c.value = y.data, h.value = y.prefix !== null;
3214
3217
  } catch (y) {
3215
3218
  Z.danger(r(y));
@@ -3219,7 +3222,7 @@ const oo = /* @__PURE__ */ q({
3219
3222
  }
3220
3223
  $();
3221
3224
  function b(y) {
3222
- n.push(`${t.options.path}/${y.id}`);
3225
+ o.push(`${t.options.path}/${y.id}`);
3223
3226
  }
3224
3227
  async function P() {
3225
3228
  const y = await f({ options: t.options });
@@ -3238,7 +3241,7 @@ const oo = /* @__PURE__ */ q({
3238
3241
  tone: "danger"
3239
3242
  }))
3240
3243
  try {
3241
- await s.remove(y.id), Z.success(i("deleted")), await $();
3244
+ await n.remove(y.id), Z.success(i("deleted")), await $();
3242
3245
  } catch (T) {
3243
3246
  Z.danger(r(T));
3244
3247
  }
@@ -3250,7 +3253,7 @@ const oo = /* @__PURE__ */ q({
3250
3253
  label: i("show-items"),
3251
3254
  icon: "file-txt",
3252
3255
  run: () => {
3253
- n.push(T(y.id));
3256
+ o.push(T(y.id));
3254
3257
  }
3255
3258
  }), y.url && y.is_visible && W.push({ key: "site", label: i("open-on-site"), icon: "link", href: y.url }), m.value && W.push({
3256
3259
  key: "delete",
@@ -3264,7 +3267,7 @@ const oo = /* @__PURE__ */ q({
3264
3267
  }
3265
3268
  async function F() {
3266
3269
  try {
3267
- await s.reorder(c.value.map((y) => y.id));
3270
+ await n.reorder(c.value.map((y) => y.id));
3268
3271
  } catch (y) {
3269
3272
  Z.danger(r(y, i("reorder-failed"))), await $();
3270
3273
  }
@@ -3275,7 +3278,7 @@ const oo = /* @__PURE__ */ q({
3275
3278
  class: "wx-categories",
3276
3279
  title: u.value,
3277
3280
  back: t.options.back?.path,
3278
- "back-label": t.options.back ? a(o)(t.options.back.label) : void 0,
3281
+ "back-label": t.options.back ? a(s)(t.options.back.label) : void 0,
3279
3282
  actions: k.value,
3280
3283
  padding: "sm"
3281
3284
  }, {
@@ -3289,7 +3292,7 @@ const oo = /* @__PURE__ */ q({
3289
3292
  title: a(i)("empty"),
3290
3293
  description: a(i)("empty-help")
3291
3294
  }, null, 8, ["title", "description"])) : (d(), S(K, { key: 2 }, [
3292
- x(a(nt), {
3295
+ x(a(ot), {
3293
3296
  modelValue: c.value,
3294
3297
  "onUpdate:modelValue": W[0] || (W[0] = (I) => c.value = I),
3295
3298
  class: "wx-categories__list",
@@ -3320,7 +3323,7 @@ const oo = /* @__PURE__ */ q({
3320
3323
  content: a(i)("hidden")
3321
3324
  }, {
3322
3325
  default: w(() => [
3323
- x(a(st), {
3326
+ x(a(it), {
3324
3327
  name: "eye-off",
3325
3328
  size: "sm"
3326
3329
  })
@@ -3354,7 +3357,7 @@ const oo = /* @__PURE__ */ q({
3354
3357
  ]),
3355
3358
  _: 2
3356
3359
  }, 1024),
3357
- x(rt, {
3360
+ x(ut, {
3358
3361
  actions: j(I),
3359
3362
  label: I.name
3360
3363
  }, null, 8, ["actions", "label"])
@@ -3383,23 +3386,23 @@ const oo = /* @__PURE__ */ q({
3383
3386
  linger: { default: 2e3 }
3384
3387
  },
3385
3388
  setup(e) {
3386
- const t = e, l = J("webx-admin"), s = A(!1);
3387
- let n = null;
3389
+ const t = e, l = J("webx-admin"), n = A(!1);
3390
+ let o = null;
3388
3391
  ie(
3389
3392
  () => t.state,
3390
- (o, r) => {
3391
- n !== null && clearTimeout(n), s.value = r === "saving" && o === "saved", s.value && (n = window.setTimeout(() => {
3392
- s.value = !1, n = null;
3393
+ (s, r) => {
3394
+ o !== null && clearTimeout(o), n.value = r === "saving" && s === "saved", n.value && (o = window.setTimeout(() => {
3395
+ n.value = !1, o = null;
3393
3396
  }, t.linger));
3394
3397
  }
3395
3398
  );
3396
3399
  const i = _(
3397
- () => t.state === "saving" ? "saving" : s.value ? "saved" : null
3400
+ () => t.state === "saving" ? "saving" : n.value ? "saved" : null
3398
3401
  );
3399
- return at(() => {
3400
- n !== null && clearTimeout(n);
3401
- }), (o, r) => (d(), S("span", ro, [
3402
- i.value ? (d(), L(a(st), {
3402
+ return nt(() => {
3403
+ o !== null && clearTimeout(o);
3404
+ }), (s, r) => (d(), S("span", ro, [
3405
+ i.value ? (d(), L(a(it), {
3403
3406
  key: 0,
3404
3407
  class: ve(["wx-save-state__mark", { "is-saved": i.value === "saved" }]),
3405
3408
  name: i.value === "saving" ? "loader" : "check",
@@ -3423,17 +3426,17 @@ const oo = /* @__PURE__ */ q({
3423
3426
  }),
3424
3427
  emits: /* @__PURE__ */ me(["loaded"], ["update:modelValue"]),
3425
3428
  setup(e, { expose: t, emit: l }) {
3426
- const s = e, n = l, i = ge(e, "modelValue"), o = ee(), r = J("webx-admin"), c = A(null), v = A(null);
3429
+ const n = e, o = l, i = ge(e, "modelValue"), s = ee(), r = J("webx-admin"), c = A(null), v = A(null);
3427
3430
  async function h() {
3428
3431
  c.value = null, v.value = null;
3429
3432
  try {
3430
- const m = await o.loadScreen(s.name);
3431
- c.value = m, n("loaded", m);
3433
+ const m = await s.loadScreen(n.name);
3434
+ c.value = m, o("loaded", m);
3432
3435
  } catch (m) {
3433
3436
  v.value = m instanceof Error ? m.message : String(m);
3434
3437
  }
3435
3438
  }
3436
- return ie([() => s.name, () => o.i18n.state.locale], () => {
3439
+ return ie([() => n.name, () => s.i18n.state.locale], () => {
3437
3440
  h();
3438
3441
  }, { immediate: !0 }), t({ reload: h }), (m, u) => (d(), S("div", fo, [
3439
3442
  v.value ? (d(), L(a(Oe), {
@@ -3449,11 +3452,11 @@ const oo = /* @__PURE__ */ q({
3449
3452
  modelValue: i.value,
3450
3453
  "onUpdate:modelValue": u[0] || (u[0] = (f) => i.value = f),
3451
3454
  root: c.value,
3452
- patch: a(o).screenPatch(e.name),
3453
- types: a(o).types,
3455
+ patch: a(s).screenPatch(e.name),
3456
+ types: a(s).types,
3454
3457
  errors: e.errors,
3455
- translate: a(o).i18n.t,
3456
- can: a(o).can,
3458
+ translate: a(s).i18n.t,
3459
+ can: a(s).can,
3457
3460
  disabled: e.disabled,
3458
3461
  "label-position": e.labelPosition,
3459
3462
  "label-width": e.labelWidth,
@@ -3468,11 +3471,11 @@ const oo = /* @__PURE__ */ q({
3468
3471
  options: {}
3469
3472
  },
3470
3473
  setup(e) {
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 = _(
3474
+ const t = e, l = ee(), n = _e(l, t.options.api), o = At(), i = Me(), s = zt(), r = ft(t.options.words), c = J("webx-admin"), v = De(), h = _(() => Number(o.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
3475
  () => t.options.title ? c(t.options.title) : l.state.manifest?.modules.find((B) => B.id === t.options.module)?.title ?? ""
3473
3476
  ), T = _(() => {
3474
3477
  const B = f.value.title;
3475
- return Sl(B, o.active.value, u.value?.name ?? "") || r("untitled");
3478
+ return Sl(B, s.active.value, u.value?.name ?? "") || r("untitled");
3476
3479
  });
3477
3480
  ao({ category: u, values: f, prefix: k, moving: () => r("address-moving") }), Ra({ id: _(() => u.value?.id ?? null) }), bn({
3478
3481
  values: f,
@@ -3486,7 +3489,7 @@ const oo = /* @__PURE__ */ q({
3486
3489
  async function V() {
3487
3490
  $.value = !0;
3488
3491
  try {
3489
- I(await s.get(h.value));
3492
+ I(await n.get(h.value));
3490
3493
  } catch (B) {
3491
3494
  Z.danger(v(B)), i.push(m.value);
3492
3495
  } finally {
@@ -3497,7 +3500,7 @@ const oo = /* @__PURE__ */ q({
3497
3500
  if (!(!u.value || b.value || !H.value)) {
3498
3501
  b.value = !0, P.value = {};
3499
3502
  try {
3500
- I(await s.save(u.value.id, f.value)), Z.success(r("saved"));
3503
+ I(await n.save(u.value.id, f.value)), Z.success(r("saved"));
3501
3504
  } catch (B) {
3502
3505
  const g = B.body;
3503
3506
  g?.errors ? (P.value = g.errors, Z.danger(r("save-failed"))) : Z.danger(v(B));
@@ -3516,7 +3519,7 @@ const oo = /* @__PURE__ */ q({
3516
3519
  tone: "danger"
3517
3520
  })))
3518
3521
  try {
3519
- await s.remove(B.id), Z.success(r("deleted")), p.value = j.value, i.push(m.value);
3522
+ await n.remove(B.id), Z.success(r("deleted")), p.value = j.value, i.push(m.value);
3520
3523
  } catch (z) {
3521
3524
  Z.danger(v(z));
3522
3525
  }
@@ -3531,7 +3534,7 @@ const oo = /* @__PURE__ */ q({
3531
3534
  V();
3532
3535
  }), Se(() => {
3533
3536
  V(), window.addEventListener("beforeunload", te);
3534
- }), at(() => {
3537
+ }), nt(() => {
3535
3538
  window.removeEventListener("beforeunload", te);
3536
3539
  }), ol(async () => !F.value || !H.value ? !0 : await Ee({
3537
3540
  title: r("leave-title"),
@@ -3563,7 +3566,7 @@ const oo = /* @__PURE__ */ q({
3563
3566
  title: "",
3564
3567
  rows: 1
3565
3568
  }),
3566
- x(a(Je), null, {
3569
+ x(a(Ge), null, {
3567
3570
  default: w(() => [
3568
3571
  x(a(ye), { rows: 6 })
3569
3572
  ]),
@@ -3584,7 +3587,7 @@ const oo = /* @__PURE__ */ q({
3584
3587
  label: a(r)("trail")
3585
3588
  }, {
3586
3589
  default: w(() => [
3587
- x(a(vt), {
3590
+ x(a(pt), {
3588
3591
  as: "router-link",
3589
3592
  to: m.value
3590
3593
  }, {
@@ -3593,7 +3596,7 @@ const oo = /* @__PURE__ */ q({
3593
3596
  ]),
3594
3597
  _: 1
3595
3598
  }, 8, ["to"]),
3596
- x(a(vt), { current: "" }, {
3599
+ x(a(pt), { current: "" }, {
3597
3600
  default: w(() => [
3598
3601
  R(C(T.value), 1)
3599
3602
  ]),
@@ -3670,16 +3673,16 @@ const Ho = 76, jo = /* @__PURE__ */ q({
3670
3673
  filters: {}
3671
3674
  },
3672
3675
  setup(e) {
3673
- return (t, l) => (d(!0), S(K, null, se(e.filters, (s) => (d(), L(a(Pe), {
3674
- key: s.key,
3676
+ return (t, l) => (d(!0), S(K, null, se(e.filters, (n) => (d(), L(a(Pe), {
3677
+ key: n.key,
3675
3678
  class: "wx-filter-chip",
3676
3679
  size: "sm",
3677
3680
  round: "",
3678
3681
  closable: "",
3679
- onClose: (n) => s.clear()
3682
+ onClose: (o) => n.clear()
3680
3683
  }, {
3681
3684
  default: w(() => [
3682
- R(C(s.label), 1)
3685
+ R(C(n.label), 1)
3683
3686
  ]),
3684
3687
  _: 2
3685
3688
  }, 1032, ["onClose"]))), 128));
@@ -3695,17 +3698,17 @@ const Ho = 76, jo = /* @__PURE__ */ q({
3695
3698
  },
3696
3699
  emits: ["rename"],
3697
3700
  setup(e, { emit: t }) {
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"));
3701
+ const l = e, n = t, o = J("webx-admin"), i = A(!1), s = A(l.name), r = A(null), c = _(() => l.label ?? o("editor.rename"));
3699
3702
  ie(i, async (h) => {
3700
- h && (o.value = l.name, await tt(), r.value?.focus(), r.value?.select());
3703
+ h && (s.value = l.name, await lt(), r.value?.focus(), r.value?.select());
3701
3704
  });
3702
3705
  function v() {
3703
- const h = o.value.trim();
3706
+ const h = s.value.trim();
3704
3707
  if (h === "" || h === l.name) {
3705
3708
  i.value = !1;
3706
3709
  return;
3707
3710
  }
3708
- s("rename", h), i.value = !1;
3711
+ n("rename", h), i.value = !1;
3709
3712
  }
3710
3713
  return (h, m) => (d(), L(a(Al), {
3711
3714
  open: i.value,
@@ -3732,8 +3735,8 @@ const Ho = 76, jo = /* @__PURE__ */ q({
3732
3735
  x(a(Te), {
3733
3736
  ref_key: "field",
3734
3737
  ref: r,
3735
- modelValue: o.value,
3736
- "onUpdate:modelValue": m[0] || (m[0] = (u) => o.value = u),
3738
+ modelValue: s.value,
3739
+ "onUpdate:modelValue": m[0] || (m[0] = (u) => s.value = u),
3737
3740
  "aria-label": c.value,
3738
3741
  placeholder: e.placeholder,
3739
3742
  onKeydown: m[1] || (m[1] = Ct((u) => i.value = !1, ["esc"]))
@@ -3745,7 +3748,7 @@ const Ho = 76, jo = /* @__PURE__ */ q({
3745
3748
  "native-type": "submit"
3746
3749
  }, {
3747
3750
  default: w(() => [
3748
- R(C(a(n)("editor.save")), 1)
3751
+ R(C(a(o)("editor.save")), 1)
3749
3752
  ]),
3750
3753
  _: 1
3751
3754
  })
@@ -3765,20 +3768,20 @@ const Ho = 76, jo = /* @__PURE__ */ q({
3765
3768
  width: { default: 720 }
3766
3769
  },
3767
3770
  setup(e) {
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, [
3771
+ const t = e, l = J("webx-admin"), n = A(!1), o = _(() => t.title ?? l("help.title")), i = _(() => Jn(t.body));
3772
+ return (s, r) => (d(), S(K, null, [
3770
3773
  x(a(be), {
3771
3774
  type: "details",
3772
3775
  icon: "question",
3773
3776
  tone: "neutral",
3774
3777
  size: e.size,
3775
- title: e.label ?? n.value,
3776
- onClick: r[0] || (r[0] = (c) => s.value = !0)
3778
+ title: e.label ?? o.value,
3779
+ onClick: r[0] || (r[0] = (c) => n.value = !0)
3777
3780
  }, null, 8, ["size", "title"]),
3778
- x(a(ot), {
3779
- open: s.value,
3780
- "onUpdate:open": r[1] || (r[1] = (c) => s.value = c),
3781
- title: n.value,
3781
+ x(a(st), {
3782
+ open: n.value,
3783
+ "onUpdate:open": r[1] || (r[1] = (c) => n.value = c),
3784
+ title: o.value,
3782
3785
  width: e.width
3783
3786
  }, {
3784
3787
  default: w(() => [
@@ -3811,13 +3814,13 @@ const Ho = 76, jo = /* @__PURE__ */ q({
3811
3814
  },
3812
3815
  emits: ["change"],
3813
3816
  setup(e, { emit: t }) {
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"));
3817
+ const l = e, n = t, o = ee(), i = J("webx-admin"), s = De(), r = A([]), c = A(!0), v = A(""), h = A(!1), m = A(null), u = A(""), f = _(() => Qn(o, l.type, l.id)), k = _(() => l.title ?? i("notes.title"));
3815
3818
  async function p() {
3816
3819
  c.value = !0;
3817
3820
  try {
3818
3821
  r.value = await f.value.list();
3819
3822
  } catch (y) {
3820
- Z.danger(o(y));
3823
+ Z.danger(s(y));
3821
3824
  } finally {
3822
3825
  c.value = !1;
3823
3826
  }
@@ -3834,9 +3837,9 @@ const Ho = 76, jo = /* @__PURE__ */ q({
3834
3837
  if (!(y === "" || h.value)) {
3835
3838
  h.value = !0;
3836
3839
  try {
3837
- r.value = [...r.value, await f.value.add(y)], v.value = "", s("change");
3840
+ r.value = [...r.value, await f.value.add(y)], v.value = "", n("change");
3838
3841
  } catch (W) {
3839
- Z.danger(o(W));
3842
+ Z.danger(s(W));
3840
3843
  } finally {
3841
3844
  h.value = !1;
3842
3845
  }
@@ -3850,9 +3853,9 @@ const Ho = 76, jo = /* @__PURE__ */ q({
3850
3853
  if (W !== "")
3851
3854
  try {
3852
3855
  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");
3856
+ r.value = r.value.map((I) => I.id === T.id ? T : I), m.value = null, Z.success(i("notes.saved")), n("change");
3854
3857
  } catch (T) {
3855
- Z.danger(o(T));
3858
+ Z.danger(s(T));
3856
3859
  }
3857
3860
  }
3858
3861
  async function H(y) {
@@ -3864,9 +3867,9 @@ const Ho = 76, jo = /* @__PURE__ */ q({
3864
3867
  tone: "danger"
3865
3868
  }))
3866
3869
  try {
3867
- await f.value.remove(y.id), r.value = r.value.filter((T) => T.id !== y.id), Z.success(i("notes.deleted")), s("change");
3870
+ await f.value.remove(y.id), r.value = r.value.filter((T) => T.id !== y.id), Z.success(i("notes.deleted")), n("change");
3868
3871
  } catch (T) {
3869
- Z.danger(o(T));
3872
+ Z.danger(s(T));
3870
3873
  }
3871
3874
  }
3872
3875
  function j(y) {
@@ -3929,13 +3932,13 @@ const Ho = 76, jo = /* @__PURE__ */ q({
3929
3932
  x(Ue, {
3930
3933
  value: T.created_at
3931
3934
  }, null, 8, ["value"]),
3932
- x(rt, {
3935
+ x(ut, {
3933
3936
  actions: j(T),
3934
3937
  label: F(T)
3935
3938
  }, null, 8, ["actions", "label"])
3936
3939
  ]),
3937
3940
  m.value === T.id ? (d(), S(K, { key: 0 }, [
3938
- x(a(pt), {
3941
+ x(a(ht), {
3939
3942
  modelValue: u.value,
3940
3943
  "onUpdate:modelValue": W[0] || (W[0] = (I) => u.value = I),
3941
3944
  autosize: { minRows: 2, maxRows: 10 }
@@ -3967,7 +3970,7 @@ const Ho = 76, jo = /* @__PURE__ */ q({
3967
3970
  ]))), 128))
3968
3971
  ])),
3969
3972
  e.can ? (d(), S("div", To, [
3970
- x(a(pt), {
3973
+ x(a(ht), {
3971
3974
  modelValue: v.value,
3972
3975
  "onUpdate:modelValue": W[2] || (W[2] = (T) => v.value = T),
3973
3976
  placeholder: a(i)("notes.placeholder"),
@@ -3995,13 +3998,13 @@ const Ho = 76, jo = /* @__PURE__ */ q({
3995
3998
  name: "WxBackupNote",
3996
3999
  __name: "BackupNote",
3997
4000
  setup(e) {
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;
4001
+ const t = ee(), l = It(), n = J("webx-admin"), o = _(() => t.state.manifest?.backup ?? null), i = _(() => o.value !== null && t.can("settings.view")), s = _(() => {
4002
+ const v = o.value?.at;
4000
4003
  if (v == null) return !0;
4001
4004
  const h = new Date(v).getTime();
4002
4005
  return Number.isNaN(h) || Date.now() - h > Wo * 36e5;
4003
4006
  }), r = _(() => {
4004
- const v = n.value?.bytes;
4007
+ const v = o.value?.bytes;
4005
4008
  if (v == null) return "";
4006
4009
  const h = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte"];
4007
4010
  let m = v, u = 0;
@@ -4014,9 +4017,9 @@ const Ho = 76, jo = /* @__PURE__ */ q({
4014
4017
  maximumFractionDigits: m >= 10 || u === 0 ? 0 : 1
4015
4018
  }).format(m);
4016
4019
  }), c = _(
4017
- () => n.value?.at == null ? s("backup.never") : s("backup.stale", { date: l.short(n.value.at) })
4020
+ () => o.value?.at == null ? n("backup.never") : n("backup.stale", { date: l.short(o.value.at) })
4018
4021
  );
4019
- return (v, h) => i.value && o.value ? (d(), L(a(Oe), {
4022
+ return (v, h) => i.value && s.value ? (d(), L(a(Oe), {
4020
4023
  key: 0,
4021
4024
  type: "warning",
4022
4025
  variant: "soft",
@@ -4027,12 +4030,12 @@ const Ho = 76, jo = /* @__PURE__ */ q({
4027
4030
  tone: "muted"
4028
4031
  }, {
4029
4032
  default: w(() => [
4030
- R(C(a(s)("backup.title")), 1)
4033
+ R(C(a(n)("backup.title")), 1)
4031
4034
  ]),
4032
4035
  _: 1
4033
4036
  }),
4034
4037
  x(Ue, {
4035
- value: n.value?.at
4038
+ value: o.value?.at
4036
4039
  }, null, 8, ["value"]),
4037
4040
  r.value ? (d(), L(a(Q), {
4038
4041
  key: 0,
@@ -4073,7 +4076,7 @@ export {
4073
4076
  Nt as WxRelationsField,
4074
4077
  Ko as WxRenameButton,
4075
4078
  gn as WxRichTextField,
4076
- rt as WxRowMenu,
4079
+ ut as WxRowMenu,
4077
4080
  co as WxSaveState,
4078
4081
  mo as WxScreen,
4079
4082
  Pt as WxScreenHead,
@@ -4091,12 +4094,12 @@ export {
4091
4094
  La as createDates,
4092
4095
  Ua as createHistoryApi,
4093
4096
  Fl as createHttp,
4094
- it as createI18n,
4097
+ rt as createI18n,
4095
4098
  wa as createLinksApi,
4096
4099
  Qn as createNotesApi,
4097
4100
  jl as createRelationsApi,
4098
4101
  Dn as createTheme,
4099
- gt as defaultMarkup,
4102
+ bt as defaultMarkup,
4100
4103
  ba as emptyLink,
4101
4104
  Va as errorText,
4102
4105
  eo as forgetUnfinishedUpload,
@@ -4104,7 +4107,7 @@ export {
4104
4107
  je as historyValue,
4105
4108
  Be as i18nKey,
4106
4109
  no as itemOrderMode,
4107
- yt as normaliseCollection,
4110
+ gt as normaliseCollection,
4108
4111
  Kl as normaliseRelations,
4109
4112
  Tn as provideAdmin,
4110
4113
  ao as provideCategoryEditor,
@@ -4113,7 +4116,7 @@ export {
4113
4116
  bn as provideRecordAddress,
4114
4117
  Ro as provideRelationOwner,
4115
4118
  Bn as provideTheme,
4116
- ht as readCookie,
4119
+ yt as readCookie,
4117
4120
  Bt as recordAddressKey,
4118
4121
  Vt as relationOwnerKey,
4119
4122
  Jn as renderMarkdown,
@@ -4121,11 +4124,11 @@ export {
4121
4124
  Ho as rowMenuWidth,
4122
4125
  Ft as themeKey,
4123
4126
  Po as unfinishedUploads,
4124
- qe as uploadFingerprint,
4127
+ Ye as uploadFingerprint,
4125
4128
  ee as useAdmin,
4126
4129
  Gn as useBodyKeys,
4127
4130
  Bo as useCategoryEditor,
4128
- ct as useCategoryWords,
4131
+ ft as useCategoryWords,
4129
4132
  Oo as useChunkedUpload,
4130
4133
  It as useDates,
4131
4134
  De as useErrorText,