@chaibuilder/pages 0.4.2 → 0.4.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.
@@ -7,11 +7,11 @@ import { jsx as r, jsxs as u, Fragment as be } from "react/jsx-runtime";
7
7
  import { get as te, isEmpty as me, reverse as Ra, sortBy as Ua, each as Oa, find as fe, set as Ba, has as nn, startsWith as Ut, isEqual as rs, map as Fe, toLower as Dt, trim as Ma, filter as Te, startCase as It, groupBy as Fa, includes as Mt, compact as Qs, concat as Xs, endsWith as Zs, orderBy as mn, first as qa, uniq as Ha, debounce as Ka, pick as Js, keys as Va, pickBy as ja, isArray as $a, cloneDeep as za, isString as ks } from "lodash-es";
8
8
  import { useAtom as Ln, atom as as } from "jotai";
9
9
  import * as ce from "react";
10
- import er, { useMemo as Y, useCallback as _e, useState as _, useEffect as we, useRef as ct } from "react";
10
+ import er, { useMemo as Y, useCallback as _e, useState as P, useEffect as we, useRef as ct } from "react";
11
11
  import { useQueryClient as Se, useQuery as Ne, useMutation as Ae, onlineManager as tr, QueryClient as Wa, QueryClientProvider as Ya } from "@tanstack/react-query";
12
12
  import { toast as j } from "sonner";
13
13
  import { useLanguages as ut, useUpdateBlocksPropsRealtime as nr, PERMISSIONS as Qa, usePartailBlocksStore as Xa, usePermissions as sn, useLibraryBlocks as Za, useTheme as Ja, mergeClasses as ei, useSavePage as sr, useRightPanel as ti, useBlocksStore as ni, getBlocksFromHTML as si, useTranslation as ri, useSidebarActivePanel as ai, registerChaiSidebarPanel as $n, registerChaiTopBar as ii, registerChaiSaveToLibrary as li, registerChaiMediaManager as oi, ChaiBuilderEditor as ci } from "@chaibuilder/sdk";
14
- import { Card as is, CardHeader as ls, CardTitle as os, CardContent as cs, CardFooter as us, Button as P, AlertDialog as rr, AlertDialogTrigger as ar, AlertDialogContent as ir, AlertDialogHeader as lr, AlertDialogTitle as or, AlertDialogDescription as cr, AlertDialogFooter as ur, AlertDialogCancel as dr, AlertDialogAction as hr, Popover as mr, PopoverTrigger as fr, PopoverContent as gr, Input as ye, Label as X, Dialog as He, DialogContent as Ke, DialogHeader as Ve, DialogTitle as je, DialogDescription as Ye, Alert as pr, DialogFooter as et, DropdownMenu as rn, DropdownMenuTrigger as an, DropdownMenuContent as ln, DropdownMenuItem as De, Textarea as Gt, Select as ui, SelectTrigger as di, SelectValue as hi, SelectContent as mi, SelectItem as fi, Badge as Fn, Sheet as yr, SheetContent as vr, SheetHeader as Er, SheetTitle as br, Separator as gi, TooltipProvider as wr, Tooltip as ds, SheetTrigger as pi, TooltipTrigger as hs, ScrollArea as yi, TooltipContent as ms, Skeleton as fn, DropdownMenuSeparator as vi, CardDescription as Ei, Command as bi, CommandInput as wi, CommandList as Si, CommandEmpty as Ni, CommandGroup as Ai, CommandItem as Ls, AlertDescription as xi, Accordion as Ti, AccordionItem as gn, AccordionTrigger as pn, AccordionContent as yn, HoverCard as Ci, HoverCardTrigger as Pi, HoverCardContent as _i } from "@chaibuilder/sdk/ui";
14
+ import { Card as is, CardHeader as ls, CardTitle as os, CardContent as cs, CardFooter as us, Button as _, AlertDialog as rr, AlertDialogTrigger as ar, AlertDialogContent as ir, AlertDialogHeader as lr, AlertDialogTitle as or, AlertDialogDescription as cr, AlertDialogFooter as ur, AlertDialogCancel as dr, AlertDialogAction as hr, Popover as mr, PopoverTrigger as fr, PopoverContent as gr, Input as ye, Label as X, Dialog as He, DialogContent as Ke, DialogHeader as Ve, DialogTitle as je, DialogDescription as Ye, Alert as pr, DialogFooter as et, DropdownMenu as rn, DropdownMenuTrigger as an, DropdownMenuContent as ln, DropdownMenuItem as De, Textarea as Gt, Select as ui, SelectTrigger as di, SelectValue as hi, SelectContent as mi, SelectItem as fi, Badge as Fn, Sheet as yr, SheetContent as vr, SheetHeader as Er, SheetTitle as br, Separator as gi, TooltipProvider as wr, Tooltip as ds, SheetTrigger as pi, TooltipTrigger as hs, ScrollArea as yi, TooltipContent as ms, Skeleton as fn, DropdownMenuSeparator as vi, CardDescription as Ei, Command as bi, CommandInput as wi, CommandList as Si, CommandEmpty as Ni, CommandGroup as Ai, CommandItem as Ls, AlertDescription as xi, Accordion as Ti, AccordionItem as gn, AccordionTrigger as pn, AccordionContent as yn, HoverCard as Ci, HoverCardTrigger as Pi, HoverCardContent as _i } from "@chaibuilder/sdk/ui";
15
15
  import { LockIcon as Sr, UserIcon as Ii, AlertTriangleIcon as ki, Trash2 as Nr, Plus as fs, ImageIcon as Ar, X as xr, AlertCircle as Tr, StarIcon as Li, MoreHorizontal as gs, PencilIcon as Di, Power as Cr, TrashIcon as Gi, Tag as Ri, File as on, Search as Ui, StarsIcon as Oi, Globe as Bi, Pencil as Mi, Trash as ps, SquareLibrary as Ds, Logs as Fi, Loader as Pr, Languages as qi, ChevronDown as _r, Star as Hi, History as Gs, ArrowUpRight as Ki, Clock as Vi, Undo2 as Ir, CloudOff as ji, Edit as $i, Save as kr, GlobeIcon as zi, Eye as Lr, Palette as Wi, CheckCircle as Yi, Send as Rs, Rocket as Us, Settings as Qi, ExternalLink as Xi, EyeOff as Zi, Loader2 as Dr, LanguagesIcon as Ji, DatabaseIcon as el, ChevronLeft as tl, ChevronRight as nl, User as sl } from "lucide-react";
16
16
  import { format as Dn, formatDistanceToNow as rl } from "date-fns";
17
17
  import { useRegisteredChaiBlocks as al, getDefaultBlockProps as il } from "@chaibuilder/runtime";
