@chaibuilder/pages 0.1.0-beta.1 → 0.1.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import pt, { useState as I, useEffect as Ie, useCallback as la, useMemo as je, useRef as ca } from "react";
2
- import { loadWebBlocks as ua } from "@chaibuilder/sdk/web-blocks";
3
- import { getBlocksFromHTML as da, useLanguages as Be, ChaiBuilderEditor as ha } from "@chaibuilder/sdk";
4
- import { useQueryClient as J, useQuery as ne, useMutation as re, QueryClient as fa, QueryClientProvider as pa } from "@tanstack/react-query";
5
- import { useToast as Y, Accordion as ga, AccordionItem as ge, AccordionTrigger as me, AccordionContent as ve, Label as _, Input as U, Textarea as xe, Button as B, Popover as gt, PopoverTrigger as mt, PopoverContent as vt, Dialog as xt, DialogContent as bt, DialogHeader as yt, DialogTitle as jt, DialogDescription as wt, DialogFooter as St, Tabs as ma, TabsList as va, TabsTrigger as ut, SheetHeader as xa, SheetDescription as ba, Sheet as ya, SheetContent as ja } from "@chaibuilder/sdk/ui";
6
- import { StarIcon as wa, PencilIcon as Et, TrashIcon as Ct, Plus as Sa, GlobeIcon as Nt, File as kt, ArrowLeftRightIcon as Ea, RocketIcon as Ca } from "lucide-react";
7
- import { get as q, find as se, isString as Ae, filter as ae, isEmpty as z, includes as be, startCase as Na, reverse as ka, sortBy as Ta, isEqual as Fe, map as Ue, toLower as Pa, trim as _a, orderBy as Oa } from "lodash-es";
8
- var Le = { exports: {} }, ee = {};
1
+ import wt, { useCallback as Ct, useState as A, useEffect as qe, useMemo as ne, useRef as St } from "react";
2
+ import { loadWebBlocks as ca } from "@chaibuilder/sdk/web-blocks";
3
+ import { getBlocksFromHTML as ua, useLanguages as $e, ChaiBuilderEditor as da } from "@chaibuilder/sdk";
4
+ import { useQueryClient as J, useQuery as Y, useMutation as re, QueryClient as ha, QueryClientProvider as fa } from "@tanstack/react-query";
5
+ import { useToast as H, Accordion as ma, AccordionItem as ge, AccordionTrigger as pe, AccordionContent as xe, Label as R, Input as G, Textarea as ve, Button as _, Popover as ga, PopoverTrigger as pa, PopoverContent as xa, Dialog as be, DialogContent as ye, DialogHeader as je, DialogTitle as we, DialogDescription as Ce, DialogFooter as Se, Tabs as va, TabsList as ba, TabsTrigger as pt, SheetHeader as ya, SheetDescription as ja, DropdownMenu as wa, DropdownMenuTrigger as Ca, DropdownMenuContent as Sa, DropdownMenuItem as Be, Sheet as ka, SheetContent as Ea } from "@chaibuilder/sdk/ui";
6
+ import { StarIcon as Na, PencilIcon as kt, TrashIcon as Et, Plus as Ta, GlobeIcon as Nt, File as Tt, MoreVertical as Pa, Power as _a, ArrowLeftRightIcon as Oa, RocketIcon as Ra } from "lucide-react";
7
+ import { get as M, find as ie, isEmpty as q, filter as Ke, includes as Pt, startCase as Da, reverse as Aa, sortBy as Fa, isEqual as Ge, map as We, startsWith as xt, toLower as La, trim as Ia, orderBy as Ua, isString as vt } from "lodash-es";
8
+ var Me = { exports: {} }, te = {};
9
9
  /**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
@@ -15,21 +15,21 @@ var Le = { exports: {} }, ee = {};
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
17
  */
