@chaibuilder/pages 0.15.14 → 0.15.15

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.
Files changed (63) hide show
  1. package/dist/{2AITGKQY-BGvx_OEz.cjs → 2AITGKQY-B0heZwO7.cjs} +1 -1
  2. package/dist/{2AITGKQY-CCad8XK8.js → 2AITGKQY-DdFbivb6.js} +2 -2
  3. package/dist/{NCMVHL6D-Iv9ufIUy.js → NCMVHL6D-C2sjzq5J.js} +2 -2
  4. package/dist/{NCMVHL6D-C_u5lHQe.cjs → NCMVHL6D-DNxzsLiV.cjs} +1 -1
  5. package/dist/{ZDWCUMSJ-BqZPKNlU.cjs → ZDWCUMSJ-5pP-AHsx.cjs} +1 -1
  6. package/dist/{ZDWCUMSJ-DT4dg62a.js → ZDWCUMSJ-lm9aSFhu.js} +1 -1
  7. package/dist/{add-new-language-page-CfH8Ernl.js → add-new-language-page-Cb1X6iHP.js} +2 -2
  8. package/dist/{add-new-language-page-DlQjzp--.cjs → add-new-language-page-NglCl30F.cjs} +1 -1
  9. package/dist/{add-new-page-DX1aQA56.js → add-new-page-DLr99NII.js} +1 -1
  10. package/dist/{add-new-page-DH-nv7ae.cjs → add-new-page-mxjdK7ia.cjs} +1 -1
  11. package/dist/{delete-page-DE-nabXs.js → delete-page-CLee5S7S.js} +1 -1
  12. package/dist/{delete-page-WPGzECyJ.cjs → delete-page-De_BOwT0.cjs} +1 -1
  13. package/dist/{digital-asset-manager-DtWIJGhf.js → digital-asset-manager-C6j4MUhE.js} +1 -1
  14. package/dist/{digital-asset-manager-CGLE6VEW.cjs → digital-asset-manager-D8GdTF5B.cjs} +1 -1
  15. package/dist/{duplicate-page-C1r3iBDY.js → duplicate-page-DQRyzlJS.js} +2 -2
  16. package/dist/{duplicate-page-CByLwz0z.cjs → duplicate-page-rjnt1Cab.cjs} +1 -1
  17. package/dist/{dynamic-page-selector-Bk8_xgFx.js → dynamic-page-selector-CLIhp1-Z.js} +1 -1
  18. package/dist/{dynamic-page-selector-GwGV0Q6Z.cjs → dynamic-page-selector-V5dW1vq-.cjs} +1 -1
  19. package/dist/index-DLp6No33.cjs +5 -0
  20. package/dist/{index-Djepisz3.js → index-QkqgwYGF.js} +396 -432
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.d.ts +12 -8
  23. package/dist/index.js +19 -18
  24. package/dist/{json-diff-viewer-zKpzQFxw.js → json-diff-viewer-DmiSmWhO.js} +1 -1
  25. package/dist/{json-diff-viewer-BUhKwjf9.cjs → json-diff-viewer-ZEoYZwR4.cjs} +1 -1
  26. package/dist/{lang-panel-CtpuO-KH.js → lang-panel-DV0KFSiS.js} +2 -2
  27. package/dist/{lang-panel-BYF6aLAt.cjs → lang-panel-DYW7FpHg.cjs} +1 -1
  28. package/dist/{mark-as-template-0kikl0oL.js → mark-as-template-BuKRW4TC.js} +1 -1
  29. package/dist/{mark-as-template-wRAGJGtp.cjs → mark-as-template-C2Hnv6Yo.cjs} +1 -1
  30. package/dist/{no-language-page-content-B1M_x_U7.js → no-language-page-content-BzkIHkKd.js} +1 -1
  31. package/dist/{no-language-page-content-DX9WXKXs.cjs → no-language-page-content-CbzJJ5V1.cjs} +1 -1
  32. package/dist/{page-creator-DuN5JD41.cjs → page-creator-Bm8RI-A1.cjs} +1 -1
  33. package/dist/{page-creator-BDJ6iDX9.js → page-creator-CfARQp5P.js} +2 -2
  34. package/dist/{page-lock-request-Bc_vwJhy.js → page-lock-request-B-JqHU4x.js} +1 -1
  35. package/dist/{page-lock-request-PRQo0DDm.cjs → page-lock-request-BeNY76tv.cjs} +1 -1
  36. package/dist/{page-locked-by-dialog-DiKNpVwH.js → page-locked-by-dialog-BoR9dKc2.js} +1 -1
  37. package/dist/{page-locked-by-dialog-Dk0G2l7a.cjs → page-locked-by-dialog-DoDvSmLK.cjs} +1 -1
  38. package/dist/{page-manager-new-CUHqC9Og.js → page-manager-new-BYPR7kTF.js} +2 -2
  39. package/dist/{page-manager-new-KBhn93Yd.cjs → page-manager-new-CLkNaFPu.cjs} +1 -1
  40. package/dist/{page-manager-search-and-filter-Ck5_TfNx.cjs → page-manager-search-and-filter-GL90NOmM.cjs} +1 -1
  41. package/dist/{page-manager-search-and-filter-CJ4AK1_7.js → page-manager-search-and-filter-qbb-z4ls.js} +1 -1
  42. package/dist/{page-revisions-content-q1Ch2-IQ.js → page-revisions-content-D9Luz4aU.js} +2 -2
  43. package/dist/{page-revisions-content-Cw2cumYS.cjs → page-revisions-content-DRXJRbW7.cjs} +1 -1
  44. package/dist/{publish-pages-content-DEHD8qkl.js → publish-pages-content-C9F29IPt.js} +2 -2
  45. package/dist/{publish-pages-content-B8Uuw29Q.cjs → publish-pages-content-Cu0DzmJj.cjs} +1 -1
  46. package/dist/{save-to-lib-B83ZH4XX.cjs → save-to-lib-Rcv9pkhE.cjs} +1 -1
  47. package/dist/{save-to-lib-QEOpf_Bd.js → save-to-lib-j75aYapW.js} +1 -1
  48. package/dist/{seo-panel-DEQfOfZs.js → seo-panel-CH6YxaSs.js} +1 -1
  49. package/dist/{seo-panel-DvDEatlO.cjs → seo-panel-Og15REBD.cjs} +1 -1
  50. package/dist/{shared-json-ld-Cyv9JitF.js → shared-json-ld-DDwAZ76n.js} +1 -1
  51. package/dist/{shared-json-ld-D5F8RuF2.cjs → shared-json-ld-DvzCrVrs.cjs} +1 -1
  52. package/dist/{slug-input-3vWL9FPC.cjs → slug-input-CU1K4HWM.cjs} +1 -1
  53. package/dist/{slug-input-D4e2anEs.js → slug-input-DIzyGGSl.js} +1 -1
  54. package/dist/{theme-panel-footer-4dbLfEph.cjs → theme-panel-footer-CV5sf8Ay.cjs} +1 -1
  55. package/dist/{theme-panel-footer-D3Gub87c.js → theme-panel-footer-DYEvREC2.js} +1 -1
  56. package/dist/{unmark-as-template-Dkc7zLZr.cjs → unmark-as-template-3YVPsBXa.cjs} +1 -1
  57. package/dist/{unmark-as-template-BENGNo7g.js → unmark-as-template-BZtRGHpb.js} +1 -1
  58. package/dist/{unpublish-page-Cui0tgvd.cjs → unpublish-page-1p_vCHUh.cjs} +1 -1
  59. package/dist/{unpublish-page-D5tWKVLY.js → unpublish-page-BucQ2Q3Z.js} +1 -1
  60. package/dist/{web-preview-CcPTcMio.cjs → web-preview-70yJppqF.cjs} +1 -1
  61. package/dist/{web-preview-CHNZZcqH.js → web-preview-DRF3WCCD.js} +1 -1
  62. package/package.json +1 -1
  63. package/dist/index-BELYt0c9.cjs +0 -5
@@ -4,17 +4,17 @@ var Un = (e) => {
4
4
  };
5
5
  var Sr = (e, t, n) => t in e ? Tr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
6
  var Pe = (e, t, n) => Sr(e, typeof t != "symbol" ? t + "" : t, n), Bn = (e, t, n) => t.has(e) || Un("Cannot " + n);
