@chaibuilder/pages 0.1.0-beta.6 → 0.1.0-beta.7
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 +8 -8
- package/dist/index.js +382 -384
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import pt, { useState as I, useEffect as
|
|
1
|
+
import pt, { useState as I, useEffect as Be, useCallback as la, useMemo as ye, useRef as ca } from "react";
|
|
2
2
|
import { loadWebBlocks as ua } from "@chaibuilder/sdk/web-blocks";
|
|
3
|
-
import { getBlocksFromHTML as da, useLanguages as
|
|
4
|
-
import { useQueryClient as
|
|
5
|
-
import { useToast as
|
|
6
|
-
import { StarIcon as wa, PencilIcon as Et, TrashIcon as Ct, Plus as Sa, GlobeIcon as
|
|
7
|
-
import { get as
|
|
8
|
-
var
|
|
3
|
+
import { getBlocksFromHTML as da, useLanguages as Ue, ChaiBuilderEditor as ha } from "@chaibuilder/sdk";
|
|
4
|
+
import { useQueryClient as z, useQuery as ne, useMutation as re, QueryClient as fa, QueryClientProvider as pa } from "@tanstack/react-query";
|
|
5
|
+
import { useToast as J, Accordion as ga, AccordionItem as pe, AccordionTrigger as ge, AccordionContent as me, Label as _, Input as U, Textarea as ve, 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 kt, File as Nt, ArrowLeftRightIcon as Ea, RocketIcon as Ca } from "lucide-react";
|
|
7
|
+
import { get as G, find as se, isString as Fe, filter as ae, isEmpty as W, includes as xe, startCase as ka, reverse as Na, sortBy as Ta, isEqual as Le, map as Ge, toLower as Pa, trim as _a, orderBy as Oa } from "lodash-es";
|
|
8
|
+
var Ie = { exports: {} }, ee = {};
|
|
9
9
|
/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
@@ -20,12 +20,12 @@ function Ra() {
|
|
|
20
20
|
if (dt) return ee;
|
|
21
21
|
dt = 1;
|
|
22
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(
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
for (
|
|
27
|
-
if (
|
|
28
|
-
return { $$typeof: i, type:
|
|
23
|
+
function c(p, u, m) {
|
|
24
|
+
var h, g = {}, f = null, S = null;
|
|
25
|
+
m !== void 0 && (f = "" + m), u.key !== void 0 && (f = "" + u.key), u.ref !== void 0 && (S = u.ref);
|
|
26
|
+
for (h in u) a.call(u, h) && !w.hasOwnProperty(h) && (g[h] = u[h]);
|
|
27
|
+
if (p && p.defaultProps) for (h in u = p.defaultProps, u) g[h] === void 0 && (g[h] = u[h]);
|
|
28
|
+
return { $$typeof: i, type: p, key: f, ref: S, props: g, _owner: s.current };
|
|
29
29
|
}
|
|
30
30
|
return ee.Fragment = o, ee.jsx = c, ee.jsxs = c, ee;
|
|
31
31
|
}
|
|
@@ -42,24 +42,24 @@ var te = {};
|
|
|
42
42
|
var ht;
|
|
43
43
|
function Da() {
|
|
44
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"),
|
|
46
|
-
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"), p = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), T = Symbol.iterator, E = "@@iterator";
|
|
46
|
+
function A(e) {
|
|
47
47
|
if (e === null || typeof e != "object")
|
|
48
48
|
return null;
|
|
49
49
|
var n = T && e[T] || e[E];
|
|
50
50
|
return typeof n == "function" ? n : null;
|
|
51
51
|
}
|
|
52
|
-
var
|
|
52
|
+
var R = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
53
53
|
function b(e) {
|
|
54
54
|
{
|
|
55
55
|
for (var n = arguments.length, l = new Array(n > 1 ? n - 1 : 0), d = 1; d < n; d++)
|
|
56
56
|
l[d - 1] = arguments[d];
|
|
57
|
-
|
|
57
|
+
je("error", e, l);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function je(e, n, l) {
|
|
61
61
|
{
|
|
62
|
-
var d =
|
|
62
|
+
var d = R.ReactDebugCurrentFrame, y = d.getStackAddendum();
|
|
63
63
|
y !== "" && (n += "%s", l = l.concat([y]));
|
|
64
64
|
var j = l.map(function(x) {
|
|
65
65
|
return String(x);
|
|
@@ -67,26 +67,26 @@ function Da() {
|
|
|
67
67
|
j.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, j);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
var
|
|
71
|
-
|
|
70
|
+
var ie = !1, H = !1, we = !1, Se = !1, oe = !1, q;
|
|
71
|
+
q = Symbol.for("react.module.reference");
|
|
72
72
|
function Ee(e) {
|
|
73
|
-
return !!(typeof e == "string" || typeof e == "function" || e === a || e === w ||
|
|
73
|
+
return !!(typeof e == "string" || typeof e == "function" || e === a || e === w || oe || e === s || e === m || e === h || Se || e === S || ie || H || we || typeof e == "object" && e !== null && (e.$$typeof === f || e.$$typeof === g || e.$$typeof === c || e.$$typeof === p || 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 === q || e.getModuleId !== void 0));
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function Ce(e, n, l) {
|
|
80
80
|
var d = e.displayName;
|
|
81
81
|
if (d)
|
|
82
82
|
return d;
|
|
83
83
|
var y = n.displayName || n.name || "";
|
|
84
84
|
return y !== "" ? l + "(" + y + ")" : l;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function Q(e) {
|
|
87
87
|
return e.displayName || "Context";
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function C(e) {
|
|
90
90
|
if (e == null)
|
|
91
91
|
return null;
|
|
92
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")
|
|
@@ -102,28 +102,28 @@ function Da() {
|
|
|
102
102
|
return "Profiler";
|
|
103
103
|
case s:
|
|
104
104
|
return "StrictMode";
|
|
105
|
-
case
|
|
105
|
+
case m:
|
|
106
106
|
return "Suspense";
|
|
107
|
-
case
|
|
107
|
+
case h:
|
|
108
108
|
return "SuspenseList";
|
|
109
109
|
}
|
|
110
110
|
if (typeof e == "object")
|
|
111
111
|
switch (e.$$typeof) {
|
|
112
|
-
case
|
|
112
|
+
case p:
|
|
113
113
|
var n = e;
|
|
114
|
-
return
|
|
114
|
+
return Q(n) + ".Consumer";
|
|
115
115
|
case c:
|
|
116
116
|
var l = e;
|
|
117
|
-
return
|
|
117
|
+
return Q(l._context) + ".Provider";
|
|
118
118
|
case u:
|
|
119
|
-
return
|
|
120
|
-
case
|
|
119
|
+
return Ce(e, e.render, "ForwardRef");
|
|
120
|
+
case g:
|
|
121
121
|
var d = e.displayName || null;
|
|
122
|
-
return d !== null ? d :
|
|
123
|
-
case
|
|
122
|
+
return d !== null ? d : C(e.type) || "Memo";
|
|
123
|
+
case f: {
|
|
124
124
|
var y = e, j = y._payload, x = y._init;
|
|
125
125
|
try {
|
|
126
|
-
return
|
|
126
|
+
return C(x(j));
|
|
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
|
|
134
|
+
var F = Object.assign, M = 0, le, ce, Ke, Ve, We, ze, Je;
|
|
135
135
|
function Ye() {
|
|
136
136
|
}
|
|
137
137
|
Ye.__reactDisabledLog = !0;
|
|
138
138
|
function Ft() {
|
|
139
139
|
{
|
|
140
140
|
if (M === 0) {
|
|
141
|
-
|
|
141
|
+
le = console.log, ce = console.info, Ke = console.warn, Ve = console.error, We = console.group, ze = console.groupCollapsed, Je = console.groupEnd;
|
|
142
142
|
var e = {
|
|
143
143
|
configurable: !0,
|
|
144
144
|
enumerable: !0,
|
|
@@ -167,25 +167,25 @@ function Da() {
|
|
|
167
167
|
writable: !0
|
|
168
168
|
};
|
|
169
169
|
Object.defineProperties(console, {
|
|
170
|
-
log:
|
|
171
|
-
value:
|
|
170
|
+
log: F({}, e, {
|
|
171
|
+
value: le
|
|
172
172
|
}),
|
|
173
|
-
info:
|
|
174
|
-
value:
|
|
173
|
+
info: F({}, e, {
|
|
174
|
+
value: ce
|
|
175
175
|
}),
|
|
176
|
-
warn:
|
|
176
|
+
warn: F({}, e, {
|
|
177
177
|
value: Ke
|
|
178
178
|
}),
|
|
179
|
-
error:
|
|
179
|
+
error: F({}, e, {
|
|
180
180
|
value: Ve
|
|
181
181
|
}),
|
|
182
|
-
group:
|
|
182
|
+
group: F({}, e, {
|
|
183
183
|
value: We
|
|
184
184
|
}),
|
|
185
|
-
groupCollapsed:
|
|
185
|
+
groupCollapsed: F({}, e, {
|
|
186
186
|
value: ze
|
|
187
187
|
}),
|
|
188
|
-
groupEnd:
|
|
188
|
+
groupEnd: F({}, e, {
|
|
189
189
|
value: Je
|
|
190
190
|
})
|
|
191
191
|
});
|
|
@@ -193,8 +193,8 @@ function Da() {
|
|
|
193
193
|
M < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
var
|
|
197
|
-
function
|
|
196
|
+
var ke = R.ReactCurrentDispatcher, Ne;
|
|
197
|
+
function ue(e, n, l) {
|
|
198
198
|
{
|
|
199
199
|
if (Ne === void 0)
|
|
200
200
|
try {
|
|
@@ -207,16 +207,16 @@ function Da() {
|
|
|
207
207
|
` + Ne + e;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
var Te = !1,
|
|
210
|
+
var Te = !1, de;
|
|
211
211
|
{
|
|
212
212
|
var It = typeof WeakMap == "function" ? WeakMap : Map;
|
|
213
|
-
|
|
213
|
+
de = new It();
|
|
214
214
|
}
|
|
215
215
|
function He(e, n) {
|
|
216
216
|
if (!e || Te)
|
|
217
217
|
return "";
|
|
218
218
|
{
|
|
219
|
-
var l =
|
|
219
|
+
var l = de.get(e);
|
|
220
220
|
if (l !== void 0)
|
|
221
221
|
return l;
|
|
222
222
|
}
|
|
@@ -225,7 +225,7 @@ function Da() {
|
|
|
225
225
|
var y = Error.prepareStackTrace;
|
|
226
226
|
Error.prepareStackTrace = void 0;
|
|
227
227
|
var j;
|
|
228
|
-
j =
|
|
228
|
+
j = ke.current, ke.current = null, Ft();
|
|
229
229
|
try {
|
|
230
230
|
if (n) {
|
|
231
231
|
var x = function() {
|
|
@@ -238,50 +238,50 @@ function Da() {
|
|
|
238
238
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
239
239
|
try {
|
|
240
240
|
Reflect.construct(x, []);
|
|
241
|
-
} catch (
|
|
242
|
-
d =
|
|
241
|
+
} catch (O) {
|
|
242
|
+
d = O;
|
|
243
243
|
}
|
|
244
244
|
Reflect.construct(e, [], x);
|
|
245
245
|
} else {
|
|
246
246
|
try {
|
|
247
247
|
x.call();
|
|
248
|
-
} catch (
|
|
249
|
-
d =
|
|
248
|
+
} catch (O) {
|
|
249
|
+
d = O;
|
|
250
250
|
}
|
|
251
251
|
e.call(x.prototype);
|
|
252
252
|
}
|
|
253
253
|
} else {
|
|
254
254
|
try {
|
|
255
255
|
throw Error();
|
|
256
|
-
} catch (
|
|
257
|
-
d =
|
|
256
|
+
} catch (O) {
|
|
257
|
+
d = O;
|
|
258
258
|
}
|
|
259
259
|
e();
|
|
260
260
|
}
|
|
261
|
-
} catch (
|
|
262
|
-
if (
|
|
263
|
-
for (var v =
|
|
261
|
+
} catch (O) {
|
|
262
|
+
if (O && d && typeof O.stack == "string") {
|
|
263
|
+
for (var v = O.stack.split(`
|
|
264
264
|
`), P = d.stack.split(`
|
|
265
|
-
`),
|
|
265
|
+
`), k = v.length - 1, N = P.length - 1; k >= 1 && N >= 0 && v[k] !== P[N]; )
|
|
266
266
|
N--;
|
|
267
|
-
for (;
|
|
268
|
-
if (v[
|
|
269
|
-
if (
|
|
267
|
+
for (; k >= 1 && N >= 0; k--, N--)
|
|
268
|
+
if (v[k] !== P[N]) {
|
|
269
|
+
if (k !== 1 || N !== 1)
|
|
270
270
|
do
|
|
271
|
-
if (
|
|
271
|
+
if (k--, N--, N < 0 || v[k] !== P[N]) {
|
|
272
272
|
var L = `
|
|
273
|
-
` + v[
|
|
274
|
-
return e.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
273
|
+
` + v[k].replace(" at new ", " at ");
|
|
274
|
+
return e.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", e.displayName)), typeof e == "function" && de.set(e, L), L;
|
|
275
275
|
}
|
|
276
|
-
while (
|
|
276
|
+
while (k >= 1 && N >= 0);
|
|
277
277
|
break;
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
} finally {
|
|
281
|
-
Te = !1,
|
|
281
|
+
Te = !1, ke.current = j, Lt(), Error.prepareStackTrace = y;
|
|
282
282
|
}
|
|
283
|
-
var
|
|
284
|
-
return typeof e == "function" &&
|
|
283
|
+
var V = e ? e.displayName || e.name : "", $ = V ? ue(V) : "";
|
|
284
|
+
return typeof e == "function" && de.set(e, $), $;
|
|
285
285
|
}
|
|
286
286
|
function Bt(e, n, l) {
|
|
287
287
|
return He(e, !1);
|
|
@@ -290,39 +290,39 @@ function Da() {
|
|
|
290
290
|
var n = e.prototype;
|
|
291
291
|
return !!(n && n.isReactComponent);
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function he(e, n, l) {
|
|
294
294
|
if (e == null)
|
|
295
295
|
return "";
|
|
296
296
|
if (typeof e == "function")
|
|
297
297
|
return He(e, Ut(e));
|
|
298
298
|
if (typeof e == "string")
|
|
299
|
-
return
|
|
299
|
+
return ue(e);
|
|
300
300
|
switch (e) {
|
|
301
|
-
case
|
|
302
|
-
return
|
|
303
|
-
case
|
|
304
|
-
return
|
|
301
|
+
case m:
|
|
302
|
+
return ue("Suspense");
|
|
303
|
+
case h:
|
|
304
|
+
return ue("SuspenseList");
|
|
305
305
|
}
|
|
306
306
|
if (typeof e == "object")
|
|
307
307
|
switch (e.$$typeof) {
|
|
308
308
|
case u:
|
|
309
309
|
return Bt(e.render);
|
|
310
|
-
case
|
|
311
|
-
return
|
|
312
|
-
case
|
|
310
|
+
case g:
|
|
311
|
+
return he(e.type, n, l);
|
|
312
|
+
case f: {
|
|
313
313
|
var d = e, y = d._payload, j = d._init;
|
|
314
314
|
try {
|
|
315
|
-
return
|
|
315
|
+
return he(j(y), n, l);
|
|
316
316
|
} catch {
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
return "";
|
|
321
321
|
}
|
|
322
|
-
var X = Object.prototype.hasOwnProperty, Qe = {}, Xe =
|
|
323
|
-
function
|
|
322
|
+
var X = Object.prototype.hasOwnProperty, Qe = {}, Xe = R.ReactDebugCurrentFrame;
|
|
323
|
+
function fe(e) {
|
|
324
324
|
if (e) {
|
|
325
|
-
var n = e._owner, l =
|
|
325
|
+
var n = e._owner, l = he(e.type, e._source, n ? n.type : null);
|
|
326
326
|
Xe.setExtraStackFrame(l);
|
|
327
327
|
} else
|
|
328
328
|
Xe.setExtraStackFrame(null);
|
|
@@ -339,15 +339,15 @@ function Da() {
|
|
|
339
339
|
throw P.name = "Invariant Violation", P;
|
|
340
340
|
}
|
|
341
341
|
v = e[x](n, x, d, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
342
|
-
} catch (
|
|
343
|
-
v =
|
|
342
|
+
} catch (k) {
|
|
343
|
+
v = k;
|
|
344
344
|
}
|
|
345
|
-
v && !(v instanceof Error) && (
|
|
345
|
+
v && !(v instanceof Error) && (fe(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), fe(null)), v instanceof Error && !(v.message in Qe) && (Qe[v.message] = !0, fe(y), b("Failed %s type: %s", l, v.message), fe(null));
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
var qt = Array.isArray;
|
|
350
|
-
function
|
|
350
|
+
function Pe(e) {
|
|
351
351
|
return qt(e);
|
|
352
352
|
}
|
|
353
353
|
function Mt(e) {
|
|
@@ -370,13 +370,13 @@ function Da() {
|
|
|
370
370
|
if ($t(e))
|
|
371
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);
|
|
372
372
|
}
|
|
373
|
-
var Z =
|
|
373
|
+
var Z = R.ReactCurrentOwner, Kt = {
|
|
374
374
|
key: !0,
|
|
375
375
|
ref: !0,
|
|
376
376
|
__self: !0,
|
|
377
377
|
__source: !0
|
|
378
|
-
}, tt, at,
|
|
379
|
-
|
|
378
|
+
}, tt, at, _e;
|
|
379
|
+
_e = {};
|
|
380
380
|
function Vt(e) {
|
|
381
381
|
if (X.call(e, "ref")) {
|
|
382
382
|
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
@@ -395,8 +395,8 @@ function Da() {
|
|
|
395
395
|
}
|
|
396
396
|
function zt(e, n) {
|
|
397
397
|
if (typeof e.ref == "string" && Z.current && n && Z.current.stateNode !== n) {
|
|
398
|
-
var l =
|
|
399
|
-
|
|
398
|
+
var l = C(Z.current.type);
|
|
399
|
+
_e[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', C(Z.current.type), e.ref), _e[l] = !0);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
function Jt(e, n) {
|
|
@@ -457,9 +457,9 @@ function Da() {
|
|
|
457
457
|
for (j in n)
|
|
458
458
|
X.call(n, j) && !Kt.hasOwnProperty(j) && (x[j] = n[j]);
|
|
459
459
|
if (e && e.defaultProps) {
|
|
460
|
-
var
|
|
461
|
-
for (j in
|
|
462
|
-
x[j] === void 0 && (x[j] =
|
|
460
|
+
var k = e.defaultProps;
|
|
461
|
+
for (j in k)
|
|
462
|
+
x[j] === void 0 && (x[j] = k[j]);
|
|
463
463
|
}
|
|
464
464
|
if (v || P) {
|
|
465
465
|
var N = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
@@ -468,23 +468,23 @@ function Da() {
|
|
|
468
468
|
return Ht(e, v, P, y, d, Z.current, x);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
var
|
|
472
|
-
function
|
|
471
|
+
var Oe = R.ReactCurrentOwner, nt = R.ReactDebugCurrentFrame;
|
|
472
|
+
function K(e) {
|
|
473
473
|
if (e) {
|
|
474
|
-
var n = e._owner, l =
|
|
474
|
+
var n = e._owner, l = he(e.type, e._source, n ? n.type : null);
|
|
475
475
|
nt.setExtraStackFrame(l);
|
|
476
476
|
} else
|
|
477
477
|
nt.setExtraStackFrame(null);
|
|
478
478
|
}
|
|
479
|
-
var
|
|
480
|
-
|
|
481
|
-
function
|
|
479
|
+
var Re;
|
|
480
|
+
Re = !1;
|
|
481
|
+
function De(e) {
|
|
482
482
|
return typeof e == "object" && e !== null && e.$$typeof === i;
|
|
483
483
|
}
|
|
484
484
|
function rt() {
|
|
485
485
|
{
|
|
486
|
-
if (
|
|
487
|
-
var e =
|
|
486
|
+
if (Oe.current) {
|
|
487
|
+
var e = C(Oe.current.type);
|
|
488
488
|
if (e)
|
|
489
489
|
return `
|
|
490
490
|
|
|
@@ -519,25 +519,25 @@ Check the top-level render call using <` + l + ">.");
|
|
|
519
519
|
return;
|
|
520
520
|
st[l] = !0;
|
|
521
521
|
var d = "";
|
|
522
|
-
e && e._owner && e._owner !==
|
|
522
|
+
e && e._owner && e._owner !== Oe.current && (d = " It was passed a child from " + C(e._owner.type) + "."), K(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), K(null);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
function ot(e, n) {
|
|
526
526
|
{
|
|
527
527
|
if (typeof e != "object")
|
|
528
528
|
return;
|
|
529
|
-
if (
|
|
529
|
+
if (Pe(e))
|
|
530
530
|
for (var l = 0; l < e.length; l++) {
|
|
531
531
|
var d = e[l];
|
|
532
|
-
|
|
532
|
+
De(d) && it(d, n);
|
|
533
533
|
}
|
|
534
|
-
else if (
|
|
534
|
+
else if (De(e))
|
|
535
535
|
e._store && (e._store.validated = !0);
|
|
536
536
|
else if (e) {
|
|
537
|
-
var y =
|
|
537
|
+
var y = A(e);
|
|
538
538
|
if (typeof y == "function" && y !== e.entries)
|
|
539
539
|
for (var j = y.call(e), x; !(x = j.next()).done; )
|
|
540
|
-
|
|
540
|
+
De(x.value) && it(x.value, n);
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
}
|
|
@@ -551,16 +551,16 @@ Check the top-level render call using <` + l + ">.");
|
|
|
551
551
|
l = n.propTypes;
|
|
552
552
|
else if (typeof n == "object" && (n.$$typeof === u || // Note: Memo only checks outer props here.
|
|
553
553
|
// Inner props are checked in the reconciler.
|
|
554
|
-
n.$$typeof ===
|
|
554
|
+
n.$$typeof === g))
|
|
555
555
|
l = n.propTypes;
|
|
556
556
|
else
|
|
557
557
|
return;
|
|
558
558
|
if (l) {
|
|
559
|
-
var d =
|
|
559
|
+
var d = C(n);
|
|
560
560
|
Gt(l, e.props, "prop", d, e);
|
|
561
|
-
} else if (n.PropTypes !== void 0 && !
|
|
562
|
-
|
|
563
|
-
var y =
|
|
561
|
+
} else if (n.PropTypes !== void 0 && !Re) {
|
|
562
|
+
Re = !0;
|
|
563
|
+
var y = C(n);
|
|
564
564
|
b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", y || "Unknown");
|
|
565
565
|
}
|
|
566
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.");
|
|
@@ -571,11 +571,11 @@ Check the top-level render call using <` + l + ">.");
|
|
|
571
571
|
for (var n = Object.keys(e.props), l = 0; l < n.length; l++) {
|
|
572
572
|
var d = n[l];
|
|
573
573
|
if (d !== "children" && d !== "key") {
|
|
574
|
-
|
|
574
|
+
K(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", d), K(null);
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
|
-
e.ref !== null && (
|
|
578
|
+
e.ref !== null && (K(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
581
|
var lt = {};
|
|
@@ -587,8 +587,8 @@ Check the top-level render call using <` + l + ">.");
|
|
|
587
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
588
|
var P = Xt();
|
|
589
589
|
P ? v += P : v += rt();
|
|
590
|
-
var
|
|
591
|
-
e === null ?
|
|
590
|
+
var k;
|
|
591
|
+
e === null ? k = "null" : Pe(e) ? k = "array" : e !== void 0 && e.$$typeof === i ? (k = "<" + (C(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : k = 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", k, v);
|
|
592
592
|
}
|
|
593
593
|
var N = Qt(e, n, l, y, j);
|
|
594
594
|
if (N == null)
|
|
@@ -597,9 +597,9 @@ Check the top-level render call using <` + l + ">.");
|
|
|
597
597
|
var L = n.children;
|
|
598
598
|
if (L !== void 0)
|
|
599
599
|
if (d)
|
|
600
|
-
if (
|
|
601
|
-
for (var
|
|
602
|
-
ot(L[
|
|
600
|
+
if (Pe(L)) {
|
|
601
|
+
for (var V = 0; V < L.length; V++)
|
|
602
|
+
ot(L[V], e);
|
|
603
603
|
Object.freeze && Object.freeze(L);
|
|
604
604
|
} else
|
|
605
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.");
|
|
@@ -607,17 +607,17 @@ Check the top-level render call using <` + l + ">.");
|
|
|
607
607
|
ot(L, e);
|
|
608
608
|
}
|
|
609
609
|
if (X.call(n, "key")) {
|
|
610
|
-
var $ =
|
|
610
|
+
var $ = C(e), O = Object.keys(n).filter(function(oa) {
|
|
611
611
|
return oa !== "key";
|
|
612
|
-
}),
|
|
613
|
-
if (!lt[$ +
|
|
614
|
-
var ia =
|
|
612
|
+
}), Ae = O.length > 0 ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
613
|
+
if (!lt[$ + Ae]) {
|
|
614
|
+
var ia = O.length > 0 ? "{" + O.join(": ..., ") + ": ...}" : "{}";
|
|
615
615
|
b(`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} />`, Ae, $, ia, $), lt[$ + Ae] = !0;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
623
|
return e === a ? ta(N) : ea(N), N;
|
|
@@ -633,17 +633,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
633
633
|
te.Fragment = a, te.jsx = ra, te.jsxs = sa;
|
|
634
634
|
}()), te;
|
|
635
635
|
}
|
|
636
|
-
process.env.NODE_ENV === "production" ?
|
|
637
|
-
var t =
|
|
636
|
+
process.env.NODE_ENV === "production" ? Ie.exports = Ra() : Ie.exports = Da();
|
|
637
|
+
var t = Ie.exports;
|
|
638
638
|
const Aa = (r, i) => {
|
|
639
|
-
const a =
|
|
640
|
-
return
|
|
641
|
-
},
|
|
642
|
-
function
|
|
639
|
+
const a = z().getQueryData(["builder_props"]);
|
|
640
|
+
return G(a, r, i);
|
|
641
|
+
}, D = () => Aa("apiUrl", "/chai/api");
|
|
642
|
+
function Y() {
|
|
643
643
|
const [r, i] = I(
|
|
644
644
|
new URLSearchParams(window.location.search)
|
|
645
645
|
);
|
|
646
|
-
return
|
|
646
|
+
return Be(() => {
|
|
647
647
|
const o = () => {
|
|
648
648
|
i(new URLSearchParams(window.location.search));
|
|
649
649
|
};
|
|
@@ -652,8 +652,8 @@ function H() {
|
|
|
652
652
|
};
|
|
653
653
|
}, []), [r, i];
|
|
654
654
|
}
|
|
655
|
-
const
|
|
656
|
-
const [r] =
|
|
655
|
+
const Tt = () => {
|
|
656
|
+
const [r] = Y(), i = r.get("page"), o = D();
|
|
657
657
|
return ne({
|
|
658
658
|
queryKey: ["page", i],
|
|
659
659
|
initialData: [],
|
|
@@ -668,38 +668,38 @@ const kt = () => {
|
|
|
668
668
|
enabled: !!i
|
|
669
669
|
});
|
|
670
670
|
}, Pt = () => {
|
|
671
|
-
const r =
|
|
671
|
+
const r = D(), i = z(), { toast: o } = J(), { data: a } = Tt(), [s] = Y(), w = s.get("page"), c = 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: p } = re({
|
|
676
|
+
mutationFn: async ({ page: u, aiContext: m }) => {
|
|
677
|
+
const h = {
|
|
678
678
|
_type: "@chai/ai-context",
|
|
679
|
-
_value:
|
|
680
|
-
},
|
|
679
|
+
_value: Fe(m) ? m : ""
|
|
680
|
+
}, g = ae(
|
|
681
681
|
a,
|
|
682
|
-
(S) => (S == null ? void 0 : S._type) !==
|
|
682
|
+
(S) => (S == null ? void 0 : S._type) !== h._type
|
|
683
683
|
);
|
|
684
|
-
return
|
|
684
|
+
return g.push(h), await fetch(r, {
|
|
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: g }
|
|
690
690
|
})
|
|
691
691
|
});
|
|
692
692
|
},
|
|
693
|
-
onSuccess: (u, { aiContext:
|
|
693
|
+
onSuccess: (u, { aiContext: m }) => {
|
|
694
694
|
i.setQueryData(["page", w], () => {
|
|
695
|
-
const
|
|
695
|
+
const h = {
|
|
696
696
|
_type: "@chai/ai-context",
|
|
697
|
-
_value:
|
|
698
|
-
},
|
|
697
|
+
_value: Fe(m) ? m : ""
|
|
698
|
+
}, g = ae(
|
|
699
699
|
a,
|
|
700
|
-
(
|
|
700
|
+
(f) => (f == null ? void 0 : f._type) !== h._type
|
|
701
701
|
);
|
|
702
|
-
return
|
|
702
|
+
return g.push(h), g;
|
|
703
703
|
}), o({ title: "AI context updated successfully." });
|
|
704
704
|
},
|
|
705
705
|
onError: (u) => {
|
|
@@ -710,12 +710,12 @@ const kt = () => {
|
|
|
710
710
|
});
|
|
711
711
|
}
|
|
712
712
|
});
|
|
713
|
-
return { aiContext: c, updateAiContext:
|
|
713
|
+
return { aiContext: c, updateAiContext: p };
|
|
714
714
|
}, Fa = () => {
|
|
715
|
-
const r =
|
|
715
|
+
const r = D(), { aiContext: i } = Pt();
|
|
716
716
|
return la(
|
|
717
717
|
async (o, a, s, w) => {
|
|
718
|
-
const
|
|
718
|
+
const p = await (await fetch(r, {
|
|
719
719
|
method: "POST",
|
|
720
720
|
headers: {
|
|
721
721
|
"Content-Type": "application/json"
|
|
@@ -725,29 +725,29 @@ const kt = () => {
|
|
|
725
725
|
data: { type: o, prompt: a, blocks: s, aiContext: i, lang: w }
|
|
726
726
|
})
|
|
727
727
|
})).json();
|
|
728
|
-
return console.log("data",
|
|
728
|
+
return console.log("data", p), p.error ? { error: new Error(p.error) } : p;
|
|
729
729
|
},
|
|
730
730
|
[r, i]
|
|
731
731
|
);
|
|
732
732
|
}, La = () => {
|
|
733
|
-
const r =
|
|
734
|
-
return { getUILibraryBlock: async (c,
|
|
735
|
-
const
|
|
736
|
-
c.url + (
|
|
733
|
+
const r = D(), { toast: i } = J(), o = z();
|
|
734
|
+
return { getUILibraryBlock: async (c, p) => {
|
|
735
|
+
const h = (await (await fetch(
|
|
736
|
+
c.url + (p.path ? "/blocks/" + p.path : "/" + p.uuid + ".html")
|
|
737
737
|
)).text()).replace(/---([\s\S]*?)---/g, "");
|
|
738
|
-
return da(`${
|
|
738
|
+
return da(`${h}`);
|
|
739
739
|
}, getUILibraryBlocks: async (c) => {
|
|
740
740
|
try {
|
|
741
|
-
return (await (await fetch(c.url + "/blocks.json")).json()).map((
|
|
742
|
-
...
|
|
743
|
-
preview: c.url.replace("chaiblocks", "") +
|
|
741
|
+
return (await (await fetch(c.url + "/blocks.json")).json()).map((m) => ({
|
|
742
|
+
...m,
|
|
743
|
+
preview: c.url.replace("chaiblocks", "") + m.preview
|
|
744
744
|
}));
|
|
745
|
-
} catch (
|
|
746
|
-
return console.error(
|
|
745
|
+
} catch (p) {
|
|
746
|
+
return console.error(p), [];
|
|
747
747
|
}
|
|
748
748
|
}, onSave: async ({
|
|
749
749
|
page: c,
|
|
750
|
-
blocks:
|
|
750
|
+
blocks: p
|
|
751
751
|
}) => {
|
|
752
752
|
try {
|
|
753
753
|
return (await fetch(r, {
|
|
@@ -755,9 +755,9 @@ const kt = () => {
|
|
|
755
755
|
headers: { "Content-Type": "application/json" },
|
|
756
756
|
body: JSON.stringify({
|
|
757
757
|
action: "UPDATE_PAGE",
|
|
758
|
-
data: { id: c, blocks:
|
|
758
|
+
data: { id: c, blocks: p }
|
|
759
759
|
})
|
|
760
|
-
})).ok ? (o.setQueryData(["page", c],
|
|
760
|
+
})).ok ? (o.setQueryData(["page", c], p), i({
|
|
761
761
|
title: "Success",
|
|
762
762
|
description: "Page saved successfully",
|
|
763
763
|
variant: "default"
|
|
@@ -766,8 +766,8 @@ const kt = () => {
|
|
|
766
766
|
return u;
|
|
767
767
|
}
|
|
768
768
|
} };
|
|
769
|
-
},
|
|
770
|
-
const r =
|
|
769
|
+
}, qe = () => {
|
|
770
|
+
const r = D();
|
|
771
771
|
return ne({
|
|
772
772
|
queryKey: ["project-pages"],
|
|
773
773
|
staleTime: 1e3 * 60 * 5,
|
|
@@ -782,8 +782,8 @@ const kt = () => {
|
|
|
782
782
|
})).json()
|
|
783
783
|
});
|
|
784
784
|
}, _t = () => {
|
|
785
|
-
const [r] =
|
|
786
|
-
return { data:
|
|
785
|
+
const [r] = Y(), i = r.get("page"), { data: o, isFetching: a } = qe();
|
|
786
|
+
return { data: ye(
|
|
787
787
|
() => se(o, { id: i }) || {},
|
|
788
788
|
[o, i]
|
|
789
789
|
), isFetching: a };
|
|
@@ -802,19 +802,19 @@ const kt = () => {
|
|
|
802
802
|
url: "https://chaibuilder.com/chaiblocks"
|
|
803
803
|
}
|
|
804
804
|
]
|
|
805
|
-
}), Ba = (r) =>
|
|
806
|
-
if (!r ||
|
|
805
|
+
}), Ba = (r) => ye(() => {
|
|
806
|
+
if (!r || W(r))
|
|
807
807
|
return {
|
|
808
808
|
blocks: [],
|
|
809
809
|
theme: {}
|
|
810
810
|
};
|
|
811
|
-
const i = se(r, { _type: "@chai/theme" }), o =
|
|
811
|
+
const i = se(r, { _type: "@chai/theme" }), o = G(i, "_value", {}) || {}, a = ae(
|
|
812
812
|
r,
|
|
813
|
-
(s) => !
|
|
813
|
+
(s) => !xe(s == null ? void 0 : s._type, "@chai/")
|
|
814
814
|
);
|
|
815
815
|
return { theme: o, blocks: a };
|
|
816
816
|
}, [r]), Ot = () => {
|
|
817
|
-
const r =
|
|
817
|
+
const r = D();
|
|
818
818
|
return ne({
|
|
819
819
|
queryKey: ["project-config"],
|
|
820
820
|
initialData: { theme: {} },
|
|
@@ -827,13 +827,13 @@ const kt = () => {
|
|
|
827
827
|
})).json()
|
|
828
828
|
});
|
|
829
829
|
}, Ua = () => {
|
|
830
|
-
const { data: r } =
|
|
830
|
+
const { data: r } = qe(), i = D();
|
|
831
831
|
return {
|
|
832
832
|
getGlobalBlocks: async () => {
|
|
833
833
|
const o = {};
|
|
834
834
|
for (const a of r ?? [])
|
|
835
|
-
|
|
836
|
-
name:
|
|
835
|
+
W(a == null ? void 0 : a.slug) && (o[a.id] = {
|
|
836
|
+
name: ka(a.name ?? a.slug),
|
|
837
837
|
description: ""
|
|
838
838
|
});
|
|
839
839
|
return o;
|
|
@@ -848,7 +848,7 @@ const kt = () => {
|
|
|
848
848
|
})).json()).blocks : []
|
|
849
849
|
};
|
|
850
850
|
}, Ga = () => {
|
|
851
|
-
const r =
|
|
851
|
+
const r = D();
|
|
852
852
|
return { uploadFile: async (o) => {
|
|
853
853
|
const a = new FormData();
|
|
854
854
|
return a.append("action", "UPLOAD_FILE"), a.append("file", o), (await fetch(r, {
|
|
@@ -857,7 +857,7 @@ const kt = () => {
|
|
|
857
857
|
})).json();
|
|
858
858
|
} };
|
|
859
859
|
}, qa = () => {
|
|
860
|
-
const r =
|
|
860
|
+
const r = D(), { toast: i } = J();
|
|
861
861
|
return re({
|
|
862
862
|
mutationFn: async (o) => (await fetch(`${r}`, {
|
|
863
863
|
method: "POST",
|
|
@@ -874,8 +874,8 @@ const kt = () => {
|
|
|
874
874
|
});
|
|
875
875
|
}
|
|
876
876
|
});
|
|
877
|
-
},
|
|
878
|
-
const r =
|
|
877
|
+
}, Me = () => {
|
|
878
|
+
const r = D(), [i] = Y(), o = i.get("page");
|
|
879
879
|
return ne({
|
|
880
880
|
queryKey: ["language-pages", o],
|
|
881
881
|
initialData: [],
|
|
@@ -889,10 +889,10 @@ const kt = () => {
|
|
|
889
889
|
data: { id: o }
|
|
890
890
|
})
|
|
891
891
|
})).json();
|
|
892
|
-
return Ta(
|
|
892
|
+
return Na(Ta(s, "primaryPage"));
|
|
893
893
|
}
|
|
894
894
|
});
|
|
895
|
-
},
|
|
895
|
+
}, be = {
|
|
896
896
|
ab: "Abkhazian",
|
|
897
897
|
aa: "Afar",
|
|
898
898
|
af: "Afrikaans",
|
|
@@ -1081,7 +1081,7 @@ const kt = () => {
|
|
|
1081
1081
|
za: "Zhuang, Chuang",
|
|
1082
1082
|
zu: "Zulu"
|
|
1083
1083
|
}, Rt = () => {
|
|
1084
|
-
const r =
|
|
1084
|
+
const r = D(), i = z(), { toast: o } = J();
|
|
1085
1085
|
return re({
|
|
1086
1086
|
mutationFn: async (a) => await (await fetch(r, {
|
|
1087
1087
|
method: "POST",
|
|
@@ -1108,8 +1108,8 @@ const kt = () => {
|
|
|
1108
1108
|
});
|
|
1109
1109
|
}
|
|
1110
1110
|
});
|
|
1111
|
-
},
|
|
1112
|
-
const r =
|
|
1111
|
+
}, $e = () => {
|
|
1112
|
+
const r = D(), i = z(), { toast: o } = J();
|
|
1113
1113
|
return re({
|
|
1114
1114
|
mutationFn: async (a) => (await fetch(r, {
|
|
1115
1115
|
method: "POST",
|
|
@@ -1139,7 +1139,7 @@ const kt = () => {
|
|
|
1139
1139
|
}
|
|
1140
1140
|
});
|
|
1141
1141
|
}, Dt = () => {
|
|
1142
|
-
const r =
|
|
1142
|
+
const r = D(), i = z(), { toast: o } = J();
|
|
1143
1143
|
return re({
|
|
1144
1144
|
mutationFn: async (a) => (await fetch(r, {
|
|
1145
1145
|
method: "POST",
|
|
@@ -1167,8 +1167,8 @@ const kt = () => {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
});
|
|
1169
1169
|
}, Ma = () => {
|
|
1170
|
-
const { selectedLang: r } =
|
|
1171
|
-
return { data:
|
|
1170
|
+
const { selectedLang: r } = Ue(), { data: i, isFetching: o } = Me();
|
|
1171
|
+
return { data: ye(() => se(i, { lang: r || "" }) || {}, [i, r]), isFetching: o };
|
|
1172
1172
|
}, At = () => {
|
|
1173
1173
|
const { data: r, isFetching: i } = Ma(), o = r == null ? void 0 : r.seo, [a, s] = I({
|
|
1174
1174
|
seoTitle: "",
|
|
@@ -1183,8 +1183,8 @@ const kt = () => {
|
|
|
1183
1183
|
searchDescription: "",
|
|
1184
1184
|
jsonLD: "",
|
|
1185
1185
|
...o
|
|
1186
|
-
}), w = ca({ initial: a, updated: a }), { selectedLang: c, fallbackLang:
|
|
1187
|
-
|
|
1186
|
+
}), w = ca({ initial: a, updated: a }), { selectedLang: c, fallbackLang: p } = Ue(), u = c.length ? c : p, { mutate: m, isPending: h } = $e(), g = h;
|
|
1187
|
+
Be(() => {
|
|
1188
1188
|
!i && o && s({
|
|
1189
1189
|
seoTitle: "",
|
|
1190
1190
|
seoDescription: "",
|
|
@@ -1200,8 +1200,8 @@ const kt = () => {
|
|
|
1200
1200
|
...o
|
|
1201
1201
|
});
|
|
1202
1202
|
}, [i, o]);
|
|
1203
|
-
const
|
|
1204
|
-
|
|
1203
|
+
const f = async () => {
|
|
1204
|
+
m({ id: r == null ? void 0 : r.id, seo: a }), w.current.initial = a, w.current.updated = a;
|
|
1205
1205
|
}, S = () => {
|
|
1206
1206
|
s({
|
|
1207
1207
|
...a,
|
|
@@ -1214,23 +1214,23 @@ const kt = () => {
|
|
|
1214
1214
|
searchTitle: a.ogTitle,
|
|
1215
1215
|
searchDescription: a.ogDescription
|
|
1216
1216
|
});
|
|
1217
|
-
}, E = (
|
|
1218
|
-
const
|
|
1217
|
+
}, E = (A) => {
|
|
1218
|
+
const R = {
|
|
1219
1219
|
...a,
|
|
1220
|
-
[
|
|
1220
|
+
[A.target.name]: A.target.name === "noIndex" ? A.target.checked : A.target.value
|
|
1221
1221
|
};
|
|
1222
|
-
s(
|
|
1222
|
+
s(R), w.current.updated = R;
|
|
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:
|
|
1228
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-blue-500 font-semibold", children: G(be, u, u) })
|
|
1229
1229
|
] }),
|
|
1230
1230
|
/* @__PURE__ */ t.jsx("form", { className: "space-y-8", children: /* @__PURE__ */ t.jsxs(ga, { type: "multiple", defaultValue: ["page"], children: [
|
|
1231
|
-
/* @__PURE__ */ t.jsxs(
|
|
1232
|
-
/* @__PURE__ */ t.jsx(
|
|
1233
|
-
/* @__PURE__ */ t.jsx(
|
|
1231
|
+
/* @__PURE__ */ t.jsxs(pe, { value: "page", children: [
|
|
1232
|
+
/* @__PURE__ */ t.jsx(ge, { className: "text-blue-500", children: "Seo Page" }),
|
|
1233
|
+
/* @__PURE__ */ t.jsx(me, { children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
|
|
1234
1234
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1235
1235
|
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "seoTitle", children: "SEO Title" }),
|
|
1236
1236
|
/* @__PURE__ */ t.jsx(
|
|
@@ -1241,7 +1241,7 @@ const kt = () => {
|
|
|
1241
1241
|
name: "seoTitle",
|
|
1242
1242
|
value: a.seoTitle,
|
|
1243
1243
|
onChange: E,
|
|
1244
|
-
disabled:
|
|
1244
|
+
disabled: g,
|
|
1245
1245
|
placeholder: "Enter SEO title"
|
|
1246
1246
|
}
|
|
1247
1247
|
),
|
|
@@ -1250,13 +1250,13 @@ const kt = () => {
|
|
|
1250
1250
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1251
1251
|
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "seoDescription", children: "SEO Description" }),
|
|
1252
1252
|
/* @__PURE__ */ t.jsx(
|
|
1253
|
-
|
|
1253
|
+
ve,
|
|
1254
1254
|
{
|
|
1255
1255
|
id: "seoDescription",
|
|
1256
1256
|
name: "seoDescription",
|
|
1257
1257
|
value: a.seoDescription,
|
|
1258
1258
|
onChange: E,
|
|
1259
|
-
disabled:
|
|
1259
|
+
disabled: g,
|
|
1260
1260
|
placeholder: "Enter SEO description"
|
|
1261
1261
|
}
|
|
1262
1262
|
),
|
|
@@ -1272,7 +1272,7 @@ const kt = () => {
|
|
|
1272
1272
|
name: "canonicalUrl",
|
|
1273
1273
|
value: a.canonicalUrl,
|
|
1274
1274
|
onChange: E,
|
|
1275
|
-
disabled:
|
|
1275
|
+
disabled: g,
|
|
1276
1276
|
placeholder: "Enter Canonical URL"
|
|
1277
1277
|
}
|
|
1278
1278
|
)
|
|
@@ -1287,7 +1287,7 @@ const kt = () => {
|
|
|
1287
1287
|
name: "noIndex",
|
|
1288
1288
|
checked: a.noIndex,
|
|
1289
1289
|
onChange: E,
|
|
1290
|
-
disabled:
|
|
1290
|
+
disabled: g,
|
|
1291
1291
|
className: "h-4 w-4"
|
|
1292
1292
|
}
|
|
1293
1293
|
),
|
|
@@ -1305,16 +1305,16 @@ const kt = () => {
|
|
|
1305
1305
|
name: "noFollow",
|
|
1306
1306
|
value: a.noFollow,
|
|
1307
1307
|
onChange: E,
|
|
1308
|
-
disabled:
|
|
1308
|
+
disabled: g,
|
|
1309
1309
|
placeholder: "Enter No follow"
|
|
1310
1310
|
}
|
|
1311
1311
|
)
|
|
1312
1312
|
] })
|
|
1313
1313
|
] }) })
|
|
1314
1314
|
] }),
|
|
1315
|
-
/* @__PURE__ */ t.jsxs(
|
|
1316
|
-
/* @__PURE__ */ t.jsx(
|
|
1317
|
-
/* @__PURE__ */ t.jsx(
|
|
1315
|
+
/* @__PURE__ */ t.jsxs(pe, { value: "og", children: [
|
|
1316
|
+
/* @__PURE__ */ t.jsx(ge, { className: "text-blue-500", children: "OG" }),
|
|
1317
|
+
/* @__PURE__ */ t.jsx(me, { children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
|
|
1318
1318
|
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ t.jsx(
|
|
1319
1319
|
B,
|
|
1320
1320
|
{
|
|
@@ -1335,7 +1335,7 @@ const kt = () => {
|
|
|
1335
1335
|
name: "ogTitle",
|
|
1336
1336
|
value: a.ogTitle,
|
|
1337
1337
|
onChange: E,
|
|
1338
|
-
disabled:
|
|
1338
|
+
disabled: g,
|
|
1339
1339
|
placeholder: "Enter OG title"
|
|
1340
1340
|
}
|
|
1341
1341
|
),
|
|
@@ -1344,13 +1344,13 @@ const kt = () => {
|
|
|
1344
1344
|
/* @__PURE__ */ t.jsxs("div", { className: "mt-4", children: [
|
|
1345
1345
|
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "ogDescription", children: "OG Description" }),
|
|
1346
1346
|
/* @__PURE__ */ t.jsx(
|
|
1347
|
-
|
|
1347
|
+
ve,
|
|
1348
1348
|
{
|
|
1349
1349
|
id: "ogDescription",
|
|
1350
1350
|
name: "ogDescription",
|
|
1351
1351
|
value: a.ogDescription,
|
|
1352
1352
|
onChange: E,
|
|
1353
|
-
disabled:
|
|
1353
|
+
disabled: g,
|
|
1354
1354
|
placeholder: "Enter OG description"
|
|
1355
1355
|
}
|
|
1356
1356
|
),
|
|
@@ -1366,7 +1366,7 @@ const kt = () => {
|
|
|
1366
1366
|
name: "ogImage",
|
|
1367
1367
|
value: a.ogImage,
|
|
1368
1368
|
onChange: E,
|
|
1369
|
-
disabled:
|
|
1369
|
+
disabled: g,
|
|
1370
1370
|
placeholder: "Enter OG image URL"
|
|
1371
1371
|
}
|
|
1372
1372
|
),
|
|
@@ -1374,9 +1374,9 @@ const kt = () => {
|
|
|
1374
1374
|
] })
|
|
1375
1375
|
] }) })
|
|
1376
1376
|
] }),
|
|
1377
|
-
/* @__PURE__ */ t.jsxs(
|
|
1378
|
-
/* @__PURE__ */ t.jsx(
|
|
1379
|
-
/* @__PURE__ */ t.jsx(
|
|
1377
|
+
/* @__PURE__ */ t.jsxs(pe, { value: "search", children: [
|
|
1378
|
+
/* @__PURE__ */ t.jsx(ge, { className: "text-blue-500", children: "Search" }),
|
|
1379
|
+
/* @__PURE__ */ t.jsx(me, { children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
|
|
1380
1380
|
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ t.jsx(
|
|
1381
1381
|
B,
|
|
1382
1382
|
{
|
|
@@ -1397,7 +1397,7 @@ const kt = () => {
|
|
|
1397
1397
|
name: "searchTitle",
|
|
1398
1398
|
value: a.searchTitle,
|
|
1399
1399
|
onChange: E,
|
|
1400
|
-
disabled:
|
|
1400
|
+
disabled: g,
|
|
1401
1401
|
placeholder: "Enter search title"
|
|
1402
1402
|
}
|
|
1403
1403
|
),
|
|
@@ -1406,7 +1406,7 @@ const kt = () => {
|
|
|
1406
1406
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1407
1407
|
/* @__PURE__ */ t.jsx(_, { className: "text-xs pb-1", htmlFor: "searchDescription", children: "Search Description" }),
|
|
1408
1408
|
/* @__PURE__ */ t.jsx(
|
|
1409
|
-
|
|
1409
|
+
ve,
|
|
1410
1410
|
{
|
|
1411
1411
|
id: "searchDescription",
|
|
1412
1412
|
name: "searchDescription",
|
|
@@ -1419,10 +1419,10 @@ const kt = () => {
|
|
|
1419
1419
|
] })
|
|
1420
1420
|
] }) })
|
|
1421
1421
|
] }),
|
|
1422
|
-
/* @__PURE__ */ t.jsxs(
|
|
1423
|
-
/* @__PURE__ */ t.jsx(
|
|
1424
|
-
/* @__PURE__ */ t.jsx(
|
|
1425
|
-
|
|
1422
|
+
/* @__PURE__ */ t.jsxs(pe, { value: "jsonLD", children: [
|
|
1423
|
+
/* @__PURE__ */ t.jsx(ge, { className: "text-blue-500", children: "JSON-LD" }),
|
|
1424
|
+
/* @__PURE__ */ t.jsx(me, { children: /* @__PURE__ */ t.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1425
|
+
ve,
|
|
1426
1426
|
{
|
|
1427
1427
|
id: "jsonLD",
|
|
1428
1428
|
name: "jsonLD",
|
|
@@ -1439,9 +1439,9 @@ const kt = () => {
|
|
|
1439
1439
|
{
|
|
1440
1440
|
size: "lg",
|
|
1441
1441
|
variant: "default",
|
|
1442
|
-
onClick:
|
|
1443
|
-
disabled:
|
|
1444
|
-
children:
|
|
1442
|
+
onClick: f,
|
|
1443
|
+
disabled: Le(w.current.initial, a) || g,
|
|
1444
|
+
children: h ? "Saving..." : "Save"
|
|
1445
1445
|
}
|
|
1446
1446
|
) })
|
|
1447
1447
|
] });
|
|
@@ -1452,11 +1452,11 @@ const $a = ({
|
|
|
1452
1452
|
onClose: i,
|
|
1453
1453
|
languagePages: o
|
|
1454
1454
|
}) => {
|
|
1455
|
-
const { data: a } = _t(), [s, w] = I(r.edit ? r.name : ""), [c,
|
|
1456
|
-
|
|
1457
|
-
(b) => !se(o, { lang: b }) && b !==
|
|
1458
|
-
),
|
|
1459
|
-
r.edit ?
|
|
1455
|
+
const { data: a } = _t(), [s, w] = I(r.edit ? r.name : ""), [c, p] = I(r.edit ? r.lang : ""), [u, m] = I(r.edit ? r.slug : ""), { mutate: h, isPending: g } = Rt(), { mutate: f, isPending: S } = $e(), T = g || S, { data: E } = Ot(), A = ae(
|
|
1456
|
+
G(E, "languages") || ["en"],
|
|
1457
|
+
(b) => !se(o, { lang: b }) && b !== G(E, "fallbackLang")
|
|
1458
|
+
), R = () => {
|
|
1459
|
+
r.edit ? f(
|
|
1460
1460
|
{
|
|
1461
1461
|
name: s,
|
|
1462
1462
|
slug: u,
|
|
@@ -1465,7 +1465,7 @@ const $a = ({
|
|
|
1465
1465
|
primaryPage: r == null ? void 0 : r.primaryPage
|
|
1466
1466
|
},
|
|
1467
1467
|
{ onSuccess: i }
|
|
1468
|
-
) :
|
|
1468
|
+
) : h(
|
|
1469
1469
|
{
|
|
1470
1470
|
name: s,
|
|
1471
1471
|
slug: u,
|
|
@@ -1488,12 +1488,12 @@ const $a = ({
|
|
|
1488
1488
|
"select",
|
|
1489
1489
|
{
|
|
1490
1490
|
value: c,
|
|
1491
|
-
disabled: r.edit ||
|
|
1492
|
-
onChange: (b) =>
|
|
1491
|
+
disabled: r.edit || W(A),
|
|
1492
|
+
onChange: (b) => p(b.target.value),
|
|
1493
1493
|
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
1494
|
children: [
|
|
1495
|
-
/* @__PURE__ */ t.jsx("option", { value: "", disabled: !0, selected: !0, children:
|
|
1496
|
-
|
|
1495
|
+
/* @__PURE__ */ t.jsx("option", { value: "", disabled: !0, selected: !0, children: W(A) ? "All available language page is created." : "Choose language" }),
|
|
1496
|
+
Ge(A, (b) => /* @__PURE__ */ t.jsx("option", { value: b, children: G(be, b, b) }, b))
|
|
1497
1497
|
]
|
|
1498
1498
|
}
|
|
1499
1499
|
)
|
|
@@ -1523,7 +1523,7 @@ const $a = ({
|
|
|
1523
1523
|
{
|
|
1524
1524
|
id: "slug",
|
|
1525
1525
|
value: u,
|
|
1526
|
-
onChange: (b) =>
|
|
1526
|
+
onChange: (b) => m(Pa(_a(b.target.value))),
|
|
1527
1527
|
className: "col-span-3",
|
|
1528
1528
|
required: !0,
|
|
1529
1529
|
pattern: "^/.*",
|
|
@@ -1536,7 +1536,7 @@ const $a = ({
|
|
|
1536
1536
|
/* @__PURE__ */ t.jsx(St, { children: /* @__PURE__ */ t.jsx(
|
|
1537
1537
|
B,
|
|
1538
1538
|
{
|
|
1539
|
-
onClick:
|
|
1539
|
+
onClick: R,
|
|
1540
1540
|
type: "button",
|
|
1541
1541
|
disabled: T || !c || !u || !u.startsWith("/"),
|
|
1542
1542
|
children: T ? r.edit ? "Updating..." : "Adding..." : r.edit ? "Update" : "Add new language"
|
|
@@ -1545,86 +1545,83 @@ const $a = ({
|
|
|
1545
1545
|
] })
|
|
1546
1546
|
] }) });
|
|
1547
1547
|
}, Ka = () => {
|
|
1548
|
-
const [r, i] = I(null), { selectedLang: o, fallbackLang: a, setSelectedLang: s, languages: w } =
|
|
1548
|
+
const [r, i] = I(null), { selectedLang: o, fallbackLang: a, setSelectedLang: s, languages: w } = Ue(), { data: c, isFetching: p } = Me(), { mutate: u, isPending: m } = Dt();
|
|
1549
1549
|
return /* @__PURE__ */ t.jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
1550
|
-
/* @__PURE__ */ t.
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
"
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
/* @__PURE__ */ t.jsxs("div", {
|
|
1566
|
-
/* @__PURE__ */ t.
|
|
1567
|
-
|
|
1568
|
-
/* @__PURE__ */ t.jsxs("
|
|
1569
|
-
"
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
/* @__PURE__ */ t.jsxs("
|
|
1576
|
-
"
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
g.name,
|
|
1580
|
-
" "
|
|
1581
|
-
] })
|
|
1550
|
+
/* @__PURE__ */ t.jsx("ul", { className: "space-y-2 mt-4", children: p ? /* @__PURE__ */ t.jsxs("div", { className: "w-full space-y-3 py-4", children: [
|
|
1551
|
+
/* @__PURE__ */ t.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
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
|
+
] }) : Ge(c, (h) => {
|
|
1555
|
+
const g = h.lang, f = h.slug, S = !h.primaryPage, T = g === o;
|
|
1556
|
+
return S ? null : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1557
|
+
/* @__PURE__ */ t.jsxs(
|
|
1558
|
+
"li",
|
|
1559
|
+
{
|
|
1560
|
+
className: `w-full p-2 rounded cursor-pointer flex items-center justify-between ${T ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
1561
|
+
onClick: () => s(g),
|
|
1562
|
+
children: [
|
|
1563
|
+
/* @__PURE__ */ t.jsxs("div", { className: " flex-1 gap-x-3", children: [
|
|
1564
|
+
/* @__PURE__ */ t.jsx("div", { className: "text-[13px]", children: G(be, S ? a : g, g) }),
|
|
1565
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1566
|
+
/* @__PURE__ */ t.jsxs("div", { className: "text-[11px] text-gray-500", children: [
|
|
1567
|
+
"Slug:",
|
|
1568
|
+
/* @__PURE__ */ t.jsxs("b", { children: [
|
|
1569
|
+
" ",
|
|
1570
|
+
f
|
|
1571
|
+
] })
|
|
1572
|
+
] }),
|
|
1573
|
+
/* @__PURE__ */ t.jsxs("div", { className: "text-[11px] text-gray-500", children: [
|
|
1574
|
+
"Name:",
|
|
1575
|
+
/* @__PURE__ */ t.jsxs("b", { children: [
|
|
1576
|
+
" ",
|
|
1577
|
+
h.name,
|
|
1578
|
+
" "
|
|
1582
1579
|
] })
|
|
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
1580
|
] })
|
|
1619
1581
|
] })
|
|
1620
|
-
]
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1582
|
+
] }),
|
|
1583
|
+
S ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
|
|
1584
|
+
/* @__PURE__ */ t.jsx(wa, { fill: "orange", className: "w-3 h-3" }),
|
|
1585
|
+
/* @__PURE__ */ t.jsx("b", { children: " Default" })
|
|
1586
|
+
] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
1587
|
+
/* @__PURE__ */ t.jsx(
|
|
1588
|
+
Et,
|
|
1589
|
+
{
|
|
1590
|
+
onClick: (E) => {
|
|
1591
|
+
E.stopPropagation(), i({ ...h, edit: !0 });
|
|
1592
|
+
},
|
|
1593
|
+
className: "w-3 h-3 hover:text-blue-500"
|
|
1594
|
+
}
|
|
1595
|
+
),
|
|
1596
|
+
/* @__PURE__ */ t.jsxs(gt, { children: [
|
|
1597
|
+
/* @__PURE__ */ t.jsx(mt, { children: /* @__PURE__ */ t.jsx(Ct, { className: "w-3 h-3 hover:text-red-500" }) }),
|
|
1598
|
+
/* @__PURE__ */ t.jsx(vt, { children: /* @__PURE__ */ t.jsxs("div", { children: [
|
|
1599
|
+
/* @__PURE__ */ t.jsxs("p", { className: "pb-2 text-sm", children: [
|
|
1600
|
+
"Are you sure you want to remove",
|
|
1601
|
+
" ",
|
|
1602
|
+
/* @__PURE__ */ t.jsx("b", { children: G(be, g, g) }),
|
|
1603
|
+
" language?"
|
|
1604
|
+
] }),
|
|
1605
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ t.jsx(
|
|
1606
|
+
B,
|
|
1607
|
+
{
|
|
1608
|
+
size: "sm",
|
|
1609
|
+
variant: "destructive",
|
|
1610
|
+
disabled: m,
|
|
1611
|
+
onClick: () => u(h),
|
|
1612
|
+
children: m ? "Deleting..." : "Delete"
|
|
1613
|
+
}
|
|
1614
|
+
) })
|
|
1615
|
+
] }) })
|
|
1616
|
+
] })
|
|
1617
|
+
] })
|
|
1618
|
+
]
|
|
1619
|
+
},
|
|
1620
|
+
h.id
|
|
1621
|
+
),
|
|
1622
|
+
/* @__PURE__ */ t.jsx("div", { className: "h-1 w-full border-b" })
|
|
1623
|
+
] });
|
|
1624
|
+
}) }),
|
|
1628
1625
|
/* @__PURE__ */ t.jsx("div", { className: "flex justify-center w-full", children: ((c == null ? void 0 : c.length) || 0) >= w.length && /* @__PURE__ */ t.jsx(
|
|
1629
1626
|
B,
|
|
1630
1627
|
{
|
|
@@ -1648,23 +1645,23 @@ const $a = ({
|
|
|
1648
1645
|
editPage: i,
|
|
1649
1646
|
onShowUpsertPage: o
|
|
1650
1647
|
}) => {
|
|
1651
|
-
const [a, s] = I("pages"), { data: w, isFetching: c } =
|
|
1652
|
-
ae(
|
|
1648
|
+
const [a, s] = I("pages"), { data: w, isFetching: c } = qe(), { mutate: p, isPending: u } = Dt(), m = (h) => Oa(
|
|
1649
|
+
ae(h, (f) => a === "pages" ? f.slug : !f.slug),
|
|
1653
1650
|
"name",
|
|
1654
1651
|
"asc"
|
|
1655
|
-
).map((
|
|
1652
|
+
).map((f) => /* @__PURE__ */ t.jsxs(
|
|
1656
1653
|
B,
|
|
1657
1654
|
{
|
|
1658
|
-
onClick: () => i(
|
|
1659
|
-
variant:
|
|
1655
|
+
onClick: () => i(f.id),
|
|
1656
|
+
variant: f.id === r ? "default" : "ghost",
|
|
1660
1657
|
className: "flex justify-between items-center w-full space-x-2 py-1",
|
|
1661
1658
|
children: [
|
|
1662
1659
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1663
|
-
|
|
1664
|
-
/* @__PURE__ */ t.jsx("span", { children:
|
|
1665
|
-
(
|
|
1660
|
+
f.global ? /* @__PURE__ */ t.jsx(kt, { className: "h-4 w-4" }) : /* @__PURE__ */ t.jsx(Nt, { className: "h-4 w-4" }),
|
|
1661
|
+
/* @__PURE__ */ t.jsx("span", { children: f.name ?? f.slug }),
|
|
1662
|
+
(f == null ? void 0 : f.slug) && /* @__PURE__ */ t.jsxs("span", { className: "text-xs font-light", children: [
|
|
1666
1663
|
"( ",
|
|
1667
|
-
|
|
1664
|
+
f.slug,
|
|
1668
1665
|
" )"
|
|
1669
1666
|
] })
|
|
1670
1667
|
] }),
|
|
@@ -1674,7 +1671,7 @@ const $a = ({
|
|
|
1674
1671
|
{
|
|
1675
1672
|
className: "h-3 w-3 hover:text-blue-500",
|
|
1676
1673
|
onClick: (S) => {
|
|
1677
|
-
S.stopPropagation(), o({ ...
|
|
1674
|
+
S.stopPropagation(), o({ ...f, global: a === "globalBlocks" });
|
|
1678
1675
|
}
|
|
1679
1676
|
}
|
|
1680
1677
|
),
|
|
@@ -1684,9 +1681,9 @@ const $a = ({
|
|
|
1684
1681
|
/* @__PURE__ */ t.jsxs("p", { className: "pb-2 text-sm", children: [
|
|
1685
1682
|
"Are you sure you want to remove",
|
|
1686
1683
|
" ",
|
|
1687
|
-
/* @__PURE__ */ t.jsx("b", { children:
|
|
1684
|
+
/* @__PURE__ */ t.jsx("b", { children: f.name ?? (f == null ? void 0 : f.slug) }),
|
|
1688
1685
|
" ",
|
|
1689
|
-
|
|
1686
|
+
f.global ? "global block?" : "page? This will also delete all associated language pages."
|
|
1690
1687
|
] }),
|
|
1691
1688
|
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ t.jsx(
|
|
1692
1689
|
B,
|
|
@@ -1695,7 +1692,7 @@ const $a = ({
|
|
|
1695
1692
|
variant: "destructive",
|
|
1696
1693
|
disabled: u,
|
|
1697
1694
|
onClick: (S) => {
|
|
1698
|
-
S.stopPropagation(), f
|
|
1695
|
+
S.stopPropagation(), p(f);
|
|
1699
1696
|
},
|
|
1700
1697
|
children: u ? "Deleting..." : "Delete"
|
|
1701
1698
|
}
|
|
@@ -1705,7 +1702,7 @@ const $a = ({
|
|
|
1705
1702
|
] })
|
|
1706
1703
|
]
|
|
1707
1704
|
},
|
|
1708
|
-
|
|
1705
|
+
f.id
|
|
1709
1706
|
));
|
|
1710
1707
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1711
1708
|
/* @__PURE__ */ t.jsx("br", {}),
|
|
@@ -1741,7 +1738,7 @@ const $a = ({
|
|
|
1741
1738
|
]
|
|
1742
1739
|
}
|
|
1743
1740
|
) }),
|
|
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..." }) :
|
|
1741
|
+
/* @__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..." }) : m(w) }) })
|
|
1745
1742
|
] })
|
|
1746
1743
|
] })
|
|
1747
1744
|
] });
|
|
@@ -1750,8 +1747,8 @@ const $a = ({
|
|
|
1750
1747
|
showUpsertPage: i,
|
|
1751
1748
|
setShowUpsertPage: o
|
|
1752
1749
|
}) => {
|
|
1753
|
-
const a = i.id, [s, w] = I(a && i.name || ""), [c,
|
|
1754
|
-
a ?
|
|
1750
|
+
const a = i.id, [s, w] = I(a && i.name || ""), [c, p] = I(a && i.slug || ""), { mutate: u, isPending: m } = Rt(), { mutate: h, isPending: g } = $e(), f = m || g, S = () => {
|
|
1751
|
+
a ? h(
|
|
1755
1752
|
{
|
|
1756
1753
|
name: s,
|
|
1757
1754
|
slug: c,
|
|
@@ -1819,7 +1816,7 @@ const $a = ({
|
|
|
1819
1816
|
value: c,
|
|
1820
1817
|
onChange: (T) => {
|
|
1821
1818
|
var E;
|
|
1822
|
-
return
|
|
1819
|
+
return p((E = T.target.value) == null ? void 0 : E.trim().toLowerCase());
|
|
1823
1820
|
},
|
|
1824
1821
|
className: "col-span-3",
|
|
1825
1822
|
required: !0,
|
|
@@ -1835,8 +1832,8 @@ const $a = ({
|
|
|
1835
1832
|
{
|
|
1836
1833
|
onClick: S,
|
|
1837
1834
|
type: "button",
|
|
1838
|
-
disabled:
|
|
1839
|
-
children:
|
|
1835
|
+
disabled: f || !s || !i.global && !c.startsWith("/") || Le(i.name, s) && Le(i.slug, c),
|
|
1836
|
+
children: f ? a ? "Updating..." : "Adding..." : i.global ? `${a ? "Update" : "Add"} global block` : `${a ? "Update" : "Add"} Page`
|
|
1840
1837
|
}
|
|
1841
1838
|
) })
|
|
1842
1839
|
] })
|
|
@@ -1845,15 +1842,15 @@ const $a = ({
|
|
|
1845
1842
|
);
|
|
1846
1843
|
};
|
|
1847
1844
|
function za(r) {
|
|
1848
|
-
const { activePage: i, canClose: o, open: a, close: s } = r, [, w] =
|
|
1849
|
-
window.history.pushState({}, "", `?page=${
|
|
1845
|
+
const { activePage: i, canClose: o, open: a, close: s } = r, [, w] = Y(), [c, p] = I(), u = (m) => {
|
|
1846
|
+
window.history.pushState({}, "", `?page=${m}`), w(new URLSearchParams({ page: m })), window.dispatchEvent(new PopStateEvent("popstate")), p(void 0), s();
|
|
1850
1847
|
};
|
|
1851
1848
|
return /* @__PURE__ */ t.jsx(
|
|
1852
1849
|
ya,
|
|
1853
1850
|
{
|
|
1854
1851
|
open: a,
|
|
1855
|
-
onOpenChange: (
|
|
1856
|
-
!
|
|
1852
|
+
onOpenChange: (m) => {
|
|
1853
|
+
!m && o && s();
|
|
1857
1854
|
},
|
|
1858
1855
|
children: /* @__PURE__ */ t.jsxs(
|
|
1859
1856
|
ja,
|
|
@@ -1864,7 +1861,7 @@ function za(r) {
|
|
|
1864
1861
|
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1865
1862
|
Va,
|
|
1866
1863
|
{
|
|
1867
|
-
onShowUpsertPage: (
|
|
1864
|
+
onShowUpsertPage: (m) => p(m),
|
|
1868
1865
|
activePage: i,
|
|
1869
1866
|
editPage: u
|
|
1870
1867
|
}
|
|
@@ -1874,7 +1871,7 @@ function za(r) {
|
|
|
1874
1871
|
{
|
|
1875
1872
|
editPage: u,
|
|
1876
1873
|
showUpsertPage: c,
|
|
1877
|
-
setShowUpsertPage:
|
|
1874
|
+
setShowUpsertPage: p
|
|
1878
1875
|
}
|
|
1879
1876
|
)
|
|
1880
1877
|
]
|
|
@@ -1885,54 +1882,55 @@ function za(r) {
|
|
|
1885
1882
|
}
|
|
1886
1883
|
ua();
|
|
1887
1884
|
const Ja = (r) => {
|
|
1888
|
-
var
|
|
1889
|
-
const [i] =
|
|
1890
|
-
|
|
1891
|
-
const
|
|
1892
|
-
|
|
1885
|
+
var Q;
|
|
1886
|
+
const [i] = Y(), o = i.get("page"), { data: a, isFetching: s } = _t(), { data: w } = Ia(), { data: c, isFetching: p } = Tt(), { blocks: u, theme: m } = Ba(c), { data: h } = Ot(), { data: g } = Me(), f = Fa(), { uploadFile: S } = Ga(), { getUILibraryBlock: T, getUILibraryBlocks: E, onSave: A } = La(), { getGlobalBlocks: R, getGlobalBlockBlocks: b } = Ua(), { mutate: je, isPending: ie } = qa(), { aiContext: H, updateAiContext: we } = Pt(), [Se, oe] = I(!1), [q, Ee] = I("SAVED");
|
|
1887
|
+
Be(() => {
|
|
1888
|
+
const C = (F) => {
|
|
1889
|
+
q === "UNSAVED" && (F.preventDefault(), F.returnValue = !1);
|
|
1893
1890
|
};
|
|
1894
|
-
return
|
|
1895
|
-
window.removeEventListener("beforeunload",
|
|
1891
|
+
return q === "UNSAVED" && window.addEventListener("beforeunload", C), () => {
|
|
1892
|
+
window.removeEventListener("beforeunload", C);
|
|
1896
1893
|
};
|
|
1897
|
-
}, [
|
|
1898
|
-
const
|
|
1899
|
-
const
|
|
1900
|
-
return
|
|
1901
|
-
}, [
|
|
1894
|
+
}, [q]);
|
|
1895
|
+
const Ce = ye(() => {
|
|
1896
|
+
const C = {};
|
|
1897
|
+
return h != null && h.theme && (C.brandingOptions = h.theme), C;
|
|
1898
|
+
}, [h]);
|
|
1902
1899
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1903
1900
|
/* @__PURE__ */ t.jsx(
|
|
1904
1901
|
ha,
|
|
1905
1902
|
{
|
|
1903
|
+
loading: p,
|
|
1906
1904
|
fallbackLang: r.fallbackLang || "en",
|
|
1907
|
-
languages:
|
|
1905
|
+
languages: Ge(g, "lang") || [],
|
|
1908
1906
|
translations: r.translations || {},
|
|
1909
1907
|
locale: r.locale || "en",
|
|
1910
1908
|
htmlDir: r.htmlDir || "ltr",
|
|
1911
1909
|
autoSaveSupport: r.autoSaveSupport || !1,
|
|
1912
1910
|
autoSaveInterval: r.autoSaveInterval || 15,
|
|
1913
|
-
uploadMediaCallback:
|
|
1911
|
+
uploadMediaCallback: S,
|
|
1914
1912
|
onError: r.onError || console.error,
|
|
1915
|
-
getGlobalBlockBlocks:
|
|
1916
|
-
getGlobalBlocks:
|
|
1917
|
-
blocks:
|
|
1918
|
-
getUILibraryBlock:
|
|
1919
|
-
getUILibraryBlocks:
|
|
1920
|
-
brandingOptions:
|
|
1913
|
+
getGlobalBlockBlocks: b,
|
|
1914
|
+
getGlobalBlocks: R,
|
|
1915
|
+
blocks: u,
|
|
1916
|
+
getUILibraryBlock: T,
|
|
1917
|
+
getUILibraryBlocks: E,
|
|
1918
|
+
brandingOptions: m,
|
|
1921
1919
|
uiLibraries: w,
|
|
1922
|
-
saveAiContextCallback: async (
|
|
1923
|
-
onSaveStateChange: (
|
|
1924
|
-
aiContext:
|
|
1925
|
-
askAiCallBack:
|
|
1926
|
-
onSave: async ({ blocks:
|
|
1920
|
+
saveAiContextCallback: async (C) => (await we({ page: o, aiContext: C }), !0),
|
|
1921
|
+
onSaveStateChange: (C) => Ee(C),
|
|
1922
|
+
aiContext: H,
|
|
1923
|
+
askAiCallBack: f,
|
|
1924
|
+
onSave: async ({ blocks: C, themeConfiguration: F }) => {
|
|
1927
1925
|
if (!o) return !0;
|
|
1928
|
-
const
|
|
1926
|
+
const M = {
|
|
1929
1927
|
_type: "@chai/theme",
|
|
1930
|
-
_value:
|
|
1931
|
-
},
|
|
1928
|
+
_value: F
|
|
1929
|
+
}, le = {
|
|
1932
1930
|
_type: "@chai/ai-context",
|
|
1933
|
-
_value:
|
|
1934
|
-
},
|
|
1935
|
-
return await
|
|
1931
|
+
_value: Fe(H) ? H : ""
|
|
1932
|
+
}, ce = [...C, M, le];
|
|
1933
|
+
return await A({ page: o, blocks: ce }), !0;
|
|
1936
1934
|
},
|
|
1937
1935
|
topBarComponents: {
|
|
1938
1936
|
left: [
|
|
@@ -1943,7 +1941,7 @@ const Ja = (r) => {
|
|
|
1943
1941
|
className: "flex justify-start max-w-[250px] items-center w-full space-x-2 py-1",
|
|
1944
1942
|
onClick: () => oe(!0),
|
|
1945
1943
|
children: [
|
|
1946
|
-
|
|
1944
|
+
xe(a.slug, "/") ? /* @__PURE__ */ t.jsx(Nt, { className: "h-4 w-4" }) : /* @__PURE__ */ t.jsx(kt, { className: "h-4 w-4" }),
|
|
1947
1945
|
/* @__PURE__ */ t.jsx("span", { className: "truncate", children: (a == null ? void 0 : a.name) ?? "" }),
|
|
1948
1946
|
/* @__PURE__ */ t.jsx(Ea, { className: "h-4 w-4" })
|
|
1949
1947
|
]
|
|
@@ -1955,10 +1953,10 @@ const Ja = (r) => {
|
|
|
1955
1953
|
() => /* @__PURE__ */ t.jsxs(
|
|
1956
1954
|
B,
|
|
1957
1955
|
{
|
|
1958
|
-
disabled: ie ||
|
|
1956
|
+
disabled: ie || q !== "SAVED",
|
|
1959
1957
|
size: "sm",
|
|
1960
1958
|
variant: "default",
|
|
1961
|
-
onClick: () =>
|
|
1959
|
+
onClick: () => je(o),
|
|
1962
1960
|
children: [
|
|
1963
1961
|
/* @__PURE__ */ t.jsx(Ca, { className: "h-4 w-4" }),
|
|
1964
1962
|
" ",
|
|
@@ -1971,7 +1969,7 @@ const Ja = (r) => {
|
|
|
1971
1969
|
},
|
|
1972
1970
|
sideBarComponents: {
|
|
1973
1971
|
top: [
|
|
1974
|
-
...
|
|
1972
|
+
...xe(a.slug, "/") ? [
|
|
1975
1973
|
{
|
|
1976
1974
|
label: "SEO Setting",
|
|
1977
1975
|
component: At,
|
|
@@ -1991,7 +1989,7 @@ const Ja = (r) => {
|
|
|
1991
1989
|
) })
|
|
1992
1990
|
}
|
|
1993
1991
|
] : [],
|
|
1994
|
-
...(
|
|
1992
|
+
...(Q = r.languages) != null && Q.length && xe(a.slug, "/") ? [
|
|
1995
1993
|
{
|
|
1996
1994
|
label: "Language Pages",
|
|
1997
1995
|
component: Ka,
|
|
@@ -2024,15 +2022,15 @@ const Ja = (r) => {
|
|
|
2024
2022
|
] : []
|
|
2025
2023
|
]
|
|
2026
2024
|
},
|
|
2027
|
-
...
|
|
2025
|
+
...Ce
|
|
2028
2026
|
}
|
|
2029
2027
|
),
|
|
2030
2028
|
/* @__PURE__ */ t.jsx(
|
|
2031
2029
|
za,
|
|
2032
2030
|
{
|
|
2033
2031
|
activePage: o || "",
|
|
2034
|
-
canClose: !!o && !
|
|
2035
|
-
open: !o || !s &&
|
|
2032
|
+
canClose: !!o && !W(a),
|
|
2033
|
+
open: !o || !s && W(a) || Se,
|
|
2036
2034
|
close: () => oe(!1)
|
|
2037
2035
|
}
|
|
2038
2036
|
)
|