18
- var dt;
19
- function Ra() {
20
- if (dt) return ee;
21
- dt = 1;
22
- var r = pt, i = Symbol.for("react.element"), o = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, s = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, w = { key: !0, ref: !0, __self: !0, __source: !0 };
23
- function c(f, u, p) {
24
- var g, m = {}, h = null, S = null;
25
- p !== void 0 && (h = "" + p), u.key !== void 0 && (h = "" + u.key), u.ref !== void 0 && (S = u.ref);
26
- for (g in u) a.call(u, g) && !w.hasOwnProperty(g) && (m[g] = u[g]);
27
- if (f && f.defaultProps) for (g in u = f.defaultProps, u) m[g] === void 0 && (m[g] = u[g]);
28
- return { $$typeof: i, type: f, key: h, ref: S, props: m, _owner: s.current };
18
+ var bt;
19
+ function Ba() {
20
+ if (bt) return te;
21
+ bt = 1;
22
+ var a = wt, i = Symbol.for("react.element"), l = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, s = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
23
+ function c(p, h, b) {
24
+ var w, f = {}, C = null, T = null;
25
+ b !== void 0 && (C = "" + b), h.key !== void 0 && (C = "" + h.key), h.ref !== void 0 && (T = h.ref);
26
+ for (w in h) n.call(h, w) && !d.hasOwnProperty(w) && (f[w] = h[w]);
27
+ if (p && p.defaultProps) for (w in h = p.defaultProps, h) f[w] === void 0 && (f[w] = h[w]);
28
+ return { $$typeof: i, type: p, key: C, ref: T, props: f, _owner: s.current };
29
29
  }
30
- return ee.Fragment = o, ee.jsx = c, ee.jsxs = c, ee;
30
+ return te.Fragment = l, te.jsx = c, te.jsxs = c, te;
31
31
  }
32
- var te = {};
32
+ var ae = {};
33
33
  /**
34
34
  * @license React
35
35
  * react-jsx-runtime.development.js
@@ -39,91 +39,91 @@ var te = {};
39
39
  * This source code is licensed under the MIT license found in the
40
40
  * LICENSE file in the root directory of this source tree.
41
41
  */
42
- var ht;
43
- function Da() {
44
- return ht || (ht = 1, process.env.NODE_ENV !== "production" && function() {
45
- var r = pt, i = Symbol.for("react.element"), o = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), f = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), k = Symbol.iterator, E = "@@iterator";
46
- function F(e) {
47
- if (e === null || typeof e != "object")
42
+ var yt;
43
+ function Ga() {
44
+ return yt || (yt = 1, process.env.NODE_ENV !== "production" && function() {
45
+ var a = wt, i = Symbol.for("react.element"), l = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), p = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), m = Symbol.iterator, v = "@@iterator";
46
+ function F(t) {
47
+ if (t === null || typeof t != "object")
48
48
  return null;
49
- var n = k && e[k] || e[E];
50
- return typeof n == "function" ? n : null;
49
+ var r = m && t[m] || t[v];
50
+ return typeof r == "function" ? r : null;
51
51
  }
52
- var D = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
53
- function b(e) {
52
+ var y = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
53
+ function k(t) {
54
54
  {
55
- for (var n = arguments.length, l = new Array(n > 1 ? n - 1 : 0), d = 1; d < n; d++)
56
- l[d - 1] = arguments[d];
57
- ie("error", e, l);
55
+ for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), u = 1; u < r; u++)
56
+ o[u - 1] = arguments[u];
57
+ ke("error", t, o);
58
58
  }
59
59
  }
60
- function ie(e, n, l) {
60
+ function ke(t, r, o) {
61
61
  {
62
- var d = D.ReactDebugCurrentFrame, y = d.getStackAddendum();
63
- y !== "" && (n += "%s", l = l.concat([y]));
64
- var j = l.map(function(x) {
62
+ var u = y.ReactDebugCurrentFrame, j = u.getStackAddendum();
63
+ j !== "" && (r += "%s", o = o.concat([j]));
64
+ var S = o.map(function(x) {
65
65
  return String(x);
66
66
  });
67
- j.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, j);
67
+ S.unshift("Warning: " + r), Function.prototype.apply.call(console[t], console, S);
68
68
  }
69
69
  }
70
- var Q = !1, we = !1, Se = !1, oe = !1, K = !1, le;
71
- le = Symbol.for("react.module.reference");
72
- function Ee(e) {
73
- return !!(typeof e == "string" || typeof e == "function" || e === a || e === w || K || e === s || e === p || e === g || oe || e === S || Q || we || Se || typeof e == "object" && e !== null && (e.$$typeof === h || e.$$typeof === m || e.$$typeof === c || e.$$typeof === f || e.$$typeof === u || // This needs to include all possible module reference object
70
+ var Ee = !1, oe = !1, Q = !1, Ne = !1, Te = !1, X;
71
+ X = Symbol.for("react.module.reference");
72
+ function K(t) {
73
+ return !!(typeof t == "string" || typeof t == "function" || t === n || t === d || Te || t === s || t === b || t === w || Ne || t === T || Ee || oe || Q || typeof t == "object" && t !== null && (t.$$typeof === C || t.$$typeof === f || t.$$typeof === c || t.$$typeof === p || t.$$typeof === h || // This needs to include all possible module reference object
74
74
  // types supported by any Flight configuration anywhere since
75
75
  // we don't know which Flight build this will end up being used
76
76
  // with.
77
- e.$$typeof === le || e.getModuleId !== void 0));
77
+ t.$$typeof === X || t.getModuleId !== void 0));
78
78
  }
79
- function ce(e, n, l) {
80
- var d = e.displayName;
81
- if (d)
82
- return d;
83
- var y = n.displayName || n.name || "";
84
- return y !== "" ? l + "(" + y + ")" : l;
79
+ function Pe(t, r, o) {
80
+ var u = t.displayName;
81
+ if (u)
82
+ return u;
83
+ var j = r.displayName || r.name || "";
84
+ return j !== "" ? o + "(" + j + ")" : o;
85
85
  }
86
- function O(e) {
87
- return e.displayName || "Context";
86
+ function ce(t) {
87
+ return t.displayName || "Context";
88
88
  }
89
- function T(e) {
90
- if (e == null)
89
+ function I(t) {
90
+ if (t == null)
91
91
  return null;
92
- if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
93
- return e.displayName || e.name || null;
94
- if (typeof e == "string")
95
- return e;
96
- switch (e) {
97
- case a:
92
+ if (typeof t.tag == "number" && k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
93
+ return t.displayName || t.name || null;
94
+ if (typeof t == "string")
95
+ return t;
96
+ switch (t) {
97
+ case n:
98
98
  return "Fragment";
99
- case o:
99
+ case l:
100
100
  return "Portal";
101
- case w:
101
+ case d:
102
102
  return "Profiler";
103
103
  case s:
104
104
  return "StrictMode";
105
- case p:
105
+ case b:
106
106
  return "Suspense";
107
- case g:
107
+ case w:
108
108
  return "SuspenseList";
109
109
  }
110
- if (typeof e == "object")
111
- switch (e.$$typeof) {
112
- case f:
113
- var n = e;
114
- return O(n) + ".Consumer";
110
+ if (typeof t == "object")
111
+ switch (t.$$typeof) {
112
+ case p:
113
+ var r = t;
114
+ return ce(r) + ".Consumer";
115
115
  case c:
116
- var l = e;
117
- return O(l._context) + ".Provider";
118
- case u:
119
- return ce(e, e.render, "ForwardRef");
120
- case m:
121
- var d = e.displayName || null;
122
- return d !== null ? d : T(e.type) || "Memo";
123
- case h: {
124
- var y = e, j = y._payload, x = y._init;
116
+ var o = t;
117
+ return ce(o._context) + ".Provider";
118
+ case h:
119
+ return Pe(t, t.render, "ForwardRef");
120
+ case f:
121
+ var u = t.displayName || null;
122
+ return u !== null ? u : I(t.type) || "Memo";
123
+ case C: {
124
+ var j = t, S = j._payload, x = j._init;
125
125
  try {
126
- return T(x(j));
126
+ return I(x(S));
127
127
  } catch {
128
128
  return null;
129
129
  }
@@ -131,103 +131,103 @@ function Da() {
131
131
  }
132
132
  return null;
133
133
  }
134
- var G = Object.assign, M = 0, ue, $e, Ke, Ve, We, ze, Je;
135
- function Ye() {
134
+ var E = Object.assign, U = 0, W, ue, He, Qe, Xe, Ze, et;
135
+ function tt() {
136
136
  }
137
- Ye.__reactDisabledLog = !0;
138
- function Ft() {
137
+ tt.__reactDisabledLog = !0;
138
+ function Lt() {
139
139
  {
140
- if (M === 0) {
141
- ue = console.log, $e = console.info, Ke = console.warn, Ve = console.error, We = console.group, ze = console.groupCollapsed, Je = console.groupEnd;
142
- var e = {
140
+ if (U === 0) {
141
+ W = console.log, ue = console.info, He = console.warn, Qe = console.error, Xe = console.group, Ze = console.groupCollapsed, et = console.groupEnd;
142
+ var t = {
143
143
  configurable: !0,
144
144
  enumerable: !0,
145
- value: Ye,
145
+ value: tt,
146
146
  writable: !0
147
147
  };
148
148
  Object.defineProperties(console, {
149
- info: e,
150
- log: e,
151
- warn: e,
152
- error: e,
153
- group: e,
154
- groupCollapsed: e,
155
- groupEnd: e
149
+ info: t,
150
+ log: t,
151
+ warn: t,
152
+ error: t,
153
+ group: t,
154
+ groupCollapsed: t,
155
+ groupEnd: t
156
156
  });
157
157
  }
158
- M++;
158
+ U++;
159
159
  }
160
160
  }
161
- function Lt() {
161
+ function It() {
162
162
  {
163
- if (M--, M === 0) {
164
- var e = {
163
+ if (U--, U === 0) {
164
+ var t = {
165
165
  configurable: !0,
166
166
  enumerable: !0,
167
167
  writable: !0
168
168
  };
169
169
  Object.defineProperties(console, {
170
- log: G({}, e, {
171
- value: ue
170
+ log: E({}, t, {
171
+ value: W
172
172
  }),
173
- info: G({}, e, {
174
- value: $e
173
+ info: E({}, t, {
174
+ value: ue
175
175
  }),
176
- warn: G({}, e, {
177
- value: Ke
176
+ warn: E({}, t, {
177
+ value: He
178
178
  }),
179
- error: G({}, e, {
180
- value: Ve
179
+ error: E({}, t, {
180
+ value: Qe
181
181
  }),
182
- group: G({}, e, {
183
- value: We
182
+ group: E({}, t, {
183
+ value: Xe
184
184
  }),
185
- groupCollapsed: G({}, e, {
186
- value: ze
185
+ groupCollapsed: E({}, t, {
186
+ value: Ze
187
187
  }),
188
- groupEnd: G({}, e, {
189
- value: Je
188
+ groupEnd: E({}, t, {
189
+ value: et
190
190
  })
191
191
  });
192
192
  }
193
- M < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
+ U < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
194
194
  }
195
195
  }
196
- var Ce = D.ReactCurrentDispatcher, Ne;
197
- function de(e, n, l) {
196
+ var _e = y.ReactCurrentDispatcher, Oe;
197
+ function de(t, r, o) {
198
198
  {
199
- if (Ne === void 0)
199
+ if (Oe === void 0)
200
200
  try {
201
201
  throw Error();
202
- } catch (y) {
203
- var d = y.stack.trim().match(/\n( *(at )?)/);
204
- Ne = d && d[1] || "";
202
+ } catch (j) {
203
+ var u = j.stack.trim().match(/\n( *(at )?)/);
204
+ Oe = u && u[1] || "";
205
205
  }
206
206
  return `
207
- ` + Ne + e;
207
+ ` + Oe + t;
208
208
  }
209
209
  }
210
- var ke = !1, he;
210
+ var Re = !1, he;
211
211
  {
212
- var It = typeof WeakMap == "function" ? WeakMap : Map;
213
- he = new It();
212
+ var Ut = typeof WeakMap == "function" ? WeakMap : Map;
213
+ he = new Ut();
214
214
  }
215
- function He(e, n) {
216
- if (!e || ke)
215
+ function at(t, r) {
216
+ if (!t || Re)
217
217
  return "";
218
218
  {
219
- var l = he.get(e);
220
- if (l !== void 0)
221
- return l;
219
+ var o = he.get(t);
220
+ if (o !== void 0)
221
+ return o;
222
222
  }
223
- var d;
224
- ke = !0;
225
- var y = Error.prepareStackTrace;
223
+ var u;
224
+ Re = !0;
225
+ var j = Error.prepareStackTrace;
226
226
  Error.prepareStackTrace = void 0;
227
- var j;
228
- j = Ce.current, Ce.current = null, Ft();
227
+ var S;
228
+ S = _e.current, _e.current = null, Lt();
229
229
  try {
230
- if (n) {
230
+ if (r) {
231
231
  var x = function() {
232
232
  throw Error();
233
233
  };
@@ -238,540 +238,490 @@ function Da() {
238
238
  }), typeof Reflect == "object" && Reflect.construct) {
239
239
  try {
240
240
  Reflect.construct(x, []);
241
- } catch (R) {
242
- d = R;
241
+ } catch (D) {
242
+ u = D;
243
243
  }
244
- Reflect.construct(e, [], x);
244
+ Reflect.construct(t, [], x);
245
245
  } else {
246
246
  try {
247
247
  x.call();
248
- } catch (R) {
249
- d = R;
248
+ } catch (D) {
249
+ u = D;
250
250
  }
251
- e.call(x.prototype);
251
+ t.call(x.prototype);
252
252
  }
253
253
  } else {
254
254
  try {
255
255
  throw Error();
256
- } catch (R) {
257
- d = R;
256
+ } catch (D) {
257
+ u = D;
258
258
  }
259
- e();
259
+ t();
260
260
  }
261
- } catch (R) {
262
- if (R && d && typeof R.stack == "string") {
263
- for (var v = R.stack.split(`
264
- `), P = d.stack.split(`
265
- `), C = v.length - 1, N = P.length - 1; C >= 1 && N >= 0 && v[C] !== P[N]; )
266
- N--;
267
- for (; C >= 1 && N >= 0; C--, N--)
268
- if (v[C] !== P[N]) {
269
- if (C !== 1 || N !== 1)
261
+ } catch (D) {
262
+ if (D && u && typeof D.stack == "string") {
263
+ for (var g = D.stack.split(`
264
+ `), O = u.stack.split(`
265
+ `), N = g.length - 1, P = O.length - 1; N >= 1 && P >= 0 && g[N] !== O[P]; )
266
+ P--;
267
+ for (; N >= 1 && P >= 0; N--, P--)
268
+ if (g[N] !== O[P]) {
269
+ if (N !== 1 || P !== 1)
270
270
  do
271
- if (C--, N--, N < 0 || v[C] !== P[N]) {
272
- var L = `
273
- ` + v[C].replace(" at new ", " at ");
274
- return e.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", e.displayName)), typeof e == "function" && he.set(e, L), L;
271
+ if (N--, P--, P < 0 || g[N] !== O[P]) {
272
+ var B = `
273
+ ` + g[N].replace(" at new ", " at ");
274
+ return t.displayName && B.includes("<anonymous>") && (B = B.replace("<anonymous>", t.displayName)), typeof t == "function" && he.set(t, B), B;
275
275
  }
276
- while (C >= 1 && N >= 0);
276
+ while (N >= 1 && P >= 0);
277
277
  break;
278
278
  }
279
279
  }
280
280
  } finally {
281
- ke = !1, Ce.current = j, Lt(), Error.prepareStackTrace = y;
281
+ Re = !1, _e.current = S, It(), Error.prepareStackTrace = j;
282
282
  }
283
- var W = e ? e.displayName || e.name : "", $ = W ? de(W) : "";
284
- return typeof e == "function" && he.set(e, $), $;
283
+ var z = t ? t.displayName || t.name : "", $ = z ? de(z) : "";
284
+ return typeof t == "function" && he.set(t, $), $;
285
285
  }
286
- function Bt(e, n, l) {
287
- return He(e, !1);
286
+ function Bt(t, r, o) {
287
+ return at(t, !1);
288
288
  }
289
- function Ut(e) {
290
- var n = e.prototype;
291
- return !!(n && n.isReactComponent);
289
+ function Gt(t) {
290
+ var r = t.prototype;
291
+ return !!(r && r.isReactComponent);
292
292
  }
293
- function fe(e, n, l) {
294
- if (e == null)
293
+ function fe(t, r, o) {
294
+ if (t == null)
295
295
  return "";
296
- if (typeof e == "function")
297
- return He(e, Ut(e));
298
- if (typeof e == "string")
299
- return de(e);
300
- switch (e) {
301
- case p:
296
+ if (typeof t == "function")
297
+ return at(t, Gt(t));
298
+ if (typeof t == "string")
299
+ return de(t);
300
+ switch (t) {
301
+ case b:
302
302
  return de("Suspense");
303
- case g:
303
+ case w:
304
304
  return de("SuspenseList");
305
305
  }
306
- if (typeof e == "object")
307
- switch (e.$$typeof) {
308
- case u:
309
- return Bt(e.render);
310
- case m:
311
- return fe(e.type, n, l);
312
- case h: {
313
- var d = e, y = d._payload, j = d._init;
306
+ if (typeof t == "object")
307
+ switch (t.$$typeof) {
308
+ case h:
309
+ return Bt(t.render);
310
+ case f:
311
+ return fe(t.type, r, o);
312
+ case C: {
313
+ var u = t, j = u._payload, S = u._init;
314
314
  try {
315
- return fe(j(y), n, l);
315
+ return fe(S(j), r, o);
316
316
  } catch {
317
317
  }
318
318
  }
319
319
  }
320
320
  return "";
321
321
  }
322
- var X = Object.prototype.hasOwnProperty, Qe = {}, Xe = D.ReactDebugCurrentFrame;
323
- function pe(e) {
324
- if (e) {
325
- var n = e._owner, l = fe(e.type, e._source, n ? n.type : null);
326
- Xe.setExtraStackFrame(l);
322
+ var Z = Object.prototype.hasOwnProperty, nt = {}, st = y.ReactDebugCurrentFrame;
323
+ function me(t) {
324
+ if (t) {
325
+ var r = t._owner, o = fe(t.type, t._source, r ? r.type : null);
326
+ st.setExtraStackFrame(o);
327
327
  } else
328
- Xe.setExtraStackFrame(null);
328
+ st.setExtraStackFrame(null);
329
329
  }
330
- function Gt(e, n, l, d, y) {
330
+ function Mt(t, r, o, u, j) {
331
331
  {
332
- var j = Function.call.bind(X);
333
- for (var x in e)
334
- if (j(e, x)) {
335
- var v = void 0;
332
+ var S = Function.call.bind(Z);
333
+ for (var x in t)
334
+ if (S(t, x)) {
335
+ var g = void 0;
336
336
  try {
337
- if (typeof e[x] != "function") {
338
- var P = Error((d || "React class") + ": " + l + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
339
- throw P.name = "Invariant Violation", P;
337
+ if (typeof t[x] != "function") {
338
+ var O = Error((u || "React class") + ": " + o + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
339
+ throw O.name = "Invariant Violation", O;
340
340
  }
341
- v = e[x](n, x, d, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
342
- } catch (C) {
343
- v = C;
341
+ g = t[x](r, x, u, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
342
+ } catch (N) {
343
+ g = N;
344
344
  }
345
- v && !(v instanceof Error) && (pe(y), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", d || "React class", l, x, typeof v), pe(null)), v instanceof Error && !(v.message in Qe) && (Qe[v.message] = !0, pe(y), b("Failed %s type: %s", l, v.message), pe(null));
345
+ g && !(g instanceof Error) && (me(j), k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", u || "React class", o, x, typeof g), me(null)), g instanceof Error && !(g.message in nt) && (nt[g.message] = !0, me(j), k("Failed %s type: %s", o, g.message), me(null));
346
346
  }
347
347
  }
348
348
  }
349
349
  var qt = Array.isArray;
350
- function Te(e) {
351
- return qt(e);
350
+ function De(t) {
351
+ return qt(t);
352
352
  }
353
- function Mt(e) {
353
+ function $t(t) {
354
354
  {
355
- var n = typeof Symbol == "function" && Symbol.toStringTag, l = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
356
- return l;
355
+ var r = typeof Symbol == "function" && Symbol.toStringTag, o = r && t[Symbol.toStringTag] || t.constructor.name || "Object";
356
+ return o;
357
357
  }
358
358
  }
359
- function $t(e) {
359
+ function Kt(t) {
360
360
  try {
361
- return Ze(e), !1;
361
+ return rt(t), !1;
362
362
  } catch {
363
363
  return !0;
364
364
  }
365
365
  }
366
- function Ze(e) {
367
- return "" + e;
366
+ function rt(t) {
367
+ return "" + t;
368
368
  }
369
- function et(e) {
370
- if ($t(e))
371
- return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Mt(e)), Ze(e);
369
+ function it(t) {
370
+ if (Kt(t))
371
+ return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", $t(t)), rt(t);
372
372
  }
373
- var Z = D.ReactCurrentOwner, Kt = {
373
+ var ee = y.ReactCurrentOwner, Wt = {
374
374
  key: !0,
375
375
  ref: !0,
376
376
  __self: !0,
377
377
  __source: !0
378
- }, tt, at, Pe;
379
- Pe = {};
380
- function Vt(e) {
381
- if (X.call(e, "ref")) {
382
- var n = Object.getOwnPropertyDescriptor(e, "ref").get;
383
- if (n && n.isReactWarning)
378
+ }, lt, ot, Ae;
379
+ Ae = {};
380
+ function Vt(t) {
381
+ if (Z.call(t, "ref")) {
382
+ var r = Object.getOwnPropertyDescriptor(t, "ref").get;
383
+ if (r && r.isReactWarning)
384
384
  return !1;
385
385
  }
386
- return e.ref !== void 0;
386
+ return t.ref !== void 0;
387
387
  }
388
- function Wt(e) {
389
- if (X.call(e, "key")) {
390
- var n = Object.getOwnPropertyDescriptor(e, "key").get;
391
- if (n && n.isReactWarning)
388
+ function zt(t) {
389
+ if (Z.call(t, "key")) {
390
+ var r = Object.getOwnPropertyDescriptor(t, "key").get;
391
+ if (r && r.isReactWarning)
392
392
  return !1;
393
393
  }
394
- return e.key !== void 0;
394
+ return t.key !== void 0;
395
395
  }
396
- function zt(e, n) {
397
- if (typeof e.ref == "string" && Z.current && n && Z.current.stateNode !== n) {
398
- var l = T(Z.current.type);
399
- Pe[l] || (b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', T(Z.current.type), e.ref), Pe[l] = !0);
396
+ function Jt(t, r) {
397
+ if (typeof t.ref == "string" && ee.current && r && ee.current.stateNode !== r) {
398
+ var o = I(ee.current.type);
399
+ Ae[o] || (k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', I(ee.current.type), t.ref), Ae[o] = !0);
400
400
  }
401
401
  }
402
- function Jt(e, n) {
402
+ function Yt(t, r) {
403
403
  {
404
- var l = function() {
405
- tt || (tt = !0, b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
404
+ var o = function() {
405
+ lt || (lt = !0, k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
406
406
  };
407
- l.isReactWarning = !0, Object.defineProperty(e, "key", {
408
- get: l,
407
+ o.isReactWarning = !0, Object.defineProperty(t, "key", {
408
+ get: o,
409
409
  configurable: !0
410
410
  });
411
411
  }
412
412
  }
413
- function Yt(e, n) {
413
+ function Ht(t, r) {
414
414
  {
415
- var l = function() {
416
- at || (at = !0, b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
415
+ var o = function() {
416
+ ot || (ot = !0, k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
417
417
  };
418
- l.isReactWarning = !0, Object.defineProperty(e, "ref", {
419
- get: l,
418
+ o.isReactWarning = !0, Object.defineProperty(t, "ref", {
419
+ get: o,
420
420
  configurable: !0
421
421
  });
422
422
  }
423
423
  }
424
- var Ht = function(e, n, l, d, y, j, x) {
425
- var v = {
424
+ var Qt = function(t, r, o, u, j, S, x) {
425
+ var g = {
426
426
  // This tag allows us to uniquely identify this as a React Element
427
427
  $$typeof: i,
428
428
  // Built-in properties that belong on the element
429
- type: e,
430
- key: n,
431
- ref: l,
429
+ type: t,
430
+ key: r,
431
+ ref: o,
432
432
  props: x,
433
433
  // Record the component responsible for creating this element.
434
- _owner: j
434
+ _owner: S
435
435
  };
436
- return v._store = {}, Object.defineProperty(v._store, "validated", {
436
+ return g._store = {}, Object.defineProperty(g._store, "validated", {
437
437
  configurable: !1,
438
438
  enumerable: !1,
439
439
  writable: !0,
440
440
  value: !1
441
- }), Object.defineProperty(v, "_self", {
441
+ }), Object.defineProperty(g, "_self", {
442
442
  configurable: !1,
443
443
  enumerable: !1,
444
444
  writable: !1,
445
- value: d
446
- }), Object.defineProperty(v, "_source", {
445
+ value: u
446
+ }), Object.defineProperty(g, "_source", {
447
447
  configurable: !1,
448
448
  enumerable: !1,
449
449
  writable: !1,
450
- value: y
451
- }), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
450
+ value: j
451
+ }), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g;
452
452
  };
453
- function Qt(e, n, l, d, y) {
453
+ function Xt(t, r, o, u, j) {
454
454
  {
455
- var j, x = {}, v = null, P = null;
456
- l !== void 0 && (et(l), v = "" + l), Wt(n) && (et(n.key), v = "" + n.key), Vt(n) && (P = n.ref, zt(n, y));
457
- for (j in n)
458
- X.call(n, j) && !Kt.hasOwnProperty(j) && (x[j] = n[j]);
459
- if (e && e.defaultProps) {
460
- var C = e.defaultProps;
461
- for (j in C)
462
- x[j] === void 0 && (x[j] = C[j]);
455
+ var S, x = {}, g = null, O = null;
456
+ o !== void 0 && (it(o), g = "" + o), zt(r) && (it(r.key), g = "" + r.key), Vt(r) && (O = r.ref, Jt(r, j));
457
+ for (S in r)
458
+ Z.call(r, S) && !Wt.hasOwnProperty(S) && (x[S] = r[S]);
459
+ if (t && t.defaultProps) {
460
+ var N = t.defaultProps;
461
+ for (S in N)
462
+ x[S] === void 0 && (x[S] = N[S]);
463
463
  }
464
- if (v || P) {
465
- var N = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
466
- v && Jt(x, N), P && Yt(x, N);
464
+ if (g || O) {
465
+ var P = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
466
+ g && Yt(x, P), O && Ht(x, P);
467
467
  }
468
- return Ht(e, v, P, y, d, Z.current, x);
468
+ return Qt(t, g, O, j, u, ee.current, x);
469
469
  }
470
470
  }
471
- var _e = D.ReactCurrentOwner, nt = D.ReactDebugCurrentFrame;
472
- function V(e) {
473
- if (e) {
474
- var n = e._owner, l = fe(e.type, e._source, n ? n.type : null);
475
- nt.setExtraStackFrame(l);
471
+ var Fe = y.ReactCurrentOwner, ct = y.ReactDebugCurrentFrame;
472
+ function V(t) {
473
+ if (t) {
474
+ var r = t._owner, o = fe(t.type, t._source, r ? r.type : null);
475
+ ct.setExtraStackFrame(o);
476
476
  } else
477
- nt.setExtraStackFrame(null);
477
+ ct.setExtraStackFrame(null);
478
478
  }
479
- var Oe;
480
- Oe = !1;
481
- function Re(e) {
482
- return typeof e == "object" && e !== null && e.$$typeof === i;
479
+ var Le;
480
+ Le = !1;
481
+ function Ie(t) {
482
+ return typeof t == "object" && t !== null && t.$$typeof === i;
483
483
  }
484
- function rt() {
484
+ function ut() {
485
485
  {
486
- if (_e.current) {
487
- var e = T(_e.current.type);
488
- if (e)
486
+ if (Fe.current) {
487
+ var t = I(Fe.current.type);
488
+ if (t)
489
489
  return `
490
490
 
491
- Check the render method of \`` + e + "`.";
491
+ Check the render method of \`` + t + "`.";
492
492
  }
493
493
  return "";
494
494
  }
495
495
  }
496
- function Xt(e) {
496
+ function Zt(t) {
497
497
  return "";
498
498
  }
499
- var st = {};
500
- function Zt(e) {
499
+ var dt = {};
500
+ function ea(t) {
501
501
  {
502
- var n = rt();
503
- if (!n) {
504
- var l = typeof e == "string" ? e : e.displayName || e.name;
505
- l && (n = `
502
+ var r = ut();
503
+ if (!r) {
504
+ var o = typeof t == "string" ? t : t.displayName || t.name;
505
+ o && (r = `
506
506
 
507
- Check the top-level render call using <` + l + ">.");
507
+ Check the top-level render call using <` + o + ">.");
508
508
  }
509
- return n;
509
+ return r;
510
510
  }
511
511
  }
512
- function it(e, n) {
512
+ function ht(t, r) {
513
513
  {
514
- if (!e._store || e._store.validated || e.key != null)
514
+ if (!t._store || t._store.validated || t.key != null)
515
515
  return;
516
- e._store.validated = !0;
517
- var l = Zt(n);
518
- if (st[l])
516
+ t._store.validated = !0;
517
+ var o = ea(r);
518
+ if (dt[o])
519
519
  return;
520
- st[l] = !0;
521
- var d = "";
522
- e && e._owner && e._owner !== _e.current && (d = " It was passed a child from " + T(e._owner.type) + "."), V(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, d), V(null);
520
+ dt[o] = !0;
521
+ var u = "";
522
+ t && t._owner && t._owner !== Fe.current && (u = " It was passed a child from " + I(t._owner.type) + "."), V(t), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, u), V(null);
523
523
  }
524
524
  }
525
- function ot(e, n) {
525
+ function ft(t, r) {
526
526
  {
527
- if (typeof e != "object")
527
+ if (typeof t != "object")
528
528
  return;
529
- if (Te(e))
530
- for (var l = 0; l < e.length; l++) {
531
- var d = e[l];
532
- Re(d) && it(d, n);
529
+ if (De(t))
530
+ for (var o = 0; o < t.length; o++) {
531
+ var u = t[o];
532
+ Ie(u) && ht(u, r);
533
533
  }
534
- else if (Re(e))
535
- e._store && (e._store.validated = !0);
536
- else if (e) {
537
- var y = F(e);
538
- if (typeof y == "function" && y !== e.entries)
539
- for (var j = y.call(e), x; !(x = j.next()).done; )
540
- Re(x.value) && it(x.value, n);
534
+ else if (Ie(t))
535
+ t._store && (t._store.validated = !0);
536
+ else if (t) {
537
+ var j = F(t);
538
+ if (typeof j == "function" && j !== t.entries)
539
+ for (var S = j.call(t), x; !(x = S.next()).done; )
540
+ Ie(x.value) && ht(x.value, r);
541
541
  }
542
542
  }
543
543
  }
544
- function ea(e) {
544
+ function ta(t) {
545
545
  {
546
- var n = e.type;
547
- if (n == null || typeof n == "string")
546
+ var r = t.type;
547
+ if (r == null || typeof r == "string")
548
548
  return;
549
- var l;
550
- if (typeof n == "function")
551
- l = n.propTypes;
552
- else if (typeof n == "object" && (n.$$typeof === u || // Note: Memo only checks outer props here.
549
+ var o;
550
+ if (typeof r == "function")
551
+ o = r.propTypes;
552
+ else if (typeof r == "object" && (r.$$typeof === h || // Note: Memo only checks outer props here.
553
553
  // Inner props are checked in the reconciler.
554
- n.$$typeof === m))
555
- l = n.propTypes;
554
+ r.$$typeof === f))
555
+ o = r.propTypes;
556
556
  else
557
557
  return;
558
- if (l) {
559
- var d = T(n);
560
- Gt(l, e.props, "prop", d, e);
561
- } else if (n.PropTypes !== void 0 && !Oe) {
562
- Oe = !0;
563
- var y = T(n);
564
- b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", y || "Unknown");
558
+ if (o) {
559
+ var u = I(r);
560
+ Mt(o, t.props, "prop", u, t);
561
+ } else if (r.PropTypes !== void 0 && !Le) {
562
+ Le = !0;
563
+ var j = I(r);
564
+ k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
565
565
  }
566
- typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
566
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
567
567
  }
568
568
  }
569
- function ta(e) {
569
+ function aa(t) {
570
570
  {
571
- for (var n = Object.keys(e.props), l = 0; l < n.length; l++) {
572
- var d = n[l];
573
- if (d !== "children" && d !== "key") {
574
- V(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", d), V(null);
571
+ for (var r = Object.keys(t.props), o = 0; o < r.length; o++) {
572
+ var u = r[o];
573
+ if (u !== "children" && u !== "key") {
574
+ V(t), k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), V(null);
575
575
  break;
576
576
  }
577
577
  }
578
- e.ref !== null && (V(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
578
+ t.ref !== null && (V(t), k("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
579
579
  }
580
580
  }
581
- var lt = {};
582
- function ct(e, n, l, d, y, j) {
581
+ var mt = {};
582
+ function gt(t, r, o, u, j, S) {
583
583
  {
584
- var x = Ee(e);
584
+ var x = K(t);
585
585
  if (!x) {
586
- var v = "";
587
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
588
- var P = Xt();
589
- P ? v += P : v += rt();
590
- var C;
591
- e === null ? C = "null" : Te(e) ? C = "array" : e !== void 0 && e.$$typeof === i ? (C = "<" + (T(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : C = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", C, v);
586
+ var g = "";
587
+ (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (g += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
588
+ var O = Zt();
589
+ O ? g += O : g += ut();
590
+ var N;
591
+ t === null ? N = "null" : De(t) ? N = "array" : t !== void 0 && t.$$typeof === i ? (N = "<" + (I(t.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : N = typeof t, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, g);
592
592
  }
593
- var N = Qt(e, n, l, y, j);
594
- if (N == null)
595
- return N;
593
+ var P = Xt(t, r, o, j, S);
594
+ if (P == null)
595
+ return P;
596
596
  if (x) {
597
- var L = n.children;
598
- if (L !== void 0)
599
- if (d)
600
- if (Te(L)) {
601
- for (var W = 0; W < L.length; W++)
602
- ot(L[W], e);
603
- Object.freeze && Object.freeze(L);
597
+ var B = r.children;
598
+ if (B !== void 0)
599
+ if (u)
600
+ if (De(B)) {
601
+ for (var z = 0; z < B.length; z++)
602
+ ft(B[z], t);
603
+ Object.freeze && Object.freeze(B);
604
604
  } else
605
- b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
605
+ k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
606
606
  else
607
- ot(L, e);
607
+ ft(B, t);
608
608
  }
609
- if (X.call(n, "key")) {
610
- var $ = T(e), R = Object.keys(n).filter(function(oa) {
609
+ if (Z.call(r, "key")) {
610
+ var $ = I(t), D = Object.keys(r).filter(function(oa) {
611
611
  return oa !== "key";
612
- }), De = R.length > 0 ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}";
613
- if (!lt[$ + De]) {
614
- var ia = R.length > 0 ? "{" + R.join(": ..., ") + ": ...}" : "{}";
615
- b(`A props object containing a "key" prop is being spread into JSX:
612
+ }), Ue = D.length > 0 ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}";
613
+ if (!mt[$ + Ue]) {
614
+ var la = D.length > 0 ? "{" + D.join(": ..., ") + ": ...}" : "{}";
615
+ k(`A props object containing a "key" prop is being spread into JSX:
616
616
  let props = %s;
617
617
  <%s {...props} />
618
618
  React keys must be passed directly to JSX without using spread:
619
619
  let props = %s;
620
- <%s key={someKey} {...props} />`, De, $, ia, $), lt[$ + De] = !0;
620
+ <%s key={someKey} {...props} />`, Ue, $, la, $), mt[$ + Ue] = !0;
621
621
  }
622
622
  }
623
- return e === a ? ta(N) : ea(N), N;
623
+ return t === n ? aa(P) : ta(P), P;
624
624
  }
625
625
  }
626
- function aa(e, n, l) {
627
- return ct(e, n, l, !0);
626
+ function na(t, r, o) {
627
+ return gt(t, r, o, !0);
628
628
  }
629
- function na(e, n, l) {
630
- return ct(e, n, l, !1);
629
+ function sa(t, r, o) {
630
+ return gt(t, r, o, !1);
631
631
  }
632
- var ra = na, sa = aa;
633
- te.Fragment = a, te.jsx = ra, te.jsxs = sa;
634
- }()), te;
635
- }
636
- process.env.NODE_ENV === "production" ? Le.exports = Ra() : Le.exports = Da();
637
- var t = Le.exports;
638
- const Aa = (r, i) => {
639
- const a = J().getQueryData(["builder_props"]);
640
- return q(a, r, i);
641
- }, A = () => Aa("apiUrl", "/chai/api");
642
- function H() {
643
- const [r, i] = I(
644
- new URLSearchParams(window.location.search)
645
- );
646
- return Ie(() => {
647
- const o = () => {
648
- i(new URLSearchParams(window.location.search));
649
- };
650
- return window.addEventListener("popstate", o), () => {
651
- window.removeEventListener("popstate", o);
652
- };
653
- }, []), [r, i];
632
+ var ra = sa, ia = na;
633
+ ae.Fragment = n, ae.jsx = ra, ae.jsxs = ia;
634
+ }()), ae;
654
635
  }
655
- const Tt = () => {
656
- const [r] = H(), i = r.get("page"), o = A();
657
- return ne({
658
- queryKey: ["page", i],
659
- initialData: [],
660
- queryFn: async () => (await (await fetch(`${o}`, {
661
- method: "POST",
662
- headers: { "Content-Type": "application/json" },
663
- body: JSON.stringify({
664
- action: "GET_PAGE",
665
- data: { id: i, draft: !0 }
666
- })
667
- })).json()).blocks ?? [],
668
- enabled: !!i
636
+ process.env.NODE_ENV === "production" ? Me.exports = Ba() : Me.exports = Ga();
637
+ var e = Me.exports;
638
+ const Ma = (a, i) => {
639
+ const n = J().getQueryData(["builder_props"]);
640
+ return M(n, a, i);
641
+ }, L = () => Ma("apiUrl", "/chai"), Ve = () => {
642
+ const a = J(), { data: i } = Y({
643
+ queryKey: ["ai-context"],
644
+ initialData: "",
645
+ queryFn: () => ""
669
646
  });
670
- }, Pt = () => {
671
- const r = A(), i = J(), { toast: o } = Y(), { data: a } = Tt(), [s] = H(), w = s.get("page"), c = q(
672
- se(a, { _type: "@chai/ai-context" }),
673
- "_value",
674
- ""
675
- ), { mutateAsync: f } = re({
676
- mutationFn: async ({ page: u, aiContext: p }) => {
677
- const g = {
678
- _type: "@chai/ai-context",
679
- _value: Ae(p) ? p : ""
680
- }, m = ae(
681
- a,
682
- (S) => (S == null ? void 0 : S._type) !== g._type
683
- );
684
- return m.push(g), await fetch(r, {
685
- method: "POST",
686
- headers: { "Content-Type": "application/json" },
687
- body: JSON.stringify({
688
- action: "UPDATE_PAGE",
689
- data: { id: u, blocks: m }
690
- })
691
- });
692
- },
693
- onSuccess: (u, { aiContext: p }) => {
694
- i.setQueryData(["page", w], () => {
695
- const g = {
696
- _type: "@chai/ai-context",
697
- _value: Ae(p) ? p : ""
698
- }, m = ae(
699
- a,
700
- (h) => (h == null ? void 0 : h._type) !== g._type
701
- );
702
- return m.push(g), m;
703
- }), o({ title: "AI context updated successfully." });
704
- },
705
- onError: (u) => {
706
- o({
707
- variant: "destructive",
708
- title: "Failed to update AI context",
709
- description: u.message
710
- });
711
- }
712
- });
713
- return { aiContext: c, updateAiContext: f };
714
- }, Fa = () => {
715
- const r = A(), { aiContext: i } = Pt();
716
- return la(
717
- async (o, a, s, w) => {
718
- const f = await (await fetch(r, {
647
+ return { setAiContext: Ct((n) => {
648
+ a.setQueryData(["ai-context"], n);
649
+ }, []), aiContext: i };
650
+ }, qa = () => {
651
+ const a = L(), { aiContext: i } = Ve();
652
+ return Ct(
653
+ async (l, n, s, d) => {
654
+ const p = await (await fetch(a, {
719
655
  method: "POST",
720
656
  headers: {
721
657
  "Content-Type": "application/json"
722
658
  },
723
659
  body: JSON.stringify({
724
660
  action: "ASK_AI",
725
- data: { type: o, prompt: a, blocks: s, aiContext: i, lang: w }
661
+ data: { type: l, prompt: n, blocks: s, aiContext: i, lang: d }
726
662
  })
727
663
  })).json();
728
- return console.log("data", f), f.error ? { error: new Error(f.error) } : f;
664
+ return console.log("data", p), p.error ? { error: new Error(p.error) } : p;
729
665
  },
730
- [r, i]
666
+ [a, i]
731
667
  );
732
- }, La = () => {
733
- const r = A(), { toast: i } = Y(), o = J();
734
- return { getUILibraryBlock: async (c, f) => {
735
- const g = (await (await fetch(
736
- c.url + (f.path ? "/blocks/" + f.path : "/" + f.uuid + ".html")
668
+ }, $a = () => {
669
+ const a = L(), { toast: i } = H();
670
+ return { getUILibraryBlock: async (d, c) => {
671
+ const b = (await (await fetch(
672
+ d.url + (c.path ? "/blocks/" + c.path : "/" + c.uuid + ".html")
737
673
  )).text()).replace(/---([\s\S]*?)---/g, "");
738
- return da(`${g}`);
739
- }, getUILibraryBlocks: async (c) => {
674
+ return ua(`${b}`);
675
+ }, getUILibraryBlocks: async (d) => {
740
676
  try {
741
- return (await (await fetch(c.url + "/blocks.json")).json()).map((p) => ({
742
- ...p,
743
- preview: c.url.replace("chaiblocks", "") + p.preview
677
+ return (await (await fetch(d.url + "/blocks.json")).json()).map((h) => ({
678
+ ...h,
679
+ preview: d.url.replace("chaiblocks", "") + h.preview
744
680
  }));
745
- } catch (f) {
746
- return console.error(f), [];
681
+ } catch (c) {
682
+ return console.error(c), [];
747
683
  }
748
684
  }, onSave: async ({
749
- page: c,
750
- blocks: f
685
+ page: d,
686
+ blocks: c
751
687
  }) => {
752
688
  try {
753
- return (await fetch(r, {
689
+ return (await fetch(a, {
754
690
  method: "POST",
755
691
  headers: { "Content-Type": "application/json" },
756
692
  body: JSON.stringify({
757
693
  action: "UPDATE_PAGE",
758
- data: { id: c, blocks: f }
694
+ data: { id: d, blocks: c }
759
695
  })
760
- })).ok ? (o.setQueryData(["page", c], f), i({
696
+ })).ok ? (i({
761
697
  title: "Success",
762
698
  description: "Page saved successfully",
763
699
  variant: "default"
764
700
  }), !0) : new Error("Failed to save blocks");
765
- } catch (u) {
766
- return u;
701
+ } catch (p) {
702
+ return p;
767
703
  }
768
704
  } };
769
- }, Ge = () => {
770
- const r = A();
771
- return ne({
705
+ };
706
+ function le() {
707
+ const [a, i] = A(
708
+ new URLSearchParams(window.location.search)
709
+ );
710
+ return qe(() => {
711
+ const l = () => {
712
+ i(new URLSearchParams(window.location.search));
713
+ };
714
+ return window.addEventListener("popstate", l), () => {
715
+ window.removeEventListener("popstate", l);
716
+ };
717
+ }, []), [a, i];
718
+ }
719
+ const ze = () => {
720
+ const a = L();
721
+ return Y({
772
722
  queryKey: ["project-pages"],
773
- initialData: [],
774
- queryFn: async () => await (await fetch(r, {
723
+ staleTime: 1e3 * 60 * 5,
724
+ queryFn: async () => await (await fetch(a, {
775
725
  method: "POST",
776
726
  headers: {
777
727
  "Content-Type": "application/json"
@@ -782,12 +732,12 @@ const Tt = () => {
782
732
  })).json()
783
733
  });
784
734
  }, _t = () => {
785
- const [r] = H(), i = r.get("page"), { data: o, isFetching: a } = Ge();
786
- return { data: je(
787
- () => se(o, { id: i }) || {},
788
- [o, i]
789
- ), isFetching: a };
790
- }, Ia = () => ne({
735
+ const [a] = le(), i = a.get("page"), { data: l, isFetching: n } = ze();
736
+ return { data: ne(
737
+ () => ie(l, { id: i }) || {},
738
+ [l, i]
739
+ ), isFetching: n };
740
+ }, Ka = () => Y({
791
741
  queryKey: ["uiLibraries"],
792
742
  initialData: [],
793
743
  queryFn: async () => [
@@ -802,69 +752,103 @@ const Tt = () => {
802
752
  url: "https://chaibuilder.com/chaiblocks"
803
753
  }
804
754
  ]
805
- }), Ba = (r) => je(() => {
806
- if (!r || z(r))
755
+ }), Wa = () => {
756
+ const [a] = le(), i = a.get("page"), l = L(), { setAiContext: n } = Ve();
757
+ return Y({
758
+ queryKey: ["page", i],
759
+ initialData: [],
760
+ queryFn: async () => {
761
+ const c = (await (await fetch(`${l}`, {
762
+ method: "POST",
763
+ headers: { "Content-Type": "application/json" },
764
+ body: JSON.stringify({
765
+ action: "GET_PAGE",
766
+ data: { id: i, draft: !0 }
767
+ })
768
+ })).json()).blocks ?? [], p = ie(c, { _type: "@chai/ai-context" });
769
+ return n(M(p, "_value", "") || ""), c;
770
+ },
771
+ enabled: !!i
772
+ });
773
+ }, Va = (a) => ne(() => {
774
+ if (!a || q(a))
807
775
  return {
808
776
  blocks: [],
809
777
  theme: {}
810
778
  };
811
- const i = se(r, { _type: "@chai/theme" }), o = q(i, "_value", {}) || {}, a = ae(
812
- r,
813
- (s) => !be(s == null ? void 0 : s._type, "@chai/")
779
+ const i = ie(a, { _type: "@chai/theme" }), l = M(i, "_value", {}) || {}, n = Ke(
780
+ a,
781
+ (s) => !Pt(s == null ? void 0 : s._type, "@chai/")
814
782
  );
815
- return { theme: o, blocks: a };
816
- }, [r]), Ot = () => {
817
- const r = A();
818
- return ne({
783
+ return { theme: l, blocks: n };
784
+ }, [a]), Ot = () => {
785
+ const a = L();
786
+ return Y({
819
787
  queryKey: ["project-config"],
820
- initialData: { theme: {} },
821
- queryFn: async () => await (await fetch(r, {
822
- method: "POST",
823
- headers: {
824
- "Content-Type": "application/json"
825
- },
826
- body: JSON.stringify({ action: "GET_PROJECT_CONFIG" })
827
- })).json()
788
+ initialData: {
789
+ theme: {},
790
+ fallbackLang: "",
791
+ languages: []
792
+ },
793
+ queryFn: async () => {
794
+ try {
795
+ const l = await (await fetch(a, {
796
+ method: "POST",
797
+ headers: {
798
+ "Content-Type": "application/json"
799
+ },
800
+ body: JSON.stringify({ action: "GET_PROJECT_CONFIG" })
801
+ })).json();
802
+ if (l != null && l.error) throw "";
803
+ return l;
804
+ } catch {
805
+ return {
806
+ fallbackLang: "fr",
807
+ languages: ["en"],
808
+ theme: {}
809
+ };
810
+ }
811
+ }
828
812
  });
829
- }, Ua = () => {
830
- const { data: r } = Ge(), i = A();
813
+ }, za = () => {
814
+ const { data: a } = ze(), i = L();
831
815
  return {
832
816
  getGlobalBlocks: async () => {
833
- const o = {};
834
- for (const a of r)
835
- z(a == null ? void 0 : a.slug) && (o[a.id] = {
836
- name: Na(a.name ?? a.slug),
817
+ const l = {};
818
+ for (const n of a ?? [])
819
+ q(n == null ? void 0 : n.slug) && (l[n.id] = {
820
+ name: Da(n.name ?? n.slug),
837
821
  description: ""
838
822
  });
839
- return o;
823
+ return l;
840
824
  },
841
- getGlobalBlockBlocks: async (o) => o ? (await (await fetch(`${i}`, {
825
+ getGlobalBlockBlocks: async (l) => l ? (await (await fetch(`${i}`, {
842
826
  method: "POST",
843
827
  headers: { "Content-Type": "application/json" },
844
828
  body: JSON.stringify({
845
829
  action: "GET_PAGE",
846
- data: { id: o, draft: !0 }
830
+ data: { id: l, draft: !0 }
847
831
  })
848
832
  })).json()).blocks : []
849
833
  };
850
- }, Ga = () => {
851
- const r = A();
852
- return { uploadFile: async (o) => {
853
- const a = new FormData();
854
- return a.append("action", "UPLOAD_FILE"), a.append("file", o), (await fetch(r, {
834
+ }, Ja = () => {
835
+ const a = L();
836
+ return { uploadFile: async (l) => {
837
+ const n = new FormData();
838
+ return n.append("action", "UPLOAD_FILE"), n.append("file", l), (await fetch(a, {
855
839
  method: "POST",
856
- body: a
840
+ body: n
857
841
  })).json();
858
842
  } };
859
- }, qa = () => {
860
- const r = A(), { toast: i } = Y();
843
+ }, Ya = () => {
844
+ const a = L(), { toast: i } = H();
861
845
  return re({
862
- mutationFn: async (o) => (await fetch(`${r}`, {
846
+ mutationFn: async (l) => (await fetch(`${a}`, {
863
847
  method: "POST",
864
848
  headers: { "Content-Type": "application/json" },
865
849
  body: JSON.stringify({
866
850
  action: "PUBLISH_PAGE",
867
- data: { id: o }
851
+ data: { id: l }
868
852
  })
869
853
  })).json(),
870
854
  onSuccess: () => {
@@ -874,25 +858,25 @@ const Tt = () => {
874
858
  });
875
859
  }
876
860
  });
877
- }, qe = () => {
878
- const r = A(), [i] = H(), o = i.get("page");
879
- return ne({
880
- queryKey: ["language-pages", o],
861
+ }, Je = () => {
862
+ const a = L(), [i] = le(), l = i.get("page");
863
+ return Y({
864
+ queryKey: ["language-pages", l],
881
865
  initialData: [],
882
866
  queryFn: async () => {
883
- if (!o) return null;
884
- const s = await (await fetch(r, {
867
+ if (!l) return null;
868
+ const s = await (await fetch(a, {
885
869
  method: "POST",
886
870
  headers: { "Content-Type": "application/json" },
887
871
  body: JSON.stringify({
888
872
  action: "GET_LANGUAGE_PAGES",
889
- data: { id: o }
873
+ data: { id: l }
890
874
  })
891
875
  })).json();
892
- return ka(Ta(s, "primaryPage"));
876
+ return Aa(Fa(s, "primaryPage"));
893
877
  }
894
878
  });
895
- }, ye = {
879
+ }, se = {
896
880
  ab: "Abkhazian",
897
881
  aa: "Afar",
898
882
  af: "Afrikaans",
@@ -1081,98 +1065,132 @@ const Tt = () => {
1081
1065
  za: "Zhuang, Chuang",
1082
1066
  zu: "Zulu"
1083
1067
  }, Rt = () => {
1084
- const r = A(), i = J(), { toast: o } = Y();
1068
+ const a = L(), i = J(), { toast: l } = H();
1085
1069
  return re({
1086
- mutationFn: async (a) => await (await fetch(r, {
1087
- method: "POST",
1088
- headers: {
1089
- "Content-Type": "application/json"
1090
- },
1091
- body: JSON.stringify({
1092
- action: "CREATE_PAGE",
1093
- data: a
1094
- })
1095
- })).json(),
1096
- onSuccess: (a, s) => {
1070
+ mutationFn: async (n) => {
1071
+ var c;
1072
+ const d = await (await fetch(a, {
1073
+ method: "POST",
1074
+ headers: {
1075
+ "Content-Type": "application/json"
1076
+ },
1077
+ body: JSON.stringify({
1078
+ action: "CREATE_PAGE",
1079
+ data: n
1080
+ })
1081
+ })).json();
1082
+ if (d != null && d.error)
1083
+ throw new Error(((c = d == null ? void 0 : d.error) == null ? void 0 : c.message) || "Something went wrong.");
1084
+ return d;
1085
+ },
1086
+ onSuccess: (n, s) => {
1097
1087
  s && (s != null && s.primaryPage) ? i.invalidateQueries({
1098
1088
  queryKey: ["language-pages", s == null ? void 0 : s.primaryPage]
1099
- }) : i.invalidateQueries({ queryKey: ["project-pages"] }), o({
1089
+ }) : i.invalidateQueries({ queryKey: ["project-pages"] }), l({
1100
1090
  title: `New ${s.global ? "global block" : "page"} added successfully.`
1101
1091
  });
1102
1092
  },
1103
- onError: (a, s) => {
1104
- o({
1093
+ onError: (n, s) => {
1094
+ l({
1105
1095
  variant: "destructive",
1106
1096
  title: `Failed to add new ${s.global ? "global block" : "page"}.`,
1107
- description: a.message
1097
+ description: n.message
1108
1098
  });
1109
1099
  }
1110
1100
  });
1111
- }, Me = () => {
1112
- const r = A(), i = J(), { toast: o } = Y();
1101
+ }, Ye = () => {
1102
+ const a = L(), i = J(), { toast: l } = H();
1113
1103
  return re({
1114
- mutationFn: async (a) => (await fetch(r, {
1104
+ mutationFn: async (n) => (await fetch(a, {
1115
1105
  method: "POST",
1116
1106
  headers: {
1117
1107
  "Content-Type": "application/json"
1118
1108
  },
1119
1109
  body: JSON.stringify({
1120
1110
  action: "UPDATE_PAGE",
1121
- data: a
1111
+ data: n
1122
1112
  })
1123
1113
  })).json(),
1124
- onSuccess: (a, s) => {
1114
+ onSuccess: (n, s) => {
1125
1115
  s && (s != null && s.primaryPage || s != null && s.seo) ? i.invalidateQueries({
1126
1116
  queryKey: ["language-pages", s == null ? void 0 : s.primaryPage]
1127
- }) : i.invalidateQueries({ queryKey: ["project-pages"] }), s != null && s.seo ? o({
1117
+ }) : i.invalidateQueries({ queryKey: ["project-pages"] }), s != null && s.seo ? l({
1128
1118
  title: "SEO Settings updated successfully."
1129
- }) : o({
1119
+ }) : l({
1130
1120
  title: `${s.global ? "Global block" : "Page"} updated successfully.`
1131
1121
  });
1132
1122
  },
1133
- onError: (a, s) => {
1134
- o({
1123
+ onError: (n, s) => {
1124
+ l({
1135
1125
  variant: "destructive",
1136
1126
  title: `Failed to update ${s.global ? "global block" : "page"}.`,
1137
- description: a.message
1127
+ description: n.message
1138
1128
  });
1139
1129
  }
1140
1130
  });
1141
1131
  }, Dt = () => {
1142
- const r = A(), i = J(), { toast: o } = Y();
1132
+ const a = L(), i = J(), { toast: l } = H();
1143
1133
  return re({
1144
- mutationFn: async (a) => (await fetch(r, {
1134
+ mutationFn: async (n) => (await fetch(a, {
1145
1135
  method: "POST",
1146
1136
  headers: {
1147
1137
  "Content-Type": "application/json"
1148
1138
  },
1149
1139
  body: JSON.stringify({
1150
1140
  action: "DELETE_PAGE",
1151
- data: { id: a == null ? void 0 : a.id }
1141
+ data: { id: n == null ? void 0 : n.id }
1152
1142
  })
1153
1143
  })).json(),
1154
- onSuccess: (a, s) => {
1144
+ onSuccess: (n, s) => {
1155
1145
  s && (s != null && s.primaryPage) ? i.invalidateQueries({
1156
1146
  queryKey: ["language-pages", s == null ? void 0 : s.primaryPage]
1157
- }) : i.invalidateQueries({ queryKey: ["project-pages"] }), o({
1147
+ }) : i.invalidateQueries({ queryKey: ["project-pages"] }), l({
1158
1148
  title: `${s.global ? "Global block" : "Page"} deleted successfully.`
1159
1149
  });
1160
1150
  },
1161
- onError: (a, s) => {
1162
- o({
1151
+ onError: (n, s) => {
1152
+ l({
1163
1153
  variant: "destructive",
1164
1154
  title: `Failed to delete ${s.global ? "global block" : "page"}.`,
1165
- description: a.message
1155
+ description: n.message
1156
+ });
1157
+ }
1158
+ });
1159
+ }, Ha = () => {
1160
+ const a = L(), i = J(), { toast: l } = H();
1161
+ return re({
1162
+ mutationFn: async (n) => (await fetch(a, {
1163
+ method: "POST",
1164
+ headers: {
1165
+ "Content-Type": "application/json"
1166
+ },
1167
+ body: JSON.stringify({
1168
+ action: "UNPUBLISH_PAGE",
1169
+ data: { id: n == null ? void 0 : n.id }
1170
+ })
1171
+ })).json(),
1172
+ onSuccess: (n, s) => {
1173
+ s && (s != null && s.primaryPage) ? i.invalidateQueries({
1174
+ queryKey: ["language-pages", s == null ? void 0 : s.primaryPage]
1175
+ }) : i.invalidateQueries({ queryKey: ["project-pages"] }), l({
1176
+ title: `${s.global ? "Global block" : "Page"} unpublished successfully.`
1177
+ });
1178
+ },
1179
+ onError: (n, s) => {
1180
+ l({
1181
+ variant: "destructive",
1182
+ title: `Failed to unpublish ${s.global ? "global block" : "page"}.`,
1183
+ description: n.message
1166
1184
  });
1167
1185
  }
1168
1186
  });
1169
- }, Ma = () => {
1170
- const { selectedLang: r } = Be(), { data: i, isFetching: o } = qe();
1171
- return { data: je(() => se(i, { lang: r || "" }) || {}, [i, r]), isFetching: o };
1172
1187
  }, At = () => {
1173
- const { data: r, isFetching: i } = Ma(), o = r == null ? void 0 : r.seo, [a, s] = I({
1174
- seoTitle: "",
1175
- seoDescription: "",
1188
+ const { selectedLang: a } = $e(), { data: i, isFetching: l } = Je();
1189
+ return { data: ne(() => ie(i, { lang: a || "" }) || {}, [i, a]), isFetching: l };
1190
+ }, Ft = () => {
1191
+ const { data: a, isFetching: i } = At(), l = a == null ? void 0 : a.seo, [n, s] = A({
1192
+ title: "",
1193
+ description: "",
1176
1194
  cononicalUrl: "",
1177
1195
  noIndex: !1,
1178
1196
  noFollow: "",
@@ -1182,12 +1200,12 @@ const Tt = () => {
1182
1200
  searchTitle: "",
1183
1201
  searchDescription: "",
1184
1202
  jsonLD: "",
1185
- ...o
1186
- }), w = ca({ initial: a, updated: a }), { selectedLang: c, fallbackLang: f } = Be(), u = c.length ? c : f, { mutate: p, isPending: g } = Me(), m = g;
1187
- Ie(() => {
1188
- !i && o && s({
1189
- seoTitle: "",
1190
- seoDescription: "",
1203
+ ...l
1204
+ }), d = St({ initial: n, updated: n }), { selectedLang: c, fallbackLang: p } = $e(), h = c.length ? c : p, { mutate: b, isPending: w } = Ye(), f = w;
1205
+ qe(() => {
1206
+ !i && l && s({
1207
+ title: "",
1208
+ description: "",
1191
1209
  cononicalUrl: "",
1192
1210
  noIndex: !1,
1193
1211
  noFollow: "",
@@ -1197,561 +1215,674 @@ const Tt = () => {
1197
1215
  searchTitle: "",
1198
1216
  searchDescription: "",
1199
1217
  jsonLD: "",
1200
- ...o
1218
+ ...l
1201
1219
  });
1202
- }, [i, o]);
1203
- const h = async () => {
1204
- p({ id: r == null ? void 0 : r.id, seo: a }), w.current.initial = a, w.current.updated = a;
1205
- }, S = () => {
1220
+ }, [i, l]);
1221
+ const C = async () => {
1222
+ b({ id: a == null ? void 0 : a.id, seo: n }), d.current.initial = n, d.current.updated = n;
1223
+ }, T = () => {
1206
1224
  s({
1207
- ...a,
1208
- ogTitle: a.seoTitle,
1209
- ogDescription: a.seoDescription
1225
+ ...n,
1226
+ ogTitle: n.title,
1227
+ ogDescription: n.description
1210
1228
  });
1211
- }, k = () => {
1229
+ }, m = () => {
1212
1230
  s({
1213
- ...a,
1214
- searchTitle: a.ogTitle,
1215
- searchDescription: a.ogDescription
1231
+ ...n,
1232
+ searchTitle: n.ogTitle,
1233
+ searchDescription: n.ogDescription
1216
1234
  });
1217
- }, E = (F) => {
1218
- const D = {
1219
- ...a,
1220
- [F.target.name]: F.target.name === "noIndex" ? F.target.checked : F.target.value
1235
+ }, v = (F) => {
1236
+ const y = {
1237
+ ...n,
1238
+ [F.target.name]: F.target.name === "noIndex" || F.target.name === "noFollow" ? F.target.checked : F.target.value
1221
1239
  };
1222
- s(D), w.current.updated = D;
1240
+ s(y), d.current.updated = y;
1223
1241
  };
1224
- return /* @__PURE__ */ t.jsxs("div", { className: "relative pb-40", children: [
1225
- /* @__PURE__ */ t.jsxs("div", { className: "text-xs bg-gray-100 p-2 rounded-md text-center", children: [
1242
+ return /* @__PURE__ */ e.jsxs("div", { className: "relative pb-40", children: [
1243
+ /* @__PURE__ */ e.jsxs("div", { className: "text-xs bg-gray-100 p-2 rounded-md text-center", children: [
1226
1244
  "Current language:",
1227
1245
  " ",
1228
- /* @__PURE__ */ t.jsx("span", { className: "text-blue-500 font-semibold", children: q(ye, u, u) })
1246
+ /* @__PURE__ */ e.jsx("span", { className: "text-blue-500 font-semibold", children: M(se, h, h) }),
1247
+ /* @__PURE__ */ e.jsxs("span", { className: "text-[11px] text-gray-500", children: [
1248
+ " ",
1249
+ "( ",
1250
+ a == null ? void 0 : a.slug,
1251
+ " )"
1252
+ ] })
1229
1253
  ] }),
1230
- /* @__PURE__ */ t.jsx("form", { className: "space-y-8", children: /* @__PURE__ */ t.jsxs(ga, { type: "multiple", defaultValue: ["page"], children: [
1231
- /* @__PURE__ */ t.jsxs(ge, { value: "page", children: [
1232
- /* @__PURE__ */ t.jsx(me, { className: "text-blue-500", children: "Seo Page" }),
1233
- /* @__PURE__ */ t.jsx(ve, { children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
1234
- /* @__PURE__ */ t.jsxs("div", { children: [
1235
- /* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "seoTitle", children: "SEO Title" }),
1236
- /* @__PURE__ */ t.jsx(
1237
- U,
1254
+ /* @__PURE__ */ e.jsx("form", { className: "space-y-8", children: /* @__PURE__ */ e.jsxs(ma, { type: "multiple", defaultValue: ["page"], children: [
1255
+ /* @__PURE__ */ e.jsxs(ge, { value: "page", children: [
1256
+ /* @__PURE__ */ e.jsx(pe, { className: "text-blue-500", children: "Seo Page" }),
1257
+ /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
1258
+ /* @__PURE__ */ e.jsxs("div", { children: [
1259
+ /* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "title", children: "SEO Title" }),
1260
+ /* @__PURE__ */ e.jsx(
1261
+ G,
1238
1262
  {
1239
1263
  type: "text",
1240
- id: "seoTitle",
1241
- name: "seoTitle",
1242
- value: a.seoTitle,
1243
- onChange: E,
1244
- disabled: m,
1264
+ id: "title",
1265
+ name: "title",
1266
+ value: n.title,
1267
+ onChange: v,
1268
+ disabled: f,
1245
1269
  placeholder: "Enter SEO title"
1246
1270
  }
1247
1271
  ),
1248
- /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The title should be between 10 and 60 characters." })
1272
+ /* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The title should be between 10 and 60 characters." })
1249
1273
  ] }),
1250
- /* @__PURE__ */ t.jsxs("div", { children: [
1251
- /* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "seoDescription", children: "SEO Description" }),
1252
- /* @__PURE__ */ t.jsx(
1253
- xe,
1274
+ /* @__PURE__ */ e.jsxs("div", { children: [
1275
+ /* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "description", children: "SEO Description" }),
1276
+ /* @__PURE__ */ e.jsx(
1277
+ ve,
1254
1278
  {
1255
- id: "seoDescription",
1256
- name: "seoDescription",
1257
- value: a.seoDescription,
1258
- onChange: E,
1259
- disabled: m,
1279
+ id: "description",
1280
+ name: "description",
1281
+ value: n.description,
1282
+ onChange: v,
1283
+ disabled: f,
1260
1284
  placeholder: "Enter SEO description"
1261
1285
  }
1262
1286
  ),
1263
- /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The description should be between 50 and 160 characters." })
1287
+ /* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The description should be between 50 and 160 characters." })
1264
1288
  ] }),
1265
- /* @__PURE__ */ t.jsxs("div", { children: [
1266
- /* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "seoTitle", children: "Canonical URL" }),
1267
- /* @__PURE__ */ t.jsx(
1268
- U,
1289
+ /* @__PURE__ */ e.jsxs("div", { children: [
1290
+ /* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "title", children: "Canonical URL" }),
1291
+ /* @__PURE__ */ e.jsx(
1292
+ G,
1269
1293
  {
1270
1294
  type: "text",
1271
1295
  id: "canonicalUrl",
1272
1296
  name: "canonicalUrl",
1273
- value: a.canonicalUrl,
1274
- onChange: E,
1275
- disabled: m,
1297
+ value: n.canonicalUrl,
1298
+ onChange: v,
1299
+ disabled: f,
1276
1300
  placeholder: "Enter Canonical URL"
1277
1301
  }
1278
1302
  )
1279
1303
  ] }),
1280
- /* @__PURE__ */ t.jsxs("div", { className: "", children: [
1281
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-2", children: [
1282
- /* @__PURE__ */ t.jsx(
1283
- U,
1304
+ /* @__PURE__ */ e.jsxs("div", { className: "", children: [
1305
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
1306
+ /* @__PURE__ */ e.jsx(
1307
+ G,
1284
1308
  {
1285
1309
  type: "checkbox",
1286
1310
  id: "noIndex",
1287
1311
  name: "noIndex",
1288
- checked: a.noIndex,
1289
- onChange: E,
1290
- disabled: m,
1312
+ checked: n.noIndex,
1313
+ onChange: v,
1314
+ disabled: f,
1291
1315
  className: "h-4 w-4"
1292
1316
  }
1293
1317
  ),
1294
- /* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Index" })
1318
+ /* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Index" })
1295
1319
  ] }),
1296
- /* @__PURE__ */ t.jsx("p", { className: "mt-2 text-[10px] font-light text-gray-400", children: "Check this if you don't want search engines to index this page." })
1320
+ /* @__PURE__ */ e.jsx("p", { className: "mt-2 text-[10px] font-light text-gray-400", children: "Check this if you don't want search engines to index this page." })
1297
1321
  ] }),
1298
- /* @__PURE__ */ t.jsxs("div", { children: [
1299
- /* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "seoTitle", children: "No Follow" }),
1300
- /* @__PURE__ */ t.jsx(
1301
- U,
1302
- {
1303
- type: "text",
1304
- id: "noFollow",
1305
- name: "noFollow",
1306
- value: a.noFollow,
1307
- onChange: E,
1308
- disabled: m,
1309
- placeholder: "Enter No follow"
1310
- }
1311
- )
1322
+ /* @__PURE__ */ e.jsxs("div", { className: "", children: [
1323
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
1324
+ /* @__PURE__ */ e.jsx(
1325
+ G,
1326
+ {
1327
+ type: "checkbox",
1328
+ id: "noFollow",
1329
+ name: "noFollow",
1330
+ checked: n.noFollow,
1331
+ onChange: v,
1332
+ disabled: f,
1333
+ className: "h-4 w-4"
1334
+ }
1335
+ ),
1336
+ /* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Follow" })
1337
+ ] }),
1338
+ /* @__PURE__ */ e.jsx("p", { className: "mt-2 text-[10px] font-light text-gray-400", children: "Check this if you don't want search engines to follow links on this page." })
1312
1339
  ] })
1313
1340
  ] }) })
1314
1341
  ] }),
1315
- /* @__PURE__ */ t.jsxs(ge, { value: "og", children: [
1316
- /* @__PURE__ */ t.jsx(me, { className: "text-blue-500", children: "OG" }),
1317
- /* @__PURE__ */ t.jsx(ve, { children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
1318
- /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ t.jsx(
1319
- B,
1342
+ /* @__PURE__ */ e.jsxs(ge, { value: "og", children: [
1343
+ /* @__PURE__ */ e.jsx(pe, { className: "text-blue-500", children: "OG" }),
1344
+ /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
1345
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e.jsx(
1346
+ _,
1320
1347
  {
1321
1348
  type: "button",
1322
1349
  variant: "outline",
1323
1350
  size: "sm",
1324
- onClick: S,
1351
+ onClick: T,
1325
1352
  children: "Copy from SEO Settings"
1326
1353
  }
1327
1354
  ) }),
1328
- /* @__PURE__ */ t.jsxs("div", { children: [
1329
- /* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "ogTitle", children: "OG Title" }),
1330
- /* @__PURE__ */ t.jsx(
1331
- U,
1355
+ /* @__PURE__ */ e.jsxs("div", { children: [
1356
+ /* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "ogTitle", children: "OG Title" }),
1357
+ /* @__PURE__ */ e.jsx(
1358
+ G,
1332
1359
  {
1333
1360
  type: "text",
1334
1361
  id: "ogTitle",
1335
1362
  name: "ogTitle",
1336
- value: a.ogTitle,
1337
- onChange: E,
1338
- disabled: m,
1363
+ value: n.ogTitle,
1364
+ onChange: v,
1365
+ disabled: f,
1339
1366
  placeholder: "Enter OG title"
1340
1367
  }
1341
1368
  ),
1342
- /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The OG title should be between 10 and 60 characters." })
1369
+ /* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The OG title should be between 10 and 60 characters." })
1343
1370
  ] }),
1344
- /* @__PURE__ */ t.jsxs("div", { className: "mt-4", children: [
1345
- /* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "ogDescription", children: "OG Description" }),
1346
- /* @__PURE__ */ t.jsx(
1347
- xe,
1371
+ /* @__PURE__ */ e.jsxs("div", { className: "mt-4", children: [
1372
+ /* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "ogDescription", children: "OG Description" }),
1373
+ /* @__PURE__ */ e.jsx(
1374
+ ve,
1348
1375
  {
1349
1376
  id: "ogDescription",
1350
1377
  name: "ogDescription",
1351
- value: a.ogDescription,
1352
- onChange: E,
1353
- disabled: m,
1378
+ value: n.ogDescription,
1379
+ onChange: v,
1380
+ disabled: f,
1354
1381
  placeholder: "Enter OG description"
1355
1382
  }
1356
1383
  ),
1357
- /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The OG description should be between 50 and 160 characters." })
1384
+ /* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The OG description should be between 50 and 160 characters." })
1358
1385
  ] }),
1359
- /* @__PURE__ */ t.jsxs("div", { className: "mt-4", children: [
1360
- /* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "ogImage", children: "OG Image URL" }),
1361
- /* @__PURE__ */ t.jsx(
1362
- U,
1386
+ /* @__PURE__ */ e.jsxs("div", { className: "mt-4", children: [
1387
+ /* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "ogImage", children: "OG Image URL" }),
1388
+ /* @__PURE__ */ e.jsx(
1389
+ G,
1363
1390
  {
1364
1391
  type: "text",
1365
1392
  id: "ogImage",
1366
1393
  name: "ogImage",
1367
- value: a.ogImage,
1368
- onChange: E,
1369
- disabled: m,
1394
+ value: n.ogImage,
1395
+ onChange: v,
1396
+ disabled: f,
1370
1397
  placeholder: "Enter OG image URL"
1371
1398
  }
1372
1399
  ),
1373
- /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "Enter a valid URL for the OG image." })
1400
+ /* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "Enter a valid URL for the OG image." })
1374
1401
  ] })
1375
1402
  ] }) })
1376
1403
  ] }),
1377
- /* @__PURE__ */ t.jsxs(ge, { value: "search", children: [
1378
- /* @__PURE__ */ t.jsx(me, { className: "text-blue-500", children: "Search" }),
1379
- /* @__PURE__ */ t.jsx(ve, { children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
1380
- /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ t.jsx(
1381
- B,
1404
+ /* @__PURE__ */ e.jsxs(ge, { value: "search", children: [
1405
+ /* @__PURE__ */ e.jsx(pe, { className: "text-blue-500", children: "Search" }),
1406
+ /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
1407
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e.jsx(
1408
+ _,
1382
1409
  {
1383
1410
  type: "button",
1384
1411
  variant: "outline",
1385
1412
  size: "sm",
1386
- onClick: k,
1413
+ onClick: m,
1387
1414
  children: "Copy from OG Settings"
1388
1415
  }
1389
1416
  ) }),
1390
- /* @__PURE__ */ t.jsxs("div", { children: [
1391
- /* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "searchTitle", children: "Search Title" }),
1392
- /* @__PURE__ */ t.jsx(
1393
- U,
1417
+ /* @__PURE__ */ e.jsxs("div", { children: [
1418
+ /* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "searchTitle", children: "Search Title" }),
1419
+ /* @__PURE__ */ e.jsx(
1420
+ G,
1394
1421
  {
1395
1422
  type: "text",
1396
1423
  id: "searchTitle",
1397
1424
  name: "searchTitle",
1398
- value: a.searchTitle,
1399
- onChange: E,
1400
- disabled: m,
1425
+ value: n.searchTitle,
1426
+ onChange: v,
1427
+ disabled: f,
1401
1428
  placeholder: "Enter search title"
1402
1429
  }
1403
1430
  ),
1404
- /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The search title should be between 10 and 60 characters." })
1431
+ /* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The search title should be between 10 and 60 characters." })
1405
1432
  ] }),
1406
- /* @__PURE__ */ t.jsxs("div", { children: [
1407
- /* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "searchDescription", children: "Search Description" }),
1408
- /* @__PURE__ */ t.jsx(
1409
- xe,
1433
+ /* @__PURE__ */ e.jsxs("div", { children: [
1434
+ /* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "searchDescription", children: "Search Description" }),
1435
+ /* @__PURE__ */ e.jsx(
1436
+ ve,
1410
1437
  {
1411
1438
  id: "searchDescription",
1412
1439
  name: "searchDescription",
1413
- value: a.searchDescription,
1414
- onChange: E,
1440
+ value: n.searchDescription,
1441
+ onChange: v,
1415
1442
  placeholder: "Enter search description"
1416
1443
  }
1417
1444
  ),
1418
- /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The search description should be between 50 and 160 characters." })
1445
+ /* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The search description should be between 50 and 160 characters." })
1419
1446
  ] })
1420
1447
  ] }) })
1421
1448
  ] }),
1422
- /* @__PURE__ */ t.jsxs(ge, { value: "jsonLD", children: [
1423
- /* @__PURE__ */ t.jsx(me, { className: "text-blue-500", children: "JSON-LD" }),
1424
- /* @__PURE__ */ t.jsx(ve, { children: /* @__PURE__ */ t.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
1425
- xe,
1449
+ /* @__PURE__ */ e.jsxs(ge, { value: "jsonLD", children: [
1450
+ /* @__PURE__ */ e.jsx(pe, { className: "text-blue-500", children: "JSON-LD" }),
1451
+ /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
1452
+ ve,
1426
1453
  {
1427
1454
  id: "jsonLD",
1428
1455
  name: "jsonLD",
1429
1456
  rows: 3,
1430
- value: a.jsonLD,
1431
- onChange: E,
1457
+ value: n.jsonLD,
1458
+ onChange: v,
1432
1459
  placeholder: "Enter JSON-LD"
1433
1460
  }
1434
1461
  ) }) }) })
1435
1462
  ] })
1436
1463
  ] }) }),
1437
- /* @__PURE__ */ t.jsx("div", { className: "w-full flex items-center justify-end mt-4", children: /* @__PURE__ */ t.jsx(
1438
- B,
1464
+ /* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-end mt-4", children: /* @__PURE__ */ e.jsx(
1465
+ _,
1439
1466
  {
1440
1467
  size: "lg",
1441
1468
  variant: "default",
1442
- onClick: h,
1443
- disabled: Fe(w.current.initial, a) || m,
1444
- children: g ? "Saving..." : "Save"
1469
+ onClick: C,
1470
+ disabled: Ge(d.current.initial, n) || f,
1471
+ children: w ? "Saving..." : "Save"
1445
1472
  }
1446
1473
  ) })
1447
1474
  ] });
1448
1475
  };
1449
- At.displayName = "SeoPanel";
1450
- const $a = ({
1451
- langProps: r,
1476
+ Ft.displayName = "SeoPanel";
1477
+ const Qa = ({
1478
+ langProps: a,
1452
1479
  onClose: i,
1453
- languagePages: o
1480
+ languages: l
1454
1481
  }) => {
1455
- const { data: a } = _t(), [s, w] = I(r.edit ? r.name : ""), [c, f] = I(r.edit ? r.lang : ""), [u, p] = I(r.edit ? r.slug : ""), { mutate: g, isPending: m } = Rt(), { mutate: h, isPending: S } = Me(), k = m || S, { data: E } = Ot(), F = ae(
1456
- q(E, "languages") || ["en"],
1457
- (b) => !se(o, { lang: b }) && b !== q(E, "fallbackLang")
1458
- ), D = () => {
1459
- r.edit ? h(
1460
- {
1461
- name: s,
1462
- slug: u,
1463
- lang: c,
1464
- id: r == null ? void 0 : r.id,
1465
- primaryPage: r == null ? void 0 : r.primaryPage
1466
- },
1467
- { onSuccess: i }
1468
- ) : g(
1469
- {
1470
- name: s,
1471
- slug: u,
1472
- lang: c,
1473
- primaryPage: a == null ? void 0 : a.id
1474
- },
1475
- { onSuccess: i }
1476
- );
1482
+ const { data: n } = _t(), [s, d] = A(a.name || ""), [c, p] = A(a.edit ? a.lang : ""), [h, b] = A(a.edit ? a.slug : ""), { mutate: w, isPending: f } = Rt(), { mutate: C, isPending: T } = Ye(), m = !!(n != null && n.global), v = f || T, F = () => {
1483
+ const y = { name: s, lang: c, primaryPage: n == null ? void 0 : n.id, slug: h };
1484
+ m || (y.global = !0), a.edit && (y.id = a == null ? void 0 : a.id), a.edit ? C(y, { onSuccess: i }) : w(y, { onSuccess: i });
1477
1485
  };
1478
- return /* @__PURE__ */ t.jsx(xt, { open: !!r, onOpenChange: i, children: /* @__PURE__ */ t.jsxs(bt, { className: "sm:max-w-[425px]", children: [
1479
- /* @__PURE__ */ t.jsxs(yt, { children: [
1480
- /* @__PURE__ */ t.jsx(jt, { children: r.edit ? "Edit language" : "Add New language" }),
1481
- /* @__PURE__ */ t.jsx(wt, { children: "Enter the details for the language" })
1486
+ return /* @__PURE__ */ e.jsx(be, { open: !!a, onOpenChange: i, children: /* @__PURE__ */ e.jsxs(ye, { className: "sm:max-w-[425px]", children: [
1487
+ /* @__PURE__ */ e.jsxs(je, { children: [
1488
+ /* @__PURE__ */ e.jsx(we, { children: a.edit ? "Edit language" : "Add New language" }),
1489
+ /* @__PURE__ */ e.jsx(Ce, { children: "Enter the details for the language" })
1482
1490
  ] }),
1483
- /* @__PURE__ */ t.jsxs("form", { children: [
1484
- /* @__PURE__ */ t.jsxs("div", { className: "grid gap-4 py-4", children: [
1485
- /* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
1486
- /* @__PURE__ */ t.jsx(_, { htmlFor: "lang", className: "text-right", children: "Language" }),
1487
- /* @__PURE__ */ t.jsxs(
1491
+ /* @__PURE__ */ e.jsxs("form", { children: [
1492
+ /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4 py-4", children: [
1493
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
1494
+ /* @__PURE__ */ e.jsx(R, { htmlFor: "lang", className: "text-right", children: "Language" }),
1495
+ /* @__PURE__ */ e.jsxs(
1488
1496
  "select",
1489
1497
  {
1490
1498
  value: c,
1491
- disabled: r.edit || z(F),
1492
- onChange: (b) => f(b.target.value),
1499
+ disabled: a.edit || q(l),
1500
+ onChange: (y) => {
1501
+ const k = y.target.value;
1502
+ p(k), !m && b(`/${k}`);
1503
+ },
1493
1504
  className: "flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 col-span-3",
1494
1505
  children: [
1495
- /* @__PURE__ */ t.jsx("option", { value: "", disabled: !0, selected: !0, children: z(F) ? "All available language page is created." : "Choose language" }),
1496
- Ue(F, (b) => /* @__PURE__ */ t.jsx("option", { value: b, children: q(ye, b, b) }, b))
1506
+ /* @__PURE__ */ e.jsx("option", { value: "", disabled: !0, selected: !0, children: a.edit ? M(se, a.lang, a.lang) : q(l) ? "All available language page is created." : "Choose language" }),
1507
+ We(l, (y) => /* @__PURE__ */ e.jsx("option", { value: y, children: M(se, y, y) }, y))
1497
1508
  ]
1498
1509
  }
1499
1510
  )
1500
1511
  ] }),
1501
- /* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
1502
- /* @__PURE__ */ t.jsx(_, { htmlFor: "slug", className: "text-right", children: "Page Name" }),
1503
- /* @__PURE__ */ t.jsx(
1504
- U,
1512
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
1513
+ /* @__PURE__ */ e.jsx(R, { htmlFor: "slug", className: "text-right", children: "Page Name" }),
1514
+ /* @__PURE__ */ e.jsx(
1515
+ G,
1505
1516
  {
1506
1517
  id: "name",
1507
1518
  value: s,
1508
- onChange: (b) => w(b.target.value),
1519
+ onChange: (y) => d(y.target.value),
1509
1520
  className: "col-span-3",
1510
1521
  required: !0,
1511
1522
  placeholder: "Enter page name"
1512
1523
  }
1513
1524
  )
1514
1525
  ] }),
1515
- /* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
1516
- /* @__PURE__ */ t.jsxs(_, { htmlFor: "slug", className: "text-right", children: [
1526
+ !m && /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
1527
+ /* @__PURE__ */ e.jsxs(R, { htmlFor: "slug", className: "text-right", children: [
1517
1528
  "Slug",
1518
1529
  " ",
1519
- /* @__PURE__ */ t.jsx("small", { className: "font-light", children: "(Slug should start with /)" })
1530
+ /* @__PURE__ */ e.jsxs("small", { className: "font-light", children: [
1531
+ "(Slug should start with /",
1532
+ c,
1533
+ ")"
1534
+ ] })
1520
1535
  ] }),
1521
- /* @__PURE__ */ t.jsx(
1522
- U,
1536
+ /* @__PURE__ */ e.jsx(
1537
+ G,
1523
1538
  {
1524
1539
  id: "slug",
1525
- value: u,
1526
- onChange: (b) => p(Pa(_a(b.target.value))),
1540
+ value: h,
1541
+ onChange: (y) => {
1542
+ const k = y.target.value;
1543
+ xt(k, `/${c}`) && b(La(Ia(k)));
1544
+ },
1527
1545
  className: "col-span-3",
1528
1546
  required: !0,
1529
1547
  pattern: "^/.*",
1548
+ disabled: q(c),
1530
1549
  title: "Slug must start with /",
1531
- placeholder: "Enter page slug"
1550
+ placeholder: q(c) ? "Choose language to add slug" : "Enter page slug"
1532
1551
  }
1533
1552
  )
1534
1553
  ] })
1535
1554
  ] }),
1536
- /* @__PURE__ */ t.jsx(St, { children: /* @__PURE__ */ t.jsx(
1537
- B,
1555
+ /* @__PURE__ */ e.jsx(Se, { children: /* @__PURE__ */ e.jsx(
1556
+ _,
1538
1557
  {
1539
- onClick: D,
1558
+ onClick: F,
1540
1559
  type: "button",
1541
- disabled: k || !c || !u || !u.startsWith("/"),
1542
- children: k ? r.edit ? "Updating..." : "Adding..." : r.edit ? "Update" : "Add new language"
1560
+ disabled: v || !c || !m && !xt(h, `/${c}`),
1561
+ children: v ? a.edit ? "Updating..." : "Adding..." : a.edit ? "Update" : "Add new language"
1543
1562
  }
1544
1563
  ) })
1545
1564
  ] })
1546
1565
  ] }) });
1547
- }, Ka = () => {
1548
- const [r, i] = I(null), { selectedLang: o, fallbackLang: a, setSelectedLang: s, languages: w } = Be(), { data: c, isFetching: f } = qe(), { mutate: u, isPending: p } = Dt();
1549
- return /* @__PURE__ */ t.jsxs("div", { className: "space-y-4 pt-2", children: [
1550
- /* @__PURE__ */ t.jsxs("ul", { className: "space-y-2 mt-4", children: [
1551
- f && /* @__PURE__ */ t.jsxs("div", { className: "w-full space-y-3 py-4", children: [
1552
- /* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
1553
- /* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
1554
- /* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
1555
- ] }),
1556
- Ue(c, (g) => {
1557
- const m = g.lang, h = g.slug, S = !g.primaryPage, k = m === o;
1558
- return S ? null : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1559
- /* @__PURE__ */ t.jsxs(
1560
- "li",
1561
- {
1562
- className: `w-full p-2 rounded cursor-pointer flex items-center justify-between ${k ? "bg-gray-200" : "hover:bg-gray-100"}`,
1563
- onClick: () => s(m),
1564
- children: [
1565
- /* @__PURE__ */ t.jsxs("div", { className: " flex-1 gap-x-3", children: [
1566
- /* @__PURE__ */ t.jsx("div", { className: "text-[13px]", children: q(ye, S ? a : m, m) }),
1567
- /* @__PURE__ */ t.jsxs("div", { children: [
1568
- /* @__PURE__ */ t.jsxs("div", { className: "text-[11px] text-gray-500", children: [
1569
- "Slug:",
1570
- /* @__PURE__ */ t.jsxs("b", { children: [
1571
- " ",
1572
- h
1573
- ] })
1574
- ] }),
1575
- /* @__PURE__ */ t.jsxs("div", { className: "text-[11px] text-gray-500", children: [
1576
- "Name:",
1577
- /* @__PURE__ */ t.jsxs("b", { children: [
1578
- " ",
1579
- g.name,
1580
- " "
1581
- ] })
1566
+ }, Xa = () => {
1567
+ const [a, i] = A(null), { selectedLang: l, fallbackLang: n, setSelectedLang: s } = $e(), { data: d, isFetching: c } = Je(), { mutate: p, isPending: h } = Dt(), { data: b } = At(), { data: w } = Ot(), f = Ke(
1568
+ M(w, "languages") || ["en"],
1569
+ (C) => !ie(d, { lang: C }) && C !== M(w, "fallbackLang")
1570
+ );
1571
+ return /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 pt-2", children: [
1572
+ /* @__PURE__ */ e.jsx("ul", { className: "space-y-2 mt-4", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-3 py-4", children: [
1573
+ /* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
1574
+ /* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
1575
+ /* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
1576
+ ] }) : We(d, (C) => {
1577
+ const T = C.lang, m = C.slug, v = !C.primaryPage, F = T === l;
1578
+ return v ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1579
+ /* @__PURE__ */ e.jsxs(
1580
+ "li",
1581
+ {
1582
+ className: `w-full p-2 rounded cursor-pointer flex items-center justify-between ${F ? "bg-gray-200" : "hover:bg-gray-100"}`,
1583
+ onClick: () => s(T),
1584
+ children: [
1585
+ /* @__PURE__ */ e.jsxs("div", { className: " flex-1 gap-x-3", children: [
1586
+ /* @__PURE__ */ e.jsx("div", { className: "text-[13px]", children: M(se, v ? n : T, T) }),
1587
+ /* @__PURE__ */ e.jsxs("div", { children: [
1588
+ /* @__PURE__ */ e.jsxs("div", { className: "text-[11px] text-gray-500", children: [
1589
+ "Slug:",
1590
+ /* @__PURE__ */ e.jsxs("b", { children: [
1591
+ " ",
1592
+ m
1593
+ ] })
1594
+ ] }),
1595
+ /* @__PURE__ */ e.jsxs("div", { className: "text-[11px] text-gray-500", children: [
1596
+ "Name:",
1597
+ /* @__PURE__ */ e.jsxs("b", { children: [
1598
+ " ",
1599
+ C.name,
1600
+ " "
1582
1601
  ] })
1583
- ] })
1584
- ] }),
1585
- S ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
1586
- /* @__PURE__ */ t.jsx(wa, { fill: "orange", className: "w-3 h-3" }),
1587
- /* @__PURE__ */ t.jsx("b", { children: " Default" })
1588
- ] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-3", children: [
1589
- /* @__PURE__ */ t.jsx(
1590
- Et,
1591
- {
1592
- onClick: (E) => {
1593
- E.stopPropagation(), i({ ...g, edit: !0 });
1594
- },
1595
- className: "w-3 h-3 hover:text-blue-500"
1596
- }
1597
- ),
1598
- /* @__PURE__ */ t.jsxs(gt, { children: [
1599
- /* @__PURE__ */ t.jsx(mt, { children: /* @__PURE__ */ t.jsx(Ct, { className: "w-3 h-3 hover:text-red-500" }) }),
1600
- /* @__PURE__ */ t.jsx(vt, { children: /* @__PURE__ */ t.jsxs("div", { children: [
1601
- /* @__PURE__ */ t.jsxs("p", { className: "pb-2 text-sm", children: [
1602
- "Are you sure you want to remove",
1603
- " ",
1604
- /* @__PURE__ */ t.jsx("b", { children: q(ye, m, m) }),
1605
- " language?"
1606
- ] }),
1607
- /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ t.jsx(
1608
- B,
1609
- {
1610
- size: "sm",
1611
- variant: "destructive",
1612
- disabled: p,
1613
- onClick: () => u(g),
1614
- children: p ? "Deleting..." : "Delete"
1615
- }
1616
- ) })
1617
- ] }) })
1618
1602
  ] })
1619
1603
  ] })
1620
- ]
1621
- },
1622
- g.id
1623
- ),
1624
- /* @__PURE__ */ t.jsx("div", { className: "h-1 w-full border-b" })
1625
- ] });
1626
- })
1627
- ] }),
1628
- /* @__PURE__ */ t.jsx("div", { className: "flex justify-center w-full", children: ((c == null ? void 0 : c.length) || 0) >= w.length && /* @__PURE__ */ t.jsx(
1629
- B,
1604
+ ] }),
1605
+ v ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
1606
+ /* @__PURE__ */ e.jsx(Na, { fill: "orange", className: "w-3 h-3" }),
1607
+ /* @__PURE__ */ e.jsx("b", { children: " Default" })
1608
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-3", children: [
1609
+ /* @__PURE__ */ e.jsx(
1610
+ kt,
1611
+ {
1612
+ onClick: (y) => {
1613
+ y.stopPropagation(), i({ ...C, edit: !0 });
1614
+ },
1615
+ className: "w-3 h-3 hover:text-blue-500"
1616
+ }
1617
+ ),
1618
+ /* @__PURE__ */ e.jsxs(ga, { children: [
1619
+ /* @__PURE__ */ e.jsx(pa, { children: /* @__PURE__ */ e.jsx(Et, { className: "w-3 h-3 hover:text-red-500" }) }),
1620
+ /* @__PURE__ */ e.jsx(xa, { children: /* @__PURE__ */ e.jsxs("div", { children: [
1621
+ /* @__PURE__ */ e.jsxs("p", { className: "pb-2 text-sm", children: [
1622
+ "Are you sure you want to remove",
1623
+ " ",
1624
+ /* @__PURE__ */ e.jsx("b", { children: M(se, T, T) }),
1625
+ " language?"
1626
+ ] }),
1627
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ e.jsx(
1628
+ _,
1629
+ {
1630
+ size: "sm",
1631
+ variant: "destructive",
1632
+ disabled: h,
1633
+ onClick: () => p(C),
1634
+ children: h ? "Deleting..." : "Delete"
1635
+ }
1636
+ ) })
1637
+ ] }) })
1638
+ ] })
1639
+ ] })
1640
+ ]
1641
+ },
1642
+ C.id
1643
+ ),
1644
+ /* @__PURE__ */ e.jsx("div", { className: "h-1 w-full border-b" })
1645
+ ] });
1646
+ }) }),
1647
+ /* @__PURE__ */ e.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ e.jsx(
1648
+ _,
1630
1649
  {
1631
1650
  variant: "default",
1632
1651
  size: "sm",
1633
- onClick: () => i({ name: "", lang: "", slug: "", edit: !1 }),
1652
+ disabled: q(f),
1653
+ onClick: () => i({
1654
+ name: b == null ? void 0 : b.name,
1655
+ lang: "",
1656
+ slug: "",
1657
+ edit: !1
1658
+ }),
1634
1659
  children: "+ Add new language"
1635
1660
  }
1636
1661
  ) }),
1637
- r && /* @__PURE__ */ t.jsx(
1638
- $a,
1662
+ a && /* @__PURE__ */ e.jsx(
1663
+ Qa,
1639
1664
  {
1640
- langProps: r,
1641
- languagePages: c,
1665
+ languages: f,
1666
+ langProps: a,
1642
1667
  onClose: () => i(null)
1643
1668
  }
1644
1669
  )
1645
1670
  ] });
1646
- }, Va = ({
1647
- activePage: r,
1671
+ };
1672
+ function Za({
1673
+ page: a,
1674
+ onClose: i,
1675
+ onDelete: l
1676
+ }) {
1677
+ const { mutate: n, isPending: s } = Dt(), d = () => {
1678
+ n(a, {
1679
+ onSuccess: () => {
1680
+ l();
1681
+ }
1682
+ });
1683
+ };
1684
+ return /* @__PURE__ */ e.jsx(be, { open: !!a, onOpenChange: i, children: /* @__PURE__ */ e.jsxs(ye, { children: [
1685
+ /* @__PURE__ */ e.jsxs(je, { children: [
1686
+ /* @__PURE__ */ e.jsx(we, { children: "Confirm Deletion" }),
1687
+ /* @__PURE__ */ e.jsxs(Ce, { children: [
1688
+ "Are you sure you want to remove ",
1689
+ /* @__PURE__ */ e.jsx("b", { children: (a == null ? void 0 : a.name) ?? (a == null ? void 0 : a.slug) }),
1690
+ " ",
1691
+ a != null && a.global ? "global block?" : "page? This will also delete all associated language pages."
1692
+ ] })
1693
+ ] }),
1694
+ /* @__PURE__ */ e.jsxs(Se, { children: [
1695
+ /* @__PURE__ */ e.jsx(_, { variant: "outline", onClick: i, children: "Cancel" }),
1696
+ /* @__PURE__ */ e.jsx(_, { variant: "destructive", disabled: s, onClick: d, children: s ? "Deleting..." : "Delete" })
1697
+ ] })
1698
+ ] }) });
1699
+ }
1700
+ const en = ({
1701
+ page: a,
1702
+ onClose: i,
1703
+ onUnpublish: l
1704
+ }) => {
1705
+ const { mutate: n, isPending: s } = Ha(), d = async () => {
1706
+ n(a, {
1707
+ onSuccess: () => {
1708
+ l();
1709
+ }
1710
+ });
1711
+ };
1712
+ return /* @__PURE__ */ e.jsx(be, { open: !!a, onOpenChange: i, children: /* @__PURE__ */ e.jsxs(ye, { children: [
1713
+ /* @__PURE__ */ e.jsxs(je, { children: [
1714
+ /* @__PURE__ */ e.jsx(we, { children: "Confirm Unpublish" }),
1715
+ /* @__PURE__ */ e.jsxs(Ce, { children: [
1716
+ "Are you sure you want to unpublish ",
1717
+ /* @__PURE__ */ e.jsx("b", { children: (a == null ? void 0 : a.name) ?? (a == null ? void 0 : a.slug) }),
1718
+ "?"
1719
+ ] })
1720
+ ] }),
1721
+ /* @__PURE__ */ e.jsxs(Se, { children: [
1722
+ /* @__PURE__ */ e.jsx(_, { variant: "outline", onClick: i, children: "Cancel" }),
1723
+ /* @__PURE__ */ e.jsx(
1724
+ _,
1725
+ {
1726
+ variant: "destructive",
1727
+ disabled: s,
1728
+ onClick: d,
1729
+ children: s ? "Unpublishing..." : "Unpublish"
1730
+ }
1731
+ )
1732
+ ] })
1733
+ ] }) });
1734
+ }, tn = ({
1735
+ activePage: a,
1648
1736
  editPage: i,
1649
- onShowUpsertPage: o
1737
+ onShowUpsertPage: l
1650
1738
  }) => {
1651
- const [a, s] = I("pages"), { data: w, isFetching: c } = Ge(), { mutate: f, isPending: u } = Dt(), p = (g) => Oa(
1652
- ae(g, (h) => a === "pages" ? h.slug : !h.slug),
1739
+ const [n, s] = A("pages"), { data: d, isFetching: c } = ze(), [p, h] = A(
1740
+ null
1741
+ ), [b, w] = A(null), f = (C) => Ua(
1742
+ Ke(C, (m) => n === "pages" ? m.slug : !m.slug),
1653
1743
  "name",
1654
1744
  "asc"
1655
- ).map((h) => /* @__PURE__ */ t.jsxs(
1656
- B,
1745
+ ).map((m) => /* @__PURE__ */ e.jsxs(
1746
+ _,
1657
1747
  {
1658
- onClick: () => i(h.id),
1659
- variant: h.id === r ? "default" : "ghost",
1748
+ onClick: () => i(m.id),
1749
+ variant: m.id === a ? "default" : "ghost",
1660
1750
  className: "flex justify-between items-center w-full space-x-2 py-1",
1661
1751
  children: [
1662
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
1663
- h.global ? /* @__PURE__ */ t.jsx(Nt, { className: "h-4 w-4" }) : /* @__PURE__ */ t.jsx(kt, { className: "h-4 w-4" }),
1664
- /* @__PURE__ */ t.jsx("span", { children: h.name ?? h.slug }),
1665
- (h == null ? void 0 : h.slug) && /* @__PURE__ */ t.jsxs("span", { className: "text-xs font-light", children: [
1752
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
1753
+ m.global ? /* @__PURE__ */ e.jsx(Nt, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(Tt, { className: "h-4 w-4" }),
1754
+ /* @__PURE__ */ e.jsx("span", { children: m.name ?? m.slug }),
1755
+ (m == null ? void 0 : m.slug) && /* @__PURE__ */ e.jsxs("span", { className: "text-xs font-light", children: [
1666
1756
  "( ",
1667
- h.slug,
1757
+ m.slug,
1668
1758
  " )"
1669
1759
  ] })
1670
1760
  ] }),
1671
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-4", children: [
1672
- /* @__PURE__ */ t.jsx(
1673
- Et,
1761
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-4", children: /* @__PURE__ */ e.jsxs(wa, { children: [
1762
+ /* @__PURE__ */ e.jsx(Ca, { asChild: !0, onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ e.jsx(
1763
+ _,
1674
1764
  {
1675
- className: "h-3 w-3 hover:text-blue-500",
1676
- onClick: (S) => {
1677
- S.stopPropagation(), o({ ...h, global: a === "globalBlocks" });
1678
- }
1765
+ variant: "ghost",
1766
+ size: "sm",
1767
+ className: `h-8 w-8 p-0 hover:bg-transparent ${m.id === a ? " hover:text-gray-200" : "bg-transparent "}`,
1768
+ children: /* @__PURE__ */ e.jsx(Pa, { className: "h-4 w-4" })
1679
1769
  }
1680
- ),
1681
- /* @__PURE__ */ t.jsxs(gt, { children: [
1682
- /* @__PURE__ */ t.jsx(mt, { onClick: (S) => S.stopPropagation(), children: /* @__PURE__ */ t.jsx(Ct, { className: "w-3 h-3 hover:text-red-500" }) }),
1683
- /* @__PURE__ */ t.jsx(vt, { children: /* @__PURE__ */ t.jsxs("div", { children: [
1684
- /* @__PURE__ */ t.jsxs("p", { className: "pb-2 text-sm", children: [
1685
- "Are you sure you want to remove",
1686
- " ",
1687
- /* @__PURE__ */ t.jsx("b", { children: h.name ?? (h == null ? void 0 : h.slug) }),
1688
- " ",
1689
- h.global ? "global block?" : "page? This will also delete all associated language pages."
1690
- ] }),
1691
- /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ t.jsx(
1692
- B,
1693
- {
1694
- size: "sm",
1695
- variant: "destructive",
1696
- disabled: u,
1697
- onClick: (S) => {
1698
- S.stopPropagation(), f(h);
1699
- },
1700
- children: u ? "Deleting..." : "Delete"
1701
- }
1702
- ) })
1703
- ] }) })
1770
+ ) }),
1771
+ /* @__PURE__ */ e.jsxs(Sa, { align: "end", className: "text-sm font-medium", children: [
1772
+ /* @__PURE__ */ e.jsxs(
1773
+ Be,
1774
+ {
1775
+ className: "flex items-center gap-2",
1776
+ onClick: (v) => {
1777
+ v.stopPropagation(), l({ ...m, global: n === "globalBlocks" });
1778
+ },
1779
+ children: [
1780
+ /* @__PURE__ */ e.jsx(kt, { className: "size-3", strokeWidth: 3 }),
1781
+ "Edit"
1782
+ ]
1783
+ }
1784
+ ),
1785
+ /* @__PURE__ */ e.jsxs(
1786
+ Be,
1787
+ {
1788
+ className: "flex items-center gap-2",
1789
+ onClick: (v) => {
1790
+ v.stopPropagation(), h(m);
1791
+ },
1792
+ children: [
1793
+ /* @__PURE__ */ e.jsx(Et, { className: "size-3", strokeWidth: 3 }),
1794
+ "Delete"
1795
+ ]
1796
+ }
1797
+ ),
1798
+ /* @__PURE__ */ e.jsxs(
1799
+ Be,
1800
+ {
1801
+ className: "flex items-center gap-2",
1802
+ onClick: (v) => {
1803
+ v.stopPropagation(), w(m);
1804
+ },
1805
+ children: [
1806
+ /* @__PURE__ */ e.jsx(_a, { className: "size-3", strokeWidth: 3 }),
1807
+ "Unpublish"
1808
+ ]
1809
+ }
1810
+ )
1704
1811
  ] })
1705
- ] })
1812
+ ] }) })
1706
1813
  ]
1707
1814
  },
1708
- h.id
1815
+ m.id
1709
1816
  ));
1710
- return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1711
- /* @__PURE__ */ t.jsx("br", {}),
1712
- /* @__PURE__ */ t.jsxs(ma, { value: a, className: "w-full", onValueChange: s, children: [
1713
- /* @__PURE__ */ t.jsxs(va, { className: "w-full", children: [
1714
- /* @__PURE__ */ t.jsx(ut, { value: "pages", className: "w-full", children: /* @__PURE__ */ t.jsx("div", { className: "px-4", children: "Pages" }) }),
1715
- /* @__PURE__ */ t.jsx(ut, { value: "globalBlocks", className: "w-full", children: /* @__PURE__ */ t.jsx("div", { className: "px-4", children: "Global Blocks" }) })
1817
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1818
+ /* @__PURE__ */ e.jsx("br", {}),
1819
+ /* @__PURE__ */ e.jsxs(va, { value: n, className: "w-full", onValueChange: s, children: [
1820
+ /* @__PURE__ */ e.jsxs(ba, { className: "w-full", children: [
1821
+ /* @__PURE__ */ e.jsx(pt, { value: "pages", className: "w-full", children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: "Pages" }) }),
1822
+ /* @__PURE__ */ e.jsx(pt, { value: "globalBlocks", className: "w-full", children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: "Global Blocks" }) })
1716
1823
  ] }),
1717
- c ? /* @__PURE__ */ t.jsxs("div", { className: "w-full space-y-3 py-4", children: [
1718
- /* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
1719
- /* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
1720
- /* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
1721
- ] }) : /* @__PURE__ */ t.jsxs("div", { className: "py-4 space-y-3", children: [
1722
- /* @__PURE__ */ t.jsx(xa, { children: /* @__PURE__ */ t.jsxs(ba, { className: "text-xs text-muted-foreground text-center text-light", children: [
1824
+ c ? /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-3 py-4", children: [
1825
+ /* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
1826
+ /* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
1827
+ /* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
1828
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: "py-4 space-y-3", children: [
1829
+ /* @__PURE__ */ e.jsx(ya, { children: /* @__PURE__ */ e.jsxs(ja, { className: "text-xs text-muted-foreground text-center text-light", children: [
1723
1830
  "Manage your ",
1724
- a === "pages" ? "pages" : "global blocks"
1831
+ n === "pages" ? "pages" : "global blocks"
1725
1832
  ] }) }),
1726
- /* @__PURE__ */ t.jsx("div", { className: "w-full flex justify-center", children: /* @__PURE__ */ t.jsxs(
1727
- B,
1833
+ /* @__PURE__ */ e.jsx("div", { className: "w-full flex justify-center", children: /* @__PURE__ */ e.jsxs(
1834
+ _,
1728
1835
  {
1729
1836
  variant: "default",
1730
1837
  size: "sm",
1731
1838
  disabled: c,
1732
- onClick: () => o({
1839
+ onClick: () => l({
1733
1840
  slug: "",
1734
1841
  name: "",
1735
- global: a === "globalBlocks"
1842
+ global: n === "globalBlocks"
1736
1843
  }),
1737
1844
  className: "mb-4 w-1/2 bg-blue-500 hover:bg-blue-400",
1738
1845
  children: [
1739
- /* @__PURE__ */ t.jsx(Sa, { className: "h-4 w-4 mr-2" }),
1740
- c ? "Loading..." : `Add new ${a === "pages" ? "page" : "global block"}`
1846
+ /* @__PURE__ */ e.jsx(Ta, { className: "h-4 w-4 mr-2" }),
1847
+ c ? "Loading..." : `Add new ${n === "pages" ? "page" : "global block"}`
1741
1848
  ]
1742
1849
  }
1743
1850
  ) }),
1744
- /* @__PURE__ */ t.jsx("div", { className: "pt-4", children: /* @__PURE__ */ t.jsx("div", { className: "space-y-2", children: c ? /* @__PURE__ */ t.jsx("div", { className: "h-32 w-full flex justify-center items-center text-sm animate-pulse", children: "Loading..." }) : p(w) }) })
1851
+ /* @__PURE__ */ e.jsx("div", { className: "pt-4", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: c ? /* @__PURE__ */ e.jsx(an, {}) : f(d) }) })
1745
1852
  ] })
1746
- ] })
1853
+ ] }),
1854
+ /* @__PURE__ */ e.jsx(
1855
+ Za,
1856
+ {
1857
+ page: p,
1858
+ onClose: () => h(null),
1859
+ onDelete: () => {
1860
+ h(null);
1861
+ }
1862
+ }
1863
+ ),
1864
+ /* @__PURE__ */ e.jsx(
1865
+ en,
1866
+ {
1867
+ page: b,
1868
+ onClose: () => w(null),
1869
+ onUnpublish: () => {
1870
+ w(null);
1871
+ }
1872
+ }
1873
+ )
1747
1874
  ] });
1748
- }, Wa = ({
1749
- editPage: r,
1875
+ };
1876
+ function an() {
1877
+ return /* @__PURE__ */ e.jsx("div", { className: "h-32 w-full flex justify-center items-center text-sm animate-pulse", children: "Loading..." });
1878
+ }
1879
+ const nn = ({
1880
+ editPage: a,
1750
1881
  showUpsertPage: i,
1751
- setShowUpsertPage: o
1882
+ setShowUpsertPage: l
1752
1883
  }) => {
1753
- const a = i.id, [s, w] = I(a && i.name || ""), [c, f] = I(a && i.slug || ""), { mutate: u, isPending: p } = Rt(), { mutate: g, isPending: m } = Me(), h = p || m, S = () => {
1754
- a ? g(
1884
+ const n = i.id, [s, d] = A(n && i.name || ""), [c, p] = A(n && i.slug || ""), { mutate: h, isPending: b } = Rt(), { mutate: w, isPending: f } = Ye(), C = b || f, T = () => {
1885
+ n ? w(
1755
1886
  {
1756
1887
  name: s,
1757
1888
  slug: c,
@@ -1760,66 +1891,66 @@ const $a = ({
1760
1891
  },
1761
1892
  {
1762
1893
  onSuccess: () => {
1763
- o(void 0);
1894
+ l(void 0);
1764
1895
  }
1765
1896
  }
1766
- ) : u(
1897
+ ) : h(
1767
1898
  {
1768
1899
  name: s,
1769
1900
  slug: c,
1770
1901
  global: !!i.global
1771
1902
  },
1772
1903
  {
1773
- onSuccess: (k) => {
1774
- r(k.id);
1904
+ onSuccess: (m) => {
1905
+ a(m.id);
1775
1906
  }
1776
1907
  }
1777
1908
  );
1778
1909
  };
1779
- return /* @__PURE__ */ t.jsx(
1780
- xt,
1910
+ return /* @__PURE__ */ e.jsx(
1911
+ be,
1781
1912
  {
1782
1913
  open: !!i,
1783
- onOpenChange: () => o(void 0),
1784
- children: /* @__PURE__ */ t.jsxs(bt, { className: "sm:max-w-[425px]", children: [
1785
- /* @__PURE__ */ t.jsxs(yt, { children: [
1786
- /* @__PURE__ */ t.jsxs(jt, { children: [
1787
- a ? "Edit" : "Add New",
1914
+ onOpenChange: () => l(void 0),
1915
+ children: /* @__PURE__ */ e.jsxs(ye, { className: "sm:max-w-[425px]", children: [
1916
+ /* @__PURE__ */ e.jsxs(je, { children: [
1917
+ /* @__PURE__ */ e.jsxs(we, { children: [
1918
+ n ? "Edit" : "Add New",
1788
1919
  " ",
1789
1920
  i.global ? "Global Block" : "Page"
1790
1921
  ] }),
1791
- /* @__PURE__ */ t.jsxs(wt, { children: [
1922
+ /* @__PURE__ */ e.jsxs(Ce, { children: [
1792
1923
  "Enter the details for the new",
1793
1924
  " ",
1794
1925
  i.global ? "global block. Identifier should be unique." : "page. Slug must start with /"
1795
1926
  ] })
1796
1927
  ] }),
1797
- /* @__PURE__ */ t.jsxs("form", { children: [
1798
- /* @__PURE__ */ t.jsxs("div", { className: "grid gap-4 py-4", children: [
1799
- /* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
1800
- /* @__PURE__ */ t.jsx(_, { htmlFor: "name", className: "text-right", children: "Name" }),
1801
- /* @__PURE__ */ t.jsx(
1802
- U,
1928
+ /* @__PURE__ */ e.jsxs("form", { children: [
1929
+ /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4 py-4", children: [
1930
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
1931
+ /* @__PURE__ */ e.jsx(R, { htmlFor: "name", className: "text-right", children: "Name" }),
1932
+ /* @__PURE__ */ e.jsx(
1933
+ G,
1803
1934
  {
1804
1935
  id: "name",
1805
1936
  value: s,
1806
1937
  placeholder: `Enter ${i.global ? "global block" : "page"} name`,
1807
- onChange: (k) => w(k.target.value),
1938
+ onChange: (m) => d(m.target.value),
1808
1939
  className: "col-span-3",
1809
1940
  required: !0
1810
1941
  }
1811
1942
  )
1812
1943
  ] }),
1813
- !i.global && /* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
1814
- /* @__PURE__ */ t.jsx(_, { htmlFor: "slug", className: "text-right", children: i.global ? "Identifier" : "Slug" }),
1815
- /* @__PURE__ */ t.jsx(
1816
- U,
1944
+ !i.global && /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
1945
+ /* @__PURE__ */ e.jsx(R, { htmlFor: "slug", className: "text-right", children: i.global ? "Identifier" : "Slug" }),
1946
+ /* @__PURE__ */ e.jsx(
1947
+ G,
1817
1948
  {
1818
1949
  id: "slug",
1819
1950
  value: c,
1820
- onChange: (k) => {
1821
- var E;
1822
- return f((E = k.target.value) == null ? void 0 : E.trim().toLowerCase());
1951
+ onChange: (m) => {
1952
+ var v;
1953
+ return p((v = m.target.value) == null ? void 0 : v.trim().toLowerCase());
1823
1954
  },
1824
1955
  className: "col-span-3",
1825
1956
  required: !0,
@@ -1830,13 +1961,13 @@ const $a = ({
1830
1961
  )
1831
1962
  ] })
1832
1963
  ] }),
1833
- /* @__PURE__ */ t.jsx(St, { children: /* @__PURE__ */ t.jsx(
1834
- B,
1964
+ /* @__PURE__ */ e.jsx(Se, { children: /* @__PURE__ */ e.jsx(
1965
+ _,
1835
1966
  {
1836
- onClick: S,
1967
+ onClick: T,
1837
1968
  type: "button",
1838
- disabled: h || !s || !i.global && !c.startsWith("/") || Fe(i.name, s) && Fe(i.slug, c),
1839
- children: h ? a ? "Updating..." : "Adding..." : i.global ? `${a ? "Update" : "Add"} global block` : `${a ? "Update" : "Add"} Page`
1969
+ disabled: C || !s || !i.global && !c.startsWith("/") || Ge(i.name, s) && Ge(i.slug, c),
1970
+ children: C ? n ? "Updating..." : "Adding..." : i.global ? `${n ? "Update" : "Add"} global block` : `${n ? "Update" : "Add"} Page`
1840
1971
  }
1841
1972
  ) })
1842
1973
  ] })
@@ -1844,37 +1975,37 @@ const $a = ({
1844
1975
  }
1845
1976
  );
1846
1977
  };
1847
- function za(r) {
1848
- const { activePage: i, canClose: o, open: a, close: s } = r, [, w] = H(), [c, f] = I(), u = (p) => {
1849
- window.history.pushState({}, "", `?page=${p}`), w(new URLSearchParams({ page: p })), window.dispatchEvent(new PopStateEvent("popstate")), f(void 0), s();
1978
+ function sn(a) {
1979
+ const { activePage: i, canClose: l, open: n, close: s } = a, [, d] = le(), [c, p] = A(), h = (b) => {
1980
+ window.history.pushState({}, "", `?page=${b}`), d(new URLSearchParams({ page: b })), window.dispatchEvent(new PopStateEvent("popstate")), p(void 0), s();
1850
1981
  };
1851
- return /* @__PURE__ */ t.jsx(
1852
- ya,
1982
+ return /* @__PURE__ */ e.jsx(
1983
+ ka,
1853
1984
  {
1854
- open: a,
1855
- onOpenChange: (p) => {
1856
- !p && o && s();
1985
+ open: n,
1986
+ onOpenChange: (b) => {
1987
+ !b && l && s();
1857
1988
  },
1858
- children: /* @__PURE__ */ t.jsxs(
1859
- ja,
1989
+ children: /* @__PURE__ */ e.jsxs(
1990
+ Ea,
1860
1991
  {
1861
1992
  side: "left",
1862
- className: `border-border w-full ${o ? "" : "sheet-hide-close-btn"}`,
1993
+ className: `border-border w-full ${l ? "" : "sheet-hide-close-btn"}`,
1863
1994
  children: [
1864
- /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
1865
- Va,
1995
+ /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
1996
+ tn,
1866
1997
  {
1867
- onShowUpsertPage: (p) => f(p),
1998
+ onShowUpsertPage: (b) => p(b),
1868
1999
  activePage: i,
1869
- editPage: u
2000
+ editPage: h
1870
2001
  }
1871
2002
  ) }),
1872
- c && /* @__PURE__ */ t.jsx(
1873
- Wa,
2003
+ c && /* @__PURE__ */ e.jsx(
2004
+ nn,
1874
2005
  {
1875
- editPage: u,
2006
+ editPage: h,
1876
2007
  showUpsertPage: c,
1877
- setShowUpsertPage: f
2008
+ setShowUpsertPage: p
1878
2009
  }
1879
2010
  )
1880
2011
  ]
@@ -1883,87 +2014,98 @@ function za(r) {
1883
2014
  }
1884
2015
  );
1885
2016
  }
1886
- ua();
1887
- const Ja = (r) => {
1888
- var ce;
1889
- const [i] = H(), o = i.get("page"), { data: a, isFetching: s } = _t(), { data: w } = Ia(), { data: c } = Tt(), { blocks: f, theme: u } = Ba(c), { data: p } = Ot(), { data: g } = qe(), m = Fa(), { uploadFile: h } = Ga(), { getUILibraryBlock: S, getUILibraryBlocks: k, onSave: E } = La(), { getGlobalBlocks: F, getGlobalBlockBlocks: D } = Ua(), { mutate: b, isPending: ie } = qa(), { aiContext: Q, updateAiContext: we } = Pt(), [Se, oe] = I(!1), [K, le] = I("SAVED");
1890
- Ie(() => {
1891
- const O = (T) => {
1892
- K === "UNSAVED" && (T.preventDefault(), T.returnValue = !1);
2017
+ ca();
2018
+ const rn = (a) => {
2019
+ const i = St([]), [l] = le(), n = l.get("page"), { data: s, isFetching: d } = _t(), { data: c } = Ka(), { data: p, isFetching: h } = Wa(), { blocks: b, theme: w } = Va(p), { data: f } = Ot(), { data: C } = Je(), T = qa(), { uploadFile: m } = Ja(), { getUILibraryBlock: v, getUILibraryBlocks: F, onSave: y } = $a(), { getGlobalBlocks: k, getGlobalBlockBlocks: ke } = za(), { mutate: Ee, isPending: oe } = Ya(), { aiContext: Q, setAiContext: Ne } = Ve();
2020
+ i.current = b;
2021
+ const [Te, X] = A(!1), [K, Pe] = A("SAVED");
2022
+ qe(() => {
2023
+ const E = (U) => {
2024
+ K === "UNSAVED" && (U.preventDefault(), U.returnValue = !1);
1893
2025
  };
1894
- return K === "UNSAVED" && window.addEventListener("beforeunload", O), () => {
1895
- window.removeEventListener("beforeunload", O);
2026
+ return K === "UNSAVED" && window.addEventListener("beforeunload", E), () => {
2027
+ window.removeEventListener("beforeunload", E);
1896
2028
  };
1897
2029
  }, [K]);
1898
- const Ee = je(() => {
1899
- const O = {};
1900
- return p != null && p.theme && (O.brandingOptions = p.theme), O;
1901
- }, [p]);
1902
- return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1903
- /* @__PURE__ */ t.jsx(
1904
- ha,
2030
+ const ce = ne(() => {
2031
+ const E = {};
2032
+ return f != null && f.theme && (E.brandingOptions = f.theme), E;
2033
+ }, [f]), I = ne(() => Array.isArray(a == null ? void 0 : a.uiLibraries) ? [...c, ...a == null ? void 0 : a.uiLibraries] : c, [c, a == null ? void 0 : a.uiLibraries]);
2034
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2035
+ /* @__PURE__ */ e.jsx(
2036
+ da,
1905
2037
  {
1906
- fallbackLang: r.fallbackLang || "en",
1907
- languages: Ue(g, "lang") || [],
1908
- translations: r.translations || {},
1909
- locale: r.locale || "en",
1910
- htmlDir: r.htmlDir || "ltr",
1911
- autoSaveSupport: r.autoSaveSupport || !1,
1912
- autoSaveInterval: r.autoSaveInterval || 15,
1913
- uploadMediaCallback: h,
1914
- onError: r.onError || console.error,
1915
- getGlobalBlockBlocks: D,
1916
- getGlobalBlocks: F,
1917
- blocks: f,
1918
- getUILibraryBlock: S,
1919
- getUILibraryBlocks: k,
1920
- brandingOptions: u,
1921
- uiLibraries: w,
1922
- saveAiContextCallback: async (O) => (await we({ page: o, aiContext: O }), !0),
1923
- onSaveStateChange: (O) => le(O),
2038
+ loading: h,
2039
+ ...a.fallbackLang && {
2040
+ fallbackLang: a.fallbackLang || "en"
2041
+ },
2042
+ ...a.languages && {
2043
+ languages: We(C, "lang") || []
2044
+ },
2045
+ translations: a.translations || {},
2046
+ locale: a.locale || "en",
2047
+ htmlDir: a.htmlDir || "ltr",
2048
+ autoSaveSupport: a.autoSaveSupport || !1,
2049
+ autoSaveInterval: a.autoSaveInterval || 15,
2050
+ uploadMediaCallback: m,
2051
+ onError: a.onError || console.error,
2052
+ getGlobalBlockBlocks: ke,
2053
+ getGlobalBlocks: k,
2054
+ blocks: b,
2055
+ getUILibraryBlock: v,
2056
+ getUILibraryBlocks: F,
2057
+ brandingOptions: w,
2058
+ uiLibraries: I,
2059
+ saveAiContextCallback: async (E) => {
2060
+ if (!n) return !0;
2061
+ const U = i.current, W = {
2062
+ _type: "@chai/ai-context",
2063
+ _value: vt(E) ? E : ""
2064
+ }, ue = [...U, W];
2065
+ return await y({ page: n, blocks: ue }), Ne(E), !0;
2066
+ },
2067
+ onSaveStateChange: (E) => Pe(E),
1924
2068
  aiContext: Q,
1925
- askAiCallBack: m,
1926
- onSave: async ({ blocks: O, themeConfiguration: T }) => {
1927
- if (!o) return !0;
1928
- const G = {
1929
- _type: "@chai/theme",
1930
- _value: T
1931
- }, M = {
2069
+ askAiCallBack: T,
2070
+ onSave: async ({ blocks: E }) => {
2071
+ if (!n) return !0;
2072
+ i.current = E;
2073
+ const U = {
1932
2074
  _type: "@chai/ai-context",
1933
- _value: Ae(Q) ? Q : ""
1934
- }, ue = [...O, G, M];
1935
- return await E({ page: o, blocks: ue }), !0;
2075
+ _value: vt(Q) ? Q : ""
2076
+ }, W = [...E, U];
2077
+ return await y({ page: n, blocks: W }), i.current = E, !0;
1936
2078
  },
1937
2079
  topBarComponents: {
1938
2080
  left: [
1939
- () => /* @__PURE__ */ t.jsxs(
1940
- B,
2081
+ () => /* @__PURE__ */ e.jsxs(
2082
+ _,
1941
2083
  {
1942
2084
  variant: "default",
1943
2085
  className: "flex justify-start max-w-[250px] items-center w-full space-x-2 py-1",
1944
- onClick: () => oe(!0),
2086
+ onClick: () => X(!0),
1945
2087
  children: [
1946
- be(a.slug, "/") ? /* @__PURE__ */ t.jsx(kt, { className: "h-4 w-4" }) : /* @__PURE__ */ t.jsx(Nt, { className: "h-4 w-4" }),
1947
- /* @__PURE__ */ t.jsx("span", { className: "truncate", children: (a == null ? void 0 : a.name) ?? "" }),
1948
- /* @__PURE__ */ t.jsx(Ea, { className: "h-4 w-4" })
2088
+ Pt(s.slug, "/") ? /* @__PURE__ */ e.jsx(Tt, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(Nt, { className: "h-4 w-4" }),
2089
+ /* @__PURE__ */ e.jsx("span", { className: "truncate", children: (s == null ? void 0 : s.name) ?? "" }),
2090
+ /* @__PURE__ */ e.jsx(Oa, { className: "h-4 w-4" })
1949
2091
  ]
1950
2092
  },
1951
2093
  "template-viewer"
1952
2094
  )
1953
2095
  ],
1954
2096
  right: [
1955
- () => /* @__PURE__ */ t.jsxs(
1956
- B,
2097
+ () => /* @__PURE__ */ e.jsxs(
2098
+ _,
1957
2099
  {
1958
- disabled: ie || K !== "SAVED",
2100
+ disabled: oe || K !== "SAVED",
1959
2101
  size: "sm",
1960
2102
  variant: "default",
1961
- onClick: () => b(o),
2103
+ onClick: () => Ee(n),
1962
2104
  children: [
1963
- /* @__PURE__ */ t.jsx(Ca, { className: "h-4 w-4" }),
2105
+ /* @__PURE__ */ e.jsx(Ra, { className: "h-4 w-4" }),
1964
2106
  "  ",
1965
2107
  " ",
1966
- ie ? "Publishing..." : "Publish"
2108
+ oe ? "Publishing..." : "Publish"
1967
2109
  ]
1968
2110
  }
1969
2111
  )
@@ -1971,11 +2113,11 @@ const Ja = (r) => {
1971
2113
  },
1972
2114
  sideBarComponents: {
1973
2115
  top: [
1974
- ...be(a.slug, "/") ? [
2116
+ ...s != null && s.global ? [] : [
1975
2117
  {
1976
2118
  label: "SEO Setting",
1977
- component: At,
1978
- icon: /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs(
2119
+ component: Ft,
2120
+ icon: /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
1979
2121
  "svg",
1980
2122
  {
1981
2123
  xmlns: "http://www.w3.org/2000/svg",
@@ -1984,25 +2126,25 @@ const Ja = (r) => {
1984
2126
  width: "21",
1985
2127
  height: "21",
1986
2128
  children: [
1987
- /* @__PURE__ */ t.jsx("path", { d: "M9.931 6.818c-1.238 0-2.136.925-2.136 2.2 0 1.279.898 2.207 2.136 2.207.664 0 1.257-.246 1.67-.694a.15.15 0 0 0-.009-.213l-.311-.286a.15.15 0 0 0-.213.009c-.273.297-.677.46-1.137.46-.699 0-1.233-.444-1.375-1.12h3.295a.15.15 0 0 0 .151-.151v-.211c0-1.295-.852-2.2-2.072-2.2m0 .724c.697 0 1.188.422 1.315 1.113h-2.69c.142-.673.676-1.113 1.374-1.113m4.332-.724c-1.246 0-2.15.925-2.15 2.2 0 1.279.904 2.207 2.15 2.207.596 0 1.143-.223 1.538-.628s.612-.965.612-1.579c0-1.275-.904-2.2-2.15-2.2m0 3.683c-.826 0-1.426-.624-1.426-1.483 0-.855.6-1.475 1.426-1.475s1.426.621 1.426 1.476c0 .423-.144.804-.406 1.073-.258.264-.62.41-1.019.41M6.318 8.71c-.665-.206-.902-.335-.902-.645 0-.47.564-.521.806-.521.29 0 .552.07.801.215a.15.15 0 0 0 .206-.055l.212-.366a.15.15 0 0 0-.055-.206 2.27 2.27 0 0 0-1.165-.312c-.915 0-1.53.501-1.53 1.245 0 .899.816 1.152 1.411 1.336.655.203.812.307.804.53-.016.398-.567.429-.735.429-.386 0-.722-.129-.972-.374q-.043-.042-.107-.043a.15.15 0 0 0-.106.045l-.295.302a.15.15 0 0 0 .002.213c.383.374.908.58 1.478.58.859 0 1.432-.441 1.459-1.125.031-.833-.746-1.074-1.313-1.249" }),
1988
- /* @__PURE__ */ t.jsx("path", { d: "M20.396 2.049H.604A.604.604 0 0 0 0 2.653v12.7c0 .333.27.604.604.604h6.941c-.266 1.296-.881 1.966-.886 1.971a.604.604 0 0 0 .434 1.024h6.815a.604.604 0 0 0 .434-1.024c-.007-.007-.621-.675-.886-1.971h6.941c.333 0 .604-.27.604-.604V2.652a.604.604 0 0 0-.604-.604m-.604 12.701h-.985v-.17a.604.604 0 0 0-1.208 0v.17h-.63v-.17a.604.604 0 0 0-1.208 0v.17H1.207V3.256h18.585z" })
2129
+ /* @__PURE__ */ e.jsx("path", { d: "M9.931 6.818c-1.238 0-2.136.925-2.136 2.2 0 1.279.898 2.207 2.136 2.207.664 0 1.257-.246 1.67-.694a.15.15 0 0 0-.009-.213l-.311-.286a.15.15 0 0 0-.213.009c-.273.297-.677.46-1.137.46-.699 0-1.233-.444-1.375-1.12h3.295a.15.15 0 0 0 .151-.151v-.211c0-1.295-.852-2.2-2.072-2.2m0 .724c.697 0 1.188.422 1.315 1.113h-2.69c.142-.673.676-1.113 1.374-1.113m4.332-.724c-1.246 0-2.15.925-2.15 2.2 0 1.279.904 2.207 2.15 2.207.596 0 1.143-.223 1.538-.628s.612-.965.612-1.579c0-1.275-.904-2.2-2.15-2.2m0 3.683c-.826 0-1.426-.624-1.426-1.483 0-.855.6-1.475 1.426-1.475s1.426.621 1.426 1.476c0 .423-.144.804-.406 1.073-.258.264-.62.41-1.019.41M6.318 8.71c-.665-.206-.902-.335-.902-.645 0-.47.564-.521.806-.521.29 0 .552.07.801.215a.15.15 0 0 0 .206-.055l.212-.366a.15.15 0 0 0-.055-.206 2.27 2.27 0 0 0-1.165-.312c-.915 0-1.53.501-1.53 1.245 0 .899.816 1.152 1.411 1.336.655.203.812.307.804.53-.016.398-.567.429-.735.429-.386 0-.722-.129-.972-.374q-.043-.042-.107-.043a.15.15 0 0 0-.106.045l-.295.302a.15.15 0 0 0 .002.213c.383.374.908.58 1.478.58.859 0 1.432-.441 1.459-1.125.031-.833-.746-1.074-1.313-1.249" }),
2130
+ /* @__PURE__ */ e.jsx("path", { d: "M20.396 2.049H.604A.604.604 0 0 0 0 2.653v12.7c0 .333.27.604.604.604h6.941c-.266 1.296-.881 1.966-.886 1.971a.604.604 0 0 0 .434 1.024h6.815a.604.604 0 0 0 .434-1.024c-.007-.007-.621-.675-.886-1.971h6.941c.333 0 .604-.27.604-.604V2.652a.604.604 0 0 0-.604-.604m-.604 12.701h-.985v-.17a.604.604 0 0 0-1.208 0v.17h-.63v-.17a.604.604 0 0 0-1.208 0v.17H1.207V3.256h18.585z" })
1989
2131
  ]
1990
2132
  }
1991
2133
  ) })
1992
2134
  }
1993
- ] : [],
1994
- ...(ce = r.languages) != null && ce.length && be(a.slug, "/") ? [
2135
+ ],
2136
+ ...(f == null ? void 0 : f.languages.length) > 0 ? [
1995
2137
  {
1996
2138
  label: "Language Pages",
1997
- component: Ka,
1998
- icon: /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
2139
+ component: Xa,
2140
+ icon: /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
1999
2141
  "svg",
2000
2142
  {
2001
2143
  width: "21",
2002
2144
  height: "21",
2003
2145
  viewBox: "0 0 21 21",
2004
2146
  fill: "currentColor",
2005
- children: /* @__PURE__ */ t.jsxs(
2147
+ children: /* @__PURE__ */ e.jsxs(
2006
2148
  "g",
2007
2149
  {
2008
2150
  fill: "none",
@@ -2011,10 +2153,10 @@ const Ja = (r) => {
2011
2153
  "stroke-linecap": "round",
2012
2154
  "stroke-linejoin": "round",
2013
2155
  children: [
2014
- /* @__PURE__ */ t.jsx("path", { d: "M18.5 10.5v-6a2 2 0 0 0-2-2h-6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2" }),
2015
- /* @__PURE__ */ t.jsx("path", { d: "M6.5 8.503h-2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h.003l6-.01a2 2 0 0 0 1.997-2V14.5" }),
2016
- /* @__PURE__ */ t.jsx("path", { d: "M7.5 12.503h-3M9 14l-1 1q-.5.5-2.5 1.5" }),
2017
- /* @__PURE__ */ t.jsx("path", { d: "M5.5 12.503q.501 1.75 1.5 2.499c1 .749 1.5.999 2.5 1.498m4-12-3 6m3-6 3 6m-1-2h-4" })
2156
+ /* @__PURE__ */ e.jsx("path", { d: "M18.5 10.5v-6a2 2 0 0 0-2-2h-6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2" }),
2157
+ /* @__PURE__ */ e.jsx("path", { d: "M6.5 8.503h-2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h.003l6-.01a2 2 0 0 0 1.997-2V14.5" }),
2158
+ /* @__PURE__ */ e.jsx("path", { d: "M7.5 12.503h-3M9 14l-1 1q-.5.5-2.5 1.5" }),
2159
+ /* @__PURE__ */ e.jsx("path", { d: "M5.5 12.503q.501 1.75 1.5 2.499c1 .749 1.5.999 2.5 1.498m4-12-3 6m3-6 3 6m-1-2h-4" })
2018
2160
  ]
2019
2161
  }
2020
2162
  )
@@ -2024,22 +2166,22 @@ const Ja = (r) => {
2024
2166
  ] : []
2025
2167
  ]
2026
2168
  },
2027
- ...Ee
2169
+ ...ce
2028
2170
  }
2029
2171
  ),
2030
- /* @__PURE__ */ t.jsx(
2031
- za,
2172
+ /* @__PURE__ */ e.jsx(
2173
+ sn,
2032
2174
  {
2033
- activePage: o || "",
2034
- canClose: !!o && !z(a),
2035
- open: !o || !s && z(a) || Se,
2036
- close: () => oe(!1)
2175
+ activePage: n || "",
2176
+ canClose: !!n && !q(s),
2177
+ open: !n || !d && q(s) || Te,
2178
+ close: () => X(!1)
2037
2179
  }
2038
2180
  )
2039
2181
  ] });
2040
- }, ft = new fa({
2182
+ }, jt = new ha({
2041
2183
  defaultOptions: { queries: { refetchOnWindowFocus: !1 } }
2042
- }), an = (r) => (ft.setQueryData(["builder_props"], r), /* @__PURE__ */ t.jsx(pa, { client: ft, children: /* @__PURE__ */ t.jsx(Ja, { ...r }) }));
2184
+ }), mn = (a) => (jt.setQueryData(["builder_props"], a), /* @__PURE__ */ e.jsx(fa, { client: jt, children: /* @__PURE__ */ e.jsx(rn, { ...a }) }));
2043
2185
  export {
2044
- an as default
2186
+ mn as default
2045
2187
  };