@chaibuilder/pages 0.4.2 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,22 @@
1
- var _s = (e) => {
1
+ var Is = (e) => {
2
2
  throw TypeError(e);
3
3
  };
4
- var Is = (e, t, n) => t.has(e) || _s("Cannot " + n);
5
- var U = (e, t, n) => (Is(e, t, "read from private field"), n ? n.call(e) : t.get(e)), se = (e, t, n) => t.has(e) ? _s("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ee = (e, t, n, s) => (Is(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
4
+ var ks = (e, t, n) => t.has(e) || Is("Cannot " + n);
5
+ var R = (e, t, n) => (ks(e, t, "read from private field"), n ? n.call(e) : t.get(e)), se = (e, t, n) => t.has(e) ? Is("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ee = (e, t, n, s) => (ks(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
6
6
  import { jsx as r, jsxs as u, Fragment as be } from "react/jsx-runtime";
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
- import { useAtom as Ln, atom as as } from "jotai";
7
+ import { get as te, isEmpty as me, reverse as Ua, sortBy as Ra, each as Oa, find as fe, set as Ba, has as nn, startsWith as Rt, isEqual as as, map as Fe, toLower as Dt, trim as Ma, filter as Te, startCase as It, groupBy as Fa, compact as Nn, includes as Mt, 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 Ls } from "lodash-es";
8
+ import { useAtom as Dn, atom as is } 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";
11
- import { useQueryClient as Se, useQuery as Ne, useMutation as Ae, onlineManager as tr, QueryClient as Wa, QueryClientProvider as Ya } from "@tanstack/react-query";
10
+ import er, { useMemo as Y, useCallback as _e, useState as P, useEffect as we, useRef as ct, lazy as Wa } from "react";
11
+ import { useQueryClient as Se, useQuery as Ne, useMutation as Ae, onlineManager as tr, QueryClient as Ya, QueryClientProvider as Qa } from "@tanstack/react-query";
12
12
  import { toast as j } from "sonner";
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";
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
- import { format as Dn, formatDistanceToNow as rl } from "date-fns";
17
- import { useRegisteredChaiBlocks as al, getDefaultBlockProps as il } from "@chaibuilder/runtime";
18
- import { z as Nn } from "zod";
19
- import { loadWebBlocks as ll } from "@chaibuilder/sdk/web-blocks";
13
+ import { useLanguages as ut, useUpdateBlocksPropsRealtime as nr, PERMISSIONS as Xa, usePartailBlocksStore as Za, usePermissions as sn, useLibraryBlocks as Ja, useTheme as ei, mergeClasses as ti, useSavePage as sr, useRightPanel as ni, useBlocksStore as si, getBlocksFromHTML as ri, useTranslation as ai, useSidebarActivePanel as ii, registerChaiSidebarPanel as zn, registerChaiTopBar as li, registerChaiMediaManager as oi, registerChaiSaveToLibrary as ci, ChaiBuilderEditor as ui } from "@chaibuilder/sdk";
14
+ import { Card as ls, CardHeader as os, CardTitle as cs, CardContent as us, CardFooter as ds, 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 di, SelectTrigger as hi, SelectValue as mi, SelectContent as fi, SelectItem as gi, Badge as qn, Sheet as yr, SheetContent as vr, SheetHeader as Er, SheetTitle as br, Separator as pi, TooltipProvider as wr, Tooltip as hs, SheetTrigger as yi, TooltipTrigger as ms, ScrollArea as vi, TooltipContent as fs, Skeleton as fn, DropdownMenuSeparator as Ei, CardDescription as bi, Command as wi, CommandInput as Si, CommandList as Ni, CommandEmpty as Ai, CommandGroup as xi, CommandItem as Ds, AlertDescription as Ti, Accordion as Ci, AccordionItem as gn, AccordionTrigger as pn, AccordionContent as yn, HoverCard as Pi, HoverCardTrigger as _i, HoverCardContent as Ii } from "@chaibuilder/sdk/ui";
15
+ import { LockIcon as Sr, UserIcon as ki, AlertTriangleIcon as Li, Trash2 as Nr, Plus as gs, ImageIcon as Ar, X as xr, AlertCircle as Tr, StarIcon as Di, MoreHorizontal as ps, PencilIcon as Gi, Power as Cr, TrashIcon as Ui, Tag as Ri, File as on, Search as Oi, StarsIcon as Bi, Globe as Mi, Pencil as Fi, Trash as ys, SquareLibrary as Gs, Logs as qi, Loader as Pr, Languages as Hi, ChevronDown as _r, Star as Ki, History as Us, ArrowUpRight as Vi, Clock as ji, Undo2 as Ir, CloudOff as $i, Edit as zi, Save as kr, GlobeIcon as Wi, Eye as Lr, Palette as Yi, CheckCircle as Qi, Send as Rs, Rocket as Os, Settings as Xi, ExternalLink as Zi, EyeOff as Ji, Loader2 as Dr, LanguagesIcon as el, DatabaseIcon as tl, ChevronLeft as nl, ChevronRight as sl, User as rl } from "lucide-react";
16
+ import { format as Gn, formatDistanceToNow as al } from "date-fns";
17
+ import { useRegisteredChaiBlocks as il, getDefaultBlockProps as ll } from "@chaibuilder/runtime";
18
+ import { z as An } from "zod";
19
+ import { loadWebBlocks as ol } from "@chaibuilder/sdk/web-blocks";
20
20
  const qe = {
21
21
  ab: "Abkhazian",
22
22
  aa: "Afar",
@@ -246,8 +246,13 @@ const qe = {
246
246
  DELETE_LIBRARY_ITEM: "DELETE_LIBRARY_ITEM",
247
247
  MARK_AS_TEMPLATE: "MARK_AS_TEMPLATE",
248
248
  UNMARK_AS_TEMPLATE: "UNMARK_AS_TEMPLATE",
249
- GET_TEMPLATES_BY_TYPE: "GET_TEMPLATES_BY_TYPE"
250
- }, ke = "chaibuilder", ys = async (e, t, n = {}) => await fetch(e, {
249
+ GET_TEMPLATES_BY_TYPE: "GET_TEMPLATES_BY_TYPE",
250
+ // DAM Actions
251
+ UPLOAD_ASSET: "UPLOAD_ASSET",
252
+ DELETE_ASSET: "DELETE_ASSET",
253
+ UPDATE_ASSET: "UPDATE_ASSET",
254
+ GET_ASSETS: "GET_ASSETS"
255
+ }, ke = "chaibuilder", vs = async (e, t, n = {}) => await fetch(e, {
251
256
  method: "POST",
252
257
  headers: {
253
258
  "Content-Type": "application/json",
@@ -258,34 +263,34 @@ const qe = {
258
263
  if (import.meta.vitest) {
259
264
  const { it: e, expect: t } = import.meta.vitest;
260
265
  e("should fetch API", async () => {
261
- const n = await ys("/v1/api/chai", {
266
+ const n = await vs("/v1/api/chai", {
262
267
  action: "test"
263
268
  });
264
269
  t(n).toBeDefined();
265
270
  });
266
271
  }
267
- let ol = 0;
268
- function Os(e, t) {
269
- const n = `atom${++ol}`, s = {
272
+ let cl = 0;
273
+ function Bs(e, t) {
274
+ const n = `atom${++cl}`, s = {
270
275
  toString() {
271
276
  return n;
272
277
  }
273
278
  };
274
- return typeof e == "function" ? s.read = e : (s.init = e, s.read = cl, s.write = ul), t && (s.write = t), s;
279
+ return typeof e == "function" ? s.read = e : (s.init = e, s.read = ul, s.write = dl), t && (s.write = t), s;
275
280
  }
276
- function cl(e) {
281
+ function ul(e) {
277
282
  return e(this);
278
283
  }
279
- function ul(e, t, n) {
284
+ function dl(e, t, n) {
280
285
  return t(
281
286
  this,
282
287
  typeof n == "function" ? n(e(this)) : n
283
288
  );
284
289
  }
285
- const dl = Symbol(
290
+ const hl = Symbol(
286
291
  ""
287
- ), hl = (e) => typeof (e == null ? void 0 : e.then) == "function";
288
- function ml(e = () => {
292
+ ), ml = (e) => typeof (e == null ? void 0 : e.then) == "function";
293
+ function fl(e = () => {
289
294
  try {
290
295
  return window.localStorage;
291
296
  } catch {
@@ -297,18 +302,18 @@ function ml(e = () => {
297
302
  const i = {
298
303
  getItem: (c, h) => {
299
304
  var g, d;
300
- const w = (y) => {
301
- if (y = y || "", s !== y) {
305
+ const w = (p) => {
306
+ if (p = p || "", s !== p) {
302
307
  try {
303
- a = JSON.parse(y, t == null ? void 0 : t.reviver);
308
+ a = JSON.parse(p, t == null ? void 0 : t.reviver);
304
309
  } catch {
305
310
  return h;
306
311
  }
307
- s = y;
312
+ s = p;
308
313
  }
309
314
  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);
315
+ }, y = (d = (g = e()) == null ? void 0 : g.getItem(c)) != null ? d : null;
316
+ return ml(y) ? y.then(w) : w(y);
312
317
  },
313
318
  setItem: (c, h) => {
314
319
  var g;
@@ -322,13 +327,13 @@ function ml(e = () => {
322
327
  return (h = e()) == null ? void 0 : h.removeItem(c);
323
328
  }
324
329
  }, l = (c) => (h, g, d) => c(h, (w) => {
325
- let p;
330
+ let y;
326
331
  try {
327
- p = JSON.parse(w || "");
332
+ y = JSON.parse(w || "");
328
333
  } catch {
329
- p = d;
334
+ y = d;
330
335
  }
331
- g(p);
336
+ g(y);
332
337
  });
333
338
  let o;
334
339
  try {
@@ -347,25 +352,25 @@ function ml(e = () => {
347
352
  };
348
353
  }), o && (i.subscribe = l(o)), i;
349
354
  }
350
- const fl = ml();
351
- function gl(e, t, n = fl, s) {
352
- const a = Os(
355
+ const gl = fl();
356
+ function pl(e, t, n = gl, s) {
357
+ const a = Bs(
353
358
  t
354
359
  );
355
360
  return a.onMount = (l) => {
356
361
  l(n.getItem(e, t));
357
362
  let o;
358
363
  return n.subscribe && (o = n.subscribe(e, l, t)), o;
359
- }, Os(
364
+ }, Bs(
360
365
  (l) => l(a),
361
366
  (l, o, c) => {
362
367
  const h = typeof c == "function" ? c(l(a)) : c;
363
- return h === dl ? (o(a, t), n.removeItem(e)) : h instanceof Promise ? h.then((g) => (o(a, g), n.setItem(e, g))) : (o(a, h), n.setItem(e, h));
368
+ return h === hl ? (o(a, t), n.removeItem(e)) : h instanceof Promise ? h.then((g) => (o(a, g), n.setItem(e, g))) : (o(a, h), n.setItem(e, h));
364
369
  }
365
370
  );
366
371
  }
367
- const pl = gl("__chai_user", null), st = () => {
368
- const [e, t] = Ln(pl);
372
+ const yl = pl("__chai_user", null), st = () => {
373
+ const [e, t] = Dn(yl);
369
374
  return {
370
375
  isLoggedIn: !!e,
371
376
  user: e,
@@ -374,8 +379,8 @@ const pl = gl("__chai_user", null), st = () => {
374
379
  t(null);
375
380
  }
376
381
  };
377
- }, yl = () => {
378
- const { user: e, setUser: t, logout: n } = st(), s = Gn(), a = Se();
382
+ }, vl = () => {
383
+ const { user: e, setUser: t, logout: n } = st(), s = Un(), a = Se();
379
384
  return Ne({
380
385
  queryKey: ["refresh_token"],
381
386
  queryFn: async () => {
@@ -405,7 +410,7 @@ const pl = gl("__chai_user", null), st = () => {
405
410
  retry: !1,
406
411
  enabled: !1
407
412
  });
408
- }, Vu = () => {
413
+ }, ju = () => {
409
414
  const { user: e } = st(), t = dt("onSessionExpired"), n = Y(
410
415
  () => e == null ? void 0 : e.accessToken,
411
416
  [e == null ? void 0 : e.accessToken]
@@ -441,12 +446,12 @@ const pl = gl("__chai_user", null), st = () => {
441
446
  const { user: e } = st(), t = Y(
442
447
  () => e == null ? void 0 : e.accessToken,
443
448
  [e == null ? void 0 : e.accessToken]
444
- ), { refetch: n } = yl();
449
+ ), { refetch: n } = vl();
445
450
  return _e(
446
451
  async (s, a, i = {}) => {
447
452
  if (t)
448
453
  try {
449
- const l = te(a, "action", "").toLowerCase(), o = await ys(
454
+ const l = te(a, "action", "").toLowerCase(), o = await vs(
450
455
  s + (l ? `?action=${l}` : ""),
451
456
  a,
452
457
  {
@@ -473,7 +478,7 @@ const pl = gl("__chai_user", null), st = () => {
473
478
  });
474
479
  }
475
480
  });
476
- }, Rr = () => {
481
+ }, Ur = () => {
477
482
  const e = Q(), t = Se(), n = $();
478
483
  return Ae({
479
484
  mutationFn: async (s) => n(e, {
@@ -492,7 +497,7 @@ const pl = gl("__chai_user", null), st = () => {
492
497
  });
493
498
  }
494
499
  });
495
- }, vl = () => {
500
+ }, El = () => {
496
501
  const e = Q(), t = Se(), n = $();
497
502
  return Ae({
498
503
  mutationFn: async (s) => n(e, { action: I.UPDATE_WEBSITE_DATA, data: s }),
@@ -508,8 +513,8 @@ const pl = gl("__chai_user", null), st = () => {
508
513
  }
509
514
  });
510
515
  };
511
- function Re() {
512
- const [e, t] = _(
516
+ function Ue() {
517
+ const [e, t] = P(
513
518
  new URLSearchParams(window.location.search)
514
519
  );
515
520
  return we(() => {
@@ -521,16 +526,16 @@ function Re() {
521
526
  };
522
527
  }, []), [e, t];
523
528
  }
524
- const El = as({}), Ur = () => Ln(El), bl = () => {
525
- const [e] = Re(), t = e.get("page"), n = ct(""), { mutate: s } = Gr();
529
+ const bl = is({}), Rr = () => Dn(bl), wl = () => {
530
+ const [e] = Ue(), t = e.get("page"), n = ct(""), { mutate: s } = Gr();
526
531
  we(() => {
527
532
  !me(n.current) && t !== n.current && s({ id: n.current }), n.current = t;
528
533
  }, [t, s, n]);
529
534
  }, dt = (e, t) => {
530
- const [n] = Ur();
535
+ const [n] = Rr();
531
536
  return te(n, e, t);
532
- }, Q = () => dt("apiUrl", "/chai/api"), Gn = () => dt("usersApiUrl", "/chai/users"), cn = () => {
533
- const e = Q(), [t] = Re(), n = t.get("page"), s = $();
537
+ }, Q = () => dt("apiUrl", "/chai/api"), Un = () => dt("usersApiUrl", "/chai/users"), cn = () => {
538
+ const e = Q(), [t] = Ue(), n = t.get("page"), s = $();
534
539
  return Ne({
535
540
  queryKey: [ke, I.GET_LANGUAGE_PAGES, n],
536
541
  initialData: [],
@@ -540,7 +545,7 @@ const El = as({}), Ur = () => Ln(El), bl = () => {
540
545
  action: I.GET_LANGUAGE_PAGES,
541
546
  data: { id: n }
542
547
  });
543
- return Ra(Ua(a, "primaryPage"));
548
+ return Ua(Ra(a, "primaryPage"));
544
549
  },
545
550
  enabled: !!n
546
551
  });
@@ -567,7 +572,7 @@ const El = as({}), Ur = () => Ln(El), bl = () => {
567
572
  }), l;
568
573
  }, [t, s, n]);
569
574
  return a || me(e) || e && i[e];
570
- }, vs = () => {
575
+ }, Es = () => {
571
576
  const e = Se(), { data: t } = Ne({
572
577
  queryKey: ["chaibuilder", I.AI_CONTEXT],
573
578
  initialData: "",
@@ -586,14 +591,14 @@ const El = as({}), Ur = () => Ln(El), bl = () => {
586
591
  staleTime: 1e3 * 60 * 5,
587
592
  queryFn: async () => e(t, { action: I.GET_WEBSITE_PAGES }) || []
588
593
  });
589
- }, wl = as({ lastSaved: void 0 }), Es = () => Ln(wl), Ue = () => {
590
- const [e] = Re(), t = e.get("page"), { data: n, isFetching: s } = Rn();
594
+ }, Sl = is({ lastSaved: void 0 }), bs = () => Dn(Sl), Re = () => {
595
+ const [e] = Ue(), t = e.get("page"), { data: n, isFetching: s } = Rn();
591
596
  return { data: Y(
592
597
  () => fe(n, { id: t }) || {},
593
598
  [n, t]
594
599
  ), isFetching: s };
595
600
  }, dn = (e) => {
596
- const t = Gn(), n = $();
601
+ const t = Un(), n = $();
597
602
  return Ne({
598
603
  queryKey: [ke, "chaiUserInfo", e],
599
604
  queryFn: async () => await n(t, {
@@ -602,15 +607,15 @@ const El = as({}), Ur = () => Ln(El), bl = () => {
602
607
  }),
603
608
  enabled: !!e && e !== "EXPIRED"
604
609
  });
605
- }, Sl = as(void 0), hn = () => {
606
- const [e] = Re(), t = e.get("page"), { user: n } = st(), [s, a] = Ln(Sl);
610
+ }, Nl = is(void 0), hn = () => {
611
+ const [e] = Ue(), t = e.get("page"), { user: n } = st(), [s, a] = Dn(Nl);
607
612
  return Y(() => ({
608
613
  isLocked: t && (n == null ? void 0 : n.id) !== s,
609
614
  currentEditor: s,
610
615
  setCurrentEditor: (i) => a(i)
611
616
  }), [n == null ? void 0 : n.id, s, t, a]);
612
617
  }, Br = () => {
613
- const [e] = Re(), t = e.get("page"), n = Q(), { setAiContext: s } = vs(), { setCurrentEditor: a } = hn(), [, i] = Es(), l = $();
618
+ const [e] = Ue(), t = e.get("page"), n = Q(), { setAiContext: s } = Es(), { setCurrentEditor: a } = hn(), [, i] = bs(), l = $();
614
619
  return Ne({
615
620
  queryKey: [ke, I.GET_DRAFT_PAGE, t],
616
621
  staleTime: 1 / 0,
@@ -642,20 +647,20 @@ const El = as({}), Ur = () => Ln(El), bl = () => {
642
647
  enabled: !!e && !!t
643
648
  });
644
649
  };
645
- function Nl({
650
+ function Al({
646
651
  avatar: e,
647
652
  name: t,
648
653
  email: n,
649
654
  onTakeOver: s,
650
655
  currentEditor: a
651
656
  }) {
652
- const [i, l] = _(!1);
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
- /* @__PURE__ */ r(ls, { className: "space-y-1", children: /* @__PURE__ */ u(os, { className: "flex items-center gap-2 text-2xl", children: [
657
+ const [i, l] = P(!1);
658
+ 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(ls, { className: "w-full max-w-md mx-auto", children: [
659
+ /* @__PURE__ */ r(os, { className: "space-y-1", children: /* @__PURE__ */ u(cs, { className: "flex items-center gap-2 text-2xl", children: [
655
660
  /* @__PURE__ */ r(Sr, { className: "w-6 h-6 text-yellow-500" }),
656
661
  a === "EXPIRED" ? "Editing access timed out" : "Page locked for editing"
657
662
  ] }) }),
658
- /* @__PURE__ */ r(cs, { className: "grid gap-4", children: a === "EXPIRED" ? /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("p", { children: "Your editing access has been paused due to inactivity. Please refresh the page to continue" }) }) : /* @__PURE__ */ u("div", { children: [
663
+ /* @__PURE__ */ r(us, { className: "grid gap-4", children: a === "EXPIRED" ? /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("p", { children: "Your editing access has been paused due to inactivity. Please refresh the page to continue" }) }) : /* @__PURE__ */ u("div", { children: [
659
664
  /* @__PURE__ */ u("div", { className: "flex items-center space-x-4", children: [
660
665
  e ? /* @__PURE__ */ r(
661
666
  "img",
@@ -664,7 +669,7 @@ function Nl({
664
669
  alt: t,
665
670
  className: "w-12 h-12 border border-gray-300 rounded-full"
666
671
  }
667
- ) : /* @__PURE__ */ r(Ii, { className: "w-12 h-12 p-2 border border-gray-300 rounded-full" }),
672
+ ) : /* @__PURE__ */ r(ki, { className: "w-12 h-12 p-2 border border-gray-300 rounded-full" }),
668
673
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
669
674
  /* @__PURE__ */ r("h3", { className: "font-semibold", children: t }),
670
675
  n && /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: n })
@@ -672,8 +677,8 @@ function Nl({
672
677
  ] }),
673
678
  /* @__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
679
  ] }) }),
675
- /* @__PURE__ */ r(us, { children: a === "EXPIRED" ? /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
676
- P,
680
+ /* @__PURE__ */ r(ds, { children: a === "EXPIRED" ? /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
681
+ _,
677
682
  {
678
683
  className: "w-full",
679
684
  onClick: () => window.location.reload(),
@@ -682,7 +687,7 @@ function Nl({
682
687
  }
683
688
  ) }) : /* @__PURE__ */ u(rr, { open: i, onOpenChange: l, children: [
684
689
  /* @__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" }),
690
+ /* @__PURE__ */ r(_, { className: "w-full", variant: "destructive", children: "Take Over" }),
686
691
  /* @__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
692
  ] }) }),
688
693
  /* @__PURE__ */ u(ir, { className: "z-[99]", children: [
@@ -690,7 +695,7 @@ function Nl({
690
695
  /* @__PURE__ */ r(or, { children: "Are you sure you want to take over?" }),
691
696
  /* @__PURE__ */ u(cr, { children: [
692
697
  /* @__PURE__ */ u("span", { className: "flex items-center space-x-2 text-yellow-500", children: [
693
- /* @__PURE__ */ r(ki, { className: "w-5 h-5" }),
698
+ /* @__PURE__ */ r(Li, { className: "w-5 h-5" }),
694
699
  /* @__PURE__ */ r("span", { children: "This action might cause the other user to lose unsaved changes." })
695
700
  ] }),
696
701
  /* @__PURE__ */ r("br", {}),
@@ -711,12 +716,12 @@ function Nl({
711
716
  ] }) })
712
717
  ] }) });
713
718
  }
714
- const Al = () => {
715
- const { isLocked: e, currentEditor: t } = hn(), { data: n } = dn(t), [s] = Re(), a = s.get("page"), { mutate: i } = Gr(), { isFetching: l } = Br(), o = _e(() => {
719
+ const xl = () => {
720
+ const { isLocked: e, currentEditor: t } = hn(), { data: n } = dn(t), [s] = Ue(), a = s.get("page"), { mutate: i } = Gr(), { isFetching: l } = Br(), o = _e(() => {
716
721
  i({ id: a });
717
722
  }, [a, i]);
718
723
  return !e || l ? /* @__PURE__ */ r("div", { className: "" }) : /* @__PURE__ */ r(
719
- Nl,
724
+ Al,
720
725
  {
721
726
  ...n,
722
727
  name: (n == null ? void 0 : n.name) || "Unknown User",
@@ -725,8 +730,8 @@ const Al = () => {
725
730
  onTakeOver: o
726
731
  }
727
732
  );
728
- }, xl = () => {
729
- const [e, t] = Re(), n = e.get("lang"), s = Or(n), { setSelectedLang: a } = ut(), i = () => {
733
+ }, Tl = () => {
734
+ const [e, t] = Ue(), n = e.get("lang"), s = Or(n), { setSelectedLang: a } = ut(), i = () => {
730
735
  const o = new URLSearchParams(window.location.search);
731
736
  o.delete("lang");
732
737
  const c = o.toString(), h = `${window.location.pathname}${c ? `?${c}` : ""}`;
@@ -734,22 +739,22 @@ const Al = () => {
734
739
  };
735
740
  if (s) return null;
736
741
  const l = te(qe, n);
737
- 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: [
738
- /* @__PURE__ */ r(ls, { className: "space-y-1", children: /* @__PURE__ */ u(os, { className: "flex items-center gap-2 text-2xl", children: [
742
+ 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(ls, { className: "w-full max-w-md mx-auto", children: [
743
+ /* @__PURE__ */ r(os, { className: "space-y-1", children: /* @__PURE__ */ u(cs, { className: "flex items-center gap-2 text-2xl", children: [
739
744
  /* @__PURE__ */ r(Sr, { className: "w-6 h-6 text-yellow-500" }),
740
745
  'Page missing for "',
741
746
  l,
742
747
  '" language.'
743
748
  ] }) }),
744
- /* @__PURE__ */ r(cs, { className: "grid gap-4", children: /* @__PURE__ */ u("div", { children: [
749
+ /* @__PURE__ */ r(us, { className: "grid gap-4", children: /* @__PURE__ */ u("div", { children: [
745
750
  'Page is not available in the "',
746
751
  l,
747
752
  '" language. Either create the page in the "',
748
753
  l,
749
754
  '" language or switch to the base language.'
750
755
  ] }) }),
751
- /* @__PURE__ */ r(us, { children: /* @__PURE__ */ r(
752
- P,
756
+ /* @__PURE__ */ r(ds, { children: /* @__PURE__ */ r(
757
+ _,
753
758
  {
754
759
  onClick: i,
755
760
  className: "w-full",
@@ -758,7 +763,7 @@ const Al = () => {
758
763
  }
759
764
  ) })
760
765
  ] }) });
761
- }, Tl = (e) => {
766
+ }, Cl = (e) => {
762
767
  const t = Q(), n = $();
763
768
  return Ae({
764
769
  mutationFn: async (s) => n(t, {
@@ -774,7 +779,7 @@ const Al = () => {
774
779
  });
775
780
  }
776
781
  });
777
- }, Cl = (e) => {
782
+ }, Pl = (e) => {
778
783
  const t = Q(), n = $();
779
784
  return Ne({
780
785
  queryKey: [ke, "uiBlockDetails", e],
@@ -795,7 +800,7 @@ const Al = () => {
795
800
  },
796
801
  retry: !1
797
802
  });
798
- }, Pl = (e) => {
803
+ }, _l = (e) => {
799
804
  const t = Q(), n = $();
800
805
  return Ae({
801
806
  mutationFn: async (s) => n(t, {
@@ -811,7 +816,7 @@ const Al = () => {
811
816
  });
812
817
  }
813
818
  });
814
- }, _l = ({
819
+ }, Il = ({
815
820
  blockId: e,
816
821
  libBlockId: t,
817
822
  isOpen: n,
@@ -819,12 +824,12 @@ const Al = () => {
819
824
  blockName: a,
820
825
  trigger: i
821
826
  }) => {
822
- const [l, o] = _(!1), c = nr(), h = Pl(() => {
827
+ const [l, o] = P(!1), c = nr(), h = _l(() => {
823
828
  c([e], { _libBlockId: void 0 }), j.success("Block deleted successfully"), o(!1), s();
824
829
  });
825
830
  return /* @__PURE__ */ u(mr, { open: n, onOpenChange: (w) => !w && s(), children: [
826
831
  /* @__PURE__ */ r(fr, { asChild: !0, children: i || /* @__PURE__ */ u(
827
- P,
832
+ _,
828
833
  {
829
834
  type: "button",
830
835
  variant: "destructive",
@@ -857,7 +862,7 @@ const Al = () => {
857
862
  /* @__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
863
  /* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-2", children: [
859
864
  /* @__PURE__ */ r(
860
- P,
865
+ _,
861
866
  {
862
867
  type: "button",
863
868
  variant: "outline",
@@ -868,7 +873,7 @@ const Al = () => {
868
873
  }
869
874
  ),
870
875
  /* @__PURE__ */ r(
871
- P,
876
+ _,
872
877
  {
873
878
  type: "button",
874
879
  variant: "destructive",
@@ -885,7 +890,7 @@ const Al = () => {
885
890
  }
886
891
  )
887
892
  ] });
888
- }, Il = ({
893
+ }, kl = ({
889
894
  blockId: e,
890
895
  libBlockId: t,
891
896
  blockName: n,
@@ -893,9 +898,9 @@ const Al = () => {
893
898
  className: a = "",
894
899
  close: i
895
900
  }) => {
896
- const [l, o] = _(!1);
901
+ const [l, o] = P(!1);
897
902
  return /* @__PURE__ */ r(
898
- _l,
903
+ Il,
899
904
  {
900
905
  blockId: e,
901
906
  libBlockId: t,
@@ -905,7 +910,7 @@ const Al = () => {
905
910
  },
906
911
  blockName: n,
907
912
  trigger: /* @__PURE__ */ u(
908
- P,
913
+ _,
909
914
  {
910
915
  type: "button",
911
916
  variant: "destructive",
@@ -920,7 +925,7 @@ const Al = () => {
920
925
  )
921
926
  }
922
927
  );
923
- }, kl = () => {
928
+ }, Ll = () => {
924
929
  const e = Q(), t = $(), n = Se(), {
925
930
  data: s = [],
926
931
  isLoading: a,
@@ -962,8 +967,8 @@ const Al = () => {
962
967
  createGroup: l,
963
968
  isCreating: o
964
969
  };
965
- }, Ll = ({ value: e, onChange: t }) => {
966
- const [n, s] = _(!1), [a, i] = _(""), l = ct(null), { groups: o } = kl(), [c, h] = _([
970
+ }, Dl = ({ value: e, onChange: t }) => {
971
+ const [n, s] = P(!1), [a, i] = P(""), l = ct(null), { groups: o } = Ll(), [c, h] = P([
967
972
  { id: "hero", name: "Hero" },
968
973
  { id: "feature", name: "Feature" },
969
974
  { id: "footer", name: "Footer" },
@@ -995,24 +1000,24 @@ const Al = () => {
995
1000
  () => [
996
1001
  ...o,
997
1002
  ...c.filter(
998
- (p) => !o.some((y) => y.id === p.id)
1003
+ (y) => !o.some((p) => p.id === y.id)
999
1004
  )
1000
1005
  ],
1001
1006
  [o, c]
1002
1007
  ), 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);
1008
+ const y = a.trim();
1009
+ if (!y) return;
1010
+ const p = { id: y, name: y };
1011
+ h((S) => [...S, p]), t(p.id), i(""), s(!1);
1007
1012
  };
1008
1013
  we(() => {
1009
1014
  n && l.current && l.current.focus();
1010
1015
  }, [n]);
1011
- const w = (p) => {
1012
- p.key === "Enter" && (p.preventDefault(), d());
1016
+ const w = (y) => {
1017
+ y.key === "Enter" && (y.preventDefault(), d());
1013
1018
  };
1014
1019
  return we(() => {
1015
- e && !g.some((p) => p.id === e) && t("");
1020
+ e && !g.some((y) => y.id === e) && t("");
1016
1021
  }, [e, g, t]), n ? /* @__PURE__ */ u("div", { className: "space-y-2", children: [
1017
1022
  /* @__PURE__ */ r(
1018
1023
  ye,
@@ -1020,13 +1025,13 @@ const Al = () => {
1020
1025
  ref: l,
1021
1026
  placeholder: "Enter new group name",
1022
1027
  value: a,
1023
- onChange: (p) => i(p.target.value),
1028
+ onChange: (y) => i(y.target.value),
1024
1029
  onKeyDown: w
1025
1030
  }
1026
1031
  ),
1027
1032
  /* @__PURE__ */ u("div", { className: "flex justify-end gap-2", children: [
1028
1033
  /* @__PURE__ */ r(
1029
- P,
1034
+ _,
1030
1035
  {
1031
1036
  variant: "outline",
1032
1037
  size: "sm",
@@ -1034,7 +1039,7 @@ const Al = () => {
1034
1039
  children: "Cancel"
1035
1040
  }
1036
1041
  ),
1037
- /* @__PURE__ */ r(P, { size: "sm", onClick: d, children: "Create" })
1042
+ /* @__PURE__ */ r(_, { size: "sm", onClick: d, children: "Create" })
1038
1043
  ] })
1039
1044
  ] }) : /* @__PURE__ */ u("div", { className: "flex gap-2", children: [
1040
1045
  /* @__PURE__ */ u(
@@ -1042,36 +1047,36 @@ const Al = () => {
1042
1047
  {
1043
1048
  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
1049
  value: e,
1045
- onChange: (p) => t(p.target.value),
1050
+ onChange: (y) => t(y.target.value),
1046
1051
  children: [
1047
1052
  /* @__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}`)) }),
1053
+ 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
1054
  c.length > 0 && /* @__PURE__ */ r("optgroup", { label: "Predefined Groups", children: c.filter(
1050
- (p) => !o.some(
1051
- (y) => y.id === p.id
1055
+ (y) => !o.some(
1056
+ (p) => p.id === y.id
1052
1057
  )
1053
- ).map((p) => /* @__PURE__ */ r("option", { value: p.id, children: p.name }, `local-${p.id}`)) })
1058
+ ).map((y) => /* @__PURE__ */ r("option", { value: y.id, children: y.name }, `local-${y.id}`)) })
1054
1059
  ]
1055
1060
  }
1056
1061
  ),
1057
1062
  /* @__PURE__ */ r(
1058
- P,
1063
+ _,
1059
1064
  {
1060
1065
  type: "button",
1061
1066
  size: "icon",
1062
1067
  variant: "outline",
1063
1068
  onClick: () => s(!0),
1064
- children: /* @__PURE__ */ r(fs, { className: "h-4 w-4" })
1069
+ children: /* @__PURE__ */ r(gs, { className: "h-4 w-4" })
1065
1070
  }
1066
1071
  )
1067
1072
  ] });
1068
- }, Dl = 1 * 1024 * 1024, Gl = ({ value: e, onChange: t }) => {
1069
- const [n, s] = _(!1), a = ct(null), i = _e(
1073
+ }, Gl = 1 * 1024 * 1024, Ul = ({ value: e, onChange: t }) => {
1074
+ const [n, s] = P(!1), a = ct(null), i = _e(
1070
1075
  (c) => {
1071
1076
  var g;
1072
1077
  const h = (g = c.target.files) == null ? void 0 : g[0];
1073
1078
  if (h) {
1074
- if (h.size > Dl) {
1079
+ if (h.size > Gl) {
1075
1080
  j.error("File too large", {
1076
1081
  description: `Maximum file size is 1mb. Selected file is ${(h.size / 1024 / 1024).toFixed(2)}MB.`
1077
1082
  }), a.current && (a.current.value = "");
@@ -1105,7 +1110,7 @@ const Al = () => {
1105
1110
  }
1106
1111
  ),
1107
1112
  /* @__PURE__ */ r(
1108
- P,
1113
+ _,
1109
1114
  {
1110
1115
  type: "button",
1111
1116
  variant: "outline",
@@ -1125,7 +1130,7 @@ const Al = () => {
1125
1130
  }
1126
1131
  ),
1127
1132
  e && /* @__PURE__ */ r(
1128
- P,
1133
+ _,
1129
1134
  {
1130
1135
  type: "button",
1131
1136
  variant: "outline",
@@ -1147,7 +1152,7 @@ const Al = () => {
1147
1152
  ) })
1148
1153
  ] });
1149
1154
  }, ue = {
1150
- ...Qa,
1155
+ ...Xa,
1151
1156
  //pages
1152
1157
  ADD_PAGE: "add_page",
1153
1158
  EDIT_PAGE: "edit_page",
@@ -1183,7 +1188,7 @@ const Al = () => {
1183
1188
  EDIT_MEDIA: "edit_media",
1184
1189
  DELETE_MEDIA: "delete_media"
1185
1190
  }, Rl = (e) => {
1186
- const { blocks: t, close: n, blockId: s } = e, { getPartailBlocks: a } = Xa(), i = t.find((N) => N._id === s), l = i == null ? void 0 : i._libBlockId, o = !!l, c = Y(() => t.some(
1191
+ const { blocks: t, close: n, blockId: s } = e, { getPartailBlocks: a } = Za(), i = t.find((N) => N._id === s), l = i == null ? void 0 : i._libBlockId, o = !!l, c = Y(() => t.some(
1187
1192
  (N) => N._type === "PartialBlock" || N._type === "GlobalBlock"
1188
1193
  ), [t]), h = Y(() => {
1189
1194
  let N = [];
@@ -1194,17 +1199,17 @@ const Al = () => {
1194
1199
  } else
1195
1200
  N.push(C);
1196
1201
  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 = () => {
1202
+ }, [t, a]), [g, d] = P(""), [w, y] = P(""), [p, S] = P(""), [v, x] = P(""), [G, E] = P({}), [b, T] = P(!1), [U, J] = P(o), [ie, k] = P(!1), { hasPermission: q } = sn(), A = q(ue.DELETE_LIBRARY_BLOCK), M = nr(), ne = () => {
1198
1203
  M([s], { _libBlockId: void 0 }), j.success("Block delinked from library"), n();
1199
1204
  }, {
1200
1205
  data: he,
1201
1206
  isLoading: z,
1202
1207
  isError: de
1203
- } = Cl(l);
1208
+ } = Pl(l);
1204
1209
  we(() => {
1205
1210
  de && o && (k(!0), J(!1));
1206
1211
  }, [de, o]), we(() => {
1207
- he && !z && (d(he.name || ""), p(he.group || ""), S(he.description || ""), x(he.preview || ""), J(!1));
1212
+ he && !z && (d(he.name || ""), y(he.group || ""), S(he.description || ""), x(he.preview || ""), J(!1));
1208
1213
  }, [he, z]), we(() => {
1209
1214
  const N = g.trim().length >= 2, C = w.trim() !== "";
1210
1215
  T(N && C && !c);
@@ -1212,7 +1217,7 @@ const Al = () => {
1212
1217
  const F = () => {
1213
1218
  const N = {};
1214
1219
  return g.trim() ? g.length < 2 && (N.name = "Name must be at least 2 characters") : N.name = "Name is required", w || (N.group = "Group is required"), E(N), Object.keys(N).length === 0 && !c;
1215
- }, { resetLibrary: Ee } = Za({ id: "" }), Qe = Tl(
1220
+ }, { resetLibrary: Ee } = Ja({ id: "" }), Qe = Cl(
1216
1221
  (N) => {
1217
1222
  o || M([s], { _libBlockId: N.id }), j.success(`Block ${o ? "updated" : "saved"} successfully`), Ee(N.library), n();
1218
1223
  }
@@ -1223,19 +1228,19 @@ const Al = () => {
1223
1228
  name: g.trim(),
1224
1229
  group: w,
1225
1230
  blocks: C,
1226
- description: y.trim(),
1231
+ description: p.trim(),
1227
1232
  // Only include previewImage if it exists and is a base64 image
1228
1233
  ...v && v.startsWith("data:") ? { previewImage: v } : {},
1229
1234
  // Include id if in edit mode
1230
1235
  ...o ? { id: l } : {}
1231
1236
  });
1232
1237
  }, 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: [
1238
+ return U || 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
1239
  /* @__PURE__ */ r("div", { className: "text-destructive font-medium", children: "Block Not Found" }),
1235
1240
  /* @__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
1241
  /* @__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" })
1242
+ /* @__PURE__ */ r(_, { type: "button", variant: "outline", onClick: n, children: "Cancel" }),
1243
+ /* @__PURE__ */ r(_, { onClick: ne, variant: "destructive", children: "Delink Block" })
1239
1244
  ] })
1240
1245
  ] }) : /* @__PURE__ */ u("div", { children: [
1241
1246
  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 +1256,7 @@ const Al = () => {
1251
1256
  X,
1252
1257
  {
1253
1258
  htmlFor: "name",
1254
- className: R.name ? "text-destructive" : "",
1259
+ className: G.name ? "text-destructive" : "",
1255
1260
  children: "Name"
1256
1261
  }
1257
1262
  ),
@@ -1262,22 +1267,22 @@ const Al = () => {
1262
1267
  placeholder: "Enter block name",
1263
1268
  value: g,
1264
1269
  onChange: (N) => d(N.target.value),
1265
- className: R.name ? "border-destructive" : ""
1270
+ className: G.name ? "border-destructive" : ""
1266
1271
  }
1267
1272
  ),
1268
- R.name && /* @__PURE__ */ r("p", { className: "text-xs text-destructive", children: R.name })
1273
+ G.name && /* @__PURE__ */ r("p", { className: "text-xs text-destructive", children: G.name })
1269
1274
  ] }),
1270
1275
  /* @__PURE__ */ u("div", { className: "space-y-2", children: [
1271
1276
  /* @__PURE__ */ r(
1272
1277
  X,
1273
1278
  {
1274
1279
  htmlFor: "group",
1275
- className: R.group ? "text-destructive" : "",
1280
+ className: G.group ? "text-destructive" : "",
1276
1281
  children: "Group"
1277
1282
  }
1278
1283
  ),
1279
- /* @__PURE__ */ r(Ll, { value: w, onChange: p }),
1280
- R.group && /* @__PURE__ */ r("p", { className: "text-xs text-destructive", children: R.group })
1284
+ /* @__PURE__ */ r(Dl, { value: w, onChange: y }),
1285
+ G.group && /* @__PURE__ */ r("p", { className: "text-xs text-destructive", children: G.group })
1281
1286
  ] }),
1282
1287
  /* @__PURE__ */ u("div", { className: "space-y-2", children: [
1283
1288
  /* @__PURE__ */ r(X, { htmlFor: "description", children: "Description (optional)" }),
@@ -1287,19 +1292,19 @@ const Al = () => {
1287
1292
  id: "description",
1288
1293
  placeholder: "Enter a brief description",
1289
1294
  className: "resize-none",
1290
- value: y,
1295
+ value: p,
1291
1296
  onChange: (N) => S(N.target.value)
1292
1297
  }
1293
1298
  )
1294
1299
  ] }),
1295
1300
  /* @__PURE__ */ u("div", { className: "space-y-2", children: [
1296
1301
  /* @__PURE__ */ r(X, { htmlFor: "previewImage", children: "Preview Image (optional)" }),
1297
- /* @__PURE__ */ r(Gl, { value: v, onChange: x }),
1302
+ /* @__PURE__ */ r(Ul, { value: v, onChange: x }),
1298
1303
  /* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: "max 1mb" })
1299
1304
  ] }),
1300
1305
  /* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-2", children: [
1301
1306
  o && A && /* @__PURE__ */ r(
1302
- Il,
1307
+ kl,
1303
1308
  {
1304
1309
  blockId: s,
1305
1310
  libBlockId: l,
@@ -1309,7 +1314,7 @@ const Al = () => {
1309
1314
  }
1310
1315
  ),
1311
1316
  /* @__PURE__ */ r(
1312
- P,
1317
+ _,
1313
1318
  {
1314
1319
  type: "button",
1315
1320
  variant: "outline",
@@ -1318,7 +1323,7 @@ const Al = () => {
1318
1323
  children: "Cancel"
1319
1324
  }
1320
1325
  ),
1321
- /* @__PURE__ */ r(P, { type: "submit", disabled: m || !b, children: m ? "Saving..." : o ? "Update Block" : "Save Block" })
1326
+ /* @__PURE__ */ r(_, { type: "submit", disabled: m || !b, children: m ? "Saving..." : o ? "Update Block" : "Save Block" })
1322
1327
  ] })
1323
1328
  ] })
1324
1329
  ] });
@@ -1371,7 +1376,7 @@ const Al = () => {
1371
1376
  GLOBAL_BLOCK_PUBLISH_SUCCESS: "Global block published successfully.",
1372
1377
  PAGES_PUBLISH_SUCCESS: "Your changes have been published successfully.",
1373
1378
  SLUG_CHANGE_SUCCESS: "Slug changed successfully."
1374
- }, Ul = {
1379
+ }, Ol = {
1375
1380
  SLUG_ALREADY_USED: "This slug is already in use. Please choose a different one."
1376
1381
  }, Ie = () => {
1377
1382
  const e = Q(), t = $();
@@ -1380,13 +1385,13 @@ const Al = () => {
1380
1385
  initialData: [],
1381
1386
  queryFn: async () => t(e, { action: I.GET_PAGE_TYPES })
1382
1387
  });
1383
- }, Ol = (e) => {
1388
+ }, Bl = (e) => {
1384
1389
  const { data: t } = Ie();
1385
1390
  return Y(
1386
1391
  () => t == null ? void 0 : t.find((n) => n.key === e),
1387
1392
  [t, e]
1388
1393
  );
1389
- }, Bl = () => {
1394
+ }, Ml = () => {
1390
1395
  const e = Q(), t = $();
1391
1396
  return Ae({
1392
1397
  mutationFn: async ({ pageType: n, query: s }) => {
@@ -1422,12 +1427,12 @@ const Al = () => {
1422
1427
  j.error(
1423
1428
  `Failed to add new ${l != null && l.hasSlug ? "page" : l.name}.`,
1424
1429
  {
1425
- description: te(Ul, a.message, a.message)
1430
+ description: te(Ol, a.message, a.message)
1426
1431
  }
1427
1432
  );
1428
1433
  }
1429
1434
  });
1430
- }, bs = () => {
1435
+ }, ws = () => {
1431
1436
  const e = Q(), t = Se(), n = $(), { data: s } = Ie();
1432
1437
  return Ae({
1433
1438
  mutationFn: async (a) => await n(e, {
@@ -1451,7 +1456,7 @@ const Al = () => {
1451
1456
  );
1452
1457
  }
1453
1458
  });
1454
- }, Ml = () => {
1459
+ }, Fl = () => {
1455
1460
  const e = Q(), t = Se(), n = $(), { data: s } = Ie();
1456
1461
  return Ae({
1457
1462
  mutationFn: async (a) => n(e, {
@@ -1481,7 +1486,7 @@ const Al = () => {
1481
1486
  );
1482
1487
  }
1483
1488
  });
1484
- }, Fl = () => {
1489
+ }, ql = () => {
1485
1490
  const e = Q(), t = Se(), n = $(), { data: s } = Ie();
1486
1491
  return Ae({
1487
1492
  mutationFn: async (a) => n(e, {
@@ -1509,8 +1514,8 @@ const Al = () => {
1509
1514
  );
1510
1515
  }
1511
1516
  });
1512
- }, ws = () => {
1513
- const e = Q(), t = $(), n = Se(), { data: s } = Ue();
1517
+ }, Ss = () => {
1518
+ const e = Q(), t = $(), n = Se(), { data: s } = Re();
1514
1519
  return Ae({
1515
1520
  mutationFn: async ({ ids: a }) => t(e, {
1516
1521
  action: I.PUBLISH_CHANGES,
@@ -1525,7 +1530,7 @@ const Al = () => {
1525
1530
  j.error("Failed to publish pages.");
1526
1531
  }
1527
1532
  });
1528
- }, ql = () => {
1533
+ }, Hl = () => {
1529
1534
  const e = Q(), t = $(), n = Se();
1530
1535
  return Ae({
1531
1536
  mutationFn: async (s) => {
@@ -1548,7 +1553,7 @@ const Al = () => {
1548
1553
  j.error("Failed to mark page as template.");
1549
1554
  }
1550
1555
  });
1551
- }, Hl = () => {
1556
+ }, Kl = () => {
1552
1557
  const e = Q(), t = $(), n = Se();
1553
1558
  return Ae({
1554
1559
  mutationFn: async (s) => t(e, {
@@ -1562,7 +1567,7 @@ const Al = () => {
1562
1567
  j.error("Failed to unmark page as template.");
1563
1568
  }
1564
1569
  });
1565
- }, Kl = () => {
1570
+ }, Vl = () => {
1566
1571
  const e = Q(), t = $(), n = Se();
1567
1572
  return Ae({
1568
1573
  mutationFn: async ({ id: s, slug: a }) => t(e, {
@@ -1581,7 +1586,7 @@ const Al = () => {
1581
1586
  }
1582
1587
  });
1583
1588
  };
1584
- var Ss = {};
1589
+ var Ns = {};
1585
1590
  (function e(t, n, s, a) {
1586
1591
  var i = !!(t.Worker && t.Blob && t.Promise && t.OffscreenCanvas && t.OffscreenCanvasRenderingContext2D && t.HTMLCanvasElement && t.HTMLCanvasElement.prototype.transferControlToOffscreen && t.URL && t.URL.createObjectURL), l = typeof Path2D == "function" && typeof DOMMatrix == "function", o = function() {
1587
1592
  if (!t.OffscreenCanvas)
@@ -1691,7 +1696,7 @@ var Ss = {};
1691
1696
  }
1692
1697
  return f;
1693
1698
  };
1694
- }(), p = {
1699
+ }(), y = {
1695
1700
  particleCount: 50,
1696
1701
  angle: 90,
1697
1702
  spread: 45,
@@ -1717,22 +1722,22 @@ var Ss = {};
1717
1722
  disableForReducedMotion: !1,
1718
1723
  scalar: 1
1719
1724
  };
1720
- function y(f, m) {
1725
+ function p(f, m) {
1721
1726
  return m ? m(f) : f;
1722
1727
  }
1723
1728
  function S(f) {
1724
1729
  return f != null;
1725
1730
  }
1726
1731
  function v(f, m, N) {
1727
- return y(
1728
- f && S(f[m]) ? f[m] : p[m],
1732
+ return p(
1733
+ f && S(f[m]) ? f[m] : y[m],
1729
1734
  N
1730
1735
  );
1731
1736
  }
1732
1737
  function x(f) {
1733
1738
  return f < 0 ? 0 : Math.floor(f);
1734
1739
  }
1735
- function R(f, m) {
1740
+ function G(f, m) {
1736
1741
  return Math.floor(Math.random() * (m - f)) + f;
1737
1742
  }
1738
1743
  function E(f) {
@@ -1749,7 +1754,7 @@ var Ss = {};
1749
1754
  b: E(m.substring(4, 6))
1750
1755
  };
1751
1756
  }
1752
- function G(f) {
1757
+ function U(f) {
1753
1758
  var m = v(f, "origin", Object);
1754
1759
  return m.x = v(m, "x", Number), m.y = v(m, "y", Number), m;
1755
1760
  }
@@ -1859,16 +1864,16 @@ var Ss = {};
1859
1864
  function he(f, m) {
1860
1865
  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
1866
  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--; )
1863
- Mn.push(
1867
+ 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), Ts = v(W, "colors", b), Ia = v(W, "ticks", Number), Cs = v(W, "shapes"), ka = v(W, "scalar"), La = !!v(W, "flat"), Ps = U(W), _s = Me, Fn = [], Da = f.width * Ps.x, Ga = f.height * Ps.y; _s--; )
1868
+ Fn.push(
1864
1869
  A({
1865
1870
  x: Da,
1866
1871
  y: Ga,
1867
1872
  angle: Xe,
1868
1873
  spread: rt,
1869
1874
  startVelocity: $e,
1870
- color: xs[Ps % xs.length],
1871
- shape: Ts[R(0, Ts.length)],
1875
+ color: Ts[_s % Ts.length],
1876
+ shape: Cs[G(0, Cs.length)],
1872
1877
  ticks: Ia,
1873
1878
  decay: Ca,
1874
1879
  gravity: Pa,
@@ -1877,7 +1882,7 @@ var Ss = {};
1877
1882
  flat: La
1878
1883
  })
1879
1884
  );
1880
- return oe ? oe.addFettis(Mn) : (oe = ne(f, Mn, V, Le, Be), oe.promise);
1885
+ return oe ? oe.addFettis(Fn) : (oe = ne(f, Fn, V, Le, Be), oe.promise);
1881
1886
  }
1882
1887
  function xe(W) {
1883
1888
  var Le = H || v(W, "disableForReducedMotion", Boolean), Be = v(W, "zIndex", Number);
@@ -1984,15 +1989,15 @@ var Ss = {};
1984
1989
  }, n.exports.create = he, n.exports.shapeFromPath = Ee, n.exports.shapeFromText = Qe;
1985
1990
  })(/* @__PURE__ */ function() {
1986
1991
  return typeof window < "u" ? window : typeof self < "u" ? self : this || {};
1987
- }(), Ss, !1);
1988
- const Vl = Ss.exports;
1989
- Ss.exports.create;
1990
- const jl = {
1992
+ }(), Ns, !1);
1993
+ const jl = Ns.exports;
1994
+ Ns.exports.create;
1995
+ const $l = {
1991
1996
  particleCount: 350,
1992
1997
  spread: 120,
1993
1998
  origin: { y: 0.6 },
1994
1999
  angle: 90
1995
- }, $l = {
2000
+ }, zl = {
1996
2001
  TOP_RIGHT: {
1997
2002
  angle: 225,
1998
2003
  origin: { x: 0.9, y: 0 }
@@ -2001,16 +2006,16 @@ const jl = {
2001
2006
  angle: 100,
2002
2007
  origin: { x: 0.9, y: 0.9 }
2003
2008
  }
2004
- }, xn = (e) => {
2005
- let t = $l[e];
2009
+ }, Tn = (e) => {
2010
+ let t = zl[e];
2006
2011
  t || (t = {});
2007
- const n = { ...jl, ...t };
2008
- Vl(n);
2009
- }, zl = () => {
2010
- const [e] = Ja(), { mutate: t, isPending: n } = ws(), { mutateAsync: s, isPending: a } = Rr();
2012
+ const n = { ...$l, ...t };
2013
+ jl(n);
2014
+ }, Wl = () => {
2015
+ const [e] = ei(), { mutate: t, isPending: n } = Ss(), { mutateAsync: s, isPending: a } = Ur();
2011
2016
  return /* @__PURE__ */ u("div", { className: "bg-white py-3 flex items-center justify-center gap-x-3 border-t", children: [
2012
2017
  /* @__PURE__ */ r(
2013
- P,
2018
+ _,
2014
2019
  {
2015
2020
  size: "sm",
2016
2021
  variant: "outline",
@@ -2022,7 +2027,7 @@ const jl = {
2022
2027
  }
2023
2028
  ),
2024
2029
  /* @__PURE__ */ r(
2025
- P,
2030
+ _,
2026
2031
  {
2027
2032
  size: "sm",
2028
2033
  disabled: n || a,
@@ -2031,7 +2036,7 @@ const jl = {
2031
2036
  { ids: ["THEME"] },
2032
2037
  {
2033
2038
  onSuccess: () => {
2034
- xn("BOTTOM_RIGHT");
2039
+ Tn("BOTTOM_RIGHT");
2035
2040
  }
2036
2041
  }
2037
2042
  );
@@ -2040,12 +2045,12 @@ const jl = {
2040
2045
  }
2041
2046
  )
2042
2047
  ] });
2043
- }, Wl = ({
2048
+ }, Yl = ({
2044
2049
  page: e,
2045
2050
  onClose: t
2046
2051
  }) => {
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}/`))) {
2052
+ const [n, s] = P(e.slug || ""), { mutate: a, isPending: i } = Vl(), { data: l } = Ie(), o = fe(l, { key: e == null ? void 0 : e.pageType }), c = (g) => {
2053
+ if (g.preventDefault(), !(e != null && e.primaryPage) && Object.keys(qe).some((y) => n === `/${y}` || Rt(n, `/${y}/`))) {
2049
2054
  j.error("Error", {
2050
2055
  description: "Slugs cannot start with a language code for primary page"
2051
2056
  });
@@ -2095,7 +2100,7 @@ const jl = {
2095
2100
  value: n,
2096
2101
  onChange: (g) => {
2097
2102
  const d = g.target.value;
2098
- Ut(d, `/${h}`) && s(d);
2103
+ Rt(d, `/${h}`) && s(d);
2099
2104
  },
2100
2105
  className: "col-span-3",
2101
2106
  required: !0,
@@ -2107,10 +2112,10 @@ const jl = {
2107
2112
  ] })
2108
2113
  ] }),
2109
2114
  /* @__PURE__ */ r(et, { children: /* @__PURE__ */ r(
2110
- P,
2115
+ _,
2111
2116
  {
2112
2117
  type: "submit",
2113
- disabled: i || !Ut(n, `/${h}`) || rs(e == null ? void 0 : e.slug, n),
2118
+ disabled: i || !Rt(n, `/${h}`) || as(e == null ? void 0 : e.slug, n),
2114
2119
  children: i ? "Changing..." : "Change Slug"
2115
2120
  }
2116
2121
  ) })
@@ -2121,7 +2126,7 @@ function qr({
2121
2126
  page: e,
2122
2127
  onClose: t
2123
2128
  }) {
2124
- const [, n] = Re(), { mutate: s, isPending: a } = Ml(), { data: i } = Ie(), l = () => {
2129
+ const [, n] = Ue(), { mutate: s, isPending: a } = Fl(), { data: i } = Ie(), l = () => {
2125
2130
  s(e, {
2126
2131
  onSuccess: () => {
2127
2132
  e != null && e.primaryPage || (window.history.replaceState(null, "", "/"), n(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate"))), t();
@@ -2148,9 +2153,9 @@ function qr({
2148
2153
  ] })
2149
2154
  ] }),
2150
2155
  /* @__PURE__ */ u(et, { children: [
2151
- /* @__PURE__ */ r(P, { variant: "outline", onClick: t, children: "Cancel" }),
2156
+ /* @__PURE__ */ r(_, { variant: "outline", onClick: t, children: "Cancel" }),
2152
2157
  /* @__PURE__ */ r(
2153
- P,
2158
+ _,
2154
2159
  {
2155
2160
  variant: "destructive",
2156
2161
  disabled: a,
@@ -2169,11 +2174,11 @@ const Oe = ({
2169
2174
  }) => {
2170
2175
  const { hasPermission: a } = sn();
2171
2176
  return e && !a(e) || t && !t.some((i) => a(i)) ? s : n;
2172
- }, Ns = ({
2177
+ }, As = ({
2173
2178
  page: e,
2174
2179
  onClose: t
2175
2180
  }) => {
2176
- const { mutate: n, isPending: s } = Fl(), a = async () => {
2181
+ const { mutate: n, isPending: s } = ql(), a = async () => {
2177
2182
  n(e, { onSuccess: t });
2178
2183
  };
2179
2184
  return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
@@ -2187,9 +2192,9 @@ const Oe = ({
2187
2192
  ] })
2188
2193
  ] }),
2189
2194
  /* @__PURE__ */ u(et, { children: [
2190
- /* @__PURE__ */ r(P, { variant: "outline", onClick: t, children: "Cancel" }),
2195
+ /* @__PURE__ */ r(_, { variant: "outline", onClick: t, children: "Cancel" }),
2191
2196
  /* @__PURE__ */ r(
2192
- P,
2197
+ _,
2193
2198
  {
2194
2199
  variant: "destructive",
2195
2200
  disabled: s,
@@ -2204,12 +2209,12 @@ const Oe = ({
2204
2209
  onClose: t,
2205
2210
  languages: n
2206
2211
  }) => {
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(
2212
+ const { data: s } = Re(), { 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 } = ws(), S = Y(
2208
2213
  () => a == null ? void 0 : a.find(
2209
2214
  (E) => E.key === e.pageType
2210
2215
  ),
2211
2216
  [a, e.pageType]
2212
- ), v = !(S != null && S.hasSlug), x = w || y, R = (E) => {
2217
+ ), v = !(S != null && S.hasSlug), x = w || p, G = (E) => {
2213
2218
  E.preventDefault();
2214
2219
  const b = {
2215
2220
  name: i,
@@ -2218,14 +2223,14 @@ const Oe = ({
2218
2223
  slug: h,
2219
2224
  pageType: s == null ? void 0 : s.pageType
2220
2225
  };
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 });
2226
+ 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
2227
  };
2223
2228
  return /* @__PURE__ */ r(He, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { className: "sm:max-w-[425px] text-slate-600", children: [
2224
2229
  /* @__PURE__ */ u(Ve, { children: [
2225
2230
  /* @__PURE__ */ r(je, { children: e.edit ? B.EDIT_LANGUAGE : B.ADD_NEW_LANGUAGE }),
2226
2231
  /* @__PURE__ */ r(Ye, { className: "font-light", children: B.ENTER_LANGUAGE_DETAILS })
2227
2232
  ] }),
2228
- /* @__PURE__ */ u("form", { onSubmit: R, children: [
2233
+ /* @__PURE__ */ u("form", { onSubmit: G, children: [
2229
2234
  /* @__PURE__ */ u("div", { className: "grid gap-4 py-4", children: [
2230
2235
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2231
2236
  /* @__PURE__ */ r(X, { htmlFor: "lang", className: "text-right", children: B.LANGUAGE }),
@@ -2273,7 +2278,7 @@ const Oe = ({
2273
2278
  value: h,
2274
2279
  onChange: (E) => {
2275
2280
  const b = E.target.value;
2276
- Ut(b, `/${o}`) && g(Dt(Ma(b)));
2281
+ Rt(b, `/${o}`) && g(Dt(Ma(b)));
2277
2282
  },
2278
2283
  className: "col-span-3",
2279
2284
  required: !0,
@@ -2286,19 +2291,19 @@ const Oe = ({
2286
2291
  ] })
2287
2292
  ] }),
2288
2293
  /* @__PURE__ */ r(et, { children: /* @__PURE__ */ r(
2289
- P,
2294
+ _,
2290
2295
  {
2291
2296
  type: "submit",
2292
- disabled: x || !i || !o || !v && !Ut(h, `/${o}`),
2297
+ disabled: x || !i || !o || !v && !Rt(h, `/${o}`),
2293
2298
  children: x ? e.edit ? B.UPDATING : B.ADDING : e.edit ? B.UPDATE : B.ADD_NEW_LANGUAGE
2294
2299
  }
2295
2300
  ) })
2296
2301
  ] })
2297
2302
  ] }) });
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")
2303
+ }, Ql = () => {
2304
+ const [e, t] = P(null), { selectedLang: n, fallbackLang: s, setSelectedLang: a } = ut(), { data: i, isFetching: l } = cn(), { data: o } = Re(), [c, h] = P(null), [g, d] = P(null), [w, y] = P(null), { data: p } = un(), S = Te(
2305
+ te(p, "languages") || ["en"],
2306
+ (v) => !fe(i, { lang: v }) && v !== te(p, "fallbackLang")
2302
2307
  );
2303
2308
  return /* @__PURE__ */ u("div", { className: "space-y-4", children: [
2304
2309
  /* @__PURE__ */ r("ul", { className: "space-y-2", children: l ? /* @__PURE__ */ u("div", { className: "w-full space-y-3 py-4", children: [
@@ -2306,7 +2311,7 @@ const Oe = ({
2306
2311
  /* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
2307
2312
  /* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
2308
2313
  ] }) : Fe(i, (v) => {
2309
- const x = v.lang, R = v.slug, E = !v.primaryPage;
2314
+ const x = v.lang, G = v.slug, E = !v.primaryPage;
2310
2315
  return /* @__PURE__ */ u(be, { children: [
2311
2316
  /* @__PURE__ */ u(
2312
2317
  "li",
@@ -2331,9 +2336,9 @@ const Oe = ({
2331
2336
  }
2332
2337
  ),
2333
2338
  /* @__PURE__ */ u("div", { children: [
2334
- R && /* @__PURE__ */ u("div", { className: "text-[11px] text-slate-600 font-light", children: [
2339
+ G && /* @__PURE__ */ u("div", { className: "text-[11px] text-slate-600 font-light", children: [
2335
2340
  "Slug: ",
2336
- /* @__PURE__ */ r("b", { className: "font-medium", children: R })
2341
+ /* @__PURE__ */ r("b", { className: "font-medium", children: G })
2337
2342
  ] }),
2338
2343
  /* @__PURE__ */ u("div", { className: "text-[11px] text-slate-600 font-light", children: [
2339
2344
  "Name:",
@@ -2346,7 +2351,7 @@ const Oe = ({
2346
2351
  ] })
2347
2352
  ] }),
2348
2353
  E ? /* @__PURE__ */ u("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
2349
- /* @__PURE__ */ r(Li, { fill: "orange", className: "w-3 h-3" }),
2354
+ /* @__PURE__ */ r(Di, { fill: "orange", className: "w-3 h-3" }),
2350
2355
  /* @__PURE__ */ r("b", { children: " Primary" })
2351
2356
  ] }) : /* @__PURE__ */ r("div", { className: "flex items-center gap-x-3", children: /* @__PURE__ */ r(
2352
2357
  Oe,
@@ -2363,12 +2368,12 @@ const Oe = ({
2363
2368
  asChild: !0,
2364
2369
  onClick: (T) => T.stopPropagation(),
2365
2370
  children: /* @__PURE__ */ r(
2366
- P,
2371
+ _,
2367
2372
  {
2368
2373
  variant: "ghost",
2369
2374
  size: "sm",
2370
2375
  className: "h-8 w-8 p-0",
2371
- children: /* @__PURE__ */ r(gs, { className: "h-4 w-4" })
2376
+ children: /* @__PURE__ */ r(ps, { className: "h-4 w-4" })
2372
2377
  }
2373
2378
  )
2374
2379
  }
@@ -2391,7 +2396,7 @@ const Oe = ({
2391
2396
  T.stopPropagation(), t({ ...v, edit: !0 });
2392
2397
  },
2393
2398
  children: [
2394
- /* @__PURE__ */ r(Di, { className: "size-3" }),
2399
+ /* @__PURE__ */ r(Gi, { className: "size-3" }),
2395
2400
  B.EDIT
2396
2401
  ]
2397
2402
  }
@@ -2429,7 +2434,7 @@ const Oe = ({
2429
2434
  T.stopPropagation(), h(v);
2430
2435
  },
2431
2436
  children: [
2432
- /* @__PURE__ */ r(Gi, { className: "size-3" }),
2437
+ /* @__PURE__ */ r(Ui, { className: "size-3" }),
2433
2438
  B.DELETE
2434
2439
  ]
2435
2440
  }
@@ -2450,7 +2455,7 @@ const Oe = ({
2450
2455
  ] });
2451
2456
  }) }),
2452
2457
  /* @__PURE__ */ r(Oe, { permissions: [ue.ADD_PAGE], children: /* @__PURE__ */ r("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ r(
2453
- P,
2458
+ _,
2454
2459
  {
2455
2460
  variant: "default",
2456
2461
  size: "sm",
@@ -2477,22 +2482,22 @@ const Oe = ({
2477
2482
  ),
2478
2483
  c && /* @__PURE__ */ r(qr, { page: c, onClose: () => h(null) }),
2479
2484
  g && /* @__PURE__ */ r(
2480
- Ns,
2485
+ As,
2481
2486
  {
2482
2487
  page: g,
2483
2488
  onClose: () => d(null)
2484
2489
  }
2485
2490
  ),
2486
2491
  w && /* @__PURE__ */ r(
2487
- Wl,
2492
+ Yl,
2488
2493
  {
2489
2494
  page: w,
2490
- onClose: () => p(null)
2495
+ onClose: () => y(null)
2491
2496
  }
2492
2497
  )
2493
2498
  ] });
2494
2499
  };
2495
- function Ql({
2500
+ function Xl({
2496
2501
  pages: e,
2497
2502
  selectedParentId: t,
2498
2503
  onChange: n,
@@ -2531,13 +2536,13 @@ function Ql({
2531
2536
  )
2532
2537
  ] });
2533
2538
  }
2534
- const Xl = ({
2539
+ const Zl = ({
2535
2540
  templates: e,
2536
2541
  selectedTemplateId: t,
2537
2542
  onSelectTemplate: n,
2538
2543
  isLoading: s = !1
2539
2544
  }) => {
2540
- const [a, i] = _("");
2545
+ const [a, i] = P("");
2541
2546
  if (we(() => {
2542
2547
  if (t) {
2543
2548
  const o = e.find((c) => c.id === t);
@@ -2579,13 +2584,13 @@ const Xl = ({
2579
2584
  /* @__PURE__ */ r("div", { className: "p-2 text-xs text-gray-500 bg-gray-50 border-t", children: "Template preview" })
2580
2585
  ] })
2581
2586
  ] });
2582
- }, Zl = () => {
2587
+ }, Jl = () => {
2583
2588
  const e = Q(), t = $();
2584
2589
  return Ne({
2585
2590
  queryKey: [ke, I.GET_LIBRARIES],
2586
2591
  queryFn: async () => await t(e, { action: I.GET_LIBRARIES }) || []
2587
2592
  });
2588
- }, Jl = (e) => {
2593
+ }, eo = (e) => {
2589
2594
  const t = Q(), n = $();
2590
2595
  return Ne({
2591
2596
  queryKey: [ke, I.GET_TEMPLATES_BY_TYPE, e],
@@ -2598,8 +2603,8 @@ const Xl = ({
2598
2603
  return (e ? Te(s, { pageType: e }) : s) || [];
2599
2604
  }
2600
2605
  });
2601
- }, eo = (e) => {
2602
- const { data: t = [], isLoading: n } = Jl(e), { data: s = [], isLoading: a } = Zl(), i = Y(() => n || a ? [] : t.map((o) => {
2606
+ }, to = (e) => {
2607
+ const { data: t = [], isLoading: n } = eo(e), { data: s = [], isLoading: a } = Jl(), i = Y(() => n || a ? [] : t.map((o) => {
2603
2608
  const c = fe(s, { id: o.library });
2604
2609
  return {
2605
2610
  ...o,
@@ -2613,34 +2618,34 @@ const Xl = ({
2613
2618
  isLoading: n || a
2614
2619
  };
2615
2620
  };
2616
- function to({
2621
+ function no({
2617
2622
  addEditPage: e,
2618
2623
  additionalPageTypes: t = [],
2619
2624
  close: n
2620
2625
  }) {
2621
2626
  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] = _(
2627
+ const s = !!(e != null && e.id), { data: a } = Rn(), { mutate: i, isPending: l } = Fr(), { mutate: o, isPending: c } = ws(), [h, g] = P(null), [d, w] = P(
2623
2628
  (e == null ? void 0 : e.pageType) ?? "page"
2624
- ), [p, y] = _(
2629
+ ), [y, p] = P(
2625
2630
  t.find(
2626
2631
  (f) => f.key === d
2627
2632
  )
2628
- ), [S, v] = _(
2633
+ ), [S, v] = P(
2629
2634
  (e == null ? void 0 : e.parent) ?? ""
2630
- ), [x, R] = _((e == null ? void 0 : e.name) ?? ""), [E, b] = _(
2635
+ ), [x, G] = P((e == null ? void 0 : e.name) ?? ""), [E, b] = P(
2631
2636
  ((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""
2632
- ), [T, G] = _(
2637
+ ), [T, U] = P(
2633
2638
  (e == null ? void 0 : e.dynamic) ?? !1
2634
- ), [J, ie] = _(""), { data: k, isLoading: q } = eo(d), A = l || c, M = t.find(
2639
+ ), [J, ie] = P(""), { data: k, isLoading: q } = to(d), A = l || c, M = t.find(
2635
2640
  (f) => f.key === d
2636
2641
  ), ne = (f) => {
2637
- w(f), v(""), b(""), G(!1), ie(""), y(
2642
+ w(f), v(""), b(""), U(!1), ie(""), p(
2638
2643
  t.find(
2639
2644
  (m) => m.key === f
2640
2645
  )
2641
2646
  );
2642
2647
  }, he = (f) => {
2643
- G(f), f && b("");
2648
+ U(f), f && b("");
2644
2649
  }, z = (f) => {
2645
2650
  if (v(f), f && f !== "none") {
2646
2651
  const m = a == null ? void 0 : a.find(
@@ -2668,9 +2673,9 @@ function to({
2668
2673
  j.error("Name is required");
2669
2674
  return;
2670
2675
  }
2671
- if (!(p != null && p.hasSlug)) {
2676
+ if (!(y != null && y.hasSlug)) {
2672
2677
  const m = {
2673
- pageType: p == null ? void 0 : p.key,
2678
+ pageType: y == null ? void 0 : y.key,
2674
2679
  name: x,
2675
2680
  slug: "",
2676
2681
  hasSlug: !1
@@ -2680,7 +2685,7 @@ function to({
2680
2685
  { id: e == null ? void 0 : e.id, name: x },
2681
2686
  {
2682
2687
  onSuccess: () => {
2683
- j.success((p == null ? void 0 : p.name) + " updated successfully"), n();
2688
+ j.success((y == null ? void 0 : y.name) + " updated successfully"), n();
2684
2689
  }
2685
2690
  }
2686
2691
  );
@@ -2756,7 +2761,7 @@ function to({
2756
2761
  });
2757
2762
  }
2758
2763
  };
2759
- return p != null && p.hasSlug ? /* @__PURE__ */ u("form", { onSubmit: F, className: "w-full max-w-md mx-auto space-y-4", children: [
2764
+ return y != null && y.hasSlug ? /* @__PURE__ */ u("form", { onSubmit: F, className: "w-full max-w-md mx-auto space-y-4", children: [
2760
2765
  /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
2761
2766
  /* @__PURE__ */ r(X, { htmlFor: "pageType", className: "text-sm", children: "Page Type" }),
2762
2767
  /* @__PURE__ */ u(
@@ -2774,10 +2779,10 @@ function to({
2774
2779
  }
2775
2780
  )
2776
2781
  ] }),
2777
- !s && (p == null ? void 0 : p.hasSlug) && k.length > 0 && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2782
+ !s && (y == null ? void 0 : y.hasSlug) && k.length > 0 && /* @__PURE__ */ u("div", { className: "space-y-1", children: [
2778
2783
  /* @__PURE__ */ r(X, { className: "text-sm mb-1 block", children: "Template" }),
2779
2784
  /* @__PURE__ */ r(
2780
- Xl,
2785
+ Zl,
2781
2786
  {
2782
2787
  templates: k,
2783
2788
  selectedTemplateId: J,
@@ -2787,7 +2792,7 @@ function to({
2787
2792
  )
2788
2793
  ] }),
2789
2794
  /* @__PURE__ */ r(
2790
- Ql,
2795
+ Xl,
2791
2796
  {
2792
2797
  pages: a,
2793
2798
  selectedParentId: S,
@@ -2801,7 +2806,7 @@ function to({
2801
2806
  {
2802
2807
  id: "name",
2803
2808
  value: x,
2804
- onChange: (f) => R(f.target.value),
2809
+ onChange: (f) => G(f.target.value),
2805
2810
  required: !0,
2806
2811
  "aria-required": "true"
2807
2812
  }
@@ -2846,7 +2851,7 @@ function to({
2846
2851
  ),
2847
2852
  h && /* @__PURE__ */ r("p", { className: "text-xs text-red-500", children: h })
2848
2853
  ] }),
2849
- /* @__PURE__ */ r(P, { disabled: A, type: "submit", className: "w-full", children: s ? A ? "Updating..." : "Update page" : A ? "Creating..." : "Create Page" })
2854
+ /* @__PURE__ */ r(_, { disabled: A, type: "submit", className: "w-full", children: s ? A ? "Updating..." : "Update page" : A ? "Creating..." : "Create Page" })
2850
2855
  ] }) : /* @__PURE__ */ u(
2851
2856
  "form",
2852
2857
  {
@@ -2878,18 +2883,18 @@ function to({
2878
2883
  {
2879
2884
  id: "name",
2880
2885
  value: x,
2881
- onChange: (f) => R(f.target.value),
2886
+ onChange: (f) => G(f.target.value),
2882
2887
  required: !0,
2883
2888
  "aria-required": "true"
2884
2889
  }
2885
2890
  )
2886
2891
  ] }),
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) })
2892
+ /* @__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
2893
  ]
2889
2894
  }
2890
2895
  );
2891
2896
  }
2892
- const no = ({
2897
+ const so = ({
2893
2898
  addEditPage: e,
2894
2899
  setAddEditPage: t
2895
2900
  }) => {
@@ -2903,7 +2908,7 @@ const no = ({
2903
2908
  /* @__PURE__ */ r(Ye, { children: s ? "Update your page name" : "Enter details to create a new page" })
2904
2909
  ] }),
2905
2910
  /* @__PURE__ */ r(
2906
- to,
2911
+ no,
2907
2912
  {
2908
2913
  addEditPage: e,
2909
2914
  close: () => t(void 0),
@@ -2911,18 +2916,18 @@ const no = ({
2911
2916
  }
2912
2917
  )
2913
2918
  ] }) });
2914
- }, so = 1 * 1024 * 1024, ro = ({
2919
+ }, ro = 1 * 1024 * 1024, ao = ({
2915
2920
  page: e,
2916
2921
  onClose: t
2917
2922
  }) => {
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(
2923
+ const [n, s] = P(!1), [a, i] = P(""), [l, o] = P(""), [c, h] = P(!1), g = ct(null), d = Hl(), { data: w } = Ie(), y = w == null ? void 0 : w.find(
2919
2924
  (E) => E.key === e.pageType
2920
- ), y = (p == null ? void 0 : p.name) || It(e.pageType), S = _e(
2925
+ ), p = (y == null ? void 0 : y.name) || It(e.pageType), S = _e(
2921
2926
  (E) => {
2922
2927
  var T;
2923
2928
  const b = (T = E.target.files) == null ? void 0 : T[0];
2924
2929
  if (b) {
2925
- if (b.size > so) {
2930
+ if (b.size > ro) {
2926
2931
  j.error("File too large", {
2927
2932
  description: `Maximum file size is 1MB. Selected file is ${(b.size / 1024).toFixed(2)}KB.`
2928
2933
  }), g.current && (g.current.value = "");
@@ -2930,13 +2935,13 @@ const no = ({
2930
2935
  }
2931
2936
  try {
2932
2937
  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"
2938
+ const U = new FileReader();
2939
+ U.onloadend = () => {
2940
+ o(U.result), h(!1);
2941
+ }, U.readAsDataURL(b);
2942
+ } catch (U) {
2943
+ console.error("Error reading file:", U), h(!1), j.error("Failed to process image", {
2944
+ description: U instanceof Error ? U.message : "Unknown error"
2940
2945
  });
2941
2946
  }
2942
2947
  }
@@ -2947,7 +2952,7 @@ const no = ({
2947
2952
  }, x = () => {
2948
2953
  var E;
2949
2954
  (E = g.current) == null || E.click();
2950
- }, R = () => {
2955
+ }, G = () => {
2951
2956
  s(!0), d.mutate(
2952
2957
  {
2953
2958
  page: e,
@@ -2985,7 +2990,7 @@ const no = ({
2985
2990
  /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
2986
2991
  /* @__PURE__ */ r(on, { className: "w-4 h-4 text-slate-500" }),
2987
2992
  /* @__PURE__ */ r("span", { className: "font-medium text-slate-500", children: "Type:" }),
2988
- /* @__PURE__ */ r("span", { className: "font-semibold", children: y })
2993
+ /* @__PURE__ */ r("span", { className: "font-semibold", children: p })
2989
2994
  ] })
2990
2995
  ] }),
2991
2996
  /* @__PURE__ */ u("div", { children: [
@@ -3017,7 +3022,7 @@ const no = ({
3017
3022
  }
3018
3023
  ),
3019
3024
  /* @__PURE__ */ r(
3020
- P,
3025
+ _,
3021
3026
  {
3022
3027
  type: "button",
3023
3028
  variant: "outline",
@@ -3034,7 +3039,7 @@ const no = ({
3034
3039
  }
3035
3040
  ),
3036
3041
  l && /* @__PURE__ */ r(
3037
- P,
3042
+ _,
3038
3043
  {
3039
3044
  type: "button",
3040
3045
  variant: "outline",
@@ -3062,7 +3067,7 @@ const no = ({
3062
3067
  className: n ? "opacity-75 pointer-events-none" : "",
3063
3068
  children: [
3064
3069
  /* @__PURE__ */ r(
3065
- P,
3070
+ _,
3066
3071
  {
3067
3072
  variant: "outline",
3068
3073
  onClick: (E) => {
@@ -3071,16 +3076,16 @@ const no = ({
3071
3076
  children: "Cancel"
3072
3077
  }
3073
3078
  ),
3074
- /* @__PURE__ */ r(P, { variant: "default", disabled: n, onClick: R, children: "Mark as template" })
3079
+ /* @__PURE__ */ r(_, { variant: "default", disabled: n, onClick: G, children: "Mark as template" })
3075
3080
  ]
3076
3081
  }
3077
3082
  )
3078
3083
  ] }) });
3079
- }, ao = ({
3084
+ }, io = ({
3080
3085
  page: e,
3081
3086
  onClose: t
3082
3087
  }) => {
3083
- const [n, s] = _(!1), a = Hl();
3088
+ const [n, s] = P(!1), a = Kl();
3084
3089
  return /* @__PURE__ */ r(He, { open: !0, onOpenChange: t, children: /* @__PURE__ */ u(Ke, { children: [
3085
3090
  /* @__PURE__ */ u(Ve, { children: [
3086
3091
  /* @__PURE__ */ r(je, { children: "Unmark as template" }),
@@ -3092,7 +3097,7 @@ const no = ({
3092
3097
  className: n ? "opacity-75 pointer-events-none" : "",
3093
3098
  children: [
3094
3099
  /* @__PURE__ */ r(
3095
- P,
3100
+ _,
3096
3101
  {
3097
3102
  variant: "outline",
3098
3103
  onClick: (l) => {
@@ -3101,7 +3106,7 @@ const no = ({
3101
3106
  children: "Cancel"
3102
3107
  }
3103
3108
  ),
3104
- /* @__PURE__ */ r(P, { variant: "default", disabled: n, onClick: () => {
3109
+ /* @__PURE__ */ r(_, { variant: "default", disabled: n, onClick: () => {
3105
3110
  s(!0), a.mutate(e, {
3106
3111
  onSuccess: () => {
3107
3112
  s(!1), t();
@@ -3115,7 +3120,7 @@ const no = ({
3115
3120
  }
3116
3121
  )
3117
3122
  ] }) });
3118
- }, qn = ({
3123
+ }, Hn = ({
3119
3124
  parentSlug: e,
3120
3125
  page: t,
3121
3126
  active: n,
@@ -3129,7 +3134,7 @@ const no = ({
3129
3134
  const { data: h } = Ie(), { hasPermission: g } = sn(), d = Y(
3130
3135
  () => fe(h, { key: t.pageType }),
3131
3136
  [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(
3137
+ ), 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
3138
  () => !!(d != null && d.hasSlug),
3134
3139
  [d == null ? void 0 : d.hasSlug]
3135
3140
  );
@@ -3140,13 +3145,13 @@ const no = ({
3140
3145
  className: `rounded flex p-1.5 items-center justify-between leading-none duration-300 cursor-pointer px-3 py-1.5 ${n ? "bg-gray-200" : "hover:bg-gray-100"}`,
3141
3146
  children: [
3142
3147
  /* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
3143
- t.dynamic ? /* @__PURE__ */ r("div", { className: "w-4 h-4 text-slate-500 stroke-[1]", children: /* @__PURE__ */ r(Oi, { className: "w-4 h-4 text-yellow-400" }) }) : d != null && d.icon ? /* @__PURE__ */ r(
3148
+ t.dynamic ? /* @__PURE__ */ r("div", { className: "w-4 h-4 text-slate-500 stroke-[1]", children: /* @__PURE__ */ r(Bi, { className: "w-4 h-4 text-yellow-400" }) }) : d != null && d.icon ? /* @__PURE__ */ r(
3144
3149
  "div",
3145
3150
  {
3146
3151
  className: "w-4 h-4 text-slate-500 stroke-[1]",
3147
3152
  dangerouslySetInnerHTML: { __html: d.icon }
3148
3153
  }
3149
- ) : d != null && d.hasSlug ? /* @__PURE__ */ r(on, { className: "w-4 h-4 text-slate-500 stroke-[1]" }) : /* @__PURE__ */ r(Bi, { className: "w-4 h-4 text-slate-500 stroke-[1]" }),
3154
+ ) : d != null && d.hasSlug ? /* @__PURE__ */ r(on, { className: "w-4 h-4 text-slate-500 stroke-[1]" }) : /* @__PURE__ */ r(Mi, { className: "w-4 h-4 text-slate-500 stroke-[1]" }),
3150
3155
  /* @__PURE__ */ r(
3151
3156
  "div",
3152
3157
  {
@@ -3155,7 +3160,7 @@ const no = ({
3155
3160
  ),
3156
3161
  /* @__PURE__ */ r("span", { className: "font-light leading-none truncate text-slate-800", children: It(t.name) ?? "" }),
3157
3162
  d != null && d.hasSlug ? /* @__PURE__ */ u(
3158
- Fn,
3163
+ qn,
3159
3164
  {
3160
3165
  variant: "outline",
3161
3166
  className: `ml-2 text-xs max-w-full leading-tight py-px font-normal rounded-full text-gray-400 border ${n ? "border-gray-300" : "border-gray-200"}`,
@@ -3165,15 +3170,15 @@ const no = ({
3165
3170
  ]
3166
3171
  }
3167
3172
  ) : /* @__PURE__ */ r(
3168
- Fn,
3173
+ qn,
3169
3174
  {
3170
3175
  variant: "outline",
3171
3176
  className: `ml-2 text-xs max-w-full leading-tight py-px font-normal rounded-full text-gray-400 border ${n ? "border-gray-300" : "border-gray-200"}`,
3172
3177
  children: d == null ? void 0 : d.name
3173
3178
  }
3174
3179
  ),
3175
- y && /* @__PURE__ */ r(
3176
- Fn,
3180
+ p && /* @__PURE__ */ r(
3181
+ qn,
3177
3182
  {
3178
3183
  variant: "outline",
3179
3184
  className: "ml-2 text-xs py-0 font-normal text-blue-500 border border-blue-200 bg-blue-50",
@@ -3181,8 +3186,8 @@ const no = ({
3181
3186
  }
3182
3187
  )
3183
3188
  ] }),
3184
- /* @__PURE__ */ r("div", { className: "flex items-center space-x-4", children: !p && /* @__PURE__ */ u(rn, { children: [
3185
- /* @__PURE__ */ r(an, { asChild: !0, onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ r(gs, { className: "h-4 w-4 hover:stroke-[3]" }) }),
3189
+ /* @__PURE__ */ r("div", { className: "flex items-center space-x-4", children: !y && /* @__PURE__ */ u(rn, { children: [
3190
+ /* @__PURE__ */ r(an, { asChild: !0, onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ r(ps, { className: "h-4 w-4 hover:stroke-[3]" }) }),
3186
3191
  /* @__PURE__ */ u(ln, { align: "end", className: "text-sm", children: [
3187
3192
  g(ue.EDIT_PAGE) && /* @__PURE__ */ u(
3188
3193
  De,
@@ -3195,7 +3200,7 @@ const no = ({
3195
3200
  });
3196
3201
  },
3197
3202
  children: [
3198
- /* @__PURE__ */ r(Mi, { className: "size-3" }),
3203
+ /* @__PURE__ */ r(Fi, { className: "size-3" }),
3199
3204
  "Edit"
3200
3205
  ]
3201
3206
  }
@@ -3221,12 +3226,12 @@ const no = ({
3221
3226
  v.stopPropagation(), i(t);
3222
3227
  },
3223
3228
  children: [
3224
- /* @__PURE__ */ r(ps, { className: "size-3" }),
3229
+ /* @__PURE__ */ r(ys, { className: "size-3" }),
3225
3230
  B.DELETE
3226
3231
  ]
3227
3232
  }
3228
3233
  ),
3229
- g(ue.MARK_AS_TEMPLATE) && S && /* @__PURE__ */ r(be, { children: y ? /* @__PURE__ */ u(
3234
+ g(ue.MARK_AS_TEMPLATE) && S && /* @__PURE__ */ r(be, { children: p ? /* @__PURE__ */ u(
3230
3235
  De,
3231
3236
  {
3232
3237
  className: "flex items-center gap-2 cursor-pointer",
@@ -3234,7 +3239,7 @@ const no = ({
3234
3239
  v.stopPropagation(), c(t);
3235
3240
  },
3236
3241
  children: [
3237
- /* @__PURE__ */ r(Ds, { className: "size-3" }),
3242
+ /* @__PURE__ */ r(Gs, { className: "size-3" }),
3238
3243
  B.UNMARK_AS_TEMPLATE
3239
3244
  ]
3240
3245
  }
@@ -3246,7 +3251,7 @@ const no = ({
3246
3251
  v.stopPropagation(), o(t);
3247
3252
  },
3248
3253
  children: [
3249
- /* @__PURE__ */ r(Ds, { className: "size-3" }),
3254
+ /* @__PURE__ */ r(Gs, { className: "size-3" }),
3250
3255
  B.MARK_AS_TEMPLATE
3251
3256
  ]
3252
3257
  }
@@ -3256,19 +3261,19 @@ const no = ({
3256
3261
  ]
3257
3262
  }
3258
3263
  );
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(
3264
+ }, lo = ({ close: e }) => {
3265
+ 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] = Ue(), T = E.get("page"), { data: U } = Ie(), J = _e(
3261
3266
  (A) => {
3262
3267
  var M;
3263
- return (M = fe(G, { key: A })) == null ? void 0 : M.hasSlug;
3268
+ return (M = fe(U, { key: A })) == null ? void 0 : M.hasSlug;
3264
3269
  },
3265
- [G]
3270
+ [U]
3266
3271
  );
3267
3272
  we(() => {
3268
3273
  if (!me(v)) return;
3269
3274
  const A = sessionStorage.getItem("pageTypeFilter") || "all";
3270
- !me(G) && A && (fe(G, { key: A }) ? x(A) : x("all"));
3271
- }, [G, v]);
3275
+ !me(U) && A && (fe(U, { key: A }) ? x(A) : x("all"));
3276
+ }, [U, v]);
3272
3277
  const ie = (A) => {
3273
3278
  x(A), sessionStorage.setItem("pageTypeFilter", A);
3274
3279
  }, k = _e(
@@ -3280,14 +3285,16 @@ const no = ({
3280
3285
  );
3281
3286
  we(() => {
3282
3287
  if (T && !S) {
3283
- const A = fe(y, { id: T });
3288
+ const A = fe(p, { id: T });
3284
3289
  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
3290
  }
3286
- }, [y, T, S, b]);
3291
+ }, [p, T, S, b]);
3287
3292
  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)));
3293
+ const A = Nn(
3294
+ 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)))
3295
+ );
3289
3296
  if (v !== "all")
3290
- return Te(A, { pageType: v });
3297
+ return Nn(Te(A, { pageType: v }));
3291
3298
  const M = /* @__PURE__ */ new Map();
3292
3299
  A.forEach((F) => {
3293
3300
  M.set(F.id, { ...F, children: [] });
@@ -3309,13 +3316,13 @@ const no = ({
3309
3316
  he,
3310
3317
  (F) => J(F.pageType)
3311
3318
  ).sort((F, Ee) => F.name.localeCompare(Ee.name));
3312
- return Qs([...de, ...z, ...ne]);
3313
- }, [y, J, n, v]);
3319
+ return Nn([...de, ...z, ...ne]);
3320
+ }, [p, J, n, v]);
3314
3321
  return /* @__PURE__ */ u("div", { className: "flex flex-col justify-between h-full", children: [
3315
3322
  /* @__PURE__ */ u("div", { className: "flex flex-col h-full space-y-6", children: [
3316
3323
  /* @__PURE__ */ u("div", { className: "relative flex item-center gap-x-4", children: [
3317
3324
  /* @__PURE__ */ r(
3318
- Ui,
3325
+ Oi,
3319
3326
  {
3320
3327
  strokeWidth: 2.5,
3321
3328
  className: "absolute left-3 top-2.5 h-4 w-4 text-gray-400"
@@ -3330,17 +3337,17 @@ const no = ({
3330
3337
  onChange: (A) => s(A.target.value)
3331
3338
  }
3332
3339
  ),
3333
- !me(v) && /* @__PURE__ */ u(ui, { value: v, onValueChange: ie, children: [
3340
+ !me(v) && /* @__PURE__ */ u(di, { value: v, onValueChange: ie, children: [
3334
3341
  /* @__PURE__ */ r(
3335
- di,
3342
+ hi,
3336
3343
  {
3337
3344
  className: `${v === "all" ? "bg-gray-50 hover:bg-gray-100" : "bg-gray-100 hover:bg-gray-50"} min-w-[120px] h-max p-0 py-1 pl-2 pr-1 top-1.5 -mt-px absolute text-gray-600 right-1.5 w-max text-xs whitespace-nowrap ring-0 focus:ring-0 shadow-none`,
3338
- children: /* @__PURE__ */ r(hi, { placeholder: "Select page type" })
3345
+ children: /* @__PURE__ */ r(mi, { placeholder: "Select page type" })
3339
3346
  }
3340
3347
  ),
3341
- /* @__PURE__ */ r(mi, { align: "end", children: Fe(
3342
- Xs([{ key: "all", name: "All" }], G),
3343
- (A) => /* @__PURE__ */ r(fi, { value: te(A, "key"), children: te(A, "name") })
3348
+ /* @__PURE__ */ r(fi, { align: "end", children: Fe(
3349
+ Xs([{ key: "all", name: "All" }], U),
3350
+ (A) => /* @__PURE__ */ r(gi, { value: te(A, "key"), children: te(A, "name") })
3344
3351
  ) })
3345
3352
  ] })
3346
3353
  ] }),
@@ -3355,28 +3362,28 @@ const no = ({
3355
3362
  "Empty List!",
3356
3363
  /* @__PURE__ */ r("span", { className: "font-light", children: "Add new page to start" })
3357
3364
  ] }) : /* @__PURE__ */ r("div", { className: "text-sm text-slate-700 space-y-2 h-[70vh] overflow-y-auto", children: Fe(q, (A) => me(A == null ? void 0 : A.children) ? /* @__PURE__ */ r(
3358
- qn,
3365
+ Hn,
3359
3366
  {
3360
3367
  changeActivePage: k,
3361
3368
  setUnpublishPage: o,
3362
3369
  setDeletePage: i,
3363
3370
  setAddEditPage: h,
3364
3371
  setMarkAsTemplate: d,
3365
- setUnmarkAsTemplate: p,
3372
+ setUnmarkAsTemplate: y,
3366
3373
  active: T === A.id,
3367
3374
  page: A
3368
3375
  },
3369
3376
  A.id
3370
3377
  ) : /* @__PURE__ */ u("div", { className: "border-0", children: [
3371
3378
  /* @__PURE__ */ r(
3372
- qn,
3379
+ Hn,
3373
3380
  {
3374
3381
  changeActivePage: k,
3375
3382
  setUnpublishPage: o,
3376
3383
  setDeletePage: i,
3377
3384
  setAddEditPage: h,
3378
3385
  setMarkAsTemplate: d,
3379
- setUnmarkAsTemplate: p,
3386
+ setUnmarkAsTemplate: y,
3380
3387
  active: T === A.id,
3381
3388
  page: A
3382
3389
  }
@@ -3384,7 +3391,7 @@ const no = ({
3384
3391
  /* @__PURE__ */ r("div", { className: "pt-2 pl-6 bg-white", children: Fe(te(A, "children", []), (M) => {
3385
3392
  const ne = T === te(M, "id");
3386
3393
  return /* @__PURE__ */ r(
3387
- qn,
3394
+ Hn,
3388
3395
  {
3389
3396
  parentSlug: A.slug,
3390
3397
  changeActivePage: k,
@@ -3392,7 +3399,7 @@ const no = ({
3392
3399
  setDeletePage: i,
3393
3400
  setAddEditPage: h,
3394
3401
  setMarkAsTemplate: d,
3395
- setUnmarkAsTemplate: p,
3402
+ setUnmarkAsTemplate: y,
3396
3403
  active: ne,
3397
3404
  page: M
3398
3405
  },
@@ -3401,8 +3408,8 @@ const no = ({
3401
3408
  }) })
3402
3409
  ] }, A.key)) })
3403
3410
  ] }),
3404
- R(ue.ADD_PAGE) && /* @__PURE__ */ u(
3405
- P,
3411
+ G(ue.ADD_PAGE) && /* @__PURE__ */ u(
3412
+ _,
3406
3413
  {
3407
3414
  className: "flex text-sm gap-x-2",
3408
3415
  onClick: () => {
@@ -3413,13 +3420,13 @@ const no = ({
3413
3420
  });
3414
3421
  },
3415
3422
  children: [
3416
- /* @__PURE__ */ r(fs, { className: "w-4 h-4" }),
3423
+ /* @__PURE__ */ r(gs, { className: "w-4 h-4" }),
3417
3424
  " Add New"
3418
3425
  ]
3419
3426
  }
3420
3427
  ),
3421
3428
  c && /* @__PURE__ */ r(
3422
- no,
3429
+ so,
3423
3430
  {
3424
3431
  editPage: k,
3425
3432
  addEditPage: c,
@@ -3428,41 +3435,41 @@ const no = ({
3428
3435
  ),
3429
3436
  a && /* @__PURE__ */ r(qr, { page: a, onClose: () => i(null) }),
3430
3437
  l && /* @__PURE__ */ r(
3431
- Ns,
3438
+ As,
3432
3439
  {
3433
3440
  page: l,
3434
3441
  onClose: () => o(null)
3435
3442
  }
3436
3443
  ),
3437
3444
  g && /* @__PURE__ */ r(
3438
- ro,
3445
+ ao,
3439
3446
  {
3440
3447
  page: g,
3441
3448
  onClose: () => d(null)
3442
3449
  }
3443
3450
  ),
3444
3451
  w && /* @__PURE__ */ r(
3445
- ao,
3452
+ io,
3446
3453
  {
3447
3454
  page: w,
3448
- onClose: () => p(null)
3455
+ onClose: () => y(null)
3449
3456
  }
3450
3457
  )
3451
3458
  ] });
3452
- }, lo = () => {
3459
+ }, oo = () => {
3453
3460
  const e = dt("logo", null);
3454
3461
  return e ? /* @__PURE__ */ r("div", { className: "w-full max-h-9 overflow-hidden pr-2", children: er.createElement(e, {}) }) : null;
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;
3462
+ }, co = () => {
3463
+ const [e] = Ue(), t = e.get("page"), { data: n, isFetching: s } = Re(), [a, i] = P(!1), l = !!t && !me(n), o = !t || !s && me(n) || a;
3457
3464
  return /* @__PURE__ */ u(be, { children: [
3458
3465
  /* @__PURE__ */ u(
3459
- P,
3466
+ _,
3460
3467
  {
3461
3468
  variant: "secondary",
3462
3469
  className: "flex items-center w-full space-x-2 py-1",
3463
3470
  onClick: () => i(!0),
3464
3471
  children: [
3465
- /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(Fi, { className: "h-4 w-4" }) }),
3472
+ /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(qi, { className: "h-4 w-4" }) }),
3466
3473
  /* @__PURE__ */ u("span", { className: "truncate leading-tight flex items-center max-w-[200px]", children: [
3467
3474
  /* @__PURE__ */ r("span", { className: "text-slate-600 pr-1 font-light", children: "Editing:" }),
3468
3475
  s ? /* @__PURE__ */ r(Pr, { className: "h-4 w-4 animate-spin text-slate-400 ml-2" }) : It(te(n, "name")) ?? ""
@@ -3489,21 +3496,21 @@ const no = ({
3489
3496
  /* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground", children: "Manage your site structure" })
3490
3497
  ] })
3491
3498
  ] }) }),
3492
- /* @__PURE__ */ r("div", { className: "h-[calc(100vh-100px)] overflow-y-auto", children: /* @__PURE__ */ r(io, { close: () => i(!1) }) })
3499
+ /* @__PURE__ */ r("div", { className: "h-[calc(100vh-100px)] overflow-y-auto", children: /* @__PURE__ */ r(lo, { close: () => i(!1) }) })
3493
3500
  ]
3494
3501
  }
3495
3502
  )
3496
3503
  }
3497
3504
  )
3498
3505
  ] });
3499
- }, co = () => {
3500
- const { fallbackLang: e, languages: t, selectedLang: n, setSelectedLang: s } = ut(), a = me(n) ? e : n, [, i] = Re();
3506
+ }, uo = () => {
3507
+ const { fallbackLang: e, languages: t, selectedLang: n, setSelectedLang: s } = ut(), a = me(n) ? e : n, [, i] = Ue();
3501
3508
  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("")));
3509
+ const p = new URLSearchParams(window.location.search), S = p.get("lang");
3510
+ S && (t.includes(S) ? s(S) : (p.delete("lang"), i(p), s("")));
3504
3511
  }, [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(
3512
+ const [l, o] = P(null), { data: c } = Re(), { data: h } = un(), { data: g, isFetching: d } = cn(), w = Y(() => {
3513
+ const p = Nn(
3507
3514
  Fe(te(h, "languages"), (S) => {
3508
3515
  const v = fe(g, { lang: S });
3509
3516
  return {
@@ -3519,54 +3526,54 @@ const no = ({
3519
3526
  value: te(qe, e),
3520
3527
  isLangPageAdded: !0
3521
3528
  },
3522
- ...y
3529
+ ...p
3523
3530
  ];
3524
- }, [e, g, h]), p = (y) => {
3525
- s(y);
3531
+ }, [e, g, h]), y = (p) => {
3532
+ s(p);
3526
3533
  const S = new URLSearchParams(window.location.search);
3527
- y === e ? S.delete("lang") : S.set("lang", y);
3534
+ p === e ? S.delete("lang") : S.set("lang", p);
3528
3535
  const v = S.toString(), x = `${window.location.pathname}${v ? `?${v}` : ""}`;
3529
3536
  window.history.pushState({}, "", x), i(S), window.dispatchEvent(new PopStateEvent("popstate"));
3530
3537
  };
3531
3538
  return me(t) || d ? null : /* @__PURE__ */ u(be, { children: [
3532
3539
  /* @__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: [
3534
- /* @__PURE__ */ r(qi, { className: "w-4 h-4" }),
3540
+ /* @__PURE__ */ r(an, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ u(_, { variant: "ghost", size: "sm", className: "gap-2", children: [
3541
+ /* @__PURE__ */ r(Hi, { className: "w-4 h-4" }),
3535
3542
  te(qe, a, a),
3536
3543
  /* @__PURE__ */ r(_r, { className: "w-4 h-4" })
3537
3544
  ] }) }),
3538
3545
  /* @__PURE__ */ u(ln, { className: "border-border space-y-1", children: [
3539
3546
  Fe(
3540
- w.filter((y) => y.isLangPageAdded),
3541
- (y) => /* @__PURE__ */ u(
3547
+ w.filter((p) => p.isLangPageAdded),
3548
+ (p) => /* @__PURE__ */ u(
3542
3549
  De,
3543
3550
  {
3544
- className: ei(
3551
+ className: ti(
3545
3552
  "flex cursor-pointer items-center justify-between text-xs font-medium text-gray-800",
3546
- y.key === a && "!bg-gray-200 text-gray-700"
3553
+ p.key === a && "!bg-gray-200 text-gray-700"
3547
3554
  ),
3548
- onClick: () => p(y.key),
3555
+ onClick: () => y(p.key),
3549
3556
  children: [
3550
- /* @__PURE__ */ r("div", { className: "text-slate-600", children: y.value }),
3551
- y.key === e && /* @__PURE__ */ u(
3557
+ /* @__PURE__ */ r("div", { className: "text-slate-600", children: p.value }),
3558
+ p.key === e && /* @__PURE__ */ u(
3552
3559
  "small",
3553
3560
  {
3554
3561
  className: "text-[9px] flex items-center gap-x-1 text-orange-500 leading-none",
3555
3562
  children: [
3556
- /* @__PURE__ */ r(Hi, { fill: "orange", className: "w-2 h-2" }),
3563
+ /* @__PURE__ */ r(Ki, { fill: "orange", className: "w-2 h-2" }),
3557
3564
  "Primary"
3558
3565
  ]
3559
3566
  }
3560
3567
  )
3561
3568
  ]
3562
3569
  },
3563
- y.value
3570
+ p.value
3564
3571
  )
3565
3572
  ),
3566
- !me(w.filter((y) => !y.isLangPageAdded)) && /* @__PURE__ */ u(be, { children: [
3567
- /* @__PURE__ */ r(gi, {}),
3573
+ !me(w.filter((p) => !p.isLangPageAdded)) && /* @__PURE__ */ u(be, { children: [
3574
+ /* @__PURE__ */ r(pi, {}),
3568
3575
  /* @__PURE__ */ u(
3569
- P,
3576
+ _,
3570
3577
  {
3571
3578
  size: "sm",
3572
3579
  variant: "ghost",
@@ -3581,7 +3588,7 @@ const no = ({
3581
3588
  },
3582
3589
  className: "hover:bg-slate-300 duration-200 font-normal text-xs hover:text-slate-800",
3583
3590
  children: [
3584
- /* @__PURE__ */ r(fs, { className: "w-3 h-3 mr-1" }),
3591
+ /* @__PURE__ */ r(gs, { className: "w-3 h-3 mr-1" }),
3585
3592
  " Add Langauge"
3586
3593
  ]
3587
3594
  }
@@ -3599,14 +3606,14 @@ const no = ({
3599
3606
  )
3600
3607
  ] });
3601
3608
  };
3602
- function uo() {
3609
+ function ho() {
3603
3610
  return /* @__PURE__ */ u("div", { className: "flex relative z-10 items-center justify-end gap-1", children: [
3604
- /* @__PURE__ */ r(lo, {}),
3605
3611
  /* @__PURE__ */ r(oo, {}),
3606
- /* @__PURE__ */ r(co, {})
3612
+ /* @__PURE__ */ r(co, {}),
3613
+ /* @__PURE__ */ r(uo, {})
3607
3614
  ] });
3608
3615
  }
3609
- function ho(e) {
3616
+ function mo(e) {
3610
3617
  const t = Q(), n = $();
3611
3618
  return Ne({
3612
3619
  queryKey: [ke, "revisions", e],
@@ -3619,7 +3626,7 @@ function ho(e) {
3619
3626
  staleTime: 0
3620
3627
  });
3621
3628
  }
3622
- const mo = () => {
3629
+ const fo = () => {
3623
3630
  const e = Q(), t = $(), n = Se();
3624
3631
  return Ae({
3625
3632
  mutationFn: async (s) => await t(e, {
@@ -3630,7 +3637,7 @@ const mo = () => {
3630
3637
  n.invalidateQueries({ queryKey: ["revisions"] });
3631
3638
  }
3632
3639
  });
3633
- }, fo = () => {
3640
+ }, go = () => {
3634
3641
  const e = Q(), t = $(), n = Se();
3635
3642
  return Ae({
3636
3643
  mutationFn: async ({
@@ -3645,20 +3652,20 @@ const mo = () => {
3645
3652
  }
3646
3653
  });
3647
3654
  };
3648
- function go() {
3649
- const { data: e } = Ue(), { saveState: t } = sr(), [n] = Es();
3655
+ function po() {
3656
+ const { data: e } = Re(), { saveState: t } = sr(), [n] = bs();
3650
3657
  return e ? /* @__PURE__ */ r("div", { className: "flex items-start gap-3 rounded-md border p-2 hover:bg-accent/50 bg-primary/5 mb-4", children: /* @__PURE__ */ u("div", { className: "flex-1 space-y-1", children: [
3651
3658
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r("p", { className: "text-sm flex items-center gap-1 font-medium leading-none", children: /* @__PURE__ */ r("span", { className: "font-bold", children: "Currently editing" }) }) }),
3652
3659
  /* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: !me(n.lastSaved) && /* @__PURE__ */ u("span", { children: [
3653
3660
  "Last updated",
3654
3661
  " ",
3655
- rl(new Date(n.lastSaved), {
3662
+ al(new Date(n.lastSaved), {
3656
3663
  addSuffix: !0
3657
3664
  })
3658
3665
  ] }) }),
3659
3666
  /* @__PURE__ */ u("div", { className: "flex items-center gap-2 pt-0.5", children: [
3660
3667
  /* @__PURE__ */ u("div", { className: "flex items-center gap-1 rounded-full bg-amber-500/10 px-1.5 py-0.5 text-xs text-amber-600", children: [
3661
- /* @__PURE__ */ r($i, { className: "h-3 w-3" }),
3668
+ /* @__PURE__ */ r(zi, { className: "h-3 w-3" }),
3662
3669
  /* @__PURE__ */ r("span", { children: "Draft" })
3663
3670
  ] }),
3664
3671
  t === "UNSAVED" ? /* @__PURE__ */ u("div", { className: "flex items-center gap-1 rounded-full bg-red-500/10 px-1.5 py-0.5 text-xs text-red-600", children: [
@@ -3668,27 +3675,27 @@ function go() {
3668
3675
  ] })
3669
3676
  ] }) }) : null;
3670
3677
  }
3671
- function po() {
3672
- const [e, t] = ce.useState(!1), [n, s] = ce.useState(null), [a, i] = ce.useState(!1), [l, o] = ce.useState(!1), { data: c } = Ue(), {
3678
+ function yo() {
3679
+ const [e, t] = ce.useState(!1), [n, s] = ce.useState(null), [a, i] = ce.useState(!1), [l, o] = ce.useState(!1), { data: c } = Re(), {
3673
3680
  data: h,
3674
3681
  isFetching: g,
3675
3682
  error: d,
3676
3683
  refetch: w
3677
- } = ho(c == null ? void 0 : c.id), { mutate: p, isPending: y } = mo(), { mutate: S, isPending: v } = fo(), x = Se(), R = (G) => {
3684
+ } = mo(c == null ? void 0 : c.id), { mutate: y, isPending: p } = fo(), { mutate: S, isPending: v } = go(), x = Se(), G = (U) => {
3678
3685
  n && S(
3679
- { revisionId: n.uid, discardCurrent: G },
3686
+ { revisionId: n.uid, discardCurrent: U },
3680
3687
  {
3681
3688
  onSuccess: () => {
3682
3689
  i(!1), s(null), x.invalidateQueries({ queryKey: [I.GET_DRAFT_PAGE] });
3683
3690
  }
3684
3691
  }
3685
3692
  );
3686
- }, E = (G) => {
3687
- s(G), i(!0);
3688
- }, b = (G) => {
3689
- s(G), o(!0);
3693
+ }, E = (U) => {
3694
+ s(U), i(!0);
3695
+ }, b = (U) => {
3696
+ s(U), o(!0);
3690
3697
  }, T = () => {
3691
- n && p(n.uid, {
3698
+ n && y(n.uid, {
3692
3699
  onSuccess: () => {
3693
3700
  o(!1), s(null);
3694
3701
  }
@@ -3697,11 +3704,11 @@ function po() {
3697
3704
  return we(() => {
3698
3705
  e && w();
3699
3706
  }, [e, w]), /* @__PURE__ */ u(be, { children: [
3700
- /* @__PURE__ */ r(wr, { children: /* @__PURE__ */ u(ds, { children: [
3707
+ /* @__PURE__ */ r(wr, { children: /* @__PURE__ */ u(hs, { children: [
3701
3708
  /* @__PURE__ */ u(yr, { open: e, onOpenChange: t, children: [
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: [
3704
- /* @__PURE__ */ r(Gs, { className: "h-4 w-4" }),
3709
+ /* @__PURE__ */ r(yi, { asChild: !0, children: /* @__PURE__ */ r(ms, { asChild: !0, children: /* @__PURE__ */ u("span", { className: "flex items-center gap-2", children: [
3710
+ /* @__PURE__ */ u(_, { variant: "ghost", size: "icon", className: "h-8 w-8", children: [
3711
+ /* @__PURE__ */ r(Us, { className: "h-4 w-4" }),
3705
3712
  /* @__PURE__ */ r("span", { className: "sr-only", children: "View revision history" })
3706
3713
  ] }),
3707
3714
  /* @__PURE__ */ r("div", { className: "w-px h-4 bg-gray-200 dark:bg-gray-700" })
@@ -3709,58 +3716,58 @@ function po() {
3709
3716
  /* @__PURE__ */ u(vr, { className: "sm:max-w-md p-4", children: [
3710
3717
  /* @__PURE__ */ u(Er, { className: "pb-2", children: [
3711
3718
  /* @__PURE__ */ u(br, { className: "flex items-center gap-2", children: [
3712
- /* @__PURE__ */ r(Gs, { className: "h-5 w-5" }),
3719
+ /* @__PURE__ */ r(Us, { className: "h-5 w-5" }),
3713
3720
  "Revision History"
3714
3721
  ] }),
3715
3722
  (c == null ? void 0 : c.createdAt) && /* @__PURE__ */ u("p", { className: "text-xs text-muted-foreground mt-1", children: [
3716
3723
  "Page created on",
3717
3724
  " ",
3718
- Dn(
3725
+ Gn(
3719
3726
  new Date(c.createdAt),
3720
3727
  "MMM d, yyyy 'at' h:mm a"
3721
3728
  )
3722
3729
  ] })
3723
3730
  ] }),
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
- /* @__PURE__ */ r(go, {}),
3726
- h == null ? void 0 : h.map((G) => /* @__PURE__ */ r(
3727
- vo,
3731
+ /* @__PURE__ */ r(vi, { className: "h-[calc(100vh-6rem)] pr-2", children: g ? /* @__PURE__ */ r(vo, {}) : 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: [
3732
+ /* @__PURE__ */ r(po, {}),
3733
+ h == null ? void 0 : h.map((U) => /* @__PURE__ */ r(
3734
+ Eo,
3728
3735
  {
3729
- revision: G,
3730
- isLatest: G.uid === "current",
3731
- onRestore: () => E(G),
3732
- onDelete: () => b(G)
3736
+ revision: U,
3737
+ isLatest: U.uid === "current",
3738
+ onRestore: () => E(U),
3739
+ onDelete: () => b(U)
3733
3740
  },
3734
- G.uid
3741
+ U.uid
3735
3742
  ))
3736
3743
  ] }) })
3737
3744
  ] })
3738
3745
  ] }),
3739
- /* @__PURE__ */ r(ms, { side: "bottom", children: /* @__PURE__ */ r("p", { children: "Revision history" }) })
3746
+ /* @__PURE__ */ r(fs, { side: "bottom", children: /* @__PURE__ */ r("p", { children: "Revision history" }) })
3740
3747
  ] }) }),
3741
3748
  /* @__PURE__ */ r(
3742
- bo,
3749
+ wo,
3743
3750
  {
3744
3751
  open: a,
3745
3752
  onOpenChange: i,
3746
3753
  revision: n,
3747
- onRestore: R,
3754
+ onRestore: G,
3748
3755
  isRestoring: v
3749
3756
  }
3750
3757
  ),
3751
3758
  /* @__PURE__ */ r(
3752
- wo,
3759
+ So,
3753
3760
  {
3754
3761
  open: l,
3755
3762
  onOpenChange: o,
3756
3763
  revision: n,
3757
3764
  onDelete: T,
3758
- isDeleting: y
3765
+ isDeleting: p
3759
3766
  }
3760
3767
  )
3761
3768
  ] });
3762
3769
  }
3763
- function yo() {
3770
+ function vo() {
3764
3771
  return /* @__PURE__ */ r("div", { className: "space-y-2 mt-2", children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ u("div", { className: "flex items-start gap-3 rounded-md border p-2", children: [
3765
3772
  /* @__PURE__ */ u("div", { className: "flex-1 space-y-1", children: [
3766
3773
  /* @__PURE__ */ r(fn, { className: "h-4 w-3/4" }),
@@ -3770,7 +3777,7 @@ function yo() {
3770
3777
  /* @__PURE__ */ r(fn, { className: "h-8 w-8 rounded-full" })
3771
3778
  ] }, t)) });
3772
3779
  }
3773
- function vo({
3780
+ function Eo({
3774
3781
  revision: e,
3775
3782
  isLatest: t,
3776
3783
  onRestore: n,
@@ -3791,12 +3798,12 @@ function vo({
3791
3798
  "Live"
3792
3799
  ] })
3793
3800
  ] }) }),
3794
- /* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: /* @__PURE__ */ r("span", { children: Dn(e.createdAt, "MMM d, h:mm a") }) }),
3801
+ /* @__PURE__ */ r("div", { className: "flex items-center text-xs text-muted-foreground", children: /* @__PURE__ */ r("span", { children: Gn(e.createdAt, "MMM d, h:mm a") }) }),
3795
3802
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2 pt-0.5", children: e.type === "published" ? /* @__PURE__ */ u("div", { className: "flex items-center gap-1 rounded-full bg-green-500/10 px-1.5 py-0.5 text-xs text-green-600", children: [
3796
- /* @__PURE__ */ r(Ki, { className: "h-3 w-3" }),
3803
+ /* @__PURE__ */ r(Vi, { className: "h-3 w-3" }),
3797
3804
  /* @__PURE__ */ r("span", { children: "Published" })
3798
3805
  ] }) : /* @__PURE__ */ u("div", { className: "flex items-center gap-1 rounded-full bg-amber-500/10 px-1.5 py-0.5 text-xs text-amber-600", children: [
3799
- /* @__PURE__ */ r(Vi, { className: "h-3 w-3" }),
3806
+ /* @__PURE__ */ r(ji, { className: "h-3 w-3" }),
3800
3807
  /* @__PURE__ */ r("span", { children: "Draft" })
3801
3808
  ] }) })
3802
3809
  ] }),
@@ -3808,7 +3815,7 @@ function vo({
3808
3815
  ue.DELETE_REVISION
3809
3816
  ],
3810
3817
  children: /* @__PURE__ */ r(
3811
- Eo,
3818
+ bo,
3812
3819
  {
3813
3820
  revision: e,
3814
3821
  onRestore: n,
@@ -3819,14 +3826,14 @@ function vo({
3819
3826
  )
3820
3827
  ] });
3821
3828
  }
3822
- function Eo({
3829
+ function bo({
3823
3830
  revision: e,
3824
3831
  onRestore: t,
3825
3832
  onDelete: n
3826
3833
  }) {
3827
3834
  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: [
3829
- /* @__PURE__ */ r(gs, { className: "h-4 w-4" }),
3835
+ /* @__PURE__ */ r(an, { asChild: !0, children: /* @__PURE__ */ u(_, { variant: "ghost", size: "icon", className: "h-7 w-7 -mr-1", children: [
3836
+ /* @__PURE__ */ r(ps, { className: "h-4 w-4" }),
3830
3837
  /* @__PURE__ */ r("span", { className: "sr-only", children: "More options" })
3831
3838
  ] }) }),
3832
3839
  /* @__PURE__ */ u(ln, { align: "end", className: "text-xs", children: [
@@ -3835,14 +3842,14 @@ function Eo({
3835
3842
  /* @__PURE__ */ r("span", { children: "Restore this version" })
3836
3843
  ] }) }),
3837
3844
  /* @__PURE__ */ r(Oe, { permission: ue.DELETE_REVISION, children: e.uid !== "current" && /* @__PURE__ */ u(be, { children: [
3838
- /* @__PURE__ */ r(vi, {}),
3845
+ /* @__PURE__ */ r(Ei, {}),
3839
3846
  /* @__PURE__ */ u(
3840
3847
  De,
3841
3848
  {
3842
3849
  onClick: n,
3843
3850
  className: "cursor-pointer text-destructive",
3844
3851
  children: [
3845
- /* @__PURE__ */ r(ps, { className: "mr-2 h-4 w-4" }),
3852
+ /* @__PURE__ */ r(ys, { className: "mr-2 h-4 w-4" }),
3846
3853
  /* @__PURE__ */ r("span", { children: "Delete this version" })
3847
3854
  ]
3848
3855
  }
@@ -3851,7 +3858,7 @@ function Eo({
3851
3858
  ] })
3852
3859
  ] });
3853
3860
  }
3854
- function bo({
3861
+ function wo({
3855
3862
  open: e,
3856
3863
  onOpenChange: t,
3857
3864
  revision: n,
@@ -3874,7 +3881,7 @@ function bo({
3874
3881
  n.uid.substring(0, 8),
3875
3882
  " ",
3876
3883
  "from ",
3877
- Dn(n.createdAt, "MMM d, yyyy 'at' h:mm a"),
3884
+ Gn(n.createdAt, "MMM d, yyyy 'at' h:mm a"),
3878
3885
  " by",
3879
3886
  " ",
3880
3887
  l
@@ -3883,7 +3890,7 @@ function bo({
3883
3890
  /* @__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
3891
  /* @__PURE__ */ u(et, { className: "flex flex-col sm:flex-row gap-2", children: [
3885
3892
  /* @__PURE__ */ r(
3886
- P,
3893
+ _,
3887
3894
  {
3888
3895
  variant: "outline",
3889
3896
  className: "sm:flex-1",
@@ -3893,13 +3900,13 @@ function bo({
3893
3900
  /* @__PURE__ */ r("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
3894
3901
  "Saving as draft..."
3895
3902
  ] }) : /* @__PURE__ */ u(be, { children: [
3896
- /* @__PURE__ */ r(ji, { className: "mr-2 h-4 w-4" }),
3903
+ /* @__PURE__ */ r($i, { className: "mr-2 h-4 w-4" }),
3897
3904
  "Save as draft"
3898
3905
  ] })
3899
3906
  }
3900
3907
  ),
3901
3908
  /* @__PURE__ */ r(
3902
- P,
3909
+ _,
3903
3910
  {
3904
3911
  variant: "default",
3905
3912
  className: "sm:flex-1",
@@ -3919,7 +3926,7 @@ function bo({
3919
3926
  }
3920
3927
  ) : null;
3921
3928
  }
3922
- function wo({
3929
+ function So({
3923
3930
  open: e,
3924
3931
  onOpenChange: t,
3925
3932
  revision: n,
@@ -3942,7 +3949,7 @@ function wo({
3942
3949
  n.uid.substring(0, 8),
3943
3950
  " from",
3944
3951
  " ",
3945
- Dn(n.createdAt, "MMM d, yyyy 'at' h:mm a"),
3952
+ Gn(n.createdAt, "MMM d, yyyy 'at' h:mm a"),
3946
3953
  " by",
3947
3954
  " ",
3948
3955
  l
@@ -3951,7 +3958,7 @@ function wo({
3951
3958
  /* @__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
3959
  /* @__PURE__ */ u(et, { className: "flex flex-col sm:flex-row gap-2", children: [
3953
3960
  /* @__PURE__ */ r(
3954
- P,
3961
+ _,
3955
3962
  {
3956
3963
  variant: "outline",
3957
3964
  className: "sm:flex-1",
@@ -3961,7 +3968,7 @@ function wo({
3961
3968
  }
3962
3969
  ),
3963
3970
  /* @__PURE__ */ r(
3964
- P,
3971
+ _,
3965
3972
  {
3966
3973
  variant: "destructive",
3967
3974
  className: "sm:flex-1",
@@ -3971,7 +3978,7 @@ function wo({
3971
3978
  /* @__PURE__ */ r("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
3972
3979
  "Deleting..."
3973
3980
  ] }) : /* @__PURE__ */ u(be, { children: [
3974
- /* @__PURE__ */ r(ps, { className: "mr-2 h-4 w-4" }),
3981
+ /* @__PURE__ */ r(ys, { className: "mr-2 h-4 w-4" }),
3975
3982
  "Delete Revision"
3976
3983
  ] })
3977
3984
  }
@@ -3981,21 +3988,21 @@ function wo({
3981
3988
  }
3982
3989
  ) : null;
3983
3990
  }
3984
- const So = () => {
3991
+ const No = () => {
3985
3992
  const e = Q(), t = $();
3986
3993
  return Ne({
3987
3994
  queryKey: [ke, I.GET_CHANGES],
3988
3995
  queryFn: async () => t(e, { action: I.GET_CHANGES })
3989
3996
  });
3990
- }, No = ({ currentEditor: e }) => {
3997
+ }, Ao = ({ currentEditor: e }) => {
3991
3998
  const { data: t } = dn(e);
3992
3999
  return t == null ? void 0 : t.name;
3993
4000
  };
3994
- function Ao({
4001
+ function xo({
3995
4002
  showModal: e = !1,
3996
4003
  onClose: t = () => console.log("Cancelled")
3997
4004
  }) {
3998
- const [n, s] = _([]), { data: a, isFetching: i } = So(), { data: l } = Ie(), o = _e(
4005
+ const [n, s] = P([]), { data: a, isFetching: i } = No(), { data: l } = Ie(), o = _e(
3999
4006
  (b) => {
4000
4007
  var T;
4001
4008
  return (T = fe(l, { key: b })) == null ? void 0 : T.hasSlug;
@@ -4015,27 +4022,27 @@ function Ao({
4015
4022
  ), d = Y(
4016
4023
  () => fe(a, { pageType: "theme", id: "THEME" }),
4017
4024
  [a]
4018
- ), { mutate: w, isPending: p } = ws();
4025
+ ), { mutate: w, isPending: y } = Ss();
4019
4026
  we(() => {
4020
4027
  const b = Fe(Te(a, { online: !0 }), "id");
4021
4028
  d && b.push(d == null ? void 0 : d.id), s(b);
4022
4029
  }, [a, d]);
4023
- const y = n.length === (a == null ? void 0 : a.length), S = (b) => {
4030
+ const p = n.length === (a == null ? void 0 : a.length), S = (b) => {
4024
4031
  s(
4025
- (T) => Mt(T, b) ? Te(T, (G) => G !== b) : Xs(T, b)
4032
+ (T) => Mt(T, b) ? Te(T, (U) => U !== b) : Xs(T, b)
4026
4033
  );
4027
4034
  }, v = () => {
4028
- s(y ? [] : Fe(a, "id"));
4035
+ s(p ? [] : Fe(a, "id"));
4029
4036
  }, x = () => {
4030
4037
  w(
4031
4038
  { ids: Ha(n) },
4032
4039
  {
4033
4040
  onSuccess: () => {
4034
- t(), xn("CENTER_CENTER");
4041
+ t(), Tn("CENTER_CENTER");
4035
4042
  }
4036
4043
  }
4037
4044
  );
4038
- }, R = (b) => {
4045
+ }, G = (b) => {
4039
4046
  if (b === "theme") return "Theme";
4040
4047
  const T = fe(l, { key: b });
4041
4048
  return T ? T == null ? void 0 : T.name : b;
@@ -4048,10 +4055,10 @@ function Ao({
4048
4055
  { label: "Offline", top: "pt-6" },
4049
4056
  ...mn(Te(h, { online: !1 }), "pageType"),
4050
4057
  ...mn(Te(g, { online: !1 }), "pageType")
4051
- ], G = d ? [{ label: "Theme", top: "pt-6" }, d] : [];
4052
- return [...b, ...G, ...T];
4058
+ ], U = d ? [{ label: "Theme", top: "pt-6" }, d] : [];
4059
+ return [...b, ...U, ...T];
4053
4060
  }, [h, g, d]);
4054
- return /* @__PURE__ */ r(He, { open: e, onOpenChange: p ? () => {
4061
+ return /* @__PURE__ */ r(He, { open: e, onOpenChange: y ? () => {
4055
4062
  } : t, children: /* @__PURE__ */ u(Ke, { className: "max-w-4xl max-h-[80%] flex flex-col", children: [
4056
4063
  /* @__PURE__ */ u(Ve, { children: [
4057
4064
  /* @__PURE__ */ r(je, { children: "Publish changes" }),
@@ -4073,7 +4080,7 @@ function Ao({
4073
4080
  /* @__PURE__ */ r(
4074
4081
  "input",
4075
4082
  {
4076
- checked: y,
4083
+ checked: p,
4077
4084
  onClick: (b) => {
4078
4085
  b.stopPropagation(), v();
4079
4086
  },
@@ -4124,7 +4131,7 @@ function Ao({
4124
4131
  }
4125
4132
  ),
4126
4133
  " ",
4127
- o(b.pageType) ? /* @__PURE__ */ r(on, { className: "w-4 h-4" }) : /* @__PURE__ */ r(zi, { className: "w-4 h-4" }),
4134
+ o(b.pageType) ? /* @__PURE__ */ r(on, { className: "w-4 h-4" }) : /* @__PURE__ */ r(Wi, { className: "w-4 h-4" }),
4128
4135
  b.name,
4129
4136
  b.slug && /* @__PURE__ */ u("span", { className: "text-xs text-gray-500", children: [
4130
4137
  "(",
@@ -4136,7 +4143,7 @@ function Ao({
4136
4143
  "-",
4137
4144
  " ",
4138
4145
  /* @__PURE__ */ r(
4139
- No,
4146
+ Ao,
4140
4147
  {
4141
4148
  currentEditor: b.currentEditor
4142
4149
  }
@@ -4148,7 +4155,7 @@ function Ao({
4148
4155
  }
4149
4156
  ),
4150
4157
  /* @__PURE__ */ r("td", { className: "px-2", children: b.lang }),
4151
- /* @__PURE__ */ r("td", { className: "px-2", children: R(b == null ? void 0 : b.pageType) }),
4158
+ /* @__PURE__ */ r("td", { className: "px-2", children: G(b == null ? void 0 : b.pageType) }),
4152
4159
  /* @__PURE__ */ r("td", { className: "px-4 text-right", children: qa(b.changes) || "" })
4153
4160
  ]
4154
4161
  },
@@ -4157,19 +4164,19 @@ function Ao({
4157
4164
  ) })
4158
4165
  ] }) }),
4159
4166
  /* @__PURE__ */ u(et, { className: "mt-10", children: [
4160
- /* @__PURE__ */ r(P, { disabled: p, variant: "outline", onClick: t, children: "Cancel" }),
4167
+ /* @__PURE__ */ r(_, { disabled: y, variant: "outline", onClick: t, children: "Cancel" }),
4161
4168
  /* @__PURE__ */ r(
4162
- P,
4169
+ _,
4163
4170
  {
4164
- disabled: p || i || me(a),
4171
+ disabled: y || i || me(a),
4165
4172
  onClick: x,
4166
- children: p ? "Publishing..." : "Publish"
4173
+ children: y ? "Publishing..." : "Publish"
4167
4174
  }
4168
4175
  )
4169
4176
  ] })
4170
4177
  ] }) });
4171
4178
  }
4172
- const xo = () => {
4179
+ const To = () => {
4173
4180
  const e = $(), t = Q();
4174
4181
  return Ne({
4175
4182
  queryKey: [I.GET_WEBSITE_DATA],
@@ -4180,8 +4187,8 @@ const xo = () => {
4180
4187
  })
4181
4188
  });
4182
4189
  };
4183
- function To({ onClose: e }) {
4184
- const { data: t, isFetching: n } = xo(), { mutateAsync: s, isPending: a } = vl(), i = dt("settingComponent", null), l = Ka(async (o) => (await s({ data: o }), !0), 300);
4190
+ function Co({ onClose: e }) {
4191
+ const { data: t, isFetching: n } = To(), { mutateAsync: s, isPending: a } = El(), i = dt("settingComponent", null), l = Ka(async (o) => (await s({ data: o }), !0), 300);
4185
4192
  return i ? /* @__PURE__ */ r(He, { open: !0, onOpenChange: e, children: /* @__PURE__ */ u(Ke, { className: "w-full", children: [
4186
4193
  /* @__PURE__ */ r(Ve, { children: /* @__PURE__ */ r(je, { children: "Website Settings" }) }),
4187
4194
  n ? /* @__PURE__ */ u("div", { className: "w-full space-y-3 py-4", children: [
@@ -4204,13 +4211,13 @@ function Kr({
4204
4211
  children: e,
4205
4212
  content: t
4206
4213
  }) {
4207
- return /* @__PURE__ */ r(wr, { children: /* @__PURE__ */ u(ds, { children: [
4208
- /* @__PURE__ */ r(hs, { asChild: !0, children: e }),
4209
- /* @__PURE__ */ r(ms, { side: "bottom", sideOffset: 10, children: /* @__PURE__ */ r("p", { children: t }) })
4214
+ return /* @__PURE__ */ r(wr, { children: /* @__PURE__ */ u(hs, { children: [
4215
+ /* @__PURE__ */ r(ms, { asChild: !0, children: e }),
4216
+ /* @__PURE__ */ r(fs, { side: "bottom", sideOffset: 10, children: /* @__PURE__ */ r("p", { children: t }) })
4210
4217
  ] }) });
4211
4218
  }
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(
4219
+ const Po = () => {
4220
+ const { selectedLang: e } = ut(), t = dt("getPreviewUrl", async (g) => g), [n, s] = P(""), { data: a, isFetching: i } = Re(), { data: l } = cn(), { data: o } = Ie(), c = Y(
4214
4221
  () => {
4215
4222
  var g;
4216
4223
  return (g = l == null ? void 0 : l.find((d) => (d == null ? void 0 : d.lang) === e)) == null ? void 0 : g.slug;
@@ -4231,28 +4238,28 @@ const Co = () => {
4231
4238
  } else
4232
4239
  s("");
4233
4240
  })();
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: [
4241
+ }, [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
4242
  /* @__PURE__ */ r(Lr, { className: "w-4 h-4" }),
4236
4243
  " ",
4237
4244
  B.PREVIEW
4238
4245
  ] }) }) });
4239
- }, Po = () => {
4240
- const [e, t] = ti();
4246
+ }, _o = () => {
4247
+ const [e, t] = ni();
4241
4248
  return /* @__PURE__ */ u(be, { children: [
4242
4249
  /* @__PURE__ */ r(Kr, { content: B.THEME, children: /* @__PURE__ */ r(
4243
- P,
4250
+ _,
4244
4251
  {
4245
4252
  variant: e === "theme" ? "outline" : "ghost",
4246
4253
  size: "icon",
4247
4254
  className: "gap-2",
4248
4255
  onClick: () => t(e === "theme" ? "block" : "theme"),
4249
- children: /* @__PURE__ */ r(Wi, { className: "w-4 h-4" })
4256
+ children: /* @__PURE__ */ r(Yi, { className: "w-4 h-4" })
4250
4257
  }
4251
4258
  ) }),
4252
4259
  /* @__PURE__ */ r("div", { className: "w-px h-4 bg-gray-200 dark:bg-gray-700" })
4253
4260
  ] });
4254
- }, _o = () => {
4255
- const [e, t] = _(!1), { isLocked: n } = hn(), { savePage: s, saveState: a } = sr();
4261
+ }, Io = () => {
4262
+ const [e, t] = P(!1), { isLocked: n } = hn(), { savePage: s, saveState: a } = sr();
4256
4263
  we(() => {
4257
4264
  const g = (d) => {
4258
4265
  a === "UNSAVED" && (d.preventDefault(), d.returnValue = !1);
@@ -4287,13 +4294,13 @@ const Co = () => {
4287
4294
  case "SAVED":
4288
4295
  return {
4289
4296
  tooltipContent: B.SAVED,
4290
- buttonIcon: /* @__PURE__ */ r(Yi, { className: "w-4 h-4" }),
4297
+ buttonIcon: /* @__PURE__ */ r(Qi, { className: "w-4 h-4" }),
4291
4298
  buttonClass: "text-green-500 flex items-center gap-x-1 leading-tight"
4292
4299
  };
4293
4300
  }
4294
4301
  }, [l]);
4295
4302
  return n ? null : /* @__PURE__ */ u(
4296
- P,
4303
+ _,
4297
4304
  {
4298
4305
  size: "sm",
4299
4306
  variant: "ghost",
@@ -4306,27 +4313,27 @@ const Co = () => {
4306
4313
  ]
4307
4314
  }
4308
4315
  );
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);
4316
+ }, ko = () => {
4317
+ const [e, t] = P(!1), [n, s] = P(!1), [a, i] = P(null), { data: l } = Re(), { mutate: o, isPending: c } = Ss(), [h] = si(), { buttonText: g, buttonClassName: d, isPublished: w } = Y(() => {
4318
+ const p = l && (l == null ? void 0 : l.online);
4312
4319
  return {
4313
- buttonClassName: y ? "hover:bg-green-600 bg-green-500" : "",
4314
- isPublished: y,
4315
- buttonText: y ? B.PUBLISHED : B.PUBLISH
4320
+ buttonClassName: p ? "hover:bg-green-600 bg-green-500" : "",
4321
+ isPublished: p,
4322
+ buttonText: p ? B.PUBLISHED : B.PUBLISH
4316
4323
  };
4317
4324
  }, [l]);
4318
4325
  return /* @__PURE__ */ u(be, { children: [
4319
4326
  /* @__PURE__ */ u("div", { className: "flex", children: [
4320
4327
  /* @__PURE__ */ u(
4321
- P,
4328
+ _,
4322
4329
  {
4323
4330
  size: "sm",
4324
4331
  onClick: async () => {
4325
4332
  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")) || [];
4333
+ 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
4334
  o(
4328
- { ids: [l == null ? void 0 : l.id, ...y] },
4329
- { onSuccess: () => xn("TOP_RIGHT") }
4335
+ { ids: [l == null ? void 0 : l.id, ...p] },
4336
+ { onSuccess: () => Tn("TOP_RIGHT") }
4330
4337
  );
4331
4338
  },
4332
4339
  disabled: c || !(l != null && l.id),
@@ -4338,14 +4345,14 @@ const Co = () => {
4338
4345
  "span",
4339
4346
  {
4340
4347
  className: `flex items-center transition-transform duration-300 ease-in-out ${n ? "-translate-y-10" : ""}`,
4341
- children: w ? /* @__PURE__ */ r(Rs, { className: "w-4 h-4" }) : /* @__PURE__ */ r(Us, { className: "w-4 h-4" })
4348
+ children: w ? /* @__PURE__ */ r(Rs, { className: "w-4 h-4" }) : /* @__PURE__ */ r(Os, { className: "w-4 h-4" })
4342
4349
  }
4343
4350
  ),
4344
4351
  /* @__PURE__ */ r(
4345
4352
  "span",
4346
4353
  {
4347
4354
  className: `absolute inset-0 flex items-center left-3 transition-transform duration-300 ease-in-out ${n ? "" : "translate-y-10"}`,
4348
- children: w ? /* @__PURE__ */ r(Us, { className: "w-4 h-4" }) : /* @__PURE__ */ r(Rs, { className: "w-4 h-4" })
4355
+ children: w ? /* @__PURE__ */ r(Os, { className: "w-4 h-4" }) : /* @__PURE__ */ r(Rs, { className: "w-4 h-4" })
4349
4356
  }
4350
4357
  ),
4351
4358
  /* @__PURE__ */ r("span", { children: g })
@@ -4354,7 +4361,7 @@ const Co = () => {
4354
4361
  ),
4355
4362
  /* @__PURE__ */ u(rn, { children: [
4356
4363
  /* @__PURE__ */ r(an, { asChild: !0, children: /* @__PURE__ */ r(
4357
- P,
4364
+ _,
4358
4365
  {
4359
4366
  size: "sm",
4360
4367
  disabled: c || !(l != null && l.id),
@@ -4370,7 +4377,7 @@ const Co = () => {
4370
4377
  className: "text-xs cursor-pointer",
4371
4378
  onClick: () => o(
4372
4379
  { ids: [l == null ? void 0 : l.id] },
4373
- { onSuccess: () => xn("TOP_RIGHT") }
4380
+ { onSuccess: () => Tn("TOP_RIGHT") }
4374
4381
  ),
4375
4382
  children: [
4376
4383
  B.PUBLISH,
@@ -4403,33 +4410,33 @@ const Co = () => {
4403
4410
  ] })
4404
4411
  ] })
4405
4412
  ] }),
4406
- /* @__PURE__ */ r(Ao, { showModal: e, onClose: () => t(!1) }),
4413
+ /* @__PURE__ */ r(xo, { showModal: e, onClose: () => t(!1) }),
4407
4414
  a && /* @__PURE__ */ r(
4408
- Ns,
4415
+ As,
4409
4416
  {
4410
4417
  page: a,
4411
4418
  onClose: () => i(null)
4412
4419
  }
4413
4420
  )
4414
4421
  ] });
4415
- }, ko = () => {
4416
- const e = dt("settingComponent", null), [t, n] = _(!1);
4422
+ }, Lo = () => {
4423
+ const e = dt("settingComponent", null), [t, n] = P(!1);
4417
4424
  return e ? /* @__PURE__ */ u(be, { children: [
4418
4425
  /* @__PURE__ */ r(Kr, { content: B.WEBSITEDATA, children: /* @__PURE__ */ r(
4419
- P,
4426
+ _,
4420
4427
  {
4421
4428
  variant: "ghost",
4422
4429
  size: "icon",
4423
4430
  className: "gap-2",
4424
4431
  onClick: () => n(!0),
4425
- children: /* @__PURE__ */ r(Qi, { className: "w-4 h-4" })
4432
+ children: /* @__PURE__ */ r(Xi, { className: "w-4 h-4" })
4426
4433
  }
4427
4434
  ) }),
4428
- t && /* @__PURE__ */ r(To, { onClose: () => n(!1) }),
4435
+ t && /* @__PURE__ */ r(Co, { onClose: () => n(!1) }),
4429
4436
  /* @__PURE__ */ r("div", { className: "w-px h-4 bg-gray-200 dark:bg-gray-700" })
4430
4437
  ] }) : null;
4431
- }, Lo = () => {
4432
- const { data: e } = Ue(), t = e && (e == null ? void 0 : e.online), { data: n } = Ie();
4438
+ }, Do = () => {
4439
+ const { data: e } = Re(), t = e && (e == null ? void 0 : e.online), { data: n } = Ie();
4433
4440
  return _e(
4434
4441
  (a) => {
4435
4442
  var i;
@@ -4437,7 +4444,7 @@ const Co = () => {
4437
4444
  },
4438
4445
  [n]
4439
4446
  )(e == null ? void 0 : e.pageType) ? /* @__PURE__ */ u(
4440
- P,
4447
+ _,
4441
4448
  {
4442
4449
  onClick: () => t && window.open(`${window.location.origin}${e.slug}`, "_blank"),
4443
4450
  disabled: !t,
@@ -4445,29 +4452,29 @@ const Co = () => {
4445
4452
  size: "sm",
4446
4453
  className: "flex items-center gap-1",
4447
4454
  children: [
4448
- /* @__PURE__ */ r(Xi, { className: "w-4 h-4" }),
4455
+ /* @__PURE__ */ r(Zi, { className: "w-4 h-4" }),
4449
4456
  /* @__PURE__ */ r("span", { className: "hidden sm:inline", children: B.OPEN })
4450
4457
  ]
4451
4458
  }
4452
4459
  ) : null;
4453
4460
  };
4454
- function Do() {
4455
- const { isLocked: e } = hn(), [t] = Re(), n = t.get("lang"), s = Or(n);
4461
+ function Go() {
4462
+ const { isLocked: e } = hn(), [t] = Ue(), n = t.get("lang"), s = Or(n);
4456
4463
  return e || !s ? null : /* @__PURE__ */ u("div", { className: "flex items-center justify-end gap-1", children: [
4457
- /* @__PURE__ */ r(po, {}),
4458
- /* @__PURE__ */ r(Oe, { permission: ue.EDIT_THEME, children: /* @__PURE__ */ r(Po, {}) }),
4459
- /* @__PURE__ */ r(Oe, { permission: ue.EDIT_SETTINGS, children: /* @__PURE__ */ r(ko, {}) }),
4460
- /* @__PURE__ */ r(Co, {}),
4461
- /* @__PURE__ */ r(Oe, { permission: ue.SAVE_PAGE, children: /* @__PURE__ */ r(_o, {}) }),
4462
- /* @__PURE__ */ r(Oe, { permission: ue.PUBLISH_PAGE, children: /* @__PURE__ */ r(Io, {}) }),
4463
- /* @__PURE__ */ r(Lo, {})
4464
+ /* @__PURE__ */ r(yo, {}),
4465
+ /* @__PURE__ */ r(Oe, { permission: ue.EDIT_THEME, children: /* @__PURE__ */ r(_o, {}) }),
4466
+ /* @__PURE__ */ r(Oe, { permission: ue.EDIT_SETTINGS, children: /* @__PURE__ */ r(Lo, {}) }),
4467
+ /* @__PURE__ */ r(Po, {}),
4468
+ /* @__PURE__ */ r(Oe, { permission: ue.SAVE_PAGE, children: /* @__PURE__ */ r(Io, {}) }),
4469
+ /* @__PURE__ */ r(Oe, { permission: ue.PUBLISH_PAGE, children: /* @__PURE__ */ r(ko, {}) }),
4470
+ /* @__PURE__ */ r(Do, {})
4464
4471
  ] });
4465
4472
  }
4466
- const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-center justify-between w-full", children: [
4467
- /* @__PURE__ */ r(uo, {}),
4468
- /* @__PURE__ */ r(Do, {})
4473
+ const Uo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-center justify-between w-full", children: [
4474
+ /* @__PURE__ */ r(ho, {}),
4475
+ /* @__PURE__ */ r(Go, {})
4469
4476
  ] }), Ro = () => {
4470
- const e = Q(), { aiContext: t } = vs(), n = $();
4477
+ const e = Q(), { aiContext: t } = Es(), n = $();
4471
4478
  return _e(
4472
4479
  async (s, a, i, l) => n(e, {
4473
4480
  action: I.ASK_AI,
@@ -4475,9 +4482,9 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4475
4482
  }),
4476
4483
  [e, t, n]
4477
4484
  );
4478
- }, Uo = (e, t) => t.map((n) => {
4485
+ }, Oo = (e, t) => t.map((n) => {
4479
4486
  if (nn(e, n._type)) {
4480
- const s = il(n._type);
4487
+ const s = ll(n._type);
4481
4488
  return {
4482
4489
  ...s,
4483
4490
  ...Js(n, [
@@ -4493,17 +4500,17 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4493
4500
  };
4494
4501
  }
4495
4502
  return n;
4496
- }), Oo = (e) => {
4497
- const t = al();
4503
+ }), Bo = (e) => {
4504
+ const t = il();
4498
4505
  return Y(() => {
4499
4506
  if (!e || me(e)) return { blocks: [] };
4500
4507
  const n = Te(
4501
4508
  e,
4502
4509
  (s) => !Mt(s == null ? void 0 : s._type, "@chai/")
4503
4510
  );
4504
- return { blocks: Uo(t, n) };
4511
+ return { blocks: Oo(t, n) };
4505
4512
  }, [e, t]);
4506
- }, Bo = () => {
4513
+ }, Mo = () => {
4507
4514
  const e = Q(), t = $();
4508
4515
  return Ne({
4509
4516
  queryKey: [ke, "uiLibraries"],
@@ -4512,8 +4519,8 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4512
4519
  ...s
4513
4520
  }))
4514
4521
  });
4515
- }, Mo = () => {
4516
- const e = Gn(), t = $(), { user: n } = st(), s = n == null ? void 0 : n.id;
4522
+ }, Fo = () => {
4523
+ const e = Un(), t = $(), { user: n } = st(), s = n == null ? void 0 : n.id;
4517
4524
  return Ne({
4518
4525
  queryKey: [ke, "permissions", s],
4519
4526
  queryFn: () => t(e, {
@@ -4522,14 +4529,14 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4522
4529
  }),
4523
4530
  enabled: !!s
4524
4531
  });
4525
- }, Fo = () => {
4526
- const e = Q(), t = $(), { setCurrentEditor: n } = hn(), [, s] = Es();
4532
+ }, qo = () => {
4533
+ const e = Q(), t = $(), { setCurrentEditor: n } = hn(), [, s] = bs();
4527
4534
  return { getUILibraryBlock: async (o, c) => {
4528
4535
  const h = await t(e, {
4529
4536
  action: "GET_LIBRARY_ITEM",
4530
4537
  data: { id: c.id }
4531
4538
  }), g = te(h, "html", ""), d = te(h, "blocks", []);
4532
- return $a(d) ? d : si(g);
4539
+ return $a(d) ? d : ri(g);
4533
4540
  }, getUILibraryBlocks: async (o) => {
4534
4541
  try {
4535
4542
  return (await t(e, {
@@ -4560,7 +4567,7 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4560
4567
  return console.error(h), new Error("Failed to save blocks");
4561
4568
  }
4562
4569
  } };
4563
- }, qo = () => {
4570
+ }, Ho = () => {
4564
4571
  const { data: e } = Rn(), t = Q(), n = $();
4565
4572
  return {
4566
4573
  getPartialBlocks: _e(async () => {
@@ -4589,56 +4596,57 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4589
4596
  [n, t]
4590
4597
  )
4591
4598
  };
4592
- }, Bs = Nn.object({
4593
- email: Nn.string().email({ message: "Please enter a valid email address" }),
4594
- password: Nn.string().min(6, { message: "Password must be at least 6 characters" })
4595
- }), Ho = ({
4599
+ }, Ms = An.object({
4600
+ email: An.string().email({ message: "Please enter a valid email address" }),
4601
+ password: An.string().min(6, { message: "Password must be at least 6 characters" })
4602
+ }), Ko = ({
4596
4603
  onLoginSuccess: e
4597
4604
  }) => {
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, {
4605
+ const t = Un(), [n, s] = P(""), [a, i] = P(""), [l, o] = P({}), [c, h] = P(!1), [g, d] = P(""), w = Ae({
4606
+ mutationFn: async (S) => {
4607
+ d("");
4608
+ const v = await vs(t, {
4601
4609
  action: "LOGIN",
4602
- data: p
4610
+ data: S
4603
4611
  });
4604
- if (!y.ok) {
4605
- const v = await y.json();
4606
- throw new Error(v.message || "Login failed");
4612
+ if (!v.ok) {
4613
+ const G = await v.json();
4614
+ throw new Error(G.error || "Login failed");
4607
4615
  }
4608
- const S = await y.json();
4609
- return e(S), S;
4616
+ const x = await v.json();
4617
+ return e(x), x;
4610
4618
  },
4611
4619
  onSuccess: () => {
4612
- o({});
4620
+ o({}), d("");
4613
4621
  },
4614
- onError: (p) => {
4622
+ onError: (S) => {
4615
4623
  o({
4616
4624
  email: " ",
4617
- password: p.message || "Something went wrong"
4618
- });
4625
+ password: " "
4626
+ }), d(S.message || "Something went wrong");
4619
4627
  }
4620
- }), d = async (p) => {
4621
- p.preventDefault(), o({});
4622
- const y = { email: n, password: a };
4628
+ }), y = async (S) => {
4629
+ S.preventDefault(), o({});
4630
+ const v = { email: n, password: a };
4623
4631
  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;
4632
+ const x = Ms.parse(v);
4633
+ w.mutate(x);
4634
+ } catch (x) {
4635
+ if (x instanceof An.ZodError) {
4636
+ const G = x.errors.reduce((E, b) => {
4637
+ const T = b.path[0];
4638
+ return E[T] = b.message, E;
4631
4639
  }, {});
4632
- o(v);
4640
+ o(G);
4633
4641
  }
4634
4642
  }
4635
- }, w = Bs.safeParse({ email: n, password: a }).success;
4636
- 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
- /* @__PURE__ */ u(ls, { children: [
4638
- /* @__PURE__ */ r(os, { className: "text-2xl", children: "Sign in" }),
4639
- /* @__PURE__ */ r(Ei, { children: "Enter your credentials to sign in to visual builder" })
4643
+ }, p = Ms.safeParse({ email: n, password: a }).success;
4644
+ return /* @__PURE__ */ r("div", { className: "flex justify-center items-center min-h-screen bg-slate-50", children: /* @__PURE__ */ u(ls, { className: "w-full max-w-md", children: [
4645
+ /* @__PURE__ */ u(os, { children: [
4646
+ /* @__PURE__ */ r(cs, { className: "text-2xl", children: "Sign in" }),
4647
+ /* @__PURE__ */ r(bi, { children: "Enter your credentials to sign in to visual builder" })
4640
4648
  ] }),
4641
- /* @__PURE__ */ r(cs, { children: /* @__PURE__ */ u("form", { onSubmit: d, className: "space-y-4", children: [
4649
+ /* @__PURE__ */ r(us, { children: /* @__PURE__ */ u("form", { onSubmit: y, className: "space-y-4", children: [
4642
4650
  /* @__PURE__ */ u("div", { className: "space-y-1", children: [
4643
4651
  /* @__PURE__ */ r(X, { htmlFor: "email", children: "Email" }),
4644
4652
  /* @__PURE__ */ r(
@@ -4648,7 +4656,7 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4648
4656
  placeholder: "you@example.com",
4649
4657
  type: "email",
4650
4658
  value: n,
4651
- onChange: (p) => s(p.target.value),
4659
+ onChange: (S) => s(S.target.value),
4652
4660
  className: l.email ? "border-destructive" : ""
4653
4661
  }
4654
4662
  ),
@@ -4664,7 +4672,7 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4664
4672
  placeholder: "Enter your password",
4665
4673
  type: c ? "text" : "password",
4666
4674
  value: a,
4667
- onChange: (p) => i(p.target.value),
4675
+ onChange: (S) => i(S.target.value),
4668
4676
  className: l.password ? "border-destructive" : ""
4669
4677
  }
4670
4678
  ),
@@ -4674,26 +4682,27 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4674
4682
  type: "button",
4675
4683
  className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",
4676
4684
  onClick: () => h(!c),
4677
- children: c ? /* @__PURE__ */ r(Zi, { className: "h-4 w-4" }) : /* @__PURE__ */ r(Lr, { className: "h-4 w-4" })
4685
+ children: c ? /* @__PURE__ */ r(Ji, { className: "h-4 w-4" }) : /* @__PURE__ */ r(Lr, { className: "h-4 w-4" })
4678
4686
  }
4679
4687
  )
4680
4688
  ] }),
4681
4689
  l.password && /* @__PURE__ */ r("p", { className: "text-sm text-destructive", children: l.password })
4682
4690
  ] }),
4691
+ /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("p", { className: "text-sm text-destructive", children: g }) }),
4683
4692
  /* @__PURE__ */ r(
4684
- P,
4693
+ _,
4685
4694
  {
4686
4695
  type: "submit",
4687
4696
  className: "w-full",
4688
- disabled: !w || g.isPending,
4689
- children: g.isPending ? /* @__PURE__ */ u(be, { children: [
4697
+ disabled: !p || w.isPending,
4698
+ children: w.isPending ? /* @__PURE__ */ u(be, { children: [
4690
4699
  /* @__PURE__ */ r(Dr, { className: "mr-2 h-4 w-4 animate-spin" }),
4691
4700
  "Logging in..."
4692
4701
  ] }) : "Login"
4693
4702
  }
4694
4703
  )
4695
4704
  ] }) }),
4696
- /* @__PURE__ */ u(us, { className: "flex flex-col justify-center", children: [
4705
+ /* @__PURE__ */ u(ds, { className: "flex flex-col justify-center", children: [
4697
4706
  /* @__PURE__ */ u("p", { className: "text-sm text-muted-foreground", children: [
4698
4707
  "Forgot your password?",
4699
4708
  " ",
@@ -4734,28 +4743,28 @@ const Go = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4734
4743
  ] })
4735
4744
  ] })
4736
4745
  ] }) });
4737
- }, Ko = () => {
4746
+ }, Vo = () => {
4738
4747
  const { setUser: e } = st();
4739
4748
  return /* @__PURE__ */ r(
4740
- Ho,
4749
+ Ko,
4741
4750
  {
4742
4751
  onLoginSuccess: (t) => {
4743
4752
  e(t);
4744
4753
  }
4745
4754
  }
4746
4755
  );
4747
- }, Vo = ({
4756
+ }, jo = ({
4748
4757
  isActive: e,
4749
4758
  show: t
4750
4759
  }) => {
4751
4760
  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" }) });
4753
- }, Vr = "lang", jo = {
4761
+ return !nn(n, "languages") || !te(n, "languages", []).length ? null : /* @__PURE__ */ r(_, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ r(el, { className: "w-4 h-4" }) });
4762
+ }, Vr = "lang", $o = {
4754
4763
  id: Vr,
4755
4764
  label: "Languages",
4756
4765
  position: "top",
4757
- panel: Yl,
4758
- button: Vo,
4766
+ panel: Ql,
4767
+ button: jo,
4759
4768
  view: "modal",
4760
4769
  width: 400
4761
4770
  };
@@ -4769,26 +4778,26 @@ function Ze({
4769
4778
  ce.useEffect(() => {
4770
4779
  a || o([]), h(e);
4771
4780
  }, [e, a]);
4772
- const g = (y) => Array.isArray(y) ? "array" : typeof y == "object" && y !== null ? "object" : "value", d = ce.useCallback(
4773
- (y) => {
4781
+ const g = (p) => Array.isArray(p) ? "array" : typeof p == "object" && p !== null ? "object" : "value", d = ce.useCallback(
4782
+ (p) => {
4774
4783
  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));
4784
+ p.type === "object" ? (o((v) => [...v, p.key]), h(p.value)) : S(p.type) && (t([...l, p.key].join(".")), i(!1));
4776
4785
  },
4777
4786
  [l, t, n]
4778
4787
  ), w = ce.useCallback(() => {
4779
4788
  if (l.length > 0) {
4780
- const y = l.slice(0, -1);
4781
- o(y), h(y.reduce((S, v) => S[v], e));
4789
+ const p = l.slice(0, -1);
4790
+ o(p), h(p.reduce((S, v) => S[v], e));
4782
4791
  }
4783
- }, [l, e]), p = ce.useMemo(() => Object.entries(c).map(([y, S]) => ({
4784
- key: y,
4792
+ }, [l, e]), y = ce.useMemo(() => Object.entries(c).map(([p, S]) => ({
4793
+ key: p,
4785
4794
  value: S,
4786
4795
  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]);
4796
+ })).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
4797
  return /* @__PURE__ */ u(mr, { open: a, onOpenChange: i, children: [
4789
- /* @__PURE__ */ u(ds, { children: [
4790
- /* @__PURE__ */ r(hs, { asChild: !0, children: /* @__PURE__ */ r(fr, { asChild: !0, children: /* @__PURE__ */ r(
4791
- P,
4798
+ /* @__PURE__ */ u(hs, { children: [
4799
+ /* @__PURE__ */ r(ms, { asChild: !0, children: /* @__PURE__ */ r(fr, { asChild: !0, children: /* @__PURE__ */ r(
4800
+ _,
4792
4801
  {
4793
4802
  size: "sm",
4794
4803
  variant: "outline",
@@ -4796,86 +4805,86 @@ function Ze({
4796
4805
  role: "combobox",
4797
4806
  "aria-expanded": a,
4798
4807
  disabled: s,
4799
- children: /* @__PURE__ */ r(el, { className: "h-3 w-3" })
4808
+ children: /* @__PURE__ */ r(tl, { className: "h-3 w-3" })
4800
4809
  }
4801
4810
  ) }) }),
4802
- /* @__PURE__ */ r(ms, { children: "Add field" })
4811
+ /* @__PURE__ */ r(fs, { children: "Add field" })
4803
4812
  ] }),
4804
- /* @__PURE__ */ r(gr, { className: "w-[200px] z-[9999] p-0", children: /* @__PURE__ */ u(bi, { children: [
4805
- /* @__PURE__ */ r(wi, { className: "border-none", placeholder: "Search..." }),
4806
- /* @__PURE__ */ u(Si, { children: [
4807
- /* @__PURE__ */ r(Ni, { children: "No option found." }),
4808
- /* @__PURE__ */ u(Ai, { children: [
4813
+ /* @__PURE__ */ r(gr, { className: "w-[200px] z-[9999] p-0", children: /* @__PURE__ */ u(wi, { children: [
4814
+ /* @__PURE__ */ r(Si, { className: "border-none", placeholder: "Search..." }),
4815
+ /* @__PURE__ */ u(Ni, { children: [
4816
+ /* @__PURE__ */ r(Ai, { children: "No option found." }),
4817
+ /* @__PURE__ */ u(xi, { children: [
4809
4818
  l.length > 0 && /* @__PURE__ */ u(
4810
- Ls,
4819
+ Ds,
4811
4820
  {
4812
4821
  onSelect: w,
4813
4822
  className: "flex items-center text-sm",
4814
4823
  children: [
4815
- /* @__PURE__ */ r(tl, { className: "w-4 h-4 mr-2" }),
4824
+ /* @__PURE__ */ r(nl, { className: "w-4 h-4 mr-2" }),
4816
4825
  "Back"
4817
4826
  ]
4818
4827
  }
4819
4828
  ),
4820
- p.map((y) => /* @__PURE__ */ u(
4821
- Ls,
4829
+ y.map((p) => /* @__PURE__ */ u(
4830
+ Ds,
4822
4831
  {
4823
- onSelect: () => d(y),
4832
+ onSelect: () => d(p),
4824
4833
  className: "flex items-center justify-between",
4825
4834
  children: [
4826
- /* @__PURE__ */ r("span", { children: y.key }),
4835
+ /* @__PURE__ */ r("span", { children: p.key }),
4827
4836
  /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
4828
- n === "object" && y.type === "object" && /* @__PURE__ */ r(
4829
- P,
4837
+ n === "object" && p.type === "object" && /* @__PURE__ */ r(
4838
+ _,
4830
4839
  {
4831
4840
  size: "sm",
4832
4841
  variant: "ghost",
4833
4842
  className: "h-6 px-2 hover:bg-primary hover:text-primary-foreground",
4834
4843
  onClick: (S) => {
4835
- S.stopPropagation(), t([...l, y.key].join(".")), i(!1);
4844
+ S.stopPropagation(), t([...l, p.key].join(".")), i(!1);
4836
4845
  },
4837
4846
  children: "Select"
4838
4847
  }
4839
4848
  ),
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" }) })
4849
+ (p.type === "object" || p.type === "array") && /* @__PURE__ */ r("div", { className: "p-1 rounded hover:bg-muted cursor-pointer", children: /* @__PURE__ */ r(sl, { className: "w-4 h-4 opacity-50" }) })
4841
4850
  ] })
4842
4851
  ]
4843
4852
  },
4844
- y.key
4853
+ p.key
4845
4854
  ))
4846
4855
  ] })
4847
4856
  ] })
4848
4857
  ] }) })
4849
4858
  ] });
4850
4859
  }
4851
- const $o = () => {
4860
+ const zo = () => {
4852
4861
  const { selectedLang: e } = ut(), { data: t, isFetching: n } = cn();
4853
4862
  return { data: Y(() => fe(t, { lang: e || "" }) || {}, [t, e]), isFetching: n };
4854
- }, zo = (e, t) => {
4863
+ }, Wo = (e, t) => {
4855
4864
  const n = e.selectionStart || 0, s = e.selectionEnd || 0, a = e.value, i = a.substring(0, n), l = a.substring(s);
4856
4865
  let o = !1;
4857
4866
  if (n > 0 && i.length > 0) {
4858
- const y = i.charAt(i.length - 1);
4859
- o = !/[\s.,!?;:()[\]{}]/.test(y) && y !== "";
4867
+ const p = i.charAt(i.length - 1);
4868
+ o = !/[\s.,!?;:()[\]{}]/.test(p) && p !== "";
4860
4869
  }
4861
4870
  let c = !1;
4862
4871
  if (l.length > 0) {
4863
- const y = l.charAt(0);
4864
- c = !/[\s.,!?;:()[\]{}]/.test(y) && y !== "";
4872
+ const p = l.charAt(0);
4873
+ c = !/[\s.,!?;:()[\]{}]/.test(p) && p !== "";
4865
4874
  }
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
4875
+ 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
4876
  d.length;
4868
4877
  return {
4869
4878
  value: w,
4870
- newCursorPos: p
4879
+ newCursorPos: y
4871
4880
  };
4872
4881
  }, jr = () => {
4873
- const { t: e } = ri(), { selectedLang: t, fallbackLang: n, languages: s } = ut(), [, a] = ai(), { data: i } = Ue(), { data: l } = Mr({
4882
+ const { t: e } = ai(), { selectedLang: t, fallbackLang: n, languages: s } = ut(), [, a] = ii(), { data: i } = Re(), { data: l } = Mr({
4874
4883
  lang: t || n,
4875
4884
  pageType: i == null ? void 0 : i.pageType
4876
- }), { data: o, isFetching: c } = $o(), h = o == null ? void 0 : o.seo, g = ct(
4885
+ }), { data: o, isFetching: c } = zo(), h = o == null ? void 0 : o.seo, g = ct(
4877
4886
  null
4878
- ), [d, w] = _({
4887
+ ), [d, w] = P({
4879
4888
  title: "",
4880
4889
  description: "",
4881
4890
  cononicalUrl: "",
@@ -4888,7 +4897,7 @@ const $o = () => {
4888
4897
  searchDescription: "",
4889
4898
  jsonLD: "",
4890
4899
  ...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);
4900
+ }), y = ct({ initial: d, updated: d }), p = t.length ? t : n, { mutate: S, isPending: v } = ws(), x = v, { hasPermission: G } = sn(), E = G(ue.EDIT_SEO);
4892
4901
  we(() => {
4893
4902
  !c && h && w({
4894
4903
  title: "",
@@ -4910,7 +4919,7 @@ const $o = () => {
4910
4919
  { id: o == null ? void 0 : o.id, seo: d },
4911
4920
  {
4912
4921
  onSuccess: () => {
4913
- p.current.initial = d, p.current.updated = d, a("outline");
4922
+ y.current.initial = d, y.current.updated = d, a("outline");
4914
4923
  }
4915
4924
  }
4916
4925
  );
@@ -4920,7 +4929,7 @@ const $o = () => {
4920
4929
  ogTitle: d.title,
4921
4930
  ogDescription: d.description
4922
4931
  });
4923
- }, G = () => {
4932
+ }, U = () => {
4924
4933
  w({
4925
4934
  ...d,
4926
4935
  searchTitle: d.ogTitle,
@@ -4929,7 +4938,7 @@ const $o = () => {
4929
4938
  }, J = (k, q) => {
4930
4939
  const A = document.getElementById(q);
4931
4940
  if (A) {
4932
- const { value: M, newCursorPos: ne } = zo(
4941
+ const { value: M, newCursorPos: ne } = Wo(
4933
4942
  A,
4934
4943
  k
4935
4944
  );
@@ -4964,10 +4973,10 @@ const $o = () => {
4964
4973
  ...d,
4965
4974
  [k.target.name]: k.target.name === "noIndex" || k.target.name === "noFollow" ? k.target.checked : k.target.value
4966
4975
  };
4967
- w(q), p.current.updated = q;
4976
+ w(q), y.current.updated = q;
4968
4977
  };
4969
4978
  return /* @__PURE__ */ u("div", { className: "relative h-full flex flex-col", children: [
4970
- !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(
4979
+ !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(Ti, { children: e(
4971
4980
  "You don't have permission to edit SEO settings. Contact your administrator for access."
4972
4981
  ) }) }) }),
4973
4982
  /* @__PURE__ */ u("div", { className: "flex-grow overflow-y-auto no-scrollbar px-2", children: [
@@ -4978,11 +4987,11 @@ const $o = () => {
4978
4987
  "  ",
4979
4988
  s.length > 0 && /* @__PURE__ */ u("span", { className: "font-semibold text-blue-500", children: [
4980
4989
  "(",
4981
- te(qe, y, y),
4990
+ te(qe, p, p),
4982
4991
  ")"
4983
4992
  ] })
4984
4993
  ] }),
4985
- /* @__PURE__ */ r("form", { className: "space-y-8", children: /* @__PURE__ */ u(Ti, { type: "multiple", defaultValue: ["page"], children: [
4994
+ /* @__PURE__ */ r("form", { className: "space-y-8", children: /* @__PURE__ */ u(Ci, { type: "multiple", defaultValue: ["page"], children: [
4986
4995
  /* @__PURE__ */ u(gn, { value: "page", children: [
4987
4996
  /* @__PURE__ */ r(pn, { className: "font-semibold text-slate-700", children: e("SEO") }),
4988
4997
  /* @__PURE__ */ r(yn, { className: "pt-2", children: /* @__PURE__ */ u("div", { className: "space-y-4", children: [
@@ -5109,7 +5118,7 @@ const $o = () => {
5109
5118
  /* @__PURE__ */ r(pn, { className: "font-bold text-slate-700", children: e("Open Graph") }),
5110
5119
  /* @__PURE__ */ r(yn, { children: /* @__PURE__ */ u("div", { className: "space-y-4", children: [
5111
5120
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r(
5112
- P,
5121
+ _,
5113
5122
  {
5114
5123
  type: "button",
5115
5124
  variant: "outline",
@@ -5203,12 +5212,12 @@ const $o = () => {
5203
5212
  /* @__PURE__ */ r(pn, { className: "font-bold text-slate-700", children: e("Search") }),
5204
5213
  /* @__PURE__ */ r(yn, { children: /* @__PURE__ */ u("div", { className: "space-y-4", children: [
5205
5214
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r(
5206
- P,
5215
+ _,
5207
5216
  {
5208
5217
  type: "button",
5209
5218
  variant: "outline",
5210
5219
  size: "sm",
5211
- onClick: G,
5220
+ onClick: U,
5212
5221
  disabled: !E,
5213
5222
  children: e("Copy from OG Settings")
5214
5223
  }
@@ -5299,25 +5308,25 @@ const $o = () => {
5299
5308
  ] }) })
5300
5309
  ] }),
5301
5310
  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,
5311
+ _,
5303
5312
  {
5304
5313
  size: "lg",
5305
5314
  variant: "default",
5306
5315
  onClick: b,
5307
- disabled: rs(p.current.initial, d) || x || !E,
5316
+ disabled: as(y.current.initial, d) || x || !E,
5308
5317
  children: e(v ? "Saving..." : "Save")
5309
5318
  }
5310
5319
  ) })
5311
5320
  ] });
5312
5321
  };
5313
5322
  jr.displayName = "SeoPanel";
5314
- const $r = "seo", Wo = ({
5323
+ const $r = "seo", Yo = ({
5315
5324
  isActive: e,
5316
5325
  show: t
5317
5326
  }) => {
5318
- const { data: n } = Ue(), s = Ol(n == null ? void 0 : n.pageType);
5327
+ const { data: n } = Re(), s = Bl(n == null ? void 0 : n.pageType);
5319
5328
  return !nn(s, "hasSlug") || !s.hasSlug ? null : /* @__PURE__ */ r(
5320
- P,
5329
+ _,
5321
5330
  {
5322
5331
  size: "sm",
5323
5332
  className: "my-1",
@@ -5338,25 +5347,25 @@ const $r = "seo", Wo = ({
5338
5347
  )
5339
5348
  }
5340
5349
  );
5341
- }, Yo = {
5350
+ }, Qo = {
5342
5351
  id: $r,
5343
5352
  label: "SEO",
5344
5353
  panel: jr,
5345
- button: Wo,
5354
+ button: Yo,
5346
5355
  position: "top",
5347
5356
  view: "modal",
5348
5357
  width: 600
5349
- }, Qo = () => {
5350
- $n($r, Yo), $n(Vr, jo);
5351
- }, Xo = "user-info", Zo = () => {
5358
+ }, Xo = () => {
5359
+ zn($r, Qo), zn(Vr, $o);
5360
+ }, Zo = "user-info", Jo = () => {
5352
5361
  const { user: e, logout: t } = st();
5353
- 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" }) }) }),
5355
- /* @__PURE__ */ u(_i, { className: "w-auto p-4 space-y-2", children: [
5362
+ return e ? /* @__PURE__ */ u(Pi, { children: [
5363
+ /* @__PURE__ */ r(_i, { asChild: !0, children: /* @__PURE__ */ r(_, { variant: "ghost", className: "text-sm font-medium", children: /* @__PURE__ */ r(rl, { className: "w-4 h-4" }) }) }),
5364
+ /* @__PURE__ */ u(Ii, { className: "w-auto p-4 space-y-2", children: [
5356
5365
  /* @__PURE__ */ r("div", { className: "text-sm font-medium", children: e.name ?? e.email }),
5357
5366
  /* @__PURE__ */ r("div", { className: "text-xs text-muted-foreground", children: e.email }),
5358
5367
  /* @__PURE__ */ u(rr, { children: [
5359
- /* @__PURE__ */ r(ar, { asChild: !0, children: /* @__PURE__ */ r(P, { variant: "outline", size: "sm", className: "w-full", children: "Logout" }) }),
5368
+ /* @__PURE__ */ r(ar, { asChild: !0, children: /* @__PURE__ */ r(_, { variant: "outline", size: "sm", className: "w-full", children: "Logout" }) }),
5360
5369
  /* @__PURE__ */ u(ir, { children: [
5361
5370
  /* @__PURE__ */ u(lr, { children: [
5362
5371
  /* @__PURE__ */ r(or, { children: "Are you sure you want to logout?" }),
@@ -5370,39 +5379,39 @@ const $r = "seo", Wo = ({
5370
5379
  ] })
5371
5380
  ] })
5372
5381
  ] }) : null;
5373
- }, Jo = {
5374
- id: Xo,
5382
+ }, ec = {
5383
+ id: Zo,
5375
5384
  label: "User Info",
5376
- button: Zo,
5385
+ button: Jo,
5377
5386
  position: "bottom"
5378
- }, ec = (e) => (console.log(e), /* @__PURE__ */ r("h1", { children: "Hello" }));
5387
+ };
5379
5388
  var O = {
5380
5389
  context: void 0,
5381
5390
  registry: void 0,
5382
5391
  effects: void 0,
5383
5392
  done: !1,
5384
5393
  getContextId() {
5385
- return Ms(this.context.count);
5394
+ return Fs(this.context.count);
5386
5395
  },
5387
5396
  getNextContextId() {
5388
- return Ms(this.context.count++);
5397
+ return Fs(this.context.count++);
5389
5398
  }
5390
5399
  };
5391
- function Ms(e) {
5400
+ function Fs(e) {
5392
5401
  const t = String(e), n = t.length - 1;
5393
5402
  return O.context.id + (n ? String.fromCharCode(96 + n) : "") + t;
5394
5403
  }
5395
- function Rt(e) {
5404
+ function Ut(e) {
5396
5405
  O.context = e;
5397
5406
  }
5398
- var tc = (e, t) => e === t, Tn = Symbol("solid-proxy"), zr = typeof Proxy == "function", Wr = Symbol("solid-track"), Cn = {
5407
+ var tc = (e, t) => e === t, Cn = Symbol("solid-proxy"), zr = typeof Proxy == "function", Wr = Symbol("solid-track"), Pn = {
5399
5408
  equals: tc
5400
- }, Yr = ta, tt = 1, Pn = 2, Qr = {
5409
+ }, Yr = ta, tt = 1, _n = 2, Qr = {
5401
5410
  owned: null,
5402
5411
  cleanups: null,
5403
5412
  context: null,
5404
5413
  owner: null
5405
- }, Hn = {}, Z = null, Kn = null, nc = null, re = null, Pe = null, Je = null, Un = 0;
5414
+ }, Kn = {}, Z = null, Vn = null, nc = null, re = null, Pe = null, Je = null, On = 0;
5406
5415
  function lt(e, t) {
5407
5416
  const n = re, s = Z, a = e.length === 0, i = t === void 0 ? s : t, l = a ? Qr : {
5408
5417
  owned: null,
@@ -5418,7 +5427,7 @@ function lt(e, t) {
5418
5427
  }
5419
5428
  }
5420
5429
  function ve(e, t) {
5421
- t = t ? Object.assign({}, Cn, t) : Cn;
5430
+ t = t ? Object.assign({}, Pn, t) : Pn;
5422
5431
  const n = {
5423
5432
  value: e,
5424
5433
  observers: null,
@@ -5428,21 +5437,21 @@ function ve(e, t) {
5428
5437
  return [Jr.bind(n), s];
5429
5438
  }
5430
5439
  function sc(e, t, n) {
5431
- const s = On(e, t, !0, tt);
5440
+ const s = Bn(e, t, !0, tt);
5432
5441
  Lt(s);
5433
5442
  }
5434
5443
  function ot(e, t, n) {
5435
- const s = On(e, t, !1, tt);
5444
+ const s = Bn(e, t, !1, tt);
5436
5445
  Lt(s);
5437
5446
  }
5438
5447
  function Xr(e, t, n) {
5439
5448
  Yr = mc;
5440
- const s = On(e, t, !1, tt);
5449
+ const s = Bn(e, t, !1, tt);
5441
5450
  (!n || !n.render) && (s.user = !0), Je ? Je.push(s) : Lt(s);
5442
5451
  }
5443
5452
  function Ge(e, t, n) {
5444
- n = n ? Object.assign({}, Cn, n) : Cn;
5445
- const s = On(e, t, !0, 0);
5453
+ n = n ? Object.assign({}, Pn, n) : Pn;
5454
+ const s = Bn(e, t, !0, 0);
5446
5455
  return s.observers = null, s.observerSlots = null, s.comparator = n.equals || void 0, Lt(s), Jr.bind(s);
5447
5456
  }
5448
5457
  function rc(e) {
@@ -5451,8 +5460,8 @@ function rc(e) {
5451
5460
  function ac(e, t, n) {
5452
5461
  let s, a, i;
5453
5462
  arguments.length === 1 ? (s = !0, a = e, i = {}) : (s = e, a = t, i = {});
5454
- 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, {
5463
+ let l = null, o = Kn, c = null, h = !1, g = "initialValue" in i, d = typeof s == "function" && Ge(s);
5464
+ const w = /* @__PURE__ */ new Set(), [y, p] = (i.storage || ve)(i.initialValue), [S, v] = ve(void 0), [x, G] = ve(void 0, {
5456
5465
  equals: !1
5457
5466
  }), [E, b] = ve(g ? "ready" : "unresolved");
5458
5467
  O.context && (c = O.getNextContextId(), i.ssrLoadFrom === "initial" ? o = i.initialValue : O.load && O.has(c) && (o = O.load(c)));
@@ -5461,18 +5470,18 @@ function ac(e, t, n) {
5461
5470
  () => i.onHydrated(M, {
5462
5471
  value: q
5463
5472
  })
5464
- ), o = Hn, G(q, A)), q;
5473
+ ), o = Kn, U(q, A)), q;
5465
5474
  }
5466
- function G(k, q) {
5475
+ function U(k, q) {
5467
5476
  We(() => {
5468
- q === void 0 && y(() => k), b(q !== void 0 ? "errored" : g ? "ready" : "unresolved"), v(q);
5477
+ q === void 0 && p(() => k), b(q !== void 0 ? "errored" : g ? "ready" : "unresolved"), v(q);
5469
5478
  for (const A of w.keys())
5470
5479
  A.decrement();
5471
5480
  w.clear();
5472
5481
  }, !1);
5473
5482
  }
5474
5483
  function J() {
5475
- const k = uc, q = p(), A = S();
5484
+ const k = uc, q = y(), A = S();
5476
5485
  if (A !== void 0 && !l)
5477
5486
  throw A;
5478
5487
  return re && re.user, q;
@@ -5483,20 +5492,20 @@ function ac(e, t, n) {
5483
5492
  h = !1;
5484
5493
  const q = d ? d() : s;
5485
5494
  if (q == null || q === !1) {
5486
- T(l, Ce(p));
5495
+ T(l, Ce(y));
5487
5496
  return;
5488
5497
  }
5489
- const A = o !== Hn ? o : Ce(
5498
+ const A = o !== Kn ? o : Ce(
5490
5499
  () => a(q, {
5491
- value: p(),
5500
+ value: y(),
5492
5501
  refetching: k
5493
5502
  })
5494
5503
  );
5495
- 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();
5504
+ return rc(A) ? (l = A, "value" in A ? (A.status === "success" ? T(l, A.value, void 0, q) : T(l, void 0, Wn(A.value), q), A) : (h = !0, queueMicrotask(() => h = !1), We(() => {
5505
+ b(g ? "refreshing" : "pending"), G();
5497
5506
  }, !1), A.then(
5498
5507
  (M) => T(A, M, void 0, q),
5499
- (M) => T(A, void 0, zn(M), q)
5508
+ (M) => T(A, void 0, Wn(M), q)
5500
5509
  ))) : (T(l, A, void 0, q), A);
5501
5510
  }
5502
5511
  return Object.defineProperties(J, {
@@ -5519,18 +5528,18 @@ function ac(e, t, n) {
5519
5528
  const k = S();
5520
5529
  if (k && !l)
5521
5530
  throw k;
5522
- return p();
5531
+ return y();
5523
5532
  }
5524
5533
  }
5525
5534
  }), d ? sc(() => ie(!1)) : ie(!1), [
5526
5535
  J,
5527
5536
  {
5528
5537
  refetch: ie,
5529
- mutate: y
5538
+ mutate: p
5530
5539
  }
5531
5540
  ];
5532
5541
  }
5533
- function ju(e) {
5542
+ function $u(e) {
5534
5543
  return We(e, !1);
5535
5544
  }
5536
5545
  function Ce(e) {
@@ -5544,7 +5553,7 @@ function Ce(e) {
5544
5553
  re = t;
5545
5554
  }
5546
5555
  }
5547
- function $u(e, t, n) {
5556
+ function zu(e, t, n) {
5548
5557
  const s = Array.isArray(e);
5549
5558
  let a, i = n && n.defer;
5550
5559
  return (l) => {
@@ -5567,7 +5576,7 @@ function ic(e) {
5567
5576
  function Ft(e) {
5568
5577
  return Z === null || (Z.cleanups === null ? Z.cleanups = [e] : Z.cleanups.push(e)), e;
5569
5578
  }
5570
- function Fs() {
5579
+ function qs() {
5571
5580
  return Z;
5572
5581
  }
5573
5582
  function lc(e, t) {
@@ -5576,7 +5585,7 @@ function lc(e, t) {
5576
5585
  try {
5577
5586
  return We(t, !0);
5578
5587
  } catch (a) {
5579
- As(a);
5588
+ xs(a);
5580
5589
  } finally {
5581
5590
  Z = n, re = s;
5582
5591
  }
@@ -5589,11 +5598,11 @@ function oc(e) {
5589
5598
  return We(e, !1), re = Z = null, s ? s.done : void 0;
5590
5599
  });
5591
5600
  }
5592
- var [cc, zu] = /* @__PURE__ */ ve(!1);
5593
- function Wu() {
5601
+ var [cc, Wu] = /* @__PURE__ */ ve(!1);
5602
+ function Yu() {
5594
5603
  return [cc, oc];
5595
5604
  }
5596
- function Yu(e, t) {
5605
+ function Qu(e, t) {
5597
5606
  const n = Symbol("context");
5598
5607
  return {
5599
5608
  id: n,
@@ -5601,12 +5610,12 @@ function Yu(e, t) {
5601
5610
  defaultValue: e
5602
5611
  };
5603
5612
  }
5604
- function Qu(e) {
5613
+ function Xu(e) {
5605
5614
  let t;
5606
5615
  return Z && Z.context && (t = Z.context[e.id]) !== void 0 ? t : e.defaultValue;
5607
5616
  }
5608
5617
  function Zr(e) {
5609
- const t = Ge(e), n = Ge(() => Wn(t()));
5618
+ const t = Ge(e), n = Ge(() => Yn(t()));
5610
5619
  return n.toArray = () => {
5611
5620
  const s = n();
5612
5621
  return Array.isArray(s) ? s : s != null ? [s] : [];
@@ -5619,7 +5628,7 @@ function Jr() {
5619
5628
  Lt(this);
5620
5629
  else {
5621
5630
  const e = Pe;
5622
- Pe = null, We(() => In(this), !1), Pe = e;
5631
+ Pe = null, We(() => kn(this), !1), Pe = e;
5623
5632
  }
5624
5633
  if (re) {
5625
5634
  const e = this.observers ? this.observers.length : 0;
@@ -5631,8 +5640,8 @@ function ea(e, t, n) {
5631
5640
  let s = e.value;
5632
5641
  return (!e.comparator || !e.comparator(s, t)) && (e.value = t, e.observers && e.observers.length && We(() => {
5633
5642
  for (let a = 0; a < e.observers.length; a += 1) {
5634
- const i = e.observers[a], l = Kn && Kn.running;
5635
- l && Kn.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? Pe.push(i) : Je.push(i), i.observers && na(i)), l || (i.state = tt);
5643
+ const i = e.observers[a], l = Vn && Vn.running;
5644
+ l && Vn.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? Pe.push(i) : Je.push(i), i.observers && na(i)), l || (i.state = tt);
5636
5645
  }
5637
5646
  if (Pe.length > 1e6)
5638
5647
  throw Pe = [], new Error();
@@ -5642,7 +5651,7 @@ function Lt(e) {
5642
5651
  if (!e.fn)
5643
5652
  return;
5644
5653
  qt(e);
5645
- const t = Un;
5654
+ const t = On;
5646
5655
  dc(
5647
5656
  e,
5648
5657
  e.value,
@@ -5656,13 +5665,13 @@ function dc(e, t, n) {
5656
5665
  try {
5657
5666
  s = e.fn(t);
5658
5667
  } catch (l) {
5659
- return e.pure && (e.state = tt, e.owned && e.owned.forEach(qt), e.owned = null), e.updatedAt = n + 1, As(l);
5668
+ return e.pure && (e.state = tt, e.owned && e.owned.forEach(qt), e.owned = null), e.updatedAt = n + 1, xs(l);
5660
5669
  } finally {
5661
5670
  re = i, Z = a;
5662
5671
  }
5663
5672
  (!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? ea(e, s) : e.value = s, e.updatedAt = n);
5664
5673
  }
5665
- function On(e, t, n, s = tt, a) {
5674
+ function Bn(e, t, n, s = tt, a) {
5666
5675
  const i = {
5667
5676
  fn: e,
5668
5677
  state: s,
@@ -5678,34 +5687,34 @@ function On(e, t, n, s = tt, a) {
5678
5687
  };
5679
5688
  return Z === null || Z !== Qr && (Z.owned ? Z.owned.push(i) : Z.owned = [i]), i;
5680
5689
  }
5681
- function _n(e) {
5690
+ function In(e) {
5682
5691
  if (e.state === 0)
5683
5692
  return;
5684
- if (e.state === Pn)
5685
- return In(e);
5693
+ if (e.state === _n)
5694
+ return kn(e);
5686
5695
  if (e.suspense && Ce(e.suspense.inFallback))
5687
5696
  return e.suspense.effects.push(e);
5688
5697
  const t = [e];
5689
- for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < Un); )
5698
+ for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < On); )
5690
5699
  e.state && t.push(e);
5691
5700
  for (let n = t.length - 1; n >= 0; n--)
5692
5701
  if (e = t[n], e.state === tt)
5693
5702
  Lt(e);
5694
- else if (e.state === Pn) {
5703
+ else if (e.state === _n) {
5695
5704
  const s = Pe;
5696
- Pe = null, We(() => In(e, t[0]), !1), Pe = s;
5705
+ Pe = null, We(() => kn(e, t[0]), !1), Pe = s;
5697
5706
  }
5698
5707
  }
5699
5708
  function We(e, t) {
5700
5709
  if (Pe)
5701
5710
  return e();
5702
5711
  let n = !1;
5703
- t || (Pe = []), Je ? n = !0 : Je = [], Un++;
5712
+ t || (Pe = []), Je ? n = !0 : Je = [], On++;
5704
5713
  try {
5705
5714
  const s = e();
5706
5715
  return hc(n), s;
5707
5716
  } catch (s) {
5708
- n || (Je = null), Pe = null, As(s);
5717
+ n || (Je = null), Pe = null, xs(s);
5709
5718
  }
5710
5719
  }
5711
5720
  function hc(e) {
@@ -5716,38 +5725,38 @@ function hc(e) {
5716
5725
  }
5717
5726
  function ta(e) {
5718
5727
  for (let t = 0; t < e.length; t++)
5719
- _n(e[t]);
5728
+ In(e[t]);
5720
5729
  }
5721
5730
  function mc(e) {
5722
5731
  let t, n = 0;
5723
5732
  for (t = 0; t < e.length; t++) {
5724
5733
  const s = e[t];
5725
- s.user ? e[n++] = s : _n(s);
5734
+ s.user ? e[n++] = s : In(s);
5726
5735
  }
5727
5736
  if (O.context) {
5728
5737
  if (O.count) {
5729
5738
  O.effects || (O.effects = []), O.effects.push(...e.slice(0, n));
5730
5739
  return;
5731
5740
  }
5732
- Rt();
5741
+ Ut();
5733
5742
  }
5734
5743
  for (O.effects && (O.done || !O.count) && (e = [...O.effects, ...e], n += O.effects.length, delete O.effects), t = 0; t < n; t++)
5735
- _n(e[t]);
5744
+ In(e[t]);
5736
5745
  }
5737
- function In(e, t) {
5746
+ function kn(e, t) {
5738
5747
  e.state = 0;
5739
5748
  for (let n = 0; n < e.sources.length; n += 1) {
5740
5749
  const s = e.sources[n];
5741
5750
  if (s.sources) {
5742
5751
  const a = s.state;
5743
- a === tt ? s !== t && (!s.updatedAt || s.updatedAt < Un) && _n(s) : a === Pn && In(s, t);
5752
+ a === tt ? s !== t && (!s.updatedAt || s.updatedAt < On) && In(s) : a === _n && kn(s, t);
5744
5753
  }
5745
5754
  }
5746
5755
  }
5747
5756
  function na(e) {
5748
5757
  for (let t = 0; t < e.observers.length; t += 1) {
5749
5758
  const n = e.observers[t];
5750
- n.state || (n.state = Pn, n.pure ? Pe.push(n) : Je.push(n), n.observers && na(n));
5759
+ n.state || (n.state = _n, n.pure ? Pe.push(n) : Je.push(n), n.observers && na(n));
5751
5760
  }
5752
5761
  }
5753
5762
  function qt(e) {
@@ -5777,21 +5786,21 @@ function qt(e) {
5777
5786
  }
5778
5787
  e.state = 0;
5779
5788
  }
5780
- function zn(e) {
5789
+ function Wn(e) {
5781
5790
  return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
5782
5791
  cause: e
5783
5792
  });
5784
5793
  }
5785
- function As(e, t = Z) {
5786
- throw zn(e);
5794
+ function xs(e, t = Z) {
5795
+ throw Wn(e);
5787
5796
  }
5788
- function Wn(e) {
5797
+ function Yn(e) {
5789
5798
  if (typeof e == "function" && !e.length)
5790
- return Wn(e());
5799
+ return Yn(e());
5791
5800
  if (Array.isArray(e)) {
5792
5801
  const t = [];
5793
5802
  for (let n = 0; n < e.length; n++) {
5794
- const s = Wn(e[n]);
5803
+ const s = Yn(e[n]);
5795
5804
  Array.isArray(s) ? t.push.apply(t, s) : t.push(s);
5796
5805
  }
5797
5806
  return t;
@@ -5810,42 +5819,42 @@ function fc(e, t) {
5810
5819
  ), a;
5811
5820
  };
5812
5821
  }
5813
- var Yn = Symbol("fallback");
5814
- function kn(e) {
5822
+ var Qn = Symbol("fallback");
5823
+ function Ln(e) {
5815
5824
  for (let t = 0; t < e.length; t++)
5816
5825
  e[t]();
5817
5826
  }
5818
5827
  function gc(e, t, n = {}) {
5819
5828
  let s = [], a = [], i = [], l = 0, o = t.length > 1 ? [] : null;
5820
- return Ft(() => kn(i)), () => {
5829
+ return Ft(() => Ln(i)), () => {
5821
5830
  let c = e() || [], h = c.length, g, d;
5822
5831
  return c[Wr], Ce(() => {
5823
- let p, y, S, v, x, R, E, b, T;
5832
+ let y, p, S, v, x, G, E, b, T;
5824
5833
  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);
5834
+ l !== 0 && (Ln(i), i = [], s = [], a = [], l = 0, o && (o = [])), n.fallback && (s = [Qn], a[0] = lt((U) => (i[0] = U, n.fallback())), l = 1);
5826
5835
  else if (l === 0) {
5827
5836
  for (a = new Array(h), d = 0; d < h; d++)
5828
5837
  s[d] = c[d], a[d] = lt(w);
5829
5838
  l = h;
5830
5839
  } 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++)
5840
+ 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
5841
  ;
5833
- for (E = l - 1, b = h - 1; E >= R && b >= R && s[E] === c[b]; E--, b--)
5842
+ for (E = l - 1, b = h - 1; E >= G && b >= G && s[E] === c[b]; E--, b--)
5834
5843
  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++)
5844
+ for (y = /* @__PURE__ */ new Map(), p = new Array(b + 1), d = b; d >= G; d--)
5845
+ T = c[d], g = y.get(T), p[d] = g === void 0 ? -1 : g, y.set(T, d);
5846
+ for (g = G; g <= E; g++)
5847
+ 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]();
5848
+ for (d = G; d < h; d++)
5840
5849
  d in S ? (a[d] = S[d], i[d] = v[d], o && (o[d] = x[d], o[d](d))) : a[d] = lt(w);
5841
5850
  a = a.slice(0, l = h), s = c.slice(0);
5842
5851
  }
5843
5852
  return a;
5844
5853
  });
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);
5854
+ function w(y) {
5855
+ if (i[d] = y, o) {
5856
+ const [p, S] = ve(d);
5857
+ return o[d] = S, t(c[d], p);
5849
5858
  }
5850
5859
  return t(c[d]);
5851
5860
  }
@@ -5853,12 +5862,12 @@ function gc(e, t, n = {}) {
5853
5862
  }
5854
5863
  function pc(e, t, n = {}) {
5855
5864
  let s = [], a = [], i = [], l = [], o = 0, c;
5856
- return Ft(() => kn(i)), () => {
5865
+ return Ft(() => Ln(i)), () => {
5857
5866
  const h = e() || [], g = h.length;
5858
5867
  return h[Wr], Ce(() => {
5859
5868
  if (g === 0)
5860
- return o !== 0 && (kn(i), i = [], s = [], a = [], o = 0, l = []), n.fallback && (s = [Yn], a[0] = lt((w) => (i[0] = w, n.fallback())), o = 1), a;
5861
- for (s[0] === Yn && (i[0](), i = [], s = [], a = [], o = 0), c = 0; c < g; c++)
5869
+ return o !== 0 && (Ln(i), i = [], s = [], a = [], o = 0, l = []), n.fallback && (s = [Qn], a[0] = lt((w) => (i[0] = w, n.fallback())), o = 1), a;
5870
+ for (s[0] === Qn && (i[0](), i = [], s = [], a = [], o = 0), c = 0; c < g; c++)
5862
5871
  c < s.length && s[c] !== h[c] ? l[c](() => h[c]) : c >= s.length && (a[c] = lt(d));
5863
5872
  for (; c < s.length; c++)
5864
5873
  i[c]();
@@ -5866,8 +5875,8 @@ function pc(e, t, n = {}) {
5866
5875
  });
5867
5876
  function d(w) {
5868
5877
  i[c] = w;
5869
- const [p, y] = ve(h[c]);
5870
- return l[c] = y, t(p, c);
5878
+ const [y, p] = ve(h[c]);
5879
+ return l[c] = p, t(y, c);
5871
5880
  }
5872
5881
  };
5873
5882
  }
@@ -5877,12 +5886,12 @@ function sa(e, t) {
5877
5886
  function vn() {
5878
5887
  return !0;
5879
5888
  }
5880
- var Qn = {
5889
+ var Xn = {
5881
5890
  get(e, t, n) {
5882
- return t === Tn ? n : e.get(t);
5891
+ return t === Cn ? n : e.get(t);
5883
5892
  },
5884
5893
  has(e, t) {
5885
- return t === Tn ? !0 : e.has(t);
5894
+ return t === Cn ? !0 : e.has(t);
5886
5895
  },
5887
5896
  set: vn,
5888
5897
  deleteProperty: vn,
@@ -5901,7 +5910,7 @@ var Qn = {
5901
5910
  return e.keys();
5902
5911
  }
5903
5912
  };
5904
- function Vn(e) {
5913
+ function jn(e) {
5905
5914
  return (e = typeof e == "function" ? e() : e) ? e : {};
5906
5915
  }
5907
5916
  function yc() {
@@ -5915,32 +5924,32 @@ function ra(...e) {
5915
5924
  let t = !1;
5916
5925
  for (let l = 0; l < e.length; l++) {
5917
5926
  const o = e[l];
5918
- t = t || !!o && Tn in o, e[l] = typeof o == "function" ? (t = !0, Ge(o)) : o;
5927
+ t = t || !!o && Cn in o, e[l] = typeof o == "function" ? (t = !0, Ge(o)) : o;
5919
5928
  }
5920
5929
  if (zr && t)
5921
5930
  return new Proxy(
5922
5931
  {
5923
5932
  get(l) {
5924
5933
  for (let o = e.length - 1; o >= 0; o--) {
5925
- const c = Vn(e[o])[l];
5934
+ const c = jn(e[o])[l];
5926
5935
  if (c !== void 0)
5927
5936
  return c;
5928
5937
  }
5929
5938
  },
5930
5939
  has(l) {
5931
5940
  for (let o = e.length - 1; o >= 0; o--)
5932
- if (l in Vn(e[o]))
5941
+ if (l in jn(e[o]))
5933
5942
  return !0;
5934
5943
  return !1;
5935
5944
  },
5936
5945
  keys() {
5937
5946
  const l = [];
5938
5947
  for (let o = 0; o < e.length; o++)
5939
- l.push(...Object.keys(Vn(e[o])));
5948
+ l.push(...Object.keys(jn(e[o])));
5940
5949
  return [...new Set(l)];
5941
5950
  }
5942
5951
  },
5943
- Qn
5952
+ Xn
5944
5953
  );
5945
5954
  const n = {}, s = /* @__PURE__ */ Object.create(null);
5946
5955
  for (let l = e.length - 1; l >= 0; l--) {
@@ -5973,7 +5982,7 @@ function ra(...e) {
5973
5982
  return a;
5974
5983
  }
5975
5984
  function vc(e, ...t) {
5976
- if (zr && Tn in e) {
5985
+ if (zr && Cn in e) {
5977
5986
  const a = new Set(t.length > 1 ? t.flat() : t[0]), i = t.map((l) => new Proxy(
5978
5987
  {
5979
5988
  get(o) {
@@ -5986,7 +5995,7 @@ function vc(e, ...t) {
5986
5995
  return l.filter((o) => o in e);
5987
5996
  }
5988
5997
  },
5989
- Qn
5998
+ Xn
5990
5999
  ));
5991
6000
  return i.push(
5992
6001
  new Proxy(
@@ -6001,7 +6010,7 @@ function vc(e, ...t) {
6001
6010
  return Object.keys(e).filter((l) => !a.has(l));
6002
6011
  }
6003
6012
  },
6004
- Qn
6013
+ Xn
6005
6014
  )
6006
6015
  ), i;
6007
6016
  }
@@ -6022,7 +6031,7 @@ function aa(e) {
6022
6031
  if (i) {
6023
6032
  const [o, c] = ve();
6024
6033
  O.count || (O.count = 0), O.count++, (n || (n = e())).then((h) => {
6025
- !O.done && Rt(i), O.count--, c(() => h.default), Rt();
6034
+ !O.done && Ut(i), O.count--, c(() => h.default), Ut();
6026
6035
  }), t = o;
6027
6036
  } else if (!t) {
6028
6037
  const [o] = ac(() => (n || (n = e())).then((c) => c.default));
@@ -6034,32 +6043,32 @@ function aa(e) {
6034
6043
  if (!i || O.done)
6035
6044
  return l(a);
6036
6045
  const o = O.context;
6037
- Rt(i);
6046
+ Ut(i);
6038
6047
  const c = l(a);
6039
- return Rt(o), c;
6048
+ return Ut(o), c;
6040
6049
  }) : ""
6041
6050
  );
6042
6051
  };
6043
6052
  return s.preload = () => n || ((n = e()).then((a) => t = () => a.default), n), s;
6044
6053
  }
6045
6054
  var Ec = 0;
6046
- function Xu() {
6055
+ function Zu() {
6047
6056
  return O.context ? O.getNextContextId() : `cl-${Ec++}`;
6048
6057
  }
6049
6058
  var ia = (e) => `Stale read from <${e}>.`;
6050
- function Zu(e) {
6059
+ function Ju(e) {
6051
6060
  const t = "fallback" in e && {
6052
6061
  fallback: () => e.fallback
6053
6062
  };
6054
6063
  return Ge(gc(() => e.each, e.children, t || void 0));
6055
6064
  }
6056
- function Ju(e) {
6065
+ function ed(e) {
6057
6066
  const t = "fallback" in e && {
6058
6067
  fallback: () => e.fallback
6059
6068
  };
6060
6069
  return Ge(pc(() => e.each, e.children, t || void 0));
6061
6070
  }
6062
- function ed(e) {
6071
+ function td(e) {
6063
6072
  const t = e.keyed, n = Ge(() => e.when, void 0, {
6064
6073
  equals: (s, a) => t ? s === a : !s == !a
6065
6074
  });
@@ -6084,7 +6093,7 @@ function ed(e) {
6084
6093
  void 0
6085
6094
  );
6086
6095
  }
6087
- function td(e) {
6096
+ function nd(e) {
6088
6097
  let t = !1;
6089
6098
  const n = (i, l) => (t ? i[1] === l[1] : !i[1] == !l[1]) && i[2] === l[2], s = Zr(() => e.children), a = Ge(
6090
6099
  () => {
@@ -6122,7 +6131,7 @@ function td(e) {
6122
6131
  void 0
6123
6132
  );
6124
6133
  }
6125
- function nd(e) {
6134
+ function sd(e) {
6126
6135
  return e;
6127
6136
  }
6128
6137
  var bc = [
@@ -6331,13 +6340,13 @@ function _c(e, t, n) {
6331
6340
  const g = h.get(t[l]);
6332
6341
  if (g != null)
6333
6342
  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); )
6343
+ let d = l, w = 1, y;
6344
+ for (; ++d < a && d < i && !((y = h.get(t[d])) == null || y !== g + w); )
6336
6345
  w++;
6337
6346
  if (w > g - o) {
6338
- const y = t[l];
6347
+ const p = t[l];
6339
6348
  for (; o < g; )
6340
- e.insertBefore(n[o++], y);
6349
+ e.insertBefore(n[o++], p);
6341
6350
  } else
6342
6351
  e.replaceChild(n[o++], t[l++]);
6343
6352
  } else
@@ -6351,12 +6360,12 @@ var Ot = "_$DX_DELEGATE";
6351
6360
  function la(e, t, n, s = {}) {
6352
6361
  let a;
6353
6362
  return lt((i) => {
6354
- a = i, t === document ? e() : Zn(t, e(), t.firstChild ? null : void 0, n);
6363
+ a = i, t === document ? e() : Jn(t, e(), t.firstChild ? null : void 0, n);
6355
6364
  }, s.owner), () => {
6356
6365
  a(), t.textContent = "";
6357
6366
  };
6358
6367
  }
6359
- function sd(e, t, n) {
6368
+ function rd(e, t, n) {
6360
6369
  let s;
6361
6370
  const a = () => {
6362
6371
  const l = document.createElement("template");
@@ -6371,14 +6380,14 @@ function Ic(e, t = window.document) {
6371
6380
  n.has(i) || (n.add(i), t.addEventListener(i, oa));
6372
6381
  }
6373
6382
  }
6374
- function rd(e = window.document) {
6383
+ function ad(e = window.document) {
6375
6384
  if (e[Ot]) {
6376
6385
  for (let t of e[Ot].keys())
6377
6386
  e.removeEventListener(t, oa);
6378
6387
  delete e[Ot];
6379
6388
  }
6380
6389
  }
6381
- function Xn(e, t, n) {
6390
+ function Zn(e, t, n) {
6382
6391
  ht(e) || (n == null ? e.removeAttribute(t) : e.setAttribute(t, n));
6383
6392
  }
6384
6393
  function kc(e, t, n, s) {
@@ -6399,22 +6408,22 @@ function Gc(e, t, n, s) {
6399
6408
  } else
6400
6409
  e.addEventListener(t, n, typeof n != "function" && n);
6401
6410
  }
6402
- function Rc(e, t, n = {}) {
6411
+ function Uc(e, t, n = {}) {
6403
6412
  const s = Object.keys(t || {}), a = Object.keys(n);
6404
6413
  let i, l;
6405
6414
  for (i = 0, l = a.length; i < l; i++) {
6406
6415
  const o = a[i];
6407
- !o || o === "undefined" || t[o] || (qs(e, o, !1), delete n[o]);
6416
+ !o || o === "undefined" || t[o] || (Hs(e, o, !1), delete n[o]);
6408
6417
  }
6409
6418
  for (i = 0, l = s.length; i < l; i++) {
6410
6419
  const o = s[i], c = !!t[o];
6411
- !o || o === "undefined" || n[o] === c || !c || (qs(e, o, !0), n[o] = c);
6420
+ !o || o === "undefined" || n[o] === c || !c || (Hs(e, o, !0), n[o] = c);
6412
6421
  }
6413
6422
  return n;
6414
6423
  }
6415
- function Uc(e, t, n) {
6424
+ function Rc(e, t, n) {
6416
6425
  if (!t)
6417
- return n ? Xn(e, "style") : t;
6426
+ return n ? Zn(e, "style") : t;
6418
6427
  const s = e.style;
6419
6428
  if (typeof t == "string")
6420
6429
  return s.cssText = t;
@@ -6435,7 +6444,7 @@ function Oc(e, t = {}, n, s) {
6435
6444
  function Bc(e, t, n) {
6436
6445
  return Ce(() => e(t, n));
6437
6446
  }
6438
- function Zn(e, t, n, s) {
6447
+ function Jn(e, t, n, s) {
6439
6448
  if (n !== void 0 && !s && (s = []), typeof t != "function")
6440
6449
  return Ht(e, t, s, n);
6441
6450
  ot((a) => Ht(e, t(), a, n), s);
@@ -6446,13 +6455,13 @@ function Mc(e, t, n, s, a = {}, i = !1) {
6446
6455
  if (!(l in t)) {
6447
6456
  if (l === "children")
6448
6457
  continue;
6449
- a[l] = Hs(e, l, null, a[l], n, i, t);
6458
+ a[l] = Ks(e, l, null, a[l], n, i, t);
6450
6459
  }
6451
6460
  for (const l in t) {
6452
6461
  if (l === "children")
6453
6462
  continue;
6454
6463
  const o = t[l];
6455
- a[l] = Hs(e, l, o, a[l], n, i, t);
6464
+ a[l] = Ks(e, l, o, a[l], n, i, t);
6456
6465
  }
6457
6466
  }
6458
6467
  function Fc(e) {
@@ -6465,17 +6474,17 @@ function ht(e) {
6465
6474
  function qc(e) {
6466
6475
  return e.toLowerCase().replace(/-([a-z])/g, (t, n) => n.toUpperCase());
6467
6476
  }
6468
- function qs(e, t, n) {
6477
+ function Hs(e, t, n) {
6469
6478
  const s = t.trim().split(/\s+/);
6470
6479
  for (let a = 0, i = s.length; a < i; a++)
6471
6480
  e.classList.toggle(s[a], n);
6472
6481
  }
6473
- function Hs(e, t, n, s, a, i, l) {
6482
+ function Ks(e, t, n, s, a, i, l) {
6474
6483
  let o, c, h, g, d;
6475
6484
  if (t === "style")
6476
- return Uc(e, n, s);
6477
- if (t === "classList")
6478
6485
  return Rc(e, n, s);
6486
+ if (t === "classList")
6487
+ return Uc(e, n, s);
6479
6488
  if (n === s)
6480
6489
  return s;
6481
6490
  if (t === "ref")
@@ -6487,14 +6496,14 @@ function Hs(e, t, n, s, a, i, l) {
6487
6496
  const w = t.slice(10);
6488
6497
  s && e.removeEventListener(w, s, !0), n && e.addEventListener(w, n, !0);
6489
6498
  } 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);
6499
+ const w = t.slice(2).toLowerCase(), y = Tc.has(w);
6500
+ if (!y && s) {
6501
+ const p = Array.isArray(s) ? s[0] : s;
6502
+ e.removeEventListener(w, p);
6494
6503
  }
6495
- (p || n) && (Gc(e, w, n, p), p && Ic([w]));
6504
+ (y || n) && (Gc(e, w, n, y), y && Ic([w]));
6496
6505
  } else if (t.slice(0, 5) === "attr:")
6497
- Xn(e, t.slice(5), n);
6506
+ Zn(e, t.slice(5), n);
6498
6507
  else if (t.slice(0, 5) === "bool:")
6499
6508
  Lc(e, t.slice(5), n);
6500
6509
  else if ((d = t.slice(0, 5) === "prop:") || (h = Sc.has(t)) || !a && ((g = xc(t, e.tagName)) || (c = wc.has(t))) || (o = e.nodeName.includes("-") || "is" in l)) {
@@ -6505,7 +6514,7 @@ function Hs(e, t, n, s, a, i, l) {
6505
6514
  t === "class" || t === "className" ? Dc(e, n) : o && !c && !h ? e[qc(t)] = n : e[g || t] = n;
6506
6515
  } else {
6507
6516
  const w = a && t.indexOf(":") > -1 && Pc[t.split(":")[0]];
6508
- w ? kc(e, w, t, n) : Xn(e, Nc[t] || t, n);
6517
+ w ? kc(e, w, t, n) : Zn(e, Nc[t] || t, n);
6509
6518
  }
6510
6519
  return n;
6511
6520
  }
@@ -6586,7 +6595,7 @@ function Ht(e, t, n, s, a) {
6586
6595
  }), () => n;
6587
6596
  if (Array.isArray(t)) {
6588
6597
  const c = [], h = n && Array.isArray(n);
6589
- if (Jn(c, t, n, a))
6598
+ if (es(c, t, n, a))
6590
6599
  return ot(() => n = Ht(e, c, n, s, !0)), () => n;
6591
6600
  if (i) {
6592
6601
  if (!c.length)
@@ -6604,7 +6613,7 @@ function Ht(e, t, n, s, a) {
6604
6613
  if (c.length === 0) {
6605
6614
  if (n = mt(e, n, s), o)
6606
6615
  return n;
6607
- } else h ? n.length === 0 ? Ks(e, c, s) : _c(e, n, c) : (n && mt(e), Ks(e, c));
6616
+ } else h ? n.length === 0 ? Vs(e, c, s) : _c(e, n, c) : (n && mt(e), Vs(e, c));
6608
6617
  n = c;
6609
6618
  } else if (t.nodeType) {
6610
6619
  if (i && t.parentNode)
@@ -6619,7 +6628,7 @@ function Ht(e, t, n, s, a) {
6619
6628
  }
6620
6629
  return n;
6621
6630
  }
6622
- function Jn(e, t, n, s) {
6631
+ function es(e, t, n, s) {
6623
6632
  let a = !1;
6624
6633
  for (let i = 0, l = t.length; i < l; i++) {
6625
6634
  let o = t[i], c = n && n[e.length], h;
@@ -6627,12 +6636,12 @@ function Jn(e, t, n, s) {
6627
6636
  if ((h = typeof o) == "object" && o.nodeType)
6628
6637
  e.push(o);
6629
6638
  else if (Array.isArray(o))
6630
- a = Jn(e, o, c) || a;
6639
+ a = es(e, o, c) || a;
6631
6640
  else if (h === "function")
6632
6641
  if (s) {
6633
6642
  for (; typeof o == "function"; )
6634
6643
  o = o();
6635
- a = Jn(
6644
+ a = es(
6636
6645
  e,
6637
6646
  Array.isArray(o) ? o : [o],
6638
6647
  Array.isArray(c) ? c : [c]
@@ -6646,7 +6655,7 @@ function Jn(e, t, n, s) {
6646
6655
  }
6647
6656
  return a;
6648
6657
  }
6649
- function Ks(e, t, n = null) {
6658
+ function Vs(e, t, n = null) {
6650
6659
  for (let s = 0, a = t.length; s < a; s++)
6651
6660
  e.insertBefore(t[s], n);
6652
6661
  }
@@ -6675,16 +6684,16 @@ var Kc = "http://www.w3.org/2000/svg";
6675
6684
  function ca(e, t = !1) {
6676
6685
  return t ? document.createElementNS(Kc, e) : document.createElement(e);
6677
6686
  }
6678
- function ad(e) {
6679
- const { useShadow: t } = e, n = document.createTextNode(""), s = () => e.mount || document.body, a = Fs();
6687
+ function id(e) {
6688
+ const { useShadow: t } = e, n = document.createTextNode(""), s = () => e.mount || document.body, a = qs();
6680
6689
  let i, l = !!O.context;
6681
6690
  return Xr(
6682
6691
  () => {
6683
- l && (Fs().user = l = !1), i || (i = lc(a, () => Ge(() => e.children)));
6692
+ l && (qs().user = l = !1), i || (i = lc(a, () => Ge(() => e.children)));
6684
6693
  const o = s();
6685
6694
  if (o instanceof HTMLHeadElement) {
6686
6695
  const [c, h] = ve(!1), g = () => h(!0);
6687
- lt((d) => Zn(o, () => c() ? d() : i(), null)), Ft(g);
6696
+ lt((d) => Jn(o, () => c() ? d() : i(), null)), Ft(g);
6688
6697
  } else {
6689
6698
  const c = ca(e.isSVG ? "g" : "div", e.isSVG), h = t && c.attachShadow ? c.attachShadow({
6690
6699
  mode: "open"
@@ -6694,7 +6703,7 @@ function ad(e) {
6694
6703
  return n.parentNode;
6695
6704
  },
6696
6705
  configurable: !0
6697
- }), Zn(h, i), o.appendChild(c), e.ref && e.ref(c), Ft(() => o.removeChild(c));
6706
+ }), Jn(h, i), o.appendChild(c), e.ref && e.ref(c), Ft(() => o.removeChild(c));
6698
6707
  }
6699
6708
  },
6700
6709
  void 0,
@@ -6703,7 +6712,7 @@ function ad(e) {
6703
6712
  }
6704
6713
  ), n;
6705
6714
  }
6706
- function id(e) {
6715
+ function ld(e) {
6707
6716
  const [t, n] = vc(e, ["component"]), s = Ge(() => t.component);
6708
6717
  return Ge(() => {
6709
6718
  const a = s();
@@ -6781,10 +6790,10 @@ function zc(e, t) {
6781
6790
  function kt(e, t) {
6782
6791
  Object.entries(e).forEach(([n, s]) => t(s, n));
6783
6792
  }
6784
- function An(e, t) {
6793
+ function xn(e, t) {
6785
6794
  return e.indexOf(t) !== -1;
6786
6795
  }
6787
- function Vs(e, t) {
6796
+ function js(e, t) {
6788
6797
  for (let n = 0; n < e.length; n++) {
6789
6798
  const s = e[n];
6790
6799
  if (t(s))
@@ -6804,7 +6813,7 @@ var Wc = class {
6804
6813
  findByName(e) {
6805
6814
  return this.transfomers[e];
6806
6815
  }
6807
- }, Yc = (e) => Object.prototype.toString.call(e).slice(8, -1), da = (e) => typeof e > "u", Qc = (e) => e === null, Kt = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, es = (e) => Kt(e) && Object.keys(e).length === 0, nt = (e) => Array.isArray(e), Xc = (e) => typeof e == "string", Zc = (e) => typeof e == "number" && !isNaN(e), Jc = (e) => typeof e == "boolean", eu = (e) => e instanceof RegExp, Vt = (e) => e instanceof Map, jt = (e) => e instanceof Set, ha = (e) => Yc(e) === "Symbol", tu = (e) => e instanceof Date && !isNaN(e.valueOf()), nu = (e) => e instanceof Error, js = (e) => typeof e == "number" && isNaN(e), su = (e) => Jc(e) || Qc(e) || da(e) || Zc(e) || Xc(e) || ha(e), ru = (e) => typeof e == "bigint", au = (e) => e === 1 / 0 || e === -1 / 0, iu = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), lu = (e) => e instanceof URL, ma = (e) => e.replace(/\./g, "\\."), jn = (e) => e.map(String).map(ma).join("."), Bt = (e) => {
6816
+ }, Yc = (e) => Object.prototype.toString.call(e).slice(8, -1), da = (e) => typeof e > "u", Qc = (e) => e === null, Kt = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, ts = (e) => Kt(e) && Object.keys(e).length === 0, nt = (e) => Array.isArray(e), Xc = (e) => typeof e == "string", Zc = (e) => typeof e == "number" && !isNaN(e), Jc = (e) => typeof e == "boolean", eu = (e) => e instanceof RegExp, Vt = (e) => e instanceof Map, jt = (e) => e instanceof Set, ha = (e) => Yc(e) === "Symbol", tu = (e) => e instanceof Date && !isNaN(e.valueOf()), nu = (e) => e instanceof Error, $s = (e) => typeof e == "number" && isNaN(e), su = (e) => Jc(e) || Qc(e) || da(e) || Zc(e) || Xc(e) || ha(e), ru = (e) => typeof e == "bigint", au = (e) => e === 1 / 0 || e === -1 / 0, iu = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), lu = (e) => e instanceof URL, ma = (e) => e.replace(/\./g, "\\."), $n = (e) => e.map(String).map(ma).join("."), Bt = (e) => {
6808
6817
  const t = [];
6809
6818
  let n = "";
6810
6819
  for (let a = 0; a < e.length; a++) {
@@ -6862,11 +6871,11 @@ var fa = [
6862
6871
  (e) => new Set(e)
6863
6872
  ),
6864
6873
  ze(Vt, "map", (e) => [...e.entries()], (e) => new Map(e)),
6865
- ze((e) => js(e) || au(e), "number", (e) => js(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
6874
+ ze((e) => $s(e) || au(e), "number", (e) => $s(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
6866
6875
  ze((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
6867
6876
  ze(lu, "URL", (e) => e.toString(), (e) => new URL(e))
6868
6877
  ];
6869
- function Bn(e, t, n, s) {
6878
+ function Mn(e, t, n, s) {
6870
6879
  return {
6871
6880
  isApplicable: e,
6872
6881
  annotation: t,
@@ -6874,7 +6883,7 @@ function Bn(e, t, n, s) {
6874
6883
  untransform: s
6875
6884
  };
6876
6885
  }
6877
- var ga = Bn((e, t) => ha(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, n) => {
6886
+ var ga = Mn((e, t) => ha(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, n) => {
6878
6887
  const s = n.symbolRegistry.getValue(t[1]);
6879
6888
  if (!s)
6880
6889
  throw new Error("Trying to deserialize unknown symbol");
@@ -6889,7 +6898,7 @@ var ga = Bn((e, t) => ha(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) =
6889
6898
  Float32Array,
6890
6899
  Float64Array,
6891
6900
  Uint8ClampedArray
6892
- ].reduce((e, t) => (e[t.name] = t, e), {}), pa = Bn(iu, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
6901
+ ].reduce((e, t) => (e[t.name] = t, e), {}), pa = Mn(iu, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
6893
6902
  const n = ou[t[1]];
6894
6903
  if (!n)
6895
6904
  throw new Error("Trying to deserialize unknown typed array");
@@ -6898,7 +6907,7 @@ var ga = Bn((e, t) => ha(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) =
6898
6907
  function ya(e, t) {
6899
6908
  return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
6900
6909
  }
6901
- var va = Bn(ya, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
6910
+ var va = Mn(ya, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
6902
6911
  const n = t.classRegistry.getAllowedProps(e.constructor);
6903
6912
  if (!n)
6904
6913
  return { ...e };
@@ -6911,19 +6920,19 @@ var va = Bn(ya, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)
6911
6920
  if (!s)
6912
6921
  throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");
6913
6922
  return Object.assign(Object.create(s.prototype), e);
6914
- }), Ea = Bn((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, n) => {
6923
+ }), Ea = Mn((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, n) => {
6915
6924
  const s = n.customTransformerRegistry.findByName(t[1]);
6916
6925
  if (!s)
6917
6926
  throw new Error("Trying to deserialize unknown custom value");
6918
6927
  return s.deserialize(e);
6919
- }), cu = [va, ga, Ea, pa], $s = (e, t) => {
6920
- const n = Vs(cu, (a) => a.isApplicable(e, t));
6928
+ }), cu = [va, ga, Ea, pa], zs = (e, t) => {
6929
+ const n = js(cu, (a) => a.isApplicable(e, t));
6921
6930
  if (n)
6922
6931
  return {
6923
6932
  value: n.transform(e, t),
6924
6933
  type: n.annotation(e, t)
6925
6934
  };
6926
- const s = Vs(fa, (a) => a.isApplicable(e, t));
6935
+ const s = js(fa, (a) => a.isApplicable(e, t));
6927
6936
  if (s)
6928
6937
  return {
6929
6938
  value: s.transform(e, t),
@@ -6960,11 +6969,11 @@ var uu = (e, t, n) => {
6960
6969
  return n.next().value;
6961
6970
  };
6962
6971
  function wa(e) {
6963
- if (An(e, "__proto__"))
6972
+ if (xn(e, "__proto__"))
6964
6973
  throw new Error("__proto__ is not allowed as a property");
6965
- if (An(e, "prototype"))
6974
+ if (xn(e, "prototype"))
6966
6975
  throw new Error("prototype is not allowed as a property");
6967
- if (An(e, "constructor"))
6976
+ if (xn(e, "constructor"))
6968
6977
  throw new Error("constructor is not allowed as a property");
6969
6978
  }
6970
6979
  var du = (e, t) => {
@@ -6987,7 +6996,7 @@ var du = (e, t) => {
6987
6996
  e = e[s];
6988
6997
  }
6989
6998
  return e;
6990
- }, ts = (e, t, n) => {
6999
+ }, ns = (e, t, n) => {
6991
7000
  if (wa(t), t.length === 0)
6992
7001
  return n(e);
6993
7002
  let s = e;
@@ -7036,34 +7045,34 @@ var du = (e, t) => {
7036
7045
  }
7037
7046
  return e;
7038
7047
  };
7039
- function ns(e, t, n = []) {
7048
+ function ss(e, t, n = []) {
7040
7049
  if (!e)
7041
7050
  return;
7042
7051
  if (!nt(e)) {
7043
- kt(e, (i, l) => ns(i, t, [...n, ...Bt(l)]));
7052
+ kt(e, (i, l) => ss(i, t, [...n, ...Bt(l)]));
7044
7053
  return;
7045
7054
  }
7046
7055
  const [s, a] = e;
7047
7056
  a && kt(a, (i, l) => {
7048
- ns(i, t, [...n, ...Bt(l)]);
7057
+ ss(i, t, [...n, ...Bt(l)]);
7049
7058
  }), t(s, n);
7050
7059
  }
7051
7060
  function hu(e, t, n) {
7052
- return ns(t, (s, a) => {
7053
- e = ts(e, a, (i) => uu(i, s, n));
7061
+ return ss(t, (s, a) => {
7062
+ e = ns(e, a, (i) => uu(i, s, n));
7054
7063
  }), e;
7055
7064
  }
7056
7065
  function mu(e, t) {
7057
7066
  function n(s, a) {
7058
7067
  const i = du(e, Bt(a));
7059
7068
  s.map(Bt).forEach((l) => {
7060
- e = ts(e, l, () => i);
7069
+ e = ns(e, l, () => i);
7061
7070
  });
7062
7071
  }
7063
7072
  if (nt(t)) {
7064
7073
  const [s, a] = t;
7065
7074
  s.forEach((i) => {
7066
- e = ts(e, Bt(i), () => e);
7075
+ e = ns(e, Bt(i), () => e);
7067
7076
  }), a && kt(a, n);
7068
7077
  } else
7069
7078
  kt(t, n);
@@ -7082,42 +7091,42 @@ function pu(e, t) {
7082
7091
  return;
7083
7092
  t || (a = a.map((o) => o.map(String)).sort((o, c) => o.length - c.length));
7084
7093
  const [i, ...l] = a;
7085
- i.length === 0 ? s = l.map(jn) : n[jn(i)] = l.map(jn);
7086
- }), s ? es(n) ? [s] : [s, n] : es(n) ? void 0 : n;
7094
+ i.length === 0 ? s = l.map($n) : n[$n(i)] = l.map($n);
7095
+ }), s ? ts(n) ? [s] : [s, n] : ts(n) ? void 0 : n;
7087
7096
  }
7088
7097
  var Sa = (e, t, n, s, a = [], i = [], l = /* @__PURE__ */ new Map()) => {
7089
7098
  const o = su(e);
7090
7099
  if (!o) {
7091
7100
  gu(e, a, t);
7092
- const p = l.get(e);
7093
- if (p)
7101
+ const y = l.get(e);
7102
+ if (y)
7094
7103
  return s ? {
7095
7104
  transformedValue: null
7096
- } : p;
7105
+ } : y;
7097
7106
  }
7098
7107
  if (!fu(e, n)) {
7099
- const p = $s(e, n), y = p ? {
7100
- transformedValue: p.value,
7101
- annotations: [p.type]
7108
+ const y = zs(e, n), p = y ? {
7109
+ transformedValue: y.value,
7110
+ annotations: [y.type]
7102
7111
  } : {
7103
7112
  transformedValue: e
7104
7113
  };
7105
- return o || l.set(e, y), y;
7114
+ return o || l.set(e, p), p;
7106
7115
  }
7107
- if (An(i, e))
7116
+ if (xn(i, e))
7108
7117
  return {
7109
7118
  transformedValue: null
7110
7119
  };
7111
- 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;
7120
+ const c = zs(e, n), h = (c == null ? void 0 : c.value) ?? e, g = nt(h) ? [] : {}, d = {};
7121
+ kt(h, (y, p) => {
7122
+ if (p === "__proto__" || p === "constructor" || p === "prototype")
7123
+ throw new Error(`Detected property ${p}. This is a prototype pollution risk, please remove it from your object.`);
7124
+ const S = Sa(y, t, n, s, [...a, p], [...i, e], l);
7125
+ g[p] = S.transformedValue, nt(S.annotations) ? d[p] = S.annotations : Kt(S.annotations) && kt(S.annotations, (v, x) => {
7126
+ d[ma(p) + "." + x] = v;
7118
7127
  });
7119
7128
  });
7120
- const w = es(d) ? {
7129
+ const w = ts(d) ? {
7121
7130
  transformedValue: g,
7122
7131
  annotations: c ? [c.type] : void 0
7123
7132
  } : {
@@ -7129,7 +7138,7 @@ var Sa = (e, t, n, s, a = [], i = [], l = /* @__PURE__ */ new Map()) => {
7129
7138
  function Na(e) {
7130
7139
  return Object.prototype.toString.call(e).slice(8, -1);
7131
7140
  }
7132
- function zs(e) {
7141
+ function Ws(e) {
7133
7142
  return Na(e) === "Array";
7134
7143
  }
7135
7144
  function yu(e) {
@@ -7147,16 +7156,16 @@ function vu(e, t, n, s, a) {
7147
7156
  configurable: !0
7148
7157
  });
7149
7158
  }
7150
- function ss(e, t = {}) {
7151
- if (zs(e))
7152
- return e.map((a) => ss(a, t));
7159
+ function rs(e, t = {}) {
7160
+ if (Ws(e))
7161
+ return e.map((a) => rs(a, t));
7153
7162
  if (!yu(e))
7154
7163
  return e;
7155
7164
  const n = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
7156
7165
  return [...n, ...s].reduce((a, i) => {
7157
- if (zs(t.props) && !t.props.includes(i))
7166
+ if (Ws(t.props) && !t.props.includes(i))
7158
7167
  return a;
7159
- const l = e[i], o = ss(l, t);
7168
+ const l = e[i], o = rs(l, t);
7160
7169
  return vu(a, i, o, e, t.nonenumerable), a;
7161
7170
  }, {});
7162
7171
  }
@@ -7183,7 +7192,7 @@ var ae = class {
7183
7192
  }
7184
7193
  deserialize(e) {
7185
7194
  const { json: t, meta: n } = e;
7186
- let s = ss(t);
7195
+ let s = rs(t);
7187
7196
  return n != null && n.values && (s = hu(s, n.values, this)), n != null && n.referentialEqualities && (s = mu(s, n.referentialEqualities)), s;
7188
7197
  }
7189
7198
  stringify(e) {
@@ -7217,42 +7226,42 @@ ae.registerClass = ae.defaultInstance.registerClass.bind(ae.defaultInstance);
7217
7226
  ae.registerSymbol = ae.defaultInstance.registerSymbol.bind(ae.defaultInstance);
7218
7227
  ae.registerCustom = ae.defaultInstance.registerCustom.bind(ae.defaultInstance);
7219
7228
  ae.allowErrorProps = ae.defaultInstance.allowErrorProps.bind(ae.defaultInstance);
7220
- var Eu = ae.serialize, ld = ae.stringify;
7221
- function od(e) {
7229
+ var Eu = ae.serialize, od = ae.stringify;
7230
+ function cd(e) {
7222
7231
  return e.state.fetchStatus === "fetching" ? "fetching" : e.getObserversCount() ? e.state.fetchStatus === "paused" ? "paused" : e.isStale() ? "stale" : "fresh" : "inactive";
7223
7232
  }
7224
- function cd(e, t) {
7233
+ function ud(e, t) {
7225
7234
  return `${e}${t.charAt(0).toUpperCase() + t.slice(1)}`;
7226
7235
  }
7227
- function ud({
7236
+ function dd({
7228
7237
  queryState: e,
7229
7238
  observerCount: t,
7230
7239
  isStale: n
7231
7240
  }) {
7232
7241
  return e.fetchStatus === "fetching" ? "blue" : t ? e.fetchStatus === "paused" ? "purple" : n ? "yellow" : "green" : "gray";
7233
7242
  }
7234
- function dd({
7243
+ function hd({
7235
7244
  status: e,
7236
7245
  isPaused: t
7237
7246
  }) {
7238
7247
  return t ? "purple" : e === "error" ? "red" : e === "pending" ? "yellow" : e === "success" ? "green" : "gray";
7239
7248
  }
7240
- function hd(e) {
7249
+ function md(e) {
7241
7250
  return e === "fresh" ? "green" : e === "stale" ? "yellow" : e === "paused" ? "purple" : e === "inactive" ? "gray" : "blue";
7242
7251
  }
7243
- var md = (e, t = !1) => {
7252
+ var fd = (e, t = !1) => {
7244
7253
  const {
7245
7254
  json: n
7246
7255
  } = Eu(e);
7247
7256
  return JSON.stringify(n, null, t ? 2 : void 0);
7248
- }, En = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, bu = (e, t) => e.queryHash.localeCompare(t.queryHash), Aa = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, wu = (e, t) => En(e) === En(t) ? Aa(e, t) : En(e) > En(t) ? 1 : -1, fd = {
7257
+ }, En = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, bu = (e, t) => e.queryHash.localeCompare(t.queryHash), Aa = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, wu = (e, t) => En(e) === En(t) ? Aa(e, t) : En(e) > En(t) ? 1 : -1, gd = {
7249
7258
  status: wu,
7250
7259
  "query hash": bu,
7251
7260
  "last updated": Aa
7252
- }, bn = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3, xa = (e, t) => e.state.submittedAt < t.state.submittedAt ? 1 : -1, Su = (e, t) => bn(e) === bn(t) ? xa(e, t) : bn(e) > bn(t) ? 1 : -1, gd = {
7261
+ }, bn = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3, xa = (e, t) => e.state.submittedAt < t.state.submittedAt ? 1 : -1, Su = (e, t) => bn(e) === bn(t) ? xa(e, t) : bn(e) > bn(t) ? 1 : -1, pd = {
7253
7262
  status: Su,
7254
7263
  "last updated": xa
7255
- }, pd = (e) => e * parseFloat(getComputedStyle(document.documentElement).fontSize), yd = () => {
7264
+ }, yd = (e) => e * parseFloat(getComputedStyle(document.documentElement).fontSize), vd = () => {
7256
7265
  const [e, t] = ve("dark");
7257
7266
  return ic(() => {
7258
7267
  const n = window.matchMedia("(prefers-color-scheme: dark)");
@@ -7327,7 +7336,7 @@ var md = (e, t = !1) => {
7327
7336
  return;
7328
7337
  const s = document.createElement("style"), a = document.createTextNode("");
7329
7338
  s.appendChild(a), s.id = "_goober", s.setAttribute("nonce", e), t ? t.appendChild(s) : document.head.appendChild(s);
7330
- }, gt, $t, zt, Wt, at, Yt, pt, yt, vt, Et, bt, wt, Qt, Ws, Nu = (Ws = class {
7339
+ }, gt, $t, zt, Wt, at, Yt, pt, yt, vt, Et, bt, wt, Qt, Ys, Nu = (Ys = class {
7331
7340
  constructor(e) {
7332
7341
  se(this, gt);
7333
7342
  se(this, $t);
@@ -7357,38 +7366,38 @@ var md = (e, t = !1) => {
7357
7366
  ee(this, gt, ve(t)), ee(this, zt, n), ee(this, Wt, s), ee(this, $t, a), ee(this, Yt, h), ee(this, pt, g), ee(this, yt, ve(i)), ee(this, vt, ve(l)), ee(this, Et, ve(o)), ee(this, bt, ve(c));
7358
7367
  }
7359
7368
  setButtonPosition(e) {
7360
- U(this, yt)[1](e);
7369
+ R(this, yt)[1](e);
7361
7370
  }
7362
7371
  setPosition(e) {
7363
- U(this, vt)[1](e);
7372
+ R(this, vt)[1](e);
7364
7373
  }
7365
7374
  setInitialIsOpen(e) {
7366
- U(this, Et)[1](e);
7375
+ R(this, Et)[1](e);
7367
7376
  }
7368
7377
  setErrorTypes(e) {
7369
- U(this, bt)[1](e);
7378
+ R(this, bt)[1](e);
7370
7379
  }
7371
7380
  setClient(e) {
7372
- U(this, gt)[1](e);
7381
+ R(this, gt)[1](e);
7373
7382
  }
7374
7383
  mount(e) {
7375
- if (U(this, at))
7384
+ if (R(this, at))
7376
7385
  throw new Error("Devtools is already mounted");
7377
7386
  const t = la(() => {
7378
- const n = this, [s] = U(this, yt), [a] = U(this, vt), [i] = U(this, Et), [l] = U(this, bt), [o] = U(this, gt);
7387
+ const n = this, [s] = R(this, yt), [a] = R(this, vt), [i] = R(this, Et), [l] = R(this, bt), [o] = R(this, gt);
7379
7388
  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({
7389
+ return R(this, wt) ? c = R(this, wt) : (c = aa(() => import("./HO4MOOFI-B0re9LoG.js")), ee(this, wt, c)), Ta(R(this, Yt), R(this, pt)), sa(c, ra({
7381
7390
  get queryFlavor() {
7382
- return U(n, zt);
7391
+ return R(n, zt);
7383
7392
  },
7384
7393
  get version() {
7385
- return U(n, Wt);
7394
+ return R(n, Wt);
7386
7395
  },
7387
7396
  get onlineManager() {
7388
- return U(n, $t);
7397
+ return R(n, $t);
7389
7398
  },
7390
7399
  get shadowDOMTarget() {
7391
- return U(n, pt);
7400
+ return R(n, pt);
7392
7401
  }
7393
7402
  }, {
7394
7403
  get client() {
@@ -7412,11 +7421,11 @@ var md = (e, t = !1) => {
7412
7421
  }
7413
7422
  unmount() {
7414
7423
  var e;
7415
- if (!U(this, at))
7424
+ if (!R(this, at))
7416
7425
  throw new Error("Devtools is not mounted");
7417
- (e = U(this, Qt)) == null || e.call(this), ee(this, at, !1);
7426
+ (e = R(this, Qt)) == null || e.call(this), ee(this, at, !1);
7418
7427
  }
7419
- }, gt = new WeakMap(), $t = new WeakMap(), zt = new WeakMap(), Wt = new WeakMap(), at = new WeakMap(), Yt = new WeakMap(), pt = new WeakMap(), yt = new WeakMap(), vt = new WeakMap(), Et = new WeakMap(), bt = new WeakMap(), wt = new WeakMap(), Qt = new WeakMap(), Ws), St, Xt, Zt, Jt, it, en, Nt, At, xt, Tt, Ct, Pt, _t, tn, Ys, Au = (Ys = class {
7428
+ }, gt = new WeakMap(), $t = new WeakMap(), zt = new WeakMap(), Wt = new WeakMap(), at = new WeakMap(), Yt = new WeakMap(), pt = new WeakMap(), yt = new WeakMap(), vt = new WeakMap(), Et = new WeakMap(), bt = new WeakMap(), wt = new WeakMap(), Qt = new WeakMap(), Ys), St, Xt, Zt, Jt, it, en, Nt, At, xt, Tt, Ct, Pt, _t, tn, Qs, Au = (Qs = class {
7420
7429
  constructor(e) {
7421
7430
  se(this, St);
7422
7431
  se(this, Xt);
@@ -7448,41 +7457,41 @@ var md = (e, t = !1) => {
7448
7457
  ee(this, St, ve(t)), ee(this, Zt, n), ee(this, Jt, s), ee(this, Xt, a), ee(this, en, h), ee(this, Nt, g), ee(this, At, ve(i)), ee(this, xt, ve(l)), ee(this, Tt, ve(o)), ee(this, Ct, ve(c)), ee(this, Pt, ve(d));
7449
7458
  }
7450
7459
  setButtonPosition(e) {
7451
- U(this, At)[1](e);
7460
+ R(this, At)[1](e);
7452
7461
  }
7453
7462
  setPosition(e) {
7454
- U(this, xt)[1](e);
7463
+ R(this, xt)[1](e);
7455
7464
  }
7456
7465
  setInitialIsOpen(e) {
7457
- U(this, Tt)[1](e);
7466
+ R(this, Tt)[1](e);
7458
7467
  }
7459
7468
  setErrorTypes(e) {
7460
- U(this, Ct)[1](e);
7469
+ R(this, Ct)[1](e);
7461
7470
  }
7462
7471
  setClient(e) {
7463
- U(this, St)[1](e);
7472
+ R(this, St)[1](e);
7464
7473
  }
7465
7474
  setOnClose(e) {
7466
- U(this, Pt)[1](() => e);
7475
+ R(this, Pt)[1](() => e);
7467
7476
  }
7468
7477
  mount(e) {
7469
- if (U(this, it))
7478
+ if (R(this, it))
7470
7479
  throw new Error("Devtools is already mounted");
7471
7480
  const t = la(() => {
7472
- 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);
7481
+ const n = this, [s] = R(this, At), [a] = R(this, xt), [i] = R(this, Tt), [l] = R(this, Ct), [o] = R(this, St), [c] = R(this, Pt);
7473
7482
  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({
7483
+ return R(this, _t) ? h = R(this, _t) : (h = aa(() => import("./HUY7CZI3-Bhnn9mlN.js")), ee(this, _t, h)), Ta(R(this, en), R(this, Nt)), sa(h, ra({
7475
7484
  get queryFlavor() {
7476
- return U(n, Zt);
7485
+ return R(n, Zt);
7477
7486
  },
7478
7487
  get version() {
7479
- return U(n, Jt);
7488
+ return R(n, Jt);
7480
7489
  },
7481
7490
  get onlineManager() {
7482
- return U(n, Xt);
7491
+ return R(n, Xt);
7483
7492
  },
7484
7493
  get shadowDOMTarget() {
7485
- return U(n, Nt);
7494
+ return R(n, Nt);
7486
7495
  }
7487
7496
  }, {
7488
7497
  get client() {
@@ -7509,11 +7518,11 @@ var md = (e, t = !1) => {
7509
7518
  }
7510
7519
  unmount() {
7511
7520
  var e;
7512
- if (!U(this, it))
7521
+ if (!R(this, it))
7513
7522
  throw new Error("Devtools is not mounted");
7514
- (e = U(this, tn)) == null || e.call(this), ee(this, it, !1);
7523
+ (e = R(this, tn)) == null || e.call(this), ee(this, it, !1);
7515
7524
  }
7516
- }, St = new WeakMap(), Xt = new WeakMap(), Zt = new WeakMap(), Jt = new WeakMap(), it = new WeakMap(), en = new WeakMap(), Nt = new WeakMap(), At = new WeakMap(), xt = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), Pt = new WeakMap(), _t = new WeakMap(), tn = new WeakMap(), Ys);
7525
+ }, St = new WeakMap(), Xt = new WeakMap(), Zt = new WeakMap(), Jt = new WeakMap(), it = new WeakMap(), en = new WeakMap(), Nt = new WeakMap(), At = new WeakMap(), xt = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), Pt = new WeakMap(), _t = new WeakMap(), tn = new WeakMap(), Qs);
7517
7526
  function xu(e) {
7518
7527
  const t = Se(e.client), n = ce.useRef(null), {
7519
7528
  buttonPosition: s,
@@ -7588,26 +7597,29 @@ var Cu = process.env.NODE_ENV !== "development" ? function() {
7588
7597
  return null;
7589
7598
  } : xu;
7590
7599
  process.env.NODE_ENV;
7591
- ll();
7592
- Qo();
7593
- ii(Go);
7594
- li(Rl);
7595
- oi(ec);
7596
- $n("user-info", Jo);
7597
- const Pu = (e) => {
7598
- const t = ct([]), [n] = Re(), s = n.get("page"), a = n.get("lang"), { data: i } = Ue(), {
7600
+ const Pu = Wa(
7601
+ () => import("./digital-asset-manager-BZ6Gatq3.js")
7602
+ );
7603
+ ol();
7604
+ Xo();
7605
+ li(Uo);
7606
+ oi(Pu);
7607
+ ci(Rl);
7608
+ zn("user-info", ec);
7609
+ const _u = (e) => {
7610
+ const t = ct([]), [n] = Ue(), s = n.get("page"), a = n.get("lang"), { data: i } = Re(), {
7599
7611
  data: l = {
7600
7612
  role: "",
7601
7613
  permissions: null
7602
7614
  }
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(
7615
+ } = Fo(), { data: o } = Mo(), { data: c, isFetching: h } = Br(), { blocks: g } = Bo(c), { data: d } = un(), { data: w } = Ie(), { mutateAsync: y } = Ur(), p = Ro(), { getUILibraryBlock: S, getUILibraryBlocks: v, onSave: x } = qo(), { getPartialBlocks: G, getPartialBlockBlocks: E } = Ho(), { aiContext: b, setAiContext: T } = Es(), { mutateAsync: U } = Ml(), [J, ie] = P(!1), k = Y(
7604
7616
  () => (d == null ? void 0 : d.fallbackLang) || "en",
7605
7617
  [d]
7606
7618
  ), { data: q } = Mr({
7607
7619
  pageType: i == null ? void 0 : i.pageType,
7608
7620
  lang: a || k
7609
7621
  });
7610
- bl(), we(() => {
7622
+ wl(), we(() => {
7611
7623
  const z = () => {
7612
7624
  document.hidden ? ie(!0) : ie(!1);
7613
7625
  };
@@ -7617,8 +7629,8 @@ const Pu = (e) => {
7617
7629
  const z = {};
7618
7630
  return l && (z.permissions = te(l, "permissions", null), z.role = te(l, "role", "user")), z;
7619
7631
  }, [l]), M = Y(() => o, [o]), ne = _e(
7620
- async (z, de) => await G({ pageType: z, query: de }),
7621
- [G]
7632
+ async (z, de) => await U({ pageType: z, query: de }),
7633
+ [U]
7622
7634
  ), he = Y(
7623
7635
  () => te(d, "theme", {}) || {},
7624
7636
  [d]
@@ -7626,7 +7638,7 @@ const Pu = (e) => {
7626
7638
  return /* @__PURE__ */ u(be, { children: [
7627
7639
  h && /* @__PURE__ */ r("div", { className: "absolute inset-0 z-50 flex items-center justify-center w-screen h-screen bg-white/30", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center bg-white rounded-full size-10", children: /* @__PURE__ */ r(Dr, { className: "size-5 animate-spin" }) }) }),
7628
7640
  /* @__PURE__ */ r(
7629
- ci,
7641
+ ui,
7630
7642
  {
7631
7643
  pageExternalData: q,
7632
7644
  themePresets: e.themePresets ?? [],
@@ -7642,7 +7654,7 @@ const Pu = (e) => {
7642
7654
  autoSaveInterval: e.autoSaveInterval ?? 15,
7643
7655
  onError: e.onError || console.error,
7644
7656
  getPartialBlockBlocks: E,
7645
- getPartialBlocks: R,
7657
+ getPartialBlocks: G,
7646
7658
  blocks: h ? [] : g,
7647
7659
  theme: za(he),
7648
7660
  getUILibraryBlock: S,
@@ -7654,39 +7666,39 @@ const Pu = (e) => {
7654
7666
  if (!s) return !0;
7655
7667
  const de = t.current, F = {
7656
7668
  _type: "@chai/ai-context",
7657
- _value: ks(z) ? z : ""
7669
+ _value: Ls(z) ? z : ""
7658
7670
  }, Ee = [...de, F];
7659
7671
  return await x({ page: s, blocks: Ee }), T(z), !0;
7660
7672
  },
7661
7673
  aiContext: b,
7662
- askAiCallBack: y,
7674
+ askAiCallBack: p,
7663
7675
  onSave: async ({ blocks: z, theme: de }) => {
7664
7676
  if (!s) return !0;
7665
7677
  t.current = z;
7666
7678
  const F = {
7667
7679
  _type: "@chai/ai-context",
7668
- _value: ks(b) ? b : ""
7680
+ _value: Ls(b) ? b : ""
7669
7681
  }, Ee = [...z, F];
7670
- return await x({ page: s, blocks: Ee }), t.current = Ee, rs(de, he) || await p({ settings: { theme: de } }), !0;
7682
+ return await x({ page: s, blocks: Ee }), t.current = Ee, as(de, he) || await y({ settings: { theme: de } }), !0;
7671
7683
  },
7672
- themePanelComponent: zl,
7684
+ themePanelComponent: Wl,
7673
7685
  ...A
7674
7686
  }
7675
7687
  ),
7676
7688
  /* @__PURE__ */ u("div", { children: [
7677
- /* @__PURE__ */ r(Al, {}),
7678
- /* @__PURE__ */ r(xl, {})
7689
+ /* @__PURE__ */ r(xl, {}),
7690
+ /* @__PURE__ */ r(Tl, {})
7679
7691
  ] })
7680
7692
  ] });
7681
- }, _u = new Wa({
7693
+ }, Iu = new Ya({
7682
7694
  defaultOptions: {
7683
7695
  queries: {
7684
7696
  refetchOnWindowFocus: !1,
7685
7697
  refetchOnReconnect: !1
7686
7698
  }
7687
7699
  }
7688
- }), vd = (e) => {
7689
- const { isLoggedIn: t } = st(), [, n] = Ur(), [s, a] = _(!1);
7700
+ }), Ed = (e) => {
7701
+ const { isLoggedIn: t } = st(), [, n] = Rr(), [s, a] = P(!1);
7690
7702
  return we(() => (n(
7691
7703
  Js(e, [
7692
7704
  "apiUrl",
@@ -7702,73 +7714,75 @@ const Pu = (e) => {
7702
7714
  a(!0);
7703
7715
  }, 200), () => {
7704
7716
  a(!1), n({});
7705
- }), [e, n]), s ? /* @__PURE__ */ u(Ya, { client: _u, children: [
7706
- t ? /* @__PURE__ */ r(Pu, { ...e }) : /* @__PURE__ */ r(Ko, {}),
7717
+ }), [e, n]), s ? /* @__PURE__ */ u(Qa, { client: Iu, children: [
7718
+ t ? /* @__PURE__ */ r(_u, { ...e }) : /* @__PURE__ */ r(Vo, {}),
7707
7719
  /* @__PURE__ */ r(Cu, {})
7708
7720
  ] }) : /* @__PURE__ */ r("div", {});
7709
- }, Ed = (e) => {
7721
+ }, bd = (e) => {
7710
7722
  };
7711
7723
  if (typeof window > "u")
7712
7724
  throw new Error("@chaibuilder/pages is not available on the server");
7713
7725
  export {
7714
7726
  Wr as $,
7715
- md as A,
7716
- ju as B,
7717
- rd as C,
7718
- id as D,
7727
+ fd as A,
7728
+ $u as B,
7729
+ ad as C,
7730
+ ld as D,
7719
7731
  Ce as E,
7720
- Zu as F,
7732
+ Ju as F,
7721
7733
  sc as G,
7722
7734
  Eu as H,
7723
- Ju as I,
7735
+ ed as I,
7724
7736
  wn as J,
7725
- pd as K,
7726
- cd as L,
7727
- od as M,
7737
+ yd as K,
7738
+ ud as L,
7739
+ cd as M,
7728
7740
  lt as N,
7729
7741
  Gc as O,
7730
- ad as P,
7731
- ld as Q,
7732
- nd as R,
7733
- ed as S,
7734
- td as T,
7742
+ id as P,
7743
+ od as Q,
7744
+ sd as R,
7745
+ td as S,
7746
+ nd as T,
7735
7747
  Sn as U,
7736
- Wu as V,
7737
- vd as W,
7738
- Oe as X,
7739
- Ue as Y,
7740
- cn as Z,
7741
- Rn as _,
7748
+ Yu as V,
7749
+ Q as W,
7750
+ $ as X,
7751
+ I as Y,
7752
+ Ed as Z,
7753
+ Oe as _,
7742
7754
  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,
7755
+ bd as a0,
7756
+ Re as a1,
7757
+ cn as a2,
7758
+ Rn as a3,
7759
+ un as a4,
7760
+ Fo as a5,
7761
+ ju as a6,
7762
+ dn as a7,
7749
7763
  ve as b,
7750
7764
  Ge as c,
7751
7765
  Ic as d,
7752
7766
  Xr as e,
7753
7767
  ra as f,
7754
- yd as g,
7768
+ vd as g,
7755
7769
  vc as h,
7756
- Yu as i,
7770
+ Qu as i,
7757
7771
  ot as j,
7758
- Xn as k,
7759
- Xu as l,
7760
- gd as m,
7772
+ Zn as k,
7773
+ Zu as l,
7774
+ pd as m,
7761
7775
  Ft as n,
7762
- $u as o,
7776
+ zu as o,
7763
7777
  ic as p,
7764
7778
  Bc as q,
7765
- Zn as r,
7766
- fd as s,
7767
- sd as t,
7768
- Qu as u,
7779
+ Jn as r,
7780
+ gd as s,
7781
+ rd as t,
7782
+ Xu as u,
7769
7783
  Dc as v,
7770
- ud as w,
7771
- dd as x,
7784
+ dd as w,
7785
+ hd as x,
7772
7786
  Oc as y,
7773
- hd as z
7787
+ md as z
7774
7788
  };