7
- var S = (e, t, n) => (Bn(e, t, "read from private field"), n ? n.call(e) : t.get(e)), D = (e, t, n) => t.has(e) ? Un("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), L = (e, t, n, s) => (Bn(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
7
+ var S = (e, t, n) => (Bn(e, t, "read from private field"), n ? n.call(e) : t.get(e)), D = (e, t, n) => t.has(e) ? Un("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), k = (e, t, n, s) => (Bn(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
8
8
  import { jsx as c, jsxs as m, Fragment as ge } from "react/jsx-runtime";
9
- import { get as V, reverse as _r, sortBy as Pr, each as wr, find as se, isEmpty as he, groupBy as vr, minBy as br, noop as ds, keyBy as Ir, map as Bt, compact as fs, upperCase as Mn, filter as hs, includes as Cr, has as jt, pick as Pn, keys as Nr, pickBy as Lr, endsWith as kr, isArray as Or, startCase as Dr, isFunction as Gr, cloneDeep as xr, isEqual as Rr } from "lodash-es";
9
+ import { get as V, reverse as _r, sortBy as Pr, each as vr, find as se, isEmpty as he, groupBy as wr, minBy as br, noop as ds, keyBy as Ir, map as Ut, compact as fs, upperCase as Mn, filter as hs, includes as Cr, has as $t, pick as Pn, keys as Nr, pickBy as Lr, endsWith as kr, isArray as Or, startCase as Dr, isFunction as Gr, cloneDeep as xr, isEqual as Rr } from "lodash-es";
10
10
  import * as z from "react";
11
- import Ur, { useMemo as j, useCallback as Q, useState as q, useEffect as ne, useRef as it, lazy as K, Suspense as H, createContext as Br, Component as Mr, createElement as Fn } from "react";
11
+ import Ur, { useMemo as $, useCallback as j, useState as q, useEffect as ne, useRef as it, lazy as K, Suspense as H, createContext as Br, Component as Mr, createElement as Fn } from "react";
12
12
  import { atom as Ee, useAtom as te } from "jotai";
13
- import { useQuery as ae, useQueryClient as W, useMutation as X, onlineManager as gs, QueryClient as Fr, QueryClientProvider as qr } from "@tanstack/react-query";
14
- import { useLanguages as Te, useSavePage as Ge, useTranslation as ve, mergeClasses as Mt, usePermissions as ms, PERMISSIONS as Kr, useRightPanel as Vr, useChaiFeatureFlag as Hr, useIsPageLoaded as Qr, registerChaiLibrary as $r, getBlocksFromHTML as jr, registerChaiSidebarPanel as en, registerChaiFeatureFlag as qn, registerChaiTopBar as zr, registerChaiMediaManager as Wr, registerChaiSaveToLibrary as Yr, ChaiBuilderEditor as Jr } from "@chaibuilder/sdk";
13
+ import { useQuery as re, useQueryClient as W, useMutation as X, onlineManager as gs, QueryClient as Fr, QueryClientProvider as qr } from "@tanstack/react-query";
14
+ import { useLanguages as Te, useSavePage as Ge, useTranslation as we, mergeClasses as Bt, usePermissions as ms, PERMISSIONS as Kr, useRightPanel as Vr, useChaiFeatureFlag as Hr, useIsPageLoaded as Qr, registerChaiLibrary as $r, getBlocksFromHTML as jr, registerChaiSidebarPanel as en, registerChaiFeatureFlag as qn, registerChaiTopBar as zr, registerChaiMediaManager as Wr, registerChaiSaveToLibrary as Yr, ChaiBuilderEditor as Jr } from "@chaibuilder/sdk";
15
15
  import { toast as R } from "sonner";
16
- import { Tooltip as zt, TooltipTrigger as Wt, Button as M, TooltipContent as Yt, Sheet as Es, SheetContent as ps, SheetHeader as Xr, SheetTitle as Zr, SheetDescription as ea, DropdownMenu as wn, DropdownMenuTrigger as vn, DropdownMenuContent as bn, DropdownMenuItem as de, Separator as ta, TooltipProvider as ys, SheetTrigger as na, Skeleton as Nt, Dialog as As, HoverCard as sa, HoverCardTrigger as ra, HoverCardContent as aa, AlertDialog as ia, AlertDialogTrigger as oa, AlertDialogContent as la, AlertDialogHeader as ca, AlertDialogTitle as ua, AlertDialogDescription as da, AlertDialogFooter as fa, AlertDialogCancel as ha, AlertDialogAction as ga, Popover as ma, PopoverTrigger as Ea, DialogContent as pa, DialogHeader as ya, DialogTitle as Aa, Tabs as Ta, TabsList as Sa, TabsTrigger as tn, TabsContent as nn, Textarea as Kn, Alert as _a, AlertDescription as Pa } from "@chaibuilder/sdk/ui";
17
- import { LogsIcon as wa, Folder as va, Languages as Vn, ChevronDown as fn, Star as ba, Plus as Ts, History as Ia, Play as Ca, Palette as Na, CheckCircle as La, Loader as Ft, Save as ka, Send as Hn, Rocket as Qn, CopyPlusIcon as Oa, Pencil as Da, Power as Ga, Trash as xa, SquareLibrary as $n, Hash as Ra, File as Ua, MoreHorizontal as jn, ExternalLink as Ba, LanguagesIcon as Ma, User as Fa, X as zn, Trash2 as qa, ImageIcon as Wn, Code as Ka, Eye as Va, Share2 as Ha, FileCode2 as Qa, AlertTriangle as $a } from "lucide-react";
16
+ import { Tooltip as jt, TooltipTrigger as zt, Button as M, TooltipContent as Wt, Sheet as Es, SheetContent as ps, SheetHeader as Xr, SheetTitle as Zr, SheetDescription as ea, DropdownMenu as vn, DropdownMenuTrigger as wn, DropdownMenuContent as bn, DropdownMenuItem as de, Separator as ta, TooltipProvider as ys, SheetTrigger as na, Skeleton as Ct, Dialog as As, HoverCard as sa, HoverCardTrigger as ra, HoverCardContent as aa, AlertDialog as ia, AlertDialogTrigger as oa, AlertDialogContent as la, AlertDialogHeader as ca, AlertDialogTitle as ua, AlertDialogDescription as da, AlertDialogFooter as fa, AlertDialogCancel as ha, AlertDialogAction as ga, Popover as ma, PopoverTrigger as Ea, DialogContent as pa, DialogHeader as ya, DialogTitle as Aa, Tabs as Ta, TabsList as Sa, TabsTrigger as tn, TabsContent as nn, Textarea as Kn, Alert as _a, AlertDescription as Pa } from "@chaibuilder/sdk/ui";
17
+ import { LogsIcon as va, Folder as wa, Languages as Vn, ChevronDown as fn, Star as ba, Plus as Ts, History as Ia, Play as Ca, Palette as Na, CheckCircle as La, Loader as Mt, Save as ka, Send as Hn, Rocket as Qn, CopyPlusIcon as Oa, Pencil as Da, Power as Ga, Trash as xa, SquareLibrary as $n, Hash as Ra, File as Ua, MoreHorizontal as jn, ExternalLink as Ba, LanguagesIcon as Ma, User as Fa, X as zn, Trash2 as qa, ImageIcon as Wn, Code as Ka, Eye as Va, Share2 as Ha, FileCode2 as Qa, AlertTriangle as $a } from "lucide-react";
18
18
  import { useRegisteredChaiBlocks as ja, getDefaultBlockProps as za } from "@chaibuilder/runtime";
19
19
  import { loadWebBlocks as Wa } from "@chaibuilder/sdk/web-blocks";
20
20
  const E = {
@@ -81,10 +81,10 @@ const E = {
81
81
  UPDATE_ASSET: "UPDATE_ASSET",
82
82
  GET_ASSETS: "GET_ASSETS",
83
83
  GET_ASSET: "GET_ASSET"
84
- }, Ya = Ee({}), In = () => te(Ya), re = (e, t) => {
84
+ }, Ya = Ee({}), In = () => te(Ya), ie = (e, t) => {
85
85
  const [n] = In();
86
- return j(() => V(n, e, t), [n, e, t]);
87
- }, k = () => re("apiUrl", "/chai/api"), Ss = () => re("usersApiUrl", "/chai/users"), bc = () => re("assetsApiUrl", "/chai/assets"), Ja = () => re("websocket", null), _s = async (e, t, n = {}) => await fetch(e, {
86
+ return $(() => V(n, e, t), [n, e, t]);
87
+ }, N = () => ie("apiUrl", "/chai/api"), Ss = () => ie("usersApiUrl", "/chai/users"), wc = () => ie("assetsApiUrl", "/chai/assets"), Ja = () => ie("websocket", null), _s = async (e, t, n = {}) => await fetch(e, {
88
88
  method: "POST",
89
89
  headers: {
90
90
  "Content-Type": "application/json",
@@ -101,32 +101,42 @@ if (import.meta.vitest) {
101
101
  t(n).toBeDefined();
102
102
  });
103
103
  }
104
- const C = () => {
105
- const e = re("onLogout"), t = re("getAccessToken");
106
- return Q(
107
- async (n, s, r = {}) => {
108
- const a = await t();
109
- if (!a)
104
+ const bc = () => {
105
+ const e = b(), t = N();
106
+ return j(
107
+ async ({
108
+ body: n,
109
+ headers: s = {},
110
+ url: r = t
111
+ }) => e(r, n, s),
112
+ [e]
113
+ );
114
+ }, b = () => {
115
+ const e = ie("onLogout"), t = ie("getAccessToken"), n = N();
116
+ return j(
117
+ async (s = n, r, a = {}) => {
118
+ const i = await t();
119
+ if (!i)
110
120
  return console.error("No auth token found"), null;
111
121
  try {
112
- const i = V(s, "action", "").toLowerCase(), o = await _s(n + (i ? `?action=${i}` : ""), s, {
113
- ...r,
114
- Authorization: `Bearer ${a}`
122
+ const o = V(r, "action", "").toLowerCase(), l = await _s(s + (o ? `?action=${o}` : ""), r, {
123
+ ...a,
124
+ Authorization: `Bearer ${i}`
115
125
  });
116
- if (o.status === 401)
117
- return console.log("401 Response", o), e(), window.location.reload(), null;
118
- if (!o.ok) {
119
- const l = await o.json();
120
- throw console.error(`API Error (${o.status}):`, l), {
121
- status: o.status,
122
- statusText: o.statusText,
123
- ...l,
124
- message: l.error || l.message || `Server error: ${o.status}`
126
+ if (l.status === 401)
127
+ return console.log("401 Response", l), e(), window.location.reload(), null;
128
+ if (!l.ok) {
129
+ const f = await l.json();
130
+ throw console.error(`API Error (${l.status}):`, f), {
131
+ status: l.status,
132
+ statusText: l.statusText,
133
+ ...f,
134
+ message: f.error || f.message || `Server error: ${l.status}`
125
135
  };
126
136
  }
127
- return await o.json();
128
- } catch (i) {
129
- throw console.error("API request failed:", s, i), i;
137
+ return await l.json();
138
+ } catch (o) {
139
+ throw console.error("API request failed:", r, o), o;
130
140
  }
131
141
  },
132
142
  [e, t]
@@ -146,8 +156,8 @@ function oe() {
146
156
  }, []), [e, t];
147
157
  }
148
158
  const xe = (e) => {
149
- const t = k(), [n] = oe(), s = e ?? n.get("page"), r = C();
150
- return ae({
159
+ const t = N(), [n] = oe(), s = e ?? n.get("page"), r = b();
160
+ return re({
151
161
  queryKey: [E.GET_LANGUAGE_PAGES, s],
152
162
  staleTime: 1 / 0,
153
163
  gcTime: 0,
@@ -163,8 +173,8 @@ const xe = (e) => {
163
173
  enabled: !!s
164
174
  });
165
175
  }, Re = () => {
166
- const e = k(), t = C();
167
- return ae({
176
+ const e = N(), t = b();
177
+ return re({
168
178
  queryKey: [E.GET_WEBSITE_DRAFT_SETTINGS],
169
179
  staleTime: 5 * 60 * 1e3,
170
180
  placeholderData: {
@@ -179,9 +189,9 @@ const xe = (e) => {
179
189
  })
180
190
  });
181
191
  }, Ps = (e) => {
182
- const { fallbackLang: t } = Te(), { data: n } = Re(), { data: s, isFetching: r } = xe(), a = j(() => {
192
+ const { fallbackLang: t } = Te(), { data: n } = Re(), { data: s, isFetching: r } = xe(), a = $(() => {
183
193
  const i = { [t]: !0 };
184
- return wr(V(n, "languages"), (o) => {
194
+ return vr(V(n, "languages"), (o) => {
185
195
  const l = se(s, { lang: o });
186
196
  i[o] = !!l;
187
197
  }), i;
@@ -232,7 +242,7 @@ class Xa {
232
242
  return t.length > 0 ? t[0] : null;
233
243
  }
234
244
  getPageUserMapping() {
235
- const t = this.getOnlineUsers({}), n = vr(t, "pageId"), s = {};
245
+ const t = this.getOnlineUsers({}), n = wr(t, "pageId"), s = {};
236
246
  return Object.keys(n).forEach((r) => {
237
247
  var i;
238
248
  const a = (i = br(n[r], "onlineAt")) == null ? void 0 : i.userId;
@@ -297,8 +307,8 @@ class Xa {
297
307
  }
298
308
  const Za = Ee(
299
309
  null
300
- ), ws = () => te(Za), Cn = () => {
301
- const [e] = ws();
310
+ ), vs = () => te(Za), Cn = () => {
311
+ const [e] = vs();
302
312
  return (e == null ? void 0 : e.slug) || "";
303
313
  };
304
314
  function ei(e, t) {
@@ -309,7 +319,7 @@ function ei(e, t) {
309
319
  }, [e, t]), n;
310
320
  }
311
321
  const ti = ({ query: e, uuid: t }) => {
312
- const { selectedLang: n, fallbackLang: s } = Te(), { data: r } = ie(), a = r == null ? void 0 : r.pageType, i = k(), o = C(), { data: l, isFetching: f } = ae({
322
+ const { selectedLang: n, fallbackLang: s } = Te(), { data: r } = ae(), a = r == null ? void 0 : r.pageType, i = N(), o = b(), { data: l, isFetching: f } = re({
313
323
  queryKey: [E.GET_DYNAMIC_PAGES, e, a, t],
314
324
  staleTime: 60 * 60 * 1e3,
315
325
  placeholderData: [],
@@ -318,10 +328,10 @@ const ti = ({ query: e, uuid: t }) => {
318
328
  data: { query: e, pageType: a, uuid: t }
319
329
  }) || [],
320
330
  enabled: !!a
321
- }), d = j(() => n === "" ? l.filter((u) => u.lang === "" || u.lang === s) : l.filter((u) => u.lang === n), [n, s, l]);
331
+ }), d = $(() => n === "" ? l.filter((u) => u.lang === "" || u.lang === s) : l.filter((u) => u.lang === n), [n, s, l]);
322
332
  return { allLangPages: l, data: d, isFetching: f };
323
333
  }, ni = () => {
324
- const { selectedLang: e, fallbackLang: t } = Te(), [n, s] = ws(), [r, a] = q(""), i = ei(r, 500), { allLangPages: o, data: l, isFetching: f } = ti({ query: i }), d = Q((g) => s(g), [s]), u = Q((g) => a(g), [a]), h = Q(() => {
334
+ const { selectedLang: e, fallbackLang: t } = Te(), [n, s] = vs(), [r, a] = q(""), i = ei(r, 500), { allLangPages: o, data: l, isFetching: f } = ti({ query: i }), d = j((g) => s(g), [s]), u = j((g) => a(g), [a]), h = j(() => {
325
335
  if (!n) return;
326
336
  const g = !(n != null && n.primaryPage), A = e.length === 0, T = g ? n == null ? void 0 : n.id : n == null ? void 0 : n.primaryPage, y = o.filter(
327
337
  (_) => (_ == null ? void 0 : _.primaryPage) === T || _.id === T
@@ -339,25 +349,25 @@ const ti = ({ query: e, uuid: t }) => {
339
349
  updateSearchQuery: u,
340
350
  onChangeLanguage: h
341
351
  };
342
- }, si = Ee({ lastSaved: void 0 }), Nn = () => te(si), ie = () => {
352
+ }, si = Ee({ lastSaved: void 0 }), Nn = () => te(si), ae = () => {
343
353
  const [e] = oe(), t = e.get("page"), { data: n, isFetching: s } = xe();
344
- return { data: j(() => ({ ...se(n, { id: t }) || {} }), [n, t]), isFetching: s };
354
+ return { data: $(() => ({ ...se(n, { id: t }) || {} }), [n, t]), isFetching: s };
345
355
  }, be = () => {
346
356
  const [e] = oe(), t = e.get("lang") ?? "", { data: n, isFetching: s } = xe();
347
- return { data: j(() => se(n, { lang: t }) || {}, [n, t]), isFetching: s };
357
+ return { data: $(() => se(n, { lang: t }) || {}, [n, t]), isFetching: s };
348
358
  }, ri = Ee({}), ai = () => te(ri), ii = () => {
349
- const { data: e } = be(), t = Cn(), n = re("getLiveUrl", ds), s = e == null ? void 0 : e.slug, r = n(s || "/");
359
+ const { data: e } = be(), t = Cn(), n = ie("getLiveUrl", ds), s = e == null ? void 0 : e.slug, r = n(s || "/");
350
360
  return t ? r + t : r;
351
- }, It = () => {
352
- const e = re("currentUser"), t = re("onLogout");
361
+ }, Yt = () => {
362
+ const e = ie("currentUser"), t = ie("onLogout");
353
363
  return {
354
364
  isLoggedIn: !!e,
355
365
  user: e,
356
366
  logout: t
357
367
  };
358
368
  }, oi = (e) => {
359
- const t = Ss(), n = C();
360
- return ae({
369
+ const t = Ss(), n = b();
370
+ return re({
361
371
  queryKey: [E.GET_CHAI_USER, e],
362
372
  queryFn: async () => {
363
373
  const r = await n(t, {
@@ -390,12 +400,12 @@ const ti = ({ query: e, uuid: t }) => {
390
400
  isLocked: t && n.status === "locked"
391
401
  };
392
402
  }, di = () => {
393
- const e = Ja(), { data: t } = ie(), { user: n } = It(), s = t == null ? void 0 : t.id, { data: r } = Re(), { pageLock: a, setPageLock: i, setLockingStatus: o, realtimeInstance: l, setRealtimeInstance: f } = Ie(), [, d] = te(Ln), u = it(!1), h = it(a), g = it(!1);
403
+ const e = Ja(), { data: t } = ae(), { user: n } = Yt(), s = t == null ? void 0 : t.id, { data: r } = Re(), { pageLock: a, setPageLock: i, setLockingStatus: o, realtimeInstance: l, setRealtimeInstance: f } = Ie(), [, d] = te(Ln), u = it(!1), h = it(a), g = it(!1);
394
404
  return ne(() => {
395
405
  if (n != null && n.id && e && !l && (r != null && r.appKey) && !g.current) {
396
406
  g.current = !0;
397
407
  const A = async (p, y) => {
398
- var _, b;
408
+ var _, I;
399
409
  switch (p) {
400
410
  /**
401
411
  * When user joins
@@ -425,7 +435,7 @@ const ti = ({ query: e, uuid: t }) => {
425
435
  */
426
436
  case "USER_JOINED":
427
437
  if (((_ = h == null ? void 0 : h.current) == null ? void 0 : _.status) === "editing") return;
428
- ((b = h == null ? void 0 : h.current) == null ? void 0 : b.status) === "locked" && o("can_edit_now"), i({
438
+ ((I = h == null ? void 0 : h.current) == null ? void 0 : I.status) === "locked" && o("can_edit_now"), i({
429
439
  ...h == null ? void 0 : h.current,
430
440
  requestedBy: "",
431
441
  status: "editing",
@@ -497,9 +507,9 @@ const ti = ({ query: e, uuid: t }) => {
497
507
  };
498
508
  }, [s, l]), a == null ? void 0 : a.status;
499
509
  }, fi = () => {
500
- const { data: e } = ie(), { user: t } = It(), n = e == null ? void 0 : e.id, { pageLock: s, setPageLock: r, realtimeInstance: a } = Ie(), { savePageAsync: i } = Ge(), o = Q(() => {
510
+ const { data: e } = ae(), { user: t } = Yt(), n = e == null ? void 0 : e.id, { pageLock: s, setPageLock: r, realtimeInstance: a } = Ie(), { savePageAsync: i } = Ge(), o = j(() => {
501
511
  !a || !n || !(t != null && t.id) || (r({ ...s, isTakeOverRequested: !0 }), a == null || a.sendEvent("TAKE_OVER_REQUESTED"));
502
- }, [a, n, t == null ? void 0 : t.id, r, s]), l = Q(async () => {
512
+ }, [a, n, t == null ? void 0 : t.id, r, s]), l = j(async () => {
503
513
  !a || !n || !(t != null && t.id) || (await i(), a == null || a.sendEvent("TAKE_OVER_REQUEST_ACCEPTED", {
504
514
  requestingClientId: s == null ? void 0 : s.requestingClientId
505
515
  }), r({
@@ -509,7 +519,7 @@ const ti = ({ query: e, uuid: t }) => {
509
519
  isActiveInOtherTab: !1,
510
520
  isTakeOverRequested: !1
511
521
  }));
512
- }, [n, a, t == null ? void 0 : t.id, r, i, s]), f = Q(() => {
522
+ }, [n, a, t == null ? void 0 : t.id, r, i, s]), f = j(() => {
513
523
  !a || !n || !(t != null && t.id) || (a == null || a.sendEvent("TAKE_OVER_REQUEST_REJECTED", {
514
524
  requestingClientId: s == null ? void 0 : s.requestingClientId
515
525
  }), r({
@@ -527,8 +537,8 @@ const ti = ({ query: e, uuid: t }) => {
527
537
  rejectTakeOver: f,
528
538
  requestTakeOver: o
529
539
  };
530
- }, hi = K(() => import("./no-language-page-content-B1M_x_U7.js")), gi = K(() => import("./page-locked-by-dialog-DiKNpVwH.js")), sn = K(() => import("./page-lock-request-Bc_vwJhy.js")), mi = ({ isFetchingPage: e }) => {
531
- const { pageLock: t, requestTakeOver: n } = fi(), { currentEditor: s, lockingStatus: r, setLockingStatus: a, realtimePageLockEnabled: i } = Ie(), { data: o, isFetching: l } = oi(s), [f] = oe(), d = f.get("page"), [u] = Nn(), h = W(), g = Q(() => {
540
+ }, hi = K(() => import("./no-language-page-content-BzkIHkKd.js")), gi = K(() => import("./page-locked-by-dialog-BoR9dKc2.js")), sn = K(() => import("./page-lock-request-B-JqHU4x.js")), mi = ({ isFetchingPage: e }) => {
541
+ const { pageLock: t, requestTakeOver: n } = fi(), { currentEditor: s, lockingStatus: r, setLockingStatus: a, realtimePageLockEnabled: i } = Ie(), { data: o, isFetching: l } = oi(s), [f] = oe(), d = f.get("page"), [u] = Nn(), h = W(), g = j(() => {
532
542
  n();
533
543
  }, [n]);
534
544
  return !d || e || !i || (t == null ? void 0 : t.status) === "checking" ? null : t != null && t.requestedBy ? /* @__PURE__ */ c(H, { children: /* @__PURE__ */ c(
@@ -565,7 +575,7 @@ const ti = ({ query: e, uuid: t }) => {
565
575
  }, Ei = () => {
566
576
  const [e] = oe(), t = e.get("lang");
567
577
  return Ps(t) ? null : /* @__PURE__ */ c(H, { children: /* @__PURE__ */ c(hi, {}) });
568
- }, Lt = {
578
+ }, Nt = {
569
579
  ab: "Abkhazian",
570
580
  aa: "Afar",
571
581
  af: "Afrikaans",
@@ -754,27 +764,27 @@ const ti = ({ query: e, uuid: t }) => {
754
764
  za: "Zhuang, Chuang",
755
765
  zu: "Zulu"
756
766
  };
757
- function vs(e, t, n = !1) {
767
+ function ws(e, t, n = !1) {
758
768
  const s = e.toString() ? `?${e.toString()}` : "/";
759
769
  n ? window.history.replaceState(null, "", s) : window.history.pushState({}, "", s), t(e), window.dispatchEvent(new PopStateEvent("popstate"));
760
770
  }
761
771
  const kn = Ee(null), On = () => {
762
772
  const { data: e } = Re();
763
- return j(
773
+ return $(
764
774
  () => (e == null ? void 0 : e.fallbackLang) || "en",
765
775
  [e]
766
776
  );
767
777
  }, bs = () => {
768
- const e = C(), t = k();
769
- return ae({
778
+ const e = b(), t = N();
779
+ return re({
770
780
  queryKey: [E.GET_WEBSITE_PAGES],
771
781
  staleTime: 1e3 * 60 * 5,
772
782
  queryFn: async () => e(t, { action: E.GET_WEBSITE_PAGES }) || [],
773
783
  placeholderData: (n) => n || []
774
784
  });
775
785
  }, Cc = (e) => {
776
- const t = C(), n = k(), s = On();
777
- return ae({
786
+ const t = b(), n = N(), s = On();
787
+ return re({
778
788
  queryKey: [E.GET_WEBSITE_PAGES, e, s],
779
789
  staleTime: 1e3 * 60 * 5,
780
790
  enabled: !!e,
@@ -782,39 +792,39 @@ const kn = Ee(null), On = () => {
782
792
  if (s === e) return {};
783
793
  const r = await t(n, { action: E.GET_WEBSITE_PAGES, data: { lang: e } }) || [];
784
794
  return Ir(
785
- Bt(r, (a) => ({ ...a, lang: e })),
795
+ Ut(r, (a) => ({ ...a, lang: e })),
786
796
  "primaryPage"
787
797
  );
788
798
  },
789
799
  placeholderData: (r) => r || {}
790
800
  });
791
- }, pi = K(() => import("./page-manager-new-CUHqC9Og.js")), Is = ({ children: e }) => {
792
- const { t } = ve(), [n, s] = oe(), r = n.get("page"), { data: a, isFetching: i } = ie(), { data: o, isFetching: l } = bs(), [f, d] = q(!1), [u, h] = q(!0), { savePage: g } = Ge(), A = !!r && !he(a), T = j(() => {
801
+ }, pi = K(() => import("./page-manager-new-BYPR7kTF.js")), Is = ({ children: e }) => {
802
+ const { t } = we(), [n, s] = oe(), r = n.get("page"), { data: a, isFetching: i } = ae(), { data: o, isFetching: l } = bs(), [f, d] = q(!1), [u, h] = q(!0), { savePage: g } = Ge(), A = !!r && !he(a), T = $(() => {
793
803
  if (!o || l) return !1;
794
- const b = o.find((O) => O.slug === "/");
795
- return b == null ? void 0 : b.id;
804
+ const I = o.find((O) => O.slug === "/");
805
+ return I == null ? void 0 : I.id;
796
806
  }, [o, l]);
797
807
  ne(() => {
798
808
  if (l || !T || o.some((B) => B.id === r)) return;
799
809
  const O = new URLSearchParams({ page: T });
800
- vs(O, s), !l && o && h(!1);
810
+ ws(O, s), !l && o && h(!1);
801
811
  }, [r, l, o, T, s]);
802
812
  const p = !u && !r, y = !u && !i && he(a), _ = f || p || y;
803
813
  return /* @__PURE__ */ m(ge, { children: [
804
- /* @__PURE__ */ c("div", { className: "flex items-center gap-x-1", children: /* @__PURE__ */ c("div", { className: "relative", children: /* @__PURE__ */ m(zt, { children: [
814
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-x-1", children: /* @__PURE__ */ c("div", { className: "relative", children: /* @__PURE__ */ m(jt, { children: [
805
815
  /* @__PURE__ */ c(
806
- Wt,
816
+ zt,
807
817
  {
808
818
  asChild: !0,
809
819
  onClick: () => {
810
820
  g(), d(!0);
811
821
  },
812
- children: e || /* @__PURE__ */ c(M, { variant: "outline", className: "flex w-full items-center space-x-2 py-1", children: /* @__PURE__ */ c(wa, { className: "h-4 w-4" }) }, "template-viewer")
822
+ children: e || /* @__PURE__ */ c(M, { variant: "outline", className: "flex w-full items-center space-x-2 py-1", children: /* @__PURE__ */ c(va, { className: "h-4 w-4" }) }, "template-viewer")
813
823
  }
814
824
  ),
815
- /* @__PURE__ */ c(Yt, { side: "right", children: /* @__PURE__ */ c("p", { children: t("Open pages manager") }) })
825
+ /* @__PURE__ */ c(Wt, { side: "right", children: /* @__PURE__ */ c("p", { children: t("Open pages manager") }) })
816
826
  ] }) }) }),
817
- /* @__PURE__ */ c(Es, { open: _, onOpenChange: (b) => !b && A && d(!1), children: /* @__PURE__ */ m(
827
+ /* @__PURE__ */ c(Es, { open: _, onOpenChange: (I) => !I && A && d(!1), children: /* @__PURE__ */ m(
818
828
  ps,
819
829
  {
820
830
  side: "left",
@@ -823,7 +833,7 @@ const kn = Ee(null), On = () => {
823
833
  children: [
824
834
  /* @__PURE__ */ m(Xr, { className: "mb-3 px-4 pt-4", children: [
825
835
  /* @__PURE__ */ m(Zr, { className: "flex items-center gap-2 text-sm font-semibold", children: [
826
- /* @__PURE__ */ c("div", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-primary text-primary-foreground", children: /* @__PURE__ */ c(va, { className: "h-4 w-4" }) }),
836
+ /* @__PURE__ */ c("div", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-primary text-primary-foreground", children: /* @__PURE__ */ c(wa, { className: "h-4 w-4" }) }),
827
837
  /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
828
838
  /* @__PURE__ */ c("span", { className: "text-sm font-semibold", children: t("Pages") }),
829
839
  /* @__PURE__ */ c("span", { id: "pages-manager-description", className: "text-xs font-normal text-muted-foreground", children: t("Manage your site structure") })
@@ -836,8 +846,8 @@ const kn = Ee(null), On = () => {
836
846
  }
837
847
  ) })
838
848
  ] });
839
- }, yi = K(() => import("./add-new-language-page-CfH8Ernl.js")), Ai = () => {
840
- const e = re("topLeftCorner", null);
849
+ }, yi = K(() => import("./add-new-language-page-Cb1X6iHP.js")), Ai = () => {
850
+ const e = ie("topLeftCorner", null);
841
851
  return e ? /* @__PURE__ */ c("div", { className: "max-h-9 w-full overflow-hidden pr-2", children: Ur.createElement(e, {}) }) : null;
842
852
  }, Ti = ({
843
853
  showAdd: e = !0,
@@ -848,13 +858,13 @@ const kn = Ee(null), On = () => {
848
858
  const p = new URLSearchParams(window.location.search), y = p.get("lang");
849
859
  y && (s.includes(y) ? a(y) : (p.delete("lang"), o(p), a("")));
850
860
  }, [s, o, a]);
851
- const [, f] = te(kn), { data: d } = ie(), { data: u } = Re(), { data: h } = xe(), g = j(() => {
861
+ const [, f] = te(kn), { data: d } = ae(), { data: u } = Re(), { data: h } = xe(), g = $(() => {
852
862
  const p = fs(
853
- Bt(V(u, "languages"), (y) => {
863
+ Ut(V(u, "languages"), (y) => {
854
864
  const _ = se(h, { lang: y });
855
865
  return {
856
866
  key: y,
857
- value: V(Lt, y, y),
867
+ value: V(Nt, y, y),
858
868
  isLangPageAdded: !!_
859
869
  };
860
870
  })
@@ -862,7 +872,7 @@ const kn = Ee(null), On = () => {
862
872
  return [
863
873
  {
864
874
  key: n,
865
- value: V(Lt, n),
875
+ value: V(Nt, n),
866
876
  isLangPageAdded: !0
867
877
  },
868
878
  ...p
@@ -883,14 +893,14 @@ const kn = Ee(null), On = () => {
883
893
  }, T = (p) => {
884
894
  a(p);
885
895
  const y = new URLSearchParams(window.location.search);
886
- p === n ? y.delete("lang") : y.set("lang", p), vs(y, o);
896
+ p === n ? y.delete("lang") : y.set("lang", p), ws(y, o);
887
897
  };
888
898
  return he(s) ? null : l ? /* @__PURE__ */ m(M, { variant: "ghost", size: "sm", className: "ml-px h-max cursor-not-allowed gap-2 py-1.5 opacity-50", children: [
889
899
  /* @__PURE__ */ c(Vn, { className: "h-4 w-4" }),
890
- V(Lt, i, i),
900
+ V(Nt, i, i),
891
901
  /* @__PURE__ */ c(fn, { className: "h-4 w-4" })
892
- ] }) : /* @__PURE__ */ c(ge, { children: /* @__PURE__ */ m(wn, { children: [
893
- /* @__PURE__ */ c(vn, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ m(
902
+ ] }) : /* @__PURE__ */ c(ge, { children: /* @__PURE__ */ m(vn, { children: [
903
+ /* @__PURE__ */ c(wn, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ m(
894
904
  M,
895
905
  {
896
906
  disabled: !!l,
@@ -899,18 +909,18 @@ const kn = Ee(null), On = () => {
899
909
  className: "ml-px h-max gap-2 py-1.5",
900
910
  children: [
901
911
  /* @__PURE__ */ c(Vn, { className: "h-4 w-4" }),
902
- V(Lt, i, i),
912
+ V(Nt, i, i),
903
913
  /* @__PURE__ */ c(fn, { className: "h-4 w-4" })
904
914
  ]
905
915
  }
906
916
  ) }),
907
917
  /* @__PURE__ */ m(bn, { className: "space-y-1 border-border", children: [
908
- Bt(
918
+ Ut(
909
919
  g.filter((p) => p.isLangPageAdded),
910
920
  (p) => /* @__PURE__ */ m(
911
921
  de,
912
922
  {
913
- className: Mt(
923
+ className: Bt(
914
924
  "flex cursor-pointer items-center justify-between text-xs font-medium text-gray-800",
915
925
  p.key === i && "!bg-gray-200 text-gray-700"
916
926
  ),
@@ -971,19 +981,19 @@ function Si() {
971
981
  function _i() {
972
982
  return /* @__PURE__ */ c("div", { className: "mt-2 space-y-2", children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ m("div", { className: "flex items-start gap-3 rounded-md border p-2", children: [
973
983
  /* @__PURE__ */ m("div", { className: "flex-1 space-y-1", children: [
974
- /* @__PURE__ */ c(Nt, { className: "h-4 w-3/4" }),
975
- /* @__PURE__ */ c(Nt, { className: "h-3 w-1/2" }),
976
- /* @__PURE__ */ c(Nt, { className: "mt-1 h-5 w-20" })
984
+ /* @__PURE__ */ c(Ct, { className: "h-4 w-3/4" }),
985
+ /* @__PURE__ */ c(Ct, { className: "h-3 w-1/2" }),
986
+ /* @__PURE__ */ c(Ct, { className: "mt-1 h-5 w-20" })
977
987
  ] }),
978
- /* @__PURE__ */ c(Nt, { className: "h-8 w-8 rounded-full" })
988
+ /* @__PURE__ */ c(Ct, { className: "h-8 w-8 rounded-full" })
979
989
  ] }, t)) });
980
990
  }
981
- const Pi = z.lazy(() => import("./page-revisions-content-q1Ch2-IQ.js"));
982
- function wi() {
991
+ const Pi = z.lazy(() => import("./page-revisions-content-D9Luz4aU.js"));
992
+ function vi() {
983
993
  const [e, t] = z.useState(!1);
984
- return /* @__PURE__ */ c(ys, { children: /* @__PURE__ */ m(zt, { delayDuration: 0, children: [
994
+ return /* @__PURE__ */ c(ys, { children: /* @__PURE__ */ m(jt, { delayDuration: 0, children: [
985
995
  /* @__PURE__ */ m(Es, { open: e, onOpenChange: t, children: [
986
- /* @__PURE__ */ c(na, { asChild: !0, children: /* @__PURE__ */ c(Wt, { asChild: !0, children: /* @__PURE__ */ m("span", { className: "flex items-center gap-2", children: [
996
+ /* @__PURE__ */ c(na, { asChild: !0, children: /* @__PURE__ */ c(zt, { asChild: !0, children: /* @__PURE__ */ m("span", { className: "flex items-center gap-2", children: [
987
997
  /* @__PURE__ */ m(M, { variant: "ghost", size: "icon", className: "h-8 w-8", children: [
988
998
  /* @__PURE__ */ c(Ia, { className: "h-4 w-4" }),
989
999
  /* @__PURE__ */ c("span", { className: "sr-only", children: "View revision history" })
@@ -992,7 +1002,7 @@ function wi() {
992
1002
  ] }) }) }),
993
1003
  /* @__PURE__ */ c(ps, { className: "flex h-[100vh] flex-col", children: e && /* @__PURE__ */ c(H, { fallback: /* @__PURE__ */ c(_i, {}), children: /* @__PURE__ */ c(Pi, { isOpen: e }) }) })
994
1004
  ] }),
995
- /* @__PURE__ */ c(Yt, { side: "bottom", children: /* @__PURE__ */ c("p", { children: "Revision history" }) })
1005
+ /* @__PURE__ */ c(Wt, { side: "bottom", children: /* @__PURE__ */ c("p", { children: "Revision history" }) })
996
1006
  ] }) });
997
1007
  }
998
1008
  const rn = ({
@@ -1003,11 +1013,11 @@ const rn = ({
1003
1013
  }) => {
1004
1014
  const { hasPermission: r } = ms();
1005
1015
  return e && !r(e) || t && !t.some((a) => r(a)) ? s : n;
1006
- }, vi = {
1016
+ }, wi = {
1007
1017
  SLUG_ALREADY_USED: "This slug is already in use. Please choose a different one."
1008
1018
  }, Ce = () => {
1009
- const e = k(), t = C();
1010
- return ae({
1019
+ const e = N(), t = b();
1020
+ return re({
1011
1021
  queryKey: [E.GET_PAGE_TYPES],
1012
1022
  staleTime: 1 / 0,
1013
1023
  placeholderData: [],
@@ -1015,9 +1025,9 @@ const rn = ({
1015
1025
  });
1016
1026
  }, bi = (e) => {
1017
1027
  const { data: t } = Ce();
1018
- return j(() => t == null ? void 0 : t.find((n) => n.key === e), [t, e]);
1028
+ return $(() => t == null ? void 0 : t.find((n) => n.key === e), [t, e]);
1019
1029
  }, Ii = () => {
1020
- const e = k(), t = C();
1030
+ const e = N(), t = b();
1021
1031
  return X({
1022
1032
  mutationFn: async ({ pageType: n, query: s }) => {
1023
1033
  try {
@@ -1034,7 +1044,7 @@ const rn = ({
1034
1044
  }
1035
1045
  });
1036
1046
  }, Nc = () => {
1037
- const e = k(), t = W(), n = C(), { data: s } = Ce();
1047
+ const e = N(), t = W(), n = b(), { data: s } = Ce();
1038
1048
  return X({
1039
1049
  mutationFn: async (r) => await n(e, {
1040
1050
  action: E.CREATE_PAGE,
@@ -1055,12 +1065,12 @@ const rn = ({
1055
1065
  onError: (r, a) => {
1056
1066
  const i = se(s, { key: a.pageType });
1057
1067
  R.error(`Failed to add new ${i != null && i.hasSlug ? "page" : i.name}.`, {
1058
- description: V(vi, r.message, r.message)
1068
+ description: V(wi, r.message, r.message)
1059
1069
  });
1060
1070
  }
1061
1071
  });
1062
1072
  }, Lc = () => {
1063
- const e = k(), t = W(), n = C(), { data: s } = be(), { data: r } = Ce();
1073
+ const e = N(), t = W(), n = b(), { data: s } = be(), { data: r } = Ce();
1064
1074
  return X({
1065
1075
  mutationFn: async (a) => await n(e, {
1066
1076
  action: E.UPDATE_PAGE,
@@ -1085,7 +1095,7 @@ const rn = ({
1085
1095
  }
1086
1096
  });
1087
1097
  }, kc = () => {
1088
- const e = k(), t = W(), n = C(), { data: s } = Ce();
1098
+ const e = N(), t = W(), n = b(), { data: s } = Ce();
1089
1099
  return X({
1090
1100
  mutationFn: async (r) => n(e, {
1091
1101
  action: E.DELETE_PAGE,
@@ -1114,7 +1124,7 @@ const rn = ({
1114
1124
  }
1115
1125
  });
1116
1126
  }, Oc = () => {
1117
- const e = k(), t = W(), n = C(), { data: s } = Ce();
1127
+ const e = N(), t = W(), n = b(), { data: s } = Ce();
1118
1128
  return X({
1119
1129
  mutationFn: async (r) => n(e, {
1120
1130
  action: E.TAKE_OFFLINE,
@@ -1139,7 +1149,7 @@ const rn = ({
1139
1149
  }
1140
1150
  });
1141
1151
  }, Cs = () => {
1142
- const e = k(), t = C(), n = W(), { data: s } = ie(), { savePageAsync: r } = Ge();
1152
+ const e = N(), t = b(), n = W(), { data: s } = ae(), { savePageAsync: r } = Ge();
1143
1153
  return X({
1144
1154
  mutationFn: async ({ ids: a }) => (await r(), t(e, {
1145
1155
  action: E.PUBLISH_CHANGES,
@@ -1159,7 +1169,7 @@ const rn = ({
1159
1169
  }
1160
1170
  });
1161
1171
  }, Dc = () => {
1162
- const e = k(), t = C(), n = W();
1172
+ const e = N(), t = b(), n = W();
1163
1173
  return X({
1164
1174
  mutationFn: async (s) => {
1165
1175
  var r;
@@ -1184,7 +1194,7 @@ const rn = ({
1184
1194
  }
1185
1195
  });
1186
1196
  }, Gc = () => {
1187
- const e = k(), t = C(), n = W();
1197
+ const e = N(), t = b(), n = W();
1188
1198
  return X({
1189
1199
  mutationFn: async (s) => t(e, {
1190
1200
  action: E.UNMARK_AS_TEMPLATE,
@@ -1200,7 +1210,7 @@ const rn = ({
1200
1210
  }
1201
1211
  });
1202
1212
  }, xc = () => {
1203
- const e = k(), t = C(), n = W();
1213
+ const e = N(), t = b(), n = W();
1204
1214
  return X({
1205
1215
  mutationFn: async ({ id: s, slug: r }) => t(e, {
1206
1216
  action: E.CHANGE_SLUG,
@@ -1217,7 +1227,7 @@ const rn = ({
1217
1227
  R.error("Failed to change slug");
1218
1228
  }
1219
1229
  });
1220
- }, Ci = K(() => import("./publish-pages-content-DEHD8qkl.js"));
1230
+ }, Ci = K(() => import("./publish-pages-content-C9F29IPt.js"));
1221
1231
  function Ni({
1222
1232
  showModal: e = !1,
1223
1233
  onClose: t = () => console.log("Cancelled")
@@ -1293,19 +1303,19 @@ function Dn({
1293
1303
  delayDuration: s = 700,
1294
1304
  showTooltip: r = !0
1295
1305
  }) {
1296
- return r ? /* @__PURE__ */ c(ys, { children: /* @__PURE__ */ m(zt, { delayDuration: s, children: [
1297
- /* @__PURE__ */ c(Wt, { asChild: !0, children: e }),
1298
- /* @__PURE__ */ c(Yt, { side: n, sideOffset: 10, children: /* @__PURE__ */ c("p", { children: t }) })
1306
+ return r ? /* @__PURE__ */ c(ys, { children: /* @__PURE__ */ m(jt, { delayDuration: s, children: [
1307
+ /* @__PURE__ */ c(zt, { asChild: !0, children: e }),
1308
+ /* @__PURE__ */ c(Wt, { side: n, sideOffset: 10, children: /* @__PURE__ */ c("p", { children: t }) })
1299
1309
  ] }) }) : e;
1300
1310
  }
1301
- const Di = K(() => import("./unpublish-page-D5tWKVLY.js")), Gi = K(() => import("./translation-warning-modal-DalBhNQy.js")), xi = () => {
1302
- const { t: e } = ve(), { selectedLang: t, fallbackLang: n } = Te(), s = re("getPreviewUrl", async (h) => h), [r, a] = q(""), { data: i } = ie(), { data: o } = xe(), { data: l } = Ce(), f = j(
1311
+ const Di = K(() => import("./unpublish-page-BucQ2Q3Z.js")), Gi = K(() => import("./translation-warning-modal-DalBhNQy.js")), xi = () => {
1312
+ const { t: e } = we(), { selectedLang: t, fallbackLang: n } = Te(), s = ie("getPreviewUrl", async (h) => h), [r, a] = q(""), { data: i } = ae(), { data: o } = xe(), { data: l } = Ce(), f = $(
1303
1313
  () => {
1304
1314
  var h;
1305
1315
  return (h = o == null ? void 0 : o.find((g) => (g == null ? void 0 : g.lang) === t)) == null ? void 0 : h.slug;
1306
1316
  },
1307
1317
  [t, o]
1308
- ), d = Q((h) => {
1318
+ ), d = j((h) => {
1309
1319
  var g;
1310
1320
  return (g = se(l, { key: h })) == null ? void 0 : g.hasSlug;
1311
1321
  }, [l]), u = t === n ? "" : t;
@@ -1321,7 +1331,7 @@ const Di = K(() => import("./unpublish-page-D5tWKVLY.js")), Gi = K(() => import(
1321
1331
  })();
1322
1332
  }, [s, f, i == null ? void 0 : i.pageType, d, i == null ? void 0 : i.id, u]), /* @__PURE__ */ c(ge, { children: /* @__PURE__ */ c(Dn, { content: e("Open preview in new tab"), delayDuration: 0, children: /* @__PURE__ */ c("a", { href: r, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ c(M, { variant: "ghost", size: "sm", className: "gap-2", children: /* @__PURE__ */ c(Ca, { className: "h-4 w-4" }) }) }) }) });
1323
1333
  }, Ri = () => {
1324
- const { t: e } = ve(), [t, n] = Vr();
1334
+ const { t: e } = we(), [t, n] = Vr();
1325
1335
  return /* @__PURE__ */ m(ge, { children: [
1326
1336
  /* @__PURE__ */ c(Dn, { content: e("Theme"), delayDuration: 0, children: /* @__PURE__ */ c(
1327
1337
  M,
@@ -1336,7 +1346,7 @@ const Di = K(() => import("./unpublish-page-D5tWKVLY.js")), Gi = K(() => import(
1336
1346
  /* @__PURE__ */ c("div", { className: "h-4 w-px bg-gray-200 dark:bg-gray-700" })
1337
1347
  ] });
1338
1348
  }, Ui = () => {
1339
- const { t: e } = ve(), [t, n] = q(!1), { isLocked: s } = Ie(), { savePageAsync: r, saveState: a } = Ge();
1349
+ const { t: e } = we(), [t, n] = q(!1), { isLocked: s } = Ie(), { savePageAsync: r, saveState: a } = Ge();
1340
1350
  ne(() => {
1341
1351
  const d = (u) => {
1342
1352
  a === "UNSAVED" && (u.preventDefault(), u.returnValue = !1);
@@ -1345,9 +1355,9 @@ const Di = K(() => import("./unpublish-page-D5tWKVLY.js")), Gi = K(() => import(
1345
1355
  window.removeEventListener("beforeunload", d);
1346
1356
  };
1347
1357
  }, [a]);
1348
- const i = Q(async () => {
1358
+ const i = j(async () => {
1349
1359
  t || (n(!0), await r(), n(!1));
1350
- }, [r, t]), { buttonIcon: o, buttonClass: l, tooltipContent: f } = j(() => {
1360
+ }, [r, t]), { buttonIcon: o, buttonClass: l, tooltipContent: f } = $(() => {
1351
1361
  switch (a) {
1352
1362
  case "UNSAVED":
1353
1363
  return {
@@ -1358,7 +1368,7 @@ const Di = K(() => import("./unpublish-page-D5tWKVLY.js")), Gi = K(() => import(
1358
1368
  case "SAVING":
1359
1369
  return {
1360
1370
  tooltipContent: e("Saving"),
1361
- buttonIcon: /* @__PURE__ */ c(Ft, { className: "h-4 w-4 animate-spin text-sky-700" }),
1371
+ buttonIcon: /* @__PURE__ */ c(Mt, { className: "h-4 w-4 animate-spin text-sky-700" }),
1362
1372
  buttonClass: "gap-x-1"
1363
1373
  };
1364
1374
  case "SAVED":
@@ -1375,27 +1385,27 @@ const Di = K(() => import("./unpublish-page-D5tWKVLY.js")), Gi = K(() => import(
1375
1385
  f
1376
1386
  ] });
1377
1387
  }, Bi = () => {
1378
- const { t: e } = ve(), { selectedLang: t } = Te(), { data: n } = be(), { data: s } = xe(), [r, a] = q(!1), [i, o] = q(!1), [l, f] = q(null), { savePageAsync: d } = Ge(), [u, h] = q(!1), { data: g } = ie(), { mutate: A, isPending: T } = Cs(), { needTranslations: p } = Ge(), y = p(), { buttonText: _, buttonClassName: b, isPublished: O } = j(() => {
1379
- const w = g && (g == null ? void 0 : g.online);
1388
+ const { t: e } = we(), { selectedLang: t } = Te(), { data: n } = be(), { data: s } = xe(), [r, a] = q(!1), [i, o] = q(!1), [l, f] = q(null), { savePageAsync: d } = Ge(), [u, h] = q(!1), { data: g } = ae(), { mutate: A, isPending: T } = Cs(), { needTranslations: p } = Ge(), y = p(), { buttonText: _, buttonClassName: I, isPublished: O } = $(() => {
1389
+ const v = g && (g == null ? void 0 : g.online);
1380
1390
  return {
1381
- buttonClassName: w ? "hover:bg-green-600 bg-green-500" : "",
1382
- isPublished: w,
1383
- buttonText: e(w ? "Published" : "Publish")
1391
+ buttonClassName: v ? "hover:bg-green-600 bg-green-500" : "",
1392
+ isPublished: v,
1393
+ buttonText: e(v ? "Published" : "Publish")
1384
1394
  };
1385
1395
  }, [g, e]), B = async () => {
1386
1396
  if (y) {
1387
1397
  h(!0);
1388
1398
  return;
1389
1399
  }
1390
- N();
1391
- }, N = () => {
1392
- const w = [n == null ? void 0 : n.id, n == null ? void 0 : n.primaryPage];
1393
- A({ ids: fs(w) }, { onSuccess: () => an("TOP_RIGHT") });
1400
+ L();
1401
+ }, L = () => {
1402
+ const v = [n == null ? void 0 : n.id, n == null ? void 0 : n.primaryPage];
1403
+ A({ ids: fs(v) }, { onSuccess: () => an("TOP_RIGHT") });
1394
1404
  }, pe = () => {
1395
- h(!1), N();
1405
+ h(!1), L();
1396
1406
  }, ye = async () => {
1397
1407
  h(!1), await d();
1398
- }, U = j(() => Bt(s ?? [], "id"), [s]);
1408
+ }, U = $(() => Ut(s ?? [], "id"), [s]);
1399
1409
  return /* @__PURE__ */ m(ge, { children: [
1400
1410
  /* @__PURE__ */ m("div", { className: "flex", children: [
1401
1411
  /* @__PURE__ */ m(
@@ -1404,7 +1414,7 @@ const Di = K(() => import("./unpublish-page-D5tWKVLY.js")), Gi = K(() => import(
1404
1414
  size: "sm",
1405
1415
  onClick: B,
1406
1416
  disabled: T || !(g != null && g.id),
1407
- className: `relative flex items-center gap-1 overflow-hidden rounded-r-none text-white transition-all duration-300 ease-in-out ${b}`,
1417
+ className: `relative flex items-center gap-1 overflow-hidden rounded-r-none text-white transition-all duration-300 ease-in-out ${I}`,
1408
1418
  onMouseEnter: () => o(!0),
1409
1419
  onMouseLeave: () => o(!1),
1410
1420
  children: [
@@ -1427,13 +1437,13 @@ const Di = K(() => import("./unpublish-page-D5tWKVLY.js")), Gi = K(() => import(
1427
1437
  ]
1428
1438
  }
1429
1439
  ),
1430
- /* @__PURE__ */ m(wn, { children: [
1431
- /* @__PURE__ */ c(vn, { asChild: !0, children: /* @__PURE__ */ c(
1440
+ /* @__PURE__ */ m(vn, { children: [
1441
+ /* @__PURE__ */ c(wn, { asChild: !0, children: /* @__PURE__ */ c(
1432
1442
  M,
1433
1443
  {
1434
1444
  size: "sm",
1435
1445
  disabled: T || !(g != null && g.id),
1436
- className: `rounded-l-none border-l border-white/50 px-2 text-white ${b}`,
1446
+ className: `rounded-l-none border-l border-white/50 px-2 text-white ${I}`,
1437
1447
  children: /* @__PURE__ */ c(fn, { className: "h-4 w-4" })
1438
1448
  }
1439
1449
  ) }),
@@ -1490,7 +1500,7 @@ const Di = K(() => import("./unpublish-page-D5tWKVLY.js")), Gi = K(() => import(
1490
1500
  function Mi() {
1491
1501
  const { isLocked: e } = Ie(), [t] = oe(), n = t.get("lang"), s = Ps(n);
1492
1502
  return e || !s ? /* @__PURE__ */ c("div", {}) : /* @__PURE__ */ m("div", { className: "flex items-center justify-end gap-1", children: [
1493
- /* @__PURE__ */ c(wi, {}),
1503
+ /* @__PURE__ */ c(vi, {}),
1494
1504
  /* @__PURE__ */ c(rn, { permission: ue.EDIT_THEME, children: /* @__PURE__ */ c(Ri, {}) }),
1495
1505
  /* @__PURE__ */ c(xi, {}),
1496
1506
  /* @__PURE__ */ c(rn, { permission: ue.SAVE_PAGE, children: /* @__PURE__ */ c(Ui, {}) }),
@@ -1508,9 +1518,9 @@ const Fi = ({
1508
1518
  children: o,
1509
1519
  isLanguagePage: l
1510
1520
  }) => {
1511
- const { t: f } = ve(), { hasPermission: d } = ms(), { data: u } = Ce(), h = j(() => se(u, { key: e.pageType }), [u, e.pageType]), g = j(() => !!e.isTemplate, [e.isTemplate]), A = j(() => !!(h != null && h.hasSlug), [h == null ? void 0 : h.hasSlug]);
1512
- return !d(ue.EDIT_PAGE) && !d(ue.DELETE_PAGE) && !d(ue.UNPUBLISH_PAGE) || !e ? null : /* @__PURE__ */ m(wn, { children: [
1513
- /* @__PURE__ */ c(vn, { asChild: !0, onClick: (p) => p.stopPropagation(), children: o }),
1521
+ const { t: f } = we(), { hasPermission: d } = ms(), { data: u } = Ce(), h = $(() => se(u, { key: e.pageType }), [u, e.pageType]), g = $(() => !!e.isTemplate, [e.isTemplate]), A = $(() => !!(h != null && h.hasSlug), [h == null ? void 0 : h.hasSlug]);
1522
+ return !d(ue.EDIT_PAGE) && !d(ue.DELETE_PAGE) && !d(ue.UNPUBLISH_PAGE) || !e ? null : /* @__PURE__ */ m(vn, { children: [
1523
+ /* @__PURE__ */ c(wn, { asChild: !0, onClick: (p) => p.stopPropagation(), children: o }),
1514
1524
  /* @__PURE__ */ m(bn, { align: "center", className: "text-sm", children: [
1515
1525
  d(ue.ADD_PAGE) && !l && /* @__PURE__ */ m(
1516
1526
  de,
@@ -1594,15 +1604,15 @@ const Fi = ({
1594
1604
  ) })
1595
1605
  ] })
1596
1606
  ] });
1597
- }, qi = K(() => import("./add-new-page-DX1aQA56.js")), Ki = K(() => import("./delete-page-DE-nabXs.js")), Vi = K(() => import("./duplicate-page-C1r3iBDY.js")), Hi = K(() => import("./mark-as-template-0kikl0oL.js")), Qi = K(() => import("./unmark-as-template-BENGNo7g.js")), $i = K(() => import("./unpublish-page-D5tWKVLY.js")), ji = () => {
1598
- const [e, t] = q(null), [n, s] = q(null), [r, a] = q(null), [i, o] = q(null), [l, f] = q(null), [d, u] = q(null), { data: h, isFetching: g } = be(), { selectedLang: A, fallbackLang: T } = Te(), { data: p } = xe(), y = p == null ? void 0 : p.find((N) => N.lang === A), { isLocked: _ } = Ie(), b = !(h != null && h.slug), [, O] = te(kn);
1607
+ }, qi = K(() => import("./add-new-page-DLr99NII.js")), Ki = K(() => import("./delete-page-CLee5S7S.js")), Vi = K(() => import("./duplicate-page-DQRyzlJS.js")), Hi = K(() => import("./mark-as-template-BuKRW4TC.js")), Qi = K(() => import("./unmark-as-template-BZtRGHpb.js")), $i = K(() => import("./unpublish-page-BucQ2Q3Z.js")), ji = () => {
1608
+ const [e, t] = q(null), [n, s] = q(null), [r, a] = q(null), [i, o] = q(null), [l, f] = q(null), [d, u] = q(null), { data: h, isFetching: g } = be(), { selectedLang: A, fallbackLang: T } = Te(), { data: p } = xe(), y = p == null ? void 0 : p.find((L) => L.lang === A), { isLocked: _ } = Ie(), I = !(h != null && h.slug), [, O] = te(kn);
1599
1609
  if (!h) return null;
1600
- const B = (N) => {
1610
+ const B = (L) => {
1601
1611
  A.length > 0 && A !== T ? O({
1602
1612
  edit: !0,
1603
- id: N == null ? void 0 : N.id,
1604
- primaryPage: N == null ? void 0 : N.primaryPage
1605
- }) : u(N);
1613
+ id: L == null ? void 0 : L.id,
1614
+ primaryPage: L == null ? void 0 : L.primaryPage
1615
+ }) : u(L);
1606
1616
  };
1607
1617
  return /* @__PURE__ */ m(ge, { children: [
1608
1618
  /* @__PURE__ */ m("div", { className: "flex items-center justify-between rounded px-[2px] transition-colors duration-200", children: [
@@ -1611,8 +1621,8 @@ const Fi = ({
1611
1621
  {
1612
1622
  className: "flex h-7 max-w-[200px] cursor-pointer items-center truncate rounded px-1 text-xs font-medium",
1613
1623
  variant: "ghost",
1614
- children: g ? /* @__PURE__ */ c(Ft, { className: "h-4 w-4 animate-spin text-slate-400" }) : /* @__PURE__ */ m("span", { className: "flex w-full cursor-pointer items-end overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-xs font-medium", children: [
1615
- b ? /* @__PURE__ */ c(Ra, { className: "mr-1 h-4 w-4" }) : /* @__PURE__ */ c(Ua, { className: "mr-1 h-4 w-4" }),
1624
+ children: g ? /* @__PURE__ */ c(Mt, { className: "h-4 w-4 animate-spin text-slate-400" }) : /* @__PURE__ */ m("span", { className: "flex w-full cursor-pointer items-end overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-xs font-medium", children: [
1625
+ I ? /* @__PURE__ */ c(Ra, { className: "mr-1 h-4 w-4" }) : /* @__PURE__ */ c(Ua, { className: "mr-1 h-4 w-4" }),
1616
1626
  V(y || h, "name") ?? ""
1617
1627
  ] })
1618
1628
  }
@@ -1629,12 +1639,12 @@ const Fi = ({
1629
1639
  Fi,
1630
1640
  {
1631
1641
  page: h,
1632
- setDuplicatePage: (N) => f(N),
1633
- setAddEditPage: (N) => B(N),
1634
- setUnpublishPage: (N) => s(N),
1635
- setDeletePage: (N) => t(N),
1636
- setMarkAsTemplate: (N) => a(N),
1637
- setUnmarkAsTemplate: (N) => o(N),
1642
+ setDuplicatePage: (L) => f(L),
1643
+ setAddEditPage: (L) => B(L),
1644
+ setUnpublishPage: (L) => s(L),
1645
+ setDeletePage: (L) => t(L),
1646
+ setMarkAsTemplate: (L) => a(L),
1647
+ setUnmarkAsTemplate: (L) => o(L),
1638
1648
  isLanguagePage: A.length > 0 && A !== T,
1639
1649
  children: /* @__PURE__ */ c(M, { variant: "ghost", size: "icon", className: "h-7 w-7 rounded", children: /* @__PURE__ */ c(jn, { className: "h-4 w-4" }) })
1640
1650
  }
@@ -1666,7 +1676,7 @@ const Fi = ({
1666
1676
  }, Ns = ({ children: e, className: t = "" }) => /* @__PURE__ */ c(
1667
1677
  "div",
1668
1678
  {
1669
- className: Mt(
1679
+ className: Bt(
1670
1680
  "fixed bottom-0 left-0 right-0 top-[50px] z-[20] flex w-screen flex-col items-center justify-center bg-black/40 transition-all",
1671
1681
  t
1672
1682
  ),
@@ -1675,19 +1685,19 @@ const Fi = ({
1675
1685
  ), zi = ({ hasDynamicPage: e }) => /* @__PURE__ */ c(Ns, { children: /* @__PURE__ */ m("div", { className: "flex min-w-[300px] max-w-[400px] flex-col items-center justify-center rounded-lg border bg-white p-4 shadow-lg", children: [
1676
1686
  /* @__PURE__ */ c("h1", { className: "text-lg font-medium", children: e ? "Select a page" : "No pages found" }),
1677
1687
  /* @__PURE__ */ c("p", { className: "pt-2 text-center text-sm font-light text-gray-600", children: e ? "Please select a page from the list in the top header. This will enable you to edit the page." : "Please add a new page" })
1678
- ] }) }), Wi = K(() => import("./dynamic-page-selector-Bk8_xgFx.js")), Yi = () => {
1688
+ ] }) }), Wi = K(() => import("./dynamic-page-selector-CLIhp1-Z.js")), Yi = () => {
1679
1689
  const { dynamicPage: e, allLangPages: t, isFetching: n } = ni(), s = t.length > 0;
1680
1690
  return n ? null : /* @__PURE__ */ m("div", { className: "relative", children: [
1681
1691
  !e && /* @__PURE__ */ c(zi, { hasDynamicPage: s }),
1682
1692
  /* @__PURE__ */ c(H, { children: /* @__PURE__ */ c(Wi, {}) })
1683
1693
  ] });
1684
1694
  }, Ji = () => {
1685
- const { data: e, isFetching: t } = be(), { data: n, isFetching: s } = ie(), r = V(n, "dynamic", !1), a = Cn(), i = Hr("dynamic-page-selector"), o = e == null ? void 0 : e.slug, l = !o, f = ii(), d = t || s, h = (l ? `Partial: ${e == null ? void 0 : e.name} ` : `${o}${a}`).replace(window.location.host, "");
1695
+ const { data: e, isFetching: t } = be(), { data: n, isFetching: s } = ae(), r = V(n, "dynamic", !1), a = Cn(), i = Hr("dynamic-page-selector"), o = e == null ? void 0 : e.slug, l = !o, f = ii(), d = t || s, h = (l ? `Partial: ${e == null ? void 0 : e.name} ` : `${o}${a}`).replace(window.location.host, "");
1686
1696
  return /* @__PURE__ */ m("div", { className: "relative flex items-center gap-x-1", children: [
1687
1697
  /* @__PURE__ */ c(
1688
1698
  "div",
1689
1699
  {
1690
- className: Mt(
1700
+ className: Bt(
1691
1701
  "flex h-8 w-auto max-w-[600px] items-center rounded-md border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800",
1692
1702
  d && "max-w-0 overflow-hidden opacity-0"
1693
1703
  ),
@@ -1697,7 +1707,7 @@ const Fi = ({
1697
1707
  /* @__PURE__ */ m(
1698
1708
  "div",
1699
1709
  {
1700
- className: Mt(
1710
+ className: Bt(
1701
1711
  "flex h-8 w-auto max-w-[600px] items-center rounded-md border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800" + (l ? " pr-2" : ""),
1702
1712
  d && "max-w-0 overflow-hidden opacity-0"
1703
1713
  ),
@@ -1726,21 +1736,21 @@ const Fi = ({
1726
1736
  /* @__PURE__ */ c(Ji, {}),
1727
1737
  /* @__PURE__ */ c(Mi, {})
1728
1738
  ] }), Ls = () => {
1729
- const e = W(), { data: t } = ae({
1739
+ const e = W(), { data: t } = re({
1730
1740
  queryKey: [E.AI_CONTEXT],
1731
1741
  initialData: "",
1732
1742
  queryFn: () => "",
1733
1743
  staleTime: 0
1734
1744
  });
1735
- return { setAiContext: Q(
1745
+ return { setAiContext: j(
1736
1746
  (s) => {
1737
1747
  e.setQueryData([E.AI_CONTEXT], s);
1738
1748
  },
1739
1749
  [e]
1740
1750
  ), aiContext: t };
1741
1751
  }, Zi = () => {
1742
- const e = k(), { aiContext: t } = Ls(), n = C();
1743
- return Q(
1752
+ const e = N(), { aiContext: t } = Ls(), n = b();
1753
+ return j(
1744
1754
  async (s, r, a, i) => n(e, {
1745
1755
  action: E.ASK_AI,
1746
1756
  data: { type: s, prompt: r, blocks: a, context: t, lang: i }
@@ -1748,7 +1758,7 @@ const Fi = ({
1748
1758
  [e, t, n]
1749
1759
  );
1750
1760
  }, eo = (e, t) => t.map((n) => {
1751
- if (jt(e, n._type)) {
1761
+ if ($t(e, n._type)) {
1752
1762
  const s = za(n._type);
1753
1763
  return {
1754
1764
  ...s,
@@ -1767,7 +1777,7 @@ const Fi = ({
1767
1777
  return n;
1768
1778
  }), to = (e) => {
1769
1779
  const t = ja();
1770
- return j(() => {
1780
+ return $(() => {
1771
1781
  if (!e || he(e)) return { blocks: [] };
1772
1782
  const n = hs(
1773
1783
  e,
@@ -1776,8 +1786,8 @@ const Fi = ({
1776
1786
  return { blocks: eo(t, n) };
1777
1787
  }, [e, t]);
1778
1788
  }, no = () => {
1779
- const [e] = oe(), t = e.get("page"), n = k(), { setAiContext: s } = Ls(), [, r] = Nn(), [, a] = ai(), [, i] = Qr(), o = C();
1780
- return ae({
1789
+ const [e] = oe(), t = e.get("page"), n = N(), { setAiContext: s } = Ls(), [, r] = Nn(), [, a] = ai(), [, i] = Qr(), o = b();
1790
+ return re({
1781
1791
  queryKey: [E.GET_DRAFT_PAGE, t],
1782
1792
  staleTime: 1 / 0,
1783
1793
  gcTime: 0,
@@ -1792,8 +1802,8 @@ const Fi = ({
1792
1802
  enabled: !!t
1793
1803
  });
1794
1804
  }, so = () => {
1795
- const { data: e } = ie(), { data: t } = be(), n = k(), s = C(), r = On(), a = Cn();
1796
- return ae({
1805
+ const { data: e } = ae(), { data: t } = be(), n = N(), s = b(), r = On(), a = Cn();
1806
+ return re({
1797
1807
  queryKey: [E.GET_BUILDER_PAGE_DATA, t == null ? void 0 : t.id, a],
1798
1808
  staleTime: 1 / 0,
1799
1809
  gcTime: 0,
@@ -1822,7 +1832,7 @@ const Fi = ({
1822
1832
  enabled: !!(e != null && e.pageType) && !!t.id
1823
1833
  });
1824
1834
  }, ro = () => {
1825
- const e = k(), t = W(), n = C();
1835
+ const e = N(), t = W(), n = b();
1826
1836
  return X({
1827
1837
  mutationFn: async (s) => n(e, {
1828
1838
  action: E.UPDATE_WEBSITE_SETTINGS,
@@ -1841,7 +1851,7 @@ const Fi = ({
1841
1851
  }
1842
1852
  });
1843
1853
  }, Rc = () => {
1844
- const e = k(), t = W(), n = C(), { selectedLang: s } = Te();
1854
+ const e = N(), t = W(), n = b(), { selectedLang: s } = Te();
1845
1855
  return X({
1846
1856
  mutationFn: async (r) => n(e, { action: E.ADD_GLOBAL_SCHEMA, data: { ...r, lang: s } }),
1847
1857
  onSuccess: () => {
@@ -1856,7 +1866,7 @@ const Fi = ({
1856
1866
  }
1857
1867
  });
1858
1868
  }, Uc = () => {
1859
- const e = k(), t = W(), n = C(), { selectedLang: s } = Te();
1869
+ const e = N(), t = W(), n = b(), { selectedLang: s } = Te();
1860
1870
  return X({
1861
1871
  mutationFn: async (r) => n(e, { action: E.UPDATE_GLOBAL_SCHEMA, data: { ...r, lang: s } }),
1862
1872
  onSuccess: () => {
@@ -1871,7 +1881,7 @@ const Fi = ({
1871
1881
  }
1872
1882
  });
1873
1883
  }, Bc = () => {
1874
- const e = k(), t = W(), n = C();
1884
+ const e = N(), t = W(), n = b();
1875
1885
  return X({
1876
1886
  mutationFn: async (s) => n(e, { action: E.DELETE_GLOBAL_SCHEMA, data: { id: s } }),
1877
1887
  onSuccess: () => {
@@ -1886,7 +1896,7 @@ const Fi = ({
1886
1896
  }
1887
1897
  });
1888
1898
  }, Mc = () => {
1889
- const e = k(), t = C();
1899
+ const e = N(), t = b();
1890
1900
  return X({
1891
1901
  mutationFn: async (n) => t(e, { action: E.TOGGLE_PAGE_GLOBAL_SCHEMA, data: n }),
1892
1902
  onError: (n) => {
@@ -1896,7 +1906,7 @@ const Fi = ({
1896
1906
  }
1897
1907
  });
1898
1908
  }, Fc = () => {
1899
- const e = k(), t = C();
1909
+ const e = N(), t = b();
1900
1910
  return X({
1901
1911
  mutationFn: async (n) => t(e, { action: E.APPLY_SCHEMA_TO_ALL_PAGES, data: { schemaId: n } }),
1902
1912
  onSuccess: (n) => {
@@ -1909,7 +1919,7 @@ const Fi = ({
1909
1919
  }
1910
1920
  });
1911
1921
  }, qc = () => {
1912
- const e = k(), t = C();
1922
+ const e = N(), t = b();
1913
1923
  return X({
1914
1924
  mutationFn: async (n) => t(e, { action: E.REMOVE_SCHEMA_FROM_ALL_PAGES, data: { schemaId: n } }),
1915
1925
  onSuccess: (n) => {
@@ -1942,8 +1952,8 @@ const Fi = ({
1942
1952
  }
1943
1953
  }
1944
1954
  }, ao = () => {
1945
- const e = k(), t = C();
1946
- return ae({
1955
+ const e = N(), t = b();
1956
+ return re({
1947
1957
  queryKey: ["uiLibraries"],
1948
1958
  staleTime: "static",
1949
1959
  queryFn: async () => {
@@ -1961,8 +1971,8 @@ const Fi = ({
1961
1971
  }
1962
1972
  });
1963
1973
  }, io = () => {
1964
- const e = Ss(), t = C(), { user: n } = It(), s = n == null ? void 0 : n.id;
1965
- return ae({
1974
+ const e = Ss(), t = b(), { user: n } = Yt(), s = n == null ? void 0 : n.id;
1975
+ return re({
1966
1976
  queryKey: [E.GET_ROLE_AND_PERMISSIONS, s],
1967
1977
  queryFn: () => t(e, {
1968
1978
  action: E.GET_ROLE_AND_PERMISSIONS,
@@ -1972,7 +1982,7 @@ const Fi = ({
1972
1982
  staleTime: 1 / 0
1973
1983
  });
1974
1984
  }, oo = () => {
1975
- const e = k(), t = C(), [, n] = Nn();
1985
+ const e = N(), t = b(), [, n] = Nn();
1976
1986
  return { onSave: async ({
1977
1987
  page: r,
1978
1988
  blocks: a,
@@ -1992,9 +2002,9 @@ const Fi = ({
1992
2002
  }
1993
2003
  } };
1994
2004
  }, lo = () => {
1995
- const { data: e } = bs(), t = k(), n = C();
2005
+ const { data: e } = bs(), t = N(), n = b();
1996
2006
  return {
1997
- getPartialBlocks: Q(async () => {
2007
+ getPartialBlocks: j(async () => {
1998
2008
  const s = {};
1999
2009
  for (const r of e ?? [])
2000
2010
  he(r == null ? void 0 : r.slug) && (s[r.id] = {
@@ -2004,7 +2014,7 @@ const Fi = ({
2004
2014
  });
2005
2015
  return s;
2006
2016
  }, [e]),
2007
- getPartialBlockBlocks: Q(
2017
+ getPartialBlockBlocks: j(
2008
2018
  async (s) => {
2009
2019
  if (!s) return [];
2010
2020
  try {
@@ -2012,7 +2022,7 @@ const Fi = ({
2012
2022
  action: "GET_DRAFT_PAGE",
2013
2023
  data: { id: s, draft: !0, editor: !1 }
2014
2024
  });
2015
- return hs(r.blocks, (a) => jt(a, "_id"));
2025
+ return hs(r.blocks, (a) => $t(a, "_id"));
2016
2026
  } catch (r) {
2017
2027
  return console.error(r), [];
2018
2028
  }
@@ -2020,9 +2030,9 @@ const Fi = ({
2020
2030
  [n, t]
2021
2031
  )
2022
2032
  };
2023
- }, co = K(() => import("./lang-panel-CtpuO-KH.js")), uo = ({ isActive: e, show: t }) => {
2033
+ }, co = K(() => import("./lang-panel-DV0KFSiS.js")), uo = ({ isActive: e, show: t }) => {
2024
2034
  const { data: n } = Re();
2025
- return !jt(n, "languages") || !V(n, "languages", []).length ? null : /* @__PURE__ */ c(M, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ c(Ma, { className: "h-4 w-4" }) });
2035
+ return !$t(n, "languages") || !V(n, "languages", []).length ? null : /* @__PURE__ */ c(M, { size: "sm", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ c(Ma, { className: "h-4 w-4" }) });
2026
2036
  }, ks = "lang", fo = {
2027
2037
  id: ks,
2028
2038
  label: "Languages",
@@ -2031,9 +2041,9 @@ const Fi = ({
2031
2041
  button: uo,
2032
2042
  view: "modal",
2033
2043
  width: 400
2034
- }, ho = K(() => import("./seo-panel-DEQfOfZs.js")), Os = "seo", go = ({ isActive: e, show: t }) => {
2035
- const { data: n } = ie(), s = bi(n == null ? void 0 : n.pageType);
2036
- return !jt(s, "hasSlug") || !s.hasSlug ? null : /* @__PURE__ */ c(M, { size: "icon", className: "my-1 p-0", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ m(
2044
+ }, ho = K(() => import("./seo-panel-CH6YxaSs.js")), Os = "seo", go = ({ isActive: e, show: t }) => {
2045
+ const { data: n } = ae(), s = bi(n == null ? void 0 : n.pageType);
2046
+ return !$t(s, "hasSlug") || !s.hasSlug ? null : /* @__PURE__ */ c(M, { size: "icon", className: "my-1 p-0", onClick: t, variant: e ? "default" : "ghost", children: /* @__PURE__ */ m(
2037
2047
  "svg",
2038
2048
  {
2039
2049
  stroke: "currentColor",
@@ -2060,7 +2070,7 @@ const Fi = ({
2060
2070
  width: 600,
2061
2071
  view: "modal"
2062
2072
  }, Ds = "user-info", Eo = () => {
2063
- const { t: e } = ve(), { user: t, logout: n } = It(), s = re("onLogout", ds);
2073
+ const { t: e } = we(), { user: t, logout: n } = Yt(), s = ie("onLogout", ds);
2064
2074
  return t ? /* @__PURE__ */ m(sa, { children: [
2065
2075
  /* @__PURE__ */ c(ra, { asChild: !0, children: /* @__PURE__ */ c(M, { variant: "ghost", className: "text-sm font-medium", children: /* @__PURE__ */ c(Fa, { className: "h-4 w-4" }) }) }),
2066
2076
  /* @__PURE__ */ m(aa, { className: "w-auto space-y-2 p-4", children: [
@@ -2116,30 +2126,30 @@ function Jn(e) {
2116
2126
  function at(e) {
2117
2127
  P.context = e;
2118
2128
  }
2119
- var Gs = !1, Ao = (e, t) => e === t, qt = Symbol("solid-proxy"), xs = typeof Proxy == "function", Rs = Symbol("solid-track"), Kt = {
2129
+ var Gs = !1, Ao = (e, t) => e === t, Ft = Symbol("solid-proxy"), xs = typeof Proxy == "function", Rs = Symbol("solid-track"), qt = {
2120
2130
  equals: Ao
2121
- }, Us = Hs, Se = 1, Vt = 2, Bs = {
2131
+ }, Us = Hs, Se = 1, Kt = 2, Bs = {
2122
2132
  owned: null,
2123
2133
  cleanups: null,
2124
2134
  context: null,
2125
2135
  owner: null
2126
- }, on = {}, I = null, ln = null, To = null, G = null, ee = null, Ae = null, Jt = 0;
2136
+ }, on = {}, C = null, ln = null, To = null, G = null, ee = null, Ae = null, Jt = 0;
2127
2137
  function Oe(e, t) {
2128
- const n = G, s = I, r = e.length === 0, a = t === void 0 ? s : t, i = r ? Bs : {
2138
+ const n = G, s = C, r = e.length === 0, a = t === void 0 ? s : t, i = r ? Bs : {
2129
2139
  owned: null,
2130
2140
  cleanups: null,
2131
2141
  context: a ? a.context : null,
2132
2142
  owner: a
2133
2143
  }, o = r ? e : () => e(() => Z(() => ut(i)));
2134
- I = i, G = null;
2144
+ C = i, G = null;
2135
2145
  try {
2136
2146
  return me(o, !0);
2137
2147
  } finally {
2138
- G = n, I = s;
2148
+ G = n, C = s;
2139
2149
  }
2140
2150
  }
2141
2151
  function F(e, t) {
2142
- t = t ? Object.assign({}, Kt, t) : Kt;
2152
+ t = t ? Object.assign({}, qt, t) : qt;
2143
2153
  const n = {
2144
2154
  value: e,
2145
2155
  observers: null,
@@ -2162,7 +2172,7 @@ function Ms(e, t, n) {
2162
2172
  (!n || !n.render) && (s.user = !0), Ae ? Ae.push(s) : nt(s);
2163
2173
  }
2164
2174
  function J(e, t, n) {
2165
- n = n ? Object.assign({}, Kt, n) : Kt;
2175
+ n = n ? Object.assign({}, qt, n) : qt;
2166
2176
  const s = Xt(e, t, !0, 0);
2167
2177
  return s.observers = null, s.observerSlots = null, s.comparator = n.equals || void 0, nt(s), Ks.bind(s);
2168
2178
  }
@@ -2175,78 +2185,78 @@ function Po(e, t, n) {
2175
2185
  let i = null, o = on, l = null, f = !1, d = "initialValue" in a, u = typeof s == "function" && J(s);
2176
2186
  const h = /* @__PURE__ */ new Set(), [g, A] = (a.storage || F)(a.initialValue), [T, p] = F(void 0), [y, _] = F(void 0, {
2177
2187
  equals: !1
2178
- }), [b, O] = F(d ? "ready" : "unresolved");
2188
+ }), [I, O] = F(d ? "ready" : "unresolved");
2179
2189
  P.context && (l = P.getNextContextId(), a.ssrLoadFrom === "initial" ? o = a.initialValue : P.load && P.has(l) && (o = P.load(l)));
2180
- function B(w, v, Y, $) {
2181
- return i === w && (i = null, $ !== void 0 && (d = !0), (w === o || v === o) && a.onHydrated && queueMicrotask(() => a.onHydrated($, {
2182
- value: v
2183
- })), o = on, N(v, Y)), v;
2190
+ function B(v, w, Y, Q) {
2191
+ return i === v && (i = null, Q !== void 0 && (d = !0), (v === o || w === o) && a.onHydrated && queueMicrotask(() => a.onHydrated(Q, {
2192
+ value: w
2193
+ })), o = on, L(w, Y)), w;
2184
2194
  }
2185
- function N(w, v) {
2195
+ function L(v, w) {
2186
2196
  me(() => {
2187
- v === void 0 && A(() => w), O(v !== void 0 ? "errored" : d ? "ready" : "unresolved"), p(v);
2197
+ w === void 0 && A(() => v), O(w !== void 0 ? "errored" : d ? "ready" : "unresolved"), p(w);
2188
2198
  for (const Y of h.keys()) Y.decrement();
2189
2199
  h.clear();
2190
2200
  }, !1);
2191
2201
  }
2192
2202
  function pe() {
2193
- const w = Io, v = g(), Y = T();
2203
+ const v = Io, w = g(), Y = T();
2194
2204
  if (Y !== void 0 && !i) throw Y;
2195
- return G && G.user, v;
2205
+ return G && G.user, w;
2196
2206
  }
2197
- function ye(w = !0) {
2198
- if (w !== !1 && f) return;
2207
+ function ye(v = !0) {
2208
+ if (v !== !1 && f) return;
2199
2209
  f = !1;
2200
- const v = u ? u() : s;
2201
- if (v == null || v === !1) {
2210
+ const w = u ? u() : s;
2211
+ if (w == null || w === !1) {
2202
2212
  B(i, Z(g));
2203
2213
  return;
2204
2214
  }
2205
2215
  let Y;
2206
- const $ = o !== on ? o : Z(() => {
2216
+ const Q = o !== on ? o : Z(() => {
2207
2217
  try {
2208
- return r(v, {
2218
+ return r(w, {
2209
2219
  value: g(),
2210
- refetching: w
2220
+ refetching: v
2211
2221
  });
2212
2222
  } catch (le) {
2213
2223
  Y = le;
2214
2224
  }
2215
2225
  });
2216
2226
  if (Y !== void 0) {
2217
- B(i, void 0, Rt(Y), v);
2227
+ B(i, void 0, xt(Y), w);
2218
2228
  return;
2219
- } else if (!_o($))
2220
- return B(i, $, void 0, v), $;
2221
- return i = $, "v" in $ ? ($.s === 1 ? B(i, $.v, void 0, v) : B(i, void 0, Rt($.v), v), $) : (f = !0, queueMicrotask(() => f = !1), me(() => {
2229
+ } else if (!_o(Q))
2230
+ return B(i, Q, void 0, w), Q;
2231
+ return i = Q, "v" in Q ? (Q.s === 1 ? B(i, Q.v, void 0, w) : B(i, void 0, xt(Q.v), w), Q) : (f = !0, queueMicrotask(() => f = !1), me(() => {
2222
2232
  O(d ? "refreshing" : "pending"), _();
2223
- }, !1), $.then((le) => B($, le, void 0, v), (le) => B($, void 0, Rt(le), v)));
2233
+ }, !1), Q.then((le) => B(Q, le, void 0, w), (le) => B(Q, void 0, xt(le), w)));
2224
2234
  }
2225
2235
  Object.defineProperties(pe, {
2226
2236
  state: {
2227
- get: () => b()
2237
+ get: () => I()
2228
2238
  },
2229
2239
  error: {
2230
2240
  get: () => T()
2231
2241
  },
2232
2242
  loading: {
2233
2243
  get() {
2234
- const w = b();
2235
- return w === "pending" || w === "refreshing";
2244
+ const v = I();
2245
+ return v === "pending" || v === "refreshing";
2236
2246
  }
2237
2247
  },
2238
2248
  latest: {
2239
2249
  get() {
2240
2250
  if (!d) return pe();
2241
- const w = T();
2242
- if (w && !i) throw w;
2251
+ const v = T();
2252
+ if (v && !i) throw v;
2243
2253
  return g();
2244
2254
  }
2245
2255
  }
2246
2256
  });
2247
- let U = I;
2248
- return u ? So(() => (U = I, ye(!1))) : ye(!1), [pe, {
2249
- refetch: (w) => Fs(U, () => ye(w)),
2257
+ let U = C;
2258
+ return u ? So(() => (U = C, ye(!1))) : ye(!1), [pe, {
2259
+ refetch: (v) => Fs(U, () => ye(v)),
2250
2260
  mutate: A
2251
2261
  }];
2252
2262
  }
@@ -2278,37 +2288,37 @@ function Vc(e, t, n) {
2278
2288
  return r = o, l;
2279
2289
  };
2280
2290
  }
2281
- function wo(e) {
2291
+ function vo(e) {
2282
2292
  Ms(() => Z(e));
2283
2293
  }
2284
2294
  function ct(e) {
2285
- return I === null || (I.cleanups === null ? I.cleanups = [e] : I.cleanups.push(e)), e;
2295
+ return C === null || (C.cleanups === null ? C.cleanups = [e] : C.cleanups.push(e)), e;
2286
2296
  }
2287
2297
  function Xn() {
2288
- return I;
2298
+ return C;
2289
2299
  }
2290
2300
  function Fs(e, t) {
2291
- const n = I, s = G;
2292
- I = e, G = null;
2301
+ const n = C, s = G;
2302
+ C = e, G = null;
2293
2303
  try {
2294
2304
  return me(t, !0);
2295
2305
  } catch (r) {
2296
2306
  Gn(r);
2297
2307
  } finally {
2298
- I = n, G = s;
2308
+ C = n, G = s;
2299
2309
  }
2300
2310
  }
2301
- function vo(e) {
2302
- const t = G, n = I;
2311
+ function wo(e) {
2312
+ const t = G, n = C;
2303
2313
  return Promise.resolve().then(() => {
2304
- G = t, I = n;
2314
+ G = t, C = n;
2305
2315
  let s;
2306
- return me(e, !1), G = I = null, s ? s.done : void 0;
2316
+ return me(e, !1), G = C = null, s ? s.done : void 0;
2307
2317
  });
2308
2318
  }
2309
2319
  var [bo, Hc] = /* @__PURE__ */ F(!1);
2310
2320
  function Qc() {
2311
- return [bo, vo];
2321
+ return [bo, wo];
2312
2322
  }
2313
2323
  function $c(e, t) {
2314
2324
  const n = Symbol("context");
@@ -2320,7 +2330,7 @@ function $c(e, t) {
2320
2330
  }
2321
2331
  function jc(e) {
2322
2332
  let t;
2323
- return I && I.context && (t = I.context[e.id]) !== void 0 ? t : e.defaultValue;
2333
+ return C && C.context && (t = C.context[e.id]) !== void 0 ? t : e.defaultValue;
2324
2334
  }
2325
2335
  function qs(e) {
2326
2336
  const t = J(e), n = J(() => hn(t()));
@@ -2335,7 +2345,7 @@ function Ks() {
2335
2345
  if (this.state === Se) nt(this);
2336
2346
  else {
2337
2347
  const e = ee;
2338
- ee = null, me(() => Qt(this), !1), ee = e;
2348
+ ee = null, me(() => Ht(this), !1), ee = e;
2339
2349
  }
2340
2350
  if (G) {
2341
2351
  const e = this.observers ? this.observers.length : 0;
@@ -2362,14 +2372,14 @@ function nt(e) {
2362
2372
  }
2363
2373
  function Co(e, t, n) {
2364
2374
  let s;
2365
- const r = I, a = G;
2366
- G = I = e;
2375
+ const r = C, a = G;
2376
+ G = C = e;
2367
2377
  try {
2368
2378
  s = e.fn(t);
2369
2379
  } catch (i) {
2370
2380
  return e.pure && (e.state = Se, e.owned && e.owned.forEach(ut), e.owned = null), e.updatedAt = n + 1, Gn(i);
2371
2381
  } finally {
2372
- G = a, I = r;
2382
+ G = a, C = r;
2373
2383
  }
2374
2384
  (!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? Vs(e, s) : e.value = s, e.updatedAt = n);
2375
2385
  }
@@ -2383,15 +2393,15 @@ function Xt(e, t, n, s = Se, r) {
2383
2393
  sourceSlots: null,
2384
2394
  cleanups: null,
2385
2395
  value: t,
2386
- owner: I,
2387
- context: I ? I.context : null,
2396
+ owner: C,
2397
+ context: C ? C.context : null,
2388
2398
  pure: n
2389
2399
  };
2390
- return I === null || I !== Bs && (I.owned ? I.owned.push(a) : I.owned = [a]), a;
2400
+ return C === null || C !== Bs && (C.owned ? C.owned.push(a) : C.owned = [a]), a;
2391
2401
  }
2392
- function Ht(e) {
2402
+ function Vt(e) {
2393
2403
  if (e.state === 0) return;
2394
- if (e.state === Vt) return Qt(e);
2404
+ if (e.state === Kt) return Ht(e);
2395
2405
  if (e.suspense && Z(e.suspense.inFallback)) return e.suspense.effects.push(e);
2396
2406
  const t = [e];
2397
2407
  for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < Jt); )
@@ -2399,9 +2409,9 @@ function Ht(e) {
2399
2409
  for (let n = t.length - 1; n >= 0; n--)
2400
2410
  if (e = t[n], e.state === Se)
2401
2411
  nt(e);
2402
- else if (e.state === Vt) {
2412
+ else if (e.state === Kt) {
2403
2413
  const s = ee;
2404
- ee = null, me(() => Qt(e, t[0]), !1), ee = s;
2414
+ ee = null, me(() => Ht(e, t[0]), !1), ee = s;
2405
2415
  }
2406
2416
  }
2407
2417
  function me(e, t) {
@@ -2421,13 +2431,13 @@ function No(e) {
2421
2431
  Ae = null, t.length && me(() => Us(t), !1);
2422
2432
  }
2423
2433
  function Hs(e) {
2424
- for (let t = 0; t < e.length; t++) Ht(e[t]);
2434
+ for (let t = 0; t < e.length; t++) Vt(e[t]);
2425
2435
  }
2426
2436
  function Lo(e) {
2427
2437
  let t, n = 0;
2428
2438
  for (t = 0; t < e.length; t++) {
2429
2439
  const s = e[t];
2430
- s.user ? e[n++] = s : Ht(s);
2440
+ s.user ? e[n++] = s : Vt(s);
2431
2441
  }
2432
2442
  if (P.context) {
2433
2443
  if (P.count) {
@@ -2436,22 +2446,22 @@ function Lo(e) {
2436
2446
  }
2437
2447
  at();
2438
2448
  }
2439
- for (P.effects && (P.done || !P.count) && (e = [...P.effects, ...e], n += P.effects.length, delete P.effects), t = 0; t < n; t++) Ht(e[t]);
2449
+ for (P.effects && (P.done || !P.count) && (e = [...P.effects, ...e], n += P.effects.length, delete P.effects), t = 0; t < n; t++) Vt(e[t]);
2440
2450
  }
2441
- function Qt(e, t) {
2451
+ function Ht(e, t) {
2442
2452
  e.state = 0;
2443
2453
  for (let n = 0; n < e.sources.length; n += 1) {
2444
2454
  const s = e.sources[n];
2445
2455
  if (s.sources) {
2446
2456
  const r = s.state;
2447
- r === Se ? s !== t && (!s.updatedAt || s.updatedAt < Jt) && Ht(s) : r === Vt && Qt(s, t);
2457
+ r === Se ? s !== t && (!s.updatedAt || s.updatedAt < Jt) && Vt(s) : r === Kt && Ht(s, t);
2448
2458
  }
2449
2459
  }
2450
2460
  }
2451
2461
  function Qs(e) {
2452
2462
  for (let t = 0; t < e.observers.length; t += 1) {
2453
2463
  const n = e.observers[t];
2454
- n.state || (n.state = Vt, n.pure ? ee.push(n) : Ae.push(n), n.observers && Qs(n));
2464
+ n.state || (n.state = Kt, n.pure ? ee.push(n) : Ae.push(n), n.observers && Qs(n));
2455
2465
  }
2456
2466
  }
2457
2467
  function ut(e) {
@@ -2478,13 +2488,13 @@ function ut(e) {
2478
2488
  }
2479
2489
  e.state = 0;
2480
2490
  }
2481
- function Rt(e) {
2491
+ function xt(e) {
2482
2492
  return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
2483
2493
  cause: e
2484
2494
  });
2485
2495
  }
2486
- function Gn(e, t = I) {
2487
- throw Rt(e);
2496
+ function Gn(e, t = C) {
2497
+ throw xt(e);
2488
2498
  }
2489
2499
  function hn(e) {
2490
2500
  if (typeof e == "function" && !e.length) return hn(e());
@@ -2501,35 +2511,35 @@ function hn(e) {
2501
2511
  function ko(e, t) {
2502
2512
  return function(s) {
2503
2513
  let r;
2504
- return De(() => r = Z(() => (I.context = {
2505
- ...I.context,
2514
+ return De(() => r = Z(() => (C.context = {
2515
+ ...C.context,
2506
2516
  [e]: s.value
2507
2517
  }, qs(() => s.children))), void 0), r;
2508
2518
  };
2509
2519
  }
2510
2520
  var gn = Symbol("fallback");
2511
- function $t(e) {
2521
+ function Qt(e) {
2512
2522
  for (let t = 0; t < e.length; t++) e[t]();
2513
2523
  }
2514
2524
  function Oo(e, t, n = {}) {
2515
2525
  let s = [], r = [], a = [], i = 0, o = t.length > 1 ? [] : null;
2516
- return ct(() => $t(a)), () => {
2526
+ return ct(() => Qt(a)), () => {
2517
2527
  let l = e() || [], f = l.length, d, u;
2518
2528
  return l[Rs], Z(() => {
2519
- let g, A, T, p, y, _, b, O, B;
2529
+ let g, A, T, p, y, _, I, O, B;
2520
2530
  if (f === 0)
2521
- i !== 0 && ($t(a), a = [], s = [], r = [], i = 0, o && (o = [])), n.fallback && (s = [gn], r[0] = Oe((N) => (a[0] = N, n.fallback())), i = 1);
2531
+ i !== 0 && (Qt(a), a = [], s = [], r = [], i = 0, o && (o = [])), n.fallback && (s = [gn], r[0] = Oe((L) => (a[0] = L, n.fallback())), i = 1);
2522
2532
  else if (i === 0) {
2523
2533
  for (r = new Array(f), u = 0; u < f; u++)
2524
2534
  s[u] = l[u], r[u] = Oe(h);
2525
2535
  i = f;
2526
2536
  } else {
2527
- for (T = new Array(f), p = new Array(f), o && (y = new Array(f)), _ = 0, b = Math.min(i, f); _ < b && s[_] === l[_]; _++) ;
2528
- for (b = i - 1, O = f - 1; b >= _ && O >= _ && s[b] === l[O]; b--, O--)
2529
- T[O] = r[b], p[O] = a[b], o && (y[O] = o[b]);
2537
+ for (T = new Array(f), p = new Array(f), o && (y = new Array(f)), _ = 0, I = Math.min(i, f); _ < I && s[_] === l[_]; _++) ;
2538
+ for (I = i - 1, O = f - 1; I >= _ && O >= _ && s[I] === l[O]; I--, O--)
2539
+ T[O] = r[I], p[O] = a[I], o && (y[O] = o[I]);
2530
2540
  for (g = /* @__PURE__ */ new Map(), A = new Array(O + 1), u = O; u >= _; u--)
2531
2541
  B = l[u], d = g.get(B), A[u] = d === void 0 ? -1 : d, g.set(B, u);
2532
- for (d = _; d <= b; d++)
2542
+ for (d = _; d <= I; d++)
2533
2543
  B = s[d], u = g.get(B), u !== void 0 && u !== -1 ? (T[u] = r[d], p[u] = a[d], o && (y[u] = o[d]), u = A[u], g.set(B, u)) : a[d]();
2534
2544
  for (u = _; u < f; u++)
2535
2545
  u in T ? (r[u] = T[u], a[u] = p[u], o && (o[u] = y[u], o[u](u))) : r[u] = Oe(h);
@@ -2548,11 +2558,11 @@ function Oo(e, t, n = {}) {
2548
2558
  }
2549
2559
  function Do(e, t, n = {}) {
2550
2560
  let s = [], r = [], a = [], i = [], o = 0, l;
2551
- return ct(() => $t(a)), () => {
2561
+ return ct(() => Qt(a)), () => {
2552
2562
  const f = e() || [], d = f.length;
2553
2563
  return f[Rs], Z(() => {
2554
2564
  if (d === 0)
2555
- return o !== 0 && ($t(a), a = [], s = [], r = [], o = 0, i = []), n.fallback && (s = [gn], r[0] = Oe((h) => (a[0] = h, n.fallback())), o = 1), r;
2565
+ return o !== 0 && (Qt(a), a = [], s = [], r = [], o = 0, i = []), n.fallback && (s = [gn], r[0] = Oe((h) => (a[0] = h, n.fallback())), o = 1), r;
2556
2566
  for (s[0] === gn && (a[0](), a = [], s = [], r = [], o = 0), l = 0; l < d; l++)
2557
2567
  l < s.length && s[l] !== f[l] ? i[l](() => f[l]) : l >= s.length && (r[l] = Oe(u));
2558
2568
  for (; l < s.length; l++)
@@ -2569,18 +2579,18 @@ function Do(e, t, n = {}) {
2569
2579
  function $s(e, t) {
2570
2580
  return Z(() => e(t || {}));
2571
2581
  }
2572
- function kt() {
2582
+ function Lt() {
2573
2583
  return !0;
2574
2584
  }
2575
2585
  var mn = {
2576
2586
  get(e, t, n) {
2577
- return t === qt ? n : e.get(t);
2587
+ return t === Ft ? n : e.get(t);
2578
2588
  },
2579
2589
  has(e, t) {
2580
- return t === qt ? !0 : e.has(t);
2590
+ return t === Ft ? !0 : e.has(t);
2581
2591
  },
2582
- set: kt,
2583
- deleteProperty: kt,
2592
+ set: Lt,
2593
+ deleteProperty: Lt,
2584
2594
  getOwnPropertyDescriptor(e, t) {
2585
2595
  return {
2586
2596
  configurable: !0,
@@ -2588,8 +2598,8 @@ var mn = {
2588
2598
  get() {
2589
2599
  return e.get(t);
2590
2600
  },
2591
- set: kt,
2592
- deleteProperty: kt
2601
+ set: Lt,
2602
+ deleteProperty: Lt
2593
2603
  };
2594
2604
  },
2595
2605
  ownKeys(e) {
@@ -2609,7 +2619,7 @@ function js(...e) {
2609
2619
  let t = !1;
2610
2620
  for (let i = 0; i < e.length; i++) {
2611
2621
  const o = e[i];
2612
- t = t || !!o && qt in o, e[i] = typeof o == "function" ? (t = !0, J(o)) : o;
2622
+ t = t || !!o && Ft in o, e[i] = typeof o == "function" ? (t = !0, J(o)) : o;
2613
2623
  }
2614
2624
  if (xs && t)
2615
2625
  return new Proxy({
@@ -2659,7 +2669,7 @@ function js(...e) {
2659
2669
  return r;
2660
2670
  }
2661
2671
  function xo(e, ...t) {
2662
- if (xs && qt in e) {
2672
+ if (xs && Ft in e) {
2663
2673
  const r = new Set(t.length > 1 ? t.flat() : t[0]), a = t.map((i) => new Proxy({
2664
2674
  get(o) {
2665
2675
  return i.includes(o) ? e[o] : void 0;
@@ -3333,7 +3343,7 @@ function dl(e, t) {
3333
3343
  function tt(e, t) {
3334
3344
  Object.entries(e).forEach(([n, s]) => t(s, n));
3335
3345
  }
3336
- function Ut(e, t) {
3346
+ function Rt(e, t) {
3337
3347
  return e.indexOf(t) !== -1;
3338
3348
  }
3339
3349
  function ns(e, t) {
@@ -3356,7 +3366,7 @@ var fl = class {
3356
3366
  findByName(e) {
3357
3367
  return this.transfomers[e];
3358
3368
  }
3359
- }, hl = (e) => Object.prototype.toString.call(e).slice(8, -1), er = (e) => typeof e > "u", gl = (e) => e === null, ft = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, An = (e) => ft(e) && Object.keys(e).length === 0, we = (e) => Array.isArray(e), ml = (e) => typeof e == "string", El = (e) => typeof e == "number" && !isNaN(e), pl = (e) => typeof e == "boolean", yl = (e) => e instanceof RegExp, ht = (e) => e instanceof Map, gt = (e) => e instanceof Set, tr = (e) => hl(e) === "Symbol", Al = (e) => e instanceof Date && !isNaN(e.valueOf()), Tl = (e) => e instanceof Error, ss = (e) => typeof e == "number" && isNaN(e), Sl = (e) => pl(e) || gl(e) || er(e) || El(e) || ml(e) || tr(e), _l = (e) => typeof e == "bigint", Pl = (e) => e === 1 / 0 || e === -1 / 0, wl = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), vl = (e) => e instanceof URL, nr = (e) => e.replace(/\./g, "\\."), un = (e) => e.map(String).map(nr).join("."), lt = (e) => {
3369
+ }, hl = (e) => Object.prototype.toString.call(e).slice(8, -1), er = (e) => typeof e > "u", gl = (e) => e === null, ft = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, An = (e) => ft(e) && Object.keys(e).length === 0, ve = (e) => Array.isArray(e), ml = (e) => typeof e == "string", El = (e) => typeof e == "number" && !isNaN(e), pl = (e) => typeof e == "boolean", yl = (e) => e instanceof RegExp, ht = (e) => e instanceof Map, gt = (e) => e instanceof Set, tr = (e) => hl(e) === "Symbol", Al = (e) => e instanceof Date && !isNaN(e.valueOf()), Tl = (e) => e instanceof Error, ss = (e) => typeof e == "number" && isNaN(e), Sl = (e) => pl(e) || gl(e) || er(e) || El(e) || ml(e) || tr(e), _l = (e) => typeof e == "bigint", Pl = (e) => e === 1 / 0 || e === -1 / 0, vl = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), wl = (e) => e instanceof URL, nr = (e) => e.replace(/\./g, "\\."), un = (e) => e.map(String).map(nr).join("."), lt = (e) => {
3360
3370
  const t = [];
3361
3371
  let n = "";
3362
3372
  for (let r = 0; r < e.length; r++) {
@@ -3416,7 +3426,7 @@ var sr = [
3416
3426
  fe(ht, "map", (e) => [...e.entries()], (e) => new Map(e)),
3417
3427
  fe((e) => ss(e) || Pl(e), "number", (e) => ss(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
3418
3428
  fe((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
3419
- fe(vl, "URL", (e) => e.toString(), (e) => new URL(e))
3429
+ fe(wl, "URL", (e) => e.toString(), (e) => new URL(e))
3420
3430
  ];
3421
3431
  function Zt(e, t, n, s) {
3422
3432
  return {
@@ -3441,7 +3451,7 @@ var rr = Zt((e, t) => tr(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) =
3441
3451
  Float32Array,
3442
3452
  Float64Array,
3443
3453
  Uint8ClampedArray
3444
- ].reduce((e, t) => (e[t.name] = t, e), {}), ar = Zt(wl, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
3454
+ ].reduce((e, t) => (e[t.name] = t, e), {}), ar = Zt(vl, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
3445
3455
  const n = bl[t[1]];
3446
3456
  if (!n)
3447
3457
  throw new Error("Trying to deserialize unknown typed array");
@@ -3486,7 +3496,7 @@ sr.forEach((e) => {
3486
3496
  cr[e.annotation] = e;
3487
3497
  });
3488
3498
  var Cl = (e, t, n) => {
3489
- if (we(t))
3499
+ if (ve(t))
3490
3500
  switch (t[0]) {
3491
3501
  case "symbol":
3492
3502
  return rr.untransform(e, t, n);
@@ -3514,11 +3524,11 @@ var Cl = (e, t, n) => {
3514
3524
  return n.next().value;
3515
3525
  };
3516
3526
  function ur(e) {
3517
- if (Ut(e, "__proto__"))
3527
+ if (Rt(e, "__proto__"))
3518
3528
  throw new Error("__proto__ is not allowed as a property");
3519
- if (Ut(e, "prototype"))
3529
+ if (Rt(e, "prototype"))
3520
3530
  throw new Error("prototype is not allowed as a property");
3521
- if (Ut(e, "constructor"))
3531
+ if (Rt(e, "constructor"))
3522
3532
  throw new Error("constructor is not allowed as a property");
3523
3533
  }
3524
3534
  var Nl = (e, t) => {
@@ -3547,7 +3557,7 @@ var Nl = (e, t) => {
3547
3557
  let s = e;
3548
3558
  for (let a = 0; a < t.length - 1; a++) {
3549
3559
  const i = t[a];
3550
- if (we(s)) {
3560
+ if (ve(s)) {
3551
3561
  const o = +i;
3552
3562
  s = s[o];
3553
3563
  } else if (ft(s))
@@ -3570,7 +3580,7 @@ var Nl = (e, t) => {
3570
3580
  }
3571
3581
  }
3572
3582
  const r = t[t.length - 1];
3573
- if (we(s) ? s[+r] = n(s[+r]) : ft(s) && (s[r] = n(s[r])), gt(s)) {
3583
+ if (ve(s) ? s[+r] = n(s[+r]) : ft(s) && (s[r] = n(s[r])), gt(s)) {
3574
3584
  const a = Me(s, +r), i = n(a);
3575
3585
  a !== i && (s.delete(a), s.add(i));
3576
3586
  }
@@ -3593,7 +3603,7 @@ var Nl = (e, t) => {
3593
3603
  function Sn(e, t, n = []) {
3594
3604
  if (!e)
3595
3605
  return;
3596
- if (!we(e)) {
3606
+ if (!ve(e)) {
3597
3607
  tt(e, (a, i) => Sn(a, t, [...n, ...lt(i)]));
3598
3608
  return;
3599
3609
  }
@@ -3614,7 +3624,7 @@ function kl(e, t) {
3614
3624
  e = Tn(e, i, () => a);
3615
3625
  });
3616
3626
  }
3617
- if (we(t)) {
3627
+ if (ve(t)) {
3618
3628
  const [s, r] = t;
3619
3629
  s.forEach((a) => {
3620
3630
  e = Tn(e, lt(a), () => e);
@@ -3623,7 +3633,7 @@ function kl(e, t) {
3623
3633
  tt(t, n);
3624
3634
  return e;
3625
3635
  }
3626
- var Ol = (e, t) => ft(e) || we(e) || ht(e) || gt(e) || ir(e, t);
3636
+ var Ol = (e, t) => ft(e) || ve(e) || ht(e) || gt(e) || ir(e, t);
3627
3637
  function Dl(e, t, n) {
3628
3638
  const s = n.get(e);
3629
3639
  s ? s.push(t) : n.set(e, [t]);
@@ -3658,16 +3668,16 @@ var dr = (e, t, n, s, r = [], a = [], i = /* @__PURE__ */ new Map()) => {
3658
3668
  };
3659
3669
  return o || i.set(e, A), A;
3660
3670
  }
3661
- if (Ut(a, e))
3671
+ if (Rt(a, e))
3662
3672
  return {
3663
3673
  transformedValue: null
3664
3674
  };
3665
- const l = rs(e, n), f = (l == null ? void 0 : l.value) ?? e, d = we(f) ? [] : {}, u = {};
3675
+ const l = rs(e, n), f = (l == null ? void 0 : l.value) ?? e, d = ve(f) ? [] : {}, u = {};
3666
3676
  tt(f, (g, A) => {
3667
3677
  if (A === "__proto__" || A === "constructor" || A === "prototype")
3668
3678
  throw new Error(`Detected property ${A}. This is a prototype pollution risk, please remove it from your object.`);
3669
3679
  const T = dr(g, t, n, s, [...r, A], [...a, e], i);
3670
- d[A] = T.transformedValue, we(T.annotations) ? u[A] = T.annotations : ft(T.annotations) && tt(T.annotations, (p, y) => {
3680
+ d[A] = T.transformedValue, ve(T.annotations) ? u[A] = T.annotations : ft(T.annotations) && tt(T.annotations, (p, y) => {
3671
3681
  u[nr(A) + "." + y] = p;
3672
3682
  });
3673
3683
  });
@@ -3799,16 +3809,16 @@ var du = (e, t = !1) => {
3799
3809
  json: n
3800
3810
  } = Ul(e);
3801
3811
  return JSON.stringify(n, null, t ? 2 : void 0);
3802
- }, Ot = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, Bl = (e, t) => e.queryHash.localeCompare(t.queryHash), hr = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, Ml = (e, t) => Ot(e) === Ot(t) ? hr(e, t) : Ot(e) > Ot(t) ? 1 : -1, fu = {
3812
+ }, kt = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, Bl = (e, t) => e.queryHash.localeCompare(t.queryHash), hr = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, Ml = (e, t) => kt(e) === kt(t) ? hr(e, t) : kt(e) > kt(t) ? 1 : -1, fu = {
3803
3813
  status: Ml,
3804
3814
  "query hash": Bl,
3805
3815
  "last updated": hr
3806
- }, Dt = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3, gr = (e, t) => e.state.submittedAt < t.state.submittedAt ? 1 : -1, Fl = (e, t) => Dt(e) === Dt(t) ? gr(e, t) : Dt(e) > Dt(t) ? 1 : -1, hu = {
3816
+ }, Ot = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3, gr = (e, t) => e.state.submittedAt < t.state.submittedAt ? 1 : -1, Fl = (e, t) => Ot(e) === Ot(t) ? gr(e, t) : Ot(e) > Ot(t) ? 1 : -1, hu = {
3807
3817
  status: Fl,
3808
3818
  "last updated": gr
3809
3819
  }, gu = (e) => e * parseFloat(getComputedStyle(document.documentElement).fontSize), mu = () => {
3810
3820
  const [e, t] = F("dark");
3811
- return wo(() => {
3821
+ return vo(() => {
3812
3822
  const n = window.matchMedia("(prefers-color-scheme: dark)");
3813
3823
  t(n.matches ? "dark" : "light");
3814
3824
  const s = (r) => {
@@ -3816,7 +3826,7 @@ var du = (e, t = !1) => {
3816
3826
  };
3817
3827
  n.addEventListener("change", s), ct(() => n.removeEventListener("change", s));
3818
3828
  }), e;
3819
- }, Gt = (e, t, n) => {
3829
+ }, Dt = (e, t, n) => {
3820
3830
  if (t.length === 0)
3821
3831
  return n;
3822
3832
  if (e instanceof Map) {
@@ -3824,10 +3834,10 @@ var du = (e, t = !1) => {
3824
3834
  if (t.length === 1)
3825
3835
  return s.set(t[0], n), s;
3826
3836
  const [r, ...a] = t;
3827
- return s.set(r, Gt(s.get(r), a, n)), s;
3837
+ return s.set(r, Dt(s.get(r), a, n)), s;
3828
3838
  }
3829
3839
  if (e instanceof Set) {
3830
- const s = Gt(Array.from(e), t, n);
3840
+ const s = Dt(Array.from(e), t, n);
3831
3841
  return new Set(s);
3832
3842
  }
3833
3843
  if (Array.isArray(e)) {
@@ -3835,7 +3845,7 @@ var du = (e, t = !1) => {
3835
3845
  if (t.length === 1)
3836
3846
  return s[t[0]] = n, s;
3837
3847
  const [r, ...a] = t;
3838
- return s[r] = Gt(s[r], a, n), s;
3848
+ return s[r] = Dt(s[r], a, n), s;
3839
3849
  }
3840
3850
  if (e instanceof Object) {
3841
3851
  const s = {
@@ -3844,19 +3854,19 @@ var du = (e, t = !1) => {
3844
3854
  if (t.length === 1)
3845
3855
  return s[t[0]] = n, s;
3846
3856
  const [r, ...a] = t;
3847
- return s[r] = Gt(s[r], a, n), s;
3857
+ return s[r] = Dt(s[r], a, n), s;
3848
3858
  }
3849
3859
  return e;
3850
- }, xt = (e, t) => {
3860
+ }, Gt = (e, t) => {
3851
3861
  if (e instanceof Map) {
3852
3862
  const n = new Map(e);
3853
3863
  if (t.length === 1)
3854
3864
  return n.delete(t[0]), n;
3855
3865
  const [s, ...r] = t;
3856
- return n.set(s, xt(n.get(s), r)), n;
3866
+ return n.set(s, Gt(n.get(s), r)), n;
3857
3867
  }
3858
3868
  if (e instanceof Set) {
3859
- const n = xt(Array.from(e), t);
3869
+ const n = Gt(Array.from(e), t);
3860
3870
  return new Set(n);
3861
3871
  }
3862
3872
  if (Array.isArray(e)) {
@@ -3864,7 +3874,7 @@ var du = (e, t = !1) => {
3864
3874
  if (t.length === 1)
3865
3875
  return n.filter((a, i) => i.toString() !== t[0]);
3866
3876
  const [s, ...r] = t;
3867
- return n[s] = xt(n[s], r), n;
3877
+ return n[s] = Gt(n[s], r), n;
3868
3878
  }
3869
3879
  if (e instanceof Object) {
3870
3880
  const n = {
@@ -3873,7 +3883,7 @@ var du = (e, t = !1) => {
3873
3883
  if (t.length === 1)
3874
3884
  return delete n[t[0]], n;
3875
3885
  const [s, ...r] = t;
3876
- return n[s] = xt(n[s], r), n;
3886
+ return n[s] = Gt(n[s], r), n;
3877
3887
  }
3878
3888
  return e;
3879
3889
  }, mr = (e, t) => {
@@ -3909,7 +3919,7 @@ var du = (e, t = !1) => {
3909
3919
  shadowDOMTarget: d,
3910
3920
  hideDisabledQueries: u
3911
3921
  } = e;
3912
- L(this, Fe, F(t)), L(this, Et, n), L(this, pt, s), L(this, mt, r), L(this, yt, f), L(this, qe, d), L(this, Ke, F(a)), L(this, Ve, F(i)), L(this, He, F(o)), L(this, Qe, F(l)), L(this, At, F(u));
3922
+ k(this, Fe, F(t)), k(this, Et, n), k(this, pt, s), k(this, mt, r), k(this, yt, f), k(this, qe, d), k(this, Ke, F(a)), k(this, Ve, F(i)), k(this, He, F(o)), k(this, Qe, F(l)), k(this, At, F(u));
3913
3923
  }
3914
3924
  setButtonPosition(e) {
3915
3925
  S(this, Ke)[1](e);
@@ -3932,7 +3942,7 @@ var du = (e, t = !1) => {
3932
3942
  const t = Ys(() => {
3933
3943
  const n = this, [s] = S(this, Ke), [r] = S(this, Ve), [a] = S(this, He), [i] = S(this, Qe), [o] = S(this, At), [l] = S(this, Fe);
3934
3944
  let f;
3935
- return S(this, $e) ? f = S(this, $e) : (f = zs(() => import("./NCMVHL6D-Iv9ufIUy.js")), L(this, $e, f)), mr(S(this, yt), S(this, qe)), $s(f, js({
3945
+ return S(this, $e) ? f = S(this, $e) : (f = zs(() => import("./NCMVHL6D-C2sjzq5J.js")), k(this, $e, f)), mr(S(this, yt), S(this, qe)), $s(f, js({
3936
3946
  get queryFlavor() {
3937
3947
  return S(n, Et);
3938
3948
  },
@@ -3966,28 +3976,28 @@ var du = (e, t = !1) => {
3966
3976
  }
3967
3977
  }));
3968
3978
  }, e);
3969
- L(this, Le, !0), L(this, Tt, t);
3979
+ k(this, Le, !0), k(this, Tt, t);
3970
3980
  }
3971
3981
  unmount() {
3972
3982
  var e;
3973
3983
  if (!S(this, Le))
3974
3984
  throw new Error("Devtools is not mounted");
3975
- (e = S(this, Tt)) == null || e.call(this), L(this, Le, !1);
3985
+ (e = S(this, Tt)) == null || e.call(this), k(this, Le, !1);
3976
3986
  }
3977
- }, Fe = new WeakMap(), mt = new WeakMap(), Et = new WeakMap(), pt = new WeakMap(), Le = new WeakMap(), yt = new WeakMap(), qe = new WeakMap(), Ke = new WeakMap(), Ve = new WeakMap(), He = new WeakMap(), Qe = new WeakMap(), At = new WeakMap(), $e = new WeakMap(), Tt = new WeakMap(), cs), je, St, _t, Pt, ke, wt, ze, We, Ye, Je, Xe, vt, Ze, et, bt, us, Kl = (us = class {
3987
+ }, Fe = new WeakMap(), mt = new WeakMap(), Et = new WeakMap(), pt = new WeakMap(), Le = new WeakMap(), yt = new WeakMap(), qe = new WeakMap(), Ke = new WeakMap(), Ve = new WeakMap(), He = new WeakMap(), Qe = new WeakMap(), At = new WeakMap(), $e = new WeakMap(), Tt = new WeakMap(), cs), je, St, _t, Pt, ke, vt, ze, We, Ye, Je, Xe, wt, Ze, et, bt, us, Kl = (us = class {
3978
3988
  constructor(e) {
3979
3989
  D(this, je);
3980
3990
  D(this, St);
3981
3991
  D(this, _t);
3982
3992
  D(this, Pt);
3983
3993
  D(this, ke, !1);
3984
- D(this, wt);
3994
+ D(this, vt);
3985
3995
  D(this, ze);
3986
3996
  D(this, We);
3987
3997
  D(this, Ye);
3988
3998
  D(this, Je);
3989
3999
  D(this, Xe);
3990
- D(this, vt);
4000
+ D(this, wt);
3991
4001
  D(this, Ze);
3992
4002
  D(this, et);
3993
4003
  D(this, bt);
@@ -4005,7 +4015,7 @@ var du = (e, t = !1) => {
4005
4015
  onClose: u,
4006
4016
  hideDisabledQueries: h
4007
4017
  } = e;
4008
- L(this, je, F(t)), L(this, _t, n), L(this, Pt, s), L(this, St, r), L(this, wt, f), L(this, ze, d), L(this, We, F(a)), L(this, Ye, F(i)), L(this, Je, F(o)), L(this, Xe, F(l)), L(this, vt, F(h)), L(this, Ze, F(u));
4018
+ k(this, je, F(t)), k(this, _t, n), k(this, Pt, s), k(this, St, r), k(this, vt, f), k(this, ze, d), k(this, We, F(a)), k(this, Ye, F(i)), k(this, Je, F(o)), k(this, Xe, F(l)), k(this, wt, F(h)), k(this, Ze, F(u));
4009
4019
  }
4010
4020
  setButtonPosition(e) {
4011
4021
  S(this, We)[1](e);
@@ -4029,9 +4039,9 @@ var du = (e, t = !1) => {
4029
4039
  if (S(this, ke))
4030
4040
  throw new Error("Devtools is already mounted");
4031
4041
  const t = Ys(() => {
4032
- const n = this, [s] = S(this, We), [r] = S(this, Ye), [a] = S(this, Je), [i] = S(this, Xe), [o] = S(this, vt), [l] = S(this, je), [f] = S(this, Ze);
4042
+ const n = this, [s] = S(this, We), [r] = S(this, Ye), [a] = S(this, Je), [i] = S(this, Xe), [o] = S(this, wt), [l] = S(this, je), [f] = S(this, Ze);
4033
4043
  let d;
4034
- return S(this, et) ? d = S(this, et) : (d = zs(() => import("./2AITGKQY-CCad8XK8.js")), L(this, et, d)), mr(S(this, wt), S(this, ze)), $s(d, js({
4044
+ return S(this, et) ? d = S(this, et) : (d = zs(() => import("./2AITGKQY-DdFbivb6.js")), k(this, et, d)), mr(S(this, vt), S(this, ze)), $s(d, js({
4035
4045
  get queryFlavor() {
4036
4046
  return S(n, _t);
4037
4047
  },
@@ -4068,15 +4078,15 @@ var du = (e, t = !1) => {
4068
4078
  }
4069
4079
  }));
4070
4080
  }, e);
4071
- L(this, ke, !0), L(this, bt, t);
4081
+ k(this, ke, !0), k(this, bt, t);
4072
4082
  }
4073
4083
  unmount() {
4074
4084
  var e;
4075
4085
  if (!S(this, ke))
4076
4086
  throw new Error("Devtools is not mounted");
4077
- (e = S(this, bt)) == null || e.call(this), L(this, ke, !1);
4087
+ (e = S(this, bt)) == null || e.call(this), k(this, ke, !1);
4078
4088
  }
4079
- }, je = new WeakMap(), St = new WeakMap(), _t = new WeakMap(), Pt = new WeakMap(), ke = new WeakMap(), wt = new WeakMap(), ze = new WeakMap(), We = new WeakMap(), Ye = new WeakMap(), Je = new WeakMap(), Xe = new WeakMap(), vt = new WeakMap(), Ze = new WeakMap(), et = new WeakMap(), bt = new WeakMap(), us);
4089
+ }, je = new WeakMap(), St = new WeakMap(), _t = new WeakMap(), Pt = new WeakMap(), ke = new WeakMap(), vt = new WeakMap(), ze = new WeakMap(), We = new WeakMap(), Ye = new WeakMap(), Je = new WeakMap(), Xe = new WeakMap(), wt = new WeakMap(), Ze = new WeakMap(), et = new WeakMap(), bt = new WeakMap(), us);
4080
4090
  function Vl(e) {
4081
4091
  const t = W(e.client), n = z.useRef(null), {
4082
4092
  buttonPosition: s,
@@ -4161,14 +4171,14 @@ const Ql = Ee(""), $l = () => {
4161
4171
  description: "Enable add page dropdown"
4162
4172
  });
4163
4173
  }, jl = () => {
4164
- const e = k(), t = C();
4165
- return ae({
4174
+ const e = N(), t = b();
4175
+ return re({
4166
4176
  queryKey: [E.GET_COLLECTIONS],
4167
4177
  staleTime: 1 / 0,
4168
4178
  queryFn: async () => t(e, { action: E.GET_COLLECTIONS })
4169
4179
  });
4170
4180
  }, zl = () => {
4171
- const { data: e } = ie(), { data: t } = be(), { data: n } = Re(), s = k(), r = C(), a = j(() => (n == null ? void 0 : n.fallbackLang) || "en", [n == null ? void 0 : n.fallbackLang]);
4181
+ const { data: e } = ae(), { data: t } = be(), { data: n } = Re(), s = N(), r = b(), a = $(() => (n == null ? void 0 : n.fallbackLang) || "en", [n == null ? void 0 : n.fallbackLang]);
4172
4182
  return X({
4173
4183
  mutationFn: async ({ block: i }) => r(s, {
4174
4184
  action: E.GET_BLOCK_ASYNC_PROPS,
@@ -4193,7 +4203,7 @@ const Ql = Ee(""), $l = () => {
4193
4203
  });
4194
4204
  }, Wl = () => {
4195
4205
  const [, e] = oe();
4196
- return Q(
4206
+ return j(
4197
4207
  (t, n) => {
4198
4208
  const r = new URLSearchParams(window.location.search).get("lang"), a = new URLSearchParams({ page: t });
4199
4209
  r && a.set("lang", r), window.history.pushState({}, "", `?${a.toString()}`), e(a), window.dispatchEvent(new PopStateEvent("popstate")), n == null || n();
@@ -4202,13 +4212,13 @@ const Ql = Ee(""), $l = () => {
4202
4212
  );
4203
4213
  }, Yl = () => {
4204
4214
  const e = Wl();
4205
- return Q(
4215
+ return j(
4206
4216
  ({ pageId: t }) => {
4207
4217
  e(t);
4208
4218
  },
4209
4219
  [e]
4210
4220
  );
4211
- }, Jl = K(() => import("./digital-asset-manager-DtWIJGhf.js")), Xl = K(() => import("./save-to-lib-QEOpf_Bd.js")), Zl = K(() => import("./theme-panel-footer-D3Gub87c.js")), ec = K(() => import("./web-preview-CHNZZcqH.js"));
4221
+ }, Jl = K(() => import("./digital-asset-manager-C6j4MUhE.js")), Xl = K(() => import("./save-to-lib-j75aYapW.js")), Zl = K(() => import("./theme-panel-footer-DYEvREC2.js")), ec = K(() => import("./web-preview-DRF3WCCD.js"));
4212
4222
  $l();
4213
4223
  Wa();
4214
4224
  zr(Xi);
@@ -4220,7 +4230,7 @@ const tc = {
4220
4230
  permissions: null
4221
4231
  }, os = (e) => {
4222
4232
  ao(), di();
4223
- const t = On(), { data: n = tc, isFetching: s } = io(), { data: r, isFetching: a } = Ce(), { data: i, isFetching: o } = jl(), { data: l, isFetching: f } = Re(), d = s || a || o || f, [u] = oe(), h = u.get("page"), { data: g } = ie(), { data: A, isFetching: T } = no(), { blocks: p } = to(A), { lockingStatus: y, pageLock: _ } = Ie(), { data: b, isFetching: O } = so(), B = Zi(), { onSave: N } = oo(), { mutateAsync: pe } = zl(), { getPartialBlocks: ye, getPartialBlockBlocks: U } = lo(), { mutateAsync: w } = Ii(), { mutateAsync: v } = ro(), Y = Yl(), [$, le] = q(!1), st = it([]), _e = j(() => V(l, "theme", {}) || {}, [l]), rt = he(y) && (_ == null ? void 0 : _.status) === "editing", Ne = (_ == null ? void 0 : _.status) === "checking", xn = T || Ne || O;
4233
+ const t = On(), { data: n = tc, isFetching: s } = io(), { data: r, isFetching: a } = Ce(), { data: i, isFetching: o } = jl(), { data: l, isFetching: f } = Re(), d = s || a || o || f, [u] = oe(), h = u.get("page"), { data: g } = ae(), { data: A, isFetching: T } = no(), { blocks: p } = to(A), { lockingStatus: y, pageLock: _ } = Ie(), { data: I, isFetching: O } = so(), B = Zi(), { onSave: L } = oo(), { mutateAsync: pe } = zl(), { getPartialBlocks: ye, getPartialBlockBlocks: U } = lo(), { mutateAsync: v } = Ii(), { mutateAsync: w } = ro(), Y = Yl(), [Q, le] = q(!1), st = it([]), _e = $(() => V(l, "theme", {}) || {}, [l]), rt = he(y) && (_ == null ? void 0 : _.status) === "editing", Ne = (_ == null ? void 0 : _.status) === "checking", xn = T || Ne || O;
4224
4234
  st.current = p;
4225
4235
  const [Er] = te(Ql);
4226
4236
  ne(() => {
@@ -4229,19 +4239,19 @@ const tc = {
4229
4239
  };
4230
4240
  return window.addEventListener("visibilitychange", ce), () => window.removeEventListener("visibilitychange", ce);
4231
4241
  }, []);
4232
- const pr = j(() => {
4242
+ const pr = $(() => {
4233
4243
  const ce = {};
4234
4244
  return n && (ce.permissions = V(n, "permissions", null), ce.role = V(n, "role", "user")), ce;
4235
- }, [n]), yr = Q(
4236
- async (ce, Ct) => await w({ pageType: ce, query: Ct }),
4237
- [w]
4245
+ }, [n]), yr = j(
4246
+ async (ce, It) => await v({ pageType: ce, query: It }),
4247
+ [v]
4238
4248
  );
4239
4249
  return /* @__PURE__ */ m(ge, { children: [
4240
- xn && /* @__PURE__ */ c(Ns, { className: d ? "fixed inset-0 bg-white" : "bg-white/75", children: /* @__PURE__ */ c(Ft, { className: `animate-spin text-primary ${d ? "h-6 w-6" : "h-5 w-5"}` }) }),
4250
+ xn && /* @__PURE__ */ c(Ns, { className: d ? "fixed inset-0 bg-white" : "bg-white/75", children: /* @__PURE__ */ c(Mt, { className: `animate-spin text-primary ${d ? "h-6 w-6" : "h-5 w-5"}` }) }),
4241
4251
  Er && /* @__PURE__ */ c(
4242
4252
  H,
4243
4253
  {
4244
- fallback: /* @__PURE__ */ c("div", { className: "absolute inset-0 z-[999999] flex min-h-screen w-screen items-center justify-center bg-gray-100", children: /* @__PURE__ */ c(Ft, { className: "h-6 w-6 animate-spin text-primary" }) }),
4254
+ fallback: /* @__PURE__ */ c("div", { className: "absolute inset-0 z-[999999] flex min-h-screen w-screen items-center justify-center bg-gray-100", children: /* @__PURE__ */ c(Mt, { className: "h-6 w-6 animate-spin text-primary" }) }),
4245
4255
  children: /* @__PURE__ */ c(ec, {})
4246
4256
  }
4247
4257
  ),
@@ -4251,7 +4261,7 @@ const tc = {
4251
4261
  gotoPage: Y,
4252
4262
  collections: i ?? [],
4253
4263
  getBlockAsyncProps: pe,
4254
- pageExternalData: b,
4264
+ pageExternalData: I,
4255
4265
  themePresets: e.themePresets ?? [],
4256
4266
  pageId: g == null ? void 0 : g.id,
4257
4267
  loading: T,
@@ -4261,7 +4271,7 @@ const tc = {
4261
4271
  translations: e.translations || {},
4262
4272
  locale: e.locale || "en",
4263
4273
  htmlDir: e.htmlDir || "ltr",
4264
- autoSave: !$ && rt && (e.autoSave ?? !0),
4274
+ autoSave: !Q && rt && (e.autoSave ?? !0),
4265
4275
  autoSaveInterval: e.autoSaveInterval ?? 15,
4266
4276
  onError: e.onError || console.error,
4267
4277
  getPartialBlockBlocks: U,
@@ -4271,11 +4281,11 @@ const tc = {
4271
4281
  pageTypes: r,
4272
4282
  searchPageTypeItems: yr,
4273
4283
  askAiCallBack: B,
4274
- onSave: async ({ blocks: ce, theme: Ct, needTranslations: Ar }) => {
4284
+ onSave: async ({ blocks: ce, theme: It, needTranslations: Ar }) => {
4275
4285
  if (!h) return !0;
4276
4286
  st.current = ce;
4277
4287
  const Rn = [...ce];
4278
- return await N({ page: h, blocks: Rn, needTranslations: Ar }), st.current = Rn, Rr(Ct, _e) || await v({ settings: { theme: Ct } }), !0;
4288
+ return await L({ page: h, blocks: Rn, needTranslations: Ar }), st.current = Rn, Rr(It, _e) || await w({ settings: { theme: It } }), !0;
4279
4289
  },
4280
4290
  themePanelComponent: Zl,
4281
4291
  ...pr
@@ -4326,8 +4336,8 @@ const tc = {
4326
4336
  function rc({ data: e, onSelect: t, dataType: n = "value", disabled: s = !1 }) {
4327
4337
  const [r, a] = z.useState(!1);
4328
4338
  return /* @__PURE__ */ m(ma, { open: r, onOpenChange: a, children: [
4329
- /* @__PURE__ */ m(zt, { children: [
4330
- /* @__PURE__ */ c(Wt, { asChild: !0, children: /* @__PURE__ */ c(Ea, { asChild: !0, children: /* @__PURE__ */ c(
4339
+ /* @__PURE__ */ m(jt, { children: [
4340
+ /* @__PURE__ */ c(zt, { asChild: !0, children: /* @__PURE__ */ c(Ea, { asChild: !0, children: /* @__PURE__ */ c(
4331
4341
  M,
4332
4342
  {
4333
4343
  size: "sm",
@@ -4348,7 +4358,7 @@ function rc({ data: e, onSelect: t, dataType: n = "value", disabled: s = !1 }) {
4348
4358
  ) })
4349
4359
  }
4350
4360
  ) }) }),
4351
- /* @__PURE__ */ c(Yt, { children: "Add field" })
4361
+ /* @__PURE__ */ c(Wt, { children: "Add field" })
4352
4362
  ] }),
4353
4363
  r && /* @__PURE__ */ c(z.Suspense, { children: /* @__PURE__ */ c(
4354
4364
  sc,
@@ -4364,16 +4374,16 @@ function rc({ data: e, onSelect: t, dataType: n = "value", disabled: s = !1 }) {
4364
4374
  }
4365
4375
  const pu = () => {
4366
4376
  const { savePageAsync: e } = Ge(), t = W();
4367
- return Q(async () => {
4377
+ return j(async () => {
4368
4378
  await e(), t.invalidateQueries({ queryKey: [E.GET_DRAFT_PAGE] }), t.invalidateQueries({ queryKey: [E.GET_BUILDER_PAGE_DATA] });
4369
4379
  }, [e, t]);
4370
4380
  }, yu = () => {
4371
4381
  const e = W();
4372
- return Q(() => {
4382
+ return j(() => {
4373
4383
  e.clear();
4374
4384
  }, [e]);
4375
4385
  }, Au = () => {
4376
- const e = k(), t = C(), { data: n } = be(), s = W();
4386
+ const e = N(), t = b(), { data: n } = be(), s = W();
4377
4387
  return X({
4378
4388
  mutationFn: async (r) => {
4379
4389
  if (!(n != null && n.id))
@@ -4397,7 +4407,7 @@ const pu = () => {
4397
4407
  console.error("Failed to update metadata");
4398
4408
  }
4399
4409
  });
4400
- }, ac = K(() => import("./digital-asset-manager-DtWIJGhf.js")), Tu = ({
4410
+ }, ac = K(() => import("./digital-asset-manager-C6j4MUhE.js")), Tu = ({
4401
4411
  assetId: e,
4402
4412
  assetUrl: t,
4403
4413
  onChange: n,
@@ -4405,7 +4415,7 @@ const pu = () => {
4405
4415
  placeholder: r = "Select an image",
4406
4416
  disabled: a = !1
4407
4417
  }) => {
4408
- const { t: i } = ve(), [o, l] = q(!1), f = () => {
4418
+ const { t: i } = we(), [o, l] = q(!1), f = () => {
4409
4419
  a || l(!0);
4410
4420
  }, d = () => {
4411
4421
  l(!1);
@@ -4624,7 +4634,7 @@ const cc = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), ls = (e) => {
4624
4634
  n = n.replace(r[0], i);
4625
4635
  }
4626
4636
  return n;
4627
- }, fc = K(() => import("./shared-json-ld-Cyv9JitF.js")), Su = ({
4637
+ }, fc = K(() => import("./shared-json-ld-DDwAZ76n.js")), Su = ({
4628
4638
  value: e,
4629
4639
  onChange: t,
4630
4640
  disabled: n = !1,
@@ -4637,38 +4647,38 @@ const cc = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), ls = (e) => {
4637
4647
  hasJsonLdForSelectedLang: f,
4638
4648
  copyJsonLDFromDefaultPage: d
4639
4649
  }) => {
4640
- const [u, h] = q("edit"), [g, A] = q(null), [T, p] = q(""), y = it(null), [_] = In(), b = i === "jsonLD" && V(_, "features.sharedJsonLD", !1), O = i === "jsonLD" && !f && !!d;
4650
+ const [u, h] = q("edit"), [g, A] = q(null), [T, p] = q(""), y = it(null), [_] = In(), I = i === "jsonLD" && V(_, "features.sharedJsonLD", !1), O = i === "jsonLD" && !f && !!d;
4641
4651
  ne(() => {
4642
4652
  e.trim() === "" && t("{}");
4643
4653
  }, [e, t]);
4644
4654
  const B = (U) => {
4645
4655
  if (s) return;
4646
- const w = U.target.value;
4647
- t(w);
4648
- }, N = (U) => {
4656
+ const v = U.target.value;
4657
+ t(v);
4658
+ }, L = (U) => {
4649
4659
  if (U.key === "Tab") {
4650
4660
  U.preventDefault();
4651
- const w = U.currentTarget, v = w.selectionStart, Y = w.selectionEnd;
4652
- if (v !== Y) {
4653
- const le = e.substring(v, Y).split(`
4661
+ const v = U.currentTarget, w = v.selectionStart, Y = v.selectionEnd;
4662
+ if (w !== Y) {
4663
+ const le = e.substring(w, Y).split(`
4654
4664
  `);
4655
4665
  if (U.shiftKey) {
4656
4666
  const _e = le.map((Ne) => Ne.startsWith(" ") ? Ne.substring(2) : Ne).join(`
4657
- `), rt = e.substring(0, v) + _e + e.substring(Y);
4667
+ `), rt = e.substring(0, w) + _e + e.substring(Y);
4658
4668
  t(rt), setTimeout(() => {
4659
- w.selectionStart = v, w.selectionEnd = v + _e.length;
4669
+ v.selectionStart = w, v.selectionEnd = w + _e.length;
4660
4670
  }, 0);
4661
4671
  } else {
4662
4672
  const _e = le.map((Ne) => ` ${Ne}`).join(`
4663
- `), rt = e.substring(0, v) + _e + e.substring(Y);
4673
+ `), rt = e.substring(0, w) + _e + e.substring(Y);
4664
4674
  t(rt), setTimeout(() => {
4665
- w.selectionStart = v, w.selectionEnd = v + _e.length;
4675
+ v.selectionStart = w, v.selectionEnd = w + _e.length;
4666
4676
  }, 0);
4667
4677
  }
4668
4678
  } else {
4669
- const $ = e.substring(0, v) + " " + e.substring(Y);
4670
- t($), setTimeout(() => {
4671
- w.selectionStart = w.selectionEnd = v + 2;
4679
+ const Q = e.substring(0, w) + " " + e.substring(Y);
4680
+ t(Q), setTimeout(() => {
4681
+ v.selectionStart = v.selectionEnd = w + 2;
4672
4682
  }, 0);
4673
4683
  }
4674
4684
  }
@@ -4677,8 +4687,8 @@ const cc = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), ls = (e) => {
4677
4687
  const U = ls(e);
4678
4688
  if (U.isValid)
4679
4689
  if (A(null), U.parsed) {
4680
- const w = dc(U.parsed, o);
4681
- p(w);
4690
+ const v = dc(U.parsed, o);
4691
+ p(v);
4682
4692
  } else
4683
4693
  p("");
4684
4694
  else
@@ -4687,8 +4697,8 @@ const cc = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), ls = (e) => {
4687
4697
  const pe = () => {
4688
4698
  const U = ls(e);
4689
4699
  if (U.isValid && U.parsed) {
4690
- const w = uc(U.parsed, U.placeholders);
4691
- t(w);
4700
+ const v = uc(U.parsed, U.placeholders);
4701
+ t(v);
4692
4702
  }
4693
4703
  }, ye = () => {
4694
4704
  g != null && g.position && y.current && (y.current.focus(), y.current.setSelectionRange(g.position, g.position + 1));
@@ -4712,7 +4722,7 @@ const cc = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), ls = (e) => {
4712
4722
  ]
4713
4723
  }
4714
4724
  ),
4715
- b && /* @__PURE__ */ m(
4725
+ I && /* @__PURE__ */ m(
4716
4726
  tn,
4717
4727
  {
4718
4728
  value: "shared",
@@ -4761,7 +4771,7 @@ const cc = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), ls = (e) => {
4761
4771
  name: i,
4762
4772
  className: `rounded-md border border-input text-xs ${g ? "border-red-500" : ""}`,
4763
4773
  onChange: B,
4764
- onKeyDown: N,
4774
+ onKeyDown: L,
4765
4775
  value: e,
4766
4776
  placeholder: r,
4767
4777
  rows: a,
@@ -4798,54 +4808,8 @@ const cc = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), ls = (e) => {
4798
4808
  /* @__PURE__ */ c(Kn, { rows: a, value: T, readOnly: !0, className: "cursor-default bg-muted font-mono text-sm" }),
4799
4809
  /* @__PURE__ */ c("p", { className: "mt-1 text-xs text-muted-foreground", children: "This is how the JSON will look after placeholder substitution." })
4800
4810
  ] }),
4801
- b && /* @__PURE__ */ c(nn, { value: "shared", className: "mt-0", children: /* @__PURE__ */ c(H, { children: /* @__PURE__ */ c(fc, {}) }) })
4811
+ I && /* @__PURE__ */ c(nn, { value: "shared", className: "mt-0", children: /* @__PURE__ */ c(H, { children: /* @__PURE__ */ c(fc, {}) }) })
4802
4812
  ] }) }) });
4803
- }, hc = () => {
4804
- const e = re("getAccessToken");
4805
- return {
4806
- getAccessToken: Q(async () => {
4807
- try {
4808
- return await e();
4809
- } catch {
4810
- return "";
4811
- }
4812
- }, [e])
4813
- };
4814
- }, _u = () => {
4815
- const { logout: e } = It(), { getAccessToken: t } = hc();
4816
- return Q(
4817
- async ({
4818
- url: n,
4819
- method: s = "GET",
4820
- body: r = {},
4821
- headers: a = {}
4822
- }) => {
4823
- const i = await t();
4824
- if (!i)
4825
- throw new Error("No auth token");
4826
- if (!n)
4827
- throw new Error("URL is required");
4828
- try {
4829
- const o = await fetch(n, {
4830
- method: s,
4831
- headers: {
4832
- "Content-Type": "application/json",
4833
- Authorization: `Bearer ${i}`,
4834
- ...a
4835
- },
4836
- body: JSON.stringify(r)
4837
- });
4838
- if (o.status === 401)
4839
- return console.log("Session expired", o), await e(), window.location.reload(), null;
4840
- if (o.status === 400)
4841
- throw new Error((await o.json()).error);
4842
- return await o.json();
4843
- } catch (o) {
4844
- throw console.log("Something went wrong", o), o;
4845
- }
4846
- },
4847
- [e, t]
4848
- );
4849
4813
  };
4850
4814
  if (typeof window > "u")
4851
4815
  throw new Error("@chaibuilder/pages is not available on the server");
@@ -4862,12 +4826,12 @@ export {
4862
4826
  zc as I,
4863
4827
  Vc as J,
4864
4828
  eu as K,
4865
- Lt as L,
4829
+ Nt as L,
4866
4830
  ct as M,
4867
4831
  ru as N,
4868
4832
  tu as O,
4869
4833
  su as P,
4870
- wo as Q,
4834
+ vo as Q,
4871
4835
  tl as R,
4872
4836
  Jc as S,
4873
4837
  Dn as T,
@@ -4885,7 +4849,7 @@ export {
4885
4849
  So as a3,
4886
4850
  Ul as a4,
4887
4851
  Yc as a5,
4888
- Gt as a6,
4852
+ Dt as a6,
4889
4853
  gu as a7,
4890
4854
  ou as a8,
4891
4855
  iu as a9,
@@ -4893,14 +4857,14 @@ export {
4893
4857
  Bc as aB,
4894
4858
  Fi as aC,
4895
4859
  Cc as aD,
4896
- vs as aE,
4860
+ ws as aE,
4897
4861
  so as aF,
4898
4862
  bi as aG,
4899
4863
  In as aH,
4900
4864
  Ti as aI,
4901
4865
  rc as aJ,
4902
4866
  Tu as aK,
4903
- bc as aL,
4867
+ wc as aL,
4904
4868
  oc as aM,
4905
4869
  Eu as aN,
4906
4870
  be as aO,
@@ -4908,9 +4872,9 @@ export {
4908
4872
  Yl as aQ,
4909
4873
  pu as aR,
4910
4874
  Au as aS,
4911
- It as aT,
4875
+ Yt as aT,
4912
4876
  io as aU,
4913
- _u as aV,
4877
+ bc as aV,
4914
4878
  Xa as aW,
4915
4879
  Rs as aa,
4916
4880
  Oe as ab,
@@ -4918,16 +4882,16 @@ export {
4918
4882
  au as ad,
4919
4883
  Zc as ae,
4920
4884
  Xc as af,
4921
- xt as ag,
4885
+ Gt as ag,
4922
4886
  Qc as ah,
4923
4887
  oi as ai,
4924
4888
  fi as aj,
4925
- k as ak,
4926
- C as al,
4889
+ N as ak,
4890
+ b as al,
4927
4891
  Wl as am,
4928
4892
  xc as an,
4929
4893
  kn as ao,
4930
- ie as ap,
4894
+ ae as ap,
4931
4895
  rn as aq,
4932
4896
  ue as ar,
4933
4897
  Nn as as,