@chaibuilder/pages 0.1.0-beta.7 → 0.1.0-beta.8
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.cjs +10 -10
- package/dist/index.js +617 -587
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { loadWebBlocks as
|
|
3
|
-
import { getBlocksFromHTML as
|
|
4
|
-
import { useQueryClient as z, useQuery as ne, useMutation as re, QueryClient as
|
|
5
|
-
import { useToast as J, Accordion as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import { get as G, find as se, isString as Fe, filter as ae, isEmpty as
|
|
1
|
+
import gt, { useState as I, useEffect as Be, useCallback as ua, useMemo as ye, useRef as da } from "react";
|
|
2
|
+
import { loadWebBlocks as ha } from "@chaibuilder/sdk/web-blocks";
|
|
3
|
+
import { getBlocksFromHTML as fa, useLanguages as Ue, ChaiBuilderEditor as pa } from "@chaibuilder/sdk";
|
|
4
|
+
import { useQueryClient as z, useQuery as ne, useMutation as re, QueryClient as ga, QueryClientProvider as ma } from "@tanstack/react-query";
|
|
5
|
+
import { useToast as J, Accordion as xa, AccordionItem as pe, AccordionTrigger as ge, AccordionContent as me, Label as R, Input as U, Textarea as xe, Button as B, Popover as mt, PopoverTrigger as xt, PopoverContent as vt, Dialog as bt, DialogContent as yt, DialogHeader as jt, DialogTitle as wt, DialogDescription as St, DialogFooter as Ct, Tabs as va, TabsList as ba, TabsTrigger as ut, SheetHeader as ya, SheetDescription as ja, Sheet as wa, SheetContent as Sa } from "@chaibuilder/sdk/ui";
|
|
6
|
+
import { StarIcon as Ca, PencilIcon as Et, TrashIcon as kt, Plus as Ea, GlobeIcon as Nt, File as Tt, ArrowLeftRightIcon as ka, RocketIcon as Na } from "lucide-react";
|
|
7
|
+
import { get as G, find as se, isString as Fe, filter as ae, isEmpty as q, includes as ve, startCase as Ta, reverse as Pa, sortBy as _a, isEqual as Le, map as Ge, startsWith as dt, toLower as Oa, trim as Ra, orderBy as Aa } from "lodash-es";
|
|
8
8
|
var Ie = { exports: {} }, ee = {};
|
|
9
9
|
/**
|
|
10
10
|
* @license React
|
|
@@ -15,19 +15,19 @@ var Ie = { 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
|
|
19
|
-
function
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
function
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
for (
|
|
27
|
-
if (
|
|
28
|
-
return { $$typeof: i, type:
|
|
18
|
+
var ht;
|
|
19
|
+
function Da() {
|
|
20
|
+
if (ht) return ee;
|
|
21
|
+
ht = 1;
|
|
22
|
+
var n = gt, i = Symbol.for("react.element"), o = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, s = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
23
|
+
function d(f, u, g) {
|
|
24
|
+
var p, m = {}, c = null, y = null;
|
|
25
|
+
g !== void 0 && (c = "" + g), u.key !== void 0 && (c = "" + u.key), u.ref !== void 0 && (y = u.ref);
|
|
26
|
+
for (p in u) a.call(u, p) && !j.hasOwnProperty(p) && (m[p] = u[p]);
|
|
27
|
+
if (f && f.defaultProps) for (p in u = f.defaultProps, u) m[p] === void 0 && (m[p] = u[p]);
|
|
28
|
+
return { $$typeof: i, type: f, key: c, ref: y, props: m, _owner: s.current };
|
|
29
29
|
}
|
|
30
|
-
return ee.Fragment = o, ee.jsx =
|
|
30
|
+
return ee.Fragment = o, ee.jsx = d, ee.jsxs = d, ee;
|
|
31
31
|
}
|
|
32
32
|
var te = {};
|
|
33
33
|
/**
|
|
@@ -39,57 +39,57 @@ 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
|
|
43
|
-
function
|
|
44
|
-
return
|
|
45
|
-
var
|
|
46
|
-
function
|
|
42
|
+
var ft;
|
|
43
|
+
function Fa() {
|
|
44
|
+
return ft || (ft = 1, process.env.NODE_ENV !== "production" && function() {
|
|
45
|
+
var n = gt, i = Symbol.for("react.element"), o = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), f = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), c = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), _ = Symbol.iterator, S = "@@iterator";
|
|
46
|
+
function C(e) {
|
|
47
47
|
if (e === null || typeof e != "object")
|
|
48
48
|
return null;
|
|
49
|
-
var
|
|
50
|
-
return typeof
|
|
49
|
+
var r = _ && e[_] || e[S];
|
|
50
|
+
return typeof r == "function" ? r : null;
|
|
51
51
|
}
|
|
52
|
-
var
|
|
53
|
-
function
|
|
52
|
+
var T = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
53
|
+
function P(e) {
|
|
54
54
|
{
|
|
55
|
-
for (var
|
|
56
|
-
l[
|
|
55
|
+
for (var r = arguments.length, l = new Array(r > 1 ? r - 1 : 0), h = 1; h < r; h++)
|
|
56
|
+
l[h - 1] = arguments[h];
|
|
57
57
|
je("error", e, l);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function je(e,
|
|
60
|
+
function je(e, r, l) {
|
|
61
61
|
{
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
var
|
|
65
|
-
return String(
|
|
62
|
+
var h = T.ReactDebugCurrentFrame, b = h.getStackAddendum();
|
|
63
|
+
b !== "" && (r += "%s", l = l.concat([b]));
|
|
64
|
+
var w = l.map(function(v) {
|
|
65
|
+
return String(v);
|
|
66
66
|
});
|
|
67
|
-
|
|
67
|
+
w.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, w);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
var ie = !1, H = !1, we = !1, Se = !1, oe = !1,
|
|
71
|
-
|
|
72
|
-
function
|
|
73
|
-
return !!(typeof e == "string" || typeof e == "function" || e === a || e ===
|
|
70
|
+
var ie = !1, H = !1, we = !1, Se = !1, oe = !1, M;
|
|
71
|
+
M = Symbol.for("react.module.reference");
|
|
72
|
+
function Ce(e) {
|
|
73
|
+
return !!(typeof e == "string" || typeof e == "function" || e === a || e === j || oe || e === s || e === g || e === p || Se || e === y || ie || H || we || typeof e == "object" && e !== null && (e.$$typeof === c || e.$$typeof === m || e.$$typeof === d || e.$$typeof === f || e.$$typeof === u || // 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 ===
|
|
77
|
+
e.$$typeof === M || e.getModuleId !== void 0));
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
var
|
|
81
|
-
if (
|
|
82
|
-
return
|
|
83
|
-
var
|
|
84
|
-
return
|
|
79
|
+
function Ee(e, r, l) {
|
|
80
|
+
var h = e.displayName;
|
|
81
|
+
if (h)
|
|
82
|
+
return h;
|
|
83
|
+
var b = r.displayName || r.name || "";
|
|
84
|
+
return b !== "" ? l + "(" + b + ")" : l;
|
|
85
85
|
}
|
|
86
86
|
function Q(e) {
|
|
87
87
|
return e.displayName || "Context";
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function E(e) {
|
|
90
90
|
if (e == null)
|
|
91
91
|
return null;
|
|
92
|
-
if (typeof e.tag == "number" &&
|
|
92
|
+
if (typeof e.tag == "number" && P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
93
93
|
return e.displayName || e.name || null;
|
|
94
94
|
if (typeof e == "string")
|
|
95
95
|
return e;
|
|
@@ -98,32 +98,32 @@ function Da() {
|
|
|
98
98
|
return "Fragment";
|
|
99
99
|
case o:
|
|
100
100
|
return "Portal";
|
|
101
|
-
case
|
|
101
|
+
case j:
|
|
102
102
|
return "Profiler";
|
|
103
103
|
case s:
|
|
104
104
|
return "StrictMode";
|
|
105
|
-
case
|
|
105
|
+
case g:
|
|
106
106
|
return "Suspense";
|
|
107
|
-
case
|
|
107
|
+
case p:
|
|
108
108
|
return "SuspenseList";
|
|
109
109
|
}
|
|
110
110
|
if (typeof e == "object")
|
|
111
111
|
switch (e.$$typeof) {
|
|
112
|
-
case
|
|
113
|
-
var
|
|
114
|
-
return Q(
|
|
115
|
-
case
|
|
112
|
+
case f:
|
|
113
|
+
var r = e;
|
|
114
|
+
return Q(r) + ".Consumer";
|
|
115
|
+
case d:
|
|
116
116
|
var l = e;
|
|
117
117
|
return Q(l._context) + ".Provider";
|
|
118
118
|
case u:
|
|
119
|
-
return
|
|
120
|
-
case
|
|
121
|
-
var
|
|
122
|
-
return
|
|
123
|
-
case
|
|
124
|
-
var
|
|
119
|
+
return Ee(e, e.render, "ForwardRef");
|
|
120
|
+
case m:
|
|
121
|
+
var h = e.displayName || null;
|
|
122
|
+
return h !== null ? h : E(e.type) || "Memo";
|
|
123
|
+
case c: {
|
|
124
|
+
var b = e, w = b._payload, v = b._init;
|
|
125
125
|
try {
|
|
126
|
-
return
|
|
126
|
+
return E(v(w));
|
|
127
127
|
} catch {
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
@@ -131,14 +131,14 @@ function Da() {
|
|
|
131
131
|
}
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
|
-
var F = Object.assign,
|
|
134
|
+
var F = Object.assign, $ = 0, le, ce, Ke, We, Ve, ze, Je;
|
|
135
135
|
function Ye() {
|
|
136
136
|
}
|
|
137
137
|
Ye.__reactDisabledLog = !0;
|
|
138
|
-
function
|
|
138
|
+
function It() {
|
|
139
139
|
{
|
|
140
|
-
if (
|
|
141
|
-
le = console.log, ce = console.info, Ke = console.warn,
|
|
140
|
+
if ($ === 0) {
|
|
141
|
+
le = console.log, ce = console.info, Ke = console.warn, We = console.error, Ve = console.group, ze = console.groupCollapsed, Je = console.groupEnd;
|
|
142
142
|
var e = {
|
|
143
143
|
configurable: !0,
|
|
144
144
|
enumerable: !0,
|
|
@@ -155,12 +155,12 @@ function Da() {
|
|
|
155
155
|
groupEnd: e
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
$++;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function Bt() {
|
|
162
162
|
{
|
|
163
|
-
if (
|
|
163
|
+
if ($--, $ === 0) {
|
|
164
164
|
var e = {
|
|
165
165
|
configurable: !0,
|
|
166
166
|
enumerable: !0,
|
|
@@ -177,10 +177,10 @@ function Da() {
|
|
|
177
177
|
value: Ke
|
|
178
178
|
}),
|
|
179
179
|
error: F({}, e, {
|
|
180
|
-
value:
|
|
180
|
+
value: We
|
|
181
181
|
}),
|
|
182
182
|
group: F({}, e, {
|
|
183
|
-
value:
|
|
183
|
+
value: Ve
|
|
184
184
|
}),
|
|
185
185
|
groupCollapsed: F({}, e, {
|
|
186
186
|
value: ze
|
|
@@ -190,18 +190,18 @@ function Da() {
|
|
|
190
190
|
})
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
$ < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
var ke =
|
|
197
|
-
function ue(e,
|
|
196
|
+
var ke = T.ReactCurrentDispatcher, Ne;
|
|
197
|
+
function ue(e, r, l) {
|
|
198
198
|
{
|
|
199
199
|
if (Ne === void 0)
|
|
200
200
|
try {
|
|
201
201
|
throw Error();
|
|
202
|
-
} catch (
|
|
203
|
-
var
|
|
204
|
-
Ne =
|
|
202
|
+
} catch (b) {
|
|
203
|
+
var h = b.stack.trim().match(/\n( *(at )?)/);
|
|
204
|
+
Ne = h && h[1] || "";
|
|
205
205
|
}
|
|
206
206
|
return `
|
|
207
207
|
` + Ne + e;
|
|
@@ -209,10 +209,10 @@ function Da() {
|
|
|
209
209
|
}
|
|
210
210
|
var Te = !1, de;
|
|
211
211
|
{
|
|
212
|
-
var
|
|
213
|
-
de = new
|
|
212
|
+
var Ut = typeof WeakMap == "function" ? WeakMap : Map;
|
|
213
|
+
de = new Ut();
|
|
214
214
|
}
|
|
215
|
-
function He(e,
|
|
215
|
+
function He(e, r) {
|
|
216
216
|
if (!e || Te)
|
|
217
217
|
return "";
|
|
218
218
|
{
|
|
@@ -220,57 +220,57 @@ function Da() {
|
|
|
220
220
|
if (l !== void 0)
|
|
221
221
|
return l;
|
|
222
222
|
}
|
|
223
|
-
var
|
|
223
|
+
var h;
|
|
224
224
|
Te = !0;
|
|
225
|
-
var
|
|
225
|
+
var b = Error.prepareStackTrace;
|
|
226
226
|
Error.prepareStackTrace = void 0;
|
|
227
|
-
var
|
|
228
|
-
|
|
227
|
+
var w;
|
|
228
|
+
w = ke.current, ke.current = null, It();
|
|
229
229
|
try {
|
|
230
|
-
if (
|
|
231
|
-
var
|
|
230
|
+
if (r) {
|
|
231
|
+
var v = function() {
|
|
232
232
|
throw Error();
|
|
233
233
|
};
|
|
234
|
-
if (Object.defineProperty(
|
|
234
|
+
if (Object.defineProperty(v.prototype, "props", {
|
|
235
235
|
set: function() {
|
|
236
236
|
throw Error();
|
|
237
237
|
}
|
|
238
238
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
239
239
|
try {
|
|
240
|
-
Reflect.construct(
|
|
241
|
-
} catch (
|
|
242
|
-
|
|
240
|
+
Reflect.construct(v, []);
|
|
241
|
+
} catch (A) {
|
|
242
|
+
h = A;
|
|
243
243
|
}
|
|
244
|
-
Reflect.construct(e, [],
|
|
244
|
+
Reflect.construct(e, [], v);
|
|
245
245
|
} else {
|
|
246
246
|
try {
|
|
247
|
-
|
|
248
|
-
} catch (
|
|
249
|
-
|
|
247
|
+
v.call();
|
|
248
|
+
} catch (A) {
|
|
249
|
+
h = A;
|
|
250
250
|
}
|
|
251
|
-
e.call(
|
|
251
|
+
e.call(v.prototype);
|
|
252
252
|
}
|
|
253
253
|
} else {
|
|
254
254
|
try {
|
|
255
255
|
throw Error();
|
|
256
|
-
} catch (
|
|
257
|
-
|
|
256
|
+
} catch (A) {
|
|
257
|
+
h = A;
|
|
258
258
|
}
|
|
259
259
|
e();
|
|
260
260
|
}
|
|
261
|
-
} catch (
|
|
262
|
-
if (
|
|
263
|
-
for (var
|
|
264
|
-
`),
|
|
265
|
-
`), k =
|
|
261
|
+
} catch (A) {
|
|
262
|
+
if (A && h && typeof A.stack == "string") {
|
|
263
|
+
for (var x = A.stack.split(`
|
|
264
|
+
`), O = h.stack.split(`
|
|
265
|
+
`), k = x.length - 1, N = O.length - 1; k >= 1 && N >= 0 && x[k] !== O[N]; )
|
|
266
266
|
N--;
|
|
267
267
|
for (; k >= 1 && N >= 0; k--, N--)
|
|
268
|
-
if (
|
|
268
|
+
if (x[k] !== O[N]) {
|
|
269
269
|
if (k !== 1 || N !== 1)
|
|
270
270
|
do
|
|
271
|
-
if (k--, N--, N < 0 ||
|
|
271
|
+
if (k--, N--, N < 0 || x[k] !== O[N]) {
|
|
272
272
|
var L = `
|
|
273
|
-
` +
|
|
273
|
+
` + x[k].replace(" at new ", " at ");
|
|
274
274
|
return e.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", e.displayName)), typeof e == "function" && de.set(e, L), L;
|
|
275
275
|
}
|
|
276
276
|
while (k >= 1 && N >= 0);
|
|
@@ -278,85 +278,85 @@ function Da() {
|
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
} finally {
|
|
281
|
-
Te = !1, ke.current =
|
|
281
|
+
Te = !1, ke.current = w, Bt(), Error.prepareStackTrace = b;
|
|
282
282
|
}
|
|
283
|
-
var V = e ? e.displayName || e.name : "",
|
|
284
|
-
return typeof e == "function" && de.set(e,
|
|
283
|
+
var V = e ? e.displayName || e.name : "", K = V ? ue(V) : "";
|
|
284
|
+
return typeof e == "function" && de.set(e, K), K;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function Gt(e, r, l) {
|
|
287
287
|
return He(e, !1);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
var
|
|
291
|
-
return !!(
|
|
289
|
+
function qt(e) {
|
|
290
|
+
var r = e.prototype;
|
|
291
|
+
return !!(r && r.isReactComponent);
|
|
292
292
|
}
|
|
293
|
-
function he(e,
|
|
293
|
+
function he(e, r, l) {
|
|
294
294
|
if (e == null)
|
|
295
295
|
return "";
|
|
296
296
|
if (typeof e == "function")
|
|
297
|
-
return He(e,
|
|
297
|
+
return He(e, qt(e));
|
|
298
298
|
if (typeof e == "string")
|
|
299
299
|
return ue(e);
|
|
300
300
|
switch (e) {
|
|
301
|
-
case
|
|
301
|
+
case g:
|
|
302
302
|
return ue("Suspense");
|
|
303
|
-
case
|
|
303
|
+
case p:
|
|
304
304
|
return ue("SuspenseList");
|
|
305
305
|
}
|
|
306
306
|
if (typeof e == "object")
|
|
307
307
|
switch (e.$$typeof) {
|
|
308
308
|
case u:
|
|
309
|
-
return
|
|
310
|
-
case
|
|
311
|
-
return he(e.type,
|
|
312
|
-
case
|
|
313
|
-
var
|
|
309
|
+
return Gt(e.render);
|
|
310
|
+
case m:
|
|
311
|
+
return he(e.type, r, l);
|
|
312
|
+
case c: {
|
|
313
|
+
var h = e, b = h._payload, w = h._init;
|
|
314
314
|
try {
|
|
315
|
-
return he(
|
|
315
|
+
return he(w(b), r, l);
|
|
316
316
|
} catch {
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
return "";
|
|
321
321
|
}
|
|
322
|
-
var X = Object.prototype.hasOwnProperty, Qe = {}, Xe =
|
|
322
|
+
var X = Object.prototype.hasOwnProperty, Qe = {}, Xe = T.ReactDebugCurrentFrame;
|
|
323
323
|
function fe(e) {
|
|
324
324
|
if (e) {
|
|
325
|
-
var
|
|
325
|
+
var r = e._owner, l = he(e.type, e._source, r ? r.type : null);
|
|
326
326
|
Xe.setExtraStackFrame(l);
|
|
327
327
|
} else
|
|
328
328
|
Xe.setExtraStackFrame(null);
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function Mt(e, r, l, h, b) {
|
|
331
331
|
{
|
|
332
|
-
var
|
|
333
|
-
for (var
|
|
334
|
-
if (
|
|
335
|
-
var
|
|
332
|
+
var w = Function.call.bind(X);
|
|
333
|
+
for (var v in e)
|
|
334
|
+
if (w(e, v)) {
|
|
335
|
+
var x = void 0;
|
|
336
336
|
try {
|
|
337
|
-
if (typeof e[
|
|
338
|
-
var
|
|
339
|
-
throw
|
|
337
|
+
if (typeof e[v] != "function") {
|
|
338
|
+
var O = Error((h || "React class") + ": " + l + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
339
|
+
throw O.name = "Invariant Violation", O;
|
|
340
340
|
}
|
|
341
|
-
|
|
341
|
+
x = e[v](r, v, h, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
342
342
|
} catch (k) {
|
|
343
|
-
|
|
343
|
+
x = k;
|
|
344
344
|
}
|
|
345
|
-
|
|
345
|
+
x && !(x instanceof Error) && (fe(b), P("%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).", h || "React class", l, v, typeof x), fe(null)), x instanceof Error && !(x.message in Qe) && (Qe[x.message] = !0, fe(b), P("Failed %s type: %s", l, x.message), fe(null));
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
var
|
|
349
|
+
var $t = Array.isArray;
|
|
350
350
|
function Pe(e) {
|
|
351
|
-
return
|
|
351
|
+
return $t(e);
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Kt(e) {
|
|
354
354
|
{
|
|
355
|
-
var
|
|
355
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, l = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
356
356
|
return l;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Wt(e) {
|
|
360
360
|
try {
|
|
361
361
|
return Ze(e), !1;
|
|
362
362
|
} catch {
|
|
@@ -367,42 +367,42 @@ function Da() {
|
|
|
367
367
|
return "" + e;
|
|
368
368
|
}
|
|
369
369
|
function et(e) {
|
|
370
|
-
if (
|
|
371
|
-
return
|
|
370
|
+
if (Wt(e))
|
|
371
|
+
return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Kt(e)), Ze(e);
|
|
372
372
|
}
|
|
373
|
-
var Z =
|
|
373
|
+
var Z = T.ReactCurrentOwner, Vt = {
|
|
374
374
|
key: !0,
|
|
375
375
|
ref: !0,
|
|
376
376
|
__self: !0,
|
|
377
377
|
__source: !0
|
|
378
378
|
}, tt, at, _e;
|
|
379
379
|
_e = {};
|
|
380
|
-
function
|
|
380
|
+
function zt(e) {
|
|
381
381
|
if (X.call(e, "ref")) {
|
|
382
|
-
var
|
|
383
|
-
if (
|
|
382
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
383
|
+
if (r && r.isReactWarning)
|
|
384
384
|
return !1;
|
|
385
385
|
}
|
|
386
386
|
return e.ref !== void 0;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function Jt(e) {
|
|
389
389
|
if (X.call(e, "key")) {
|
|
390
|
-
var
|
|
391
|
-
if (
|
|
390
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
391
|
+
if (r && r.isReactWarning)
|
|
392
392
|
return !1;
|
|
393
393
|
}
|
|
394
394
|
return e.key !== void 0;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
397
|
-
if (typeof e.ref == "string" && Z.current &&
|
|
398
|
-
var l =
|
|
399
|
-
_e[l] || (
|
|
396
|
+
function Yt(e, r) {
|
|
397
|
+
if (typeof e.ref == "string" && Z.current && r && Z.current.stateNode !== r) {
|
|
398
|
+
var l = E(Z.current.type);
|
|
399
|
+
_e[l] || (P('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', E(Z.current.type), e.ref), _e[l] = !0);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function Ht(e, r) {
|
|
403
403
|
{
|
|
404
404
|
var l = function() {
|
|
405
|
-
tt || (tt = !0,
|
|
405
|
+
tt || (tt = !0, P("%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
407
|
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
408
408
|
get: l,
|
|
@@ -410,10 +410,10 @@ function Da() {
|
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function Qt(e, r) {
|
|
414
414
|
{
|
|
415
415
|
var l = function() {
|
|
416
|
-
at || (at = !0,
|
|
416
|
+
at || (at = !0, P("%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
418
|
l.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
419
419
|
get: l,
|
|
@@ -421,70 +421,70 @@ function Da() {
|
|
|
421
421
|
});
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
var
|
|
425
|
-
var
|
|
424
|
+
var Xt = function(e, r, l, h, b, w, v) {
|
|
425
|
+
var x = {
|
|
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
429
|
type: e,
|
|
430
|
-
key:
|
|
430
|
+
key: r,
|
|
431
431
|
ref: l,
|
|
432
|
-
props:
|
|
432
|
+
props: v,
|
|
433
433
|
// Record the component responsible for creating this element.
|
|
434
|
-
_owner:
|
|
434
|
+
_owner: w
|
|
435
435
|
};
|
|
436
|
-
return
|
|
436
|
+
return x._store = {}, Object.defineProperty(x._store, "validated", {
|
|
437
437
|
configurable: !1,
|
|
438
438
|
enumerable: !1,
|
|
439
439
|
writable: !0,
|
|
440
440
|
value: !1
|
|
441
|
-
}), Object.defineProperty(
|
|
441
|
+
}), Object.defineProperty(x, "_self", {
|
|
442
442
|
configurable: !1,
|
|
443
443
|
enumerable: !1,
|
|
444
444
|
writable: !1,
|
|
445
|
-
value:
|
|
446
|
-
}), Object.defineProperty(
|
|
445
|
+
value: h
|
|
446
|
+
}), Object.defineProperty(x, "_source", {
|
|
447
447
|
configurable: !1,
|
|
448
448
|
enumerable: !1,
|
|
449
449
|
writable: !1,
|
|
450
|
-
value:
|
|
451
|
-
}), Object.freeze && (Object.freeze(
|
|
450
|
+
value: b
|
|
451
|
+
}), Object.freeze && (Object.freeze(x.props), Object.freeze(x)), x;
|
|
452
452
|
};
|
|
453
|
-
function
|
|
453
|
+
function Zt(e, r, l, h, b) {
|
|
454
454
|
{
|
|
455
|
-
var
|
|
456
|
-
l !== void 0 && (et(l),
|
|
457
|
-
for (
|
|
458
|
-
X.call(
|
|
455
|
+
var w, v = {}, x = null, O = null;
|
|
456
|
+
l !== void 0 && (et(l), x = "" + l), Jt(r) && (et(r.key), x = "" + r.key), zt(r) && (O = r.ref, Yt(r, b));
|
|
457
|
+
for (w in r)
|
|
458
|
+
X.call(r, w) && !Vt.hasOwnProperty(w) && (v[w] = r[w]);
|
|
459
459
|
if (e && e.defaultProps) {
|
|
460
460
|
var k = e.defaultProps;
|
|
461
|
-
for (
|
|
462
|
-
|
|
461
|
+
for (w in k)
|
|
462
|
+
v[w] === void 0 && (v[w] = k[w]);
|
|
463
463
|
}
|
|
464
|
-
if (
|
|
464
|
+
if (x || O) {
|
|
465
465
|
var N = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
466
|
-
|
|
466
|
+
x && Ht(v, N), O && Qt(v, N);
|
|
467
467
|
}
|
|
468
|
-
return
|
|
468
|
+
return Xt(e, x, O, b, h, Z.current, v);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
var Oe =
|
|
472
|
-
function
|
|
471
|
+
var Oe = T.ReactCurrentOwner, nt = T.ReactDebugCurrentFrame;
|
|
472
|
+
function W(e) {
|
|
473
473
|
if (e) {
|
|
474
|
-
var
|
|
474
|
+
var r = e._owner, l = he(e.type, e._source, r ? r.type : null);
|
|
475
475
|
nt.setExtraStackFrame(l);
|
|
476
476
|
} else
|
|
477
477
|
nt.setExtraStackFrame(null);
|
|
478
478
|
}
|
|
479
479
|
var Re;
|
|
480
480
|
Re = !1;
|
|
481
|
-
function
|
|
481
|
+
function Ae(e) {
|
|
482
482
|
return typeof e == "object" && e !== null && e.$$typeof === i;
|
|
483
483
|
}
|
|
484
484
|
function rt() {
|
|
485
485
|
{
|
|
486
486
|
if (Oe.current) {
|
|
487
|
-
var e =
|
|
487
|
+
var e = E(Oe.current.type);
|
|
488
488
|
if (e)
|
|
489
489
|
return `
|
|
490
490
|
|
|
@@ -493,154 +493,154 @@ Check the render method of \`` + e + "`.";
|
|
|
493
493
|
return "";
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function ea(e) {
|
|
497
497
|
return "";
|
|
498
498
|
}
|
|
499
499
|
var st = {};
|
|
500
|
-
function
|
|
500
|
+
function ta(e) {
|
|
501
501
|
{
|
|
502
|
-
var
|
|
503
|
-
if (!
|
|
502
|
+
var r = rt();
|
|
503
|
+
if (!r) {
|
|
504
504
|
var l = typeof e == "string" ? e : e.displayName || e.name;
|
|
505
|
-
l && (
|
|
505
|
+
l && (r = `
|
|
506
506
|
|
|
507
507
|
Check the top-level render call using <` + l + ">.");
|
|
508
508
|
}
|
|
509
|
-
return
|
|
509
|
+
return r;
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
function it(e,
|
|
512
|
+
function it(e, r) {
|
|
513
513
|
{
|
|
514
514
|
if (!e._store || e._store.validated || e.key != null)
|
|
515
515
|
return;
|
|
516
516
|
e._store.validated = !0;
|
|
517
|
-
var l =
|
|
517
|
+
var l = ta(r);
|
|
518
518
|
if (st[l])
|
|
519
519
|
return;
|
|
520
520
|
st[l] = !0;
|
|
521
|
-
var
|
|
522
|
-
e && e._owner && e._owner !== Oe.current && (
|
|
521
|
+
var h = "";
|
|
522
|
+
e && e._owner && e._owner !== Oe.current && (h = " It was passed a child from " + E(e._owner.type) + "."), W(e), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, h), W(null);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function ot(e,
|
|
525
|
+
function ot(e, r) {
|
|
526
526
|
{
|
|
527
527
|
if (typeof e != "object")
|
|
528
528
|
return;
|
|
529
529
|
if (Pe(e))
|
|
530
530
|
for (var l = 0; l < e.length; l++) {
|
|
531
|
-
var
|
|
532
|
-
|
|
531
|
+
var h = e[l];
|
|
532
|
+
Ae(h) && it(h, r);
|
|
533
533
|
}
|
|
534
|
-
else if (
|
|
534
|
+
else if (Ae(e))
|
|
535
535
|
e._store && (e._store.validated = !0);
|
|
536
536
|
else if (e) {
|
|
537
|
-
var
|
|
538
|
-
if (typeof
|
|
539
|
-
for (var
|
|
540
|
-
|
|
537
|
+
var b = C(e);
|
|
538
|
+
if (typeof b == "function" && b !== e.entries)
|
|
539
|
+
for (var w = b.call(e), v; !(v = w.next()).done; )
|
|
540
|
+
Ae(v.value) && it(v.value, r);
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function aa(e) {
|
|
545
545
|
{
|
|
546
|
-
var
|
|
547
|
-
if (
|
|
546
|
+
var r = e.type;
|
|
547
|
+
if (r == null || typeof r == "string")
|
|
548
548
|
return;
|
|
549
549
|
var l;
|
|
550
|
-
if (typeof
|
|
551
|
-
l =
|
|
552
|
-
else if (typeof
|
|
550
|
+
if (typeof r == "function")
|
|
551
|
+
l = r.propTypes;
|
|
552
|
+
else if (typeof r == "object" && (r.$$typeof === u || // Note: Memo only checks outer props here.
|
|
553
553
|
// Inner props are checked in the reconciler.
|
|
554
|
-
|
|
555
|
-
l =
|
|
554
|
+
r.$$typeof === m))
|
|
555
|
+
l = r.propTypes;
|
|
556
556
|
else
|
|
557
557
|
return;
|
|
558
558
|
if (l) {
|
|
559
|
-
var
|
|
560
|
-
|
|
561
|
-
} else if (
|
|
559
|
+
var h = E(r);
|
|
560
|
+
Mt(l, e.props, "prop", h, e);
|
|
561
|
+
} else if (r.PropTypes !== void 0 && !Re) {
|
|
562
562
|
Re = !0;
|
|
563
|
-
var
|
|
564
|
-
|
|
563
|
+
var b = E(r);
|
|
564
|
+
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
|
|
565
565
|
}
|
|
566
|
-
typeof
|
|
566
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function na(e) {
|
|
570
570
|
{
|
|
571
|
-
for (var
|
|
572
|
-
var
|
|
573
|
-
if (
|
|
574
|
-
|
|
571
|
+
for (var r = Object.keys(e.props), l = 0; l < r.length; l++) {
|
|
572
|
+
var h = r[l];
|
|
573
|
+
if (h !== "children" && h !== "key") {
|
|
574
|
+
W(e), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", h), W(null);
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
|
-
e.ref !== null && (
|
|
578
|
+
e.ref !== null && (W(e), P("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
581
|
var lt = {};
|
|
582
|
-
function ct(e,
|
|
582
|
+
function ct(e, r, l, h, b, w) {
|
|
583
583
|
{
|
|
584
|
-
var
|
|
585
|
-
if (!
|
|
586
|
-
var
|
|
587
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
588
|
-
var
|
|
589
|
-
|
|
584
|
+
var v = Ce(e);
|
|
585
|
+
if (!v) {
|
|
586
|
+
var x = "";
|
|
587
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (x += " 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 = ea();
|
|
589
|
+
O ? x += O : x += rt();
|
|
590
590
|
var k;
|
|
591
|
-
e === null ? k = "null" : Pe(e) ? k = "array" : e !== void 0 && e.$$typeof === i ? (k = "<" + (
|
|
591
|
+
e === null ? k = "null" : Pe(e) ? k = "array" : e !== void 0 && e.$$typeof === i ? (k = "<" + (E(e.type) || "Unknown") + " />", x = " Did you accidentally export a JSX literal instead of a component?") : k = typeof e, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", k, x);
|
|
592
592
|
}
|
|
593
|
-
var N =
|
|
593
|
+
var N = Zt(e, r, l, b, w);
|
|
594
594
|
if (N == null)
|
|
595
595
|
return N;
|
|
596
|
-
if (
|
|
597
|
-
var L =
|
|
596
|
+
if (v) {
|
|
597
|
+
var L = r.children;
|
|
598
598
|
if (L !== void 0)
|
|
599
|
-
if (
|
|
599
|
+
if (h)
|
|
600
600
|
if (Pe(L)) {
|
|
601
601
|
for (var V = 0; V < L.length; V++)
|
|
602
602
|
ot(L[V], e);
|
|
603
603
|
Object.freeze && Object.freeze(L);
|
|
604
604
|
} else
|
|
605
|
-
|
|
605
|
+
P("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
607
|
ot(L, e);
|
|
608
608
|
}
|
|
609
|
-
if (X.call(
|
|
610
|
-
var
|
|
611
|
-
return
|
|
612
|
-
}),
|
|
613
|
-
if (!lt[
|
|
614
|
-
var
|
|
615
|
-
|
|
609
|
+
if (X.call(r, "key")) {
|
|
610
|
+
var K = E(e), A = Object.keys(r).filter(function(ca) {
|
|
611
|
+
return ca !== "key";
|
|
612
|
+
}), De = A.length > 0 ? "{key: someKey, " + A.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
613
|
+
if (!lt[K + De]) {
|
|
614
|
+
var la = A.length > 0 ? "{" + A.join(": ..., ") + ": ...}" : "{}";
|
|
615
|
+
P(`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} />`,
|
|
620
|
+
<%s key={someKey} {...props} />`, De, K, la, K), lt[K + De] = !0;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
return e === a ?
|
|
623
|
+
return e === a ? na(N) : aa(N), N;
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
function
|
|
627
|
-
return ct(e,
|
|
626
|
+
function ra(e, r, l) {
|
|
627
|
+
return ct(e, r, l, !0);
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
return ct(e,
|
|
629
|
+
function sa(e, r, l) {
|
|
630
|
+
return ct(e, r, l, !1);
|
|
631
631
|
}
|
|
632
|
-
var
|
|
633
|
-
te.Fragment = a, te.jsx =
|
|
632
|
+
var ia = sa, oa = ra;
|
|
633
|
+
te.Fragment = a, te.jsx = ia, te.jsxs = oa;
|
|
634
634
|
}()), te;
|
|
635
635
|
}
|
|
636
|
-
process.env.NODE_ENV === "production" ? Ie.exports =
|
|
636
|
+
process.env.NODE_ENV === "production" ? Ie.exports = Da() : Ie.exports = Fa();
|
|
637
637
|
var t = Ie.exports;
|
|
638
|
-
const
|
|
638
|
+
const La = (n, i) => {
|
|
639
639
|
const a = z().getQueryData(["builder_props"]);
|
|
640
|
-
return G(a,
|
|
641
|
-
}, D = () =>
|
|
640
|
+
return G(a, n, i);
|
|
641
|
+
}, D = () => La("apiUrl", "/chai/api");
|
|
642
642
|
function Y() {
|
|
643
|
-
const [
|
|
643
|
+
const [n, i] = I(
|
|
644
644
|
new URLSearchParams(window.location.search)
|
|
645
645
|
);
|
|
646
646
|
return Be(() => {
|
|
@@ -650,10 +650,10 @@ function Y() {
|
|
|
650
650
|
return window.addEventListener("popstate", o), () => {
|
|
651
651
|
window.removeEventListener("popstate", o);
|
|
652
652
|
};
|
|
653
|
-
}, []), [
|
|
653
|
+
}, []), [n, i];
|
|
654
654
|
}
|
|
655
|
-
const
|
|
656
|
-
const [
|
|
655
|
+
const Pt = () => {
|
|
656
|
+
const [n] = Y(), i = n.get("page"), o = D();
|
|
657
657
|
return ne({
|
|
658
658
|
queryKey: ["page", i],
|
|
659
659
|
initialData: [],
|
|
@@ -667,39 +667,39 @@ const Tt = () => {
|
|
|
667
667
|
})).json()).blocks ?? [],
|
|
668
668
|
enabled: !!i
|
|
669
669
|
});
|
|
670
|
-
},
|
|
671
|
-
const
|
|
670
|
+
}, _t = () => {
|
|
671
|
+
const n = D(), i = z(), { toast: o } = J(), { data: a } = Pt(), [s] = Y(), j = s.get("page"), d = G(
|
|
672
672
|
se(a, { _type: "@chai/ai-context" }),
|
|
673
673
|
"_value",
|
|
674
674
|
""
|
|
675
|
-
), { mutateAsync:
|
|
676
|
-
mutationFn: async ({ page: u, aiContext:
|
|
677
|
-
const
|
|
675
|
+
), { mutateAsync: f } = re({
|
|
676
|
+
mutationFn: async ({ page: u, aiContext: g }) => {
|
|
677
|
+
const p = {
|
|
678
678
|
_type: "@chai/ai-context",
|
|
679
|
-
_value: Fe(
|
|
680
|
-
},
|
|
679
|
+
_value: Fe(g) ? g : ""
|
|
680
|
+
}, m = ae(
|
|
681
681
|
a,
|
|
682
|
-
(
|
|
682
|
+
(y) => (y == null ? void 0 : y._type) !== p._type
|
|
683
683
|
);
|
|
684
|
-
return
|
|
684
|
+
return m.push(p), await fetch(n, {
|
|
685
685
|
method: "POST",
|
|
686
686
|
headers: { "Content-Type": "application/json" },
|
|
687
687
|
body: JSON.stringify({
|
|
688
688
|
action: "UPDATE_PAGE",
|
|
689
|
-
data: { id: u, blocks:
|
|
689
|
+
data: { id: u, blocks: m }
|
|
690
690
|
})
|
|
691
691
|
});
|
|
692
692
|
},
|
|
693
|
-
onSuccess: (u, { aiContext:
|
|
694
|
-
i.setQueryData(["page",
|
|
695
|
-
const
|
|
693
|
+
onSuccess: (u, { aiContext: g }) => {
|
|
694
|
+
i.setQueryData(["page", j], () => {
|
|
695
|
+
const p = {
|
|
696
696
|
_type: "@chai/ai-context",
|
|
697
|
-
_value: Fe(
|
|
698
|
-
},
|
|
697
|
+
_value: Fe(g) ? g : ""
|
|
698
|
+
}, m = ae(
|
|
699
699
|
a,
|
|
700
|
-
(
|
|
700
|
+
(c) => (c == null ? void 0 : c._type) !== p._type
|
|
701
701
|
);
|
|
702
|
-
return
|
|
702
|
+
return m.push(p), m;
|
|
703
703
|
}), o({ title: "AI context updated successfully." });
|
|
704
704
|
},
|
|
705
705
|
onError: (u) => {
|
|
@@ -710,54 +710,54 @@ const Tt = () => {
|
|
|
710
710
|
});
|
|
711
711
|
}
|
|
712
712
|
});
|
|
713
|
-
return { aiContext:
|
|
714
|
-
},
|
|
715
|
-
const
|
|
716
|
-
return
|
|
717
|
-
async (o, a, s,
|
|
718
|
-
const
|
|
713
|
+
return { aiContext: d, updateAiContext: f };
|
|
714
|
+
}, Ia = () => {
|
|
715
|
+
const n = D(), { aiContext: i } = _t();
|
|
716
|
+
return ua(
|
|
717
|
+
async (o, a, s, j) => {
|
|
718
|
+
const f = await (await fetch(n, {
|
|
719
719
|
method: "POST",
|
|
720
720
|
headers: {
|
|
721
721
|
"Content-Type": "application/json"
|
|
722
722
|
},
|
|
723
723
|
body: JSON.stringify({
|
|
724
724
|
action: "ASK_AI",
|
|
725
|
-
data: { type: o, prompt: a, blocks: s, aiContext: i, lang:
|
|
725
|
+
data: { type: o, prompt: a, blocks: s, aiContext: i, lang: j }
|
|
726
726
|
})
|
|
727
727
|
})).json();
|
|
728
|
-
return console.log("data",
|
|
728
|
+
return console.log("data", f), f.error ? { error: new Error(f.error) } : f;
|
|
729
729
|
},
|
|
730
|
-
[
|
|
730
|
+
[n, i]
|
|
731
731
|
);
|
|
732
|
-
},
|
|
733
|
-
const
|
|
734
|
-
return { getUILibraryBlock: async (
|
|
735
|
-
const
|
|
736
|
-
|
|
732
|
+
}, Ba = () => {
|
|
733
|
+
const n = D(), { toast: i } = J(), o = z();
|
|
734
|
+
return { getUILibraryBlock: async (d, f) => {
|
|
735
|
+
const p = (await (await fetch(
|
|
736
|
+
d.url + (f.path ? "/blocks/" + f.path : "/" + f.uuid + ".html")
|
|
737
737
|
)).text()).replace(/---([\s\S]*?)---/g, "");
|
|
738
|
-
return
|
|
739
|
-
}, getUILibraryBlocks: async (
|
|
738
|
+
return fa(`${p}`);
|
|
739
|
+
}, getUILibraryBlocks: async (d) => {
|
|
740
740
|
try {
|
|
741
|
-
return (await (await fetch(
|
|
742
|
-
...
|
|
743
|
-
preview:
|
|
741
|
+
return (await (await fetch(d.url + "/blocks.json")).json()).map((g) => ({
|
|
742
|
+
...g,
|
|
743
|
+
preview: d.url.replace("chaiblocks", "") + g.preview
|
|
744
744
|
}));
|
|
745
|
-
} catch (
|
|
746
|
-
return console.error(
|
|
745
|
+
} catch (f) {
|
|
746
|
+
return console.error(f), [];
|
|
747
747
|
}
|
|
748
748
|
}, onSave: async ({
|
|
749
|
-
page:
|
|
750
|
-
blocks:
|
|
749
|
+
page: d,
|
|
750
|
+
blocks: f
|
|
751
751
|
}) => {
|
|
752
752
|
try {
|
|
753
|
-
return (await fetch(
|
|
753
|
+
return (await fetch(n, {
|
|
754
754
|
method: "POST",
|
|
755
755
|
headers: { "Content-Type": "application/json" },
|
|
756
756
|
body: JSON.stringify({
|
|
757
757
|
action: "UPDATE_PAGE",
|
|
758
|
-
data: { id:
|
|
758
|
+
data: { id: d, blocks: f }
|
|
759
759
|
})
|
|
760
|
-
})).ok ? (o.setQueryData(["page",
|
|
760
|
+
})).ok ? (o.setQueryData(["page", d], f), i({
|
|
761
761
|
title: "Success",
|
|
762
762
|
description: "Page saved successfully",
|
|
763
763
|
variant: "default"
|
|
@@ -767,11 +767,11 @@ const Tt = () => {
|
|
|
767
767
|
}
|
|
768
768
|
} };
|
|
769
769
|
}, qe = () => {
|
|
770
|
-
const
|
|
770
|
+
const n = D();
|
|
771
771
|
return ne({
|
|
772
772
|
queryKey: ["project-pages"],
|
|
773
773
|
staleTime: 1e3 * 60 * 5,
|
|
774
|
-
queryFn: async () => await (await fetch(
|
|
774
|
+
queryFn: async () => await (await fetch(n, {
|
|
775
775
|
method: "POST",
|
|
776
776
|
headers: {
|
|
777
777
|
"Content-Type": "application/json"
|
|
@@ -781,13 +781,13 @@ const Tt = () => {
|
|
|
781
781
|
})
|
|
782
782
|
})).json()
|
|
783
783
|
});
|
|
784
|
-
},
|
|
785
|
-
const [
|
|
784
|
+
}, Ot = () => {
|
|
785
|
+
const [n] = Y(), i = n.get("page"), { data: o, isFetching: a } = qe();
|
|
786
786
|
return { data: ye(
|
|
787
787
|
() => se(o, { id: i }) || {},
|
|
788
788
|
[o, i]
|
|
789
789
|
), isFetching: a };
|
|
790
|
-
},
|
|
790
|
+
}, Ua = () => ne({
|
|
791
791
|
queryKey: ["uiLibraries"],
|
|
792
792
|
initialData: [],
|
|
793
793
|
queryFn: async () => [
|
|
@@ -802,23 +802,23 @@ const Tt = () => {
|
|
|
802
802
|
url: "https://chaibuilder.com/chaiblocks"
|
|
803
803
|
}
|
|
804
804
|
]
|
|
805
|
-
}),
|
|
806
|
-
if (!
|
|
805
|
+
}), Ga = (n) => ye(() => {
|
|
806
|
+
if (!n || q(n))
|
|
807
807
|
return {
|
|
808
808
|
blocks: [],
|
|
809
809
|
theme: {}
|
|
810
810
|
};
|
|
811
|
-
const i = se(
|
|
812
|
-
|
|
813
|
-
(s) => !
|
|
811
|
+
const i = se(n, { _type: "@chai/theme" }), o = G(i, "_value", {}) || {}, a = ae(
|
|
812
|
+
n,
|
|
813
|
+
(s) => !ve(s == null ? void 0 : s._type, "@chai/")
|
|
814
814
|
);
|
|
815
815
|
return { theme: o, blocks: a };
|
|
816
|
-
}, [
|
|
817
|
-
const
|
|
816
|
+
}, [n]), Rt = () => {
|
|
817
|
+
const n = D();
|
|
818
818
|
return ne({
|
|
819
819
|
queryKey: ["project-config"],
|
|
820
820
|
initialData: { theme: {} },
|
|
821
|
-
queryFn: async () => await (await fetch(
|
|
821
|
+
queryFn: async () => await (await fetch(n, {
|
|
822
822
|
method: "POST",
|
|
823
823
|
headers: {
|
|
824
824
|
"Content-Type": "application/json"
|
|
@@ -826,14 +826,14 @@ const Tt = () => {
|
|
|
826
826
|
body: JSON.stringify({ action: "GET_PROJECT_CONFIG" })
|
|
827
827
|
})).json()
|
|
828
828
|
});
|
|
829
|
-
},
|
|
830
|
-
const { data:
|
|
829
|
+
}, qa = () => {
|
|
830
|
+
const { data: n } = qe(), i = D();
|
|
831
831
|
return {
|
|
832
832
|
getGlobalBlocks: async () => {
|
|
833
833
|
const o = {};
|
|
834
|
-
for (const a of
|
|
835
|
-
|
|
836
|
-
name:
|
|
834
|
+
for (const a of n ?? [])
|
|
835
|
+
q(a == null ? void 0 : a.slug) && (o[a.id] = {
|
|
836
|
+
name: Ta(a.name ?? a.slug),
|
|
837
837
|
description: ""
|
|
838
838
|
});
|
|
839
839
|
return o;
|
|
@@ -847,19 +847,19 @@ const Tt = () => {
|
|
|
847
847
|
})
|
|
848
848
|
})).json()).blocks : []
|
|
849
849
|
};
|
|
850
|
-
},
|
|
851
|
-
const
|
|
850
|
+
}, Ma = () => {
|
|
851
|
+
const n = D();
|
|
852
852
|
return { uploadFile: async (o) => {
|
|
853
853
|
const a = new FormData();
|
|
854
|
-
return a.append("action", "UPLOAD_FILE"), a.append("file", o), (await fetch(
|
|
854
|
+
return a.append("action", "UPLOAD_FILE"), a.append("file", o), (await fetch(n, {
|
|
855
855
|
method: "POST",
|
|
856
856
|
body: a
|
|
857
857
|
})).json();
|
|
858
858
|
} };
|
|
859
|
-
},
|
|
860
|
-
const
|
|
859
|
+
}, $a = () => {
|
|
860
|
+
const n = D(), { toast: i } = J();
|
|
861
861
|
return re({
|
|
862
|
-
mutationFn: async (o) => (await fetch(`${
|
|
862
|
+
mutationFn: async (o) => (await fetch(`${n}`, {
|
|
863
863
|
method: "POST",
|
|
864
864
|
headers: { "Content-Type": "application/json" },
|
|
865
865
|
body: JSON.stringify({
|
|
@@ -875,13 +875,13 @@ const Tt = () => {
|
|
|
875
875
|
}
|
|
876
876
|
});
|
|
877
877
|
}, Me = () => {
|
|
878
|
-
const
|
|
878
|
+
const n = D(), [i] = Y(), o = i.get("page");
|
|
879
879
|
return ne({
|
|
880
880
|
queryKey: ["language-pages", o],
|
|
881
881
|
initialData: [],
|
|
882
882
|
queryFn: async () => {
|
|
883
883
|
if (!o) return null;
|
|
884
|
-
const s = await (await fetch(
|
|
884
|
+
const s = await (await fetch(n, {
|
|
885
885
|
method: "POST",
|
|
886
886
|
headers: { "Content-Type": "application/json" },
|
|
887
887
|
body: JSON.stringify({
|
|
@@ -889,7 +889,7 @@ const Tt = () => {
|
|
|
889
889
|
data: { id: o }
|
|
890
890
|
})
|
|
891
891
|
})).json();
|
|
892
|
-
return
|
|
892
|
+
return Pa(_a(s, "primaryPage"));
|
|
893
893
|
}
|
|
894
894
|
});
|
|
895
895
|
}, be = {
|
|
@@ -1080,10 +1080,10 @@ const Tt = () => {
|
|
|
1080
1080
|
yo: "Yoruba",
|
|
1081
1081
|
za: "Zhuang, Chuang",
|
|
1082
1082
|
zu: "Zulu"
|
|
1083
|
-
},
|
|
1084
|
-
const
|
|
1083
|
+
}, At = () => {
|
|
1084
|
+
const n = D(), i = z(), { toast: o } = J();
|
|
1085
1085
|
return re({
|
|
1086
|
-
mutationFn: async (a) => await (await fetch(
|
|
1086
|
+
mutationFn: async (a) => await (await fetch(n, {
|
|
1087
1087
|
method: "POST",
|
|
1088
1088
|
headers: {
|
|
1089
1089
|
"Content-Type": "application/json"
|
|
@@ -1109,9 +1109,9 @@ const Tt = () => {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
});
|
|
1111
1111
|
}, $e = () => {
|
|
1112
|
-
const
|
|
1112
|
+
const n = D(), i = z(), { toast: o } = J();
|
|
1113
1113
|
return re({
|
|
1114
|
-
mutationFn: async (a) => (await fetch(
|
|
1114
|
+
mutationFn: async (a) => (await fetch(n, {
|
|
1115
1115
|
method: "POST",
|
|
1116
1116
|
headers: {
|
|
1117
1117
|
"Content-Type": "application/json"
|
|
@@ -1139,9 +1139,9 @@ const Tt = () => {
|
|
|
1139
1139
|
}
|
|
1140
1140
|
});
|
|
1141
1141
|
}, Dt = () => {
|
|
1142
|
-
const
|
|
1142
|
+
const n = D(), i = z(), { toast: o } = J();
|
|
1143
1143
|
return re({
|
|
1144
|
-
mutationFn: async (a) => (await fetch(
|
|
1144
|
+
mutationFn: async (a) => (await fetch(n, {
|
|
1145
1145
|
method: "POST",
|
|
1146
1146
|
headers: {
|
|
1147
1147
|
"Content-Type": "application/json"
|
|
@@ -1166,13 +1166,13 @@ const Tt = () => {
|
|
|
1166
1166
|
});
|
|
1167
1167
|
}
|
|
1168
1168
|
});
|
|
1169
|
-
},
|
|
1170
|
-
const { selectedLang:
|
|
1171
|
-
return { data: ye(() => se(i, { lang:
|
|
1172
|
-
},
|
|
1173
|
-
const { data:
|
|
1174
|
-
|
|
1175
|
-
|
|
1169
|
+
}, Ft = () => {
|
|
1170
|
+
const { selectedLang: n } = Ue(), { data: i, isFetching: o } = Me();
|
|
1171
|
+
return { data: ye(() => se(i, { lang: n || "" }) || {}, [i, n]), isFetching: o };
|
|
1172
|
+
}, Lt = () => {
|
|
1173
|
+
const { data: n, isFetching: i } = Ft(), o = n == null ? void 0 : n.seo, [a, s] = I({
|
|
1174
|
+
title: "",
|
|
1175
|
+
description: "",
|
|
1176
1176
|
cononicalUrl: "",
|
|
1177
1177
|
noIndex: !1,
|
|
1178
1178
|
noFollow: "",
|
|
@@ -1183,11 +1183,11 @@ const Tt = () => {
|
|
|
1183
1183
|
searchDescription: "",
|
|
1184
1184
|
jsonLD: "",
|
|
1185
1185
|
...o
|
|
1186
|
-
}),
|
|
1186
|
+
}), j = da({ initial: a, updated: a }), { selectedLang: d, fallbackLang: f } = Ue(), u = d.length ? d : f, { mutate: g, isPending: p } = $e(), m = p;
|
|
1187
1187
|
Be(() => {
|
|
1188
1188
|
!i && o && s({
|
|
1189
|
-
|
|
1190
|
-
|
|
1189
|
+
title: "",
|
|
1190
|
+
description: "",
|
|
1191
1191
|
cononicalUrl: "",
|
|
1192
1192
|
noIndex: !1,
|
|
1193
1193
|
noFollow: "",
|
|
@@ -1200,70 +1200,76 @@ const Tt = () => {
|
|
|
1200
1200
|
...o
|
|
1201
1201
|
});
|
|
1202
1202
|
}, [i, o]);
|
|
1203
|
-
const
|
|
1204
|
-
|
|
1205
|
-
},
|
|
1203
|
+
const c = async () => {
|
|
1204
|
+
g({ id: n == null ? void 0 : n.id, seo: a }), j.current.initial = a, j.current.updated = a;
|
|
1205
|
+
}, y = () => {
|
|
1206
1206
|
s({
|
|
1207
1207
|
...a,
|
|
1208
|
-
ogTitle: a.
|
|
1209
|
-
ogDescription: a.
|
|
1208
|
+
ogTitle: a.title,
|
|
1209
|
+
ogDescription: a.description
|
|
1210
1210
|
});
|
|
1211
|
-
},
|
|
1211
|
+
}, _ = () => {
|
|
1212
1212
|
s({
|
|
1213
1213
|
...a,
|
|
1214
1214
|
searchTitle: a.ogTitle,
|
|
1215
1215
|
searchDescription: a.ogDescription
|
|
1216
1216
|
});
|
|
1217
|
-
},
|
|
1218
|
-
const
|
|
1217
|
+
}, S = (C) => {
|
|
1218
|
+
const T = {
|
|
1219
1219
|
...a,
|
|
1220
|
-
[
|
|
1220
|
+
[C.target.name]: C.target.name === "noIndex" || C.target.name === "noFollow" ? C.target.checked : C.target.value
|
|
1221
1221
|
};
|
|
1222
|
-
s(
|
|
1222
|
+
s(T), j.current.updated = T;
|
|
1223
1223
|
};
|
|
1224
1224
|
return /* @__PURE__ */ t.jsxs("div", { className: "relative pb-40", children: [
|
|
1225
1225
|
/* @__PURE__ */ t.jsxs("div", { className: "text-xs bg-gray-100 p-2 rounded-md text-center", children: [
|
|
1226
1226
|
"Current language:",
|
|
1227
1227
|
" ",
|
|
1228
|
-
/* @__PURE__ */ t.jsx("span", { className: "text-blue-500 font-semibold", children: G(be, u, u) })
|
|
1228
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-blue-500 font-semibold", children: G(be, u, u) }),
|
|
1229
|
+
/* @__PURE__ */ t.jsxs("span", { className: "text-[11px] text-gray-500", children: [
|
|
1230
|
+
" ",
|
|
1231
|
+
"( ",
|
|
1232
|
+
n == null ? void 0 : n.slug,
|
|
1233
|
+
" )"
|
|
1234
|
+
] })
|
|
1229
1235
|
] }),
|
|
1230
|
-
/* @__PURE__ */ t.jsx("form", { className: "space-y-8", children: /* @__PURE__ */ t.jsxs(
|
|
1236
|
+
/* @__PURE__ */ t.jsx("form", { className: "space-y-8", children: /* @__PURE__ */ t.jsxs(xa, { type: "multiple", defaultValue: ["page"], children: [
|
|
1231
1237
|
/* @__PURE__ */ t.jsxs(pe, { value: "page", children: [
|
|
1232
1238
|
/* @__PURE__ */ t.jsx(ge, { className: "text-blue-500", children: "Seo Page" }),
|
|
1233
1239
|
/* @__PURE__ */ t.jsx(me, { children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
|
|
1234
1240
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1235
|
-
/* @__PURE__ */ t.jsx(
|
|
1241
|
+
/* @__PURE__ */ t.jsx(R, { className: "text-xs pb-1", htmlFor: "title", children: "SEO Title" }),
|
|
1236
1242
|
/* @__PURE__ */ t.jsx(
|
|
1237
1243
|
U,
|
|
1238
1244
|
{
|
|
1239
1245
|
type: "text",
|
|
1240
|
-
id: "
|
|
1241
|
-
name: "
|
|
1242
|
-
value: a.
|
|
1243
|
-
onChange:
|
|
1244
|
-
disabled:
|
|
1246
|
+
id: "title",
|
|
1247
|
+
name: "title",
|
|
1248
|
+
value: a.title,
|
|
1249
|
+
onChange: S,
|
|
1250
|
+
disabled: m,
|
|
1245
1251
|
placeholder: "Enter SEO title"
|
|
1246
1252
|
}
|
|
1247
1253
|
),
|
|
1248
1254
|
/* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The title should be between 10 and 60 characters." })
|
|
1249
1255
|
] }),
|
|
1250
1256
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1251
|
-
/* @__PURE__ */ t.jsx(
|
|
1257
|
+
/* @__PURE__ */ t.jsx(R, { className: "text-xs pb-1", htmlFor: "description", children: "SEO Description" }),
|
|
1252
1258
|
/* @__PURE__ */ t.jsx(
|
|
1253
|
-
|
|
1259
|
+
xe,
|
|
1254
1260
|
{
|
|
1255
|
-
id: "
|
|
1256
|
-
name: "
|
|
1257
|
-
value: a.
|
|
1258
|
-
onChange:
|
|
1259
|
-
disabled:
|
|
1261
|
+
id: "description",
|
|
1262
|
+
name: "description",
|
|
1263
|
+
value: a.description,
|
|
1264
|
+
onChange: S,
|
|
1265
|
+
disabled: m,
|
|
1260
1266
|
placeholder: "Enter SEO description"
|
|
1261
1267
|
}
|
|
1262
1268
|
),
|
|
1263
1269
|
/* @__PURE__ */ t.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The description should be between 50 and 160 characters." })
|
|
1264
1270
|
] }),
|
|
1265
1271
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1266
|
-
/* @__PURE__ */ t.jsx(
|
|
1272
|
+
/* @__PURE__ */ t.jsx(R, { className: "text-xs pb-1", htmlFor: "title", children: "Canonical URL" }),
|
|
1267
1273
|
/* @__PURE__ */ t.jsx(
|
|
1268
1274
|
U,
|
|
1269
1275
|
{
|
|
@@ -1271,8 +1277,8 @@ const Tt = () => {
|
|
|
1271
1277
|
id: "canonicalUrl",
|
|
1272
1278
|
name: "canonicalUrl",
|
|
1273
1279
|
value: a.canonicalUrl,
|
|
1274
|
-
onChange:
|
|
1275
|
-
disabled:
|
|
1280
|
+
onChange: S,
|
|
1281
|
+
disabled: m,
|
|
1276
1282
|
placeholder: "Enter Canonical URL"
|
|
1277
1283
|
}
|
|
1278
1284
|
)
|
|
@@ -1286,29 +1292,32 @@ const Tt = () => {
|
|
|
1286
1292
|
id: "noIndex",
|
|
1287
1293
|
name: "noIndex",
|
|
1288
1294
|
checked: a.noIndex,
|
|
1289
|
-
onChange:
|
|
1290
|
-
disabled:
|
|
1295
|
+
onChange: S,
|
|
1296
|
+
disabled: m,
|
|
1291
1297
|
className: "h-4 w-4"
|
|
1292
1298
|
}
|
|
1293
1299
|
),
|
|
1294
|
-
/* @__PURE__ */ t.jsx(
|
|
1300
|
+
/* @__PURE__ */ t.jsx(R, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Index" })
|
|
1295
1301
|
] }),
|
|
1296
1302
|
/* @__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." })
|
|
1297
1303
|
] }),
|
|
1298
|
-
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1299
|
-
/* @__PURE__ */ t.
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1304
|
+
/* @__PURE__ */ t.jsxs("div", { className: "", children: [
|
|
1305
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1306
|
+
/* @__PURE__ */ t.jsx(
|
|
1307
|
+
U,
|
|
1308
|
+
{
|
|
1309
|
+
type: "checkbox",
|
|
1310
|
+
id: "noFollow",
|
|
1311
|
+
name: "noFollow",
|
|
1312
|
+
checked: a.noFollow,
|
|
1313
|
+
onChange: S,
|
|
1314
|
+
disabled: m,
|
|
1315
|
+
className: "h-4 w-4"
|
|
1316
|
+
}
|
|
1317
|
+
),
|
|
1318
|
+
/* @__PURE__ */ t.jsx(R, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Follow" })
|
|
1319
|
+
] }),
|
|
1320
|
+
/* @__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 follow links on this page." })
|
|
1312
1321
|
] })
|
|
1313
1322
|
] }) })
|
|
1314
1323
|
] }),
|
|
@@ -1321,12 +1330,12 @@ const Tt = () => {
|
|
|
1321
1330
|
type: "button",
|
|
1322
1331
|
variant: "outline",
|
|
1323
1332
|
size: "sm",
|
|
1324
|
-
onClick:
|
|
1333
|
+
onClick: y,
|
|
1325
1334
|
children: "Copy from SEO Settings"
|
|
1326
1335
|
}
|
|
1327
1336
|
) }),
|
|
1328
1337
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1329
|
-
/* @__PURE__ */ t.jsx(
|
|
1338
|
+
/* @__PURE__ */ t.jsx(R, { className: "text-xs pb-1", htmlFor: "ogTitle", children: "OG Title" }),
|
|
1330
1339
|
/* @__PURE__ */ t.jsx(
|
|
1331
1340
|
U,
|
|
1332
1341
|
{
|
|
@@ -1334,30 +1343,30 @@ const Tt = () => {
|
|
|
1334
1343
|
id: "ogTitle",
|
|
1335
1344
|
name: "ogTitle",
|
|
1336
1345
|
value: a.ogTitle,
|
|
1337
|
-
onChange:
|
|
1338
|
-
disabled:
|
|
1346
|
+
onChange: S,
|
|
1347
|
+
disabled: m,
|
|
1339
1348
|
placeholder: "Enter OG title"
|
|
1340
1349
|
}
|
|
1341
1350
|
),
|
|
1342
1351
|
/* @__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." })
|
|
1343
1352
|
] }),
|
|
1344
1353
|
/* @__PURE__ */ t.jsxs("div", { className: "mt-4", children: [
|
|
1345
|
-
/* @__PURE__ */ t.jsx(
|
|
1354
|
+
/* @__PURE__ */ t.jsx(R, { className: "text-xs pb-1", htmlFor: "ogDescription", children: "OG Description" }),
|
|
1346
1355
|
/* @__PURE__ */ t.jsx(
|
|
1347
|
-
|
|
1356
|
+
xe,
|
|
1348
1357
|
{
|
|
1349
1358
|
id: "ogDescription",
|
|
1350
1359
|
name: "ogDescription",
|
|
1351
1360
|
value: a.ogDescription,
|
|
1352
|
-
onChange:
|
|
1353
|
-
disabled:
|
|
1361
|
+
onChange: S,
|
|
1362
|
+
disabled: m,
|
|
1354
1363
|
placeholder: "Enter OG description"
|
|
1355
1364
|
}
|
|
1356
1365
|
),
|
|
1357
1366
|
/* @__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." })
|
|
1358
1367
|
] }),
|
|
1359
1368
|
/* @__PURE__ */ t.jsxs("div", { className: "mt-4", children: [
|
|
1360
|
-
/* @__PURE__ */ t.jsx(
|
|
1369
|
+
/* @__PURE__ */ t.jsx(R, { className: "text-xs pb-1", htmlFor: "ogImage", children: "OG Image URL" }),
|
|
1361
1370
|
/* @__PURE__ */ t.jsx(
|
|
1362
1371
|
U,
|
|
1363
1372
|
{
|
|
@@ -1365,8 +1374,8 @@ const Tt = () => {
|
|
|
1365
1374
|
id: "ogImage",
|
|
1366
1375
|
name: "ogImage",
|
|
1367
1376
|
value: a.ogImage,
|
|
1368
|
-
onChange:
|
|
1369
|
-
disabled:
|
|
1377
|
+
onChange: S,
|
|
1378
|
+
disabled: m,
|
|
1370
1379
|
placeholder: "Enter OG image URL"
|
|
1371
1380
|
}
|
|
1372
1381
|
),
|
|
@@ -1383,12 +1392,12 @@ const Tt = () => {
|
|
|
1383
1392
|
type: "button",
|
|
1384
1393
|
variant: "outline",
|
|
1385
1394
|
size: "sm",
|
|
1386
|
-
onClick:
|
|
1395
|
+
onClick: _,
|
|
1387
1396
|
children: "Copy from OG Settings"
|
|
1388
1397
|
}
|
|
1389
1398
|
) }),
|
|
1390
1399
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1391
|
-
/* @__PURE__ */ t.jsx(
|
|
1400
|
+
/* @__PURE__ */ t.jsx(R, { className: "text-xs pb-1", htmlFor: "searchTitle", children: "Search Title" }),
|
|
1392
1401
|
/* @__PURE__ */ t.jsx(
|
|
1393
1402
|
U,
|
|
1394
1403
|
{
|
|
@@ -1396,22 +1405,22 @@ const Tt = () => {
|
|
|
1396
1405
|
id: "searchTitle",
|
|
1397
1406
|
name: "searchTitle",
|
|
1398
1407
|
value: a.searchTitle,
|
|
1399
|
-
onChange:
|
|
1400
|
-
disabled:
|
|
1408
|
+
onChange: S,
|
|
1409
|
+
disabled: m,
|
|
1401
1410
|
placeholder: "Enter search title"
|
|
1402
1411
|
}
|
|
1403
1412
|
),
|
|
1404
1413
|
/* @__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." })
|
|
1405
1414
|
] }),
|
|
1406
1415
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1407
|
-
/* @__PURE__ */ t.jsx(
|
|
1416
|
+
/* @__PURE__ */ t.jsx(R, { className: "text-xs pb-1", htmlFor: "searchDescription", children: "Search Description" }),
|
|
1408
1417
|
/* @__PURE__ */ t.jsx(
|
|
1409
|
-
|
|
1418
|
+
xe,
|
|
1410
1419
|
{
|
|
1411
1420
|
id: "searchDescription",
|
|
1412
1421
|
name: "searchDescription",
|
|
1413
1422
|
value: a.searchDescription,
|
|
1414
|
-
onChange:
|
|
1423
|
+
onChange: S,
|
|
1415
1424
|
placeholder: "Enter search description"
|
|
1416
1425
|
}
|
|
1417
1426
|
),
|
|
@@ -1422,13 +1431,13 @@ const Tt = () => {
|
|
|
1422
1431
|
/* @__PURE__ */ t.jsxs(pe, { value: "jsonLD", children: [
|
|
1423
1432
|
/* @__PURE__ */ t.jsx(ge, { className: "text-blue-500", children: "JSON-LD" }),
|
|
1424
1433
|
/* @__PURE__ */ t.jsx(me, { children: /* @__PURE__ */ t.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1425
|
-
|
|
1434
|
+
xe,
|
|
1426
1435
|
{
|
|
1427
1436
|
id: "jsonLD",
|
|
1428
1437
|
name: "jsonLD",
|
|
1429
1438
|
rows: 3,
|
|
1430
1439
|
value: a.jsonLD,
|
|
1431
|
-
onChange:
|
|
1440
|
+
onChange: S,
|
|
1432
1441
|
placeholder: "Enter JSON-LD"
|
|
1433
1442
|
}
|
|
1434
1443
|
) }) }) })
|
|
@@ -1439,73 +1448,73 @@ const Tt = () => {
|
|
|
1439
1448
|
{
|
|
1440
1449
|
size: "lg",
|
|
1441
1450
|
variant: "default",
|
|
1442
|
-
onClick:
|
|
1443
|
-
disabled: Le(
|
|
1444
|
-
children:
|
|
1451
|
+
onClick: c,
|
|
1452
|
+
disabled: Le(j.current.initial, a) || m,
|
|
1453
|
+
children: p ? "Saving..." : "Save"
|
|
1445
1454
|
}
|
|
1446
1455
|
) })
|
|
1447
1456
|
] });
|
|
1448
1457
|
};
|
|
1449
|
-
|
|
1450
|
-
const
|
|
1451
|
-
langProps:
|
|
1458
|
+
Lt.displayName = "SeoPanel";
|
|
1459
|
+
const Ka = ({
|
|
1460
|
+
langProps: n,
|
|
1452
1461
|
onClose: i,
|
|
1453
|
-
|
|
1462
|
+
languages: o
|
|
1454
1463
|
}) => {
|
|
1455
|
-
const { data: a } =
|
|
1456
|
-
|
|
1457
|
-
(b) => !se(o, { lang: b }) && b !== G(E, "fallbackLang")
|
|
1458
|
-
), R = () => {
|
|
1459
|
-
r.edit ? f(
|
|
1464
|
+
const { data: a } = Ot(), [s, j] = I(n.name || ""), [d, f] = I(n.edit ? n.lang : ""), [u, g] = I(n.edit ? n.slug : ""), { mutate: p, isPending: m } = At(), { mutate: c, isPending: y } = $e(), _ = m || y, S = () => {
|
|
1465
|
+
n.edit ? c(
|
|
1460
1466
|
{
|
|
1461
1467
|
name: s,
|
|
1462
1468
|
slug: u,
|
|
1463
|
-
lang:
|
|
1464
|
-
id:
|
|
1465
|
-
primaryPage:
|
|
1469
|
+
lang: d,
|
|
1470
|
+
id: n == null ? void 0 : n.id,
|
|
1471
|
+
primaryPage: n == null ? void 0 : n.primaryPage
|
|
1466
1472
|
},
|
|
1467
1473
|
{ onSuccess: i }
|
|
1468
|
-
) :
|
|
1474
|
+
) : p(
|
|
1469
1475
|
{
|
|
1470
1476
|
name: s,
|
|
1471
1477
|
slug: u,
|
|
1472
|
-
lang:
|
|
1478
|
+
lang: d,
|
|
1473
1479
|
primaryPage: a == null ? void 0 : a.id
|
|
1474
1480
|
},
|
|
1475
1481
|
{ onSuccess: i }
|
|
1476
1482
|
);
|
|
1477
1483
|
};
|
|
1478
|
-
return /* @__PURE__ */ t.jsx(
|
|
1479
|
-
/* @__PURE__ */ t.jsxs(
|
|
1480
|
-
/* @__PURE__ */ t.jsx(
|
|
1481
|
-
/* @__PURE__ */ t.jsx(
|
|
1484
|
+
return /* @__PURE__ */ t.jsx(bt, { open: !!n, onOpenChange: i, children: /* @__PURE__ */ t.jsxs(yt, { className: "sm:max-w-[425px]", children: [
|
|
1485
|
+
/* @__PURE__ */ t.jsxs(jt, { children: [
|
|
1486
|
+
/* @__PURE__ */ t.jsx(wt, { children: n.edit ? "Edit language" : "Add New language" }),
|
|
1487
|
+
/* @__PURE__ */ t.jsx(St, { children: "Enter the details for the language" })
|
|
1482
1488
|
] }),
|
|
1483
1489
|
/* @__PURE__ */ t.jsxs("form", { children: [
|
|
1484
1490
|
/* @__PURE__ */ t.jsxs("div", { className: "grid gap-4 py-4", children: [
|
|
1485
1491
|
/* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
|
|
1486
|
-
/* @__PURE__ */ t.jsx(
|
|
1492
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: "lang", className: "text-right", children: "Language" }),
|
|
1487
1493
|
/* @__PURE__ */ t.jsxs(
|
|
1488
1494
|
"select",
|
|
1489
1495
|
{
|
|
1490
|
-
value:
|
|
1491
|
-
disabled:
|
|
1492
|
-
onChange: (
|
|
1496
|
+
value: d,
|
|
1497
|
+
disabled: n.edit || q(o),
|
|
1498
|
+
onChange: (C) => {
|
|
1499
|
+
const T = C.target.value;
|
|
1500
|
+
f(T), g(`/${T}`);
|
|
1501
|
+
},
|
|
1493
1502
|
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
1503
|
children: [
|
|
1495
|
-
/* @__PURE__ */ t.jsx("option", { value: "", disabled: !0, selected: !0, children:
|
|
1496
|
-
Ge(
|
|
1504
|
+
/* @__PURE__ */ t.jsx("option", { value: "", disabled: !0, selected: !0, children: q(o) ? "All available language page is created." : "Choose language" }),
|
|
1505
|
+
Ge(o, (C) => /* @__PURE__ */ t.jsx("option", { value: C, children: G(be, C, C) }, C))
|
|
1497
1506
|
]
|
|
1498
1507
|
}
|
|
1499
1508
|
)
|
|
1500
1509
|
] }),
|
|
1501
1510
|
/* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
|
|
1502
|
-
/* @__PURE__ */ t.jsx(
|
|
1511
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: "slug", className: "text-right", children: "Page Name" }),
|
|
1503
1512
|
/* @__PURE__ */ t.jsx(
|
|
1504
1513
|
U,
|
|
1505
1514
|
{
|
|
1506
1515
|
id: "name",
|
|
1507
1516
|
value: s,
|
|
1508
|
-
onChange: (
|
|
1517
|
+
onChange: (C) => j(C.target.value),
|
|
1509
1518
|
className: "col-span-3",
|
|
1510
1519
|
required: !0,
|
|
1511
1520
|
placeholder: "Enter page name"
|
|
@@ -1513,93 +1522,104 @@ const $a = ({
|
|
|
1513
1522
|
)
|
|
1514
1523
|
] }),
|
|
1515
1524
|
/* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
|
|
1516
|
-
/* @__PURE__ */ t.jsxs(
|
|
1525
|
+
/* @__PURE__ */ t.jsxs(R, { htmlFor: "slug", className: "text-right", children: [
|
|
1517
1526
|
"Slug",
|
|
1518
1527
|
" ",
|
|
1519
|
-
/* @__PURE__ */ t.
|
|
1528
|
+
/* @__PURE__ */ t.jsxs("small", { className: "font-light", children: [
|
|
1529
|
+
"(Slug should start with /",
|
|
1530
|
+
d,
|
|
1531
|
+
")"
|
|
1532
|
+
] })
|
|
1520
1533
|
] }),
|
|
1521
1534
|
/* @__PURE__ */ t.jsx(
|
|
1522
1535
|
U,
|
|
1523
1536
|
{
|
|
1524
1537
|
id: "slug",
|
|
1525
1538
|
value: u,
|
|
1526
|
-
onChange: (
|
|
1539
|
+
onChange: (C) => {
|
|
1540
|
+
const T = C.target.value;
|
|
1541
|
+
dt(T, `/${d}`) && g(Oa(Ra(T)));
|
|
1542
|
+
},
|
|
1527
1543
|
className: "col-span-3",
|
|
1528
1544
|
required: !0,
|
|
1529
1545
|
pattern: "^/.*",
|
|
1546
|
+
disabled: q(d),
|
|
1530
1547
|
title: "Slug must start with /",
|
|
1531
|
-
placeholder: "Enter page slug"
|
|
1548
|
+
placeholder: q(d) ? "Choose language to add slug" : "Enter page slug"
|
|
1532
1549
|
}
|
|
1533
1550
|
)
|
|
1534
1551
|
] })
|
|
1535
1552
|
] }),
|
|
1536
|
-
/* @__PURE__ */ t.jsx(
|
|
1553
|
+
/* @__PURE__ */ t.jsx(Ct, { children: /* @__PURE__ */ t.jsx(
|
|
1537
1554
|
B,
|
|
1538
1555
|
{
|
|
1539
|
-
onClick:
|
|
1556
|
+
onClick: S,
|
|
1540
1557
|
type: "button",
|
|
1541
|
-
disabled:
|
|
1542
|
-
children:
|
|
1558
|
+
disabled: _ || !d || !u || !u.startsWith("/") || !dt(u, `/${d}`),
|
|
1559
|
+
children: _ ? n.edit ? "Updating..." : "Adding..." : n.edit ? "Update" : "Add new language"
|
|
1543
1560
|
}
|
|
1544
1561
|
) })
|
|
1545
1562
|
] })
|
|
1546
1563
|
] }) });
|
|
1547
|
-
},
|
|
1548
|
-
const [
|
|
1564
|
+
}, Wa = () => {
|
|
1565
|
+
const [n, i] = I(null), { selectedLang: o, fallbackLang: a, setSelectedLang: s } = Ue(), { data: j, isFetching: d } = Me(), { mutate: f, isPending: u } = Dt(), { data: g } = Ft(), { data: p } = Rt(), m = ae(
|
|
1566
|
+
G(p, "languages") || ["en"],
|
|
1567
|
+
(c) => !se(j, { lang: c }) && c !== G(p, "fallbackLang")
|
|
1568
|
+
);
|
|
1549
1569
|
return /* @__PURE__ */ t.jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
1550
|
-
/* @__PURE__ */ t.jsx("ul", { className: "space-y-2 mt-4", children:
|
|
1570
|
+
/* @__PURE__ */ t.jsx("ul", { className: "space-y-2 mt-4", children: d ? /* @__PURE__ */ t.jsxs("div", { className: "w-full space-y-3 py-4", children: [
|
|
1551
1571
|
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1552
1572
|
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1553
1573
|
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
1554
|
-
] }) : Ge(
|
|
1555
|
-
const
|
|
1574
|
+
] }) : Ge(j, (c) => {
|
|
1575
|
+
const y = c.lang, _ = c.slug, S = !c.primaryPage, C = y === o;
|
|
1556
1576
|
return S ? null : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1557
1577
|
/* @__PURE__ */ t.jsxs(
|
|
1558
1578
|
"li",
|
|
1559
1579
|
{
|
|
1560
|
-
className: `w-full p-2 rounded cursor-pointer flex items-center justify-between ${
|
|
1561
|
-
onClick: () => s(
|
|
1580
|
+
className: `w-full p-2 rounded cursor-pointer flex items-center justify-between ${C ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
1581
|
+
onClick: () => s(y),
|
|
1562
1582
|
children: [
|
|
1563
1583
|
/* @__PURE__ */ t.jsxs("div", { className: " flex-1 gap-x-3", children: [
|
|
1564
|
-
/* @__PURE__ */ t.jsx("div", { className: "text-[13px]", children: G(be, S ? a :
|
|
1584
|
+
/* @__PURE__ */ t.jsx("div", { className: "text-[13px]", children: G(be, S ? a : y, y) }),
|
|
1565
1585
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1566
1586
|
/* @__PURE__ */ t.jsxs("div", { className: "text-[11px] text-gray-500", children: [
|
|
1567
1587
|
"Slug:",
|
|
1568
1588
|
/* @__PURE__ */ t.jsxs("b", { children: [
|
|
1569
1589
|
" ",
|
|
1570
|
-
|
|
1590
|
+
_
|
|
1571
1591
|
] })
|
|
1572
1592
|
] }),
|
|
1573
1593
|
/* @__PURE__ */ t.jsxs("div", { className: "text-[11px] text-gray-500", children: [
|
|
1574
1594
|
"Name:",
|
|
1575
1595
|
/* @__PURE__ */ t.jsxs("b", { children: [
|
|
1576
1596
|
" ",
|
|
1577
|
-
|
|
1597
|
+
c.name,
|
|
1578
1598
|
" "
|
|
1579
1599
|
] })
|
|
1580
1600
|
] })
|
|
1581
1601
|
] })
|
|
1582
1602
|
] }),
|
|
1583
1603
|
S ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
|
|
1584
|
-
/* @__PURE__ */ t.jsx(
|
|
1604
|
+
/* @__PURE__ */ t.jsx(Ca, { fill: "orange", className: "w-3 h-3" }),
|
|
1585
1605
|
/* @__PURE__ */ t.jsx("b", { children: " Default" })
|
|
1586
1606
|
] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
1587
1607
|
/* @__PURE__ */ t.jsx(
|
|
1588
1608
|
Et,
|
|
1589
1609
|
{
|
|
1590
|
-
onClick: (
|
|
1591
|
-
|
|
1610
|
+
onClick: (T) => {
|
|
1611
|
+
T.stopPropagation(), i({ ...c, edit: !0 });
|
|
1592
1612
|
},
|
|
1593
1613
|
className: "w-3 h-3 hover:text-blue-500"
|
|
1594
1614
|
}
|
|
1595
1615
|
),
|
|
1596
|
-
/* @__PURE__ */ t.jsxs(
|
|
1597
|
-
/* @__PURE__ */ t.jsx(
|
|
1616
|
+
/* @__PURE__ */ t.jsxs(mt, { children: [
|
|
1617
|
+
/* @__PURE__ */ t.jsx(xt, { children: /* @__PURE__ */ t.jsx(kt, { className: "w-3 h-3 hover:text-red-500" }) }),
|
|
1598
1618
|
/* @__PURE__ */ t.jsx(vt, { children: /* @__PURE__ */ t.jsxs("div", { children: [
|
|
1599
1619
|
/* @__PURE__ */ t.jsxs("p", { className: "pb-2 text-sm", children: [
|
|
1600
1620
|
"Are you sure you want to remove",
|
|
1601
1621
|
" ",
|
|
1602
|
-
/* @__PURE__ */ t.jsx("b", { children: G(be,
|
|
1622
|
+
/* @__PURE__ */ t.jsx("b", { children: G(be, y, y) }),
|
|
1603
1623
|
" language?"
|
|
1604
1624
|
] }),
|
|
1605
1625
|
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ t.jsx(
|
|
@@ -1607,9 +1627,9 @@ const $a = ({
|
|
|
1607
1627
|
{
|
|
1608
1628
|
size: "sm",
|
|
1609
1629
|
variant: "destructive",
|
|
1610
|
-
disabled:
|
|
1611
|
-
onClick: () =>
|
|
1612
|
-
children:
|
|
1630
|
+
disabled: u,
|
|
1631
|
+
onClick: () => f(c),
|
|
1632
|
+
children: u ? "Deleting..." : "Delete"
|
|
1613
1633
|
}
|
|
1614
1634
|
) })
|
|
1615
1635
|
] }) })
|
|
@@ -1617,51 +1637,57 @@ const $a = ({
|
|
|
1617
1637
|
] })
|
|
1618
1638
|
]
|
|
1619
1639
|
},
|
|
1620
|
-
|
|
1640
|
+
c.id
|
|
1621
1641
|
),
|
|
1622
1642
|
/* @__PURE__ */ t.jsx("div", { className: "h-1 w-full border-b" })
|
|
1623
1643
|
] });
|
|
1624
1644
|
}) }),
|
|
1625
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex justify-center w-full", children:
|
|
1645
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ t.jsx(
|
|
1626
1646
|
B,
|
|
1627
1647
|
{
|
|
1628
1648
|
variant: "default",
|
|
1629
1649
|
size: "sm",
|
|
1630
|
-
|
|
1650
|
+
disabled: q(m),
|
|
1651
|
+
onClick: () => i({
|
|
1652
|
+
name: g == null ? void 0 : g.name,
|
|
1653
|
+
lang: "",
|
|
1654
|
+
slug: "",
|
|
1655
|
+
edit: !1
|
|
1656
|
+
}),
|
|
1631
1657
|
children: "+ Add new language"
|
|
1632
1658
|
}
|
|
1633
1659
|
) }),
|
|
1634
|
-
|
|
1635
|
-
|
|
1660
|
+
n && /* @__PURE__ */ t.jsx(
|
|
1661
|
+
Ka,
|
|
1636
1662
|
{
|
|
1637
|
-
|
|
1638
|
-
|
|
1663
|
+
languages: m,
|
|
1664
|
+
langProps: n,
|
|
1639
1665
|
onClose: () => i(null)
|
|
1640
1666
|
}
|
|
1641
1667
|
)
|
|
1642
1668
|
] });
|
|
1643
1669
|
}, Va = ({
|
|
1644
|
-
activePage:
|
|
1670
|
+
activePage: n,
|
|
1645
1671
|
editPage: i,
|
|
1646
1672
|
onShowUpsertPage: o
|
|
1647
1673
|
}) => {
|
|
1648
|
-
const [a, s] = I("pages"), { data:
|
|
1649
|
-
ae(
|
|
1674
|
+
const [a, s] = I("pages"), { data: j, isFetching: d } = qe(), { mutate: f, isPending: u } = Dt(), g = (p) => Aa(
|
|
1675
|
+
ae(p, (c) => a === "pages" ? c.slug : !c.slug),
|
|
1650
1676
|
"name",
|
|
1651
1677
|
"asc"
|
|
1652
|
-
).map((
|
|
1678
|
+
).map((c) => /* @__PURE__ */ t.jsxs(
|
|
1653
1679
|
B,
|
|
1654
1680
|
{
|
|
1655
|
-
onClick: () => i(
|
|
1656
|
-
variant:
|
|
1681
|
+
onClick: () => i(c.id),
|
|
1682
|
+
variant: c.id === n ? "default" : "ghost",
|
|
1657
1683
|
className: "flex justify-between items-center w-full space-x-2 py-1",
|
|
1658
1684
|
children: [
|
|
1659
1685
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1660
|
-
|
|
1661
|
-
/* @__PURE__ */ t.jsx("span", { children:
|
|
1662
|
-
(
|
|
1686
|
+
c.global ? /* @__PURE__ */ t.jsx(Nt, { className: "h-4 w-4" }) : /* @__PURE__ */ t.jsx(Tt, { className: "h-4 w-4" }),
|
|
1687
|
+
/* @__PURE__ */ t.jsx("span", { children: c.name ?? c.slug }),
|
|
1688
|
+
(c == null ? void 0 : c.slug) && /* @__PURE__ */ t.jsxs("span", { className: "text-xs font-light", children: [
|
|
1663
1689
|
"( ",
|
|
1664
|
-
|
|
1690
|
+
c.slug,
|
|
1665
1691
|
" )"
|
|
1666
1692
|
] })
|
|
1667
1693
|
] }),
|
|
@@ -1670,20 +1696,20 @@ const $a = ({
|
|
|
1670
1696
|
Et,
|
|
1671
1697
|
{
|
|
1672
1698
|
className: "h-3 w-3 hover:text-blue-500",
|
|
1673
|
-
onClick: (
|
|
1674
|
-
|
|
1699
|
+
onClick: (y) => {
|
|
1700
|
+
y.stopPropagation(), o({ ...c, global: a === "globalBlocks" });
|
|
1675
1701
|
}
|
|
1676
1702
|
}
|
|
1677
1703
|
),
|
|
1678
|
-
/* @__PURE__ */ t.jsxs(
|
|
1679
|
-
/* @__PURE__ */ t.jsx(
|
|
1704
|
+
/* @__PURE__ */ t.jsxs(mt, { children: [
|
|
1705
|
+
/* @__PURE__ */ t.jsx(xt, { onClick: (y) => y.stopPropagation(), children: /* @__PURE__ */ t.jsx(kt, { className: "w-3 h-3 hover:text-red-500" }) }),
|
|
1680
1706
|
/* @__PURE__ */ t.jsx(vt, { children: /* @__PURE__ */ t.jsxs("div", { children: [
|
|
1681
1707
|
/* @__PURE__ */ t.jsxs("p", { className: "pb-2 text-sm", children: [
|
|
1682
1708
|
"Are you sure you want to remove",
|
|
1683
1709
|
" ",
|
|
1684
|
-
/* @__PURE__ */ t.jsx("b", { children:
|
|
1710
|
+
/* @__PURE__ */ t.jsx("b", { children: c.name ?? (c == null ? void 0 : c.slug) }),
|
|
1685
1711
|
" ",
|
|
1686
|
-
|
|
1712
|
+
c.global ? "global block?" : "page? This will also delete all associated language pages."
|
|
1687
1713
|
] }),
|
|
1688
1714
|
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ t.jsx(
|
|
1689
1715
|
B,
|
|
@@ -1691,8 +1717,8 @@ const $a = ({
|
|
|
1691
1717
|
size: "sm",
|
|
1692
1718
|
variant: "destructive",
|
|
1693
1719
|
disabled: u,
|
|
1694
|
-
onClick: (
|
|
1695
|
-
|
|
1720
|
+
onClick: (y) => {
|
|
1721
|
+
y.stopPropagation(), f(c);
|
|
1696
1722
|
},
|
|
1697
1723
|
children: u ? "Deleting..." : "Delete"
|
|
1698
1724
|
}
|
|
@@ -1702,21 +1728,21 @@ const $a = ({
|
|
|
1702
1728
|
] })
|
|
1703
1729
|
]
|
|
1704
1730
|
},
|
|
1705
|
-
|
|
1731
|
+
c.id
|
|
1706
1732
|
));
|
|
1707
1733
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1708
1734
|
/* @__PURE__ */ t.jsx("br", {}),
|
|
1709
|
-
/* @__PURE__ */ t.jsxs(
|
|
1710
|
-
/* @__PURE__ */ t.jsxs(
|
|
1735
|
+
/* @__PURE__ */ t.jsxs(va, { value: a, className: "w-full", onValueChange: s, children: [
|
|
1736
|
+
/* @__PURE__ */ t.jsxs(ba, { className: "w-full", children: [
|
|
1711
1737
|
/* @__PURE__ */ t.jsx(ut, { value: "pages", className: "w-full", children: /* @__PURE__ */ t.jsx("div", { className: "px-4", children: "Pages" }) }),
|
|
1712
1738
|
/* @__PURE__ */ t.jsx(ut, { value: "globalBlocks", className: "w-full", children: /* @__PURE__ */ t.jsx("div", { className: "px-4", children: "Global Blocks" }) })
|
|
1713
1739
|
] }),
|
|
1714
|
-
|
|
1740
|
+
d ? /* @__PURE__ */ t.jsxs("div", { className: "w-full space-y-3 py-4", children: [
|
|
1715
1741
|
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1716
1742
|
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1717
1743
|
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
1718
1744
|
] }) : /* @__PURE__ */ t.jsxs("div", { className: "py-4 space-y-3", children: [
|
|
1719
|
-
/* @__PURE__ */ t.jsx(
|
|
1745
|
+
/* @__PURE__ */ t.jsx(ya, { children: /* @__PURE__ */ t.jsxs(ja, { className: "text-xs text-muted-foreground text-center text-light", children: [
|
|
1720
1746
|
"Manage your ",
|
|
1721
1747
|
a === "pages" ? "pages" : "global blocks"
|
|
1722
1748
|
] }) }),
|
|
@@ -1725,7 +1751,7 @@ const $a = ({
|
|
|
1725
1751
|
{
|
|
1726
1752
|
variant: "default",
|
|
1727
1753
|
size: "sm",
|
|
1728
|
-
disabled:
|
|
1754
|
+
disabled: d,
|
|
1729
1755
|
onClick: () => o({
|
|
1730
1756
|
slug: "",
|
|
1731
1757
|
name: "",
|
|
@@ -1733,25 +1759,25 @@ const $a = ({
|
|
|
1733
1759
|
}),
|
|
1734
1760
|
className: "mb-4 w-1/2 bg-blue-500 hover:bg-blue-400",
|
|
1735
1761
|
children: [
|
|
1736
|
-
/* @__PURE__ */ t.jsx(
|
|
1737
|
-
|
|
1762
|
+
/* @__PURE__ */ t.jsx(Ea, { className: "h-4 w-4 mr-2" }),
|
|
1763
|
+
d ? "Loading..." : `Add new ${a === "pages" ? "page" : "global block"}`
|
|
1738
1764
|
]
|
|
1739
1765
|
}
|
|
1740
1766
|
) }),
|
|
1741
|
-
/* @__PURE__ */ t.jsx("div", { className: "pt-4", children: /* @__PURE__ */ t.jsx("div", { className: "space-y-2", children:
|
|
1767
|
+
/* @__PURE__ */ t.jsx("div", { className: "pt-4", children: /* @__PURE__ */ t.jsx("div", { className: "space-y-2", children: d ? /* @__PURE__ */ t.jsx("div", { className: "h-32 w-full flex justify-center items-center text-sm animate-pulse", children: "Loading..." }) : g(j) }) })
|
|
1742
1768
|
] })
|
|
1743
1769
|
] })
|
|
1744
1770
|
] });
|
|
1745
|
-
},
|
|
1746
|
-
editPage:
|
|
1771
|
+
}, za = ({
|
|
1772
|
+
editPage: n,
|
|
1747
1773
|
showUpsertPage: i,
|
|
1748
1774
|
setShowUpsertPage: o
|
|
1749
1775
|
}) => {
|
|
1750
|
-
const a = i.id, [s,
|
|
1751
|
-
a ?
|
|
1776
|
+
const a = i.id, [s, j] = I(a && i.name || ""), [d, f] = I(a && i.slug || ""), { mutate: u, isPending: g } = At(), { mutate: p, isPending: m } = $e(), c = g || m, y = () => {
|
|
1777
|
+
a ? p(
|
|
1752
1778
|
{
|
|
1753
1779
|
name: s,
|
|
1754
|
-
slug:
|
|
1780
|
+
slug: d,
|
|
1755
1781
|
id: i.id,
|
|
1756
1782
|
global: !!i.global
|
|
1757
1783
|
},
|
|
@@ -1763,29 +1789,29 @@ const $a = ({
|
|
|
1763
1789
|
) : u(
|
|
1764
1790
|
{
|
|
1765
1791
|
name: s,
|
|
1766
|
-
slug:
|
|
1792
|
+
slug: d,
|
|
1767
1793
|
global: !!i.global
|
|
1768
1794
|
},
|
|
1769
1795
|
{
|
|
1770
|
-
onSuccess: (
|
|
1771
|
-
|
|
1796
|
+
onSuccess: (_) => {
|
|
1797
|
+
n(_.id);
|
|
1772
1798
|
}
|
|
1773
1799
|
}
|
|
1774
1800
|
);
|
|
1775
1801
|
};
|
|
1776
1802
|
return /* @__PURE__ */ t.jsx(
|
|
1777
|
-
|
|
1803
|
+
bt,
|
|
1778
1804
|
{
|
|
1779
1805
|
open: !!i,
|
|
1780
1806
|
onOpenChange: () => o(void 0),
|
|
1781
|
-
children: /* @__PURE__ */ t.jsxs(
|
|
1782
|
-
/* @__PURE__ */ t.jsxs(
|
|
1783
|
-
/* @__PURE__ */ t.jsxs(
|
|
1807
|
+
children: /* @__PURE__ */ t.jsxs(yt, { className: "sm:max-w-[425px]", children: [
|
|
1808
|
+
/* @__PURE__ */ t.jsxs(jt, { children: [
|
|
1809
|
+
/* @__PURE__ */ t.jsxs(wt, { children: [
|
|
1784
1810
|
a ? "Edit" : "Add New",
|
|
1785
1811
|
" ",
|
|
1786
1812
|
i.global ? "Global Block" : "Page"
|
|
1787
1813
|
] }),
|
|
1788
|
-
/* @__PURE__ */ t.jsxs(
|
|
1814
|
+
/* @__PURE__ */ t.jsxs(St, { children: [
|
|
1789
1815
|
"Enter the details for the new",
|
|
1790
1816
|
" ",
|
|
1791
1817
|
i.global ? "global block. Identifier should be unique." : "page. Slug must start with /"
|
|
@@ -1794,29 +1820,29 @@ const $a = ({
|
|
|
1794
1820
|
/* @__PURE__ */ t.jsxs("form", { children: [
|
|
1795
1821
|
/* @__PURE__ */ t.jsxs("div", { className: "grid gap-4 py-4", children: [
|
|
1796
1822
|
/* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
|
|
1797
|
-
/* @__PURE__ */ t.jsx(
|
|
1823
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: "name", className: "text-right", children: "Name" }),
|
|
1798
1824
|
/* @__PURE__ */ t.jsx(
|
|
1799
1825
|
U,
|
|
1800
1826
|
{
|
|
1801
1827
|
id: "name",
|
|
1802
1828
|
value: s,
|
|
1803
1829
|
placeholder: `Enter ${i.global ? "global block" : "page"} name`,
|
|
1804
|
-
onChange: (
|
|
1830
|
+
onChange: (_) => j(_.target.value),
|
|
1805
1831
|
className: "col-span-3",
|
|
1806
1832
|
required: !0
|
|
1807
1833
|
}
|
|
1808
1834
|
)
|
|
1809
1835
|
] }),
|
|
1810
1836
|
!i.global && /* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
|
|
1811
|
-
/* @__PURE__ */ t.jsx(
|
|
1837
|
+
/* @__PURE__ */ t.jsx(R, { htmlFor: "slug", className: "text-right", children: i.global ? "Identifier" : "Slug" }),
|
|
1812
1838
|
/* @__PURE__ */ t.jsx(
|
|
1813
1839
|
U,
|
|
1814
1840
|
{
|
|
1815
1841
|
id: "slug",
|
|
1816
|
-
value:
|
|
1817
|
-
onChange: (
|
|
1818
|
-
var
|
|
1819
|
-
return
|
|
1842
|
+
value: d,
|
|
1843
|
+
onChange: (_) => {
|
|
1844
|
+
var S;
|
|
1845
|
+
return f((S = _.target.value) == null ? void 0 : S.trim().toLowerCase());
|
|
1820
1846
|
},
|
|
1821
1847
|
className: "col-span-3",
|
|
1822
1848
|
required: !0,
|
|
@@ -1827,13 +1853,13 @@ const $a = ({
|
|
|
1827
1853
|
)
|
|
1828
1854
|
] })
|
|
1829
1855
|
] }),
|
|
1830
|
-
/* @__PURE__ */ t.jsx(
|
|
1856
|
+
/* @__PURE__ */ t.jsx(Ct, { children: /* @__PURE__ */ t.jsx(
|
|
1831
1857
|
B,
|
|
1832
1858
|
{
|
|
1833
|
-
onClick:
|
|
1859
|
+
onClick: y,
|
|
1834
1860
|
type: "button",
|
|
1835
|
-
disabled:
|
|
1836
|
-
children:
|
|
1861
|
+
disabled: c || !s || !i.global && !d.startsWith("/") || Le(i.name, s) && Le(i.slug, d),
|
|
1862
|
+
children: c ? a ? "Updating..." : "Adding..." : i.global ? `${a ? "Update" : "Add"} global block` : `${a ? "Update" : "Add"} Page`
|
|
1837
1863
|
}
|
|
1838
1864
|
) })
|
|
1839
1865
|
] })
|
|
@@ -1841,19 +1867,19 @@ const $a = ({
|
|
|
1841
1867
|
}
|
|
1842
1868
|
);
|
|
1843
1869
|
};
|
|
1844
|
-
function
|
|
1845
|
-
const { activePage: i, canClose: o, open: a, close: s } =
|
|
1846
|
-
window.history.pushState({}, "", `?page=${
|
|
1870
|
+
function Ja(n) {
|
|
1871
|
+
const { activePage: i, canClose: o, open: a, close: s } = n, [, j] = Y(), [d, f] = I(), u = (g) => {
|
|
1872
|
+
window.history.pushState({}, "", `?page=${g}`), j(new URLSearchParams({ page: g })), window.dispatchEvent(new PopStateEvent("popstate")), f(void 0), s();
|
|
1847
1873
|
};
|
|
1848
1874
|
return /* @__PURE__ */ t.jsx(
|
|
1849
|
-
|
|
1875
|
+
wa,
|
|
1850
1876
|
{
|
|
1851
1877
|
open: a,
|
|
1852
|
-
onOpenChange: (
|
|
1853
|
-
!
|
|
1878
|
+
onOpenChange: (g) => {
|
|
1879
|
+
!g && o && s();
|
|
1854
1880
|
},
|
|
1855
1881
|
children: /* @__PURE__ */ t.jsxs(
|
|
1856
|
-
|
|
1882
|
+
Sa,
|
|
1857
1883
|
{
|
|
1858
1884
|
side: "left",
|
|
1859
1885
|
className: `border-border w-full ${o ? "" : "sheet-hide-close-btn"}`,
|
|
@@ -1861,17 +1887,17 @@ function za(r) {
|
|
|
1861
1887
|
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1862
1888
|
Va,
|
|
1863
1889
|
{
|
|
1864
|
-
onShowUpsertPage: (
|
|
1890
|
+
onShowUpsertPage: (g) => f(g),
|
|
1865
1891
|
activePage: i,
|
|
1866
1892
|
editPage: u
|
|
1867
1893
|
}
|
|
1868
1894
|
) }),
|
|
1869
|
-
|
|
1870
|
-
|
|
1895
|
+
d && /* @__PURE__ */ t.jsx(
|
|
1896
|
+
za,
|
|
1871
1897
|
{
|
|
1872
1898
|
editPage: u,
|
|
1873
|
-
showUpsertPage:
|
|
1874
|
-
setShowUpsertPage:
|
|
1899
|
+
showUpsertPage: d,
|
|
1900
|
+
setShowUpsertPage: f
|
|
1875
1901
|
}
|
|
1876
1902
|
)
|
|
1877
1903
|
]
|
|
@@ -1880,57 +1906,61 @@ function za(r) {
|
|
|
1880
1906
|
}
|
|
1881
1907
|
);
|
|
1882
1908
|
}
|
|
1883
|
-
|
|
1884
|
-
const
|
|
1909
|
+
ha();
|
|
1910
|
+
const Ya = (n) => {
|
|
1885
1911
|
var Q;
|
|
1886
|
-
const [i] = Y(), o = i.get("page"), { data: a, isFetching: s } =
|
|
1912
|
+
const [i] = Y(), o = i.get("page"), { data: a, isFetching: s } = Ot(), { data: j } = Ua(), { data: d, isFetching: f } = Pt(), { blocks: u, theme: g } = Ga(d), { data: p } = Rt(), { data: m } = Me(), c = Ia(), { uploadFile: y } = Ma(), { getUILibraryBlock: _, getUILibraryBlocks: S, onSave: C } = Ba(), { getGlobalBlocks: T, getGlobalBlockBlocks: P } = qa(), { mutate: je, isPending: ie } = $a(), { aiContext: H, updateAiContext: we } = _t(), [Se, oe] = I(!1), [M, Ce] = I("SAVED");
|
|
1887
1913
|
Be(() => {
|
|
1888
|
-
const
|
|
1889
|
-
|
|
1914
|
+
const E = (F) => {
|
|
1915
|
+
M === "UNSAVED" && (F.preventDefault(), F.returnValue = !1);
|
|
1890
1916
|
};
|
|
1891
|
-
return
|
|
1892
|
-
window.removeEventListener("beforeunload",
|
|
1917
|
+
return M === "UNSAVED" && window.addEventListener("beforeunload", E), () => {
|
|
1918
|
+
window.removeEventListener("beforeunload", E);
|
|
1893
1919
|
};
|
|
1894
|
-
}, [
|
|
1895
|
-
const
|
|
1896
|
-
const
|
|
1897
|
-
return
|
|
1898
|
-
}, [
|
|
1920
|
+
}, [M]);
|
|
1921
|
+
const Ee = ye(() => {
|
|
1922
|
+
const E = {};
|
|
1923
|
+
return p != null && p.theme && (E.brandingOptions = p.theme), E;
|
|
1924
|
+
}, [p]);
|
|
1899
1925
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1900
1926
|
/* @__PURE__ */ t.jsx(
|
|
1901
|
-
|
|
1927
|
+
pa,
|
|
1902
1928
|
{
|
|
1903
|
-
loading:
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1929
|
+
loading: f,
|
|
1930
|
+
...n.fallbackLang && {
|
|
1931
|
+
fallbackLang: n.fallbackLang || "en"
|
|
1932
|
+
},
|
|
1933
|
+
...n.languages && {
|
|
1934
|
+
languages: Ge(m, "lang") || []
|
|
1935
|
+
},
|
|
1936
|
+
translations: n.translations || {},
|
|
1937
|
+
locale: n.locale || "en",
|
|
1938
|
+
htmlDir: n.htmlDir || "ltr",
|
|
1939
|
+
autoSaveSupport: n.autoSaveSupport || !1,
|
|
1940
|
+
autoSaveInterval: n.autoSaveInterval || 15,
|
|
1941
|
+
uploadMediaCallback: y,
|
|
1942
|
+
onError: n.onError || console.error,
|
|
1943
|
+
getGlobalBlockBlocks: P,
|
|
1944
|
+
getGlobalBlocks: T,
|
|
1915
1945
|
blocks: u,
|
|
1916
|
-
getUILibraryBlock:
|
|
1917
|
-
getUILibraryBlocks:
|
|
1918
|
-
brandingOptions:
|
|
1919
|
-
uiLibraries:
|
|
1920
|
-
saveAiContextCallback: async (
|
|
1921
|
-
onSaveStateChange: (
|
|
1946
|
+
getUILibraryBlock: _,
|
|
1947
|
+
getUILibraryBlocks: S,
|
|
1948
|
+
brandingOptions: g,
|
|
1949
|
+
uiLibraries: j,
|
|
1950
|
+
saveAiContextCallback: async (E) => (await we({ page: o, aiContext: E }), !0),
|
|
1951
|
+
onSaveStateChange: (E) => Ce(E),
|
|
1922
1952
|
aiContext: H,
|
|
1923
|
-
askAiCallBack:
|
|
1924
|
-
onSave: async ({ blocks:
|
|
1953
|
+
askAiCallBack: c,
|
|
1954
|
+
onSave: async ({ blocks: E, themeConfiguration: F }) => {
|
|
1925
1955
|
if (!o) return !0;
|
|
1926
|
-
const
|
|
1956
|
+
const $ = {
|
|
1927
1957
|
_type: "@chai/theme",
|
|
1928
1958
|
_value: F
|
|
1929
1959
|
}, le = {
|
|
1930
1960
|
_type: "@chai/ai-context",
|
|
1931
1961
|
_value: Fe(H) ? H : ""
|
|
1932
|
-
}, ce = [...
|
|
1933
|
-
return await
|
|
1962
|
+
}, ce = [...E, $, le];
|
|
1963
|
+
return await C({ page: o, blocks: ce }), !0;
|
|
1934
1964
|
},
|
|
1935
1965
|
topBarComponents: {
|
|
1936
1966
|
left: [
|
|
@@ -1941,9 +1971,9 @@ const Ja = (r) => {
|
|
|
1941
1971
|
className: "flex justify-start max-w-[250px] items-center w-full space-x-2 py-1",
|
|
1942
1972
|
onClick: () => oe(!0),
|
|
1943
1973
|
children: [
|
|
1944
|
-
|
|
1974
|
+
ve(a.slug, "/") ? /* @__PURE__ */ t.jsx(Tt, { className: "h-4 w-4" }) : /* @__PURE__ */ t.jsx(Nt, { className: "h-4 w-4" }),
|
|
1945
1975
|
/* @__PURE__ */ t.jsx("span", { className: "truncate", children: (a == null ? void 0 : a.name) ?? "" }),
|
|
1946
|
-
/* @__PURE__ */ t.jsx(
|
|
1976
|
+
/* @__PURE__ */ t.jsx(ka, { className: "h-4 w-4" })
|
|
1947
1977
|
]
|
|
1948
1978
|
},
|
|
1949
1979
|
"template-viewer"
|
|
@@ -1953,12 +1983,12 @@ const Ja = (r) => {
|
|
|
1953
1983
|
() => /* @__PURE__ */ t.jsxs(
|
|
1954
1984
|
B,
|
|
1955
1985
|
{
|
|
1956
|
-
disabled: ie ||
|
|
1986
|
+
disabled: ie || M !== "SAVED",
|
|
1957
1987
|
size: "sm",
|
|
1958
1988
|
variant: "default",
|
|
1959
1989
|
onClick: () => je(o),
|
|
1960
1990
|
children: [
|
|
1961
|
-
/* @__PURE__ */ t.jsx(
|
|
1991
|
+
/* @__PURE__ */ t.jsx(Na, { className: "h-4 w-4" }),
|
|
1962
1992
|
" ",
|
|
1963
1993
|
" ",
|
|
1964
1994
|
ie ? "Publishing..." : "Publish"
|
|
@@ -1969,10 +1999,10 @@ const Ja = (r) => {
|
|
|
1969
1999
|
},
|
|
1970
2000
|
sideBarComponents: {
|
|
1971
2001
|
top: [
|
|
1972
|
-
...
|
|
2002
|
+
...ve(a.slug, "/") ? [
|
|
1973
2003
|
{
|
|
1974
2004
|
label: "SEO Setting",
|
|
1975
|
-
component:
|
|
2005
|
+
component: Lt,
|
|
1976
2006
|
icon: /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs(
|
|
1977
2007
|
"svg",
|
|
1978
2008
|
{
|
|
@@ -1989,10 +2019,10 @@ const Ja = (r) => {
|
|
|
1989
2019
|
) })
|
|
1990
2020
|
}
|
|
1991
2021
|
] : [],
|
|
1992
|
-
...(Q =
|
|
2022
|
+
...(Q = n.languages) != null && Q.length && ve(a.slug, "/") ? [
|
|
1993
2023
|
{
|
|
1994
2024
|
label: "Language Pages",
|
|
1995
|
-
component:
|
|
2025
|
+
component: Wa,
|
|
1996
2026
|
icon: /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
|
|
1997
2027
|
"svg",
|
|
1998
2028
|
{
|
|
@@ -2022,22 +2052,22 @@ const Ja = (r) => {
|
|
|
2022
2052
|
] : []
|
|
2023
2053
|
]
|
|
2024
2054
|
},
|
|
2025
|
-
...
|
|
2055
|
+
...Ee
|
|
2026
2056
|
}
|
|
2027
2057
|
),
|
|
2028
2058
|
/* @__PURE__ */ t.jsx(
|
|
2029
|
-
|
|
2059
|
+
Ja,
|
|
2030
2060
|
{
|
|
2031
2061
|
activePage: o || "",
|
|
2032
|
-
canClose: !!o && !
|
|
2033
|
-
open: !o || !s &&
|
|
2062
|
+
canClose: !!o && !q(a),
|
|
2063
|
+
open: !o || !s && q(a) || Se,
|
|
2034
2064
|
close: () => oe(!1)
|
|
2035
2065
|
}
|
|
2036
2066
|
)
|
|
2037
2067
|
] });
|
|
2038
|
-
},
|
|
2068
|
+
}, pt = new ga({
|
|
2039
2069
|
defaultOptions: { queries: { refetchOnWindowFocus: !1 } }
|
|
2040
|
-
}),
|
|
2070
|
+
}), nn = (n) => (pt.setQueryData(["builder_props"], n), /* @__PURE__ */ t.jsx(ma, { client: pt, children: /* @__PURE__ */ t.jsx(Ya, { ...n }) }));
|
|
2041
2071
|
export {
|
|
2042
|
-
|
|
2072
|
+
nn as default
|
|
2043
2073
|
};
|