@webx-ui/module-blog 0.5.18 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
- import { useAdmin as ne, useTranslate as Z, useDates as pt, useErrorText as he, WxScreenHead as vt, WxScreen as gt, WxSaveState as ft, WxDate as Ee, rowMenuWidth as et, WxListScreen as tt, WxRowMenu as ze, WxAddressNote as ht, WxFilterChips as mt, categoryRoutes as bt } from "@webx-ui/module-admin";
2
- import { provide as yt, inject as wt, defineComponent as ee, useModel as Le, computed as b, openBlock as _, createBlock as q, unref as e, mergeModels as Fe, ref as M, watch as pe, onMounted as Ue, onBeforeUnmount as Ke, createElementBlock as j, Fragment as _e, createVNode as r, withCtx as l, createTextVNode as C, toDisplayString as $, createCommentVNode as L, createElementVNode as F, renderList as qe, normalizeClass as at, normalizeProps as xt, guardReactiveProps as _t, useTemplateRef as Ie, nextTick as He, isRef as Pe, withKeys as Me, useId as kt, withModifiers as Ze } from "vue";
3
- import { WxSelect as xe, useLocales as lt, localizedValue as $t, confirm as oe, WxSkeleton as Oe, WxCard as Tt, WxBadge as ie, WxBreadcrumb as At, WxBreadcrumbItem as Qe, WxAlert as Ne, WxButton as J, WxActionBar as it, toast as P, WxEmpty as St, WxText as le, WxSortableList as Wt, WxAction as Ct, WxInput as Ce, WxFormItem as de, useModal as Re, WxDialog as De, WxSpace as Be, useElementWidth as Vt, createModal as Ve, WxTable as nt, WxEntityCard as zt, WxIcon as Te, WxTooltip as st, WxCheckbox as Mt } from "@webx-ui/core";
4
- import { useRoute as Ge, useRouter as je, onBeforeRouteLeave as Nt } from "vue-router";
5
- import { provideBlocksPreview as Ut } from "@webx-ui/module-blocks";
6
- const rt = /* @__PURE__ */ Symbol("wx-article-editor");
7
- function qt(h) {
8
- yt(rt, h);
1
+ import { useAdmin as re, useTranslate as j, useDates as gt, useErrorText as me, useEditing as ft, WxScreenHead as ht, WxEditingAlerts as mt, WxScreen as bt, WxSaveState as yt, WxDate as Ee, WxDrafts as wt, rowMenuWidth as at, WxListScreen as lt, WxRowMenu as Ne, WxAddressNote as xt, WxFilterChips as _t, categoryRoutes as kt } from "@webx-ui/module-admin";
2
+ import { provide as $t, inject as Tt, defineComponent as te, useModel as Fe, computed as y, openBlock as _, createBlock as q, unref as e, mergeModels as Ke, ref as N, watch as ge, onMounted as Ue, onBeforeUnmount as He, createElementBlock as J, Fragment as _e, createVNode as r, withCtx as i, createTextVNode as V, toDisplayString as T, createCommentVNode as K, createElementVNode as H, renderList as qe, normalizeClass as it, normalizeProps as At, guardReactiveProps as St, useTemplateRef as Ie, nextTick as Ge, isRef as Pe, withKeys as Me, useId as Wt, withModifiers as Xe } from "vue";
3
+ import { WxSelect as xe, useLocales as nt, localizedValue as Ct, confirm as pe, WxSkeleton as Oe, WxCard as Vt, WxBadge as se, WxBreadcrumb as zt, WxBreadcrumbItem as Ye, WxActionBar as st, WxButton as Y, toast as P, WxEmpty as Nt, WxText as ne, WxSortableList as Mt, WxAction as Ut, WxInput as Ve, WxAlert as Le, WxFormItem as ve, useModal as Re, WxDialog as De, WxSpace as Be, useElementWidth as qt, createModal as ze, WxTable as rt, WxEntityCard as It, WxIcon as Se, WxTooltip as ot, WxCheckbox as Pt } from "@webx-ui/core";
4
+ import { useRoute as Je, useRouter as je, onBeforeRouteLeave as Rt } from "vue-router";
5
+ import { provideBlocksPreview as Dt } from "@webx-ui/module-blocks";
6
+ const ut = /* @__PURE__ */ Symbol("wx-article-editor");
7
+ function Bt(b) {
8
+ $t(ut, b);
9
9
  }
10
- function Ae() {
11
- return wt(rt, null);
10
+ function We() {
11
+ return Tt(ut, null);
12
12
  }
13
- const It = {
13
+ const Et = {
14
14
  module: {
15
15
  group: "Blog",
16
16
  articles: "Articles",
@@ -221,41 +221,41 @@ const It = {
221
221
  "merge-warning": ":count articles will carry “:tag” instead. :merged tags will be deleted, and there is no undoing it.",
222
222
  "merge-confirm": "Merge"
223
223
  }
224
- }, Xe = /* @__PURE__ */ new WeakSet();
225
- function te() {
224
+ }, et = /* @__PURE__ */ new WeakSet();
225
+ function ae() {
226
226
  try {
227
- const { i18n: h } = ne();
228
- Xe.has(h) || (h.defaults("webx-blog", It), Xe.add(h));
227
+ const { i18n: b } = re();
228
+ et.has(b) || (b.defaults("webx-blog", Et), et.add(b));
229
229
  } catch {
230
230
  }
231
231
  }
232
- const Pt = /* @__PURE__ */ ee({
232
+ const Ot = /* @__PURE__ */ te({
233
233
  name: "WxArticleAuthor",
234
234
  __name: "ArticleAuthor",
235
- props: /* @__PURE__ */ Fe({
235
+ props: /* @__PURE__ */ Ke({
236
236
  disabled: { type: Boolean, default: !1 }
237
237
  }, {
238
238
  modelValue: { default: null },
239
239
  modelModifiers: {}
240
240
  }),
241
241
  emits: ["update:modelValue"],
242
- setup(h) {
243
- const c = h, v = Le(h, "modelValue"), f = Ae();
244
- te();
245
- const a = Z("webx-blog"), s = b(() => c.disabled || f?.disabled.value === !0), t = b(
246
- () => (f?.options.value.authors ?? []).map((i) => ({
247
- label: i.title,
248
- value: i.id
242
+ setup(b) {
243
+ const d = b, f = Fe(b, "modelValue"), c = We();
244
+ ae();
245
+ const a = j("webx-blog"), s = y(() => d.disabled || c?.disabled.value === !0), t = y(
246
+ () => (c?.options.value.authors ?? []).map((n) => ({
247
+ label: n.title,
248
+ value: n.id
249
249
  }))
250
- ), o = b({
251
- get: () => v.value,
252
- set: (i) => {
253
- v.value = typeof i == "number" ? i : null;
250
+ ), u = y({
251
+ get: () => f.value,
252
+ set: (n) => {
253
+ f.value = typeof n == "number" ? n : null;
254
254
  }
255
255
  });
256
- return (i, d) => (_(), q(e(xe), {
257
- modelValue: o.value,
258
- "onUpdate:modelValue": d[0] || (d[0] = (w) => o.value = w),
256
+ return (n, p) => (_(), q(e(xe), {
257
+ modelValue: u.value,
258
+ "onUpdate:modelValue": p[0] || (p[0] = (w) => u.value = w),
259
259
  options: t.value,
260
260
  placeholder: e(a)("article.no-author"),
261
261
  disabled: s.value,
@@ -266,294 +266,322 @@ const Pt = /* @__PURE__ */ ee({
266
266
  }, null, 8, ["modelValue", "options", "placeholder", "disabled", "aria-label"]));
267
267
  }
268
268
  });
269
- function ue(h) {
270
- const c = `${h.apiPath}/blog/articles`, v = `${h.apiPath}/blog/tags`, f = (a) => a.data;
269
+ function de(b) {
270
+ const d = `${b.apiPath}/blog/articles`, f = `${b.apiPath}/blog/tags`, c = (a) => a.data;
271
271
  return {
272
272
  articles: (a = {}) => {
273
273
  const s = new URLSearchParams();
274
274
  a.q && s.set("q", a.q), a.rubric != null && s.set("rubric", String(a.rubric)), a.tag != null && s.set("tag", String(a.tag)), a.author != null && s.set("author", String(a.author)), a.status && s.set("status", a.status), a.sort && s.set("sort", a.sort), a.trashed && s.set("trashed", "1"), a.page && a.page > 1 && s.set("page", String(a.page)), a.per_page && s.set("per_page", String(a.per_page));
275
275
  const t = s.size > 0 ? `?${s}` : "";
276
- return h.http.get(`${c}${t}`).then((o) => ({ ...o.meta, data: o.data, filters: o.filters }));
276
+ return b.http.get(`${d}${t}`).then((u) => ({ ...u.meta, data: u.data, filters: u.filters }));
277
277
  },
278
- get: (a) => h.http.get(`${c}/${a}`).then(f),
279
- create: (a) => h.http.post(c, a).then(f),
280
- save: (a, s) => h.http.put(`${c}/${a}`, s).then(f),
281
- discard: (a) => h.http.post(`${c}/${a}/discard`, {}).then(f),
282
- versions: (a) => h.http.get(`${c}/${a}/versions`).then(f),
283
- restoreVersion: (a, s) => h.http.post(`${c}/${a}/versions/${s}/restore`, {}).then(f),
278
+ get: (a) => b.http.get(`${d}/${a}`).then(c),
279
+ create: (a) => b.http.post(d, a).then(c),
280
+ save: (a, s) => b.http.put(`${d}/${a}`, s).then(c),
281
+ discard: (a) => b.http.post(`${d}/${a}/discard`, {}).then(c),
282
+ versions: (a) => b.http.get(`${d}/${a}/versions`).then(c),
283
+ restoreVersion: (a, s) => b.http.post(`${d}/${a}/versions/${s}/restore`, {}).then(c),
284
284
  tags: (a = "") => {
285
285
  const s = a.trim() === "" ? "" : `?q=${encodeURIComponent(a.trim())}`;
286
- return h.http.get(`${v}${s}`).then(f);
286
+ return b.http.get(`${f}${s}`).then(c);
287
287
  },
288
- createTag: (a) => h.http.post(v, a).then(f),
289
- publish: (a, s) => h.http.post(`${c}/${a}/publish`, s == null ? {} : { at: s }).then(f),
290
- unpublish: (a) => h.http.post(`${c}/${a}/unpublish`, {}).then(f),
291
- remove: (a) => h.http.delete(`${c}/${a}`).then(() => {
288
+ createTag: (a) => b.http.post(f, a).then(c),
289
+ publish: (a, s, t) => b.http.post(`${d}/${a}/publish`, {
290
+ ...s == null ? {} : { at: s },
291
+ ...t ? { revision: t } : {}
292
+ }).then(c),
293
+ unpublish: (a) => b.http.post(`${d}/${a}/unpublish`, {}).then(c),
294
+ remove: (a) => b.http.delete(`${d}/${a}`).then(() => {
292
295
  }),
293
- restore: (a) => h.http.post(`${c}/${a}/restore`, {}).then(f),
296
+ restore: (a) => b.http.post(`${d}/${a}/restore`, {}).then(c),
294
297
  tagsPage: (a = {}) => {
295
298
  const s = new URLSearchParams();
296
299
  a.q && s.set("q", a.q), a.empty && s.set("empty", "1"), a.noindex && s.set("noindex", "1"), a.sort && s.set("sort", a.sort), a.page && a.page > 1 && s.set("page", String(a.page)), a.per_page && s.set("per_page", String(a.per_page));
297
300
  const t = s.size > 0 ? `?${s}` : "";
298
- return h.http.get(`${v}${t}`).then((o) => ({ ...o.meta, data: o.data, filters: o.filters }));
301
+ return b.http.get(`${f}${t}`).then((u) => ({ ...u.meta, data: u.data, filters: u.filters }));
299
302
  },
300
- saveTag: (a, s) => h.http.put(`${v}/${a}`, s).then(f),
301
- removeTag: (a) => h.http.delete(`${v}/${a}`).then(() => {
303
+ saveTag: (a, s) => b.http.put(`${f}/${a}`, s).then(c),
304
+ removeTag: (a) => b.http.delete(`${f}/${a}`).then(() => {
302
305
  }),
303
- massTags: (a, s) => h.http.post(`${v}/mass`, { ids: a, action: s }).then((t) => t.data.affected),
304
- mergeTags: (a, s, t) => h.http.post(`${v}/merge`, { ids: a, keep: s, redirect: t }).then(f)
306
+ massTags: (a, s) => b.http.post(`${f}/mass`, { ids: a, action: s }).then((t) => t.data.affected),
307
+ mergeTags: (a, s, t) => b.http.post(`${f}/merge`, { ids: a, keep: s, redirect: t }).then(c)
305
308
  };
306
309
  }
307
- const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__ */ ee({
310
+ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__ */ te({
308
311
  __name: "ArticleEditorPage",
309
312
  props: {
310
313
  base: { default: "/blog" }
311
314
  },
312
- setup(h) {
313
- const c = h, v = ne(), f = ue(v), a = Ge(), s = je(), t = lt(), o = pt();
314
- te();
315
- const i = Z("webx-blog"), d = Z("webx-admin"), w = he(), T = b(() => Number(a.params.id)), A = b(() => `${c.base}/articles`), y = M(null), S = M({}), z = M(""), E = M(""), R = M(null), x = M({ rubrics: [], authors: [] }), W = M([]), U = M(!0), I = M(!1), g = M(!1), B = M({}), D = M(null), H = M(""), me = M(0), Q = b(() => v.can("blog.articles.manage")), ke = b(() => !Q.value || g.value), X = b(() => JSON.stringify(S.value)), G = b(() => H.value !== "" && X.value !== H.value), $e = b(() => I.value ? "saving" : G.value ? "unsaved" : "saved"), ge = b(() => {
316
- const m = S.value.title;
317
- return $t(m, t.active.value, y.value?.title ?? "");
318
- }), ce = b(() => {
319
- const m = S.value.published_at;
315
+ setup(b) {
316
+ const d = b, f = re(), c = de(f), a = Je(), s = je(), t = nt(), u = gt();
317
+ ae();
318
+ const n = j("webx-blog"), p = j("webx-admin"), w = me(), k = y(() => Number(a.params.id)), A = y(() => `${d.base}/articles`), v = N(null), $ = N({}), C = N(""), B = N(""), R = N(null), x = N({ rubrics: [], authors: [] }), S = N([]), U = N(!0), I = N(!1), h = N(!1), E = N({}), L = N(""), Z = N(0), ee = y(() => f.can("blog.articles.manage")), O = ft({
319
+ entity: "articles",
320
+ id: () => v.value?.id,
321
+ values: $,
322
+ revision: C,
323
+ read: async () => {
324
+ const m = await c.get(k.value);
325
+ return { values: m.values, revision: m.revision };
326
+ },
327
+ adopt: (m) => {
328
+ L.value = JSON.stringify(m.values), Z.value += 1;
329
+ },
330
+ // Published or restored by somebody else: the badge and the address follow, and the form
331
+ // stays as it is.
332
+ refresh: () => Ce(),
333
+ restore: async () => {
334
+ v.value && await c.restore(v.value.id);
335
+ },
336
+ canWrite: () => ee.value,
337
+ busy: () => I.value || G !== void 0,
338
+ screen: "blog.article-form"
339
+ }), oe = O.conflict, ie = y(() => !ee.value || h.value), le = y(() => JSON.stringify($.value)), Q = y(() => L.value !== "" && le.value !== L.value), be = y(() => I.value ? "saving" : Q.value ? "unsaved" : "saved"), ke = y(() => {
340
+ const m = $.value.title;
341
+ return Ct(m, t.active.value, v.value?.title ?? "");
342
+ }), ce = y(() => {
343
+ const m = $.value.published_at;
320
344
  return typeof m == "string" && m !== "" ? m : null;
321
- }), fe = b(() => {
345
+ }), he = y(() => {
322
346
  if (ce.value === null) return !1;
323
347
  const m = new Date(ce.value.replace(" ", "T"));
324
348
  return !Number.isNaN(m.valueOf()) && m.valueOf() > Date.now();
325
- }), Se = b(() => {
326
- const m = y.value;
349
+ }), $e = y(() => {
350
+ const m = v.value;
327
351
  if (!m) return "";
328
- const O = o.short(m.published_at);
352
+ const D = u.short(m.published_at);
329
353
  return {
330
- scheduled: i("article.live-scheduled", { date: O }),
331
- published: i("article.live-since", { date: O }),
332
- modified: i("article.live-since", { date: O })
354
+ scheduled: n("article.live-scheduled", { date: D }),
355
+ published: n("article.live-since", { date: D }),
356
+ modified: n("article.live-since", { date: D })
333
357
  }[m.status] ?? "";
334
358
  });
335
- Ut({ url: b(() => R.value), reload: me }), qt({
336
- article: y,
337
- values: S,
359
+ Dt({ url: y(() => R.value), reload: Z }), Bt({
360
+ article: v,
361
+ values: $,
338
362
  options: x,
339
- related: W,
340
- prefix: E,
341
- base: c.base,
342
- canManage: Q.value,
343
- disabled: ke,
344
- reload: () => se(!0),
345
- save: () => k()
363
+ related: S,
364
+ prefix: B,
365
+ base: d.base,
366
+ canManage: ee.value,
367
+ disabled: ie,
368
+ reload: () => X(!0),
369
+ save: () => l()
346
370
  });
347
- function be(m) {
348
- y.value = m.article, S.value = m.values, z.value = m.revision, E.value = m.prefix, R.value = m.preview_url, x.value = m.options, W.value = m.related, H.value = JSON.stringify(m.values), D.value = null;
371
+ function Te(m) {
372
+ v.value = m.article, $.value = m.values, C.value = m.revision, B.value = m.prefix, R.value = m.preview_url, x.value = m.options, S.value = m.related, L.value = JSON.stringify(m.values), O.opened(m.values), oe.value = null;
349
373
  }
350
- async function se(m = !1) {
374
+ async function X(m = !1) {
351
375
  m || (U.value = !0);
352
376
  try {
353
- be(await f.get(T.value));
354
- } catch (O) {
355
- P.danger(w(O)), s.push(A.value);
377
+ Te(await c.get(k.value));
378
+ } catch (D) {
379
+ P.danger(w(D)), s.push(A.value);
356
380
  } finally {
357
381
  U.value = !1;
358
382
  }
359
383
  }
360
- let Y;
361
- function We() {
362
- !Q.value || D.value || !G.value || (clearTimeout(Y), Y = setTimeout(() => {
363
- k();
364
- }, Dt));
384
+ async function Ce() {
385
+ try {
386
+ const m = await c.get(k.value);
387
+ v.value = m.article, B.value = m.prefix, R.value = m.preview_url;
388
+ } catch {
389
+ }
365
390
  }
366
- function u() {
367
- !Q.value || D.value || !G.value || I.value || (clearTimeout(Y), k());
391
+ let o;
392
+ function M() {
393
+ !ee.value || oe.value || !Q.value || O.stopped.value || (clearTimeout(o), o = setTimeout(() => {
394
+ l();
395
+ }, Ft));
368
396
  }
369
- let V;
370
- async function k() {
371
- for (; V; ) {
372
- const { carried: K, done: re } = V;
373
- if (await re, !G.value || D.value || X.value === K) return;
397
+ function W() {
398
+ !ee.value || oe.value || !Q.value || I.value || O.stopped.value || (clearTimeout(o), l());
399
+ }
400
+ let G;
401
+ async function l() {
402
+ for (; G; ) {
403
+ const { carried: F, done: ue } = G;
404
+ if (await ue, !Q.value || oe.value || le.value === F) return;
374
405
  }
375
- const m = X.value, O = ae();
376
- V = { carried: m, done: O };
406
+ const m = le.value, D = z();
407
+ G = { carried: m, done: D };
377
408
  try {
378
- await O;
409
+ await D;
379
410
  } finally {
380
- V?.done === O && (V = void 0);
411
+ G?.done === D && (G = void 0);
381
412
  }
382
413
  }
383
- async function ae() {
384
- if (!y.value || !Q.value) return;
385
- clearTimeout(Y);
386
- const m = X.value, O = S.value;
387
- I.value = !0, B.value = {};
414
+ async function z() {
415
+ if (!v.value || !ee.value) return;
416
+ clearTimeout(o);
417
+ const m = le.value, D = $.value;
418
+ I.value = !0, E.value = {};
388
419
  try {
389
- const K = await f.save(y.value.id, { values: O, revision: z.value });
390
- y.value = K.article, z.value = K.revision, E.value = K.prefix, R.value = K.preview_url, x.value = K.options, W.value = K.related, D.value = null, X.value === m && (H.value = m), me.value += 1;
391
- } catch (K) {
392
- const re = K;
393
- re.status === 409 && re.body?.data ? D.value = re.body : re.body?.errors ? (B.value = re.body.errors, P.danger(i("article.save-failed"))) : P.danger(w(K));
420
+ const F = await c.save(v.value.id, { values: D, revision: C.value });
421
+ v.value = F.article, C.value = F.revision, B.value = F.prefix, R.value = F.preview_url, x.value = F.options, S.value = F.related, oe.value = null, le.value === m && (L.value = m), O.opened(D), Z.value += 1;
422
+ } catch (F) {
423
+ const ue = F;
424
+ if (ue.status === 409 && ue.body?.data) {
425
+ const Ae = ue.body.data;
426
+ O.refused({
427
+ values: Ae.values,
428
+ revision: Ae.revision,
429
+ changed: ue.body.changed
430
+ }) && (v.value = Ae.article, l());
431
+ } else ue.body?.errors ? (E.value = ue.body.errors, P.danger(n("article.save-failed"))) : await O.failed(F) || P.danger(w(F));
394
432
  } finally {
395
433
  I.value = !1;
396
434
  }
397
435
  }
398
- async function n() {
399
- await oe({
400
- title: i("article.conflict-theirs-title"),
401
- message: i("article.conflict-theirs-text"),
402
- confirmText: i("article.conflict-theirs"),
403
- cancelText: i("panel.cancel"),
404
- tone: "danger"
405
- }) && await se(!0);
406
- }
407
- async function N() {
408
- const m = D.value;
409
- m && (z.value = m.data.revision, D.value = null, await k());
436
+ async function g() {
437
+ await X(!0);
410
438
  }
411
- async function p() {
412
- if (!(!y.value || !await oe({
413
- title: d("editor.discard-title"),
414
- message: d("editor.discard-text"),
415
- confirmText: i("article.discard"),
439
+ async function ye() {
440
+ if (!(!v.value || !await pe({
441
+ title: p("editor.discard-title"),
442
+ message: p("editor.discard-text"),
443
+ confirmText: n("article.discard"),
416
444
  // Not «Cancel»: beside «Discard changes» the two read as the same word.
417
- cancelText: d("editor.keep-changes"),
445
+ cancelText: p("editor.keep-changes"),
418
446
  tone: "danger"
419
447
  }))) {
420
- g.value = !0;
448
+ h.value = !0;
421
449
  try {
422
- be(await f.discard(y.value.id)), P.success(i("article.discarded"));
423
- } catch (O) {
424
- P.danger(w(O));
450
+ Te(await c.discard(v.value.id)), P.success(n("article.discarded"));
451
+ } catch (D) {
452
+ P.danger(w(D));
425
453
  } finally {
426
- g.value = !1;
454
+ h.value = !1;
427
455
  }
428
456
  }
429
457
  }
430
- async function ye() {
431
- if (G.value && await k(), D.value || G.value) return;
432
- const m = y.value;
458
+ async function we() {
459
+ if (Q.value && await l(), oe.value || Q.value || !v.value) return;
460
+ const m = await O.beforePublish();
433
461
  if (!m) return;
434
- const O = m.next_path ?? m.path, K = m.next_path != null && m.path !== null ? ` ${d("editor.publish-moves", { old: `/${m.path}` })}` : "", re = O === null ? null : `/${O}`, ct = ce.value === null ? i("article.publish-now") : o.short(ce.value);
435
- if (await oe({
436
- title: i("article.publish-title", { title: m.title }),
437
- message: fe.value ? i("article.publish-later", { date: ct }) : re === null ? i("article.publish-nowhere") : i("article.publish-text", { address: re }) + K,
438
- confirmText: fe.value ? i("article.schedule") : i("panel.publish"),
439
- cancelText: i("panel.cancel")
462
+ const D = v.value, F = D.next_path ?? D.path, ue = D.next_path != null && D.path !== null ? ` ${p("editor.publish-moves", { old: `/${D.path}` })}` : "", Ae = F === null ? null : `/${F}`, vt = ce.value === null ? n("article.publish-now") : u.short(ce.value);
463
+ if (m.asked || await pe({
464
+ title: n("article.publish-title", { title: D.title }),
465
+ message: he.value ? n("article.publish-later", { date: vt }) : Ae === null ? n("article.publish-nowhere") : n("article.publish-text", { address: Ae }) + ue,
466
+ confirmText: he.value ? n("article.schedule") : n("panel.publish"),
467
+ cancelText: n("panel.cancel")
440
468
  })) {
441
- g.value = !0;
469
+ h.value = !0;
442
470
  try {
443
- await f.publish(m.id, ce.value), await se(!0), P.success(fe.value ? i("article.scheduled") : i("panel.published"));
444
- } catch (dt) {
445
- P.danger(w(dt));
471
+ await c.publish(D.id, ce.value, m.revision), await X(!0), P.success(he.value ? n("article.scheduled") : n("panel.published"));
472
+ } catch (Qe) {
473
+ await O.failed(Qe) || P.danger(w(Qe));
446
474
  } finally {
447
- g.value = !1;
475
+ h.value = !1;
448
476
  }
449
477
  }
450
478
  }
451
- async function we() {
452
- const m = y.value;
453
- if (!(!m || !await oe({
454
- title: d("editor.unpublish-title"),
455
- message: d("editor.unpublish-text"),
456
- confirmText: d("editor.unpublish"),
457
- cancelText: d("editor.keep-published")
479
+ async function dt() {
480
+ const m = v.value;
481
+ if (!(!m || !await pe({
482
+ title: p("editor.unpublish-title"),
483
+ message: p("editor.unpublish-text"),
484
+ confirmText: p("editor.unpublish"),
485
+ cancelText: p("editor.keep-published")
458
486
  }))) {
459
- g.value = !0;
487
+ h.value = !0;
460
488
  try {
461
- await f.unpublish(m.id), await se(!0), P.success(d("editor.unpublished"));
462
- } catch (K) {
463
- P.danger(w(K));
489
+ await c.unpublish(m.id), await X(!0), P.success(p("editor.unpublished"));
490
+ } catch (F) {
491
+ P.danger(w(F));
464
492
  } finally {
465
- g.value = !1;
493
+ h.value = !1;
466
494
  }
467
495
  }
468
496
  }
469
- function ot() {
470
- const m = y.value?.status;
497
+ function ct() {
498
+ const m = v.value?.status;
471
499
  return m === "published" ? "success" : m === "modified" ? "warning" : m === "scheduled" ? "primary" : "default";
472
500
  }
473
- function Je(m) {
474
- G.value && m.preventDefault();
501
+ function Ze(m) {
502
+ Q.value && m.preventDefault();
475
503
  }
476
- pe(X, We), pe(T, () => {
477
- se();
504
+ ge(le, M), ge(k, () => {
505
+ X();
478
506
  }), Ue(() => {
479
- se(), window.addEventListener("beforeunload", Je);
480
- }), Ke(() => {
481
- clearTimeout(Y), window.removeEventListener("beforeunload", Je);
482
- }), Nt(async () => !G.value || !Q.value || (await k(), !G.value) ? !0 : await oe({
483
- title: i("article.leave-title"),
484
- message: i("article.leave-text"),
485
- confirmText: i("article.leave"),
486
- cancelText: i("panel.cancel"),
507
+ X(), window.addEventListener("beforeunload", Ze);
508
+ }), He(() => {
509
+ clearTimeout(o), window.removeEventListener("beforeunload", Ze);
510
+ }), Rt(async () => !Q.value || !ee.value || (await l(), !Q.value) ? !0 : await pe({
511
+ title: n("article.leave-title"),
512
+ message: n("article.leave-text"),
513
+ confirmText: n("article.leave"),
514
+ cancelText: n("panel.cancel"),
487
515
  tone: "danger"
488
516
  }));
489
- const ut = b(() => {
517
+ const pt = y(() => {
490
518
  const m = [];
491
- return R.value && m.push({ key: "preview", label: i("article.preview"), icon: "eye", href: R.value }), y.value?.url && y.value.status !== "draft" && m.push({
519
+ return R.value && m.push({ key: "preview", label: n("article.preview"), icon: "eye", href: R.value }), v.value?.url && v.value.status !== "draft" && m.push({
492
520
  key: "site",
493
- label: i("panel.open-on-site"),
521
+ label: n("panel.open-on-site"),
494
522
  icon: "link",
495
- href: y.value.url
496
- }), Q.value && (y.value?.status === "published" || y.value?.status === "modified") && m.push({
523
+ href: v.value.url
524
+ }), ee.value && (v.value?.status === "published" || v.value?.status === "modified") && m.push({
497
525
  key: "unpublish",
498
- label: d("editor.unpublish"),
526
+ label: p("editor.unpublish"),
499
527
  icon: "eye-off",
500
528
  run: () => {
501
- we();
529
+ dt();
502
530
  }
503
- }), y.value?.status === "modified" && m.push({
531
+ }), v.value?.status === "modified" && m.push({
504
532
  key: "discard",
505
- label: i("article.discard"),
533
+ label: n("article.discard"),
506
534
  icon: "refresh",
507
535
  danger: !0,
508
536
  menu: !0,
509
537
  run: () => {
510
- p();
538
+ ye();
511
539
  }
512
540
  }), m;
513
541
  });
514
- return (m, O) => (_(), j("div", {
542
+ return (m, D) => (_(), J("div", {
515
543
  class: "wx-article-editor",
516
- onFocusout: u
544
+ onFocusout: W
517
545
  }, [
518
- U.value || !y.value ? (_(), j(_e, { key: 0 }, [
546
+ U.value || !v.value ? (_(), J(_e, { key: 0 }, [
519
547
  r(e(Oe), {
520
548
  class: "wx-article-editor__ghost",
521
549
  title: "",
522
550
  rows: 1
523
551
  }),
524
- r(e(Tt), null, {
525
- default: l(() => [
552
+ r(e(Vt), null, {
553
+ default: i(() => [
526
554
  r(e(Oe), { rows: 8 })
527
555
  ]),
528
556
  _: 1
529
557
  })
530
- ], 64)) : (_(), j(_e, { key: 1 }, [
531
- r(e(vt), {
558
+ ], 64)) : (_(), J(_e, { key: 1 }, [
559
+ r(e(ht), {
532
560
  divider: "",
533
561
  back: A.value,
534
- "back-label": e(i)("module.articles"),
535
- title: ge.value || e(i)("article.untitled"),
536
- subtitle: Se.value,
537
- actions: ut.value
562
+ "back-label": e(n)("module.articles"),
563
+ title: ke.value || e(n)("article.untitled"),
564
+ subtitle: $e.value,
565
+ actions: pt.value
538
566
  }, {
539
- trail: l(() => [
540
- r(e(At), {
567
+ trail: i(() => [
568
+ r(e(zt), {
541
569
  size: "sm",
542
- label: e(i)("article.trail")
570
+ label: e(n)("article.trail")
543
571
  }, {
544
- default: l(() => [
545
- r(e(Qe), {
572
+ default: i(() => [
573
+ r(e(Ye), {
546
574
  as: "router-link",
547
575
  to: A.value
548
576
  }, {
549
- default: l(() => [
550
- C($(e(i)("module.articles")), 1)
577
+ default: i(() => [
578
+ V(T(e(n)("module.articles")), 1)
551
579
  ]),
552
580
  _: 1
553
581
  }, 8, ["to"]),
554
- r(e(Qe), { current: "" }, {
555
- default: l(() => [
556
- C($(ge.value || e(i)("article.untitled")), 1)
582
+ r(e(Ye), { current: "" }, {
583
+ default: i(() => [
584
+ V(T(ke.value || e(n)("article.untitled")), 1)
557
585
  ]),
558
586
  _: 1
559
587
  })
@@ -561,287 +589,277 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
561
589
  _: 1
562
590
  }, 8, ["label"])
563
591
  ]),
564
- "title-after": l(() => [
565
- r(e(ie), {
566
- type: ot(),
592
+ "title-after": i(() => [
593
+ r(e(se), {
594
+ type: ct(),
567
595
  dot: ""
568
596
  }, {
569
- default: l(() => [
570
- C($(e(i)(`panel.status-${y.value.status}`)), 1)
597
+ default: i(() => [
598
+ V(T(e(n)(`panel.status-${v.value.status}`)), 1)
571
599
  ]),
572
600
  _: 1
573
601
  }, 8, ["type"]),
574
- y.value.status === "modified" ? (_(), q(e(ie), {
602
+ v.value.status === "modified" ? (_(), q(e(se), {
575
603
  key: 0,
576
604
  type: "primary",
577
605
  round: ""
578
606
  }, {
579
- default: l(() => [
580
- C($(e(i)("panel.edits")), 1)
607
+ default: i(() => [
608
+ V(T(e(n)("panel.edits")), 1)
581
609
  ]),
582
610
  _: 1
583
- })) : L("", !0)
611
+ })) : K("", !0)
584
612
  ]),
585
613
  _: 1
586
614
  }, 8, ["back", "back-label", "title", "subtitle", "actions"]),
587
- D.value ? (_(), q(e(Ne), {
588
- key: 0,
589
- type: "warning",
590
- title: e(i)("article.conflict-title"),
591
- description: D.value.message
592
- }, {
593
- actions: l(() => [
594
- r(e(J), {
595
- size: "sm",
596
- variant: "outline",
597
- onClick: n
598
- }, {
599
- default: l(() => [
600
- C($(e(i)("article.conflict-theirs")), 1)
601
- ]),
602
- _: 1
603
- }),
604
- r(e(J), {
605
- size: "sm",
606
- type: "primary",
607
- onClick: N
608
- }, {
609
- default: l(() => [
610
- C($(e(i)("article.conflict-mine")), 1)
611
- ]),
612
- _: 1
613
- })
614
- ]),
615
- _: 1
616
- }, 8, ["title", "description"])) : L("", !0),
617
- F("div", Rt, [
618
- r(e(gt), {
619
- modelValue: S.value,
620
- "onUpdate:modelValue": O[0] || (O[0] = (K) => S.value = K),
615
+ r(e(mt), {
616
+ editing: e(O),
617
+ onSave: l,
618
+ onTheirs: g
619
+ }, null, 8, ["editing"]),
620
+ H("div", Lt, [
621
+ r(e(bt), {
622
+ modelValue: $.value,
623
+ "onUpdate:modelValue": D[0] || (D[0] = (F) => $.value = F),
621
624
  name: "blog.article-form",
622
- errors: B.value,
623
- disabled: ke.value
625
+ errors: E.value,
626
+ disabled: ie.value
624
627
  }, null, 8, ["modelValue", "errors", "disabled"])
625
628
  ]),
626
- Q.value ? (_(), q(e(it), { key: 1 }, {
627
- state: l(() => [
628
- r(e(ft), { state: $e.value }, null, 8, ["state"])
629
+ ee.value ? (_(), q(e(st), { key: 0 }, {
630
+ state: i(() => [
631
+ e(O).stopped.value ? K("", !0) : (_(), q(e(yt), {
632
+ key: 0,
633
+ state: be.value
634
+ }, null, 8, ["state"]))
629
635
  ]),
630
- default: l(() => [
631
- r(e(J), {
636
+ default: i(() => [
637
+ r(e(Y), {
632
638
  variant: "outline",
633
639
  loading: I.value,
634
- disabled: !G.value,
635
- onClick: k
640
+ disabled: !Q.value || e(O).stopped.value,
641
+ title: e(O).blocked.value,
642
+ onClick: l
636
643
  }, {
637
- default: l(() => [
638
- C($(e(i)("article.save")), 1)
644
+ default: i(() => [
645
+ V(T(e(n)("article.save")), 1)
639
646
  ]),
640
647
  _: 1
641
- }, 8, ["loading", "disabled"]),
642
- r(e(J), {
648
+ }, 8, ["loading", "disabled", "title"]),
649
+ r(e(Y), {
643
650
  type: "primary",
644
- loading: g.value,
645
- disabled: y.value.status === "published" && !G.value,
646
- onClick: ye
651
+ loading: h.value,
652
+ disabled: e(O).stopped.value || v.value.status === "published" && !Q.value,
653
+ title: e(O).blocked.value,
654
+ onClick: we
647
655
  }, {
648
- default: l(() => [
649
- C($(fe.value ? e(i)("article.schedule") : e(i)("panel.publish")), 1)
656
+ default: i(() => [
657
+ V(T(he.value ? e(n)("article.schedule") : e(n)("panel.publish")), 1)
650
658
  ]),
651
659
  _: 1
652
- }, 8, ["loading", "disabled"])
660
+ }, 8, ["loading", "disabled", "title"])
653
661
  ]),
654
662
  _: 1
655
- })) : L("", !0)
663
+ })) : K("", !0)
656
664
  ], 64))
657
665
  ], 32));
658
666
  }
659
- }), ve = (h, c) => {
660
- const v = h.__vccOpts || h;
661
- for (const [f, a] of c)
662
- v[f] = a;
663
- return v;
664
- }, Et = /* @__PURE__ */ ve(Bt, [["__scopeId", "data-v-98dc2b0f"]]), Ot = { class: "wx-article-history" }, Lt = { class: "wx-article-history__number" }, Ft = { class: "wx-article-history__who" }, Kt = /* @__PURE__ */ ee({
667
+ }), fe = (b, d) => {
668
+ const f = b.__vccOpts || b;
669
+ for (const [c, a] of d)
670
+ f[c] = a;
671
+ return f;
672
+ }, Ht = /* @__PURE__ */ fe(Kt, [["__scopeId", "data-v-49f5a61d"]]), Gt = { class: "wx-article-history-tab" }, Jt = { class: "wx-article-history" }, jt = { class: "wx-article-history__number" }, Zt = { class: "wx-article-history__who" }, Qt = /* @__PURE__ */ te({
665
673
  name: "WxArticleHistory",
666
674
  __name: "ArticleHistory",
667
- setup(h) {
668
- const c = ne(), v = ue(c), f = Ae();
669
- te();
670
- const a = Z("webx-blog"), s = he(), t = M(null), o = M(!1), i = b(() => f?.article.value ?? null), d = b(() => c.can("blog.articles.manage")), w = b(
671
- () => i.value?.status === "published" || i.value?.status === "modified" ? t.value?.[0]?.number ?? null : null
675
+ setup(b) {
676
+ const d = re(), f = de(d), c = We();
677
+ ae();
678
+ const a = j("webx-blog"), s = me(), t = N(null), u = N(!1), n = y(() => c?.article.value ?? null), p = y(() => d.can("blog.articles.manage")), w = y(
679
+ () => n.value?.status === "published" || n.value?.status === "modified" ? t.value?.[0]?.number ?? null : null
672
680
  );
673
- async function T() {
674
- const y = i.value;
675
- if (y)
681
+ async function k() {
682
+ const v = n.value;
683
+ if (v)
676
684
  try {
677
- t.value = await v.versions(y.id);
678
- } catch (S) {
679
- t.value = [], P.danger(s(S));
685
+ t.value = await f.versions(v.id);
686
+ } catch ($) {
687
+ t.value = [], P.danger(s($));
680
688
  }
681
689
  }
682
- async function A(y) {
683
- const S = i.value;
684
- if (!(!S || !await oe({
685
- title: a("article.restore-title", { number: y.number }),
690
+ async function A(v) {
691
+ const $ = n.value;
692
+ if (!(!$ || !await pe({
693
+ title: a("article.restore-title", { number: v.number }),
686
694
  message: a("article.restore-text"),
687
695
  confirmText: a("article.restore-version"),
688
696
  cancelText: a("panel.cancel")
689
697
  }))) {
690
- o.value = !0;
698
+ u.value = !0;
691
699
  try {
692
- await v.restoreVersion(S.id, y.number), await f?.reload(), P.success(a("article.restored-version", { number: y.number }));
693
- } catch (E) {
694
- P.danger(s(E));
700
+ await f.restoreVersion($.id, v.number), await c?.reload(), P.success(a("article.restored-version", { number: v.number }));
701
+ } catch (B) {
702
+ P.danger(s(B));
695
703
  } finally {
696
- o.value = !1;
704
+ u.value = !1;
697
705
  }
698
706
  }
699
707
  }
700
- return pe(
701
- () => [i.value?.id, i.value?.published_at, i.value?.updated_at],
708
+ return ge(
709
+ () => [n.value?.id, n.value?.published_at, n.value?.updated_at],
702
710
  () => {
703
- T();
711
+ k();
704
712
  },
705
713
  { immediate: !0 }
706
- ), (y, S) => (_(), j("div", Ot, [
707
- t.value === null ? (_(), q(e(Oe), {
708
- key: 0,
709
- class: "wx-article-history__ghost",
710
- rows: 3
711
- })) : t.value.length === 0 ? (_(), q(e(St), {
712
- key: 1,
713
- description: e(a)("article.history-empty")
714
- }, null, 8, ["description"])) : (_(!0), j(_e, { key: 2 }, qe(t.value, (z) => (_(), j("div", {
715
- key: z.number,
716
- class: at(["wx-article-history__row", { "is-live": z.number === w.value }])
717
- }, [
718
- F("code", Lt, $(e(a)("article.version", { number: z.number })), 1),
719
- F("div", Ft, [
720
- z.created_at ? (_(), q(e(Ee), {
714
+ ), (v, $) => (_(), J("div", Gt, [
715
+ H("div", Jt, [
716
+ t.value === null ? (_(), q(e(Oe), {
717
+ key: 0,
718
+ class: "wx-article-history__ghost",
719
+ rows: 3
720
+ })) : t.value.length === 0 ? (_(), q(e(Nt), {
721
+ key: 1,
722
+ description: e(a)("article.history-empty")
723
+ }, null, 8, ["description"])) : (_(!0), J(_e, { key: 2 }, qe(t.value, (C) => (_(), J("div", {
724
+ key: C.number,
725
+ class: it(["wx-article-history__row", { "is-live": C.number === w.value }])
726
+ }, [
727
+ H("code", jt, T(e(a)("article.version", { number: C.number })), 1),
728
+ H("div", Zt, [
729
+ C.created_at ? (_(), q(e(Ee), {
730
+ key: 0,
731
+ value: C.created_at,
732
+ size: "md",
733
+ tone: "default"
734
+ }, null, 8, ["value"])) : K("", !0),
735
+ r(e(ne), {
736
+ size: "sm",
737
+ tone: "muted"
738
+ }, {
739
+ default: i(() => [
740
+ V(T(C.author ?? e(a)(`article.source-${C.source}`)) + " ", 1),
741
+ C.comment ? (_(), J(_e, { key: 0 }, [
742
+ V(" · " + T(C.comment), 1)
743
+ ], 64)) : K("", !0)
744
+ ]),
745
+ _: 2
746
+ }, 1024)
747
+ ]),
748
+ C.number === w.value ? (_(), q(e(se), {
721
749
  key: 0,
722
- value: z.created_at,
723
- size: "md",
724
- tone: "default"
725
- }, null, 8, ["value"])) : L("", !0),
726
- r(e(le), {
750
+ type: "success",
751
+ dot: ""
752
+ }, {
753
+ default: i(() => [
754
+ V(T(e(a)("article.version-live")), 1)
755
+ ]),
756
+ _: 1
757
+ })) : K("", !0),
758
+ p.value && C.number !== w.value ? (_(), q(e(Y), {
759
+ key: 1,
727
760
  size: "sm",
728
- tone: "muted"
761
+ variant: "outline",
762
+ loading: u.value,
763
+ onClick: (B) => A(C)
729
764
  }, {
730
- default: l(() => [
731
- C($(z.author ?? e(a)(`article.source-${z.source}`)) + " ", 1),
732
- z.comment ? (_(), j(_e, { key: 0 }, [
733
- C(" · " + $(z.comment), 1)
734
- ], 64)) : L("", !0)
765
+ default: i(() => [
766
+ V(T(e(a)("article.restore-version")), 1)
735
767
  ]),
736
- _: 2
737
- }, 1024)
738
- ]),
739
- z.number === w.value ? (_(), q(e(ie), {
740
- key: 0,
741
- type: "success",
742
- dot: ""
743
- }, {
744
- default: l(() => [
745
- C($(e(a)("article.version-live")), 1)
746
- ]),
747
- _: 1
748
- })) : L("", !0),
749
- d.value && z.number !== w.value ? (_(), q(e(J), {
750
- key: 1,
751
- size: "sm",
752
- variant: "outline",
753
- loading: o.value,
754
- onClick: (E) => A(z)
755
- }, {
756
- default: l(() => [
757
- C($(e(a)("article.restore-version")), 1)
758
- ]),
759
- _: 1
760
- }, 8, ["loading", "onClick"])) : L("", !0)
761
- ], 2))), 128))
768
+ _: 1
769
+ }, 8, ["loading", "onClick"])) : K("", !0)
770
+ ], 2))), 128))
771
+ ]),
772
+ r(e(wt), {
773
+ id: n.value?.id,
774
+ entity: "articles",
775
+ screen: "blog.article-form",
776
+ "can-restore": p.value,
777
+ stamp: [n.value?.published_at, n.value?.updated_at],
778
+ onRestored: $[0] || ($[0] = (C) => e(c)?.reload())
779
+ }, null, 8, ["id", "can-restore", "stamp"])
762
780
  ]));
763
781
  }
764
- }), Ht = /* @__PURE__ */ ve(Kt, [["__scopeId", "data-v-0a997938"]]), Gt = { class: "wx-article-related" }, jt = { class: "wx-article-related__name" }, Jt = 250, Zt = 10, Qt = /* @__PURE__ */ ee({
782
+ }), Xt = /* @__PURE__ */ fe(Qt, [["__scopeId", "data-v-0052c4f9"]]), Yt = { class: "wx-article-related" }, ea = { class: "wx-article-related__name" }, ta = 250, aa = 10, la = /* @__PURE__ */ te({
765
783
  name: "WxArticleRelated",
766
784
  __name: "ArticleRelated",
767
- props: /* @__PURE__ */ Fe({
785
+ props: /* @__PURE__ */ Ke({
768
786
  disabled: { type: Boolean, default: !1 }
769
787
  }, {
770
788
  modelValue: { default: () => [] },
771
789
  modelModifiers: {}
772
790
  }),
773
791
  emits: ["update:modelValue"],
774
- setup(h) {
775
- const c = h, v = Le(h, "modelValue"), f = ne(), a = ue(f), s = Ae();
776
- te();
777
- const t = Z("webx-blog"), o = he(), i = b(() => c.disabled || s?.disabled.value === !0), d = M(/* @__PURE__ */ new Map()), w = M([]);
778
- let T;
779
- pe(
792
+ setup(b) {
793
+ const d = b, f = Fe(b, "modelValue"), c = re(), a = de(c), s = We();
794
+ ae();
795
+ const t = j("webx-blog"), u = me(), n = y(() => d.disabled || s?.disabled.value === !0), p = N(/* @__PURE__ */ new Map()), w = N([]);
796
+ let k;
797
+ ge(
780
798
  () => s?.related.value,
781
799
  (x) => {
782
- const W = new Map(d.value);
783
- for (const U of x ?? []) W.set(U.id, U.title);
784
- d.value = W;
800
+ const S = new Map(p.value);
801
+ for (const U of x ?? []) S.set(U.id, U.title);
802
+ p.value = S;
785
803
  },
786
804
  { immediate: !0, deep: !0 }
787
805
  );
788
- const A = b({
789
- get: () => v.value.map((x) => ({ id: x, title: d.value.get(x) ?? `#${x}` })),
806
+ const A = y({
807
+ get: () => f.value.map((x) => ({ id: x, title: p.value.get(x) ?? `#${x}` })),
790
808
  set: (x) => {
791
- v.value = x.map((W) => W.id);
809
+ f.value = x.map((S) => S.id);
792
810
  }
793
- }), y = b(
794
- () => w.value.filter((x) => !v.value.includes(x.id)).map((x) => ({ label: x.title, value: x.id }))
811
+ }), v = y(
812
+ () => w.value.filter((x) => !f.value.includes(x.id)).map((x) => ({ label: x.title, value: x.id }))
795
813
  );
796
- async function S(x) {
797
- const W = s?.article.value?.id;
814
+ async function $(x) {
815
+ const S = s?.article.value?.id;
798
816
  try {
799
- const U = await a.articles({ q: x, per_page: Zt });
800
- w.value = U.data.filter((g) => g.id !== W).map((g) => ({ id: g.id, title: g.title }));
801
- const I = new Map(d.value);
802
- for (const g of w.value) I.set(g.id, g.title);
803
- d.value = I;
817
+ const U = await a.articles({ q: x, per_page: aa });
818
+ w.value = U.data.filter((h) => h.id !== S).map((h) => ({ id: h.id, title: h.title }));
819
+ const I = new Map(p.value);
820
+ for (const h of w.value) I.set(h.id, h.title);
821
+ p.value = I;
804
822
  } catch (U) {
805
- P.danger(o(U));
823
+ P.danger(u(U));
806
824
  }
807
825
  }
808
- function z(x) {
809
- clearTimeout(T), T = setTimeout(() => {
810
- S(x);
811
- }, Jt);
826
+ function C(x) {
827
+ clearTimeout(k), k = setTimeout(() => {
828
+ $(x);
829
+ }, ta);
812
830
  }
813
- function E(x) {
814
- typeof x != "number" || v.value.includes(x) || (v.value = [...v.value, x]);
831
+ function B(x) {
832
+ typeof x != "number" || f.value.includes(x) || (f.value = [...f.value, x]);
815
833
  }
816
834
  function R(x) {
817
- v.value = v.value.filter((W) => W !== x);
835
+ f.value = f.value.filter((S) => S !== x);
818
836
  }
819
- return pe(
837
+ return ge(
820
838
  () => s?.article.value?.id,
821
839
  () => {
822
- S("");
840
+ $("");
823
841
  },
824
842
  { immediate: !0 }
825
- ), Ke(() => clearTimeout(T)), (x, W) => (_(), j("div", Gt, [
826
- r(e(Wt), {
843
+ ), He(() => clearTimeout(k)), (x, S) => (_(), J("div", Yt, [
844
+ r(e(Mt), {
827
845
  modelValue: A.value,
828
- "onUpdate:modelValue": W[0] || (W[0] = (U) => A.value = U),
846
+ "onUpdate:modelValue": S[0] || (S[0] = (U) => A.value = U),
829
847
  plain: "",
830
848
  size: "sm",
831
849
  "item-key": "id",
832
850
  "item-label": "title",
833
- disabled: i.value,
851
+ disabled: n.value,
834
852
  "empty-text": e(t)("article.related-empty"),
835
853
  "aria-label": e(t)("article.related")
836
854
  }, {
837
- default: l(({ item: U }) => [
838
- F("span", jt, $(U.title), 1)
855
+ default: i(({ item: U }) => [
856
+ H("span", ea, T(U.title), 1)
839
857
  ]),
840
- actions: l(({ item: U }) => [
841
- r(e(Ct), {
858
+ actions: i(({ item: U }) => [
859
+ r(e(Ut), {
842
860
  type: "remove",
843
861
  size: "sm",
844
- disabled: i.value,
862
+ disabled: n.value,
845
863
  title: e(t)("article.related-remove"),
846
864
  onClick: (I) => R(U.id)
847
865
  }, null, 8, ["disabled", "title", "onClick"])
@@ -850,199 +868,199 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
850
868
  }, 8, ["modelValue", "disabled", "empty-text", "aria-label"]),
851
869
  r(e(xe), {
852
870
  "model-value": null,
853
- options: y.value,
871
+ options: v.value,
854
872
  placeholder: e(t)("article.related-add"),
855
873
  "empty-text": e(t)("article.related-nothing"),
856
- disabled: i.value,
874
+ disabled: n.value,
857
875
  filterable: "",
858
876
  teleport: "",
859
877
  "aria-label": e(t)("article.related-add"),
860
- onSearch: z,
861
- "onUpdate:modelValue": E
878
+ onSearch: C,
879
+ "onUpdate:modelValue": B
862
880
  }, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"])
863
881
  ]));
864
882
  }
865
- }), Xt = /* @__PURE__ */ ve(Qt, [["__scopeId", "data-v-164e86fe"]]), Yt = { class: "wx-article-slug" }, ea = { class: "wx-article-slug__prefix" }, ta = /* @__PURE__ */ ee({
883
+ }), ia = /* @__PURE__ */ fe(la, [["__scopeId", "data-v-164e86fe"]]), na = { class: "wx-article-slug" }, sa = { class: "wx-article-slug__prefix" }, ra = /* @__PURE__ */ te({
866
884
  name: "WxArticleSlug",
867
885
  inheritAttrs: !1,
868
886
  __name: "ArticleSlug",
869
- setup(h) {
870
- const c = Ae(), v = lt();
871
- te();
872
- const f = Z("webx-blog"), a = b(() => {
873
- const o = c?.prefix.value ?? "";
874
- return o === "" ? "/" : `/${o}/`;
875
- }), s = b(() => {
876
- const o = c?.values.value.slug;
877
- return typeof o == "string" ? o : o?.[v.active.value] ?? "";
878
- }), t = b(() => {
879
- const o = c?.article.value?.path;
880
- return typeof o == "string" && s.value !== "" && `${a.value}${s.value}` != `/${o}`;
887
+ setup(b) {
888
+ const d = We(), f = nt();
889
+ ae();
890
+ const c = j("webx-blog"), a = y(() => {
891
+ const u = d?.prefix.value ?? "";
892
+ return u === "" ? "/" : `/${u}/`;
893
+ }), s = y(() => {
894
+ const u = d?.values.value.slug;
895
+ return typeof u == "string" ? u : u?.[f.active.value] ?? "";
896
+ }), t = y(() => {
897
+ const u = d?.article.value?.path;
898
+ return typeof u == "string" && s.value !== "" && `${a.value}${s.value}` != `/${u}`;
881
899
  });
882
- return (o, i) => (_(), j("div", Yt, [
883
- r(e(Ce), xt(_t(o.$attrs)), {
884
- prefix: l(() => [
885
- F("span", ea, $(a.value), 1)
900
+ return (u, n) => (_(), J("div", na, [
901
+ r(e(Ve), At(St(u.$attrs)), {
902
+ prefix: i(() => [
903
+ H("span", sa, T(a.value), 1)
886
904
  ]),
887
905
  _: 1
888
906
  }, 16),
889
- t.value ? (_(), q(e(Ne), {
907
+ t.value ? (_(), q(e(Le), {
890
908
  key: 0,
891
909
  type: "info",
892
910
  variant: "soft",
893
- description: e(f)("article.address-moving")
894
- }, null, 8, ["description"])) : L("", !0)
911
+ description: e(c)("article.address-moving")
912
+ }, null, 8, ["description"])) : K("", !0)
895
913
  ]));
896
914
  }
897
- }), aa = /* @__PURE__ */ ve(ta, [["__scopeId", "data-v-5da20e5e"]]), la = { class: "wx-article-tags" }, ia = {
915
+ }), oa = /* @__PURE__ */ fe(ra, [["__scopeId", "data-v-5da20e5e"]]), ua = { class: "wx-article-tags" }, da = {
898
916
  key: 0,
899
917
  class: "wx-article-tags__chips"
900
- }, na = { class: "wx-article-tags__pick" }, sa = 250, ra = /* @__PURE__ */ ee({
918
+ }, ca = { class: "wx-article-tags__pick" }, pa = 250, va = /* @__PURE__ */ te({
901
919
  name: "WxArticleTags",
902
920
  __name: "ArticleTags",
903
- props: /* @__PURE__ */ Fe({
921
+ props: /* @__PURE__ */ Ke({
904
922
  disabled: { type: Boolean, default: !1 }
905
923
  }, {
906
924
  modelValue: { default: () => [] },
907
925
  modelModifiers: {}
908
926
  }),
909
927
  emits: ["update:modelValue"],
910
- setup(h) {
911
- const c = h, v = Le(h, "modelValue"), f = ne(), a = ue(f), s = Ae();
912
- te();
913
- const t = Z("webx-blog"), o = he(), i = b(() => c.disabled || s?.disabled.value === !0), d = M(/* @__PURE__ */ new Map()), w = M([]), T = M(""), A = M(!1);
914
- let y;
915
- pe(
928
+ setup(b) {
929
+ const d = b, f = Fe(b, "modelValue"), c = re(), a = de(c), s = We();
930
+ ae();
931
+ const t = j("webx-blog"), u = me(), n = y(() => d.disabled || s?.disabled.value === !0), p = N(/* @__PURE__ */ new Map()), w = N([]), k = N(""), A = N(!1);
932
+ let v;
933
+ ge(
916
934
  () => s?.article.value?.tags,
917
- (g) => {
918
- const B = new Map(d.value);
919
- for (const D of g ?? []) B.set(D.id, D.title);
920
- d.value = B;
935
+ (h) => {
936
+ const E = new Map(p.value);
937
+ for (const L of h ?? []) E.set(L.id, L.title);
938
+ p.value = E;
921
939
  },
922
940
  { immediate: !0, deep: !0 }
923
941
  );
924
- const S = b(
925
- () => v.value.map((g) => ({ id: g, title: d.value.get(g) ?? `#${g}` }))
926
- ), z = b(
927
- () => w.value.filter((g) => !v.value.includes(g.id)).map((g) => ({
942
+ const $ = y(
943
+ () => f.value.map((h) => ({ id: h, title: p.value.get(h) ?? `#${h}` }))
944
+ ), C = y(
945
+ () => w.value.filter((h) => !f.value.includes(h.id)).map((h) => ({
928
946
  // The count is part of the label rather than a column: a select draws a line of text, and
929
947
  // the number is what the reader is choosing between two near-identical words on.
930
- label: t("article.tag-option", { title: g.title, count: g.articles_count }),
931
- value: g.id
948
+ label: t("article.tag-option", { title: h.title, count: h.articles_count }),
949
+ value: h.id
932
950
  }))
933
- ), E = b(() => {
934
- const g = T.value.trim();
935
- if (g === "") return null;
936
- const B = (D) => D.toLowerCase() === g.toLowerCase();
937
- return w.value.some((D) => B(D.title)) ? null : g;
951
+ ), B = y(() => {
952
+ const h = k.value.trim();
953
+ if (h === "") return null;
954
+ const E = (L) => L.toLowerCase() === h.toLowerCase();
955
+ return w.value.some((L) => E(L.title)) ? null : h;
938
956
  });
939
957
  async function R() {
940
958
  try {
941
- w.value = await a.tags(T.value);
942
- const g = new Map(d.value);
943
- for (const B of w.value) g.set(B.id, B.title);
944
- d.value = g;
945
- } catch (g) {
946
- P.danger(o(g));
959
+ w.value = await a.tags(k.value);
960
+ const h = new Map(p.value);
961
+ for (const E of w.value) h.set(E.id, E.title);
962
+ p.value = h;
963
+ } catch (h) {
964
+ P.danger(u(h));
947
965
  }
948
966
  }
949
- function x(g) {
950
- T.value = g, clearTimeout(y), y = setTimeout(() => {
967
+ function x(h) {
968
+ k.value = h, clearTimeout(v), v = setTimeout(() => {
951
969
  R();
952
- }, sa);
970
+ }, pa);
953
971
  }
954
- function W(g) {
955
- typeof g != "number" || v.value.includes(g) || (v.value = [...v.value, g], T.value = "");
972
+ function S(h) {
973
+ typeof h != "number" || f.value.includes(h) || (f.value = [...f.value, h], k.value = "");
956
974
  }
957
- function U(g) {
958
- v.value = v.value.filter((B) => B !== g);
975
+ function U(h) {
976
+ f.value = f.value.filter((E) => E !== h);
959
977
  }
960
978
  async function I() {
961
- const g = E.value;
962
- if (!(g === null || A.value)) {
979
+ const h = B.value;
980
+ if (!(h === null || A.value)) {
963
981
  A.value = !0;
964
982
  try {
965
- const B = await a.createTag({ title: g });
966
- d.value = new Map(d.value).set(B.id, B.title), w.value = [B, ...w.value], W(B.id);
967
- } catch (B) {
968
- P.danger(o(B));
983
+ const E = await a.createTag({ title: h });
984
+ p.value = new Map(p.value).set(E.id, E.title), w.value = [E, ...w.value], S(E.id);
985
+ } catch (E) {
986
+ P.danger(u(E));
969
987
  } finally {
970
988
  A.value = !1;
971
989
  }
972
990
  }
973
991
  }
974
- return pe(
992
+ return ge(
975
993
  () => s?.article.value?.id,
976
994
  () => {
977
995
  R();
978
996
  },
979
997
  { immediate: !0 }
980
- ), Ke(() => clearTimeout(y)), (g, B) => (_(), j("div", la, [
981
- S.value.length > 0 ? (_(), j("div", ia, [
982
- (_(!0), j(_e, null, qe(S.value, (D) => (_(), q(e(ie), {
983
- key: D.id,
998
+ ), He(() => clearTimeout(v)), (h, E) => (_(), J("div", ua, [
999
+ $.value.length > 0 ? (_(), J("div", da, [
1000
+ (_(!0), J(_e, null, qe($.value, (L) => (_(), q(e(se), {
1001
+ key: L.id,
984
1002
  type: "default",
985
- closable: !i.value,
1003
+ closable: !n.value,
986
1004
  "close-label": e(t)("article.tag-remove"),
987
- onClose: (H) => U(D.id)
1005
+ onClose: (Z) => U(L.id)
988
1006
  }, {
989
- default: l(() => [
990
- C($(D.title), 1)
1007
+ default: i(() => [
1008
+ V(T(L.title), 1)
991
1009
  ]),
992
1010
  _: 2
993
1011
  }, 1032, ["closable", "close-label", "onClose"]))), 128))
994
- ])) : (_(), q(e(le), {
1012
+ ])) : (_(), q(e(ne), {
995
1013
  key: 1,
996
1014
  size: "sm",
997
1015
  tone: "muted"
998
1016
  }, {
999
- default: l(() => [
1000
- C($(e(t)("article.tags-empty")), 1)
1017
+ default: i(() => [
1018
+ V(T(e(t)("article.tags-empty")), 1)
1001
1019
  ]),
1002
1020
  _: 1
1003
1021
  })),
1004
- F("div", na, [
1022
+ H("div", ca, [
1005
1023
  r(e(xe), {
1006
1024
  "model-value": null,
1007
- options: z.value,
1025
+ options: C.value,
1008
1026
  placeholder: e(t)("article.tag-add"),
1009
1027
  "empty-text": e(t)("article.tag-nothing"),
1010
- disabled: i.value,
1028
+ disabled: n.value,
1011
1029
  filterable: "",
1012
1030
  teleport: "",
1013
1031
  "aria-label": e(t)("article.tag-add"),
1014
1032
  onSearch: x,
1015
- "onUpdate:modelValue": W
1033
+ "onUpdate:modelValue": S
1016
1034
  }, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"]),
1017
- E.value ? (_(), q(e(J), {
1035
+ B.value ? (_(), q(e(Y), {
1018
1036
  key: 0,
1019
1037
  variant: "outline",
1020
1038
  icon: "plus",
1021
1039
  loading: A.value,
1022
- disabled: i.value,
1040
+ disabled: n.value,
1023
1041
  onClick: I
1024
1042
  }, {
1025
- default: l(() => [
1026
- C($(e(t)("article.tag-create", { title: E.value })), 1)
1043
+ default: i(() => [
1044
+ V(T(e(t)("article.tag-create", { title: B.value })), 1)
1027
1045
  ]),
1028
1046
  _: 1
1029
- }, 8, ["loading", "disabled"])) : L("", !0)
1047
+ }, 8, ["loading", "disabled"])) : K("", !0)
1030
1048
  ])
1031
1049
  ]));
1032
1050
  }
1033
- }), oa = /* @__PURE__ */ ve(ra, [["__scopeId", "data-v-faf5adec"]]), ua = /* @__PURE__ */ ee({
1051
+ }), ga = /* @__PURE__ */ fe(va, [["__scopeId", "data-v-faf5adec"]]), fa = /* @__PURE__ */ te({
1034
1052
  name: "WxArticleUnpublish",
1035
1053
  __name: "ArticleUnpublish",
1036
- setup(h) {
1037
- const c = ne(), v = ue(c), f = Ae();
1038
- te();
1039
- const a = Z("webx-blog"), s = he(), t = M(!1), o = b(() => {
1040
- const w = f?.article.value?.status;
1054
+ setup(b) {
1055
+ const d = re(), f = de(d), c = We();
1056
+ ae();
1057
+ const a = j("webx-blog"), s = me(), t = N(!1), u = y(() => {
1058
+ const w = c?.article.value?.status;
1041
1059
  return w === "published" || w === "modified" || w === "scheduled";
1042
- }), i = b(() => f?.disabled.value === !0 || t.value);
1043
- async function d() {
1044
- const w = f?.article.value;
1045
- if (!(!w || !await oe({
1060
+ }), n = y(() => c?.disabled.value === !0 || t.value);
1061
+ async function p() {
1062
+ const w = c?.article.value;
1063
+ if (!(!w || !await pe({
1046
1064
  title: a("article.unpublish-title", { title: w.title }),
1047
1065
  message: w.status === "scheduled" ? a("article.unpublish-waiting") : a("article.unpublish-text"),
1048
1066
  confirmText: a("panel.unpublish"),
@@ -1051,7 +1069,7 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1051
1069
  }))) {
1052
1070
  t.value = !0;
1053
1071
  try {
1054
- await v.unpublish(w.id), await f?.reload(), P.success(a("panel.unpublished-done"));
1072
+ await f.unpublish(w.id), await c?.reload(), P.success(a("panel.unpublished-done"));
1055
1073
  } catch (A) {
1056
1074
  P.danger(s(A));
1057
1075
  } finally {
@@ -1059,76 +1077,76 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1059
1077
  }
1060
1078
  }
1061
1079
  }
1062
- return (w, T) => o.value && e(f)?.canManage ? (_(), q(e(de), {
1080
+ return (w, k) => u.value && e(c)?.canManage ? (_(), q(e(ve), {
1063
1081
  key: 0,
1064
1082
  class: "wx-article-unpublish",
1065
1083
  help: e(a)("article.unpublish-help")
1066
1084
  }, {
1067
- default: l(() => [
1068
- r(e(J), {
1085
+ default: i(() => [
1086
+ r(e(Y), {
1069
1087
  variant: "outline",
1070
1088
  type: "danger",
1071
1089
  icon: "eye-off",
1072
1090
  loading: t.value,
1073
- disabled: i.value,
1074
- onClick: d
1091
+ disabled: n.value,
1092
+ onClick: p
1075
1093
  }, {
1076
- default: l(() => [
1077
- C($(e(a)("panel.unpublish")), 1)
1094
+ default: i(() => [
1095
+ V(T(e(a)("panel.unpublish")), 1)
1078
1096
  ]),
1079
1097
  _: 1
1080
1098
  }, 8, ["loading", "disabled"])
1081
1099
  ]),
1082
1100
  _: 1
1083
- }, 8, ["help"])) : L("", !0);
1101
+ }, 8, ["help"])) : K("", !0);
1084
1102
  }
1085
- }), ca = /* @__PURE__ */ ve(ua, [["__scopeId", "data-v-c311cff2"]]), da = /* @__PURE__ */ ee({
1103
+ }), ha = /* @__PURE__ */ fe(fa, [["__scopeId", "data-v-c311cff2"]]), ma = /* @__PURE__ */ te({
1086
1104
  __name: "ArticleCreateDialog",
1087
- setup(h) {
1088
- const { open: c, resolve: v, dismiss: f } = Re(), a = ne(), s = ue(a);
1089
- te();
1090
- const t = Z("webx-blog"), o = M(""), i = M(!1), d = M({}), w = Ie("field");
1105
+ setup(b) {
1106
+ const { open: d, resolve: f, dismiss: c } = Re(), a = re(), s = de(a);
1107
+ ae();
1108
+ const t = j("webx-blog"), u = N(""), n = N(!1), p = N({}), w = Ie("field");
1091
1109
  Ue(async () => {
1092
- await He(), w.value?.querySelector("input")?.focus();
1110
+ await Ge(), w.value?.querySelector("input")?.focus();
1093
1111
  });
1094
- async function T() {
1095
- if (!(o.value.trim() === "" || i.value)) {
1096
- i.value = !0, d.value = {};
1112
+ async function k() {
1113
+ if (!(u.value.trim() === "" || n.value)) {
1114
+ n.value = !0, p.value = {};
1097
1115
  try {
1098
- v(await s.create({ title: o.value.trim() }));
1116
+ f(await s.create({ title: u.value.trim() }));
1099
1117
  } catch (A) {
1100
- d.value = A.body?.errors ?? {};
1118
+ p.value = A.body?.errors ?? {};
1101
1119
  } finally {
1102
- i.value = !1;
1120
+ n.value = !1;
1103
1121
  }
1104
1122
  }
1105
1123
  }
1106
- return (A, y) => (_(), q(e(De), {
1107
- open: e(c),
1108
- "onUpdate:open": y[2] || (y[2] = (S) => Pe(c) ? c.value = S : null),
1124
+ return (A, v) => (_(), q(e(De), {
1125
+ open: e(d),
1126
+ "onUpdate:open": v[2] || (v[2] = ($) => Pe(d) ? d.value = $ : null),
1109
1127
  title: e(t)("panel.new-title"),
1110
1128
  width: 440
1111
1129
  }, {
1112
- footer: l(() => [
1130
+ footer: i(() => [
1113
1131
  r(e(Be), { size: "sm" }, {
1114
- default: l(() => [
1115
- r(e(J), {
1132
+ default: i(() => [
1133
+ r(e(Y), {
1116
1134
  variant: "outline",
1117
- onClick: y[1] || (y[1] = (S) => e(f)())
1135
+ onClick: v[1] || (v[1] = ($) => e(c)())
1118
1136
  }, {
1119
- default: l(() => [
1120
- C($(e(t)("panel.cancel")), 1)
1137
+ default: i(() => [
1138
+ V(T(e(t)("panel.cancel")), 1)
1121
1139
  ]),
1122
1140
  _: 1
1123
1141
  }),
1124
- r(e(J), {
1142
+ r(e(Y), {
1125
1143
  type: "primary",
1126
- loading: i.value,
1127
- disabled: o.value.trim() === "",
1128
- onClick: T
1144
+ loading: n.value,
1145
+ disabled: u.value.trim() === "",
1146
+ onClick: k
1129
1147
  }, {
1130
- default: l(() => [
1131
- C($(e(t)("panel.create")), 1)
1148
+ default: i(() => [
1149
+ V(T(e(t)("panel.create")), 1)
1132
1150
  ]),
1133
1151
  _: 1
1134
1152
  }, 8, ["loading", "disabled"])
@@ -1136,22 +1154,22 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1136
1154
  _: 1
1137
1155
  })
1138
1156
  ]),
1139
- default: l(() => [
1140
- r(e(de), {
1157
+ default: i(() => [
1158
+ r(e(ve), {
1141
1159
  label: e(t)("panel.field-title"),
1142
- error: d.value.title?.[0] ?? d.value.slug?.[0],
1160
+ error: p.value.title?.[0] ?? p.value.slug?.[0],
1143
1161
  required: ""
1144
1162
  }, {
1145
- default: l(() => [
1146
- F("div", {
1163
+ default: i(() => [
1164
+ H("div", {
1147
1165
  ref_key: "field",
1148
1166
  ref: w
1149
1167
  }, [
1150
- r(e(Ce), {
1151
- modelValue: o.value,
1152
- "onUpdate:modelValue": y[0] || (y[0] = (S) => o.value = S),
1168
+ r(e(Ve), {
1169
+ modelValue: u.value,
1170
+ "onUpdate:modelValue": v[0] || (v[0] = ($) => u.value = $),
1153
1171
  "aria-label": e(t)("panel.field-title"),
1154
- onKeyup: Me(T, ["enter"])
1172
+ onKeyup: Me(k, ["enter"])
1155
1173
  }, null, 8, ["modelValue", "aria-label"])
1156
1174
  ], 512)
1157
1175
  ]),
@@ -1161,42 +1179,42 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1161
1179
  _: 1
1162
1180
  }, 8, ["open", "title"]));
1163
1181
  }
1164
- }), pa = ["src"], va = { class: "wx-articles__name" }, ga = { class: "wx-articles__name-text" }, fa = { class: "wx-articles__title" }, ha = { class: "wx-articles__address" }, ma = { class: "wx-articles__chips" }, ba = { class: "wx-articles__state" }, Ye = 640, ya = /* @__PURE__ */ ee({
1182
+ }), ba = ["src"], ya = { class: "wx-articles__name" }, wa = { class: "wx-articles__name-text" }, xa = { class: "wx-articles__title" }, _a = { class: "wx-articles__address" }, ka = { class: "wx-articles__chips" }, $a = { class: "wx-articles__state" }, tt = 640, Ta = /* @__PURE__ */ te({
1165
1183
  __name: "ArticlesPage",
1166
1184
  props: {
1167
1185
  base: { default: "/blog" }
1168
1186
  },
1169
- setup(h) {
1170
- const c = h, v = ne(), f = ue(v), a = Ge(), s = je();
1171
- te();
1172
- const t = Z("webx-blog"), o = Z("webx-admin"), i = he(), d = Ie("root"), w = Vt(d), T = M(null), A = M(!0), y = Ve(da), S = b(() => v.can("blog.articles.manage")), z = b(
1173
- () => v.state.manifest?.modules.find((n) => n.id === "articles")?.title ?? t("module.articles")
1174
- ), E = b({
1187
+ setup(b) {
1188
+ const d = b, f = re(), c = de(f), a = Je(), s = je();
1189
+ ae();
1190
+ const t = j("webx-blog"), u = j("webx-admin"), n = me(), p = Ie("root"), w = qt(p), k = N(null), A = N(!0), v = ze(ma), $ = y(() => f.can("blog.articles.manage")), C = y(
1191
+ () => f.state.manifest?.modules.find((l) => l.id === "articles")?.title ?? t("module.articles")
1192
+ ), B = y({
1175
1193
  get: () => typeof a.query.view == "string" ? a.query.view : "",
1176
- set: (n) => {
1194
+ set: (l) => {
1177
1195
  s.replace({
1178
- query: { ...a.query, view: n === "" ? void 0 : String(n), page: void 0 }
1196
+ query: { ...a.query, view: l === "" ? void 0 : String(l), page: void 0 }
1179
1197
  });
1180
1198
  }
1181
- }), R = b(() => E.value === "trashed"), x = b(() => ({
1199
+ }), R = y(() => B.value === "trashed"), x = y(() => ({
1182
1200
  q: typeof a.query.q == "string" ? a.query.q : "",
1183
- rubric: W(a.query.rubric),
1184
- tag: W(a.query.tag),
1185
- author: W(a.query.author),
1201
+ rubric: S(a.query.rubric),
1202
+ tag: S(a.query.tag),
1203
+ author: S(a.query.author),
1186
1204
  sort: typeof a.query.sort == "string" ? a.query.sort : null,
1187
1205
  page: Number(a.query.page ?? 1) || 1
1188
1206
  }));
1189
- function W(n) {
1190
- return typeof n == "string" && n !== "" && Number(n) || null;
1207
+ function S(l) {
1208
+ return typeof l == "string" && l !== "" && Number(l) || null;
1191
1209
  }
1192
- const U = b(() => [
1210
+ const U = y(() => [
1193
1211
  { value: "", label: t("panel.view-all") },
1194
1212
  { value: "published", label: t("panel.view-published") },
1195
1213
  { value: "scheduled", label: t("panel.view-scheduled") },
1196
1214
  { value: "draft", label: t("panel.view-draft") },
1197
1215
  { value: "unpublished", label: t("panel.view-unpublished") },
1198
1216
  { value: "trashed", label: t("panel.bin"), icon: "trash" }
1199
- ]), I = b(() => T.value?.filters ?? { rubrics: [], tags: [], authors: [] }), g = b(() => w.value > 0 && w.value < Ye), B = b(() => g.value ? [{ key: "card", label: "" }] : [
1217
+ ]), I = y(() => k.value?.filters ?? { rubrics: [], tags: [], authors: [] }), h = y(() => w.value > 0 && w.value < tt), E = y(() => h.value ? [{ key: "card", label: "" }] : [
1200
1218
  { key: "cover", label: "", width: 68 },
1201
1219
  /* The one that takes what the others leave, and the only one without a number. */
1202
1220
  { key: "title", label: t("panel.column-title"), minWidth: 220 },
@@ -1212,28 +1230,28 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1212
1230
  cellClass: "wx-articles__when"
1213
1231
  },
1214
1232
  { key: "status", label: t("panel.column-status"), width: 170 },
1215
- { key: "actions", label: "", width: et, align: "right" }
1216
- ]), D = b(() => x.value.q !== "" ? t("panel.empty-search") : R.value ? t("panel.empty-bin") : t("panel.empty")), H = b(() => {
1217
- const n = [], N = I.value.rubrics.find((we) => we.id === x.value.rubric);
1218
- N && n.push({
1233
+ { key: "actions", label: "", width: at, align: "right" }
1234
+ ]), L = y(() => x.value.q !== "" ? t("panel.empty-search") : R.value ? t("panel.empty-bin") : t("panel.empty")), Z = y(() => {
1235
+ const l = [], z = I.value.rubrics.find((we) => we.id === x.value.rubric);
1236
+ z && l.push({
1219
1237
  key: "rubric",
1220
- label: `${t("panel.filter-rubric")}: ${N.title}`,
1221
- clear: () => X("rubric", void 0)
1238
+ label: `${t("panel.filter-rubric")}: ${z.title}`,
1239
+ clear: () => ie("rubric", void 0)
1222
1240
  });
1223
- const p = I.value.tags.find((we) => we.id === x.value.tag);
1224
- p && n.push({
1241
+ const g = I.value.tags.find((we) => we.id === x.value.tag);
1242
+ g && l.push({
1225
1243
  key: "tag",
1226
- label: `${t("panel.filter-tag")}: ${p.title}`,
1227
- clear: () => X("tag", void 0)
1244
+ label: `${t("panel.filter-tag")}: ${g.title}`,
1245
+ clear: () => ie("tag", void 0)
1228
1246
  });
1229
1247
  const ye = I.value.authors.find((we) => we.id === x.value.author);
1230
- return ye && n.push({
1248
+ return ye && l.push({
1231
1249
  key: "author",
1232
1250
  label: `${t("panel.filter-author")}: ${ye.title}`,
1233
- clear: () => X("author", void 0)
1234
- }), n;
1251
+ clear: () => ie("author", void 0)
1252
+ }), l;
1235
1253
  });
1236
- function me() {
1254
+ function ee() {
1237
1255
  s.replace({
1238
1256
  query: {
1239
1257
  ...a.query,
@@ -1244,60 +1262,60 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1244
1262
  }
1245
1263
  });
1246
1264
  }
1247
- async function Q(n) {
1265
+ async function O(l) {
1248
1266
  A.value = !0;
1249
1267
  try {
1250
- T.value = await f.articles({
1251
- q: n?.search ?? x.value.q,
1252
- status: R.value ? "" : E.value,
1268
+ k.value = await c.articles({
1269
+ q: l?.search ?? x.value.q,
1270
+ status: R.value ? "" : B.value,
1253
1271
  trashed: R.value,
1254
1272
  rubric: x.value.rubric,
1255
1273
  tag: x.value.tag,
1256
1274
  author: x.value.author,
1257
- sort: n?.sort ? `${n.sort.order === "desc" ? "-" : ""}${n.sort.key}` : null,
1258
- page: n?.page ?? x.value.page,
1259
- per_page: n?.perPage
1275
+ sort: l?.sort ? `${l.sort.order === "desc" ? "-" : ""}${l.sort.key}` : null,
1276
+ page: l?.page ?? x.value.page,
1277
+ per_page: l?.perPage
1260
1278
  });
1261
- } catch (N) {
1262
- P.danger(i(N));
1279
+ } catch (z) {
1280
+ P.danger(n(z));
1263
1281
  } finally {
1264
1282
  A.value = !1;
1265
1283
  }
1266
1284
  }
1267
- function ke(n) {
1268
- const N = {
1285
+ function oe(l) {
1286
+ const z = {
1269
1287
  ...a.query,
1270
- q: n.search === "" ? void 0 : n.search,
1271
- sort: n.sort === null ? void 0 : `${n.sort.order === "desc" ? "-" : ""}${n.sort.key}`,
1272
- page: n.page === 1 ? void 0 : String(n.page)
1288
+ q: l.search === "" ? void 0 : l.search,
1289
+ sort: l.sort === null ? void 0 : `${l.sort.order === "desc" ? "-" : ""}${l.sort.key}`,
1290
+ page: l.page === 1 ? void 0 : String(l.page)
1273
1291
  };
1274
- s.replace({ query: N }), Q(n);
1292
+ s.replace({ query: z }), O(l);
1275
1293
  }
1276
- function X(n, N) {
1294
+ function ie(l, z) {
1277
1295
  s.replace({
1278
1296
  query: {
1279
1297
  ...a.query,
1280
- [n]: typeof N == "number" ? String(N) : void 0,
1298
+ [l]: typeof z == "number" ? String(z) : void 0,
1281
1299
  page: void 0
1282
1300
  }
1283
1301
  });
1284
1302
  }
1285
- pe(
1286
- [E, () => x.value.rubric, () => x.value.tag, () => x.value.author],
1303
+ ge(
1304
+ [B, () => x.value.rubric, () => x.value.tag, () => x.value.author],
1287
1305
  () => {
1288
- Q();
1306
+ O();
1289
1307
  }
1290
- ), Q();
1291
- function G(n) {
1292
- const N = `${c.base}/articles/${n.id}`;
1293
- s.resolve(N).matched.length > 0 && s.push({ path: N, query: { ...a.query } });
1308
+ ), O();
1309
+ function le(l) {
1310
+ const z = `${d.base}/articles/${l.id}`;
1311
+ s.resolve(z).matched.length > 0 && s.push({ path: z, query: { ...a.query } });
1294
1312
  }
1295
- async function $e() {
1296
- const n = await y({});
1297
- n && (await Q(), G(n));
1313
+ async function Q() {
1314
+ const l = await v({});
1315
+ l && (await O(), le(l));
1298
1316
  }
1299
- function ge(n) {
1300
- if (!S.value) return [];
1317
+ function be(l) {
1318
+ if (!$.value) return [];
1301
1319
  if (R.value)
1302
1320
  return [
1303
1321
  {
@@ -1305,128 +1323,128 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1305
1323
  icon: "refresh",
1306
1324
  label: t("panel.restore"),
1307
1325
  run: () => {
1308
- se(n);
1326
+ Te(l);
1309
1327
  }
1310
1328
  }
1311
1329
  ];
1312
- const N = [
1313
- { key: "open", icon: "edit", label: t("panel.open"), run: () => G(n) }
1330
+ const z = [
1331
+ { key: "open", icon: "edit", label: t("panel.open"), run: () => le(l) }
1314
1332
  ];
1315
- return n.url && n.status !== "draft" && N.push({
1333
+ return l.url && l.status !== "draft" && z.push({
1316
1334
  key: "site",
1317
1335
  icon: "external-link",
1318
1336
  label: t("panel.open-on-site"),
1319
- href: n.url
1320
- }), n.path !== null && N.push({
1337
+ href: l.url
1338
+ }), l.path !== null && z.push({
1321
1339
  key: "copy",
1322
1340
  icon: "copy",
1323
1341
  label: t("panel.copy-address"),
1324
1342
  run: () => {
1325
- We(n);
1343
+ Ce(l);
1326
1344
  }
1327
- }), N.push({
1345
+ }), z.push({
1328
1346
  key: "pin",
1329
1347
  icon: "star",
1330
- label: n.pinned ? t("panel.unpin") : t("panel.pin"),
1348
+ label: l.pinned ? t("panel.unpin") : t("panel.pin"),
1331
1349
  run: () => {
1332
- Se(n, !n.pinned);
1350
+ he(l, !l.pinned);
1333
1351
  }
1334
- }), N.push(
1335
- n.status === "published" || n.status === "modified" || n.status === "scheduled" ? {
1352
+ }), z.push(
1353
+ l.status === "published" || l.status === "modified" || l.status === "scheduled" ? {
1336
1354
  key: "unpublish",
1337
1355
  icon: "eye-off",
1338
1356
  label: t("panel.unpublish"),
1339
1357
  run: () => {
1340
- fe(n);
1358
+ ce(l);
1341
1359
  }
1342
1360
  } : {
1343
1361
  key: "publish",
1344
1362
  icon: "upload",
1345
1363
  label: t("panel.publish"),
1346
1364
  run: () => {
1347
- ce(n);
1365
+ ke(l);
1348
1366
  }
1349
1367
  }
1350
- ), N.push({
1368
+ ), z.push({
1351
1369
  key: "delete",
1352
1370
  icon: "trash",
1353
1371
  label: t("panel.delete"),
1354
1372
  danger: !0,
1355
1373
  run: () => {
1356
- be(n);
1374
+ $e(l);
1357
1375
  }
1358
- }), N;
1376
+ }), z;
1359
1377
  }
1360
- async function ce(n) {
1361
- await Y(() => f.publish(n.id), t("panel.published"));
1378
+ async function ke(l) {
1379
+ await X(() => c.publish(l.id), t("panel.published"));
1362
1380
  }
1363
- async function fe(n) {
1364
- await Y(() => f.unpublish(n.id), t("panel.unpublished-done"));
1381
+ async function ce(l) {
1382
+ await X(() => c.unpublish(l.id), t("panel.unpublished-done"));
1365
1383
  }
1366
- async function Se(n, N) {
1367
- await Y(
1368
- () => f.save(n.id, { values: { pinned: N }, revision: n.revision }),
1369
- t(N ? "panel.pinned-done" : "panel.unpinned")
1384
+ async function he(l, z) {
1385
+ await X(
1386
+ () => c.save(l.id, { values: { pinned: z }, revision: l.revision }),
1387
+ t(z ? "panel.pinned-done" : "panel.unpinned")
1370
1388
  );
1371
1389
  }
1372
- async function be(n) {
1373
- await oe({
1374
- title: t("panel.delete-title", { title: n.title }),
1390
+ async function $e(l) {
1391
+ await pe({
1392
+ title: t("panel.delete-title", { title: l.title }),
1375
1393
  message: t("panel.delete-text"),
1376
1394
  confirmText: t("panel.delete"),
1377
1395
  cancelText: t("panel.cancel"),
1378
1396
  tone: "danger"
1379
- }) && await Y(() => f.remove(n.id), t("panel.deleted"));
1397
+ }) && await X(() => c.remove(l.id), t("panel.deleted"));
1380
1398
  }
1381
- async function se(n) {
1382
- await Y(() => f.restore(n.id), t("panel.restored"));
1399
+ async function Te(l) {
1400
+ await X(() => c.restore(l.id), t("panel.restored"));
1383
1401
  }
1384
- async function Y(n, N) {
1402
+ async function X(l, z) {
1385
1403
  try {
1386
- await n(), P.success(N);
1387
- } catch (p) {
1388
- P.danger(i(p));
1404
+ await l(), P.success(z);
1405
+ } catch (g) {
1406
+ P.danger(n(g));
1389
1407
  } finally {
1390
- await Q();
1408
+ await O();
1391
1409
  }
1392
1410
  }
1393
- async function We(n) {
1394
- if (n.url)
1411
+ async function Ce(l) {
1412
+ if (l.url)
1395
1413
  try {
1396
- await navigator.clipboard.writeText(n.url), P.success(t("panel.address-copied"));
1414
+ await navigator.clipboard.writeText(l.url), P.success(t("panel.address-copied"));
1397
1415
  } catch {
1398
1416
  }
1399
1417
  }
1400
- function u(n) {
1401
- return n === "published" || n === "modified" ? "success" : n === "scheduled" ? "warning" : "default";
1418
+ function o(l) {
1419
+ return l === "published" || l === "modified" ? "success" : l === "scheduled" ? "warning" : "default";
1402
1420
  }
1403
- function V(n) {
1404
- return R.value ? "—" : n.path === null ? t("panel.no-address") : `/${n.path}`;
1421
+ function M(l) {
1422
+ return R.value ? "—" : l.path === null ? t("panel.no-address") : `/${l.path}`;
1405
1423
  }
1406
- function k(n) {
1407
- return R.value ? n.deleted_at : n.published_at;
1424
+ function W(l) {
1425
+ return R.value ? l.deleted_at : l.published_at;
1408
1426
  }
1409
- const ae = b(
1410
- () => S.value ? [{ key: "new", label: t("panel.new"), icon: "plus", primary: !0, run: () => {
1411
- $e();
1427
+ const G = y(
1428
+ () => $.value ? [{ key: "new", label: t("panel.new"), icon: "plus", primary: !0, run: () => {
1429
+ Q();
1412
1430
  } }] : []
1413
1431
  );
1414
- return (n, N) => (_(), j("div", {
1432
+ return (l, z) => (_(), J("div", {
1415
1433
  ref_key: "root",
1416
- ref: d,
1434
+ ref: p,
1417
1435
  class: "wx-articles"
1418
1436
  }, [
1419
- r(e(tt), {
1420
- view: E.value,
1421
- "onUpdate:view": N[3] || (N[3] = (p) => E.value = p),
1422
- title: z.value,
1437
+ r(e(lt), {
1438
+ view: B.value,
1439
+ "onUpdate:view": z[3] || (z[3] = (g) => B.value = g),
1440
+ title: C.value,
1423
1441
  views: U.value,
1424
- actions: ae.value
1442
+ actions: G.value
1425
1443
  }, {
1426
- default: l(() => [
1427
- r(e(nt), {
1428
- data: T.value,
1429
- columns: B.value,
1444
+ default: i(() => [
1445
+ r(e(rt), {
1446
+ data: k.value,
1447
+ columns: E.value,
1430
1448
  "row-key": "id",
1431
1449
  searchable: "",
1432
1450
  clickable: !R.value,
@@ -1434,249 +1452,249 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1434
1452
  flush: "",
1435
1453
  loading: A.value,
1436
1454
  layout: "fixed",
1437
- "cards-below": Ye,
1438
- "filters-count": H.value.length,
1439
- "filters-label": e(o)("filters.title"),
1455
+ "cards-below": tt,
1456
+ "filters-count": Z.value.length,
1457
+ "filters-label": e(u)("filters.title"),
1440
1458
  "search-placeholder": e(t)("panel.search"),
1441
- "empty-text": D.value,
1442
- "aria-label": z.value,
1443
- onRowClick: G,
1444
- onStateChange: ke
1459
+ "empty-text": L.value,
1460
+ "aria-label": C.value,
1461
+ onRowClick: le,
1462
+ onStateChange: oe
1445
1463
  }, {
1446
- filters: l(() => [
1447
- r(e(de), {
1464
+ filters: i(() => [
1465
+ r(e(ve), {
1448
1466
  label: e(t)("panel.filter-rubric")
1449
1467
  }, {
1450
- default: l(() => [
1468
+ default: i(() => [
1451
1469
  r(e(xe), {
1452
1470
  "model-value": x.value.rubric,
1453
- options: I.value.rubrics.map((p) => ({ value: p.id, label: p.title })),
1471
+ options: I.value.rubrics.map((g) => ({ value: g.id, label: g.title })),
1454
1472
  placeholder: e(t)("panel.any-rubric"),
1455
1473
  clearable: "",
1456
1474
  size: "sm",
1457
- "onUpdate:modelValue": N[0] || (N[0] = (p) => X("rubric", p))
1475
+ "onUpdate:modelValue": z[0] || (z[0] = (g) => ie("rubric", g))
1458
1476
  }, null, 8, ["model-value", "options", "placeholder"])
1459
1477
  ]),
1460
1478
  _: 1
1461
1479
  }, 8, ["label"]),
1462
- r(e(de), {
1480
+ r(e(ve), {
1463
1481
  label: e(t)("panel.filter-tag")
1464
1482
  }, {
1465
- default: l(() => [
1483
+ default: i(() => [
1466
1484
  r(e(xe), {
1467
1485
  "model-value": x.value.tag,
1468
- options: I.value.tags.map((p) => ({ value: p.id, label: p.title })),
1486
+ options: I.value.tags.map((g) => ({ value: g.id, label: g.title })),
1469
1487
  placeholder: e(t)("panel.any-tag"),
1470
1488
  clearable: "",
1471
1489
  filterable: "",
1472
1490
  size: "sm",
1473
- "onUpdate:modelValue": N[1] || (N[1] = (p) => X("tag", p))
1491
+ "onUpdate:modelValue": z[1] || (z[1] = (g) => ie("tag", g))
1474
1492
  }, null, 8, ["model-value", "options", "placeholder"])
1475
1493
  ]),
1476
1494
  _: 1
1477
1495
  }, 8, ["label"]),
1478
- r(e(de), {
1496
+ r(e(ve), {
1479
1497
  label: e(t)("panel.filter-author")
1480
1498
  }, {
1481
- default: l(() => [
1499
+ default: i(() => [
1482
1500
  r(e(xe), {
1483
1501
  "model-value": x.value.author,
1484
- options: I.value.authors.map((p) => ({ value: p.id, label: p.title })),
1502
+ options: I.value.authors.map((g) => ({ value: g.id, label: g.title })),
1485
1503
  placeholder: e(t)("panel.any-author"),
1486
1504
  clearable: "",
1487
1505
  size: "sm",
1488
- "onUpdate:modelValue": N[2] || (N[2] = (p) => X("author", p))
1506
+ "onUpdate:modelValue": z[2] || (z[2] = (g) => ie("author", g))
1489
1507
  }, null, 8, ["model-value", "options", "placeholder"])
1490
1508
  ]),
1491
1509
  _: 1
1492
1510
  }, 8, ["label"]),
1493
- H.value.length > 0 ? (_(), q(e(J), {
1511
+ Z.value.length > 0 ? (_(), q(e(Y), {
1494
1512
  key: 0,
1495
1513
  variant: "text",
1496
1514
  size: "sm",
1497
1515
  block: "",
1498
- onClick: me
1516
+ onClick: ee
1499
1517
  }, {
1500
- icon: l(() => [
1501
- r(e(Te), { name: "close" })
1518
+ icon: i(() => [
1519
+ r(e(Se), { name: "close" })
1502
1520
  ]),
1503
- default: l(() => [
1504
- C(" " + $(e(o)("filters.reset")), 1)
1521
+ default: i(() => [
1522
+ V(" " + T(e(u)("filters.reset")), 1)
1505
1523
  ]),
1506
1524
  _: 1
1507
- })) : L("", !0)
1525
+ })) : K("", !0)
1508
1526
  ]),
1509
- applied: l(() => [
1510
- r(e(mt), { filters: H.value }, null, 8, ["filters"])
1527
+ applied: i(() => [
1528
+ r(e(_t), { filters: Z.value }, null, 8, ["filters"])
1511
1529
  ]),
1512
- "cell-cover": l(({ row: p }) => [
1513
- F("span", {
1514
- class: at(["wx-articles__cover", { "is-empty": !p.cover }])
1530
+ "cell-cover": i(({ row: g }) => [
1531
+ H("span", {
1532
+ class: it(["wx-articles__cover", { "is-empty": !g.cover }])
1515
1533
  }, [
1516
- p.cover?.thumb ? (_(), j("img", {
1534
+ g.cover?.thumb ? (_(), J("img", {
1517
1535
  key: 0,
1518
- src: p.cover.thumb,
1536
+ src: g.cover.thumb,
1519
1537
  alt: "",
1520
1538
  loading: "lazy"
1521
- }, null, 8, pa)) : (_(), q(e(Te), {
1539
+ }, null, 8, ba)) : (_(), q(e(Se), {
1522
1540
  key: 1,
1523
1541
  name: "image",
1524
1542
  size: "sm"
1525
1543
  }))
1526
1544
  ], 2)
1527
1545
  ]),
1528
- "cell-title": l(({ row: p }) => [
1529
- F("div", va, [
1530
- p.pinned ? (_(), q(e(st), {
1546
+ "cell-title": i(({ row: g }) => [
1547
+ H("div", ya, [
1548
+ g.pinned ? (_(), q(e(ot), {
1531
1549
  key: 0,
1532
1550
  content: e(t)("panel.pinned")
1533
1551
  }, {
1534
- default: l(() => [
1535
- r(e(Te), {
1552
+ default: i(() => [
1553
+ r(e(Se), {
1536
1554
  class: "wx-articles__pin",
1537
1555
  name: "star",
1538
1556
  size: "sm"
1539
1557
  })
1540
1558
  ]),
1541
1559
  _: 1
1542
- }, 8, ["content"])) : L("", !0),
1543
- F("div", ga, [
1544
- F("span", fa, $(p.title), 1),
1545
- F("span", ha, [
1546
- C($(V(p)) + " ", 1),
1547
- R.value ? L("", !0) : (_(), q(e(ht), {
1560
+ }, 8, ["content"])) : K("", !0),
1561
+ H("div", wa, [
1562
+ H("span", xa, T(g.title), 1),
1563
+ H("span", _a, [
1564
+ V(T(M(g)) + " ", 1),
1565
+ R.value ? K("", !0) : (_(), q(e(xt), {
1548
1566
  key: 0,
1549
- locale: p.address_locale
1567
+ locale: g.address_locale
1550
1568
  }, null, 8, ["locale"]))
1551
1569
  ])
1552
1570
  ])
1553
1571
  ])
1554
1572
  ]),
1555
- "cell-rubrics": l(({ row: p }) => [
1556
- F("span", ma, [
1557
- (_(!0), j(_e, null, qe(p.rubrics, (ye) => (_(), q(e(ie), {
1573
+ "cell-rubrics": i(({ row: g }) => [
1574
+ H("span", ka, [
1575
+ (_(!0), J(_e, null, qe(g.rubrics, (ye) => (_(), q(e(se), {
1558
1576
  key: ye.id,
1559
1577
  size: "sm",
1560
1578
  round: ""
1561
1579
  }, {
1562
- default: l(() => [
1563
- C($(ye.title), 1)
1580
+ default: i(() => [
1581
+ V(T(ye.title), 1)
1564
1582
  ]),
1565
1583
  _: 2
1566
1584
  }, 1024))), 128))
1567
1585
  ])
1568
1586
  ]),
1569
- "cell-author": l(({ row: p }) => [
1570
- r(e(le), {
1587
+ "cell-author": i(({ row: g }) => [
1588
+ r(e(ne), {
1571
1589
  size: "sm",
1572
1590
  tone: "muted",
1573
1591
  truncate: ""
1574
1592
  }, {
1575
- default: l(() => [
1576
- C($(p.author ? p.author.name : "—"), 1)
1593
+ default: i(() => [
1594
+ V(T(g.author ? g.author.name : "—"), 1)
1577
1595
  ]),
1578
1596
  _: 2
1579
1597
  }, 1024)
1580
1598
  ]),
1581
- "cell-date": l(({ row: p }) => [
1582
- k(p) ? (_(), q(e(Ee), {
1599
+ "cell-date": i(({ row: g }) => [
1600
+ W(g) ? (_(), q(e(Ee), {
1583
1601
  key: 0,
1584
- value: k(p),
1602
+ value: W(g),
1585
1603
  compact: ""
1586
- }, null, 8, ["value"])) : (_(), q(e(le), {
1604
+ }, null, 8, ["value"])) : (_(), q(e(ne), {
1587
1605
  key: 1,
1588
1606
  size: "sm",
1589
1607
  tone: "muted"
1590
1608
  }, {
1591
- default: l(() => [...N[4] || (N[4] = [
1592
- C("—", -1)
1609
+ default: i(() => [...z[4] || (z[4] = [
1610
+ V("—", -1)
1593
1611
  ])]),
1594
1612
  _: 1
1595
1613
  }))
1596
1614
  ]),
1597
- "cell-status": l(({ row: p }) => [
1598
- F("span", ba, [
1599
- r(e(ie), {
1600
- type: u(p.status),
1615
+ "cell-status": i(({ row: g }) => [
1616
+ H("span", $a, [
1617
+ r(e(se), {
1618
+ type: o(g.status),
1601
1619
  dot: "",
1602
1620
  size: "sm"
1603
1621
  }, {
1604
- default: l(() => [
1605
- C($(e(t)(`panel.status-${p.status}`)), 1)
1622
+ default: i(() => [
1623
+ V(T(e(t)(`panel.status-${g.status}`)), 1)
1606
1624
  ]),
1607
1625
  _: 2
1608
1626
  }, 1032, ["type"]),
1609
- p.status === "modified" ? (_(), q(e(ie), {
1627
+ g.status === "modified" ? (_(), q(e(se), {
1610
1628
  key: 0,
1611
1629
  type: "primary",
1612
1630
  size: "sm",
1613
1631
  round: ""
1614
1632
  }, {
1615
- default: l(() => [
1616
- C($(e(t)("panel.edits")), 1)
1633
+ default: i(() => [
1634
+ V(T(e(t)("panel.edits")), 1)
1617
1635
  ]),
1618
1636
  _: 1
1619
- })) : L("", !0)
1637
+ })) : K("", !0)
1620
1638
  ])
1621
1639
  ]),
1622
- "cell-card": l(({ row: p }) => [
1623
- r(e(zt), {
1640
+ "cell-card": i(({ row: g }) => [
1641
+ r(e(It), {
1624
1642
  class: "wx-articles__entity",
1625
1643
  variant: "plain",
1626
- title: p.title,
1627
- image: p.cover?.thumb ?? void 0,
1644
+ title: g.title,
1645
+ image: g.cover?.thumb ?? void 0,
1628
1646
  "image-size": "56px",
1629
1647
  "title-lines": 2,
1630
- subtitle: V(p)
1648
+ subtitle: M(g)
1631
1649
  }, {
1632
- title: l(() => [
1633
- p.pinned ? (_(), q(e(Te), {
1650
+ title: i(() => [
1651
+ g.pinned ? (_(), q(e(Se), {
1634
1652
  key: 0,
1635
1653
  class: "wx-articles__pin",
1636
1654
  name: "star",
1637
1655
  size: "sm"
1638
- })) : L("", !0),
1639
- C(" " + $(p.title), 1)
1656
+ })) : K("", !0),
1657
+ V(" " + T(g.title), 1)
1640
1658
  ]),
1641
- meta: l(() => [
1642
- p.rubrics[0] ? (_(), q(e(ie), {
1659
+ meta: i(() => [
1660
+ g.rubrics[0] ? (_(), q(e(se), {
1643
1661
  key: 0,
1644
1662
  size: "sm",
1645
1663
  round: ""
1646
1664
  }, {
1647
- default: l(() => [
1648
- C($(p.rubrics[0].title), 1)
1665
+ default: i(() => [
1666
+ V(T(g.rubrics[0].title), 1)
1649
1667
  ]),
1650
1668
  _: 2
1651
- }, 1024)) : L("", !0),
1652
- r(e(ie), {
1653
- type: u(p.status),
1669
+ }, 1024)) : K("", !0),
1670
+ r(e(se), {
1671
+ type: o(g.status),
1654
1672
  dot: "",
1655
1673
  size: "sm"
1656
1674
  }, {
1657
- default: l(() => [
1658
- C($(e(t)(`panel.status-${p.status}`)), 1)
1675
+ default: i(() => [
1676
+ V(T(e(t)(`panel.status-${g.status}`)), 1)
1659
1677
  ]),
1660
1678
  _: 2
1661
1679
  }, 1032, ["type"]),
1662
- k(p) ? (_(), q(e(Ee), {
1680
+ W(g) ? (_(), q(e(Ee), {
1663
1681
  key: 1,
1664
- value: k(p)
1665
- }, null, 8, ["value"])) : L("", !0)
1682
+ value: W(g)
1683
+ }, null, 8, ["value"])) : K("", !0)
1666
1684
  ]),
1667
1685
  _: 2
1668
1686
  }, 1032, ["title", "image", "subtitle"])
1669
1687
  ]),
1670
- "card-actions": l(({ row: p }) => [
1671
- r(e(ze), {
1672
- actions: ge(p),
1673
- label: p.title
1688
+ "card-actions": i(({ row: g }) => [
1689
+ r(e(Ne), {
1690
+ actions: be(g),
1691
+ label: g.title
1674
1692
  }, null, 8, ["actions", "label"])
1675
1693
  ]),
1676
- "cell-actions": l(({ row: p }) => [
1677
- r(e(ze), {
1678
- actions: ge(p),
1679
- label: p.title
1694
+ "cell-actions": i(({ row: g }) => [
1695
+ r(e(Ne), {
1696
+ actions: be(g),
1697
+ label: g.title
1680
1698
  }, null, 8, ["actions", "label"])
1681
1699
  ]),
1682
1700
  _: 1
@@ -1686,58 +1704,58 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1686
1704
  }, 8, ["view", "title", "views", "actions"])
1687
1705
  ], 512));
1688
1706
  }
1689
- }), wa = /* @__PURE__ */ ve(ya, [["__scopeId", "data-v-5dfe798a"]]), xa = /* @__PURE__ */ ee({
1707
+ }), Aa = /* @__PURE__ */ fe(Ta, [["__scopeId", "data-v-5dfe798a"]]), Sa = /* @__PURE__ */ te({
1690
1708
  __name: "TagCreateDialog",
1691
- setup(h) {
1692
- const { open: c, resolve: v, dismiss: f } = Re(), a = ne(), s = ue(a);
1693
- te();
1694
- const t = Z("webx-blog"), o = M(""), i = M(""), d = M(!1), w = M({}), T = Ie("field");
1709
+ setup(b) {
1710
+ const { open: d, resolve: f, dismiss: c } = Re(), a = re(), s = de(a);
1711
+ ae();
1712
+ const t = j("webx-blog"), u = N(""), n = N(""), p = N(!1), w = N({}), k = Ie("field");
1695
1713
  Ue(async () => {
1696
- await He(), T.value?.querySelector("input")?.focus();
1714
+ await Ge(), k.value?.querySelector("input")?.focus();
1697
1715
  });
1698
1716
  async function A() {
1699
- if (!(o.value.trim() === "" || d.value)) {
1700
- d.value = !0, w.value = {};
1717
+ if (!(u.value.trim() === "" || p.value)) {
1718
+ p.value = !0, w.value = {};
1701
1719
  try {
1702
- v(
1720
+ f(
1703
1721
  await s.createTag({
1704
- title: o.value.trim(),
1705
- ...i.value.trim() === "" ? {} : { slug: i.value.trim() }
1722
+ title: u.value.trim(),
1723
+ ...n.value.trim() === "" ? {} : { slug: n.value.trim() }
1706
1724
  })
1707
1725
  );
1708
- } catch (y) {
1709
- w.value = y.body?.errors ?? {};
1726
+ } catch (v) {
1727
+ w.value = v.body?.errors ?? {};
1710
1728
  } finally {
1711
- d.value = !1;
1729
+ p.value = !1;
1712
1730
  }
1713
1731
  }
1714
1732
  }
1715
- return (y, S) => (_(), q(e(De), {
1716
- open: e(c),
1717
- "onUpdate:open": S[3] || (S[3] = (z) => Pe(c) ? c.value = z : null),
1733
+ return (v, $) => (_(), q(e(De), {
1734
+ open: e(d),
1735
+ "onUpdate:open": $[3] || ($[3] = (C) => Pe(d) ? d.value = C : null),
1718
1736
  title: e(t)("tag.new-title"),
1719
1737
  width: 440
1720
1738
  }, {
1721
- footer: l(() => [
1739
+ footer: i(() => [
1722
1740
  r(e(Be), { size: "sm" }, {
1723
- default: l(() => [
1724
- r(e(J), {
1741
+ default: i(() => [
1742
+ r(e(Y), {
1725
1743
  variant: "outline",
1726
- onClick: S[2] || (S[2] = (z) => e(f)())
1744
+ onClick: $[2] || ($[2] = (C) => e(c)())
1727
1745
  }, {
1728
- default: l(() => [
1729
- C($(e(t)("tag.cancel")), 1)
1746
+ default: i(() => [
1747
+ V(T(e(t)("tag.cancel")), 1)
1730
1748
  ]),
1731
1749
  _: 1
1732
1750
  }),
1733
- r(e(J), {
1751
+ r(e(Y), {
1734
1752
  type: "primary",
1735
- loading: d.value,
1736
- disabled: o.value.trim() === "",
1753
+ loading: p.value,
1754
+ disabled: u.value.trim() === "",
1737
1755
  onClick: A
1738
1756
  }, {
1739
- default: l(() => [
1740
- C($(e(t)("tag.create")), 1)
1757
+ default: i(() => [
1758
+ V(T(e(t)("tag.create")), 1)
1741
1759
  ]),
1742
1760
  _: 1
1743
1761
  }, 8, ["loading", "disabled"])
@@ -1745,20 +1763,20 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1745
1763
  _: 1
1746
1764
  })
1747
1765
  ]),
1748
- default: l(() => [
1749
- r(e(de), {
1766
+ default: i(() => [
1767
+ r(e(ve), {
1750
1768
  label: e(t)("tag.field-title"),
1751
1769
  error: w.value.title?.[0],
1752
1770
  required: ""
1753
1771
  }, {
1754
- default: l(() => [
1755
- F("div", {
1772
+ default: i(() => [
1773
+ H("div", {
1756
1774
  ref_key: "field",
1757
- ref: T
1775
+ ref: k
1758
1776
  }, [
1759
- r(e(Ce), {
1760
- modelValue: o.value,
1761
- "onUpdate:modelValue": S[0] || (S[0] = (z) => o.value = z),
1777
+ r(e(Ve), {
1778
+ modelValue: u.value,
1779
+ "onUpdate:modelValue": $[0] || ($[0] = (C) => u.value = C),
1762
1780
  "aria-label": e(t)("tag.field-title"),
1763
1781
  onKeyup: Me(A, ["enter"])
1764
1782
  }, null, 8, ["modelValue", "aria-label"])
@@ -1766,15 +1784,15 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1766
1784
  ]),
1767
1785
  _: 1
1768
1786
  }, 8, ["label", "error"]),
1769
- r(e(de), {
1787
+ r(e(ve), {
1770
1788
  label: e(t)("tag.field-slug"),
1771
1789
  error: w.value.slug?.[0],
1772
1790
  help: e(t)("tag.field-slug-help")
1773
1791
  }, {
1774
- default: l(() => [
1775
- r(e(Ce), {
1776
- modelValue: i.value,
1777
- "onUpdate:modelValue": S[1] || (S[1] = (z) => i.value = z),
1792
+ default: i(() => [
1793
+ r(e(Ve), {
1794
+ modelValue: n.value,
1795
+ "onUpdate:modelValue": $[1] || ($[1] = (C) => n.value = C),
1778
1796
  "aria-label": e(t)("tag.field-slug"),
1779
1797
  onKeyup: Me(A, ["enter"])
1780
1798
  }, null, 8, ["modelValue", "aria-label"])
@@ -1785,54 +1803,54 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1785
1803
  _: 1
1786
1804
  }, 8, ["open", "title"]));
1787
1805
  }
1788
- }), _a = ["id"], ka = /* @__PURE__ */ ee({
1806
+ }), Wa = ["id"], Ca = /* @__PURE__ */ te({
1789
1807
  __name: "TagRenameDialog",
1790
1808
  props: {
1791
1809
  name: {}
1792
1810
  },
1793
- setup(h) {
1794
- const c = h, { open: v, resolve: f, dismiss: a } = Re();
1795
- te();
1796
- const s = Z("webx-blog"), t = Z("webx-admin"), o = kt(), i = M(c.name), d = Ie("field");
1811
+ setup(b) {
1812
+ const d = b, { open: f, resolve: c, dismiss: a } = Re();
1813
+ ae();
1814
+ const s = j("webx-blog"), t = j("webx-admin"), u = Wt(), n = N(d.name), p = Ie("field");
1797
1815
  Ue(async () => {
1798
- await He();
1799
- const T = d.value?.querySelector("input");
1800
- T?.focus(), T?.select();
1816
+ await Ge();
1817
+ const k = p.value?.querySelector("input");
1818
+ k?.focus(), k?.select();
1801
1819
  });
1802
1820
  function w() {
1803
- const T = i.value.trim();
1804
- if (T === "" || T === c.name) {
1821
+ const k = n.value.trim();
1822
+ if (k === "" || k === d.name) {
1805
1823
  a();
1806
1824
  return;
1807
1825
  }
1808
- f(T);
1826
+ c(k);
1809
1827
  }
1810
- return (T, A) => (_(), q(e(De), {
1811
- open: e(v),
1812
- "onUpdate:open": A[2] || (A[2] = (y) => Pe(v) ? v.value = y : null),
1828
+ return (k, A) => (_(), q(e(De), {
1829
+ open: e(f),
1830
+ "onUpdate:open": A[2] || (A[2] = (v) => Pe(f) ? f.value = v : null),
1813
1831
  title: e(s)("tag.rename"),
1814
1832
  width: 420
1815
1833
  }, {
1816
- footer: l(() => [
1834
+ footer: i(() => [
1817
1835
  r(e(Be), { size: "sm" }, {
1818
- default: l(() => [
1819
- r(e(J), {
1836
+ default: i(() => [
1837
+ r(e(Y), {
1820
1838
  variant: "outline",
1821
- onClick: A[1] || (A[1] = (y) => e(a)())
1839
+ onClick: A[1] || (A[1] = (v) => e(a)())
1822
1840
  }, {
1823
- default: l(() => [
1824
- C($(e(s)("tag.cancel")), 1)
1841
+ default: i(() => [
1842
+ V(T(e(s)("tag.cancel")), 1)
1825
1843
  ]),
1826
1844
  _: 1
1827
1845
  }),
1828
- r(e(J), {
1846
+ r(e(Y), {
1829
1847
  type: "primary",
1830
1848
  "native-type": "submit",
1831
- form: e(o),
1832
- disabled: i.value.trim() === ""
1849
+ form: e(u),
1850
+ disabled: n.value.trim() === ""
1833
1851
  }, {
1834
- default: l(() => [
1835
- C($(e(t)("editor.save")), 1)
1852
+ default: i(() => [
1853
+ V(T(e(t)("editor.save")), 1)
1836
1854
  ]),
1837
1855
  _: 1
1838
1856
  }, 8, ["form", "disabled"])
@@ -1840,89 +1858,89 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1840
1858
  _: 1
1841
1859
  })
1842
1860
  ]),
1843
- default: l(() => [
1844
- F("form", {
1845
- id: e(o),
1861
+ default: i(() => [
1862
+ H("form", {
1863
+ id: e(u),
1846
1864
  ref_key: "field",
1847
- ref: d,
1848
- onSubmit: Ze(w, ["prevent"])
1865
+ ref: p,
1866
+ onSubmit: Xe(w, ["prevent"])
1849
1867
  }, [
1850
- r(e(de), {
1868
+ r(e(ve), {
1851
1869
  label: e(s)("tag.field-title"),
1852
1870
  required: ""
1853
1871
  }, {
1854
- default: l(() => [
1855
- r(e(Ce), {
1856
- modelValue: i.value,
1857
- "onUpdate:modelValue": A[0] || (A[0] = (y) => i.value = y),
1872
+ default: i(() => [
1873
+ r(e(Ve), {
1874
+ modelValue: n.value,
1875
+ "onUpdate:modelValue": A[0] || (A[0] = (v) => n.value = v),
1858
1876
  "aria-label": e(s)("tag.field-title"),
1859
- onKeydown: Me(Ze(w, ["prevent"]), ["enter"])
1877
+ onKeydown: Me(Xe(w, ["prevent"]), ["enter"])
1860
1878
  }, null, 8, ["modelValue", "aria-label", "onKeydown"])
1861
1879
  ]),
1862
1880
  _: 1
1863
1881
  }, 8, ["label"])
1864
- ], 40, _a)
1882
+ ], 40, Wa)
1865
1883
  ]),
1866
1884
  _: 1
1867
1885
  }, 8, ["open", "title"]));
1868
1886
  }
1869
- }), $a = { class: "wx-tag-merge" }, Ta = { class: "wx-tag-merge__chips" }, Aa = { class: "wx-tag-merge__redirect" }, Sa = /* @__PURE__ */ ee({
1887
+ }), Va = { class: "wx-tag-merge" }, za = { class: "wx-tag-merge__chips" }, Na = { class: "wx-tag-merge__redirect" }, Ma = /* @__PURE__ */ te({
1870
1888
  __name: "TagMergeDialog",
1871
1889
  props: {
1872
1890
  tags: {}
1873
1891
  },
1874
- setup(h) {
1875
- const c = h, { open: v, resolve: f, dismiss: a } = Re(), s = ne(), t = ue(s);
1876
- te();
1877
- const o = Z("webx-blog"), i = he(), d = M(
1878
- [...c.tags].sort((W, U) => U.articles_count - W.articles_count)[0]?.id ?? 0
1879
- ), w = M(!1), T = M(!0), A = M(null), y = b(
1880
- () => c.tags.map((W) => ({ value: W.id, label: `${W.title} · ${W.articles_count}` }))
1881
- ), S = b(() => c.tags.find((W) => W.id === d.value) ?? null), z = b(() => c.tags.filter((W) => W.id !== d.value)), E = b(() => z.value.reduce((W, U) => W + U.articles_count, 0)), R = b(() => z.value.map((W) => W.path).filter(Boolean));
1892
+ setup(b) {
1893
+ const d = b, { open: f, resolve: c, dismiss: a } = Re(), s = re(), t = de(s);
1894
+ ae();
1895
+ const u = j("webx-blog"), n = me(), p = N(
1896
+ [...d.tags].sort((S, U) => U.articles_count - S.articles_count)[0]?.id ?? 0
1897
+ ), w = N(!1), k = N(!0), A = N(null), v = y(
1898
+ () => d.tags.map((S) => ({ value: S.id, label: `${S.title} · ${S.articles_count}` }))
1899
+ ), $ = y(() => d.tags.find((S) => S.id === p.value) ?? null), C = y(() => d.tags.filter((S) => S.id !== p.value)), B = y(() => C.value.reduce((S, U) => S + U.articles_count, 0)), R = y(() => C.value.map((S) => S.path).filter(Boolean));
1882
1900
  async function x() {
1883
- if (!(S.value === null || z.value.length === 0 || w.value)) {
1901
+ if (!($.value === null || C.value.length === 0 || w.value)) {
1884
1902
  w.value = !0, A.value = null;
1885
1903
  try {
1886
- f(
1904
+ c(
1887
1905
  await t.mergeTags(
1888
- z.value.map((W) => W.id),
1889
- d.value,
1890
- T.value
1906
+ C.value.map((S) => S.id),
1907
+ p.value,
1908
+ k.value
1891
1909
  )
1892
1910
  );
1893
- } catch (W) {
1894
- A.value = i(W);
1911
+ } catch (S) {
1912
+ A.value = n(S);
1895
1913
  } finally {
1896
1914
  w.value = !1;
1897
1915
  }
1898
1916
  }
1899
1917
  }
1900
- return (W, U) => (_(), q(e(De), {
1901
- open: e(v),
1902
- "onUpdate:open": U[3] || (U[3] = (I) => Pe(v) ? v.value = I : null),
1903
- title: e(o)("tag.merge-title"),
1918
+ return (S, U) => (_(), q(e(De), {
1919
+ open: e(f),
1920
+ "onUpdate:open": U[3] || (U[3] = (I) => Pe(f) ? f.value = I : null),
1921
+ title: e(u)("tag.merge-title"),
1904
1922
  width: 520
1905
1923
  }, {
1906
- footer: l(() => [
1924
+ footer: i(() => [
1907
1925
  r(e(Be), { size: "sm" }, {
1908
- default: l(() => [
1909
- r(e(J), {
1926
+ default: i(() => [
1927
+ r(e(Y), {
1910
1928
  variant: "outline",
1911
1929
  onClick: U[2] || (U[2] = (I) => e(a)())
1912
1930
  }, {
1913
- default: l(() => [
1914
- C($(e(o)("tag.cancel")), 1)
1931
+ default: i(() => [
1932
+ V(T(e(u)("tag.cancel")), 1)
1915
1933
  ]),
1916
1934
  _: 1
1917
1935
  }),
1918
- r(e(J), {
1936
+ r(e(Y), {
1919
1937
  type: "primary",
1920
1938
  loading: w.value,
1921
- disabled: z.value.length === 0,
1939
+ disabled: C.value.length === 0,
1922
1940
  onClick: x
1923
1941
  }, {
1924
- default: l(() => [
1925
- C($(e(o)("tag.merge-confirm")), 1)
1942
+ default: i(() => [
1943
+ V(T(e(u)("tag.merge-confirm")), 1)
1926
1944
  ]),
1927
1945
  _: 1
1928
1946
  }, 8, ["loading", "disabled"])
@@ -1930,106 +1948,106 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
1930
1948
  _: 1
1931
1949
  })
1932
1950
  ]),
1933
- default: l(() => [
1934
- F("div", $a, [
1935
- F("div", Ta, [
1936
- (_(!0), j(_e, null, qe(z.value, (I) => (_(), q(e(ie), {
1951
+ default: i(() => [
1952
+ H("div", Va, [
1953
+ H("div", za, [
1954
+ (_(!0), J(_e, null, qe(C.value, (I) => (_(), q(e(se), {
1937
1955
  key: I.id,
1938
1956
  size: "sm",
1939
1957
  round: ""
1940
1958
  }, {
1941
- default: l(() => [
1942
- C($(I.title) + " · " + $(I.articles_count), 1)
1959
+ default: i(() => [
1960
+ V(T(I.title) + " · " + T(I.articles_count), 1)
1943
1961
  ]),
1944
1962
  _: 2
1945
1963
  }, 1024))), 128)),
1946
- r(e(Te), {
1964
+ r(e(Se), {
1947
1965
  name: "arrow-right",
1948
1966
  size: "sm"
1949
1967
  }),
1950
- S.value ? (_(), q(e(ie), {
1968
+ $.value ? (_(), q(e(se), {
1951
1969
  key: 0,
1952
1970
  type: "primary",
1953
1971
  size: "sm",
1954
1972
  round: ""
1955
1973
  }, {
1956
- default: l(() => [
1957
- C($(S.value.title) + " · " + $(S.value.articles_count), 1)
1974
+ default: i(() => [
1975
+ V(T($.value.title) + " · " + T($.value.articles_count), 1)
1958
1976
  ]),
1959
1977
  _: 1
1960
- })) : L("", !0)
1978
+ })) : K("", !0)
1961
1979
  ]),
1962
- r(e(de), {
1963
- label: e(o)("tag.merge-keep")
1980
+ r(e(ve), {
1981
+ label: e(u)("tag.merge-keep")
1964
1982
  }, {
1965
- default: l(() => [
1983
+ default: i(() => [
1966
1984
  r(e(xe), {
1967
- modelValue: d.value,
1968
- "onUpdate:modelValue": U[0] || (U[0] = (I) => d.value = I),
1969
- options: y.value,
1970
- "aria-label": e(o)("tag.merge-keep")
1985
+ modelValue: p.value,
1986
+ "onUpdate:modelValue": U[0] || (U[0] = (I) => p.value = I),
1987
+ options: v.value,
1988
+ "aria-label": e(u)("tag.merge-keep")
1971
1989
  }, null, 8, ["modelValue", "options", "aria-label"])
1972
1990
  ]),
1973
1991
  _: 1
1974
1992
  }, 8, ["label"]),
1975
- F("div", Aa, [
1976
- r(e(Mt), {
1977
- modelValue: T.value,
1978
- "onUpdate:modelValue": U[1] || (U[1] = (I) => T.value = I),
1979
- label: e(o)("tag.merge-redirect")
1993
+ H("div", Na, [
1994
+ r(e(Pt), {
1995
+ modelValue: k.value,
1996
+ "onUpdate:modelValue": U[1] || (U[1] = (I) => k.value = I),
1997
+ label: e(u)("tag.merge-redirect")
1980
1998
  }, null, 8, ["modelValue", "label"]),
1981
- r(e(le), {
1999
+ r(e(ne), {
1982
2000
  size: "sm",
1983
2001
  tone: "muted"
1984
2002
  }, {
1985
- default: l(() => [
1986
- C($(R.value.length === 0 ? e(o)("tag.merge-redirect-none") : e(o)("tag.merge-redirect-help", { addresses: R.value.join(", ") })), 1)
2003
+ default: i(() => [
2004
+ V(T(R.value.length === 0 ? e(u)("tag.merge-redirect-none") : e(u)("tag.merge-redirect-help", { addresses: R.value.join(", ") })), 1)
1987
2005
  ]),
1988
2006
  _: 1
1989
2007
  })
1990
2008
  ]),
1991
- r(e(Ne), {
2009
+ r(e(Le), {
1992
2010
  type: "warning",
1993
2011
  variant: "soft",
1994
- description: e(o)("tag.merge-warning", {
1995
- count: E.value,
1996
- tag: S.value?.title ?? "",
1997
- merged: z.value.length
2012
+ description: e(u)("tag.merge-warning", {
2013
+ count: B.value,
2014
+ tag: $.value?.title ?? "",
2015
+ merged: C.value.length
1998
2016
  })
1999
2017
  }, null, 8, ["description"]),
2000
- A.value ? (_(), q(e(Ne), {
2018
+ A.value ? (_(), q(e(Le), {
2001
2019
  key: 0,
2002
2020
  type: "danger",
2003
2021
  variant: "soft",
2004
2022
  description: A.value
2005
- }, null, 8, ["description"])) : L("", !0)
2023
+ }, null, 8, ["description"])) : K("", !0)
2006
2024
  ])
2007
2025
  ]),
2008
2026
  _: 1
2009
2027
  }, 8, ["open", "title"]));
2010
2028
  }
2011
- }), Wa = /* @__PURE__ */ ve(Sa, [["__scopeId", "data-v-aa68b3a8"]]), Ca = { class: "wx-tags" }, Va = /* @__PURE__ */ ee({
2029
+ }), Ua = /* @__PURE__ */ fe(Ma, [["__scopeId", "data-v-aa68b3a8"]]), qa = { class: "wx-tags" }, Ia = /* @__PURE__ */ te({
2012
2030
  __name: "TagsPage",
2013
2031
  props: {
2014
2032
  base: { default: "/blog" }
2015
2033
  },
2016
- setup(h) {
2017
- const c = h, v = ne(), f = ue(v), a = Ge(), s = je();
2018
- te();
2019
- const t = Z("webx-blog"), o = Z("webx-admin"), i = he(), d = M(null), w = M(!0), T = M([]), A = M(!1), y = Ve(ka), S = Ve(xa), z = Ve(Wa), E = b(() => v.can("blog.taxonomy.manage")), R = b(
2020
- () => v.state.manifest?.modules.find((u) => u.id === "tags")?.title ?? t("module.tags")
2021
- ), x = b({
2034
+ setup(b) {
2035
+ const d = b, f = re(), c = de(f), a = Je(), s = je();
2036
+ ae();
2037
+ const t = j("webx-blog"), u = j("webx-admin"), n = me(), p = N(null), w = N(!0), k = N([]), A = N(!1), v = ze(Ca), $ = ze(Sa), C = ze(Ua), B = y(() => f.can("blog.taxonomy.manage")), R = y(
2038
+ () => f.state.manifest?.modules.find((o) => o.id === "tags")?.title ?? t("module.tags")
2039
+ ), x = y({
2022
2040
  get: () => typeof a.query.view == "string" ? a.query.view : "",
2023
- set: (u) => {
2041
+ set: (o) => {
2024
2042
  s.replace({
2025
- query: { ...a.query, view: u === "" ? void 0 : String(u), page: void 0 }
2043
+ query: { ...a.query, view: o === "" ? void 0 : String(o), page: void 0 }
2026
2044
  });
2027
2045
  }
2028
- }), W = b(() => d.value?.filters ?? { total: 0, empty: 0, noindex: 0 }), U = b(() => [
2029
- { value: "", label: t("tag.view-all"), badge: W.value.total },
2030
- { value: "empty", label: t("tag.view-empty"), badge: W.value.empty },
2031
- { value: "noindex", label: t("tag.view-noindex"), badge: W.value.noindex }
2032
- ]), I = b(() => d.value?.data ?? []), g = b(() => I.value.filter((u) => T.value.includes(u.id))), B = b(() => [
2046
+ }), S = y(() => p.value?.filters ?? { total: 0, empty: 0, noindex: 0 }), U = y(() => [
2047
+ { value: "", label: t("tag.view-all"), badge: S.value.total },
2048
+ { value: "empty", label: t("tag.view-empty"), badge: S.value.empty },
2049
+ { value: "noindex", label: t("tag.view-noindex"), badge: S.value.noindex }
2050
+ ]), I = y(() => p.value?.data ?? []), h = y(() => I.value.filter((o) => k.value.includes(o.id))), E = y(() => [
2033
2051
  { key: "title", label: t("tag.column-title"), minWidth: 150, sortable: !0 },
2034
2052
  // The number is what the other columns and the narrowest the title may be add up to without
2035
2053
  // this one: below it the address is what does not fit, and a fixed table does not shrink —
@@ -2047,97 +2065,97 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
2047
2065
  // at 180px of text, and a cell keeps 32 of its own. Narrower, the ruled row wrapped and
2048
2066
  // stood eighteen pixels taller than the ones around it.
2049
2067
  { key: "indexing", label: t("tag.column-indexing"), width: 230, hideBelow: 560 },
2050
- { key: "actions", label: "", width: et, align: "right" }
2068
+ { key: "actions", label: "", width: at, align: "right" }
2051
2069
  ]);
2052
- function D(u) {
2070
+ function L(o) {
2053
2071
  return {
2054
- q: u?.search ?? (typeof a.query.q == "string" ? a.query.q : ""),
2072
+ q: o?.search ?? (typeof a.query.q == "string" ? a.query.q : ""),
2055
2073
  empty: x.value === "empty",
2056
2074
  noindex: x.value === "noindex",
2057
2075
  // Only when it is not the default: most used first is what the list is, and a query
2058
2076
  // string that repeats the default is a link that outlives a change of mind about it.
2059
- sort: me(u),
2060
- page: u?.page ?? (Number(a.query.page ?? 1) || 1),
2061
- per_page: u?.perPage
2077
+ sort: ee(o),
2078
+ page: o?.page ?? (Number(a.query.page ?? 1) || 1),
2079
+ per_page: o?.perPage
2062
2080
  };
2063
2081
  }
2064
- async function H(u) {
2082
+ async function Z(o) {
2065
2083
  w.value = !0;
2066
2084
  try {
2067
- d.value = await f.tagsPage(D(u));
2068
- } catch (V) {
2069
- P.danger(i(V));
2085
+ p.value = await c.tagsPage(L(o));
2086
+ } catch (M) {
2087
+ P.danger(n(M));
2070
2088
  } finally {
2071
2089
  w.value = !1;
2072
2090
  }
2073
2091
  }
2074
- function me(u) {
2075
- const V = u?.sort ?? Q();
2076
- if (!V) return;
2077
- const k = V.key === "title" ? "name" : "articles", ae = `${V.order === "desc" ? "-" : ""}${k}`;
2078
- return ae === "articles" ? void 0 : ae;
2092
+ function ee(o) {
2093
+ const M = o?.sort ?? O();
2094
+ if (!M) return;
2095
+ const W = M.key === "title" ? "name" : "articles", G = `${M.order === "desc" ? "-" : ""}${W}`;
2096
+ return G === "articles" ? void 0 : G;
2079
2097
  }
2080
- function Q() {
2081
- const u = typeof a.query.sort == "string" ? a.query.sort : "";
2082
- if (u === "") return null;
2083
- const V = u.startsWith("-");
2084
- return { key: (V ? u.slice(1) : u) === "name" ? "title" : "articles_count", order: V ? "desc" : "asc" };
2098
+ function O() {
2099
+ const o = typeof a.query.sort == "string" ? a.query.sort : "";
2100
+ if (o === "") return null;
2101
+ const M = o.startsWith("-");
2102
+ return { key: (M ? o.slice(1) : o) === "name" ? "title" : "articles_count", order: M ? "desc" : "asc" };
2085
2103
  }
2086
- function ke(u) {
2087
- const V = {
2104
+ function oe(o) {
2105
+ const M = {
2088
2106
  ...a.query,
2089
- q: u.search === "" ? void 0 : u.search,
2090
- sort: me(u),
2091
- page: u.page === 1 ? void 0 : String(u.page)
2107
+ q: o.search === "" ? void 0 : o.search,
2108
+ sort: ee(o),
2109
+ page: o.page === 1 ? void 0 : String(o.page)
2092
2110
  };
2093
- s.replace({ query: V }), H(u);
2111
+ s.replace({ query: M }), Z(o);
2094
2112
  }
2095
- pe(x, () => {
2096
- T.value = [], H();
2097
- }), H();
2098
- async function X() {
2099
- await S({}) && await H();
2113
+ ge(x, () => {
2114
+ k.value = [], Z();
2115
+ }), Z();
2116
+ async function ie() {
2117
+ await $({}) && await Z();
2100
2118
  }
2101
- async function G(u) {
2102
- const V = await y({ name: u.title });
2103
- V && await ge(u, { title: V }, t("tag.renamed"));
2119
+ async function le(o) {
2120
+ const M = await v({ name: o.title });
2121
+ M && await be(o, { title: M }, t("tag.renamed"));
2104
2122
  }
2105
- async function $e(u, V) {
2106
- await ge(u, { noindex: V }, t(V ? "tag.kept-out" : "tag.indexed"));
2123
+ async function Q(o, M) {
2124
+ await be(o, { noindex: M }, t(M ? "tag.kept-out" : "tag.indexed"));
2107
2125
  }
2108
- async function ge(u, V, k) {
2126
+ async function be(o, M, W) {
2109
2127
  try {
2110
- const ae = await f.saveTag(u.id, V);
2111
- d.value && (d.value = {
2112
- ...d.value,
2113
- data: d.value.data.map((n) => n.id === ae.id ? ae : n)
2114
- }), P.success(k);
2115
- } catch (ae) {
2116
- P.danger(i(ae));
2128
+ const G = await c.saveTag(o.id, M);
2129
+ p.value && (p.value = {
2130
+ ...p.value,
2131
+ data: p.value.data.map((l) => l.id === G.id ? G : l)
2132
+ }), P.success(W);
2133
+ } catch (G) {
2134
+ P.danger(n(G));
2117
2135
  }
2118
2136
  }
2119
- async function ce(u) {
2120
- if (await oe({
2121
- title: t("tag.delete-title", { title: u.title }),
2122
- message: u.articles_count > 0 ? t("tag.delete-text-used", { count: u.articles_count }) : t("tag.delete-text"),
2137
+ async function ke(o) {
2138
+ if (await pe({
2139
+ title: t("tag.delete-title", { title: o.title }),
2140
+ message: o.articles_count > 0 ? t("tag.delete-text-used", { count: o.articles_count }) : t("tag.delete-text"),
2123
2141
  confirmText: t("tag.delete"),
2124
2142
  cancelText: t("tag.cancel"),
2125
2143
  tone: "danger"
2126
2144
  }))
2127
2145
  try {
2128
- await f.removeTag(u.id), P.success(t("tag.deleted")), T.value = T.value.filter((k) => k !== u.id), await H();
2129
- } catch (k) {
2130
- P.danger(i(k));
2146
+ await c.removeTag(o.id), P.success(t("tag.deleted")), k.value = k.value.filter((W) => W !== o.id), await Z();
2147
+ } catch (W) {
2148
+ P.danger(n(W));
2131
2149
  }
2132
2150
  }
2133
- const fe = b(() => [
2151
+ const ce = y(() => [
2134
2152
  {
2135
2153
  key: "index",
2136
2154
  icon: "eye",
2137
2155
  label: t("tag.index"),
2138
2156
  disabled: A.value,
2139
2157
  run: () => {
2140
- Y("index");
2158
+ X("index");
2141
2159
  }
2142
2160
  },
2143
2161
  {
@@ -2146,7 +2164,7 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
2146
2164
  label: t("tag.noindex"),
2147
2165
  disabled: A.value,
2148
2166
  run: () => {
2149
- Y("noindex");
2167
+ X("noindex");
2150
2168
  }
2151
2169
  },
2152
2170
  {
@@ -2156,71 +2174,71 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
2156
2174
  danger: !0,
2157
2175
  disabled: A.value,
2158
2176
  run: () => {
2159
- Y("delete");
2177
+ X("delete");
2160
2178
  }
2161
2179
  }
2162
2180
  ]);
2163
- function Se(u) {
2164
- if (!E.value) return [];
2165
- const V = [
2181
+ function he(o) {
2182
+ if (!B.value) return [];
2183
+ const M = [
2166
2184
  { key: "rename", icon: "edit", label: t("tag.rename"), run: () => {
2167
- G(u);
2185
+ le(o);
2168
2186
  } }
2169
2187
  ];
2170
- return u.url && V.push({
2188
+ return o.url && M.push({
2171
2189
  key: "site",
2172
2190
  icon: "external-link",
2173
2191
  label: t("tag.open-on-site"),
2174
- href: u.url
2175
- }), V.push({
2192
+ href: o.url
2193
+ }), M.push({
2176
2194
  key: "articles",
2177
2195
  icon: "list",
2178
2196
  label: t("tag.show-articles"),
2179
2197
  run: () => {
2180
- s.push({ path: `${c.base}/articles`, query: { tag: String(u.id) } });
2198
+ s.push({ path: `${d.base}/articles`, query: { tag: String(o.id) } });
2181
2199
  }
2182
- }), V.push(
2183
- u.noindex ? {
2200
+ }), M.push(
2201
+ o.noindex ? {
2184
2202
  key: "index",
2185
2203
  icon: "eye",
2186
2204
  label: t("tag.index"),
2187
2205
  run: () => {
2188
- $e(u, !1);
2206
+ Q(o, !1);
2189
2207
  }
2190
2208
  } : {
2191
2209
  key: "noindex",
2192
2210
  icon: "eye-off",
2193
2211
  label: t("tag.noindex"),
2194
2212
  run: () => {
2195
- $e(u, !0);
2213
+ Q(o, !0);
2196
2214
  }
2197
2215
  }
2198
- ), V.push({
2216
+ ), M.push({
2199
2217
  key: "delete",
2200
2218
  icon: "trash",
2201
2219
  label: t("tag.delete"),
2202
2220
  danger: !0,
2203
2221
  run: () => {
2204
- ce(u);
2222
+ ke(o);
2205
2223
  }
2206
- }), V;
2224
+ }), M;
2207
2225
  }
2208
- function be(u) {
2209
- return u === "noindex" ? "muted" : "success";
2226
+ function $e(o) {
2227
+ return o === "noindex" ? "muted" : "success";
2210
2228
  }
2211
- async function se() {
2212
- if (g.value.length < 2) return;
2213
- const u = await z({ tags: g.value });
2214
- u && (P.success(t("tag.merged", { tag: u.tag.title, count: u.articles_count })), T.value = [], await H());
2229
+ async function Te() {
2230
+ if (h.value.length < 2) return;
2231
+ const o = await C({ tags: h.value });
2232
+ o && (P.success(t("tag.merged", { tag: o.tag.title, count: o.articles_count })), k.value = [], await Z());
2215
2233
  }
2216
- async function Y(u) {
2217
- const V = g.value.map((k) => k.id);
2218
- if (!(V.length === 0 || A.value)) {
2219
- if (u === "delete") {
2220
- const k = g.value.reduce((n, N) => n + N.articles_count, 0);
2221
- if (!await oe({
2222
- title: t("tag.delete-many-title", { count: V.length }),
2223
- message: k > 0 ? t("tag.delete-many-text-used", { count: k }) : t("tag.delete-many-text"),
2234
+ async function X(o) {
2235
+ const M = h.value.map((W) => W.id);
2236
+ if (!(M.length === 0 || A.value)) {
2237
+ if (o === "delete") {
2238
+ const W = h.value.reduce((l, z) => l + z.articles_count, 0);
2239
+ if (!await pe({
2240
+ title: t("tag.delete-many-title", { count: M.length }),
2241
+ message: W > 0 ? t("tag.delete-many-text-used", { count: W }) : t("tag.delete-many-text"),
2224
2242
  confirmText: t("tag.delete"),
2225
2243
  cancelText: t("tag.cancel"),
2226
2244
  tone: "danger"
@@ -2228,114 +2246,114 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
2228
2246
  }
2229
2247
  A.value = !0;
2230
2248
  try {
2231
- const k = await f.massTags(V, u);
2249
+ const W = await c.massTags(M, o);
2232
2250
  P.success(
2233
- u === "delete" ? t("tag.deleted-many", { count: k }) : u === "index" ? t("tag.indexed-many", { count: k }) : t("tag.kept-out-many", { count: k })
2234
- ), T.value = [], await H();
2235
- } catch (k) {
2236
- P.danger(i(k));
2251
+ o === "delete" ? t("tag.deleted-many", { count: W }) : o === "index" ? t("tag.indexed-many", { count: W }) : t("tag.kept-out-many", { count: W })
2252
+ ), k.value = [], await Z();
2253
+ } catch (W) {
2254
+ P.danger(n(W));
2237
2255
  } finally {
2238
2256
  A.value = !1;
2239
2257
  }
2240
2258
  }
2241
2259
  }
2242
- const We = b(
2243
- () => E.value ? [{ key: "new", label: t("tag.new"), icon: "plus", primary: !0, run: () => {
2244
- X();
2260
+ const Ce = y(
2261
+ () => B.value ? [{ key: "new", label: t("tag.new"), icon: "plus", primary: !0, run: () => {
2262
+ ie();
2245
2263
  } }] : []
2246
2264
  );
2247
- return (u, V) => (_(), j("div", Ca, [
2248
- r(e(tt), {
2265
+ return (o, M) => (_(), J("div", qa, [
2266
+ r(e(lt), {
2249
2267
  view: x.value,
2250
- "onUpdate:view": V[1] || (V[1] = (k) => x.value = k),
2268
+ "onUpdate:view": M[1] || (M[1] = (W) => x.value = W),
2251
2269
  title: R.value,
2252
2270
  views: U.value,
2253
- actions: We.value
2271
+ actions: Ce.value
2254
2272
  }, {
2255
- default: l(() => [
2256
- r(e(nt), {
2257
- selected: T.value,
2258
- "onUpdate:selected": V[0] || (V[0] = (k) => T.value = k),
2259
- data: d.value,
2260
- columns: B.value,
2273
+ default: i(() => [
2274
+ r(e(rt), {
2275
+ selected: k.value,
2276
+ "onUpdate:selected": M[0] || (M[0] = (W) => k.value = W),
2277
+ data: p.value,
2278
+ columns: E.value,
2261
2279
  "row-key": "id",
2262
2280
  searchable: "",
2263
2281
  hover: "",
2264
2282
  flush: "",
2265
2283
  layout: "fixed",
2266
2284
  loading: w.value,
2267
- selectable: E.value,
2268
- "select-row-label": e(o)("filters.select-row"),
2269
- "select-all-label": e(o)("filters.select-all"),
2285
+ selectable: B.value,
2286
+ "select-row-label": e(u)("filters.select-row"),
2287
+ "select-all-label": e(u)("filters.select-all"),
2270
2288
  "cards-below": 0,
2271
2289
  "search-placeholder": e(t)("tag.search"),
2272
2290
  "empty-text": I.value.length === 0 && !w.value ? e(t)("tag.empty") : void 0,
2273
2291
  "aria-label": R.value,
2274
- onStateChange: ke
2292
+ onStateChange: oe
2275
2293
  }, {
2276
- "cell-title": l(({ row: k }) => [
2277
- r(e(le), { truncate: "" }, {
2278
- default: l(() => [
2279
- C($(k.title), 1)
2294
+ "cell-title": i(({ row: W }) => [
2295
+ r(e(ne), { truncate: "" }, {
2296
+ default: i(() => [
2297
+ V(T(W.title), 1)
2280
2298
  ]),
2281
2299
  _: 2
2282
2300
  }, 1024)
2283
2301
  ]),
2284
- "cell-path": l(({ row: k }) => [
2285
- r(e(le), {
2302
+ "cell-path": i(({ row: W }) => [
2303
+ r(e(ne), {
2286
2304
  size: "sm",
2287
2305
  tone: "muted",
2288
2306
  mono: "",
2289
2307
  truncate: ""
2290
2308
  }, {
2291
- default: l(() => [
2292
- C($(k.path ?? e(t)("tag.no-address")), 1)
2309
+ default: i(() => [
2310
+ V(T(W.path ?? e(t)("tag.no-address")), 1)
2293
2311
  ]),
2294
2312
  _: 2
2295
2313
  }, 1024)
2296
2314
  ]),
2297
- "cell-articles_count": l(({ row: k }) => [
2298
- r(e(le), {
2299
- tone: k.articles_count === 0 ? "muted" : "default"
2315
+ "cell-articles_count": i(({ row: W }) => [
2316
+ r(e(ne), {
2317
+ tone: W.articles_count === 0 ? "muted" : "default"
2300
2318
  }, {
2301
- default: l(() => [
2302
- C($(k.articles_count), 1)
2319
+ default: i(() => [
2320
+ V(T(W.articles_count), 1)
2303
2321
  ]),
2304
2322
  _: 2
2305
2323
  }, 1032, ["tone"])
2306
2324
  ]),
2307
- "cell-indexing": l(({ row: k }) => [
2308
- k.indexing === "rule" ? (_(), q(e(st), {
2325
+ "cell-indexing": i(({ row: W }) => [
2326
+ W.indexing === "rule" ? (_(), q(e(ot), {
2309
2327
  key: 0,
2310
2328
  content: e(t)("tag.indexing-rule-help")
2311
2329
  }, {
2312
- default: l(() => [
2313
- r(e(le), {
2330
+ default: i(() => [
2331
+ r(e(ne), {
2314
2332
  size: "sm",
2315
- tone: be(k.indexing)
2333
+ tone: $e(W.indexing)
2316
2334
  }, {
2317
- default: l(() => [
2318
- C($(e(t)("tag.indexing-rule")), 1)
2335
+ default: i(() => [
2336
+ V(T(e(t)("tag.indexing-rule")), 1)
2319
2337
  ]),
2320
2338
  _: 1
2321
2339
  }, 8, ["tone"])
2322
2340
  ]),
2323
2341
  _: 2
2324
- }, 1032, ["content"])) : (_(), q(e(le), {
2342
+ }, 1032, ["content"])) : (_(), q(e(ne), {
2325
2343
  key: 1,
2326
2344
  size: "sm",
2327
- tone: be(k.indexing)
2345
+ tone: $e(W.indexing)
2328
2346
  }, {
2329
- default: l(() => [
2330
- C($(e(t)(`tag.indexing-${k.indexing}`)), 1)
2347
+ default: i(() => [
2348
+ V(T(e(t)(`tag.indexing-${W.indexing}`)), 1)
2331
2349
  ]),
2332
2350
  _: 2
2333
2351
  }, 1032, ["tone"]))
2334
2352
  ]),
2335
- "cell-actions": l(({ row: k }) => [
2336
- r(e(ze), {
2337
- actions: Se(k),
2338
- label: k.title
2353
+ "cell-actions": i(({ row: W }) => [
2354
+ r(e(Ne), {
2355
+ actions: he(W),
2356
+ label: W.title
2339
2357
  }, null, 8, ["actions", "label"])
2340
2358
  ]),
2341
2359
  _: 1
@@ -2343,54 +2361,54 @@ const Rt = { class: "wx-article-editor__screen" }, Dt = 1200, Bt = /* @__PURE__
2343
2361
  ]),
2344
2362
  _: 1
2345
2363
  }, 8, ["view", "title", "views", "actions"]),
2346
- g.value.length > 0 ? (_(), q(e(it), {
2364
+ h.value.length > 0 ? (_(), q(e(st), {
2347
2365
  key: 0,
2348
2366
  class: "wx-tags__bar",
2349
2367
  sticky: ""
2350
2368
  }, {
2351
- state: l(() => [
2352
- r(e(le), { weight: "medium" }, {
2353
- default: l(() => [
2354
- C($(e(t)("tag.selected", { count: g.value.length })), 1)
2369
+ state: i(() => [
2370
+ r(e(ne), { weight: "medium" }, {
2371
+ default: i(() => [
2372
+ V(T(e(t)("tag.selected", { count: h.value.length })), 1)
2355
2373
  ]),
2356
2374
  _: 1
2357
2375
  })
2358
2376
  ]),
2359
- default: l(() => [
2360
- r(e(J), {
2377
+ default: i(() => [
2378
+ r(e(Y), {
2361
2379
  type: "primary",
2362
- disabled: g.value.length < 2 || A.value,
2363
- onClick: se
2380
+ disabled: h.value.length < 2 || A.value,
2381
+ onClick: Te
2364
2382
  }, {
2365
- icon: l(() => [
2366
- r(e(Te), { name: "link" })
2383
+ icon: i(() => [
2384
+ r(e(Se), { name: "link" })
2367
2385
  ]),
2368
- default: l(() => [
2369
- C(" " + $(e(t)("tag.merge")), 1)
2386
+ default: i(() => [
2387
+ V(" " + T(e(t)("tag.merge")), 1)
2370
2388
  ]),
2371
2389
  _: 1
2372
2390
  }, 8, ["disabled"]),
2373
- r(e(ze), {
2391
+ r(e(Ne), {
2374
2392
  size: "lg",
2375
- actions: fe.value,
2376
- label: e(t)("tag.selected", { count: g.value.length })
2393
+ actions: ce.value,
2394
+ label: e(t)("tag.selected", { count: h.value.length })
2377
2395
  }, null, 8, ["actions", "label"])
2378
2396
  ]),
2379
2397
  _: 1
2380
- })) : L("", !0)
2398
+ })) : K("", !0)
2381
2399
  ]));
2382
2400
  }
2383
- }), za = /* @__PURE__ */ ve(Va, [["__scopeId", "data-v-d9b8d73d"]]);
2384
- function Ma(h = "/blog") {
2401
+ }), Pa = /* @__PURE__ */ fe(Ia, [["__scopeId", "data-v-d9b8d73d"]]);
2402
+ function Ra(b = "/blog") {
2385
2403
  return {
2386
2404
  api: "blog/rubrics",
2387
- path: `${h}/rubrics`,
2405
+ path: `${b}/rubrics`,
2388
2406
  name: "webx.blog.rubrics",
2389
2407
  module: "rubrics",
2390
2408
  screen: "blog.category-form",
2391
2409
  manage: "blog.taxonomy.manage",
2392
2410
  count: "articles_count",
2393
- items: (c) => ({ path: `${h}/articles`, query: { rubric: String(c) } }),
2411
+ items: (d) => ({ path: `${b}/articles`, query: { rubric: String(d) } }),
2394
2412
  words: {
2395
2413
  new: "webx-blog::rubric.new",
2396
2414
  empty: "webx-blog::rubric.empty",
@@ -2410,26 +2428,26 @@ function Ma(h = "/blog") {
2410
2428
  }
2411
2429
  };
2412
2430
  }
2413
- function Da(h = {}) {
2414
- const c = h.path ?? "/blog";
2431
+ function Ka(b = {}) {
2432
+ const d = b.path ?? "/blog";
2415
2433
  return [
2416
2434
  {
2417
2435
  id: "articles",
2418
- path: `${c}/articles`,
2436
+ path: `${d}/articles`,
2419
2437
  routes: [
2420
2438
  // The section's own path travels as a prop, so a panel that mounted the blog somewhere
2421
2439
  // else still links between its screens correctly.
2422
2440
  {
2423
- path: `${c}/articles`,
2441
+ path: `${d}/articles`,
2424
2442
  name: "webx.blog.articles",
2425
- component: wa,
2426
- props: { base: c }
2443
+ component: Aa,
2444
+ props: { base: d }
2427
2445
  },
2428
2446
  {
2429
- path: `${c}/articles/:id(\\d+)`,
2447
+ path: `${d}/articles/:id(\\d+)`,
2430
2448
  name: "webx.blog.articles.edit",
2431
- component: Et,
2432
- props: { base: c }
2449
+ component: Ht,
2450
+ props: { base: d }
2433
2451
  }
2434
2452
  ],
2435
2453
  /*
@@ -2447,54 +2465,54 @@ function Da(h = {}) {
2447
2465
  * description — it is configuration the editor was handed with the record.
2448
2466
  */
2449
2467
  types: {
2450
- "wx-article-slug": { component: aa, kind: "field" },
2451
- "wx-article-author": { component: Pt, kind: "field" },
2452
- "wx-article-tags": { component: oa, kind: "field" },
2453
- "wx-article-related": { component: Xt, kind: "field" },
2454
- "wx-article-unpublish": { component: ca, kind: "display" },
2455
- "wx-article-history": { component: Ht, kind: "display" }
2468
+ "wx-article-slug": { component: oa, kind: "field" },
2469
+ "wx-article-author": { component: Ot, kind: "field" },
2470
+ "wx-article-tags": { component: ga, kind: "field" },
2471
+ "wx-article-related": { component: ia, kind: "field" },
2472
+ "wx-article-unpublish": { component: ha, kind: "display" },
2473
+ "wx-article-history": { component: Xt, kind: "display" }
2456
2474
  }
2457
2475
  },
2458
2476
  {
2459
2477
  id: "rubrics",
2460
- path: `${c}/rubrics`,
2478
+ path: `${d}/rubrics`,
2461
2479
  // The list and the page of one rubric are the panel's shared category screens (§3.6 of
2462
2480
  // the services spec); what is the blog's is the description they are handed.
2463
- routes: bt(Ma(c))
2481
+ routes: kt(Ra(d))
2464
2482
  },
2465
2483
  {
2466
2484
  id: "tags",
2467
- path: `${c}/tags`,
2485
+ path: `${d}/tags`,
2468
2486
  routes: [
2469
2487
  {
2470
- path: `${c}/tags`,
2488
+ path: `${d}/tags`,
2471
2489
  name: "webx.blog.tags",
2472
- component: za,
2473
- props: { base: c }
2490
+ component: Pa,
2491
+ props: { base: d }
2474
2492
  }
2475
2493
  ]
2476
2494
  }
2477
2495
  ];
2478
2496
  }
2479
2497
  export {
2480
- Pt as WxArticleAuthorField,
2481
- da as WxArticleCreateDialog,
2482
- Et as WxArticleEditorPage,
2483
- Ht as WxArticleHistory,
2484
- Xt as WxArticleRelated,
2485
- aa as WxArticleSlug,
2486
- oa as WxArticleTags,
2487
- ca as WxArticleUnpublish,
2488
- wa as WxArticlesPage,
2489
- xa as WxTagCreateDialog,
2490
- Wa as WxTagMergeDialog,
2491
- za as WxTagsPage,
2492
- rt as articleEditorKey,
2493
- Da as blog,
2494
- It as blogMessages,
2495
- ue as createBlogApi,
2496
- qt as provideArticleEditor,
2497
- Ma as rubricsOptions,
2498
- Ae as useArticleEditor
2498
+ Ot as WxArticleAuthorField,
2499
+ ma as WxArticleCreateDialog,
2500
+ Ht as WxArticleEditorPage,
2501
+ Xt as WxArticleHistory,
2502
+ ia as WxArticleRelated,
2503
+ oa as WxArticleSlug,
2504
+ ga as WxArticleTags,
2505
+ ha as WxArticleUnpublish,
2506
+ Aa as WxArticlesPage,
2507
+ Sa as WxTagCreateDialog,
2508
+ Ua as WxTagMergeDialog,
2509
+ Pa as WxTagsPage,
2510
+ ut as articleEditorKey,
2511
+ Ka as blog,
2512
+ Et as blogMessages,
2513
+ de as createBlogApi,
2514
+ Bt as provideArticleEditor,
2515
+ Ra as rubricsOptions,
2516
+ We as useArticleEditor
2499
2517
  };
2500
2518
  //# sourceMappingURL=index.js.map