@@ -297,18 +297,18 @@ function ml(e = () => {
297
297
  const i = {
298
298
  getItem: (c, h) => {
299
299
  var g, d;
300
- const w = (y) => {
301
- if (y = y || "", s !== y) {
300
+ const w = (p) => {
301
+ if (p = p || "", s !== p) {
302
302
  try {
303
- a = JSON.parse(y, t == null ? void 0 : t.reviver);
303
+ a = JSON.parse(p, t == null ? void 0 : t.reviver);
304
304
  } catch {
305
305
  return h;
306
306
  }
307
- s = y;
307
+ s = p;
308
308
  }
309
309
  return a;
310
- }, p = (d = (g = e()) == null ? void 0 : g.getItem(c)) != null ? d : null;
311
- return hl(p) ? p.then(w) : w(p);
310
+ }, y = (d = (g = e()) == null ? void 0 : g.getItem(c)) != null ? d : null;
311
+ return hl(y) ? y.then(w) : w(y);
312
312
  },
313
313
  setItem: (c, h) => {
314
314
  var g;
@@ -322,13 +322,13 @@ function ml(e = () => {
322
322
  return (h = e()) == null ? void 0 : h.removeItem(c);
323
323
  }
324
324
  }, l = (c) => (h, g, d) => c(h, (w) => {
325
- let p;
325
+ let y;
326
326
  try {
327
- p = JSON.parse(w || "");
327
+ y = JSON.parse(w || "");
328
328
  } catch {
329
- p = d;
329
+ y = d;
330
330
  }
331
- g(p);
331
+ g(y);
332
332
  });
333
333
  let o;
334
334
  try {
@@ -509,7 +509,7 @@ const pl = gl("__chai_user", null), st = () => {
509
509
  });
510
510
  };
511
511
  function Re() {
512
- const [e, t] = _(
512
+ const [e, t] = P(
513
513
  new URLSearchParams(window.location.search)
514
514
  );
515
515
  return we(() => {
@@ -649,7 +649,7 @@ function Nl({
649
649
  onTakeOver: s,
650
650
  currentEditor: a
651
651
  }) {
652
- const [i, l] = _(!1);
652
+ const [i, l] = P(!1);
653
653
  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(is, { className: "w-full max-w-md mx-auto", children: [
654
654
  /* @__PURE__ */ r(ls, { className: "space-y-1", children: /* @__PURE__ */ u(os, { className: "flex items-center gap-2 text-2xl", children: [
655
655
  /* @__PURE__ */ r(Sr, { className: "w-6 h-6 text-yellow-500" }),
@@ -673,7 +673,7 @@ function Nl({
673
673
  /* @__PURE__ */ r("div", { className: "text-sm mt-4", children: /* @__PURE__ */ r("p", { children: "This user is currently editing the page. You cannot make changes." }) })
674
674
  ] }) }),
675
675
  /* @__PURE__ */ r(us, { children: a === "EXPIRED" ? /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
676
- P,
676
+ _,
677
677
  {
678
678
  className: "w-full",
679
679
  onClick: () => window.location.reload(),
@@ -682,7 +682,7 @@ function Nl({
682
682
  }
683
683
  ) }) : /* @__PURE__ */ u(rr, { open: i, onOpenChange: l, children: [
684
684
  /* @__PURE__ */ r(ar, { asChild: !0, children: /* @__PURE__ */ u("span", { className: "flex flex-col items-center", children: [
685
- /* @__PURE__ */ r(P, { className: "w-full", variant: "destructive", children: "Take Over" }),
685
+ /* @__PURE__ */ r(_, { className: "w-full", variant: "destructive", children: "Take Over" }),
686
686
  /* @__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." })
687
687
  ] }) }),
688
688
  /* @__PURE__ */ u(ir, { className: "z-[99]", children: [
@@ -749,7 +749,7 @@ const Al = () => {
749
749
  '" language or switch to the base language.'
750
750
  ] }) }),
751
751
  /* @__PURE__ */ r(us, { children: /* @__PURE__ */ r(
752
- P,
752
+ _,
753
753
  {
754
754
  onClick: i,
755
755
  className: "w-full",
@@ -819,12 +819,12 @@ const Al = () => {
819
819
  blockName: a,
820
820
  trigger: i
821
821
  }) => {
822
- const [l, o] = _(!1), c = nr(), h = Pl(() => {
822
+ const [l, o] = P(!1), c = nr(), h = Pl(() => {
823
823
  c([e], { _libBlockId: void 0 }), j.success("Block deleted successfully"), o(!1), s();
824
824
  });
825
825
  return /* @__PURE__ */ u(mr, { open: n, onOpenChange: (w) => !w && s(), children: [
826
826
  /* @__PURE__ */ r(fr, { asChild: !0, children: i || /* @__PURE__ */ u(
827
- P,
827
+ _,
828
828
  {
829
829
  type: "button",
830
830
  variant: "destructive",
@@ -857,7 +857,7 @@ const Al = () => {
857
857
  /* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: "This block will be permanently removed from the library. This action cannot be undone." }),
858
858
  /* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-2", children: [
859
859
  /* @__PURE__ */ r(
860
- P,
860
+ _,
861
861
  {
862
862
  type: "button",
863
863
  variant: "outline",
@@ -868,7 +868,7 @@ const Al = () => {
868
868
  }
869
869
  ),
870
870
  /* @__PURE__ */ r(
871
- P,
871
+ _,
872
872
  {
873
873
  type: "button",
874
874
  variant: "destructive",
@@ -893,7 +893,7 @@ const Al = () => {
893
893
  className: a = "",
894
894
  close: i
895
895
  }) => {
896
- const [l, o] = _(!1);
896
+ const [l, o] = P(!1);
897
897
  return /* @__PURE__ */ r(
898
898
  _l,
899
899
  {
@@ -905,7 +905,7 @@ const Al = () => {
905
905
  },
906
906
  blockName: n,
907
907
  trigger: /* @__PURE__ */ u(
908
- P,
908
+ _,
909
909
  {
910
910
  type: "button",
911
911
  variant: "destructive",
@@ -963,7 +963,7 @@ const Al = () => {
963
963
  isCreating: o
964
964
  };
965
965
  }, Ll = ({ value: e, onChange: t }) => {
966
- const [n, s] = _(!1), [a, i] = _(""), l = ct(null), { groups: o } = kl(), [c, h] = _([
966
+ const [n, s] = P(!1), [a, i] = P(""), l = ct(null), { groups: o } = kl(), [c, h] = P([
967
967
  { id: "hero", name: "Hero" },
968
968
  { id: "feature", name: "Feature" },
969
969
  { id: "footer", name: "Footer" },
@@ -995,24 +995,24 @@ const Al = () => {
995
995
  () => [
996
996
  ...o,
997
997
  ...c.filter(
998
- (p) => !o.some((y) => y.id === p.id)
998
+ (y) => !o.some((p) => p.id === y.id)
999
999
  )
1000
1000
  ],
1001
1001
  [o, c]
1002
1002
  ), d = () => {
1003
- const p = a.trim();
1004
- if (!p) return;
1005
- const y = { id: p, name: p };
1006
- h((S) => [...S, y]), t(y.id), i(""), s(!1);
1003
+ const y = a.trim();
1004
+ if (!y) return;
1005
+ const p = { id: y, name: y };
1006
+ h((S) => [...S, p]), t(p.id), i(""), s(!1);
1007
1007
  };
1008
1008
  we(() => {
1009
1009
  n && l.current && l.current.focus();
1010
1010
  }, [n]);
1011
- const w = (p) => {
1012
- p.key === "Enter" && (p.preventDefault(), d());
1011
+ const w = (y) => {
1012
+ y.key === "Enter" && (y.preventDefault(), d());
1013
1013
  };
1014
1014
  return we(() => {
1015
- e && !g.some((p) => p.id === e) && t("");
1015
+ e && !g.some((y) => y.id === e) && t("");
1016
1016
  }, [e, g, t]), n ? /* @__PURE__ */ u("div", { className: "space-y-2", children: [
1017
1017
  /* @__PURE__ */ r(
1018
1018
  ye,
@@ -1020,13 +1020,13 @@ const Al = () => {
1020
1020
  ref: l,
1021
1021
  placeholder: "Enter new group name",
1022
1022
  value: a,
1023
- onChange: (p) => i(p.target.value),
1023
+ onChange: (y) => i(y.target.value),
1024
1024
  onKeyDown: w
1025
1025
  }
1026
1026
  ),
1027
1027
  /* @__PURE__ */ u("div", { className: "flex justify-end gap-2", children: [
1028
1028
  /* @__PURE__ */ r(
1029
- P,
1029
+ _,
1030
1030
  {
1031
1031
  variant: "outline",
1032
1032
  size: "sm",
@@ -1034,7 +1034,7 @@ const Al = () => {
1034
1034
  children: "Cancel"
1035
1035
  }
1036
1036
  ),
1037
- /* @__PURE__ */ r(P, { size: "sm", onClick: d, children: "Create" })
1037
+ /* @__PURE__ */ r(_, { size: "sm", onClick: d, children: "Create" })
1038
1038
  ] })
1039
1039
  ] }) : /* @__PURE__ */ u("div", { className: "flex gap-2", children: [
1040
1040
  /* @__PURE__ */ u(
@@ -1042,20 +1042,20 @@ const Al = () => {
1042
1042
  {
1043
1043
  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",
1044
1044
  value: e,
1045
- onChange: (p) => t(p.target.value),
1045
+ onChange: (y) => t(y.target.value),
1046
1046
  children: [
1047
1047
  /* @__PURE__ */ r("option", { value: "", children: "Select a group" }),
1048
- 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}`)) }),
1048
+ o.length > 0 && /* @__PURE__ */ r("optgroup", { label: "Library Groups", children: o.map((y) => /* @__PURE__ */ r("option", { value: y.id, children: y.name }, `lib-${y.id}`)) }),
1049
1049
  c.length > 0 && /* @__PURE__ */ r("optgroup", { label: "Predefined Groups", children: c.filter(
1050
- (p) => !o.some(
1051
- (y) => y.id === p.id
1050
+ (y) => !o.some(
1051
+ (p) => p.id === y.id
1052
1052
  )
1053
- ).map((p) => /* @__PURE__ */ r("option", { value: p.id, children: p.name }, `local-${p.id}`)) })
1053
+ ).map((y) => /* @__PURE__ */ r("option", { value: y.id, children: y.name }, `local-${y.id}`)) })
1054
1054
  ]
1055
1055
  }
1056
1056
  ),
1057
1057
  /* @__PURE__ */ r(
1058
- P,
1058
+ _,
1059
1059
  {
1060
1060
  type: "button",
1061
1061
  size: "icon",
@@ -1066,7 +1066,7 @@ const Al = () => {
1066
1066
  )
1067
1067
  ] });
1068
1068
  }, Dl = 1 * 1024 * 1024, Gl = ({ value: e, onChange: t }) => {
1069
- const [n, s] = _(!1), a = ct(null), i = _e(
1069
+ const [n, s] = P(!1), a = ct(null), i = _e(
1070
1070
  (c) => {
1071
1071
  var g;
1072
1072
  const h = (g = c.target.files) == null ? void 0 : g[0];
@@ -1105,7 +1105,7 @@ const Al = () => {
1105
1105
  }
1106
1106
  ),
1107
1107
  /* @__PURE__ */ r(
1108
- P,
1108
+ _,
1109
1109
  {
1110
1110
  type: "button",
1111
1111
  variant: "outline",
@@ -1125,7 +1125,7 @@ const Al = () => {
1125
1125
  }
1126
1126
  ),
1127
1127
  e && /* @__PURE__ */ r(
1128
- P,
1128
+ _,
1129
1129
  {
1130
1130
  type: "button",
1131
1131
  variant: "outline",
@@ -1194,7 +1194,7 @@ const Al = () => {
1194
1194
  } else
1195
1195
  N.push(C);
1196
1196
  return N;
1197
- }, [t, a]), [g, d] = _(""), [w, p] = _(""), [y, S] = _(""), [v, x] = _(""), [R, E] = _({}), [b, T] = _(!1), [G, J] = _(o), [ie, k] = _(!1), { hasPermission: q } = sn(), A = q(ue.DELETE_LIBRARY_BLOCK), M = nr(), ne = () => {
1197
+ }, [t, a]), [g, d] = P(""), [w, y] = P(""), [p, S] = P(""), [v, x] = P(""), [G, E] = P({}), [b, T] = P(!1), [R, J] = P(o), [ie, k] = P(!1), { hasPermission: q } = sn(), A = q(ue.DELETE_LIBRARY_BLOCK), M = nr(), ne = () => {
1198
1198
  M([s], { _libBlockId: void 0 }), j.success("Block delinked from library"), n();
1199
1199
  }, {
1200
1200
  data: he,
@@ -1204,7 +1204,7 @@ const Al = () => {
1204
1204
  we(() => {
1205
1205
  de && o && (k(!0), J(!1));
1206
1206
  }, [de, o]), we(() => {
1207
- he && !z && (d(he.name || ""), p(he.group || ""), S(he.description || ""), x(he.preview || ""), J(!1));
1207
+ he && !z && (d(he.name || ""), y(he.group || ""), S(he.description || ""), x(he.preview || ""), J(!1));
1208
1208
  }, [he, z]), we(() => {
1209
1209
  const N = g.trim().length >= 2, C = w.trim() !== "";
1210
1210
  T(N && C && !c);
@@ -1223,19 +1223,19 @@ const Al = () => {
1223
1223
  name: g.trim(),
1224
1224
  group: w,
1225
1225
  blocks: C,
1226
- description: y.trim(),
1226
+ description: p.trim(),
1227
1227
  // Only include previewImage if it exists and is a base64 image
1228
1228
  ...v && v.startsWith("data:") ? { previewImage: v } : {},
1229
1229
  // Include id if in edit mode
1230
1230
  ...o ? { id: l } : {}
1231
1231
  });
1232
1232
  }, m = Qe.isPending;
1233
- return G || z ? /* @__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" }) }) : ie ? /* @__PURE__ */ u("div", { className: "p-6 space-y-4", children: [
1233
+ return R || z ? /* @__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" }) }) : ie ? /* @__PURE__ */ u("div", { className: "p-6 space-y-4", children: [
1234
1234
  /* @__PURE__ */ r("div", { className: "text-destructive font-medium", children: "Block Not Found" }),
1235
1235
  /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: "This block could not be found on the server. It may have been deleted." }),
1236
1236
  /* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-4", children: [
1237
- /* @__PURE__ */ r(P, { type: "button", variant: "outline", onClick: n, children: "Cancel" }),
1238
- /* @__PURE__ */ r(P, { onClick: ne, variant: "destructive", children: "Delink Block" })
1237
+ /* @__PURE__ */ r(_, { type: "button", variant: "outline", onClick: n, children: "Cancel" }),
1238
+ /* @__PURE__ */ r(_, { onClick: ne, variant: "destructive", children: "Delink Block" })
1239
1239
  ] })
1240
1240
  ] }) : /* @__PURE__ */ u("div", { children: [
1241
1241
  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: [
@@ -1251,7 +1251,7 @@ const Al = () => {
1251
1251
  X,
1252
1252
  {
1253
1253
  htmlFor: "name",
1254
- className: R.name ? "text-destructive" : "",
1254
+ className: G.name ? "text-destructive" : "",
1255
1255
  children: "Name"
1256
1256
  }
1257
1257
  ),
@@ -1262,22 +1262,22 @@ const Al = () => {
1262
1262
  placeholder: "Enter block name",
1263
1263
  value: g,
1264
1264
  onChange: (N) => d(N.target.value),
1265
- className: R.name ? "border-destructive" : ""
1265
+ className: G.name ? "border-destructive" : ""
1266
1266
  }
1267
1267
  ),
1268
- R.name && /* @__PURE__ */ r("p", { className: "text-xs text-destructive", children: R.name })
1268
+ G.name && /* @__PURE__ */ r("p", { className: "text-xs text-destructive", children: G.name })
1269
1269
  ] }),
1270
1270
  /* @__PURE__ */ u("div", { className: "space-y-2", children: [
1271
1271
  /* @__PURE__ */ r(
1272
1272
  X,
1273
1273
  {
1274
1274
  htmlFor: "group",
1275
- className: R.group ? "text-destructive" : "",
1275
+ className: G.group ? "text-destructive" : "",
1276
1276
  children: "Group"
1277
1277
  }
1278
1278
  ),
1279
- /* @__PURE__ */ r(Ll, { value: w, onChange: p }),
1280
- R.group && /* @__PURE__ */ r("p", { className: "text-xs text-destructive", children: R.group })
1279
+ /* @__PURE__ */ r(Ll, { value: w, onChange: y }),
1280
+ G.group && /* @__PURE__ */ r("p", { className: "text-xs text-destructive", children: G.group })
1281
1281
  ] }),
1282
1282
  /* @__PURE__ */ u("div", { className: "space-y-2", children: [
1283
1283
  /* @__PURE__ */ r(X, { htmlFor: "description", children: "Description (optional)" }),
@@ -1287,7 +1287,7 @@ const Al = () => {
1287
1287
  id: "description",
1288
1288
  placeholder: "Enter a brief description",
1289
1289
  className: "resize-none",
1290
- value: y,
1290
+ value: p,
1291
1291
  onChange: (N) => S(N.target.value)
1292
1292
  }
1293
1293
  )
@@ -1309,7 +1309,7 @@ const Al = () => {
1309
1309
  }
1310
1310
  ),
1311
1311
  /* @__PURE__ */ r(
1312
- P,
1312
+ _,
1313
1313
  {
1314
1314
  type: "button",
1315
1315
  variant: "outline",
@@ -1318,7 +1318,7 @@ const Al = () => {
1318
1318
  children: "Cancel"
1319
1319
  }
1320
1320
  ),
1321
- /* @__PURE__ */ r(P, { type: "submit", disabled: m || !b, children: m ? "Saving..." : o ? "Update Block" : "Save Block" })
1321
+ /* @__PURE__ */ r(_, { type: "submit", disabled: m || !b, children: m ? "Saving..." : o ? "Update Block" : "Save Block" })
1322
1322
  ] })
1323
1323
  ] })
1324
1324
  ] });
@@ -1691,7 +1691,7 @@ var Ss = {};
1691
1691
  }
1692
1692
  return f;
1693
1693
  };
1694
- }(), p = {
1694
+ }(), y = {
1695
1695
  particleCount: 50,
1696
1696
  angle: 90,
1697
1697
  spread: 45,
@@ -1717,22 +1717,22 @@ var Ss = {};
1717
1717
  disableForReducedMotion: !1,
1718
1718
  scalar: 1
1719
1719
  };
1720
- function y(f, m) {
1720
+ function p(f, m) {
1721
1721
  return m ? m(f) : f;
1722
1722
  }
1723
1723
  function S(f) {
1724
1724
  return f != null;
1725
1725
  }
1726
1726
  function v(f, m, N) {
1727
- return y(
1728
- f && S(f[m]) ? f[m] : p[m],
1727
+ return p(
1728
+ f && S(f[m]) ? f[m] : y[m],
1729
1729
  N
1730
1730
  );
1731
1731
  }
1732
1732
  function x(f) {
1733
1733
  return f < 0 ? 0 : Math.floor(f);
1734
1734
  }
1735
- function R(f, m) {
1735
+ function G(f, m) {
1736
1736
  return Math.floor(Math.random() * (m - f)) + f;
1737
1737
  }
1738
1738
  function E(f) {
@@ -1749,7 +1749,7 @@ var Ss = {};
1749
1749
  b: E(m.substring(4, 6))
1750
1750
  };
1751
1751
  }
1752
- function G(f) {
1752
+ function R(f) {
1753
1753
  var m = v(f, "origin", Object);
1754
1754
  return m.x = v(m, "x", Number), m.y = v(m, "y", Number), m;
1755
1755
  }
@@ -1859,7 +1859,7 @@ var Ss = {};
1859
1859
  function he(f, m) {
1860
1860
  var N = !f, C = !!v(m || {}, "resize"), D = !1, H = v(m, "disableForReducedMotion", Boolean), K = i && !!v(m || {}, "useWorker"), L = K ? w() : null, V = N ? J : ie, le = f && L ? !!f.__confetti_initialized : !1, ge = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, oe;
1861
1861
  function pe(W, Le, Be) {
1862
- for (var Me = v(W, "particleCount", x), Xe = v(W, "angle", Number), rt = v(W, "spread", Number), $e = v(W, "startVelocity", Number), Ca = v(W, "decay", Number), Pa = v(W, "gravity", Number), _a = v(W, "drift", Number), xs = v(W, "colors", b), Ia = v(W, "ticks", Number), Ts = v(W, "shapes"), ka = v(W, "scalar"), La = !!v(W, "flat"), Cs = G(W), Ps = Me, Mn = [], Da = f.width * Cs.x, Ga = f.height * Cs.y; Ps--; )
1862
+ for (var Me = v(W, "particleCount", x), Xe = v(W, "angle", Number), rt = v(W, "spread", Number), $e = v(W, "startVelocity", Number), Ca = v(W, "decay", Number), Pa = v(W, "gravity", Number), _a = v(W, "drift", Number), xs = v(W, "colors", b), Ia = v(W, "ticks", Number), Ts = v(W, "shapes"), ka = v(W, "scalar"), La = !!v(W, "flat"), Cs = R(W), Ps = Me, Mn = [], Da = f.width * Cs.x, Ga = f.height * Cs.y; Ps--; )
1863
1863
  Mn.push(
1864
1864
  A({
1865
1865
  x: Da,
@@ -1868,7 +1868,7 @@ var Ss = {};
1868
1868
  spread: rt,
1869
1869
  startVelocity: $e,
1870
1870
  color: xs[Ps % xs.length],
1871
- shape: Ts[R(0, Ts.length)],
1871
+ shape: Ts[G(0, Ts.length)],
1872
1872
  ticks: Ia,
1873
1873
  decay: Ca,
1874
1874
  gravity: Pa,
@@ -2010,7 +2010,7 @@ const jl = {
2010
2010
  const [e] = Ja(), { mutate: t, isPending: n } = ws(), { mutateAsync: s, isPending: a } = Rr();
2011
2011
  return /* @__PURE__ */ u("div", { className: "bg-white py-3 flex items-center justify-center gap-x-3 border-t", children: [
2012
2012
  /* @__PURE__ */ r(
2013
- P,
2013
+ _,
2014
2014
  {
2015
2015
  size: "sm",
2016
2016
  variant: "outline",
@@ -2022,7 +2022,7 @@ const jl = {
2022
2022
  }
2023
2023
  ),
2024
2024
  /* @__PURE__ */ r(
2025
- P,
2025
+ _,
2026
2026
  {
2027
2027
  size: "sm",
2028
2028
  disabled: n || a,
@@ -2044,8 +2044,8 @@ const jl = {
2044
2044
  page: e,
2045
2045
  onClose: t
2046
2046
  }) => {
2047
- const [n, s] = _(e.slug || ""), { mutate: a, isPending: i } = Kl(), { data: l } = Ie(), o = fe(l, { key: e == null ? void 0 : e.pageType }), c = (g) => {
2048
- if (g.preventDefault(), !(e != null && e.primaryPage) && Object.keys(qe).some((p) => n === `/${p}` || Ut(n, `/${p}/`))) {
2047
+ const [n, s] = P(e.slug || ""), { mutate: a, isPending: i } = Kl(), { data: l } = Ie(), o = fe(l, { key: e == null ? void 0 : e.pageType }), c = (g) => {
2048
+ if (g.preventDefault(), !(e != null && e.primaryPage) && Object.keys(qe).some((y) => n === `/${y}` || Ut(n, `/${y}/`))) {
2049
2049
  j.error("Error", {
2050
2050
  description: "Slugs cannot start with a language code for primary page"
2051
2051
  });
@@ -2107,7 +2107,7 @@ const jl = {
2107
2107
  ] })
2108
2108
  ] }),
2109
2109
  /* @__PURE__ */ r(et, { children: /* @__PURE__ */ r(
2110
- P,
2110
+ _,
2111
2111
  {
2112
2112
  type: "submit",
2113
2113
  disabled: i || !Ut(n, `/${h}`) || rs(e == null ? void 0 : e.slug, n),
@@ -2148,9 +2148,9 @@ function qr({
2148
2148
  ] })
2149
2149
  ] }),
2150
2150
  /* @__PURE__ */ u(et, { children: [
2151
- /* @__PURE__ */ r(P, { variant: "outline", onClick: t, children: "Cancel" }),
2151
+ /* @__PURE__ */ r(_, { variant: "outline", onClick: t, children: "Cancel" }),
2152
2152
  /* @__PURE__ */ r(
2153
- P,
2153
+ _,
2154
2154
  {
2155
2155
  variant: "destructive",
2156
2156
  disabled: a,
@@ -2187,9 +2187,9 @@ const Oe = ({
2187
2187
  ] })
2188
2188
  ] }),
2189
2189
  /* @__PURE__ */ u(et, { children: [
2190
- /* @__PURE__ */ r(P, { variant: "outline", onClick: t, children: "Cancel" }),
2190
+ /* @__PURE__ */ r(_, { variant: "outline", onClick: t, children: "Cancel" }),
2191
2191
  /* @__PURE__ */ r(
2192
- P,
2192
+ _,
2193
2193
  {
2194
2194
  variant: "destructive",
2195
2195
  disabled: s,
@@ -2204,12 +2204,12 @@ const Oe = ({
2204
2204
  onClose: t,
2205
2205
  languages: n
2206
2206
  }) => {
2207
- const { data: s } = Ue(), { data: a } = Ie(), [i, l] = _(e.name || ""), [o, c] = _(e.edit ? e.lang : ""), [h, g] = _(e.edit ? e.slug : ""), { mutate: d, isPending: w } = Fr(), { mutate: p, isPending: y } = bs(), S = Y(
2207
+ const { data: s } = Ue(), { data: a } = Ie(), [i, l] = P(e.name || ""), [o, c] = P(e.edit ? e.lang : ""), [h, g] = P(e.edit ? e.slug : ""), { mutate: d, isPending: w } = Fr(), { mutate: y, isPending: p } = bs(), S = Y(
2208
2208
  () => a == null ? void 0 : a.find(
2209
2209
  (E) => E.key === e.pageType
2210
2210
  ),
2211
2211
  [a, e.pageType]
2212
- ), v = !(S != null && S.hasSlug), x = w || y, R = (E) => {
2212
+ ), v = !(S != null && S.hasSlug), x = w || p, G = (E) => {
2213
2213
  E.preventDefault();
2214
2214
  const b = {
2215
2215
  name: i,
@@ -2218,14 +2218,14 @@ const Oe = ({
2218
2218
  slug: h,
2219
2219
  pageType: s == null ? void 0 : s.pageType
2220
2220
  };
2221
- b.pageType = e.pageType, e.edit && (b.id = e == null ? void 0 : e.id), e.edit ? p(b, { onSuccess: t }) : d(b, { onSuccess: t });
2221
+ b.pageType = e.pageType, e.edit && (b.id = e == null ? void 0 : e.id), e.edit ? y(b, { onSuccess: t }) : d(b, { onSuccess: t });
2222
2222
  };
2223
2223
  return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-[425px] text-slate-600", children: [
2224
2224
  /* @__PURE__ */ u(Ve, { children: [
2225
2225
  /* @__PURE__ */ r(je, { children: e.edit ? B.EDIT_LANGUAGE : B.ADD_NEW_LANGUAGE }),
2226
2226
  /* @__PURE__ */ r(Ye, { className: "font-light", children: B.ENTER_LANGUAGE_DETAILS })
2227
2227
  ] }),
2228
- /* @__PURE__ */ u("form", { onSubmit: R, children: [
2228
+ /* @__PURE__ */ u("form", { onSubmit: G, children: [
2229
2229
  /* @__PURE__ */ u("div", { className: "grid gap-4 py-4", children: [
2230
2230
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2231
2231
  /* @__PURE__ */ r(X, { htmlFor: "lang", className: "text-right", children: B.LANGUAGE }),
@@ -2286,7 +2286,7 @@ const Oe = ({
2286
2286
  ] })
2287
2287
  ] }),
2288
2288
  /* @__PURE__ */ r(et, { children: /* @__PURE__ */ r(
2289
- P,
2289
+ _,
2290
2290
  {
2291
2291
  type: "submit",
2292
2292
  disabled: x || !i || !o || !v && !Ut(h, `/${o}`),
@@ -2296,9 +2296,9 @@ const Oe = ({
2296
2296
  ] })
2297
2297
  ] }) });
2298
2298
  }, Yl = () => {
2299
- const [e, t] = _(null), { selectedLang: n, fallbackLang: s, setSelectedLang: a } = ut(), { data: i, isFetching: l } = cn(), { data: o } = Ue(), [c, h] = _(null), [g, d] = _(null), [w, p] = _(null), { data: y } = un(), S = Te(
2300
- te(y, "languages") || ["en"],
2301
- (v) => !fe(i, { lang: v }) && v !== te(y, "fallbackLang")
2299
+ const [e, t] = P(null), { selectedLang: n, fallbackLang: s, setSelectedLang: a } = ut(), { data: i, isFetching: l } = cn(), { data: o } = Ue(), [c, h] = P(null), [g, d] = P(null), [w, y] = P(null), { data: p } = un(), S = Te(
2300
+ te(p, "languages") || ["en"],
2301
+ (v) => !fe(i, { lang: v }) && v !== te(p, "fallbackLang")
2302
2302
  );
2303
2303
  return /* @__PURE__ */ u("div", { className: "space-y-4", children: [
2304
2304
  /* @__PURE__ */ r("ul", { className: "space-y-2", children: l ? /* @__PURE__ */ u("div", { className: "w-full space-y-3 py-4", children: [
@@ -2306,7 +2306,7 @@ const Oe = ({
2306
2306
  /* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
2307
2307
  /* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
2308
2308
  ] }) : Fe(i, (v) => {
2309
- const x = v.lang, R = v.slug, E = !v.primaryPage;
2309
+ const x = v.lang, G = v.slug, E = !v.primaryPage;
2310
2310
  return /* @__PURE__ */ u(be, { children: [
2311
2311
  /* @__PURE__ */ u(
2312
2312
  "li",
@@ -2331,9 +2331,9 @@ const Oe = ({
2331
2331
  }
2332
2332
  ),
2333
2333
  /* @__PURE__ */ u("div", { children: [
2334
- R && /* @__PURE__ */ u("div", { className: "text-[11px] text-slate-600 font-light", children: [
2334
+ G && /* @__PURE__ */ u("div", { className: "text-[11px] text-slate-600 font-light", children: [
2335
2335
  "Slug: ",
2336
- /* @__PURE__ */ r("b", { className: "font-medium", children: R })
2336
+ /* @__PURE__ */ r("b", { className: "font-medium", children: G })
2337
2337
  ] }),
2338
2338
  /* @__PURE__ */ u("div", { className: "text-[11px] text-slate-600 font-light", children: [
2339
2339
  "Name:",
@@ -2363,7 +2363,7 @@ const Oe = ({
2363
2363
  asChild: !0,
2364
2364
  onClick: (T) => T.stopPropagation(),
2365
2365
  children: /* @__PURE__ */ r(
2366
- P,
2366
+ _,
2367
2367
  {
2368
2368
  variant: "ghost",
2369
2369
  size: "sm",
@@ -2450,7 +2450,7 @@ const Oe = ({
2450
2450
  ] });
2451
2451
  }) }),
2452
2452
  /* @__PURE__ */ r(Oe, { permissions: [ue.ADD_PAGE], children: /* @__PURE__ */ r("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ r(
2453
- P,
2453
+ _,
2454
2454
  {
2455
2455
  variant: "default",
2456
2456
  size: "sm",
@@ -2487,7 +2487,7 @@ const Oe = ({
2487
2487
  Wl,
2488
2488
  {
2489
2489
  page: w,
2490
- onClose: () => p(null)
2490
+ onClose: () => y(null)
2491
2491
  }
2492
2492
  )
2493
2493
  ] });
@@ -2537,7 +2537,7 @@ const Xl = ({
2537
2537
  onSelectTemplate: n,
2538
2538
  isLoading: s = !1
2539
2539
  }) => {
2540
- const [a, i] = _("");
2540
+ const [a, i] = P("");
2541
2541
  if (we(() => {
2542
2542
  if (t) {
2543
2543
  const o = e.find((c) => c.id === t);
@@ -2619,28 +2619,28 @@ function to({
2619
2619
  close: n
2620
2620
  }) {
2621
2621
  var Ee, Qe;
2622
- const s = !!(e != null && e.id), { data: a } = Rn(), { mutate: i, isPending: l } = Fr(), { mutate: o, isPending: c } = bs(), [h, g] = _(null), [d, w] = _(
2622
+ const s = !!(e != null && e.id), { data: a } = Rn(), { mutate: i, isPending: l } = Fr(), { mutate: o, isPending: c } = bs(), [h, g] = P(null), [d, w] = P(
2623
2623
  (e == null ? void 0 : e.pageType) ?? "page"
2624
- ), [p, y] = _(
2624
+ ), [y, p] = P(
2625
2625
  t.find(
2626
2626
  (f) => f.key === d
2627
2627
  )
2628
- ), [S, v] = _(
2628
+ ), [S, v] = P(
2629
2629
  (e == null ? void 0 : e.parent) ?? ""
2630
- ), [x, R] = _((e == null ? void 0 : e.name) ?? ""), [E, b] = _(
2630
+ ), [x, G] = P((e == null ? void 0 : e.name) ?? ""), [E, b] = P(
2631
2631
  ((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""
2632
- ), [T, G] = _(
2632
+ ), [T, R] = P(
2633
2633
  (e == null ? void 0 : e.dynamic) ?? !1
2634
- ), [J, ie] = _(""), { data: k, isLoading: q } = eo(d), A = l || c, M = t.find(
2634
+ ), [J, ie] = P(""), { data: k, isLoading: q } = eo(d), A = l || c, M = t.find(
2635
2635
  (f) => f.key === d
2636
2636
  ), ne = (f) => {
2637
- w(f), v(""), b(""), G(!1), ie(""), y(
2637
+ w(f), v(""), b(""), R(!1), ie(""), p(
2638
2638
  t.find(
2639
2639
  (m) => m.key === f
2640
2640
  )
2641
2641
  );
2642
2642
  }, he = (f) => {
2643
- G(f), f && b("");
2643
+ R(f), f && b("");
2644
2644
  }, z = (f) => {
2645
2645
  if (v(f), f && f !== "none") {
2646
2646
  const m = a == null ? void 0 : a.find(
@@ -2668,9 +2668,9 @@ function to({
2668
2668
  j.error("Name is required");
2669
2669
  return;
2670
2670
  }
2671
- if (!(p != null && p.hasSlug)) {
2671
+ if (!(y != null && y.hasSlug)) {
2672
2672
  const m = {
2673
- pageType: p == null ? void 0 : p.key,
2673
+ pageType: y == null ? void 0 : y.key,
2674
2674
  name: x,
2675
2675
  slug: "",
2676
2676
  hasSlug: !1
@@ -2680,7 +2680,7 @@ function to({
2680
2680
  { id: e == null ? void 0 : e.id, name: x },
2681
2681
  {
2682
2682
  onSuccess: () => {
2683
- j.success((p == null ? void 0 : p.name) + " updated successfully"), n();
2683
+ j.success((y == null ? void 0 : y.name) + " updated successfully"), n();
2684
2684
  }
2685
2685
  }
2686
2686
  );
@@ -2756,7 +2756,7 @@ function to({
2756
2756
  });
2757
2757
  }
2758
2758
  };
2759
- return p != null && p.hasSlug ? /* @__PURE__ */ u("form", { onSubmit: F, className: "w-full max-w-md mx-auto space-y-4", children: [
2759
+ return y != null && y.hasSlug ? /* @__PURE__ */ u("form", { onSubmit: F, className: "w-full max-w-md mx-auto space-y-4", children: [
2760
2760
  /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
2761
2761
  /* @__PURE__ */ r(X, { htmlFor: "pageType", className: "text-sm", children: "Page Type" }),
2762
2762
  /* @__PURE__ */ u(
@@ -2774,7 +2774,7 @@ function to({
2774
2774
  }
2775
2775
  )
2776
2776
  ] }),
2777
- !s && (p == null ? void 0 : p.hasSlug) && k.length > 0 && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2777
+ !s && (y == null ? void 0 : y.hasSlug) && k.length > 0 && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2778
2778
  /* @__PURE__ */ r(X, { className: "text-sm mb-1 block", children: "Template" }),
2779
2779
  /* @__PURE__ */ r(
2780
2780
  Xl,
@@ -2801,7 +2801,7 @@ function to({
2801
2801
  {
2802
2802
  id: "name",
2803
2803
  value: x,
2804
- onChange: (f) => R(f.target.value),
2804
+ onChange: (f) => G(f.target.value),
2805
2805
  required: !0,
2806
2806
  "aria-required": "true"
2807
2807
  }
@@ -2846,7 +2846,7 @@ function to({
2846
2846
  ),
2847
2847
  h && /* @__PURE__ */ r("p", { className: "text-xs text-red-500", children: h })
2848
2848
  ] }),
2849
- /* @__PURE__ */ r(P, { disabled: A, type: "submit", className: "w-full", children: s ? A ? "Updating..." : "Update page" : A ? "Creating..." : "Create Page" })
2849
+ /* @__PURE__ */ r(_, { disabled: A, type: "submit", className: "w-full", children: s ? A ? "Updating..." : "Update page" : A ? "Creating..." : "Create Page" })
2850
2850
  ] }) : /* @__PURE__ */ u(
2851
2851
  "form",
2852
2852
  {
@@ -2878,13 +2878,13 @@ function to({
2878
2878
  {
2879
2879
  id: "name",
2880
2880
  value: x,
2881
- onChange: (f) => R(f.target.value),
2881
+ onChange: (f) => G(f.target.value),
2882
2882
  required: !0,
2883
2883
  "aria-required": "true"
2884
2884
  }
2885
2885
  )
2886
2886
  ] }),
2887
- /* @__PURE__ */ r(P, { disabled: A, type: "submit", className: "w-full", children: s ? A ? "Updating..." : "Update " + (p == null ? void 0 : p.name) : A ? "Creating..." : "Create " + (p == null ? void 0 : p.name) })
2887
+ /* @__PURE__ */ r(_, { disabled: A, type: "submit", className: "w-full", children: s ? A ? "Updating..." : "Update " + (y == null ? void 0 : y.name) : A ? "Creating..." : "Create " + (y == null ? void 0 : y.name) })
2888
2888
  ]
2889
2889
  }
2890
2890
  );
@@ -2915,9 +2915,9 @@ const no = ({
2915
2915
  page: e,
2916
2916
  onClose: t
2917
2917
  }) => {
2918
- const [n, s] = _(!1), [a, i] = _(""), [l, o] = _(""), [c, h] = _(!1), g = ct(null), d = ql(), { data: w } = Ie(), p = w == null ? void 0 : w.find(
2918
+ const [n, s] = P(!1), [a, i] = P(""), [l, o] = P(""), [c, h] = P(!1), g = ct(null), d = ql(), { data: w } = Ie(), y = w == null ? void 0 : w.find(
2919
2919
  (E) => E.key === e.pageType
2920
- ), y = (p == null ? void 0 : p.name) || It(e.pageType), S = _e(
2920
+ ), p = (y == null ? void 0 : y.name) || It(e.pageType), S = _e(
2921
2921
  (E) => {
2922
2922
  var T;
2923
2923
  const b = (T = E.target.files) == null ? void 0 : T[0];
@@ -2930,13 +2930,13 @@ const no = ({
2930
2930
  }
2931
2931
  try {
2932
2932
  h(!0);
2933
- const G = new FileReader();
2934
- G.onloadend = () => {
2935
- o(G.result), h(!1);
2936
- }, G.readAsDataURL(b);
2937
- } catch (G) {
2938
- console.error("Error reading file:", G), h(!1), j.error("Failed to process image", {
2939
- description: G instanceof Error ? G.message : "Unknown error"
2933
+ const R = new FileReader();
2934
+ R.onloadend = () => {
2935
+ o(R.result), h(!1);
2936
+ }, R.readAsDataURL(b);
2937
+ } catch (R) {
2938
+ console.error("Error reading file:", R), h(!1), j.error("Failed to process image", {
2939
+ description: R instanceof Error ? R.message : "Unknown error"
2940
2940
  });
2941
2941
  }
2942
2942
  }
@@ -2947,7 +2947,7 @@ const no = ({
2947
2947
  }, x = () => {
2948
2948
  var E;
2949
2949
  (E = g.current) == null || E.click();
2950
- }, R = () => {
2950
+ }, G = () => {
2951
2951
  s(!0), d.mutate(
2952
2952
  {
2953
2953
  page: e,
@@ -2985,7 +2985,7 @@ const no = ({
2985
2985
  /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
2986
2986
  /* @__PURE__ */ r(on, { className: "w-4 h-4 text-slate-500" }),
2987
2987
  /* @__PURE__ */ r("span", { className: "font-medium text-slate-500", children: "Type:" }),
2988
- /* @__PURE__ */ r("span", { className: "font-semibold", children: y })
2988
+ /* @__PURE__ */ r("span", { className: "font-semibold", children: p })
2989
2989
  ] })
2990
2990
  ] }),
2991
2991
  /* @__PURE__ */ u("div", { children: [
@@ -3017,7 +3017,7 @@ const no = ({
3017
3017
  }
3018
3018
  ),
3019
3019
  /* @__PURE__ */ r(
3020
- P,
3020
+ _,
3021
3021
  {
3022
3022
  type: "button",
3023
3023
  variant: "outline",
@@ -3034,7 +3034,7 @@ const no = ({
3034
3034
  }
3035
3035
  ),
3036
3036
  l && /* @__PURE__ */ r(
3037
- P,
3037
+ _,
3038
3038
  {
3039
3039
  type: "button",
3040
3040
  variant: "outline",
@@ -3062,7 +3062,7 @@ const no = ({
3062
3062
  className: n ? "opacity-75 pointer-events-none" : "",
3063
3063
  children: [
3064
3064
  /* @__PURE__ */ r(
3065
- P,
3065
+ _,
3066
3066
  {
3067
3067
  variant: "outline",
3068
3068
  onClick: (E) => {
@@ -3071,7 +3071,7 @@ const no = ({
3071
3071
  children: "Cancel"
3072
3072
  }
3073
3073
  ),
3074
- /* @__PURE__ */ r(P, { variant: "default", disabled: n, onClick: R, children: "Mark as template" })
3074
+ /* @__PURE__ */ r(_, { variant: "default", disabled: n, onClick: G, children: "Mark as template" })
3075
3075
  ]
3076
3076
  }
3077
3077
  )
@@ -3080,7 +3080,7 @@ const no = ({
3080
3080
  page: e,
3081
3081
  onClose: t
3082
3082
  }) => {
3083
- const [n, s] = _(!1), a = Hl();
3083
+ const [n, s] = P(!1), a = Hl();
3084
3084
  return /* @__PURE__ */ r(He, { open: !0, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
3085
3085
  /* @__PURE__ */ u(Ve, { children: [
3086
3086
  /* @__PURE__ */ r(je, { children: "Unmark as template" }),
@@ -3092,7 +3092,7 @@ const no = ({
3092
3092
  className: n ? "opacity-75 pointer-events-none" : "",
3093
3093
  children: [
3094
3094
  /* @__PURE__ */ r(
3095
- P,
3095
+ _,
3096
3096
  {
3097
3097
  variant: "outline",
3098
3098
  onClick: (l) => {
@@ -3101,7 +3101,7 @@ const no = ({
3101
3101
  children: "Cancel"
3102
3102
  }
3103
3103
  ),
3104
- /* @__PURE__ */ r(P, { variant: "default", disabled: n, onClick: () => {
3104
+ /* @__PURE__ */ r(_, { variant: "default", disabled: n, onClick: () => {
3105
3105
  s(!0), a.mutate(e, {
3106
3106
  onSuccess: () => {
3107
3107
  s(!1), t();
@@ -3129,7 +3129,7 @@ const no = ({
3129
3129
  const { data: h } = Ie(), { hasPermission: g } = sn(), d = Y(
3130
3130
  () => fe(h, { key: t.pageType }),
3131
3131
  [h, t.pageType]
3132
- ), w = te(t, "slug").replace(e, "") || "/", p = !g(ue.EDIT_PAGE) && !g(ue.DELETE_PAGE) && !g(ue.UNPUBLISH_PAGE), y = Y(() => !!t.isTemplate, [t.isTemplate]), S = Y(
3132
+ ), w = te(t, "slug").replace(e, "") || "/", y = !g(ue.EDIT_PAGE) && !g(ue.DELETE_PAGE) && !g(ue.UNPUBLISH_PAGE), p = Y(() => !!t.isTemplate, [t.isTemplate]), S = Y(
3133
3133
  () => !!(d != null && d.hasSlug),
3134
3134
  [d == null ? void 0 : d.hasSlug]
3135
3135
  );
@@ -3172,7 +3172,7 @@ const no = ({
3172
3172
  children: d == null ? void 0 : d.name
3173
3173
  }
3174
3174
  ),
3175
- y && /* @__PURE__ */ r(
3175
+ p && /* @__PURE__ */ r(
3176
3176
  Fn,
3177
3177
  {
3178
3178
  variant: "outline",
@@ -3181,7 +3181,7 @@ const no = ({
3181
3181
  }
3182
3182
  )
3183
3183
  ] }),
3184
- /* @__PURE__ */ r("div", { className: "flex items-center space-x-4", children: !p && /* @__PURE__ */ u(rn, { children: [
3184
+ /* @__PURE__ */ r("div", { className: "flex items-center space-x-4", children: !y && /* @__PURE__ */ u(rn, { children: [
3185
3185
  /* @__PURE__ */ r(an, { asChild: !0, onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ r(gs, { className: "h-4 w-4 hover:stroke-[3]" }) }),
3186
3186
  /* @__PURE__ */ u(ln, { align: "end", className: "text-sm", children: [
3187
3187
  g(ue.EDIT_PAGE) && /* @__PURE__ */ u(
@@ -3226,7 +3226,7 @@ const no = ({
3226
3226
  ]
3227
3227
  }
3228
3228
  ),
3229
- g(ue.MARK_AS_TEMPLATE) && S && /* @__PURE__ */ r(be, { children: y ? /* @__PURE__ */ u(
3229
+ g(ue.MARK_AS_TEMPLATE) && S && /* @__PURE__ */ r(be, { children: p ? /* @__PURE__ */ u(
3230
3230
  De,
3231
3231
  {
3232
3232
  className: "flex items-center gap-2 cursor-pointer",
@@ -3257,18 +3257,18 @@ const no = ({
3257
3257
  }
3258
3258
  );
3259
3259
  }, io = ({ close: e }) => {
3260
- const [, t] = _([]), [n, s] = _(""), [a, i] = _(null), [l, o] = _(null), [c, h] = _(null), [g, d] = _(null), [w, p] = _(null), { data: y, isFetching: S } = Rn(), [v, x] = _(""), { hasPermission: R } = sn(), [E, b] = Re(), T = E.get("page"), { data: G } = Ie(), J = _e(
3260
+ const [, t] = P([]), [n, s] = P(""), [a, i] = P(null), [l, o] = P(null), [c, h] = P(null), [g, d] = P(null), [w, y] = P(null), { data: p, isFetching: S } = Rn(), [v, x] = P(""), { hasPermission: G } = sn(), [E, b] = Re(), T = E.get("page"), { data: R } = Ie(), J = _e(
3261
3261
  (A) => {
3262
3262
  var M;
3263
- return (M = fe(G, { key: A })) == null ? void 0 : M.hasSlug;
3263
+ return (M = fe(R, { key: A })) == null ? void 0 : M.hasSlug;
3264
3264
  },
3265
- [G]
3265
+ [R]
3266
3266
  );
3267
3267
  we(() => {
3268
3268
  if (!me(v)) return;
3269
3269
  const A = sessionStorage.getItem("pageTypeFilter") || "all";
3270
- !me(G) && A && (fe(G, { key: A }) ? x(A) : x("all"));
3271
- }, [G, v]);
3270
+ !me(R) && A && (fe(R, { key: A }) ? x(A) : x("all"));
3271
+ }, [R, v]);
3272
3272
  const ie = (A) => {
3273
3273
  x(A), sessionStorage.setItem("pageTypeFilter", A);
3274
3274
  }, k = _e(
@@ -3280,12 +3280,12 @@ const no = ({
3280
3280
  );
3281
3281
  we(() => {
3282
3282
  if (T && !S) {
3283
- const A = fe(y, { id: T });
3283
+ const A = fe(p, { id: T });
3284
3284
  A && (A != null && A.pageType) ? t((M) => [...M, A == null ? void 0 : A.pageType]) : (window.history.replaceState(null, "", "/"), b(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate")));
3285
3285
  }
3286
- }, [y, T, S, b]);
3286
+ }, [p, T, S, b]);
3287
3287
  const q = Y(() => {
3288
- const A = Te(y, (F) => me(n) ? !0 : Mt(Dt(F == null ? void 0 : F.name), Dt(n)) || Mt(Dt(F == null ? void 0 : F.slug), Dt(n)));
3288
+ const A = Te(p, (F) => me(n) ? !0 : Mt(Dt(F == null ? void 0 : F.name), Dt(n)) || Mt(Dt(F == null ? void 0 : F.slug), Dt(n)));
3289
3289
  if (v !== "all")
3290
3290
  return Te(A, { pageType: v });
3291
3291
  const M = /* @__PURE__ */ new Map();
@@ -3310,7 +3310,7 @@ const no = ({
3310
3310
  (F) => J(F.pageType)
3311
3311
  ).sort((F, Ee) => F.name.localeCompare(Ee.name));
3312
3312
  return Qs([...de, ...z, ...ne]);
3313
- }, [y, J, n, v]);
3313
+ }, [p, J, n, v]);
3314
3314
  return /* @__PURE__ */ u("div", { className: "flex flex-col justify-between h-full", children: [
3315
3315
  /* @__PURE__ */ u("div", { className: "flex flex-col h-full space-y-6", children: [
3316
3316
  /* @__PURE__ */ u("div", { className: "relative flex item-center gap-x-4", children: [
@@ -3339,7 +3339,7 @@ const no = ({
3339
3339
  }
3340
3340
  ),
3341
3341
  /* @__PURE__ */ r(mi, { align: "end", children: Fe(
3342
- Xs([{ key: "all", name: "All" }], G),
3342
+ Xs([{ key: "all", name: "All" }], R),
3343
3343
  (A) => /* @__PURE__ */ r(fi, { value: te(A, "key"), children: te(A, "name") })
3344
3344
  ) })
3345
3345
  ] })
@@ -3362,7 +3362,7 @@ const no = ({
3362
3362
  setDeletePage: i,
3363
3363
  setAddEditPage: h,
3364
3364
  setMarkAsTemplate: d,
3365
- setUnmarkAsTemplate: p,
3365
+ setUnmarkAsTemplate: y,
3366
3366
  active: T === A.id,
3367
3367
  page: A
3368
3368
  },
@@ -3376,7 +3376,7 @@ const no = ({
3376
3376
  setDeletePage: i,
3377
3377
  setAddEditPage: h,
3378
3378
  setMarkAsTemplate: d,
3379
- setUnmarkAsTemplate: p,
3379
+ setUnmarkAsTemplate: y,
3380
3380
  active: T === A.id,
3381
3381
  page: A
3382
3382
  }
@@ -3392,7 +3392,7 @@ const no = ({
3392
3392
  setDeletePage: i,
3393
3393
  setAddEditPage: h,
3394
3394
  setMarkAsTemplate: d,
3395
- setUnmarkAsTemplate: p,
3395
+ setUnmarkAsTemplate: y,
3396
3396
  active: ne,
3397
3397
  page: M
3398
3398
  },
@@ -3401,8 +3401,8 @@ const no = ({
3401
3401
  }) })
3402
3402
  ] }, A.key)) })
3403
3403
  ] }),
3404
- R(ue.ADD_PAGE) && /* @__PURE__ */ u(
3405
- P,
3404
+ G(ue.ADD_PAGE) && /* @__PURE__ */ u(
3405
+ _,
3406
3406
  {
3407
3407
  className: "flex text-sm gap-x-2",
3408
3408
  onClick: () => {
@@ -3445,7 +3445,7 @@ const no = ({
3445
3445
  ao,
3446
3446
  {
3447
3447
  page: w,
3448
- onClose: () => p(null)
3448
+ onClose: () => y(null)
3449
3449
  }
3450
3450
  )
3451
3451
  ] });
@@ -3453,10 +3453,10 @@ const no = ({
3453
3453
  const e = dt("logo", null);
3454
3454
  return e ? /* @__PURE__ */ r("div", { className: "w-full max-h-9 overflow-hidden pr-2", children: er.createElement(e, {}) }) : null;
3455
3455
  }, oo = () => {
3456
- const [e] = Re(), t = e.get("page"), { data: n, isFetching: s } = Ue(), [a, i] = _(!1), l = !!t && !me(n), o = !t || !s && me(n) || a;
3456
+ const [e] = Re(), t = e.get("page"), { data: n, isFetching: s } = Ue(), [a, i] = P(!1), l = !!t && !me(n), o = !t || !s && me(n) || a;
3457
3457
  return /* @__PURE__ */ u(be, { children: [
3458
3458
  /* @__PURE__ */ u(
3459
- P,
3459
+ _,
3460
3460
  {
3461
3461
  variant: "secondary",
3462
3462
  className: "flex items-center w-full space-x-2 py-1",
@@ -3499,11 +3499,11 @@ const no = ({
3499
3499
  }, co = () => {
3500
3500
  const { fallbackLang: e, languages: t, selectedLang: n, setSelectedLang: s } = ut(), a = me(n) ? e : n, [, i] = Re();
3501
3501
  we(() => {
3502
- const y = new URLSearchParams(window.location.search), S = y.get("lang");
3503
- S && (t.includes(S) ? s(S) : (y.delete("lang"), i(y), s("")));
3502
+ const p = new URLSearchParams(window.location.search), S = p.get("lang");
3503
+ S && (t.includes(S) ? s(S) : (p.delete("lang"), i(p), s("")));
3504
3504
  }, [t, i, s]);
3505
- const [l, o] = _(null), { data: c } = Ue(), { data: h } = un(), { data: g, isFetching: d } = cn(), w = Y(() => {
3506
- const y = Qs(
3505
+ const [l, o] = P(null), { data: c } = Ue(), { data: h } = un(), { data: g, isFetching: d } = cn(), w = Y(() => {
3506
+ const p = Qs(
3507
3507
  Fe(te(h, "languages"), (S) => {
3508
3508
  const v = fe(g, { lang: S });
3509
3509
  return {
@@ -3519,36 +3519,36 @@ const no = ({
3519
3519
  value: te(qe, e),
3520
3520
  isLangPageAdded: !0
3521
3521
  },
3522
- ...y
3522
+ ...p
3523
3523
  ];
3524
- }, [e, g, h]), p = (y) => {
3525
- s(y);
3524
+ }, [e, g, h]), y = (p) => {
3525
+ s(p);
3526
3526
  const S = new URLSearchParams(window.location.search);
3527
- y === e ? S.delete("lang") : S.set("lang", y);
3527
+ p === e ? S.delete("lang") : S.set("lang", p);
3528
3528
  const v = S.toString(), x = `${window.location.pathname}${v ? `?${v}` : ""}`;
3529
3529
  window.history.pushState({}, "", x), i(S), window.dispatchEvent(new PopStateEvent("popstate"));
3530
3530
  };
3531
3531
  return me(t) || d ? null : /* @__PURE__ */ u(be, { children: [
3532
3532
  /* @__PURE__ */ u(rn, { children: [
3533
- /* @__PURE__ */ r(an, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ u(P, { variant: "ghost", size: "sm", className: "gap-2", children: [
3533
+ /* @__PURE__ */ r(an, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ u(_, { variant: "ghost", size: "sm", className: "gap-2", children: [
3534
3534
  /* @__PURE__ */ r(qi, { className: "w-4 h-4" }),
3535
3535
  te(qe, a, a),
3536
3536
  /* @__PURE__ */ r(_r, { className: "w-4 h-4" })
3537
3537
  ] }) }),
3538
3538
  /* @__PURE__ */ u(ln, { className: "border-border space-y-1", children: [
3539
3539
  Fe(
3540
- w.filter((y) => y.isLangPageAdded),
3541
- (y) => /* @__PURE__ */ u(
3540
+ w.filter((p) => p.isLangPageAdded),
3541
+ (p) => /* @__PURE__ */ u(
3542
3542
  De,
3543
3543
  {
3544
3544
  className: ei(
3545
3545
  "flex cursor-pointer items-center justify-between text-xs font-medium text-gray-800",
3546
- y.key === a && "!bg-gray-200 text-gray-700"
3546
+ p.key === a && "!bg-gray-200 text-gray-700"
3547
3547
  ),
3548
- onClick: () => p(y.key),
3548
+ onClick: () => y(p.key),
3549
3549
  children: [
3550
- /* @__PURE__ */ r("div", { className: "text-slate-600", children: y.value }),
3551
- y.key === e && /* @__PURE__ */ u(
3550
+ /* @__PURE__ */ r("div", { className: "text-slate-600", children: p.value }),
3551
+ p.key === e && /* @__PURE__ */ u(
3552
3552
  "small",
3553
3553
  {
3554
3554
  className: "text-[9px] flex items-center gap-x-1 text-orange-500 leading-none",
@@ -3560,13 +3560,13 @@ const no = ({
3560
3560
  )
3561
3561
  ]
3562
3562
  },
3563
- y.value
3563
+ p.value
3564
3564
  )
3565
3565
  ),
3566
- !me(w.filter((y) => !y.isLangPageAdded)) && /* @__PURE__ */ u(be, { children: [
3566
+ !me(w.filter((p) => !p.isLangPageAdded)) && /* @__PURE__ */ u(be, { children: [
3567
3567
  /* @__PURE__ */ r(gi, {}),
3568
3568
  /* @__PURE__ */ u(
3569
- P,
3569
+ _,
3570
3570
  {
3571
3571
  size: "sm",
3572
3572
  variant: "ghost",
@@ -3674,21 +3674,21 @@ function po() {
3674
3674
  isFetching: g,
3675
3675
  error: d,
3676
3676
  refetch: w
3677
- } = ho(c == null ? void 0 : c.id), { mutate: p, isPending: y } = mo(), { mutate: S, isPending: v } = fo(), x = Se(), R = (G) => {
3677
+ } = ho(c == null ? void 0 : c.id), { mutate: y, isPending: p } = mo(), { mutate: S, isPending: v } = fo(), x = Se(), G = (R) => {
3678
3678
  n && S(
3679
- { revisionId: n.uid, discardCurrent: G },
3679
+ { revisionId: n.uid, discardCurrent: R },
3680
3680
  {
3681
3681
  onSuccess: () => {
3682
3682
  i(!1), s(null), x.invalidateQueries({ queryKey: [I.GET_DRAFT_PAGE] });
3683
3683
  }
3684
3684
  }
3685
3685
  );
3686
- }, E = (G) => {
3687
- s(G), i(!0);
3688
- }, b = (G) => {
3689
- s(G), o(!0);
3686
+ }, E = (R) => {
3687
+ s(R), i(!0);
3688
+ }, b = (R) => {
3689
+ s(R), o(!0);
3690
3690
  }, T = () => {
3691
- n && p(n.uid, {
3691
+ n && y(n.uid, {
3692
3692
  onSuccess: () => {
3693
3693
  o(!1), s(null);
3694
3694
  }
@@ -3700,7 +3700,7 @@ function po() {
3700
3700
  /* @__PURE__ */ r(wr, { children: /* @__PURE__ */ u(ds, { children: [
3701
3701
  /* @__PURE__ */ u(yr, { open: e, onOpenChange: t, children: [
3702
3702
  /* @__PURE__ */ r(pi, { asChild: !0, children: /* @__PURE__ */ r(hs, { asChild: !0, children: /* @__PURE__ */ u("span", { className: "flex items-center gap-2", children: [
3703
- /* @__PURE__ */ u(P, { variant: "ghost", size: "icon", className: "h-8 w-8", children: [
3703
+ /* @__PURE__ */ u(_, { variant: "ghost", size: "icon", className: "h-8 w-8", children: [
3704
3704
  /* @__PURE__ */ r(Gs, { className: "h-4 w-4" }),
3705
3705
  /* @__PURE__ */ r("span", { className: "sr-only", children: "View revision history" })
3706
3706
  ] }),
@@ -3723,15 +3723,15 @@ function po() {
3723
3723
  ] }),
3724
3724
  /* @__PURE__ */ r(yi, { className: "h-[calc(100vh-6rem)] pr-2", children: g ? /* @__PURE__ */ r(yo, {}) : d ? /* @__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: [
3725
3725
  /* @__PURE__ */ r(go, {}),
3726
- h == null ? void 0 : h.map((G) => /* @__PURE__ */ r(
3726
+ h == null ? void 0 : h.map((R) => /* @__PURE__ */ r(
3727
3727
  vo,
3728
3728
  {
3729
- revision: G,
3730
- isLatest: G.uid === "current",
3731
- onRestore: () => E(G),
3732
- onDelete: () => b(G)
3729
+ revision: R,
3730
+ isLatest: R.uid === "current",
3731
+ onRestore: () => E(R),
3732
+ onDelete: () => b(R)
3733
3733
  },
3734
- G.uid
3734
+ R.uid
3735
3735
  ))
3736
3736
  ] }) })
3737
3737
  ] })
@@ -3744,7 +3744,7 @@ function po() {
3744
3744
  open: a,
3745
3745
  onOpenChange: i,
3746
3746
  revision: n,
3747
- onRestore: R,
3747
+ onRestore: G,
3748
3748
  isRestoring: v
3749
3749
  }
3750
3750
  ),
@@ -3755,7 +3755,7 @@ function po() {
3755
3755
  onOpenChange: o,
3756
3756
  revision: n,
3757
3757
  onDelete: T,
3758
- isDeleting: y
3758
+ isDeleting: p
3759
3759
  }
3760
3760
  )
3761
3761
  ] });
@@ -3825,7 +3825,7 @@ function Eo({
3825
3825
  onDelete: n
3826
3826
  }) {
3827
3827
  return /* @__PURE__ */ u(rn, { children: [
3828
- /* @__PURE__ */ r(an, { asChild: !0, children: /* @__PURE__ */ u(P, { variant: "ghost", size: "icon", className: "h-7 w-7 -mr-1", children: [
3828
+ /* @__PURE__ */ r(an, { asChild: !0, children: /* @__PURE__ */ u(_, { variant: "ghost", size: "icon", className: "h-7 w-7 -mr-1", children: [
3829
3829
  /* @__PURE__ */ r(gs, { className: "h-4 w-4" }),
3830
3830
  /* @__PURE__ */ r("span", { className: "sr-only", children: "More options" })
3831
3831
  ] }) }),
@@ -3883,7 +3883,7 @@ function bo({
3883
3883
  /* @__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?" }) }),
3884
3884
  /* @__PURE__ */ u(et, { className: "flex flex-col sm:flex-row gap-2", children: [
3885
3885
  /* @__PURE__ */ r(
3886
- P,
3886
+ _,
3887
3887
  {
3888
3888
  variant: "outline",
3889
3889
  className: "sm:flex-1",
@@ -3899,7 +3899,7 @@ function bo({
3899
3899
  }
3900
3900
  ),
3901
3901
  /* @__PURE__ */ r(
3902
- P,
3902
+ _,
3903
3903
  {
3904
3904
  variant: "default",
3905
3905
  className: "sm:flex-1",
@@ -3951,7 +3951,7 @@ function wo({
3951
3951
  /* @__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?" }) }),
3952
3952
  /* @__PURE__ */ u(et, { className: "flex flex-col sm:flex-row gap-2", children: [
3953
3953
  /* @__PURE__ */ r(
3954
- P,
3954
+ _,
3955
3955
  {
3956
3956
  variant: "outline",
3957
3957
  className: "sm:flex-1",
@@ -3961,7 +3961,7 @@ function wo({
3961
3961
  }
3962
3962
  ),
3963
3963
  /* @__PURE__ */ r(
3964
- P,
3964
+ _,
3965
3965
  {
3966
3966
  variant: "destructive",
3967
3967
  className: "sm:flex-1",
@@ -3995,7 +3995,7 @@ function Ao({
3995
3995
  showModal: e = !1,
3996
3996
  onClose: t = () => console.log("Cancelled")
3997
3997
  }) {
3998
- const [n, s] = _([]), { data: a, isFetching: i } = So(), { data: l } = Ie(), o = _e(
3998
+ const [n, s] = P([]), { data: a, isFetching: i } = So(), { data: l } = Ie(), o = _e(
3999
3999
  (b) => {
4000
4000
  var T;
4001
4001
  return (T = fe(l, { key: b })) == null ? void 0 : T.hasSlug;
@@ -4015,17 +4015,17 @@ function Ao({
4015
4015
  ), d = Y(
4016
4016
  () => fe(a, { pageType: "theme", id: "THEME" }),
4017
4017
  [a]
4018
- ), { mutate: w, isPending: p } = ws();
4018
+ ), { mutate: w, isPending: y } = ws();
4019
4019
  we(() => {
4020
4020
  const b = Fe(Te(a, { online: !0 }), "id");
4021
4021
  d && b.push(d == null ? void 0 : d.id), s(b);
4022
4022
  }, [a, d]);
4023
- const y = n.length === (a == null ? void 0 : a.length), S = (b) => {
4023
+ const p = n.length === (a == null ? void 0 : a.length), S = (b) => {
4024
4024
  s(
4025
- (T) => Mt(T, b) ? Te(T, (G) => G !== b) : Xs(T, b)
4025
+ (T) => Mt(T, b) ? Te(T, (R) => R !== b) : Xs(T, b)
4026
4026
  );
4027
4027
  }, v = () => {
4028
- s(y ? [] : Fe(a, "id"));
4028
+ s(p ? [] : Fe(a, "id"));
4029
4029
  }, x = () => {
4030
4030
  w(
4031
4031
  { ids: Ha(n) },
@@ -4035,7 +4035,7 @@ function Ao({
4035
4035
  }
4036
4036
  }
4037
4037
  );
4038
- }, R = (b) => {
4038
+ }, G = (b) => {
4039
4039
  if (b === "theme") return "Theme";
4040
4040
  const T = fe(l, { key: b });
4041
4041
  return T ? T == null ? void 0 : T.name : b;
@@ -4048,10 +4048,10 @@ function Ao({
4048
4048
  { label: "Offline", top: "pt-6" },
4049
4049
  ...mn(Te(h, { online: !1 }), "pageType"),
4050
4050
  ...mn(Te(g, { online: !1 }), "pageType")
4051
- ], G = d ? [{ label: "Theme", top: "pt-6" }, d] : [];
4052
- return [...b, ...G, ...T];
4051
+ ], R = d ? [{ label: "Theme", top: "pt-6" }, d] : [];
4052
+ return [...b, ...R, ...T];
4053
4053
  }, [h, g, d]);
4054
- return /* @__PURE__ */ r(He, { open: e, onOpenChange: p ? () => {
4054
+ return /* @__PURE__ */ r(He, { open: e, onOpenChange: y ? () => {
4055
4055
  } : t, children: /* @__PURE__ */ u(Ke, { className: "max-w-4xl max-h-[80%] flex flex-col", children: [
4056
4056
  /* @__PURE__ */ u(Ve, { children: [
4057
4057
  /* @__PURE__ */ r(je, { children: "Publish changes" }),
@@ -4073,7 +4073,7 @@ function Ao({
4073
4073
  /* @__PURE__ */ r(
4074
4074
  "input",
4075
4075
  {
4076
- checked: y,
4076
+ checked: p,
4077
4077
  onClick: (b) => {
4078
4078
  b.stopPropagation(), v();
4079
4079
  },
@@ -4148,7 +4148,7 @@ function Ao({
4148
4148
  }
4149
4149
  ),
4150
4150
  /* @__PURE__ */ r("td", { className: "px-2", children: b.lang }),
4151
- /* @__PURE__ */ r("td", { className: "px-2", children: R(b == null ? void 0 : b.pageType) }),
4151
+ /* @__PURE__ */ r("td", { className: "px-2", children: G(b == null ? void 0 : b.pageType) }),
4152
4152
  /* @__PURE__ */ r("td", { className: "px-4 text-right", children: qa(b.changes) || "" })
4153
4153
  ]
4154
4154
  },
@@ -4157,13 +4157,13 @@ function Ao({
4157
4157
  ) })
4158
4158
  ] }) }),
4159
4159
  /* @__PURE__ */ u(et, { className: "mt-10", children: [
4160
- /* @__PURE__ */ r(P, { disabled: p, variant: "outline", onClick: t, children: "Cancel" }),
4160
+ /* @__PURE__ */ r(_, { disabled: y, variant: "outline", onClick: t, children: "Cancel" }),
4161
4161
  /* @__PURE__ */ r(
4162
- P,
4162
+ _,
4163
4163
  {
4164
- disabled: p || i || me(a),
4164
+ disabled: y || i || me(a),
4165
4165
  onClick: x,
4166
- children: p ? "Publishing..." : "Publish"
4166
+ children: y ? "Publishing..." : "Publish"
4167
4167
  }
4168
4168
  )
4169
4169
  ] })
@@ -4210,7 +4210,7 @@ function Kr({
4210
4210
  ] }) });
4211
4211
  }
4212
4212
  const Co = () => {
4213
- const { selectedLang: e } = ut(), t = dt("getPreviewUrl", async (g) => g), [n, s] = _(""), { data: a, isFetching: i } = Ue(), { data: l } = cn(), { data: o } = Ie(), c = Y(
4213
+ const { selectedLang: e } = ut(), t = dt("getPreviewUrl", async (g) => g), [n, s] = P(""), { data: a, isFetching: i } = Ue(), { data: l } = cn(), { data: o } = Ie(), c = Y(
4214
4214
  () => {
4215
4215
  var g;
4216
4216
  return (g = l == null ? void 0 : l.find((d) => (d == null ? void 0 : d.lang) === e)) == null ? void 0 : g.slug;
@@ -4231,7 +4231,7 @@ const Co = () => {
4231
4231
  } else
4232
4232
  s("");
4233
4233
  })();
4234
- }, [t, c]), !n || !h(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: [
4234
+ }, [t, c]), !n || !h(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(_, { variant: "ghost", size: "sm", className: "gap-2", children: [
4235
4235
  /* @__PURE__ */ r(Lr, { className: "w-4 h-4" }),
4236
4236
  " ",
4237
4237
  B.PREVIEW
@@ -4240,7 +4240,7 @@ const Co = () => {
4240
4240
  const [e, t] = ti();
4241
4241
  return /* @__PURE__ */ u(be, { children: [
4242
4242
  /* @__PURE__ */ r(Kr, { content: B.THEME, children: /* @__PURE__ */ r(
4243
- P,
4243
+ _,
4244
4244
  {
4245
4245
  variant: e === "theme" ? "outline" : "ghost",
4246
4246
  size: "icon",
@@ -4252,7 +4252,7 @@ const Co = () => {
4252
4252
  /* @__PURE__ */ r("div", { className: "w-px h-4 bg-gray-200 dark:bg-gray-700" })
4253
4253
  ] });
4254
4254
  }, _o = () => {
4255
- const [e, t] = _(!1), { isLocked: n } = hn(), { savePage: s, saveState: a } = sr();
4255
+ const [e, t] = P(!1), { isLocked: n } = hn(), { savePage: s, saveState: a } = sr();
4256
4256
  we(() => {
4257
4257
  const g = (d) => {
4258
4258
  a === "UNSAVED" && (d.preventDefault(), d.returnValue = !1);
@@ -4293,7 +4293,7 @@ const Co = () => {
4293
4293
  }
4294
4294
  }, [l]);
4295
4295
  return n ? null : /* @__PURE__ */ u(
4296
- P,
4296
+ _,
4297
4297
  {
4298
4298
  size: "sm",
4299
4299
  variant: "ghost",
@@ -4307,25 +4307,25 @@ const Co = () => {
4307
4307
  }
4308
4308
  );
4309
4309
  }, Io = () => {
4310
- const [e, t] = _(!1), [n, s] = _(!1), [a, i] = _(null), { data: l } = Ue(), { mutate: o, isPending: c } = ws(), [h] = ni(), { buttonText: g, buttonClassName: d, isPublished: w } = Y(() => {
4311
- const y = l && (l == null ? void 0 : l.online);
4310
+ const [e, t] = P(!1), [n, s] = P(!1), [a, i] = P(null), { data: l } = Ue(), { mutate: o, isPending: c } = ws(), [h] = ni(), { buttonText: g, buttonClassName: d, isPublished: w } = Y(() => {
4311
+ const p = l && (l == null ? void 0 : l.online);
4312
4312
  return {
4313
- buttonClassName: y ? "hover:bg-green-600 bg-green-500" : "",
4314
- isPublished: y,
4315
- buttonText: y ? B.PUBLISHED : B.PUBLISH
4313
+ buttonClassName: p ? "hover:bg-green-600 bg-green-500" : "",
4314
+ isPublished: p,
4315
+ buttonText: p ? B.PUBLISHED : B.PUBLISH
4316
4316
  };
4317
4317
  }, [l]);
4318
4318
  return /* @__PURE__ */ u(be, { children: [
4319
4319
  /* @__PURE__ */ u("div", { className: "flex", children: [
4320
4320
  /* @__PURE__ */ u(
4321
- P,
4321
+ _,
4322
4322
  {
4323
4323
  size: "sm",
4324
4324
  onClick: async () => {
4325
4325
  var S, v;
4326
- const y = ((v = (S = h == null ? void 0 : h.filter((x) => (x == null ? void 0 : x._type) === "GlobalBlock")) == null ? void 0 : S.map((x) => x == null ? void 0 : x.globalBlock)) == null ? void 0 : v.filter((x) => typeof x == "string")) || [];
4326
+ const p = ((v = (S = h == null ? void 0 : h.filter((x) => (x == null ? void 0 : x._type) === "GlobalBlock")) == null ? void 0 : S.map((x) => x == null ? void 0 : x.globalBlock)) == null ? void 0 : v.filter((x) => typeof x == "string")) || [];
4327
4327
  o(
4328
- { ids: [l == null ? void 0 : l.id, ...y] },
4328
+ { ids: [l == null ? void 0 : l.id, ...p] },
4329
4329
  { onSuccess: () => xn("TOP_RIGHT") }
4330
4330
  );
4331
4331
  },
@@ -4354,7 +4354,7 @@ const Co = () => {
4354
4354
  ),
4355
4355
  /* @__PURE__ */ u(rn, { children: [
4356
4356
  /* @__PURE__ */ r(an, { asChild: !0, children: /* @__PURE__ */ r(
4357
- P,
4357
+ _,
4358
4358
  {
4359
4359
  size: "sm",
4360
4360
  disabled: c || !(l != null && l.id),
@@ -4413,10 +4413,10 @@ const Co = () => {
4413
4413
  )
4414
4414
  ] });
4415
4415
  }, ko = () => {
4416
- const e = dt("settingComponent", null), [t, n] = _(!1);
4416
+ const e = dt("settingComponent", null), [t, n] = P(!1);
4417
4417
  return e ? /* @__PURE__ */ u(be, { children: [
4418
4418
  /* @__PURE__ */ r(Kr, { content: B.WEBSITEDATA, children: /* @__PURE__ */ r(
4419
- P,
4419
+ _,
4420
4420
  {
4421
4421
  variant: "ghost",
4422
4422
  size: "icon",
@@ -4437,7 +4437,7 @@ const Co = () => {
4437
4437
  },
4438
4438
  [n]
4439
4439
  )(e == null ? void 0 : e.pageType) ? /* @__PURE__ */ u(
4440
- P,
4440
+ _,
4441
4441
  {
4442
4442
  onClick: () => t && window.open(`${window.location.origin}${e.slug}`, "_blank"),
4443
4443
  disabled: !t,
@@ -4595,50 +4595,51 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4595
4595
  }), Ho = ({
4596
4596
  onLoginSuccess: e
4597
4597
  }) => {
4598
- const t = Gn(), [n, s] = _(""), [a, i] = _(""), [l, o] = _({}), [c, h] = _(!1), g = Ae({
4599
- mutationFn: async (p) => {
4600
- const y = await ys(t, {
4598
+ const t = Gn(), [n, s] = P(""), [a, i] = P(""), [l, o] = P({}), [c, h] = P(!1), [g, d] = P(""), w = Ae({
4599
+ mutationFn: async (S) => {
4600
+ d("");
4601
+ const v = await ys(t, {
4601
4602
  action: "LOGIN",
4602
- data: p
4603
+ data: S
4603
4604
  });
4604
- if (!y.ok) {
4605
- const v = await y.json();
4606
- throw new Error(v.message || "Login failed");
4605
+ if (!v.ok) {
4606
+ const G = await v.json();
4607
+ throw new Error(G.error || "Login failed");
4607
4608
  }
4608
- const S = await y.json();
4609
- return e(S), S;
4609
+ const x = await v.json();
4610
+ return e(x), x;
4610
4611
  },
4611
4612
  onSuccess: () => {
4612
- o({});
4613
+ o({}), d("");
4613
4614
  },
4614
- onError: (p) => {
4615
+ onError: (S) => {
4615
4616
  o({
4616
4617
  email: " ",
4617
- password: p.message || "Something went wrong"
4618
- });
4618
+ password: " "
4619
+ }), d(S.message || "Something went wrong");
4619
4620
  }
4620
- }), d = async (p) => {
4621
- p.preventDefault(), o({});
4622
- const y = { email: n, password: a };
4621
+ }), y = async (S) => {
4622
+ S.preventDefault(), o({});
4623
+ const v = { email: n, password: a };
4623
4624
  try {
4624
- const S = Bs.parse(y);
4625
- g.mutate(S);
4626
- } catch (S) {
4627
- if (S instanceof Nn.ZodError) {
4628
- const v = S.errors.reduce((x, R) => {
4629
- const E = R.path[0];
4630
- return x[E] = R.message, x;
4625
+ const x = Bs.parse(v);
4626
+ w.mutate(x);
4627
+ } catch (x) {
4628
+ if (x instanceof Nn.ZodError) {
4629
+ const G = x.errors.reduce((E, b) => {
4630
+ const T = b.path[0];
4631
+ return E[T] = b.message, E;
4631
4632
  }, {});
4632
- o(v);
4633
+ o(G);
4633
4634
  }
4634
4635
  }
4635
- }, w = Bs.safeParse({ email: n, password: a }).success;
4636
+ }, p = Bs.safeParse({ email: n, password: a }).success;
4636
4637
  return /* @__PURE__ */ r("div", { className: "flex justify-center items-center min-h-screen bg-slate-50", children: /* @__PURE__ */ u(is, { className: "w-full max-w-md", children: [
4637
4638
  /* @__PURE__ */ u(ls, { children: [
4638
4639
  /* @__PURE__ */ r(os, { className: "text-2xl", children: "Sign in" }),
4639
4640
  /* @__PURE__ */ r(Ei, { children: "Enter your credentials to sign in to visual builder" })
4640
4641
  ] }),
4641
- /* @__PURE__ */ r(cs, { children: /* @__PURE__ */ u("form", { onSubmit: d, className: "space-y-4", children: [
4642
+ /* @__PURE__ */ r(cs, { children: /* @__PURE__ */ u("form", { onSubmit: y, className: "space-y-4", children: [
4642
4643
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
4643
4644
  /* @__PURE__ */ r(X, { htmlFor: "email", children: "Email" }),
4644
4645
  /* @__PURE__ */ r(
@@ -4648,7 +4649,7 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4648
4649
  placeholder: "you@example.com",
4649
4650
  type: "email",
4650
4651
  value: n,
4651
- onChange: (p) => s(p.target.value),
4652
+ onChange: (S) => s(S.target.value),
4652
4653
  className: l.email ? "border-destructive" : ""
4653
4654
  }
4654
4655
  ),
@@ -4664,7 +4665,7 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4664
4665
  placeholder: "Enter your password",
4665
4666
  type: c ? "text" : "password",
4666
4667
  value: a,
4667
- onChange: (p) => i(p.target.value),
4668
+ onChange: (S) => i(S.target.value),
4668
4669
  className: l.password ? "border-destructive" : ""
4669
4670
  }
4670
4671
  ),
@@ -4680,13 +4681,14 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4680
4681
  ] }),
4681
4682
  l.password && /* @__PURE__ */ r("p", { className: "text-sm text-destructive", children: l.password })
4682
4683
  ] }),
4684
+ /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("p", { className: "text-sm text-destructive", children: g }) }),
4683
4685
  /* @__PURE__ */ r(
4684
- P,
4686
+ _,
4685
4687
  {
4686
4688
  type: "submit",
4687
4689
  className: "w-full",
4688
- disabled: !w || g.isPending,
4689
- children: g.isPending ? /* @__PURE__ */ u(be, { children: [
4690
+ disabled: !p || w.isPending,
4691
+ children: w.isPending ? /* @__PURE__ */ u(be, { children: [
4690
4692
  /* @__PURE__ */ r(Dr, { className: "mr-2 h-4 w-4 animate-spin" }),
4691
4693
  "Logging in..."
4692
4694
  ] }) : "Login"
@@ -4749,7 +4751,7 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4749
4751
  show: t
4750
4752
  }) => {
4751
4753
  const { data: n } = un();
4752
- return !nn(n, "languages") || !te(n, "languages", []).length ? null : /* @__PURE__ */ r(P, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ r(Ji, { className: "w-4 h-4" }) });
4754
+ return !nn(n, "languages") || !te(n, "languages", []).length ? null : /* @__PURE__ */ r(_, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ r(Ji, { className: "w-4 h-4" }) });
4753
4755
  }, Vr = "lang", jo = {
4754
4756
  id: Vr,
4755
4757
  label: "Languages",
@@ -4769,26 +4771,26 @@ function Ze({
4769
4771
  ce.useEffect(() => {
4770
4772
  a || o([]), h(e);
4771
4773
  }, [e, a]);
4772
- const g = (y) => Array.isArray(y) ? "array" : typeof y == "object" && y !== null ? "object" : "value", d = ce.useCallback(
4773
- (y) => {
4774
+ const g = (p) => Array.isArray(p) ? "array" : typeof p == "object" && p !== null ? "object" : "value", d = ce.useCallback(
4775
+ (p) => {
4774
4776
  const S = (v) => n === "value" ? v === "value" || v === "object" : n === "array" ? v === "array" : v === n;
4775
- y.type === "object" ? (o((v) => [...v, y.key]), h(y.value)) : S(y.type) && (t([...l, y.key].join(".")), i(!1));
4777
+ p.type === "object" ? (o((v) => [...v, p.key]), h(p.value)) : S(p.type) && (t([...l, p.key].join(".")), i(!1));
4776
4778
  },
4777
4779
  [l, t, n]
4778
4780
  ), w = ce.useCallback(() => {
4779
4781
  if (l.length > 0) {
4780
- const y = l.slice(0, -1);
4781
- o(y), h(y.reduce((S, v) => S[v], e));
4782
+ const p = l.slice(0, -1);
4783
+ o(p), h(p.reduce((S, v) => S[v], e));
4782
4784
  }
4783
- }, [l, e]), p = ce.useMemo(() => Object.entries(c).map(([y, S]) => ({
4784
- key: y,
4785
+ }, [l, e]), y = ce.useMemo(() => Object.entries(c).map(([p, S]) => ({
4786
+ key: p,
4785
4787
  value: S,
4786
4788
  type: g(S)
4787
- })).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]);
4789
+ })).filter((p) => n === "value" ? p.type === "value" || p.type === "object" : n === "array" ? p.type === "array" || p.type === "object" : n === "object" ? p.type === "object" : !0), [c, n]);
4788
4790
  return /* @__PURE__ */ u(mr, { open: a, onOpenChange: i, children: [
4789
4791
  /* @__PURE__ */ u(ds, { children: [
4790
4792
  /* @__PURE__ */ r(hs, { asChild: !0, children: /* @__PURE__ */ r(fr, { asChild: !0, children: /* @__PURE__ */ r(
4791
- P,
4793
+ _,
4792
4794
  {
4793
4795
  size: "sm",
4794
4796
  variant: "outline",
@@ -4817,31 +4819,31 @@ function Ze({
4817
4819
  ]
4818
4820
  }
4819
4821
  ),
4820
- p.map((y) => /* @__PURE__ */ u(
4822
+ y.map((p) => /* @__PURE__ */ u(
4821
4823
  Ls,
4822
4824
  {
4823
- onSelect: () => d(y),
4825
+ onSelect: () => d(p),
4824
4826
  className: "flex items-center justify-between",
4825
4827
  children: [
4826
- /* @__PURE__ */ r("span", { children: y.key }),
4828
+ /* @__PURE__ */ r("span", { children: p.key }),
4827
4829
  /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
4828
- n === "object" && y.type === "object" && /* @__PURE__ */ r(
4829
- P,
4830
+ n === "object" && p.type === "object" && /* @__PURE__ */ r(
4831
+ _,
4830
4832
  {
4831
4833
  size: "sm",
4832
4834
  variant: "ghost",
4833
4835
  className: "h-6 px-2 hover:bg-primary hover:text-primary-foreground",
4834
4836
  onClick: (S) => {
4835
- S.stopPropagation(), t([...l, y.key].join(".")), i(!1);
4837
+ S.stopPropagation(), t([...l, p.key].join(".")), i(!1);
4836
4838
  },
4837
4839
  children: "Select"
4838
4840
  }
4839
4841
  ),
4840
- (y.type === "object" || y.type === "array") && /* @__PURE__ */ r("div", { className: "p-1 rounded hover:bg-muted cursor-pointer", children: /* @__PURE__ */ r(nl, { className: "w-4 h-4 opacity-50" }) })
4842
+ (p.type === "object" || p.type === "array") && /* @__PURE__ */ r("div", { className: "p-1 rounded hover:bg-muted cursor-pointer", children: /* @__PURE__ */ r(nl, { className: "w-4 h-4 opacity-50" }) })
4841
4843
  ] })
4842
4844
  ]
4843
4845
  },
4844
- y.key
4846
+ p.key
4845
4847
  ))
4846
4848
  ] })
4847
4849
  ] })
@@ -4855,19 +4857,19 @@ const $o = () => {
4855
4857
  const n = e.selectionStart || 0, s = e.selectionEnd || 0, a = e.value, i = a.substring(0, n), l = a.substring(s);
4856
4858
  let o = !1;
4857
4859
  if (n > 0 && i.length > 0) {
4858
- const y = i.charAt(i.length - 1);
4859
- o = !/[\s.,!?;:()[\]{}]/.test(y) && y !== "";
4860
+ const p = i.charAt(i.length - 1);
4861
+ o = !/[\s.,!?;:()[\]{}]/.test(p) && p !== "";
4860
4862
  }
4861
4863
  let c = !1;
4862
4864
  if (l.length > 0) {
4863
- const y = l.charAt(0);
4864
- c = !/[\s.,!?;:()[\]{}]/.test(y) && y !== "";
4865
+ const p = l.charAt(0);
4866
+ c = !/[\s.,!?;:()[\]{}]/.test(p) && p !== "";
4865
4867
  }
4866
- const h = o ? " " : "", g = c ? " " : "", d = `{{${t}}}`, w = i + (o ? h : "") + d + (c ? g : "") + l, p = n + (o ? 1 : 0) + // Account for space before if added
4868
+ const h = o ? " " : "", g = c ? " " : "", d = `{{${t}}}`, w = i + (o ? h : "") + d + (c ? g : "") + l, y = n + (o ? 1 : 0) + // Account for space before if added
4867
4869
  d.length;
4868
4870
  return {
4869
4871
  value: w,
4870
- newCursorPos: p
4872
+ newCursorPos: y
4871
4873
  };
4872
4874
  }, jr = () => {
4873
4875
  const { t: e } = ri(), { selectedLang: t, fallbackLang: n, languages: s } = ut(), [, a] = ai(), { data: i } = Ue(), { data: l } = Mr({
@@ -4875,7 +4877,7 @@ const $o = () => {
4875
4877
  pageType: i == null ? void 0 : i.pageType
4876
4878
  }), { data: o, isFetching: c } = $o(), h = o == null ? void 0 : o.seo, g = ct(
4877
4879
  null
4878
- ), [d, w] = _({
4880
+ ), [d, w] = P({
4879
4881
  title: "",
4880
4882
  description: "",
4881
4883
  cononicalUrl: "",
@@ -4888,7 +4890,7 @@ const $o = () => {
4888
4890
  searchDescription: "",
4889
4891
  jsonLD: "",
4890
4892
  ...h
4891
- }), p = ct({ initial: d, updated: d }), y = t.length ? t : n, { mutate: S, isPending: v } = bs(), x = v, { hasPermission: R } = sn(), E = R(ue.EDIT_SEO);
4893
+ }), y = ct({ initial: d, updated: d }), p = t.length ? t : n, { mutate: S, isPending: v } = bs(), x = v, { hasPermission: G } = sn(), E = G(ue.EDIT_SEO);
4892
4894
  we(() => {
4893
4895
  !c && h && w({
4894
4896
  title: "",
@@ -4910,7 +4912,7 @@ const $o = () => {
4910
4912
  { id: o == null ? void 0 : o.id, seo: d },
4911
4913
  {
4912
4914
  onSuccess: () => {
4913
- p.current.initial = d, p.current.updated = d, a("outline");
4915
+ y.current.initial = d, y.current.updated = d, a("outline");
4914
4916
  }
4915
4917
  }
4916
4918
  );
@@ -4920,7 +4922,7 @@ const $o = () => {
4920
4922
  ogTitle: d.title,
4921
4923
  ogDescription: d.description
4922
4924
  });
4923
- }, G = () => {
4925
+ }, R = () => {
4924
4926
  w({
4925
4927
  ...d,
4926
4928
  searchTitle: d.ogTitle,
@@ -4964,7 +4966,7 @@ const $o = () => {
4964
4966
  ...d,
4965
4967
  [k.target.name]: k.target.name === "noIndex" || k.target.name === "noFollow" ? k.target.checked : k.target.value
4966
4968
  };
4967
- w(q), p.current.updated = q;
4969
+ w(q), y.current.updated = q;
4968
4970
  };
4969
4971
  return /* @__PURE__ */ u("div", { className: "relative h-full flex flex-col", children: [
4970
4972
  !E && /* @__PURE__ */ r("div", { className: "absolute inset-0 z-10 backdrop-blur-sm flex items-center justify-center", children: /* @__PURE__ */ r(pr, { variant: "default", className: "w-[80%] max-w-md text-xs", children: /* @__PURE__ */ r(xi, { children: e(
@@ -4978,7 +4980,7 @@ const $o = () => {
4978
4980
  "  ",
4979
4981
  s.length > 0 && /* @__PURE__ */ u("span", { className: "font-semibold text-blue-500", children: [
4980
4982
  "(",
4981
- te(qe, y, y),
4983
+ te(qe, p, p),
4982
4984
  ")"
4983
4985
  ] })
4984
4986
  ] }),
@@ -5109,7 +5111,7 @@ const $o = () => {
5109
5111
  /* @__PURE__ */ r(pn, { className: "font-bold text-slate-700", children: e("Open Graph") }),
5110
5112
  /* @__PURE__ */ r(yn, { children: /* @__PURE__ */ u("div", { className: "space-y-4", children: [
5111
5113
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r(
5112
- P,
5114
+ _,
5113
5115
  {
5114
5116
  type: "button",
5115
5117
  variant: "outline",
@@ -5203,12 +5205,12 @@ const $o = () => {
5203
5205
  /* @__PURE__ */ r(pn, { className: "font-bold text-slate-700", children: e("Search") }),
5204
5206
  /* @__PURE__ */ r(yn, { children: /* @__PURE__ */ u("div", { className: "space-y-4", children: [
5205
5207
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r(
5206
- P,
5208
+ _,
5207
5209
  {
5208
5210
  type: "button",
5209
5211
  variant: "outline",
5210
5212
  size: "sm",
5211
- onClick: G,
5213
+ onClick: R,
5212
5214
  disabled: !E,
5213
5215
  children: e("Copy from OG Settings")
5214
5216
  }
@@ -5299,12 +5301,12 @@ const $o = () => {
5299
5301
  ] }) })
5300
5302
  ] }),
5301
5303
  E && /* @__PURE__ */ r("div", { className: "flex-shrink-0 flex items-center justify-end w-full p-4 bg-background border-t", children: /* @__PURE__ */ r(
5302
- P,
5304
+ _,
5303
5305
  {
5304
5306
  size: "lg",
5305
5307
  variant: "default",
5306
5308
  onClick: b,
5307
- disabled: rs(p.current.initial, d) || x || !E,
5309
+ disabled: rs(y.current.initial, d) || x || !E,
5308
5310
  children: e(v ? "Saving..." : "Save")
5309
5311
  }
5310
5312
  ) })
@@ -5317,7 +5319,7 @@ const $r = "seo", Wo = ({
5317
5319
  }) => {
5318
5320
  const { data: n } = Ue(), s = Ol(n == null ? void 0 : n.pageType);
5319
5321
  return !nn(s, "hasSlug") || !s.hasSlug ? null : /* @__PURE__ */ r(
5320
- P,
5322
+ _,
5321
5323
  {
5322
5324
  size: "sm",
5323
5325
  className: "my-1",
@@ -5351,12 +5353,12 @@ const $r = "seo", Wo = ({
5351
5353
  }, Xo = "user-info", Zo = () => {
5352
5354
  const { user: e, logout: t } = st();
5353
5355
  return e ? /* @__PURE__ */ u(Ci, { children: [
5354
- /* @__PURE__ */ r(Pi, { asChild: !0, children: /* @__PURE__ */ r(P, { variant: "ghost", className: "text-sm font-medium", children: /* @__PURE__ */ r(sl, { className: "w-4 h-4" }) }) }),
5356
+ /* @__PURE__ */ r(Pi, { asChild: !0, children: /* @__PURE__ */ r(_, { variant: "ghost", className: "text-sm font-medium", children: /* @__PURE__ */ r(sl, { className: "w-4 h-4" }) }) }),
5355
5357
  /* @__PURE__ */ u(_i, { className: "w-auto p-4 space-y-2", children: [
5356
5358
  /* @__PURE__ */ r("div", { className: "text-sm font-medium", children: e.name ?? e.email }),
5357
5359
  /* @__PURE__ */ r("div", { className: "text-xs text-muted-foreground", children: e.email }),
5358
5360
  /* @__PURE__ */ u(rr, { children: [
5359
- /* @__PURE__ */ r(ar, { asChild: !0, children: /* @__PURE__ */ r(P, { variant: "outline", size: "sm", className: "w-full", children: "Logout" }) }),
5361
+ /* @__PURE__ */ r(ar, { asChild: !0, children: /* @__PURE__ */ r(_, { variant: "outline", size: "sm", className: "w-full", children: "Logout" }) }),
5360
5362
  /* @__PURE__ */ u(ir, { children: [
5361
5363
  /* @__PURE__ */ u(lr, { children: [
5362
5364
  /* @__PURE__ */ r(or, { children: "Are you sure you want to logout?" }),
@@ -5452,7 +5454,7 @@ function ac(e, t, n) {
5452
5454
  let s, a, i;
5453
5455
  arguments.length === 1 ? (s = !0, a = e, i = {}) : (s = e, a = t, i = {});
5454
5456
  let l = null, o = Hn, c = null, h = !1, g = "initialValue" in i, d = typeof s == "function" && Ge(s);
5455
- const w = /* @__PURE__ */ new Set(), [p, y] = (i.storage || ve)(i.initialValue), [S, v] = ve(void 0), [x, R] = ve(void 0, {
5457
+ const w = /* @__PURE__ */ new Set(), [y, p] = (i.storage || ve)(i.initialValue), [S, v] = ve(void 0), [x, G] = ve(void 0, {
5456
5458
  equals: !1
5457
5459
  }), [E, b] = ve(g ? "ready" : "unresolved");
5458
5460
  O.context && (c = O.getNextContextId(), i.ssrLoadFrom === "initial" ? o = i.initialValue : O.load && O.has(c) && (o = O.load(c)));
@@ -5461,18 +5463,18 @@ function ac(e, t, n) {
5461
5463
  () => i.onHydrated(M, {
5462
5464
  value: q
5463
5465
  })
5464
- ), o = Hn, G(q, A)), q;
5466
+ ), o = Hn, R(q, A)), q;
5465
5467
  }
5466
- function G(k, q) {
5468
+ function R(k, q) {
5467
5469
  We(() => {
5468
- q === void 0 && y(() => k), b(q !== void 0 ? "errored" : g ? "ready" : "unresolved"), v(q);
5470
+ q === void 0 && p(() => k), b(q !== void 0 ? "errored" : g ? "ready" : "unresolved"), v(q);
5469
5471
  for (const A of w.keys())
5470
5472
  A.decrement();
5471
5473
  w.clear();
5472
5474
  }, !1);
5473
5475
  }
5474
5476
  function J() {
5475
- const k = uc, q = p(), A = S();
5477
+ const k = uc, q = y(), A = S();
5476
5478
  if (A !== void 0 && !l)
5477
5479
  throw A;
5478
5480
  return re && re.user, q;
@@ -5483,17 +5485,17 @@ function ac(e, t, n) {
5483
5485
  h = !1;
5484
5486
  const q = d ? d() : s;
5485
5487
  if (q == null || q === !1) {
5486
- T(l, Ce(p));
5488
+ T(l, Ce(y));
5487
5489
  return;
5488
5490
  }
5489
5491
  const A = o !== Hn ? o : Ce(
5490
5492
  () => a(q, {
5491
- value: p(),
5493
+ value: y(),
5492
5494
  refetching: k
5493
5495
  })
5494
5496
  );
5495
5497
  return rc(A) ? (l = A, "value" in A ? (A.status === "success" ? T(l, A.value, void 0, q) : T(l, void 0, zn(A.value), q), A) : (h = !0, queueMicrotask(() => h = !1), We(() => {
5496
- b(g ? "refreshing" : "pending"), R();
5498
+ b(g ? "refreshing" : "pending"), G();
5497
5499
  }, !1), A.then(
5498
5500
  (M) => T(A, M, void 0, q),
5499
5501
  (M) => T(A, void 0, zn(M), q)
@@ -5519,14 +5521,14 @@ function ac(e, t, n) {
5519
5521
  const k = S();
5520
5522
  if (k && !l)
5521
5523
  throw k;
5522
- return p();
5524
+ return y();
5523
5525
  }
5524
5526
  }
5525
5527
  }), d ? sc(() => ie(!1)) : ie(!1), [
5526
5528
  J,
5527
5529
  {
5528
5530
  refetch: ie,
5529
- mutate: y
5531
+ mutate: p
5530
5532
  }
5531
5533
  ];
5532
5534
  }
@@ -5820,32 +5822,32 @@ function gc(e, t, n = {}) {
5820
5822
  return Ft(() => kn(i)), () => {
5821
5823
  let c = e() || [], h = c.length, g, d;
5822
5824
  return c[Wr], Ce(() => {
5823
- let p, y, S, v, x, R, E, b, T;
5825
+ let y, p, S, v, x, G, E, b, T;
5824
5826
  if (h === 0)
5825
- l !== 0 && (kn(i), i = [], s = [], a = [], l = 0, o && (o = [])), n.fallback && (s = [Yn], a[0] = lt((G) => (i[0] = G, n.fallback())), l = 1);
5827
+ l !== 0 && (kn(i), i = [], s = [], a = [], l = 0, o && (o = [])), n.fallback && (s = [Yn], a[0] = lt((R) => (i[0] = R, n.fallback())), l = 1);
5826
5828
  else if (l === 0) {
5827
5829
  for (a = new Array(h), d = 0; d < h; d++)
5828
5830
  s[d] = c[d], a[d] = lt(w);
5829
5831
  l = h;
5830
5832
  } else {
5831
- for (S = new Array(h), v = new Array(h), o && (x = new Array(h)), R = 0, E = Math.min(l, h); R < E && s[R] === c[R]; R++)
5833
+ for (S = new Array(h), v = new Array(h), o && (x = new Array(h)), G = 0, E = Math.min(l, h); G < E && s[G] === c[G]; G++)
5832
5834
  ;
5833
- for (E = l - 1, b = h - 1; E >= R && b >= R && s[E] === c[b]; E--, b--)
5835
+ for (E = l - 1, b = h - 1; E >= G && b >= G && s[E] === c[b]; E--, b--)
5834
5836
  S[b] = a[E], v[b] = i[E], o && (x[b] = o[E]);
5835
- for (p = /* @__PURE__ */ new Map(), y = new Array(b + 1), d = b; d >= R; d--)
5836
- T = c[d], g = p.get(T), y[d] = g === void 0 ? -1 : g, p.set(T, d);
5837
- for (g = R; g <= E; g++)
5838
- T = s[g], d = p.get(T), d !== void 0 && d !== -1 ? (S[d] = a[g], v[d] = i[g], o && (x[d] = o[g]), d = y[d], p.set(T, d)) : i[g]();
5839
- for (d = R; d < h; d++)
5837
+ for (y = /* @__PURE__ */ new Map(), p = new Array(b + 1), d = b; d >= G; d--)
5838
+ T = c[d], g = y.get(T), p[d] = g === void 0 ? -1 : g, y.set(T, d);
5839
+ for (g = G; g <= E; g++)
5840
+ T = s[g], d = y.get(T), d !== void 0 && d !== -1 ? (S[d] = a[g], v[d] = i[g], o && (x[d] = o[g]), d = p[d], y.set(T, d)) : i[g]();
5841
+ for (d = G; d < h; d++)
5840
5842
  d in S ? (a[d] = S[d], i[d] = v[d], o && (o[d] = x[d], o[d](d))) : a[d] = lt(w);
5841
5843
  a = a.slice(0, l = h), s = c.slice(0);
5842
5844
  }
5843
5845
  return a;
5844
5846
  });
5845
- function w(p) {
5846
- if (i[d] = p, o) {
5847
- const [y, S] = ve(d);
5848
- return o[d] = S, t(c[d], y);
5847
+ function w(y) {
5848
+ if (i[d] = y, o) {
5849
+ const [p, S] = ve(d);
5850
+ return o[d] = S, t(c[d], p);
5849
5851
  }
5850
5852
  return t(c[d]);
5851
5853
  }
@@ -5866,8 +5868,8 @@ function pc(e, t, n = {}) {
5866
5868
  });
5867
5869
  function d(w) {
5868
5870
  i[c] = w;
5869
- const [p, y] = ve(h[c]);
5870
- return l[c] = y, t(p, c);
5871
+ const [y, p] = ve(h[c]);
5872
+ return l[c] = p, t(y, c);
5871
5873
  }
5872
5874
  };
5873
5875
  }
@@ -6331,13 +6333,13 @@ function _c(e, t, n) {
6331
6333
  const g = h.get(t[l]);
6332
6334
  if (g != null)
6333
6335
  if (o < g && g < i) {
6334
- let d = l, w = 1, p;
6335
- for (; ++d < a && d < i && !((p = h.get(t[d])) == null || p !== g + w); )
6336
+ let d = l, w = 1, y;
6337
+ for (; ++d < a && d < i && !((y = h.get(t[d])) == null || y !== g + w); )
6336
6338
  w++;
6337
6339
  if (w > g - o) {
6338
- const y = t[l];
6340
+ const p = t[l];
6339
6341
  for (; o < g; )
6340
- e.insertBefore(n[o++], y);
6342
+ e.insertBefore(n[o++], p);
6341
6343
  } else
6342
6344
  e.replaceChild(n[o++], t[l++]);
6343
6345
  } else
@@ -6487,12 +6489,12 @@ function Hs(e, t, n, s, a, i, l) {
6487
6489
  const w = t.slice(10);
6488
6490
  s && e.removeEventListener(w, s, !0), n && e.addEventListener(w, n, !0);
6489
6491
  } else if (t.slice(0, 2) === "on") {
6490
- const w = t.slice(2).toLowerCase(), p = Tc.has(w);
6491
- if (!p && s) {
6492
- const y = Array.isArray(s) ? s[0] : s;
6493
- e.removeEventListener(w, y);
6492
+ const w = t.slice(2).toLowerCase(), y = Tc.has(w);
6493
+ if (!y && s) {
6494
+ const p = Array.isArray(s) ? s[0] : s;
6495
+ e.removeEventListener(w, p);
6494
6496
  }
6495
- (p || n) && (Gc(e, w, n, p), p && Ic([w]));
6497
+ (y || n) && (Gc(e, w, n, y), y && Ic([w]));
6496
6498
  } else if (t.slice(0, 5) === "attr:")
6497
6499
  Xn(e, t.slice(5), n);
6498
6500
  else if (t.slice(0, 5) === "bool:")
@@ -7089,32 +7091,32 @@ var Sa = (e, t, n, s, a = [], i = [], l = /* @__PURE__ */ new Map()) => {
7089
7091
  const o = su(e);
7090
7092
  if (!o) {
7091
7093
  gu(e, a, t);
7092
- const p = l.get(e);
7093
- if (p)
7094
+ const y = l.get(e);
7095
+ if (y)
7094
7096
  return s ? {
7095
7097
  transformedValue: null
7096
- } : p;
7098
+ } : y;
7097
7099
  }
7098
7100
  if (!fu(e, n)) {
7099
- const p = $s(e, n), y = p ? {
7100
- transformedValue: p.value,
7101
- annotations: [p.type]
7101
+ const y = $s(e, n), p = y ? {
7102
+ transformedValue: y.value,
7103
+ annotations: [y.type]
7102
7104
  } : {
7103
7105
  transformedValue: e
7104
7106
  };
7105
- return o || l.set(e, y), y;
7107
+ return o || l.set(e, p), p;
7106
7108
  }
7107
7109
  if (An(i, e))
7108
7110
  return {
7109
7111
  transformedValue: null
7110
7112
  };
7111
7113
  const c = $s(e, n), h = (c == null ? void 0 : c.value) ?? e, g = nt(h) ? [] : {}, d = {};
7112
- kt(h, (p, y) => {
7113
- if (y === "__proto__" || y === "constructor" || y === "prototype")
7114
- throw new Error(`Detected property ${y}. This is a prototype pollution risk, please remove it from your object.`);
7115
- const S = Sa(p, t, n, s, [...a, y], [...i, e], l);
7116
- g[y] = S.transformedValue, nt(S.annotations) ? d[y] = S.annotations : Kt(S.annotations) && kt(S.annotations, (v, x) => {
7117
- d[ma(y) + "." + x] = v;
7114
+ kt(h, (y, p) => {
7115
+ if (p === "__proto__" || p === "constructor" || p === "prototype")
7116
+ throw new Error(`Detected property ${p}. This is a prototype pollution risk, please remove it from your object.`);
7117
+ const S = Sa(y, t, n, s, [...a, p], [...i, e], l);
7118
+ g[p] = S.transformedValue, nt(S.annotations) ? d[p] = S.annotations : Kt(S.annotations) && kt(S.annotations, (v, x) => {
7119
+ d[ma(p) + "." + x] = v;
7118
7120
  });
7119
7121
  });
7120
7122
  const w = es(d) ? {
@@ -7377,7 +7379,7 @@ var md = (e, t = !1) => {
7377
7379
  const t = la(() => {
7378
7380
  const n = this, [s] = U(this, yt), [a] = U(this, vt), [i] = U(this, Et), [l] = U(this, bt), [o] = U(this, gt);
7379
7381
  let c;
7380
- return U(this, wt) ? c = U(this, wt) : (c = aa(() => import("./HO4MOOFI-Dv52MIrF.js")), ee(this, wt, c)), Ta(U(this, Yt), U(this, pt)), sa(c, ra({
7382
+ return U(this, wt) ? c = U(this, wt) : (c = aa(() => import("./HO4MOOFI-Ckm2pyGV.js")), ee(this, wt, c)), Ta(U(this, Yt), U(this, pt)), sa(c, ra({
7381
7383
  get queryFlavor() {
7382
7384
  return U(n, zt);
7383
7385
  },
@@ -7471,7 +7473,7 @@ var md = (e, t = !1) => {
7471
7473
  const t = la(() => {
7472
7474
  const n = this, [s] = U(this, At), [a] = U(this, xt), [i] = U(this, Tt), [l] = U(this, Ct), [o] = U(this, St), [c] = U(this, Pt);
7473
7475
  let h;
7474
- return U(this, _t) ? h = U(this, _t) : (h = aa(() => import("./HUY7CZI3-CGms6kn7.js")), ee(this, _t, h)), Ta(U(this, en), U(this, Nt)), sa(h, ra({
7476
+ return U(this, _t) ? h = U(this, _t) : (h = aa(() => import("./HUY7CZI3-BDpIMk8f.js")), ee(this, _t, h)), Ta(U(this, en), U(this, Nt)), sa(h, ra({
7475
7477
  get queryFlavor() {
7476
7478
  return U(n, Zt);
7477
7479
  },
@@ -7600,7 +7602,7 @@ const Pu = (e) => {
7600
7602
  role: "",
7601
7603
  permissions: null
7602
7604
  }
7603
- } = Mo(), { data: o } = Bo(), { data: c, isFetching: h } = Br(), { blocks: g } = Oo(c), { data: d } = un(), { data: w } = Ie(), { mutateAsync: p } = Rr(), y = Ro(), { getUILibraryBlock: S, getUILibraryBlocks: v, onSave: x } = Fo(), { getPartialBlocks: R, getPartialBlockBlocks: E } = qo(), { aiContext: b, setAiContext: T } = vs(), { mutateAsync: G } = Bl(), [J, ie] = _(!1), k = Y(
7605
+ } = Mo(), { data: o } = Bo(), { data: c, isFetching: h } = Br(), { blocks: g } = Oo(c), { data: d } = un(), { data: w } = Ie(), { mutateAsync: y } = Rr(), p = Ro(), { getUILibraryBlock: S, getUILibraryBlocks: v, onSave: x } = Fo(), { getPartialBlocks: G, getPartialBlockBlocks: E } = qo(), { aiContext: b, setAiContext: T } = vs(), { mutateAsync: R } = Bl(), [J, ie] = P(!1), k = Y(
7604
7606
  () => (d == null ? void 0 : d.fallbackLang) || "en",
7605
7607
  [d]
7606
7608
  ), { data: q } = Mr({
@@ -7617,8 +7619,8 @@ const Pu = (e) => {
7617
7619
  const z = {};
7618
7620
  return l && (z.permissions = te(l, "permissions", null), z.role = te(l, "role", "user")), z;
7619
7621
  }, [l]), M = Y(() => o, [o]), ne = _e(
7620
- async (z, de) => await G({ pageType: z, query: de }),
7621
- [G]
7622
+ async (z, de) => await R({ pageType: z, query: de }),
7623
+ [R]
7622
7624
  ), he = Y(
7623
7625
  () => te(d, "theme", {}) || {},
7624
7626
  [d]
@@ -7642,7 +7644,7 @@ const Pu = (e) => {
7642
7644
  autoSaveInterval: e.autoSaveInterval ?? 15,
7643
7645
  onError: e.onError || console.error,
7644
7646
  getPartialBlockBlocks: E,
7645
- getPartialBlocks: R,
7647
+ getPartialBlocks: G,
7646
7648
  blocks: h ? [] : g,
7647
7649
  theme: za(he),
7648
7650
  getUILibraryBlock: S,
@@ -7659,7 +7661,7 @@ const Pu = (e) => {
7659
7661
  return await x({ page: s, blocks: Ee }), T(z), !0;
7660
7662
  },
7661
7663
  aiContext: b,
7662
- askAiCallBack: y,
7664
+ askAiCallBack: p,
7663
7665
  onSave: async ({ blocks: z, theme: de }) => {
7664
7666
  if (!s) return !0;
7665
7667
  t.current = z;
@@ -7667,7 +7669,7 @@ const Pu = (e) => {
7667
7669
  _type: "@chai/ai-context",
7668
7670
  _value: ks(b) ? b : ""
7669
7671
  }, Ee = [...z, F];
7670
- return await x({ page: s, blocks: Ee }), t.current = Ee, rs(de, he) || await p({ settings: { theme: de } }), !0;
7672
+ return await x({ page: s, blocks: Ee }), t.current = Ee, rs(de, he) || await y({ settings: { theme: de } }), !0;
7671
7673
  },
7672
7674
  themePanelComponent: zl,
7673
7675
  ...A
@@ -7686,7 +7688,7 @@ const Pu = (e) => {
7686
7688
  }
7687
7689
  }
7688
7690
  }), vd = (e) => {
7689
- const { isLoggedIn: t } = st(), [, n] = Ur(), [s, a] = _(!1);
7691
+ const { isLoggedIn: t } = st(), [, n] = Ur(), [s, a] = P(!1);
7690
7692
  return we(() => (n(
7691
7693
  Js(e, [
7692
7694
  "apiUrl",
@@ -7736,16 +7738,16 @@ export {
7736
7738
  Wu as V,
7737
7739
  vd as W,
7738
7740
  Oe as X,
7739
- Ue as Y,
7740
- cn as Z,
7741
- Rn as _,
7741
+ Ed as Y,
7742
+ Ue as Z,
7743
+ cn as _,
7742
7744
  sa as a,
7743
- un as a0,
7744
- Mo as a1,
7745
- $ as a2,
7746
- Vu as a3,
7747
- dn as a4,
7748
- Ed as a5,
7745
+ Rn as a0,
7746
+ un as a1,
7747
+ Mo as a2,
7748
+ $ as a3,
7749
+ Vu as a4,
7750
+ dn as a5,
7749
7751
  ve as b,
7750
7752
  Ge as c,
7751
7753
  Ic as d,