@web-mods/articles 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,108 +1,108 @@
1
- import { jsx as n, jsxs as s, Fragment as ue } from "react/jsx-runtime";
2
- import ce, { createContext as Ae, useContext as He, useState as _, useEffect as K, forwardRef as nt, createElement as Le, useRef as Y, useId as Ie, useCallback as xe, memo as We, useLayoutEffect as Mt } from "react";
3
- import { defaultArticleService as Ct } from "./server.js";
4
- import { ArticleServiceError as ea, createArticleService as ta, renderArticleByPathname as ra } from "./server.js";
5
- import { useNavigate as St, useParams as jt, useLocation as Ot, useMatch as qe } from "react-router";
6
- import { createPortal as at } from "react-dom";
7
- const Re = Ae({
1
+ import { jsx as t, jsxs as s, Fragment as be } from "react/jsx-runtime";
2
+ import ge, { createContext as Ue, useContext as Ke, useState as S, useEffect as te, forwardRef as yt, createElement as Ve, useRef as Y, useId as we, useLayoutEffect as bt, useCallback as Me, memo as Ze } from "react";
3
+ import { defaultArticleService as Ft } from "./server.js";
4
+ import { ArticleServiceError as Oa, createArticleService as Ea, renderArticleByPathname as Pa } from "./server.js";
5
+ import { useNavigate as Ut, useParams as Kt, useLocation as Zt, useMatch as it } from "react-router";
6
+ import { createPortal as vt } from "react-dom";
7
+ const Je = Ue({
8
8
  navigate: () => {
9
9
  },
10
10
  params: {},
11
11
  locationState: null
12
12
  });
13
- function Ve() {
14
- return He(Re);
15
- }
16
- let se = [];
17
- const Te = /* @__PURE__ */ new Set();
18
- function Be() {
19
- Te.forEach((e) => e([...se]));
20
- }
21
- function $e(e, t) {
22
- const r = Math.random().toString(36).slice(2);
23
- se = [...se, { id: r, type: e, content: t }], Be(), setTimeout(() => {
24
- se = se.filter((a) => a.id !== r), Be();
13
+ function Xe() {
14
+ return Ke(Je);
15
+ }
16
+ let me = [];
17
+ const Ye = /* @__PURE__ */ new Set();
18
+ function st() {
19
+ Ye.forEach((e) => e([...me]));
20
+ }
21
+ function _e(e, r) {
22
+ const n = Math.random().toString(36).slice(2);
23
+ me = [...me, { id: n, type: e, content: r }], st(), setTimeout(() => {
24
+ me = me.filter((a) => a.id !== n), st();
25
25
  }, 3e3);
26
26
  }
27
- const J = {
28
- success: (e) => $e("success", e),
29
- error: (e) => $e("error", e),
30
- warning: (e) => $e("warning", e)
27
+ const ae = {
28
+ success: (e) => _e("success", e),
29
+ error: (e) => _e("error", e),
30
+ warning: (e) => _e("warning", e)
31
31
  };
32
- function Pt(e) {
33
- return Te.add(e), () => {
34
- Te.delete(e);
32
+ function Jt(e) {
33
+ return Ye.add(e), () => {
34
+ Ye.delete(e);
35
35
  };
36
36
  }
37
- function Et() {
38
- return se;
37
+ function Xt() {
38
+ return me;
39
39
  }
40
- const Lt = {
40
+ const Qt = {
41
41
  success: "bg-emerald-500",
42
42
  error: "bg-red-500",
43
43
  warning: "bg-amber-500"
44
- }, Tt = {
44
+ }, er = {
45
45
  success: "✓",
46
46
  error: "✕",
47
47
  warning: "⚠"
48
48
  };
49
- function _t() {
50
- const [e, t] = _(Et());
51
- return K(() => Pt(t), []), e.length === 0 ? null : /* @__PURE__ */ n("div", { className: "fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none", children: e.map((r) => /* @__PURE__ */ s(
49
+ function tr() {
50
+ const [e, r] = S(Xt());
51
+ return te(() => Jt(r), []), e.length === 0 ? null : /* @__PURE__ */ t("div", { className: "fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none", children: e.map((n) => /* @__PURE__ */ s(
52
52
  "div",
53
53
  {
54
- className: `flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-sm text-white font-medium pointer-events-auto ${Lt[r.type]}`,
54
+ className: `flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-sm text-white font-medium pointer-events-auto ${Qt[n.type]}`,
55
55
  children: [
56
- /* @__PURE__ */ n("span", { className: "shrink-0 font-bold", children: Tt[r.type] }),
57
- r.content
56
+ /* @__PURE__ */ t("span", { className: "shrink-0 font-bold", children: er[n.type] }),
57
+ n.content
58
58
  ]
59
59
  },
60
- r.id
60
+ n.id
61
61
  )) });
62
62
  }
63
- const it = Ae(null);
64
- function Un({
63
+ const wt = Ue(null);
64
+ function Na({
65
65
  children: e,
66
- basePath: t,
67
- service: r = Ct,
66
+ basePath: r,
67
+ service: n = Ft,
68
68
  previewBaseUrl: a,
69
- previewTailwind: o,
70
- navigate: l
69
+ previewTailwind: c,
70
+ navigate: d
71
71
  }) {
72
- const f = /* @__PURE__ */ s(
73
- it.Provider,
72
+ const g = /* @__PURE__ */ s(
73
+ wt.Provider,
74
74
  {
75
- value: { basePath: t, service: r, previewBaseUrl: a, previewTailwind: o },
75
+ value: { basePath: r, service: n, previewBaseUrl: a, previewTailwind: c },
76
76
  children: [
77
77
  e,
78
- /* @__PURE__ */ n(_t, {})
78
+ /* @__PURE__ */ t(tr, {})
79
79
  ]
80
80
  }
81
81
  );
82
- return l ? /* @__PURE__ */ n(
83
- Re.Provider,
82
+ return d ? /* @__PURE__ */ t(
83
+ Je.Provider,
84
84
  {
85
- value: { navigate: l, params: {}, locationState: null },
86
- children: f
85
+ value: { navigate: d, params: {}, locationState: null },
86
+ children: g
87
87
  }
88
- ) : f;
88
+ ) : g;
89
89
  }
90
- function ve() {
91
- const e = He(it);
90
+ function Ee() {
91
+ const e = Ke(wt);
92
92
  if (!e)
93
93
  throw new Error(
94
94
  "useArticlesConfig must be used within ArticlesProvider"
95
95
  );
96
96
  return e;
97
97
  }
98
- function Gn({ children: e }) {
99
- const t = St(), r = jt(), a = Ot(), { basePath: o } = ve(), l = o.replace(/\/+$/, ""), f = qe(`${l}/:id/edit`), g = qe(`${l}/:id/detail`), y = f ?? g;
100
- return /* @__PURE__ */ n(
101
- Re.Provider,
98
+ function ka({ children: e }) {
99
+ const r = Ut(), n = Kt(), a = Zt(), { basePath: c } = Ee(), d = c.replace(/\/+$/, ""), g = it(`${d}/:id/edit`), h = it(`${d}/:id/detail`), u = g ?? h;
100
+ return /* @__PURE__ */ t(
101
+ Je.Provider,
102
102
  {
103
103
  value: {
104
- navigate: (k, p) => t(k, p),
105
- params: { ...r, ...y == null ? void 0 : y.params },
104
+ navigate: (y, f) => r(y, f),
105
+ params: { ...n, ...u == null ? void 0 : u.params },
106
106
  locationState: a.state
107
107
  },
108
108
  children: e
@@ -115,23 +115,23 @@ function Gn({ children: e }) {
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
117
  */
118
- const st = (...e) => e.filter((t, r, a) => !!t && t.trim() !== "" && a.indexOf(t) === r).join(" ").trim();
118
+ const Nt = (...e) => e.filter((r, n, a) => !!r && r.trim() !== "" && a.indexOf(r) === n).join(" ").trim();
119
119
  /**
120
120
  * @license lucide-react v1.11.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
124
  */
125
- const Dt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
125
+ const rr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
126
126
  /**
127
127
  * @license lucide-react v1.11.0 - ISC
128
128
  *
129
129
  * This source code is licensed under the ISC license.
130
130
  * See the LICENSE file in the root directory of this source tree.
131
131
  */
132
- const zt = (e) => e.replace(
132
+ const nr = (e) => e.replace(
133
133
  /^([A-Z])|[\s-_]+(\w)/g,
134
- (t, r, a) => a ? a.toUpperCase() : r.toLowerCase()
134
+ (r, n, a) => a ? a.toUpperCase() : n.toLowerCase()
135
135
  );
136
136
  /**
137
137
  * @license lucide-react v1.11.0 - ISC
@@ -139,9 +139,9 @@ const zt = (e) => e.replace(
139
139
  * This source code is licensed under the ISC license.
140
140
  * See the LICENSE file in the root directory of this source tree.
141
141
  */
142
- const Fe = (e) => {
143
- const t = zt(e);
144
- return t.charAt(0).toUpperCase() + t.slice(1);
142
+ const ot = (e) => {
143
+ const r = nr(e);
144
+ return r.charAt(0).toUpperCase() + r.slice(1);
145
145
  };
146
146
  /**
147
147
  * @license lucide-react v1.11.0 - ISC
@@ -149,7 +149,7 @@ const Fe = (e) => {
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
151
  */
152
- var Me = {
152
+ var Te = {
153
153
  xmlns: "http://www.w3.org/2000/svg",
154
154
  width: 24,
155
155
  height: 24,
@@ -166,36 +166,36 @@ var Me = {
166
166
  * This source code is licensed under the ISC license.
167
167
  * See the LICENSE file in the root directory of this source tree.
168
168
  */
169
- const At = (e) => {
170
- for (const t in e)
171
- if (t.startsWith("aria-") || t === "role" || t === "title")
169
+ const ar = (e) => {
170
+ for (const r in e)
171
+ if (r.startsWith("aria-") || r === "role" || r === "title")
172
172
  return !0;
173
173
  return !1;
174
- }, Ht = Ae({}), It = () => He(Ht), Wt = nt(
175
- ({ color: e, size: t, strokeWidth: r, absoluteStrokeWidth: a, className: o = "", children: l, iconNode: f, ...g }, y) => {
174
+ }, ir = Ue({}), sr = () => Ke(ir), or = yt(
175
+ ({ color: e, size: r, strokeWidth: n, absoluteStrokeWidth: a, className: c = "", children: d, iconNode: g, ...h }, u) => {
176
176
  const {
177
- size: k = 24,
178
- strokeWidth: p = 2,
179
- absoluteStrokeWidth: v = !1,
180
- color: P = "currentColor",
181
- className: A = ""
182
- } = It() ?? {}, H = a ?? v ? Number(r ?? p) * 24 / Number(t ?? k) : r ?? p;
183
- return Le(
177
+ size: y = 24,
178
+ strokeWidth: f = 2,
179
+ absoluteStrokeWidth: N = !1,
180
+ color: _ = "currentColor",
181
+ className: z = ""
182
+ } = sr() ?? {}, A = a ?? N ? Number(n ?? f) * 24 / Number(r ?? y) : n ?? f;
183
+ return Ve(
184
184
  "svg",
185
185
  {
186
- ref: y,
187
- ...Me,
188
- width: t ?? k ?? Me.width,
189
- height: t ?? k ?? Me.height,
190
- stroke: e ?? P,
191
- strokeWidth: H,
192
- className: st("lucide", A, o),
193
- ...!l && !At(g) && { "aria-hidden": "true" },
194
- ...g
186
+ ref: u,
187
+ ...Te,
188
+ width: r ?? y ?? Te.width,
189
+ height: r ?? y ?? Te.height,
190
+ stroke: e ?? _,
191
+ strokeWidth: A,
192
+ className: Nt("lucide", z, c),
193
+ ...!d && !ar(h) && { "aria-hidden": "true" },
194
+ ...h
195
195
  },
196
196
  [
197
- ...f.map(([T, W]) => Le(T, W)),
198
- ...Array.isArray(l) ? l : [l]
197
+ ...g.map(([W, V]) => Ve(W, V)),
198
+ ...Array.isArray(d) ? d : [d]
199
199
  ]
200
200
  );
201
201
  }
@@ -206,20 +206,20 @@ const At = (e) => {
206
206
  * This source code is licensed under the ISC license.
207
207
  * See the LICENSE file in the root directory of this source tree.
208
208
  */
209
- const B = (e, t) => {
210
- const r = nt(
211
- ({ className: a, ...o }, l) => Le(Wt, {
212
- ref: l,
213
- iconNode: t,
214
- className: st(
215
- `lucide-${Dt(Fe(e))}`,
209
+ const K = (e, r) => {
210
+ const n = yt(
211
+ ({ className: a, ...c }, d) => Ve(or, {
212
+ ref: d,
213
+ iconNode: r,
214
+ className: Nt(
215
+ `lucide-${rr(ot(e))}`,
216
216
  `lucide-${e}`,
217
217
  a
218
218
  ),
219
- ...o
219
+ ...c
220
220
  })
221
221
  );
222
- return r.displayName = Fe(e), r;
222
+ return n.displayName = ot(e), n;
223
223
  };
224
224
  /**
225
225
  * @license lucide-react v1.11.0 - ISC
@@ -227,80 +227,105 @@ const B = (e, t) => {
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
229
  */
230
- const Rt = [
230
+ const cr = [
231
+ ["path", { d: "M12 5v14", key: "s699le" }],
232
+ ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
233
+ ], lr = K("arrow-down", cr);
234
+ /**
235
+ * @license lucide-react v1.11.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */
240
+ const dr = [
231
241
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
232
242
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
233
- ], ot = B("arrow-left", Rt);
243
+ ], kt = K("arrow-left", dr);
234
244
  /**
235
245
  * @license lucide-react v1.11.0 - ISC
236
246
  *
237
247
  * This source code is licensed under the ISC license.
238
248
  * See the LICENSE file in the root directory of this source tree.
239
249
  */
240
- const Vt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Yt = B("check", Vt);
250
+ const ur = [
251
+ ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
252
+ ["path", { d: "M17 20V4", key: "1ejh1v" }],
253
+ ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
254
+ ["path", { d: "M7 4v16", key: "1glfcx" }]
255
+ ], $t = K("arrow-up-down", ur);
256
+ /**
257
+ * @license lucide-react v1.11.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */
262
+ const mr = [
263
+ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
264
+ ["path", { d: "M12 19V5", key: "x0mq9r" }]
265
+ ], hr = K("arrow-up", mr);
241
266
  /**
242
267
  * @license lucide-react v1.11.0 - ISC
243
268
  *
244
269
  * This source code is licensed under the ISC license.
245
270
  * See the LICENSE file in the root directory of this source tree.
246
271
  */
247
- const qt = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Bt = B("chevron-down", qt);
272
+ const gr = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Ct = K("check", gr);
248
273
  /**
249
274
  * @license lucide-react v1.11.0 - ISC
250
275
  *
251
276
  * This source code is licensed under the ISC license.
252
277
  * See the LICENSE file in the root directory of this source tree.
253
278
  */
254
- const Ft = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ue = B("chevron-right", Ft);
279
+ const pr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], fr = K("chevron-down", pr);
255
280
  /**
256
281
  * @license lucide-react v1.11.0 - ISC
257
282
  *
258
283
  * This source code is licensed under the ISC license.
259
284
  * See the LICENSE file in the root directory of this source tree.
260
285
  */
261
- const Ut = [
286
+ const xr = [
262
287
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
263
288
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
264
289
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
265
- ], Gt = B("circle-alert", Ut);
290
+ ], yr = K("circle-alert", xr);
266
291
  /**
267
292
  * @license lucide-react v1.11.0 - ISC
268
293
  *
269
294
  * This source code is licensed under the ISC license.
270
295
  * See the LICENSE file in the root directory of this source tree.
271
296
  */
272
- const Zt = [
297
+ const br = [
273
298
  ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
274
299
  ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
275
- ], Ye = B("code", Zt);
300
+ ], Qe = K("code", br);
276
301
  /**
277
302
  * @license lucide-react v1.11.0 - ISC
278
303
  *
279
304
  * This source code is licensed under the ISC license.
280
305
  * See the LICENSE file in the root directory of this source tree.
281
306
  */
282
- const Kt = [
307
+ const vr = [
283
308
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
284
309
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
285
- ], Jt = B("copy", Kt);
310
+ ], wr = K("copy", vr);
286
311
  /**
287
312
  * @license lucide-react v1.11.0 - ISC
288
313
  *
289
314
  * This source code is licensed under the ISC license.
290
315
  * See the LICENSE file in the root directory of this source tree.
291
316
  */
292
- const Qt = [
317
+ const Nr = [
293
318
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
294
319
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
295
320
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
296
- ], Xt = B("external-link", Qt);
321
+ ], kr = K("external-link", Nr);
297
322
  /**
298
323
  * @license lucide-react v1.11.0 - ISC
299
324
  *
300
325
  * This source code is licensed under the ISC license.
301
326
  * See the LICENSE file in the root directory of this source tree.
302
327
  */
303
- const er = [
328
+ const $r = [
304
329
  [
305
330
  "path",
306
331
  {
@@ -309,14 +334,14 @@ const er = [
309
334
  }
310
335
  ],
311
336
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
312
- ], _e = B("eye", er);
337
+ ], qe = K("eye", $r);
313
338
  /**
314
339
  * @license lucide-react v1.11.0 - ISC
315
340
  *
316
341
  * This source code is licensed under the ISC license.
317
342
  * See the LICENSE file in the root directory of this source tree.
318
343
  */
319
- const tr = [
344
+ const Cr = [
320
345
  [
321
346
  "path",
322
347
  {
@@ -328,14 +353,28 @@ const tr = [
328
353
  ["path", { d: "M10 9H8", key: "b1mrlr" }],
329
354
  ["path", { d: "M16 13H8", key: "t4e002" }],
330
355
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
331
- ], rr = B("file-text", tr);
356
+ ], Mr = K("file-text", Cr);
357
+ /**
358
+ * @license lucide-react v1.11.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */
363
+ const Sr = [
364
+ ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
365
+ ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
366
+ ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
367
+ ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
368
+ ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
369
+ ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
370
+ ], ct = K("grip-vertical", Sr);
332
371
  /**
333
372
  * @license lucide-react v1.11.0 - ISC
334
373
  *
335
374
  * This source code is licensed under the ISC license.
336
375
  * See the LICENSE file in the root directory of this source tree.
337
376
  */
338
- const nr = [
377
+ const jr = [
339
378
  ["polyline", { points: "22 12 16 12 14 15 10 15 8 12 2 12", key: "o97t9d" }],
340
379
  [
341
380
  "path",
@@ -344,63 +383,63 @@ const nr = [
344
383
  key: "oot6mr"
345
384
  }
346
385
  ]
347
- ], ar = B("inbox", nr);
386
+ ], Or = K("inbox", jr);
348
387
  /**
349
388
  * @license lucide-react v1.11.0 - ISC
350
389
  *
351
390
  * This source code is licensed under the ISC license.
352
391
  * See the LICENSE file in the root directory of this source tree.
353
392
  */
354
- const ir = [
393
+ const Er = [
355
394
  ["rect", { width: "18", height: "7", x: "3", y: "3", rx: "1", key: "f1a2em" }],
356
395
  ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }],
357
396
  ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }]
358
- ], ct = B("layout-panel-top", ir);
397
+ ], Pr = K("layout-panel-top", Er);
359
398
  /**
360
399
  * @license lucide-react v1.11.0 - ISC
361
400
  *
362
401
  * This source code is licensed under the ISC license.
363
402
  * See the LICENSE file in the root directory of this source tree.
364
403
  */
365
- const sr = [
404
+ const Dr = [
366
405
  ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
367
406
  ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
368
- ], or = B("link", sr);
407
+ ], Ir = K("link", Dr);
369
408
  /**
370
409
  * @license lucide-react v1.11.0 - ISC
371
410
  *
372
411
  * This source code is licensed under the ISC license.
373
412
  * See the LICENSE file in the root directory of this source tree.
374
413
  */
375
- const cr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], lt = B("loader-circle", cr);
414
+ const Lr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], Pe = K("loader-circle", Lr);
376
415
  /**
377
416
  * @license lucide-react v1.11.0 - ISC
378
417
  *
379
418
  * This source code is licensed under the ISC license.
380
419
  * See the LICENSE file in the root directory of this source tree.
381
420
  */
382
- const lr = [
421
+ const _r = [
383
422
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
384
423
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
385
424
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
386
- ], dt = B("monitor", lr);
425
+ ], Mt = K("monitor", _r);
387
426
  /**
388
427
  * @license lucide-react v1.11.0 - ISC
389
428
  *
390
429
  * This source code is licensed under the ISC license.
391
430
  * See the LICENSE file in the root directory of this source tree.
392
431
  */
393
- const dr = [
432
+ const Tr = [
394
433
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
395
434
  ["path", { d: "M3 15h18", key: "5xshup" }]
396
- ], ut = B("panel-bottom", dr);
435
+ ], zr = K("panel-bottom", Tr);
397
436
  /**
398
437
  * @license lucide-react v1.11.0 - ISC
399
438
  *
400
439
  * This source code is licensed under the ISC license.
401
440
  * See the LICENSE file in the root directory of this source tree.
402
441
  */
403
- const ur = [
442
+ const Ar = [
404
443
  [
405
444
  "path",
406
445
  {
@@ -409,44 +448,44 @@ const ur = [
409
448
  }
410
449
  ],
411
450
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
412
- ], hr = B("pencil", ur);
451
+ ], St = K("pencil", Ar);
413
452
  /**
414
453
  * @license lucide-react v1.11.0 - ISC
415
454
  *
416
455
  * This source code is licensed under the ISC license.
417
456
  * See the LICENSE file in the root directory of this source tree.
418
457
  */
419
- const mr = [
458
+ const Hr = [
420
459
  ["path", { d: "M5 12h14", key: "1ays0h" }],
421
460
  ["path", { d: "M12 5v14", key: "s699le" }]
422
- ], ht = B("plus", mr);
461
+ ], et = K("plus", Hr);
423
462
  /**
424
463
  * @license lucide-react v1.11.0 - ISC
425
464
  *
426
465
  * This source code is licensed under the ISC license.
427
466
  * See the LICENSE file in the root directory of this source tree.
428
467
  */
429
- const pr = [
468
+ const Gr = [
430
469
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
431
470
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
432
- ], fr = B("rotate-ccw", pr);
471
+ ], Wr = K("rotate-ccw", Gr);
433
472
  /**
434
473
  * @license lucide-react v1.11.0 - ISC
435
474
  *
436
475
  * This source code is licensed under the ISC license.
437
476
  * See the LICENSE file in the root directory of this source tree.
438
477
  */
439
- const gr = [
478
+ const Rr = [
440
479
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
441
480
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
442
- ], Ce = B("search", gr);
481
+ ], ze = K("search", Rr);
443
482
  /**
444
483
  * @license lucide-react v1.11.0 - ISC
445
484
  *
446
485
  * This source code is licensed under the ISC license.
447
486
  * See the LICENSE file in the root directory of this source tree.
448
487
  */
449
- const xr = [
488
+ const Vr = [
450
489
  [
451
490
  "path",
452
491
  {
@@ -455,364 +494,364 @@ const xr = [
455
494
  }
456
495
  ],
457
496
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
458
- ], Ge = B("shield-check", xr);
497
+ ], lt = K("shield-check", Vr);
459
498
  /**
460
499
  * @license lucide-react v1.11.0 - ISC
461
500
  *
462
501
  * This source code is licensed under the ISC license.
463
502
  * See the LICENSE file in the root directory of this source tree.
464
503
  */
465
- const br = [
504
+ const Yr = [
466
505
  ["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "1yt0o3" }],
467
506
  ["path", { d: "M12 18h.01", key: "mhygvu" }]
468
- ], mt = B("smartphone", br);
507
+ ], jt = K("smartphone", Yr);
469
508
  /**
470
509
  * @license lucide-react v1.11.0 - ISC
471
510
  *
472
511
  * This source code is licensed under the ISC license.
473
512
  * See the LICENSE file in the root directory of this source tree.
474
513
  */
475
- const yr = [
514
+ const qr = [
476
515
  ["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2", key: "76otgf" }],
477
516
  ["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
478
- ], pt = B("tablet", yr);
517
+ ], Ot = K("tablet", qr);
479
518
  /**
480
519
  * @license lucide-react v1.11.0 - ISC
481
520
  *
482
521
  * This source code is licensed under the ISC license.
483
522
  * See the LICENSE file in the root directory of this source tree.
484
523
  */
485
- const vr = [
524
+ const Br = [
486
525
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
487
526
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
488
- ], wr = B("x", vr);
489
- function Nr(e) {
527
+ ], Et = K("x", Br);
528
+ function Fr(e) {
490
529
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
491
530
  }
492
- var ge = { exports: {} }, kr = ge.exports, Ze;
493
- function $r() {
494
- return Ze || (Ze = 1, (function(e, t) {
495
- (function(r, a) {
531
+ var Ce = { exports: {} }, Ur = Ce.exports, dt;
532
+ function Kr() {
533
+ return dt || (dt = 1, (function(e, r) {
534
+ (function(n, a) {
496
535
  e.exports = a();
497
- })(kr, (function() {
498
- var r = 1e3, a = 6e4, o = 36e5, l = "millisecond", f = "second", g = "minute", y = "hour", k = "day", p = "week", v = "month", P = "quarter", A = "year", H = "date", T = "Invalid Date", W = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, D = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, R = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(d) {
499
- var i = ["th", "st", "nd", "rd"], c = d % 100;
500
- return "[" + d + (i[(c - 20) % 10] || i[c] || i[0]) + "]";
501
- } }, V = function(d, i, c) {
502
- var m = String(d);
503
- return !m || m.length >= i ? d : "" + Array(i + 1 - m.length).join(c) + d;
504
- }, j = { s: V, z: function(d) {
505
- var i = -d.utcOffset(), c = Math.abs(i), m = Math.floor(c / 60), u = c % 60;
506
- return (i <= 0 ? "+" : "-") + V(m, 2, "0") + ":" + V(u, 2, "0");
507
- }, m: function d(i, c) {
508
- if (i.date() < c.date()) return -d(c, i);
509
- var m = 12 * (c.year() - i.year()) + (c.month() - i.month()), u = i.clone().add(m, v), C = c - u < 0, O = i.clone().add(m + (C ? -1 : 1), v);
510
- return +(-(m + (c - u) / (C ? u - O : O - u)) || 0);
511
- }, a: function(d) {
512
- return d < 0 ? Math.ceil(d) || 0 : Math.floor(d);
513
- }, p: function(d) {
514
- return { M: v, y: A, w: p, d: k, D: H, h: y, m: g, s: f, ms: l, Q: P }[d] || String(d || "").toLowerCase().replace(/s$/, "");
515
- }, u: function(d) {
516
- return d === void 0;
517
- } }, E = "en", b = {};
518
- b[E] = R;
519
- var h = "$isDayjsObject", z = function(d) {
520
- return d instanceof L || !(!d || !d[h]);
521
- }, M = function d(i, c, m) {
522
- var u;
523
- if (!i) return E;
524
- if (typeof i == "string") {
525
- var C = i.toLowerCase();
526
- b[C] && (u = C), c && (b[C] = c, u = C);
527
- var O = i.split("-");
528
- if (!u && O.length > 1) return d(O[0]);
536
+ })(Ur, (function() {
537
+ var n = 1e3, a = 6e4, c = 36e5, d = "millisecond", g = "second", h = "minute", u = "hour", y = "day", f = "week", N = "month", _ = "quarter", z = "year", A = "date", W = "Invalid Date", V = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, R = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, H = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(k) {
538
+ var l = ["th", "st", "nd", "rd"], m = k % 100;
539
+ return "[" + k + (l[(m - 20) % 10] || l[m] || l[0]) + "]";
540
+ } }, F = function(k, l, m) {
541
+ var $ = String(k);
542
+ return !$ || $.length >= l ? k : "" + Array(l + 1 - $.length).join(m) + k;
543
+ }, M = { s: F, z: function(k) {
544
+ var l = -k.utcOffset(), m = Math.abs(l), $ = Math.floor(m / 60), x = m % 60;
545
+ return (l <= 0 ? "+" : "-") + F($, 2, "0") + ":" + F(x, 2, "0");
546
+ }, m: function k(l, m) {
547
+ if (l.date() < m.date()) return -k(m, l);
548
+ var $ = 12 * (m.year() - l.year()) + (m.month() - l.month()), x = l.clone().add($, N), E = m - x < 0, P = l.clone().add($ + (E ? -1 : 1), N);
549
+ return +(-($ + (m - x) / (E ? x - P : P - x)) || 0);
550
+ }, a: function(k) {
551
+ return k < 0 ? Math.ceil(k) || 0 : Math.floor(k);
552
+ }, p: function(k) {
553
+ return { M: N, y: z, w: f, d: y, D: A, h: u, m: h, s: g, ms: d, Q: _ }[k] || String(k || "").toLowerCase().replace(/s$/, "");
554
+ }, u: function(k) {
555
+ return k === void 0;
556
+ } }, D = "en", v = {};
557
+ v[D] = H;
558
+ var b = "$isDayjsObject", T = function(k) {
559
+ return k instanceof L || !(!k || !k[b]);
560
+ }, O = function k(l, m, $) {
561
+ var x;
562
+ if (!l) return D;
563
+ if (typeof l == "string") {
564
+ var E = l.toLowerCase();
565
+ v[E] && (x = E), m && (v[E] = m, x = E);
566
+ var P = l.split("-");
567
+ if (!x && P.length > 1) return k(P[0]);
529
568
  } else {
530
- var N = i.name;
531
- b[N] = i, u = N;
569
+ var i = l.name;
570
+ v[i] = l, x = i;
532
571
  }
533
- return !m && u && (E = u), u || !m && E;
534
- }, x = function(d, i) {
535
- if (z(d)) return d.clone();
536
- var c = typeof i == "object" ? i : {};
537
- return c.date = d, c.args = arguments, new L(c);
538
- }, w = j;
539
- w.l = M, w.i = z, w.w = function(d, i) {
540
- return x(d, { locale: i.$L, utc: i.$u, x: i.$x, $offset: i.$offset });
572
+ return !$ && x && (D = x), x || !$ && D;
573
+ }, p = function(k, l) {
574
+ if (T(k)) return k.clone();
575
+ var m = typeof l == "object" ? l : {};
576
+ return m.date = k, m.args = arguments, new L(m);
577
+ }, C = M;
578
+ C.l = O, C.i = T, C.w = function(k, l) {
579
+ return p(k, { locale: l.$L, utc: l.$u, x: l.$x, $offset: l.$offset });
541
580
  };
542
581
  var L = (function() {
543
- function d(c) {
544
- this.$L = M(c.locale, null, !0), this.parse(c), this.$x = this.$x || c.x || {}, this[h] = !0;
582
+ function k(m) {
583
+ this.$L = O(m.locale, null, !0), this.parse(m), this.$x = this.$x || m.x || {}, this[b] = !0;
545
584
  }
546
- var i = d.prototype;
547
- return i.parse = function(c) {
548
- this.$d = (function(m) {
549
- var u = m.date, C = m.utc;
550
- if (u === null) return /* @__PURE__ */ new Date(NaN);
551
- if (w.u(u)) return /* @__PURE__ */ new Date();
552
- if (u instanceof Date) return new Date(u);
553
- if (typeof u == "string" && !/Z$/i.test(u)) {
554
- var O = u.match(W);
555
- if (O) {
556
- var N = O[2] - 1 || 0, S = (O[7] || "0").substring(0, 3);
557
- return C ? new Date(Date.UTC(O[1], N, O[3] || 1, O[4] || 0, O[5] || 0, O[6] || 0, S)) : new Date(O[1], N, O[3] || 1, O[4] || 0, O[5] || 0, O[6] || 0, S);
585
+ var l = k.prototype;
586
+ return l.parse = function(m) {
587
+ this.$d = (function($) {
588
+ var x = $.date, E = $.utc;
589
+ if (x === null) return /* @__PURE__ */ new Date(NaN);
590
+ if (C.u(x)) return /* @__PURE__ */ new Date();
591
+ if (x instanceof Date) return new Date(x);
592
+ if (typeof x == "string" && !/Z$/i.test(x)) {
593
+ var P = x.match(V);
594
+ if (P) {
595
+ var i = P[2] - 1 || 0, o = (P[7] || "0").substring(0, 3);
596
+ return E ? new Date(Date.UTC(P[1], i, P[3] || 1, P[4] || 0, P[5] || 0, P[6] || 0, o)) : new Date(P[1], i, P[3] || 1, P[4] || 0, P[5] || 0, P[6] || 0, o);
558
597
  }
559
598
  }
560
- return new Date(u);
561
- })(c), this.init();
562
- }, i.init = function() {
563
- var c = this.$d;
564
- this.$y = c.getFullYear(), this.$M = c.getMonth(), this.$D = c.getDate(), this.$W = c.getDay(), this.$H = c.getHours(), this.$m = c.getMinutes(), this.$s = c.getSeconds(), this.$ms = c.getMilliseconds();
565
- }, i.$utils = function() {
566
- return w;
567
- }, i.isValid = function() {
568
- return this.$d.toString() !== T;
569
- }, i.isSame = function(c, m) {
570
- var u = x(c);
571
- return this.startOf(m) <= u && u <= this.endOf(m);
572
- }, i.isAfter = function(c, m) {
573
- return x(c) < this.startOf(m);
574
- }, i.isBefore = function(c, m) {
575
- return this.endOf(m) < x(c);
576
- }, i.$g = function(c, m, u) {
577
- return w.u(c) ? this[m] : this.set(u, c);
578
- }, i.unix = function() {
599
+ return new Date(x);
600
+ })(m), this.init();
601
+ }, l.init = function() {
602
+ var m = this.$d;
603
+ this.$y = m.getFullYear(), this.$M = m.getMonth(), this.$D = m.getDate(), this.$W = m.getDay(), this.$H = m.getHours(), this.$m = m.getMinutes(), this.$s = m.getSeconds(), this.$ms = m.getMilliseconds();
604
+ }, l.$utils = function() {
605
+ return C;
606
+ }, l.isValid = function() {
607
+ return this.$d.toString() !== W;
608
+ }, l.isSame = function(m, $) {
609
+ var x = p(m);
610
+ return this.startOf($) <= x && x <= this.endOf($);
611
+ }, l.isAfter = function(m, $) {
612
+ return p(m) < this.startOf($);
613
+ }, l.isBefore = function(m, $) {
614
+ return this.endOf($) < p(m);
615
+ }, l.$g = function(m, $, x) {
616
+ return C.u(m) ? this[$] : this.set(x, m);
617
+ }, l.unix = function() {
579
618
  return Math.floor(this.valueOf() / 1e3);
580
- }, i.valueOf = function() {
619
+ }, l.valueOf = function() {
581
620
  return this.$d.getTime();
582
- }, i.startOf = function(c, m) {
583
- var u = this, C = !!w.u(m) || m, O = w.p(c), N = function(re, $) {
584
- var Z = w.w(u.$u ? Date.UTC(u.$y, $, re) : new Date(u.$y, $, re), u);
585
- return C ? Z : Z.endOf(k);
586
- }, S = function(re, $) {
587
- return w.w(u.toDate()[re].apply(u.toDate("s"), (C ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice($)), u);
588
- }, I = this.$W, q = this.$M, G = this.$D, ee = "set" + (this.$u ? "UTC" : "");
589
- switch (O) {
590
- case A:
591
- return C ? N(1, 0) : N(31, 11);
592
- case v:
593
- return C ? N(1, q) : N(0, q + 1);
594
- case p:
595
- var te = this.$locale().weekStart || 0, ae = (I < te ? I + 7 : I) - te;
596
- return N(C ? G - ae : G + (6 - ae), q);
597
- case k:
598
- case H:
599
- return S(ee + "Hours", 0);
621
+ }, l.startOf = function(m, $) {
622
+ var x = this, E = !!C.u($) || $, P = C.p(m), i = function(X, ne) {
623
+ var ie = C.w(x.$u ? Date.UTC(x.$y, ne, X) : new Date(x.$y, ne, X), x);
624
+ return E ? ie : ie.endOf(y);
625
+ }, o = function(X, ne) {
626
+ return C.w(x.toDate()[X].apply(x.toDate("s"), (E ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ne)), x);
627
+ }, w = this.$W, j = this.$M, G = this.$D, J = "set" + (this.$u ? "UTC" : "");
628
+ switch (P) {
629
+ case z:
630
+ return E ? i(1, 0) : i(31, 11);
631
+ case N:
632
+ return E ? i(1, j) : i(0, j + 1);
633
+ case f:
634
+ var B = this.$locale().weekStart || 0, re = (w < B ? w + 7 : w) - B;
635
+ return i(E ? G - re : G + (6 - re), j);
600
636
  case y:
601
- return S(ee + "Minutes", 1);
637
+ case A:
638
+ return o(J + "Hours", 0);
639
+ case u:
640
+ return o(J + "Minutes", 1);
641
+ case h:
642
+ return o(J + "Seconds", 2);
602
643
  case g:
603
- return S(ee + "Seconds", 2);
604
- case f:
605
- return S(ee + "Milliseconds", 3);
644
+ return o(J + "Milliseconds", 3);
606
645
  default:
607
646
  return this.clone();
608
647
  }
609
- }, i.endOf = function(c) {
610
- return this.startOf(c, !1);
611
- }, i.$set = function(c, m) {
612
- var u, C = w.p(c), O = "set" + (this.$u ? "UTC" : ""), N = (u = {}, u[k] = O + "Date", u[H] = O + "Date", u[v] = O + "Month", u[A] = O + "FullYear", u[y] = O + "Hours", u[g] = O + "Minutes", u[f] = O + "Seconds", u[l] = O + "Milliseconds", u)[C], S = C === k ? this.$D + (m - this.$W) : m;
613
- if (C === v || C === A) {
614
- var I = this.clone().set(H, 1);
615
- I.$d[N](S), I.init(), this.$d = I.set(H, Math.min(this.$D, I.daysInMonth())).$d;
616
- } else N && this.$d[N](S);
648
+ }, l.endOf = function(m) {
649
+ return this.startOf(m, !1);
650
+ }, l.$set = function(m, $) {
651
+ var x, E = C.p(m), P = "set" + (this.$u ? "UTC" : ""), i = (x = {}, x[y] = P + "Date", x[A] = P + "Date", x[N] = P + "Month", x[z] = P + "FullYear", x[u] = P + "Hours", x[h] = P + "Minutes", x[g] = P + "Seconds", x[d] = P + "Milliseconds", x)[E], o = E === y ? this.$D + ($ - this.$W) : $;
652
+ if (E === N || E === z) {
653
+ var w = this.clone().set(A, 1);
654
+ w.$d[i](o), w.init(), this.$d = w.set(A, Math.min(this.$D, w.daysInMonth())).$d;
655
+ } else i && this.$d[i](o);
617
656
  return this.init(), this;
618
- }, i.set = function(c, m) {
619
- return this.clone().$set(c, m);
620
- }, i.get = function(c) {
621
- return this[w.p(c)]();
622
- }, i.add = function(c, m) {
623
- var u, C = this;
624
- c = Number(c);
625
- var O = w.p(m), N = function(q) {
626
- var G = x(C);
627
- return w.w(G.date(G.date() + Math.round(q * c)), C);
657
+ }, l.set = function(m, $) {
658
+ return this.clone().$set(m, $);
659
+ }, l.get = function(m) {
660
+ return this[C.p(m)]();
661
+ }, l.add = function(m, $) {
662
+ var x, E = this;
663
+ m = Number(m);
664
+ var P = C.p($), i = function(j) {
665
+ var G = p(E);
666
+ return C.w(G.date(G.date() + Math.round(j * m)), E);
628
667
  };
629
- if (O === v) return this.set(v, this.$M + c);
630
- if (O === A) return this.set(A, this.$y + c);
631
- if (O === k) return N(1);
632
- if (O === p) return N(7);
633
- var S = (u = {}, u[g] = a, u[y] = o, u[f] = r, u)[O] || 1, I = this.$d.getTime() + c * S;
634
- return w.w(I, this);
635
- }, i.subtract = function(c, m) {
636
- return this.add(-1 * c, m);
637
- }, i.format = function(c) {
638
- var m = this, u = this.$locale();
639
- if (!this.isValid()) return u.invalidDate || T;
640
- var C = c || "YYYY-MM-DDTHH:mm:ssZ", O = w.z(this), N = this.$H, S = this.$m, I = this.$M, q = u.weekdays, G = u.months, ee = u.meridiem, te = function($, Z, U, Q) {
641
- return $ && ($[Z] || $(m, C)) || U[Z].slice(0, Q);
642
- }, ae = function($) {
643
- return w.s(N % 12 || 12, $, "0");
644
- }, re = ee || function($, Z, U) {
645
- var Q = $ < 12 ? "AM" : "PM";
646
- return U ? Q.toLowerCase() : Q;
668
+ if (P === N) return this.set(N, this.$M + m);
669
+ if (P === z) return this.set(z, this.$y + m);
670
+ if (P === y) return i(1);
671
+ if (P === f) return i(7);
672
+ var o = (x = {}, x[h] = a, x[u] = c, x[g] = n, x)[P] || 1, w = this.$d.getTime() + m * o;
673
+ return C.w(w, this);
674
+ }, l.subtract = function(m, $) {
675
+ return this.add(-1 * m, $);
676
+ }, l.format = function(m) {
677
+ var $ = this, x = this.$locale();
678
+ if (!this.isValid()) return x.invalidDate || W;
679
+ var E = m || "YYYY-MM-DDTHH:mm:ssZ", P = C.z(this), i = this.$H, o = this.$m, w = this.$M, j = x.weekdays, G = x.months, J = x.meridiem, B = function(ne, ie, se, ee) {
680
+ return ne && (ne[ie] || ne($, E)) || se[ie].slice(0, ee);
681
+ }, re = function(ne) {
682
+ return C.s(i % 12 || 12, ne, "0");
683
+ }, X = J || function(ne, ie, se) {
684
+ var ee = ne < 12 ? "AM" : "PM";
685
+ return se ? ee.toLowerCase() : ee;
647
686
  };
648
- return C.replace(D, (function($, Z) {
649
- return Z || (function(U) {
650
- switch (U) {
687
+ return E.replace(R, (function(ne, ie) {
688
+ return ie || (function(se) {
689
+ switch (se) {
651
690
  case "YY":
652
- return String(m.$y).slice(-2);
691
+ return String($.$y).slice(-2);
653
692
  case "YYYY":
654
- return w.s(m.$y, 4, "0");
693
+ return C.s($.$y, 4, "0");
655
694
  case "M":
656
- return I + 1;
695
+ return w + 1;
657
696
  case "MM":
658
- return w.s(I + 1, 2, "0");
697
+ return C.s(w + 1, 2, "0");
659
698
  case "MMM":
660
- return te(u.monthsShort, I, G, 3);
699
+ return B(x.monthsShort, w, G, 3);
661
700
  case "MMMM":
662
- return te(G, I);
701
+ return B(G, w);
663
702
  case "D":
664
- return m.$D;
703
+ return $.$D;
665
704
  case "DD":
666
- return w.s(m.$D, 2, "0");
705
+ return C.s($.$D, 2, "0");
667
706
  case "d":
668
- return String(m.$W);
707
+ return String($.$W);
669
708
  case "dd":
670
- return te(u.weekdaysMin, m.$W, q, 2);
709
+ return B(x.weekdaysMin, $.$W, j, 2);
671
710
  case "ddd":
672
- return te(u.weekdaysShort, m.$W, q, 3);
711
+ return B(x.weekdaysShort, $.$W, j, 3);
673
712
  case "dddd":
674
- return q[m.$W];
713
+ return j[$.$W];
675
714
  case "H":
676
- return String(N);
715
+ return String(i);
677
716
  case "HH":
678
- return w.s(N, 2, "0");
717
+ return C.s(i, 2, "0");
679
718
  case "h":
680
- return ae(1);
719
+ return re(1);
681
720
  case "hh":
682
- return ae(2);
721
+ return re(2);
683
722
  case "a":
684
- return re(N, S, !0);
723
+ return X(i, o, !0);
685
724
  case "A":
686
- return re(N, S, !1);
725
+ return X(i, o, !1);
687
726
  case "m":
688
- return String(S);
727
+ return String(o);
689
728
  case "mm":
690
- return w.s(S, 2, "0");
729
+ return C.s(o, 2, "0");
691
730
  case "s":
692
- return String(m.$s);
731
+ return String($.$s);
693
732
  case "ss":
694
- return w.s(m.$s, 2, "0");
733
+ return C.s($.$s, 2, "0");
695
734
  case "SSS":
696
- return w.s(m.$ms, 3, "0");
735
+ return C.s($.$ms, 3, "0");
697
736
  case "Z":
698
- return O;
737
+ return P;
699
738
  }
700
739
  return null;
701
- })($) || O.replace(":", "");
740
+ })(ne) || P.replace(":", "");
702
741
  }));
703
- }, i.utcOffset = function() {
742
+ }, l.utcOffset = function() {
704
743
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
705
- }, i.diff = function(c, m, u) {
706
- var C, O = this, N = w.p(m), S = x(c), I = (S.utcOffset() - this.utcOffset()) * a, q = this - S, G = function() {
707
- return w.m(O, S);
744
+ }, l.diff = function(m, $, x) {
745
+ var E, P = this, i = C.p($), o = p(m), w = (o.utcOffset() - this.utcOffset()) * a, j = this - o, G = function() {
746
+ return C.m(P, o);
708
747
  };
709
- switch (N) {
710
- case A:
711
- C = G() / 12;
712
- break;
713
- case v:
714
- C = G();
748
+ switch (i) {
749
+ case z:
750
+ E = G() / 12;
715
751
  break;
716
- case P:
717
- C = G() / 3;
752
+ case N:
753
+ E = G();
718
754
  break;
719
- case p:
720
- C = (q - I) / 6048e5;
755
+ case _:
756
+ E = G() / 3;
721
757
  break;
722
- case k:
723
- C = (q - I) / 864e5;
758
+ case f:
759
+ E = (j - w) / 6048e5;
724
760
  break;
725
761
  case y:
726
- C = q / o;
762
+ E = (j - w) / 864e5;
727
763
  break;
728
- case g:
729
- C = q / a;
764
+ case u:
765
+ E = j / c;
730
766
  break;
731
- case f:
732
- C = q / r;
767
+ case h:
768
+ E = j / a;
769
+ break;
770
+ case g:
771
+ E = j / n;
733
772
  break;
734
773
  default:
735
- C = q;
774
+ E = j;
736
775
  }
737
- return u ? C : w.a(C);
738
- }, i.daysInMonth = function() {
739
- return this.endOf(v).$D;
740
- }, i.$locale = function() {
741
- return b[this.$L];
742
- }, i.locale = function(c, m) {
743
- if (!c) return this.$L;
744
- var u = this.clone(), C = M(c, m, !0);
745
- return C && (u.$L = C), u;
746
- }, i.clone = function() {
747
- return w.w(this.$d, this);
748
- }, i.toDate = function() {
776
+ return x ? E : C.a(E);
777
+ }, l.daysInMonth = function() {
778
+ return this.endOf(N).$D;
779
+ }, l.$locale = function() {
780
+ return v[this.$L];
781
+ }, l.locale = function(m, $) {
782
+ if (!m) return this.$L;
783
+ var x = this.clone(), E = O(m, $, !0);
784
+ return E && (x.$L = E), x;
785
+ }, l.clone = function() {
786
+ return C.w(this.$d, this);
787
+ }, l.toDate = function() {
749
788
  return new Date(this.valueOf());
750
- }, i.toJSON = function() {
789
+ }, l.toJSON = function() {
751
790
  return this.isValid() ? this.toISOString() : null;
752
- }, i.toISOString = function() {
791
+ }, l.toISOString = function() {
753
792
  return this.$d.toISOString();
754
- }, i.toString = function() {
793
+ }, l.toString = function() {
755
794
  return this.$d.toUTCString();
756
- }, d;
757
- })(), F = L.prototype;
758
- return x.prototype = F, [["$ms", l], ["$s", f], ["$m", g], ["$H", y], ["$W", k], ["$M", v], ["$y", A], ["$D", H]].forEach((function(d) {
759
- F[d[1]] = function(i) {
760
- return this.$g(i, d[0], d[1]);
795
+ }, k;
796
+ })(), q = L.prototype;
797
+ return p.prototype = q, [["$ms", d], ["$s", g], ["$m", h], ["$H", u], ["$W", y], ["$M", N], ["$y", z], ["$D", A]].forEach((function(k) {
798
+ q[k[1]] = function(l) {
799
+ return this.$g(l, k[0], k[1]);
761
800
  };
762
- })), x.extend = function(d, i) {
763
- return d.$i || (d(i, L, x), d.$i = !0), x;
764
- }, x.locale = M, x.isDayjs = z, x.unix = function(d) {
765
- return x(1e3 * d);
766
- }, x.en = b[E], x.Ls = b, x.p = {}, x;
801
+ })), p.extend = function(k, l) {
802
+ return k.$i || (k(l, L, p), k.$i = !0), p;
803
+ }, p.locale = O, p.isDayjs = T, p.unix = function(k) {
804
+ return p(1e3 * k);
805
+ }, p.en = v[D], p.Ls = v, p.p = {}, p;
767
806
  }));
768
- })(ge)), ge.exports;
769
- }
770
- var Mr = $r();
771
- const De = /* @__PURE__ */ Nr(Mr);
772
- function ft() {
773
- const [e, t] = _(!1), [r, a] = _(!1), o = Y({ title: "" }), l = {
774
- confirm: (v) => {
775
- o.current = v, a(!1), t(!0);
807
+ })(Ce)), Ce.exports;
808
+ }
809
+ var Zr = Kr();
810
+ const Be = /* @__PURE__ */ Fr(Zr);
811
+ function Pt() {
812
+ const [e, r] = S(!1), [n, a] = S(!1), c = Y({ title: "" }), d = {
813
+ confirm: (N) => {
814
+ c.current = N, a(!1), r(!0);
776
815
  }
777
- }, f = async () => {
778
- var v, P;
816
+ }, g = async () => {
817
+ var N, _;
779
818
  a(!0);
780
819
  try {
781
- await ((P = (v = o.current).onOk) == null ? void 0 : P.call(v)), t(!1);
820
+ await ((_ = (N = c.current).onOk) == null ? void 0 : _.call(N)), r(!1);
782
821
  } finally {
783
822
  a(!1);
784
823
  }
785
- }, g = () => {
786
- var v, P;
787
- (P = (v = o.current).onCancel) == null || P.call(v), t(!1);
788
- }, y = o.current, k = y.okType === "danger", p = e ? at(
824
+ }, h = () => {
825
+ var N, _;
826
+ (_ = (N = c.current).onCancel) == null || _.call(N), r(!1);
827
+ }, u = c.current, y = u.okType === "danger", f = e ? vt(
789
828
  /* @__PURE__ */ s("div", { className: "fixed inset-0 z-[9998] flex items-center justify-center", children: [
790
- /* @__PURE__ */ n(
829
+ /* @__PURE__ */ t(
791
830
  "div",
792
831
  {
793
832
  className: "absolute inset-0 bg-black/40",
794
- onClick: g
833
+ onClick: h
795
834
  }
796
835
  ),
797
836
  /* @__PURE__ */ s("div", { className: "relative bg-white rounded-2xl shadow-xl w-full max-w-md mx-4 p-6", children: [
798
- /* @__PURE__ */ n("div", { className: "text-base font-semibold text-gray-800 mb-2", children: y.title }),
799
- y.content && /* @__PURE__ */ n("div", { className: "text-sm text-gray-600 mt-3", children: y.content }),
837
+ /* @__PURE__ */ t("div", { className: "text-base font-semibold text-gray-800 mb-2", children: u.title }),
838
+ u.content && /* @__PURE__ */ t("div", { className: "text-sm text-gray-600 mt-3", children: u.content }),
800
839
  /* @__PURE__ */ s("div", { className: "flex justify-end gap-2 mt-5", children: [
801
- /* @__PURE__ */ n(
840
+ /* @__PURE__ */ t(
802
841
  "button",
803
842
  {
804
843
  className: "px-4 py-1.5 rounded-lg border border-gray-200 text-sm text-gray-600 hover:bg-gray-50 transition-colors cursor-pointer",
805
- onClick: g,
806
- children: y.cancelText ?? "取消"
844
+ onClick: h,
845
+ children: u.cancelText ?? "取消"
807
846
  }
808
847
  ),
809
- /* @__PURE__ */ n(
848
+ /* @__PURE__ */ t(
810
849
  "button",
811
850
  {
812
- disabled: r,
813
- className: `px-4 py-1.5 rounded-lg text-white text-sm font-medium transition-colors disabled:opacity-50 cursor-pointer ${k ? "bg-red-500 hover:bg-red-600" : "bg-blue-500 hover:bg-blue-600"}`,
814
- onClick: f,
815
- children: r ? "处理中…" : y.okText ?? "确定"
851
+ disabled: n,
852
+ className: `px-4 py-1.5 rounded-lg text-white text-sm font-medium transition-colors disabled:opacity-50 cursor-pointer ${y ? "bg-red-500 hover:bg-red-600" : "bg-blue-500 hover:bg-blue-600"}`,
853
+ onClick: g,
854
+ children: n ? "处理中…" : u.okText ?? "确定"
816
855
  }
817
856
  )
818
857
  ] })
@@ -820,161 +859,165 @@ function ft() {
820
859
  ] }),
821
860
  document.body
822
861
  ) : null;
823
- return [l, p];
824
- }
825
- const gt = (e, t) => JSON.stringify([e.trim().replace(/\/+$/, ""), t]);
826
- function Cr({ article: e, groups: t, canLoadGroups: r, onRetry: a }) {
827
- var f;
828
- const o = e.navPlacements ?? [], l = (f = e.navname) == null ? void 0 : f.trim();
829
- return !e.navEnabled && !l && !o.length ? /* @__PURE__ */ n("span", { className: "text-xs text-gray-400", children: "未加入网站导航" }) : /* @__PURE__ */ s("div", { className: "min-w-0 space-y-2.5 py-0.5", children: [
830
- /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
831
- /* @__PURE__ */ n("span", { className: "min-w-0 break-words text-sm font-semibold text-gray-800", children: l || "未命名导航" }),
832
- /* @__PURE__ */ s(
833
- "span",
834
- {
835
- className: `inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium ${e.navEnabled ? "bg-emerald-50 text-emerald-700" : "bg-gray-100 text-gray-500"}`,
836
- title: e.navEnabled ? "已在以下位置展示" : "导航已关闭,保留以下位置配置",
837
- children: [
838
- /* @__PURE__ */ n("span", { "aria-hidden": "true", className: `h-1.5 w-1.5 rounded-full ${e.navEnabled ? "bg-emerald-500" : "bg-gray-400"}` }),
839
- e.navEnabled ? "展示中" : "已关闭"
840
- ]
841
- }
842
- )
862
+ return [d, f];
863
+ }
864
+ const Dt = (e, r) => JSON.stringify([e.trim().replace(/\/+$/, ""), r]);
865
+ function Se({ enabled: e, children: r }) {
866
+ return /* @__PURE__ */ s("span", { className: `inline-flex shrink-0 items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] font-medium leading-4 ${e ? "bg-emerald-50 text-emerald-700" : "bg-gray-100 text-gray-500"}`, children: [
867
+ /* @__PURE__ */ t("span", { "aria-hidden": "true", className: `h-1 w-1 shrink-0 rounded-full ${e ? "bg-emerald-500" : "bg-gray-400"}` }),
868
+ r
869
+ ] });
870
+ }
871
+ function Jr({ article: e }) {
872
+ var g, h;
873
+ const r = e.guidesDisplay, n = r == null ? void 0 : r.title.trim(), a = r == null ? void 0 : r.description.trim(), c = (g = r == null ? void 0 : r.category) == null ? void 0 : g.name.trim(), d = !!(r != null && r.categoryId || (h = r == null ? void 0 : r.category) != null && h.id || c);
874
+ return r ? /* @__PURE__ */ s("div", { className: "min-w-0 space-y-1", children: [
875
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2 leading-5", children: [
876
+ /* @__PURE__ */ t("span", { className: "w-6 shrink-0 text-xs text-gray-400", children: "标题" }),
877
+ /* @__PURE__ */ t("p", { title: n, className: "min-w-0 truncate text-sm font-medium text-gray-800", children: n || "未设置展示标题" }),
878
+ /* @__PURE__ */ t(Se, { enabled: !0, children: "已配置" })
843
879
  ] }),
844
- /* @__PURE__ */ s("div", { className: `space-y-1.5 ${e.navEnabled ? "" : "opacity-60"}`, children: [
845
- ["header", "footer"].map((g) => {
846
- const y = o.find((D) => D.position === g);
847
- if (!y) return null;
848
- const k = g === "header", p = k ? ct : ut, v = k ? "页眉" : "页尾", P = t[gt(e.host ?? "", g)], A = y.parentNavId ? P == null ? void 0 : P.names[y.parentNavId] : void 0, H = r && e.host && (!P || P.status === "loading"), T = A || (H ? "加载中…" : (P == null ? void 0 : P.status) === "error" ? "加载失败" : "父导航名称不可用"), W = [v, ...y.parentNavId ? [T] : [], l || "未命名导航"].join(" → ");
849
- return /* @__PURE__ */ s("div", { className: "flex min-w-0 items-start gap-2", "aria-label": W, title: W, children: [
850
- /* @__PURE__ */ s("span", { className: `inline-flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium leading-none ${k ? "bg-blue-50 text-blue-600" : "bg-violet-50 text-violet-600"}`, children: [
851
- /* @__PURE__ */ n(p, { size: 12, "aria-hidden": "true" }),
852
- v
853
- ] }),
854
- /* @__PURE__ */ n(Ue, { size: 12, className: "mt-0.5 shrink-0 text-gray-300", "aria-hidden": "true" }),
855
- /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-wrap items-center gap-x-1 gap-y-1 pt-0.5 text-xs leading-4", children: [
856
- y.parentNavId && /* @__PURE__ */ s(ue, { children: [
857
- /* @__PURE__ */ n("span", { className: `break-all ${A ? "text-gray-600" : "text-gray-400"}`, children: T }),
858
- (P == null ? void 0 : P.status) === "error" && /* @__PURE__ */ n("button", { type: "button", onClick: a, className: "cursor-pointer text-blue-500 hover:text-blue-600", children: "重试" }),
859
- /* @__PURE__ */ n(Ue, { size: 12, className: "shrink-0 text-gray-300", "aria-hidden": "true" })
860
- ] }),
861
- /* @__PURE__ */ n("span", { className: "break-all text-gray-700", children: l || "未命名导航" })
862
- ] })
863
- ] }, g);
864
- }),
865
- !o.length && /* @__PURE__ */ n("p", { className: "text-xs text-gray-400", children: "尚未设置展示位置" })
880
+ a && /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2 text-xs leading-5", children: [
881
+ /* @__PURE__ */ t("span", { className: "w-6 shrink-0 text-gray-400", children: "简介" }),
882
+ /* @__PURE__ */ t("p", { title: a, className: "truncate text-gray-500", children: a })
883
+ ] }),
884
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2 text-xs leading-5", children: [
885
+ /* @__PURE__ */ t("span", { className: "w-6 shrink-0 text-gray-400", children: "分类" }),
886
+ /* @__PURE__ */ t("p", { className: `truncate ${c ? "text-gray-600" : "text-gray-400"}`, title: c, children: c || (d ? "分类名称暂不可用" : "未分类") })
866
887
  ] })
888
+ ] }) : /* @__PURE__ */ t(Se, { enabled: !1, children: "未配置" });
889
+ }
890
+ function Xr({ article: e, groups: r, canLoadGroups: n, onRetry: a }) {
891
+ var g;
892
+ const c = e.navPlacements ?? [], d = (g = e.navname) == null ? void 0 : g.trim();
893
+ return !e.navEnabled && !d && !c.length ? /* @__PURE__ */ t(Se, { enabled: !1, children: "未设置" }) : /* @__PURE__ */ s("div", { className: "min-w-0 space-y-1", children: [
894
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2 leading-5", children: [
895
+ /* @__PURE__ */ t("span", { className: "w-12 shrink-0 text-xs text-gray-400", children: "导航名称" }),
896
+ /* @__PURE__ */ t("span", { title: d, className: "min-w-0 truncate text-sm font-medium text-gray-800", children: d || "尚未填写" }),
897
+ /* @__PURE__ */ t(Se, { enabled: !!e.navEnabled, children: e.navEnabled ? "已开启" : "已关闭" })
898
+ ] }),
899
+ e.navEnabled && ["header", "footer"].map((h) => {
900
+ const u = c.find((A) => A.position === h);
901
+ if (!u) return null;
902
+ const y = r[Dt(e.host ?? "", h)], f = u.parentNavId ? y == null ? void 0 : y.names[u.parentNavId] : void 0, N = n && e.host && (!y || y.status === "loading"), _ = u.parentNavId ? f ? `${f} 分组内` : N ? "正在加载分组…" : "分组名称加载失败" : "直接显示链接", z = h === "header" ? "页眉" : "页尾";
903
+ return /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2 text-xs leading-5", children: [
904
+ /* @__PURE__ */ t("span", { className: "w-12 shrink-0 text-gray-400", children: z }),
905
+ /* @__PURE__ */ t("span", { title: `${z}:${_}`, className: "truncate text-gray-600", children: _ }),
906
+ u.parentNavId && (y == null ? void 0 : y.status) === "error" && /* @__PURE__ */ t("button", { type: "button", onClick: a, className: "shrink-0 cursor-pointer text-blue-600 hover:underline", children: "重试" })
907
+ ] }, h);
908
+ }),
909
+ e.navEnabled && !c.length && /* @__PURE__ */ t("p", { className: "text-xs leading-5 text-amber-700", children: "未设置展示位置" })
867
910
  ] });
868
911
  }
869
- const Zn = () => {
870
- const { navigate: e } = Ve(), { basePath: t, service: r } = ve(), [a, o] = ft(), [l, f] = _(""), [g, y] = _(""), [k, p] = _(!1), [v, P] = _([]), [A, H] = _({}), [T, W] = _(0), [D, R] = _({
912
+ const $a = () => {
913
+ const { navigate: e } = Xe(), { basePath: r, service: n } = Ee(), [a, c] = Pt(), [d, g] = S(""), [h, u] = S(""), [y, f] = S(!1), [N, _] = S([]), [z, A] = S({}), [W, V] = S(0), [R, H] = S({
871
914
  current: 1,
872
915
  size: 15,
873
916
  total: 0
874
- }), V = (h) => {
875
- const z = h.trim();
876
- if (!z) return "";
917
+ }), F = (b) => {
918
+ const T = b.trim();
919
+ if (!T) return "";
877
920
  try {
878
921
  return new URL(
879
- z.startsWith("http") ? z : `https://${z}`
922
+ T.startsWith("http") ? T : `https://${T}`
880
923
  ).origin;
881
924
  } catch {
882
- return z;
925
+ return T;
883
926
  }
884
- }, j = async (h = D.current, z = D.size, M = l, x = g) => {
885
- p(!0);
927
+ }, M = async (b = R.current, T = R.size, O = d, p = h) => {
928
+ f(!0);
886
929
  try {
887
- const w = { page: h, size: z };
888
- M && (w.pathname = M);
889
- const L = V(x);
890
- L && (w.host = L);
891
- const F = await r.getList(w);
892
- P(F.items), R((d) => ({
893
- ...d,
894
- current: h,
895
- size: z,
896
- total: F.total ?? d.total
930
+ const C = { page: b, size: T };
931
+ O && (C.pathname = O);
932
+ const L = F(p);
933
+ L && (C.host = L);
934
+ const q = await n.getList(C);
935
+ _(q.items), H((k) => ({
936
+ ...k,
937
+ current: b,
938
+ size: T,
939
+ total: q.total ?? k.total
897
940
  }));
898
- } catch (w) {
899
- J.error(w.message || "获取文章失败");
941
+ } catch (C) {
942
+ ae.error(C.message || "获取文章失败");
900
943
  } finally {
901
- p(!1);
944
+ f(!1);
902
945
  }
903
946
  };
904
- K(() => {
905
- j(1);
906
- }, []), K(() => {
907
- if (!r.getNavigationGroups) return;
908
- let h = !0;
909
- const z = /* @__PURE__ */ new Map();
910
- for (const M of v)
911
- if (M.host)
912
- for (const x of M.navPlacements ?? []) {
913
- if (!x.parentNavId) continue;
914
- const w = M.host.trim().replace(/\/+$/, "");
915
- z.set(gt(w, x.position), { host: w, position: x.position });
947
+ te(() => {
948
+ M(1);
949
+ }, []), te(() => {
950
+ if (!n.getNavigationGroups) return;
951
+ let b = !0;
952
+ const T = /* @__PURE__ */ new Map();
953
+ for (const O of N)
954
+ if (O.host)
955
+ for (const p of O.navPlacements ?? []) {
956
+ if (!p.parentNavId) continue;
957
+ const C = O.host.trim().replace(/\/+$/, "");
958
+ T.set(Dt(C, p.position), { host: C, position: p.position });
916
959
  }
917
- H(Object.fromEntries([...z.keys()].map((M) => [M, { status: "loading", names: {} }])));
918
- for (const [M, x] of z)
960
+ A(Object.fromEntries([...T.keys()].map((O) => [O, { status: "loading", names: {} }])));
961
+ for (const [O, p] of T)
919
962
  (async () => {
920
963
  try {
921
- const w = await r.getNavigationGroups(x);
922
- if (!h) return;
923
- H((L) => ({ ...L, [M]: { status: "loaded", names: Object.fromEntries(w.map((F) => [F.id, F.name])) } }));
964
+ const C = await n.getNavigationGroups(p);
965
+ if (!b) return;
966
+ A((L) => ({ ...L, [O]: { status: "loaded", names: Object.fromEntries(C.map((q) => [q.id, q.name])) } }));
924
967
  } catch {
925
- if (!h) return;
926
- H((w) => ({ ...w, [M]: { status: "error", names: {} } }));
968
+ if (!b) return;
969
+ A((C) => ({ ...C, [O]: { status: "error", names: {} } }));
927
970
  }
928
971
  })();
929
972
  return () => {
930
- h = !1;
973
+ b = !1;
931
974
  };
932
- }, [v, r, T]);
933
- const E = (h) => {
975
+ }, [N, n, W]);
976
+ const D = (b) => {
934
977
  a.confirm({
935
978
  title: "删除文章",
936
- content: `确认删除 /${h.pathname}?`,
979
+ content: `确认删除 /${b.pathname}?`,
937
980
  okText: "删除",
938
981
  okType: "danger",
939
982
  cancelText: "取消",
940
983
  onOk: async () => {
941
- await r.delete(h.id), J.success("删除成功"), j(1);
984
+ await n.delete(b.id), ae.success("删除成功"), M(1);
942
985
  }
943
986
  });
944
- }, b = Math.ceil(D.total / D.size) || 1;
987
+ }, v = Math.ceil(R.total / R.size) || 1;
945
988
  return /* @__PURE__ */ s("div", { className: "min-w-0 bg-white rounded-xl shadow-sm border border-gray-100 p-5", children: [
946
- o,
989
+ c,
947
990
  /* @__PURE__ */ s(
948
991
  "form",
949
992
  {
950
993
  className: "flex flex-wrap items-center gap-2 mb-5",
951
- onSubmit: (h) => {
952
- h.preventDefault(), j(1);
994
+ onSubmit: (b) => {
995
+ b.preventDefault(), M(1);
953
996
  },
954
997
  children: [
955
998
  /* @__PURE__ */ s("div", { className: "relative w-full sm:w-52", children: [
956
- /* @__PURE__ */ n(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
957
- /* @__PURE__ */ n(
999
+ /* @__PURE__ */ t(ze, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
1000
+ /* @__PURE__ */ t(
958
1001
  "input",
959
1002
  {
960
1003
  className: "w-full pl-9 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
961
1004
  "aria-label": "搜索访问路径",
962
1005
  placeholder: "搜索访问路径",
963
- value: l,
964
- onChange: (h) => f(h.target.value)
1006
+ value: d,
1007
+ onChange: (b) => g(b.target.value)
965
1008
  }
966
1009
  )
967
1010
  ] }),
968
1011
  /* @__PURE__ */ s("div", { className: "relative w-full sm:w-52", children: [
969
- /* @__PURE__ */ n(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
970
- /* @__PURE__ */ n(
1012
+ /* @__PURE__ */ t(ze, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
1013
+ /* @__PURE__ */ t(
971
1014
  "input",
972
1015
  {
973
1016
  className: "w-full pl-9 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
974
1017
  "aria-label": "搜索网站地址",
975
1018
  placeholder: "搜索网站地址",
976
- value: g,
977
- onChange: (h) => y(h.target.value)
1019
+ value: h,
1020
+ onChange: (b) => u(b.target.value)
978
1021
  }
979
1022
  )
980
1023
  ] }),
@@ -984,7 +1027,7 @@ const Zn = () => {
984
1027
  type: "submit",
985
1028
  className: "flex items-center gap-1.5 px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm rounded-lg transition cursor-pointer",
986
1029
  children: [
987
- /* @__PURE__ */ n(Ce, { className: "w-3.5 h-3.5" }),
1030
+ /* @__PURE__ */ t(ze, { className: "w-3.5 h-3.5" }),
988
1031
  "搜索"
989
1032
  ]
990
1033
  }
@@ -995,456 +1038,792 @@ const Zn = () => {
995
1038
  type: "button",
996
1039
  className: "flex items-center gap-1.5 px-3 py-1.5 border border-gray-200 hover:bg-gray-50 text-gray-600 text-sm rounded-lg transition cursor-pointer",
997
1040
  onClick: () => {
998
- f(""), y(""), j(1, D.size, "", "");
1041
+ g(""), u(""), M(1, R.size, "", "");
999
1042
  },
1000
1043
  children: [
1001
- /* @__PURE__ */ n(fr, { className: "w-3.5 h-3.5" }),
1044
+ /* @__PURE__ */ t(Wr, { className: "w-3.5 h-3.5" }),
1002
1045
  "重置"
1003
1046
  ]
1004
1047
  }
1005
1048
  ),
1006
- /* @__PURE__ */ n("div", { className: "flex-1" }),
1007
- /* @__PURE__ */ s(
1008
- "button",
1009
- {
1010
- type: "button",
1011
- className: "flex items-center gap-1.5 px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm rounded-lg transition cursor-pointer",
1012
- onClick: () => e(`${t}/create`),
1013
- children: [
1014
- /* @__PURE__ */ n(ht, { className: "w-3.5 h-3.5" }),
1015
- "新增文章"
1016
- ]
1017
- }
1018
- )
1049
+ /* @__PURE__ */ t("div", { className: "flex-1" }),
1050
+ /* @__PURE__ */ s("button", { type: "button", onClick: () => e(`${r}/create`), className: "flex cursor-pointer items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-sm text-white transition hover:bg-blue-600", children: [
1051
+ /* @__PURE__ */ t(et, { size: 14, "aria-hidden": "true" }),
1052
+ "新增文章"
1053
+ ] })
1019
1054
  ]
1020
1055
  }
1021
1056
  ),
1022
- /* @__PURE__ */ n("div", { className: "relative overflow-x-auto", role: "region", "aria-label": "文章列表", tabIndex: 0, children: /* @__PURE__ */ s("table", { className: "w-full min-w-[1120px] table-fixed text-sm", children: [
1023
- /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ s("tr", { className: "border-b border-gray-100", children: [
1024
- /* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-36", children: "访问路径" }),
1025
- /* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-32", children: "网站地址" }),
1026
- /* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-80", children: "网站导航" }),
1027
- /* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide", children: "HTML 摘要" }),
1028
- /* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-36", children: "创建时间" }),
1029
- /* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-60", children: "操作" })
1057
+ /* @__PURE__ */ t("div", { className: "relative overflow-x-auto", role: "region", "aria-label": "文章列表", tabIndex: 0, children: /* @__PURE__ */ s("table", { className: "w-full min-w-[1120px] table-fixed text-left text-sm", children: [
1058
+ /* @__PURE__ */ s("colgroup", { children: [
1059
+ /* @__PURE__ */ t("col", { style: { width: "8%" } }),
1060
+ /* @__PURE__ */ t("col", { style: { width: "16%" } }),
1061
+ /* @__PURE__ */ t("col", { style: { width: "24%" } }),
1062
+ /* @__PURE__ */ t("col", { style: { width: "23%" } }),
1063
+ /* @__PURE__ */ t("col", { style: { width: "13%" } }),
1064
+ /* @__PURE__ */ t("col", { style: { width: "16%" } })
1065
+ ] }),
1066
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ s("tr", { className: "border-b border-gray-100", children: [
1067
+ /* @__PURE__ */ t("th", { scope: "col", className: "px-3 py-2.5 text-xs font-medium tracking-wide text-gray-400", children: "访问路径" }),
1068
+ /* @__PURE__ */ t("th", { scope: "col", className: "px-3 py-2.5 text-xs font-medium tracking-wide text-gray-400", children: "访问地址" }),
1069
+ /* @__PURE__ */ t("th", { scope: "col", className: "px-3 py-2.5 text-xs font-medium tracking-wide text-gray-400", children: "Guides 配置" }),
1070
+ /* @__PURE__ */ t("th", { scope: "col", className: "px-3 py-2.5 text-xs font-medium tracking-wide text-gray-400", children: "网站导航" }),
1071
+ /* @__PURE__ */ t("th", { scope: "col", className: "px-3 py-2.5 text-xs font-medium tracking-wide text-gray-400", children: "创建时间" }),
1072
+ /* @__PURE__ */ t("th", { scope: "col", className: "sticky right-0 z-10 bg-white px-3 py-2.5 text-right text-xs font-medium tracking-wide text-gray-400", children: "操作" })
1030
1073
  ] }) }),
1031
- /* @__PURE__ */ n("tbody", { children: k ? /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: 6, className: "py-16 text-center", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2 text-gray-400", children: [
1032
- /* @__PURE__ */ n(lt, { className: "w-6 h-6 text-blue-400 animate-spin" }),
1033
- /* @__PURE__ */ n("span", { className: "text-sm", children: "加载中…" })
1034
- ] }) }) }) : v.length === 0 ? /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: 6, className: "py-16 text-center", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: [
1035
- /* @__PURE__ */ n(ar, { className: "w-10 h-10" }),
1036
- /* @__PURE__ */ n("span", { className: "text-sm", children: "暂无文章" })
1037
- ] }) }) }) : v.map((h) => {
1038
- const z = (h.content || "").replace(/<(style|script)\b[^>]*>[\s\S]*?<\/\1>/gi, " ").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim().slice(0, 80);
1039
- return /* @__PURE__ */ s(
1040
- "tr",
1041
- {
1042
- className: "border-b border-gray-50 hover:bg-gray-50/60 transition-colors",
1043
- children: [
1044
- /* @__PURE__ */ n("td", { className: "py-3 px-3", children: /* @__PURE__ */ s("span", { className: "block break-words font-mono text-xs text-gray-700", children: [
1045
- "/",
1046
- h.pathname
1047
- ] }) }),
1048
- /* @__PURE__ */ n("td", { className: "py-3 px-3", children: h.host ? /* @__PURE__ */ s(
1049
- "a",
1050
- {
1051
- href: h.host,
1052
- target: "_blank",
1053
- rel: "noopener noreferrer",
1054
- className: "inline-flex max-w-full items-center gap-1 text-xs text-blue-600 underline underline-offset-2 hover:text-blue-800 transition-colors",
1055
- title: h.host,
1056
- children: [
1057
- /* @__PURE__ */ n("span", { className: "truncate", children: h.host.replace(/^https?:\/\//, "") }),
1058
- /* @__PURE__ */ n(Xt, { className: "w-3 h-3 shrink-0" })
1059
- ]
1060
- }
1061
- ) : /* @__PURE__ */ n("span", { className: "text-xs text-gray-300", children: "—" }) }),
1062
- /* @__PURE__ */ n("td", { className: "py-3 px-3", children: /* @__PURE__ */ n(Cr, { article: h, groups: A, canLoadGroups: !!r.getNavigationGroups, onRetry: () => W((M) => M + 1) }) }),
1063
- /* @__PURE__ */ n("td", { className: "py-3 px-3", children: z ? /* @__PURE__ */ n(
1064
- "span",
1065
- {
1066
- className: "text-sm text-gray-500 truncate block max-w-sm",
1067
- title: z,
1068
- children: z
1069
- }
1070
- ) : /* @__PURE__ */ n("span", { className: "text-xs text-gray-300", children: "暂无内容" }) }),
1071
- /* @__PURE__ */ n("td", { className: "py-3 px-3 text-xs whitespace-nowrap text-gray-400", children: h.createdAt ? De(h.createdAt).format(
1072
- "YYYY/MM/DD HH:mm"
1073
- ) : "—" }),
1074
- /* @__PURE__ */ n("td", { className: "py-3 px-3", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
1075
- h.host && /* @__PURE__ */ n(
1076
- "button",
1077
- {
1078
- className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 text-gray-600 transition cursor-pointer",
1079
- onClick: () => window.open(
1080
- `${h.host.replace(/\/$/, "")}/${h.pathname}`,
1081
- "_blank"
1082
- ),
1083
- children: "跳转"
1084
- }
1085
- ),
1086
- /* @__PURE__ */ n(
1087
- "button",
1088
- {
1089
- className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 text-gray-600 transition cursor-pointer",
1090
- onClick: () => e(
1091
- `${t}/${h.id}/detail`,
1092
- { state: { record: h } }
1093
- ),
1094
- children: "详情"
1095
- }
1096
- ),
1097
- /* @__PURE__ */ n(
1098
- "button",
1099
- {
1100
- className: "px-2.5 py-1 text-xs bg-blue-500 hover:bg-blue-600 text-white rounded-md transition cursor-pointer",
1101
- onClick: () => e(
1102
- `${t}/${h.id}/edit`,
1103
- { state: { record: h } }
1104
- ),
1105
- children: "编辑"
1106
- }
1107
- ),
1108
- /* @__PURE__ */ n(
1109
- "button",
1110
- {
1111
- className: "px-2.5 py-1 text-xs bg-red-500 hover:bg-red-600 text-white rounded-md transition cursor-pointer",
1112
- onClick: () => E(h),
1113
- children: "删除"
1114
- }
1115
- )
1116
- ] }) })
1117
- ]
1118
- },
1119
- h.id
1120
- );
1074
+ /* @__PURE__ */ t("tbody", { children: y || N.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: 6, className: "py-16 text-center", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2 text-gray-400", children: [
1075
+ y ? /* @__PURE__ */ t(Pe, { className: "h-6 w-6 animate-spin text-blue-400" }) : /* @__PURE__ */ t(Or, { className: "h-10 w-10 text-gray-300" }),
1076
+ /* @__PURE__ */ t("span", { className: "text-sm", children: y ? "正在加载文章…" : "暂无文章" })
1077
+ ] }) }) }) : N.map((b) => {
1078
+ const T = `/${b.pathname.replace(/^\/+/, "")}`, O = b.host ? `${b.host.replace(/\/+$/, "")}${T}` : void 0;
1079
+ return /* @__PURE__ */ s("tr", { className: "group border-b border-gray-50 transition-colors hover:bg-gray-50/60", children: [
1080
+ /* @__PURE__ */ t("td", { className: "px-3 py-3 align-middle", children: /* @__PURE__ */ t("button", { type: "button", onClick: () => e(`${r}/${b.id}/detail`, { state: { record: b } }), title: T, className: "block max-w-full cursor-pointer truncate text-left font-mono text-xs text-gray-700 hover:text-blue-600 focus-visible:outline-2 focus-visible:outline-blue-500", children: T }) }),
1081
+ /* @__PURE__ */ t("td", { className: "px-3 py-3 align-middle", children: O ? /* @__PURE__ */ s("a", { href: O, target: "_blank", rel: "noopener noreferrer", title: O, className: "inline-flex max-w-full items-center gap-1 text-xs text-blue-600 underline underline-offset-2 hover:text-blue-800", children: [
1082
+ /* @__PURE__ */ t("span", { className: "truncate", children: O.replace(/^https?:\/\//, "") }),
1083
+ /* @__PURE__ */ t(kr, { size: 12, className: "shrink-0", "aria-hidden": "true" })
1084
+ ] }) : /* @__PURE__ */ t("span", { className: "text-xs text-gray-400", children: "未填写" }) }),
1085
+ /* @__PURE__ */ t("td", { className: "px-3 py-3 align-middle", children: /* @__PURE__ */ t(Jr, { article: b }) }),
1086
+ /* @__PURE__ */ t("td", { className: "px-3 py-3 align-middle", children: /* @__PURE__ */ t(Xr, { article: b, groups: z, canLoadGroups: !!n.getNavigationGroups, onRetry: () => V((p) => p + 1) }) }),
1087
+ /* @__PURE__ */ t("td", { className: "whitespace-nowrap px-3 py-3 align-middle text-xs text-gray-400", children: b.createdAt ? Be(b.createdAt).format("YYYY/MM/DD HH:mm") : "—" }),
1088
+ /* @__PURE__ */ t("td", { className: "sticky right-0 z-10 bg-white px-3 py-3 text-right align-middle transition-colors group-hover:bg-gray-50", children: /* @__PURE__ */ s("div", { className: "flex items-center justify-end gap-1", children: [
1089
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => e(`${r}/${b.id}/detail`, { state: { record: b } }), className: "cursor-pointer whitespace-nowrap rounded-md border border-gray-200 px-2.5 py-1 text-xs text-gray-600 transition hover:bg-gray-50", children: "详情" }),
1090
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => e(`${r}/${b.id}/edit`), className: "cursor-pointer whitespace-nowrap rounded-md bg-blue-500 px-2.5 py-1 text-xs text-white transition hover:bg-blue-600", children: "编辑" }),
1091
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => D(b), className: "cursor-pointer whitespace-nowrap rounded-md bg-red-500 px-2.5 py-1 text-xs text-white transition hover:bg-red-600", children: "删除" })
1092
+ ] }) })
1093
+ ] }, b.id);
1121
1094
  }) })
1122
1095
  ] }) }),
1123
- D.total > 0 && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-3 pt-4 mt-2 border-t border-gray-100", children: [
1096
+ R.total > 0 && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-3 pt-4 mt-2 border-t border-gray-100", children: [
1124
1097
  /* @__PURE__ */ s("span", { className: "text-xs text-gray-400", children: [
1125
1098
  "共 ",
1126
- D.total,
1099
+ R.total,
1127
1100
  " 篇文章"
1128
1101
  ] }),
1129
1102
  /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-1", children: [
1130
- /* @__PURE__ */ n(
1103
+ /* @__PURE__ */ t(
1131
1104
  "button",
1132
1105
  {
1133
1106
  className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 disabled:opacity-40 disabled:cursor-not-allowed text-gray-600 transition cursor-pointer",
1134
- disabled: D.current <= 1,
1135
- onClick: () => j(D.current - 1),
1107
+ disabled: R.current <= 1,
1108
+ onClick: () => M(R.current - 1),
1136
1109
  children: "上一页"
1137
1110
  }
1138
1111
  ),
1139
1112
  /* @__PURE__ */ s("span", { className: "px-3 py-1 text-xs text-gray-500", children: [
1140
- D.current,
1113
+ R.current,
1141
1114
  " / ",
1142
- b
1115
+ v
1143
1116
  ] }),
1144
- /* @__PURE__ */ n(
1117
+ /* @__PURE__ */ t(
1145
1118
  "button",
1146
1119
  {
1147
1120
  className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 disabled:opacity-40 disabled:cursor-not-allowed text-gray-600 transition cursor-pointer",
1148
- disabled: D.current >= b,
1149
- onClick: () => j(D.current + 1),
1121
+ disabled: R.current >= v,
1122
+ onClick: () => M(R.current + 1),
1150
1123
  children: "下一页"
1151
1124
  }
1152
1125
  ),
1153
- /* @__PURE__ */ n(
1126
+ /* @__PURE__ */ t(
1154
1127
  "select",
1155
1128
  {
1156
1129
  "aria-label": "每页条数",
1157
1130
  className: "ml-2 text-xs border border-gray-200 rounded-md px-1.5 py-1 text-gray-600 focus:outline-none focus:ring-1 focus:ring-blue-400 cursor-pointer",
1158
- value: D.size,
1159
- onChange: (h) => j(1, Number(h.target.value)),
1160
- children: [10, 15, 20, 50].map((h) => /* @__PURE__ */ s("option", { value: h, children: [
1161
- h,
1131
+ value: R.size,
1132
+ onChange: (b) => M(1, Number(b.target.value)),
1133
+ children: [10, 15, 20, 50].map((b) => /* @__PURE__ */ s("option", { value: b, children: [
1134
+ b,
1162
1135
  " 条/页"
1163
- ] }, h))
1136
+ ] }, b))
1164
1137
  }
1165
1138
  )
1166
1139
  ] })
1167
1140
  ] })
1168
1141
  ] });
1169
- }, Sr = [
1170
- { position: "header", label: "页眉", icon: ct, parentEnabled: !1 },
1171
- { position: "footer", label: "页尾", icon: ut, parentEnabled: !0 }
1172
- ], ze = "w-full min-w-0 rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm text-gray-700 outline-none transition focus:border-blue-400 focus:ring-2 focus:ring-blue-500/20";
1173
- function jr({ host: e, position: t, label: r, parentEnabled: a, service: o, parentNavId: l, onSelect: f }) {
1174
- const g = Ie(), [y, k] = _([]), [p, v] = _(!1), [P, A] = _(""), [H, T] = _(!1), [W, D] = _(""), [R, V] = _(""), [j, E] = _(!1), b = Y(0), h = Y(0), z = Y(f);
1175
- z.current = f;
1176
- const M = o.getNavigationGroups, x = o.createNavigationGroup, w = xe(async () => {
1177
- if (!e || !M) return;
1178
- const d = ++h.current;
1179
- v(!0), A("");
1142
+ };
1143
+ function It({ items: e, label: r, description: n, presentation: a = "inline", saveOrder: c, onSaved: d, onCancel: g }) {
1144
+ const h = we(), [u, y] = S(() => [...e]), [f, N] = S(!1), [_, z] = S(""), [A, W] = S(""), [V, R] = S(null), [H, F] = S(null), M = Y(null), D = Y(null), v = Y(null), b = Y(null), T = Y(/* @__PURE__ */ new Map()), O = Y(null), p = Y(!1), C = Y(!1);
1145
+ te(() => {
1146
+ p.current = !0;
1147
+ const i = T.current;
1148
+ return () => {
1149
+ p.current = !1, O.current && clearTimeout(O.current), i.forEach((o) => o.cancel());
1150
+ };
1151
+ }, []);
1152
+ const L = () => window.matchMedia("(prefers-reduced-motion: reduce)").matches, q = () => {
1153
+ var i;
1154
+ return Array.from(((i = D.current) == null ? void 0 : i.querySelectorAll("[data-order-id]")) ?? []);
1155
+ }, k = () => {
1156
+ b.current = new Map(q().map((i) => [i.dataset.orderId, i.getBoundingClientRect().top]));
1157
+ };
1158
+ bt(() => {
1159
+ const i = b.current;
1160
+ b.current = null;
1161
+ const o = q();
1162
+ if (T.current.forEach((j) => j.cancel()), T.current.clear(), !i || L()) return;
1163
+ o.map((j) => ({ row: j, delta: (i.get(j.dataset.orderId) ?? j.getBoundingClientRect().top) - j.getBoundingClientRect().top })).forEach(({ row: j, delta: G }) => {
1164
+ var J;
1165
+ j.dataset.orderId === ((J = v.current) == null ? void 0 : J.id) || Math.abs(G) < 1 || T.current.set(j, j.animate([
1166
+ { transform: `translateY(${G}px)` },
1167
+ { transform: "translateY(0)" }
1168
+ ], { duration: 210, easing: "cubic-bezier(0.22, 1, 0.36, 1)" }));
1169
+ });
1170
+ }, [u]);
1171
+ const l = u.some((i, o) => {
1172
+ var w;
1173
+ return i.id !== ((w = e[o]) == null ? void 0 : w.id);
1174
+ }), m = (i, o) => {
1175
+ const w = i + o;
1176
+ if (C.current || v.current || w < 0 || w >= u.length) return;
1177
+ const j = [...u];
1178
+ [j[i], j[w]] = [j[w], j[i]], k(), y(j), z(""), W(`${u[i].name}已移至第 ${w + 1} 位`);
1179
+ }, $ = (i, o) => {
1180
+ var J;
1181
+ if (C.current || v.current || !i.isPrimary || i.button !== 0) return;
1182
+ const w = i.currentTarget.closest("[data-order-id]");
1183
+ if (!w || !D.current) return;
1184
+ const j = w.getBoundingClientRect(), G = D.current.getBoundingClientRect();
1185
+ (J = D.current) == null || J.setPointerCapture(i.pointerId), v.current = { id: o.id, pointerId: i.pointerId, original: [...u], startX: i.clientX, offsetY: i.clientY - j.top, height: j.height, phase: "dragging" }, F({ item: o, index: u.findIndex((B) => B.id === o.id), height: j.height, top: j.top - G.top }), R(o.id), z(""), W(`已拿起${o.name},上下拖动调整顺序,按 Escape 取消。`);
1186
+ }, x = (i) => {
1187
+ const o = v.current;
1188
+ if (!o || o.phase !== "dragging" || o.pointerId !== i.pointerId || !D.current) return;
1189
+ const w = i.clientY, j = D.current.getBoundingClientRect(), G = Math.max(0, Math.min(j.height - o.height, w - j.top - o.offsetY)), J = Math.max(-16, Math.min(16, i.clientX - o.startX)), B = q(), re = G + o.height / 2, X = B.find((ee) => re >= ee.offsetTop && re <= ee.offsetTop + ee.offsetHeight), ne = X == null ? void 0 : X.dataset.orderId, ie = u.findIndex((ee) => ee.id === o.id), se = u.findIndex((ee) => ee.id === ne);
1190
+ if (X && ie >= 0 && se >= 0 && ie !== se && (ie < se ? re >= X.offsetTop + X.offsetHeight / 2 : re <= X.offsetTop + X.offsetHeight / 2)) {
1191
+ k();
1192
+ const ee = [...u], [Ie] = ee.splice(ie, 1);
1193
+ ee.splice(se, 0, Ie), y(ee);
1194
+ }
1195
+ M.current && (M.current.style.transform = `translate3d(${J}px, ${G}px, 0)`);
1196
+ }, E = (i = !1) => {
1197
+ var J, B;
1198
+ const o = v.current;
1199
+ if (!o || o.phase === "dropping") return;
1200
+ o.phase = "dropping", (J = D.current) != null && J.hasPointerCapture(o.pointerId) && D.current.releasePointerCapture(o.pointerId);
1201
+ const w = () => {
1202
+ v.current = null, O.current = null, R(null), F(null);
1203
+ };
1204
+ if (i) {
1205
+ k(), y(o.original), W("已取消本次拖动。"), w();
1206
+ return;
1207
+ }
1208
+ const j = u.findIndex((re) => re.id === o.id);
1209
+ W(`${((B = u[j]) == null ? void 0 : B.name) ?? r}已移至第 ${j + 1} 位。`);
1210
+ const G = q().find((re) => re.dataset.orderId === o.id);
1211
+ if (!M.current || !G || L()) {
1212
+ w();
1213
+ return;
1214
+ }
1215
+ M.current.dataset.dropping = "true", M.current.style.transform = `translate3d(0, ${G.offsetTop}px, 0)`, O.current = setTimeout(w, 190);
1216
+ }, P = async () => {
1217
+ if (!(!l || C.current || v.current)) {
1218
+ C.current = !0, N(!0), z("");
1219
+ try {
1220
+ const i = await c(u.map((o) => o.id));
1221
+ p.current && d(i);
1222
+ } catch (i) {
1223
+ if (p.current) {
1224
+ const o = i == null ? void 0 : i.status;
1225
+ z(o === 404 || o === 405 || o === 501 ? `当前服务暂不支持保存${r}顺序,请联系管理员开通。` : o === 409 ? `${r}已发生变化,请取消后重新打开排序。` : i instanceof Error ? i.message : "顺序保存失败,请重试");
1226
+ }
1227
+ } finally {
1228
+ C.current = !1, p.current && N(!1);
1229
+ }
1230
+ }
1231
+ };
1232
+ return /* @__PURE__ */ s("section", { "aria-labelledby": `${h}-title`, "aria-busy": f, className: a === "dialog" ? "p-6" : "mt-3 rounded-lg border border-gray-200 bg-white p-3", children: [
1233
+ /* @__PURE__ */ s("h3", { id: `${h}-title`, className: "text-sm font-medium text-gray-700", children: [
1234
+ r,
1235
+ "顺序"
1236
+ ] }),
1237
+ /* @__PURE__ */ t("p", { className: "mt-1 text-xs leading-5 text-gray-500", children: n }),
1238
+ /* @__PURE__ */ t("p", { id: `${h}-drag-hint`, className: "mt-1 text-xs text-gray-400", children: "拖动左侧手柄或点击上下箭头调整,完成后保存顺序。" }),
1239
+ /* @__PURE__ */ s(
1240
+ "ol",
1241
+ {
1242
+ ref: D,
1243
+ "aria-label": `${r}展示顺序`,
1244
+ className: `aisee-order-list relative mt-3 space-y-2 ${V ? "aisee-order-list--dragging select-none" : ""}`,
1245
+ onPointerMove: x,
1246
+ onPointerUp: (i) => {
1247
+ var o;
1248
+ ((o = v.current) == null ? void 0 : o.pointerId) === i.pointerId && E();
1249
+ },
1250
+ onPointerCancel: () => E(!0),
1251
+ onLostPointerCapture: () => E(!0),
1252
+ children: [
1253
+ u.map((i, o) => /* @__PURE__ */ s("li", { "data-order-id": i.id, className: `aisee-order-row relative flex min-w-0 items-center gap-2 rounded-lg border px-2.5 py-2 ${V === i.id ? "aisee-order-row--placeholder" : "border-gray-100 bg-white"}`, children: [
1254
+ /* @__PURE__ */ t(
1255
+ "button",
1256
+ {
1257
+ type: "button",
1258
+ "aria-label": `拖动 ${i.name}`,
1259
+ "aria-describedby": `${h}-drag-hint`,
1260
+ disabled: f,
1261
+ onPointerDown: (w) => $(w, i),
1262
+ onKeyDown: (w) => {
1263
+ w.key === "Escape" && v.current && (w.preventDefault(), w.stopPropagation(), E(!0)), (w.key === "ArrowUp" || w.key === "ArrowDown") && (w.preventDefault(), m(o, w.key === "ArrowUp" ? -1 : 1));
1264
+ },
1265
+ className: `flex h-8 w-8 shrink-0 touch-none select-none items-center justify-center rounded-md text-gray-400 hover:bg-gray-100 hover:text-gray-600 focus-visible:outline-2 focus-visible:outline-blue-500 disabled:cursor-not-allowed disabled:opacity-30 ${V === i.id ? "cursor-grabbing" : "cursor-grab"}`,
1266
+ children: /* @__PURE__ */ t(ct, { size: 16, "aria-hidden": "true" })
1267
+ }
1268
+ ),
1269
+ /* @__PURE__ */ t("span", { "aria-hidden": "true", className: "w-5 shrink-0 text-xs text-gray-400", children: o + 1 }),
1270
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 break-words text-sm text-gray-700", children: i.name }),
1271
+ /* @__PURE__ */ t("button", { type: "button", "aria-label": `上移 ${i.name}`, disabled: f || o === 0, onClick: () => m(o, -1), className: "flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-gray-200 text-gray-500 enabled:hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-30", children: /* @__PURE__ */ t(hr, { size: 14, "aria-hidden": "true" }) }),
1272
+ /* @__PURE__ */ t("button", { type: "button", "aria-label": `下移 ${i.name}`, disabled: f || o === u.length - 1, onClick: () => m(o, 1), className: "flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-gray-200 text-gray-500 enabled:hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-30", children: /* @__PURE__ */ t(lr, { size: 14, "aria-hidden": "true" }) }),
1273
+ V === i.id && /* @__PURE__ */ s("span", { "aria-hidden": "true", className: "aisee-order-placeholder-label", children: [
1274
+ "放到这里 · 第 ",
1275
+ o + 1,
1276
+ " 位"
1277
+ ] })
1278
+ ] }, i.id)),
1279
+ H && /* @__PURE__ */ t("li", { ref: M, "aria-hidden": "true", className: "aisee-order-floating", style: { height: H.height, transform: `translate3d(0, ${H.top}px, 0)` }, children: /* @__PURE__ */ s("div", { className: "aisee-order-floating-card", children: [
1280
+ /* @__PURE__ */ t(ct, { size: 16, className: "shrink-0 text-blue-500" }),
1281
+ /* @__PURE__ */ t("span", { className: "w-5 shrink-0 text-xs text-blue-400", children: H.index + 1 }),
1282
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 break-words text-sm font-medium text-gray-800", children: H.item.name }),
1283
+ /* @__PURE__ */ t("span", { className: "shrink-0 rounded-md bg-blue-100 px-2 py-1 text-xs font-medium text-blue-600", children: "拖动中" })
1284
+ ] }) })
1285
+ ]
1286
+ }
1287
+ ),
1288
+ /* @__PURE__ */ t("span", { role: "status", className: "sr-only", children: A }),
1289
+ _ && /* @__PURE__ */ t("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: _ }),
1290
+ /* @__PURE__ */ s("div", { className: "mt-3 flex flex-wrap justify-end gap-2", children: [
1291
+ /* @__PURE__ */ t("button", { type: "button", disabled: f, onClick: g, className: "cursor-pointer rounded-lg border border-gray-200 px-3 py-1.5 text-xs text-gray-600 hover:bg-gray-50 disabled:opacity-50", children: "取消" }),
1292
+ /* @__PURE__ */ s("button", { type: "button", disabled: f || !l, onClick: () => void P(), className: "flex cursor-pointer items-center gap-1 rounded-lg bg-blue-500 px-3 py-1.5 text-xs text-white hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50", children: [
1293
+ f && /* @__PURE__ */ t(Pe, { size: 12, className: "animate-spin", "aria-hidden": "true" }),
1294
+ f ? "保存中…" : "保存顺序"
1295
+ ] })
1296
+ ] })
1297
+ ] });
1298
+ }
1299
+ function Qr({ host: e, position: r, groups: n, reorder: a, onSaved: c, onCancel: d }) {
1300
+ return /* @__PURE__ */ t(
1301
+ It,
1302
+ {
1303
+ items: n,
1304
+ label: "父导航",
1305
+ description: "前台按此顺序从左到右展示。保存后对该网站的所有文章生效。",
1306
+ presentation: "dialog",
1307
+ saveOrder: (g) => a({ host: e, position: r, groupIds: g }),
1308
+ onSaved: c,
1309
+ onCancel: d
1310
+ }
1311
+ );
1312
+ }
1313
+ function Lt({ id: e, open: r, busy: n, label: a, onDismiss: c, children: d }) {
1314
+ const g = Y(null);
1315
+ return te(() => {
1316
+ var h, u, y;
1317
+ r && !((h = g.current) != null && h.open) && ((u = g.current) == null || u.showModal()), !r && ((y = g.current) != null && y.open) && g.current.close();
1318
+ }, [r]), /* @__PURE__ */ t("dialog", { ref: g, id: e, "aria-label": a, onCancel: (h) => {
1319
+ h.preventDefault(), n || c();
1320
+ }, className: "m-auto max-h-[85vh] w-[calc(100%_-_2rem)] max-w-xl overflow-y-auto rounded-2xl border border-gray-200 bg-white p-0 text-gray-700 shadow-xl backdrop:bg-black/30", children: d });
1321
+ }
1322
+ const en = [
1323
+ { position: "header", label: "页眉", icon: Pr, parentEnabled: !1 },
1324
+ { position: "footer", label: "页尾", icon: zr, parentEnabled: !0 }
1325
+ ], Fe = "w-full min-w-0 rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm text-gray-700 outline-none transition focus:border-blue-400 focus:ring-2 focus:ring-blue-500/20";
1326
+ function tn({ host: e, position: r, label: n, parentEnabled: a, service: c, parentNavId: d, onSelect: g }) {
1327
+ const h = we(), [u, y] = S([]), [f, N] = S(!1), [_, z] = S(""), [A, W] = S(!1), [V, R] = S(""), [H, F] = S(""), [M, D] = S(!1), [v, b] = S(!1), [T, O] = S(!1), [p, C] = S(!1), L = Y(0), q = Y(0), k = Y(g);
1328
+ k.current = g;
1329
+ const l = c.getNavigationGroups, m = c.createNavigationGroup, $ = c.reorderNavigationGroups, x = Me(async () => {
1330
+ if (!e || !l) return;
1331
+ const o = ++q.current;
1332
+ N(!0), z("");
1180
1333
  try {
1181
- const i = await M({ host: e, position: t });
1182
- return d !== h.current ? void 0 : (k(i), i);
1183
- } catch (i) {
1184
- d === h.current && A(i instanceof Error ? i.message : "父导航加载失败");
1334
+ const w = await l({ host: e, position: r });
1335
+ return o !== q.current ? void 0 : (y(w), w);
1336
+ } catch (w) {
1337
+ o === q.current && z(w instanceof Error ? w.message : "父导航加载失败");
1185
1338
  } finally {
1186
- d === h.current && v(!1);
1339
+ o === q.current && N(!1);
1187
1340
  }
1188
- }, [e, t, M]);
1189
- K(() => (b.current++, w(), () => {
1190
- b.current++, h.current++;
1191
- }), [w]);
1192
- const L = async () => {
1193
- if (j || !x || !a) return;
1194
- const d = W.trim();
1195
- if (!d) {
1196
- V("请输入父导航名称");
1341
+ }, [e, r, l]);
1342
+ te(() => (L.current++, x(), () => {
1343
+ L.current++, q.current++;
1344
+ }), [x]);
1345
+ const E = async () => {
1346
+ if (M || !m || !a) return;
1347
+ const o = V.trim();
1348
+ if (!o) {
1349
+ F("请输入父导航名称");
1197
1350
  return;
1198
1351
  }
1199
- const i = y.find((m) => m.name === d);
1200
- if (i) {
1201
- z.current(i.id), T(!1);
1352
+ const w = u.find((G) => G.name === o);
1353
+ if (w) {
1354
+ k.current(w.id), W(!1);
1202
1355
  return;
1203
1356
  }
1204
- const c = b.current;
1205
- E(!0), V("");
1357
+ const j = L.current;
1358
+ D(!0), F("");
1206
1359
  try {
1207
- const m = await x({ host: e, position: t, name: d });
1208
- if (c !== b.current) return;
1209
- k((u) => [...u.filter((C) => C.id !== m.id), m]), z.current(m.id), T(!1), D(""), w();
1210
- } catch (m) {
1211
- if (c !== b.current) return;
1212
- if ((m == null ? void 0 : m.status) === 409) {
1213
- const u = await w();
1214
- if (c !== b.current) return;
1215
- const C = u == null ? void 0 : u.find((O) => O.name === d);
1216
- if (C) {
1217
- z.current(C.id), T(!1), D("");
1360
+ const G = await m({ host: e, position: r, name: o });
1361
+ if (j !== L.current) return;
1362
+ y((J) => [...J.filter((B) => B.id !== G.id), G]), k.current(G.id), W(!1), R(""), x();
1363
+ } catch (G) {
1364
+ if (j !== L.current) return;
1365
+ if ((G == null ? void 0 : G.status) === 409) {
1366
+ const J = await x();
1367
+ if (j !== L.current) return;
1368
+ const B = J == null ? void 0 : J.find((re) => re.name === o);
1369
+ if (B) {
1370
+ k.current(B.id), W(!1), R("");
1218
1371
  return;
1219
1372
  }
1220
1373
  }
1221
- V(m instanceof Error ? m.message : "新增父导航失败");
1374
+ F(G instanceof Error ? G.message : "新增父导航失败");
1222
1375
  } finally {
1223
- c === b.current && E(!1);
1376
+ j === L.current && D(!1);
1224
1377
  }
1225
- }, F = !!l && !y.some((d) => d.id === l);
1226
- return /* @__PURE__ */ s("div", { className: "mt-3", children: [
1227
- /* @__PURE__ */ s("label", { htmlFor: g, className: "mb-1.5 block text-xs text-gray-500", children: [
1228
- "所属父导航 ",
1229
- /* @__PURE__ */ n("span", { className: "text-gray-400", children: "(可选)" })
1378
+ }, P = !!d && !u.some((o) => o.id === d), i = async () => {
1379
+ const o = L.current;
1380
+ O(!1);
1381
+ const w = await x();
1382
+ w && o === L.current && w.length > 1 && b(!0);
1383
+ };
1384
+ return /* @__PURE__ */ s("div", { children: [
1385
+ /* @__PURE__ */ s("div", { className: "mb-1.5 flex flex-wrap items-center justify-between gap-2", children: [
1386
+ /* @__PURE__ */ s("label", { htmlFor: h, className: "block text-sm font-medium text-gray-700", children: [
1387
+ "所属父导航 ",
1388
+ /* @__PURE__ */ t("span", { className: "font-normal text-gray-400", children: "(可选)" })
1389
+ ] }),
1390
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-3", children: [
1391
+ a && $ && e && /* @__PURE__ */ s("button", { type: "button", disabled: f || M || A || v || !!_ || u.length < 2, "aria-haspopup": "dialog", "aria-expanded": v, "aria-controls": `${h}-dialog`, onClick: () => void i(), className: "flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:cursor-not-allowed disabled:opacity-40", children: [
1392
+ /* @__PURE__ */ t($t, { size: 12, "aria-hidden": "true" }),
1393
+ "调整顺序"
1394
+ ] }),
1395
+ a && m && e && /* @__PURE__ */ s("button", { type: "button", disabled: f || M || A || v, "aria-label": `新增${n}父导航`, "aria-haspopup": "dialog", onClick: () => {
1396
+ W(!0), R(""), F(""), O(!1);
1397
+ }, className: "flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:opacity-40", children: [
1398
+ /* @__PURE__ */ t(et, { size: 13, "aria-hidden": "true" }),
1399
+ "新增父导航"
1400
+ ] })
1401
+ ] })
1230
1402
  ] }),
1231
1403
  /* @__PURE__ */ s(
1232
1404
  "select",
1233
1405
  {
1234
- id: g,
1235
- "aria-label": `${r}父导航`,
1236
- disabled: !a || !e || p || j,
1237
- value: l ?? "",
1238
- onChange: (d) => f(d.target.value || null),
1239
- className: `${ze} disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-400`,
1406
+ id: h,
1407
+ "aria-label": `${n}父导航`,
1408
+ disabled: !a || !e || f || M || A || v,
1409
+ value: d ?? "",
1410
+ onChange: (o) => g(o.target.value || null),
1411
+ className: `${Fe} disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-400`,
1240
1412
  children: [
1241
- /* @__PURE__ */ n("option", { value: "", children: "无(顶级导航)" }),
1242
- y.map((d) => /* @__PURE__ */ n("option", { value: d.id, children: d.name }, d.id)),
1243
- F && /* @__PURE__ */ s("option", { value: l, children: [
1413
+ /* @__PURE__ */ t("option", { value: "", children: a ? "不选分组(直接显示在页尾)" : "暂不支持设置" }),
1414
+ u.map((o) => /* @__PURE__ */ t("option", { value: o.id, children: o.name }, o.id)),
1415
+ P && /* @__PURE__ */ s("option", { value: d, children: [
1244
1416
  "已选父导航(",
1245
- l,
1417
+ d,
1246
1418
  ")"
1247
1419
  ] })
1248
1420
  ]
1249
1421
  }
1250
1422
  ),
1251
- p && /* @__PURE__ */ n("p", { role: "status", className: "mt-2 text-xs text-gray-500", children: "加载父导航中…" }),
1252
- P && /* @__PURE__ */ s("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: [
1253
- P,
1254
- /* @__PURE__ */ n("button", { type: "button", onClick: () => void w(), className: "ml-2 cursor-pointer text-blue-500", children: "重试" })
1423
+ /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs text-gray-400", children: a ? e ? d ? u.some((o) => o.id === d) ? `文章链接会显示在「${u.find((o) => o.id === d).name}」分组下。` : "文章链接会显示在所选分组下。" : "不选父导航时,链接直接显示在网站底部。" : "请先填写网站地址" : d ? "已保存的页眉父导航暂不可修改。" : "页眉目前只能直接显示文章链接。" }),
1424
+ f && /* @__PURE__ */ t("p", { role: "status", className: "mt-2 text-xs text-gray-500", children: "加载父导航中…" }),
1425
+ _ && /* @__PURE__ */ s("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: [
1426
+ _,
1427
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => void x(), className: "ml-2 cursor-pointer text-blue-500", children: "重试" })
1255
1428
  ] }),
1256
- a ? e ? H ? /* @__PURE__ */ s("div", { className: "mt-3", children: [
1257
- /* @__PURE__ */ s("label", { htmlFor: `${g}-new`, className: "mb-1.5 block text-xs text-gray-500", children: [
1429
+ T && /* @__PURE__ */ t("p", { role: "status", className: "mt-2 text-xs text-green-600", children: "父导航顺序已保存" }),
1430
+ /* @__PURE__ */ t(Lt, { id: `${h}-dialog`, open: v || A, busy: M || p, label: v ? "父导航顺序" : A ? `新增${n}父导航` : void 0, onDismiss: () => {
1431
+ W(!1), b(!1), F("");
1432
+ }, children: v && $ ? /* @__PURE__ */ t(
1433
+ Qr,
1434
+ {
1435
+ host: e,
1436
+ position: r,
1437
+ groups: u,
1438
+ reorder: async (o) => {
1439
+ const w = L.current;
1440
+ C(!0);
1441
+ try {
1442
+ return await $(o);
1443
+ } finally {
1444
+ w === L.current && C(!1);
1445
+ }
1446
+ },
1447
+ onSaved: (o) => {
1448
+ y(o), b(!1), O(!0);
1449
+ },
1450
+ onCancel: () => b(!1)
1451
+ }
1452
+ ) : A ? /* @__PURE__ */ s("div", { className: "p-6", children: [
1453
+ /* @__PURE__ */ s("h3", { className: "text-sm font-medium text-gray-700", children: [
1258
1454
  "新增",
1259
- r,
1455
+ n,
1260
1456
  "父导航"
1261
1457
  ] }),
1262
- /* @__PURE__ */ n(
1458
+ /* @__PURE__ */ s("label", { htmlFor: `${h}-new`, className: "mb-1.5 mt-3 block text-xs text-gray-600", children: [
1459
+ "父导航名称 ",
1460
+ /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" })
1461
+ ] }),
1462
+ /* @__PURE__ */ t(
1263
1463
  "input",
1264
1464
  {
1265
- id: `${g}-new`,
1465
+ id: `${h}-new`,
1266
1466
  autoFocus: !0,
1267
1467
  maxLength: 100,
1268
- value: W,
1269
- disabled: j,
1468
+ value: V,
1469
+ disabled: M,
1270
1470
  placeholder: "输入父导航名称",
1271
- "aria-invalid": !!R,
1272
- "aria-describedby": R ? `${g}-error` : void 0,
1273
- onChange: (d) => {
1274
- D(d.target.value), V("");
1471
+ "aria-invalid": !!H,
1472
+ "aria-describedby": H ? `${h}-error` : void 0,
1473
+ onChange: (o) => {
1474
+ R(o.target.value), F("");
1275
1475
  },
1276
- onKeyDown: (d) => {
1277
- d.key === "Enter" && !d.nativeEvent.isComposing && (d.preventDefault(), L()), d.key === "Escape" && !j && T(!1);
1476
+ onKeyDown: (o) => {
1477
+ o.key === "Enter" && !o.nativeEvent.isComposing && (o.preventDefault(), E());
1278
1478
  },
1279
- className: ze
1479
+ className: Fe
1280
1480
  }
1281
1481
  ),
1282
- R && /* @__PURE__ */ n("p", { id: `${g}-error`, role: "alert", className: "mt-1.5 text-xs text-red-500", children: R }),
1482
+ H && /* @__PURE__ */ t("p", { id: `${h}-error`, role: "alert", className: "mt-1.5 text-xs text-red-500", children: H }),
1283
1483
  /* @__PURE__ */ s("div", { className: "mt-2 flex flex-wrap gap-2", children: [
1284
- /* @__PURE__ */ s("button", { type: "button", disabled: j, onClick: () => void L(), className: "flex cursor-pointer items-center gap-1 rounded-lg bg-blue-500 px-2.5 py-1.5 text-xs text-white hover:bg-blue-600 disabled:opacity-50", children: [
1285
- j ? /* @__PURE__ */ n(lt, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ n(Yt, { size: 12, "aria-hidden": "true" }),
1286
- j ? "添加中…" : "添加并选中"
1484
+ /* @__PURE__ */ s("button", { type: "button", disabled: M, onClick: () => void E(), className: "flex cursor-pointer items-center gap-1 rounded-lg bg-blue-500 px-2.5 py-1.5 text-xs text-white hover:bg-blue-600 disabled:opacity-50", children: [
1485
+ M ? /* @__PURE__ */ t(Pe, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ t(Ct, { size: 12, "aria-hidden": "true" }),
1486
+ M ? "添加中…" : "添加并选中"
1287
1487
  ] }),
1288
- /* @__PURE__ */ s("button", { type: "button", disabled: j, onClick: () => T(!1), className: "flex cursor-pointer items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs text-gray-500 hover:bg-gray-100 disabled:opacity-50", children: [
1289
- /* @__PURE__ */ n(wr, { size: 12, "aria-hidden": "true" }),
1488
+ /* @__PURE__ */ s("button", { type: "button", disabled: M, onClick: () => W(!1), className: "flex cursor-pointer items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs text-gray-500 hover:bg-gray-100 disabled:opacity-50", children: [
1489
+ /* @__PURE__ */ t(Et, { size: 12, "aria-hidden": "true" }),
1290
1490
  "取消"
1291
1491
  ] })
1292
1492
  ] })
1293
- ] }) : x ? /* @__PURE__ */ s("button", { type: "button", disabled: p, "aria-label": `新增${r}父导航`, onClick: () => {
1294
- T(!0), D(""), V("");
1295
- }, className: "mt-2.5 flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:opacity-50", children: [
1296
- /* @__PURE__ */ n(ht, { size: 13, "aria-hidden": "true" }),
1297
- "新增父导航"
1298
- ] }) : null : /* @__PURE__ */ n("p", { className: "mt-2 text-xs text-gray-500", children: "请先填写网站地址" }) : /* @__PURE__ */ n("p", { className: "mt-2 text-xs text-gray-500", children: "页眉暂不支持设置父导航。" })
1493
+ ] }) : null })
1299
1494
  ] });
1300
1495
  }
1301
- function Or({ host: e, service: t, value: r, onChange: a }) {
1302
- const o = Ie(), l = e.trim().replace(/\/+$/, ""), [f, g] = _(!1), y = !!t.getNavigationGroups, k = (v) => a({ ...r, ...v }), p = (v, P) => {
1303
- k({
1304
- navPlacements: P ? [...r.navPlacements, { position: v, parentNavId: null }] : r.navPlacements.filter((A) => A.position !== v)
1496
+ function rn({ host: e, service: r, value: n, onChange: a }) {
1497
+ const c = we(), d = e.trim().replace(/\/+$/, ""), [g, h] = S(!1), u = !!r.getNavigationGroups, y = (N) => a({ ...n, ...N }), f = (N, _) => {
1498
+ y({
1499
+ navPlacements: _ ? [...n.navPlacements, { position: N, parentNavId: null }] : n.navPlacements.filter((z) => z.position !== N)
1305
1500
  });
1306
1501
  };
1307
- return /* @__PURE__ */ s("section", { "aria-label": "导航设置", className: "mt-5 border-t border-gray-100 pt-4", children: [
1502
+ return /* @__PURE__ */ s("section", { "aria-label": "导航设置", className: "mt-5 border-t border-gray-100 pt-5", children: [
1308
1503
  /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
1309
- /* @__PURE__ */ n("span", { className: "text-sm font-medium text-gray-700", children: "导航设置" }),
1310
- /* @__PURE__ */ s("label", { htmlFor: `${o}-enabled`, className: "flex cursor-pointer items-center gap-2 text-sm text-gray-600", children: [
1311
- /* @__PURE__ */ n("span", { children: "启用导航" }),
1504
+ /* @__PURE__ */ t("h2", { className: "text-sm font-semibold text-gray-800", children: "导航设置" }),
1505
+ /* @__PURE__ */ s("label", { htmlFor: `${c}-enabled`, className: "flex cursor-pointer items-center gap-2 text-sm text-gray-600", children: [
1506
+ /* @__PURE__ */ t("span", { children: "启用导航" }),
1312
1507
  /* @__PURE__ */ s("span", { className: "relative inline-flex h-5 w-9 shrink-0 items-center", children: [
1313
- /* @__PURE__ */ n(
1508
+ /* @__PURE__ */ t(
1314
1509
  "input",
1315
1510
  {
1316
- id: `${o}-enabled`,
1511
+ id: `${c}-enabled`,
1317
1512
  type: "checkbox",
1318
1513
  role: "switch",
1319
- checked: r.navEnabled,
1320
- disabled: !y,
1321
- "aria-controls": `${o}-fields`,
1322
- onChange: (v) => k({ navEnabled: v.target.checked }),
1514
+ checked: n.navEnabled,
1515
+ disabled: !u,
1516
+ "aria-controls": `${c}-fields`,
1517
+ onChange: (N) => y({ navEnabled: N.target.checked }),
1323
1518
  className: "peer absolute inset-0 z-10 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed"
1324
1519
  }
1325
1520
  ),
1326
- /* @__PURE__ */ n("span", { "aria-hidden": "true", className: "absolute inset-0 rounded-full bg-gray-200 transition peer-checked:bg-blue-500 peer-disabled:opacity-50 peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-blue-500" }),
1327
- /* @__PURE__ */ n("span", { "aria-hidden": "true", className: "pointer-events-none relative ml-0.5 h-4 w-4 rounded-full bg-white shadow-sm transition-transform peer-checked:translate-x-4" })
1521
+ /* @__PURE__ */ t("span", { "aria-hidden": "true", className: "absolute inset-0 rounded-full bg-gray-200 transition peer-checked:bg-blue-500 peer-disabled:opacity-50 peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-blue-500" }),
1522
+ /* @__PURE__ */ t("span", { "aria-hidden": "true", className: "pointer-events-none relative ml-0.5 h-4 w-4 rounded-full bg-white shadow-sm transition-transform peer-checked:translate-x-4" })
1328
1523
  ] })
1329
1524
  ] })
1330
1525
  ] }),
1331
- y ? r.navEnabled ? /* @__PURE__ */ s("div", { id: `${o}-fields`, className: "mt-4 space-y-4", children: [
1332
- /* @__PURE__ */ s("div", { className: "max-w-md", children: [
1333
- /* @__PURE__ */ s("label", { htmlFor: `${o}-name`, className: "mb-1.5 block text-sm font-medium text-gray-700", children: [
1526
+ u && n.navEnabled && /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs leading-5 text-gray-500", children: "在网站顶部或底部显示这篇文章的链接。" }),
1527
+ u ? n.navEnabled ? /* @__PURE__ */ s("div", { id: `${c}-fields`, className: "mt-4 space-y-4 rounded-xl border border-gray-200 bg-gray-50/40 p-4", children: [
1528
+ /* @__PURE__ */ s("div", { className: "max-w-3xl", children: [
1529
+ /* @__PURE__ */ s("label", { htmlFor: `${c}-name`, className: "mb-1.5 block text-sm font-medium text-gray-700", children: [
1334
1530
  "导航名称 ",
1335
- /* @__PURE__ */ n("span", { className: "text-red-500", children: "*" })
1531
+ /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" })
1336
1532
  ] }),
1337
- /* @__PURE__ */ n(
1533
+ /* @__PURE__ */ t(
1338
1534
  "input",
1339
1535
  {
1340
- id: `${o}-name`,
1341
- value: r.navname,
1536
+ id: `${c}-name`,
1537
+ value: n.navname,
1342
1538
  maxLength: 100,
1343
1539
  placeholder: "输入导航名称",
1344
1540
  required: !0,
1345
- "aria-invalid": f && !r.navname.trim(),
1346
- "aria-describedby": f && !r.navname.trim() ? `${o}-name-error` : void 0,
1347
- onChange: (v) => k({ navname: v.target.value }),
1348
- onBlur: () => g(!0),
1349
- className: ze
1541
+ "aria-invalid": g && !n.navname.trim(),
1542
+ "aria-describedby": g && !n.navname.trim() ? `${c}-name-error` : void 0,
1543
+ onChange: (N) => y({ navname: N.target.value }),
1544
+ onBlur: () => h(!0),
1545
+ className: Fe
1350
1546
  }
1351
1547
  ),
1352
- f && !r.navname.trim() && /* @__PURE__ */ n("p", { id: `${o}-name-error`, role: "alert", className: "mt-1.5 text-xs text-red-500", children: "开启导航后,请填写导航名称" })
1548
+ /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs text-gray-400", children: "前台显示的链接名称,例如「关于我们」。" }),
1549
+ g && !n.navname.trim() && /* @__PURE__ */ t("p", { id: `${c}-name-error`, role: "alert", className: "mt-1.5 text-xs text-red-500", children: "开启导航后,请填写导航名称" })
1353
1550
  ] }),
1354
- /* @__PURE__ */ s("fieldset", { "aria-describedby": `${o}-placements-hint`, children: [
1355
- /* @__PURE__ */ s("legend", { className: "mb-2 text-sm font-medium text-gray-700", children: [
1551
+ /* @__PURE__ */ s("fieldset", { "aria-describedby": `${c}-placements-hint`, className: "min-w-0", children: [
1552
+ /* @__PURE__ */ s("legend", { className: "mb-1.5 text-sm font-medium text-gray-700", children: [
1356
1553
  "展示位置 ",
1357
- /* @__PURE__ */ n("span", { className: "text-red-500", children: "*" })
1554
+ /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" })
1358
1555
  ] }),
1359
- /* @__PURE__ */ n("p", { id: `${o}-placements-hint`, className: "mb-3 text-xs text-gray-500", children: "可同时选择页眉和页尾,页尾可设置父导航。" }),
1360
- /* @__PURE__ */ n("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: Sr.map(({ position: v, label: P, icon: A, parentEnabled: H }) => {
1361
- const T = r.navPlacements.find((W) => W.position === v);
1362
- return /* @__PURE__ */ s("div", { className: `min-w-0 rounded-xl border p-3.5 transition-colors ${T ? "border-blue-200 bg-blue-50/30" : "border-gray-200 bg-gray-50/50"}`, children: [
1556
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: en.map(({ position: N, label: _, icon: z, parentEnabled: A }) => {
1557
+ const W = n.navPlacements.find((V) => V.position === N);
1558
+ return /* @__PURE__ */ s("div", { role: "group", "aria-label": `${_}导航设置`, className: `min-w-0 self-start rounded-lg border p-3 transition-colors ${W ? "border-blue-200 bg-blue-50/30" : "border-gray-200 bg-white"}`, children: [
1363
1559
  /* @__PURE__ */ s("label", { className: "flex cursor-pointer items-center gap-2.5 text-sm text-gray-700", children: [
1364
- /* @__PURE__ */ n("input", { type: "checkbox", checked: !!T, onChange: (W) => p(v, W.target.checked), className: "h-4 w-4 shrink-0 accent-blue-500" }),
1365
- /* @__PURE__ */ n(A, { size: 15, className: "shrink-0 text-gray-400", "aria-hidden": "true" }),
1366
- /* @__PURE__ */ n("span", { className: "font-medium", children: P })
1560
+ /* @__PURE__ */ t("input", { type: "checkbox", checked: !!W, onChange: (V) => f(N, V.target.checked), className: "h-4 w-4 shrink-0 accent-blue-500" }),
1561
+ /* @__PURE__ */ t(z, { size: 15, className: "shrink-0 text-gray-400", "aria-hidden": "true" }),
1562
+ /* @__PURE__ */ t("span", { className: "font-medium", children: _ })
1367
1563
  ] }),
1368
- T && /* @__PURE__ */ n(
1369
- jr,
1564
+ /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs text-gray-500", children: N === "header" ? "文章链接显示在网站顶部。" : "文章链接显示在网站底部。" }),
1565
+ W && /* @__PURE__ */ t("div", { className: "mt-3 border-t border-gray-200/70 pt-3", children: /* @__PURE__ */ t(
1566
+ tn,
1370
1567
  {
1371
- host: l,
1372
- position: v,
1373
- label: P,
1374
- parentEnabled: H,
1375
- service: t,
1376
- parentNavId: T.parentNavId,
1377
- onSelect: (W) => k({ navPlacements: r.navPlacements.map((D) => D.position === v ? { ...D, parentNavId: W } : D) })
1568
+ host: d,
1569
+ position: N,
1570
+ label: _,
1571
+ parentEnabled: A,
1572
+ service: r,
1573
+ parentNavId: W.parentNavId,
1574
+ onSelect: (V) => y({ navPlacements: n.navPlacements.map((R) => R.position === N ? { ...R, parentNavId: V } : R) })
1378
1575
  },
1379
- `${l}:${v}`
1380
- )
1381
- ] }, v);
1576
+ `${d}:${N}`
1577
+ ) })
1578
+ ] }, N);
1382
1579
  }) }),
1383
- r.navPlacements.length === 0 && /* @__PURE__ */ n("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: "请至少选择一个展示位置" })
1580
+ /* @__PURE__ */ t("p", { id: `${c}-placements-hint`, className: "mt-1.5 text-xs text-gray-400", children: "可以同时勾选页眉和页尾。" }),
1581
+ n.navPlacements.length === 0 && /* @__PURE__ */ t("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: "请至少选择一个展示位置" })
1384
1582
  ] })
1385
- ] }) : /* @__PURE__ */ n("p", { className: "mt-1.5 text-xs text-gray-500", children: "开启后可将文章加入页眉、页尾或同时加入两处。" }) : /* @__PURE__ */ n("p", { className: "mt-1.5 text-xs text-gray-500", children: "当前服务尚未接入导航配置" })
1583
+ ] }) : /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs text-gray-500", children: "开启后可将文章加入页眉、页尾或同时加入两处。" }) : /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs text-gray-500", children: "当前服务尚未接入导航配置" })
1386
1584
  ] });
1387
1585
  }
1388
- function Pr(e) {
1586
+ const fe = "w-full min-w-0 rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm text-gray-700 outline-none transition focus:border-blue-400 focus:ring-2 focus:ring-blue-500/20";
1587
+ function nn({ value: e, categories: r, categoriesDisabled: n = !1, onChange: a, onSaveCategory: c, onLoadCategories: d, onReorderCategories: g }) {
1588
+ const h = we(), [u, y] = S(null), [f, N] = S(""), [_, z] = S(!1), [A, W] = S(""), [V, R] = S(!1), [H, F] = S(null), [M, D] = S(!1), [v, b] = S(""), [T, O] = S(!1), p = !!u || !!H, C = Y(!1), L = Y(!1), q = Y(!1);
1589
+ te(() => (L.current = !0, () => {
1590
+ L.current = !1;
1591
+ }), []);
1592
+ const k = r.find((i) => i.id === e.categoryId), l = e.categoryId ? void 0 : e.category, m = (k == null ? void 0 : k.description) ?? (l == null ? void 0 : l.description), $ = Y(e);
1593
+ $.current = e;
1594
+ const x = (i) => a({ ...e, ...i }), E = async () => {
1595
+ if (!(C.current || !g || n || u || H)) {
1596
+ C.current = !0, D(!0), b(""), W("");
1597
+ try {
1598
+ const i = d ? await d() : r;
1599
+ L.current && F(i);
1600
+ } catch (i) {
1601
+ L.current && b(i instanceof Error ? i.message : "分类加载失败,请重试");
1602
+ } finally {
1603
+ C.current = !1, L.current && D(!1);
1604
+ }
1605
+ }
1606
+ }, P = async () => {
1607
+ if (!u || !c || q.current) return;
1608
+ const i = u.name.trim();
1609
+ if (!i) {
1610
+ N("请输入分类名称");
1611
+ return;
1612
+ }
1613
+ if (r.some((o) => o.id !== u.id && o.name === i)) {
1614
+ N("该分类名称已存在,请选择已有分类或使用其他名称");
1615
+ return;
1616
+ }
1617
+ q.current = !0, R(!0), N("");
1618
+ try {
1619
+ const o = await c({ ...u.id ? { id: u.id } : {}, name: i, description: u.description.trim() });
1620
+ if (!L.current) return;
1621
+ a({ ...$.current, categoryId: o.id }), W(u.id ? "分类已更新" : "分类已新增并选中"), y(null);
1622
+ } catch (o) {
1623
+ L.current && N(o instanceof Error ? o.message : "分类保存失败,请重试");
1624
+ } finally {
1625
+ q.current = !1, L.current && R(!1);
1626
+ }
1627
+ };
1628
+ return /* @__PURE__ */ s("section", { "aria-labelledby": `${h}-heading`, className: "mt-5 border-t border-gray-100 pt-5", children: [
1629
+ /* @__PURE__ */ t("h2", { id: `${h}-heading`, className: "text-sm font-semibold text-gray-800", children: "Guides 展示设置" }),
1630
+ /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs leading-5 text-gray-500", children: "用于 Guides 页面的文章展示,分类可选。" }),
1631
+ /* @__PURE__ */ s("div", { className: "mt-4 grid grid-cols-1 gap-x-6 gap-y-4 rounded-xl border border-gray-200 bg-gray-50/40 p-4 lg:grid-cols-3", children: [
1632
+ /* @__PURE__ */ s("div", { className: "lg:col-span-2", children: [
1633
+ /* @__PURE__ */ s("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
1634
+ /* @__PURE__ */ s("label", { htmlFor: `${h}-title`, className: "text-sm font-medium text-gray-700", children: [
1635
+ "文章标题 ",
1636
+ /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" })
1637
+ ] }),
1638
+ /* @__PURE__ */ t("span", { className: "text-xs text-gray-400", children: "用于文章卡片" })
1639
+ ] }),
1640
+ /* @__PURE__ */ t("input", { id: `${h}-title`, value: e.title, maxLength: 200, required: !0, placeholder: "例如 White-Hat GEO: Ethical Optimization for AI Search", onChange: (i) => x({ title: i.target.value }), onBlur: () => z(!0), "aria-invalid": _ && !e.title.trim(), "aria-describedby": `${h}-title-hint`, className: fe }),
1641
+ /* @__PURE__ */ t("p", { id: `${h}-title-hint`, className: `mt-1.5 text-xs ${_ && !e.title.trim() ? "text-red-500" : "text-gray-400"}`, role: _ && !e.title.trim() ? "alert" : void 0, children: _ && !e.title.trim() ? "请输入文章展示标题" : "可使用比导航名称更完整的标题。" })
1642
+ ] }),
1643
+ /* @__PURE__ */ s("div", { children: [
1644
+ /* @__PURE__ */ s("div", { className: "mb-1.5 flex flex-wrap items-center justify-between gap-2", children: [
1645
+ /* @__PURE__ */ s("label", { htmlFor: `${h}-category`, className: "text-sm font-medium text-gray-700", children: [
1646
+ "所属分类 ",
1647
+ /* @__PURE__ */ t("span", { className: "font-normal text-gray-400", children: "(可选)" })
1648
+ ] }),
1649
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-3", children: [
1650
+ g && /* @__PURE__ */ s("button", { type: "button", disabled: n || p || M || r.length < 2, "aria-haspopup": "dialog", "aria-expanded": !!H, "aria-controls": `${h}-dialog`, onClick: () => void E(), className: "flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:opacity-40", children: [
1651
+ /* @__PURE__ */ t($t, { size: 12, "aria-hidden": "true" }),
1652
+ "调整顺序"
1653
+ ] }),
1654
+ c && /* @__PURE__ */ s("button", { type: "button", disabled: n || p || M, "aria-haspopup": "dialog", onClick: () => {
1655
+ y({ id: null, name: "", description: "" }), N(""), W(""), b("");
1656
+ }, className: "flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:opacity-40", children: [
1657
+ /* @__PURE__ */ t(et, { size: 13, "aria-hidden": "true" }),
1658
+ "新增分类"
1659
+ ] })
1660
+ ] })
1661
+ ] }),
1662
+ /* @__PURE__ */ s("select", { id: `${h}-category`, value: l ? "__unresolved-category__" : e.categoryId ?? "", disabled: n || p || M, onChange: (i) => {
1663
+ x({ categoryId: i.target.value || null, category: void 0 }), W("");
1664
+ }, className: `${fe} disabled:bg-gray-50 disabled:text-gray-400`, children: [
1665
+ /* @__PURE__ */ t("option", { value: "", children: "不设置分类" }),
1666
+ l && /* @__PURE__ */ s("option", { value: "__unresolved-category__", disabled: !0, children: [
1667
+ l.name,
1668
+ "(请重新选择)"
1669
+ ] }),
1670
+ r.map((i) => /* @__PURE__ */ t("option", { value: i.id, children: i.name }, i.id)),
1671
+ e.categoryId && !k && /* @__PURE__ */ s("option", { value: e.categoryId, children: [
1672
+ "已选分类(",
1673
+ e.categoryId,
1674
+ ")"
1675
+ ] })
1676
+ ] }),
1677
+ /* @__PURE__ */ t("p", { className: `mt-1.5 text-xs ${l ? "text-amber-700" : "text-gray-400"}`, children: l ? "无法确认已保存的分类,请重新选择后保存。" : "可留空,不影响文章保存。" }),
1678
+ M && /* @__PURE__ */ t("p", { role: "status", className: "mt-2 text-xs text-gray-500", children: "加载分类顺序中…" }),
1679
+ v && /* @__PURE__ */ t("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: v }),
1680
+ A && /* @__PURE__ */ t("p", { role: "status", className: "mt-2 text-xs text-green-600", children: A })
1681
+ ] }),
1682
+ /* @__PURE__ */ s("div", { className: k || l ? "lg:col-span-2" : "lg:col-span-3", children: [
1683
+ /* @__PURE__ */ s("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
1684
+ /* @__PURE__ */ s("label", { htmlFor: `${h}-description`, className: "text-sm font-medium text-gray-700", children: [
1685
+ "文章简介 ",
1686
+ /* @__PURE__ */ t("span", { className: "font-normal text-gray-400", children: "(可选)" })
1687
+ ] }),
1688
+ /* @__PURE__ */ s("span", { className: "text-xs text-gray-400", children: [
1689
+ e.description.length,
1690
+ "/500"
1691
+ ] })
1692
+ ] }),
1693
+ /* @__PURE__ */ t("textarea", { id: `${h}-description`, rows: 2, maxLength: 500, value: e.description, placeholder: "简要介绍文章内容,展示在卡片标题下方", onChange: (i) => x({ description: i.target.value }), className: `${fe} resize-y leading-6` })
1694
+ ] }),
1695
+ (k || l) && /* @__PURE__ */ s("div", { className: "rounded-lg border border-gray-200 bg-white p-3", children: [
1696
+ /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-3", children: [
1697
+ /* @__PURE__ */ t("span", { className: "text-xs font-medium text-gray-500", children: "分类描述" }),
1698
+ k && c && /* @__PURE__ */ s("button", { type: "button", disabled: n || M, "aria-haspopup": "dialog", onClick: () => {
1699
+ y({ ...k }), N(""), W(""), b("");
1700
+ }, className: "flex shrink-0 cursor-pointer items-center gap-1 text-xs text-blue-500 hover:text-blue-600 disabled:opacity-40", children: [
1701
+ /* @__PURE__ */ t(St, { size: 12, "aria-hidden": "true" }),
1702
+ "编辑分类"
1703
+ ] })
1704
+ ] }),
1705
+ /* @__PURE__ */ t("p", { className: "mt-2 break-words text-xs leading-5 text-gray-500", children: m || "未填写分类描述" })
1706
+ ] })
1707
+ ] }),
1708
+ /* @__PURE__ */ t(Lt, { id: `${h}-dialog`, open: p, busy: V || T, label: H ? "分类顺序" : u ? u.id ? "编辑分类" : "新增分类" : void 0, onDismiss: () => {
1709
+ y(null), F(null), N("");
1710
+ }, children: H && g ? /* @__PURE__ */ t(
1711
+ It,
1712
+ {
1713
+ items: H,
1714
+ label: "分类",
1715
+ description: "Guides 页面按此顺序从上到下展示分类。保存后对该网站的所有文章生效,不改变文章所属分类。",
1716
+ presentation: "dialog",
1717
+ saveOrder: async (i) => {
1718
+ O(!0);
1719
+ try {
1720
+ return await g(i);
1721
+ } finally {
1722
+ L.current && O(!1);
1723
+ }
1724
+ },
1725
+ onSaved: () => {
1726
+ F(null), W("分类顺序已保存");
1727
+ },
1728
+ onCancel: () => F(null)
1729
+ }
1730
+ ) : u ? /* @__PURE__ */ s("fieldset", { disabled: V, className: "p-6", children: [
1731
+ /* @__PURE__ */ t("h3", { className: "text-sm font-medium text-gray-700", children: u.id ? "编辑分类" : "新增分类" }),
1732
+ /* @__PURE__ */ s("div", { className: "mt-3", children: [
1733
+ /* @__PURE__ */ s("label", { htmlFor: `${h}-category-name`, className: "mb-1.5 block text-xs text-gray-600", children: [
1734
+ "分类名称 ",
1735
+ /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" })
1736
+ ] }),
1737
+ /* @__PURE__ */ t("input", { id: `${h}-category-name`, autoFocus: !0, maxLength: 100, value: u.name, "aria-invalid": !!f, "aria-describedby": f ? `${h}-category-error` : void 0, placeholder: "例如 Start with the foundations", onChange: (i) => {
1738
+ y({ ...u, name: i.target.value }), N("");
1739
+ }, className: fe })
1740
+ ] }),
1741
+ /* @__PURE__ */ s("div", { className: "mt-3", children: [
1742
+ /* @__PURE__ */ t("label", { htmlFor: `${h}-category-description`, className: "mb-1.5 block text-xs text-gray-600", children: "分类描述" }),
1743
+ /* @__PURE__ */ t("textarea", { id: `${h}-category-description`, rows: 3, maxLength: 500, value: u.description, placeholder: "介绍这个分类包含的内容,展示在分类名称下方", onChange: (i) => y({ ...u, description: i.target.value }), className: `${fe} resize-y leading-6` })
1744
+ ] }),
1745
+ u.id && /* @__PURE__ */ t("p", { className: "mt-2 text-xs leading-5 text-amber-700", children: "分类由多篇文章共用,修改名称和描述会同步影响该分类下的所有文章。" }),
1746
+ f && /* @__PURE__ */ t("p", { id: `${h}-category-error`, role: "alert", className: "mt-2 text-xs text-red-500", children: f }),
1747
+ /* @__PURE__ */ s("div", { className: "mt-3 flex flex-wrap gap-2", children: [
1748
+ /* @__PURE__ */ s("button", { type: "button", onClick: () => void P(), className: "flex cursor-pointer items-center gap-1 rounded-lg bg-blue-500 px-3 py-1.5 text-xs text-white hover:bg-blue-600 disabled:opacity-50", children: [
1749
+ V ? /* @__PURE__ */ t(Pe, { size: 12, className: "animate-spin", "aria-hidden": "true" }) : /* @__PURE__ */ t(Ct, { size: 12, "aria-hidden": "true" }),
1750
+ V ? "保存中…" : u.id ? "保存分类" : "新增并选中"
1751
+ ] }),
1752
+ /* @__PURE__ */ s("button", { type: "button", onClick: () => {
1753
+ y(null), N("");
1754
+ }, className: "flex cursor-pointer items-center gap-1 rounded-lg px-3 py-1.5 text-xs text-gray-500 hover:bg-gray-100", children: [
1755
+ /* @__PURE__ */ t(Et, { size: 12, "aria-hidden": "true" }),
1756
+ "取消"
1757
+ ] })
1758
+ ] })
1759
+ ] }) : null })
1760
+ ] });
1761
+ }
1762
+ function an(e) {
1763
+ var n;
1764
+ const r = e.categoryId !== void 0 ? e.categoryId : ((n = e.category) == null ? void 0 : n.id) ?? null;
1765
+ return { title: e.title, description: e.description, categoryId: r };
1766
+ }
1767
+ function sn(e) {
1389
1768
  return e.split(/(“[^”]+”|"[^"]+")/g).map(
1390
- (t, r) => /^(“.*”|".*")$/.test(t) ? /* @__PURE__ */ n("code", { className: "rounded bg-gray-100 px-1 py-0.5 font-mono text-[11px] text-gray-800", children: t.slice(1, -1) }, r) : t
1769
+ (r, n) => /^(“.*”|".*")$/.test(r) ? /* @__PURE__ */ t("code", { className: "rounded bg-gray-100 px-1 py-0.5 font-mono text-[11px] text-gray-800", children: r.slice(1, -1) }, n) : r
1391
1770
  );
1392
1771
  }
1393
- function Er({ errors: e, source: t }) {
1394
- const [r, a] = _(null), o = t.split(`
1772
+ function on({ errors: e, source: r }) {
1773
+ const [n, a] = S(null), c = r.split(`
1395
1774
  `);
1396
1775
  return /* @__PURE__ */ s("div", { children: [
1397
1776
  /* @__PURE__ */ s("div", { className: "sticky top-0 z-10 flex items-center gap-3 border-b border-gray-100 bg-white px-4 py-3.5", children: [
1398
- /* @__PURE__ */ n("span", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-red-50 text-red-500", children: /* @__PURE__ */ n(Gt, { size: 18, strokeWidth: 1.75 }) }),
1777
+ /* @__PURE__ */ t("span", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-red-50 text-red-500", children: /* @__PURE__ */ t(yr, { size: 18, strokeWidth: 1.75 }) }),
1399
1778
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
1400
- /* @__PURE__ */ n("div", { className: "text-sm font-semibold text-gray-900", children: "HTML 校验" }),
1401
- /* @__PURE__ */ n("div", { className: "mt-0.5 text-xs text-gray-500", children: "点击问题查看详情" })
1779
+ /* @__PURE__ */ t("div", { className: "text-sm font-semibold text-gray-900", children: "HTML 校验" }),
1780
+ /* @__PURE__ */ t("div", { className: "mt-0.5 text-xs text-gray-500", children: "点击问题查看详情" })
1402
1781
  ] }),
1403
1782
  /* @__PURE__ */ s("span", { className: "shrink-0 rounded-full bg-red-50 px-2.5 py-1 text-xs font-medium text-red-600", children: [
1404
1783
  e.length,
1405
1784
  " 个问题"
1406
1785
  ] })
1407
1786
  ] }),
1408
- /* @__PURE__ */ n("ol", { className: "m-0 list-none divide-y divide-gray-100 p-0", children: e.map((l, f) => {
1409
- var k, p;
1410
- const g = (l.lastLine ? (k = o[l.lastLine - 1]) == null ? void 0 : k.trim() : "") || ((p = l.extract) == null ? void 0 : p.trim()), y = r === f;
1787
+ /* @__PURE__ */ t("ol", { className: "m-0 list-none divide-y divide-gray-100 p-0", children: e.map((d, g) => {
1788
+ var y, f;
1789
+ const h = (d.lastLine ? (y = c[d.lastLine - 1]) == null ? void 0 : y.trim() : "") || ((f = d.extract) == null ? void 0 : f.trim()), u = n === g;
1411
1790
  return /* @__PURE__ */ s("li", { children: [
1412
1791
  /* @__PURE__ */ s(
1413
1792
  "button",
1414
1793
  {
1415
1794
  type: "button",
1416
- "aria-expanded": y,
1417
- onClick: () => a(y ? null : f),
1418
- className: `flex w-full cursor-pointer items-center gap-2.5 px-4 py-3 text-left transition-colors hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 ${y ? "bg-gray-50" : ""}`,
1795
+ "aria-expanded": u,
1796
+ onClick: () => a(u ? null : g),
1797
+ className: `flex w-full cursor-pointer items-center gap-2.5 px-4 py-3 text-left transition-colors hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 ${u ? "bg-gray-50" : ""}`,
1419
1798
  children: [
1420
- /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-red-400" }),
1421
- /* @__PURE__ */ n("span", { className: "w-16 shrink-0 font-mono text-[11px] text-gray-500", children: l.lastLine != null ? `第 ${l.lastLine} 行` : `问题 ${f + 1}` }),
1422
- /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-xs leading-5 text-gray-700", children: l.message.replace(/[“”"]/g, "") }),
1423
- /* @__PURE__ */ n(Bt, { size: 14, className: `shrink-0 text-gray-400 transition-transform ${y ? "rotate-180" : ""}` })
1799
+ /* @__PURE__ */ t("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-red-400" }),
1800
+ /* @__PURE__ */ t("span", { className: "w-16 shrink-0 font-mono text-[11px] text-gray-500", children: d.lastLine != null ? `第 ${d.lastLine} 行` : `问题 ${g + 1}` }),
1801
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-xs leading-5 text-gray-700", children: d.message.replace(/[“”"]/g, "") }),
1802
+ /* @__PURE__ */ t(fr, { size: 14, className: `shrink-0 text-gray-400 transition-transform ${u ? "rotate-180" : ""}` })
1424
1803
  ]
1425
1804
  }
1426
1805
  ),
1427
- y && /* @__PURE__ */ s("div", { className: "border-t border-gray-100 px-4 pb-4 pt-3", children: [
1428
- l.lastColumn != null && /* @__PURE__ */ s("div", { className: "mb-2 font-mono text-[11px] text-gray-400", children: [
1806
+ u && /* @__PURE__ */ s("div", { className: "border-t border-gray-100 px-4 pb-4 pt-3", children: [
1807
+ d.lastColumn != null && /* @__PURE__ */ s("div", { className: "mb-2 font-mono text-[11px] text-gray-400", children: [
1429
1808
  "第 ",
1430
- l.lastColumn,
1809
+ d.lastColumn,
1431
1810
  " 列"
1432
1811
  ] }),
1433
- /* @__PURE__ */ n("p", { className: "m-0 text-[13px] leading-6 text-gray-600", children: Pr(l.message) }),
1434
- g && /* @__PURE__ */ s("div", { className: "mt-3 overflow-hidden rounded-lg border border-gray-100 bg-gray-50", children: [
1812
+ /* @__PURE__ */ t("p", { className: "m-0 text-[13px] leading-6 text-gray-600", children: sn(d.message) }),
1813
+ h && /* @__PURE__ */ s("div", { className: "mt-3 overflow-hidden rounded-lg border border-gray-100 bg-gray-50", children: [
1435
1814
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5 border-b border-gray-100 px-3 py-1.5 text-[10px] font-medium uppercase tracking-wider text-gray-400", children: [
1436
- /* @__PURE__ */ n(Ye, { size: 11 }),
1815
+ /* @__PURE__ */ t(Qe, { size: 11 }),
1437
1816
  " 源代码"
1438
1817
  ] }),
1439
- /* @__PURE__ */ n("pre", { className: "m-0 whitespace-pre-wrap break-words px-3 py-2.5 font-mono text-[11px] leading-5 text-gray-600", children: g })
1818
+ /* @__PURE__ */ t("pre", { className: "m-0 whitespace-pre-wrap break-words px-3 py-2.5 font-mono text-[11px] leading-5 text-gray-600", children: h })
1440
1819
  ] })
1441
1820
  ] })
1442
- ] }, f);
1821
+ ] }, g);
1443
1822
  }) })
1444
1823
  ] });
1445
1824
  }
1446
- async function Ke(e) {
1447
- const t = new AbortController(), r = setTimeout(() => t.abort(), 1e4);
1825
+ async function ut(e) {
1826
+ const r = new AbortController(), n = setTimeout(() => r.abort(), 1e4);
1448
1827
  try {
1449
1828
  const a = await fetch("https://validator.w3.org/nu/?out=json", {
1450
1829
  method: "POST",
@@ -1453,199 +1832,199 @@ async function Ke(e) {
1453
1832
  "User-Agent": "AiSee-Manage/1.0"
1454
1833
  },
1455
1834
  body: e,
1456
- signal: t.signal
1835
+ signal: r.signal
1457
1836
  });
1458
1837
  if (!a.ok) throw new Error(`W3C validator responded with ${a.status}`);
1459
- const f = ((await a.json()).messages || []).filter((g) => g.type === "error");
1460
- return { isValid: f.length === 0, errors: f };
1838
+ const g = ((await a.json()).messages || []).filter((h) => h.type === "error");
1839
+ return { isValid: g.length === 0, errors: g };
1461
1840
  } catch (a) {
1462
1841
  return console.error("W3C 校验请求失败:", a), { isValid: !0, errors: [], networkError: !0 };
1463
1842
  } finally {
1464
- clearTimeout(r);
1843
+ clearTimeout(n);
1465
1844
  }
1466
1845
  }
1467
- function Je(e, t) {
1468
- (t == null || t > e.length) && (t = e.length);
1469
- for (var r = 0, a = Array(t); r < t; r++) a[r] = e[r];
1846
+ function mt(e, r) {
1847
+ (r == null || r > e.length) && (r = e.length);
1848
+ for (var n = 0, a = Array(r); n < r; n++) a[n] = e[n];
1470
1849
  return a;
1471
1850
  }
1472
- function Lr(e) {
1851
+ function cn(e) {
1473
1852
  if (Array.isArray(e)) return e;
1474
1853
  }
1475
- function Tr(e, t, r) {
1476
- return (t = Wr(t)) in e ? Object.defineProperty(e, t, {
1477
- value: r,
1854
+ function ln(e, r, n) {
1855
+ return (r = fn(r)) in e ? Object.defineProperty(e, r, {
1856
+ value: n,
1478
1857
  enumerable: !0,
1479
1858
  configurable: !0,
1480
1859
  writable: !0
1481
- }) : e[t] = r, e;
1860
+ }) : e[r] = n, e;
1482
1861
  }
1483
- function _r(e, t) {
1484
- var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
1485
- if (r != null) {
1486
- var a, o, l, f, g = [], y = !0, k = !1;
1862
+ function dn(e, r) {
1863
+ var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
1864
+ if (n != null) {
1865
+ var a, c, d, g, h = [], u = !0, y = !1;
1487
1866
  try {
1488
- if (l = (r = r.call(e)).next, t !== 0) for (; !(y = (a = l.call(r)).done) && (g.push(a.value), g.length !== t); y = !0) ;
1489
- } catch (p) {
1490
- k = !0, o = p;
1867
+ if (d = (n = n.call(e)).next, r !== 0) for (; !(u = (a = d.call(n)).done) && (h.push(a.value), h.length !== r); u = !0) ;
1868
+ } catch (f) {
1869
+ y = !0, c = f;
1491
1870
  } finally {
1492
1871
  try {
1493
- if (!y && r.return != null && (f = r.return(), Object(f) !== f)) return;
1872
+ if (!u && n.return != null && (g = n.return(), Object(g) !== g)) return;
1494
1873
  } finally {
1495
- if (k) throw o;
1874
+ if (y) throw c;
1496
1875
  }
1497
1876
  }
1498
- return g;
1877
+ return h;
1499
1878
  }
1500
1879
  }
1501
- function Dr() {
1880
+ function un() {
1502
1881
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1503
1882
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1504
1883
  }
1505
- function Qe(e, t) {
1506
- var r = Object.keys(e);
1884
+ function ht(e, r) {
1885
+ var n = Object.keys(e);
1507
1886
  if (Object.getOwnPropertySymbols) {
1508
1887
  var a = Object.getOwnPropertySymbols(e);
1509
- t && (a = a.filter(function(o) {
1510
- return Object.getOwnPropertyDescriptor(e, o).enumerable;
1511
- })), r.push.apply(r, a);
1888
+ r && (a = a.filter(function(c) {
1889
+ return Object.getOwnPropertyDescriptor(e, c).enumerable;
1890
+ })), n.push.apply(n, a);
1512
1891
  }
1513
- return r;
1514
- }
1515
- function Xe(e) {
1516
- for (var t = 1; t < arguments.length; t++) {
1517
- var r = arguments[t] != null ? arguments[t] : {};
1518
- t % 2 ? Qe(Object(r), !0).forEach(function(a) {
1519
- Tr(e, a, r[a]);
1520
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Qe(Object(r)).forEach(function(a) {
1521
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
1892
+ return n;
1893
+ }
1894
+ function gt(e) {
1895
+ for (var r = 1; r < arguments.length; r++) {
1896
+ var n = arguments[r] != null ? arguments[r] : {};
1897
+ r % 2 ? ht(Object(n), !0).forEach(function(a) {
1898
+ ln(e, a, n[a]);
1899
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ht(Object(n)).forEach(function(a) {
1900
+ Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(n, a));
1522
1901
  });
1523
1902
  }
1524
1903
  return e;
1525
1904
  }
1526
- function zr(e, t) {
1905
+ function mn(e, r) {
1527
1906
  if (e == null) return {};
1528
- var r, a, o = Ar(e, t);
1907
+ var n, a, c = hn(e, r);
1529
1908
  if (Object.getOwnPropertySymbols) {
1530
- var l = Object.getOwnPropertySymbols(e);
1531
- for (a = 0; a < l.length; a++) r = l[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
1909
+ var d = Object.getOwnPropertySymbols(e);
1910
+ for (a = 0; a < d.length; a++) n = d[a], r.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (c[n] = e[n]);
1532
1911
  }
1533
- return o;
1912
+ return c;
1534
1913
  }
1535
- function Ar(e, t) {
1914
+ function hn(e, r) {
1536
1915
  if (e == null) return {};
1537
- var r = {};
1916
+ var n = {};
1538
1917
  for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
1539
- if (t.indexOf(a) !== -1) continue;
1540
- r[a] = e[a];
1918
+ if (r.indexOf(a) !== -1) continue;
1919
+ n[a] = e[a];
1541
1920
  }
1542
- return r;
1921
+ return n;
1543
1922
  }
1544
- function Hr(e, t) {
1545
- return Lr(e) || _r(e, t) || Rr(e, t) || Dr();
1923
+ function gn(e, r) {
1924
+ return cn(e) || dn(e, r) || xn(e, r) || un();
1546
1925
  }
1547
- function Ir(e, t) {
1926
+ function pn(e, r) {
1548
1927
  if (typeof e != "object" || !e) return e;
1549
- var r = e[Symbol.toPrimitive];
1550
- if (r !== void 0) {
1551
- var a = r.call(e, t);
1928
+ var n = e[Symbol.toPrimitive];
1929
+ if (n !== void 0) {
1930
+ var a = n.call(e, r);
1552
1931
  if (typeof a != "object") return a;
1553
1932
  throw new TypeError("@@toPrimitive must return a primitive value.");
1554
1933
  }
1555
- return (t === "string" ? String : Number)(e);
1934
+ return (r === "string" ? String : Number)(e);
1556
1935
  }
1557
- function Wr(e) {
1558
- var t = Ir(e, "string");
1559
- return typeof t == "symbol" ? t : t + "";
1936
+ function fn(e) {
1937
+ var r = pn(e, "string");
1938
+ return typeof r == "symbol" ? r : r + "";
1560
1939
  }
1561
- function Rr(e, t) {
1940
+ function xn(e, r) {
1562
1941
  if (e) {
1563
- if (typeof e == "string") return Je(e, t);
1564
- var r = {}.toString.call(e).slice(8, -1);
1565
- return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Je(e, t) : void 0;
1942
+ if (typeof e == "string") return mt(e, r);
1943
+ var n = {}.toString.call(e).slice(8, -1);
1944
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? mt(e, r) : void 0;
1566
1945
  }
1567
1946
  }
1568
- function Vr(e, t, r) {
1569
- return t in e ? Object.defineProperty(e, t, {
1570
- value: r,
1947
+ function yn(e, r, n) {
1948
+ return r in e ? Object.defineProperty(e, r, {
1949
+ value: n,
1571
1950
  enumerable: !0,
1572
1951
  configurable: !0,
1573
1952
  writable: !0
1574
- }) : e[t] = r, e;
1953
+ }) : e[r] = n, e;
1575
1954
  }
1576
- function et(e, t) {
1577
- var r = Object.keys(e);
1955
+ function pt(e, r) {
1956
+ var n = Object.keys(e);
1578
1957
  if (Object.getOwnPropertySymbols) {
1579
1958
  var a = Object.getOwnPropertySymbols(e);
1580
- t && (a = a.filter(function(o) {
1581
- return Object.getOwnPropertyDescriptor(e, o).enumerable;
1582
- })), r.push.apply(r, a);
1959
+ r && (a = a.filter(function(c) {
1960
+ return Object.getOwnPropertyDescriptor(e, c).enumerable;
1961
+ })), n.push.apply(n, a);
1583
1962
  }
1584
- return r;
1585
- }
1586
- function tt(e) {
1587
- for (var t = 1; t < arguments.length; t++) {
1588
- var r = arguments[t] != null ? arguments[t] : {};
1589
- t % 2 ? et(Object(r), !0).forEach(function(a) {
1590
- Vr(e, a, r[a]);
1591
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : et(Object(r)).forEach(function(a) {
1592
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
1963
+ return n;
1964
+ }
1965
+ function ft(e) {
1966
+ for (var r = 1; r < arguments.length; r++) {
1967
+ var n = arguments[r] != null ? arguments[r] : {};
1968
+ r % 2 ? pt(Object(n), !0).forEach(function(a) {
1969
+ yn(e, a, n[a]);
1970
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : pt(Object(n)).forEach(function(a) {
1971
+ Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(n, a));
1593
1972
  });
1594
1973
  }
1595
1974
  return e;
1596
1975
  }
1597
- function Yr() {
1598
- for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
1599
- t[r] = arguments[r];
1976
+ function bn() {
1977
+ for (var e = arguments.length, r = new Array(e), n = 0; n < e; n++)
1978
+ r[n] = arguments[n];
1600
1979
  return function(a) {
1601
- return t.reduceRight(function(o, l) {
1602
- return l(o);
1980
+ return r.reduceRight(function(c, d) {
1981
+ return d(c);
1603
1982
  }, a);
1604
1983
  };
1605
1984
  }
1606
- function le(e) {
1607
- return function t() {
1608
- for (var r = this, a = arguments.length, o = new Array(a), l = 0; l < a; l++)
1609
- o[l] = arguments[l];
1610
- return o.length >= e.length ? e.apply(this, o) : function() {
1611
- for (var f = arguments.length, g = new Array(f), y = 0; y < f; y++)
1612
- g[y] = arguments[y];
1613
- return t.apply(r, [].concat(o, g));
1985
+ function xe(e) {
1986
+ return function r() {
1987
+ for (var n = this, a = arguments.length, c = new Array(a), d = 0; d < a; d++)
1988
+ c[d] = arguments[d];
1989
+ return c.length >= e.length ? e.apply(this, c) : function() {
1990
+ for (var g = arguments.length, h = new Array(g), u = 0; u < g; u++)
1991
+ h[u] = arguments[u];
1992
+ return r.apply(n, [].concat(c, h));
1614
1993
  };
1615
1994
  };
1616
1995
  }
1617
- function be(e) {
1996
+ function je(e) {
1618
1997
  return {}.toString.call(e).includes("Object");
1619
1998
  }
1620
- function qr(e) {
1999
+ function vn(e) {
1621
2000
  return !Object.keys(e).length;
1622
2001
  }
1623
- function he(e) {
2002
+ function ve(e) {
1624
2003
  return typeof e == "function";
1625
2004
  }
1626
- function Br(e, t) {
1627
- return Object.prototype.hasOwnProperty.call(e, t);
2005
+ function wn(e, r) {
2006
+ return Object.prototype.hasOwnProperty.call(e, r);
1628
2007
  }
1629
- function Fr(e, t) {
1630
- return be(t) || ne("changeType"), Object.keys(t).some(function(r) {
1631
- return !Br(e, r);
1632
- }) && ne("changeField"), t;
2008
+ function Nn(e, r) {
2009
+ return je(r) || le("changeType"), Object.keys(r).some(function(n) {
2010
+ return !wn(e, n);
2011
+ }) && le("changeField"), r;
1633
2012
  }
1634
- function Ur(e) {
1635
- he(e) || ne("selectorType");
2013
+ function kn(e) {
2014
+ ve(e) || le("selectorType");
1636
2015
  }
1637
- function Gr(e) {
1638
- he(e) || be(e) || ne("handlerType"), be(e) && Object.values(e).some(function(t) {
1639
- return !he(t);
1640
- }) && ne("handlersType");
2016
+ function $n(e) {
2017
+ ve(e) || je(e) || le("handlerType"), je(e) && Object.values(e).some(function(r) {
2018
+ return !ve(r);
2019
+ }) && le("handlersType");
1641
2020
  }
1642
- function Zr(e) {
1643
- e || ne("initialIsRequired"), be(e) || ne("initialType"), qr(e) && ne("initialContent");
2021
+ function Cn(e) {
2022
+ e || le("initialIsRequired"), je(e) || le("initialType"), vn(e) && le("initialContent");
1644
2023
  }
1645
- function Kr(e, t) {
1646
- throw new Error(e[t] || e.default);
2024
+ function Mn(e, r) {
2025
+ throw new Error(e[r] || e.default);
1647
2026
  }
1648
- var Jr = {
2027
+ var Sn = {
1649
2028
  initialIsRequired: "initial state is required",
1650
2029
  initialType: "initial state should be an object",
1651
2030
  initialContent: "initial state shouldn't be an empty object",
@@ -1655,76 +2034,76 @@ var Jr = {
1655
2034
  changeType: "provided value of changes should be an object",
1656
2035
  changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
1657
2036
  default: "an unknown error accured in `state-local` package"
1658
- }, ne = le(Kr)(Jr), pe = {
1659
- changes: Fr,
1660
- selector: Ur,
1661
- handler: Gr,
1662
- initial: Zr
2037
+ }, le = xe(Mn)(Sn), ke = {
2038
+ changes: Nn,
2039
+ selector: kn,
2040
+ handler: $n,
2041
+ initial: Cn
1663
2042
  };
1664
- function Qr(e) {
1665
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1666
- pe.initial(e), pe.handler(t);
1667
- var r = {
2043
+ function jn(e) {
2044
+ var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2045
+ ke.initial(e), ke.handler(r);
2046
+ var n = {
1668
2047
  current: e
1669
- }, a = le(tn)(r, t), o = le(en)(r), l = le(pe.changes)(e), f = le(Xr)(r);
1670
- function g() {
1671
- var k = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(p) {
1672
- return p;
2048
+ }, a = xe(Pn)(n, r), c = xe(En)(n), d = xe(ke.changes)(e), g = xe(On)(n);
2049
+ function h() {
2050
+ var y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(f) {
2051
+ return f;
1673
2052
  };
1674
- return pe.selector(k), k(r.current);
2053
+ return ke.selector(y), y(n.current);
1675
2054
  }
1676
- function y(k) {
1677
- Yr(a, o, l, f)(k);
2055
+ function u(y) {
2056
+ bn(a, c, d, g)(y);
1678
2057
  }
1679
- return [g, y];
2058
+ return [h, u];
1680
2059
  }
1681
- function Xr(e, t) {
1682
- return he(t) ? t(e.current) : t;
2060
+ function On(e, r) {
2061
+ return ve(r) ? r(e.current) : r;
1683
2062
  }
1684
- function en(e, t) {
1685
- return e.current = tt(tt({}, e.current), t), t;
2063
+ function En(e, r) {
2064
+ return e.current = ft(ft({}, e.current), r), r;
1686
2065
  }
1687
- function tn(e, t, r) {
1688
- return he(t) ? t(e.current) : Object.keys(r).forEach(function(a) {
1689
- var o;
1690
- return (o = t[a]) === null || o === void 0 ? void 0 : o.call(t, e.current[a]);
1691
- }), r;
2066
+ function Pn(e, r, n) {
2067
+ return ve(r) ? r(e.current) : Object.keys(n).forEach(function(a) {
2068
+ var c;
2069
+ return (c = r[a]) === null || c === void 0 ? void 0 : c.call(r, e.current[a]);
2070
+ }), n;
1692
2071
  }
1693
- var rn = {
1694
- create: Qr
1695
- }, nn = {
2072
+ var Dn = {
2073
+ create: jn
2074
+ }, In = {
1696
2075
  paths: {
1697
2076
  vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"
1698
2077
  }
1699
2078
  };
1700
- function an(e) {
1701
- return function t() {
1702
- for (var r = this, a = arguments.length, o = new Array(a), l = 0; l < a; l++)
1703
- o[l] = arguments[l];
1704
- return o.length >= e.length ? e.apply(this, o) : function() {
1705
- for (var f = arguments.length, g = new Array(f), y = 0; y < f; y++)
1706
- g[y] = arguments[y];
1707
- return t.apply(r, [].concat(o, g));
2079
+ function Ln(e) {
2080
+ return function r() {
2081
+ for (var n = this, a = arguments.length, c = new Array(a), d = 0; d < a; d++)
2082
+ c[d] = arguments[d];
2083
+ return c.length >= e.length ? e.apply(this, c) : function() {
2084
+ for (var g = arguments.length, h = new Array(g), u = 0; u < g; u++)
2085
+ h[u] = arguments[u];
2086
+ return r.apply(n, [].concat(c, h));
1708
2087
  };
1709
2088
  };
1710
2089
  }
1711
- function sn(e) {
2090
+ function _n(e) {
1712
2091
  return {}.toString.call(e).includes("Object");
1713
2092
  }
1714
- function on(e) {
1715
- return e || rt("configIsRequired"), sn(e) || rt("configType"), e.urls ? (cn(), {
2093
+ function Tn(e) {
2094
+ return e || xt("configIsRequired"), _n(e) || xt("configType"), e.urls ? (zn(), {
1716
2095
  paths: {
1717
2096
  vs: e.urls.monacoBase
1718
2097
  }
1719
2098
  }) : e;
1720
2099
  }
1721
- function cn() {
1722
- console.warn(xt.deprecation);
2100
+ function zn() {
2101
+ console.warn(_t.deprecation);
1723
2102
  }
1724
- function ln(e, t) {
1725
- throw new Error(e[t] || e.default);
2103
+ function An(e, r) {
2104
+ throw new Error(e[r] || e.default);
1726
2105
  }
1727
- var xt = {
2106
+ var _t = {
1728
2107
  configIsRequired: "the configuration object is required",
1729
2108
  configType: "the configuration object should be an object",
1730
2109
  default: "an unknown error accured in `@monaco-editor/loader` package",
@@ -1738,380 +2117,380 @@ var xt = {
1738
2117
 
1739
2118
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
1740
2119
  `
1741
- }, rt = an(ln)(xt), dn = {
1742
- config: on
1743
- }, un = function() {
1744
- for (var t = arguments.length, r = new Array(t), a = 0; a < t; a++)
1745
- r[a] = arguments[a];
1746
- return function(o) {
1747
- return r.reduceRight(function(l, f) {
1748
- return f(l);
1749
- }, o);
2120
+ }, xt = Ln(An)(_t), Hn = {
2121
+ config: Tn
2122
+ }, Gn = function() {
2123
+ for (var r = arguments.length, n = new Array(r), a = 0; a < r; a++)
2124
+ n[a] = arguments[a];
2125
+ return function(c) {
2126
+ return n.reduceRight(function(d, g) {
2127
+ return g(d);
2128
+ }, c);
1750
2129
  };
1751
2130
  };
1752
- function bt(e, t) {
1753
- return Object.keys(t).forEach(function(r) {
1754
- t[r] instanceof Object && e[r] && Object.assign(t[r], bt(e[r], t[r]));
1755
- }), Xe(Xe({}, e), t);
2131
+ function Tt(e, r) {
2132
+ return Object.keys(r).forEach(function(n) {
2133
+ r[n] instanceof Object && e[n] && Object.assign(r[n], Tt(e[n], r[n]));
2134
+ }), gt(gt({}, e), r);
1756
2135
  }
1757
- var hn = {
2136
+ var Wn = {
1758
2137
  type: "cancelation",
1759
2138
  msg: "operation is manually canceled"
1760
2139
  };
1761
- function Se(e) {
1762
- var t = !1, r = new Promise(function(a, o) {
1763
- e.then(function(l) {
1764
- return t ? o(hn) : a(l);
1765
- }), e.catch(o);
2140
+ function Ae(e) {
2141
+ var r = !1, n = new Promise(function(a, c) {
2142
+ e.then(function(d) {
2143
+ return r ? c(Wn) : a(d);
2144
+ }), e.catch(c);
1766
2145
  });
1767
- return r.cancel = function() {
1768
- return t = !0;
1769
- }, r;
2146
+ return n.cancel = function() {
2147
+ return r = !0;
2148
+ }, n;
1770
2149
  }
1771
- var mn = ["monaco"], pn = rn.create({
1772
- config: nn,
2150
+ var Rn = ["monaco"], Vn = Dn.create({
2151
+ config: In,
1773
2152
  isInitialized: !1,
1774
2153
  resolve: null,
1775
2154
  reject: null,
1776
2155
  monaco: null
1777
- }), yt = Hr(pn, 2), me = yt[0], we = yt[1];
1778
- function fn(e) {
1779
- var t = dn.config(e), r = t.monaco, a = zr(t, mn);
1780
- we(function(o) {
2156
+ }), zt = gn(Vn, 2), Ne = zt[0], De = zt[1];
2157
+ function Yn(e) {
2158
+ var r = Hn.config(e), n = r.monaco, a = mn(r, Rn);
2159
+ De(function(c) {
1781
2160
  return {
1782
- config: bt(o.config, a),
1783
- monaco: r
2161
+ config: Tt(c.config, a),
2162
+ monaco: n
1784
2163
  };
1785
2164
  });
1786
2165
  }
1787
- function gn() {
1788
- var e = me(function(t) {
1789
- var r = t.monaco, a = t.isInitialized, o = t.resolve;
2166
+ function qn() {
2167
+ var e = Ne(function(r) {
2168
+ var n = r.monaco, a = r.isInitialized, c = r.resolve;
1790
2169
  return {
1791
- monaco: r,
2170
+ monaco: n,
1792
2171
  isInitialized: a,
1793
- resolve: o
2172
+ resolve: c
1794
2173
  };
1795
2174
  });
1796
2175
  if (!e.isInitialized) {
1797
- if (we({
2176
+ if (De({
1798
2177
  isInitialized: !0
1799
2178
  }), e.monaco)
1800
- return e.resolve(e.monaco), Se(je);
2179
+ return e.resolve(e.monaco), Ae(He);
1801
2180
  if (window.monaco && window.monaco.editor)
1802
- return vt(window.monaco), e.resolve(window.monaco), Se(je);
1803
- un(xn, yn)(vn);
2181
+ return At(window.monaco), e.resolve(window.monaco), Ae(He);
2182
+ Gn(Bn, Un)(Kn);
1804
2183
  }
1805
- return Se(je);
2184
+ return Ae(He);
1806
2185
  }
1807
- function xn(e) {
2186
+ function Bn(e) {
1808
2187
  return document.body.appendChild(e);
1809
2188
  }
1810
- function bn(e) {
1811
- var t = document.createElement("script");
1812
- return e && (t.src = e), t;
2189
+ function Fn(e) {
2190
+ var r = document.createElement("script");
2191
+ return e && (r.src = e), r;
1813
2192
  }
1814
- function yn(e) {
1815
- var t = me(function(a) {
1816
- var o = a.config, l = a.reject;
2193
+ function Un(e) {
2194
+ var r = Ne(function(a) {
2195
+ var c = a.config, d = a.reject;
1817
2196
  return {
1818
- config: o,
1819
- reject: l
2197
+ config: c,
2198
+ reject: d
1820
2199
  };
1821
- }), r = bn("".concat(t.config.paths.vs, "/loader.js"));
1822
- return r.onload = function() {
2200
+ }), n = Fn("".concat(r.config.paths.vs, "/loader.js"));
2201
+ return n.onload = function() {
1823
2202
  return e();
1824
- }, r.onerror = t.reject, r;
2203
+ }, n.onerror = r.reject, n;
1825
2204
  }
1826
- function vn() {
1827
- var e = me(function(r) {
1828
- var a = r.config, o = r.resolve, l = r.reject;
2205
+ function Kn() {
2206
+ var e = Ne(function(n) {
2207
+ var a = n.config, c = n.resolve, d = n.reject;
1829
2208
  return {
1830
2209
  config: a,
1831
- resolve: o,
1832
- reject: l
2210
+ resolve: c,
2211
+ reject: d
1833
2212
  };
1834
- }), t = window.require;
1835
- t.config(e.config), t(["vs/editor/editor.main"], function(r) {
1836
- var a = r.m || r;
1837
- vt(a), e.resolve(a);
1838
- }, function(r) {
1839
- e.reject(r);
2213
+ }), r = window.require;
2214
+ r.config(e.config), r(["vs/editor/editor.main"], function(n) {
2215
+ var a = n.m || n;
2216
+ At(a), e.resolve(a);
2217
+ }, function(n) {
2218
+ e.reject(n);
1840
2219
  });
1841
2220
  }
1842
- function vt(e) {
1843
- me().monaco || we({
2221
+ function At(e) {
2222
+ Ne().monaco || De({
1844
2223
  monaco: e
1845
2224
  });
1846
2225
  }
1847
- function wn() {
1848
- return me(function(e) {
1849
- var t = e.monaco;
1850
- return t;
2226
+ function Zn() {
2227
+ return Ne(function(e) {
2228
+ var r = e.monaco;
2229
+ return r;
1851
2230
  });
1852
2231
  }
1853
- var je = new Promise(function(e, t) {
1854
- return we({
2232
+ var He = new Promise(function(e, r) {
2233
+ return De({
1855
2234
  resolve: e,
1856
- reject: t
2235
+ reject: r
1857
2236
  });
1858
- }), wt = {
1859
- config: fn,
1860
- init: gn,
1861
- __getMonacoInstance: wn
1862
- }, Nn = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, Oe = Nn, kn = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, $n = kn;
1863
- function Mn({ children: e }) {
1864
- return ce.createElement("div", { style: $n.container }, e);
1865
- }
1866
- var Cn = Mn, Sn = Cn;
1867
- function jn({ width: e, height: t, isEditorReady: r, loading: a, _ref: o, className: l, wrapperProps: f }) {
1868
- return ce.createElement("section", { style: { ...Oe.wrapper, width: e, height: t }, ...f }, !r && ce.createElement(Sn, null, a), ce.createElement("div", { ref: o, style: { ...Oe.fullWidth, ...!r && Oe.hide }, className: l }));
1869
- }
1870
- var On = jn, Nt = We(On);
1871
- function Pn(e) {
1872
- K(e, []);
1873
- }
1874
- var kt = Pn;
1875
- function En(e, t, r = !0) {
2237
+ }), Ht = {
2238
+ config: Yn,
2239
+ init: qn,
2240
+ __getMonacoInstance: Zn
2241
+ }, Jn = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, Ge = Jn, Xn = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Qn = Xn;
2242
+ function ea({ children: e }) {
2243
+ return ge.createElement("div", { style: Qn.container }, e);
2244
+ }
2245
+ var ta = ea, ra = ta;
2246
+ function na({ width: e, height: r, isEditorReady: n, loading: a, _ref: c, className: d, wrapperProps: g }) {
2247
+ return ge.createElement("section", { style: { ...Ge.wrapper, width: e, height: r }, ...g }, !n && ge.createElement(ra, null, a), ge.createElement("div", { ref: c, style: { ...Ge.fullWidth, ...!n && Ge.hide }, className: d }));
2248
+ }
2249
+ var aa = na, Gt = Ze(aa);
2250
+ function ia(e) {
2251
+ te(e, []);
2252
+ }
2253
+ var Wt = ia;
2254
+ function sa(e, r, n = !0) {
1876
2255
  let a = Y(!0);
1877
- K(a.current || !r ? () => {
2256
+ te(a.current || !n ? () => {
1878
2257
  a.current = !1;
1879
- } : e, t);
2258
+ } : e, r);
1880
2259
  }
1881
- var X = En;
1882
- function de() {
2260
+ var oe = sa;
2261
+ function ye() {
1883
2262
  }
1884
- function oe(e, t, r, a) {
1885
- return Ln(e, a) || Tn(e, t, r, a);
2263
+ function he(e, r, n, a) {
2264
+ return oa(e, a) || ca(e, r, n, a);
1886
2265
  }
1887
- function Ln(e, t) {
1888
- return e.editor.getModel($t(e, t));
2266
+ function oa(e, r) {
2267
+ return e.editor.getModel(Rt(e, r));
1889
2268
  }
1890
- function Tn(e, t, r, a) {
1891
- return e.editor.createModel(t, r, a ? $t(e, a) : void 0);
2269
+ function ca(e, r, n, a) {
2270
+ return e.editor.createModel(r, n, a ? Rt(e, a) : void 0);
1892
2271
  }
1893
- function $t(e, t) {
1894
- return e.Uri.parse(t);
2272
+ function Rt(e, r) {
2273
+ return e.Uri.parse(r);
1895
2274
  }
1896
- function _n({ original: e, modified: t, language: r, originalLanguage: a, modifiedLanguage: o, originalModelPath: l, modifiedModelPath: f, keepCurrentOriginalModel: g = !1, keepCurrentModifiedModel: y = !1, theme: k = "light", loading: p = "Loading...", options: v = {}, height: P = "100%", width: A = "100%", className: H, wrapperProps: T = {}, beforeMount: W = de, onMount: D = de }) {
1897
- let [R, V] = _(!1), [j, E] = _(!0), b = Y(null), h = Y(null), z = Y(null), M = Y(D), x = Y(W), w = Y(!1);
1898
- kt(() => {
1899
- let i = wt.init();
1900
- return i.then((c) => (h.current = c) && E(!1)).catch((c) => (c == null ? void 0 : c.type) !== "cancelation" && console.error("Monaco initialization: error:", c)), () => b.current ? d() : i.cancel();
1901
- }), X(() => {
1902
- if (b.current && h.current) {
1903
- let i = b.current.getOriginalEditor(), c = oe(h.current, e || "", a || r || "text", l || "");
1904
- c !== i.getModel() && i.setModel(c);
2275
+ function la({ original: e, modified: r, language: n, originalLanguage: a, modifiedLanguage: c, originalModelPath: d, modifiedModelPath: g, keepCurrentOriginalModel: h = !1, keepCurrentModifiedModel: u = !1, theme: y = "light", loading: f = "Loading...", options: N = {}, height: _ = "100%", width: z = "100%", className: A, wrapperProps: W = {}, beforeMount: V = ye, onMount: R = ye }) {
2276
+ let [H, F] = S(!1), [M, D] = S(!0), v = Y(null), b = Y(null), T = Y(null), O = Y(R), p = Y(V), C = Y(!1);
2277
+ Wt(() => {
2278
+ let l = Ht.init();
2279
+ return l.then((m) => (b.current = m) && D(!1)).catch((m) => (m == null ? void 0 : m.type) !== "cancelation" && console.error("Monaco initialization: error:", m)), () => v.current ? k() : l.cancel();
2280
+ }), oe(() => {
2281
+ if (v.current && b.current) {
2282
+ let l = v.current.getOriginalEditor(), m = he(b.current, e || "", a || n || "text", d || "");
2283
+ m !== l.getModel() && l.setModel(m);
1905
2284
  }
1906
- }, [l], R), X(() => {
1907
- if (b.current && h.current) {
1908
- let i = b.current.getModifiedEditor(), c = oe(h.current, t || "", o || r || "text", f || "");
1909
- c !== i.getModel() && i.setModel(c);
2285
+ }, [d], H), oe(() => {
2286
+ if (v.current && b.current) {
2287
+ let l = v.current.getModifiedEditor(), m = he(b.current, r || "", c || n || "text", g || "");
2288
+ m !== l.getModel() && l.setModel(m);
1910
2289
  }
1911
- }, [f], R), X(() => {
1912
- let i = b.current.getModifiedEditor();
1913
- i.getOption(h.current.editor.EditorOption.readOnly) ? i.setValue(t || "") : t !== i.getValue() && (i.executeEdits("", [{ range: i.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), i.pushUndoStop());
1914
- }, [t], R), X(() => {
1915
- var i, c;
1916
- (c = (i = b.current) == null ? void 0 : i.getModel()) == null || c.original.setValue(e || "");
1917
- }, [e], R), X(() => {
1918
- let { original: i, modified: c } = b.current.getModel();
1919
- h.current.editor.setModelLanguage(i, a || r || "text"), h.current.editor.setModelLanguage(c, o || r || "text");
1920
- }, [r, a, o], R), X(() => {
2290
+ }, [g], H), oe(() => {
2291
+ let l = v.current.getModifiedEditor();
2292
+ l.getOption(b.current.editor.EditorOption.readOnly) ? l.setValue(r || "") : r !== l.getValue() && (l.executeEdits("", [{ range: l.getModel().getFullModelRange(), text: r || "", forceMoveMarkers: !0 }]), l.pushUndoStop());
2293
+ }, [r], H), oe(() => {
2294
+ var l, m;
2295
+ (m = (l = v.current) == null ? void 0 : l.getModel()) == null || m.original.setValue(e || "");
2296
+ }, [e], H), oe(() => {
2297
+ let { original: l, modified: m } = v.current.getModel();
2298
+ b.current.editor.setModelLanguage(l, a || n || "text"), b.current.editor.setModelLanguage(m, c || n || "text");
2299
+ }, [n, a, c], H), oe(() => {
2300
+ var l;
2301
+ (l = b.current) == null || l.editor.setTheme(y);
2302
+ }, [y], H), oe(() => {
2303
+ var l;
2304
+ (l = v.current) == null || l.updateOptions(N);
2305
+ }, [N], H);
2306
+ let L = Me(() => {
2307
+ var $;
2308
+ if (!b.current) return;
2309
+ p.current(b.current);
2310
+ let l = he(b.current, e || "", a || n || "text", d || ""), m = he(b.current, r || "", c || n || "text", g || "");
2311
+ ($ = v.current) == null || $.setModel({ original: l, modified: m });
2312
+ }, [n, r, c, e, a, d, g]), q = Me(() => {
2313
+ var l;
2314
+ !C.current && T.current && (v.current = b.current.editor.createDiffEditor(T.current, { automaticLayout: !0, ...N }), L(), (l = b.current) == null || l.editor.setTheme(y), F(!0), C.current = !0);
2315
+ }, [N, y, L]);
2316
+ te(() => {
2317
+ H && O.current(v.current, b.current);
2318
+ }, [H]), te(() => {
2319
+ !M && !H && q();
2320
+ }, [M, H, q]);
2321
+ function k() {
2322
+ var m, $, x, E;
2323
+ let l = (m = v.current) == null ? void 0 : m.getModel();
2324
+ h || (($ = l == null ? void 0 : l.original) == null || $.dispose()), u || ((x = l == null ? void 0 : l.modified) == null || x.dispose()), (E = v.current) == null || E.dispose();
2325
+ }
2326
+ return ge.createElement(Gt, { width: z, height: _, isEditorReady: H, loading: f, _ref: T, className: A, wrapperProps: W });
2327
+ }
2328
+ var da = la;
2329
+ Ze(da);
2330
+ function ua(e) {
2331
+ let r = Y();
2332
+ return te(() => {
2333
+ r.current = e;
2334
+ }, [e]), r.current;
2335
+ }
2336
+ var ma = ua, $e = /* @__PURE__ */ new Map();
2337
+ function ha({ defaultValue: e, defaultLanguage: r, defaultPath: n, value: a, language: c, path: d, theme: g = "light", line: h, loading: u = "Loading...", options: y = {}, overrideServices: f = {}, saveViewState: N = !0, keepCurrentModel: _ = !1, width: z = "100%", height: A = "100%", className: W, wrapperProps: V = {}, beforeMount: R = ye, onMount: H = ye, onChange: F, onValidate: M = ye }) {
2338
+ let [D, v] = S(!1), [b, T] = S(!0), O = Y(null), p = Y(null), C = Y(null), L = Y(H), q = Y(R), k = Y(), l = Y(a), m = ma(d), $ = Y(!1), x = Y(!1);
2339
+ Wt(() => {
2340
+ let i = Ht.init();
2341
+ return i.then((o) => (O.current = o) && T(!1)).catch((o) => (o == null ? void 0 : o.type) !== "cancelation" && console.error("Monaco initialization: error:", o)), () => p.current ? P() : i.cancel();
2342
+ }), oe(() => {
2343
+ var o, w, j, G;
2344
+ let i = he(O.current, e || a || "", r || c || "", d || n || "");
2345
+ i !== ((o = p.current) == null ? void 0 : o.getModel()) && (N && $e.set(m, (w = p.current) == null ? void 0 : w.saveViewState()), (j = p.current) == null || j.setModel(i), N && ((G = p.current) == null || G.restoreViewState($e.get(d))));
2346
+ }, [d], D), oe(() => {
1921
2347
  var i;
1922
- (i = h.current) == null || i.editor.setTheme(k);
1923
- }, [k], R), X(() => {
2348
+ (i = p.current) == null || i.updateOptions(y);
2349
+ }, [y], D), oe(() => {
2350
+ !p.current || a === void 0 || (p.current.getOption(O.current.editor.EditorOption.readOnly) ? p.current.setValue(a) : a !== p.current.getValue() && (x.current = !0, p.current.executeEdits("", [{ range: p.current.getModel().getFullModelRange(), text: a, forceMoveMarkers: !0 }]), p.current.pushUndoStop(), x.current = !1));
2351
+ }, [a], D), oe(() => {
2352
+ var o, w;
2353
+ let i = (o = p.current) == null ? void 0 : o.getModel();
2354
+ i && c && ((w = O.current) == null || w.editor.setModelLanguage(i, c));
2355
+ }, [c], D), oe(() => {
1924
2356
  var i;
1925
- (i = b.current) == null || i.updateOptions(v);
1926
- }, [v], R);
1927
- let L = xe(() => {
1928
- var m;
1929
- if (!h.current) return;
1930
- x.current(h.current);
1931
- let i = oe(h.current, e || "", a || r || "text", l || ""), c = oe(h.current, t || "", o || r || "text", f || "");
1932
- (m = b.current) == null || m.setModel({ original: i, modified: c });
1933
- }, [r, t, o, e, a, l, f]), F = xe(() => {
2357
+ h !== void 0 && ((i = p.current) == null || i.revealLine(h));
2358
+ }, [h], D), oe(() => {
1934
2359
  var i;
1935
- !w.current && z.current && (b.current = h.current.editor.createDiffEditor(z.current, { automaticLayout: !0, ...v }), L(), (i = h.current) == null || i.editor.setTheme(k), V(!0), w.current = !0);
1936
- }, [v, k, L]);
1937
- K(() => {
1938
- R && M.current(b.current, h.current);
1939
- }, [R]), K(() => {
1940
- !j && !R && F();
1941
- }, [j, R, F]);
1942
- function d() {
1943
- var c, m, u, C;
1944
- let i = (c = b.current) == null ? void 0 : c.getModel();
1945
- g || ((m = i == null ? void 0 : i.original) == null || m.dispose()), y || ((u = i == null ? void 0 : i.modified) == null || u.dispose()), (C = b.current) == null || C.dispose();
1946
- }
1947
- return ce.createElement(Nt, { width: A, height: P, isEditorReady: R, loading: p, _ref: z, className: H, wrapperProps: T });
1948
- }
1949
- var Dn = _n;
1950
- We(Dn);
1951
- function zn(e) {
1952
- let t = Y();
1953
- return K(() => {
1954
- t.current = e;
1955
- }, [e]), t.current;
1956
- }
1957
- var An = zn, fe = /* @__PURE__ */ new Map();
1958
- function Hn({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: a, language: o, path: l, theme: f = "light", line: g, loading: y = "Loading...", options: k = {}, overrideServices: p = {}, saveViewState: v = !0, keepCurrentModel: P = !1, width: A = "100%", height: H = "100%", className: T, wrapperProps: W = {}, beforeMount: D = de, onMount: R = de, onChange: V, onValidate: j = de }) {
1959
- let [E, b] = _(!1), [h, z] = _(!0), M = Y(null), x = Y(null), w = Y(null), L = Y(R), F = Y(D), d = Y(), i = Y(a), c = An(l), m = Y(!1), u = Y(!1);
1960
- kt(() => {
1961
- let N = wt.init();
1962
- return N.then((S) => (M.current = S) && z(!1)).catch((S) => (S == null ? void 0 : S.type) !== "cancelation" && console.error("Monaco initialization: error:", S)), () => x.current ? O() : N.cancel();
1963
- }), X(() => {
1964
- var S, I, q, G;
1965
- let N = oe(M.current, e || a || "", t || o || "", l || r || "");
1966
- N !== ((S = x.current) == null ? void 0 : S.getModel()) && (v && fe.set(c, (I = x.current) == null ? void 0 : I.saveViewState()), (q = x.current) == null || q.setModel(N), v && ((G = x.current) == null || G.restoreViewState(fe.get(l))));
1967
- }, [l], E), X(() => {
1968
- var N;
1969
- (N = x.current) == null || N.updateOptions(k);
1970
- }, [k], E), X(() => {
1971
- !x.current || a === void 0 || (x.current.getOption(M.current.editor.EditorOption.readOnly) ? x.current.setValue(a) : a !== x.current.getValue() && (u.current = !0, x.current.executeEdits("", [{ range: x.current.getModel().getFullModelRange(), text: a, forceMoveMarkers: !0 }]), x.current.pushUndoStop(), u.current = !1));
1972
- }, [a], E), X(() => {
1973
- var S, I;
1974
- let N = (S = x.current) == null ? void 0 : S.getModel();
1975
- N && o && ((I = M.current) == null || I.editor.setModelLanguage(N, o));
1976
- }, [o], E), X(() => {
1977
- var N;
1978
- g !== void 0 && ((N = x.current) == null || N.revealLine(g));
1979
- }, [g], E), X(() => {
1980
- var N;
1981
- (N = M.current) == null || N.editor.setTheme(f);
1982
- }, [f], E);
1983
- let C = xe(() => {
1984
- var N;
1985
- if (!(!w.current || !M.current) && !m.current) {
1986
- F.current(M.current);
1987
- let S = l || r, I = oe(M.current, a || e || "", t || o || "", S || "");
1988
- x.current = (N = M.current) == null ? void 0 : N.editor.create(w.current, { model: I, automaticLayout: !0, ...k }, p), v && x.current.restoreViewState(fe.get(S)), M.current.editor.setTheme(f), g !== void 0 && x.current.revealLine(g), b(!0), m.current = !0;
2360
+ (i = O.current) == null || i.editor.setTheme(g);
2361
+ }, [g], D);
2362
+ let E = Me(() => {
2363
+ var i;
2364
+ if (!(!C.current || !O.current) && !$.current) {
2365
+ q.current(O.current);
2366
+ let o = d || n, w = he(O.current, a || e || "", r || c || "", o || "");
2367
+ p.current = (i = O.current) == null ? void 0 : i.editor.create(C.current, { model: w, automaticLayout: !0, ...y }, f), N && p.current.restoreViewState($e.get(o)), O.current.editor.setTheme(g), h !== void 0 && p.current.revealLine(h), v(!0), $.current = !0;
1989
2368
  }
1990
- }, [e, t, r, a, o, l, k, p, v, f, g]);
1991
- K(() => {
1992
- E && L.current(x.current, M.current);
1993
- }, [E]), K(() => {
1994
- !h && !E && C();
1995
- }, [h, E, C]), i.current = a, K(() => {
1996
- var N, S;
1997
- E && V && ((N = d.current) == null || N.dispose(), d.current = (S = x.current) == null ? void 0 : S.onDidChangeModelContent((I) => {
1998
- u.current || V(x.current.getValue(), I);
2369
+ }, [e, r, n, a, c, d, y, f, N, g, h]);
2370
+ te(() => {
2371
+ D && L.current(p.current, O.current);
2372
+ }, [D]), te(() => {
2373
+ !b && !D && E();
2374
+ }, [b, D, E]), l.current = a, te(() => {
2375
+ var i, o;
2376
+ D && F && ((i = k.current) == null || i.dispose(), k.current = (o = p.current) == null ? void 0 : o.onDidChangeModelContent((w) => {
2377
+ x.current || F(p.current.getValue(), w);
1999
2378
  }));
2000
- }, [E, V]), K(() => {
2001
- if (E) {
2002
- let N = M.current.editor.onDidChangeMarkers((S) => {
2003
- var q;
2004
- let I = (q = x.current.getModel()) == null ? void 0 : q.uri;
2005
- if (I && S.find((G) => G.path === I.path)) {
2006
- let G = M.current.editor.getModelMarkers({ resource: I });
2007
- j == null || j(G);
2379
+ }, [D, F]), te(() => {
2380
+ if (D) {
2381
+ let i = O.current.editor.onDidChangeMarkers((o) => {
2382
+ var j;
2383
+ let w = (j = p.current.getModel()) == null ? void 0 : j.uri;
2384
+ if (w && o.find((G) => G.path === w.path)) {
2385
+ let G = O.current.editor.getModelMarkers({ resource: w });
2386
+ M == null || M(G);
2008
2387
  }
2009
2388
  });
2010
2389
  return () => {
2011
- N == null || N.dispose();
2390
+ i == null || i.dispose();
2012
2391
  };
2013
2392
  }
2014
2393
  return () => {
2015
2394
  };
2016
- }, [E, j]);
2017
- function O() {
2018
- var N, S;
2019
- (N = d.current) == null || N.dispose(), P ? v && fe.set(l, x.current.saveViewState()) : (S = x.current.getModel()) == null || S.dispose(), x.current.dispose();
2395
+ }, [D, M]);
2396
+ function P() {
2397
+ var i, o;
2398
+ (i = k.current) == null || i.dispose(), _ ? N && $e.set(d, p.current.saveViewState()) : (o = p.current.getModel()) == null || o.dispose(), p.current.dispose();
2020
2399
  }
2021
- return ce.createElement(Nt, { width: A, height: H, isEditorReady: E, loading: y, _ref: w, className: T, wrapperProps: W });
2022
- }
2023
- var In = Hn, Wn = We(In), Rn = Wn;
2024
- function ye({ title: e, children: t, placement: r = "top", align: a = "center", variant: o = "default" }) {
2025
- const [l, f] = _(!1), [g, y] = _(null), k = Y(null), p = Y(null), v = Y(void 0), P = Y(!1), A = Y(null), H = Ie(), T = () => {
2026
- clearTimeout(v.current), P.current = !1, A.current = null, f(!1), y(null);
2027
- }, W = () => {
2028
- clearTimeout(v.current), f(!0);
2029
- }, D = () => {
2030
- clearTimeout(v.current), !P.current && (v.current = setTimeout(() => {
2031
- P.current || T();
2032
- }, 150));
2400
+ return ge.createElement(Gt, { width: z, height: A, isEditorReady: D, loading: u, _ref: C, className: W, wrapperProps: V });
2401
+ }
2402
+ var ga = ha, pa = Ze(ga), fa = pa;
2403
+ function Oe({ title: e, children: r, placement: n = "top", align: a = "center", variant: c = "default" }) {
2404
+ const [d, g] = S(!1), [h, u] = S(null), y = Y(null), f = Y(null), N = Y(void 0), _ = Y(!1), z = Y(null), A = we(), W = () => {
2405
+ clearTimeout(N.current), _.current = !1, z.current = null, g(!1), u(null);
2406
+ }, V = () => {
2407
+ clearTimeout(N.current), g(!0);
2033
2408
  }, R = () => {
2034
- o === "card" && (P.current = !0, W());
2035
- }, V = (j) => {
2036
- var E, b;
2037
- return j instanceof Node && (((E = k.current) == null ? void 0 : E.contains(j)) || ((b = p.current) == null ? void 0 : b.contains(j)));
2409
+ clearTimeout(N.current), !_.current && (N.current = setTimeout(() => {
2410
+ _.current || W();
2411
+ }, 150));
2412
+ }, H = () => {
2413
+ c === "card" && (_.current = !0, V());
2414
+ }, F = (M) => {
2415
+ var D, v;
2416
+ return M instanceof Node && (((D = y.current) == null ? void 0 : D.contains(M)) || ((v = f.current) == null ? void 0 : v.contains(M)));
2038
2417
  };
2039
- return K(() => () => clearTimeout(v.current), []), K(() => {
2040
- if (!l) return;
2041
- const j = (b) => {
2042
- V(b.target) || T();
2043
- }, E = (b) => {
2044
- b.key === "Escape" && T();
2418
+ return te(() => () => clearTimeout(N.current), []), te(() => {
2419
+ if (!d) return;
2420
+ const M = (v) => {
2421
+ F(v.target) || W();
2422
+ }, D = (v) => {
2423
+ v.key === "Escape" && W();
2045
2424
  };
2046
- return document.addEventListener("pointerdown", j), document.addEventListener("keydown", E), () => {
2047
- document.removeEventListener("pointerdown", j), document.removeEventListener("keydown", E);
2425
+ return document.addEventListener("pointerdown", M), document.addEventListener("keydown", D), () => {
2426
+ document.removeEventListener("pointerdown", M), document.removeEventListener("keydown", D);
2048
2427
  };
2049
- }, [l]), Mt(() => {
2050
- if (!l || !e) return;
2051
- const j = () => {
2052
- const b = k.current, h = p.current;
2053
- if (!b || !h) return;
2054
- const z = 12, M = 6, x = b.getBoundingClientRect(), w = Math.max(0, x.top - z - M), L = Math.max(0, window.innerHeight - x.bottom - z - M), F = o === "card" ? 420 : 320;
2055
- if (!A.current) {
2056
- const m = o === "card" ? F : Math.min(F, h.getBoundingClientRect().height), u = r === "top" ? w >= m || w >= L : !(L >= m || L >= w);
2057
- A.current = u ? "top" : "bottom";
2428
+ }, [d]), bt(() => {
2429
+ if (!d || !e) return;
2430
+ const M = () => {
2431
+ const v = y.current, b = f.current;
2432
+ if (!v || !b) return;
2433
+ const T = 12, O = 6, p = v.getBoundingClientRect(), C = Math.max(0, p.top - T - O), L = Math.max(0, window.innerHeight - p.bottom - T - O), q = c === "card" ? 420 : 320;
2434
+ if (!z.current) {
2435
+ const $ = c === "card" ? q : Math.min(q, b.getBoundingClientRect().height), x = n === "top" ? C >= $ || C >= L : !(L >= $ || L >= C);
2436
+ z.current = x ? "top" : "bottom";
2058
2437
  }
2059
- const d = A.current === "top";
2060
- h.style.maxHeight = `${Math.min(F, d ? w : L)}px`;
2061
- const { width: i, height: c } = h.getBoundingClientRect();
2062
- y({
2063
- left: Math.max(z, Math.min(
2064
- a === "end" ? x.right - i : x.left + (x.width - i) / 2,
2065
- window.innerWidth - i - z
2438
+ const k = z.current === "top";
2439
+ b.style.maxHeight = `${Math.min(q, k ? C : L)}px`;
2440
+ const { width: l, height: m } = b.getBoundingClientRect();
2441
+ u({
2442
+ left: Math.max(T, Math.min(
2443
+ a === "end" ? p.right - l : p.left + (p.width - l) / 2,
2444
+ window.innerWidth - l - T
2066
2445
  )),
2067
- top: d ? x.top - c - M : x.bottom + M
2446
+ top: k ? p.top - m - O : p.bottom + O
2068
2447
  });
2069
2448
  };
2070
- j();
2071
- const E = new ResizeObserver(j);
2072
- return p.current && E.observe(p.current), window.addEventListener("resize", j), window.addEventListener("scroll", j, !0), () => {
2073
- E.disconnect(), window.removeEventListener("resize", j), window.removeEventListener("scroll", j, !0);
2449
+ M();
2450
+ const D = new ResizeObserver(M);
2451
+ return f.current && D.observe(f.current), window.addEventListener("resize", M), window.addEventListener("scroll", M, !0), () => {
2452
+ D.disconnect(), window.removeEventListener("resize", M), window.removeEventListener("scroll", M, !0);
2074
2453
  };
2075
- }, [l, e, r, a, o]), e ? /* @__PURE__ */ s(
2454
+ }, [d, e, n, a, c]), e ? /* @__PURE__ */ s(
2076
2455
  "div",
2077
2456
  {
2078
- ref: k,
2457
+ ref: y,
2079
2458
  className: "inline-flex",
2080
- "aria-describedby": l && o === "default" ? H : void 0,
2081
- onMouseEnter: W,
2082
- onMouseLeave: D,
2083
- onPointerDown: R,
2459
+ "aria-describedby": d && c === "default" ? A : void 0,
2460
+ onMouseEnter: V,
2461
+ onMouseLeave: R,
2462
+ onPointerDown: H,
2084
2463
  onClick: () => {
2085
- o === "default" && T();
2464
+ c === "default" && W();
2086
2465
  },
2087
- onFocus: W,
2088
- onBlur: (j) => {
2089
- V(j.relatedTarget) || (j.relatedTarget ? T() : D());
2466
+ onFocus: V,
2467
+ onBlur: (M) => {
2468
+ F(M.relatedTarget) || (M.relatedTarget ? W() : R());
2090
2469
  },
2091
2470
  children: [
2092
- t,
2093
- l && at(
2094
- /* @__PURE__ */ n(
2471
+ r,
2472
+ d && vt(
2473
+ /* @__PURE__ */ t(
2095
2474
  "div",
2096
2475
  {
2097
- ref: p,
2098
- id: H,
2099
- role: o === "card" ? "dialog" : "tooltip",
2100
- "aria-label": o === "card" ? "校验问题" : void 0,
2101
- className: `aisee-articles-tooltip aisee-articles-tooltip--${o}`,
2476
+ ref: f,
2477
+ id: A,
2478
+ role: c === "card" ? "dialog" : "tooltip",
2479
+ "aria-label": c === "card" ? "校验问题" : void 0,
2480
+ className: `aisee-articles-tooltip aisee-articles-tooltip--${c}`,
2102
2481
  style: {
2103
- width: o === "card" ? 480 : "max-content",
2482
+ width: c === "card" ? 480 : "max-content",
2104
2483
  maxWidth: "min(480px, calc(100vw - 24px))",
2105
2484
  overflowWrap: "anywhere",
2106
2485
  scrollbarWidth: "thin",
2107
- left: (g == null ? void 0 : g.left) ?? 0,
2108
- top: (g == null ? void 0 : g.top) ?? 0,
2109
- visibility: g ? "visible" : "hidden"
2486
+ left: (h == null ? void 0 : h.left) ?? 0,
2487
+ top: (h == null ? void 0 : h.top) ?? 0,
2488
+ visibility: h ? "visible" : "hidden"
2110
2489
  },
2111
- onMouseEnter: W,
2112
- onMouseLeave: D,
2113
- onPointerDown: R,
2114
- onFocus: W,
2490
+ onMouseEnter: V,
2491
+ onMouseLeave: R,
2492
+ onPointerDown: H,
2493
+ onFocus: V,
2115
2494
  children: e
2116
2495
  }
2117
2496
  ),
@@ -2119,136 +2498,184 @@ function ye({ title: e, children: t, placement: r = "top", align: a = "center",
2119
2498
  )
2120
2499
  ]
2121
2500
  }
2122
- ) : /* @__PURE__ */ n(ue, { children: t });
2123
- }
2124
- const Pe = [
2125
- { key: "desktop", icon: /* @__PURE__ */ n(dt, { size: 13 }), label: "桌面", width: null },
2126
- { key: "tablet", icon: /* @__PURE__ */ n(pt, { size: 13 }), label: "平板", width: 768 },
2127
- { key: "mobile", icon: /* @__PURE__ */ n(mt, { size: 13 }), label: "手机", width: 390 }
2128
- ], Kn = ({ id: e, record: t }) => {
2129
- const { navigate: r, params: a, locationState: o } = Ve(), l = e ?? a.id, { basePath: f, service: g, previewBaseUrl: y, previewTailwind: k } = ve(), p = !!l, [v, P] = ft(), [A, H] = _(!1), [T, W] = _(t ?? (o == null ? void 0 : o.record) ?? null), [D, R] = _(""), [V, j] = _(p ? "" : "https://aisee.live"), [E, b] = _(""), [h, z] = _(""), [M, x] = _({
2501
+ ) : /* @__PURE__ */ t(be, { children: r });
2502
+ }
2503
+ const We = [
2504
+ { key: "desktop", icon: /* @__PURE__ */ t(Mt, { size: 13 }), label: "桌面", width: null },
2505
+ { key: "tablet", icon: /* @__PURE__ */ t(Ot, { size: 13 }), label: "平板", width: 768 },
2506
+ { key: "mobile", icon: /* @__PURE__ */ t(jt, { size: 13 }), label: "手机", width: 390 }
2507
+ ], Ca = ({ id: e, record: r }) => {
2508
+ const { navigate: n, params: a } = Xe(), c = e ?? a.id, { basePath: d, service: g, previewBaseUrl: h, previewTailwind: u } = Ee(), y = !!c, [f, N] = Pt(), [_, z] = S(!1), [A, W] = S(r ?? null), [V, R] = S(y && !r), [H, F] = S(""), [M, D] = S(y ? "" : "https://aisee.live"), [v, b] = S(""), [T, O] = S(""), [p, C] = S({ title: "", description: "", categoryId: null }), [L, q] = S([]), [k, l] = S(!1), [m, $] = S(""), [x, E] = S(0), P = an(p), i = M.trim().replace(/\/+$/, ""), o = Y(i);
2509
+ o.current = i;
2510
+ const w = g.getGuidesCategories;
2511
+ te(() => {
2512
+ let I = !0;
2513
+ return q([]), $(""), l(!!i && !!w), i && w && w({ host: i }).then((Z) => {
2514
+ I && q(Z);
2515
+ }).catch((Z) => {
2516
+ I && $(Z instanceof Error ? Z.message : "分类加载失败");
2517
+ }).finally(() => {
2518
+ I && l(!1);
2519
+ }), () => {
2520
+ I = !1;
2521
+ };
2522
+ }, [i, w, x]);
2523
+ const [j, G] = S({
2130
2524
  navEnabled: !1,
2131
2525
  navname: "",
2132
2526
  navPlacements: []
2133
- }), w = ($) => x({
2134
- navEnabled: $.navEnabled ?? !1,
2135
- navname: $.navname ?? "",
2136
- navPlacements: $.navPlacements ?? []
2137
- }), [L, F] = _(""), [d, i] = _("code"), [c, m] = _(!1), [u, C] = _("desktop"), [O, N] = _(!1), [S, I] = _(null), q = ($, Z) => {
2138
- const U = y ? `<base href="${y}">` : "", Q = Z ? `<meta name="viewport" content="width=${Z}, initial-scale=1">` : "", ie = Z ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", Ne = k && !$.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", ke = U + Q + ie + Ne;
2139
- return ke ? $.includes("</head>") ? $.replace("</head>", `${ke}
2140
- </head>`) : ke + $ : $;
2141
- }, G = async () => {
2142
- if (!L.trim()) {
2143
- J.warning("请先输入 HTML 代码");
2527
+ }), J = (I) => {
2528
+ G({
2529
+ navEnabled: I.navEnabled ?? !1,
2530
+ navname: I.navname ?? "",
2531
+ navPlacements: I.navPlacements ?? []
2532
+ }), C(I.guidesDisplay ?? { title: "", description: "", categoryId: null });
2533
+ }, [B, re] = S(""), [X, ne] = S("code"), [ie, se] = S(!1), [ee, Ie] = S("desktop"), [tt, rt] = S(!1), [ue, Le] = S(null), nt = (I, Z) => {
2534
+ const U = h ? `<base href="${h}">` : "", Q = Z ? `<meta name="viewport" content="width=${Z}, initial-scale=1">` : "", ce = Z ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", de = u && !I.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", pe = U + Q + ce + de;
2535
+ return pe ? I.includes("</head>") ? I.replace("</head>", `${pe}
2536
+ </head>`) : pe + I : I;
2537
+ }, Vt = async () => {
2538
+ if (!B.trim()) {
2539
+ ae.warning("请先输入 HTML 代码");
2144
2540
  return;
2145
2541
  }
2146
- N(!0), I(null);
2542
+ rt(!0), Le(null);
2147
2543
  try {
2148
- const $ = await Ke(L);
2149
- I($), $.networkError ? J.warning("W3C 校验服务不可用") : $.isValid && J.success("HTML 校验通过");
2544
+ const I = await ut(B);
2545
+ Le(I), I.networkError ? ae.warning("W3C 校验服务不可用") : I.isValid && ae.success("HTML 校验通过");
2150
2546
  } finally {
2151
- N(!1);
2547
+ rt(!1);
2152
2548
  }
2153
2549
  };
2154
- K(() => {
2155
- p && (T ? (R(T.pathname || ""), j(T.host || ""), F(T.content || ""), w(T)) : g.getById(l).then(($) => {
2156
- W($), R($.pathname || ""), j($.host || ""), F($.content || ""), w($);
2157
- }).catch(($) => {
2158
- J.error($.message || "获取文章失败"), r(f);
2159
- }));
2160
- }, [l]);
2161
- const ee = () => r(f), te = !D.trim(), ae = L.split(`
2162
- `).length, re = async () => {
2163
- if (A) return;
2164
- if (!D.trim()) {
2165
- z("请输入访问路径");
2550
+ te(() => {
2551
+ if (!y) return;
2552
+ let I = !0;
2553
+ const Z = (U) => {
2554
+ W(U), F(U.pathname || ""), D(U.host || ""), re(U.content || ""), J(U);
2555
+ };
2556
+ if ((r == null ? void 0 : r.id) === c) {
2557
+ Z(r), R(!1);
2558
+ return;
2559
+ }
2560
+ return R(!0), g.getById(c).then((U) => {
2561
+ I && Z(U);
2562
+ }).catch((U) => {
2563
+ I && (ae.error(U instanceof Error ? U.message : "获取文章失败"), n(d));
2564
+ }).finally(() => {
2565
+ I && R(!1);
2566
+ }), () => {
2567
+ I = !1;
2568
+ };
2569
+ }, [c, r, g.getById]);
2570
+ const at = () => n(d), Yt = V || !H.trim(), qt = B.split(`
2571
+ `).length, Bt = async () => {
2572
+ if (_ || V) return;
2573
+ if (!H.trim()) {
2574
+ O("请输入访问路径");
2166
2575
  return;
2167
2576
  }
2168
- if (!L.trim()) {
2169
- m(!0), J.error("请先输入 HTML 代码");
2577
+ if (!B.trim()) {
2578
+ se(!0), ae.error("请先输入 HTML 代码");
2170
2579
  return;
2171
2580
  }
2172
- const $ = V.trim().replace(/\/+$/, "");
2581
+ const I = M.trim().replace(/\/+$/, "");
2173
2582
  try {
2174
- const U = new URL($);
2175
- if (!["http:", "https:"].includes(U.protocol) || U.search || U.hash || U.username || U.password) throw new Error();
2583
+ const Q = new URL(I);
2584
+ if (!["http:", "https:"].includes(Q.protocol) || Q.pathname !== "/" || Q.search || Q.hash || Q.username || Q.password) throw new Error();
2176
2585
  } catch {
2177
- b("请输入有效的网站地址,需以 http:// 或 https:// 开头");
2586
+ b("请输入有效的网站地址,需以 http:// 或 https:// 开头,且不能包含路径、账号、查询参数或锚点");
2178
2587
  return;
2179
2588
  }
2180
- if (g.getNavigationGroups && M.navEnabled) {
2181
- if (!M.navname.trim()) {
2182
- J.error("开启导航后,请填写导航名称");
2589
+ if (g.getNavigationGroups && j.navEnabled) {
2590
+ if (!j.navname.trim()) {
2591
+ ae.error("开启导航后,请填写导航名称");
2592
+ return;
2593
+ }
2594
+ if (!j.navPlacements.length) {
2595
+ ae.error("请至少选择一个展示位置");
2596
+ return;
2597
+ }
2598
+ }
2599
+ const Z = !!(p.title.trim() || p.description.trim() || P.categoryId || p.categoryId === void 0 && p.category);
2600
+ if (w && Z) {
2601
+ if (!p.title.trim()) {
2602
+ ae.error("配置 Guides 展示时,请填写文章标题");
2183
2603
  return;
2184
2604
  }
2185
- if (!M.navPlacements.length) {
2186
- J.error("请至少选择一个展示位置");
2605
+ if (p.categoryId === void 0 && !!p.category && !P.categoryId || P.categoryId && (k || m || !L.some((ce) => ce.id === P.categoryId))) {
2606
+ ae.error("请先成功加载并选择有效的 Guides 分类");
2187
2607
  return;
2188
2608
  }
2189
2609
  }
2190
- H(!0);
2191
- const Z = await Ke(L);
2192
- if (H(!1), Z.networkError)
2193
- J.warning("W3C 校验服务不可用,已跳过校验");
2194
- else if (!Z.isValid && !await new Promise((Q) => {
2195
- v.confirm({
2610
+ z(!0);
2611
+ const U = await ut(B);
2612
+ if (z(!1), U.networkError)
2613
+ ae.warning("W3C 校验服务不可用,已跳过校验");
2614
+ else if (!U.isValid && !await new Promise((ce) => {
2615
+ f.confirm({
2196
2616
  title: "HTML 校验发现问题",
2197
2617
  content: /* @__PURE__ */ s("div", { className: "mt-1", children: [
2198
- /* @__PURE__ */ n("p", { className: "text-gray-600 mb-2", children: "检测到以下 W3C 标准问题,仍要保存吗?" }),
2618
+ /* @__PURE__ */ t("p", { className: "text-gray-600 mb-2", children: "检测到以下 W3C 标准问题,仍要保存吗?" }),
2199
2619
  /* @__PURE__ */ s("ul", { className: "space-y-1", children: [
2200
- Z.errors.slice(0, 5).map((ie, Ne) => /* @__PURE__ */ s(
2620
+ U.errors.slice(0, 5).map((de, pe) => /* @__PURE__ */ s(
2201
2621
  "li",
2202
2622
  {
2203
2623
  className: "flex items-start gap-1.5 text-red-500 text-sm",
2204
2624
  children: [
2205
- /* @__PURE__ */ n("span", { className: "shrink-0", children: "✕" }),
2625
+ /* @__PURE__ */ t("span", { className: "shrink-0", children: "✕" }),
2206
2626
  /* @__PURE__ */ s("span", { children: [
2207
- ie.lastLine ? `第 ${ie.lastLine} 行:` : "",
2208
- ie.message
2627
+ de.lastLine ? `第 ${de.lastLine} 行:` : "",
2628
+ de.message
2209
2629
  ] })
2210
2630
  ]
2211
2631
  },
2212
- Ne
2632
+ pe
2213
2633
  )),
2214
- Z.errors.length > 5 && /* @__PURE__ */ s("li", { className: "text-gray-400 text-xs mt-1", children: [
2634
+ U.errors.length > 5 && /* @__PURE__ */ s("li", { className: "text-gray-400 text-xs mt-1", children: [
2215
2635
  "另有 ",
2216
- Z.errors.length - 5,
2636
+ U.errors.length - 5,
2217
2637
  " 个问题"
2218
2638
  ] })
2219
2639
  ] })
2220
2640
  ] }),
2221
2641
  okText: "仍然保存",
2222
2642
  cancelText: "返回修改",
2223
- onOk: () => Q(!0),
2224
- onCancel: () => Q(!1)
2643
+ onOk: () => ce(!0),
2644
+ onCancel: () => ce(!1)
2225
2645
  });
2226
2646
  }))
2227
2647
  return;
2228
- H(!0);
2648
+ z(!0);
2229
2649
  try {
2230
- const U = {
2231
- pathname: D.trim(),
2232
- content: L,
2233
- host: $,
2650
+ const Q = {
2651
+ pathname: H.trim(),
2652
+ content: B,
2653
+ host: I,
2654
+ ...w ? {
2655
+ guidesDisplay: Z ? {
2656
+ title: p.title.trim(),
2657
+ description: p.description.trim(),
2658
+ categoryId: P.categoryId
2659
+ } : null
2660
+ } : {},
2234
2661
  ...g.getNavigationGroups ? {
2235
- navEnabled: M.navEnabled,
2236
- navname: M.navname.trim() || null,
2237
- navPlacements: M.navPlacements.map(({ position: Q, parentNavId: ie }) => ({
2238
- position: Q,
2239
- parentNavId: ie || null
2662
+ navEnabled: j.navEnabled,
2663
+ navname: j.navname.trim() || null,
2664
+ navPlacements: j.navPlacements.map(({ position: ce, parentNavId: de }) => ({
2665
+ position: ce,
2666
+ parentNavId: de || null
2240
2667
  }))
2241
2668
  } : {}
2242
2669
  };
2243
- p && T ? (await g.update(T.id, U), J.success("编辑成功")) : (await g.create(U), J.success("新增成功")), r(f);
2244
- } catch (U) {
2245
- J.error(U.message || "保存失败");
2670
+ y && A ? (await g.update(A.id, Q), ae.success("编辑成功")) : (await g.create(Q), ae.success("新增成功")), n(d);
2671
+ } catch (Q) {
2672
+ ae.error(Q.message || "保存失败");
2246
2673
  } finally {
2247
- H(!1);
2674
+ z(!1);
2248
2675
  }
2249
2676
  };
2250
- return /* @__PURE__ */ s(ue, { children: [
2251
- P,
2677
+ return /* @__PURE__ */ s(be, { children: [
2678
+ N,
2252
2679
  /* @__PURE__ */ s(
2253
2680
  "div",
2254
2681
  {
@@ -2257,39 +2684,39 @@ const Pe = [
2257
2684
  children: [
2258
2685
  /* @__PURE__ */ s("div", { className: "shrink-0 flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-gray-50/60", children: [
2259
2686
  /* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
2260
- /* @__PURE__ */ n(
2687
+ /* @__PURE__ */ t(
2261
2688
  "button",
2262
2689
  {
2263
2690
  "aria-label": "返回文章列表",
2264
2691
  className: "flex items-center justify-center w-7 h-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-200 transition -ml-1 cursor-pointer",
2265
- onClick: ee,
2266
- children: /* @__PURE__ */ n(ot, { size: 15 })
2692
+ onClick: at,
2693
+ children: /* @__PURE__ */ t(kt, { size: 15 })
2267
2694
  }
2268
2695
  ),
2269
2696
  /* @__PURE__ */ s("div", { children: [
2270
- /* @__PURE__ */ n("div", { className: "text-base font-semibold text-gray-800 leading-tight", children: p ? "编辑文章" : "新增文章" }),
2271
- p && T && /* @__PURE__ */ s("div", { className: "text-xs text-gray-400 mt-0.5 font-mono", children: [
2697
+ /* @__PURE__ */ t("div", { className: "text-base font-semibold text-gray-800 leading-tight", children: y ? "编辑文章" : "新增文章" }),
2698
+ y && A && /* @__PURE__ */ s("div", { className: "text-xs text-gray-400 mt-0.5 font-mono", children: [
2272
2699
  "/",
2273
- T.pathname
2700
+ A.pathname
2274
2701
  ] })
2275
2702
  ] })
2276
2703
  ] }),
2277
2704
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
2278
- /* @__PURE__ */ n(
2705
+ /* @__PURE__ */ t(
2279
2706
  "button",
2280
2707
  {
2281
2708
  className: "px-4 py-1.5 border border-gray-200 rounded-lg text-sm text-gray-600 hover:bg-gray-50 transition cursor-pointer",
2282
- onClick: ee,
2709
+ onClick: at,
2283
2710
  children: "取消"
2284
2711
  }
2285
2712
  ),
2286
- /* @__PURE__ */ n(
2713
+ /* @__PURE__ */ t(
2287
2714
  "button",
2288
2715
  {
2289
- disabled: te || A,
2716
+ disabled: Yt || _,
2290
2717
  className: "px-4 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm rounded-lg transition disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",
2291
- onClick: re,
2292
- children: A ? "保存中…" : "保存"
2718
+ onClick: Bt,
2719
+ children: V ? "加载中…" : _ ? "保存中…" : "保存"
2293
2720
  }
2294
2721
  )
2295
2722
  ] })
@@ -2300,76 +2727,105 @@ const Pe = [
2300
2727
  /* @__PURE__ */ s("div", { className: "flex-1", children: [
2301
2728
  /* @__PURE__ */ s("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
2302
2729
  "访问路径",
2303
- /* @__PURE__ */ n("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "前台页面路径" })
2730
+ /* @__PURE__ */ t("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "前台页面路径" })
2304
2731
  ] }),
2305
2732
  /* @__PURE__ */ s(
2306
2733
  "div",
2307
2734
  {
2308
- className: `flex items-center border rounded-lg transition focus-within:ring-2 focus-within:ring-blue-500/30 focus-within:border-blue-400 ${h ? "border-red-400 ring-2 ring-red-500/20" : "border-gray-200"}`,
2735
+ className: `flex items-center border rounded-lg transition focus-within:ring-2 focus-within:ring-blue-500/30 focus-within:border-blue-400 ${T ? "border-red-400 ring-2 ring-red-500/20" : "border-gray-200"}`,
2309
2736
  children: [
2310
- /* @__PURE__ */ n("span", { className: "pl-3 text-gray-400 select-none text-sm shrink-0", children: "/" }),
2311
- /* @__PURE__ */ n(
2737
+ /* @__PURE__ */ t("span", { className: "pl-3 text-gray-400 select-none text-sm shrink-0", children: "/" }),
2738
+ /* @__PURE__ */ t(
2312
2739
  "input",
2313
2740
  {
2314
2741
  className: "flex-1 pr-3 py-1.5 text-sm bg-transparent focus:outline-none",
2315
2742
  placeholder: "例如 about-us",
2316
- value: D,
2317
- onChange: ($) => {
2318
- R($.target.value), h && z("");
2743
+ value: H,
2744
+ onChange: (I) => {
2745
+ F(I.target.value), T && O("");
2319
2746
  }
2320
2747
  }
2321
2748
  )
2322
2749
  ]
2323
2750
  }
2324
2751
  ),
2325
- /* @__PURE__ */ n("p", { className: "text-xs text-gray-500 mt-1.5", children: "建议使用小写字母,不能包含空格,例如 about-us。" }),
2326
- h && /* @__PURE__ */ n("p", { className: "text-red-500 text-xs mt-1", children: h })
2752
+ /* @__PURE__ */ t("p", { className: "text-xs text-gray-500 mt-1.5", children: "建议使用小写字母,不能包含空格,例如 about-us。" }),
2753
+ T && /* @__PURE__ */ t("p", { className: "text-red-500 text-xs mt-1", children: T })
2327
2754
  ] }),
2328
2755
  /* @__PURE__ */ s("div", { className: "flex-1", children: [
2329
2756
  /* @__PURE__ */ s("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
2330
2757
  "网站地址",
2331
- /* @__PURE__ */ n("span", { className: "text-red-500 ml-1", children: "*" }),
2332
- /* @__PURE__ */ n("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "网站基础地址" })
2758
+ /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" }),
2759
+ /* @__PURE__ */ t("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "网站基础地址" })
2333
2760
  ] }),
2334
- /* @__PURE__ */ n(
2761
+ /* @__PURE__ */ t(
2335
2762
  "input",
2336
2763
  {
2337
2764
  className: "w-full px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
2338
2765
  placeholder: "例如 https://aisee.live",
2339
- value: V,
2766
+ value: M,
2340
2767
  "aria-label": "网站地址",
2341
- "aria-invalid": !!E,
2342
- onChange: ($) => {
2343
- const Z = $.target.value;
2344
- Z.trim().replace(/\/+$/, "") !== V.trim().replace(/\/+$/, "") && x((U) => ({
2768
+ "aria-invalid": !!v,
2769
+ onChange: (I) => {
2770
+ const Z = I.target.value;
2771
+ Z.trim().replace(/\/+$/, "") !== M.trim().replace(/\/+$/, "") && (C((U) => ({ ...U, categoryId: null })), G((U) => ({
2345
2772
  ...U,
2346
2773
  navPlacements: U.navPlacements.map((Q) => ({ ...Q, parentNavId: null }))
2347
- })), j(Z), b("");
2774
+ }))), D(Z), b("");
2348
2775
  }
2349
2776
  }
2350
2777
  ),
2351
- E && /* @__PURE__ */ n("p", { role: "alert", className: "mt-1 text-xs text-red-500", children: E })
2778
+ v && /* @__PURE__ */ t("p", { role: "alert", className: "mt-1 text-xs text-red-500", children: v })
2779
+ ] })
2780
+ ] }),
2781
+ w && /* @__PURE__ */ s(be, { children: [
2782
+ /* @__PURE__ */ t(
2783
+ nn,
2784
+ {
2785
+ value: { ...P, ...p.categoryId === void 0 && !P.categoryId ? { category: p.category } : {} },
2786
+ categories: L,
2787
+ categoriesDisabled: !i || k || !!m,
2788
+ onChange: C,
2789
+ onLoadCategories: async () => {
2790
+ const I = await w({ host: i });
2791
+ return o.current === i && q(I), I;
2792
+ },
2793
+ onReorderCategories: g.reorderGuidesCategories ? async (I) => {
2794
+ const Z = await g.reorderGuidesCategories({ host: i, categoryIds: I });
2795
+ return o.current === i && q(Z), Z;
2796
+ } : void 0,
2797
+ onSaveCategory: g.saveGuidesCategory ? async (I) => {
2798
+ const Z = await g.saveGuidesCategory({ ...I, host: i });
2799
+ return o.current === i && q((U) => U.some((Q) => Q.id === Z.id) ? U.map((Q) => Q.id === Z.id ? Z : Q) : [...U, Z]), Z;
2800
+ } : void 0
2801
+ },
2802
+ i
2803
+ ),
2804
+ k && /* @__PURE__ */ t("p", { role: "status", className: "mt-2 text-xs text-gray-500", children: "加载 Guides 分类中…" }),
2805
+ m && /* @__PURE__ */ s("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: [
2806
+ m,
2807
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => E((I) => I + 1), className: "ml-2 cursor-pointer text-blue-500", children: "重试" })
2352
2808
  ] })
2353
2809
  ] }),
2354
- /* @__PURE__ */ n(
2355
- Or,
2810
+ /* @__PURE__ */ t(
2811
+ rn,
2356
2812
  {
2357
- host: V,
2813
+ host: M,
2358
2814
  service: g,
2359
- value: M,
2360
- onChange: x
2815
+ value: j,
2816
+ onChange: G
2361
2817
  }
2362
2818
  )
2363
2819
  ] }),
2364
- /* @__PURE__ */ n("div", { className: "shrink-0 border-b border-gray-100 bg-gray-50/40", children: /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-2 px-6 py-2", children: [
2365
- /* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ s("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: [
2820
+ /* @__PURE__ */ t("div", { className: "shrink-0 border-b border-gray-100 bg-gray-50/40", children: /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-2 px-6 py-2", children: [
2821
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ s("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: [
2366
2822
  /* @__PURE__ */ s(
2367
2823
  "button",
2368
2824
  {
2369
- className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${d === "code" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2370
- onClick: () => i("code"),
2825
+ className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${X === "code" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2826
+ onClick: () => ne("code"),
2371
2827
  children: [
2372
- /* @__PURE__ */ n(Ye, { size: 11 }),
2828
+ /* @__PURE__ */ t(Qe, { size: 11 }),
2373
2829
  " 代码"
2374
2830
  ]
2375
2831
  }
@@ -2377,44 +2833,44 @@ const Pe = [
2377
2833
  /* @__PURE__ */ s(
2378
2834
  "button",
2379
2835
  {
2380
- className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none ${d === "preview" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50 cursor-pointer" : L ? "text-gray-400 hover:text-gray-600 hover:bg-white/50 cursor-pointer" : "text-gray-300 cursor-not-allowed"}`,
2381
- onClick: () => i("preview"),
2382
- disabled: !L,
2836
+ className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none ${X === "preview" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50 cursor-pointer" : B ? "text-gray-400 hover:text-gray-600 hover:bg-white/50 cursor-pointer" : "text-gray-300 cursor-not-allowed"}`,
2837
+ onClick: () => ne("preview"),
2838
+ disabled: !B,
2383
2839
  children: [
2384
- /* @__PURE__ */ n(_e, { size: 11 }),
2840
+ /* @__PURE__ */ t(qe, { size: 11 }),
2385
2841
  " 预览"
2386
2842
  ]
2387
2843
  }
2388
2844
  )
2389
2845
  ] }) }),
2390
- d === "preview" && L && /* @__PURE__ */ n("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: Pe.map(($) => /* @__PURE__ */ n(ye, { title: $.label, children: /* @__PURE__ */ n(
2846
+ X === "preview" && B && /* @__PURE__ */ t("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: We.map((I) => /* @__PURE__ */ t(Oe, { title: I.label, children: /* @__PURE__ */ t(
2391
2847
  "button",
2392
2848
  {
2393
- className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${u === $.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2394
- onClick: () => C($.key),
2395
- children: $.icon
2849
+ className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${ee === I.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2850
+ onClick: () => Ie(I.key),
2851
+ children: I.icon
2396
2852
  }
2397
- ) }, $.key)) }),
2398
- d === "code" && /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
2399
- L && /* @__PURE__ */ s("span", { className: "text-xs text-gray-400", children: [
2400
- ae,
2853
+ ) }, I.key)) }),
2854
+ X === "code" && /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
2855
+ B && /* @__PURE__ */ s("span", { className: "text-xs text-gray-400", children: [
2856
+ qt,
2401
2857
  " 行 · ",
2402
- L.length,
2858
+ B.length,
2403
2859
  " 字符"
2404
2860
  ] }),
2405
- S && !S.networkError && (S.isValid ? /* @__PURE__ */ s("span", { className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-50 border border-green-200 text-green-600 text-xs", children: [
2406
- /* @__PURE__ */ n(Ge, { size: 11 }),
2861
+ ue && !ue.networkError && (ue.isValid ? /* @__PURE__ */ s("span", { className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-50 border border-green-200 text-green-600 text-xs", children: [
2862
+ /* @__PURE__ */ t(lt, { size: 11 }),
2407
2863
  " 校验通过"
2408
- ] }) : /* @__PURE__ */ n(
2409
- ye,
2864
+ ] }) : /* @__PURE__ */ t(
2865
+ Oe,
2410
2866
  {
2411
2867
  variant: "card",
2412
2868
  align: "end",
2413
- title: /* @__PURE__ */ n(Er, { errors: S.errors, source: L }),
2869
+ title: /* @__PURE__ */ t(on, { errors: ue.errors, source: B }),
2414
2870
  children: /* @__PURE__ */ s("span", { tabIndex: 0, className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-50 border border-red-200 text-red-500 text-xs cursor-default", children: [
2415
2871
  "✕",
2416
2872
  " ",
2417
- S.errors.length,
2873
+ ue.errors.length,
2418
2874
  " 个问题"
2419
2875
  ] })
2420
2876
  }
@@ -2422,35 +2878,35 @@ const Pe = [
2422
2878
  /* @__PURE__ */ s(
2423
2879
  "button",
2424
2880
  {
2425
- disabled: !L || O,
2881
+ disabled: !B || tt,
2426
2882
  className: "flex items-center gap-1.5 px-2.5 py-1 text-xs border border-gray-200 rounded-lg hover:bg-gray-50 text-gray-600 transition disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer",
2427
- onClick: G,
2883
+ onClick: Vt,
2428
2884
  children: [
2429
- /* @__PURE__ */ n(Ge, { size: 12 }),
2430
- O ? "校验中…" : "W3C 校验"
2885
+ /* @__PURE__ */ t(lt, { size: 12 }),
2886
+ tt ? "校验中…" : "W3C 校验"
2431
2887
  ]
2432
2888
  }
2433
2889
  )
2434
2890
  ] })
2435
2891
  ] }) }),
2436
2892
  /* @__PURE__ */ s("div", { className: "relative min-h-[320px] flex-1 shrink-0", children: [
2437
- /* @__PURE__ */ n(
2893
+ /* @__PURE__ */ t(
2438
2894
  "div",
2439
2895
  {
2440
2896
  className: "absolute inset-0",
2441
2897
  style: {
2442
- display: d === "code" ? "block" : "none",
2443
- outline: c ? "2px solid #ff4d4f" : "none"
2898
+ display: X === "code" ? "block" : "none",
2899
+ outline: ie ? "2px solid #ff4d4f" : "none"
2444
2900
  },
2445
- children: /* @__PURE__ */ n(
2446
- Rn,
2901
+ children: /* @__PURE__ */ t(
2902
+ fa,
2447
2903
  {
2448
2904
  height: "100%",
2449
2905
  language: "html",
2450
2906
  theme: "vs-dark",
2451
- value: L,
2452
- onChange: ($) => {
2453
- F($ ?? ""), c && m(!1), S && I(null);
2907
+ value: B,
2908
+ onChange: (I) => {
2909
+ re(I ?? ""), ie && se(!1), ue && Le(null);
2454
2910
  },
2455
2911
  options: {
2456
2912
  fontSize: 13,
@@ -2470,20 +2926,20 @@ const Pe = [
2470
2926
  )
2471
2927
  }
2472
2928
  ),
2473
- d === "preview" && (L ? /* @__PURE__ */ n("div", { className: "absolute inset-0 overflow-auto bg-gray-100/60 flex justify-center", children: u !== "desktop" ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ n(
2929
+ X === "preview" && (B ? /* @__PURE__ */ t("div", { className: "absolute inset-0 overflow-auto bg-gray-100/60 flex justify-center", children: ee !== "desktop" ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ t(
2474
2930
  "iframe",
2475
2931
  {
2476
- srcDoc: q(
2477
- L,
2478
- Pe.find(
2479
- ($) => $.key === u
2932
+ srcDoc: nt(
2933
+ B,
2934
+ We.find(
2935
+ (I) => I.key === ee
2480
2936
  ).width
2481
2937
  ),
2482
2938
  sandbox: "allow-same-origin allow-scripts",
2483
2939
  title: "HTML 预览",
2484
2940
  style: {
2485
- width: `${Pe.find(
2486
- ($) => $.key === u
2941
+ width: `${We.find(
2942
+ (I) => I.key === ee
2487
2943
  ).width}px`,
2488
2944
  height: "100%",
2489
2945
  minHeight: 0,
@@ -2494,11 +2950,11 @@ const Pe = [
2494
2950
  flexShrink: 0
2495
2951
  }
2496
2952
  }
2497
- ) }) : /* @__PURE__ */ n(
2953
+ ) }) : /* @__PURE__ */ t(
2498
2954
  "iframe",
2499
2955
  {
2500
- srcDoc: q(
2501
- L
2956
+ srcDoc: nt(
2957
+ B
2502
2958
  ),
2503
2959
  sandbox: "allow-same-origin allow-scripts",
2504
2960
  title: "HTML 预览",
@@ -2511,8 +2967,8 @@ const Pe = [
2511
2967
  }
2512
2968
  }
2513
2969
  ) }) : /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center h-full text-gray-300 gap-3 select-none", children: [
2514
- /* @__PURE__ */ n(_e, { size: 36 }),
2515
- /* @__PURE__ */ n("span", { className: "text-sm", children: "请先输入 HTML 代码以预览" })
2970
+ /* @__PURE__ */ t(qe, { size: 36 }),
2971
+ /* @__PURE__ */ t("span", { className: "text-sm", children: "请先输入 HTML 代码以预览" })
2516
2972
  ] }))
2517
2973
  ] })
2518
2974
  ] })
@@ -2520,30 +2976,30 @@ const Pe = [
2520
2976
  }
2521
2977
  )
2522
2978
  ] });
2523
- }, Ee = [
2524
- { key: "desktop", icon: /* @__PURE__ */ n(dt, { size: 13 }), label: "Desktop", width: null },
2525
- { key: "tablet", icon: /* @__PURE__ */ n(pt, { size: 13 }), label: "Tablet", width: 768 },
2526
- { key: "mobile", icon: /* @__PURE__ */ n(mt, { size: 13 }), label: "Mobile", width: 390 }
2527
- ], Jn = ({
2979
+ }, Re = [
2980
+ { key: "desktop", icon: /* @__PURE__ */ t(Mt, { size: 13 }), label: "Desktop", width: null },
2981
+ { key: "tablet", icon: /* @__PURE__ */ t(Ot, { size: 13 }), label: "Tablet", width: 768 },
2982
+ { key: "mobile", icon: /* @__PURE__ */ t(jt, { size: 13 }), label: "Mobile", width: 390 }
2983
+ ], Ma = ({
2528
2984
  id: e,
2529
- record: t
2985
+ record: r
2530
2986
  }) => {
2531
- const { navigate: r, params: a, locationState: o } = Ve(), l = e ?? a.id, { basePath: f, service: g, previewBaseUrl: y, previewTailwind: k } = ve(), [p, v] = _(
2532
- t ?? (o == null ? void 0 : o.record) ?? null
2533
- ), [P, A] = _(!1), [H, T] = _("preview"), [W, D] = _("desktop");
2534
- K(() => {
2535
- !p && l && (A(!0), g.getById(l).then(v).catch((b) => {
2536
- J.error(b.message || "获取数据失败"), r(f);
2537
- }).finally(() => A(!1)));
2538
- }, [l]);
2539
- const R = () => r(f), V = () => r(`${f}/${l}/edit`, { state: { record: p } }), j = () => {
2540
- p != null && p.content && (navigator.clipboard.writeText(p.content), J.success("已复制到剪贴板"));
2541
- }, E = (b, h) => {
2542
- const z = y ? `<base href="${y}">` : "", M = h ? `<meta name="viewport" content="width=${h}, initial-scale=1">` : "", x = h ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", w = k && !b.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", L = z + M + x + w;
2543
- return L ? b.includes("</head>") ? b.replace("</head>", `${L}
2544
- </head>`) : L + b : b;
2987
+ const { navigate: n, params: a, locationState: c } = Xe(), d = e ?? a.id, { basePath: g, service: h, previewBaseUrl: u, previewTailwind: y } = Ee(), [f, N] = S(
2988
+ r ?? (c == null ? void 0 : c.record) ?? null
2989
+ ), [_, z] = S(!1), [A, W] = S("preview"), [V, R] = S("desktop");
2990
+ te(() => {
2991
+ !f && d && (z(!0), h.getById(d).then(N).catch((v) => {
2992
+ ae.error(v.message || "获取数据失败"), n(g);
2993
+ }).finally(() => z(!1)));
2994
+ }, [d]);
2995
+ const H = () => n(g), F = () => n(`${g}/${d}/edit`, { state: { record: f } }), M = () => {
2996
+ f != null && f.content && (navigator.clipboard.writeText(f.content), ae.success("已复制到剪贴板"));
2997
+ }, D = (v, b) => {
2998
+ const T = u ? `<base href="${u}">` : "", O = b ? `<meta name="viewport" content="width=${b}, initial-scale=1">` : "", p = b ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", C = y && !v.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", L = T + O + p + C;
2999
+ return L ? v.includes("</head>") ? v.replace("</head>", `${L}
3000
+ </head>`) : L + v : v;
2545
3001
  };
2546
- return P ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center h-64 text-gray-400 text-sm", children: "加载中…" }) : /* @__PURE__ */ s(
3002
+ return _ ? /* @__PURE__ */ t("div", { className: "flex items-center justify-center h-64 text-gray-400 text-sm", children: "加载中…" }) : /* @__PURE__ */ s(
2547
3003
  "div",
2548
3004
  {
2549
3005
  className: "w-full bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden flex flex-col",
@@ -2551,87 +3007,87 @@ const Pe = [
2551
3007
  children: [
2552
3008
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between px-5 py-3.5 border-b border-gray-100 bg-white shrink-0", children: [
2553
3009
  /* @__PURE__ */ s("div", { className: "flex items-center gap-3 min-w-0", children: [
2554
- /* @__PURE__ */ n(
3010
+ /* @__PURE__ */ t(
2555
3011
  "button",
2556
3012
  {
2557
3013
  className: "flex items-center justify-center w-7 h-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100 transition -ml-1 shrink-0 cursor-pointer",
2558
- onClick: R,
2559
- children: /* @__PURE__ */ n(ot, { size: 15 })
3014
+ onClick: H,
3015
+ children: /* @__PURE__ */ t(kt, { size: 15 })
2560
3016
  }
2561
3017
  ),
2562
- /* @__PURE__ */ n(
3018
+ /* @__PURE__ */ t(
2563
3019
  "div",
2564
3020
  {
2565
3021
  className: "flex items-center justify-center w-8 h-8 rounded-lg shrink-0",
2566
3022
  style: {
2567
3023
  background: "linear-gradient(135deg, #60a5fa, #818cf8)"
2568
3024
  },
2569
- children: /* @__PURE__ */ n(rr, { size: 13, className: "text-white" })
3025
+ children: /* @__PURE__ */ t(Mr, { size: 13, className: "text-white" })
2570
3026
  }
2571
3027
  ),
2572
3028
  /* @__PURE__ */ s("div", { className: "min-w-0", children: [
2573
- /* @__PURE__ */ n("div", { className: "font-semibold text-gray-800 text-sm leading-tight", children: "Article 详情" }),
2574
- /* @__PURE__ */ n("div", { className: "flex items-center gap-1 mt-0.5", children: /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1 px-1.5 py-0 rounded bg-blue-50 border border-blue-100 text-blue-600 font-mono text-xs leading-5 truncate max-w-[300px]", children: [
2575
- /* @__PURE__ */ n(or, { size: 9 }),
3029
+ /* @__PURE__ */ t("div", { className: "font-semibold text-gray-800 text-sm leading-tight", children: "Article 详情" }),
3030
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-1 mt-0.5", children: /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1 px-1.5 py-0 rounded bg-blue-50 border border-blue-100 text-blue-600 font-mono text-xs leading-5 truncate max-w-[300px]", children: [
3031
+ /* @__PURE__ */ t(Ir, { size: 9 }),
2576
3032
  "/",
2577
- p == null ? void 0 : p.pathname
3033
+ f == null ? void 0 : f.pathname
2578
3034
  ] }) })
2579
3035
  ] })
2580
3036
  ] }),
2581
3037
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2 shrink-0", children: [
2582
- H === "preview" && /* @__PURE__ */ n("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: Ee.map((b) => /* @__PURE__ */ n(ye, { title: b.label, children: /* @__PURE__ */ n(
3038
+ A === "preview" && /* @__PURE__ */ t("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: Re.map((v) => /* @__PURE__ */ t(Oe, { title: v.label, children: /* @__PURE__ */ t(
2583
3039
  "button",
2584
3040
  {
2585
- className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${W === b.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2586
- onClick: () => D(b.key),
2587
- children: b.icon
3041
+ className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${V === v.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
3042
+ onClick: () => R(v.key),
3043
+ children: v.icon
2588
3044
  }
2589
- ) }, b.key)) }),
2590
- /* @__PURE__ */ n("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: ["preview", "code"].map((b) => /* @__PURE__ */ n(
3045
+ ) }, v.key)) }),
3046
+ /* @__PURE__ */ t("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: ["preview", "code"].map((v) => /* @__PURE__ */ t(
2591
3047
  "button",
2592
3048
  {
2593
- className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${H === b ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2594
- onClick: () => T(b),
2595
- children: b === "preview" ? /* @__PURE__ */ s(ue, { children: [
2596
- /* @__PURE__ */ n(_e, { size: 11 }),
3049
+ className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${A === v ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
3050
+ onClick: () => W(v),
3051
+ children: v === "preview" ? /* @__PURE__ */ s(be, { children: [
3052
+ /* @__PURE__ */ t(qe, { size: 11 }),
2597
3053
  " 预览"
2598
- ] }) : /* @__PURE__ */ s(ue, { children: [
2599
- /* @__PURE__ */ n(Ye, { size: 11 }),
3054
+ ] }) : /* @__PURE__ */ s(be, { children: [
3055
+ /* @__PURE__ */ t(Qe, { size: 11 }),
2600
3056
  " Code"
2601
3057
  ] })
2602
3058
  },
2603
- b
3059
+ v
2604
3060
  )) }),
2605
- H === "code" && /* @__PURE__ */ n(ye, { title: "复制代码", children: /* @__PURE__ */ n(
3061
+ A === "code" && /* @__PURE__ */ t(Oe, { title: "复制代码", children: /* @__PURE__ */ t(
2606
3062
  "button",
2607
3063
  {
2608
3064
  type: "button",
2609
3065
  "aria-label": "复制代码",
2610
3066
  className: "flex items-center justify-center w-7 h-7 rounded-lg text-gray-400 hover:text-blue-500 hover:bg-blue-50 transition cursor-pointer",
2611
- onClick: j,
2612
- children: /* @__PURE__ */ n(Jt, { size: 14 })
3067
+ onClick: M,
3068
+ children: /* @__PURE__ */ t(wr, { size: 14 })
2613
3069
  }
2614
3070
  ) })
2615
3071
  ] })
2616
3072
  ] }),
2617
- /* @__PURE__ */ n(
3073
+ /* @__PURE__ */ t(
2618
3074
  "div",
2619
3075
  {
2620
- className: `flex-1 min-h-0 ${H === "preview" ? "bg-gray-100/70" : ""}`,
2621
- children: H === "preview" ? /* @__PURE__ */ n("div", { className: "w-full h-full flex justify-center overflow-auto py-0", children: W !== "desktop" ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ n(
3076
+ className: `flex-1 min-h-0 ${A === "preview" ? "bg-gray-100/70" : ""}`,
3077
+ children: A === "preview" ? /* @__PURE__ */ t("div", { className: "w-full h-full flex justify-center overflow-auto py-0", children: V !== "desktop" ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ t(
2622
3078
  "iframe",
2623
3079
  {
2624
- srcDoc: E(
2625
- (p == null ? void 0 : p.content) || "",
2626
- Ee.find(
2627
- (b) => b.key === W
3080
+ srcDoc: D(
3081
+ (f == null ? void 0 : f.content) || "",
3082
+ Re.find(
3083
+ (v) => v.key === V
2628
3084
  ).width
2629
3085
  ),
2630
3086
  sandbox: "allow-same-origin allow-scripts",
2631
3087
  title: "HTML 预览",
2632
3088
  style: {
2633
- width: `${Ee.find(
2634
- (b) => b.key === W
3089
+ width: `${Re.find(
3090
+ (v) => v.key === V
2635
3091
  ).width}px`,
2636
3092
  height: "100%",
2637
3093
  minHeight: 0,
@@ -2642,11 +3098,11 @@ const Pe = [
2642
3098
  flexShrink: 0
2643
3099
  }
2644
3100
  }
2645
- ) }) : /* @__PURE__ */ n(
3101
+ ) }) : /* @__PURE__ */ t(
2646
3102
  "iframe",
2647
3103
  {
2648
- srcDoc: E(
2649
- (p == null ? void 0 : p.content) || ""
3104
+ srcDoc: D(
3105
+ (f == null ? void 0 : f.content) || ""
2650
3106
  ),
2651
3107
  sandbox: "allow-same-origin allow-scripts",
2652
3108
  title: "HTML 预览",
@@ -2675,11 +3131,11 @@ const Pe = [
2675
3131
  children: [
2676
3132
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
2677
3133
  /* @__PURE__ */ s("div", { className: "flex gap-1.5", children: [
2678
- /* @__PURE__ */ n("span", { className: "w-3 h-3 rounded-full bg-red-400/80 inline-block" }),
2679
- /* @__PURE__ */ n("span", { className: "w-3 h-3 rounded-full bg-yellow-400/80 inline-block" }),
2680
- /* @__PURE__ */ n("span", { className: "w-3 h-3 rounded-full bg-green-400/80 inline-block" })
3134
+ /* @__PURE__ */ t("span", { className: "w-3 h-3 rounded-full bg-red-400/80 inline-block" }),
3135
+ /* @__PURE__ */ t("span", { className: "w-3 h-3 rounded-full bg-yellow-400/80 inline-block" }),
3136
+ /* @__PURE__ */ t("span", { className: "w-3 h-3 rounded-full bg-green-400/80 inline-block" })
2681
3137
  ] }),
2682
- /* @__PURE__ */ n(
3138
+ /* @__PURE__ */ t(
2683
3139
  "span",
2684
3140
  {
2685
3141
  className: "text-xs font-mono ml-2",
@@ -2688,24 +3144,24 @@ const Pe = [
2688
3144
  }
2689
3145
  )
2690
3146
  ] }),
2691
- /* @__PURE__ */ n(
3147
+ /* @__PURE__ */ t(
2692
3148
  "span",
2693
3149
  {
2694
3150
  className: "text-xs font-mono",
2695
3151
  style: { color: "#6c7086" },
2696
- children: p != null && p.content ? `${p.content.split(`
2697
- `).length} 行 · ${p.content.length} 字符` : "空"
3152
+ children: f != null && f.content ? `${f.content.split(`
3153
+ `).length} 行 · ${f.content.length} 字符` : "空"
2698
3154
  }
2699
3155
  )
2700
3156
  ]
2701
3157
  }
2702
3158
  ),
2703
- /* @__PURE__ */ n("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ n(
3159
+ /* @__PURE__ */ t("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ t(
2704
3160
  "pre",
2705
3161
  {
2706
3162
  className: "m-0 p-5 text-xs font-mono whitespace-pre-wrap break-all leading-relaxed",
2707
3163
  style: { color: "#cdd6f4" },
2708
- children: (p == null ? void 0 : p.content) || /* @__PURE__ */ n("span", { style: { color: "#585b70" }, children: "// 暂无内容" })
3164
+ children: (f == null ? void 0 : f.content) || /* @__PURE__ */ t("span", { style: { color: "#585b70" }, children: "// 暂无内容" })
2709
3165
  }
2710
3166
  ) })
2711
3167
  ]
@@ -2715,24 +3171,24 @@ const Pe = [
2715
3171
  ),
2716
3172
  /* @__PURE__ */ s("div", { className: "shrink-0 flex items-center justify-between px-5 py-2.5 border-t border-gray-100 bg-gray-50/60", children: [
2717
3173
  /* @__PURE__ */ s("div", { className: "flex items-center gap-4 text-xs text-gray-400", children: [
2718
- (p == null ? void 0 : p.createdAt) && /* @__PURE__ */ s("span", { children: [
3174
+ (f == null ? void 0 : f.createdAt) && /* @__PURE__ */ s("span", { children: [
2719
3175
  "创建于",
2720
3176
  " ",
2721
- De(p.createdAt).format("YYYY/MM/DD HH:mm")
3177
+ Be(f.createdAt).format("YYYY/MM/DD HH:mm")
2722
3178
  ] }),
2723
- (p == null ? void 0 : p.updatedAt) && /* @__PURE__ */ s("span", { children: [
3179
+ (f == null ? void 0 : f.updatedAt) && /* @__PURE__ */ s("span", { children: [
2724
3180
  "更新于",
2725
3181
  " ",
2726
- De(p.updatedAt).format("YYYY/MM/DD HH:mm")
3182
+ Be(f.updatedAt).format("YYYY/MM/DD HH:mm")
2727
3183
  ] })
2728
3184
  ] }),
2729
3185
  /* @__PURE__ */ s(
2730
3186
  "button",
2731
3187
  {
2732
3188
  className: "flex items-center gap-1.5 px-3 py-1.5 text-xs border border-gray-200 rounded-lg hover:bg-gray-50 text-gray-600 transition cursor-pointer",
2733
- onClick: V,
3189
+ onClick: F,
2734
3190
  children: [
2735
- /* @__PURE__ */ n(hr, { size: 12 }),
3191
+ /* @__PURE__ */ t(St, { size: 12 }),
2736
3192
  "编辑"
2737
3193
  ]
2738
3194
  }
@@ -2743,13 +3199,13 @@ const Pe = [
2743
3199
  );
2744
3200
  };
2745
3201
  export {
2746
- Jn as ArticleDetail,
2747
- Kn as ArticleEdit,
2748
- Zn as ArticleList,
2749
- ea as ArticleServiceError,
2750
- Un as ArticlesProvider,
2751
- Gn as ReactRouterAdapter,
2752
- ta as createArticleService,
2753
- Ct as defaultArticleService,
2754
- ra as renderArticleByPathname
3202
+ Ma as ArticleDetail,
3203
+ Ca as ArticleEdit,
3204
+ $a as ArticleList,
3205
+ Oa as ArticleServiceError,
3206
+ Na as ArticlesProvider,
3207
+ ka as ReactRouterAdapter,
3208
+ Ea as createArticleService,
3209
+ Ft as defaultArticleService,
3210
+ Pa as renderArticleByPathname
2755
3211
  };