@chaibuilder/pages 0.5.2 → 0.5.3
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/{B4MFY5CR-Dejj9XNi.cjs → B4MFY5CR--lNS1XOZ.cjs} +1 -1
- package/dist/{B4MFY5CR-CxaAsbN9.js → B4MFY5CR-SntV1tRS.js} +1 -1
- package/dist/{HO4MOOFI-DyGZciGV.js → HO4MOOFI-BqUF7yRt.js} +2 -2
- package/dist/{HO4MOOFI-aeWm2iw3.cjs → HO4MOOFI-Dtsz_siU.cjs} +1 -1
- package/dist/{HUY7CZI3-BKHbLpsl.js → HUY7CZI3-BQnbnmHI.js} +2 -2
- package/dist/{HUY7CZI3-CLInB0IP.cjs → HUY7CZI3-D_CODqZw.cjs} +1 -1
- package/dist/{digital-asset-manager-DJEJxRa5.js → digital-asset-manager-Biz2tg8j.js} +1 -1
- package/dist/{digital-asset-manager-GB5X0F5T.cjs → digital-asset-manager-_BA_7qEh.cjs} +1 -1
- package/dist/index-B0BuMI6F.cjs +2 -0
- package/dist/{index-TNPTcXFM.js → index-cpLk6vnM.js} +1001 -995
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/index-BV5BWsTF.cjs +0 -2
|
@@ -2,9 +2,9 @@ var Ms = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var Fs = (e, t, n) => t.has(e) || Ms("Cannot " + n);
|
|
5
|
-
var F = (e, t, n) => (Fs(e, t, "read from private field"), n ? n.call(e) : t.get(e)),
|
|
6
|
-
import { jsx as r, jsxs as
|
|
7
|
-
import { get as W, isEmpty as
|
|
5
|
+
var F = (e, t, n) => (Fs(e, t, "read from private field"), n ? n.call(e) : t.get(e)), ce = (e, t, n) => t.has(e) ? Ms("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ie = (e, t, n, s) => (Fs(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
|
|
6
|
+
import { jsx as r, jsxs as u, Fragment as be } from "react/jsx-runtime";
|
|
7
|
+
import { get as W, isEmpty as le, reverse as Va, sortBy as ja, each as Ha, find as Ee, set as Ka, has as et, startsWith as jt, isEqual as ds, map as je, toLower as Ft, trim as $a, filter as Se, startCase as $t, groupBy as za, initial as Wa, compact as _n, includes as zt, endsWith as or, orderBy as En, first as Ya, concat as Qa, uniq as Xa, debounce as Za, pick as cr, keys as Ja, pickBy as ei, isArray as ti, noop as ni, isFunction as si, cloneDeep as ri, isString as qs } from "lodash-es";
|
|
8
8
|
import * as ge from "react";
|
|
9
9
|
import ur, { useCallback as Pe, useState as T, useEffect as Ne, useRef as it, useMemo as Q, Suspense as ai, lazy as ii } from "react";
|
|
10
10
|
import { useAtom as Mn, atom as hs } from "jotai";
|
|
@@ -287,52 +287,52 @@ function Pl(e = () => {
|
|
|
287
287
|
var n;
|
|
288
288
|
let s, a;
|
|
289
289
|
const i = {
|
|
290
|
-
getItem: (
|
|
290
|
+
getItem: (c, d) => {
|
|
291
291
|
var h, f;
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
292
|
+
const E = (y) => {
|
|
293
|
+
if (y = y || "", s !== y) {
|
|
294
294
|
try {
|
|
295
|
-
a = JSON.parse(
|
|
295
|
+
a = JSON.parse(y, t == null ? void 0 : t.reviver);
|
|
296
296
|
} catch {
|
|
297
297
|
return d;
|
|
298
298
|
}
|
|
299
|
-
s =
|
|
299
|
+
s = y;
|
|
300
300
|
}
|
|
301
301
|
return a;
|
|
302
|
-
},
|
|
303
|
-
return Cl(
|
|
302
|
+
}, p = (f = (h = e()) == null ? void 0 : h.getItem(c)) != null ? f : null;
|
|
303
|
+
return Cl(p) ? p.then(E) : E(p);
|
|
304
304
|
},
|
|
305
|
-
setItem: (
|
|
305
|
+
setItem: (c, d) => {
|
|
306
306
|
var h;
|
|
307
307
|
return (h = e()) == null ? void 0 : h.setItem(
|
|
308
|
-
|
|
308
|
+
c,
|
|
309
309
|
JSON.stringify(d, void 0)
|
|
310
310
|
);
|
|
311
311
|
},
|
|
312
|
-
removeItem: (
|
|
312
|
+
removeItem: (c) => {
|
|
313
313
|
var d;
|
|
314
|
-
return (d = e()) == null ? void 0 : d.removeItem(
|
|
314
|
+
return (d = e()) == null ? void 0 : d.removeItem(c);
|
|
315
315
|
}
|
|
316
|
-
}, l = (
|
|
317
|
-
let
|
|
316
|
+
}, l = (c) => (d, h, f) => c(d, (E) => {
|
|
317
|
+
let p;
|
|
318
318
|
try {
|
|
319
|
-
|
|
319
|
+
p = JSON.parse(E || "");
|
|
320
320
|
} catch {
|
|
321
|
-
|
|
321
|
+
p = f;
|
|
322
322
|
}
|
|
323
|
-
h(
|
|
323
|
+
h(p);
|
|
324
324
|
});
|
|
325
325
|
let o;
|
|
326
326
|
try {
|
|
327
327
|
o = (n = e()) == null ? void 0 : n.subscribe;
|
|
328
328
|
} catch {
|
|
329
329
|
}
|
|
330
|
-
return !o && typeof window < "u" && typeof window.addEventListener == "function" && window.Storage && (o = (
|
|
330
|
+
return !o && typeof window < "u" && typeof window.addEventListener == "function" && window.Storage && (o = (c, d) => {
|
|
331
331
|
if (!(e() instanceof window.Storage))
|
|
332
332
|
return () => {
|
|
333
333
|
};
|
|
334
334
|
const h = (f) => {
|
|
335
|
-
f.storageArea === e() && f.key ===
|
|
335
|
+
f.storageArea === e() && f.key === c && d(f.newValue);
|
|
336
336
|
};
|
|
337
337
|
return window.addEventListener("storage", h), () => {
|
|
338
338
|
window.removeEventListener("storage", h);
|
|
@@ -350,8 +350,8 @@ function Il(e, t, n = _l, s) {
|
|
|
350
350
|
return n.subscribe && (o = n.subscribe(e, l, t)), o;
|
|
351
351
|
}, zs(
|
|
352
352
|
(l) => l(a),
|
|
353
|
-
(l, o,
|
|
354
|
-
const d = typeof
|
|
353
|
+
(l, o, c) => {
|
|
354
|
+
const d = typeof c == "function" ? c(l(a)) : c;
|
|
355
355
|
return d === Tl ? (o(a, t), n.removeItem(e)) : d instanceof Promise ? d.then((h) => (o(a, h), n.setItem(e, h))) : (o(a, d), n.setItem(e, d));
|
|
356
356
|
}
|
|
357
357
|
);
|
|
@@ -395,25 +395,25 @@ const z = () => {
|
|
|
395
395
|
if (!s)
|
|
396
396
|
return null;
|
|
397
397
|
try {
|
|
398
|
-
const o = W(i, "action", "").toLowerCase(),
|
|
398
|
+
const o = W(i, "action", "").toLowerCase(), c = await Cs(
|
|
399
399
|
a + (o ? `?action=${o}` : ""),
|
|
400
400
|
i,
|
|
401
401
|
{ ...l, Authorization: `Bearer ${s}` }
|
|
402
402
|
);
|
|
403
|
-
if (
|
|
404
|
-
return console.log("401 Response",
|
|
403
|
+
if (c.status === 401)
|
|
404
|
+
return console.log("401 Response", c), n.invalidateQueries({
|
|
405
405
|
queryKey: [j]
|
|
406
406
|
}), t(), null;
|
|
407
|
-
if (!
|
|
408
|
-
const d = await
|
|
409
|
-
throw console.error(`API Error (${
|
|
410
|
-
status:
|
|
411
|
-
statusText:
|
|
407
|
+
if (!c.ok) {
|
|
408
|
+
const d = await c.json();
|
|
409
|
+
throw console.error(`API Error (${c.status}):`, d), {
|
|
410
|
+
status: c.status,
|
|
411
|
+
statusText: c.statusText,
|
|
412
412
|
...d,
|
|
413
|
-
message: d.error || d.message || `Server error: ${
|
|
413
|
+
message: d.error || d.message || `Server error: ${c.status}`
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
|
-
return await
|
|
416
|
+
return await c.json();
|
|
417
417
|
} catch (o) {
|
|
418
418
|
throw console.error("API request failed:", i, o), o;
|
|
419
419
|
}
|
|
@@ -481,7 +481,7 @@ function Me() {
|
|
|
481
481
|
const Dl = hs({}), Hr = () => Mn(Dl), Gl = () => {
|
|
482
482
|
const [e] = Me(), t = e.get("page"), n = it(""), { mutate: s } = Vr();
|
|
483
483
|
Ne(() => {
|
|
484
|
-
!
|
|
484
|
+
!le(n.current) && t !== n.current && s({ id: n.current }), n.current = t;
|
|
485
485
|
}, [t, s, n]);
|
|
486
486
|
}, ot = (e, t) => {
|
|
487
487
|
const [n] = Hr();
|
|
@@ -522,11 +522,11 @@ const Dl = hs({}), Hr = () => Mn(Dl), Gl = () => {
|
|
|
522
522
|
const { fallbackLang: t } = ft(), { data: n } = pt(), { data: s, isFetching: a } = gn(), i = Q(() => {
|
|
523
523
|
const l = { [t]: !0 };
|
|
524
524
|
return Ha(W(n, "languages"), (o) => {
|
|
525
|
-
const
|
|
526
|
-
l[o] = !!
|
|
525
|
+
const c = Ee(s, { lang: o });
|
|
526
|
+
l[o] = !!c;
|
|
527
527
|
}), l;
|
|
528
528
|
}, [t, s, n]);
|
|
529
|
-
return a ||
|
|
529
|
+
return a || le(e) || e && i[e];
|
|
530
530
|
}, _s = () => {
|
|
531
531
|
const e = Ae(), { data: t } = _e({
|
|
532
532
|
queryKey: [j, _.AI_CONTEXT],
|
|
@@ -561,7 +561,7 @@ const Dl = hs({}), Hr = () => Mn(Dl), Gl = () => {
|
|
|
561
561
|
action: _.GET_CHAI_USER,
|
|
562
562
|
data: { userId: e }
|
|
563
563
|
}),
|
|
564
|
-
enabled: !
|
|
564
|
+
enabled: !le(e)
|
|
565
565
|
});
|
|
566
566
|
}, Ol = hs(void 0), yn = () => {
|
|
567
567
|
const [e] = Me(), t = e.get("page"), { user: n } = gt(), [s, a] = Mn(Ol);
|
|
@@ -583,8 +583,8 @@ const Dl = hs({}), Hr = () => Mn(Dl), Gl = () => {
|
|
|
583
583
|
data: { id: t, draft: !0 }
|
|
584
584
|
});
|
|
585
585
|
a(o.currentEditor);
|
|
586
|
-
const
|
|
587
|
-
return s(W(d, "_value", "") || ""), i((h) => ({ ...h, lastSaved: o.lastSaved })),
|
|
586
|
+
const c = o.blocks ?? [], d = Ee(c, { _type: "@chai/ai-context" });
|
|
587
|
+
return s(W(d, "_value", "") || ""), i((h) => ({ ...h, lastSaved: o.lastSaved })), c;
|
|
588
588
|
},
|
|
589
589
|
enabled: !!t
|
|
590
590
|
});
|
|
@@ -622,13 +622,13 @@ function Rl({
|
|
|
622
622
|
onTakeOver: s
|
|
623
623
|
}) {
|
|
624
624
|
const [a, i] = T(!1);
|
|
625
|
-
return /* @__PURE__ */ r("div", { className: "fixed bottom-0 left-0 right-0 z-[20] flex items-center justify-center w-screen top-14 bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */
|
|
626
|
-
/* @__PURE__ */ r(gs, { className: "space-y-1", children: /* @__PURE__ */
|
|
625
|
+
return /* @__PURE__ */ r("div", { className: "fixed bottom-0 left-0 right-0 z-[20] flex items-center justify-center w-screen top-14 bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */ u(fs, { className: "w-full max-w-md mx-auto", children: [
|
|
626
|
+
/* @__PURE__ */ r(gs, { className: "space-y-1", children: /* @__PURE__ */ u(ps, { className: "flex items-center gap-2 text-2xl", children: [
|
|
627
627
|
/* @__PURE__ */ r(Ir, { className: "w-6 h-6 text-yellow-500" }),
|
|
628
628
|
"Page locked for editing"
|
|
629
629
|
] }) }),
|
|
630
|
-
/* @__PURE__ */ r(ys, { className: "grid gap-4", children: /* @__PURE__ */
|
|
631
|
-
/* @__PURE__ */
|
|
630
|
+
/* @__PURE__ */ r(ys, { className: "grid gap-4", children: /* @__PURE__ */ u("div", { children: [
|
|
631
|
+
/* @__PURE__ */ u("div", { className: "flex items-center space-x-4", children: [
|
|
632
632
|
e ? /* @__PURE__ */ r(
|
|
633
633
|
"img",
|
|
634
634
|
{
|
|
@@ -637,35 +637,35 @@ function Rl({
|
|
|
637
637
|
className: "w-12 h-12 border border-gray-300 rounded-full"
|
|
638
638
|
}
|
|
639
639
|
) : /* @__PURE__ */ r(Hi, { className: "w-12 h-12 p-2 border border-gray-300 rounded-full" }),
|
|
640
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
641
641
|
/* @__PURE__ */ r("h3", { className: "font-semibold", children: t }),
|
|
642
642
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: n })
|
|
643
643
|
] })
|
|
644
644
|
] }),
|
|
645
645
|
/* @__PURE__ */ r("div", { className: "text-sm mt-4", children: /* @__PURE__ */ r("p", { children: "This user is currently editing the page. You cannot make changes." }) })
|
|
646
646
|
] }) }),
|
|
647
|
-
/* @__PURE__ */ r(vs, { children: /* @__PURE__ */
|
|
648
|
-
/* @__PURE__ */ r(fr, { asChild: !0, children: /* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ r(vs, { children: /* @__PURE__ */ u(mr, { open: a, onOpenChange: i, children: [
|
|
648
|
+
/* @__PURE__ */ r(fr, { asChild: !0, children: /* @__PURE__ */ u("span", { className: "flex flex-col items-center", children: [
|
|
649
649
|
/* @__PURE__ */ r(P, { className: "w-full", variant: "destructive", children: "Take Over" }),
|
|
650
650
|
/* @__PURE__ */ r("p", { className: "mt-2 text-xs text-muted-foreground", children: "If you need to edit, you can take over the lock, but be aware that the other user might lose unsaved changes." })
|
|
651
651
|
] }) }),
|
|
652
|
-
/* @__PURE__ */
|
|
653
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ u(gr, { className: "z-[99]", children: [
|
|
653
|
+
/* @__PURE__ */ u(pr, { children: [
|
|
654
654
|
/* @__PURE__ */ r(yr, { children: "Are you sure you want to take over?" }),
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
/* @__PURE__ */
|
|
655
|
+
/* @__PURE__ */ u(vr, { children: [
|
|
656
|
+
/* @__PURE__ */ u("span", { className: "flex items-center space-x-2 text-yellow-500", children: [
|
|
657
657
|
/* @__PURE__ */ r(Ki, { className: "w-5 h-5" }),
|
|
658
658
|
/* @__PURE__ */ r("span", { children: "This action might cause the other user to lose unsaved changes." })
|
|
659
659
|
] }),
|
|
660
660
|
/* @__PURE__ */ r("br", {}),
|
|
661
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ u("span", { className: "mt-2", children: [
|
|
662
662
|
"By taking over, you will become the active editor of this page, and ",
|
|
663
663
|
t,
|
|
664
664
|
" will lose their editing access."
|
|
665
665
|
] })
|
|
666
666
|
] })
|
|
667
667
|
] }),
|
|
668
|
-
/* @__PURE__ */
|
|
668
|
+
/* @__PURE__ */ u(Er, { children: [
|
|
669
669
|
/* @__PURE__ */ r(br, { children: "Cancel" }),
|
|
670
670
|
/* @__PURE__ */ r(Sr, { onClick: () => {
|
|
671
671
|
i(!1), s();
|
|
@@ -692,19 +692,19 @@ const Bl = () => {
|
|
|
692
692
|
const [e, t] = Me(), n = e.get("lang"), s = Kr(n), { setSelectedLang: a } = ft(), i = () => {
|
|
693
693
|
const o = new URLSearchParams(window.location.search);
|
|
694
694
|
o.delete("lang");
|
|
695
|
-
const
|
|
695
|
+
const c = o.toString(), d = `${window.location.pathname}${c ? `?${c}` : ""}`;
|
|
696
696
|
window.history.pushState({}, "", d), t(o), a(""), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
697
697
|
};
|
|
698
698
|
if (s) return null;
|
|
699
699
|
const l = W(Ye, n);
|
|
700
|
-
return /* @__PURE__ */ r("div", { className: "fixed bottom-0 left-0 right-0 z-[20] flex items-center justify-center w-screen top-14 bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */
|
|
701
|
-
/* @__PURE__ */ r(gs, { className: "space-y-1", children: /* @__PURE__ */
|
|
700
|
+
return /* @__PURE__ */ r("div", { className: "fixed bottom-0 left-0 right-0 z-[20] flex items-center justify-center w-screen top-14 bg-black/30 backdrop-blur-sm", children: /* @__PURE__ */ u(fs, { className: "w-full max-w-md mx-auto", children: [
|
|
701
|
+
/* @__PURE__ */ r(gs, { className: "space-y-1", children: /* @__PURE__ */ u(ps, { className: "flex items-center gap-2 text-2xl", children: [
|
|
702
702
|
/* @__PURE__ */ r(Ir, { className: "w-6 h-6 text-yellow-500" }),
|
|
703
703
|
'Page missing for "',
|
|
704
704
|
l,
|
|
705
705
|
'" language.'
|
|
706
706
|
] }) }),
|
|
707
|
-
/* @__PURE__ */ r(ys, { className: "grid gap-4", children: /* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ r(ys, { className: "grid gap-4", children: /* @__PURE__ */ u("div", { children: [
|
|
708
708
|
'Page is not available in the "',
|
|
709
709
|
l,
|
|
710
710
|
'" language. Either create the page in the "',
|
|
@@ -782,17 +782,17 @@ const Bl = () => {
|
|
|
782
782
|
blockName: a,
|
|
783
783
|
trigger: i
|
|
784
784
|
}) => {
|
|
785
|
-
const [l, o] = T(!1),
|
|
786
|
-
|
|
785
|
+
const [l, o] = T(!1), c = hr(), d = Vl(() => {
|
|
786
|
+
c([e], { _libBlockId: void 0 }), X.success("Block deleted successfully"), o(!1), s();
|
|
787
787
|
});
|
|
788
|
-
return /* @__PURE__ */
|
|
789
|
-
/* @__PURE__ */ r(Nr, { asChild: !0, children: i || /* @__PURE__ */
|
|
788
|
+
return /* @__PURE__ */ u(wr, { open: n, onOpenChange: (E) => !E && s(), children: [
|
|
789
|
+
/* @__PURE__ */ r(Nr, { asChild: !0, children: i || /* @__PURE__ */ u(
|
|
790
790
|
P,
|
|
791
791
|
{
|
|
792
792
|
type: "button",
|
|
793
793
|
variant: "destructive",
|
|
794
794
|
size: "sm",
|
|
795
|
-
onClick: (
|
|
795
|
+
onClick: (E) => E.preventDefault(),
|
|
796
796
|
disabled: l,
|
|
797
797
|
children: [
|
|
798
798
|
/* @__PURE__ */ r(kr, { className: "h-4 w-4 mr-2" }),
|
|
@@ -806,11 +806,11 @@ const Bl = () => {
|
|
|
806
806
|
className: "w-72 p-4 z-[9999]",
|
|
807
807
|
sideOffset: 5,
|
|
808
808
|
align: "center",
|
|
809
|
-
children: /* @__PURE__ */
|
|
809
|
+
children: /* @__PURE__ */ u("div", { className: "space-y-3", children: [
|
|
810
810
|
/* @__PURE__ */ r("h4", { className: "font-medium", children: "Delete Block" }),
|
|
811
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ u("p", { className: "text-sm", children: [
|
|
812
812
|
"Are you sure you want to delete the block",
|
|
813
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ u("span", { className: "font-medium", children: [
|
|
814
814
|
' "',
|
|
815
815
|
a,
|
|
816
816
|
'"'
|
|
@@ -818,7 +818,7 @@ const Bl = () => {
|
|
|
818
818
|
"?"
|
|
819
819
|
] }),
|
|
820
820
|
/* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: "This block will be permanently removed from the library. This action cannot be undone." }),
|
|
821
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
822
822
|
/* @__PURE__ */ r(
|
|
823
823
|
P,
|
|
824
824
|
{
|
|
@@ -867,7 +867,7 @@ const Bl = () => {
|
|
|
867
867
|
o(!1), i();
|
|
868
868
|
},
|
|
869
869
|
blockName: n,
|
|
870
|
-
trigger: /* @__PURE__ */
|
|
870
|
+
trigger: /* @__PURE__ */ u(
|
|
871
871
|
P,
|
|
872
872
|
{
|
|
873
873
|
type: "button",
|
|
@@ -895,18 +895,18 @@ const Bl = () => {
|
|
|
895
895
|
return await t(e, {
|
|
896
896
|
action: "GET_LIBRARY_GROUPS"
|
|
897
897
|
}) || [];
|
|
898
|
-
} catch (
|
|
899
|
-
return console.error("Error fetching library groups:",
|
|
898
|
+
} catch (c) {
|
|
899
|
+
return console.error("Error fetching library groups:", c), [];
|
|
900
900
|
}
|
|
901
901
|
},
|
|
902
902
|
initialData: []
|
|
903
903
|
}), { mutateAsync: l, isPending: o } = xe({
|
|
904
|
-
mutationFn: async (
|
|
905
|
-
if (!
|
|
904
|
+
mutationFn: async (c) => {
|
|
905
|
+
if (!c.trim())
|
|
906
906
|
throw new Error("Group name is required");
|
|
907
907
|
return t(e, {
|
|
908
908
|
action: "CREATE_BLOCK_GROUP",
|
|
909
|
-
data: { name:
|
|
909
|
+
data: { name: c }
|
|
910
910
|
});
|
|
911
911
|
},
|
|
912
912
|
onSuccess: () => {
|
|
@@ -914,9 +914,9 @@ const Bl = () => {
|
|
|
914
914
|
queryKey: [j, "library-groups"]
|
|
915
915
|
}), X.success("Group created successfully");
|
|
916
916
|
},
|
|
917
|
-
onError: (
|
|
918
|
-
console.error("Error creating group:",
|
|
919
|
-
description:
|
|
917
|
+
onError: (c) => {
|
|
918
|
+
console.error("Error creating group:", c), X.error("Failed to create group", {
|
|
919
|
+
description: c instanceof Error ? c.message : "Unknown error"
|
|
920
920
|
});
|
|
921
921
|
}
|
|
922
922
|
});
|
|
@@ -928,7 +928,7 @@ const Bl = () => {
|
|
|
928
928
|
isCreating: o
|
|
929
929
|
};
|
|
930
930
|
}, $l = ({ value: e, onChange: t }) => {
|
|
931
|
-
const [n, s] = T(!1), [a, i] = T(""), l = it(null), { groups: o } = Kl(), [
|
|
931
|
+
const [n, s] = T(!1), [a, i] = T(""), l = it(null), { groups: o } = Kl(), [c, d] = T([
|
|
932
932
|
{ id: "hero", name: "Hero" },
|
|
933
933
|
{ id: "feature", name: "Feature" },
|
|
934
934
|
{ id: "footer", name: "Footer" },
|
|
@@ -959,37 +959,37 @@ const Bl = () => {
|
|
|
959
959
|
]), h = Q(
|
|
960
960
|
() => [
|
|
961
961
|
...o,
|
|
962
|
-
...
|
|
963
|
-
(
|
|
962
|
+
...c.filter(
|
|
963
|
+
(p) => !o.some((y) => y.id === p.id)
|
|
964
964
|
)
|
|
965
965
|
],
|
|
966
|
-
[o,
|
|
966
|
+
[o, c]
|
|
967
967
|
), f = () => {
|
|
968
|
-
const
|
|
969
|
-
if (!
|
|
970
|
-
const
|
|
971
|
-
d((w) => [...w,
|
|
968
|
+
const p = a.trim();
|
|
969
|
+
if (!p) return;
|
|
970
|
+
const y = { id: p, name: p };
|
|
971
|
+
d((w) => [...w, y]), t(y.id), i(""), s(!1);
|
|
972
972
|
};
|
|
973
973
|
Ne(() => {
|
|
974
974
|
n && l.current && l.current.focus();
|
|
975
975
|
}, [n]);
|
|
976
|
-
const
|
|
977
|
-
|
|
976
|
+
const E = (p) => {
|
|
977
|
+
p.key === "Enter" && (p.preventDefault(), f());
|
|
978
978
|
};
|
|
979
979
|
return Ne(() => {
|
|
980
|
-
e && !h.some((
|
|
981
|
-
}, [e, h, t]), n ? /* @__PURE__ */
|
|
980
|
+
e && !h.some((p) => p.id === e) && t("");
|
|
981
|
+
}, [e, h, t]), n ? /* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
982
982
|
/* @__PURE__ */ r(
|
|
983
983
|
ve,
|
|
984
984
|
{
|
|
985
985
|
ref: l,
|
|
986
986
|
placeholder: "Enter new group name",
|
|
987
987
|
value: a,
|
|
988
|
-
onChange: (
|
|
989
|
-
onKeyDown:
|
|
988
|
+
onChange: (p) => i(p.target.value),
|
|
989
|
+
onKeyDown: E
|
|
990
990
|
}
|
|
991
991
|
),
|
|
992
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ u("div", { className: "flex justify-end gap-2", children: [
|
|
993
993
|
/* @__PURE__ */ r(
|
|
994
994
|
P,
|
|
995
995
|
{
|
|
@@ -1001,21 +1001,21 @@ const Bl = () => {
|
|
|
1001
1001
|
),
|
|
1002
1002
|
/* @__PURE__ */ r(P, { size: "sm", onClick: f, children: "Create" })
|
|
1003
1003
|
] })
|
|
1004
|
-
] }) : /* @__PURE__ */
|
|
1005
|
-
/* @__PURE__ */
|
|
1004
|
+
] }) : /* @__PURE__ */ u("div", { className: "flex gap-2", children: [
|
|
1005
|
+
/* @__PURE__ */ u(
|
|
1006
1006
|
"select",
|
|
1007
1007
|
{
|
|
1008
1008
|
className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
1009
1009
|
value: e,
|
|
1010
|
-
onChange: (
|
|
1010
|
+
onChange: (p) => t(p.target.value),
|
|
1011
1011
|
children: [
|
|
1012
1012
|
/* @__PURE__ */ r("option", { value: "", children: "Select a group" }),
|
|
1013
|
-
o.length > 0 && /* @__PURE__ */ r("optgroup", { label: "Library Groups", children: o.map((
|
|
1014
|
-
|
|
1015
|
-
(
|
|
1016
|
-
(
|
|
1013
|
+
o.length > 0 && /* @__PURE__ */ r("optgroup", { label: "Library Groups", children: o.map((p) => /* @__PURE__ */ r("option", { value: p.id, children: p.name }, `lib-${p.id}`)) }),
|
|
1014
|
+
c.length > 0 && /* @__PURE__ */ r("optgroup", { label: "Predefined Groups", children: c.filter(
|
|
1015
|
+
(p) => !o.some(
|
|
1016
|
+
(y) => y.id === p.id
|
|
1017
1017
|
)
|
|
1018
|
-
).map((
|
|
1018
|
+
).map((p) => /* @__PURE__ */ r("option", { value: p.id, children: p.name }, `local-${p.id}`)) })
|
|
1019
1019
|
]
|
|
1020
1020
|
}
|
|
1021
1021
|
),
|
|
@@ -1032,9 +1032,9 @@ const Bl = () => {
|
|
|
1032
1032
|
] });
|
|
1033
1033
|
}, zl = 10 * 1024 * 1024, Wl = ({ value: e, onChange: t }) => {
|
|
1034
1034
|
const [n, s] = T(!1), a = it(null), i = Pe(
|
|
1035
|
-
(
|
|
1035
|
+
(c) => {
|
|
1036
1036
|
var h;
|
|
1037
|
-
const d = (h =
|
|
1037
|
+
const d = (h = c.target.files) == null ? void 0 : h[0];
|
|
1038
1038
|
if (d) {
|
|
1039
1039
|
if (d.size > zl) {
|
|
1040
1040
|
X.error("File too large", {
|
|
@@ -1057,8 +1057,8 @@ const Bl = () => {
|
|
|
1057
1057
|
},
|
|
1058
1058
|
[t]
|
|
1059
1059
|
);
|
|
1060
|
-
return /* @__PURE__ */
|
|
1061
|
-
/* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
1061
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
1062
1062
|
/* @__PURE__ */ r(
|
|
1063
1063
|
ve,
|
|
1064
1064
|
{
|
|
@@ -1075,15 +1075,15 @@ const Bl = () => {
|
|
|
1075
1075
|
type: "button",
|
|
1076
1076
|
variant: "outline",
|
|
1077
1077
|
onClick: () => {
|
|
1078
|
-
var
|
|
1079
|
-
(
|
|
1078
|
+
var c;
|
|
1079
|
+
(c = a.current) == null || c.click();
|
|
1080
1080
|
},
|
|
1081
1081
|
disabled: n,
|
|
1082
1082
|
className: "w-full",
|
|
1083
|
-
children: n ? /* @__PURE__ */
|
|
1083
|
+
children: n ? /* @__PURE__ */ u("span", { className: "flex items-center gap-2", children: [
|
|
1084
1084
|
/* @__PURE__ */ r("div", { className: "animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full" }),
|
|
1085
1085
|
"Uploading..."
|
|
1086
|
-
] }) : /* @__PURE__ */
|
|
1086
|
+
] }) : /* @__PURE__ */ u("span", { className: "flex items-center gap-2", children: [
|
|
1087
1087
|
/* @__PURE__ */ r(Lr, { className: "h-4 w-4" }),
|
|
1088
1088
|
"Select image"
|
|
1089
1089
|
] })
|
|
@@ -1149,18 +1149,18 @@ const Bl = () => {
|
|
|
1149
1149
|
EDIT_MEDIA: "edit_media",
|
|
1150
1150
|
DELETE_MEDIA: "delete_media"
|
|
1151
1151
|
}, Yl = (e) => {
|
|
1152
|
-
const { blocks: t, close: n, blockId: s } = e, { getPartailBlocks: a } = ui(), i = t.find((A) => A._id === s), l = i == null ? void 0 : i._libBlockId, o = !!l,
|
|
1152
|
+
const { blocks: t, close: n, blockId: s } = e, { getPartailBlocks: a } = ui(), i = t.find((A) => A._id === s), l = i == null ? void 0 : i._libBlockId, o = !!l, c = Q(() => t.some(
|
|
1153
1153
|
(A) => A._type === "PartialBlock" || A._type === "GlobalBlock"
|
|
1154
1154
|
), [t]), d = Q(() => {
|
|
1155
1155
|
let A = [];
|
|
1156
1156
|
for (const G of t)
|
|
1157
1157
|
if (G._type === "PartialBlock" || G._type === "GlobalBlock") {
|
|
1158
1158
|
let U = a(G.partialBlockId);
|
|
1159
|
-
G._parent && (U == null ? void 0 : U.length) > 0 && (U = U.map((x) => (
|
|
1159
|
+
G._parent && (U == null ? void 0 : U.length) > 0 && (U = U.map((x) => (le(x._parent) && Ka(x, "_parent", G._parent), x))), A = [...A, ...U];
|
|
1160
1160
|
} else
|
|
1161
1161
|
A.push(G);
|
|
1162
1162
|
return A;
|
|
1163
|
-
}, [t, a]), [h, f] = T(""), [
|
|
1163
|
+
}, [t, a]), [h, f] = T(""), [E, p] = T(""), [y, w] = T(""), [v, I] = T(""), [b, C] = T({}), [S, L] = T(!1), [O, re] = T(o), [D, Y] = T(!1), { hasPermission: q } = Bt(), J = q(fe.DELETE_LIBRARY_BLOCK), R = hr(), k = () => {
|
|
1164
1164
|
R([s], { _libBlockId: void 0 }), X.success("Block delinked from library"), n();
|
|
1165
1165
|
}, {
|
|
1166
1166
|
data: M,
|
|
@@ -1170,14 +1170,14 @@ const Bl = () => {
|
|
|
1170
1170
|
Ne(() => {
|
|
1171
1171
|
Te && o && (Y(!0), re(!1));
|
|
1172
1172
|
}, [Te, o]), Ne(() => {
|
|
1173
|
-
M && !ee && (f(M.name || ""),
|
|
1173
|
+
M && !ee && (f(M.name || ""), p(M.group || ""), w(M.description || ""), I(M.preview || ""), re(!1));
|
|
1174
1174
|
}, [M, ee]), Ne(() => {
|
|
1175
|
-
const A = h.trim().length >= 2, G =
|
|
1175
|
+
const A = h.trim().length >= 2, G = E.trim() !== "";
|
|
1176
1176
|
L(A && G);
|
|
1177
|
-
}, [h,
|
|
1177
|
+
}, [h, E]);
|
|
1178
1178
|
const rt = () => {
|
|
1179
1179
|
const A = {};
|
|
1180
|
-
return h.trim() ? h.length < 2 && (A.name = "Name must be at least 2 characters") : A.name = "Name is required",
|
|
1180
|
+
return h.trim() ? h.length < 2 && (A.name = "Name must be at least 2 characters") : A.name = "Name is required", E || (A.group = "Group is required"), C(A), Object.keys(A).length === 0;
|
|
1181
1181
|
}, { resetLibrary: at } = di({ id: "" }), se = Fl(
|
|
1182
1182
|
(A) => {
|
|
1183
1183
|
o || R([s], { _libBlockId: A.id }), X.success(`Block ${o ? "updated" : "saved"} successfully`), at(A.library), n();
|
|
@@ -1187,32 +1187,32 @@ const Bl = () => {
|
|
|
1187
1187
|
const G = d.map((U) => (et(U, "_libBlockId") && delete U._libBlockId, U));
|
|
1188
1188
|
se.mutate({
|
|
1189
1189
|
name: h.trim(),
|
|
1190
|
-
group:
|
|
1190
|
+
group: E,
|
|
1191
1191
|
blocks: G,
|
|
1192
|
-
description:
|
|
1192
|
+
description: y.trim(),
|
|
1193
1193
|
// Only include previewImage if it exists and is a base64 image
|
|
1194
|
-
...
|
|
1194
|
+
...v && v.startsWith("data:") ? { previewImage: v } : {},
|
|
1195
1195
|
// Include id if in edit mode
|
|
1196
1196
|
...o ? { id: l } : {}
|
|
1197
1197
|
});
|
|
1198
1198
|
}, m = se.isPending;
|
|
1199
|
-
return O || ee ? /* @__PURE__ */ r("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ r("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" }) }) : D ? /* @__PURE__ */
|
|
1199
|
+
return O || ee ? /* @__PURE__ */ r("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ r("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" }) }) : D ? /* @__PURE__ */ u("div", { className: "p-6 space-y-4", children: [
|
|
1200
1200
|
/* @__PURE__ */ r("div", { className: "text-destructive font-medium", children: "Block Not Found" }),
|
|
1201
1201
|
/* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: "This block could not be found on the server. It may have been deleted." }),
|
|
1202
|
-
/* @__PURE__ */
|
|
1202
|
+
/* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-4", children: [
|
|
1203
1203
|
/* @__PURE__ */ r(P, { type: "button", variant: "outline", onClick: n, children: "Cancel" }),
|
|
1204
|
-
/* @__PURE__ */ r(P, { onClick:
|
|
1204
|
+
/* @__PURE__ */ r(P, { onClick: k, variant: "destructive", children: "Delink Block" })
|
|
1205
1205
|
] })
|
|
1206
|
-
] }) : /* @__PURE__ */
|
|
1207
|
-
|
|
1206
|
+
] }) : /* @__PURE__ */ u("div", { children: [
|
|
1207
|
+
c && /* @__PURE__ */ u("div", { className: "mb-4 p-3 border border-destructive/50 bg-destructive/10 text-destructive rounded-md flex items-start gap-2", children: [
|
|
1208
1208
|
/* @__PURE__ */ r(As, { className: "h-5 w-5 flex-shrink-0 mt-0.5" }),
|
|
1209
|
-
/* @__PURE__ */
|
|
1209
|
+
/* @__PURE__ */ u("div", { children: [
|
|
1210
1210
|
/* @__PURE__ */ r("p", { className: "font-medium", children: "Partial Blocks Detected" }),
|
|
1211
1211
|
/* @__PURE__ */ r("p", { className: "text-xs mt-1", children: "This block contains one or more Partial Blocks. Partial blocks will be merged into the library block" })
|
|
1212
1212
|
] })
|
|
1213
1213
|
] }),
|
|
1214
|
-
/* @__PURE__ */
|
|
1215
|
-
/* @__PURE__ */
|
|
1214
|
+
/* @__PURE__ */ u("form", { onSubmit: g, className: "space-y-4", children: [
|
|
1215
|
+
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
1216
1216
|
/* @__PURE__ */ r(
|
|
1217
1217
|
ne,
|
|
1218
1218
|
{
|
|
@@ -1233,7 +1233,7 @@ const Bl = () => {
|
|
|
1233
1233
|
),
|
|
1234
1234
|
b.name && /* @__PURE__ */ r("p", { className: "text-xs text-destructive", children: b.name })
|
|
1235
1235
|
] }),
|
|
1236
|
-
/* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
1237
1237
|
/* @__PURE__ */ r(
|
|
1238
1238
|
ne,
|
|
1239
1239
|
{
|
|
@@ -1242,10 +1242,10 @@ const Bl = () => {
|
|
|
1242
1242
|
children: "Group"
|
|
1243
1243
|
}
|
|
1244
1244
|
),
|
|
1245
|
-
/* @__PURE__ */ r($l, { value:
|
|
1245
|
+
/* @__PURE__ */ r($l, { value: E, onChange: p }),
|
|
1246
1246
|
b.group && /* @__PURE__ */ r("p", { className: "text-xs text-destructive", children: b.group })
|
|
1247
1247
|
] }),
|
|
1248
|
-
/* @__PURE__ */
|
|
1248
|
+
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
1249
1249
|
/* @__PURE__ */ r(ne, { htmlFor: "description", children: "Description (optional)" }),
|
|
1250
1250
|
/* @__PURE__ */ r(
|
|
1251
1251
|
ve,
|
|
@@ -1253,16 +1253,16 @@ const Bl = () => {
|
|
|
1253
1253
|
id: "description",
|
|
1254
1254
|
placeholder: "Enter a brief description",
|
|
1255
1255
|
className: "resize-none",
|
|
1256
|
-
value:
|
|
1256
|
+
value: y,
|
|
1257
1257
|
onChange: (A) => w(A.target.value)
|
|
1258
1258
|
}
|
|
1259
1259
|
)
|
|
1260
1260
|
] }),
|
|
1261
|
-
/* @__PURE__ */
|
|
1261
|
+
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
1262
1262
|
/* @__PURE__ */ r(ne, { htmlFor: "previewImage", children: "Preview Image (optional)" }),
|
|
1263
|
-
/* @__PURE__ */ r(Wl, { value:
|
|
1263
|
+
/* @__PURE__ */ r(Wl, { value: v, onChange: I })
|
|
1264
1264
|
] }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1265
|
+
/* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
1266
1266
|
o && J && /* @__PURE__ */ r(
|
|
1267
1267
|
Hl,
|
|
1268
1268
|
{
|
|
@@ -1588,11 +1588,11 @@ var Ds = {};
|
|
|
1588
1588
|
}
|
|
1589
1589
|
return !0;
|
|
1590
1590
|
}();
|
|
1591
|
-
function
|
|
1591
|
+
function c() {
|
|
1592
1592
|
}
|
|
1593
1593
|
function d(g) {
|
|
1594
1594
|
var m = n.exports.Promise, A = m !== void 0 ? m : t.Promise;
|
|
1595
|
-
return typeof A == "function" ? new A(g) : (g(
|
|
1595
|
+
return typeof A == "function" ? new A(g) : (g(c, c), null);
|
|
1596
1596
|
}
|
|
1597
1597
|
var h = /* @__PURE__ */ function(g, m) {
|
|
1598
1598
|
return {
|
|
@@ -1622,7 +1622,7 @@ var Ds = {};
|
|
|
1622
1622
|
}, A = function(x) {
|
|
1623
1623
|
return clearTimeout(x);
|
|
1624
1624
|
}), { frame: m, cancel: A };
|
|
1625
|
-
}(),
|
|
1625
|
+
}(), E = /* @__PURE__ */ function() {
|
|
1626
1626
|
var g, m, A = {};
|
|
1627
1627
|
function G(U) {
|
|
1628
1628
|
function x(K, B) {
|
|
@@ -1631,13 +1631,13 @@ var Ds = {};
|
|
|
1631
1631
|
U.init = function(B) {
|
|
1632
1632
|
var $ = B.transferControlToOffscreen();
|
|
1633
1633
|
U.postMessage({ canvas: $ }, [$]);
|
|
1634
|
-
}, U.fire = function(B, $,
|
|
1634
|
+
}, U.fire = function(B, $, oe) {
|
|
1635
1635
|
if (m)
|
|
1636
1636
|
return x(B, null), m;
|
|
1637
1637
|
var pe = Math.random().toString(36).slice(2);
|
|
1638
1638
|
return m = d(function(he) {
|
|
1639
1639
|
function ye(Ce) {
|
|
1640
|
-
Ce.data.callback === pe && (delete A[pe], U.removeEventListener("message", ye), m = null, h.clear(),
|
|
1640
|
+
Ce.data.callback === pe && (delete A[pe], U.removeEventListener("message", ye), m = null, h.clear(), oe(), he());
|
|
1641
1641
|
}
|
|
1642
1642
|
U.addEventListener("message", ye), x(B, pe), A[pe] = ye.bind(null, { data: { callback: pe } });
|
|
1643
1643
|
}), m;
|
|
@@ -1683,7 +1683,7 @@ var Ds = {};
|
|
|
1683
1683
|
}
|
|
1684
1684
|
return g;
|
|
1685
1685
|
};
|
|
1686
|
-
}(),
|
|
1686
|
+
}(), p = {
|
|
1687
1687
|
particleCount: 50,
|
|
1688
1688
|
angle: 90,
|
|
1689
1689
|
spread: 45,
|
|
@@ -1709,19 +1709,19 @@ var Ds = {};
|
|
|
1709
1709
|
disableForReducedMotion: !1,
|
|
1710
1710
|
scalar: 1
|
|
1711
1711
|
};
|
|
1712
|
-
function
|
|
1712
|
+
function y(g, m) {
|
|
1713
1713
|
return m ? m(g) : g;
|
|
1714
1714
|
}
|
|
1715
1715
|
function w(g) {
|
|
1716
1716
|
return g != null;
|
|
1717
1717
|
}
|
|
1718
|
-
function
|
|
1719
|
-
return
|
|
1720
|
-
g && w(g[m]) ? g[m] :
|
|
1718
|
+
function v(g, m, A) {
|
|
1719
|
+
return y(
|
|
1720
|
+
g && w(g[m]) ? g[m] : p[m],
|
|
1721
1721
|
A
|
|
1722
1722
|
);
|
|
1723
1723
|
}
|
|
1724
|
-
function
|
|
1724
|
+
function I(g) {
|
|
1725
1725
|
return g < 0 ? 0 : Math.floor(g);
|
|
1726
1726
|
}
|
|
1727
1727
|
function b(g, m) {
|
|
@@ -1742,8 +1742,8 @@ var Ds = {};
|
|
|
1742
1742
|
};
|
|
1743
1743
|
}
|
|
1744
1744
|
function O(g) {
|
|
1745
|
-
var m =
|
|
1746
|
-
return m.x =
|
|
1745
|
+
var m = v(g, "origin", Object);
|
|
1746
|
+
return m.x = v(m, "x", Number), m.y = v(m, "y", Number), m;
|
|
1747
1747
|
}
|
|
1748
1748
|
function re(g) {
|
|
1749
1749
|
g.width = document.documentElement.clientWidth, g.height = document.documentElement.clientHeight;
|
|
@@ -1800,11 +1800,11 @@ var Ds = {};
|
|
|
1800
1800
|
Math.PI / 10 * m.wobble
|
|
1801
1801
|
));
|
|
1802
1802
|
else if (m.shape.type === "bitmap") {
|
|
1803
|
-
var B = Math.PI / 10 * m.wobble, $ = Math.abs(x - G) * 0.1,
|
|
1803
|
+
var B = Math.PI / 10 * m.wobble, $ = Math.abs(x - G) * 0.1, oe = Math.abs(K - U) * 0.1, pe = m.shape.bitmap.width * m.scalar, he = m.shape.bitmap.height * m.scalar, ye = new DOMMatrix([
|
|
1804
1804
|
Math.cos(B) * $,
|
|
1805
1805
|
Math.sin(B) * $,
|
|
1806
|
-
-Math.sin(B) *
|
|
1807
|
-
Math.cos(B) *
|
|
1806
|
+
-Math.sin(B) * oe,
|
|
1807
|
+
Math.cos(B) * oe,
|
|
1808
1808
|
m.x,
|
|
1809
1809
|
m.y
|
|
1810
1810
|
]);
|
|
@@ -1825,8 +1825,8 @@ var Ds = {};
|
|
|
1825
1825
|
g.moveTo(Math.floor(m.x), Math.floor(m.y)), g.lineTo(Math.floor(m.wobbleX), Math.floor(U)), g.lineTo(Math.floor(x), Math.floor(K)), g.lineTo(Math.floor(G), Math.floor(m.wobbleY));
|
|
1826
1826
|
return g.closePath(), g.fill(), m.tick < m.totalTicks;
|
|
1827
1827
|
}
|
|
1828
|
-
function
|
|
1829
|
-
var x = m.slice(), K = g.getContext("2d"), B, $,
|
|
1828
|
+
function k(g, m, A, G, U) {
|
|
1829
|
+
var x = m.slice(), K = g.getContext("2d"), B, $, oe = d(function(pe) {
|
|
1830
1830
|
function he() {
|
|
1831
1831
|
B = $ = null, K.clearRect(0, 0, G.width, G.height), h.clear(), U(), pe();
|
|
1832
1832
|
}
|
|
@@ -1839,19 +1839,19 @@ var Ds = {};
|
|
|
1839
1839
|
});
|
|
1840
1840
|
return {
|
|
1841
1841
|
addFettis: function(pe) {
|
|
1842
|
-
return x = x.concat(pe),
|
|
1842
|
+
return x = x.concat(pe), oe;
|
|
1843
1843
|
},
|
|
1844
1844
|
canvas: g,
|
|
1845
|
-
promise:
|
|
1845
|
+
promise: oe,
|
|
1846
1846
|
reset: function() {
|
|
1847
1847
|
B && f.cancel(B), $ && $();
|
|
1848
1848
|
}
|
|
1849
1849
|
};
|
|
1850
1850
|
}
|
|
1851
1851
|
function M(g, m) {
|
|
1852
|
-
var A = !g, G = !!
|
|
1852
|
+
var A = !g, G = !!v(m || {}, "resize"), U = !1, x = v(m, "disableForReducedMotion", Boolean), K = i && !!v(m || {}, "useWorker"), B = K ? E() : null, $ = A ? re : D, oe = g && B ? !!g.__confetti_initialized : !1, pe = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, he;
|
|
1853
1853
|
function ye(te, ke, Ue) {
|
|
1854
|
-
for (var Oe =
|
|
1854
|
+
for (var Oe = v(te, "particleCount", I), qe = v(te, "angle", Number), N = v(te, "spread", Number), me = v(te, "startVelocity", Number), We = v(te, "decay", Number), Re = v(te, "gravity", Number), vt = v(te, "drift", Number), Et = v(te, "colors", S), vn = v(te, "ticks", Number), Os = v(te, "shapes"), Ba = v(te, "scalar"), Ma = !!v(te, "flat"), Rs = O(te), Bs = Oe, Kn = [], Fa = g.width * Rs.x, qa = g.height * Rs.y; Bs--; )
|
|
1855
1855
|
Kn.push(
|
|
1856
1856
|
J({
|
|
1857
1857
|
x: Fa,
|
|
@@ -1869,20 +1869,20 @@ var Ds = {};
|
|
|
1869
1869
|
flat: Ma
|
|
1870
1870
|
})
|
|
1871
1871
|
);
|
|
1872
|
-
return he ? he.addFettis(Kn) : (he =
|
|
1872
|
+
return he ? he.addFettis(Kn) : (he = k(g, Kn, $, ke, Ue), he.promise);
|
|
1873
1873
|
}
|
|
1874
1874
|
function Ce(te) {
|
|
1875
|
-
var ke = x ||
|
|
1875
|
+
var ke = x || v(te, "disableForReducedMotion", Boolean), Ue = v(te, "zIndex", Number);
|
|
1876
1876
|
if (ke && pe)
|
|
1877
1877
|
return d(function(me) {
|
|
1878
1878
|
me();
|
|
1879
1879
|
});
|
|
1880
|
-
A && he ? g = he.canvas : A && !g && (g = Y(Ue), document.body.appendChild(g)), G && !
|
|
1880
|
+
A && he ? g = he.canvas : A && !g && (g = Y(Ue), document.body.appendChild(g)), G && !oe && $(g);
|
|
1881
1881
|
var Oe = {
|
|
1882
1882
|
width: g.width,
|
|
1883
1883
|
height: g.height
|
|
1884
1884
|
};
|
|
1885
|
-
B && !
|
|
1885
|
+
B && !oe && B.init(g), oe = !0, B && (g.__confetti_initialized = !0);
|
|
1886
1886
|
function qe() {
|
|
1887
1887
|
if (B) {
|
|
1888
1888
|
var me = {
|
|
@@ -1902,7 +1902,7 @@ var Ds = {};
|
|
|
1902
1902
|
Oe.width = Oe.height = null;
|
|
1903
1903
|
}
|
|
1904
1904
|
function N() {
|
|
1905
|
-
he = null, G && (U = !1, t.removeEventListener("resize", qe)), A && g && (document.body.contains(g) && document.body.removeChild(g), g = null,
|
|
1905
|
+
he = null, G && (U = !1, t.removeEventListener("resize", qe)), A && g && (document.body.contains(g) && document.body.removeChild(g), g = null, oe = !1);
|
|
1906
1906
|
}
|
|
1907
1907
|
return G && !U && (U = !0, t.addEventListener("resize", qe, !1)), B ? B.fire(te, Oe, N) : ye(te, Oe, N);
|
|
1908
1908
|
}
|
|
@@ -1917,15 +1917,15 @@ var Ds = {};
|
|
|
1917
1917
|
function rt(g, m, A, G, U, x, K) {
|
|
1918
1918
|
var B = new Path2D(g), $ = new Path2D();
|
|
1919
1919
|
$.addPath(B, new DOMMatrix(m));
|
|
1920
|
-
var
|
|
1921
|
-
return
|
|
1920
|
+
var oe = new Path2D();
|
|
1921
|
+
return oe.addPath($, new DOMMatrix([
|
|
1922
1922
|
Math.cos(K) * U,
|
|
1923
1923
|
Math.sin(K) * U,
|
|
1924
1924
|
-Math.sin(K) * x,
|
|
1925
1925
|
Math.cos(K) * x,
|
|
1926
1926
|
A,
|
|
1927
1927
|
G
|
|
1928
|
-
])),
|
|
1928
|
+
])), oe;
|
|
1929
1929
|
}
|
|
1930
1930
|
function at(g) {
|
|
1931
1931
|
if (!l)
|
|
@@ -1934,10 +1934,10 @@ var Ds = {};
|
|
|
1934
1934
|
typeof g == "string" ? m = g : (m = g.path, A = g.matrix);
|
|
1935
1935
|
var G = new Path2D(m), U = document.createElement("canvas"), x = U.getContext("2d");
|
|
1936
1936
|
if (!A) {
|
|
1937
|
-
for (var K = 1e3, B = K, $ = K,
|
|
1937
|
+
for (var K = 1e3, B = K, $ = K, oe = 0, pe = 0, he, ye, Ce = 0; Ce < K; Ce += 2)
|
|
1938
1938
|
for (var te = 0; te < K; te += 2)
|
|
1939
|
-
x.isPointInPath(G, Ce, te, "nonzero") && (B = Math.min(B, Ce), $ = Math.min($, te),
|
|
1940
|
-
he =
|
|
1939
|
+
x.isPointInPath(G, Ce, te, "nonzero") && (B = Math.min(B, Ce), $ = Math.min($, te), oe = Math.max(oe, Ce), pe = Math.max(pe, te));
|
|
1940
|
+
he = oe - B, ye = pe - $;
|
|
1941
1941
|
var ke = 10, Ue = Math.min(ke / he, ke / ye);
|
|
1942
1942
|
A = [
|
|
1943
1943
|
Ue,
|
|
@@ -1959,7 +1959,7 @@ var Ds = {};
|
|
|
1959
1959
|
typeof g == "string" ? m = g : (m = g.text, A = "scalar" in g ? g.scalar : A, U = "fontFamily" in g ? g.fontFamily : U, G = "color" in g ? g.color : G);
|
|
1960
1960
|
var x = 10 * A, K = "" + x + "px " + U, B = new OffscreenCanvas(x, x), $ = B.getContext("2d");
|
|
1961
1961
|
$.font = K;
|
|
1962
|
-
var
|
|
1962
|
+
var oe = $.measureText(m), pe = Math.ceil(oe.actualBoundingBoxRight + oe.actualBoundingBoxLeft), he = Math.ceil(oe.actualBoundingBoxAscent + oe.actualBoundingBoxDescent), ye = 2, Ce = oe.actualBoundingBoxLeft + ye, te = oe.actualBoundingBoxAscent + ye;
|
|
1963
1963
|
pe += ye + ye, he += ye + ye, B = new OffscreenCanvas(pe, he), $ = B.getContext("2d"), $.font = K, $.fillStyle = G, $.fillText(m, Ce, te);
|
|
1964
1964
|
var ke = 1 / A;
|
|
1965
1965
|
return {
|
|
@@ -2000,7 +2000,7 @@ const ao = {
|
|
|
2000
2000
|
ro(n);
|
|
2001
2001
|
}, lo = () => {
|
|
2002
2002
|
const [e] = hi(), { mutate: t, isPending: n } = Ls(), { mutateAsync: s, isPending: a } = jr();
|
|
2003
|
-
return /* @__PURE__ */
|
|
2003
|
+
return /* @__PURE__ */ u("div", { className: "bg-white py-3 flex items-center justify-center gap-x-3 border-t", children: [
|
|
2004
2004
|
/* @__PURE__ */ r(
|
|
2005
2005
|
P,
|
|
2006
2006
|
{
|
|
@@ -2036,8 +2036,8 @@ const ao = {
|
|
|
2036
2036
|
page: e,
|
|
2037
2037
|
onClose: t
|
|
2038
2038
|
}) => {
|
|
2039
|
-
const [n, s] = T(e.slug || ""), { mutate: a, isPending: i } = so(), { data: l } = De(), o = Ee(l, { key: e == null ? void 0 : e.pageType }),
|
|
2040
|
-
if (h.preventDefault(), !(e != null && e.primaryPage) && Object.keys(Ye).some((
|
|
2039
|
+
const [n, s] = T(e.slug || ""), { mutate: a, isPending: i } = so(), { data: l } = De(), o = Ee(l, { key: e == null ? void 0 : e.pageType }), c = (h) => {
|
|
2040
|
+
if (h.preventDefault(), !(e != null && e.primaryPage) && Object.keys(Ye).some((p) => n === `/${p}` || jt(n, `/${p}/`))) {
|
|
2041
2041
|
X.error("Error", {
|
|
2042
2042
|
description: "Slugs cannot start with a language code for primary page"
|
|
2043
2043
|
});
|
|
@@ -2045,37 +2045,37 @@ const ao = {
|
|
|
2045
2045
|
}
|
|
2046
2046
|
a({ ...e, slug: n }, { onSuccess: t });
|
|
2047
2047
|
}, d = (e == null ? void 0 : e.lang) || "";
|
|
2048
|
-
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2048
|
+
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
|
|
2049
|
+
/* @__PURE__ */ u($e, { children: [
|
|
2050
2050
|
/* @__PURE__ */ r(ze, { children: "Change Slug" }),
|
|
2051
|
-
/* @__PURE__ */ r(Qe, { className: "text-xs", children: /* @__PURE__ */
|
|
2051
|
+
/* @__PURE__ */ r(Qe, { className: "text-xs", children: /* @__PURE__ */ u(Es, { variant: "destructive", className: "mt-2", children: [
|
|
2052
2052
|
/* @__PURE__ */ r(As, { className: "h-4 w-4" }),
|
|
2053
2053
|
"Changing the slug may have impact on your SEO. Please proceed with caution."
|
|
2054
2054
|
] }) })
|
|
2055
2055
|
] }),
|
|
2056
|
-
/* @__PURE__ */
|
|
2057
|
-
/* @__PURE__ */
|
|
2058
|
-
/* @__PURE__ */
|
|
2059
|
-
/* @__PURE__ */
|
|
2056
|
+
/* @__PURE__ */ u("form", { onSubmit: c, children: [
|
|
2057
|
+
/* @__PURE__ */ u("div", { className: "space-y-4 py-4 text-sm ", children: [
|
|
2058
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
2059
|
+
/* @__PURE__ */ u("div", { children: [
|
|
2060
2060
|
/* @__PURE__ */ r("span", { children: "Type:" }),
|
|
2061
|
-
/* @__PURE__ */
|
|
2061
|
+
/* @__PURE__ */ u("span", { className: "font-medium text-gray-600", children: [
|
|
2062
2062
|
" ",
|
|
2063
2063
|
(o == null ? void 0 : o.name) || (e == null ? void 0 : e.pageType)
|
|
2064
2064
|
] })
|
|
2065
2065
|
] }),
|
|
2066
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ u("div", { children: [
|
|
2067
2067
|
/* @__PURE__ */ r("span", { children: "Name:" }),
|
|
2068
|
-
/* @__PURE__ */
|
|
2068
|
+
/* @__PURE__ */ u("span", { className: "font-medium text-gray-600", children: [
|
|
2069
2069
|
" ",
|
|
2070
2070
|
e.name
|
|
2071
2071
|
] })
|
|
2072
2072
|
] })
|
|
2073
2073
|
] }),
|
|
2074
|
-
/* @__PURE__ */
|
|
2075
|
-
/* @__PURE__ */
|
|
2074
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
2075
|
+
/* @__PURE__ */ u(ne, { htmlFor: "slug", className: "text-right", children: [
|
|
2076
2076
|
"Slug",
|
|
2077
2077
|
" ",
|
|
2078
|
-
/* @__PURE__ */
|
|
2078
|
+
/* @__PURE__ */ u("small", { className: "font-light text-gray-500", children: [
|
|
2079
2079
|
"Slug should start with /",
|
|
2080
2080
|
d
|
|
2081
2081
|
] })
|
|
@@ -2120,26 +2120,26 @@ function Yr({
|
|
|
2120
2120
|
}
|
|
2121
2121
|
});
|
|
2122
2122
|
}, o = i == null ? void 0 : i.find(
|
|
2123
|
-
(
|
|
2123
|
+
(c) => c.key === (e == null ? void 0 : e.pageType)
|
|
2124
2124
|
);
|
|
2125
|
-
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */
|
|
2126
|
-
/* @__PURE__ */
|
|
2125
|
+
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
|
|
2126
|
+
/* @__PURE__ */ u($e, { children: [
|
|
2127
2127
|
/* @__PURE__ */ r(ze, { children: "Confirm Deletion" }),
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
-
/* @__PURE__ */
|
|
2128
|
+
/* @__PURE__ */ u(Qe, { className: "py-4 text-slate-500", children: [
|
|
2129
|
+
/* @__PURE__ */ u("div", { children: [
|
|
2130
2130
|
"Are you sure you want to remove ",
|
|
2131
2131
|
/* @__PURE__ */ r("b", { children: (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.slug) }),
|
|
2132
2132
|
" ",
|
|
2133
2133
|
o != null && o.hasSlug ? (o == null ? void 0 : o.name) + "?" : `page? ${e != null && e.primaryPage ? "" : "This will also delete all associated language pages."}`
|
|
2134
2134
|
] }),
|
|
2135
|
-
e.lang && /* @__PURE__ */
|
|
2135
|
+
e.lang && /* @__PURE__ */ u("div", { className: "py-2 text-sm", children: [
|
|
2136
2136
|
"Language:",
|
|
2137
2137
|
" ",
|
|
2138
2138
|
/* @__PURE__ */ r("span", { className: "font-medium text-gray-500", children: W(Ye, e.lang, e.lang) })
|
|
2139
2139
|
] })
|
|
2140
2140
|
] })
|
|
2141
2141
|
] }),
|
|
2142
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ u(nt, { children: [
|
|
2143
2143
|
/* @__PURE__ */ r(P, { variant: "outline", onClick: t, children: "Cancel" }),
|
|
2144
2144
|
/* @__PURE__ */ r(
|
|
2145
2145
|
P,
|
|
@@ -2168,17 +2168,17 @@ const Ve = ({
|
|
|
2168
2168
|
const { mutate: n, isPending: s } = eo(), a = async () => {
|
|
2169
2169
|
n(e, { onSuccess: t });
|
|
2170
2170
|
};
|
|
2171
|
-
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */
|
|
2172
|
-
/* @__PURE__ */
|
|
2171
|
+
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
|
|
2172
|
+
/* @__PURE__ */ u($e, { children: [
|
|
2173
2173
|
/* @__PURE__ */ r(ze, { children: "Confirm action" }),
|
|
2174
|
-
/* @__PURE__ */
|
|
2174
|
+
/* @__PURE__ */ u(Qe, { children: [
|
|
2175
2175
|
H.UNPUBLISH_MSG,
|
|
2176
2176
|
" ",
|
|
2177
2177
|
/* @__PURE__ */ r("b", { children: (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.slug) }),
|
|
2178
2178
|
"?"
|
|
2179
2179
|
] })
|
|
2180
2180
|
] }),
|
|
2181
|
-
/* @__PURE__ */
|
|
2181
|
+
/* @__PURE__ */ u(nt, { children: [
|
|
2182
2182
|
/* @__PURE__ */ r(P, { variant: "outline", onClick: t, children: "Cancel" }),
|
|
2183
2183
|
/* @__PURE__ */ r(
|
|
2184
2184
|
P,
|
|
@@ -2196,12 +2196,12 @@ const Ve = ({
|
|
|
2196
2196
|
onClose: t,
|
|
2197
2197
|
languages: n
|
|
2198
2198
|
}) => {
|
|
2199
|
-
const { data: s } = Fe(), { data: a } = De(), [i, l] = T(e.name || ""), [o,
|
|
2199
|
+
const { data: s } = Fe(), { data: a } = De(), [i, l] = T(e.name || ""), [o, c] = T(e.edit ? e.lang : ""), [d, h] = T(e.edit ? e.slug : ""), { mutate: f, isPending: E } = Wr(), { mutate: p, isPending: y } = ks(), w = Q(
|
|
2200
2200
|
() => a == null ? void 0 : a.find(
|
|
2201
2201
|
(C) => C.key === e.pageType
|
|
2202
2202
|
),
|
|
2203
2203
|
[a, e.pageType]
|
|
2204
|
-
),
|
|
2204
|
+
), v = !(w != null && w.hasSlug), I = E || y, b = (C) => {
|
|
2205
2205
|
C.preventDefault();
|
|
2206
2206
|
const S = {
|
|
2207
2207
|
name: i,
|
|
@@ -2210,35 +2210,35 @@ const Ve = ({
|
|
|
2210
2210
|
slug: d,
|
|
2211
2211
|
pageType: s == null ? void 0 : s.pageType
|
|
2212
2212
|
};
|
|
2213
|
-
S.pageType = e.pageType, e.edit && (S.id = e == null ? void 0 : e.id), e.edit ?
|
|
2213
|
+
S.pageType = e.pageType, e.edit && (S.id = e == null ? void 0 : e.id), e.edit ? p(S, { onSuccess: t }) : f(S, { onSuccess: t });
|
|
2214
2214
|
};
|
|
2215
|
-
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */
|
|
2216
|
-
/* @__PURE__ */
|
|
2215
|
+
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-[425px] text-slate-600", children: [
|
|
2216
|
+
/* @__PURE__ */ u($e, { children: [
|
|
2217
2217
|
/* @__PURE__ */ r(ze, { children: e.edit ? H.EDIT_LANGUAGE : H.ADD_NEW_LANGUAGE }),
|
|
2218
2218
|
/* @__PURE__ */ r(Qe, { className: "font-light", children: H.ENTER_LANGUAGE_DETAILS })
|
|
2219
2219
|
] }),
|
|
2220
|
-
/* @__PURE__ */
|
|
2221
|
-
/* @__PURE__ */
|
|
2222
|
-
/* @__PURE__ */
|
|
2220
|
+
/* @__PURE__ */ u("form", { onSubmit: b, children: [
|
|
2221
|
+
/* @__PURE__ */ u("div", { className: "grid gap-4 py-4", children: [
|
|
2222
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
2223
2223
|
/* @__PURE__ */ r(ne, { htmlFor: "lang", className: "text-right", children: H.LANGUAGE }),
|
|
2224
|
-
/* @__PURE__ */
|
|
2224
|
+
/* @__PURE__ */ u(
|
|
2225
2225
|
"select",
|
|
2226
2226
|
{
|
|
2227
2227
|
value: o,
|
|
2228
|
-
disabled: e.edit ||
|
|
2228
|
+
disabled: e.edit || le(n),
|
|
2229
2229
|
onChange: (C) => {
|
|
2230
2230
|
const S = C.target.value;
|
|
2231
|
-
|
|
2231
|
+
c(S), !v && h(`/${S}`);
|
|
2232
2232
|
},
|
|
2233
2233
|
className: "flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 col-span-3",
|
|
2234
2234
|
children: [
|
|
2235
|
-
/* @__PURE__ */ r("option", { value: "", disabled: !0, selected: !0, children: e.edit ? W(Ye, e.lang, e.lang) :
|
|
2235
|
+
/* @__PURE__ */ r("option", { value: "", disabled: !0, selected: !0, children: e.edit ? W(Ye, e.lang, e.lang) : le(n) ? H.ALL_AVAILABLE_LANGUAGE_PAGE : H.CHOOSE_LANGUAGE }),
|
|
2236
2236
|
je(n, (C) => /* @__PURE__ */ r("option", { value: C, children: W(Ye, C, C) }, C))
|
|
2237
2237
|
]
|
|
2238
2238
|
}
|
|
2239
2239
|
)
|
|
2240
2240
|
] }),
|
|
2241
|
-
/* @__PURE__ */
|
|
2241
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
2242
2242
|
/* @__PURE__ */ r(ne, { htmlFor: "slug", className: "text-right", children: H.PAGE_NAME }),
|
|
2243
2243
|
/* @__PURE__ */ r(
|
|
2244
2244
|
ve,
|
|
@@ -2252,8 +2252,8 @@ const Ve = ({
|
|
|
2252
2252
|
}
|
|
2253
2253
|
)
|
|
2254
2254
|
] }),
|
|
2255
|
-
!
|
|
2256
|
-
/* @__PURE__ */
|
|
2255
|
+
!v && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
2256
|
+
/* @__PURE__ */ u(ne, { htmlFor: "slug", className: "text-right", children: [
|
|
2257
2257
|
H.SLUG,
|
|
2258
2258
|
" ",
|
|
2259
2259
|
/* @__PURE__ */ r("small", { className: "font-light", children: H.SLUG_SHOULD_START_WITH })
|
|
@@ -2270,9 +2270,9 @@ const Ve = ({
|
|
|
2270
2270
|
className: "col-span-3",
|
|
2271
2271
|
required: !0,
|
|
2272
2272
|
pattern: "^/.*",
|
|
2273
|
-
disabled:
|
|
2273
|
+
disabled: le(o),
|
|
2274
2274
|
title: H.SLUG_MUST_START_WITH,
|
|
2275
|
-
placeholder:
|
|
2275
|
+
placeholder: le(o) ? H.CHOOSE_LANGUAGE_TO_ADD_SLUG : H.ENTER_PAGE_SLUG
|
|
2276
2276
|
}
|
|
2277
2277
|
)
|
|
2278
2278
|
] })
|
|
@@ -2281,33 +2281,33 @@ const Ve = ({
|
|
|
2281
2281
|
P,
|
|
2282
2282
|
{
|
|
2283
2283
|
type: "submit",
|
|
2284
|
-
disabled:
|
|
2285
|
-
children:
|
|
2284
|
+
disabled: I || !i || !o || !v && !jt(d, `/${o}`),
|
|
2285
|
+
children: I ? e.edit ? H.UPDATING : H.ADDING : e.edit ? H.UPDATE : H.ADD_NEW_LANGUAGE
|
|
2286
2286
|
}
|
|
2287
2287
|
) })
|
|
2288
2288
|
] })
|
|
2289
2289
|
] }) });
|
|
2290
2290
|
}, co = () => {
|
|
2291
|
-
const [e, t] = T(null), { selectedLang: n, fallbackLang: s, setSelectedLang: a } = ft(), { data: i, isFetching: l } = gn(), { data: o } = Fe(), [
|
|
2292
|
-
W(
|
|
2293
|
-
(
|
|
2291
|
+
const [e, t] = T(null), { selectedLang: n, fallbackLang: s, setSelectedLang: a } = ft(), { data: i, isFetching: l } = gn(), { data: o } = Fe(), [c, d] = T(null), [h, f] = T(null), [E, p] = T(null), { data: y } = pt(), w = Se(
|
|
2292
|
+
W(y, "languages") || ["en"],
|
|
2293
|
+
(v) => !Ee(i, { lang: v }) && v !== W(y, "fallbackLang")
|
|
2294
2294
|
);
|
|
2295
|
-
return /* @__PURE__ */
|
|
2296
|
-
/* @__PURE__ */ r("ul", { className: "space-y-2", children: l ? /* @__PURE__ */
|
|
2295
|
+
return /* @__PURE__ */ u("div", { className: "space-y-4", children: [
|
|
2296
|
+
/* @__PURE__ */ r("ul", { className: "space-y-2", children: l ? /* @__PURE__ */ u("div", { className: "w-full space-y-3 py-4", children: [
|
|
2297
2297
|
/* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
2298
2298
|
/* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
2299
2299
|
/* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
2300
|
-
] }) : je(i, (
|
|
2301
|
-
const
|
|
2302
|
-
return /* @__PURE__ */
|
|
2303
|
-
/* @__PURE__ */
|
|
2300
|
+
] }) : je(i, (v) => {
|
|
2301
|
+
const I = v.lang, b = v.slug, C = !v.primaryPage;
|
|
2302
|
+
return /* @__PURE__ */ u(be, { children: [
|
|
2303
|
+
/* @__PURE__ */ u(
|
|
2304
2304
|
"li",
|
|
2305
2305
|
{
|
|
2306
|
-
className: `text-slate-500 w-full p-2 rounded cursor-pointer flex items-center justify-between ${
|
|
2307
|
-
onClick: () => a(
|
|
2306
|
+
className: `text-slate-500 w-full p-2 rounded cursor-pointer flex items-center justify-between ${I === n ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
2307
|
+
onClick: () => a(I),
|
|
2308
2308
|
children: [
|
|
2309
|
-
/* @__PURE__ */
|
|
2310
|
-
/* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ u("div", { className: " flex-1 gap-x-3", children: [
|
|
2310
|
+
/* @__PURE__ */ u(
|
|
2311
2311
|
"div",
|
|
2312
2312
|
{
|
|
2313
2313
|
className: "text-[13px] text-slate-800 flex items-center gap-x-2",
|
|
@@ -2315,29 +2315,29 @@ const Ve = ({
|
|
|
2315
2315
|
/* @__PURE__ */ r(
|
|
2316
2316
|
"div",
|
|
2317
2317
|
{
|
|
2318
|
-
className: `w-2.5 h-2.5 rounded-full ${
|
|
2318
|
+
className: `w-2.5 h-2.5 rounded-full ${v.online ? "bg-green-300" : "bg-gray-300"}`
|
|
2319
2319
|
}
|
|
2320
2320
|
),
|
|
2321
|
-
W(Ye, C ? s :
|
|
2321
|
+
W(Ye, C ? s : I, I)
|
|
2322
2322
|
]
|
|
2323
2323
|
}
|
|
2324
2324
|
),
|
|
2325
|
-
/* @__PURE__ */
|
|
2326
|
-
b && /* @__PURE__ */
|
|
2325
|
+
/* @__PURE__ */ u("div", { children: [
|
|
2326
|
+
b && /* @__PURE__ */ u("div", { className: "text-[11px] text-slate-600 font-light", children: [
|
|
2327
2327
|
"Slug: ",
|
|
2328
2328
|
/* @__PURE__ */ r("b", { className: "font-medium", children: b })
|
|
2329
2329
|
] }),
|
|
2330
|
-
/* @__PURE__ */
|
|
2330
|
+
/* @__PURE__ */ u("div", { className: "text-[11px] text-slate-600 font-light", children: [
|
|
2331
2331
|
"Name:",
|
|
2332
|
-
/* @__PURE__ */
|
|
2332
|
+
/* @__PURE__ */ u("b", { className: "font-medium", children: [
|
|
2333
2333
|
" ",
|
|
2334
|
-
|
|
2334
|
+
v.name,
|
|
2335
2335
|
" "
|
|
2336
2336
|
] })
|
|
2337
2337
|
] })
|
|
2338
2338
|
] })
|
|
2339
2339
|
] }),
|
|
2340
|
-
C ? /* @__PURE__ */
|
|
2340
|
+
C ? /* @__PURE__ */ u("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
|
|
2341
2341
|
/* @__PURE__ */ r($i, { fill: "orange", className: "w-3 h-3" }),
|
|
2342
2342
|
/* @__PURE__ */ r("b", { children: " Primary" })
|
|
2343
2343
|
] }) : /* @__PURE__ */ r("div", { className: "flex items-center gap-x-3", children: /* @__PURE__ */ r(
|
|
@@ -2348,7 +2348,7 @@ const Ve = ({
|
|
|
2348
2348
|
fe.DELETE_PAGE,
|
|
2349
2349
|
fe.UNPUBLISH_PAGE
|
|
2350
2350
|
],
|
|
2351
|
-
children: /* @__PURE__ */
|
|
2351
|
+
children: /* @__PURE__ */ u(dn, { children: [
|
|
2352
2352
|
/* @__PURE__ */ r(
|
|
2353
2353
|
hn,
|
|
2354
2354
|
{
|
|
@@ -2365,7 +2365,7 @@ const Ve = ({
|
|
|
2365
2365
|
)
|
|
2366
2366
|
}
|
|
2367
2367
|
),
|
|
2368
|
-
/* @__PURE__ */
|
|
2368
|
+
/* @__PURE__ */ u(
|
|
2369
2369
|
mn,
|
|
2370
2370
|
{
|
|
2371
2371
|
align: "end",
|
|
@@ -2375,12 +2375,12 @@ const Ve = ({
|
|
|
2375
2375
|
Ve,
|
|
2376
2376
|
{
|
|
2377
2377
|
permissions: [fe.EDIT_PAGE],
|
|
2378
|
-
children: /* @__PURE__ */
|
|
2378
|
+
children: /* @__PURE__ */ u(
|
|
2379
2379
|
Ge,
|
|
2380
2380
|
{
|
|
2381
2381
|
className: "flex items-center gap-2 cursor-pointer",
|
|
2382
2382
|
onClick: (L) => {
|
|
2383
|
-
L.stopPropagation(), t({ ...
|
|
2383
|
+
L.stopPropagation(), t({ ...v, edit: !0 });
|
|
2384
2384
|
},
|
|
2385
2385
|
children: [
|
|
2386
2386
|
/* @__PURE__ */ r(zi, { className: "size-3" }),
|
|
@@ -2394,12 +2394,12 @@ const Ve = ({
|
|
|
2394
2394
|
Ve,
|
|
2395
2395
|
{
|
|
2396
2396
|
permissions: [fe.UNPUBLISH_PAGE],
|
|
2397
|
-
children: (
|
|
2397
|
+
children: (v == null ? void 0 : v.online) && /* @__PURE__ */ u(
|
|
2398
2398
|
Ge,
|
|
2399
2399
|
{
|
|
2400
2400
|
className: "flex items-center gap-2 cursor-pointer",
|
|
2401
2401
|
onClick: (L) => {
|
|
2402
|
-
L.stopPropagation(), f(
|
|
2402
|
+
L.stopPropagation(), f(v);
|
|
2403
2403
|
},
|
|
2404
2404
|
children: [
|
|
2405
2405
|
/* @__PURE__ */ r(Gr, { className: "size-3" }),
|
|
@@ -2413,12 +2413,12 @@ const Ve = ({
|
|
|
2413
2413
|
Ve,
|
|
2414
2414
|
{
|
|
2415
2415
|
permissions: [fe.DELETE_PAGE],
|
|
2416
|
-
children: /* @__PURE__ */
|
|
2416
|
+
children: /* @__PURE__ */ u(
|
|
2417
2417
|
Ge,
|
|
2418
2418
|
{
|
|
2419
2419
|
className: "flex items-center gap-2 cursor-pointer",
|
|
2420
2420
|
onClick: (L) => {
|
|
2421
|
-
L.stopPropagation(), d(
|
|
2421
|
+
L.stopPropagation(), d(v);
|
|
2422
2422
|
},
|
|
2423
2423
|
children: [
|
|
2424
2424
|
/* @__PURE__ */ r(Wi, { className: "size-3" }),
|
|
@@ -2436,7 +2436,7 @@ const Ve = ({
|
|
|
2436
2436
|
) })
|
|
2437
2437
|
]
|
|
2438
2438
|
},
|
|
2439
|
-
|
|
2439
|
+
v.id
|
|
2440
2440
|
),
|
|
2441
2441
|
/* @__PURE__ */ r("div", { className: "h-1 w-full border-b" })
|
|
2442
2442
|
] });
|
|
@@ -2446,7 +2446,7 @@ const Ve = ({
|
|
|
2446
2446
|
{
|
|
2447
2447
|
variant: "default",
|
|
2448
2448
|
size: "sm",
|
|
2449
|
-
disabled:
|
|
2449
|
+
disabled: le(w),
|
|
2450
2450
|
onClick: () => {
|
|
2451
2451
|
t({
|
|
2452
2452
|
name: o == null ? void 0 : o.name,
|
|
@@ -2467,7 +2467,7 @@ const Ve = ({
|
|
|
2467
2467
|
onClose: () => t(null)
|
|
2468
2468
|
}
|
|
2469
2469
|
),
|
|
2470
|
-
|
|
2470
|
+
c && /* @__PURE__ */ r(Yr, { page: c, onClose: () => d(null) }),
|
|
2471
2471
|
h && /* @__PURE__ */ r(
|
|
2472
2472
|
Gs,
|
|
2473
2473
|
{
|
|
@@ -2475,11 +2475,11 @@ const Ve = ({
|
|
|
2475
2475
|
onClose: () => f(null)
|
|
2476
2476
|
}
|
|
2477
2477
|
),
|
|
2478
|
-
|
|
2478
|
+
E && /* @__PURE__ */ r(
|
|
2479
2479
|
oo,
|
|
2480
2480
|
{
|
|
2481
|
-
page:
|
|
2482
|
-
onClose: () =>
|
|
2481
|
+
page: E,
|
|
2482
|
+
onClose: () => p(null)
|
|
2483
2483
|
}
|
|
2484
2484
|
)
|
|
2485
2485
|
] });
|
|
@@ -2491,38 +2491,38 @@ function uo({
|
|
|
2491
2491
|
dynamicPattern: s,
|
|
2492
2492
|
onValidationChange: a
|
|
2493
2493
|
}) {
|
|
2494
|
-
const [i, l] = T(null), o = it(null), [
|
|
2494
|
+
const [i, l] = T(null), o = it(null), [c, d] = T(s + e);
|
|
2495
2495
|
Ne(() => {
|
|
2496
2496
|
d(s + e);
|
|
2497
2497
|
}, [e, s]);
|
|
2498
|
-
const h = (
|
|
2499
|
-
const
|
|
2500
|
-
if (!
|
|
2501
|
-
const S =
|
|
2498
|
+
const h = (p) => {
|
|
2499
|
+
const y = p.target.value;
|
|
2500
|
+
if (!y.startsWith(s)) {
|
|
2501
|
+
const S = y.replace(s, ""), L = s + S;
|
|
2502
2502
|
d(L), t(S);
|
|
2503
2503
|
return;
|
|
2504
2504
|
}
|
|
2505
|
-
const
|
|
2506
|
-
|
|
2507
|
-
const C = s +
|
|
2508
|
-
d(C), t(
|
|
2505
|
+
const v = y.substring(s.length).replace(/\//g, "").replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-_.]/g, "-").replace(/-+/g, "-").replace(/^-+/, "").toLowerCase(), I = (v.match(/\./g) || []).length, b = I <= 1;
|
|
2506
|
+
I > 1 ? l("Invalid slug. Only one dot (.) is allowed in the slug") : l(null), a && a(b);
|
|
2507
|
+
const C = s + v;
|
|
2508
|
+
d(C), t(v);
|
|
2509
2509
|
}, f = () => {
|
|
2510
2510
|
if (o.current) {
|
|
2511
|
-
const
|
|
2511
|
+
const p = o.current;
|
|
2512
2512
|
setTimeout(() => {
|
|
2513
|
-
const
|
|
2514
|
-
|
|
2513
|
+
const y = s.length;
|
|
2514
|
+
p.setSelectionRange(y, y);
|
|
2515
2515
|
}, 0);
|
|
2516
2516
|
}
|
|
2517
|
-
},
|
|
2518
|
-
const
|
|
2519
|
-
(
|
|
2520
|
-
const
|
|
2521
|
-
|
|
2517
|
+
}, E = (p) => {
|
|
2518
|
+
const y = p.currentTarget;
|
|
2519
|
+
(y.selectionStart || 0) <= s.length && setTimeout(() => {
|
|
2520
|
+
const v = s.length;
|
|
2521
|
+
y.setSelectionRange(v, v);
|
|
2522
2522
|
}, 0);
|
|
2523
2523
|
};
|
|
2524
|
-
return /* @__PURE__ */ r("div", { children: /* @__PURE__ */
|
|
2525
|
-
/* @__PURE__ */
|
|
2524
|
+
return /* @__PURE__ */ r("div", { children: /* @__PURE__ */ u("div", { className: "relative", children: [
|
|
2525
|
+
/* @__PURE__ */ u("p", { className: "text-gray-500 text-xs mb-2", children: [
|
|
2526
2526
|
`${s}`,
|
|
2527
2527
|
" is a dynamic segment of slug"
|
|
2528
2528
|
] }),
|
|
@@ -2530,10 +2530,10 @@ function uo({
|
|
|
2530
2530
|
ve,
|
|
2531
2531
|
{
|
|
2532
2532
|
ref: o,
|
|
2533
|
-
value:
|
|
2533
|
+
value: c,
|
|
2534
2534
|
onChange: h,
|
|
2535
2535
|
onFocus: f,
|
|
2536
|
-
onClick:
|
|
2536
|
+
onClick: E,
|
|
2537
2537
|
placeholder: n,
|
|
2538
2538
|
className: i ? "border-red-500" : ""
|
|
2539
2539
|
}
|
|
@@ -2562,19 +2562,19 @@ function fo({
|
|
|
2562
2562
|
className: s = "w-full rounded-md border border-gray-300 px-3 py-2",
|
|
2563
2563
|
id: a = "parentPage"
|
|
2564
2564
|
}) {
|
|
2565
|
-
const i = Q(() => !e || e.length === 0 ? [] : e.filter((h) => !
|
|
2565
|
+
const i = Q(() => !e || e.length === 0 ? [] : e.filter((h) => !le(h.slug)).filter((h) => h.slug !== "/").sort((h, f) => h.slug.localeCompare(f.slug)), [e]), l = (d) => Math.max(0, (d.match(/\//g) || []).length - 1), o = (d) => " ".repeat(d), c = (d) => {
|
|
2566
2566
|
if (d === "/") return "/";
|
|
2567
2567
|
const h = d.split("/").filter(Boolean);
|
|
2568
2568
|
if (h.length <= 1) {
|
|
2569
|
-
const
|
|
2570
|
-
return `/${mt(
|
|
2569
|
+
const p = h[0] || "";
|
|
2570
|
+
return `/${mt(p)}`;
|
|
2571
2571
|
}
|
|
2572
2572
|
const f = h[h.length - 1];
|
|
2573
2573
|
return `/${mt(f)}`;
|
|
2574
2574
|
};
|
|
2575
|
-
return /* @__PURE__ */
|
|
2575
|
+
return /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
2576
2576
|
/* @__PURE__ */ r(ne, { htmlFor: a, className: "text-sm", children: "Parent" }),
|
|
2577
|
-
/* @__PURE__ */
|
|
2577
|
+
/* @__PURE__ */ u(
|
|
2578
2578
|
"select",
|
|
2579
2579
|
{
|
|
2580
2580
|
id: a,
|
|
@@ -2585,12 +2585,12 @@ function fo({
|
|
|
2585
2585
|
children: [
|
|
2586
2586
|
/* @__PURE__ */ r("option", { value: "none", children: "None" }),
|
|
2587
2587
|
i.map((d) => {
|
|
2588
|
-
const h = l(d.slug), f = h > 0 ? o(h) : "",
|
|
2589
|
-
return /* @__PURE__ */
|
|
2588
|
+
const h = l(d.slug), f = h > 0 ? o(h) : "", E = c(d.slug);
|
|
2589
|
+
return /* @__PURE__ */ u("option", { value: d.id, children: [
|
|
2590
2590
|
f,
|
|
2591
2591
|
d.name,
|
|
2592
2592
|
" (",
|
|
2593
|
-
|
|
2593
|
+
E,
|
|
2594
2594
|
")"
|
|
2595
2595
|
] }, d.id);
|
|
2596
2596
|
})
|
|
@@ -2606,20 +2606,20 @@ function Xr({
|
|
|
2606
2606
|
parentSlug: s,
|
|
2607
2607
|
onValidationChange: a
|
|
2608
2608
|
}) {
|
|
2609
|
-
const [i, l] = T(e), [o,
|
|
2609
|
+
const [i, l] = T(e), [o, c] = T(null);
|
|
2610
2610
|
Ne(() => {
|
|
2611
2611
|
l(e);
|
|
2612
2612
|
}, [e]);
|
|
2613
2613
|
const d = (h) => {
|
|
2614
|
-
const
|
|
2615
|
-
|
|
2614
|
+
const E = h.target.value.replace(/\//g, "").replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-_.]/g, "-").replace(/-+/g, "-").replace(/^-+/, "").toLowerCase(), p = (E.match(/\./g) || []).length, y = p <= 1;
|
|
2615
|
+
p > 1 ? c("Invalid slug. Only one dot (.) is allowed in the slug") : c(null), a && a(y), l(E), t(E);
|
|
2616
2616
|
};
|
|
2617
|
-
return /* @__PURE__ */
|
|
2618
|
-
s && /* @__PURE__ */ r("div", { className: "flex items-center mb-1", children: /* @__PURE__ */
|
|
2617
|
+
return /* @__PURE__ */ u("div", { children: [
|
|
2618
|
+
s && /* @__PURE__ */ r("div", { className: "flex items-center mb-1", children: /* @__PURE__ */ u("span", { className: "text-xs text-gray-500", children: [
|
|
2619
2619
|
"Parent: ",
|
|
2620
2620
|
mo(s)
|
|
2621
2621
|
] }) }),
|
|
2622
|
-
/* @__PURE__ */
|
|
2622
|
+
/* @__PURE__ */ u("div", { className: "relative", children: [
|
|
2623
2623
|
/* @__PURE__ */ r(
|
|
2624
2624
|
ve,
|
|
2625
2625
|
{
|
|
@@ -2642,7 +2642,7 @@ const go = ({
|
|
|
2642
2642
|
const [a, i] = T("");
|
|
2643
2643
|
if (Ne(() => {
|
|
2644
2644
|
if (t) {
|
|
2645
|
-
const o = e.find((
|
|
2645
|
+
const o = e.find((c) => c.id === t);
|
|
2646
2646
|
i((o == null ? void 0 : o.preview) || "");
|
|
2647
2647
|
} else
|
|
2648
2648
|
i("");
|
|
@@ -2652,10 +2652,10 @@ const go = ({
|
|
|
2652
2652
|
return null;
|
|
2653
2653
|
const l = {};
|
|
2654
2654
|
return e.forEach((o) => {
|
|
2655
|
-
const
|
|
2656
|
-
l[
|
|
2657
|
-
}), /* @__PURE__ */
|
|
2658
|
-
/* @__PURE__ */
|
|
2655
|
+
const c = o.libraryName;
|
|
2656
|
+
l[c] || (l[c] = []), l[c].push(o);
|
|
2657
|
+
}), /* @__PURE__ */ u("div", { className: "space-y-4", children: [
|
|
2658
|
+
/* @__PURE__ */ u(
|
|
2659
2659
|
"select",
|
|
2660
2660
|
{
|
|
2661
2661
|
className: "w-full rounded-md border border-gray-300 px-3 py-2",
|
|
@@ -2664,12 +2664,12 @@ const go = ({
|
|
|
2664
2664
|
children: [
|
|
2665
2665
|
/* @__PURE__ */ r("option", { value: "", children: "No Template" }),
|
|
2666
2666
|
Object.entries(l).map(
|
|
2667
|
-
([o,
|
|
2667
|
+
([o, c]) => /* @__PURE__ */ r("optgroup", { label: o, children: c.map((d) => /* @__PURE__ */ r("option", { value: d.id, children: $t(d.name) }, d.id)) }, o)
|
|
2668
2668
|
)
|
|
2669
2669
|
]
|
|
2670
2670
|
}
|
|
2671
2671
|
),
|
|
2672
|
-
a && /* @__PURE__ */
|
|
2672
|
+
a && /* @__PURE__ */ u("div", { className: "mt-3 border rounded overflow-hidden", children: [
|
|
2673
2673
|
/* @__PURE__ */ r("div", { className: "max-h-[200px] overflow-auto", children: /* @__PURE__ */ r(
|
|
2674
2674
|
"img",
|
|
2675
2675
|
{
|
|
@@ -2702,11 +2702,11 @@ const go = ({
|
|
|
2702
2702
|
});
|
|
2703
2703
|
}, vo = (e) => {
|
|
2704
2704
|
const { data: t = [], isLoading: n } = yo(e), { data: s = [], isLoading: a } = po(), i = Q(() => n || a ? [] : t.map((o) => {
|
|
2705
|
-
const
|
|
2705
|
+
const c = Ee(s, { id: o.library });
|
|
2706
2706
|
return {
|
|
2707
2707
|
...o,
|
|
2708
|
-
libraryName: (
|
|
2709
|
-
libraryType:
|
|
2708
|
+
libraryName: (c == null ? void 0 : c.type) !== "shared" ? "Site Library" : (c == null ? void 0 : c.name) + " Library",
|
|
2709
|
+
libraryType: c == null ? void 0 : c.type
|
|
2710
2710
|
};
|
|
2711
2711
|
}), [t, s, n, a]), l = Q(() => za(i, "libraryName"), [i]);
|
|
2712
2712
|
return {
|
|
@@ -2731,34 +2731,34 @@ function Eo({
|
|
|
2731
2731
|
closePanel: s
|
|
2732
2732
|
}) {
|
|
2733
2733
|
var Oe, qe;
|
|
2734
|
-
const a = Zr(), i = !!(e != null && e.id), { data: l } = qn(), { mutate: o, isPending:
|
|
2734
|
+
const a = Zr(), i = !!(e != null && e.id), { data: l } = qn(), { mutate: o, isPending: c } = Wr(), { mutate: d, isPending: h } = ks(), [f, E] = T(null), [p, y] = T(!0), [w, v] = T(
|
|
2735
2735
|
(e == null ? void 0 : e.pageType) ?? "page"
|
|
2736
|
-
), { hasPermission:
|
|
2736
|
+
), { hasPermission: I } = Bt(), b = I(fe.CHANGE_PAGE_TYPE), [C, S] = T(!1), [L, O] = T(""), re = Q(() => {
|
|
2737
2737
|
const N = t.find(
|
|
2738
2738
|
(me) => me.key === w
|
|
2739
2739
|
);
|
|
2740
2740
|
return (N == null ? void 0 : N.hasSlug) === !1;
|
|
2741
2741
|
}, [w, t]), [D, Y] = T(
|
|
2742
2742
|
(e == null ? void 0 : e.parent) ?? ""
|
|
2743
|
-
), [q, J] = T((e == null ? void 0 : e.name) ?? ""), [R,
|
|
2743
|
+
), [q, J] = T((e == null ? void 0 : e.name) ?? ""), [R, k] = T(
|
|
2744
2744
|
(e == null ? void 0 : e.dynamic) ?? !1
|
|
2745
2745
|
), [M, ee] = T(
|
|
2746
2746
|
R ? "" : ((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""
|
|
2747
2747
|
), [Te, rt] = T(
|
|
2748
2748
|
(e == null ? void 0 : e.dynamicSlugCustom) ?? ""
|
|
2749
|
-
), [at, se] = T(!0), [g, m] = T(""), { data: A, isLoading: G } = vo(w), U =
|
|
2749
|
+
), [at, se] = T(!0), [g, m] = T(""), { data: A, isLoading: G } = vo(w), U = c || h, x = t.find(
|
|
2750
2750
|
(N) => N.key === w
|
|
2751
2751
|
), K = (N) => {
|
|
2752
2752
|
if (i && w !== N) {
|
|
2753
2753
|
O(N), S(!0);
|
|
2754
2754
|
return;
|
|
2755
2755
|
}
|
|
2756
|
-
|
|
2756
|
+
v(N);
|
|
2757
2757
|
}, B = () => {
|
|
2758
|
-
|
|
2758
|
+
v(L), S(!1), k(!1);
|
|
2759
2759
|
}, $ = (N) => {
|
|
2760
|
-
|
|
2761
|
-
},
|
|
2760
|
+
k(N), N ? ee("") : rt("");
|
|
2761
|
+
}, oe = (N) => {
|
|
2762
2762
|
if (Y(N), N && N !== "none") {
|
|
2763
2763
|
const me = l == null ? void 0 : l.find(
|
|
2764
2764
|
(Re) => Re.id === N
|
|
@@ -2772,7 +2772,7 @@ function Eo({
|
|
|
2772
2772
|
ee(M ? `${M}` : "");
|
|
2773
2773
|
}, pe = (N) => {
|
|
2774
2774
|
m(N);
|
|
2775
|
-
}, he = () => q.trim() ? R && !
|
|
2775
|
+
}, he = () => q.trim() ? R && !le(M) ? (E("Slug must be empty when using dynamic slug"), !1) : R && !at ? (E("Dynamic slug is invalid"), !1) : !0 : (X.error("Name is required"), !1), ye = () => {
|
|
2776
2776
|
const N = {
|
|
2777
2777
|
pageType: x == null ? void 0 : x.key,
|
|
2778
2778
|
name: q,
|
|
@@ -2793,9 +2793,9 @@ function Eo({
|
|
|
2793
2793
|
});
|
|
2794
2794
|
}, Ce = (N, me) => {
|
|
2795
2795
|
if (!N.trim() && !R)
|
|
2796
|
-
return
|
|
2796
|
+
return E("Child page slug is required"), !1;
|
|
2797
2797
|
const We = mt(me), Re = Ws(We, N);
|
|
2798
|
-
return Object.keys(Ye).some((vn) => Re === `/${vn}` || (Re == null ? void 0 : Re.startsWith(`/${vn}/`))) ? (
|
|
2798
|
+
return Object.keys(Ye).some((vn) => Re === `/${vn}` || (Re == null ? void 0 : Re.startsWith(`/${vn}/`))) ? (E(
|
|
2799
2799
|
"Slugs cannot start with a language code for primary page"
|
|
2800
2800
|
), !1) : !0;
|
|
2801
2801
|
}, te = (N, me) => {
|
|
@@ -2842,7 +2842,7 @@ function Eo({
|
|
|
2842
2842
|
}
|
|
2843
2843
|
});
|
|
2844
2844
|
}, Ue = (N) => {
|
|
2845
|
-
if (N.preventDefault(),
|
|
2845
|
+
if (N.preventDefault(), E(null), !!he()) {
|
|
2846
2846
|
if (!(x != null && x.hasSlug)) {
|
|
2847
2847
|
ye();
|
|
2848
2848
|
return;
|
|
@@ -2858,8 +2858,8 @@ function Eo({
|
|
|
2858
2858
|
ke();
|
|
2859
2859
|
}
|
|
2860
2860
|
};
|
|
2861
|
-
return x != null && x.hasSlug ? /* @__PURE__ */
|
|
2862
|
-
/* @__PURE__ */
|
|
2861
|
+
return x != null && x.hasSlug ? /* @__PURE__ */ u("form", { onSubmit: Ue, className: "w-full max-w-md mx-auto space-y-4", children: [
|
|
2862
|
+
/* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
2863
2863
|
/* @__PURE__ */ r(ne, { htmlFor: "pageType", className: "text-sm", children: "Type" }),
|
|
2864
2864
|
/* @__PURE__ */ r(
|
|
2865
2865
|
"select",
|
|
@@ -2869,15 +2869,15 @@ function Eo({
|
|
|
2869
2869
|
disabled: i && !b,
|
|
2870
2870
|
onChange: (N) => K(N.target.value),
|
|
2871
2871
|
className: `w-full rounded-md border border-gray-300 px-3 py-2 ${i && !b ? "cursor-not-allowed text-gray-500" : ""}`,
|
|
2872
|
-
children: i ? re ? /* @__PURE__ */ r("optgroup", { label: "Partials", children: t.filter((N) => N.hasSlug === !1).map((N) => /* @__PURE__ */ r("option", { value: N.key, children: N.name }, N.key)) }) : /* @__PURE__ */ r("optgroup", { label: "Pages", children: t.filter((N) => N.hasSlug !== !1).map((N) => /* @__PURE__ */ r("option", { value: N.key, children: N.name }, N.key)) }) : /* @__PURE__ */
|
|
2872
|
+
children: i ? re ? /* @__PURE__ */ r("optgroup", { label: "Partials", children: t.filter((N) => N.hasSlug === !1).map((N) => /* @__PURE__ */ r("option", { value: N.key, children: N.name }, N.key)) }) : /* @__PURE__ */ r("optgroup", { label: "Pages", children: t.filter((N) => N.hasSlug !== !1).map((N) => /* @__PURE__ */ r("option", { value: N.key, children: N.name }, N.key)) }) : /* @__PURE__ */ u(be, { children: [
|
|
2873
2873
|
/* @__PURE__ */ r("optgroup", { label: "Pages", children: t.filter((N) => N.hasSlug !== !1).map((N) => /* @__PURE__ */ r("option", { value: N.key, children: N.name }, N.key)) }),
|
|
2874
2874
|
/* @__PURE__ */ r("optgroup", { label: "Partials", children: t.filter((N) => N.hasSlug === !1).map((N) => /* @__PURE__ */ r("option", { value: N.key, children: N.name }, N.key)) })
|
|
2875
2875
|
] })
|
|
2876
2876
|
}
|
|
2877
2877
|
),
|
|
2878
|
-
C && /* @__PURE__ */
|
|
2878
|
+
C && /* @__PURE__ */ u("div", { className: "mt-2 p-3 bg-yellow-50 border border-yellow-200 rounded-md", children: [
|
|
2879
2879
|
/* @__PURE__ */ r("p", { className: "text-sm text-yellow-800", children: "Changing the page type may impact the page data. Are you sure you want to proceed?" }),
|
|
2880
|
-
/* @__PURE__ */
|
|
2880
|
+
/* @__PURE__ */ u("div", { className: "mt-2 flex gap-2", children: [
|
|
2881
2881
|
/* @__PURE__ */ r(
|
|
2882
2882
|
P,
|
|
2883
2883
|
{
|
|
@@ -2899,7 +2899,7 @@ function Eo({
|
|
|
2899
2899
|
] })
|
|
2900
2900
|
] })
|
|
2901
2901
|
] }),
|
|
2902
|
-
!i && (x == null ? void 0 : x.hasSlug) && A.length > 0 && /* @__PURE__ */
|
|
2902
|
+
!i && (x == null ? void 0 : x.hasSlug) && A.length > 0 && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
2903
2903
|
/* @__PURE__ */ r(ne, { className: "text-sm mb-1 block", children: "Template" }),
|
|
2904
2904
|
/* @__PURE__ */ r(
|
|
2905
2905
|
go,
|
|
@@ -2916,10 +2916,10 @@ function Eo({
|
|
|
2916
2916
|
{
|
|
2917
2917
|
pages: l,
|
|
2918
2918
|
selectedParentId: D,
|
|
2919
|
-
onChange:
|
|
2919
|
+
onChange: oe
|
|
2920
2920
|
}
|
|
2921
2921
|
),
|
|
2922
|
-
/* @__PURE__ */
|
|
2922
|
+
/* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
2923
2923
|
/* @__PURE__ */ r(ne, { htmlFor: "name", className: "text-sm", children: "Name" }),
|
|
2924
2924
|
/* @__PURE__ */ r(
|
|
2925
2925
|
ve,
|
|
@@ -2932,8 +2932,8 @@ function Eo({
|
|
|
2932
2932
|
}
|
|
2933
2933
|
)
|
|
2934
2934
|
] }),
|
|
2935
|
-
(x == null ? void 0 : x.dynamicSegments) && D && D !== "none" && /* @__PURE__ */
|
|
2936
|
-
/* @__PURE__ */
|
|
2935
|
+
(x == null ? void 0 : x.dynamicSegments) && D && D !== "none" && /* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
2936
|
+
/* @__PURE__ */ u("div", { className: "flex items-center space-x-2", children: [
|
|
2937
2937
|
/* @__PURE__ */ r(
|
|
2938
2938
|
"input",
|
|
2939
2939
|
{
|
|
@@ -2957,7 +2957,7 @@ function Eo({
|
|
|
2957
2957
|
}
|
|
2958
2958
|
) }) })
|
|
2959
2959
|
] }),
|
|
2960
|
-
(!(x != null && x.dynamicSegments) || !R) && /* @__PURE__ */
|
|
2960
|
+
(!(x != null && x.dynamicSegments) || !R) && /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
2961
2961
|
/* @__PURE__ */ r(ne, { htmlFor: "slug", className: "text-sm", children: "Slug" }),
|
|
2962
2962
|
/* @__PURE__ */ r(
|
|
2963
2963
|
Xr,
|
|
@@ -2966,7 +2966,7 @@ function Eo({
|
|
|
2966
2966
|
onChange: ee,
|
|
2967
2967
|
placeholder: D && D !== "none" ? "Enter page slug" : w === "page" ? "Leave empty for home page" : "Required - e.g. your-slug",
|
|
2968
2968
|
parentSlug: D && D !== "none" ? (qe = l == null ? void 0 : l.find((N) => N.id === D)) == null ? void 0 : qe.slug : void 0,
|
|
2969
|
-
onValidationChange:
|
|
2969
|
+
onValidationChange: y
|
|
2970
2970
|
}
|
|
2971
2971
|
),
|
|
2972
2972
|
f && /* @__PURE__ */ r("p", { className: "text-xs text-red-500", children: f })
|
|
@@ -2975,20 +2975,20 @@ function Eo({
|
|
|
2975
2975
|
P,
|
|
2976
2976
|
{
|
|
2977
2977
|
disabled: U || // Disable if regular slug is invalid and we're not using dynamic slug
|
|
2978
|
-
!
|
|
2978
|
+
!p && (!(x != null && x.dynamicSegments) || !R) || // Disable if dynamic slug is invalid and we are using dynamic slug
|
|
2979
2979
|
R && !at,
|
|
2980
2980
|
type: "submit",
|
|
2981
2981
|
className: "w-full",
|
|
2982
2982
|
children: i ? U ? "Updating..." : "Update page" : U ? "Creating..." : "Create Page"
|
|
2983
2983
|
}
|
|
2984
2984
|
)
|
|
2985
|
-
] }) : /* @__PURE__ */
|
|
2985
|
+
] }) : /* @__PURE__ */ u(
|
|
2986
2986
|
"form",
|
|
2987
2987
|
{
|
|
2988
2988
|
onSubmit: Ue,
|
|
2989
2989
|
className: "w-full max-w-md mx-auto space-y-4",
|
|
2990
2990
|
children: [
|
|
2991
|
-
/* @__PURE__ */
|
|
2991
|
+
/* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
2992
2992
|
/* @__PURE__ */ r(ne, { htmlFor: "pageType", className: "text-sm", children: "Type" }),
|
|
2993
2993
|
/* @__PURE__ */ r(
|
|
2994
2994
|
"select",
|
|
@@ -3001,9 +3001,9 @@ function Eo({
|
|
|
3001
3001
|
children: /* @__PURE__ */ r("optgroup", { label: "Partials", children: t.filter((N) => N.hasSlug === !1).map((N) => /* @__PURE__ */ r("option", { value: N.key, children: N.name }, N.key)) })
|
|
3002
3002
|
}
|
|
3003
3003
|
),
|
|
3004
|
-
C && /* @__PURE__ */
|
|
3004
|
+
C && /* @__PURE__ */ u("div", { className: "mt-2 p-3 bg-yellow-50 border border-yellow-200 rounded-md", children: [
|
|
3005
3005
|
/* @__PURE__ */ r("p", { className: "text-sm text-yellow-800", children: "Changing the page type may impact the page data. Are you sure you want to proceed?" }),
|
|
3006
|
-
/* @__PURE__ */
|
|
3006
|
+
/* @__PURE__ */ u("div", { className: "mt-2 flex gap-2", children: [
|
|
3007
3007
|
/* @__PURE__ */ r(
|
|
3008
3008
|
P,
|
|
3009
3009
|
{
|
|
@@ -3026,7 +3026,7 @@ function Eo({
|
|
|
3026
3026
|
] }),
|
|
3027
3027
|
/* @__PURE__ */ r("p", { className: "text-xs text-gray-500", children: (Oe = t.find((N) => N.key === w)) == null ? void 0 : Oe.helpText })
|
|
3028
3028
|
] }),
|
|
3029
|
-
/* @__PURE__ */
|
|
3029
|
+
/* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
3030
3030
|
/* @__PURE__ */ r(ne, { htmlFor: "name", className: "text-sm", children: "Name" }),
|
|
3031
3031
|
/* @__PURE__ */ r(
|
|
3032
3032
|
ve,
|
|
@@ -3050,9 +3050,9 @@ const bo = ({
|
|
|
3050
3050
|
closePanel: n
|
|
3051
3051
|
}) => {
|
|
3052
3052
|
const { data: s } = De(), a = !!(e != null && e.id);
|
|
3053
|
-
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: () => t(void 0), children: /* @__PURE__ */
|
|
3054
|
-
/* @__PURE__ */
|
|
3055
|
-
/* @__PURE__ */
|
|
3053
|
+
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: () => t(void 0), children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-[425px]", children: [
|
|
3054
|
+
/* @__PURE__ */ u($e, { children: [
|
|
3055
|
+
/* @__PURE__ */ u(ze, { children: [
|
|
3056
3056
|
a ? "Edit" : "Add New",
|
|
3057
3057
|
" "
|
|
3058
3058
|
] }),
|
|
@@ -3075,10 +3075,16 @@ const bo = ({
|
|
|
3075
3075
|
pageId: s,
|
|
3076
3076
|
name: a,
|
|
3077
3077
|
slug: i
|
|
3078
|
-
}) =>
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3078
|
+
}) => {
|
|
3079
|
+
const l = {
|
|
3080
|
+
pageId: s,
|
|
3081
|
+
name: a
|
|
3082
|
+
};
|
|
3083
|
+
return i && (l.slug = i), await n(e, {
|
|
3084
|
+
action: "DUPLICATE_PAGE",
|
|
3085
|
+
data: l
|
|
3086
|
+
});
|
|
3087
|
+
},
|
|
3082
3088
|
onSuccess: () => {
|
|
3083
3089
|
t.invalidateQueries({
|
|
3084
3090
|
queryKey: [j, _.GET_WEBSITE_PAGES]
|
|
@@ -3094,97 +3100,97 @@ const bo = ({
|
|
|
3094
3100
|
page: e,
|
|
3095
3101
|
onClose: t
|
|
3096
3102
|
}) => {
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
if (p.preventDefault(), !l.trim()) {
|
|
3103
|
+
const { mutate: n, isPending: s } = So(), [a, i] = T(null), [l, o] = T(`${e.name} (Copy)`), c = le(e.slug), [d, h] = T(
|
|
3104
|
+
c ? "" : `${e.slug.split("/").pop()}-copy`
|
|
3105
|
+
), f = c ? "" : Wa(e.slug.split("/")).join("/"), [E, p] = T(!1), y = (w) => {
|
|
3106
|
+
if (w.preventDefault(), !l.trim()) {
|
|
3102
3107
|
i("Name is required");
|
|
3103
3108
|
return;
|
|
3104
3109
|
}
|
|
3105
|
-
if (!
|
|
3110
|
+
if (!c && !d.trim()) {
|
|
3106
3111
|
i("Slug is required");
|
|
3107
3112
|
return;
|
|
3108
3113
|
}
|
|
3109
|
-
i(null),
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3114
|
+
i(null), p(!0);
|
|
3115
|
+
const v = {
|
|
3116
|
+
pageId: e.id,
|
|
3117
|
+
name: l
|
|
3118
|
+
};
|
|
3119
|
+
c || (v.slug = `${f}/${d}`), n(
|
|
3120
|
+
v,
|
|
3115
3121
|
{
|
|
3116
3122
|
onSuccess: () => {
|
|
3117
|
-
|
|
3123
|
+
p(!1), t();
|
|
3118
3124
|
},
|
|
3119
|
-
onError: (
|
|
3120
|
-
|
|
3125
|
+
onError: (I) => {
|
|
3126
|
+
p(!1), I.code === "SLUG_EXISTS" ? i(
|
|
3121
3127
|
"A page with this slug already exists. Please choose a different slug."
|
|
3122
|
-
) :
|
|
3128
|
+
) : I.code === "INVALID_SLUG" ? i(
|
|
3123
3129
|
"The slug format is invalid. Please use only lowercase letters, numbers, and hyphens."
|
|
3124
|
-
) :
|
|
3125
|
-
|
|
3130
|
+
) : I.code === "PERMISSION_DENIED" ? i("You don't have permission to duplicate this page.") : i(
|
|
3131
|
+
I.message || "Failed to duplicate page. Please try again later."
|
|
3126
3132
|
);
|
|
3127
3133
|
}
|
|
3128
3134
|
}
|
|
3129
3135
|
);
|
|
3130
3136
|
};
|
|
3131
|
-
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */
|
|
3132
|
-
/* @__PURE__ */
|
|
3137
|
+
return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-[425px]", children: [
|
|
3138
|
+
/* @__PURE__ */ u($e, { children: [
|
|
3133
3139
|
/* @__PURE__ */ r(ze, { children: "Duplicate Page" }),
|
|
3134
3140
|
/* @__PURE__ */ r(Qe, { children: "Create a copy of the page with a new name and slug" })
|
|
3135
3141
|
] }),
|
|
3136
|
-
/* @__PURE__ */
|
|
3142
|
+
/* @__PURE__ */ u("div", { className: "bg-gray-50 p-3 rounded-md mb-4", children: [
|
|
3137
3143
|
/* @__PURE__ */ r("h3", { className: "text-sm font-medium mb-1", children: "Duplicating:" }),
|
|
3138
|
-
/* @__PURE__ */
|
|
3139
|
-
/* @__PURE__ */
|
|
3144
|
+
/* @__PURE__ */ u("div", { className: "text-sm text-gray-700 flex flex-col gap-1", children: [
|
|
3145
|
+
/* @__PURE__ */ u("div", { children: [
|
|
3140
3146
|
/* @__PURE__ */ r("span", { className: "font-medium", children: "Name:" }),
|
|
3141
3147
|
" ",
|
|
3142
3148
|
e.name
|
|
3143
3149
|
] }),
|
|
3144
|
-
/* @__PURE__ */
|
|
3150
|
+
!c && /* @__PURE__ */ u("div", { children: [
|
|
3145
3151
|
/* @__PURE__ */ r("span", { className: "font-medium", children: "Slug:" }),
|
|
3146
3152
|
" ",
|
|
3147
3153
|
e.slug
|
|
3148
3154
|
] }),
|
|
3149
|
-
/* @__PURE__ */
|
|
3155
|
+
/* @__PURE__ */ u("div", { children: [
|
|
3150
3156
|
/* @__PURE__ */ r("span", { className: "font-medium", children: "Type:" }),
|
|
3151
3157
|
" ",
|
|
3152
3158
|
e.pageType
|
|
3153
3159
|
] })
|
|
3154
3160
|
] })
|
|
3155
3161
|
] }),
|
|
3156
|
-
/* @__PURE__ */
|
|
3157
|
-
/* @__PURE__ */
|
|
3162
|
+
/* @__PURE__ */ u("form", { onSubmit: y, className: "space-y-4", children: [
|
|
3163
|
+
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
3158
3164
|
/* @__PURE__ */ r(ne, { htmlFor: "name", className: "text-sm", children: "Name" }),
|
|
3159
3165
|
/* @__PURE__ */ r(
|
|
3160
3166
|
ve,
|
|
3161
3167
|
{
|
|
3162
3168
|
id: "name",
|
|
3163
3169
|
value: l,
|
|
3164
|
-
onChange: (
|
|
3170
|
+
onChange: (w) => o(w.target.value),
|
|
3165
3171
|
required: !0
|
|
3166
3172
|
}
|
|
3167
3173
|
)
|
|
3168
3174
|
] }),
|
|
3169
|
-
/* @__PURE__ */
|
|
3175
|
+
!c && /* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
3170
3176
|
/* @__PURE__ */ r(ne, { htmlFor: "slug", className: "text-sm", children: "Slug" }),
|
|
3171
3177
|
/* @__PURE__ */ r(
|
|
3172
3178
|
Xr,
|
|
3173
3179
|
{
|
|
3174
|
-
value:
|
|
3175
|
-
onChange: (
|
|
3176
|
-
parentSlug:
|
|
3177
|
-
onValidationChange: (
|
|
3178
|
-
i(
|
|
3180
|
+
value: d,
|
|
3181
|
+
onChange: (w) => h(w),
|
|
3182
|
+
parentSlug: f,
|
|
3183
|
+
onValidationChange: (w) => {
|
|
3184
|
+
i(w ? null : "Invalid slug");
|
|
3179
3185
|
}
|
|
3180
3186
|
}
|
|
3181
3187
|
)
|
|
3182
3188
|
] }),
|
|
3183
|
-
a && /* @__PURE__ */
|
|
3189
|
+
a && /* @__PURE__ */ u(Es, { variant: "destructive", className: "py-2", children: [
|
|
3184
3190
|
/* @__PURE__ */ r(As, { className: "h-4 w-4" }),
|
|
3185
3191
|
/* @__PURE__ */ r("span", { className: "text-sm", children: a })
|
|
3186
3192
|
] }),
|
|
3187
|
-
/* @__PURE__ */
|
|
3193
|
+
/* @__PURE__ */ u("div", { className: "flex justify-end gap-2", children: [
|
|
3188
3194
|
/* @__PURE__ */ r(
|
|
3189
3195
|
P,
|
|
3190
3196
|
{
|
|
@@ -3199,8 +3205,8 @@ const bo = ({
|
|
|
3199
3205
|
P,
|
|
3200
3206
|
{
|
|
3201
3207
|
type: "submit",
|
|
3202
|
-
disabled: !l.trim() || !
|
|
3203
|
-
children: s ||
|
|
3208
|
+
disabled: !l.trim() || !c && !d.trim() || s || E,
|
|
3209
|
+
children: s || E ? "Duplicating..." : "Duplicate"
|
|
3204
3210
|
}
|
|
3205
3211
|
)
|
|
3206
3212
|
] })
|
|
@@ -3210,9 +3216,9 @@ const bo = ({
|
|
|
3210
3216
|
page: e,
|
|
3211
3217
|
onClose: t
|
|
3212
3218
|
}) => {
|
|
3213
|
-
const [n, s] = T(!1), [a, i] = T(""), [l, o] = T(""), [
|
|
3219
|
+
const [n, s] = T(!1), [a, i] = T(""), [l, o] = T(""), [c, d] = T(!1), h = it(null), f = to(), { data: E } = De(), p = E == null ? void 0 : E.find(
|
|
3214
3220
|
(C) => C.key === e.pageType
|
|
3215
|
-
),
|
|
3221
|
+
), y = (p == null ? void 0 : p.name) || $t(e.pageType), w = Pe(
|
|
3216
3222
|
(C) => {
|
|
3217
3223
|
var L;
|
|
3218
3224
|
const S = (L = C.target.files) == null ? void 0 : L[0];
|
|
@@ -3237,9 +3243,9 @@ const bo = ({
|
|
|
3237
3243
|
}
|
|
3238
3244
|
},
|
|
3239
3245
|
[]
|
|
3240
|
-
),
|
|
3246
|
+
), v = () => {
|
|
3241
3247
|
o(""), h.current && (h.current.value = "");
|
|
3242
|
-
},
|
|
3248
|
+
}, I = () => {
|
|
3243
3249
|
var C;
|
|
3244
3250
|
(C = h.current) == null || C.click();
|
|
3245
3251
|
}, b = () => {
|
|
@@ -3261,29 +3267,29 @@ const bo = ({
|
|
|
3261
3267
|
}
|
|
3262
3268
|
);
|
|
3263
3269
|
};
|
|
3264
|
-
return /* @__PURE__ */ r(He, { open: !0, onOpenChange: t, children: /* @__PURE__ */
|
|
3265
|
-
/* @__PURE__ */
|
|
3270
|
+
return /* @__PURE__ */ r(He, { open: !0, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
|
|
3271
|
+
/* @__PURE__ */ u($e, { children: [
|
|
3266
3272
|
/* @__PURE__ */ r(ze, { children: "Mark as template" }),
|
|
3267
|
-
/* @__PURE__ */
|
|
3273
|
+
/* @__PURE__ */ u(Qe, { className: "py-4 text-slate-500 space-y-1 text-xs", children: [
|
|
3268
3274
|
"Are you sure you want to mark this page as a template?",
|
|
3269
3275
|
/* @__PURE__ */ r("br", {}),
|
|
3270
3276
|
"Templates can be used to create new pages with the same content."
|
|
3271
3277
|
] })
|
|
3272
3278
|
] }),
|
|
3273
|
-
/* @__PURE__ */
|
|
3274
|
-
/* @__PURE__ */
|
|
3275
|
-
/* @__PURE__ */
|
|
3279
|
+
/* @__PURE__ */ u("div", { className: "space-y-4 mb-4 text-xs", children: [
|
|
3280
|
+
/* @__PURE__ */ u("div", { className: "p-4 border rounded bg-slate-50 space-y-3", children: [
|
|
3281
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
3276
3282
|
/* @__PURE__ */ r(Yi, { className: "w-4 h-4 text-slate-500" }),
|
|
3277
3283
|
/* @__PURE__ */ r("span", { className: "font-medium text-slate-500", children: "Page Name:" }),
|
|
3278
3284
|
/* @__PURE__ */ r("span", { className: "font-semibold", children: $t(e.name) })
|
|
3279
3285
|
] }),
|
|
3280
|
-
/* @__PURE__ */
|
|
3286
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
3281
3287
|
/* @__PURE__ */ r(fn, { className: "w-4 h-4 text-slate-500" }),
|
|
3282
3288
|
/* @__PURE__ */ r("span", { className: "font-medium text-slate-500", children: "Type:" }),
|
|
3283
|
-
/* @__PURE__ */ r("span", { className: "font-semibold", children:
|
|
3289
|
+
/* @__PURE__ */ r("span", { className: "font-semibold", children: y })
|
|
3284
3290
|
] })
|
|
3285
3291
|
] }),
|
|
3286
|
-
/* @__PURE__ */
|
|
3292
|
+
/* @__PURE__ */ u("div", { children: [
|
|
3287
3293
|
/* @__PURE__ */ r(ne, { htmlFor: "description", className: "text-xs font-medium", children: "Description (Optional)" }),
|
|
3288
3294
|
/* @__PURE__ */ r(
|
|
3289
3295
|
qt,
|
|
@@ -3296,10 +3302,10 @@ const bo = ({
|
|
|
3296
3302
|
}
|
|
3297
3303
|
)
|
|
3298
3304
|
] }),
|
|
3299
|
-
/* @__PURE__ */
|
|
3305
|
+
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
3300
3306
|
/* @__PURE__ */ r(ne, { htmlFor: "previewImage", className: "text-xs font-medium", children: "Preview Image (Optional)" }),
|
|
3301
|
-
/* @__PURE__ */
|
|
3302
|
-
/* @__PURE__ */
|
|
3307
|
+
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
3308
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
3303
3309
|
/* @__PURE__ */ r(
|
|
3304
3310
|
ve,
|
|
3305
3311
|
{
|
|
@@ -3316,13 +3322,13 @@ const bo = ({
|
|
|
3316
3322
|
{
|
|
3317
3323
|
type: "button",
|
|
3318
3324
|
variant: "outline",
|
|
3319
|
-
onClick:
|
|
3320
|
-
disabled:
|
|
3325
|
+
onClick: I,
|
|
3326
|
+
disabled: c,
|
|
3321
3327
|
className: "w-full",
|
|
3322
|
-
children:
|
|
3328
|
+
children: c ? /* @__PURE__ */ u("span", { className: "flex items-center gap-2", children: [
|
|
3323
3329
|
/* @__PURE__ */ r("div", { className: "animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full" }),
|
|
3324
3330
|
"Uploading..."
|
|
3325
|
-
] }) : /* @__PURE__ */
|
|
3331
|
+
] }) : /* @__PURE__ */ u("span", { className: "flex items-center gap-2", children: [
|
|
3326
3332
|
/* @__PURE__ */ r(Lr, { className: "h-4 w-4" }),
|
|
3327
3333
|
"Select image"
|
|
3328
3334
|
] })
|
|
@@ -3334,7 +3340,7 @@ const bo = ({
|
|
|
3334
3340
|
type: "button",
|
|
3335
3341
|
variant: "outline",
|
|
3336
3342
|
size: "icon",
|
|
3337
|
-
onClick:
|
|
3343
|
+
onClick: v,
|
|
3338
3344
|
children: /* @__PURE__ */ r(Dr, { className: "h-4 w-4" })
|
|
3339
3345
|
}
|
|
3340
3346
|
)
|
|
@@ -3351,7 +3357,7 @@ const bo = ({
|
|
|
3351
3357
|
] })
|
|
3352
3358
|
] })
|
|
3353
3359
|
] }),
|
|
3354
|
-
/* @__PURE__ */
|
|
3360
|
+
/* @__PURE__ */ u(
|
|
3355
3361
|
nt,
|
|
3356
3362
|
{
|
|
3357
3363
|
className: n ? "opacity-75 pointer-events-none" : "",
|
|
@@ -3376,12 +3382,12 @@ const bo = ({
|
|
|
3376
3382
|
onClose: t
|
|
3377
3383
|
}) => {
|
|
3378
3384
|
const [n, s] = T(!1), a = no();
|
|
3379
|
-
return /* @__PURE__ */ r(He, { open: !0, onOpenChange: t, children: /* @__PURE__ */
|
|
3380
|
-
/* @__PURE__ */
|
|
3385
|
+
return /* @__PURE__ */ r(He, { open: !0, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
|
|
3386
|
+
/* @__PURE__ */ u($e, { children: [
|
|
3381
3387
|
/* @__PURE__ */ r(ze, { children: "Unmark as template" }),
|
|
3382
3388
|
/* @__PURE__ */ r(Qe, { className: "py-4 text-slate-500 space-y-1 text-xs", children: "Are you sure you want to unmark this page as a template?" })
|
|
3383
3389
|
] }),
|
|
3384
|
-
/* @__PURE__ */
|
|
3390
|
+
/* @__PURE__ */ u(
|
|
3385
3391
|
nt,
|
|
3386
3392
|
{
|
|
3387
3393
|
className: n ? "opacity-75 pointer-events-none" : "",
|
|
@@ -3419,33 +3425,33 @@ const bo = ({
|
|
|
3419
3425
|
setDeletePage: i,
|
|
3420
3426
|
setAddEditPage: l,
|
|
3421
3427
|
setMarkAsTemplate: o,
|
|
3422
|
-
setUnmarkAsTemplate:
|
|
3428
|
+
setUnmarkAsTemplate: c,
|
|
3423
3429
|
setDuplicatePage: d
|
|
3424
3430
|
}) => {
|
|
3425
|
-
const h = Zr(), { data: f } = De(), { hasPermission:
|
|
3431
|
+
const h = Zr(), { data: f } = De(), { hasPermission: E } = Bt(), p = Q(
|
|
3426
3432
|
() => Ee(f, { key: t.pageType }),
|
|
3427
3433
|
[f, t.pageType]
|
|
3428
|
-
),
|
|
3434
|
+
), y = Q(() => {
|
|
3429
3435
|
const b = W(t, "slug", ""), C = e ? mt(e) : "", S = C ? b.replace(C, "") : b;
|
|
3430
3436
|
return S || "/";
|
|
3431
|
-
}, [t, e]), w = !
|
|
3432
|
-
() => !!(
|
|
3433
|
-
[
|
|
3437
|
+
}, [t, e]), w = !E(fe.EDIT_PAGE) && !E(fe.DELETE_PAGE) && !E(fe.UNPUBLISH_PAGE), v = Q(() => !!t.isTemplate, [t.isTemplate]), I = Q(
|
|
3438
|
+
() => !!(p != null && p.hasSlug),
|
|
3439
|
+
[p == null ? void 0 : p.hasSlug]
|
|
3434
3440
|
);
|
|
3435
|
-
return /* @__PURE__ */
|
|
3441
|
+
return /* @__PURE__ */ u(
|
|
3436
3442
|
"div",
|
|
3437
3443
|
{
|
|
3438
3444
|
onClick: () => h(W(t, "id"), s),
|
|
3439
3445
|
className: `rounded flex p-1.5 items-center justify-between leading-none duration-300 cursor-pointer px-3 py-1.5 ${n ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
3440
3446
|
children: [
|
|
3441
|
-
/* @__PURE__ */
|
|
3442
|
-
t.dynamic ? /* @__PURE__ */ r("div", { className: "w-4 h-4 text-slate-500 stroke-[1]", children: /* @__PURE__ */ r(Xi, { className: "w-4 h-4 text-yellow-400" }) }) :
|
|
3447
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
|
|
3448
|
+
t.dynamic ? /* @__PURE__ */ r("div", { className: "w-4 h-4 text-slate-500 stroke-[1]", children: /* @__PURE__ */ r(Xi, { className: "w-4 h-4 text-yellow-400" }) }) : p != null && p.icon ? /* @__PURE__ */ r(
|
|
3443
3449
|
"div",
|
|
3444
3450
|
{
|
|
3445
3451
|
className: "w-4 h-4 text-slate-500 stroke-[1]",
|
|
3446
|
-
dangerouslySetInnerHTML: { __html:
|
|
3452
|
+
dangerouslySetInnerHTML: { __html: p.icon }
|
|
3447
3453
|
}
|
|
3448
|
-
) :
|
|
3454
|
+
) : p != null && p.hasSlug ? /* @__PURE__ */ r(fn, { className: "w-4 h-4 text-slate-500 stroke-[1]" }) : /* @__PURE__ */ r(Zi, { className: "w-4 h-4 text-slate-500 stroke-[1]" }),
|
|
3449
3455
|
/* @__PURE__ */ r(
|
|
3450
3456
|
"div",
|
|
3451
3457
|
{
|
|
@@ -3453,15 +3459,15 @@ const bo = ({
|
|
|
3453
3459
|
}
|
|
3454
3460
|
),
|
|
3455
3461
|
/* @__PURE__ */ r("span", { className: "font-light leading-none truncate text-slate-800", children: t.name }),
|
|
3456
|
-
|
|
3462
|
+
p != null && p.hasSlug ? /* @__PURE__ */ u(
|
|
3457
3463
|
Wn,
|
|
3458
3464
|
{
|
|
3459
3465
|
variant: "outline",
|
|
3460
3466
|
className: `ml-2 text-xs max-w-full leading-tight py-px font-normal rounded-full text-gray-400 border ${n ? "border-gray-300" : "border-gray-200"}`,
|
|
3461
3467
|
children: [
|
|
3462
|
-
|
|
3463
|
-
t.dynamic && /* @__PURE__ */
|
|
3464
|
-
or(
|
|
3468
|
+
y,
|
|
3469
|
+
t.dynamic && /* @__PURE__ */ u("span", { className: "text-xs font-light leading-none text-slate-500", children: [
|
|
3470
|
+
or(y, "/") ? `${p == null ? void 0 : p.dynamicSlug}` : `/${p == null ? void 0 : p.dynamicSlug}`,
|
|
3465
3471
|
t.dynamicSlugCustom
|
|
3466
3472
|
] })
|
|
3467
3473
|
]
|
|
@@ -3471,10 +3477,10 @@ const bo = ({
|
|
|
3471
3477
|
{
|
|
3472
3478
|
variant: "outline",
|
|
3473
3479
|
className: `ml-2 text-xs max-w-full leading-tight py-px font-normal rounded-full text-gray-400 border ${n ? "border-gray-300" : "border-gray-200"}`,
|
|
3474
|
-
children:
|
|
3480
|
+
children: p == null ? void 0 : p.name
|
|
3475
3481
|
}
|
|
3476
3482
|
),
|
|
3477
|
-
|
|
3483
|
+
v && /* @__PURE__ */ r(
|
|
3478
3484
|
Wn,
|
|
3479
3485
|
{
|
|
3480
3486
|
variant: "outline",
|
|
@@ -3483,10 +3489,10 @@ const bo = ({
|
|
|
3483
3489
|
}
|
|
3484
3490
|
)
|
|
3485
3491
|
] }),
|
|
3486
|
-
/* @__PURE__ */ r("div", { className: "flex items-center space-x-4", children: !w && /* @__PURE__ */
|
|
3492
|
+
/* @__PURE__ */ r("div", { className: "flex items-center space-x-4", children: !w && /* @__PURE__ */ u(dn, { children: [
|
|
3487
3493
|
/* @__PURE__ */ r(hn, { asChild: !0, onClick: (b) => b.stopPropagation(), children: /* @__PURE__ */ r(xs, { className: "h-4 w-4 hover:stroke-[3]" }) }),
|
|
3488
|
-
/* @__PURE__ */
|
|
3489
|
-
|
|
3494
|
+
/* @__PURE__ */ u(mn, { align: "end", className: "text-sm", children: [
|
|
3495
|
+
E(fe.ADD_PAGE) && /* @__PURE__ */ u(
|
|
3490
3496
|
Ge,
|
|
3491
3497
|
{
|
|
3492
3498
|
className: "flex items-center gap-2 cursor-pointer",
|
|
@@ -3499,14 +3505,14 @@ const bo = ({
|
|
|
3499
3505
|
]
|
|
3500
3506
|
}
|
|
3501
3507
|
),
|
|
3502
|
-
|
|
3508
|
+
E(fe.EDIT_PAGE) && /* @__PURE__ */ u(
|
|
3503
3509
|
Ge,
|
|
3504
3510
|
{
|
|
3505
3511
|
className: "flex items-center gap-2 cursor-pointer",
|
|
3506
3512
|
onClick: (b) => {
|
|
3507
3513
|
b.stopPropagation(), l({
|
|
3508
3514
|
...t,
|
|
3509
|
-
global: !(
|
|
3515
|
+
global: !(p != null && p.hasSlug)
|
|
3510
3516
|
});
|
|
3511
3517
|
},
|
|
3512
3518
|
children: [
|
|
@@ -3515,7 +3521,7 @@ const bo = ({
|
|
|
3515
3521
|
]
|
|
3516
3522
|
}
|
|
3517
3523
|
),
|
|
3518
|
-
(t == null ? void 0 : t.online) &&
|
|
3524
|
+
(t == null ? void 0 : t.online) && E(fe.UNPUBLISH_PAGE) && /* @__PURE__ */ u(
|
|
3519
3525
|
Ge,
|
|
3520
3526
|
{
|
|
3521
3527
|
className: "flex items-center gap-2 cursor-pointer",
|
|
@@ -3528,7 +3534,7 @@ const bo = ({
|
|
|
3528
3534
|
]
|
|
3529
3535
|
}
|
|
3530
3536
|
),
|
|
3531
|
-
|
|
3537
|
+
E(fe.DELETE_PAGE) && /* @__PURE__ */ u(
|
|
3532
3538
|
Ge,
|
|
3533
3539
|
{
|
|
3534
3540
|
className: "flex items-center gap-2 cursor-pointer",
|
|
@@ -3541,19 +3547,19 @@ const bo = ({
|
|
|
3541
3547
|
]
|
|
3542
3548
|
}
|
|
3543
3549
|
),
|
|
3544
|
-
|
|
3550
|
+
E(fe.MARK_AS_TEMPLATE) && I && /* @__PURE__ */ r(be, { children: v ? /* @__PURE__ */ u(
|
|
3545
3551
|
Ge,
|
|
3546
3552
|
{
|
|
3547
3553
|
className: "flex items-center gap-2 cursor-pointer",
|
|
3548
3554
|
onClick: (b) => {
|
|
3549
|
-
b.stopPropagation(),
|
|
3555
|
+
b.stopPropagation(), c(t);
|
|
3550
3556
|
},
|
|
3551
3557
|
children: [
|
|
3552
3558
|
/* @__PURE__ */ r(js, { className: "size-3" }),
|
|
3553
3559
|
H.UNMARK_AS_TEMPLATE
|
|
3554
3560
|
]
|
|
3555
3561
|
}
|
|
3556
|
-
) : /* @__PURE__ */
|
|
3562
|
+
) : /* @__PURE__ */ u(
|
|
3557
3563
|
Ge,
|
|
3558
3564
|
{
|
|
3559
3565
|
className: "flex items-center gap-2 cursor-pointer",
|
|
@@ -3572,41 +3578,41 @@ const bo = ({
|
|
|
3572
3578
|
}
|
|
3573
3579
|
);
|
|
3574
3580
|
}, Co = ({ close: e }) => {
|
|
3575
|
-
const [, t] = T([]), [n, s] = T(null), [a, i] = T(""), [l, o] = T(null), [
|
|
3576
|
-
(
|
|
3581
|
+
const [, t] = T([]), [n, s] = T(null), [a, i] = T(""), [l, o] = T(null), [c, d] = T(null), [h, f] = T(null), [E, p] = T(null), [y, w] = T(null), { data: v, isFetching: I } = qn(), [b, C] = T(""), { hasPermission: S } = Bt(), [L, O] = Me(), re = L.get("page"), { data: D } = De(), Y = Pe(
|
|
3582
|
+
(k) => {
|
|
3577
3583
|
var M;
|
|
3578
|
-
return (M = Ee(D, { key:
|
|
3584
|
+
return (M = Ee(D, { key: k })) == null ? void 0 : M.hasSlug;
|
|
3579
3585
|
},
|
|
3580
3586
|
[D]
|
|
3581
3587
|
);
|
|
3582
3588
|
Ne(() => {
|
|
3583
|
-
if (!
|
|
3584
|
-
const
|
|
3585
|
-
!
|
|
3589
|
+
if (!le(b)) return;
|
|
3590
|
+
const k = sessionStorage.getItem("pageTypeFilter") || "all";
|
|
3591
|
+
!le(D) && k && (Ee(D, { key: k }) ? C(k) : C("all"));
|
|
3586
3592
|
}, [D, b]);
|
|
3587
|
-
const q = (
|
|
3588
|
-
C(
|
|
3593
|
+
const q = (k) => {
|
|
3594
|
+
C(k), sessionStorage.setItem("pageTypeFilter", k);
|
|
3589
3595
|
}, J = Pe(
|
|
3590
|
-
(
|
|
3591
|
-
const ee = new URLSearchParams(window.location.search).get("lang"), Te = new URLSearchParams({ page:
|
|
3596
|
+
(k) => {
|
|
3597
|
+
const ee = new URLSearchParams(window.location.search).get("lang"), Te = new URLSearchParams({ page: k });
|
|
3592
3598
|
ee && Te.set("lang", ee), window.history.pushState({}, "", `?${Te.toString()}`), O(Te), window.dispatchEvent(new PopStateEvent("popstate")), e();
|
|
3593
3599
|
},
|
|
3594
3600
|
[O, e]
|
|
3595
3601
|
);
|
|
3596
3602
|
Ne(() => {
|
|
3597
|
-
if (re && !
|
|
3598
|
-
const
|
|
3599
|
-
|
|
3603
|
+
if (re && !I) {
|
|
3604
|
+
const k = Ee(v, { id: re });
|
|
3605
|
+
k && (k != null && k.pageType) ? t((M) => [...M, k == null ? void 0 : k.pageType]) : (window.history.replaceState(null, "", "/"), O(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate")));
|
|
3600
3606
|
}
|
|
3601
|
-
}, [
|
|
3607
|
+
}, [v, re, I, O]);
|
|
3602
3608
|
const R = Q(() => {
|
|
3603
|
-
const
|
|
3604
|
-
Se(
|
|
3609
|
+
const k = _n(
|
|
3610
|
+
Se(v, (se) => le(a) ? !0 : zt(Ft(se == null ? void 0 : se.name), Ft(a)) || zt(Ft(se == null ? void 0 : se.slug), Ft(a)))
|
|
3605
3611
|
);
|
|
3606
3612
|
if (b !== "all")
|
|
3607
|
-
return _n(Se(
|
|
3613
|
+
return _n(Se(k, { pageType: b }));
|
|
3608
3614
|
const M = /* @__PURE__ */ new Map();
|
|
3609
|
-
|
|
3615
|
+
k.forEach((se) => {
|
|
3610
3616
|
M.set(se.id, { ...se, children: [] });
|
|
3611
3617
|
});
|
|
3612
3618
|
const ee = [];
|
|
@@ -3626,10 +3632,10 @@ const bo = ({
|
|
|
3626
3632
|
(se) => Y(se.pageType)
|
|
3627
3633
|
).sort((se, g) => se.name.localeCompare(g.name)), at = Se(ee, (se) => !Y(se.pageType));
|
|
3628
3634
|
return _n([...rt, ...at]);
|
|
3629
|
-
}, [
|
|
3630
|
-
return /* @__PURE__ */
|
|
3631
|
-
/* @__PURE__ */
|
|
3632
|
-
/* @__PURE__ */
|
|
3635
|
+
}, [v, Y, a, b]);
|
|
3636
|
+
return /* @__PURE__ */ u("div", { className: "flex flex-col justify-between h-full", children: [
|
|
3637
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col h-full space-y-6", children: [
|
|
3638
|
+
/* @__PURE__ */ u("div", { className: "relative flex item-center gap-x-4", children: [
|
|
3633
3639
|
/* @__PURE__ */ r(
|
|
3634
3640
|
Qi,
|
|
3635
3641
|
{
|
|
@@ -3643,10 +3649,10 @@ const bo = ({
|
|
|
3643
3649
|
placeholder: "Search pages...",
|
|
3644
3650
|
className: "text-xs font-medium leading-none text-gray-700 pl-9 pr-24 placeholder:text-gray-400",
|
|
3645
3651
|
value: a,
|
|
3646
|
-
onChange: (
|
|
3652
|
+
onChange: (k) => i(k.target.value)
|
|
3647
3653
|
}
|
|
3648
3654
|
),
|
|
3649
|
-
!
|
|
3655
|
+
!le(b) && /* @__PURE__ */ u(Ai, { value: b, onValueChange: q, children: [
|
|
3650
3656
|
/* @__PURE__ */ r(
|
|
3651
3657
|
xi,
|
|
3652
3658
|
{
|
|
@@ -3654,79 +3660,79 @@ const bo = ({
|
|
|
3654
3660
|
children: /* @__PURE__ */ r(Ti, { placeholder: "Select page type" })
|
|
3655
3661
|
}
|
|
3656
3662
|
),
|
|
3657
|
-
/* @__PURE__ */
|
|
3663
|
+
/* @__PURE__ */ u(Ci, { align: "end", children: [
|
|
3658
3664
|
/* @__PURE__ */ r(zn, { value: "all", children: "All" }, "all"),
|
|
3659
|
-
!
|
|
3660
|
-
Se(D, (
|
|
3661
|
-
) && /* @__PURE__ */
|
|
3665
|
+
!le(
|
|
3666
|
+
Se(D, (k) => k.hasSlug)
|
|
3667
|
+
) && /* @__PURE__ */ u(be, { children: [
|
|
3662
3668
|
/* @__PURE__ */ r("div", { className: "px-2 py-1.5 text-xs font-semibold text-gray-500 mt-2 border-t pt-2", children: "Pages" }),
|
|
3663
3669
|
je(
|
|
3664
3670
|
[
|
|
3665
|
-
...Se(D, (
|
|
3671
|
+
...Se(D, (k) => k.hasSlug)
|
|
3666
3672
|
].sort(
|
|
3667
|
-
(
|
|
3673
|
+
(k, M) => W(k, "name", "").localeCompare(W(M, "name", ""))
|
|
3668
3674
|
),
|
|
3669
|
-
(
|
|
3675
|
+
(k) => /* @__PURE__ */ r(
|
|
3670
3676
|
zn,
|
|
3671
3677
|
{
|
|
3672
|
-
value: W(
|
|
3673
|
-
children: W(
|
|
3678
|
+
value: W(k, "key"),
|
|
3679
|
+
children: W(k, "name")
|
|
3674
3680
|
},
|
|
3675
|
-
W(
|
|
3681
|
+
W(k, "key")
|
|
3676
3682
|
)
|
|
3677
3683
|
)
|
|
3678
3684
|
] }),
|
|
3679
|
-
!
|
|
3680
|
-
Se(D, (
|
|
3681
|
-
) && /* @__PURE__ */
|
|
3685
|
+
!le(
|
|
3686
|
+
Se(D, (k) => !k.hasSlug)
|
|
3687
|
+
) && /* @__PURE__ */ u(be, { children: [
|
|
3682
3688
|
/* @__PURE__ */ r("div", { className: "px-2 py-1.5 text-xs font-semibold text-gray-500 mt-2 border-t pt-2", children: "Partials" }),
|
|
3683
3689
|
je(
|
|
3684
3690
|
[
|
|
3685
|
-
...Se(D, (
|
|
3691
|
+
...Se(D, (k) => !k.hasSlug)
|
|
3686
3692
|
].sort(
|
|
3687
|
-
(
|
|
3693
|
+
(k, M) => W(k, "name", "").localeCompare(W(M, "name", ""))
|
|
3688
3694
|
),
|
|
3689
|
-
(
|
|
3695
|
+
(k) => /* @__PURE__ */ r(
|
|
3690
3696
|
zn,
|
|
3691
3697
|
{
|
|
3692
|
-
value: W(
|
|
3693
|
-
children: W(
|
|
3698
|
+
value: W(k, "key"),
|
|
3699
|
+
children: W(k, "name")
|
|
3694
3700
|
},
|
|
3695
|
-
W(
|
|
3701
|
+
W(k, "key")
|
|
3696
3702
|
)
|
|
3697
3703
|
)
|
|
3698
3704
|
] })
|
|
3699
3705
|
] })
|
|
3700
3706
|
] })
|
|
3701
3707
|
] }),
|
|
3702
|
-
|
|
3708
|
+
I ? /* @__PURE__ */ r("div", { className: "space-y-2", children: je([...Array(5).keys()], (k) => /* @__PURE__ */ r(
|
|
3703
3709
|
"div",
|
|
3704
3710
|
{
|
|
3705
3711
|
className: "w-full bg-gray-200 rounded h-9 animate-pulse"
|
|
3706
3712
|
},
|
|
3707
|
-
|
|
3708
|
-
)) }) :
|
|
3713
|
+
k
|
|
3714
|
+
)) }) : le(R) ? /* @__PURE__ */ u("div", { className: "h-[70vh] flex flex-col gap-y-1 items-center justify-center text-slate-500 text-sm font-medium", children: [
|
|
3709
3715
|
/* @__PURE__ */ r(fn, { className: "h-6 w-6 stroke-[1]" }),
|
|
3710
3716
|
"Empty List!",
|
|
3711
3717
|
/* @__PURE__ */ r("span", { className: "font-light", children: "Add new page to start" })
|
|
3712
|
-
] }) : /* @__PURE__ */ r("div", { className: "text-sm text-slate-700 space-y-2 h-[70vh] overflow-y-auto", children: je(R, (
|
|
3718
|
+
] }) : /* @__PURE__ */ r("div", { className: "text-sm text-slate-700 space-y-2 h-[70vh] overflow-y-auto", children: je(R, (k) => /* @__PURE__ */ r(
|
|
3713
3719
|
Jr,
|
|
3714
3720
|
{
|
|
3715
|
-
item:
|
|
3721
|
+
item: k,
|
|
3716
3722
|
currentPage: re,
|
|
3717
3723
|
close: e,
|
|
3718
3724
|
setUnpublishPage: d,
|
|
3719
3725
|
setDeletePage: o,
|
|
3720
3726
|
setAddEditPage: f,
|
|
3721
|
-
setMarkAsTemplate:
|
|
3727
|
+
setMarkAsTemplate: p,
|
|
3722
3728
|
setUnmarkAsTemplate: w,
|
|
3723
3729
|
setDuplicatePage: s,
|
|
3724
3730
|
level: 0
|
|
3725
3731
|
},
|
|
3726
|
-
`page-item-${
|
|
3732
|
+
`page-item-${k.id}`
|
|
3727
3733
|
)) })
|
|
3728
3734
|
] }),
|
|
3729
|
-
S(fe.ADD_PAGE) && /* @__PURE__ */
|
|
3735
|
+
S(fe.ADD_PAGE) && /* @__PURE__ */ u(
|
|
3730
3736
|
P,
|
|
3731
3737
|
{
|
|
3732
3738
|
className: "flex text-sm gap-x-2",
|
|
@@ -3753,24 +3759,24 @@ const bo = ({
|
|
|
3753
3759
|
}
|
|
3754
3760
|
),
|
|
3755
3761
|
l && /* @__PURE__ */ r(Yr, { page: l, onClose: () => o(null) }),
|
|
3756
|
-
|
|
3762
|
+
c && /* @__PURE__ */ r(
|
|
3757
3763
|
Gs,
|
|
3758
3764
|
{
|
|
3759
|
-
page:
|
|
3765
|
+
page: c,
|
|
3760
3766
|
onClose: () => d(null)
|
|
3761
3767
|
}
|
|
3762
3768
|
),
|
|
3763
|
-
|
|
3769
|
+
E && /* @__PURE__ */ r(
|
|
3764
3770
|
Ao,
|
|
3765
3771
|
{
|
|
3766
|
-
page:
|
|
3767
|
-
onClose: () =>
|
|
3772
|
+
page: E,
|
|
3773
|
+
onClose: () => p(null)
|
|
3768
3774
|
}
|
|
3769
3775
|
),
|
|
3770
|
-
|
|
3776
|
+
y && /* @__PURE__ */ r(
|
|
3771
3777
|
xo,
|
|
3772
3778
|
{
|
|
3773
|
-
page:
|
|
3779
|
+
page: y,
|
|
3774
3780
|
onClose: () => w(null)
|
|
3775
3781
|
}
|
|
3776
3782
|
),
|
|
@@ -3791,12 +3797,12 @@ const bo = ({
|
|
|
3791
3797
|
setAddEditPage: i,
|
|
3792
3798
|
setMarkAsTemplate: l,
|
|
3793
3799
|
setUnmarkAsTemplate: o,
|
|
3794
|
-
setDuplicatePage:
|
|
3800
|
+
setDuplicatePage: c,
|
|
3795
3801
|
parentSlug: d,
|
|
3796
3802
|
level: h = 0
|
|
3797
3803
|
}) => {
|
|
3798
|
-
const f = !
|
|
3799
|
-
return /* @__PURE__ */
|
|
3804
|
+
const f = !le(e == null ? void 0 : e.children);
|
|
3805
|
+
return /* @__PURE__ */ u("div", { className: "border-0", children: [
|
|
3800
3806
|
/* @__PURE__ */ r(
|
|
3801
3807
|
To,
|
|
3802
3808
|
{
|
|
@@ -3806,16 +3812,16 @@ const bo = ({
|
|
|
3806
3812
|
setAddEditPage: i,
|
|
3807
3813
|
setMarkAsTemplate: l,
|
|
3808
3814
|
setUnmarkAsTemplate: o,
|
|
3809
|
-
setDuplicatePage:
|
|
3815
|
+
setDuplicatePage: c,
|
|
3810
3816
|
active: t === e.id,
|
|
3811
3817
|
page: e,
|
|
3812
3818
|
parentSlug: d
|
|
3813
3819
|
}
|
|
3814
3820
|
),
|
|
3815
|
-
f && /* @__PURE__ */ r("div", { className: "pt-2 pl-6 bg-white", children: je(W(e, "children", []), (
|
|
3821
|
+
f && /* @__PURE__ */ r("div", { className: "pt-2 pl-6 bg-white", children: je(W(e, "children", []), (E) => /* @__PURE__ */ r(
|
|
3816
3822
|
Jr,
|
|
3817
3823
|
{
|
|
3818
|
-
item:
|
|
3824
|
+
item: E,
|
|
3819
3825
|
currentPage: t,
|
|
3820
3826
|
close: n,
|
|
3821
3827
|
setUnpublishPage: s,
|
|
@@ -3823,20 +3829,20 @@ const bo = ({
|
|
|
3823
3829
|
setAddEditPage: i,
|
|
3824
3830
|
setMarkAsTemplate: l,
|
|
3825
3831
|
setUnmarkAsTemplate: o,
|
|
3826
|
-
setDuplicatePage:
|
|
3832
|
+
setDuplicatePage: c,
|
|
3827
3833
|
parentSlug: e.slug,
|
|
3828
3834
|
level: h + 1
|
|
3829
3835
|
},
|
|
3830
|
-
|
|
3836
|
+
E.id || `child-${h}-${E.key}`
|
|
3831
3837
|
)) })
|
|
3832
3838
|
] }, e.id || `level-${h}-${e.key}`);
|
|
3833
3839
|
}, Po = () => {
|
|
3834
3840
|
const e = ot("logo", null);
|
|
3835
3841
|
return e ? /* @__PURE__ */ r("div", { className: "w-full max-h-9 overflow-hidden pr-2", children: ur.createElement(e, {}) }) : null;
|
|
3836
3842
|
}, _o = () => {
|
|
3837
|
-
const [e] = Me(), t = e.get("page"), { data: n, isFetching: s } = Fe(), [a, i] = T(!1), { savePage: l } = ms(), o = !!t && !
|
|
3838
|
-
return /* @__PURE__ */
|
|
3839
|
-
/* @__PURE__ */
|
|
3843
|
+
const [e] = Me(), t = e.get("page"), { data: n, isFetching: s } = Fe(), [a, i] = T(!1), { savePage: l } = ms(), o = !!t && !le(n), c = !t || !s && le(n) || a;
|
|
3844
|
+
return /* @__PURE__ */ u(be, { children: [
|
|
3845
|
+
/* @__PURE__ */ u(
|
|
3840
3846
|
P,
|
|
3841
3847
|
{
|
|
3842
3848
|
variant: "secondary",
|
|
@@ -3846,7 +3852,7 @@ const bo = ({
|
|
|
3846
3852
|
},
|
|
3847
3853
|
children: [
|
|
3848
3854
|
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(tl, { className: "h-4 w-4" }) }),
|
|
3849
|
-
/* @__PURE__ */
|
|
3855
|
+
/* @__PURE__ */ u("span", { className: "truncate leading-tight flex items-center max-w-[200px]", children: [
|
|
3850
3856
|
/* @__PURE__ */ r("span", { className: "text-slate-600 pr-1 font-light", children: "Editing:" }),
|
|
3851
3857
|
s ? /* @__PURE__ */ r(Ur, { className: "h-4 w-4 animate-spin text-slate-400 ml-2" }) : $t(W(n, "name")) ?? ""
|
|
3852
3858
|
] })
|
|
@@ -3857,19 +3863,19 @@ const bo = ({
|
|
|
3857
3863
|
/* @__PURE__ */ r(
|
|
3858
3864
|
xr,
|
|
3859
3865
|
{
|
|
3860
|
-
open:
|
|
3866
|
+
open: c,
|
|
3861
3867
|
onOpenChange: (d) => !d && o && i(!1),
|
|
3862
|
-
children: /* @__PURE__ */
|
|
3868
|
+
children: /* @__PURE__ */ u(
|
|
3863
3869
|
Tr,
|
|
3864
3870
|
{
|
|
3865
3871
|
side: "left",
|
|
3866
3872
|
"aria-describedby": "pages-manager-description",
|
|
3867
3873
|
className: `!max-w-screen-md z-50 border-border w-full ${o ? "" : "sheet-hide-close-btn"}`,
|
|
3868
3874
|
children: [
|
|
3869
|
-
/* @__PURE__ */
|
|
3870
|
-
/* @__PURE__ */
|
|
3875
|
+
/* @__PURE__ */ u(Cr, { className: "mb-3", children: [
|
|
3876
|
+
/* @__PURE__ */ u(Pr, { className: "text-sm flex items-center gap-2 font-semibold", children: [
|
|
3871
3877
|
/* @__PURE__ */ r("div", { className: "p-2 rounded-md bg-primary text-primary-foreground", children: /* @__PURE__ */ r(fn, { className: "w-6 h-6" }) }),
|
|
3872
|
-
/* @__PURE__ */
|
|
3878
|
+
/* @__PURE__ */ u("div", { className: "flex flex-col", children: [
|
|
3873
3879
|
/* @__PURE__ */ r("span", { className: "text-sm font-semibold", children: "Pages" }),
|
|
3874
3880
|
/* @__PURE__ */ r(
|
|
3875
3881
|
"span",
|
|
@@ -3891,19 +3897,19 @@ const bo = ({
|
|
|
3891
3897
|
)
|
|
3892
3898
|
] });
|
|
3893
3899
|
}, Io = () => {
|
|
3894
|
-
const { fallbackLang: e, languages: t, selectedLang: n, setSelectedLang: s } = ft(), a =
|
|
3900
|
+
const { fallbackLang: e, languages: t, selectedLang: n, setSelectedLang: s } = ft(), a = le(n) ? e : n, [, i] = Me();
|
|
3895
3901
|
Ne(() => {
|
|
3896
|
-
const
|
|
3897
|
-
w && (t.includes(w) ? s(w) : (
|
|
3902
|
+
const y = new URLSearchParams(window.location.search), w = y.get("lang");
|
|
3903
|
+
w && (t.includes(w) ? s(w) : (y.delete("lang"), i(y), s("")));
|
|
3898
3904
|
}, [t, i, s]);
|
|
3899
|
-
const [l, o] = T(null), { data:
|
|
3900
|
-
const
|
|
3905
|
+
const [l, o] = T(null), { data: c } = Fe(), { data: d } = pt(), { data: h, isFetching: f } = gn(), E = Q(() => {
|
|
3906
|
+
const y = _n(
|
|
3901
3907
|
je(W(d, "languages"), (w) => {
|
|
3902
|
-
const
|
|
3908
|
+
const v = Ee(h, { lang: w });
|
|
3903
3909
|
return {
|
|
3904
3910
|
key: w,
|
|
3905
3911
|
value: W(Ye, w, w),
|
|
3906
|
-
isLangPageAdded: !!
|
|
3912
|
+
isLangPageAdded: !!v
|
|
3907
3913
|
};
|
|
3908
3914
|
})
|
|
3909
3915
|
).filter(Boolean);
|
|
@@ -3913,36 +3919,36 @@ const bo = ({
|
|
|
3913
3919
|
value: W(Ye, e),
|
|
3914
3920
|
isLangPageAdded: !0
|
|
3915
3921
|
},
|
|
3916
|
-
...
|
|
3922
|
+
...y
|
|
3917
3923
|
];
|
|
3918
|
-
}, [e, h, d]),
|
|
3919
|
-
s(
|
|
3924
|
+
}, [e, h, d]), p = (y) => {
|
|
3925
|
+
s(y);
|
|
3920
3926
|
const w = new URLSearchParams(window.location.search);
|
|
3921
|
-
|
|
3922
|
-
const
|
|
3923
|
-
window.history.pushState({}, "",
|
|
3927
|
+
y === e ? w.delete("lang") : w.set("lang", y);
|
|
3928
|
+
const v = w.toString(), I = `${window.location.pathname}${v ? `?${v}` : ""}`;
|
|
3929
|
+
window.history.pushState({}, "", I), i(w), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
3924
3930
|
};
|
|
3925
|
-
return
|
|
3926
|
-
/* @__PURE__ */
|
|
3927
|
-
/* @__PURE__ */ r(hn, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */
|
|
3931
|
+
return le(t) || f ? null : /* @__PURE__ */ u(be, { children: [
|
|
3932
|
+
/* @__PURE__ */ u(dn, { children: [
|
|
3933
|
+
/* @__PURE__ */ r(hn, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ u(P, { variant: "ghost", size: "sm", className: "gap-2", children: [
|
|
3928
3934
|
/* @__PURE__ */ r(nl, { className: "w-4 h-4" }),
|
|
3929
3935
|
W(Ye, a, a),
|
|
3930
3936
|
/* @__PURE__ */ r(Or, { className: "w-4 h-4" })
|
|
3931
3937
|
] }) }),
|
|
3932
|
-
/* @__PURE__ */
|
|
3938
|
+
/* @__PURE__ */ u(mn, { className: "border-border space-y-1", children: [
|
|
3933
3939
|
je(
|
|
3934
|
-
|
|
3935
|
-
(
|
|
3940
|
+
E.filter((y) => y.isLangPageAdded),
|
|
3941
|
+
(y) => /* @__PURE__ */ u(
|
|
3936
3942
|
Ge,
|
|
3937
3943
|
{
|
|
3938
3944
|
className: mi(
|
|
3939
3945
|
"flex cursor-pointer items-center justify-between text-xs font-medium text-gray-800",
|
|
3940
|
-
|
|
3946
|
+
y.key === a && "!bg-gray-200 text-gray-700"
|
|
3941
3947
|
),
|
|
3942
|
-
onClick: () => y
|
|
3948
|
+
onClick: () => p(y.key),
|
|
3943
3949
|
children: [
|
|
3944
|
-
/* @__PURE__ */ r("div", { className: "text-slate-600", children:
|
|
3945
|
-
|
|
3950
|
+
/* @__PURE__ */ r("div", { className: "text-slate-600", children: y.value }),
|
|
3951
|
+
y.key === e && /* @__PURE__ */ u(
|
|
3946
3952
|
"small",
|
|
3947
3953
|
{
|
|
3948
3954
|
className: "text-[9px] flex items-center gap-x-1 text-orange-500 leading-none",
|
|
@@ -3954,20 +3960,20 @@ const bo = ({
|
|
|
3954
3960
|
)
|
|
3955
3961
|
]
|
|
3956
3962
|
},
|
|
3957
|
-
|
|
3963
|
+
y.value
|
|
3958
3964
|
)
|
|
3959
3965
|
),
|
|
3960
|
-
!
|
|
3966
|
+
!le(E.filter((y) => !y.isLangPageAdded)) && /* @__PURE__ */ u(be, { children: [
|
|
3961
3967
|
/* @__PURE__ */ r(_i, {}),
|
|
3962
|
-
/* @__PURE__ */
|
|
3968
|
+
/* @__PURE__ */ u(
|
|
3963
3969
|
P,
|
|
3964
3970
|
{
|
|
3965
3971
|
size: "sm",
|
|
3966
3972
|
variant: "ghost",
|
|
3967
3973
|
onClick: () => {
|
|
3968
3974
|
o({
|
|
3969
|
-
name:
|
|
3970
|
-
pageType:
|
|
3975
|
+
name: c == null ? void 0 : c.name,
|
|
3976
|
+
pageType: c == null ? void 0 : c.pageType,
|
|
3971
3977
|
lang: "",
|
|
3972
3978
|
slug: "",
|
|
3973
3979
|
edit: !1
|
|
@@ -3994,7 +4000,7 @@ const bo = ({
|
|
|
3994
4000
|
] });
|
|
3995
4001
|
};
|
|
3996
4002
|
function ko() {
|
|
3997
|
-
return /* @__PURE__ */
|
|
4003
|
+
return /* @__PURE__ */ u("div", { className: "flex relative z-10 items-center justify-end gap-1", children: [
|
|
3998
4004
|
/* @__PURE__ */ r(Po, {}),
|
|
3999
4005
|
/* @__PURE__ */ r(_o, {}),
|
|
4000
4006
|
/* @__PURE__ */ r(Io, {})
|
|
@@ -4045,21 +4051,21 @@ const Do = () => {
|
|
|
4045
4051
|
};
|
|
4046
4052
|
function Uo() {
|
|
4047
4053
|
const { data: e } = Fe(), { saveState: t } = ms(), [n] = Is();
|
|
4048
|
-
return e ? /* @__PURE__ */ r("div", { className: "flex items-start gap-3 rounded-md border p-2 hover:bg-accent/50 bg-primary/5 mb-4", children: /* @__PURE__ */
|
|
4054
|
+
return e ? /* @__PURE__ */ r("div", { className: "flex items-start gap-3 rounded-md border p-2 hover:bg-accent/50 bg-primary/5 mb-4", children: /* @__PURE__ */ u("div", { className: "flex-1 space-y-1", children: [
|
|
4049
4055
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r("p", { className: "text-sm flex items-center gap-1 font-medium leading-none", children: /* @__PURE__ */ r("span", { className: "font-bold", children: "Currently editing" }) }) }),
|
|
4050
|
-
/* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: !
|
|
4056
|
+
/* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: !le(n.lastSaved) && /* @__PURE__ */ u("span", { children: [
|
|
4051
4057
|
"Last updated",
|
|
4052
4058
|
" ",
|
|
4053
4059
|
El(new Date(n.lastSaved), {
|
|
4054
4060
|
addSuffix: !0
|
|
4055
4061
|
})
|
|
4056
4062
|
] }) }),
|
|
4057
|
-
/* @__PURE__ */
|
|
4058
|
-
/* @__PURE__ */
|
|
4063
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2 pt-0.5", children: [
|
|
4064
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-1 rounded-full bg-amber-500/10 px-1.5 py-0.5 text-xs text-amber-600", children: [
|
|
4059
4065
|
/* @__PURE__ */ r(ll, { className: "h-3 w-3" }),
|
|
4060
4066
|
/* @__PURE__ */ r("span", { children: "Draft" })
|
|
4061
4067
|
] }),
|
|
4062
|
-
t === "UNSAVED" ? /* @__PURE__ */
|
|
4068
|
+
t === "UNSAVED" ? /* @__PURE__ */ u("div", { className: "flex items-center gap-1 rounded-full bg-red-500/10 px-1.5 py-0.5 text-xs text-red-600", children: [
|
|
4063
4069
|
/* @__PURE__ */ r(Br, { className: "h-3 w-3" }),
|
|
4064
4070
|
/* @__PURE__ */ r("span", { children: " Unsaved changes" })
|
|
4065
4071
|
] }) : null
|
|
@@ -4067,17 +4073,17 @@ function Uo() {
|
|
|
4067
4073
|
] }) }) : null;
|
|
4068
4074
|
}
|
|
4069
4075
|
function Oo() {
|
|
4070
|
-
const [e, t] = ge.useState(!1), [n, s] = ge.useState(null), [a, i] = ge.useState(!1), [l, o] = ge.useState(!1), { data:
|
|
4076
|
+
const [e, t] = ge.useState(!1), [n, s] = ge.useState(null), [a, i] = ge.useState(!1), [l, o] = ge.useState(!1), { data: c } = Fe(), {
|
|
4071
4077
|
data: d,
|
|
4072
4078
|
isFetching: h,
|
|
4073
4079
|
error: f,
|
|
4074
|
-
refetch:
|
|
4075
|
-
} = Lo(
|
|
4080
|
+
refetch: E
|
|
4081
|
+
} = Lo(c == null ? void 0 : c.id), { mutate: p, isPending: y } = Do(), { mutate: w, isPending: v } = Go(), I = Ae(), b = (O) => {
|
|
4076
4082
|
n && w(
|
|
4077
4083
|
{ revisionId: n.uid, discardCurrent: O },
|
|
4078
4084
|
{
|
|
4079
4085
|
onSuccess: () => {
|
|
4080
|
-
i(!1), s(null),
|
|
4086
|
+
i(!1), s(null), I.invalidateQueries({
|
|
4081
4087
|
queryKey: [j, _.GET_DRAFT_PAGE]
|
|
4082
4088
|
});
|
|
4083
4089
|
}
|
|
@@ -4088,40 +4094,40 @@ function Oo() {
|
|
|
4088
4094
|
}, S = (O) => {
|
|
4089
4095
|
s(O), o(!0);
|
|
4090
4096
|
}, L = () => {
|
|
4091
|
-
n &&
|
|
4097
|
+
n && p(n.uid, {
|
|
4092
4098
|
onSuccess: () => {
|
|
4093
4099
|
o(!1), s(null);
|
|
4094
4100
|
}
|
|
4095
4101
|
});
|
|
4096
4102
|
};
|
|
4097
4103
|
return Ne(() => {
|
|
4098
|
-
e &&
|
|
4099
|
-
}, [e,
|
|
4100
|
-
/* @__PURE__ */ r(_r, { children: /* @__PURE__ */
|
|
4101
|
-
/* @__PURE__ */
|
|
4102
|
-
/* @__PURE__ */ r(Ii, { asChild: !0, children: /* @__PURE__ */ r(Ss, { asChild: !0, children: /* @__PURE__ */
|
|
4103
|
-
/* @__PURE__ */
|
|
4104
|
+
e && E();
|
|
4105
|
+
}, [e, E]), /* @__PURE__ */ u(be, { children: [
|
|
4106
|
+
/* @__PURE__ */ r(_r, { children: /* @__PURE__ */ u(bs, { children: [
|
|
4107
|
+
/* @__PURE__ */ u(xr, { open: e, onOpenChange: t, children: [
|
|
4108
|
+
/* @__PURE__ */ r(Ii, { asChild: !0, children: /* @__PURE__ */ r(Ss, { asChild: !0, children: /* @__PURE__ */ u("span", { className: "flex items-center gap-2", children: [
|
|
4109
|
+
/* @__PURE__ */ u(P, { variant: "ghost", size: "icon", className: "h-8 w-8", children: [
|
|
4104
4110
|
/* @__PURE__ */ r(Hs, { className: "h-4 w-4" }),
|
|
4105
4111
|
/* @__PURE__ */ r("span", { className: "sr-only", children: "View revision history" })
|
|
4106
4112
|
] }),
|
|
4107
4113
|
/* @__PURE__ */ r("div", { className: "w-px h-4 bg-gray-200 dark:bg-gray-700" })
|
|
4108
4114
|
] }) }) }),
|
|
4109
|
-
/* @__PURE__ */
|
|
4110
|
-
/* @__PURE__ */
|
|
4111
|
-
/* @__PURE__ */
|
|
4115
|
+
/* @__PURE__ */ u(Tr, { className: "sm:max-w-md p-4", children: [
|
|
4116
|
+
/* @__PURE__ */ u(Cr, { className: "pb-2", children: [
|
|
4117
|
+
/* @__PURE__ */ u(Pr, { className: "flex items-center gap-2", children: [
|
|
4112
4118
|
/* @__PURE__ */ r(Hs, { className: "h-5 w-5" }),
|
|
4113
4119
|
"Revision History"
|
|
4114
4120
|
] }),
|
|
4115
|
-
(
|
|
4121
|
+
(c == null ? void 0 : c.createdAt) && /* @__PURE__ */ u("p", { className: "text-xs text-muted-foreground mt-1", children: [
|
|
4116
4122
|
"Page created on",
|
|
4117
4123
|
" ",
|
|
4118
4124
|
Fn(
|
|
4119
|
-
new Date(
|
|
4125
|
+
new Date(c.createdAt),
|
|
4120
4126
|
"MMM d, yyyy 'at' h:mm a"
|
|
4121
4127
|
)
|
|
4122
4128
|
] })
|
|
4123
4129
|
] }),
|
|
4124
|
-
/* @__PURE__ */ r(ki, { className: "h-[calc(100vh-6rem)] pr-2", children: h ? /* @__PURE__ */ r(Ro, {}) : f ? /* @__PURE__ */ r("div", { className: "p-4 text-center text-sm text-muted-foreground", children: "Failed to load revisions. Please try again." }) : /* @__PURE__ */
|
|
4130
|
+
/* @__PURE__ */ r(ki, { className: "h-[calc(100vh-6rem)] pr-2", children: h ? /* @__PURE__ */ r(Ro, {}) : f ? /* @__PURE__ */ r("div", { className: "p-4 text-center text-sm text-muted-foreground", children: "Failed to load revisions. Please try again." }) : /* @__PURE__ */ u("div", { className: "mt-2 space-y-2", children: [
|
|
4125
4131
|
/* @__PURE__ */ r(Uo, {}),
|
|
4126
4132
|
d == null ? void 0 : d.map((O) => /* @__PURE__ */ r(
|
|
4127
4133
|
Bo,
|
|
@@ -4145,7 +4151,7 @@ function Oo() {
|
|
|
4145
4151
|
onOpenChange: i,
|
|
4146
4152
|
revision: n,
|
|
4147
4153
|
onRestore: b,
|
|
4148
|
-
isRestoring:
|
|
4154
|
+
isRestoring: v
|
|
4149
4155
|
}
|
|
4150
4156
|
),
|
|
4151
4157
|
/* @__PURE__ */ r(
|
|
@@ -4155,14 +4161,14 @@ function Oo() {
|
|
|
4155
4161
|
onOpenChange: o,
|
|
4156
4162
|
revision: n,
|
|
4157
4163
|
onDelete: L,
|
|
4158
|
-
isDeleting:
|
|
4164
|
+
isDeleting: y
|
|
4159
4165
|
}
|
|
4160
4166
|
)
|
|
4161
4167
|
] });
|
|
4162
4168
|
}
|
|
4163
4169
|
function Ro() {
|
|
4164
|
-
return /* @__PURE__ */ r("div", { className: "space-y-2 mt-2", children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */
|
|
4165
|
-
/* @__PURE__ */
|
|
4170
|
+
return /* @__PURE__ */ r("div", { className: "space-y-2 mt-2", children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ u("div", { className: "flex items-start gap-3 rounded-md border p-2", children: [
|
|
4171
|
+
/* @__PURE__ */ u("div", { className: "flex-1 space-y-1", children: [
|
|
4166
4172
|
/* @__PURE__ */ r(bn, { className: "h-4 w-3/4" }),
|
|
4167
4173
|
/* @__PURE__ */ r(bn, { className: "h-3 w-1/2" }),
|
|
4168
4174
|
/* @__PURE__ */ r(bn, { className: "h-5 w-20 mt-1" })
|
|
@@ -4177,14 +4183,14 @@ function Bo({
|
|
|
4177
4183
|
onDelete: s
|
|
4178
4184
|
}) {
|
|
4179
4185
|
const { data: a } = pn(e.currentEditor), i = (a == null ? void 0 : a.name) || "Unknown";
|
|
4180
|
-
return /* @__PURE__ */
|
|
4181
|
-
/* @__PURE__ */
|
|
4182
|
-
/* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: /* @__PURE__ */
|
|
4186
|
+
return /* @__PURE__ */ u("div", { className: "flex items-start gap-3 rounded-md border p-2 hover:bg-accent/50", children: [
|
|
4187
|
+
/* @__PURE__ */ u("div", { className: "flex-1 space-y-1", children: [
|
|
4188
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ u("p", { className: "text-sm flex items-center gap-1 font-medium leading-none", children: [
|
|
4183
4189
|
e.type === "published" ? "Published" : "Draft",
|
|
4184
4190
|
" by ",
|
|
4185
4191
|
/* @__PURE__ */ r("span", { className: "font-bold", children: i }),
|
|
4186
|
-
t && /* @__PURE__ */
|
|
4187
|
-
/* @__PURE__ */
|
|
4192
|
+
t && /* @__PURE__ */ u("span", { className: "ml-2 flex items-center gap-1 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary", children: [
|
|
4193
|
+
/* @__PURE__ */ u("span", { className: "mr-1 relative flex h-2 w-2", children: [
|
|
4188
4194
|
/* @__PURE__ */ r("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75" }),
|
|
4189
4195
|
/* @__PURE__ */ r("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-green-500" })
|
|
4190
4196
|
] }),
|
|
@@ -4192,10 +4198,10 @@ function Bo({
|
|
|
4192
4198
|
] })
|
|
4193
4199
|
] }) }),
|
|
4194
4200
|
/* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: /* @__PURE__ */ r("span", { children: Fn(e.createdAt, "MMM d, h:mm a") }) }),
|
|
4195
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 pt-0.5", children: e.type === "published" ? /* @__PURE__ */
|
|
4201
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 pt-0.5", children: e.type === "published" ? /* @__PURE__ */ u("div", { className: "flex items-center gap-1 rounded-full bg-green-500/10 px-1.5 py-0.5 text-xs text-green-600", children: [
|
|
4196
4202
|
/* @__PURE__ */ r(rl, { className: "h-3 w-3" }),
|
|
4197
4203
|
/* @__PURE__ */ r("span", { children: "Published" })
|
|
4198
|
-
] }) : /* @__PURE__ */
|
|
4204
|
+
] }) : /* @__PURE__ */ u("div", { className: "flex items-center gap-1 rounded-full bg-amber-500/10 px-1.5 py-0.5 text-xs text-amber-600", children: [
|
|
4199
4205
|
/* @__PURE__ */ r(al, { className: "h-3 w-3" }),
|
|
4200
4206
|
/* @__PURE__ */ r("span", { children: "Draft" })
|
|
4201
4207
|
] }) })
|
|
@@ -4224,19 +4230,19 @@ function Mo({
|
|
|
4224
4230
|
onRestore: t,
|
|
4225
4231
|
onDelete: n
|
|
4226
4232
|
}) {
|
|
4227
|
-
return /* @__PURE__ */
|
|
4228
|
-
/* @__PURE__ */ r(hn, { asChild: !0, children: /* @__PURE__ */
|
|
4233
|
+
return /* @__PURE__ */ u(dn, { children: [
|
|
4234
|
+
/* @__PURE__ */ r(hn, { asChild: !0, children: /* @__PURE__ */ u(P, { variant: "ghost", size: "icon", className: "h-7 w-7 -mr-1", children: [
|
|
4229
4235
|
/* @__PURE__ */ r(xs, { className: "h-4 w-4" }),
|
|
4230
4236
|
/* @__PURE__ */ r("span", { className: "sr-only", children: "More options" })
|
|
4231
4237
|
] }) }),
|
|
4232
|
-
/* @__PURE__ */
|
|
4233
|
-
/* @__PURE__ */ r(Ve, { permission: fe.RESTORE_REVISION, children: /* @__PURE__ */
|
|
4238
|
+
/* @__PURE__ */ u(mn, { align: "end", className: "text-xs", children: [
|
|
4239
|
+
/* @__PURE__ */ r(Ve, { permission: fe.RESTORE_REVISION, children: /* @__PURE__ */ u(Ge, { onClick: t, className: "cursor-pointer", children: [
|
|
4234
4240
|
/* @__PURE__ */ r(Rr, { className: "mr-2 h-4 w-4" }),
|
|
4235
4241
|
/* @__PURE__ */ r("span", { children: "Restore this version" })
|
|
4236
4242
|
] }) }),
|
|
4237
|
-
/* @__PURE__ */ r(Ve, { permission: fe.DELETE_REVISION, children: e.uid !== "current" && /* @__PURE__ */
|
|
4243
|
+
/* @__PURE__ */ r(Ve, { permission: fe.DELETE_REVISION, children: e.uid !== "current" && /* @__PURE__ */ u(be, { children: [
|
|
4238
4244
|
/* @__PURE__ */ r(Li, {}),
|
|
4239
|
-
/* @__PURE__ */
|
|
4245
|
+
/* @__PURE__ */ u(
|
|
4240
4246
|
Ge,
|
|
4241
4247
|
{
|
|
4242
4248
|
onClick: n,
|
|
@@ -4266,10 +4272,10 @@ function Fo({
|
|
|
4266
4272
|
onOpenChange: (o) => {
|
|
4267
4273
|
a || t(o);
|
|
4268
4274
|
},
|
|
4269
|
-
children: /* @__PURE__ */
|
|
4270
|
-
/* @__PURE__ */
|
|
4275
|
+
children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-md", children: [
|
|
4276
|
+
/* @__PURE__ */ u($e, { children: [
|
|
4271
4277
|
/* @__PURE__ */ r(ze, { children: "Restore Revision" }),
|
|
4272
|
-
/* @__PURE__ */
|
|
4278
|
+
/* @__PURE__ */ u(Qe, { children: [
|
|
4273
4279
|
"You are about to restore to revision ",
|
|
4274
4280
|
n.uid.substring(0, 8),
|
|
4275
4281
|
" ",
|
|
@@ -4281,7 +4287,7 @@ function Fo({
|
|
|
4281
4287
|
] })
|
|
4282
4288
|
] }),
|
|
4283
4289
|
/* @__PURE__ */ r("div", { className: "py-2", children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: "How would you like to handle your current edits?" }) }),
|
|
4284
|
-
/* @__PURE__ */
|
|
4290
|
+
/* @__PURE__ */ u(nt, { className: "flex flex-col sm:flex-row gap-2", children: [
|
|
4285
4291
|
/* @__PURE__ */ r(
|
|
4286
4292
|
P,
|
|
4287
4293
|
{
|
|
@@ -4289,10 +4295,10 @@ function Fo({
|
|
|
4289
4295
|
className: "sm:flex-1",
|
|
4290
4296
|
onClick: () => s(!1),
|
|
4291
4297
|
disabled: a,
|
|
4292
|
-
children: a ? /* @__PURE__ */
|
|
4298
|
+
children: a ? /* @__PURE__ */ u(be, { children: [
|
|
4293
4299
|
/* @__PURE__ */ r("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
4294
4300
|
"Saving as draft..."
|
|
4295
|
-
] }) : /* @__PURE__ */
|
|
4301
|
+
] }) : /* @__PURE__ */ u(be, { children: [
|
|
4296
4302
|
/* @__PURE__ */ r(il, { className: "mr-2 h-4 w-4" }),
|
|
4297
4303
|
"Save as draft"
|
|
4298
4304
|
] })
|
|
@@ -4305,10 +4311,10 @@ function Fo({
|
|
|
4305
4311
|
className: "sm:flex-1",
|
|
4306
4312
|
onClick: () => s(!0),
|
|
4307
4313
|
disabled: a,
|
|
4308
|
-
children: a ? /* @__PURE__ */
|
|
4314
|
+
children: a ? /* @__PURE__ */ u(be, { children: [
|
|
4309
4315
|
/* @__PURE__ */ r("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
4310
4316
|
"Discarding current..."
|
|
4311
|
-
] }) : /* @__PURE__ */
|
|
4317
|
+
] }) : /* @__PURE__ */ u(be, { children: [
|
|
4312
4318
|
/* @__PURE__ */ r(Rr, { className: "mr-2 h-4 w-4" }),
|
|
4313
4319
|
"Discard current"
|
|
4314
4320
|
] })
|
|
@@ -4334,10 +4340,10 @@ function qo({
|
|
|
4334
4340
|
onOpenChange: (o) => {
|
|
4335
4341
|
a || t(o);
|
|
4336
4342
|
},
|
|
4337
|
-
children: /* @__PURE__ */
|
|
4338
|
-
/* @__PURE__ */
|
|
4343
|
+
children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-md", children: [
|
|
4344
|
+
/* @__PURE__ */ u($e, { children: [
|
|
4339
4345
|
/* @__PURE__ */ r(ze, { children: "Delete Revision" }),
|
|
4340
|
-
/* @__PURE__ */
|
|
4346
|
+
/* @__PURE__ */ u(Qe, { children: [
|
|
4341
4347
|
"You are about to delete revision ",
|
|
4342
4348
|
n.uid.substring(0, 8),
|
|
4343
4349
|
" from",
|
|
@@ -4349,7 +4355,7 @@ function qo({
|
|
|
4349
4355
|
] })
|
|
4350
4356
|
] }),
|
|
4351
4357
|
/* @__PURE__ */ r("div", { className: "py-2", children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: "This action cannot be undone. Are you sure you want to proceed?" }) }),
|
|
4352
|
-
/* @__PURE__ */
|
|
4358
|
+
/* @__PURE__ */ u(nt, { className: "flex flex-col sm:flex-row gap-2", children: [
|
|
4353
4359
|
/* @__PURE__ */ r(
|
|
4354
4360
|
P,
|
|
4355
4361
|
{
|
|
@@ -4367,10 +4373,10 @@ function qo({
|
|
|
4367
4373
|
className: "sm:flex-1",
|
|
4368
4374
|
onClick: s,
|
|
4369
4375
|
disabled: a,
|
|
4370
|
-
children: a ? /* @__PURE__ */
|
|
4376
|
+
children: a ? /* @__PURE__ */ u(be, { children: [
|
|
4371
4377
|
/* @__PURE__ */ r("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
4372
4378
|
"Deleting..."
|
|
4373
|
-
] }) : /* @__PURE__ */
|
|
4379
|
+
] }) : /* @__PURE__ */ u(be, { children: [
|
|
4374
4380
|
/* @__PURE__ */ r(Ts, { className: "mr-2 h-4 w-4" }),
|
|
4375
4381
|
"Delete Revision"
|
|
4376
4382
|
] })
|
|
@@ -4401,33 +4407,33 @@ function Ho({
|
|
|
4401
4407
|
return (L = Ee(l, { key: S })) == null ? void 0 : L.hasSlug;
|
|
4402
4408
|
},
|
|
4403
4409
|
[l]
|
|
4404
|
-
),
|
|
4410
|
+
), c = Q(
|
|
4405
4411
|
() => Se(l, (S) => !o(S.key)).map(
|
|
4406
4412
|
(S) => S.key
|
|
4407
4413
|
),
|
|
4408
4414
|
[o, l]
|
|
4409
4415
|
), d = Q(
|
|
4410
|
-
() => Se(a, (S) => !
|
|
4411
|
-
[a,
|
|
4416
|
+
() => Se(a, (S) => !c.includes(S.pageType)),
|
|
4417
|
+
[a, c]
|
|
4412
4418
|
), h = Q(
|
|
4413
|
-
() => Se(a, (S) =>
|
|
4414
|
-
[a,
|
|
4419
|
+
() => Se(a, (S) => c.includes(S.pageType)),
|
|
4420
|
+
[a, c]
|
|
4415
4421
|
), f = Q(
|
|
4416
4422
|
() => Ee(a, { pageType: "theme", id: "THEME" }),
|
|
4417
4423
|
[a]
|
|
4418
|
-
), { mutate:
|
|
4424
|
+
), { mutate: E, isPending: p } = Ls();
|
|
4419
4425
|
Ne(() => {
|
|
4420
4426
|
const S = je(Se(a, { online: !0 }), "id");
|
|
4421
4427
|
f && S.push(f == null ? void 0 : f.id), s(S);
|
|
4422
4428
|
}, [a, f]);
|
|
4423
|
-
const
|
|
4429
|
+
const y = n.length === (a == null ? void 0 : a.length), w = (S) => {
|
|
4424
4430
|
s(
|
|
4425
4431
|
(L) => zt(L, S) ? Se(L, (O) => O !== S) : Qa(L, S)
|
|
4426
4432
|
);
|
|
4427
|
-
},
|
|
4428
|
-
s(
|
|
4429
|
-
},
|
|
4430
|
-
|
|
4433
|
+
}, v = () => {
|
|
4434
|
+
s(y ? [] : je(a, "id"));
|
|
4435
|
+
}, I = () => {
|
|
4436
|
+
E(
|
|
4431
4437
|
{ ids: Xa(n) },
|
|
4432
4438
|
{
|
|
4433
4439
|
onSuccess: () => {
|
|
@@ -4451,20 +4457,20 @@ function Ho({
|
|
|
4451
4457
|
], O = f ? [{ label: "Theme", top: "pt-6" }, f] : [];
|
|
4452
4458
|
return [...S, ...O, ...L];
|
|
4453
4459
|
}, [d, h, f]);
|
|
4454
|
-
return /* @__PURE__ */ r(He, { open: e, onOpenChange:
|
|
4455
|
-
} : t, children: /* @__PURE__ */
|
|
4456
|
-
/* @__PURE__ */
|
|
4460
|
+
return /* @__PURE__ */ r(He, { open: e, onOpenChange: p ? () => {
|
|
4461
|
+
} : t, children: /* @__PURE__ */ u(Ke, { className: "max-w-4xl max-h-[80%] flex flex-col", children: [
|
|
4462
|
+
/* @__PURE__ */ u($e, { children: [
|
|
4457
4463
|
/* @__PURE__ */ r(ze, { children: "Publish changes" }),
|
|
4458
4464
|
/* @__PURE__ */ r(Qe, { className: "text-xs", children: "Select the pages you want to publish. Click publish when you're done." })
|
|
4459
4465
|
] }),
|
|
4460
|
-
/* @__PURE__ */ r("div", { className: "relative h-full max-h-full -mx-4 overflow-y-auto no-scrollbar", children: i ? /* @__PURE__ */
|
|
4466
|
+
/* @__PURE__ */ r("div", { className: "relative h-full max-h-full -mx-4 overflow-y-auto no-scrollbar", children: i ? /* @__PURE__ */ u("div", { className: "px-1 space-y-2", children: [
|
|
4461
4467
|
/* @__PURE__ */ r("div", { className: "w-full h-6 mt-2 bg-gray-200 rounded animate-pulse" }),
|
|
4462
4468
|
/* @__PURE__ */ r("div", { className: "w-full h-6 bg-gray-200 rounded animate-pulse" }),
|
|
4463
4469
|
/* @__PURE__ */ r("div", { className: "w-full h-6 bg-gray-200 rounded animate-pulse" }),
|
|
4464
4470
|
/* @__PURE__ */ r("div", { className: "w-full h-6 bg-gray-200 rounded animate-pulse" })
|
|
4465
|
-
] }) : /* @__PURE__ */
|
|
4466
|
-
/* @__PURE__ */ r("thead", { className: "text-gray-700 border-b bg-gray-50 dark:bg-gray-700 dark:text-gray-400", children: /* @__PURE__ */
|
|
4467
|
-
/* @__PURE__ */
|
|
4471
|
+
] }) : /* @__PURE__ */ u("table", { className: "w-full text-xs text-left text-gray-500 rtl:text-right dark:text-gray-400", children: [
|
|
4472
|
+
/* @__PURE__ */ r("thead", { className: "text-gray-700 border-b bg-gray-50 dark:bg-gray-700 dark:text-gray-400", children: /* @__PURE__ */ u("tr", { children: [
|
|
4473
|
+
/* @__PURE__ */ u(
|
|
4468
4474
|
"th",
|
|
4469
4475
|
{
|
|
4470
4476
|
scope: "col",
|
|
@@ -4473,9 +4479,9 @@ function Ho({
|
|
|
4473
4479
|
/* @__PURE__ */ r(
|
|
4474
4480
|
"input",
|
|
4475
4481
|
{
|
|
4476
|
-
checked:
|
|
4482
|
+
checked: y,
|
|
4477
4483
|
onClick: (S) => {
|
|
4478
|
-
S.stopPropagation(),
|
|
4484
|
+
S.stopPropagation(), v();
|
|
4479
4485
|
},
|
|
4480
4486
|
type: "checkbox",
|
|
4481
4487
|
className: "mt-1 rounded cursor-pointer focus:outline-none focus:ring-0"
|
|
@@ -4491,7 +4497,7 @@ function Ho({
|
|
|
4491
4497
|
] }) }),
|
|
4492
4498
|
/* @__PURE__ */ r("tbody", { children: je(
|
|
4493
4499
|
C,
|
|
4494
|
-
(S) => S.label ? /* @__PURE__ */ r("tr", { children: /* @__PURE__ */
|
|
4500
|
+
(S) => S.label ? /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ u(
|
|
4495
4501
|
"td",
|
|
4496
4502
|
{
|
|
4497
4503
|
colSpan: 4,
|
|
@@ -4501,12 +4507,12 @@ function Ho({
|
|
|
4501
4507
|
/* @__PURE__ */ r("div", { className: "relative flex justify-start", children: /* @__PURE__ */ r("span", { className: "pr-2 bg-gray-50", children: S.label }) })
|
|
4502
4508
|
]
|
|
4503
4509
|
}
|
|
4504
|
-
) }, "separator") : /* @__PURE__ */
|
|
4510
|
+
) }, "separator") : /* @__PURE__ */ u(
|
|
4505
4511
|
"tr",
|
|
4506
4512
|
{
|
|
4507
4513
|
className: "border-b group hover:bg-gray-50 last:border-b-0",
|
|
4508
4514
|
children: [
|
|
4509
|
-
/* @__PURE__ */
|
|
4515
|
+
/* @__PURE__ */ u(
|
|
4510
4516
|
"td",
|
|
4511
4517
|
{
|
|
4512
4518
|
scope: "row",
|
|
@@ -4526,12 +4532,12 @@ function Ho({
|
|
|
4526
4532
|
" ",
|
|
4527
4533
|
o(S.pageType) ? /* @__PURE__ */ r(fn, { className: "w-4 h-4" }) : /* @__PURE__ */ r(ol, { className: "w-4 h-4" }),
|
|
4528
4534
|
S.name,
|
|
4529
|
-
S.slug && /* @__PURE__ */
|
|
4535
|
+
S.slug && /* @__PURE__ */ u("span", { className: "text-xs text-gray-500", children: [
|
|
4530
4536
|
"(",
|
|
4531
4537
|
S.slug,
|
|
4532
4538
|
")"
|
|
4533
4539
|
] }),
|
|
4534
|
-
S.currentEditor && /* @__PURE__ */ r("div", { className: "flex items-center gap-x-1", children: /* @__PURE__ */
|
|
4540
|
+
S.currentEditor && /* @__PURE__ */ r("div", { className: "flex items-center gap-x-1", children: /* @__PURE__ */ u("span", { className: "flex text-xs font-bold text-gray-500", children: [
|
|
4535
4541
|
" ",
|
|
4536
4542
|
"-",
|
|
4537
4543
|
" ",
|
|
@@ -4556,14 +4562,14 @@ function Ho({
|
|
|
4556
4562
|
)
|
|
4557
4563
|
) })
|
|
4558
4564
|
] }) }),
|
|
4559
|
-
/* @__PURE__ */
|
|
4560
|
-
/* @__PURE__ */ r(P, { disabled:
|
|
4565
|
+
/* @__PURE__ */ u(nt, { className: "mt-10", children: [
|
|
4566
|
+
/* @__PURE__ */ r(P, { disabled: p, variant: "outline", onClick: t, children: "Cancel" }),
|
|
4561
4567
|
/* @__PURE__ */ r(
|
|
4562
4568
|
P,
|
|
4563
4569
|
{
|
|
4564
|
-
disabled:
|
|
4565
|
-
onClick:
|
|
4566
|
-
children:
|
|
4570
|
+
disabled: p || i || le(a),
|
|
4571
|
+
onClick: I,
|
|
4572
|
+
children: p ? "Publishing..." : "Publish"
|
|
4567
4573
|
}
|
|
4568
4574
|
)
|
|
4569
4575
|
] })
|
|
@@ -4582,9 +4588,9 @@ const Ko = () => {
|
|
|
4582
4588
|
};
|
|
4583
4589
|
function $o({ onClose: e }) {
|
|
4584
4590
|
const { data: t, isFetching: n } = Ko(), { mutateAsync: s, isPending: a } = Ll(), i = ot("settingComponent", null), l = Za(async (o) => (await s({ data: o }), !0), 300);
|
|
4585
|
-
return i ? /* @__PURE__ */ r(He, { open: !0, onOpenChange: e, children: /* @__PURE__ */
|
|
4591
|
+
return i ? /* @__PURE__ */ r(He, { open: !0, onOpenChange: e, children: /* @__PURE__ */ u(Ke, { className: "w-full", children: [
|
|
4586
4592
|
/* @__PURE__ */ r($e, { children: /* @__PURE__ */ r(ze, { children: "Website Settings" }) }),
|
|
4587
|
-
n ? /* @__PURE__ */
|
|
4593
|
+
n ? /* @__PURE__ */ u("div", { className: "w-full space-y-3 py-4", children: [
|
|
4588
4594
|
/* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
4589
4595
|
/* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
4590
4596
|
/* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
@@ -4604,13 +4610,13 @@ function ea({
|
|
|
4604
4610
|
children: e,
|
|
4605
4611
|
content: t
|
|
4606
4612
|
}) {
|
|
4607
|
-
return /* @__PURE__ */ r(_r, { children: /* @__PURE__ */
|
|
4613
|
+
return /* @__PURE__ */ r(_r, { children: /* @__PURE__ */ u(bs, { children: [
|
|
4608
4614
|
/* @__PURE__ */ r(Ss, { asChild: !0, children: e }),
|
|
4609
4615
|
/* @__PURE__ */ r(ws, { side: "bottom", sideOffset: 10, children: /* @__PURE__ */ r("p", { children: t }) })
|
|
4610
4616
|
] }) });
|
|
4611
4617
|
}
|
|
4612
4618
|
const zo = () => {
|
|
4613
|
-
const { selectedLang: e } = ft(), t = ot("getPreviewUrl", async (h) => h), [n, s] = T(""), { data: a, isFetching: i } = Fe(), { data: l } = gn(), { data: o } = De(),
|
|
4619
|
+
const { selectedLang: e } = ft(), t = ot("getPreviewUrl", async (h) => h), [n, s] = T(""), { data: a, isFetching: i } = Fe(), { data: l } = gn(), { data: o } = De(), c = Q(
|
|
4614
4620
|
() => {
|
|
4615
4621
|
var h;
|
|
4616
4622
|
return (h = l == null ? void 0 : l.find((f) => (f == null ? void 0 : f.lang) === e)) == null ? void 0 : h.slug;
|
|
@@ -4625,20 +4631,20 @@ const zo = () => {
|
|
|
4625
4631
|
);
|
|
4626
4632
|
return Ne(() => {
|
|
4627
4633
|
(async () => {
|
|
4628
|
-
if (
|
|
4629
|
-
const h = await t(
|
|
4634
|
+
if (c && typeof t == "function") {
|
|
4635
|
+
const h = await t(c || "");
|
|
4630
4636
|
s(h);
|
|
4631
4637
|
} else
|
|
4632
4638
|
s("");
|
|
4633
4639
|
})();
|
|
4634
|
-
}, [t,
|
|
4640
|
+
}, [t, c]), !n || !d(a == null ? void 0 : a.pageType) || i ? null : /* @__PURE__ */ r(be, { children: /* @__PURE__ */ r("a", { href: n, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ u(P, { variant: "ghost", size: "sm", className: "gap-2", children: [
|
|
4635
4641
|
/* @__PURE__ */ r(Mr, { className: "w-4 h-4" }),
|
|
4636
4642
|
" ",
|
|
4637
4643
|
H.PREVIEW
|
|
4638
4644
|
] }) }) });
|
|
4639
4645
|
}, Wo = () => {
|
|
4640
4646
|
const [e, t] = fi();
|
|
4641
|
-
return /* @__PURE__ */
|
|
4647
|
+
return /* @__PURE__ */ u(be, { children: [
|
|
4642
4648
|
/* @__PURE__ */ r(ea, { content: H.THEME, children: /* @__PURE__ */ r(
|
|
4643
4649
|
P,
|
|
4644
4650
|
{
|
|
@@ -4670,7 +4676,7 @@ const zo = () => {
|
|
|
4670
4676
|
const l = Q(() => {
|
|
4671
4677
|
if (a === "SAVED" || a === "UNSAVED") return a;
|
|
4672
4678
|
if (a === "SAVING") return e ? a : "SAVED";
|
|
4673
|
-
}, [e, a]), { buttonIcon: o, buttonClass:
|
|
4679
|
+
}, [e, a]), { buttonIcon: o, buttonClass: c, tooltipContent: d } = Q(() => {
|
|
4674
4680
|
switch (l) {
|
|
4675
4681
|
case "UNSAVED":
|
|
4676
4682
|
return {
|
|
@@ -4692,13 +4698,13 @@ const zo = () => {
|
|
|
4692
4698
|
};
|
|
4693
4699
|
}
|
|
4694
4700
|
}, [l]);
|
|
4695
|
-
return n ? null : /* @__PURE__ */
|
|
4701
|
+
return n ? null : /* @__PURE__ */ u(
|
|
4696
4702
|
P,
|
|
4697
4703
|
{
|
|
4698
4704
|
size: "sm",
|
|
4699
4705
|
variant: "ghost",
|
|
4700
4706
|
onClick: i,
|
|
4701
|
-
className:
|
|
4707
|
+
className: c,
|
|
4702
4708
|
children: [
|
|
4703
4709
|
o,
|
|
4704
4710
|
" ",
|
|
@@ -4707,29 +4713,29 @@ const zo = () => {
|
|
|
4707
4713
|
}
|
|
4708
4714
|
);
|
|
4709
4715
|
}, Qo = () => {
|
|
4710
|
-
const [e, t] = T(!1), [n, s] = T(!1), [a, i] = T(null), { data: l } = Fe(), { mutate: o, isPending:
|
|
4711
|
-
const
|
|
4716
|
+
const [e, t] = T(!1), [n, s] = T(!1), [a, i] = T(null), { data: l } = Fe(), { mutate: o, isPending: c } = Ls(), [d] = gi(), { buttonText: h, buttonClassName: f, isPublished: E } = Q(() => {
|
|
4717
|
+
const y = l && (l == null ? void 0 : l.online);
|
|
4712
4718
|
return {
|
|
4713
|
-
buttonClassName:
|
|
4714
|
-
isPublished:
|
|
4715
|
-
buttonText:
|
|
4719
|
+
buttonClassName: y ? "hover:bg-green-600 bg-green-500" : "",
|
|
4720
|
+
isPublished: y,
|
|
4721
|
+
buttonText: y ? H.PUBLISHED : H.PUBLISH
|
|
4716
4722
|
};
|
|
4717
4723
|
}, [l]);
|
|
4718
|
-
return /* @__PURE__ */
|
|
4719
|
-
/* @__PURE__ */
|
|
4720
|
-
/* @__PURE__ */
|
|
4724
|
+
return /* @__PURE__ */ u(be, { children: [
|
|
4725
|
+
/* @__PURE__ */ u("div", { className: "flex", children: [
|
|
4726
|
+
/* @__PURE__ */ u(
|
|
4721
4727
|
P,
|
|
4722
4728
|
{
|
|
4723
4729
|
size: "sm",
|
|
4724
4730
|
onClick: async () => {
|
|
4725
|
-
var w,
|
|
4726
|
-
const
|
|
4731
|
+
var w, v;
|
|
4732
|
+
const y = ((v = (w = d == null ? void 0 : d.filter((I) => (I == null ? void 0 : I._type) === "GlobalBlock")) == null ? void 0 : w.map((I) => I == null ? void 0 : I.globalBlock)) == null ? void 0 : v.filter((I) => typeof I == "string")) || [];
|
|
4727
4733
|
o(
|
|
4728
|
-
{ ids: [l == null ? void 0 : l.id, ...
|
|
4734
|
+
{ ids: [l == null ? void 0 : l.id, ...y] },
|
|
4729
4735
|
{ onSuccess: () => Ln("TOP_RIGHT") }
|
|
4730
4736
|
);
|
|
4731
4737
|
},
|
|
4732
|
-
disabled:
|
|
4738
|
+
disabled: c || !(l != null && l.id),
|
|
4733
4739
|
className: `relative overflow-hidden transition-all duration-300 ease-in-out text-white flex items-center gap-1 rounded-r-none ${f}`,
|
|
4734
4740
|
onMouseEnter: () => s(!0),
|
|
4735
4741
|
onMouseLeave: () => s(!1),
|
|
@@ -4738,35 +4744,35 @@ const zo = () => {
|
|
|
4738
4744
|
"span",
|
|
4739
4745
|
{
|
|
4740
4746
|
className: `flex items-center transition-transform duration-300 ease-in-out ${n ? "-translate-y-10" : ""}`,
|
|
4741
|
-
children:
|
|
4747
|
+
children: E ? /* @__PURE__ */ r(Ks, { className: "w-4 h-4" }) : /* @__PURE__ */ r($s, { className: "w-4 h-4" })
|
|
4742
4748
|
}
|
|
4743
4749
|
),
|
|
4744
4750
|
/* @__PURE__ */ r(
|
|
4745
4751
|
"span",
|
|
4746
4752
|
{
|
|
4747
4753
|
className: `absolute inset-0 flex items-center left-3 transition-transform duration-300 ease-in-out ${n ? "" : "translate-y-10"}`,
|
|
4748
|
-
children:
|
|
4754
|
+
children: E ? /* @__PURE__ */ r($s, { className: "w-4 h-4" }) : /* @__PURE__ */ r(Ks, { className: "w-4 h-4" })
|
|
4749
4755
|
}
|
|
4750
4756
|
),
|
|
4751
4757
|
/* @__PURE__ */ r("span", { children: h })
|
|
4752
4758
|
]
|
|
4753
4759
|
}
|
|
4754
4760
|
),
|
|
4755
|
-
/* @__PURE__ */
|
|
4761
|
+
/* @__PURE__ */ u(dn, { children: [
|
|
4756
4762
|
/* @__PURE__ */ r(hn, { asChild: !0, children: /* @__PURE__ */ r(
|
|
4757
4763
|
P,
|
|
4758
4764
|
{
|
|
4759
4765
|
size: "sm",
|
|
4760
|
-
disabled:
|
|
4766
|
+
disabled: c || !(l != null && l.id),
|
|
4761
4767
|
className: `px-2 text-white border-l border-white/50 rounded-l-none ${f}`,
|
|
4762
4768
|
children: /* @__PURE__ */ r(Or, { className: "w-4 h-4" })
|
|
4763
4769
|
}
|
|
4764
4770
|
) }),
|
|
4765
|
-
/* @__PURE__ */
|
|
4766
|
-
!
|
|
4771
|
+
/* @__PURE__ */ u(mn, { align: "end", className: "w-36", children: [
|
|
4772
|
+
!E && /* @__PURE__ */ u(
|
|
4767
4773
|
Ge,
|
|
4768
4774
|
{
|
|
4769
|
-
disabled:
|
|
4775
|
+
disabled: c,
|
|
4770
4776
|
className: "text-xs cursor-pointer",
|
|
4771
4777
|
onClick: () => o(
|
|
4772
4778
|
{ ids: [l == null ? void 0 : l.id] },
|
|
@@ -4778,7 +4784,7 @@ const zo = () => {
|
|
|
4778
4784
|
]
|
|
4779
4785
|
}
|
|
4780
4786
|
),
|
|
4781
|
-
/* @__PURE__ */
|
|
4787
|
+
/* @__PURE__ */ u(
|
|
4782
4788
|
Ge,
|
|
4783
4789
|
{
|
|
4784
4790
|
onClick: () => t(!0),
|
|
@@ -4789,7 +4795,7 @@ const zo = () => {
|
|
|
4789
4795
|
]
|
|
4790
4796
|
}
|
|
4791
4797
|
),
|
|
4792
|
-
|
|
4798
|
+
E && /* @__PURE__ */ u(
|
|
4793
4799
|
Ge,
|
|
4794
4800
|
{
|
|
4795
4801
|
onClick: () => i(l),
|
|
@@ -4814,7 +4820,7 @@ const zo = () => {
|
|
|
4814
4820
|
] });
|
|
4815
4821
|
}, Xo = () => {
|
|
4816
4822
|
const e = ot("settingComponent", null), [t, n] = T(!1);
|
|
4817
|
-
return e ? /* @__PURE__ */
|
|
4823
|
+
return e ? /* @__PURE__ */ u(be, { children: [
|
|
4818
4824
|
/* @__PURE__ */ r(ea, { content: H.WEBSITEDATA, children: /* @__PURE__ */ r(
|
|
4819
4825
|
P,
|
|
4820
4826
|
{
|
|
@@ -4836,7 +4842,7 @@ const zo = () => {
|
|
|
4836
4842
|
return (i = Ee(n, { key: a })) == null ? void 0 : i.hasSlug;
|
|
4837
4843
|
},
|
|
4838
4844
|
[n]
|
|
4839
|
-
)(e == null ? void 0 : e.pageType) ? /* @__PURE__ */
|
|
4845
|
+
)(e == null ? void 0 : e.pageType) ? /* @__PURE__ */ u(
|
|
4840
4846
|
P,
|
|
4841
4847
|
{
|
|
4842
4848
|
onClick: () => t && window.open(`${window.location.origin}${e.slug}`, "_blank"),
|
|
@@ -4853,7 +4859,7 @@ const zo = () => {
|
|
|
4853
4859
|
};
|
|
4854
4860
|
function Jo() {
|
|
4855
4861
|
const { isLocked: e } = yn(), [t] = Me(), n = t.get("lang"), s = Kr(n);
|
|
4856
|
-
return e || !s ? null : /* @__PURE__ */
|
|
4862
|
+
return e || !s ? null : /* @__PURE__ */ u("div", { className: "flex items-center justify-end gap-1", children: [
|
|
4857
4863
|
/* @__PURE__ */ r(Oo, {}),
|
|
4858
4864
|
/* @__PURE__ */ r(Ve, { permission: fe.EDIT_THEME, children: /* @__PURE__ */ r(Wo, {}) }),
|
|
4859
4865
|
/* @__PURE__ */ r(Ve, { permission: fe.EDIT_SETTINGS, children: /* @__PURE__ */ r(Xo, {}) }),
|
|
@@ -4863,7 +4869,7 @@ function Jo() {
|
|
|
4863
4869
|
/* @__PURE__ */ r(Zo, {})
|
|
4864
4870
|
] });
|
|
4865
4871
|
}
|
|
4866
|
-
const ec = () => /* @__PURE__ */
|
|
4872
|
+
const ec = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-center justify-between w-full", children: [
|
|
4867
4873
|
/* @__PURE__ */ r(ko, {}),
|
|
4868
4874
|
/* @__PURE__ */ r(Jo, {})
|
|
4869
4875
|
] }), tc = () => {
|
|
@@ -4896,7 +4902,7 @@ const ec = () => /* @__PURE__ */ c("div", { className: "flex px-2 h-full items-c
|
|
|
4896
4902
|
}), sc = (e) => {
|
|
4897
4903
|
const t = bl();
|
|
4898
4904
|
return Q(() => {
|
|
4899
|
-
if (!e ||
|
|
4905
|
+
if (!e || le(e)) return { blocks: [] };
|
|
4900
4906
|
const n = Se(
|
|
4901
4907
|
e,
|
|
4902
4908
|
(s) => !zt(s == null ? void 0 : s._type, "@chai/")
|
|
@@ -4971,8 +4977,8 @@ const ec = () => /* @__PURE__ */ c("div", { className: "flex px-2 h-full items-c
|
|
|
4971
4977
|
action: "UPDATE_PAGE",
|
|
4972
4978
|
data: { id: i, blocks: l }
|
|
4973
4979
|
});
|
|
4974
|
-
return o.code === "PAGE_LOCKED" ? (n(o.editor), !0) : (s((
|
|
4975
|
-
...
|
|
4980
|
+
return o.code === "PAGE_LOCKED" ? (n(o.editor), !0) : (s((c) => ({
|
|
4981
|
+
...c,
|
|
4976
4982
|
lastSaved: (/* @__PURE__ */ new Date()).toISOString()
|
|
4977
4983
|
})), o);
|
|
4978
4984
|
} catch (o) {
|
|
@@ -4985,7 +4991,7 @@ const ec = () => /* @__PURE__ */ c("div", { className: "flex px-2 h-full items-c
|
|
|
4985
4991
|
getPartialBlocks: Pe(async () => {
|
|
4986
4992
|
const s = {};
|
|
4987
4993
|
for (const a of e ?? [])
|
|
4988
|
-
|
|
4994
|
+
le(a == null ? void 0 : a.slug) && (s[a.id] = {
|
|
4989
4995
|
type: a.pageType,
|
|
4990
4996
|
name: $t(a.name ?? a.slug),
|
|
4991
4997
|
description: ""
|
|
@@ -5012,18 +5018,18 @@ const ec = () => /* @__PURE__ */ c("div", { className: "flex px-2 h-full items-c
|
|
|
5012
5018
|
email: In.string().email({ message: "Please enter a valid email address" }),
|
|
5013
5019
|
password: In.string().min(6, { message: "Password must be at least 6 characters" })
|
|
5014
5020
|
}), oc = () => {
|
|
5015
|
-
const { setUser: e, logout: t } = gt(), n = Ps(), [s, a] = T(""), [i, l] = T(""), [o,
|
|
5016
|
-
mutationFn: async (
|
|
5017
|
-
|
|
5018
|
-
const
|
|
5021
|
+
const { setUser: e, logout: t } = gt(), n = Ps(), [s, a] = T(""), [i, l] = T(""), [o, c] = T({}), [d, h] = T(!1), [f, E] = T(""), p = xe({
|
|
5022
|
+
mutationFn: async (v) => {
|
|
5023
|
+
E("");
|
|
5024
|
+
const I = await Cs(n, {
|
|
5019
5025
|
action: "LOGIN",
|
|
5020
|
-
data:
|
|
5026
|
+
data: v
|
|
5021
5027
|
});
|
|
5022
|
-
if (!
|
|
5023
|
-
const C = await
|
|
5028
|
+
if (!I.ok) {
|
|
5029
|
+
const C = await I.json();
|
|
5024
5030
|
throw new Error(C.error || "Login failed");
|
|
5025
5031
|
}
|
|
5026
|
-
const b = await
|
|
5032
|
+
const b = await I.json();
|
|
5027
5033
|
if (et(b, "id") && et(b, "email") && et(b, "accessToken") && et(b, "refreshToken"))
|
|
5028
5034
|
e(b);
|
|
5029
5035
|
else
|
|
@@ -5031,37 +5037,37 @@ const ec = () => /* @__PURE__ */ c("div", { className: "flex px-2 h-full items-c
|
|
|
5031
5037
|
return b;
|
|
5032
5038
|
},
|
|
5033
5039
|
onSuccess: () => {
|
|
5034
|
-
|
|
5040
|
+
c({}), E("");
|
|
5035
5041
|
},
|
|
5036
|
-
onError: (
|
|
5037
|
-
|
|
5042
|
+
onError: (v) => {
|
|
5043
|
+
c({
|
|
5038
5044
|
email: " ",
|
|
5039
5045
|
password: " "
|
|
5040
|
-
}), v
|
|
5046
|
+
}), E(v.message || "Something went wrong");
|
|
5041
5047
|
}
|
|
5042
|
-
}),
|
|
5043
|
-
|
|
5044
|
-
const
|
|
5048
|
+
}), y = async (v) => {
|
|
5049
|
+
v.preventDefault(), c({});
|
|
5050
|
+
const I = { email: s, password: i };
|
|
5045
5051
|
try {
|
|
5046
|
-
const b = Qs.parse(
|
|
5047
|
-
|
|
5052
|
+
const b = Qs.parse(I);
|
|
5053
|
+
p.mutate(b);
|
|
5048
5054
|
} catch (b) {
|
|
5049
5055
|
if (b instanceof In.ZodError) {
|
|
5050
5056
|
const C = b.errors.reduce((S, L) => {
|
|
5051
5057
|
const O = L.path[0];
|
|
5052
5058
|
return S[O] = L.message, S;
|
|
5053
5059
|
}, {});
|
|
5054
|
-
|
|
5060
|
+
c(C);
|
|
5055
5061
|
}
|
|
5056
5062
|
}
|
|
5057
5063
|
}, w = Qs.safeParse({ email: s, password: i }).success;
|
|
5058
|
-
return /* @__PURE__ */ r("div", { className: "flex justify-center items-center min-h-screen bg-slate-50", children: /* @__PURE__ */
|
|
5059
|
-
/* @__PURE__ */
|
|
5064
|
+
return /* @__PURE__ */ r("div", { className: "flex justify-center items-center min-h-screen bg-slate-50", children: /* @__PURE__ */ u(fs, { className: "w-full max-w-md", children: [
|
|
5065
|
+
/* @__PURE__ */ u(gs, { children: [
|
|
5060
5066
|
/* @__PURE__ */ r(ps, { className: "text-2xl", children: "Sign in" }),
|
|
5061
5067
|
/* @__PURE__ */ r(Di, { children: "Enter your credentials to sign in to visual builder" })
|
|
5062
5068
|
] }),
|
|
5063
|
-
/* @__PURE__ */ r(ys, { children: /* @__PURE__ */
|
|
5064
|
-
/* @__PURE__ */
|
|
5069
|
+
/* @__PURE__ */ r(ys, { children: /* @__PURE__ */ u("form", { onSubmit: y, className: "space-y-4", children: [
|
|
5070
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5065
5071
|
/* @__PURE__ */ r(ne, { htmlFor: "email", children: "Email" }),
|
|
5066
5072
|
/* @__PURE__ */ r(
|
|
5067
5073
|
ve,
|
|
@@ -5070,15 +5076,15 @@ const ec = () => /* @__PURE__ */ c("div", { className: "flex px-2 h-full items-c
|
|
|
5070
5076
|
placeholder: "you@example.com",
|
|
5071
5077
|
type: "email",
|
|
5072
5078
|
value: s,
|
|
5073
|
-
onChange: (
|
|
5079
|
+
onChange: (v) => a(v.target.value),
|
|
5074
5080
|
className: o.email ? "border-destructive" : ""
|
|
5075
5081
|
}
|
|
5076
5082
|
),
|
|
5077
5083
|
o.email && /* @__PURE__ */ r("p", { className: "text-sm text-destructive", children: o.email })
|
|
5078
5084
|
] }),
|
|
5079
|
-
/* @__PURE__ */
|
|
5085
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5080
5086
|
/* @__PURE__ */ r(ne, { htmlFor: "password", children: "Password" }),
|
|
5081
|
-
/* @__PURE__ */
|
|
5087
|
+
/* @__PURE__ */ u("div", { className: "relative", children: [
|
|
5082
5088
|
/* @__PURE__ */ r(
|
|
5083
5089
|
ve,
|
|
5084
5090
|
{
|
|
@@ -5086,7 +5092,7 @@ const ec = () => /* @__PURE__ */ c("div", { className: "flex px-2 h-full items-c
|
|
|
5086
5092
|
placeholder: "Enter your password",
|
|
5087
5093
|
type: d ? "text" : "password",
|
|
5088
5094
|
value: i,
|
|
5089
|
-
onChange: (
|
|
5095
|
+
onChange: (v) => l(v.target.value),
|
|
5090
5096
|
className: o.password ? "border-destructive" : ""
|
|
5091
5097
|
}
|
|
5092
5098
|
),
|
|
@@ -5108,16 +5114,16 @@ const ec = () => /* @__PURE__ */ c("div", { className: "flex px-2 h-full items-c
|
|
|
5108
5114
|
{
|
|
5109
5115
|
type: "submit",
|
|
5110
5116
|
className: "w-full",
|
|
5111
|
-
disabled: !w ||
|
|
5112
|
-
children:
|
|
5117
|
+
disabled: !w || p.isPending,
|
|
5118
|
+
children: p.isPending ? /* @__PURE__ */ u(be, { children: [
|
|
5113
5119
|
/* @__PURE__ */ r(Fr, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
5114
5120
|
"Logging in..."
|
|
5115
5121
|
] }) : "Login"
|
|
5116
5122
|
}
|
|
5117
5123
|
)
|
|
5118
5124
|
] }) }),
|
|
5119
|
-
/* @__PURE__ */
|
|
5120
|
-
/* @__PURE__ */
|
|
5125
|
+
/* @__PURE__ */ u(vs, { className: "flex flex-col justify-center", children: [
|
|
5126
|
+
/* @__PURE__ */ u("p", { className: "text-sm text-muted-foreground", children: [
|
|
5121
5127
|
"Forgot your password?",
|
|
5122
5128
|
" ",
|
|
5123
5129
|
/* @__PURE__ */ r(
|
|
@@ -5132,10 +5138,10 @@ const ec = () => /* @__PURE__ */ c("div", { className: "flex px-2 h-full items-c
|
|
|
5132
5138
|
] }),
|
|
5133
5139
|
/* @__PURE__ */ r("br", {}),
|
|
5134
5140
|
/* @__PURE__ */ r("br", {}),
|
|
5135
|
-
/* @__PURE__ */
|
|
5141
|
+
/* @__PURE__ */ u("div", { className: "flex items-center border-t pt-2 px-10 gap-2", children: [
|
|
5136
5142
|
"Powered by",
|
|
5137
5143
|
" ",
|
|
5138
|
-
/* @__PURE__ */
|
|
5144
|
+
/* @__PURE__ */ u(
|
|
5139
5145
|
"a",
|
|
5140
5146
|
{
|
|
5141
5147
|
target: "_blank",
|
|
@@ -5185,28 +5191,28 @@ function Je({
|
|
|
5185
5191
|
dataType: n = "value",
|
|
5186
5192
|
disabled: s = !1
|
|
5187
5193
|
}) {
|
|
5188
|
-
const [a, i] = ge.useState(!1), [l, o] = ge.useState([]), [
|
|
5194
|
+
const [a, i] = ge.useState(!1), [l, o] = ge.useState([]), [c, d] = ge.useState(e);
|
|
5189
5195
|
ge.useEffect(() => {
|
|
5190
5196
|
a || o([]), d(e);
|
|
5191
5197
|
}, [e, a]);
|
|
5192
|
-
const h = (
|
|
5193
|
-
(
|
|
5194
|
-
const w = (
|
|
5195
|
-
|
|
5198
|
+
const h = (y) => Array.isArray(y) ? "array" : typeof y == "object" && y !== null ? "object" : "value", f = ge.useCallback(
|
|
5199
|
+
(y) => {
|
|
5200
|
+
const w = (v) => n === "value" ? v === "value" || v === "object" : n === "array" ? v === "array" : v === n;
|
|
5201
|
+
y.type === "object" ? (o((v) => [...v, y.key]), d(y.value)) : w(y.type) && (t([...l, y.key].join(".")), i(!1));
|
|
5196
5202
|
},
|
|
5197
5203
|
[l, t, n]
|
|
5198
|
-
),
|
|
5204
|
+
), E = ge.useCallback(() => {
|
|
5199
5205
|
if (l.length > 0) {
|
|
5200
|
-
const
|
|
5201
|
-
o(
|
|
5206
|
+
const y = l.slice(0, -1);
|
|
5207
|
+
o(y), d(y.reduce((w, v) => w[v], e));
|
|
5202
5208
|
}
|
|
5203
|
-
}, [l, e]),
|
|
5204
|
-
key:
|
|
5209
|
+
}, [l, e]), p = ge.useMemo(() => Object.entries(c).map(([y, w]) => ({
|
|
5210
|
+
key: y,
|
|
5205
5211
|
value: w,
|
|
5206
5212
|
type: h(w)
|
|
5207
|
-
})).filter((
|
|
5208
|
-
return /* @__PURE__ */
|
|
5209
|
-
/* @__PURE__ */
|
|
5213
|
+
})).filter((y) => n === "value" ? y.type === "value" || y.type === "object" : n === "array" ? y.type === "array" || y.type === "object" : n === "object" ? y.type === "object" : !0), [c, n]);
|
|
5214
|
+
return /* @__PURE__ */ u(wr, { open: a, onOpenChange: i, children: [
|
|
5215
|
+
/* @__PURE__ */ u(bs, { children: [
|
|
5210
5216
|
/* @__PURE__ */ r(Ss, { asChild: !0, children: /* @__PURE__ */ r(Nr, { asChild: !0, children: /* @__PURE__ */ r(
|
|
5211
5217
|
P,
|
|
5212
5218
|
{
|
|
@@ -5221,15 +5227,15 @@ function Je({
|
|
|
5221
5227
|
) }) }),
|
|
5222
5228
|
/* @__PURE__ */ r(ws, { children: "Add field" })
|
|
5223
5229
|
] }),
|
|
5224
|
-
/* @__PURE__ */ r(Ar, { className: "w-[200px] z-[9999] p-0", children: /* @__PURE__ */
|
|
5230
|
+
/* @__PURE__ */ r(Ar, { className: "w-[200px] z-[9999] p-0", children: /* @__PURE__ */ u(Gi, { children: [
|
|
5225
5231
|
/* @__PURE__ */ r(Ui, { className: "border-none", placeholder: "Search..." }),
|
|
5226
|
-
/* @__PURE__ */
|
|
5232
|
+
/* @__PURE__ */ u(Oi, { children: [
|
|
5227
5233
|
/* @__PURE__ */ r(Ri, { children: "No option found." }),
|
|
5228
|
-
/* @__PURE__ */
|
|
5229
|
-
l.length > 0 && /* @__PURE__ */
|
|
5234
|
+
/* @__PURE__ */ u(Bi, { children: [
|
|
5235
|
+
l.length > 0 && /* @__PURE__ */ u(
|
|
5230
5236
|
Vs,
|
|
5231
5237
|
{
|
|
5232
|
-
onSelect:
|
|
5238
|
+
onSelect: E,
|
|
5233
5239
|
className: "flex items-center text-sm",
|
|
5234
5240
|
children: [
|
|
5235
5241
|
/* @__PURE__ */ r(pl, { className: "w-4 h-4 mr-2" }),
|
|
@@ -5237,31 +5243,31 @@ function Je({
|
|
|
5237
5243
|
]
|
|
5238
5244
|
}
|
|
5239
5245
|
),
|
|
5240
|
-
|
|
5246
|
+
p.map((y) => /* @__PURE__ */ u(
|
|
5241
5247
|
Vs,
|
|
5242
5248
|
{
|
|
5243
|
-
onSelect: () => f(
|
|
5249
|
+
onSelect: () => f(y),
|
|
5244
5250
|
className: "flex items-center justify-between",
|
|
5245
5251
|
children: [
|
|
5246
|
-
/* @__PURE__ */ r("span", { children:
|
|
5247
|
-
/* @__PURE__ */
|
|
5248
|
-
n === "object" &&
|
|
5252
|
+
/* @__PURE__ */ r("span", { children: y.key }),
|
|
5253
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
5254
|
+
n === "object" && y.type === "object" && /* @__PURE__ */ r(
|
|
5249
5255
|
P,
|
|
5250
5256
|
{
|
|
5251
5257
|
size: "sm",
|
|
5252
5258
|
variant: "ghost",
|
|
5253
5259
|
className: "h-6 px-2 hover:bg-primary hover:text-primary-foreground",
|
|
5254
5260
|
onClick: (w) => {
|
|
5255
|
-
w.stopPropagation(), t([...l,
|
|
5261
|
+
w.stopPropagation(), t([...l, y.key].join(".")), i(!1);
|
|
5256
5262
|
},
|
|
5257
5263
|
children: "Select"
|
|
5258
5264
|
}
|
|
5259
5265
|
),
|
|
5260
|
-
(
|
|
5266
|
+
(y.type === "object" || y.type === "array") && /* @__PURE__ */ r("div", { className: "p-1 rounded hover:bg-muted cursor-pointer", children: /* @__PURE__ */ r(yl, { className: "w-4 h-4 opacity-50" }) })
|
|
5261
5267
|
] })
|
|
5262
5268
|
]
|
|
5263
5269
|
},
|
|
5264
|
-
|
|
5270
|
+
y.key
|
|
5265
5271
|
))
|
|
5266
5272
|
] })
|
|
5267
5273
|
] })
|
|
@@ -5275,22 +5281,22 @@ const mc = () => {
|
|
|
5275
5281
|
const n = e.selectionStart || 0, s = e.selectionEnd || 0, a = e.value, i = a.substring(0, n), l = a.substring(s);
|
|
5276
5282
|
let o = !1;
|
|
5277
5283
|
if (n > 0 && i.length > 0) {
|
|
5278
|
-
const
|
|
5279
|
-
o = !/[\s.,!?;:()[\]{}]/.test(
|
|
5284
|
+
const y = i.charAt(i.length - 1);
|
|
5285
|
+
o = !/[\s.,!?;:()[\]{}]/.test(y) && y !== "";
|
|
5280
5286
|
}
|
|
5281
|
-
let
|
|
5287
|
+
let c = !1;
|
|
5282
5288
|
if (l.length > 0) {
|
|
5283
|
-
const
|
|
5284
|
-
|
|
5289
|
+
const y = l.charAt(0);
|
|
5290
|
+
c = !/[\s.,!?;:()[\]{}]/.test(y) && y !== "";
|
|
5285
5291
|
}
|
|
5286
|
-
const d = o ? " " : "", h =
|
|
5292
|
+
const d = o ? " " : "", h = c ? " " : "", f = `{{${t}}}`, E = i + (o ? d : "") + f + (c ? h : "") + l, p = n + (o ? 1 : 0) + // Account for space before if added
|
|
5287
5293
|
f.length;
|
|
5288
5294
|
return {
|
|
5289
|
-
value:
|
|
5290
|
-
newCursorPos:
|
|
5295
|
+
value: E,
|
|
5296
|
+
newCursorPos: p
|
|
5291
5297
|
};
|
|
5292
5298
|
}, na = () => {
|
|
5293
|
-
const { t: e } = vi(), { selectedLang: t, fallbackLang: n, languages: s } = ft(), [, a] = Ei(), { data: i } = zr(), { data: l, isFetching: o } = mc(),
|
|
5299
|
+
const { t: e } = vi(), { selectedLang: t, fallbackLang: n, languages: s } = ft(), [, a] = Ei(), { data: i } = zr(), { data: l, isFetching: o } = mc(), c = l == null ? void 0 : l.seo, d = it(
|
|
5294
5300
|
null
|
|
5295
5301
|
), [h, f] = T({
|
|
5296
5302
|
title: "",
|
|
@@ -5304,10 +5310,10 @@ const mc = () => {
|
|
|
5304
5310
|
searchTitle: "",
|
|
5305
5311
|
searchDescription: "",
|
|
5306
5312
|
jsonLD: "",
|
|
5307
|
-
...
|
|
5308
|
-
}),
|
|
5313
|
+
...c
|
|
5314
|
+
}), E = it({ initial: h, updated: h }), p = t.length ? t : n, { mutate: y, isPending: w } = ks(), v = w, { hasPermission: I } = Bt(), b = I(fe.EDIT_SEO);
|
|
5309
5315
|
Ne(() => {
|
|
5310
|
-
!o &&
|
|
5316
|
+
!o && c && f({
|
|
5311
5317
|
title: "",
|
|
5312
5318
|
description: "",
|
|
5313
5319
|
cononicalUrl: "",
|
|
@@ -5319,15 +5325,15 @@ const mc = () => {
|
|
|
5319
5325
|
searchTitle: "",
|
|
5320
5326
|
searchDescription: "",
|
|
5321
5327
|
jsonLD: "",
|
|
5322
|
-
...
|
|
5328
|
+
...c
|
|
5323
5329
|
});
|
|
5324
|
-
}, [o,
|
|
5330
|
+
}, [o, c]);
|
|
5325
5331
|
const C = async () => {
|
|
5326
|
-
|
|
5332
|
+
y(
|
|
5327
5333
|
{ id: l == null ? void 0 : l.id, seo: h },
|
|
5328
5334
|
{
|
|
5329
5335
|
onSuccess: () => {
|
|
5330
|
-
|
|
5336
|
+
E.current.initial = h, E.current.updated = h, a("outline");
|
|
5331
5337
|
}
|
|
5332
5338
|
}
|
|
5333
5339
|
);
|
|
@@ -5381,30 +5387,30 @@ const mc = () => {
|
|
|
5381
5387
|
...h,
|
|
5382
5388
|
[D.target.name]: D.target.name === "noIndex" || D.target.name === "noFollow" ? D.target.checked : D.target.value
|
|
5383
5389
|
};
|
|
5384
|
-
f(Y),
|
|
5390
|
+
f(Y), E.current.updated = Y;
|
|
5385
5391
|
};
|
|
5386
|
-
return /* @__PURE__ */
|
|
5392
|
+
return /* @__PURE__ */ u("div", { className: "relative h-full flex flex-col", children: [
|
|
5387
5393
|
!b && /* @__PURE__ */ r("div", { className: "absolute inset-0 z-10 backdrop-blur-sm flex items-center justify-center", children: /* @__PURE__ */ r(Es, { variant: "default", className: "w-[80%] max-w-md text-xs", children: /* @__PURE__ */ r(Mi, { children: e(
|
|
5388
5394
|
"You don't have permission to edit SEO settings. Contact your administrator for access."
|
|
5389
5395
|
) }) }) }),
|
|
5390
|
-
/* @__PURE__ */
|
|
5391
|
-
/* @__PURE__ */
|
|
5396
|
+
/* @__PURE__ */ u("div", { className: "flex-grow overflow-y-auto no-scrollbar px-2", children: [
|
|
5397
|
+
/* @__PURE__ */ u("div", { className: "p-2 text-xs text-left bg-gray-100 rounded-md mb-4", children: [
|
|
5392
5398
|
e("Slug"),
|
|
5393
5399
|
": ",
|
|
5394
5400
|
l == null ? void 0 : l.slug,
|
|
5395
5401
|
" ",
|
|
5396
|
-
s.length > 0 && /* @__PURE__ */
|
|
5402
|
+
s.length > 0 && /* @__PURE__ */ u("span", { className: "font-semibold text-blue-500", children: [
|
|
5397
5403
|
"(",
|
|
5398
|
-
W(Ye,
|
|
5404
|
+
W(Ye, p, p),
|
|
5399
5405
|
")"
|
|
5400
5406
|
] })
|
|
5401
5407
|
] }),
|
|
5402
|
-
/* @__PURE__ */ r("form", { className: "space-y-8", children: /* @__PURE__ */
|
|
5403
|
-
/* @__PURE__ */
|
|
5408
|
+
/* @__PURE__ */ r("form", { className: "space-y-8", children: /* @__PURE__ */ u(Fi, { type: "multiple", defaultValue: ["page"], children: [
|
|
5409
|
+
/* @__PURE__ */ u(Sn, { value: "page", children: [
|
|
5404
5410
|
/* @__PURE__ */ r(wn, { className: "font-semibold text-slate-700", children: e("SEO") }),
|
|
5405
|
-
/* @__PURE__ */ r(Nn, { className: "pt-2", children: /* @__PURE__ */
|
|
5406
|
-
/* @__PURE__ */
|
|
5407
|
-
/* @__PURE__ */
|
|
5411
|
+
/* @__PURE__ */ r(Nn, { className: "pt-2", children: /* @__PURE__ */ u("div", { className: "space-y-4", children: [
|
|
5412
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5413
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5408
5414
|
/* @__PURE__ */ r(ne, { className: "text-xs", htmlFor: "title", children: e("SEO Title") }),
|
|
5409
5415
|
b && /* @__PURE__ */ r(
|
|
5410
5416
|
Je,
|
|
@@ -5423,14 +5429,14 @@ const mc = () => {
|
|
|
5423
5429
|
name: "title",
|
|
5424
5430
|
value: h.title,
|
|
5425
5431
|
onChange: re,
|
|
5426
|
-
disabled:
|
|
5432
|
+
disabled: v || !b,
|
|
5427
5433
|
placeholder: e("Enter SEO title"),
|
|
5428
5434
|
readOnly: !b
|
|
5429
5435
|
}
|
|
5430
5436
|
)
|
|
5431
5437
|
] }),
|
|
5432
|
-
/* @__PURE__ */
|
|
5433
|
-
/* @__PURE__ */
|
|
5438
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5439
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5434
5440
|
/* @__PURE__ */ r(ne, { className: "text-xs", htmlFor: "description", children: e("SEO Description") }),
|
|
5435
5441
|
b && /* @__PURE__ */ r(
|
|
5436
5442
|
Je,
|
|
@@ -5448,14 +5454,14 @@ const mc = () => {
|
|
|
5448
5454
|
rows: 5,
|
|
5449
5455
|
value: h.description,
|
|
5450
5456
|
onChange: re,
|
|
5451
|
-
disabled:
|
|
5457
|
+
disabled: v || !b,
|
|
5452
5458
|
placeholder: e("Enter SEO description"),
|
|
5453
5459
|
readOnly: !b
|
|
5454
5460
|
}
|
|
5455
5461
|
)
|
|
5456
5462
|
] }),
|
|
5457
|
-
/* @__PURE__ */
|
|
5458
|
-
/* @__PURE__ */
|
|
5463
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5464
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5459
5465
|
/* @__PURE__ */ r(ne, { className: "text-xs", htmlFor: "title", children: e("Canonical URL") }),
|
|
5460
5466
|
b && /* @__PURE__ */ r(
|
|
5461
5467
|
Je,
|
|
@@ -5474,14 +5480,14 @@ const mc = () => {
|
|
|
5474
5480
|
name: "canonicalUrl",
|
|
5475
5481
|
value: h.canonicalUrl,
|
|
5476
5482
|
onChange: re,
|
|
5477
|
-
disabled:
|
|
5483
|
+
disabled: v || !b,
|
|
5478
5484
|
placeholder: e("Enter Canonical URL"),
|
|
5479
5485
|
readOnly: !b
|
|
5480
5486
|
}
|
|
5481
5487
|
)
|
|
5482
5488
|
] }),
|
|
5483
|
-
/* @__PURE__ */
|
|
5484
|
-
/* @__PURE__ */
|
|
5489
|
+
/* @__PURE__ */ u("div", { className: "", children: [
|
|
5490
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
|
|
5485
5491
|
/* @__PURE__ */ r(
|
|
5486
5492
|
ve,
|
|
5487
5493
|
{
|
|
@@ -5490,7 +5496,7 @@ const mc = () => {
|
|
|
5490
5496
|
name: "noIndex",
|
|
5491
5497
|
checked: h.noIndex,
|
|
5492
5498
|
onChange: re,
|
|
5493
|
-
disabled:
|
|
5499
|
+
disabled: v || !b,
|
|
5494
5500
|
className: "w-4 h-4"
|
|
5495
5501
|
}
|
|
5496
5502
|
),
|
|
@@ -5500,8 +5506,8 @@ const mc = () => {
|
|
|
5500
5506
|
"Check this if you don't want search engines to index this page."
|
|
5501
5507
|
) })
|
|
5502
5508
|
] }),
|
|
5503
|
-
/* @__PURE__ */
|
|
5504
|
-
/* @__PURE__ */
|
|
5509
|
+
/* @__PURE__ */ u("div", { className: "", children: [
|
|
5510
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
|
|
5505
5511
|
/* @__PURE__ */ r(
|
|
5506
5512
|
ve,
|
|
5507
5513
|
{
|
|
@@ -5510,7 +5516,7 @@ const mc = () => {
|
|
|
5510
5516
|
name: "noFollow",
|
|
5511
5517
|
checked: h.noFollow,
|
|
5512
5518
|
onChange: re,
|
|
5513
|
-
disabled:
|
|
5519
|
+
disabled: v || !b,
|
|
5514
5520
|
className: "w-4 h-4"
|
|
5515
5521
|
}
|
|
5516
5522
|
),
|
|
@@ -5522,9 +5528,9 @@ const mc = () => {
|
|
|
5522
5528
|
] })
|
|
5523
5529
|
] }) })
|
|
5524
5530
|
] }),
|
|
5525
|
-
/* @__PURE__ */
|
|
5531
|
+
/* @__PURE__ */ u(Sn, { value: "og", children: [
|
|
5526
5532
|
/* @__PURE__ */ r(wn, { className: "font-bold text-slate-700", children: e("Open Graph") }),
|
|
5527
|
-
/* @__PURE__ */ r(Nn, { children: /* @__PURE__ */
|
|
5533
|
+
/* @__PURE__ */ r(Nn, { children: /* @__PURE__ */ u("div", { className: "space-y-4", children: [
|
|
5528
5534
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r(
|
|
5529
5535
|
P,
|
|
5530
5536
|
{
|
|
@@ -5536,8 +5542,8 @@ const mc = () => {
|
|
|
5536
5542
|
children: e("Copy from SEO Settings")
|
|
5537
5543
|
}
|
|
5538
5544
|
) }),
|
|
5539
|
-
/* @__PURE__ */
|
|
5540
|
-
/* @__PURE__ */
|
|
5545
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5546
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5541
5547
|
/* @__PURE__ */ r(ne, { className: "text-xs", htmlFor: "ogTitle", children: e("OG Title") }),
|
|
5542
5548
|
b && /* @__PURE__ */ r(
|
|
5543
5549
|
Je,
|
|
@@ -5556,14 +5562,14 @@ const mc = () => {
|
|
|
5556
5562
|
name: "ogTitle",
|
|
5557
5563
|
value: h.ogTitle,
|
|
5558
5564
|
onChange: re,
|
|
5559
|
-
disabled:
|
|
5565
|
+
disabled: v || !b,
|
|
5560
5566
|
placeholder: e("Enter OG title"),
|
|
5561
5567
|
readOnly: !b
|
|
5562
5568
|
}
|
|
5563
5569
|
)
|
|
5564
5570
|
] }),
|
|
5565
|
-
/* @__PURE__ */
|
|
5566
|
-
/* @__PURE__ */
|
|
5571
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5572
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5567
5573
|
/* @__PURE__ */ r(ne, { className: "text-xs", htmlFor: "ogDescription", children: e("OG Description") }),
|
|
5568
5574
|
b && /* @__PURE__ */ r(
|
|
5569
5575
|
Je,
|
|
@@ -5582,14 +5588,14 @@ const mc = () => {
|
|
|
5582
5588
|
rows: 5,
|
|
5583
5589
|
value: h.ogDescription,
|
|
5584
5590
|
onChange: re,
|
|
5585
|
-
disabled:
|
|
5591
|
+
disabled: v || !b,
|
|
5586
5592
|
placeholder: e("Enter OG description"),
|
|
5587
5593
|
readOnly: !b
|
|
5588
5594
|
}
|
|
5589
5595
|
)
|
|
5590
5596
|
] }),
|
|
5591
|
-
/* @__PURE__ */
|
|
5592
|
-
/* @__PURE__ */
|
|
5597
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5598
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5593
5599
|
/* @__PURE__ */ r(ne, { className: "text-xs", htmlFor: "ogImage", children: e("OG Image URL") }),
|
|
5594
5600
|
b && /* @__PURE__ */ r(
|
|
5595
5601
|
Je,
|
|
@@ -5608,7 +5614,7 @@ const mc = () => {
|
|
|
5608
5614
|
name: "ogImage",
|
|
5609
5615
|
value: h.ogImage,
|
|
5610
5616
|
onChange: re,
|
|
5611
|
-
disabled:
|
|
5617
|
+
disabled: v || !b,
|
|
5612
5618
|
placeholder: e("Enter OG image URL"),
|
|
5613
5619
|
readOnly: !b
|
|
5614
5620
|
}
|
|
@@ -5616,9 +5622,9 @@ const mc = () => {
|
|
|
5616
5622
|
] })
|
|
5617
5623
|
] }) })
|
|
5618
5624
|
] }),
|
|
5619
|
-
/* @__PURE__ */
|
|
5625
|
+
/* @__PURE__ */ u(Sn, { value: "search", children: [
|
|
5620
5626
|
/* @__PURE__ */ r(wn, { className: "font-bold text-slate-700", children: e("Search") }),
|
|
5621
|
-
/* @__PURE__ */ r(Nn, { children: /* @__PURE__ */
|
|
5627
|
+
/* @__PURE__ */ r(Nn, { children: /* @__PURE__ */ u("div", { className: "space-y-4", children: [
|
|
5622
5628
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r(
|
|
5623
5629
|
P,
|
|
5624
5630
|
{
|
|
@@ -5630,8 +5636,8 @@ const mc = () => {
|
|
|
5630
5636
|
children: e("Copy from OG Settings")
|
|
5631
5637
|
}
|
|
5632
5638
|
) }),
|
|
5633
|
-
/* @__PURE__ */
|
|
5634
|
-
/* @__PURE__ */
|
|
5639
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5640
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5635
5641
|
/* @__PURE__ */ r(ne, { className: "text-xs", htmlFor: "searchTitle", children: e("Search Title") }),
|
|
5636
5642
|
b && /* @__PURE__ */ r(
|
|
5637
5643
|
Je,
|
|
@@ -5650,14 +5656,14 @@ const mc = () => {
|
|
|
5650
5656
|
name: "searchTitle",
|
|
5651
5657
|
value: h.searchTitle,
|
|
5652
5658
|
onChange: re,
|
|
5653
|
-
disabled:
|
|
5659
|
+
disabled: v || !b,
|
|
5654
5660
|
placeholder: e("Enter search title"),
|
|
5655
5661
|
readOnly: !b
|
|
5656
5662
|
}
|
|
5657
5663
|
)
|
|
5658
5664
|
] }),
|
|
5659
|
-
/* @__PURE__ */
|
|
5660
|
-
/* @__PURE__ */
|
|
5665
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5666
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5661
5667
|
/* @__PURE__ */ r(ne, { className: "text-xs", htmlFor: "searchDescription", children: e("Search Description") }),
|
|
5662
5668
|
b && /* @__PURE__ */ r(
|
|
5663
5669
|
Je,
|
|
@@ -5677,17 +5683,17 @@ const mc = () => {
|
|
|
5677
5683
|
value: h.searchDescription,
|
|
5678
5684
|
onChange: re,
|
|
5679
5685
|
placeholder: e("Enter search description"),
|
|
5680
|
-
disabled:
|
|
5686
|
+
disabled: v || !b,
|
|
5681
5687
|
readOnly: !b
|
|
5682
5688
|
}
|
|
5683
5689
|
)
|
|
5684
5690
|
] })
|
|
5685
5691
|
] }) })
|
|
5686
5692
|
] }),
|
|
5687
|
-
/* @__PURE__ */
|
|
5693
|
+
/* @__PURE__ */ u(Sn, { value: "jsonLD", className: "border-none", children: [
|
|
5688
5694
|
/* @__PURE__ */ r(wn, { className: "font-bold text-slate-700", children: e("JSON-LD") }),
|
|
5689
|
-
/* @__PURE__ */ r(Nn, { children: /* @__PURE__ */ r("div", { className: "space-y-4", children: /* @__PURE__ */
|
|
5690
|
-
/* @__PURE__ */
|
|
5695
|
+
/* @__PURE__ */ r(Nn, { children: /* @__PURE__ */ r("div", { className: "space-y-4", children: /* @__PURE__ */ u("div", { className: "space-y-1", children: [
|
|
5696
|
+
/* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
|
|
5691
5697
|
/* @__PURE__ */ r(ne, { className: "text-xs", htmlFor: "jsonLD", children: e("JSON-LD") }),
|
|
5692
5698
|
b && /* @__PURE__ */ r(
|
|
5693
5699
|
Je,
|
|
@@ -5707,7 +5713,7 @@ const mc = () => {
|
|
|
5707
5713
|
value: h.jsonLD,
|
|
5708
5714
|
onChange: re,
|
|
5709
5715
|
placeholder: e("Enter JSON-LD"),
|
|
5710
|
-
disabled:
|
|
5716
|
+
disabled: v || !b,
|
|
5711
5717
|
readOnly: !b
|
|
5712
5718
|
}
|
|
5713
5719
|
)
|
|
@@ -5721,7 +5727,7 @@ const mc = () => {
|
|
|
5721
5727
|
size: "lg",
|
|
5722
5728
|
variant: "default",
|
|
5723
5729
|
onClick: C,
|
|
5724
|
-
disabled: ds(
|
|
5730
|
+
disabled: ds(E.current.initial, h) || v || !b,
|
|
5725
5731
|
children: e(w ? "Saving..." : "Save")
|
|
5726
5732
|
}
|
|
5727
5733
|
) })
|
|
@@ -5740,7 +5746,7 @@ const sa = "seo", gc = ({
|
|
|
5740
5746
|
className: "my-1",
|
|
5741
5747
|
onClick: t,
|
|
5742
5748
|
variant: e ? "default" : "ghost",
|
|
5743
|
-
children: /* @__PURE__ */
|
|
5749
|
+
children: /* @__PURE__ */ u(
|
|
5744
5750
|
"svg",
|
|
5745
5751
|
{
|
|
5746
5752
|
className: "w-4 h-4",
|
|
@@ -5765,19 +5771,19 @@ const sa = "seo", gc = ({
|
|
|
5765
5771
|
width: 600
|
|
5766
5772
|
}, yc = "user-info", vc = () => {
|
|
5767
5773
|
const { user: e, logout: t } = gt(), n = Ae(), s = ot("onLogout", ni);
|
|
5768
|
-
return e ? /* @__PURE__ */
|
|
5774
|
+
return e ? /* @__PURE__ */ u(qi, { children: [
|
|
5769
5775
|
/* @__PURE__ */ r(Vi, { asChild: !0, children: /* @__PURE__ */ r(P, { variant: "ghost", className: "text-sm font-medium", children: /* @__PURE__ */ r(vl, { className: "w-4 h-4" }) }) }),
|
|
5770
|
-
/* @__PURE__ */
|
|
5776
|
+
/* @__PURE__ */ u(ji, { className: "w-auto p-4 space-y-2", children: [
|
|
5771
5777
|
/* @__PURE__ */ r("div", { className: "text-sm font-medium", children: e.name ?? e.email }),
|
|
5772
5778
|
/* @__PURE__ */ r("div", { className: "text-xs text-muted-foreground", children: e.email }),
|
|
5773
|
-
/* @__PURE__ */
|
|
5779
|
+
/* @__PURE__ */ u(mr, { children: [
|
|
5774
5780
|
/* @__PURE__ */ r(fr, { asChild: !0, children: /* @__PURE__ */ r(P, { variant: "outline", size: "sm", className: "w-full", children: "Logout" }) }),
|
|
5775
|
-
/* @__PURE__ */
|
|
5776
|
-
/* @__PURE__ */
|
|
5781
|
+
/* @__PURE__ */ u(gr, { children: [
|
|
5782
|
+
/* @__PURE__ */ u(pr, { children: [
|
|
5777
5783
|
/* @__PURE__ */ r(yr, { children: "Are you sure you want to logout?" }),
|
|
5778
5784
|
/* @__PURE__ */ r(vr, { children: "You will be redirected to the login page." })
|
|
5779
5785
|
] }),
|
|
5780
|
-
/* @__PURE__ */
|
|
5786
|
+
/* @__PURE__ */ u(Er, { children: [
|
|
5781
5787
|
/* @__PURE__ */ r(br, { children: "Cancel" }),
|
|
5782
5788
|
/* @__PURE__ */ r(
|
|
5783
5789
|
Sr,
|
|
@@ -5827,19 +5833,19 @@ var Sc = (e, t) => e === t, Dn = Symbol("solid-proxy"), ra = typeof Proxy == "fu
|
|
|
5827
5833
|
cleanups: null,
|
|
5828
5834
|
context: null,
|
|
5829
5835
|
owner: null
|
|
5830
|
-
}, Yn = {}, ae = null, Qn = null, wc = null,
|
|
5836
|
+
}, Yn = {}, ae = null, Qn = null, wc = null, ue = null, Le = null, tt = null, Vn = 0;
|
|
5831
5837
|
function dt(e, t) {
|
|
5832
|
-
const n =
|
|
5838
|
+
const n = ue, s = ae, a = e.length === 0, i = t === void 0 ? s : t, l = a ? la : {
|
|
5833
5839
|
owned: null,
|
|
5834
5840
|
cleanups: null,
|
|
5835
5841
|
context: i ? i.context : null,
|
|
5836
5842
|
owner: i
|
|
5837
5843
|
}, o = a ? e : () => e(() => Ie(() => Yt(l)));
|
|
5838
|
-
ae = l,
|
|
5844
|
+
ae = l, ue = null;
|
|
5839
5845
|
try {
|
|
5840
5846
|
return Ze(o, !0);
|
|
5841
5847
|
} finally {
|
|
5842
|
-
|
|
5848
|
+
ue = n, ae = s;
|
|
5843
5849
|
}
|
|
5844
5850
|
}
|
|
5845
5851
|
function we(e, t) {
|
|
@@ -5876,11 +5882,11 @@ function Ac(e) {
|
|
|
5876
5882
|
function xc(e, t, n) {
|
|
5877
5883
|
let s, a, i;
|
|
5878
5884
|
arguments.length === 1 ? (s = !0, a = e, i = {}) : (s = e, a = t, i = {});
|
|
5879
|
-
let l = null, o = Yn,
|
|
5880
|
-
const
|
|
5885
|
+
let l = null, o = Yn, c = null, d = !1, h = "initialValue" in i, f = typeof s == "function" && Be(s);
|
|
5886
|
+
const E = /* @__PURE__ */ new Set(), [p, y] = (i.storage || we)(i.initialValue), [w, v] = we(void 0), [I, b] = we(void 0, {
|
|
5881
5887
|
equals: !1
|
|
5882
5888
|
}), [C, S] = we(h ? "ready" : "unresolved");
|
|
5883
|
-
V.context && (
|
|
5889
|
+
V.context && (c = V.getNextContextId(), i.ssrLoadFrom === "initial" ? o = i.initialValue : V.load && V.has(c) && (o = V.load(c)));
|
|
5884
5890
|
function L(Y, q, J, R) {
|
|
5885
5891
|
return l === Y && (l = null, R !== void 0 && (h = !0), (Y === o || q === o) && i.onHydrated && queueMicrotask(
|
|
5886
5892
|
() => i.onHydrated(R, {
|
|
@@ -5890,17 +5896,17 @@ function xc(e, t, n) {
|
|
|
5890
5896
|
}
|
|
5891
5897
|
function O(Y, q) {
|
|
5892
5898
|
Ze(() => {
|
|
5893
|
-
q === void 0 &&
|
|
5894
|
-
for (const J of
|
|
5899
|
+
q === void 0 && y(() => Y), S(q !== void 0 ? "errored" : h ? "ready" : "unresolved"), v(q);
|
|
5900
|
+
for (const J of E.keys())
|
|
5895
5901
|
J.decrement();
|
|
5896
|
-
|
|
5902
|
+
E.clear();
|
|
5897
5903
|
}, !1);
|
|
5898
5904
|
}
|
|
5899
5905
|
function re() {
|
|
5900
|
-
const Y = Ic, q =
|
|
5906
|
+
const Y = Ic, q = p(), J = w();
|
|
5901
5907
|
if (J !== void 0 && !l)
|
|
5902
5908
|
throw J;
|
|
5903
|
-
return
|
|
5909
|
+
return ue && ue.user, q;
|
|
5904
5910
|
}
|
|
5905
5911
|
function D(Y = !0) {
|
|
5906
5912
|
if (Y !== !1 && d)
|
|
@@ -5908,12 +5914,12 @@ function xc(e, t, n) {
|
|
|
5908
5914
|
d = !1;
|
|
5909
5915
|
const q = f ? f() : s;
|
|
5910
5916
|
if (q == null || q === !1) {
|
|
5911
|
-
L(l, Ie(
|
|
5917
|
+
L(l, Ie(p));
|
|
5912
5918
|
return;
|
|
5913
5919
|
}
|
|
5914
5920
|
const J = o !== Yn ? o : Ie(
|
|
5915
5921
|
() => a(q, {
|
|
5916
|
-
value:
|
|
5922
|
+
value: p(),
|
|
5917
5923
|
refetching: Y
|
|
5918
5924
|
})
|
|
5919
5925
|
);
|
|
@@ -5944,14 +5950,14 @@ function xc(e, t, n) {
|
|
|
5944
5950
|
const Y = w();
|
|
5945
5951
|
if (Y && !l)
|
|
5946
5952
|
throw Y;
|
|
5947
|
-
return
|
|
5953
|
+
return p();
|
|
5948
5954
|
}
|
|
5949
5955
|
}
|
|
5950
5956
|
}), f ? Nc(() => D(!1)) : D(!1), [
|
|
5951
5957
|
re,
|
|
5952
5958
|
{
|
|
5953
5959
|
refetch: D,
|
|
5954
|
-
mutate:
|
|
5960
|
+
mutate: y
|
|
5955
5961
|
}
|
|
5956
5962
|
];
|
|
5957
5963
|
}
|
|
@@ -5959,14 +5965,14 @@ function gd(e) {
|
|
|
5959
5965
|
return Ze(e, !1);
|
|
5960
5966
|
}
|
|
5961
5967
|
function Ie(e) {
|
|
5962
|
-
if (
|
|
5968
|
+
if (ue === null)
|
|
5963
5969
|
return e();
|
|
5964
|
-
const t =
|
|
5965
|
-
|
|
5970
|
+
const t = ue;
|
|
5971
|
+
ue = null;
|
|
5966
5972
|
try {
|
|
5967
5973
|
return e();
|
|
5968
5974
|
} finally {
|
|
5969
|
-
|
|
5975
|
+
ue = t;
|
|
5970
5976
|
}
|
|
5971
5977
|
}
|
|
5972
5978
|
function pd(e, t, n) {
|
|
@@ -5982,8 +5988,8 @@ function pd(e, t, n) {
|
|
|
5982
5988
|
o = e();
|
|
5983
5989
|
if (i)
|
|
5984
5990
|
return i = !1, l;
|
|
5985
|
-
const
|
|
5986
|
-
return a = o,
|
|
5991
|
+
const c = Ie(() => t(o, a, l));
|
|
5992
|
+
return a = o, c;
|
|
5987
5993
|
};
|
|
5988
5994
|
}
|
|
5989
5995
|
function Tc(e) {
|
|
@@ -5996,22 +6002,22 @@ function Zs() {
|
|
|
5996
6002
|
return ae;
|
|
5997
6003
|
}
|
|
5998
6004
|
function Cc(e, t) {
|
|
5999
|
-
const n = ae, s =
|
|
6000
|
-
ae = e,
|
|
6005
|
+
const n = ae, s = ue;
|
|
6006
|
+
ae = e, ue = null;
|
|
6001
6007
|
try {
|
|
6002
6008
|
return Ze(t, !0);
|
|
6003
6009
|
} catch (a) {
|
|
6004
6010
|
Us(a);
|
|
6005
6011
|
} finally {
|
|
6006
|
-
ae = n,
|
|
6012
|
+
ae = n, ue = s;
|
|
6007
6013
|
}
|
|
6008
6014
|
}
|
|
6009
6015
|
function Pc(e) {
|
|
6010
|
-
const t =
|
|
6016
|
+
const t = ue, n = ae;
|
|
6011
6017
|
return Promise.resolve().then(() => {
|
|
6012
|
-
|
|
6018
|
+
ue = t, ae = n;
|
|
6013
6019
|
let s;
|
|
6014
|
-
return Ze(e, !1),
|
|
6020
|
+
return Ze(e, !1), ue = ae = null, s ? s.done : void 0;
|
|
6015
6021
|
});
|
|
6016
6022
|
}
|
|
6017
6023
|
var [_c, yd] = /* @__PURE__ */ we(!1);
|
|
@@ -6046,9 +6052,9 @@ function ua() {
|
|
|
6046
6052
|
const e = Le;
|
|
6047
6053
|
Le = null, Ze(() => Rn(this), !1), Le = e;
|
|
6048
6054
|
}
|
|
6049
|
-
if (
|
|
6055
|
+
if (ue) {
|
|
6050
6056
|
const e = this.observers ? this.observers.length : 0;
|
|
6051
|
-
|
|
6057
|
+
ue.sources ? (ue.sources.push(this), ue.sourceSlots.push(e)) : (ue.sources = [this], ue.sourceSlots = [e]), this.observers ? (this.observers.push(ue), this.observerSlots.push(ue.sources.length - 1)) : (this.observers = [ue], this.observerSlots = [ue.sources.length - 1]);
|
|
6052
6058
|
}
|
|
6053
6059
|
return this.value;
|
|
6054
6060
|
}
|
|
@@ -6076,14 +6082,14 @@ function Mt(e) {
|
|
|
6076
6082
|
}
|
|
6077
6083
|
function kc(e, t, n) {
|
|
6078
6084
|
let s;
|
|
6079
|
-
const a = ae, i =
|
|
6080
|
-
|
|
6085
|
+
const a = ae, i = ue;
|
|
6086
|
+
ue = ae = e;
|
|
6081
6087
|
try {
|
|
6082
6088
|
s = e.fn(t);
|
|
6083
6089
|
} catch (l) {
|
|
6084
6090
|
return e.pure && (e.state = st, e.owned && e.owned.forEach(Yt), e.owned = null), e.updatedAt = n + 1, Us(l);
|
|
6085
6091
|
} finally {
|
|
6086
|
-
|
|
6092
|
+
ue = i, ae = a;
|
|
6087
6093
|
}
|
|
6088
6094
|
(!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? da(e, s) : e.value = s, e.updatedAt = n);
|
|
6089
6095
|
}
|
|
@@ -6243,56 +6249,56 @@ function Bn(e) {
|
|
|
6243
6249
|
function Uc(e, t, n = {}) {
|
|
6244
6250
|
let s = [], a = [], i = [], l = 0, o = t.length > 1 ? [] : null;
|
|
6245
6251
|
return Wt(() => Bn(i)), () => {
|
|
6246
|
-
let
|
|
6247
|
-
return
|
|
6248
|
-
let
|
|
6252
|
+
let c = e() || [], d = c.length, h, f;
|
|
6253
|
+
return c[aa], Ie(() => {
|
|
6254
|
+
let p, y, w, v, I, b, C, S, L;
|
|
6249
6255
|
if (d === 0)
|
|
6250
6256
|
l !== 0 && (Bn(i), i = [], s = [], a = [], l = 0, o && (o = [])), n.fallback && (s = [ns], a[0] = dt((O) => (i[0] = O, n.fallback())), l = 1);
|
|
6251
6257
|
else if (l === 0) {
|
|
6252
6258
|
for (a = new Array(d), f = 0; f < d; f++)
|
|
6253
|
-
s[f] =
|
|
6259
|
+
s[f] = c[f], a[f] = dt(E);
|
|
6254
6260
|
l = d;
|
|
6255
6261
|
} else {
|
|
6256
|
-
for (w = new Array(d),
|
|
6262
|
+
for (w = new Array(d), v = new Array(d), o && (I = new Array(d)), b = 0, C = Math.min(l, d); b < C && s[b] === c[b]; b++)
|
|
6257
6263
|
;
|
|
6258
|
-
for (C = l - 1, S = d - 1; C >= b && S >= b && s[C] ===
|
|
6259
|
-
w[S] = a[C],
|
|
6260
|
-
for (
|
|
6261
|
-
L =
|
|
6264
|
+
for (C = l - 1, S = d - 1; C >= b && S >= b && s[C] === c[S]; C--, S--)
|
|
6265
|
+
w[S] = a[C], v[S] = i[C], o && (I[S] = o[C]);
|
|
6266
|
+
for (p = /* @__PURE__ */ new Map(), y = new Array(S + 1), f = S; f >= b; f--)
|
|
6267
|
+
L = c[f], h = p.get(L), y[f] = h === void 0 ? -1 : h, p.set(L, f);
|
|
6262
6268
|
for (h = b; h <= C; h++)
|
|
6263
|
-
L = s[h], f =
|
|
6269
|
+
L = s[h], f = p.get(L), f !== void 0 && f !== -1 ? (w[f] = a[h], v[f] = i[h], o && (I[f] = o[h]), f = y[f], p.set(L, f)) : i[h]();
|
|
6264
6270
|
for (f = b; f < d; f++)
|
|
6265
|
-
f in w ? (a[f] = w[f], i[f] =
|
|
6266
|
-
a = a.slice(0, l = d), s =
|
|
6271
|
+
f in w ? (a[f] = w[f], i[f] = v[f], o && (o[f] = I[f], o[f](f))) : a[f] = dt(E);
|
|
6272
|
+
a = a.slice(0, l = d), s = c.slice(0);
|
|
6267
6273
|
}
|
|
6268
6274
|
return a;
|
|
6269
6275
|
});
|
|
6270
|
-
function
|
|
6271
|
-
if (i[f] =
|
|
6272
|
-
const [
|
|
6273
|
-
return o[f] = w, t(
|
|
6276
|
+
function E(p) {
|
|
6277
|
+
if (i[f] = p, o) {
|
|
6278
|
+
const [y, w] = we(f);
|
|
6279
|
+
return o[f] = w, t(c[f], y);
|
|
6274
6280
|
}
|
|
6275
|
-
return t(
|
|
6281
|
+
return t(c[f]);
|
|
6276
6282
|
}
|
|
6277
6283
|
};
|
|
6278
6284
|
}
|
|
6279
6285
|
function Oc(e, t, n = {}) {
|
|
6280
|
-
let s = [], a = [], i = [], l = [], o = 0,
|
|
6286
|
+
let s = [], a = [], i = [], l = [], o = 0, c;
|
|
6281
6287
|
return Wt(() => Bn(i)), () => {
|
|
6282
6288
|
const d = e() || [], h = d.length;
|
|
6283
6289
|
return d[aa], Ie(() => {
|
|
6284
6290
|
if (h === 0)
|
|
6285
|
-
return o !== 0 && (Bn(i), i = [], s = [], a = [], o = 0, l = []), n.fallback && (s = [ns], a[0] = dt((
|
|
6286
|
-
for (s[0] === ns && (i[0](), i = [], s = [], a = [], o = 0),
|
|
6287
|
-
|
|
6288
|
-
for (;
|
|
6289
|
-
i[
|
|
6291
|
+
return o !== 0 && (Bn(i), i = [], s = [], a = [], o = 0, l = []), n.fallback && (s = [ns], a[0] = dt((E) => (i[0] = E, n.fallback())), o = 1), a;
|
|
6292
|
+
for (s[0] === ns && (i[0](), i = [], s = [], a = [], o = 0), c = 0; c < h; c++)
|
|
6293
|
+
c < s.length && s[c] !== d[c] ? l[c](() => d[c]) : c >= s.length && (a[c] = dt(f));
|
|
6294
|
+
for (; c < s.length; c++)
|
|
6295
|
+
i[c]();
|
|
6290
6296
|
return o = l.length = i.length = h, s = d.slice(0), a = a.slice(0, o);
|
|
6291
6297
|
});
|
|
6292
|
-
function f(
|
|
6293
|
-
i[
|
|
6294
|
-
const [
|
|
6295
|
-
return l[
|
|
6298
|
+
function f(E) {
|
|
6299
|
+
i[c] = E;
|
|
6300
|
+
const [p, y] = we(d[c]);
|
|
6301
|
+
return l[c] = y, t(p, c);
|
|
6296
6302
|
}
|
|
6297
6303
|
};
|
|
6298
6304
|
}
|
|
@@ -6347,9 +6353,9 @@ function ga(...e) {
|
|
|
6347
6353
|
{
|
|
6348
6354
|
get(l) {
|
|
6349
6355
|
for (let o = e.length - 1; o >= 0; o--) {
|
|
6350
|
-
const
|
|
6351
|
-
if (
|
|
6352
|
-
return
|
|
6356
|
+
const c = Xn(e[o])[l];
|
|
6357
|
+
if (c !== void 0)
|
|
6358
|
+
return c;
|
|
6353
6359
|
}
|
|
6354
6360
|
},
|
|
6355
6361
|
has(l) {
|
|
@@ -6372,9 +6378,9 @@ function ga(...e) {
|
|
|
6372
6378
|
const o = e[l];
|
|
6373
6379
|
if (!o)
|
|
6374
6380
|
continue;
|
|
6375
|
-
const
|
|
6376
|
-
for (let d =
|
|
6377
|
-
const h =
|
|
6381
|
+
const c = Object.getOwnPropertyNames(o);
|
|
6382
|
+
for (let d = c.length - 1; d >= 0; d--) {
|
|
6383
|
+
const h = c[d];
|
|
6378
6384
|
if (h === "__proto__" || h === "constructor")
|
|
6379
6385
|
continue;
|
|
6380
6386
|
const f = Object.getOwnPropertyDescriptor(o, h);
|
|
@@ -6385,15 +6391,15 @@ function ga(...e) {
|
|
|
6385
6391
|
get: Rc.bind(n[h] = [f.get.bind(o)])
|
|
6386
6392
|
} : f.value !== void 0 ? f : void 0;
|
|
6387
6393
|
else {
|
|
6388
|
-
const
|
|
6389
|
-
|
|
6394
|
+
const E = n[h];
|
|
6395
|
+
E && (f.get ? E.push(f.get.bind(o)) : f.value !== void 0 && E.push(() => f.value));
|
|
6390
6396
|
}
|
|
6391
6397
|
}
|
|
6392
6398
|
}
|
|
6393
6399
|
const a = {}, i = Object.keys(s);
|
|
6394
6400
|
for (let l = i.length - 1; l >= 0; l--) {
|
|
6395
|
-
const o = i[l],
|
|
6396
|
-
|
|
6401
|
+
const o = i[l], c = s[o];
|
|
6402
|
+
c && c.get ? Object.defineProperty(a, o, c) : a[o] = c ? c.value : void 0;
|
|
6397
6403
|
}
|
|
6398
6404
|
return a;
|
|
6399
6405
|
}
|
|
@@ -6433,9 +6439,9 @@ function Bc(e, ...t) {
|
|
|
6433
6439
|
const n = {}, s = t.map(() => ({}));
|
|
6434
6440
|
for (const a of Object.getOwnPropertyNames(e)) {
|
|
6435
6441
|
const i = Object.getOwnPropertyDescriptor(e, a), l = !i.get && !i.set && i.enumerable && i.writable && i.configurable;
|
|
6436
|
-
let o = !1,
|
|
6442
|
+
let o = !1, c = 0;
|
|
6437
6443
|
for (const d of t)
|
|
6438
|
-
d.includes(a) && (o = !0, l ? s[
|
|
6444
|
+
d.includes(a) && (o = !0, l ? s[c][a] = i.value : Object.defineProperty(s[c], a, i)), ++c;
|
|
6439
6445
|
o || (l ? n[a] = i.value : Object.defineProperty(n, a, i));
|
|
6440
6446
|
}
|
|
6441
6447
|
return [...s, n];
|
|
@@ -6445,12 +6451,12 @@ function pa(e) {
|
|
|
6445
6451
|
const s = (a) => {
|
|
6446
6452
|
const i = V.context;
|
|
6447
6453
|
if (i) {
|
|
6448
|
-
const [o,
|
|
6454
|
+
const [o, c] = we();
|
|
6449
6455
|
V.count || (V.count = 0), V.count++, (n || (n = e())).then((d) => {
|
|
6450
|
-
!V.done && Vt(i), V.count--,
|
|
6456
|
+
!V.done && Vt(i), V.count--, c(() => d.default), Vt();
|
|
6451
6457
|
}), t = o;
|
|
6452
6458
|
} else if (!t) {
|
|
6453
|
-
const [o] = xc(() => (n || (n = e())).then((
|
|
6459
|
+
const [o] = xc(() => (n || (n = e())).then((c) => c.default));
|
|
6454
6460
|
t = o;
|
|
6455
6461
|
}
|
|
6456
6462
|
let l;
|
|
@@ -6460,8 +6466,8 @@ function pa(e) {
|
|
|
6460
6466
|
return l(a);
|
|
6461
6467
|
const o = V.context;
|
|
6462
6468
|
Vt(i);
|
|
6463
|
-
const
|
|
6464
|
-
return Vt(o),
|
|
6469
|
+
const c = l(a);
|
|
6470
|
+
return Vt(o), c;
|
|
6465
6471
|
}) : ""
|
|
6466
6472
|
);
|
|
6467
6473
|
};
|
|
@@ -6532,16 +6538,16 @@ function xd(e) {
|
|
|
6532
6538
|
const [i, l, o] = a();
|
|
6533
6539
|
if (i < 0)
|
|
6534
6540
|
return e.fallback;
|
|
6535
|
-
const
|
|
6536
|
-
return typeof
|
|
6537
|
-
() =>
|
|
6541
|
+
const c = o.children;
|
|
6542
|
+
return typeof c == "function" && c.length > 0 ? Ie(
|
|
6543
|
+
() => c(
|
|
6538
6544
|
t ? l : () => {
|
|
6539
6545
|
if (Ie(a)[0] !== i)
|
|
6540
6546
|
throw ya("Match");
|
|
6541
6547
|
return o.when;
|
|
6542
6548
|
}
|
|
6543
6549
|
)
|
|
6544
|
-
) :
|
|
6550
|
+
) : c;
|
|
6545
6551
|
},
|
|
6546
6552
|
void 0,
|
|
6547
6553
|
void 0
|
|
@@ -6728,7 +6734,7 @@ var $c = /* @__PURE__ */ new Set([
|
|
|
6728
6734
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
6729
6735
|
};
|
|
6730
6736
|
function Yc(e, t, n) {
|
|
6731
|
-
let s = n.length, a = t.length, i = s, l = 0, o = 0,
|
|
6737
|
+
let s = n.length, a = t.length, i = s, l = 0, o = 0, c = t[a - 1].nextSibling, d = null;
|
|
6732
6738
|
for (; l < a || o < i; ) {
|
|
6733
6739
|
if (t[l] === n[o]) {
|
|
6734
6740
|
l++, o++;
|
|
@@ -6737,7 +6743,7 @@ function Yc(e, t, n) {
|
|
|
6737
6743
|
for (; t[a - 1] === n[i - 1]; )
|
|
6738
6744
|
a--, i--;
|
|
6739
6745
|
if (a === l) {
|
|
6740
|
-
const h = i < s ? o ? n[o - 1].nextSibling : n[i - o] :
|
|
6746
|
+
const h = i < s ? o ? n[o - 1].nextSibling : n[i - o] : c;
|
|
6741
6747
|
for (; o < i; )
|
|
6742
6748
|
e.insertBefore(n[o++], h);
|
|
6743
6749
|
} else if (i === o)
|
|
@@ -6756,13 +6762,13 @@ function Yc(e, t, n) {
|
|
|
6756
6762
|
const h = d.get(t[l]);
|
|
6757
6763
|
if (h != null)
|
|
6758
6764
|
if (o < h && h < i) {
|
|
6759
|
-
let f = l,
|
|
6760
|
-
for (; ++f < a && f < i && !((
|
|
6761
|
-
|
|
6762
|
-
if (
|
|
6763
|
-
const
|
|
6765
|
+
let f = l, E = 1, p;
|
|
6766
|
+
for (; ++f < a && f < i && !((p = d.get(t[f])) == null || p !== h + E); )
|
|
6767
|
+
E++;
|
|
6768
|
+
if (E > h - o) {
|
|
6769
|
+
const y = t[l];
|
|
6764
6770
|
for (; o < h; )
|
|
6765
|
-
e.insertBefore(n[o++],
|
|
6771
|
+
e.insertBefore(n[o++], y);
|
|
6766
6772
|
} else
|
|
6767
6773
|
e.replaceChild(n[o++], t[l++]);
|
|
6768
6774
|
} else
|
|
@@ -6832,8 +6838,8 @@ function tu(e, t, n = {}) {
|
|
|
6832
6838
|
!o || o === "undefined" || t[o] || (Js(e, o, !1), delete n[o]);
|
|
6833
6839
|
}
|
|
6834
6840
|
for (i = 0, l = s.length; i < l; i++) {
|
|
6835
|
-
const o = s[i],
|
|
6836
|
-
!o || o === "undefined" || n[o] ===
|
|
6841
|
+
const o = s[i], c = !!t[o];
|
|
6842
|
+
!o || o === "undefined" || n[o] === c || !c || (Js(e, o, !0), n[o] = c);
|
|
6837
6843
|
}
|
|
6838
6844
|
return n;
|
|
6839
6845
|
}
|
|
@@ -6896,7 +6902,7 @@ function Js(e, t, n) {
|
|
|
6896
6902
|
e.classList.toggle(s[a], n);
|
|
6897
6903
|
}
|
|
6898
6904
|
function er(e, t, n, s, a, i, l) {
|
|
6899
|
-
let o,
|
|
6905
|
+
let o, c, d, h, f;
|
|
6900
6906
|
if (t === "style")
|
|
6901
6907
|
return nu(e, n, s);
|
|
6902
6908
|
if (t === "classList")
|
|
@@ -6906,46 +6912,46 @@ function er(e, t, n, s, a, i, l) {
|
|
|
6906
6912
|
if (t === "ref")
|
|
6907
6913
|
i || n(e);
|
|
6908
6914
|
else if (t.slice(0, 3) === "on:") {
|
|
6909
|
-
const
|
|
6910
|
-
s && e.removeEventListener(
|
|
6915
|
+
const E = t.slice(3);
|
|
6916
|
+
s && e.removeEventListener(E, s, typeof s != "function" && s), n && e.addEventListener(E, n, typeof n != "function" && n);
|
|
6911
6917
|
} else if (t.slice(0, 10) === "oncapture:") {
|
|
6912
|
-
const
|
|
6913
|
-
s && e.removeEventListener(
|
|
6918
|
+
const E = t.slice(10);
|
|
6919
|
+
s && e.removeEventListener(E, s, !0), n && e.addEventListener(E, n, !0);
|
|
6914
6920
|
} else if (t.slice(0, 2) === "on") {
|
|
6915
|
-
const
|
|
6916
|
-
if (!
|
|
6917
|
-
const
|
|
6918
|
-
e.removeEventListener(
|
|
6921
|
+
const E = t.slice(2).toLowerCase(), p = $c.has(E);
|
|
6922
|
+
if (!p && s) {
|
|
6923
|
+
const y = Array.isArray(s) ? s[0] : s;
|
|
6924
|
+
e.removeEventListener(E, y);
|
|
6919
6925
|
}
|
|
6920
|
-
(
|
|
6926
|
+
(p || n) && (eu(e, E, n, p), p && Qc([E]));
|
|
6921
6927
|
} else if (t.slice(0, 5) === "attr:")
|
|
6922
6928
|
rs(e, t.slice(5), n);
|
|
6923
6929
|
else if (t.slice(0, 5) === "bool:")
|
|
6924
6930
|
Zc(e, t.slice(5), n);
|
|
6925
|
-
else if ((f = t.slice(0, 5) === "prop:") || (d = Vc.has(t)) || !a && ((h = Kc(t, e.tagName)) || (
|
|
6931
|
+
else if ((f = t.slice(0, 5) === "prop:") || (d = Vc.has(t)) || !a && ((h = Kc(t, e.tagName)) || (c = qc.has(t))) || (o = e.nodeName.includes("-") || "is" in l)) {
|
|
6926
6932
|
if (f)
|
|
6927
|
-
t = t.slice(5),
|
|
6933
|
+
t = t.slice(5), c = !0;
|
|
6928
6934
|
else if (yt(e))
|
|
6929
6935
|
return n;
|
|
6930
|
-
t === "class" || t === "className" ? Jc(e, n) : o && !
|
|
6936
|
+
t === "class" || t === "className" ? Jc(e, n) : o && !c && !d ? e[lu(t)] = n : e[h || t] = n;
|
|
6931
6937
|
} else {
|
|
6932
|
-
const
|
|
6933
|
-
|
|
6938
|
+
const E = a && t.indexOf(":") > -1 && Wc[t.split(":")[0]];
|
|
6939
|
+
E ? Xc(e, E, t, n) : rs(e, jc[t] || t, n);
|
|
6934
6940
|
}
|
|
6935
6941
|
return n;
|
|
6936
6942
|
}
|
|
6937
6943
|
function Ea(e) {
|
|
6938
|
-
if (V.registry && V.events && V.events.find(([
|
|
6944
|
+
if (V.registry && V.events && V.events.find(([c, d]) => d === e))
|
|
6939
6945
|
return;
|
|
6940
6946
|
let t = e.target;
|
|
6941
|
-
const n = `$$${e.type}`, s = e.target, a = e.currentTarget, i = (
|
|
6947
|
+
const n = `$$${e.type}`, s = e.target, a = e.currentTarget, i = (c) => Object.defineProperty(e, "target", {
|
|
6942
6948
|
configurable: !0,
|
|
6943
|
-
value:
|
|
6949
|
+
value: c
|
|
6944
6950
|
}), l = () => {
|
|
6945
|
-
const
|
|
6946
|
-
if (
|
|
6951
|
+
const c = t[n];
|
|
6952
|
+
if (c && !t.disabled) {
|
|
6947
6953
|
const d = t[`${n}Data`];
|
|
6948
|
-
if (d !== void 0 ?
|
|
6954
|
+
if (d !== void 0 ? c.call(t, d, e) : c.call(t, e), e.cancelBubble)
|
|
6949
6955
|
return;
|
|
6950
6956
|
}
|
|
6951
6957
|
return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) && i(t.host), !0;
|
|
@@ -6959,9 +6965,9 @@ function Ea(e) {
|
|
|
6959
6965
|
return t || document;
|
|
6960
6966
|
}
|
|
6961
6967
|
}), V.registry && !V.done && (V.done = _$HY.done = !0), e.composedPath) {
|
|
6962
|
-
const
|
|
6963
|
-
i(
|
|
6964
|
-
for (let d = 0; d <
|
|
6968
|
+
const c = e.composedPath();
|
|
6969
|
+
i(c[0]);
|
|
6970
|
+
for (let d = 0; d < c.length - 2 && (t = c[d], !!l()); d++) {
|
|
6965
6971
|
if (t._$host) {
|
|
6966
6972
|
t = t._$host, o();
|
|
6967
6973
|
break;
|
|
@@ -6977,12 +6983,12 @@ function Qt(e, t, n, s, a) {
|
|
|
6977
6983
|
const i = yt(e);
|
|
6978
6984
|
if (i) {
|
|
6979
6985
|
!n && (n = [...e.childNodes]);
|
|
6980
|
-
let
|
|
6986
|
+
let c = [];
|
|
6981
6987
|
for (let d = 0; d < n.length; d++) {
|
|
6982
6988
|
const h = n[d];
|
|
6983
|
-
h.nodeType === 8 && h.data.slice(0, 2) === "!$" ? h.remove() :
|
|
6989
|
+
h.nodeType === 8 && h.data.slice(0, 2) === "!$" ? h.remove() : c.push(h);
|
|
6984
6990
|
}
|
|
6985
|
-
n =
|
|
6991
|
+
n = c;
|
|
6986
6992
|
}
|
|
6987
6993
|
for (; typeof n == "function"; )
|
|
6988
6994
|
n = n();
|
|
@@ -6993,8 +6999,8 @@ function Qt(e, t, n, s, a) {
|
|
|
6993
6999
|
if (i || l === "number" && (t = t.toString(), t === n))
|
|
6994
7000
|
return n;
|
|
6995
7001
|
if (o) {
|
|
6996
|
-
let
|
|
6997
|
-
|
|
7002
|
+
let c = n[0];
|
|
7003
|
+
c && c.nodeType === 3 ? c.data !== t && (c.data = t) : c = document.createTextNode(t), n = bt(e, n, s, c);
|
|
6998
7004
|
} else
|
|
6999
7005
|
n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t;
|
|
7000
7006
|
} else if (t == null || l === "boolean") {
|
|
@@ -7004,21 +7010,21 @@ function Qt(e, t, n, s, a) {
|
|
|
7004
7010
|
} else {
|
|
7005
7011
|
if (l === "function")
|
|
7006
7012
|
return ht(() => {
|
|
7007
|
-
let
|
|
7008
|
-
for (; typeof
|
|
7009
|
-
|
|
7010
|
-
n = Qt(e,
|
|
7013
|
+
let c = t();
|
|
7014
|
+
for (; typeof c == "function"; )
|
|
7015
|
+
c = c();
|
|
7016
|
+
n = Qt(e, c, n, s);
|
|
7011
7017
|
}), () => n;
|
|
7012
7018
|
if (Array.isArray(t)) {
|
|
7013
|
-
const
|
|
7014
|
-
if (is(
|
|
7015
|
-
return ht(() => n = Qt(e,
|
|
7019
|
+
const c = [], d = n && Array.isArray(n);
|
|
7020
|
+
if (is(c, t, n, a))
|
|
7021
|
+
return ht(() => n = Qt(e, c, n, s, !0)), () => n;
|
|
7016
7022
|
if (i) {
|
|
7017
|
-
if (!
|
|
7023
|
+
if (!c.length)
|
|
7018
7024
|
return n;
|
|
7019
7025
|
if (s === void 0)
|
|
7020
7026
|
return n = [...e.childNodes];
|
|
7021
|
-
let h =
|
|
7027
|
+
let h = c[0];
|
|
7022
7028
|
if (h.parentNode !== e)
|
|
7023
7029
|
return n;
|
|
7024
7030
|
const f = [h];
|
|
@@ -7026,11 +7032,11 @@ function Qt(e, t, n, s, a) {
|
|
|
7026
7032
|
f.push(h);
|
|
7027
7033
|
return n = f;
|
|
7028
7034
|
}
|
|
7029
|
-
if (
|
|
7035
|
+
if (c.length === 0) {
|
|
7030
7036
|
if (n = bt(e, n, s), o)
|
|
7031
7037
|
return n;
|
|
7032
|
-
} else d ? n.length === 0 ? tr(e,
|
|
7033
|
-
n =
|
|
7038
|
+
} else d ? n.length === 0 ? tr(e, c, s) : Yc(e, n, c) : (n && bt(e), tr(e, c));
|
|
7039
|
+
n = c;
|
|
7034
7040
|
} else if (t.nodeType) {
|
|
7035
7041
|
if (i && t.parentNode)
|
|
7036
7042
|
return n = o ? [t] : t;
|
|
@@ -7047,12 +7053,12 @@ function Qt(e, t, n, s, a) {
|
|
|
7047
7053
|
function is(e, t, n, s) {
|
|
7048
7054
|
let a = !1;
|
|
7049
7055
|
for (let i = 0, l = t.length; i < l; i++) {
|
|
7050
|
-
let o = t[i],
|
|
7056
|
+
let o = t[i], c = n && n[e.length], d;
|
|
7051
7057
|
if (!(o == null || o === !0 || o === !1))
|
|
7052
7058
|
if ((d = typeof o) == "object" && o.nodeType)
|
|
7053
7059
|
e.push(o);
|
|
7054
7060
|
else if (Array.isArray(o))
|
|
7055
|
-
a = is(e, o,
|
|
7061
|
+
a = is(e, o, c) || a;
|
|
7056
7062
|
else if (d === "function")
|
|
7057
7063
|
if (s) {
|
|
7058
7064
|
for (; typeof o == "function"; )
|
|
@@ -7060,13 +7066,13 @@ function is(e, t, n, s) {
|
|
|
7060
7066
|
a = is(
|
|
7061
7067
|
e,
|
|
7062
7068
|
Array.isArray(o) ? o : [o],
|
|
7063
|
-
Array.isArray(
|
|
7069
|
+
Array.isArray(c) ? c : [c]
|
|
7064
7070
|
) || a;
|
|
7065
7071
|
} else
|
|
7066
7072
|
e.push(o), a = !0;
|
|
7067
7073
|
else {
|
|
7068
7074
|
const h = String(o);
|
|
7069
|
-
|
|
7075
|
+
c && c.nodeType === 3 && c.data === h ? e.push(c) : e.push(document.createTextNode(h));
|
|
7070
7076
|
}
|
|
7071
7077
|
}
|
|
7072
7078
|
return a;
|
|
@@ -7084,8 +7090,8 @@ function bt(e, t, n, s) {
|
|
|
7084
7090
|
for (let l = t.length - 1; l >= 0; l--) {
|
|
7085
7091
|
const o = t[l];
|
|
7086
7092
|
if (a !== o) {
|
|
7087
|
-
const
|
|
7088
|
-
!i && !l ?
|
|
7093
|
+
const c = o.parentNode === e;
|
|
7094
|
+
!i && !l ? c ? e.replaceChild(a, o) : e.insertBefore(a, n) : c && o.remove();
|
|
7089
7095
|
} else
|
|
7090
7096
|
i = !0;
|
|
7091
7097
|
}
|
|
@@ -7108,18 +7114,18 @@ function _d(e) {
|
|
|
7108
7114
|
l && (Zs().user = l = !1), i || (i = Cc(a, () => Be(() => e.children)));
|
|
7109
7115
|
const o = s();
|
|
7110
7116
|
if (o instanceof HTMLHeadElement) {
|
|
7111
|
-
const [
|
|
7112
|
-
dt((f) => as(o, () =>
|
|
7117
|
+
const [c, d] = we(!1), h = () => d(!0);
|
|
7118
|
+
dt((f) => as(o, () => c() ? f() : i(), null)), Wt(h);
|
|
7113
7119
|
} else {
|
|
7114
|
-
const
|
|
7120
|
+
const c = ba(e.isSVG ? "g" : "div", e.isSVG), d = t && c.attachShadow ? c.attachShadow({
|
|
7115
7121
|
mode: "open"
|
|
7116
|
-
}) :
|
|
7117
|
-
Object.defineProperty(
|
|
7122
|
+
}) : c;
|
|
7123
|
+
Object.defineProperty(c, "_$host", {
|
|
7118
7124
|
get() {
|
|
7119
7125
|
return n.parentNode;
|
|
7120
7126
|
},
|
|
7121
7127
|
configurable: !0
|
|
7122
|
-
}), as(d, i), o.appendChild(
|
|
7128
|
+
}), as(d, i), o.appendChild(c), e.ref && e.ref(c), Wt(() => o.removeChild(c));
|
|
7123
7129
|
}
|
|
7124
7130
|
},
|
|
7125
7131
|
void 0,
|
|
@@ -7429,7 +7435,7 @@ var ku = (e, t) => {
|
|
|
7429
7435
|
} else if (Zt(s)) {
|
|
7430
7436
|
if (i === t.length - 2)
|
|
7431
7437
|
break;
|
|
7432
|
-
const
|
|
7438
|
+
const c = +l, d = +t[++i] == 0 ? "key" : "value", h = St(s, c);
|
|
7433
7439
|
switch (d) {
|
|
7434
7440
|
case "key":
|
|
7435
7441
|
s = h;
|
|
@@ -7449,8 +7455,8 @@ var ku = (e, t) => {
|
|
|
7449
7455
|
const i = +t[t.length - 2], l = St(s, i);
|
|
7450
7456
|
switch (+a == 0 ? "key" : "value") {
|
|
7451
7457
|
case "key": {
|
|
7452
|
-
const
|
|
7453
|
-
s.set(
|
|
7458
|
+
const c = n(l);
|
|
7459
|
+
s.set(c, s.get(l)), c !== l && s.delete(l);
|
|
7454
7460
|
break;
|
|
7455
7461
|
}
|
|
7456
7462
|
case "value": {
|
|
@@ -7505,7 +7511,7 @@ function Ou(e, t) {
|
|
|
7505
7511
|
return e.forEach((a) => {
|
|
7506
7512
|
if (a.length <= 1)
|
|
7507
7513
|
return;
|
|
7508
|
-
t || (a = a.map((o) => o.map(String)).sort((o,
|
|
7514
|
+
t || (a = a.map((o) => o.map(String)).sort((o, c) => o.length - c.length));
|
|
7509
7515
|
const [i, ...l] = a;
|
|
7510
7516
|
i.length === 0 ? s = l.map(Zn) : n[Zn(i)] = l.map(Zn);
|
|
7511
7517
|
}), s ? ls(n) ? [s] : [s, n] : ls(n) ? void 0 : n;
|
|
@@ -7514,42 +7520,42 @@ var Da = (e, t, n, s, a = [], i = [], l = /* @__PURE__ */ new Map()) => {
|
|
|
7514
7520
|
const o = Nu(e);
|
|
7515
7521
|
if (!o) {
|
|
7516
7522
|
Uu(e, a, t);
|
|
7517
|
-
const
|
|
7518
|
-
if (
|
|
7523
|
+
const p = l.get(e);
|
|
7524
|
+
if (p)
|
|
7519
7525
|
return s ? {
|
|
7520
7526
|
transformedValue: null
|
|
7521
|
-
} :
|
|
7527
|
+
} : p;
|
|
7522
7528
|
}
|
|
7523
7529
|
if (!Gu(e, n)) {
|
|
7524
|
-
const
|
|
7525
|
-
transformedValue:
|
|
7526
|
-
annotations: [
|
|
7530
|
+
const p = rr(e, n), y = p ? {
|
|
7531
|
+
transformedValue: p.value,
|
|
7532
|
+
annotations: [p.type]
|
|
7527
7533
|
} : {
|
|
7528
7534
|
transformedValue: e
|
|
7529
7535
|
};
|
|
7530
|
-
return o || l.set(e,
|
|
7536
|
+
return o || l.set(e, y), y;
|
|
7531
7537
|
}
|
|
7532
7538
|
if (kn(i, e))
|
|
7533
7539
|
return {
|
|
7534
7540
|
transformedValue: null
|
|
7535
7541
|
};
|
|
7536
|
-
const
|
|
7537
|
-
Rt(d, (
|
|
7538
|
-
if (
|
|
7539
|
-
throw new Error(`Detected property ${
|
|
7540
|
-
const w = Da(
|
|
7541
|
-
h[
|
|
7542
|
-
f[Aa(
|
|
7542
|
+
const c = rr(e, n), d = (c == null ? void 0 : c.value) ?? e, h = lt(d) ? [] : {}, f = {};
|
|
7543
|
+
Rt(d, (p, y) => {
|
|
7544
|
+
if (y === "__proto__" || y === "constructor" || y === "prototype")
|
|
7545
|
+
throw new Error(`Detected property ${y}. This is a prototype pollution risk, please remove it from your object.`);
|
|
7546
|
+
const w = Da(p, t, n, s, [...a, y], [...i, e], l);
|
|
7547
|
+
h[y] = w.transformedValue, lt(w.annotations) ? f[y] = w.annotations : Xt(w.annotations) && Rt(w.annotations, (v, I) => {
|
|
7548
|
+
f[Aa(y) + "." + I] = v;
|
|
7543
7549
|
});
|
|
7544
7550
|
});
|
|
7545
|
-
const
|
|
7551
|
+
const E = ls(f) ? {
|
|
7546
7552
|
transformedValue: h,
|
|
7547
|
-
annotations:
|
|
7553
|
+
annotations: c ? [c.type] : void 0
|
|
7548
7554
|
} : {
|
|
7549
7555
|
transformedValue: h,
|
|
7550
|
-
annotations:
|
|
7556
|
+
annotations: c ? [c.type, f] : f
|
|
7551
7557
|
};
|
|
7552
|
-
return o || l.set(e,
|
|
7558
|
+
return o || l.set(e, E), E;
|
|
7553
7559
|
};
|
|
7554
7560
|
function Ga(e) {
|
|
7555
7561
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
@@ -7754,19 +7760,19 @@ var Rd = (e, t = !1) => {
|
|
|
7754
7760
|
s.appendChild(a), s.id = "_goober", s.setAttribute("nonce", e), t ? t.appendChild(s) : document.head.appendChild(s);
|
|
7755
7761
|
}, wt, en, tn, nn, ct, sn, Nt, At, xt, Tt, Ct, Pt, rn, ir, ju = (ir = class {
|
|
7756
7762
|
constructor(e) {
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7763
|
+
ce(this, wt);
|
|
7764
|
+
ce(this, en);
|
|
7765
|
+
ce(this, tn);
|
|
7766
|
+
ce(this, nn);
|
|
7767
|
+
ce(this, ct, !1);
|
|
7768
|
+
ce(this, sn);
|
|
7769
|
+
ce(this, Nt);
|
|
7770
|
+
ce(this, At);
|
|
7771
|
+
ce(this, xt);
|
|
7772
|
+
ce(this, Tt);
|
|
7773
|
+
ce(this, Ct);
|
|
7774
|
+
ce(this, Pt);
|
|
7775
|
+
ce(this, rn);
|
|
7770
7776
|
const {
|
|
7771
7777
|
client: t,
|
|
7772
7778
|
queryFlavor: n,
|
|
@@ -7775,11 +7781,11 @@ var Rd = (e, t = !1) => {
|
|
|
7775
7781
|
buttonPosition: i,
|
|
7776
7782
|
position: l,
|
|
7777
7783
|
initialIsOpen: o,
|
|
7778
|
-
errorTypes:
|
|
7784
|
+
errorTypes: c,
|
|
7779
7785
|
styleNonce: d,
|
|
7780
7786
|
shadowDOMTarget: h
|
|
7781
7787
|
} = e;
|
|
7782
|
-
ie(this, wt, we(t)), ie(this, tn, n), ie(this, nn, s), ie(this, en, a), ie(this, sn, d), ie(this, Nt, h), ie(this, At, we(i)), ie(this, xt, we(l)), ie(this, Tt, we(o)), ie(this, Ct, we(
|
|
7788
|
+
ie(this, wt, we(t)), ie(this, tn, n), ie(this, nn, s), ie(this, en, a), ie(this, sn, d), ie(this, Nt, h), ie(this, At, we(i)), ie(this, xt, we(l)), ie(this, Tt, we(o)), ie(this, Ct, we(c));
|
|
7783
7789
|
}
|
|
7784
7790
|
setButtonPosition(e) {
|
|
7785
7791
|
F(this, At)[1](e);
|
|
@@ -7801,8 +7807,8 @@ var Rd = (e, t = !1) => {
|
|
|
7801
7807
|
throw new Error("Devtools is already mounted");
|
|
7802
7808
|
const t = va(() => {
|
|
7803
7809
|
const n = this, [s] = F(this, At), [a] = F(this, xt), [i] = F(this, Tt), [l] = F(this, Ct), [o] = F(this, wt);
|
|
7804
|
-
let
|
|
7805
|
-
return F(this, Pt) ?
|
|
7810
|
+
let c;
|
|
7811
|
+
return F(this, Pt) ? c = F(this, Pt) : (c = pa(() => import("./HO4MOOFI-BqUF7yRt.js")), ie(this, Pt, c)), Ra(F(this, sn), F(this, Nt)), fa(c, ga({
|
|
7806
7812
|
get queryFlavor() {
|
|
7807
7813
|
return F(n, tn);
|
|
7808
7814
|
},
|
|
@@ -7843,20 +7849,20 @@ var Rd = (e, t = !1) => {
|
|
|
7843
7849
|
}
|
|
7844
7850
|
}, wt = new WeakMap(), en = new WeakMap(), tn = new WeakMap(), nn = new WeakMap(), ct = new WeakMap(), sn = new WeakMap(), Nt = new WeakMap(), At = new WeakMap(), xt = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), Pt = new WeakMap(), rn = new WeakMap(), ir), _t, an, ln, on, ut, cn, It, kt, Lt, Dt, Gt, Ut, Ot, un, lr, Hu = (lr = class {
|
|
7845
7851
|
constructor(e) {
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7852
|
+
ce(this, _t);
|
|
7853
|
+
ce(this, an);
|
|
7854
|
+
ce(this, ln);
|
|
7855
|
+
ce(this, on);
|
|
7856
|
+
ce(this, ut, !1);
|
|
7857
|
+
ce(this, cn);
|
|
7858
|
+
ce(this, It);
|
|
7859
|
+
ce(this, kt);
|
|
7860
|
+
ce(this, Lt);
|
|
7861
|
+
ce(this, Dt);
|
|
7862
|
+
ce(this, Gt);
|
|
7863
|
+
ce(this, Ut);
|
|
7864
|
+
ce(this, Ot);
|
|
7865
|
+
ce(this, un);
|
|
7860
7866
|
const {
|
|
7861
7867
|
client: t,
|
|
7862
7868
|
queryFlavor: n,
|
|
@@ -7865,12 +7871,12 @@ var Rd = (e, t = !1) => {
|
|
|
7865
7871
|
buttonPosition: i,
|
|
7866
7872
|
position: l,
|
|
7867
7873
|
initialIsOpen: o,
|
|
7868
|
-
errorTypes:
|
|
7874
|
+
errorTypes: c,
|
|
7869
7875
|
styleNonce: d,
|
|
7870
7876
|
shadowDOMTarget: h,
|
|
7871
7877
|
onClose: f
|
|
7872
7878
|
} = e;
|
|
7873
|
-
ie(this, _t, we(t)), ie(this, ln, n), ie(this, on, s), ie(this, an, a), ie(this, cn, d), ie(this, It, h), ie(this, kt, we(i)), ie(this, Lt, we(l)), ie(this, Dt, we(o)), ie(this, Gt, we(
|
|
7879
|
+
ie(this, _t, we(t)), ie(this, ln, n), ie(this, on, s), ie(this, an, a), ie(this, cn, d), ie(this, It, h), ie(this, kt, we(i)), ie(this, Lt, we(l)), ie(this, Dt, we(o)), ie(this, Gt, we(c)), ie(this, Ut, we(f));
|
|
7874
7880
|
}
|
|
7875
7881
|
setButtonPosition(e) {
|
|
7876
7882
|
F(this, kt)[1](e);
|
|
@@ -7894,9 +7900,9 @@ var Rd = (e, t = !1) => {
|
|
|
7894
7900
|
if (F(this, ut))
|
|
7895
7901
|
throw new Error("Devtools is already mounted");
|
|
7896
7902
|
const t = va(() => {
|
|
7897
|
-
const n = this, [s] = F(this, kt), [a] = F(this, Lt), [i] = F(this, Dt), [l] = F(this, Gt), [o] = F(this, _t), [
|
|
7903
|
+
const n = this, [s] = F(this, kt), [a] = F(this, Lt), [i] = F(this, Dt), [l] = F(this, Gt), [o] = F(this, _t), [c] = F(this, Ut);
|
|
7898
7904
|
let d;
|
|
7899
|
-
return F(this, Ot) ? d = F(this, Ot) : (d = pa(() => import("./HUY7CZI3-
|
|
7905
|
+
return F(this, Ot) ? d = F(this, Ot) : (d = pa(() => import("./HUY7CZI3-BQnbnmHI.js")), ie(this, Ot, d)), Ra(F(this, cn), F(this, It)), fa(d, ga({
|
|
7900
7906
|
get queryFlavor() {
|
|
7901
7907
|
return F(n, ln);
|
|
7902
7908
|
},
|
|
@@ -7926,7 +7932,7 @@ var Rd = (e, t = !1) => {
|
|
|
7926
7932
|
return l();
|
|
7927
7933
|
},
|
|
7928
7934
|
get onClose() {
|
|
7929
|
-
return
|
|
7935
|
+
return c();
|
|
7930
7936
|
}
|
|
7931
7937
|
}));
|
|
7932
7938
|
}, e);
|
|
@@ -7946,7 +7952,7 @@ function Ku(e) {
|
|
|
7946
7952
|
initialIsOpen: i,
|
|
7947
7953
|
errorTypes: l,
|
|
7948
7954
|
styleNonce: o,
|
|
7949
|
-
shadowDOMTarget:
|
|
7955
|
+
shadowDOMTarget: c
|
|
7950
7956
|
} = e, [d] = ge.useState(
|
|
7951
7957
|
new ju({
|
|
7952
7958
|
client: t,
|
|
@@ -7958,7 +7964,7 @@ function Ku(e) {
|
|
|
7958
7964
|
initialIsOpen: i,
|
|
7959
7965
|
errorTypes: l,
|
|
7960
7966
|
styleNonce: o,
|
|
7961
|
-
shadowDOMTarget:
|
|
7967
|
+
shadowDOMTarget: c
|
|
7962
7968
|
})
|
|
7963
7969
|
);
|
|
7964
7970
|
return ge.useEffect(() => {
|
|
@@ -8036,7 +8042,7 @@ const Wu = () => {
|
|
|
8036
8042
|
})
|
|
8037
8043
|
});
|
|
8038
8044
|
}, Qu = ii(
|
|
8039
|
-
() => import("./digital-asset-manager-
|
|
8045
|
+
() => import("./digital-asset-manager-Biz2tg8j.js")
|
|
8040
8046
|
);
|
|
8041
8047
|
wl();
|
|
8042
8048
|
bi(ec);
|
|
@@ -8051,7 +8057,7 @@ const Xu = (e) => {
|
|
|
8051
8057
|
}
|
|
8052
8058
|
} = ac();
|
|
8053
8059
|
rc();
|
|
8054
|
-
const { data: l, isFetching: o } = $r(), { blocks:
|
|
8060
|
+
const { data: l, isFetching: o } = $r(), { blocks: c } = sc(l), { data: d } = pt(), { data: h } = De(), { mutateAsync: f } = jr(), E = tc(), { onSave: p } = ic(), { getPartialBlocks: y, getPartialBlockBlocks: w } = lc(), { aiContext: v, setAiContext: I } = _s(), { mutateAsync: b } = Zl(), [C, S] = T(!1), L = Q(
|
|
8055
8061
|
() => (d == null ? void 0 : d.fallbackLang) || "en",
|
|
8056
8062
|
[d]
|
|
8057
8063
|
), { data: O } = zr(), { data: re } = Wu(), { mutateAsync: D } = Yu();
|
|
@@ -8060,18 +8066,18 @@ const Xu = (e) => {
|
|
|
8060
8066
|
document.hidden ? S(!0) : S(!1);
|
|
8061
8067
|
};
|
|
8062
8068
|
return window.addEventListener("visibilitychange", R), () => window.removeEventListener("visibilitychange", R);
|
|
8063
|
-
}, []), t.current =
|
|
8069
|
+
}, []), t.current = c;
|
|
8064
8070
|
const Y = Q(() => {
|
|
8065
8071
|
const R = {};
|
|
8066
8072
|
return i && (R.permissions = W(i, "permissions", null), R.role = W(i, "role", "user")), R;
|
|
8067
8073
|
}, [i]), q = Pe(
|
|
8068
|
-
async (R,
|
|
8074
|
+
async (R, k) => await b({ pageType: R, query: k }),
|
|
8069
8075
|
[b]
|
|
8070
8076
|
), J = Q(
|
|
8071
8077
|
() => W(d, "theme", {}) || {},
|
|
8072
8078
|
[d]
|
|
8073
8079
|
);
|
|
8074
|
-
return /* @__PURE__ */
|
|
8080
|
+
return /* @__PURE__ */ u(be, { children: [
|
|
8075
8081
|
o && /* @__PURE__ */ r("div", { className: "absolute inset-0 z-50 flex items-center justify-center w-screen h-screen bg-white/30", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center bg-white rounded-full size-10", children: /* @__PURE__ */ r(Fr, { className: "size-5 animate-spin" }) }) }),
|
|
8076
8082
|
/* @__PURE__ */ r(
|
|
8077
8083
|
Ni,
|
|
@@ -8092,35 +8098,35 @@ const Xu = (e) => {
|
|
|
8092
8098
|
autoSaveInterval: e.autoSaveInterval ?? 15,
|
|
8093
8099
|
onError: e.onError || console.error,
|
|
8094
8100
|
getPartialBlockBlocks: w,
|
|
8095
|
-
getPartialBlocks:
|
|
8096
|
-
blocks: o ? [] :
|
|
8101
|
+
getPartialBlocks: y,
|
|
8102
|
+
blocks: o ? [] : c,
|
|
8097
8103
|
theme: ri(J),
|
|
8098
8104
|
pageTypes: h,
|
|
8099
8105
|
searchPageTypeItems: q,
|
|
8100
8106
|
saveAiContextCallback: async (R) => {
|
|
8101
8107
|
if (!s) return !0;
|
|
8102
|
-
const
|
|
8108
|
+
const k = t.current, M = {
|
|
8103
8109
|
_type: "@chai/ai-context",
|
|
8104
8110
|
_value: qs(R) ? R : ""
|
|
8105
|
-
}, ee = [...
|
|
8106
|
-
return await
|
|
8111
|
+
}, ee = [...k, M];
|
|
8112
|
+
return await p({ page: s, blocks: ee }), I(R), !0;
|
|
8107
8113
|
},
|
|
8108
|
-
aiContext:
|
|
8109
|
-
askAiCallBack:
|
|
8110
|
-
onSave: async ({ blocks: R, theme:
|
|
8114
|
+
aiContext: v,
|
|
8115
|
+
askAiCallBack: E,
|
|
8116
|
+
onSave: async ({ blocks: R, theme: k }) => {
|
|
8111
8117
|
if (!s) return !0;
|
|
8112
8118
|
t.current = R;
|
|
8113
8119
|
const M = {
|
|
8114
8120
|
_type: "@chai/ai-context",
|
|
8115
|
-
_value: qs(
|
|
8121
|
+
_value: qs(v) ? v : ""
|
|
8116
8122
|
}, ee = [...R, M];
|
|
8117
|
-
return await
|
|
8123
|
+
return await p({ page: s, blocks: ee }), t.current = ee, ds(k, J) || await f({ settings: { theme: k } }), !0;
|
|
8118
8124
|
},
|
|
8119
8125
|
themePanelComponent: lo,
|
|
8120
8126
|
...Y
|
|
8121
8127
|
}
|
|
8122
8128
|
),
|
|
8123
|
-
/* @__PURE__ */
|
|
8129
|
+
/* @__PURE__ */ u("div", { children: [
|
|
8124
8130
|
/* @__PURE__ */ r(Bl, {}),
|
|
8125
8131
|
/* @__PURE__ */ r(Ml, {})
|
|
8126
8132
|
] })
|
|
@@ -8147,7 +8153,7 @@ const Xu = (e) => {
|
|
|
8147
8153
|
a(!0);
|
|
8148
8154
|
}, 200), () => {
|
|
8149
8155
|
a(!1), n({});
|
|
8150
|
-
}), [e, n]), s ? /* @__PURE__ */
|
|
8156
|
+
}), [e, n]), s ? /* @__PURE__ */ u(oi, { client: Zu, children: [
|
|
8151
8157
|
t ? /* @__PURE__ */ r(Xu, { ...e }) : /* @__PURE__ */ r(uc, {}),
|
|
8152
8158
|
/* @__PURE__ */ r(zu, {})
|
|
8153
8159
|
] }) : /* @__PURE__ */ r("div", {});
|