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