@chaibuilder/sdk 0.1.8 → 0.1.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/{AddBlocks-4e50ad65.cjs → AddBlocks-8bcba532.cjs} +1 -1
- package/dist/{AddBlocks-619d3dde.js → AddBlocks-a9d3b6c0.js} +2 -2
- package/dist/BrandingOptions-c4c8676e.cjs +1 -0
- package/dist/{BrandingOptions-05634eee.js → BrandingOptions-c8dba155.js} +18 -16
- package/dist/{CanvasArea-8f96a9f5.js → CanvasArea-77c280f6.js} +4 -4
- package/dist/{CanvasArea-f26157c0.cjs → CanvasArea-c8892280.cjs} +2 -2
- package/dist/{CurrentPage-d372a5a9.js → CurrentPage-6ca95592.js} +2 -2
- package/dist/{CurrentPage-0663041c.cjs → CurrentPage-ebe20c9e.cjs} +1 -1
- package/dist/{Layers-57457feb.cjs → Layers-c1be574f.cjs} +1 -1
- package/dist/{Layers-5da1d796.js → Layers-d3c8eea6.js} +4 -4
- package/dist/{MarkAsGlobalBlock-1a0d0725.js → MarkAsGlobalBlock-04b2d169.js} +3 -3
- package/dist/{MarkAsGlobalBlock-dd53daec.cjs → MarkAsGlobalBlock-d40a9947.cjs} +1 -1
- package/dist/{PagesPanel-113739d6.cjs → PagesPanel-27f7a791.cjs} +1 -1
- package/dist/{PagesPanel-42dba988.js → PagesPanel-78e3bbb9.js} +4 -4
- package/dist/{ProjectPanel-7e26e6a3.js → ProjectPanel-22ec7598.js} +4 -4
- package/dist/{ProjectPanel-ee6b71ab.cjs → ProjectPanel-8cec3a82.cjs} +1 -1
- package/dist/{Settings-9f28c157.cjs → Settings-675c7a84.cjs} +1 -1
- package/dist/{Settings-cdaf197a.js → Settings-e49b1212.js} +4 -4
- package/dist/{SidePanels-ce2deb33.cjs → SidePanels-35ad2f5f.cjs} +1 -1
- package/dist/{SidePanels-7757f767.js → SidePanels-7371a5c6.js} +4 -4
- package/dist/{Topbar-7600678e.cjs → Topbar-3bda931b.cjs} +1 -1
- package/dist/{Topbar-73c9aa97.js → Topbar-da90da83.js} +3 -3
- package/dist/{add-page-modal-eb896eef.cjs → add-page-modal-15f377cc.cjs} +1 -1
- package/dist/{add-page-modal-96a1f8dc.js → add-page-modal-6b37b90c.js} +5 -5
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +0 -8
- package/dist/core.js +57 -59
- package/dist/{delete-page-modal-aabd460d.js → delete-page-modal-3b1edeb1.js} +3 -3
- package/dist/{delete-page-modal-306dab3c.cjs → delete-page-modal-92a70848.cjs} +1 -1
- package/dist/{form-6eac0287.cjs → form-431f0141.cjs} +1 -1
- package/dist/{form-5d5c5c9e.js → form-526188f9.js} +1 -1
- package/dist/{html-to-json-feece010.cjs → html-to-json-78bfa1f3.cjs} +1 -1
- package/dist/{html-to-json-eb4de645.js → html-to-json-8397fab5.js} +1 -1
- package/dist/{index-38bc7894.js → index-67c3fc28.js} +1053 -1071
- package/dist/{index-94612af5.cjs → index-d214d8c8.cjs} +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +8 -0
- package/dist/lib.js +36 -34
- package/dist/link-8b201d2c.cjs +1 -0
- package/dist/{link-f80a947d.js → link-ebe8a751.js} +60 -51
- package/dist/{page-viewer-f60c4980.cjs → page-viewer-584e4c45.cjs} +1 -1
- package/dist/{page-viewer-be5d5315.js → page-viewer-dcd98e40.js} +4 -4
- package/dist/{project-general-setting-bebd5cb1.cjs → project-general-setting-09427e43.cjs} +1 -1
- package/dist/{project-general-setting-cc9b43cd.js → project-general-setting-f4614eb4.js} +5 -5
- package/dist/{project-seo-setting-e3924578.cjs → project-seo-setting-157acce4.cjs} +1 -1
- package/dist/{project-seo-setting-01536592.js → project-seo-setting-f31a84f5.js} +2 -2
- package/dist/render.cjs +1 -1
- package/dist/render.js +1 -1
- package/dist/{single-page-detail-33436195.js → single-page-detail-20bf1b52.js} +5 -5
- package/dist/{single-page-detail-584589e0.cjs → single-page-detail-e9713757.cjs} +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/package.json +1 -1
- package/dist/BrandingOptions-d2a7778f.cjs +0 -1
- package/dist/link-86c532b5.cjs +0 -1
|
@@ -6,44 +6,44 @@ var a = (e, t, n) => (fs(e, t, "read from private field"), n ? n.call(e) : t.get
|
|
|
6
6
|
if (t.has(e))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
t instanceof WeakSet ? t.add(e) : t.set(e, n);
|
|
9
|
-
},
|
|
9
|
+
}, x = (e, t, n, s) => (fs(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
|
|
10
10
|
var Bn = (e, t, n, s) => ({
|
|
11
11
|
set _(r) {
|
|
12
|
-
|
|
12
|
+
x(e, t, r, n);
|
|
13
13
|
},
|
|
14
14
|
get _() {
|
|
15
15
|
return a(e, t, s);
|
|
16
16
|
}
|
|
17
17
|
}), Q = (e, t, n) => (fs(e, t, "access private method"), n);
|
|
18
|
-
import { j as
|
|
18
|
+
import { j as _ } from "./jsx-runtime-944c88e2.js";
|
|
19
19
|
import Io from "i18next";
|
|
20
20
|
import { initReactI18next as jo } from "react-i18next";
|
|
21
21
|
import { FlagsProvider as Bo } from "flagged";
|
|
22
22
|
import * as ae from "react";
|
|
23
|
-
import
|
|
23
|
+
import Xn, { createContext as Ro, useReducer as Do, useEffect as Ee, useDebugValue as Mo, useCallback as W, useContext as Lo, useMemo as No, useState as ws, Suspense as Et, lazy as Pt } from "react";
|
|
24
24
|
import { DndProvider as To } from "react-dnd";
|
|
25
|
-
import { flatten as Pe, find as Oe, filter as te, map as de, omit as
|
|
25
|
+
import { flatten as Pe, find as Oe, filter as te, map as de, omit as Zn, isEmpty as Le, isString as $s, set as it, get as ee, includes as he, without as di, forIn as fi, has as es, findIndex as Rn, last as Fo, first as Me, startsWith as hi, isNull as Ss, each as nt, pick as or, sortBy as Ps, isObject as Uo, capitalize as qo } from "lodash";
|
|
26
26
|
import { getBackendOptions as $o, MultiBackend as Qo } from "@minoru/react-dnd-treeview";
|
|
27
27
|
import { u as dn, c as pi, B as mi, S as Vo, T as Ko, a as zo } from "./useBuilderProp-81a14920.js";
|
|
28
|
-
import { atom as N, useAtomValue as ne, useAtom as
|
|
28
|
+
import { atom as N, useAtomValue as ne, useAtom as X, useSetAtom as ot, getDefaultStore as Go } from "jotai";
|
|
29
29
|
import { c as Wo } from "./utils-ac68b2c8.js";
|
|
30
30
|
import { useHotkeys as Qe } from "react-hotkeys-hook";
|
|
31
31
|
import gi from "flat-to-nested";
|
|
32
|
-
import { g as st, c as qn, a as Ho, b as Jo } from "./html-to-json-
|
|
33
|
-
import Yo, { excludeAction as
|
|
34
|
-
import { useThrottledCallback as
|
|
35
|
-
import { S as vt, I as yi, a as
|
|
32
|
+
import { g as st, c as qn, a as Ho, b as Jo } from "./html-to-json-8397fab5.js";
|
|
33
|
+
import Yo, { excludeAction as Xo, ActionCreators as hs } from "redux-undo";
|
|
34
|
+
import { useThrottledCallback as Zo } from "@react-hookz/web";
|
|
35
|
+
import { S as vt, I as yi, a as ks, B as xs } from "./MODIFIERS-c2e02614.js";
|
|
36
36
|
import { useChaiBlocks as ea, syncBlocksWithDefaults as ta } from "@chaibuilder/blocks";
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
const
|
|
41
|
-
dark_mode:
|
|
42
|
-
tree_view_no_blocks:
|
|
43
|
-
canvas_empty:
|
|
44
|
-
no_block_selected_for_styling:
|
|
45
|
-
no_styling_block_selected:
|
|
46
|
-
drop_here_message:
|
|
37
|
+
import { FileTextIcon as na, GearIcon as sa, EyeClosedIcon as ra, EyeOpenIcon as ia } from "@radix-ui/react-icons";
|
|
38
|
+
import { LogOutIcon as oa } from "lucide-react";
|
|
39
|
+
import { toast as Ue, Toaster as aa } from "sonner";
|
|
40
|
+
const ca = "Dark mode", ua = "This page has no blocks. Add a block by clicking the + button", la = "This page is empty", da = "Please select a block to edit settings or styles", fa = "Please select a styling block", ha = "Drop your block here", pa = {
|
|
41
|
+
dark_mode: ca,
|
|
42
|
+
tree_view_no_blocks: ua,
|
|
43
|
+
canvas_empty: la,
|
|
44
|
+
no_block_selected_for_styling: da,
|
|
45
|
+
no_styling_block_selected: fa,
|
|
46
|
+
drop_here_message: ha
|
|
47
47
|
};
|
|
48
48
|
Io.use(jo).init({
|
|
49
49
|
// the translations
|
|
@@ -51,7 +51,7 @@ Io.use(jo).init({
|
|
|
51
51
|
// or even better, manage them via a UI: https://react.i18next.com/guides/multiple-translation-files#manage-your-translations-with-a-management-gui)
|
|
52
52
|
resources: {
|
|
53
53
|
en: {
|
|
54
|
-
translation:
|
|
54
|
+
translation: pa
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
lng: "en",
|
|
@@ -62,9 +62,9 @@ Io.use(jo).init({
|
|
|
62
62
|
// react already safes from xss => https://www.i18next.com/translation-function/interpolation#unescape
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
class
|
|
65
|
+
const ma = "";
|
|
66
|
+
const ga = {};
|
|
67
|
+
class ya extends Xn.Component {
|
|
68
68
|
constructor(t) {
|
|
69
69
|
super(t), this.state = { hasError: !1 };
|
|
70
70
|
}
|
|
@@ -76,16 +76,16 @@ class ma extends Zn.Component {
|
|
|
76
76
|
return console.error(t), { hasError: !0 };
|
|
77
77
|
}
|
|
78
78
|
render() {
|
|
79
|
-
return this.state.hasError ? /* @__PURE__ */
|
|
79
|
+
return this.state.hasError ? /* @__PURE__ */ _.jsx("h1", { children: "Something went wrong." }) : this.props.children;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const va = (e) => {
|
|
83
83
|
const t = e.replace(vt, "").split(",");
|
|
84
84
|
return { baseClasses: t[0], classes: t[1] };
|
|
85
85
|
};
|
|
86
|
-
let
|
|
86
|
+
let ba = 0;
|
|
87
87
|
function ze(e, t) {
|
|
88
|
-
const n = `atom${++
|
|
88
|
+
const n = `atom${++ba}`, s = {
|
|
89
89
|
toString: () => n
|
|
90
90
|
};
|
|
91
91
|
return typeof e == "function" ? s.read = e : (s.init = e, s.read = (r) => r(s), s.write = (r, i, o) => i(
|
|
@@ -93,28 +93,28 @@ function ze(e, t) {
|
|
|
93
93
|
typeof o == "function" ? o(r(s)) : o
|
|
94
94
|
)), t && (s.write = t), s;
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const ar = (e) => "init" in e, cr = (e) => !!e.write, Kn = /* @__PURE__ */ new WeakMap(), wa = (e, t) => {
|
|
97
97
|
Kn.set(e, t), e.catch(() => {
|
|
98
98
|
}).finally(() => Kn.delete(e));
|
|
99
|
-
},
|
|
99
|
+
}, ur = (e, t) => {
|
|
100
100
|
const n = Kn.get(e);
|
|
101
101
|
n && (Kn.delete(e), n(t));
|
|
102
|
-
}, ur = (e, t) => {
|
|
103
|
-
e.status = "fulfilled", e.value = t;
|
|
104
102
|
}, lr = (e, t) => {
|
|
103
|
+
e.status = "fulfilled", e.value = t;
|
|
104
|
+
}, dr = (e, t) => {
|
|
105
105
|
e.status = "rejected", e.reason = t;
|
|
106
|
-
},
|
|
106
|
+
}, Sa = (e) => typeof (e == null ? void 0 : e.then) == "function", sn = (e, t) => "v" in e && "v" in t && Object.is(e.v, t.v), fr = (e, t) => "e" in e && "e" in t && Object.is(e.e, t.e), At = (e) => "v" in e && e.v instanceof Promise, Pa = (e, t) => "v" in e && "v" in t && e.v.orig && e.v.orig === t.v.orig, Dn = (e) => {
|
|
107
107
|
if ("e" in e)
|
|
108
108
|
throw e.e;
|
|
109
109
|
return e.v;
|
|
110
|
-
},
|
|
110
|
+
}, ka = () => {
|
|
111
111
|
const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new Map();
|
|
112
112
|
let s, r, i;
|
|
113
113
|
const o = (m) => e.get(m), c = (m, v) => {
|
|
114
114
|
const j = e.get(m);
|
|
115
115
|
if (e.set(m, v), n.has(m) || n.set(m, j), j && At(j)) {
|
|
116
116
|
const w = "v" in v ? v.v instanceof Promise ? v.v : Promise.resolve(v.v) : Promise.reject(v.e);
|
|
117
|
-
|
|
117
|
+
ur(j.v, w);
|
|
118
118
|
}
|
|
119
119
|
}, l = (m, v, j) => {
|
|
120
120
|
const w = /* @__PURE__ */ new Map();
|
|
@@ -129,14 +129,14 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
129
129
|
};
|
|
130
130
|
if (j && l(m, D, j), w && sn(w, D) && w.d === D.d)
|
|
131
131
|
return w;
|
|
132
|
-
if (w && At(w) && At(D) &&
|
|
132
|
+
if (w && At(w) && At(D) && Pa(w, D)) {
|
|
133
133
|
if (w.d === D.d)
|
|
134
134
|
return w;
|
|
135
135
|
D.v = w.v;
|
|
136
136
|
}
|
|
137
137
|
return c(m, D), D;
|
|
138
138
|
}, f = (m, v, j, w) => {
|
|
139
|
-
if (
|
|
139
|
+
if (Sa(v)) {
|
|
140
140
|
let D;
|
|
141
141
|
const E = new Promise((S, V) => {
|
|
142
142
|
let $ = !1;
|
|
@@ -149,7 +149,7 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
149
149
|
E,
|
|
150
150
|
j
|
|
151
151
|
);
|
|
152
|
-
|
|
152
|
+
lr(E, G), S(G), (d == null ? void 0 : d.d) !== h.d && F(m, h, d == null ? void 0 : d.d);
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
155
|
(G) => {
|
|
@@ -160,17 +160,17 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
160
160
|
E,
|
|
161
161
|
j
|
|
162
162
|
);
|
|
163
|
-
|
|
163
|
+
dr(E, G), V(G), (d == null ? void 0 : d.d) !== h.d && F(m, h, d == null ? void 0 : d.d);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
), D = (G) => {
|
|
167
167
|
$ || ($ = !0, G.then(
|
|
168
|
-
(d) =>
|
|
169
|
-
(d) =>
|
|
168
|
+
(d) => lr(E, d),
|
|
169
|
+
(d) => dr(E, d)
|
|
170
170
|
), S(G));
|
|
171
171
|
};
|
|
172
172
|
});
|
|
173
|
-
return E.orig = v, E.status = "pending",
|
|
173
|
+
return E.orig = v, E.status = "pending", wa(E, (S) => {
|
|
174
174
|
S && D(S), w == null || w();
|
|
175
175
|
}), u(m, E, j);
|
|
176
176
|
}
|
|
@@ -180,7 +180,7 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
180
180
|
d: (w == null ? void 0 : w.d) || /* @__PURE__ */ new Map(),
|
|
181
181
|
e: v
|
|
182
182
|
};
|
|
183
|
-
return j && l(m, D, j), w &&
|
|
183
|
+
return j && l(m, D, j), w && fr(w, D) && w.d === D.d ? w : (c(m, D), D);
|
|
184
184
|
}, P = (m) => {
|
|
185
185
|
const v = o(m);
|
|
186
186
|
if (v && (v.d.forEach(($, G) => {
|
|
@@ -198,7 +198,7 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
198
198
|
const d = o($);
|
|
199
199
|
if (d)
|
|
200
200
|
return j.set($, d), Dn(d);
|
|
201
|
-
if (
|
|
201
|
+
if (ar($))
|
|
202
202
|
return j.set($, void 0), $.init;
|
|
203
203
|
throw new Error("no atom init");
|
|
204
204
|
}
|
|
@@ -211,7 +211,7 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
211
211
|
return E || (E = new AbortController()), E.signal;
|
|
212
212
|
},
|
|
213
213
|
get setSelf() {
|
|
214
|
-
return !S &&
|
|
214
|
+
return !S && cr(m) && (S = (...$) => {
|
|
215
215
|
if (!w)
|
|
216
216
|
return B(m, ...$);
|
|
217
217
|
}), S;
|
|
@@ -230,12 +230,12 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
230
230
|
} finally {
|
|
231
231
|
w = !1;
|
|
232
232
|
}
|
|
233
|
-
}, g = (m) => Dn(P(m)),
|
|
233
|
+
}, g = (m) => Dn(P(m)), O = (m) => {
|
|
234
234
|
let v = t.get(m);
|
|
235
235
|
return v || (v = b(m)), v;
|
|
236
|
-
},
|
|
236
|
+
}, C = (m, v) => !v.l.size && (!v.t.size || v.t.size === 1 && v.t.has(m)), y = (m) => {
|
|
237
237
|
const v = t.get(m);
|
|
238
|
-
v &&
|
|
238
|
+
v && C(m, v) && k(m);
|
|
239
239
|
}, A = (m) => {
|
|
240
240
|
const v = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new WeakMap(), w = (E) => {
|
|
241
241
|
const S = t.get(E);
|
|
@@ -271,7 +271,7 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
271
271
|
const w = (S) => Dn(P(S)), D = (S, ...V) => {
|
|
272
272
|
let $;
|
|
273
273
|
if (S === m) {
|
|
274
|
-
if (!
|
|
274
|
+
if (!ar(S))
|
|
275
275
|
throw new Error("atom not writable");
|
|
276
276
|
const G = o(S), d = f(S, V[0]);
|
|
277
277
|
(!G || !sn(G, d)) && A(S);
|
|
@@ -294,20 +294,20 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
294
294
|
if (t.set(m, j), P(m).d.forEach((w, D) => {
|
|
295
295
|
const E = t.get(D);
|
|
296
296
|
E ? E.t.add(m) : D !== m && b(D, m);
|
|
297
|
-
}), P(m),
|
|
297
|
+
}), P(m), cr(m) && m.onMount) {
|
|
298
298
|
const w = m.onMount((...D) => B(m, ...D));
|
|
299
299
|
w && (j.u = w);
|
|
300
300
|
}
|
|
301
301
|
return j;
|
|
302
|
-
},
|
|
302
|
+
}, k = (m) => {
|
|
303
303
|
var v;
|
|
304
304
|
const j = (v = t.get(m)) == null ? void 0 : v.u;
|
|
305
305
|
j && j(), t.delete(m);
|
|
306
306
|
const w = o(m);
|
|
307
|
-
w && (At(w) &&
|
|
307
|
+
w && (At(w) && ur(w.v), w.d.forEach((D, E) => {
|
|
308
308
|
if (E !== m) {
|
|
309
309
|
const S = t.get(E);
|
|
310
|
-
S && (S.t.delete(m),
|
|
310
|
+
S && (S.t.delete(m), C(E, S) && k(E));
|
|
311
311
|
}
|
|
312
312
|
}));
|
|
313
313
|
}, F = (m, v, j) => {
|
|
@@ -318,7 +318,7 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
318
318
|
return;
|
|
319
319
|
}
|
|
320
320
|
const S = t.get(E);
|
|
321
|
-
S && (S.t.delete(m),
|
|
321
|
+
S && (S.t.delete(m), C(E, S) && k(E));
|
|
322
322
|
}), w.forEach((D) => {
|
|
323
323
|
const E = t.get(D);
|
|
324
324
|
E ? E.t.add(m) : t.has(m) && b(D, m);
|
|
@@ -334,7 +334,7 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
334
334
|
const E = t.get(j);
|
|
335
335
|
E && !// TODO This seems pretty hacky. Hope to fix it.
|
|
336
336
|
// Maybe we could `mountDependencies` in `setAtomState`?
|
|
337
|
-
(w && !At(w) && (sn(w, D) ||
|
|
337
|
+
(w && !At(w) && (sn(w, D) || fr(w, D))) && E.l.forEach((S) => S());
|
|
338
338
|
}
|
|
339
339
|
});
|
|
340
340
|
}
|
|
@@ -343,7 +343,7 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
343
343
|
get: g,
|
|
344
344
|
set: B,
|
|
345
345
|
sub: (m, v) => {
|
|
346
|
-
const j =
|
|
346
|
+
const j = O(m), w = T(), D = j.l;
|
|
347
347
|
return D.add(v), () => {
|
|
348
348
|
D.delete(v), y(m);
|
|
349
349
|
};
|
|
@@ -351,20 +351,20 @@ const or = (e) => "init" in e, ar = (e) => !!e.write, Kn = /* @__PURE__ */ new W
|
|
|
351
351
|
};
|
|
352
352
|
};
|
|
353
353
|
let ps;
|
|
354
|
-
const
|
|
355
|
-
function
|
|
354
|
+
const xa = () => (ps || (ps = ka()), ps), Aa = Symbol();
|
|
355
|
+
function Ea(e, t) {
|
|
356
356
|
const n = ze(
|
|
357
357
|
e,
|
|
358
358
|
(s, r, i) => r(n, t(s(n), i))
|
|
359
359
|
);
|
|
360
360
|
return n;
|
|
361
361
|
}
|
|
362
|
-
const
|
|
363
|
-
const s =
|
|
364
|
-
return
|
|
365
|
-
},
|
|
366
|
-
function
|
|
367
|
-
return
|
|
362
|
+
const hr = (e, t, n) => (t.has(n) ? t : t.set(n, e())).get(n), Oa = /* @__PURE__ */ new WeakMap(), _a = (e, t, n) => {
|
|
363
|
+
const s = hr(() => /* @__PURE__ */ new WeakMap(), Oa, t);
|
|
364
|
+
return hr(e, s, n);
|
|
365
|
+
}, Ca = {}, pr = (e) => !!e.write, Ia = (e) => typeof e == "function";
|
|
366
|
+
function ja(e, t) {
|
|
367
|
+
return _a(
|
|
368
368
|
() => {
|
|
369
369
|
const n = /* @__PURE__ */ new WeakMap(), s = (o, c) => {
|
|
370
370
|
let l = n.get(o);
|
|
@@ -372,41 +372,41 @@ function _a(e, t) {
|
|
|
372
372
|
return l;
|
|
373
373
|
const u = c && n.get(c), f = [], p = [];
|
|
374
374
|
return o.forEach((P, g) => {
|
|
375
|
-
const
|
|
376
|
-
p[g] =
|
|
377
|
-
const
|
|
378
|
-
if (
|
|
379
|
-
f[g] =
|
|
375
|
+
const O = t ? t(P) : g;
|
|
376
|
+
p[g] = O;
|
|
377
|
+
const C = u && u.atomList[u.keyList.indexOf(O)];
|
|
378
|
+
if (C) {
|
|
379
|
+
f[g] = C;
|
|
380
380
|
return;
|
|
381
381
|
}
|
|
382
382
|
const y = (I) => {
|
|
383
|
-
const B = I(r), b = I(e), F = s(b, B == null ? void 0 : B.arr).keyList.indexOf(
|
|
383
|
+
const B = I(r), b = I(e), F = s(b, B == null ? void 0 : B.arr).keyList.indexOf(O);
|
|
384
384
|
if (F < 0 || F >= b.length) {
|
|
385
|
-
const T = o[s(o).keyList.indexOf(
|
|
385
|
+
const T = o[s(o).keyList.indexOf(O)];
|
|
386
386
|
if (T)
|
|
387
387
|
return T;
|
|
388
388
|
throw new Error("splitAtom: index out of bounds for read");
|
|
389
389
|
}
|
|
390
390
|
return b[F];
|
|
391
391
|
}, A = (I, B, b) => {
|
|
392
|
-
const
|
|
392
|
+
const k = I(r), F = I(e), M = s(F, k == null ? void 0 : k.arr).keyList.indexOf(O);
|
|
393
393
|
if (M < 0 || M >= F.length)
|
|
394
394
|
throw new Error("splitAtom: index out of bounds for write");
|
|
395
|
-
const m =
|
|
395
|
+
const m = Ia(b) ? b(F[M]) : b;
|
|
396
396
|
B(e, [
|
|
397
397
|
...F.slice(0, M),
|
|
398
398
|
m,
|
|
399
399
|
...F.slice(M + 1)
|
|
400
400
|
]);
|
|
401
401
|
};
|
|
402
|
-
f[g] =
|
|
402
|
+
f[g] = pr(e) ? ze(y, A) : ze(y);
|
|
403
403
|
}), u && u.keyList.length === p.length && u.keyList.every((P, g) => P === p[g]) ? l = u : l = { arr: o, atomList: f, keyList: p }, n.set(o, l), l;
|
|
404
404
|
}, r = ze((o) => {
|
|
405
405
|
const c = o(r), l = o(e);
|
|
406
406
|
return s(l, c == null ? void 0 : c.arr);
|
|
407
407
|
});
|
|
408
408
|
r.init = void 0;
|
|
409
|
-
const i =
|
|
409
|
+
const i = pr(e) ? ze(
|
|
410
410
|
(o) => o(r).atomList,
|
|
411
411
|
(o, c, l) => {
|
|
412
412
|
switch (l.type) {
|
|
@@ -457,11 +457,11 @@ function _a(e, t) {
|
|
|
457
457
|
return i;
|
|
458
458
|
},
|
|
459
459
|
e,
|
|
460
|
-
t ||
|
|
460
|
+
t || Ca
|
|
461
461
|
);
|
|
462
462
|
}
|
|
463
|
-
const
|
|
464
|
-
function
|
|
463
|
+
const Ba = (e) => typeof (e == null ? void 0 : e.then) == "function";
|
|
464
|
+
function Ra(e) {
|
|
465
465
|
let t, n;
|
|
466
466
|
const s = {
|
|
467
467
|
getItem: (r, i) => {
|
|
@@ -477,7 +477,7 @@ function ja(e) {
|
|
|
477
477
|
}
|
|
478
478
|
return n;
|
|
479
479
|
}, u = (c = (o = e()) == null ? void 0 : o.getItem(r)) != null ? c : null;
|
|
480
|
-
return
|
|
480
|
+
return Ba(u) ? u.then(l) : l(u);
|
|
481
481
|
},
|
|
482
482
|
setItem: (r, i) => {
|
|
483
483
|
var o;
|
|
@@ -508,10 +508,10 @@ function ja(e) {
|
|
|
508
508
|
};
|
|
509
509
|
}), s;
|
|
510
510
|
}
|
|
511
|
-
const
|
|
511
|
+
const Da = Ra(
|
|
512
512
|
() => typeof window < "u" ? window.localStorage : void 0
|
|
513
513
|
);
|
|
514
|
-
function
|
|
514
|
+
function kt(e, t, n = Da, s) {
|
|
515
515
|
const r = s == null ? void 0 : s.unstable_getOnInit, i = ze(
|
|
516
516
|
r ? n.getItem(e, t) : t
|
|
517
517
|
);
|
|
@@ -523,14 +523,14 @@ function xt(e, t, n = Ba, s) {
|
|
|
523
523
|
(c) => c(i),
|
|
524
524
|
(c, l, u) => {
|
|
525
525
|
const f = typeof u == "function" ? u(c(i)) : u;
|
|
526
|
-
return f ===
|
|
526
|
+
return f === Aa ? (l(i, t), n.removeItem(e)) : f instanceof Promise ? f.then((p) => (l(i, p), n.setItem(e, p))) : (l(i, f), n.setItem(e, f));
|
|
527
527
|
}
|
|
528
528
|
);
|
|
529
529
|
}
|
|
530
|
-
const
|
|
531
|
-
const t = Lo(
|
|
532
|
-
return (e == null ? void 0 : e.store) || t ||
|
|
533
|
-
},
|
|
530
|
+
const Ma = Ro(void 0), vi = (e) => {
|
|
531
|
+
const t = Lo(Ma);
|
|
532
|
+
return (e == null ? void 0 : e.store) || t || xa();
|
|
533
|
+
}, La = (e) => typeof (e == null ? void 0 : e.then) == "function", Na = Xn.use || ((e) => {
|
|
534
534
|
if (e.status === "pending")
|
|
535
535
|
throw e;
|
|
536
536
|
if (e.status === "fulfilled")
|
|
@@ -544,7 +544,7 @@ const Ra = Ro(void 0), vi = (e) => {
|
|
|
544
544
|
}
|
|
545
545
|
), e);
|
|
546
546
|
});
|
|
547
|
-
function
|
|
547
|
+
function Ta(e, t) {
|
|
548
548
|
const n = vi(t), [[s, r, i], o] = Do(
|
|
549
549
|
(u) => {
|
|
550
550
|
const f = n.get(e);
|
|
@@ -565,23 +565,23 @@ function La(e, t) {
|
|
|
565
565
|
o();
|
|
566
566
|
});
|
|
567
567
|
return o(), u;
|
|
568
|
-
}, [n, e, l]), Mo(c),
|
|
568
|
+
}, [n, e, l]), Mo(c), La(c) ? Na(c) : c;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function Fa(e, t) {
|
|
571
571
|
const n = vi(t);
|
|
572
572
|
return W(
|
|
573
573
|
(...r) => n.set(e, ...r),
|
|
574
574
|
[n, e]
|
|
575
575
|
);
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function Ua(e, t) {
|
|
578
578
|
return [
|
|
579
|
-
|
|
579
|
+
Ta(e, t),
|
|
580
580
|
// We do wrong type assertion here, which results in throwing an error.
|
|
581
|
-
|
|
581
|
+
Fa(e, t)
|
|
582
582
|
];
|
|
583
583
|
}
|
|
584
|
-
const
|
|
584
|
+
const qa = new gi({ children: "blockNodes" }), bi = (e, t = null) => Pe(
|
|
585
585
|
e.map((n) => {
|
|
586
586
|
if (n = t !== null ? { ...n, parent: t } : n, n.children && n.children.length) {
|
|
587
587
|
const s = [...n.children];
|
|
@@ -609,16 +609,16 @@ function wi(e, t, n) {
|
|
|
609
609
|
}
|
|
610
610
|
return Pe(r);
|
|
611
611
|
}
|
|
612
|
-
function
|
|
613
|
-
let t =
|
|
612
|
+
function $a(e) {
|
|
613
|
+
let t = qa.convert(e.map((n) => Zn(n, ["settings"])));
|
|
614
614
|
return t = !t.type && t.blockNodes ? t.blockNodes : Le(t) ? [] : [t], t;
|
|
615
615
|
}
|
|
616
616
|
const Si = (e) => {
|
|
617
617
|
const t = {};
|
|
618
618
|
return Object.keys(e).forEach((n) => {
|
|
619
|
-
|
|
619
|
+
$s(e[n]) && e[n].startsWith("slot") && (t[n] = e[n].replace("slot:", ""));
|
|
620
620
|
}), t;
|
|
621
|
-
},
|
|
621
|
+
}, Qa = (e, t, n = null) => {
|
|
622
622
|
let s = Oe(e, { _id: t });
|
|
623
623
|
s = { ...s, oldId: s._id, _id: st() }, n && (s = { ...s, _parent: n });
|
|
624
624
|
const r = [s];
|
|
@@ -629,9 +629,9 @@ const Si = (e) => {
|
|
|
629
629
|
return Object.keys(l).length > 0 && Object.keys(l).forEach((u) => {
|
|
630
630
|
const f = Oe(i, { oldId: l[u].replace("slot:", "") });
|
|
631
631
|
c[u] = `slot:${f._id}`;
|
|
632
|
-
}),
|
|
632
|
+
}), Zn(c, ["global", "oldId"]);
|
|
633
633
|
});
|
|
634
|
-
},
|
|
634
|
+
}, Va = Yo(
|
|
635
635
|
// eslint-disable-next-line default-param-last
|
|
636
636
|
(e = [], t) => {
|
|
637
637
|
switch (t.type) {
|
|
@@ -657,37 +657,37 @@ const Si = (e) => {
|
|
|
657
657
|
debug: !1,
|
|
658
658
|
ignoreInitialState: !1,
|
|
659
659
|
limit: 30,
|
|
660
|
-
filter:
|
|
660
|
+
filter: Xo(["update_props_realtime", "add_duplicate_blocks", "set_page_blocks"])
|
|
661
661
|
}
|
|
662
|
-
), ts =
|
|
662
|
+
), ts = Ea(
|
|
663
663
|
{
|
|
664
664
|
past: [],
|
|
665
665
|
present: [],
|
|
666
666
|
future: []
|
|
667
667
|
},
|
|
668
|
-
|
|
668
|
+
Va
|
|
669
669
|
);
|
|
670
670
|
ts.debugLabel = "pageBlocksAtom";
|
|
671
|
-
const
|
|
671
|
+
const ke = N((e) => {
|
|
672
672
|
var t;
|
|
673
673
|
return (t = e(ts)) == null ? void 0 : t.present;
|
|
674
674
|
});
|
|
675
|
-
|
|
676
|
-
const
|
|
677
|
-
|
|
678
|
-
const Pi = N((e) =>
|
|
675
|
+
ke.debugLabel = "presentBlocksAtom";
|
|
676
|
+
const Qs = ja(ke);
|
|
677
|
+
Qs.debugLabel = "pageBlocksAtomsAtom";
|
|
678
|
+
const Pi = N((e) => $a(e(ke)));
|
|
679
679
|
Pi.debugLabel = "pageBlocksTreeAtom";
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
const
|
|
683
|
-
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
const
|
|
687
|
-
const [, e] =
|
|
680
|
+
const Ka = N("");
|
|
681
|
+
Ka.debugLabel = "builderActivePageAtom";
|
|
682
|
+
const za = N(-1);
|
|
683
|
+
za.debugLabel = "destinationDropIndexAtom";
|
|
684
|
+
const Ga = N(!1);
|
|
685
|
+
Ga.debugLabel = "addBlocksModalAtom";
|
|
686
|
+
const xe = () => {
|
|
687
|
+
const [, e] = X(ts);
|
|
688
688
|
return e;
|
|
689
|
-
},
|
|
690
|
-
const e =
|
|
689
|
+
}, Td = () => {
|
|
690
|
+
const e = xe(), t = ne(Pi), n = W(
|
|
691
691
|
(s) => {
|
|
692
692
|
const r = bi(s);
|
|
693
693
|
e({ type: "set_page_blocks", payload: r });
|
|
@@ -695,66 +695,66 @@ const ke = () => {
|
|
|
695
695
|
[e]
|
|
696
696
|
);
|
|
697
697
|
return [t, n];
|
|
698
|
-
},
|
|
699
|
-
const e =
|
|
698
|
+
}, Wa = () => {
|
|
699
|
+
const e = xe();
|
|
700
700
|
return [W(
|
|
701
701
|
(n) => {
|
|
702
702
|
e({ type: "set_page_blocks", payload: n });
|
|
703
703
|
},
|
|
704
704
|
[e]
|
|
705
705
|
)];
|
|
706
|
-
},
|
|
706
|
+
}, As = (e) => ["Box", "Slot", "Form", "DataContext", "Link", "List", "ListItem", "Row", "Column", "Table", "TableCell"].includes(
|
|
707
707
|
e
|
|
708
|
-
),
|
|
709
|
-
function
|
|
710
|
-
return e === "Slot" || t === "List" && e !== "ListItem" || t === "Row" && e !== "Column" ? !1 :
|
|
708
|
+
), Fd = (e) => !["Slot"].includes(e), Ud = (e) => !["Slot"].includes(e);
|
|
709
|
+
function Ha(e, t) {
|
|
710
|
+
return e === "Slot" || t === "List" && e !== "ListItem" || t === "Row" && e !== "Column" ? !1 : As(t);
|
|
711
711
|
}
|
|
712
|
-
const
|
|
712
|
+
const qd = (e, { dragSource: t, dropTarget: n }) => {
|
|
713
713
|
const s = ee(t, "data._type", ""), r = ee(n, "data._type", "");
|
|
714
|
-
return s === "Slot" || ee(t, "id") && ee(t, "id") === ee(n, "id") ? !1 : Le(r) ? !0 :
|
|
715
|
-
},
|
|
716
|
-
|
|
717
|
-
const
|
|
718
|
-
const t = e(
|
|
714
|
+
return s === "Slot" || ee(t, "id") && ee(t, "id") === ee(n, "id") ? !1 : Le(r) ? !0 : Ha(s, r);
|
|
715
|
+
}, Vs = N([]);
|
|
716
|
+
Vs.debugLabel = "selectedBlockIdsAtom";
|
|
717
|
+
const Ks = N((e) => {
|
|
718
|
+
const t = e(ke), n = e(Vs);
|
|
719
719
|
return de(
|
|
720
720
|
te(t, ({ _id: s }) => he(n, s)),
|
|
721
721
|
(s) => ({ ...s })
|
|
722
722
|
);
|
|
723
723
|
});
|
|
724
|
-
|
|
725
|
-
const
|
|
726
|
-
const t = e(
|
|
724
|
+
Ks.debugLabel = "selectedBlocksAtom";
|
|
725
|
+
const zs = N((e) => {
|
|
726
|
+
const t = e(Ks);
|
|
727
727
|
return t.length === 0 ? null : t.length === 1 ? t[0] : {
|
|
728
728
|
type: "Multiple",
|
|
729
729
|
id: de(t, "id")
|
|
730
730
|
};
|
|
731
731
|
});
|
|
732
|
-
|
|
733
|
-
const
|
|
734
|
-
const t = e(
|
|
735
|
-
return te(e(
|
|
732
|
+
zs.debugLabel = "selectedBlockAtom";
|
|
733
|
+
const Ja = (e) => ee(e, "parent", null), Ya = N((e) => {
|
|
734
|
+
const t = e(Ks), n = de(t, Ja);
|
|
735
|
+
return te(e(ke), (s) => he(n, s._id));
|
|
736
736
|
});
|
|
737
|
-
|
|
738
|
-
const xi = N(() => !1);
|
|
739
|
-
xi.debugLabel = "selectedBlockFlexChildAtom";
|
|
737
|
+
Ya.debugLabel = "selectedBlocksParentsAtom";
|
|
740
738
|
const ki = N(() => !1);
|
|
741
|
-
ki.debugLabel = "
|
|
742
|
-
const
|
|
743
|
-
|
|
744
|
-
const
|
|
739
|
+
ki.debugLabel = "selectedBlockFlexChildAtom";
|
|
740
|
+
const xi = N(() => !1);
|
|
741
|
+
xi.debugLabel = "selectedBlockGridChildAtom";
|
|
742
|
+
const Gs = N("");
|
|
743
|
+
Gs.debugLabel = "styleStateAtom";
|
|
744
|
+
const Ai = kt("styleBreakpoint", "xs");
|
|
745
745
|
Ai.debugLabel = "styleBreakpointAtom";
|
|
746
|
-
const
|
|
747
|
-
flexChild: ne(
|
|
748
|
-
gridChild: ne(
|
|
749
|
-
}),
|
|
750
|
-
const [e, t] =
|
|
746
|
+
const $d = () => ({
|
|
747
|
+
flexChild: ne(ki),
|
|
748
|
+
gridChild: ne(xi)
|
|
749
|
+
}), Qd = () => ne(zs), xt = () => {
|
|
750
|
+
const [e, t] = X(Vs), n = W(
|
|
751
751
|
(s) => {
|
|
752
752
|
t((r) => he(r, s) ? di(r, s) : [...r, s]);
|
|
753
753
|
},
|
|
754
754
|
[t]
|
|
755
755
|
);
|
|
756
756
|
return [e, t, n];
|
|
757
|
-
},
|
|
757
|
+
}, mr = (e, t = "") => {
|
|
758
758
|
switch (e.type) {
|
|
759
759
|
case "singular":
|
|
760
760
|
return e.uiSchema;
|
|
@@ -765,7 +765,7 @@ const Ud = () => ({
|
|
|
765
765
|
if (he(["slot", "styles"], c.type))
|
|
766
766
|
return;
|
|
767
767
|
const l = ee(c, "i18n", !1) ? `${o}-${t}` : o;
|
|
768
|
-
s[l] =
|
|
768
|
+
s[l] = mr(c, t);
|
|
769
769
|
}), s;
|
|
770
770
|
case "list":
|
|
771
771
|
const { itemProperties: r } = e, i = {
|
|
@@ -776,12 +776,12 @@ const Ud = () => ({
|
|
|
776
776
|
if (he(["slot", "styles"], c.type))
|
|
777
777
|
return;
|
|
778
778
|
const l = ee(c, "i18n", !1) ? `${o}-${t}` : o;
|
|
779
|
-
i.items[l] =
|
|
779
|
+
i.items[l] = mr(c, t);
|
|
780
780
|
}), i;
|
|
781
781
|
default:
|
|
782
782
|
return {};
|
|
783
783
|
}
|
|
784
|
-
},
|
|
784
|
+
}, gr = (e, t = "") => {
|
|
785
785
|
switch (e.type) {
|
|
786
786
|
case "singular":
|
|
787
787
|
return e.schema;
|
|
@@ -796,7 +796,7 @@ const Ud = () => ({
|
|
|
796
796
|
if (he(["slot", "styles"], u.type))
|
|
797
797
|
return;
|
|
798
798
|
const f = ee(u, "i18n", !1) ? `${l}-${t}` : l;
|
|
799
|
-
r.properties[f] =
|
|
799
|
+
r.properties[f] = gr(u, t);
|
|
800
800
|
}), r;
|
|
801
801
|
case "list":
|
|
802
802
|
const { itemProperties: i, title: o } = e, c = {
|
|
@@ -812,7 +812,7 @@ const Ud = () => ({
|
|
|
812
812
|
if (he(["slot", "styles"], u.type))
|
|
813
813
|
return;
|
|
814
814
|
const f = ee(u, "i18n", !1) ? `${l}-${t}` : l;
|
|
815
|
-
c.items.properties[f] =
|
|
815
|
+
c.items.properties[f] = gr(u, t), it(c.items, "title", ee(u, "itemTitle", `${o} item`));
|
|
816
816
|
}), c;
|
|
817
817
|
default:
|
|
818
818
|
return {};
|
|
@@ -820,9 +820,9 @@ const Ud = () => ({
|
|
|
820
820
|
}, Ei = (e) => {
|
|
821
821
|
const t = {};
|
|
822
822
|
return Object.keys(e).forEach((n) => {
|
|
823
|
-
t[n] =
|
|
823
|
+
t[n] = Za(e[n]);
|
|
824
824
|
}), t;
|
|
825
|
-
},
|
|
825
|
+
}, Xa = (e) => {
|
|
826
826
|
if (Le(e.default))
|
|
827
827
|
return [];
|
|
828
828
|
const { itemProperties: t } = e;
|
|
@@ -832,24 +832,24 @@ const Ud = () => ({
|
|
|
832
832
|
es(t, i) && ee(t[i], "i18n", !1) && (s[i] = yi);
|
|
833
833
|
}), s;
|
|
834
834
|
});
|
|
835
|
-
},
|
|
835
|
+
}, Za = (e) => {
|
|
836
836
|
switch (e.type) {
|
|
837
837
|
case "styles":
|
|
838
838
|
return e.default;
|
|
839
839
|
case "slot":
|
|
840
|
-
return `${
|
|
840
|
+
return `${ks}${st()}`;
|
|
841
841
|
case "singular":
|
|
842
842
|
const { i18n: t, schema: n } = e;
|
|
843
843
|
return t ? yi : ee(n, "default", "");
|
|
844
844
|
case "model":
|
|
845
845
|
return Ei(e.properties);
|
|
846
846
|
case "list":
|
|
847
|
-
return
|
|
847
|
+
return Xa(e);
|
|
848
848
|
default:
|
|
849
849
|
return "";
|
|
850
850
|
}
|
|
851
|
-
},
|
|
852
|
-
function
|
|
851
|
+
}, ec = () => ne(ke);
|
|
852
|
+
function yr(e, t, n, s, r) {
|
|
853
853
|
if (t === null)
|
|
854
854
|
return [...e, ...s];
|
|
855
855
|
if (n !== null) {
|
|
@@ -866,23 +866,23 @@ function gr(e, t, n, s, r) {
|
|
|
866
866
|
const c = i + 1;
|
|
867
867
|
return e.splice(c, 0, ...s), e;
|
|
868
868
|
}
|
|
869
|
-
const
|
|
870
|
-
const e =
|
|
869
|
+
const Vd = () => {
|
|
870
|
+
const e = xe(), t = ec(), [, n] = xt(), s = W(
|
|
871
871
|
(i, o, c) => {
|
|
872
872
|
var f;
|
|
873
873
|
for (let p = 0; p < i.length; p++) {
|
|
874
874
|
const { _id: P } = i[p];
|
|
875
875
|
i[p]._id = st();
|
|
876
876
|
const g = te(i, { _parent: P });
|
|
877
|
-
for (let
|
|
878
|
-
g[
|
|
877
|
+
for (let O = 0; O < g.length; O++)
|
|
878
|
+
g[O]._parent = i[p]._id;
|
|
879
879
|
}
|
|
880
880
|
let l;
|
|
881
881
|
o && (l = Oe(t, { _id: o }), i[0]._parent = o);
|
|
882
|
-
const u = l ?
|
|
882
|
+
const u = l ? As(l._type) : !0;
|
|
883
883
|
return !u && l && (i[0]._parent = l._parent), e({
|
|
884
884
|
type: "set_blocks",
|
|
885
|
-
payload:
|
|
885
|
+
payload: yr(t, o || null, c || null, i, u)
|
|
886
886
|
}), n([(f = Me(i)) == null ? void 0 : f._id]), Me(i);
|
|
887
887
|
},
|
|
888
888
|
[t, e, n]
|
|
@@ -890,13 +890,13 @@ const $d = () => {
|
|
|
890
890
|
return { addCoreBlock: W(
|
|
891
891
|
(i, o, c) => {
|
|
892
892
|
if (es(i, "blocks")) {
|
|
893
|
-
const
|
|
894
|
-
return s(
|
|
893
|
+
const C = i.blocks;
|
|
894
|
+
return s(C, o, c);
|
|
895
895
|
}
|
|
896
896
|
const l = st(), u = Ei(i.props), f = [];
|
|
897
|
-
fi(u, (
|
|
898
|
-
if (hi(
|
|
899
|
-
const A =
|
|
897
|
+
fi(u, (C, y) => {
|
|
898
|
+
if (hi(C, ks)) {
|
|
899
|
+
const A = C.replace(ks, "");
|
|
900
900
|
f.push({
|
|
901
901
|
_id: A,
|
|
902
902
|
_type: "Slot",
|
|
@@ -914,33 +914,33 @@ const $d = () => {
|
|
|
914
914
|
};
|
|
915
915
|
let P;
|
|
916
916
|
o && (P = Oe(t, { _id: o }), p._parent = o);
|
|
917
|
-
const g = P ?
|
|
917
|
+
const g = P ? As(P._type) : !0;
|
|
918
918
|
!g && P && (p._parent = P._parent);
|
|
919
|
-
const
|
|
919
|
+
const O = [p, ...f];
|
|
920
920
|
return e({
|
|
921
921
|
type: "set_blocks",
|
|
922
|
-
payload:
|
|
922
|
+
payload: yr(t, o || null, c || null, O, g)
|
|
923
923
|
}), n([p._id]), p;
|
|
924
924
|
},
|
|
925
925
|
[s, t, e, n]
|
|
926
926
|
), addPredefinedBlock: s };
|
|
927
|
-
},
|
|
927
|
+
}, vr = {
|
|
928
928
|
xs: 420,
|
|
929
929
|
sm: 620,
|
|
930
930
|
md: 768,
|
|
931
931
|
lg: 1024,
|
|
932
932
|
xl: 1280,
|
|
933
933
|
"2xl": 1536
|
|
934
|
-
},
|
|
935
|
-
function
|
|
934
|
+
}, br = ["xs", "sm", "md", "lg", "xl", "2xl"];
|
|
935
|
+
function tc(e, t) {
|
|
936
936
|
if (t === null)
|
|
937
937
|
return "baseClasses";
|
|
938
938
|
const n = t.mq;
|
|
939
939
|
if (n === "xs" || t.dark || t.mod !== "")
|
|
940
940
|
return "classes";
|
|
941
|
-
let s = "baseClasses", r =
|
|
941
|
+
let s = "baseClasses", r = br.indexOf(n);
|
|
942
942
|
for (; r > 0; ) {
|
|
943
|
-
const i =
|
|
943
|
+
const i = br[r - 1];
|
|
944
944
|
if (Oe(e, {
|
|
945
945
|
mq: i,
|
|
946
946
|
property: t.property
|
|
@@ -952,25 +952,25 @@ function Xa(e, t) {
|
|
|
952
952
|
}
|
|
953
953
|
return s;
|
|
954
954
|
}
|
|
955
|
-
const
|
|
956
|
-
function
|
|
955
|
+
const wr = [];
|
|
956
|
+
function nc(e = "", t = "", n = []) {
|
|
957
957
|
e = e.trim().replace(/ +/g, "");
|
|
958
958
|
let s = te(
|
|
959
959
|
de(e.split(" "), qn),
|
|
960
|
-
(u) => !
|
|
961
|
-
), r = te(de(t.split(" "), qn), (u) => !
|
|
960
|
+
(u) => !Ss(u)
|
|
961
|
+
), r = te(de(t.split(" "), qn), (u) => !Ss(u));
|
|
962
962
|
r = te(
|
|
963
963
|
r,
|
|
964
|
-
(u) => !he(
|
|
964
|
+
(u) => !he(wr, u.property)
|
|
965
965
|
);
|
|
966
966
|
const i = [], o = [];
|
|
967
967
|
nt(n, (u) => {
|
|
968
|
-
const f = qn(u), p = Oe(s,
|
|
968
|
+
const f = qn(u), p = Oe(s, or(f, ["dark", "mq", "mod", "property"]));
|
|
969
969
|
if (p && (s = te(
|
|
970
970
|
s,
|
|
971
971
|
(P) => P.fullCls !== (p == null ? void 0 : p.fullCls)
|
|
972
|
-
)), i.push(f), f.mq === "xs" && !f.dark && f.mod === "" && (r = te(r, (P) => P.property !== f.property)),
|
|
973
|
-
const P = Oe(r,
|
|
972
|
+
)), i.push(f), f.mq === "xs" && !f.dark && f.mod === "" && (r = te(r, (P) => P.property !== f.property)), tc(s, f) === "baseClasses" && !he(wr, f.property)) {
|
|
973
|
+
const P = Oe(r, or(f, ["property"]));
|
|
974
974
|
p && (r = te(
|
|
975
975
|
r,
|
|
976
976
|
(g) => g.fullCls !== (P == null ? void 0 : P.fullCls)
|
|
@@ -982,79 +982,79 @@ function ec(e = "", t = "", n = []) {
|
|
|
982
982
|
}
|
|
983
983
|
});
|
|
984
984
|
const c = de(
|
|
985
|
-
|
|
985
|
+
Ps([...s, ...i], (u) => vr[u.mq]),
|
|
986
986
|
"fullCls"
|
|
987
987
|
).join(" ");
|
|
988
988
|
return `${de(
|
|
989
|
-
|
|
989
|
+
Ps([...r, ...o], (u) => vr[u.mq]),
|
|
990
990
|
"fullCls"
|
|
991
991
|
).join(" ").trim()},${c.trim()}`.trim().replace(/ +/g, "");
|
|
992
992
|
}
|
|
993
993
|
const On = N([]);
|
|
994
994
|
On.debugLabel = "selectedStylingBlocksAtom";
|
|
995
|
-
const Oi = () =>
|
|
995
|
+
const Oi = () => X(On), sc = (e) => {
|
|
996
996
|
const t = e.replace(vt, "").split(",");
|
|
997
997
|
return { baseClasses: t[0], classes: t[1] };
|
|
998
|
-
},
|
|
998
|
+
}, rc = N(null, (e, t, { blockIds: n, newClasses: s, dispatch: r }) => {
|
|
999
999
|
const i = te(
|
|
1000
|
-
e(
|
|
1000
|
+
e(Qs),
|
|
1001
1001
|
(c) => (
|
|
1002
1002
|
// @ts-ignore
|
|
1003
1003
|
n.includes(e(c)._id)
|
|
1004
1004
|
)
|
|
1005
1005
|
), o = Me(e(On));
|
|
1006
1006
|
nt(i, (c) => {
|
|
1007
|
-
const l = e(c), u = ee(l, o.prop, `${vt},`), { baseClasses: f, classes: p } =
|
|
1007
|
+
const l = e(c), u = ee(l, o.prop, `${vt},`), { baseClasses: f, classes: p } = sc(u);
|
|
1008
1008
|
r({
|
|
1009
1009
|
type: "update_props_realtime",
|
|
1010
1010
|
payload: {
|
|
1011
1011
|
ids: [l._id],
|
|
1012
|
-
props: { [o.prop]: `${vt}${
|
|
1012
|
+
props: { [o.prop]: `${vt}${nc(p, f, s)}` }
|
|
1013
1013
|
}
|
|
1014
1014
|
});
|
|
1015
1015
|
});
|
|
1016
|
-
}),
|
|
1017
|
-
const e =
|
|
1016
|
+
}), Kd = () => {
|
|
1017
|
+
const e = xe(), t = ot(rc);
|
|
1018
1018
|
return W(
|
|
1019
1019
|
(n, s, r) => {
|
|
1020
1020
|
t({ blockIds: n, newClasses: s, dispatch: e }), r && setTimeout(() => e({ type: "create_snapshot" }), 500);
|
|
1021
1021
|
},
|
|
1022
1022
|
[e, t]
|
|
1023
1023
|
);
|
|
1024
|
-
},
|
|
1025
|
-
|
|
1026
|
-
const
|
|
1027
|
-
const t = e(
|
|
1024
|
+
}, _i = N([]);
|
|
1025
|
+
_i.debugLabel = "buildingBlocksAtom";
|
|
1026
|
+
const ic = N((e) => {
|
|
1027
|
+
const t = e(_i);
|
|
1028
1028
|
return te(t, (n) => es(n, "blockId"));
|
|
1029
|
-
}),
|
|
1030
|
-
},
|
|
1031
|
-
const e = ea(), t = ne(
|
|
1032
|
-
}, s = W(() =>
|
|
1029
|
+
}), oc = () => {
|
|
1030
|
+
}, ac = () => {
|
|
1031
|
+
const e = ea(), t = ne(ic), n = () => {
|
|
1032
|
+
}, s = W(() => oc(), []);
|
|
1033
1033
|
return [e, t, n, s];
|
|
1034
|
-
},
|
|
1035
|
-
const [e, t] =
|
|
1034
|
+
}, cc = N(!1), Ci = () => {
|
|
1035
|
+
const [e, t] = X(cc);
|
|
1036
1036
|
return [e, t];
|
|
1037
|
-
},
|
|
1038
|
-
const [e, t] =
|
|
1037
|
+
}, uc = N(xs), Ii = () => {
|
|
1038
|
+
const [e, t] = X(uc);
|
|
1039
1039
|
return [
|
|
1040
1040
|
Uo(e) ? { ...xs, ...e } : xs,
|
|
1041
1041
|
t
|
|
1042
1042
|
];
|
|
1043
|
-
},
|
|
1044
|
-
function
|
|
1043
|
+
}, lc = N(null), dc = () => ({ currentPage: ne(lc) }), ji = new gi({});
|
|
1044
|
+
function fc(e) {
|
|
1045
1045
|
let t = ji.convert(e);
|
|
1046
1046
|
return t = !t.type && t.children && t.children.length ? t.children : Le(t) ? [] : [t], t;
|
|
1047
1047
|
}
|
|
1048
|
-
const
|
|
1048
|
+
const Ws = (e, t) => Pe(
|
|
1049
1049
|
e.map((n) => {
|
|
1050
1050
|
if (n = t ? { ...n, parent: t } : { ...n }, n.children) {
|
|
1051
1051
|
const s = [...n.children];
|
|
1052
|
-
return delete n.children, Pe([n, ...
|
|
1052
|
+
return delete n.children, Pe([n, ...Ws(s, n._id)]);
|
|
1053
1053
|
}
|
|
1054
1054
|
return n;
|
|
1055
1055
|
})
|
|
1056
1056
|
);
|
|
1057
|
-
function
|
|
1057
|
+
function Hs(e, t = !1) {
|
|
1058
1058
|
for (let n = 0; n < e.length; n++) {
|
|
1059
1059
|
const s = e[n];
|
|
1060
1060
|
s.global && !t ? e[n] = {
|
|
@@ -1062,47 +1062,47 @@ function Ws(e, t = !1) {
|
|
|
1062
1062
|
_parent: ee(s, "parent", null),
|
|
1063
1063
|
blockId: s.blockId,
|
|
1064
1064
|
_id: s._id
|
|
1065
|
-
} : s.children && s.children.length &&
|
|
1065
|
+
} : s.children && s.children.length && Hs(s.children);
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
1068
|
function Bi(e) {
|
|
1069
1069
|
let t = [], n = te(e, { type: "GlobalBlock" });
|
|
1070
1070
|
return n.length > 0 && (n = de(n, Ri), nt(n, (s) => {
|
|
1071
|
-
t = [...t, ...
|
|
1071
|
+
t = [...t, ...hc(s)];
|
|
1072
1072
|
})), t;
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function hc(e) {
|
|
1075
1075
|
let t = [];
|
|
1076
1076
|
const n = ee(Me(e), "parent", null);
|
|
1077
1077
|
it(Me(e), "parent", null);
|
|
1078
1078
|
const s = [ji.convert(Di(e))];
|
|
1079
|
-
|
|
1080
|
-
let r =
|
|
1079
|
+
Hs(s, !0);
|
|
1080
|
+
let r = Ws(s, e[0]._id);
|
|
1081
1081
|
return r = it(r, "0.parent", n), t = [...t, r, ...Bi(r)], t;
|
|
1082
1082
|
}
|
|
1083
1083
|
function Ri(e) {
|
|
1084
|
-
const t = Oe(
|
|
1084
|
+
const t = Oe(Es, { _id: e._id });
|
|
1085
1085
|
if (!t)
|
|
1086
1086
|
return [];
|
|
1087
|
-
const n = [t], s = te(
|
|
1087
|
+
const n = [t], s = te(Es, { _parent: e._id });
|
|
1088
1088
|
return s.length ? Pe([...n, ...Pe(de(s, Ri))]) : Pe(n);
|
|
1089
1089
|
}
|
|
1090
1090
|
const Di = (e) => JSON.parse(JSON.stringify(e));
|
|
1091
|
-
let
|
|
1092
|
-
function
|
|
1093
|
-
|
|
1094
|
-
const t =
|
|
1095
|
-
|
|
1096
|
-
const n =
|
|
1091
|
+
let Es = [];
|
|
1092
|
+
function pc(e) {
|
|
1093
|
+
Es = e;
|
|
1094
|
+
const t = fc(Di(e));
|
|
1095
|
+
Hs(t);
|
|
1096
|
+
const n = Ws(t, null), s = Bi(n), r = {};
|
|
1097
1097
|
return nt(s, (i) => it(r, Me(i).blockId, i)), [n, r];
|
|
1098
1098
|
}
|
|
1099
1099
|
const Mi = () => {
|
|
1100
|
-
const [e] = Ii(), { currentPage: t } =
|
|
1100
|
+
const [e] = Ii(), { currentPage: t } = dc(), n = ne(ke);
|
|
1101
1101
|
return W(() => {
|
|
1102
1102
|
const s = de(
|
|
1103
1103
|
n,
|
|
1104
|
-
(o) =>
|
|
1105
|
-
), [r = [], i = []] =
|
|
1104
|
+
(o) => Zn(o, ["expanded", "order", "title", "siblings", "tempClasses"])
|
|
1105
|
+
), [r = [], i = []] = pc(s);
|
|
1106
1106
|
return {
|
|
1107
1107
|
currentPage: t,
|
|
1108
1108
|
blocks: r,
|
|
@@ -1110,42 +1110,42 @@ const Mi = () => {
|
|
|
1110
1110
|
};
|
|
1111
1111
|
}, [e, t, n]);
|
|
1112
1112
|
};
|
|
1113
|
-
|
|
1113
|
+
kt("blockStylingActiveTab", 1);
|
|
1114
1114
|
N([]);
|
|
1115
1115
|
const Li = N(!1);
|
|
1116
1116
|
Li.debugLabel = "readOnlyModeAtom";
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1119
|
-
const pc = N(!1);
|
|
1120
|
-
pc.debugLabel = "advanceStylingOpenAtom";
|
|
1121
|
-
const mc = N("online");
|
|
1122
|
-
mc.debugLabel = "networkModeAtom";
|
|
1123
|
-
xt("currentUiLibrary", "");
|
|
1117
|
+
const mc = N(!1);
|
|
1118
|
+
mc.debugLabel = "inlineEditingActiveAtom";
|
|
1124
1119
|
const gc = N(!1);
|
|
1125
|
-
gc.debugLabel = "
|
|
1126
|
-
const yc = N(
|
|
1127
|
-
yc.debugLabel = "
|
|
1128
|
-
|
|
1129
|
-
vc
|
|
1130
|
-
|
|
1131
|
-
bc
|
|
1132
|
-
|
|
1133
|
-
wc
|
|
1134
|
-
|
|
1135
|
-
Sc
|
|
1136
|
-
|
|
1137
|
-
Pc
|
|
1138
|
-
|
|
1139
|
-
|
|
1120
|
+
gc.debugLabel = "advanceStylingOpenAtom";
|
|
1121
|
+
const yc = N("online");
|
|
1122
|
+
yc.debugLabel = "networkModeAtom";
|
|
1123
|
+
kt("currentUiLibrary", "");
|
|
1124
|
+
const vc = N(!1);
|
|
1125
|
+
vc.debugLabel = "codeEditorOpenAtom";
|
|
1126
|
+
const bc = N(!1);
|
|
1127
|
+
bc.debugLabel = "editLayerNameAtom";
|
|
1128
|
+
const wc = N("");
|
|
1129
|
+
wc.debugLabel = "activeLanguageAtom";
|
|
1130
|
+
const Sc = N("");
|
|
1131
|
+
Sc.debugLabel = "primaryLanguageAtom";
|
|
1132
|
+
const Pc = N(null);
|
|
1133
|
+
Pc.debugLabel = "canvasIframeAtom";
|
|
1134
|
+
const kc = N("layers");
|
|
1135
|
+
kc.debugLabel = "activePanelAtom";
|
|
1136
|
+
const xc = N(!1);
|
|
1137
|
+
xc.debugLabel = "addBlockOffCanvasAtom";
|
|
1138
|
+
const Ac = N("");
|
|
1139
|
+
Ac.debugLabel = "showPredefinedBlockCategoryAtom";
|
|
1140
1140
|
const ns = N({ undoCount: 0, redoCount: 0 });
|
|
1141
1141
|
ns.debugLabel = "historyStatesAtom";
|
|
1142
1142
|
const ss = N("SAVED");
|
|
1143
1143
|
ss.debugLabel = "pageSyncStateAtom";
|
|
1144
|
-
const
|
|
1145
|
-
const [e, t] =
|
|
1144
|
+
const zd = () => {
|
|
1145
|
+
const [e, t] = X(ss), n = dn("onSaveBlocks", async () => {
|
|
1146
1146
|
}), s = dn("onSyncStatusChange", () => {
|
|
1147
1147
|
}), r = Mi(), i = ot(ns), { undoCount: o, redoCount: c } = rs();
|
|
1148
|
-
return { savePage:
|
|
1148
|
+
return { savePage: Zo(
|
|
1149
1149
|
async () => {
|
|
1150
1150
|
t("SAVING"), s("SAVING");
|
|
1151
1151
|
const u = r();
|
|
@@ -1158,7 +1158,7 @@ const Vd = () => {
|
|
|
1158
1158
|
// save only every 5 seconds
|
|
1159
1159
|
), syncState: e, setSyncState: t };
|
|
1160
1160
|
}, rs = () => {
|
|
1161
|
-
const e = ne(ts), [{ undoCount: t, redoCount: n }] =
|
|
1161
|
+
const e = ne(ts), [{ undoCount: t, redoCount: n }] = X(ns), s = xe(), [r] = Ci(), [, i] = xt(), [, o] = Oi(), [, c] = X(ss), l = dn("onSyncStatusChange", () => {
|
|
1162
1162
|
}), u = W(() => {
|
|
1163
1163
|
s({ type: "create_snapshot" });
|
|
1164
1164
|
}, [s]);
|
|
@@ -1182,58 +1182,58 @@ const Vd = () => {
|
|
|
1182
1182
|
},
|
|
1183
1183
|
createSnapshot: u
|
|
1184
1184
|
};
|
|
1185
|
-
},
|
|
1185
|
+
}, Ec = () => X(Ai), Ni = kt("canvasWidth", 360), Ti = N((e) => {
|
|
1186
1186
|
const t = e(Ni);
|
|
1187
1187
|
return Ho(t).toLowerCase();
|
|
1188
|
-
}),
|
|
1189
|
-
const [e, t] =
|
|
1188
|
+
}), Gd = () => {
|
|
1189
|
+
const [e, t] = X(Ni), n = ne(Ti), [s, r] = Ec();
|
|
1190
1190
|
return Ee(() => {
|
|
1191
1191
|
s !== "xs" && r(n);
|
|
1192
1192
|
}, [n, s, r]), [e, n, t];
|
|
1193
|
-
},
|
|
1194
|
-
const [e, t] =
|
|
1193
|
+
}, Oc = kt("canvasZoom", 100), Wd = () => X(Oc), Fi = N([]), Ui = () => {
|
|
1194
|
+
const [e, t] = X(Fi), n = ot(Js), s = W(
|
|
1195
1195
|
(r) => {
|
|
1196
1196
|
t(r), n([]);
|
|
1197
1197
|
},
|
|
1198
1198
|
[t, n]
|
|
1199
1199
|
);
|
|
1200
1200
|
return [e, s];
|
|
1201
|
-
},
|
|
1202
|
-
const [e, t] =
|
|
1201
|
+
}, Js = N([]), _c = () => {
|
|
1202
|
+
const [e, t] = X(Js), n = ot(Fi), s = W(
|
|
1203
1203
|
(r) => {
|
|
1204
1204
|
t(r), n([]);
|
|
1205
1205
|
},
|
|
1206
1206
|
[t, n]
|
|
1207
1207
|
);
|
|
1208
1208
|
return [e, s];
|
|
1209
|
-
}, qi =
|
|
1210
|
-
const [e, t] =
|
|
1209
|
+
}, qi = kt("darkMode", !1), Hd = () => {
|
|
1210
|
+
const [e, t] = X(qi);
|
|
1211
1211
|
return [e, t];
|
|
1212
|
-
},
|
|
1213
|
-
const [e, t] =
|
|
1212
|
+
}, Cc = N(!1), Jd = () => {
|
|
1213
|
+
const [e, t] = X(Cc);
|
|
1214
1214
|
return [e, t];
|
|
1215
1215
|
}, $i = () => {
|
|
1216
|
-
const e =
|
|
1216
|
+
const e = xe(), t = ne(ke), [, n] = xt();
|
|
1217
1217
|
return W(
|
|
1218
1218
|
(s, r = null) => {
|
|
1219
1219
|
const i = [];
|
|
1220
1220
|
nt(s, (o) => {
|
|
1221
|
-
const l =
|
|
1221
|
+
const l = Qa(t, o, r === o ? null : r);
|
|
1222
1222
|
i.push(ee(l, "0._id", "")), e({ type: "add_duplicate_blocks", payload: l });
|
|
1223
1223
|
}), n(i), e({ type: "create_snapshot" });
|
|
1224
1224
|
},
|
|
1225
1225
|
[t, n, e]
|
|
1226
1226
|
);
|
|
1227
|
-
},
|
|
1228
|
-
const [e, t] =
|
|
1227
|
+
}, Ic = N([]), Yd = () => {
|
|
1228
|
+
const [e, t] = X(Ic), n = W(
|
|
1229
1229
|
(s) => {
|
|
1230
1230
|
t((r) => he(r, s) ? di(r, s) : [...r, s]);
|
|
1231
1231
|
},
|
|
1232
1232
|
[t]
|
|
1233
1233
|
);
|
|
1234
1234
|
return [e, t, n];
|
|
1235
|
-
},
|
|
1236
|
-
const e = ne(
|
|
1235
|
+
}, jc = N(""), Bc = () => X(jc), Xd = () => {
|
|
1236
|
+
const e = ne(ke), t = xe(), n = Mi(), [, , s] = ac();
|
|
1237
1237
|
return W(
|
|
1238
1238
|
async (r, i) => {
|
|
1239
1239
|
const o = st(16), c = de(e, (l) => (l._id === r && (l._globalBlockId = o, l._name = i), l));
|
|
@@ -1241,8 +1241,8 @@ const Vd = () => {
|
|
|
1241
1241
|
},
|
|
1242
1242
|
[e, t, n, s]
|
|
1243
1243
|
);
|
|
1244
|
-
},
|
|
1245
|
-
const e = ne(
|
|
1244
|
+
}, Zd = () => ({}), Rc = () => {
|
|
1245
|
+
const e = ne(ke), t = xe();
|
|
1246
1246
|
return W(
|
|
1247
1247
|
(n, s) => {
|
|
1248
1248
|
const r = de(e, (i) => (he(n, ee(i, "_id")) && it(i, "_parent", s), i));
|
|
@@ -1250,8 +1250,8 @@ const Vd = () => {
|
|
|
1250
1250
|
},
|
|
1251
1251
|
[e, t]
|
|
1252
1252
|
);
|
|
1253
|
-
},
|
|
1254
|
-
const e = ne(
|
|
1253
|
+
}, Dc = () => {
|
|
1254
|
+
const e = ne(Js), [t, n] = Ui(), s = $i(), r = Rc();
|
|
1255
1255
|
return {
|
|
1256
1256
|
canPaste: No(
|
|
1257
1257
|
() => t.length > 0 || e.length > 0,
|
|
@@ -1264,8 +1264,8 @@ const Vd = () => {
|
|
|
1264
1264
|
[t, e, s, r, n]
|
|
1265
1265
|
)
|
|
1266
1266
|
};
|
|
1267
|
-
},
|
|
1268
|
-
const e = ne(
|
|
1267
|
+
}, Mc = N(""), ef = () => {
|
|
1268
|
+
const e = ne(Mc), t = W(() => {
|
|
1269
1269
|
}, []), n = W(() => {
|
|
1270
1270
|
}, []), s = W(() => {
|
|
1271
1271
|
}, []);
|
|
@@ -1273,8 +1273,8 @@ const Vd = () => {
|
|
|
1273
1273
|
}, Qi = (e, t) => {
|
|
1274
1274
|
const n = [], s = te(e, (r) => he(t, r._id) || he(t, r._parent) ? (n.push(r._id), !1) : !0);
|
|
1275
1275
|
return Le(n) ? s : Qi(s, n);
|
|
1276
|
-
},
|
|
1277
|
-
const e =
|
|
1276
|
+
}, Lc = () => {
|
|
1277
|
+
const e = xe(), t = ne(ke), [n, s] = xt();
|
|
1278
1278
|
return W(
|
|
1279
1279
|
(r) => {
|
|
1280
1280
|
var c;
|
|
@@ -1283,9 +1283,9 @@ const Vd = () => {
|
|
|
1283
1283
|
},
|
|
1284
1284
|
[t, s, e, n]
|
|
1285
1285
|
);
|
|
1286
|
-
},
|
|
1286
|
+
}, Nc = N(null, (e, t, { blockIds: n, fullClasses: s, dispatch: r }) => {
|
|
1287
1287
|
const i = Me(e(On)), o = te(
|
|
1288
|
-
e(
|
|
1288
|
+
e(Qs),
|
|
1289
1289
|
(c) => (
|
|
1290
1290
|
// @ts-ignore
|
|
1291
1291
|
n.includes(e(c)._id)
|
|
@@ -1293,12 +1293,12 @@ const Vd = () => {
|
|
|
1293
1293
|
);
|
|
1294
1294
|
nt(o, (c) => {
|
|
1295
1295
|
const l = e(c), u = s;
|
|
1296
|
-
let { classes: f, baseClasses: p } =
|
|
1296
|
+
let { classes: f, baseClasses: p } = va(ee(l, i.prop, "styles:,"));
|
|
1297
1297
|
nt(u, (P) => {
|
|
1298
1298
|
const g = new RegExp(`(^| )${P.replace("[", "\\[").replace("]", "\\]")}($| )`, "g");
|
|
1299
1299
|
f = f.replace(g, " ").replace(/ +/g, " ").trim();
|
|
1300
|
-
const
|
|
1301
|
-
he(["2xl", "xl", "lg", "md", "sm"],
|
|
1300
|
+
const O = Me(P.split(":"));
|
|
1301
|
+
he(["2xl", "xl", "lg", "md", "sm"], O) && u.push(P.split(":").pop().trim());
|
|
1302
1302
|
}), nt(u, (P) => {
|
|
1303
1303
|
const g = new RegExp(`(^| )${P.replace("[", "\\[").replace("]", "\\]")}($| )`, "g");
|
|
1304
1304
|
p = p.replace(g, " ").replace(/ +/g, " ").trim();
|
|
@@ -1312,8 +1312,8 @@ const Vd = () => {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
});
|
|
1314
1314
|
});
|
|
1315
|
-
}),
|
|
1316
|
-
const e =
|
|
1315
|
+
}), tf = () => {
|
|
1316
|
+
const e = xe(), t = ot(Nc);
|
|
1317
1317
|
return W(
|
|
1318
1318
|
(n, s) => {
|
|
1319
1319
|
t({ blockIds: n, fullClasses: s, dispatch: e }), setTimeout(() => e({ type: "create_snapshot" }));
|
|
@@ -1321,16 +1321,16 @@ const Vd = () => {
|
|
|
1321
1321
|
[e, t]
|
|
1322
1322
|
);
|
|
1323
1323
|
}, Vi = N((e) => {
|
|
1324
|
-
const t = Me(e(On)), n = e(
|
|
1324
|
+
const t = Me(e(On)), n = e(zs);
|
|
1325
1325
|
if (!t || t.blockId !== ee(n, "_id", null))
|
|
1326
1326
|
return [];
|
|
1327
1327
|
const r = ee(n, t.prop, `${vt},`).replace(vt, "").split(",").join(" ");
|
|
1328
|
-
return te(de(r.trim().split(" "), qn), (i) => !
|
|
1329
|
-
}),
|
|
1330
|
-
const t = e(Ti), n = e(
|
|
1328
|
+
return te(de(r.trim().split(" "), qn), (i) => !Ss(i));
|
|
1329
|
+
}), nf = () => ne(Vi), Sr = { xs: 0, sm: 1, md: 2, lg: 3, xl: 4, "2xl": 5 }, Tc = N((e) => {
|
|
1330
|
+
const t = e(Ti), n = e(Gs), s = e(qi), r = Fc(t);
|
|
1331
1331
|
let i = te(e(Vi), { mod: n });
|
|
1332
|
-
return hi(n, "_") || (i = te(i, (o) => r.includes(o.mq))), i = i.sort((o, c) =>
|
|
1333
|
-
}),
|
|
1332
|
+
return hi(n, "_") || (i = te(i, (o) => r.includes(o.mq))), i = i.sort((o, c) => Sr[o.mq] - Sr[c.mq]), s || (i = te(i, { dark: !1 })), i;
|
|
1333
|
+
}), Fc = (e) => {
|
|
1334
1334
|
let t = [];
|
|
1335
1335
|
switch (e) {
|
|
1336
1336
|
case "xs":
|
|
@@ -1356,21 +1356,21 @@ const Vd = () => {
|
|
|
1356
1356
|
break;
|
|
1357
1357
|
}
|
|
1358
1358
|
return t;
|
|
1359
|
-
},
|
|
1359
|
+
}, sf = () => ne(Tc), rf = () => X(Gs), Ki = N(null, (e, t, { blockIds: n, props: s, dispatch: r }) => {
|
|
1360
1360
|
r({
|
|
1361
1361
|
type: "update_props_realtime",
|
|
1362
1362
|
payload: { ids: n, props: s }
|
|
1363
1363
|
});
|
|
1364
|
-
}),
|
|
1365
|
-
const { createSnapshot: e } = rs(), t =
|
|
1364
|
+
}), of = () => {
|
|
1365
|
+
const { createSnapshot: e } = rs(), t = xe(), n = ot(Ki);
|
|
1366
1366
|
return W(
|
|
1367
1367
|
(s, r) => {
|
|
1368
1368
|
n({ blockIds: s, props: r, dispatch: t }), e();
|
|
1369
1369
|
},
|
|
1370
1370
|
[e, t, n]
|
|
1371
1371
|
);
|
|
1372
|
-
},
|
|
1373
|
-
const e =
|
|
1372
|
+
}, af = () => {
|
|
1373
|
+
const e = xe(), t = ot(Ki);
|
|
1374
1374
|
return W(
|
|
1375
1375
|
(n, s) => {
|
|
1376
1376
|
t({ blockIds: n, props: s, dispatch: e });
|
|
@@ -1382,8 +1382,8 @@ const Vd = () => {
|
|
|
1382
1382
|
props: {},
|
|
1383
1383
|
modalProps: {},
|
|
1384
1384
|
backdropClose: !0
|
|
1385
|
-
},
|
|
1386
|
-
const [e, t] =
|
|
1385
|
+
}, Uc = N(zi), cf = () => {
|
|
1386
|
+
const [e, t] = X(Uc), n = W(
|
|
1387
1387
|
(r, i = {}, o = {}) => {
|
|
1388
1388
|
t({ name: r, props: i, modalProps: o });
|
|
1389
1389
|
},
|
|
@@ -1400,41 +1400,41 @@ const Vd = () => {
|
|
|
1400
1400
|
openModal: n,
|
|
1401
1401
|
closeModal: s
|
|
1402
1402
|
};
|
|
1403
|
-
},
|
|
1404
|
-
const [e, t] =
|
|
1403
|
+
}, uf = () => ne(Li), qc = N(""), $c = N(null), lf = () => X(qc), df = () => X($c), Qc = kt("selectedBreakpoints", ["XS", "MD", "XL"]), ff = () => {
|
|
1404
|
+
const [e, t] = X(Qc);
|
|
1405
1405
|
return [e, t];
|
|
1406
1406
|
}, Gi = () => {
|
|
1407
|
-
const e = ot(ns), { clear: t } = rs(), [, n] =
|
|
1407
|
+
const e = ot(ns), { clear: t } = rs(), [, n] = xt(), [, s] = Bc(), [, r] = Oi();
|
|
1408
1408
|
return () => {
|
|
1409
1409
|
n([]), r([]), s(""), t(), e({ undoCount: 0, redoCount: 0 });
|
|
1410
1410
|
};
|
|
1411
|
-
},
|
|
1412
|
-
const [e, t] =
|
|
1411
|
+
}, Vc = N({ en: {} }), hf = () => {
|
|
1412
|
+
const [e, t] = X(Vc), n = W(
|
|
1413
1413
|
(s, r, i) => {
|
|
1414
1414
|
it(e, `${s}.${r}`, i), t(e);
|
|
1415
1415
|
},
|
|
1416
1416
|
[e, t]
|
|
1417
1417
|
);
|
|
1418
1418
|
return [e, n];
|
|
1419
|
-
},
|
|
1420
|
-
const [n] =
|
|
1419
|
+
}, pf = (e, t) => {
|
|
1420
|
+
const [n] = X(pi);
|
|
1421
1421
|
return ee(n, e, t);
|
|
1422
|
-
},
|
|
1423
|
-
const [e, t] =
|
|
1422
|
+
}, Kc = N([]), mf = () => {
|
|
1423
|
+
const [e, t] = ws(!1), [n, s] = X(Kc), r = dn("getUILibraryBlocks", () => []);
|
|
1424
1424
|
return Ee(() => {
|
|
1425
1425
|
(async () => n.length > 0 || (t(!0), s(await r()), t(!1)))();
|
|
1426
1426
|
}, []), { data: n, isLoading: e };
|
|
1427
|
-
},
|
|
1428
|
-
const [n] =
|
|
1427
|
+
}, zc = N("en"), Gc = N("en"), Wc = N(["en"]), Hc = () => X(zc), gf = () => X(Gc), yf = () => X(Wc), vf = (e, t) => {
|
|
1428
|
+
const [n] = Hc(), s = `${e}${n ? `-${n}` : ""}`;
|
|
1429
1429
|
return { content: ee(t, s, ee(t, e, "")), propKey: e };
|
|
1430
|
-
},
|
|
1431
|
-
const [e, t] =
|
|
1432
|
-
return /* @__PURE__ */
|
|
1433
|
-
/* @__PURE__ */
|
|
1434
|
-
/* @__PURE__ */
|
|
1430
|
+
}, Jc = () => {
|
|
1431
|
+
const [e, t] = Ci(), n = dn("previewComponent");
|
|
1432
|
+
return /* @__PURE__ */ _.jsxs("div", { className: Wo("fixed inset-0 z-[999] bg-background", e ? "block" : "hidden"), children: [
|
|
1433
|
+
/* @__PURE__ */ _.jsx(mi, { size: "sm", className: "absolute right-0 top-0 m-4", onClick: () => t(!1), children: "Close Preview" }),
|
|
1434
|
+
/* @__PURE__ */ _.jsx("div", { children: n ? /* @__PURE__ */ _.jsx(Et, { fallback: /* @__PURE__ */ _.jsx(Vo, { className: "h-96 w-full" }), children: Xn.createElement(n) }) : null })
|
|
1435
1435
|
] });
|
|
1436
|
-
},
|
|
1437
|
-
const [e, t] =
|
|
1436
|
+
}, Yc = () => {
|
|
1437
|
+
const [e, t] = xt(), [, n] = _c(), s = Lc(), r = $i(), [, i] = Ui(), { pasteBlocks: o } = Dc(), { undo: c, redo: l } = rs();
|
|
1438
1438
|
Qe("esc", () => t([]), {}, [t]), Qe("ctrl+c,command+c", () => n(e), {}, [e, n]), Qe("ctrl+d,command+d", () => r(e), { preventDefault: !0 }, [e, r]), Qe("ctrl+x,command+x", () => i(e), {}, [e, i]), Qe("ctrl+v,command+v", () => e.length === 1 ? o(e[0]) : null, {}, [e, o]), Qe("ctrl+z,command+z", () => c(), {}, [c]), Qe("ctrl+y,command+y", () => l(), {}, [l]), Qe(
|
|
1439
1439
|
"del, backspace",
|
|
1440
1440
|
(u) => {
|
|
@@ -1443,105 +1443,105 @@ const Vd = () => {
|
|
|
1443
1443
|
{},
|
|
1444
1444
|
[e, s]
|
|
1445
1445
|
);
|
|
1446
|
-
},
|
|
1446
|
+
}, Xc = (e, t) => {
|
|
1447
1447
|
const n = [];
|
|
1448
1448
|
let s = Oe(e, { _id: t }), r = ee(s, "_parent", "");
|
|
1449
|
-
for (;
|
|
1449
|
+
for (; $s(r) && !Le(r); )
|
|
1450
1450
|
n.push(s == null ? void 0 : s._parent), s = Oe(e, { _id: r }), r = s == null ? void 0 : s._parent;
|
|
1451
1451
|
return Pe(n);
|
|
1452
|
-
}, Wi = N([]),
|
|
1453
|
-
const [e] =
|
|
1452
|
+
}, Wi = N([]), Zc = () => {
|
|
1453
|
+
const [e] = xt(), t = ne(ke), [, n] = X(Wi);
|
|
1454
1454
|
Ee(() => {
|
|
1455
1455
|
let s = [];
|
|
1456
1456
|
const r = Me(e);
|
|
1457
|
-
|
|
1457
|
+
$s(r) && (s = [r, ...Xc(t, r)]), n(s);
|
|
1458
1458
|
}, [e, t, n]);
|
|
1459
|
-
},
|
|
1460
|
-
const [e] =
|
|
1459
|
+
}, bf = () => ne(Wi), eu = Pt(() => import("./SidePanels-7371a5c6.js")), tu = Pt(() => import("./Topbar-da90da83.js")), nu = Pt(() => import("./CanvasArea-77c280f6.js")), su = Pt(() => import("./Settings-e49b1212.js")), ru = () => {
|
|
1460
|
+
const [e] = Ua(ss), t = (n) => {
|
|
1461
1461
|
n.preventDefault();
|
|
1462
1462
|
};
|
|
1463
|
-
return
|
|
1463
|
+
return Yc(), Zc(), Ee(() => (e !== "SAVED" ? window.onbeforeunload = () => "" : window.onbeforeunload = null, () => {
|
|
1464
1464
|
window.onbeforeunload = null;
|
|
1465
|
-
}), [e]), /* @__PURE__ */
|
|
1466
|
-
/* @__PURE__ */
|
|
1465
|
+
}), [e]), /* @__PURE__ */ _.jsx("div", { className: "h-screen w-screen bg-background text-foreground", children: /* @__PURE__ */ _.jsxs(Ko, { children: [
|
|
1466
|
+
/* @__PURE__ */ _.jsxs(
|
|
1467
1467
|
"div",
|
|
1468
1468
|
{
|
|
1469
1469
|
onContextMenu: t,
|
|
1470
1470
|
className: "flex h-screen flex-col overflow-hidden bg-background text-foreground",
|
|
1471
1471
|
children: [
|
|
1472
|
-
/* @__PURE__ */
|
|
1473
|
-
/* @__PURE__ */
|
|
1474
|
-
/* @__PURE__ */
|
|
1475
|
-
/* @__PURE__ */
|
|
1476
|
-
/* @__PURE__ */
|
|
1472
|
+
/* @__PURE__ */ _.jsx("div", { className: "h-14 w-screen shrink-0 border-b border-border", children: /* @__PURE__ */ _.jsx(Et, { children: /* @__PURE__ */ _.jsx(tu, {}) }) }),
|
|
1473
|
+
/* @__PURE__ */ _.jsxs("main", { className: "flex h-full flex-row", children: [
|
|
1474
|
+
/* @__PURE__ */ _.jsx("div", { className: "flex h-full w-fit border-border", children: /* @__PURE__ */ _.jsx(Et, { children: /* @__PURE__ */ _.jsx(eu, {}) }) }),
|
|
1475
|
+
/* @__PURE__ */ _.jsx("div", { className: "h-full flex-1 bg-slate-800/20", children: /* @__PURE__ */ _.jsx(Et, { children: /* @__PURE__ */ _.jsx(nu, {}) }) }),
|
|
1476
|
+
/* @__PURE__ */ _.jsx("div", { className: "flex h-full w-[280px] min-w-[280px] border-l border-border", children: /* @__PURE__ */ _.jsx(Et, { children: /* @__PURE__ */ _.jsx(su, {}) }) })
|
|
1477
1477
|
] })
|
|
1478
1478
|
]
|
|
1479
1479
|
}
|
|
1480
1480
|
),
|
|
1481
|
-
/* @__PURE__ */
|
|
1481
|
+
/* @__PURE__ */ _.jsx(Jc, {})
|
|
1482
1482
|
] }) });
|
|
1483
|
-
},
|
|
1483
|
+
}, iu = Go();
|
|
1484
1484
|
N({});
|
|
1485
|
-
function
|
|
1485
|
+
function Pr(e, t, n, s, r) {
|
|
1486
1486
|
for (t = t.split ? t.split(".") : t, s = 0; s < t.length; s++)
|
|
1487
1487
|
e = e ? e[t[s]] : r;
|
|
1488
1488
|
return e === r ? n : e;
|
|
1489
1489
|
}
|
|
1490
|
-
var Mn = "undefined",
|
|
1490
|
+
var Mn = "undefined", kr = "object", Hi = "any", Ji = "*", bt = "__", zn = typeof process < "u" ? process : {};
|
|
1491
1491
|
zn.env && zn.env.NODE_ENV;
|
|
1492
|
-
var
|
|
1492
|
+
var _e = typeof document < "u";
|
|
1493
1493
|
zn.versions != null && zn.versions.node != null;
|
|
1494
1494
|
typeof Deno < "u" && Deno.core;
|
|
1495
|
-
|
|
1495
|
+
_e && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
|
|
1496
1496
|
function Yi(e, t) {
|
|
1497
1497
|
return t.charAt(0)[e]() + t.slice(1);
|
|
1498
1498
|
}
|
|
1499
|
-
var
|
|
1500
|
-
function
|
|
1501
|
-
return
|
|
1499
|
+
var ou = Yi.bind(null, "toUpperCase"), au = Yi.bind(null, "toLowerCase");
|
|
1500
|
+
function cu(e) {
|
|
1501
|
+
return Xi(e) ? ou("null") : typeof e == "object" ? hu(e) : Object.prototype.toString.call(e).slice(8, -1);
|
|
1502
1502
|
}
|
|
1503
1503
|
function Gn(e, t) {
|
|
1504
1504
|
t === void 0 && (t = !0);
|
|
1505
|
-
var n =
|
|
1506
|
-
return t ?
|
|
1505
|
+
var n = cu(e);
|
|
1506
|
+
return t ? au(n) : n;
|
|
1507
1507
|
}
|
|
1508
|
-
function
|
|
1508
|
+
function _n(e, t) {
|
|
1509
1509
|
return typeof t === e;
|
|
1510
1510
|
}
|
|
1511
|
-
var De =
|
|
1512
|
-
|
|
1513
|
-
function
|
|
1511
|
+
var De = _n.bind(null, "function"), Ct = _n.bind(null, "string"), Ot = _n.bind(null, "undefined"), uu = _n.bind(null, "boolean");
|
|
1512
|
+
_n.bind(null, "symbol");
|
|
1513
|
+
function Xi(e) {
|
|
1514
1514
|
return e === null;
|
|
1515
1515
|
}
|
|
1516
|
-
function
|
|
1516
|
+
function lu(e) {
|
|
1517
1517
|
return Gn(e) === "number" && !isNaN(e);
|
|
1518
1518
|
}
|
|
1519
|
-
function
|
|
1519
|
+
function du(e) {
|
|
1520
1520
|
return Gn(e) === "array";
|
|
1521
1521
|
}
|
|
1522
1522
|
function ge(e) {
|
|
1523
|
-
if (!
|
|
1523
|
+
if (!fu(e))
|
|
1524
1524
|
return !1;
|
|
1525
1525
|
for (var t = e; Object.getPrototypeOf(t) !== null; )
|
|
1526
1526
|
t = Object.getPrototypeOf(t);
|
|
1527
1527
|
return Object.getPrototypeOf(e) === t;
|
|
1528
1528
|
}
|
|
1529
|
-
function
|
|
1529
|
+
function fu(e) {
|
|
1530
1530
|
return e && (typeof e == "object" || e !== null);
|
|
1531
1531
|
}
|
|
1532
|
-
function
|
|
1532
|
+
function hu(e) {
|
|
1533
1533
|
return De(e.constructor) ? e.constructor.name : null;
|
|
1534
1534
|
}
|
|
1535
|
-
function
|
|
1536
|
-
return e instanceof Error ||
|
|
1535
|
+
function pu(e) {
|
|
1536
|
+
return e instanceof Error || Ct(e.message) && e.constructor && lu(e.constructor.stackTraceLimit);
|
|
1537
1537
|
}
|
|
1538
|
-
function
|
|
1539
|
-
if (typeof t != "object" ||
|
|
1538
|
+
function Zi(e, t) {
|
|
1539
|
+
if (typeof t != "object" || Xi(t))
|
|
1540
1540
|
return !1;
|
|
1541
1541
|
if (t instanceof e)
|
|
1542
1542
|
return !0;
|
|
1543
1543
|
var n = Gn(new e(""));
|
|
1544
|
-
if (
|
|
1544
|
+
if (pu(t))
|
|
1545
1545
|
for (; t; ) {
|
|
1546
1546
|
if (Gn(t) === n)
|
|
1547
1547
|
return !0;
|
|
@@ -1549,13 +1549,13 @@ function Xi(e, t) {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
return !1;
|
|
1551
1551
|
}
|
|
1552
|
-
|
|
1553
|
-
|
|
1552
|
+
Zi.bind(null, TypeError);
|
|
1553
|
+
Zi.bind(null, SyntaxError);
|
|
1554
1554
|
function is(e, t) {
|
|
1555
1555
|
var n = e instanceof Element || e instanceof HTMLDocument;
|
|
1556
|
-
return n && t ?
|
|
1556
|
+
return n && t ? mu(e, t) : n;
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1558
|
+
function mu(e, t) {
|
|
1559
1559
|
return t === void 0 && (t = ""), e && e.nodeName === t.toUpperCase();
|
|
1560
1560
|
}
|
|
1561
1561
|
function os(e) {
|
|
@@ -1575,19 +1575,19 @@ function xr(e) {
|
|
|
1575
1575
|
return null;
|
|
1576
1576
|
}
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1579
|
-
if (
|
|
1578
|
+
function gu() {
|
|
1579
|
+
if (_e) {
|
|
1580
1580
|
var e = navigator, t = e.languages;
|
|
1581
1581
|
return e.userLanguage || (t && t.length ? t[0] : e.language);
|
|
1582
1582
|
}
|
|
1583
1583
|
}
|
|
1584
|
-
function
|
|
1584
|
+
function yu() {
|
|
1585
1585
|
try {
|
|
1586
1586
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1587
1587
|
} catch {
|
|
1588
1588
|
}
|
|
1589
1589
|
}
|
|
1590
|
-
function
|
|
1590
|
+
function vu(e) {
|
|
1591
1591
|
return function(t) {
|
|
1592
1592
|
for (var n, s = /* @__PURE__ */ Object.create(null), r = /([^&=]+)=?([^&]*)/g; n = r.exec(t); ) {
|
|
1593
1593
|
var i = xr(n[1]), o = xr(n[2]);
|
|
@@ -1595,7 +1595,7 @@ function gu(e) {
|
|
|
1595
1595
|
}
|
|
1596
1596
|
for (var c in s) {
|
|
1597
1597
|
var l = c.split("[");
|
|
1598
|
-
l.length > 1 && (
|
|
1598
|
+
l.length > 1 && (bu(s, l.map(function(u) {
|
|
1599
1599
|
return u.replace(/[?[\]\\ ]/g, "");
|
|
1600
1600
|
}), s[c]), delete s[c]);
|
|
1601
1601
|
}
|
|
@@ -1605,10 +1605,10 @@ function gu(e) {
|
|
|
1605
1605
|
var n = t.match(/\?(.*)/);
|
|
1606
1606
|
return n && n[1] ? n[1].split("#")[0] : "";
|
|
1607
1607
|
}
|
|
1608
|
-
return
|
|
1608
|
+
return _e && window.location.search.substring(1);
|
|
1609
1609
|
}(e));
|
|
1610
1610
|
}
|
|
1611
|
-
function
|
|
1611
|
+
function bu(e, t, n) {
|
|
1612
1612
|
for (var s = t.length - 1, r = 0; r < s; ++r) {
|
|
1613
1613
|
var i = t[r];
|
|
1614
1614
|
if (i === "__proto__" || i === "constructor")
|
|
@@ -1624,20 +1624,20 @@ function as() {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
return e;
|
|
1626
1626
|
}
|
|
1627
|
-
var an = "global", Ht = bt + "global" + bt, Jt = typeof self ===
|
|
1627
|
+
var an = "global", Ht = bt + "global" + bt, Jt = typeof self === kr && self.self === self && self || typeof global === kr && global.global === global && global || void 0;
|
|
1628
1628
|
function wt(e) {
|
|
1629
1629
|
return Jt[Ht][e];
|
|
1630
1630
|
}
|
|
1631
1631
|
function St(e, t) {
|
|
1632
1632
|
return Jt[Ht][e] = t;
|
|
1633
1633
|
}
|
|
1634
|
-
function
|
|
1634
|
+
function Zt(e) {
|
|
1635
1635
|
delete Jt[Ht][e];
|
|
1636
1636
|
}
|
|
1637
1637
|
function en(e, t, n) {
|
|
1638
1638
|
var s;
|
|
1639
1639
|
try {
|
|
1640
|
-
if (
|
|
1640
|
+
if (Ys(e)) {
|
|
1641
1641
|
var r = window[e];
|
|
1642
1642
|
s = r[t].bind(r);
|
|
1643
1643
|
}
|
|
@@ -1647,7 +1647,7 @@ function en(e, t, n) {
|
|
|
1647
1647
|
}
|
|
1648
1648
|
Jt[Ht] || (Jt[Ht] = {});
|
|
1649
1649
|
var Ln = {};
|
|
1650
|
-
function
|
|
1650
|
+
function Ys(e) {
|
|
1651
1651
|
if (typeof Ln[e] !== Mn)
|
|
1652
1652
|
return Ln[e];
|
|
1653
1653
|
try {
|
|
@@ -1668,7 +1668,7 @@ function q() {
|
|
|
1668
1668
|
return e;
|
|
1669
1669
|
}, q.apply(this, arguments);
|
|
1670
1670
|
}
|
|
1671
|
-
var Ge = "function", Fe = "undefined",
|
|
1671
|
+
var Ge = "function", Fe = "undefined", wu = "@@redux/" + Math.random().toString(36), Ar = /* @__PURE__ */ function() {
|
|
1672
1672
|
return typeof Symbol === Ge && Symbol.observable || "@@observable";
|
|
1673
1673
|
}(), Nn = " != " + Ge;
|
|
1674
1674
|
function eo(e, t, n) {
|
|
@@ -1690,12 +1690,12 @@ function eo(e, t, n) {
|
|
|
1690
1690
|
function p(g) {
|
|
1691
1691
|
if (typeof g !== Ge)
|
|
1692
1692
|
throw new Error("Listener" + Nn);
|
|
1693
|
-
var
|
|
1693
|
+
var O = !0;
|
|
1694
1694
|
return u(), c.push(g), function() {
|
|
1695
|
-
if (
|
|
1696
|
-
|
|
1697
|
-
var
|
|
1698
|
-
c.splice(
|
|
1695
|
+
if (O) {
|
|
1696
|
+
O = !1, u();
|
|
1697
|
+
var C = c.indexOf(g);
|
|
1698
|
+
c.splice(C, 1);
|
|
1699
1699
|
}
|
|
1700
1700
|
};
|
|
1701
1701
|
}
|
|
@@ -1711,29 +1711,29 @@ function eo(e, t, n) {
|
|
|
1711
1711
|
} finally {
|
|
1712
1712
|
l = !1;
|
|
1713
1713
|
}
|
|
1714
|
-
for (var
|
|
1715
|
-
(0, C
|
|
1714
|
+
for (var O = o = c, C = 0; C < O.length; C++)
|
|
1715
|
+
(0, O[C])();
|
|
1716
1716
|
return g;
|
|
1717
1717
|
}
|
|
1718
1718
|
return P({ type: "@@redux/INIT" }), (s = { dispatch: P, subscribe: p, getState: f, replaceReducer: function(g) {
|
|
1719
1719
|
if (typeof g !== Ge)
|
|
1720
1720
|
throw new Error("next reducer" + Nn);
|
|
1721
1721
|
r = g, P({ type: "@@redux/INIT" });
|
|
1722
|
-
} })[
|
|
1723
|
-
var g,
|
|
1724
|
-
return (g = { subscribe: function(
|
|
1725
|
-
if (typeof
|
|
1722
|
+
} })[Ar] = function() {
|
|
1723
|
+
var g, O = p;
|
|
1724
|
+
return (g = { subscribe: function(C) {
|
|
1725
|
+
if (typeof C != "object")
|
|
1726
1726
|
throw new TypeError("Observer != obj");
|
|
1727
1727
|
function y() {
|
|
1728
|
-
|
|
1728
|
+
C.next && C.next(f());
|
|
1729
1729
|
}
|
|
1730
|
-
return y(), { unsubscribe:
|
|
1731
|
-
} })[
|
|
1730
|
+
return y(), { unsubscribe: O(y) };
|
|
1731
|
+
} })[Ar] = function() {
|
|
1732
1732
|
return this;
|
|
1733
1733
|
}, g;
|
|
1734
1734
|
}, s;
|
|
1735
1735
|
}
|
|
1736
|
-
function
|
|
1736
|
+
function Su(e, t) {
|
|
1737
1737
|
var n = t && t.type;
|
|
1738
1738
|
return "action " + (n && n.toString() || "?") + "reducer " + e + " returns " + Fe;
|
|
1739
1739
|
}
|
|
@@ -1747,7 +1747,7 @@ function Yt() {
|
|
|
1747
1747
|
};
|
|
1748
1748
|
});
|
|
1749
1749
|
}
|
|
1750
|
-
function
|
|
1750
|
+
function Pu() {
|
|
1751
1751
|
var e = arguments;
|
|
1752
1752
|
return function(t) {
|
|
1753
1753
|
return function(n, s, r) {
|
|
@@ -1760,14 +1760,14 @@ function wu() {
|
|
|
1760
1760
|
};
|
|
1761
1761
|
};
|
|
1762
1762
|
}
|
|
1763
|
-
var rt = bt + "anon_id", yt = bt + "user_id", It = bt + "user_traits", Ke = "userId",
|
|
1763
|
+
var rt = bt + "anon_id", yt = bt + "user_id", It = bt + "user_traits", Ke = "userId", _t = "anonymousId", $n = ["bootstrap", "params", "campaign", "initializeStart", "initialize", "initializeEnd", "ready", "resetStart", "reset", "resetEnd", "pageStart", "page", "pageEnd", "pageAborted", "trackStart", "track", "trackEnd", "trackAborted", "identifyStart", "identify", "identifyEnd", "identifyAborted", "userIdChanged", "registerPlugins", "enablePlugin", "disablePlugin", "online", "offline", "setItemStart", "setItem", "setItemEnd", "setItemAborted", "removeItemStart", "removeItem", "removeItemEnd", "removeItemAborted"], Os = ["name", "EVENTS", "config", "loaded"], U = $n.reduce(function(e, t) {
|
|
1764
1764
|
return e[t] = t, e;
|
|
1765
1765
|
}, { registerPluginType: function(e) {
|
|
1766
1766
|
return "registerPlugin:" + e;
|
|
1767
1767
|
}, pluginReadyType: function(e) {
|
|
1768
1768
|
return "ready:" + e;
|
|
1769
|
-
} }),
|
|
1770
|
-
function
|
|
1769
|
+
} }), Er = /^utm_/, Or = /^an_prop_/, _r = /^an_trait_/;
|
|
1770
|
+
function ku(e) {
|
|
1771
1771
|
var t = e.storage.setItem;
|
|
1772
1772
|
return function(n) {
|
|
1773
1773
|
return function(s) {
|
|
@@ -1777,12 +1777,12 @@ function Su(e) {
|
|
|
1777
1777
|
c.anonymousId !== o.anonymousId && t(rt, o.anonymousId), u || t(yt, o.userId), l.traits && t(It, q({}, u && c.traits ? c.traits : {}, l.traits));
|
|
1778
1778
|
var f = Object.keys(r.params);
|
|
1779
1779
|
if (f.length) {
|
|
1780
|
-
var p = i.an_uid, P = i.an_event, g = f.reduce(function(
|
|
1781
|
-
if (
|
|
1782
|
-
var y =
|
|
1783
|
-
|
|
1780
|
+
var p = i.an_uid, P = i.an_event, g = f.reduce(function(O, C) {
|
|
1781
|
+
if (C.match(Er) || C.match(/^(d|g)clid/)) {
|
|
1782
|
+
var y = C.replace(Er, "");
|
|
1783
|
+
O.campaign[y === "campaign" ? "name" : y] = i[C];
|
|
1784
1784
|
}
|
|
1785
|
-
return
|
|
1785
|
+
return C.match(Or) && (O.props[C.replace(Or, "")] = i[C]), C.match(_r) && (O.traits[C.replace(_r, "")] = i[C]), O;
|
|
1786
1786
|
}, { campaign: {}, props: {}, traits: {} });
|
|
1787
1787
|
n.dispatch(q({ type: U.params, raw: i }, g, p ? { userId: p } : {})), p && setTimeout(function() {
|
|
1788
1788
|
return e.identify(p, g.traits);
|
|
@@ -1796,7 +1796,7 @@ function Su(e) {
|
|
|
1796
1796
|
};
|
|
1797
1797
|
};
|
|
1798
1798
|
}
|
|
1799
|
-
function
|
|
1799
|
+
function xu(e) {
|
|
1800
1800
|
return function(t, n) {
|
|
1801
1801
|
if (t === void 0 && (t = {}), n === void 0 && (n = {}), n.type === U.setItemEnd) {
|
|
1802
1802
|
if (n.key === rt)
|
|
@@ -1819,10 +1819,10 @@ function Pu(e) {
|
|
|
1819
1819
|
function Cr(e) {
|
|
1820
1820
|
return { userId: e.getItem(yt), anonymousId: e.getItem(rt), traits: e.getItem(It) };
|
|
1821
1821
|
}
|
|
1822
|
-
var
|
|
1822
|
+
var _s = function(e) {
|
|
1823
1823
|
return bt + "TEMP" + bt + e;
|
|
1824
1824
|
};
|
|
1825
|
-
function
|
|
1825
|
+
function Au(e) {
|
|
1826
1826
|
var t = e.storage, n = t.setItem, s = t.removeItem, r = t.getItem;
|
|
1827
1827
|
return function(i) {
|
|
1828
1828
|
return function(o) {
|
|
@@ -1830,8 +1830,8 @@ function xu(e) {
|
|
|
1830
1830
|
var l = c.userId, u = c.traits, f = c.options;
|
|
1831
1831
|
if (c.type === U.reset && ([yt, It, rt].forEach(function(g) {
|
|
1832
1832
|
s(g);
|
|
1833
|
-
}), [Ke,
|
|
1834
|
-
|
|
1833
|
+
}), [Ke, _t, "traits"].forEach(function(g) {
|
|
1834
|
+
Zt(_s(g));
|
|
1835
1835
|
})), c.type === U.identify) {
|
|
1836
1836
|
r(rt) || n(rt, as());
|
|
1837
1837
|
var p = r(yt), P = r(It) || {};
|
|
@@ -1843,7 +1843,7 @@ function xu(e) {
|
|
|
1843
1843
|
};
|
|
1844
1844
|
}
|
|
1845
1845
|
var rn = {};
|
|
1846
|
-
function
|
|
1846
|
+
function Ir(e, t) {
|
|
1847
1847
|
rn[e] && De(rn[e]) && (rn[e](t), delete rn[e]);
|
|
1848
1848
|
}
|
|
1849
1849
|
function to(e, t, n) {
|
|
@@ -1863,16 +1863,16 @@ function no(e, t, n) {
|
|
|
1863
1863
|
}, { processIndex: [], process: [], requeue: [], requeueIndex: [] });
|
|
1864
1864
|
if (l.processIndex && l.processIndex.length) {
|
|
1865
1865
|
l.processIndex.forEach(function(f) {
|
|
1866
|
-
var p = o.actions[f], P = p.plugin, g = p.payload.type,
|
|
1867
|
-
if (
|
|
1868
|
-
var
|
|
1869
|
-
return A === void 0 && (A = {}), I === void 0 && (I = {}), [Ke,
|
|
1866
|
+
var p = o.actions[f], P = p.plugin, g = p.payload.type, O = s[P][g];
|
|
1867
|
+
if (O && De(O)) {
|
|
1868
|
+
var C = function(A, I) {
|
|
1869
|
+
return A === void 0 && (A = {}), I === void 0 && (I = {}), [Ke, _t].reduce(function(B, b) {
|
|
1870
1870
|
return A.hasOwnProperty(b) && I[b] && I[b] !== A[b] && (B[b] = I[b]), B;
|
|
1871
1871
|
}, A);
|
|
1872
1872
|
}(p.payload, c);
|
|
1873
|
-
|
|
1873
|
+
O({ payload: C, config: i[P].config, instance: n });
|
|
1874
1874
|
var y = g + ":" + P;
|
|
1875
|
-
e.dispatch(q({},
|
|
1875
|
+
e.dispatch(q({}, C, { type: y, _: { called: y, from: "queueDrain" } }));
|
|
1876
1876
|
}
|
|
1877
1877
|
});
|
|
1878
1878
|
var u = o.actions.filter(function(f, p) {
|
|
@@ -1891,9 +1891,9 @@ var ms = function(e) {
|
|
|
1891
1891
|
P && (g = o.during.map(function(y) {
|
|
1892
1892
|
return y.pluginName;
|
|
1893
1893
|
}));
|
|
1894
|
-
var
|
|
1894
|
+
var O = function(y, A) {
|
|
1895
1895
|
return function(I, B, b) {
|
|
1896
|
-
var
|
|
1896
|
+
var k = B.config, F = B.name, T = F + "." + I.type;
|
|
1897
1897
|
b && (T = b.event);
|
|
1898
1898
|
var M = I.type.match(jt) ? function(m, v, j, w, D) {
|
|
1899
1899
|
return function(E, S) {
|
|
@@ -1907,9 +1907,9 @@ var ms = function(e) {
|
|
|
1907
1907
|
throw new Error(m.type + " action not cancellable. Remove abort in " + v);
|
|
1908
1908
|
};
|
|
1909
1909
|
}(I, T);
|
|
1910
|
-
return { payload:
|
|
1910
|
+
return { payload: Eu(I), instance: y, config: k || {}, abort: M };
|
|
1911
1911
|
};
|
|
1912
|
-
}(s, g),
|
|
1912
|
+
}(s, g), C = t.exact.reduce(function(y, A) {
|
|
1913
1913
|
var I = A.pluginName, B = A.methodName, b = !1;
|
|
1914
1914
|
return B.match(/^initialize/) || B.match(/^reset/) || (b = !u[I].loaded), f.offline && B.match(/^(page|track|identify)/) && (b = !0), y["" + I] = b, y;
|
|
1915
1915
|
}, {});
|
|
@@ -1917,7 +1917,7 @@ var ms = function(e) {
|
|
|
1917
1917
|
try {
|
|
1918
1918
|
var B = A.pluginName;
|
|
1919
1919
|
return Promise.resolve(y).then(function(b) {
|
|
1920
|
-
function
|
|
1920
|
+
function k() {
|
|
1921
1921
|
return Promise.resolve(b);
|
|
1922
1922
|
}
|
|
1923
1923
|
var F = function() {
|
|
@@ -1926,15 +1926,15 @@ var ms = function(e) {
|
|
|
1926
1926
|
try {
|
|
1927
1927
|
return Promise.resolve(T).then(function(v) {
|
|
1928
1928
|
return M.method && De(M.method) ? (function(E, S) {
|
|
1929
|
-
var V =
|
|
1929
|
+
var V = Nr(E);
|
|
1930
1930
|
if (V && V.name === S) {
|
|
1931
|
-
var $ =
|
|
1931
|
+
var $ = Nr(V.method);
|
|
1932
1932
|
throw new Error([S + " plugin is calling method " + E, "Plugins cant call self", "Use " + V.method + " " + ($ ? "or " + $.method : "") + " in " + S + " plugin insteadof " + E].join(`
|
|
1933
1933
|
`));
|
|
1934
1934
|
}
|
|
1935
1935
|
}(M.methodName, M.pluginName), Promise.resolve(M.method({ payload: v, instance: s, abort: (j = v, w = B, D = M.pluginName, function(E, S) {
|
|
1936
1936
|
return q({}, j, { abort: { reason: E, plugins: S || [w], caller: p, from: D || w } });
|
|
1937
|
-
}), config:
|
|
1937
|
+
}), config: Rr(M.pluginName, u, i), plugins: u })).then(function(E) {
|
|
1938
1938
|
var S = ge(E) ? E : {};
|
|
1939
1939
|
return Promise.resolve(q({}, v, S));
|
|
1940
1940
|
})) : v;
|
|
@@ -1948,7 +1948,7 @@ var ms = function(e) {
|
|
|
1948
1948
|
});
|
|
1949
1949
|
b[B] = n;
|
|
1950
1950
|
}();
|
|
1951
|
-
return F && F.then ? F.then(
|
|
1951
|
+
return F && F.then ? F.then(k) : k();
|
|
1952
1952
|
});
|
|
1953
1953
|
} catch (b) {
|
|
1954
1954
|
return Promise.reject(b);
|
|
@@ -1956,23 +1956,23 @@ var ms = function(e) {
|
|
|
1956
1956
|
}, Promise.resolve({}))).then(function(y) {
|
|
1957
1957
|
return Promise.resolve(t.exact.reduce(function(A, I, B) {
|
|
1958
1958
|
try {
|
|
1959
|
-
var b = t.exact.length === B + 1,
|
|
1959
|
+
var b = t.exact.length === B + 1, k = I.pluginName, F = i[k];
|
|
1960
1960
|
return Promise.resolve(A).then(function(T) {
|
|
1961
|
-
var M = y[
|
|
1962
|
-
if (P && (M = T), ys(M,
|
|
1963
|
-
return gs({ data: M, method: p, instance: s, pluginName:
|
|
1964
|
-
if (ys(T,
|
|
1961
|
+
var M = y[k] ? y[k] : {};
|
|
1962
|
+
if (P && (M = T), ys(M, k))
|
|
1963
|
+
return gs({ data: M, method: p, instance: s, pluginName: k, store: c }), Promise.resolve(T);
|
|
1964
|
+
if (ys(T, k))
|
|
1965
1965
|
return b && gs({ data: T, method: p, instance: s, store: c }), Promise.resolve(T);
|
|
1966
|
-
if (
|
|
1967
|
-
return c.dispatch({ type: "queue", plugin:
|
|
1968
|
-
var m =
|
|
1969
|
-
return Promise.resolve(F[p]({ abort: m.abort, payload: M, instance: s, config:
|
|
1970
|
-
var j = ge(v) ? v : {}, w = q({}, T, j), D = y[
|
|
1971
|
-
if (ys(D,
|
|
1972
|
-
gs({ data: D, method: p, instance: s, pluginName:
|
|
1966
|
+
if (C.hasOwnProperty(k) && C[k] === !0)
|
|
1967
|
+
return c.dispatch({ type: "queue", plugin: k, payload: M, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(T);
|
|
1968
|
+
var m = O(y[k], i[k]);
|
|
1969
|
+
return Promise.resolve(F[p]({ abort: m.abort, payload: M, instance: s, config: Rr(k, u, i), plugins: u })).then(function(v) {
|
|
1970
|
+
var j = ge(v) ? v : {}, w = q({}, T, j), D = y[k];
|
|
1971
|
+
if (ys(D, k))
|
|
1972
|
+
gs({ data: D, method: p, instance: s, pluginName: k, store: c });
|
|
1973
1973
|
else {
|
|
1974
|
-
var E = p + ":" +
|
|
1975
|
-
(E.match(/:/g) || []).length < 2 && !p.match(
|
|
1974
|
+
var E = p + ":" + k;
|
|
1975
|
+
(E.match(/:/g) || []).length < 2 && !p.match(jr) && !p.match(Br) && s.dispatch(q({}, P ? w : M, { type: E, _: { called: E, from: "submethod" } }));
|
|
1976
1976
|
}
|
|
1977
1977
|
return Promise.resolve(w);
|
|
1978
1978
|
});
|
|
@@ -1981,7 +1981,7 @@ var ms = function(e) {
|
|
|
1981
1981
|
return Promise.reject(T);
|
|
1982
1982
|
}
|
|
1983
1983
|
}, Promise.resolve(n))).then(function(A) {
|
|
1984
|
-
if (!(p.match(jt) || p.match(/^registerPlugin/) || p.match(
|
|
1984
|
+
if (!(p.match(jt) || p.match(/^registerPlugin/) || p.match(Br) || p.match(jr) || p.match(/^params/) || p.match(/^userIdChanged/))) {
|
|
1985
1985
|
if (l.plugins.includes(p), A._ && A._.originalAction === p)
|
|
1986
1986
|
return A;
|
|
1987
1987
|
var I = q({}, A, { _: { originalAction: A.type, called: A.type, from: "engineEnd" } });
|
|
@@ -1993,33 +1993,33 @@ var ms = function(e) {
|
|
|
1993
1993
|
} catch (y) {
|
|
1994
1994
|
return Promise.reject(y);
|
|
1995
1995
|
}
|
|
1996
|
-
}, jt = /Start$/,
|
|
1996
|
+
}, jt = /Start$/, jr = /^bootstrap/, Br = /^ready/;
|
|
1997
1997
|
function gs(e) {
|
|
1998
1998
|
var t = e.pluginName, n = e.method + "Aborted" + (t ? ":" + t : "");
|
|
1999
1999
|
e.store.dispatch(q({}, e.data, { type: n, _: { called: n, from: "abort" } }));
|
|
2000
2000
|
}
|
|
2001
|
-
function
|
|
2001
|
+
function Rr(e, t, n) {
|
|
2002
2002
|
var s = t[e] || n[e];
|
|
2003
2003
|
return s && s.config ? s.config : {};
|
|
2004
2004
|
}
|
|
2005
|
-
function
|
|
2005
|
+
function Dr(e, t) {
|
|
2006
2006
|
return t.reduce(function(n, s) {
|
|
2007
2007
|
return s[e] ? n.concat({ methodName: e, pluginName: s.name, method: s[e] }) : n;
|
|
2008
2008
|
}, []);
|
|
2009
2009
|
}
|
|
2010
|
-
function
|
|
2010
|
+
function Mr(e, t) {
|
|
2011
2011
|
var n = e.replace(jt, ""), s = t ? ":" + t : "";
|
|
2012
2012
|
return ["" + e + s, "" + n + s, n + "End" + s];
|
|
2013
2013
|
}
|
|
2014
2014
|
function ys(e, t) {
|
|
2015
2015
|
var n = e.abort;
|
|
2016
|
-
return !!n && (n === !0 ||
|
|
2016
|
+
return !!n && (n === !0 || Lr(n, t) || n && Lr(n.plugins, t));
|
|
2017
2017
|
}
|
|
2018
2018
|
function so(e, t) {
|
|
2019
2019
|
var n = e.abort;
|
|
2020
2020
|
if (!n)
|
|
2021
2021
|
return !1;
|
|
2022
|
-
if (n === !0 ||
|
|
2022
|
+
if (n === !0 || Ct(n))
|
|
2023
2023
|
return !0;
|
|
2024
2024
|
var s = n.plugins;
|
|
2025
2025
|
return fn(n) && n.length === t || fn(s) && s.length === t;
|
|
@@ -2027,19 +2027,19 @@ function so(e, t) {
|
|
|
2027
2027
|
function fn(e) {
|
|
2028
2028
|
return Array.isArray(e);
|
|
2029
2029
|
}
|
|
2030
|
-
function
|
|
2030
|
+
function Lr(e, t) {
|
|
2031
2031
|
return !(!e || !fn(e)) && e.includes(t);
|
|
2032
2032
|
}
|
|
2033
|
-
function
|
|
2033
|
+
function Nr(e) {
|
|
2034
2034
|
var t = e.match(/(.*):(.*)/);
|
|
2035
2035
|
return !!t && { method: t[1], name: t[2] };
|
|
2036
2036
|
}
|
|
2037
|
-
function
|
|
2037
|
+
function Eu(e) {
|
|
2038
2038
|
return Object.keys(e).reduce(function(t, n) {
|
|
2039
2039
|
return n === "type" || (t[n] = ge(e[n]) ? Object.assign({}, e[n]) : e[n]), t;
|
|
2040
2040
|
}, {});
|
|
2041
2041
|
}
|
|
2042
|
-
function
|
|
2042
|
+
function Ou(e, t, n) {
|
|
2043
2043
|
var s = {};
|
|
2044
2044
|
return function(r) {
|
|
2045
2045
|
return function(i) {
|
|
@@ -2051,20 +2051,20 @@ function Au(e, t, n) {
|
|
|
2051
2051
|
if (o.abort)
|
|
2052
2052
|
return Promise.resolve(i(o));
|
|
2053
2053
|
if (u === U.enablePlugin && r.dispatch({ type: U.initializeStart, plugins: f, disabled: [], fromEnable: !0, meta: o.meta }), u === U.disablePlugin && setTimeout(function() {
|
|
2054
|
-
return
|
|
2054
|
+
return Ir(o.meta.rid, { payload: o });
|
|
2055
2055
|
}, 0), u === U.initializeEnd) {
|
|
2056
|
-
var P = t(), g = Object.keys(P),
|
|
2056
|
+
var P = t(), g = Object.keys(P), O = g.filter(function(b) {
|
|
2057
2057
|
return f.includes(b);
|
|
2058
2058
|
}).map(function(b) {
|
|
2059
2059
|
return P[b];
|
|
2060
|
-
}),
|
|
2061
|
-
var
|
|
2060
|
+
}), C = [], y = [], A = o.disabled, I = O.map(function(b) {
|
|
2061
|
+
var k = b.loaded, F = b.name, T = b.config;
|
|
2062
2062
|
return to(b, function() {
|
|
2063
|
-
return
|
|
2063
|
+
return k({ config: T });
|
|
2064
2064
|
}, 1e4).then(function(M) {
|
|
2065
2065
|
return s[F] || (r.dispatch({ type: U.pluginReadyType(F), name: F, events: Object.keys(b).filter(function(m) {
|
|
2066
|
-
return !
|
|
2067
|
-
}) }), s[F] = !0),
|
|
2066
|
+
return !Os.includes(m);
|
|
2067
|
+
}) }), s[F] = !0), C = C.concat(F), b;
|
|
2068
2068
|
}).catch(function(M) {
|
|
2069
2069
|
if (M instanceof Error)
|
|
2070
2070
|
throw new Error(M);
|
|
@@ -2072,9 +2072,9 @@ function Au(e, t, n) {
|
|
|
2072
2072
|
});
|
|
2073
2073
|
});
|
|
2074
2074
|
Promise.all(I).then(function(b) {
|
|
2075
|
-
var
|
|
2075
|
+
var k = { plugins: C, failed: y, disabled: A };
|
|
2076
2076
|
setTimeout(function() {
|
|
2077
|
-
g.length === I.length + A.length && r.dispatch(q({}, { type: U.ready },
|
|
2077
|
+
g.length === I.length + A.length && r.dispatch(q({}, { type: U.ready }, k));
|
|
2078
2078
|
}, 0);
|
|
2079
2079
|
});
|
|
2080
2080
|
}
|
|
@@ -2082,14 +2082,14 @@ function Au(e, t, n) {
|
|
|
2082
2082
|
if (u !== U.bootstrap)
|
|
2083
2083
|
return /^ready:([^:]*)$/.test(u) && setTimeout(function() {
|
|
2084
2084
|
return no(r, t, e);
|
|
2085
|
-
}, 0), Promise.resolve(function(b,
|
|
2085
|
+
}, 0), Promise.resolve(function(b, k, F, T, M) {
|
|
2086
2086
|
try {
|
|
2087
|
-
var m = De(
|
|
2087
|
+
var m = De(k) ? k() : k, v = b.type, j = v.replace(jt, "");
|
|
2088
2088
|
if (b._ && b._.called)
|
|
2089
2089
|
return Promise.resolve(b);
|
|
2090
2090
|
var w = F.getState(), D = (V = m, ($ = w.plugins) === void 0 && ($ = {}), (G = b.options) === void 0 && (G = {}), Object.keys(V).filter(function(d) {
|
|
2091
2091
|
var h = G.plugins || {};
|
|
2092
|
-
return
|
|
2092
|
+
return uu(h[d]) ? h[d] : h.all !== !1 && (!$[d] || $[d].enabled !== !1);
|
|
2093
2093
|
}).map(function(d) {
|
|
2094
2094
|
return V[d];
|
|
2095
2095
|
}));
|
|
@@ -2102,14 +2102,14 @@ function Au(e, t, n) {
|
|
|
2102
2102
|
var E = D.map(function(d) {
|
|
2103
2103
|
return d.name;
|
|
2104
2104
|
}), S = function(d, h, L) {
|
|
2105
|
-
var K =
|
|
2106
|
-
return
|
|
2105
|
+
var K = Mr(d).map(function(z) {
|
|
2106
|
+
return Dr(z, h);
|
|
2107
2107
|
});
|
|
2108
2108
|
return h.reduce(function(z, H) {
|
|
2109
|
-
var ce = H.name, Y =
|
|
2110
|
-
return
|
|
2111
|
-
}), se = Y[0], J = Y[1],
|
|
2112
|
-
return se.length && (z.beforeNS[ce] = se), J.length && (z.duringNS[ce] = J),
|
|
2109
|
+
var ce = H.name, Y = Mr(d, ce).map(function(nn) {
|
|
2110
|
+
return Dr(nn, h);
|
|
2111
|
+
}), se = Y[0], J = Y[1], Ce = Y[2];
|
|
2112
|
+
return se.length && (z.beforeNS[ce] = se), J.length && (z.duringNS[ce] = J), Ce.length && (z.afterNS[ce] = Ce), z;
|
|
2113
2113
|
}, { before: K[0], beforeNS: {}, during: K[1], duringNS: {}, after: K[2], afterNS: {} });
|
|
2114
2114
|
}(v, D);
|
|
2115
2115
|
return Promise.resolve(ms({ action: b, data: { exact: S.before, namespaced: S.beforeNS }, state: w, allPlugins: m, allMatches: S, instance: F, store: T, EVENTS: M })).then(function(d) {
|
|
@@ -2117,7 +2117,7 @@ function Au(e, t, n) {
|
|
|
2117
2117
|
var z = function() {
|
|
2118
2118
|
if (v.match(jt))
|
|
2119
2119
|
return Promise.resolve(ms({ action: q({}, L, { type: j + "End" }), data: { exact: S.after, namespaced: S.afterNS }, state: w, allPlugins: m, allMatches: S, instance: F, store: T, EVENTS: M })).then(function(H) {
|
|
2120
|
-
H.meta && H.meta.hasCallback &&
|
|
2120
|
+
H.meta && H.meta.hasCallback && Ir(H.meta.rid, { payload: H });
|
|
2121
2121
|
});
|
|
2122
2122
|
}();
|
|
2123
2123
|
return z && z.then ? z.then(function() {
|
|
@@ -2151,7 +2151,7 @@ function Au(e, t, n) {
|
|
|
2151
2151
|
};
|
|
2152
2152
|
};
|
|
2153
2153
|
}
|
|
2154
|
-
function
|
|
2154
|
+
function _u(e) {
|
|
2155
2155
|
return function(t) {
|
|
2156
2156
|
return function(n) {
|
|
2157
2157
|
return function(s) {
|
|
@@ -2166,7 +2166,7 @@ function Eu(e) {
|
|
|
2166
2166
|
};
|
|
2167
2167
|
};
|
|
2168
2168
|
}
|
|
2169
|
-
var
|
|
2169
|
+
var Cu = function() {
|
|
2170
2170
|
var e = this;
|
|
2171
2171
|
this.before = [], this.after = [], this.addMiddleware = function(t, n) {
|
|
2172
2172
|
e[n] = e[n].concat(t);
|
|
@@ -2190,39 +2190,39 @@ var Ou = function() {
|
|
|
2190
2190
|
};
|
|
2191
2191
|
};
|
|
2192
2192
|
};
|
|
2193
|
-
function
|
|
2193
|
+
function Iu(e) {
|
|
2194
2194
|
return function(t, n) {
|
|
2195
2195
|
t === void 0 && (t = {});
|
|
2196
2196
|
var s = {};
|
|
2197
2197
|
if (n.type === "initialize:aborted")
|
|
2198
2198
|
return t;
|
|
2199
2199
|
if (/^registerPlugin:([^:]*)$/.test(n.type)) {
|
|
2200
|
-
var r =
|
|
2200
|
+
var r = Tr(n.type, "registerPlugin"), i = e()[r];
|
|
2201
2201
|
if (!i || !r)
|
|
2202
2202
|
return t;
|
|
2203
2203
|
var o = n.enabled, c = i.config;
|
|
2204
2204
|
return s[r] = { enabled: o, initialized: !!o && !i.initialize, loaded: !!o && !!i.loaded({ config: c }), config: c }, q({}, t, s);
|
|
2205
2205
|
}
|
|
2206
2206
|
if (/^initialize:([^:]*)$/.test(n.type)) {
|
|
2207
|
-
var l =
|
|
2207
|
+
var l = Tr(n.type, U.initialize), u = e()[l];
|
|
2208
2208
|
return u && l ? (s[l] = q({}, t[l], { initialized: !0, loaded: !!u.loaded({ config: u.config }) }), q({}, t, s)) : t;
|
|
2209
2209
|
}
|
|
2210
2210
|
if (/^ready:([^:]*)$/.test(n.type))
|
|
2211
2211
|
return s[n.name] = q({}, t[n.name], { loaded: !0 }), q({}, t, s);
|
|
2212
2212
|
switch (n.type) {
|
|
2213
2213
|
case U.disablePlugin:
|
|
2214
|
-
return q({}, t,
|
|
2214
|
+
return q({}, t, Fr(n.plugins, !1, t));
|
|
2215
2215
|
case U.enablePlugin:
|
|
2216
|
-
return q({}, t,
|
|
2216
|
+
return q({}, t, Fr(n.plugins, !0, t));
|
|
2217
2217
|
default:
|
|
2218
2218
|
return t;
|
|
2219
2219
|
}
|
|
2220
2220
|
};
|
|
2221
2221
|
}
|
|
2222
|
-
function
|
|
2222
|
+
function Tr(e, t) {
|
|
2223
2223
|
return e.substring(t.length + 1, e.length);
|
|
2224
2224
|
}
|
|
2225
|
-
function
|
|
2225
|
+
function Fr(e, t, n) {
|
|
2226
2226
|
return e.reduce(function(s, r) {
|
|
2227
2227
|
return s[r] = q({}, n[r], { enabled: t }), s;
|
|
2228
2228
|
}, n);
|
|
@@ -2234,9 +2234,9 @@ function ro(e) {
|
|
|
2234
2234
|
}
|
|
2235
2235
|
return e;
|
|
2236
2236
|
}
|
|
2237
|
-
var
|
|
2238
|
-
function
|
|
2239
|
-
e === void 0 && (e =
|
|
2237
|
+
var ju = { last: {}, history: [] };
|
|
2238
|
+
function Bu(e, t) {
|
|
2239
|
+
e === void 0 && (e = ju);
|
|
2240
2240
|
var n = t.options, s = t.meta;
|
|
2241
2241
|
if (t.type === U.track) {
|
|
2242
2242
|
var r = ro(q({ event: t.event, properties: t.properties }, Object.keys(n).length && { options: n }, { meta: s }));
|
|
@@ -2244,9 +2244,9 @@ function Iu(e, t) {
|
|
|
2244
2244
|
}
|
|
2245
2245
|
return e;
|
|
2246
2246
|
}
|
|
2247
|
-
var
|
|
2248
|
-
function
|
|
2249
|
-
e === void 0 && (e =
|
|
2247
|
+
var Ru = { actions: [] };
|
|
2248
|
+
function Du(e, t) {
|
|
2249
|
+
e === void 0 && (e = Ru);
|
|
2250
2250
|
var n = t.payload;
|
|
2251
2251
|
switch (t.type) {
|
|
2252
2252
|
case "queue":
|
|
@@ -2259,27 +2259,27 @@ function Bu(e, t) {
|
|
|
2259
2259
|
}
|
|
2260
2260
|
}
|
|
2261
2261
|
var io = /#.*$/;
|
|
2262
|
-
function
|
|
2262
|
+
function Mu(e) {
|
|
2263
2263
|
var t = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);
|
|
2264
2264
|
return "/" + (t && t[3] ? t[3].split("?")[0].replace(io, "") : "");
|
|
2265
2265
|
}
|
|
2266
|
-
var oo, ao, co, uo,
|
|
2267
|
-
if (e === void 0 && (e = {}), !
|
|
2266
|
+
var oo, ao, co, uo, Lu = function(e) {
|
|
2267
|
+
if (e === void 0 && (e = {}), !_e)
|
|
2268
2268
|
return e;
|
|
2269
2269
|
var t = document, n = t.title, s = t.referrer, r = window, i = r.location, o = r.innerWidth, c = r.innerHeight, l = i.hash, u = i.search, f = function(P) {
|
|
2270
2270
|
var g = function() {
|
|
2271
|
-
if (
|
|
2272
|
-
for (var
|
|
2273
|
-
if (
|
|
2274
|
-
return
|
|
2271
|
+
if (_e) {
|
|
2272
|
+
for (var O, C = document.getElementsByTagName("link"), y = 0; O = C[y]; y++)
|
|
2273
|
+
if (O.getAttribute("rel") === "canonical")
|
|
2274
|
+
return O.getAttribute("href");
|
|
2275
2275
|
}
|
|
2276
2276
|
}();
|
|
2277
2277
|
return g ? g.match(/\?/) ? g : g + P : window.location.href.replace(io, "");
|
|
2278
|
-
}(u), p = { title: n, url: f, path:
|
|
2278
|
+
}(u), p = { title: n, url: f, path: Mu(f), hash: l, search: u, width: o, height: c };
|
|
2279
2279
|
return s && s !== "" && (p.referrer = s), q({}, p, e);
|
|
2280
|
-
},
|
|
2281
|
-
function
|
|
2282
|
-
e === void 0 && (e =
|
|
2280
|
+
}, Nu = { last: {}, history: [] };
|
|
2281
|
+
function Tu(e, t) {
|
|
2282
|
+
e === void 0 && (e = Nu);
|
|
2283
2283
|
var n = t.options;
|
|
2284
2284
|
if (t.type === U.page) {
|
|
2285
2285
|
var s = ro(q({ properties: t.properties, meta: t.meta }, Object.keys(n).length && { options: n }));
|
|
@@ -2288,14 +2288,14 @@ function Lu(e, t) {
|
|
|
2288
2288
|
return e;
|
|
2289
2289
|
}
|
|
2290
2290
|
oo = function() {
|
|
2291
|
-
if (!
|
|
2291
|
+
if (!_e)
|
|
2292
2292
|
return !1;
|
|
2293
2293
|
var e = navigator.appVersion;
|
|
2294
2294
|
return ~e.indexOf("Win") ? "Windows" : ~e.indexOf("Mac") ? "MacOS" : ~e.indexOf("X11") ? "UNIX" : ~e.indexOf("Linux") ? "Linux" : "Unknown OS";
|
|
2295
|
-
}(), ao =
|
|
2296
|
-
var
|
|
2297
|
-
function
|
|
2298
|
-
e === void 0 && (e =
|
|
2295
|
+
}(), ao = _e ? document.referrer : null, co = gu(), uo = yu();
|
|
2296
|
+
var Ur = { initialized: !1, sessionId: as(), app: null, version: null, debug: !1, offline: !!_e && !navigator.onLine, os: { name: oo }, userAgent: _e ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.5" }, timezone: uo, locale: co, campaign: {}, referrer: ao };
|
|
2297
|
+
function Fu(e, t) {
|
|
2298
|
+
e === void 0 && (e = Ur);
|
|
2299
2299
|
var n = e.initialized, s = t.campaign;
|
|
2300
2300
|
switch (t.type) {
|
|
2301
2301
|
case U.campaign:
|
|
@@ -2305,20 +2305,20 @@ function Nu(e, t) {
|
|
|
2305
2305
|
case U.online:
|
|
2306
2306
|
return q({}, e, { offline: !1 });
|
|
2307
2307
|
default:
|
|
2308
|
-
return n ? e : q({},
|
|
2308
|
+
return n ? e : q({}, Ur, e, { initialized: !0 });
|
|
2309
2309
|
}
|
|
2310
2310
|
}
|
|
2311
|
-
var
|
|
2312
|
-
function
|
|
2313
|
-
if (
|
|
2311
|
+
var Uu = ["plugins", "reducers", "storage"];
|
|
2312
|
+
function qu(e, t, n) {
|
|
2313
|
+
if (_e) {
|
|
2314
2314
|
var s = window[(n ? "add" : "remove") + "EventListener"];
|
|
2315
2315
|
e.split(" ").forEach(function(r) {
|
|
2316
2316
|
s(r, t);
|
|
2317
2317
|
});
|
|
2318
2318
|
}
|
|
2319
2319
|
}
|
|
2320
|
-
function
|
|
2321
|
-
var t =
|
|
2320
|
+
function $u(e) {
|
|
2321
|
+
var t = qu.bind(null, "online offline", function(n) {
|
|
2322
2322
|
return Promise.resolve(!navigator.onLine).then(e);
|
|
2323
2323
|
});
|
|
2324
2324
|
return t(!0), function(n) {
|
|
@@ -2335,15 +2335,15 @@ function lo() {
|
|
|
2335
2335
|
};
|
|
2336
2336
|
};
|
|
2337
2337
|
}
|
|
2338
|
-
function
|
|
2338
|
+
function qr(e) {
|
|
2339
2339
|
return function() {
|
|
2340
2340
|
return Yt(Yt.apply(null, arguments), lo());
|
|
2341
2341
|
};
|
|
2342
2342
|
}
|
|
2343
2343
|
function vs(e) {
|
|
2344
|
-
return e ?
|
|
2344
|
+
return e ? du(e) ? e : [e] : [];
|
|
2345
2345
|
}
|
|
2346
|
-
function
|
|
2346
|
+
function $r(e, t, n) {
|
|
2347
2347
|
e === void 0 && (e = {});
|
|
2348
2348
|
var s, r, i = as();
|
|
2349
2349
|
return t && (rn[i] = (s = t, r = function(o) {
|
|
@@ -2357,7 +2357,7 @@ function qr(e, t, n) {
|
|
|
2357
2357
|
r && r(o), s(o);
|
|
2358
2358
|
})), q({}, e, { rid: i, ts: (/* @__PURE__ */ new Date()).getTime() }, t ? { hasCallback: !0 } : {});
|
|
2359
2359
|
}
|
|
2360
|
-
function
|
|
2360
|
+
function Qu(e) {
|
|
2361
2361
|
e === void 0 && (e = {});
|
|
2362
2362
|
var t = e.reducers || {}, n = e.initialUser || {}, s = (e.plugins || []).reduce(function(d, h) {
|
|
2363
2363
|
if (De(h))
|
|
@@ -2371,9 +2371,9 @@ function qu(e) {
|
|
|
2371
2371
|
d.pluginEnabled[h.name] = !(h.enabled === !1 || h.config.enabled === !1), delete h.enabled, h.methods && (d.methods[h.name] = Object.keys(h.methods).reduce(function(H, ce) {
|
|
2372
2372
|
var Y;
|
|
2373
2373
|
return H[ce] = (Y = h.methods[ce], function() {
|
|
2374
|
-
for (var se = Array.prototype.slice.call(arguments), J = new Array(Y.length),
|
|
2375
|
-
J[
|
|
2376
|
-
return J[J.length] =
|
|
2374
|
+
for (var se = Array.prototype.slice.call(arguments), J = new Array(Y.length), Ce = 0; Ce < se.length; Ce++)
|
|
2375
|
+
J[Ce] = se[Ce];
|
|
2376
|
+
return J[J.length] = k, Y.apply({ instance: k }, J);
|
|
2377
2377
|
}), H;
|
|
2378
2378
|
}, {}), delete h.methods);
|
|
2379
2379
|
var K = Object.keys(h).concat(L), z = new Set(d.events.concat(K));
|
|
@@ -2382,19 +2382,19 @@ function qu(e) {
|
|
|
2382
2382
|
return d.plugins[h.name] = h, d.plugins[h.name].loaded || (d.plugins[h.name].loaded = function() {
|
|
2383
2383
|
return !0;
|
|
2384
2384
|
}), d;
|
|
2385
|
-
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), r = e.storage ? e.storage : { getItem: wt, setItem: St, removeItem:
|
|
2385
|
+
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), r = e.storage ? e.storage : { getItem: wt, setItem: St, removeItem: Zt }, i = function(d) {
|
|
2386
2386
|
return function(h, L, K) {
|
|
2387
|
-
return L.getState("user")[h] || (K && ge(K) && K[h] ? K[h] : Cr(d)[h] || wt(
|
|
2387
|
+
return L.getState("user")[h] || (K && ge(K) && K[h] ? K[h] : Cr(d)[h] || wt(_s(h)) || null);
|
|
2388
2388
|
};
|
|
2389
2389
|
}(r), o = s.plugins, c = s.events.filter(function(d) {
|
|
2390
|
-
return !
|
|
2390
|
+
return !Os.includes(d);
|
|
2391
2391
|
}).sort(), l = new Set(c.concat($n).filter(function(d) {
|
|
2392
|
-
return !
|
|
2392
|
+
return !Os.includes(d);
|
|
2393
2393
|
})), u = Array.from(l).sort(), f = function() {
|
|
2394
2394
|
return o;
|
|
2395
|
-
}, p = new
|
|
2395
|
+
}, p = new Cu(), P = p.addMiddleware, g = p.removeMiddleware, O = p.dynamicMiddlewares, C = function() {
|
|
2396
2396
|
throw new Error("Abort disabled inListener");
|
|
2397
|
-
}, y =
|
|
2397
|
+
}, y = vu(), A = Cr(r), I = q({}, A, n, y.an_uid ? { userId: y.an_uid } : {}, y.an_aid ? { anonymousId: y.an_aid } : {});
|
|
2398
2398
|
I.anonymousId || (I.anonymousId = as());
|
|
2399
2399
|
var B = q({ enable: function(d, h) {
|
|
2400
2400
|
return new Promise(function(L) {
|
|
@@ -2404,11 +2404,11 @@ function qu(e) {
|
|
|
2404
2404
|
return new Promise(function(L) {
|
|
2405
2405
|
S.dispatch({ type: U.disablePlugin, plugins: vs(d), _: { originalAction: U.disablePlugin } }, L, [h]);
|
|
2406
2406
|
});
|
|
2407
|
-
} }, s.methods), b = !1,
|
|
2407
|
+
} }, s.methods), b = !1, k = { identify: function(d, h, L, K) {
|
|
2408
2408
|
try {
|
|
2409
|
-
var z =
|
|
2410
|
-
St(
|
|
2411
|
-
var se = z || H.userId || i(Ke,
|
|
2409
|
+
var z = Ct(d) ? d : null, H = ge(d) ? d : h, ce = L || {}, Y = k.user();
|
|
2410
|
+
St(_s(Ke), z);
|
|
2411
|
+
var se = z || H.userId || i(Ke, k, H);
|
|
2412
2412
|
return Promise.resolve(new Promise(function(J) {
|
|
2413
2413
|
S.dispatch(q({ type: U.identifyStart, userId: se, traits: H || {}, options: ce, anonymousId: Y.anonymousId }, Y.id && Y.id !== z && { previousId: Y.id }), J, [h, L, K]);
|
|
2414
2414
|
}));
|
|
@@ -2418,11 +2418,11 @@ function qu(e) {
|
|
|
2418
2418
|
}, track: function(d, h, L, K) {
|
|
2419
2419
|
try {
|
|
2420
2420
|
var z = ge(d) ? d.event : d;
|
|
2421
|
-
if (!z || !
|
|
2421
|
+
if (!z || !Ct(z))
|
|
2422
2422
|
throw new Error("EventMissing");
|
|
2423
2423
|
var H = ge(d) ? d : h || {}, ce = ge(L) ? L : {};
|
|
2424
2424
|
return Promise.resolve(new Promise(function(Y) {
|
|
2425
|
-
S.dispatch({ type: U.trackStart, event: z, properties: H, options: ce, userId: i(Ke,
|
|
2425
|
+
S.dispatch({ type: U.trackStart, event: z, properties: H, options: ce, userId: i(Ke, k, h), anonymousId: i(_t, k, h) }, Y, [h, L, K]);
|
|
2426
2426
|
}));
|
|
2427
2427
|
} catch (Y) {
|
|
2428
2428
|
return Promise.reject(Y);
|
|
@@ -2431,24 +2431,24 @@ function qu(e) {
|
|
|
2431
2431
|
try {
|
|
2432
2432
|
var K = ge(d) ? d : {}, z = ge(h) ? h : {};
|
|
2433
2433
|
return Promise.resolve(new Promise(function(H) {
|
|
2434
|
-
S.dispatch({ type: U.pageStart, properties:
|
|
2434
|
+
S.dispatch({ type: U.pageStart, properties: Lu(K), options: z, userId: i(Ke, k, K), anonymousId: i(_t, k, K) }, H, [d, h, L]);
|
|
2435
2435
|
}));
|
|
2436
2436
|
} catch (H) {
|
|
2437
2437
|
return Promise.reject(H);
|
|
2438
2438
|
}
|
|
2439
2439
|
}, user: function(d) {
|
|
2440
2440
|
if (d === Ke || d === "id")
|
|
2441
|
-
return i(Ke,
|
|
2442
|
-
if (d ===
|
|
2443
|
-
return i(
|
|
2444
|
-
var h =
|
|
2445
|
-
return d ?
|
|
2441
|
+
return i(Ke, k);
|
|
2442
|
+
if (d === _t || d === "anonId")
|
|
2443
|
+
return i(_t, k);
|
|
2444
|
+
var h = k.getState("user");
|
|
2445
|
+
return d ? Pr(h, d) : h;
|
|
2446
2446
|
}, reset: function(d) {
|
|
2447
2447
|
return new Promise(function(h) {
|
|
2448
2448
|
S.dispatch({ type: U.resetStart }, h, d);
|
|
2449
2449
|
});
|
|
2450
2450
|
}, ready: function(d) {
|
|
2451
|
-
return b && d({ plugins: B, instance:
|
|
2451
|
+
return b && d({ plugins: B, instance: k }), k.on(U.ready, function(h) {
|
|
2452
2452
|
d(h), b = !0;
|
|
2453
2453
|
});
|
|
2454
2454
|
}, on: function(d, h) {
|
|
@@ -2461,13 +2461,13 @@ function qu(e) {
|
|
|
2461
2461
|
var K = function(Y) {
|
|
2462
2462
|
return function(se) {
|
|
2463
2463
|
return function(J) {
|
|
2464
|
-
return J.type.match(L) && h({ payload: J, instance:
|
|
2464
|
+
return J.type.match(L) && h({ payload: J, instance: k, plugins: o }), se(J);
|
|
2465
2465
|
};
|
|
2466
2466
|
};
|
|
2467
2467
|
}, z = function(Y) {
|
|
2468
2468
|
return function(se) {
|
|
2469
2469
|
return function(J) {
|
|
2470
|
-
return J.type.match(L) || h({ payload: J, instance:
|
|
2470
|
+
return J.type.match(L) || h({ payload: J, instance: k, plugins: o }), se(J);
|
|
2471
2471
|
};
|
|
2472
2472
|
};
|
|
2473
2473
|
};
|
|
@@ -2478,7 +2478,7 @@ function qu(e) {
|
|
|
2478
2478
|
var H = d.match(L) ? Tn : Fn, ce = function(Y) {
|
|
2479
2479
|
return function(se) {
|
|
2480
2480
|
return function(J) {
|
|
2481
|
-
return J.type === d && h({ payload: J, instance:
|
|
2481
|
+
return J.type === d && h({ payload: J, instance: k, plugins: o, abort: C }), se(J);
|
|
2482
2482
|
};
|
|
2483
2483
|
};
|
|
2484
2484
|
};
|
|
@@ -2490,15 +2490,15 @@ function qu(e) {
|
|
|
2490
2490
|
return !1;
|
|
2491
2491
|
if (d === U.bootstrap)
|
|
2492
2492
|
throw new Error(".once disabled for " + d);
|
|
2493
|
-
var L =
|
|
2494
|
-
h({ payload: K.payload, instance:
|
|
2493
|
+
var L = k.on(d, function(K) {
|
|
2494
|
+
h({ payload: K.payload, instance: k, plugins: o, abort: C }), L();
|
|
2495
2495
|
});
|
|
2496
2496
|
return L;
|
|
2497
2497
|
}, getState: function(d) {
|
|
2498
2498
|
var h = S.getState();
|
|
2499
|
-
return d ?
|
|
2499
|
+
return d ? Pr(h, d) : Object.assign({}, h);
|
|
2500
2500
|
}, dispatch: function(d) {
|
|
2501
|
-
var h =
|
|
2501
|
+
var h = Ct(d) ? { type: d } : d;
|
|
2502
2502
|
if ($n.includes(h.type))
|
|
2503
2503
|
throw new Error("reserved action " + h.type);
|
|
2504
2504
|
var L = q({}, h, { _: q({ originalAction: h.type }, d._ || {}) });
|
|
@@ -2508,23 +2508,23 @@ function qu(e) {
|
|
|
2508
2508
|
}, removeItem: function(d, h) {
|
|
2509
2509
|
S.dispatch({ type: U.removeItemStart, key: d, options: h });
|
|
2510
2510
|
} }, setAnonymousId: function(d, h) {
|
|
2511
|
-
|
|
2511
|
+
k.storage.setItem(rt, d, h);
|
|
2512
2512
|
}, events: { core: $n, plugins: c } }, F = s.middlewares.concat([function(d) {
|
|
2513
2513
|
return function(h) {
|
|
2514
2514
|
return function(L) {
|
|
2515
|
-
return L.meta || (L.meta =
|
|
2515
|
+
return L.meta || (L.meta = $r()), h(L);
|
|
2516
2516
|
};
|
|
2517
2517
|
};
|
|
2518
|
-
},
|
|
2519
|
-
if (
|
|
2518
|
+
}, O(Tn), Ou(k, f, { all: u, plugins: c }), _u(r), ku(k), Au(k), O(Fn)]), T = { context: Fu, user: xu(r), page: Tu, track: Bu, plugins: Iu(f), queue: Du }, M = Yt, m = Yt;
|
|
2519
|
+
if (_e && e.debug) {
|
|
2520
2520
|
var v = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
|
2521
2521
|
v && (M = v({ trace: !0, traceLimit: 25 })), m = function() {
|
|
2522
|
-
return arguments.length === 0 ? lo() : ge(typeof arguments[0]) ?
|
|
2522
|
+
return arguments.length === 0 ? lo() : ge(typeof arguments[0]) ? qr() : qr().apply(null, arguments);
|
|
2523
2523
|
};
|
|
2524
2524
|
}
|
|
2525
2525
|
var j, w = function(d) {
|
|
2526
2526
|
return Object.keys(d).reduce(function(h, L) {
|
|
2527
|
-
return
|
|
2527
|
+
return Uu.includes(L) || (h[L] = d[L]), h;
|
|
2528
2528
|
}, {});
|
|
2529
2529
|
}(e), D = s.pluginsArray.reduce(function(d, h) {
|
|
2530
2530
|
var L = h.name, K = h.config, z = h.loaded, H = s.pluginEnabled[L];
|
|
@@ -2539,7 +2539,7 @@ function qu(e) {
|
|
|
2539
2539
|
(function(Y) {
|
|
2540
2540
|
Object.keys(Y).forEach(function(se) {
|
|
2541
2541
|
var J = Y[se];
|
|
2542
|
-
if (typeof J(void 0, { type: "@@redux/INIT" }) === Fe || typeof J(void 0, { type:
|
|
2542
|
+
if (typeof J(void 0, { type: "@@redux/INIT" }) === Fe || typeof J(void 0, { type: wu }) === Fe)
|
|
2543
2543
|
throw new Error("reducer " + se + " " + Fe);
|
|
2544
2544
|
});
|
|
2545
2545
|
})(L);
|
|
@@ -2549,19 +2549,19 @@ function qu(e) {
|
|
|
2549
2549
|
return function(Y, se) {
|
|
2550
2550
|
if (Y === void 0 && (Y = {}), H)
|
|
2551
2551
|
throw H;
|
|
2552
|
-
for (var J = !1,
|
|
2553
|
-
var jn = ce[nn],
|
|
2552
|
+
for (var J = !1, Ce = {}, nn = 0; nn < ce.length; nn++) {
|
|
2553
|
+
var jn = ce[nn], ir = Y[jn], ds = (0, L[jn])(ir, se);
|
|
2554
2554
|
if (typeof ds === Fe) {
|
|
2555
|
-
var
|
|
2556
|
-
throw new Error(
|
|
2555
|
+
var Co = Su(jn, se);
|
|
2556
|
+
throw new Error(Co);
|
|
2557
2557
|
}
|
|
2558
|
-
|
|
2558
|
+
Ce[jn] = ds, J = J || ds !== ir;
|
|
2559
2559
|
}
|
|
2560
|
-
return J ?
|
|
2560
|
+
return J ? Ce : Y;
|
|
2561
2561
|
};
|
|
2562
|
-
}(q({}, T, t)), E, m(M(
|
|
2562
|
+
}(q({}, T, t)), E, m(M(Pu.apply(void 0, F))));
|
|
2563
2563
|
S.dispatch = (j = S.dispatch, function(d, h, L) {
|
|
2564
|
-
var K = q({}, d, { meta:
|
|
2564
|
+
var K = q({}, d, { meta: $r(d.meta, h, vs(L)) });
|
|
2565
2565
|
return j.apply(null, [K]);
|
|
2566
2566
|
});
|
|
2567
2567
|
var V = Object.keys(o);
|
|
@@ -2573,18 +2573,18 @@ function qu(e) {
|
|
|
2573
2573
|
});
|
|
2574
2574
|
return S.dispatch({ type: U.registerPlugins, plugins: V, enabled: s.pluginEnabled }), s.pluginsArray.map(function(d, h) {
|
|
2575
2575
|
var L = d.bootstrap, K = d.config, z = d.name;
|
|
2576
|
-
L && De(L) && L({ instance:
|
|
2577
|
-
}),
|
|
2576
|
+
L && De(L) && L({ instance: k, config: K, payload: d }), S.dispatch({ type: U.registerPluginType(z), name: z, enabled: s.pluginEnabled[z], plugin: d }), s.pluginsArray.length === h + 1 && S.dispatch({ type: U.initializeStart, plugins: $, disabled: G });
|
|
2577
|
+
}), $u(function(d) {
|
|
2578
2578
|
S.dispatch({ type: d ? U.offline : U.online });
|
|
2579
2579
|
}), function(d, h, L) {
|
|
2580
2580
|
setInterval(function() {
|
|
2581
2581
|
return no(d, h, L);
|
|
2582
2582
|
}, 3e3);
|
|
2583
|
-
}(S, f,
|
|
2583
|
+
}(S, f, k), k;
|
|
2584
2584
|
}
|
|
2585
|
-
var Tn = "before", Fn = "after", cn = "cookie", at = po(), fo = cs,
|
|
2585
|
+
var Tn = "before", Fn = "after", cn = "cookie", at = po(), fo = cs, Vu = cs;
|
|
2586
2586
|
function ho(e) {
|
|
2587
|
-
return at ? cs(e, "", -1) :
|
|
2587
|
+
return at ? cs(e, "", -1) : Zt(e);
|
|
2588
2588
|
}
|
|
2589
2589
|
function po() {
|
|
2590
2590
|
if (at !== void 0)
|
|
@@ -2603,14 +2603,14 @@ function cs(e, t, n, s, r, i) {
|
|
|
2603
2603
|
return at === !1 && (o ? St(e, t) : wt(e)), o ? document.cookie = e + "=" + encodeURIComponent(t) + (n ? "; expires=" + new Date(+/* @__PURE__ */ new Date() + 1e3 * n).toUTCString() + (s ? "; path=" + s : "") + (r ? "; domain=" + r : "") + (i ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + e + "=")[1] || "").split(";")[0]);
|
|
2604
2604
|
}
|
|
2605
2605
|
}
|
|
2606
|
-
var un = "localStorage",
|
|
2606
|
+
var un = "localStorage", Ku = Ys.bind(null, "localStorage");
|
|
2607
2607
|
en("localStorage", "getItem", wt);
|
|
2608
2608
|
en("localStorage", "setItem", St);
|
|
2609
|
-
en("localStorage", "removeItem",
|
|
2610
|
-
var ln = "sessionStorage",
|
|
2609
|
+
en("localStorage", "removeItem", Zt);
|
|
2610
|
+
var ln = "sessionStorage", zu = Ys.bind(null, "sessionStorage");
|
|
2611
2611
|
en("sessionStorage", "getItem", wt);
|
|
2612
2612
|
en("sessionStorage", "setItem", St);
|
|
2613
|
-
en("sessionStorage", "removeItem",
|
|
2613
|
+
en("sessionStorage", "removeItem", Zt);
|
|
2614
2614
|
function Bt(e) {
|
|
2615
2615
|
var t = e;
|
|
2616
2616
|
try {
|
|
@@ -2626,57 +2626,57 @@ function Bt(e) {
|
|
|
2626
2626
|
if (t !== null && t !== "")
|
|
2627
2627
|
return t;
|
|
2628
2628
|
}
|
|
2629
|
-
var
|
|
2629
|
+
var Gu = Ku(), Wu = zu(), Hu = po();
|
|
2630
2630
|
function mo(e, t) {
|
|
2631
2631
|
if (e) {
|
|
2632
|
-
var n =
|
|
2632
|
+
var n = Xs(t), s = !nr(n), r = Zs(n) ? Bt(localStorage.getItem(e)) : void 0;
|
|
2633
2633
|
if (s && !Ot(r))
|
|
2634
2634
|
return r;
|
|
2635
|
-
var i =
|
|
2635
|
+
var i = er(n) ? Bt(fo(e)) : void 0;
|
|
2636
2636
|
if (s && i)
|
|
2637
2637
|
return i;
|
|
2638
|
-
var o =
|
|
2638
|
+
var o = tr(n) ? Bt(sessionStorage.getItem(e)) : void 0;
|
|
2639
2639
|
if (s && o)
|
|
2640
2640
|
return o;
|
|
2641
2641
|
var c = wt(e);
|
|
2642
2642
|
return s ? c : { localStorage: r, sessionStorage: o, cookie: i, global: c };
|
|
2643
2643
|
}
|
|
2644
2644
|
}
|
|
2645
|
-
function
|
|
2645
|
+
function Ju(e, t, n) {
|
|
2646
2646
|
if (e && !Ot(t)) {
|
|
2647
|
-
var s = {}, r =
|
|
2648
|
-
return Zs(r) && (s[un] = Un(un, t, Bt(localStorage.getItem(e))), localStorage.setItem(e, i), o) ? s[un] :
|
|
2647
|
+
var s = {}, r = Xs(n), i = JSON.stringify(t), o = !nr(r);
|
|
2648
|
+
return Zs(r) && (s[un] = Un(un, t, Bt(localStorage.getItem(e))), localStorage.setItem(e, i), o) ? s[un] : er(r) && (s[cn] = Un(cn, t, Bt(fo(e))), Vu(e, i), o) ? s[cn] : tr(r) && (s[ln] = Un(ln, t, Bt(sessionStorage.getItem(e))), sessionStorage.setItem(e, i), o) ? s[ln] : (s[an] = Un(an, t, wt(e)), St(e, t), o ? s[an] : s);
|
|
2649
2649
|
}
|
|
2650
2650
|
}
|
|
2651
|
-
function
|
|
2651
|
+
function Yu(e, t) {
|
|
2652
2652
|
if (e) {
|
|
2653
|
-
var n =
|
|
2654
|
-
return !Ot(s.localStorage) && Zs(n) && (localStorage.removeItem(e), r[un] = s.localStorage), !Ot(s.cookie) &&
|
|
2653
|
+
var n = Xs(t), s = mo(e, Ji), r = {};
|
|
2654
|
+
return !Ot(s.localStorage) && Zs(n) && (localStorage.removeItem(e), r[un] = s.localStorage), !Ot(s.cookie) && er(n) && (ho(e), r[cn] = s.cookie), !Ot(s.sessionStorage) && tr(n) && (sessionStorage.removeItem(e), r[ln] = s.sessionStorage), !Ot(s.global) && us(n, an) && (Zt(e), r[an] = s.global), r;
|
|
2655
2655
|
}
|
|
2656
2656
|
}
|
|
2657
|
-
function
|
|
2658
|
-
return e ?
|
|
2657
|
+
function Xs(e) {
|
|
2658
|
+
return e ? Ct(e) ? e : e.storage : Hi;
|
|
2659
2659
|
}
|
|
2660
2660
|
function Zs(e) {
|
|
2661
|
-
return
|
|
2662
|
-
}
|
|
2663
|
-
function Xs(e) {
|
|
2664
|
-
return Gu && us(e, cn);
|
|
2661
|
+
return Gu && us(e, un);
|
|
2665
2662
|
}
|
|
2666
2663
|
function er(e) {
|
|
2667
|
-
return
|
|
2664
|
+
return Hu && us(e, cn);
|
|
2668
2665
|
}
|
|
2669
2666
|
function tr(e) {
|
|
2667
|
+
return Wu && us(e, ln);
|
|
2668
|
+
}
|
|
2669
|
+
function nr(e) {
|
|
2670
2670
|
return e === Ji || e === "all";
|
|
2671
2671
|
}
|
|
2672
2672
|
function us(e, t) {
|
|
2673
|
-
return e === Hi || e === t ||
|
|
2673
|
+
return e === Hi || e === t || nr(e);
|
|
2674
2674
|
}
|
|
2675
2675
|
function Un(e, t, n) {
|
|
2676
2676
|
return { location: e, current: t, previous: n };
|
|
2677
2677
|
}
|
|
2678
|
-
var
|
|
2679
|
-
function
|
|
2678
|
+
var Xu = { setItem: Ju, getItem: mo, removeItem: Yu };
|
|
2679
|
+
function Zu(e, t, n) {
|
|
2680
2680
|
return t in e ? Object.defineProperty(e, t, {
|
|
2681
2681
|
value: n,
|
|
2682
2682
|
enumerable: !0,
|
|
@@ -2684,7 +2684,7 @@ function Yu(e, t, n) {
|
|
|
2684
2684
|
writable: !0
|
|
2685
2685
|
}) : e[t] = n, e;
|
|
2686
2686
|
}
|
|
2687
|
-
function
|
|
2687
|
+
function Qr(e, t) {
|
|
2688
2688
|
var n = Object.keys(e);
|
|
2689
2689
|
if (Object.getOwnPropertySymbols) {
|
|
2690
2690
|
var s = Object.getOwnPropertySymbols(e);
|
|
@@ -2694,26 +2694,26 @@ function $r(e, t) {
|
|
|
2694
2694
|
}
|
|
2695
2695
|
return n;
|
|
2696
2696
|
}
|
|
2697
|
-
function
|
|
2697
|
+
function Vr(e) {
|
|
2698
2698
|
for (var t = 1; t < arguments.length; t++) {
|
|
2699
2699
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
2700
|
-
t % 2 ?
|
|
2701
|
-
|
|
2702
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
2700
|
+
t % 2 ? Qr(Object(n), !0).forEach(function(s) {
|
|
2701
|
+
Zu(e, s, n[s]);
|
|
2702
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Qr(Object(n)).forEach(function(s) {
|
|
2703
2703
|
Object.defineProperty(e, s, Object.getOwnPropertyDescriptor(n, s));
|
|
2704
2704
|
});
|
|
2705
2705
|
}
|
|
2706
2706
|
return e;
|
|
2707
2707
|
}
|
|
2708
|
-
function
|
|
2708
|
+
function el() {
|
|
2709
2709
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = {
|
|
2710
|
-
storage:
|
|
2710
|
+
storage: Xu
|
|
2711
2711
|
};
|
|
2712
|
-
return
|
|
2712
|
+
return Qu(Vr(Vr({}, t), e));
|
|
2713
2713
|
}
|
|
2714
|
-
const
|
|
2714
|
+
const tl = "@chaibuilder/sdk", nl = "0.1.9", sl = "module", rl = [
|
|
2715
2715
|
"dist"
|
|
2716
|
-
],
|
|
2716
|
+
], il = "dist/core.js", ol = !1, al = {
|
|
2717
2717
|
".": {
|
|
2718
2718
|
import: "./dist/core.js",
|
|
2719
2719
|
require: "./dist/core.cjs",
|
|
@@ -2743,7 +2743,7 @@ const Xu = "@chaibuilder/sdk", el = "0.1.8", tl = "module", nl = [
|
|
|
2743
2743
|
import: "./dist/style.css",
|
|
2744
2744
|
require: "./dist/style.css"
|
|
2745
2745
|
}
|
|
2746
|
-
},
|
|
2746
|
+
}, cl = {
|
|
2747
2747
|
dev: "vite",
|
|
2748
2748
|
build: "tsc && vite build",
|
|
2749
2749
|
lint: "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
@@ -2755,7 +2755,7 @@ const Xu = "@chaibuilder/sdk", el = "0.1.8", tl = "module", nl = [
|
|
|
2755
2755
|
"e2e:report": "playwright show-report",
|
|
2756
2756
|
"e2e:ui": "playwright test --ui",
|
|
2757
2757
|
docs: "jsdoc -c jsdoc.conf.json"
|
|
2758
|
-
},
|
|
2758
|
+
}, ul = {
|
|
2759
2759
|
"@analytics/google-analytics": "^1.0.7",
|
|
2760
2760
|
"@bobthered/tailwindcss-palette-generator": "3.1.1",
|
|
2761
2761
|
"@chaibuilder/blocks": "^0.1.0",
|
|
@@ -2832,7 +2832,7 @@ const Xu = "@chaibuilder/sdk", el = "0.1.8", tl = "module", nl = [
|
|
|
2832
2832
|
"tippy.js": "^6.3.7",
|
|
2833
2833
|
"unist-util-visit": "^4.1.2",
|
|
2834
2834
|
"unsplash-js": "^7.0.18"
|
|
2835
|
-
},
|
|
2835
|
+
}, ll = {
|
|
2836
2836
|
"@commitlint/cli": "17.7.1",
|
|
2837
2837
|
"@commitlint/config-conventional": "17.7.0",
|
|
2838
2838
|
"@faker-js/faker": "^8.3.1",
|
|
@@ -2871,23 +2871,23 @@ const Xu = "@chaibuilder/sdk", el = "0.1.8", tl = "module", nl = [
|
|
|
2871
2871
|
typescript: "^5.0.2",
|
|
2872
2872
|
vite: "^4.4.5",
|
|
2873
2873
|
"vite-plugin-dts": "^3.6.3"
|
|
2874
|
-
},
|
|
2874
|
+
}, dl = {
|
|
2875
2875
|
workerDirectory: "public"
|
|
2876
|
-
},
|
|
2877
|
-
name:
|
|
2876
|
+
}, fl = {
|
|
2877
|
+
name: tl,
|
|
2878
2878
|
private: !1,
|
|
2879
|
-
version:
|
|
2880
|
-
type:
|
|
2881
|
-
files:
|
|
2882
|
-
main:
|
|
2883
|
-
sideEffects:
|
|
2884
|
-
exports:
|
|
2885
|
-
scripts:
|
|
2886
|
-
dependencies:
|
|
2887
|
-
devDependencies:
|
|
2888
|
-
msw:
|
|
2889
|
-
},
|
|
2890
|
-
function
|
|
2879
|
+
version: nl,
|
|
2880
|
+
type: sl,
|
|
2881
|
+
files: rl,
|
|
2882
|
+
main: il,
|
|
2883
|
+
sideEffects: ol,
|
|
2884
|
+
exports: al,
|
|
2885
|
+
scripts: cl,
|
|
2886
|
+
dependencies: ul,
|
|
2887
|
+
devDependencies: ll,
|
|
2888
|
+
msw: dl
|
|
2889
|
+
}, Kr = "https://api.chaibuilder.com", zr = () => typeof window > "u" ? !1 : window.location.href.includes("localhost");
|
|
2890
|
+
function hl() {
|
|
2891
2891
|
return {
|
|
2892
2892
|
/* All plugins require a name */
|
|
2893
2893
|
name: "chaibuilder-analytics",
|
|
@@ -2901,43 +2901,43 @@ function dl() {
|
|
|
2901
2901
|
page: (e) => {
|
|
2902
2902
|
if (typeof window > "u")
|
|
2903
2903
|
return !1;
|
|
2904
|
-
if (
|
|
2904
|
+
if (zr())
|
|
2905
2905
|
return;
|
|
2906
2906
|
const { payload: t } = e;
|
|
2907
|
-
fetch(`${
|
|
2907
|
+
fetch(`${Kr}/v1/log`, { method: "post", body: JSON.stringify(t) }).then((n) => n.json());
|
|
2908
2908
|
},
|
|
2909
2909
|
track: ({ payload: e }) => {
|
|
2910
2910
|
if (typeof window > "u")
|
|
2911
2911
|
return !1;
|
|
2912
|
-
|
|
2912
|
+
zr() || fetch(`${Kr}/v1/log`, { method: "post", body: JSON.stringify(e) });
|
|
2913
2913
|
},
|
|
2914
2914
|
loaded: () => typeof window > "u" ? !0 : !!window.chaibuilderAnalyticsLoaded
|
|
2915
2915
|
};
|
|
2916
2916
|
}
|
|
2917
|
-
const
|
|
2917
|
+
const pl = el({
|
|
2918
2918
|
app: "chaibuilder",
|
|
2919
|
-
version:
|
|
2920
|
-
plugins: [
|
|
2919
|
+
version: fl.version,
|
|
2920
|
+
plugins: [hl()]
|
|
2921
2921
|
});
|
|
2922
|
-
({}).NODE_ENV === "development" && console.log("Chai Builder:",
|
|
2923
|
-
const
|
|
2924
|
-
const { dndOptions: t = { backend: Qo } } = e, [n] =
|
|
2922
|
+
({}).NODE_ENV === "development" && console.log("Chai Builder:", ma);
|
|
2923
|
+
const ml = (e) => /* @__PURE__ */ _.jsx(_.Fragment, { children: e.children }), gl = (e) => {
|
|
2924
|
+
const { dndOptions: t = { backend: Qo } } = e, [n] = Wa(), [, s] = Ii(), r = Gi();
|
|
2925
2925
|
return Ee(() => {
|
|
2926
|
-
|
|
2926
|
+
iu.set(
|
|
2927
2927
|
// @ts-ignore
|
|
2928
2928
|
pi,
|
|
2929
|
-
|
|
2929
|
+
Zn(e, ["blocks", "globalBlocks", "brandingOptions"])
|
|
2930
2930
|
);
|
|
2931
2931
|
}, [e]), Ee(() => {
|
|
2932
2932
|
n(ta(e.blocks || [])), r();
|
|
2933
2933
|
}, [e.blocks]), Ee(() => {
|
|
2934
2934
|
s(e.brandingOptions);
|
|
2935
2935
|
}, [e.brandingOptions]), Ee(() => {
|
|
2936
|
-
|
|
2937
|
-
}, []), /* @__PURE__ */
|
|
2938
|
-
},
|
|
2939
|
-
/* @__PURE__ */
|
|
2940
|
-
/* @__PURE__ */
|
|
2936
|
+
pl.page();
|
|
2937
|
+
}, []), /* @__PURE__ */ _.jsx(To, { ...t, options: $o(), children: /* @__PURE__ */ _.jsx(ml, { children: /* @__PURE__ */ _.jsx(ru, {}) }) });
|
|
2938
|
+
}, yl = (e) => /* @__PURE__ */ _.jsxs(ya, { children: [
|
|
2939
|
+
/* @__PURE__ */ _.jsx(Bo, { features: ga, children: /* @__PURE__ */ _.jsx(gl, { ...e }) }),
|
|
2940
|
+
/* @__PURE__ */ _.jsx(zo, {})
|
|
2941
2941
|
] });
|
|
2942
2942
|
var tn = class {
|
|
2943
2943
|
constructor() {
|
|
@@ -2955,10 +2955,10 @@ var tn = class {
|
|
|
2955
2955
|
}
|
|
2956
2956
|
onUnsubscribe() {
|
|
2957
2957
|
}
|
|
2958
|
-
},
|
|
2958
|
+
}, Xt = typeof window > "u" || "Deno" in window;
|
|
2959
2959
|
function Se() {
|
|
2960
2960
|
}
|
|
2961
|
-
function
|
|
2961
|
+
function vl(e, t) {
|
|
2962
2962
|
return typeof e == "function" ? e(t) : e;
|
|
2963
2963
|
}
|
|
2964
2964
|
function Cs(e) {
|
|
@@ -2967,7 +2967,7 @@ function Cs(e) {
|
|
|
2967
2967
|
function go(e, t) {
|
|
2968
2968
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
2969
2969
|
}
|
|
2970
|
-
function
|
|
2970
|
+
function Gr(e, t) {
|
|
2971
2971
|
const {
|
|
2972
2972
|
type: n = "all",
|
|
2973
2973
|
exact: s,
|
|
@@ -2978,7 +2978,7 @@ function zr(e, t) {
|
|
|
2978
2978
|
} = e;
|
|
2979
2979
|
if (o) {
|
|
2980
2980
|
if (s) {
|
|
2981
|
-
if (t.queryHash !==
|
|
2981
|
+
if (t.queryHash !== sr(o, t.options))
|
|
2982
2982
|
return !1;
|
|
2983
2983
|
} else if (!pn(t.queryKey, o))
|
|
2984
2984
|
return !1;
|
|
@@ -2990,7 +2990,7 @@ function zr(e, t) {
|
|
|
2990
2990
|
}
|
|
2991
2991
|
return !(typeof c == "boolean" && t.isStale() !== c || typeof r < "u" && r !== t.state.fetchStatus || i && !i(t));
|
|
2992
2992
|
}
|
|
2993
|
-
function
|
|
2993
|
+
function Wr(e, t) {
|
|
2994
2994
|
const { exact: n, status: s, predicate: r, mutationKey: i } = e;
|
|
2995
2995
|
if (i) {
|
|
2996
2996
|
if (!t.options.mutationKey)
|
|
@@ -3003,13 +3003,13 @@ function Gr(e, t) {
|
|
|
3003
3003
|
}
|
|
3004
3004
|
return !(s && t.state.status !== s || r && !r(t));
|
|
3005
3005
|
}
|
|
3006
|
-
function
|
|
3006
|
+
function sr(e, t) {
|
|
3007
3007
|
return ((t == null ? void 0 : t.queryKeyHashFn) || hn)(e);
|
|
3008
3008
|
}
|
|
3009
3009
|
function hn(e) {
|
|
3010
3010
|
return JSON.stringify(
|
|
3011
3011
|
e,
|
|
3012
|
-
(t, n) =>
|
|
3012
|
+
(t, n) => Is(n) ? Object.keys(n).sort().reduce((s, r) => (s[r] = n[r], s), {}) : n
|
|
3013
3013
|
);
|
|
3014
3014
|
}
|
|
3015
3015
|
function pn(e, t) {
|
|
@@ -3018,8 +3018,8 @@ function pn(e, t) {
|
|
|
3018
3018
|
function yo(e, t) {
|
|
3019
3019
|
if (e === t)
|
|
3020
3020
|
return e;
|
|
3021
|
-
const n =
|
|
3022
|
-
if (n ||
|
|
3021
|
+
const n = Hr(e) && Hr(t);
|
|
3022
|
+
if (n || Is(e) && Is(t)) {
|
|
3023
3023
|
const s = n ? e.length : Object.keys(e).length, r = n ? t : Object.keys(t), i = r.length, o = n ? [] : {};
|
|
3024
3024
|
let c = 0;
|
|
3025
3025
|
for (let l = 0; l < i; l++) {
|
|
@@ -3038,19 +3038,19 @@ function Wn(e, t) {
|
|
|
3038
3038
|
return !1;
|
|
3039
3039
|
return !0;
|
|
3040
3040
|
}
|
|
3041
|
-
function
|
|
3041
|
+
function Hr(e) {
|
|
3042
3042
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
3043
3043
|
}
|
|
3044
|
-
function
|
|
3045
|
-
if (!
|
|
3044
|
+
function Is(e) {
|
|
3045
|
+
if (!Jr(e))
|
|
3046
3046
|
return !1;
|
|
3047
3047
|
const t = e.constructor;
|
|
3048
3048
|
if (typeof t > "u")
|
|
3049
3049
|
return !0;
|
|
3050
3050
|
const n = t.prototype;
|
|
3051
|
-
return !(!
|
|
3051
|
+
return !(!Jr(n) || !n.hasOwnProperty("isPrototypeOf"));
|
|
3052
3052
|
}
|
|
3053
|
-
function
|
|
3053
|
+
function Jr(e) {
|
|
3054
3054
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
3055
3055
|
}
|
|
3056
3056
|
function vo(e) {
|
|
@@ -3058,28 +3058,28 @@ function vo(e) {
|
|
|
3058
3058
|
setTimeout(t, e);
|
|
3059
3059
|
});
|
|
3060
3060
|
}
|
|
3061
|
-
function
|
|
3061
|
+
function Yr(e) {
|
|
3062
3062
|
vo(0).then(e);
|
|
3063
3063
|
}
|
|
3064
|
-
function
|
|
3064
|
+
function js(e, t, n) {
|
|
3065
3065
|
return typeof n.structuralSharing == "function" ? n.structuralSharing(e, t) : n.structuralSharing !== !1 ? yo(e, t) : t;
|
|
3066
3066
|
}
|
|
3067
|
-
function
|
|
3067
|
+
function bl(e, t, n = 0) {
|
|
3068
3068
|
const s = [...e, t];
|
|
3069
3069
|
return n && s.length > n ? s.slice(1) : s;
|
|
3070
3070
|
}
|
|
3071
|
-
function
|
|
3071
|
+
function wl(e, t, n = 0) {
|
|
3072
3072
|
const s = [t, ...e];
|
|
3073
3073
|
return n && s.length > n ? s.slice(0, -1) : s;
|
|
3074
3074
|
}
|
|
3075
|
-
var ct, We, Rt,
|
|
3075
|
+
var ct, We, Rt, ti, Sl = (ti = class extends tn {
|
|
3076
3076
|
constructor() {
|
|
3077
3077
|
super();
|
|
3078
3078
|
R(this, ct, void 0);
|
|
3079
3079
|
R(this, We, void 0);
|
|
3080
3080
|
R(this, Rt, void 0);
|
|
3081
|
-
|
|
3082
|
-
if (!
|
|
3081
|
+
x(this, Rt, (t) => {
|
|
3082
|
+
if (!Xt && window.addEventListener) {
|
|
3083
3083
|
const n = () => t();
|
|
3084
3084
|
return window.addEventListener("visibilitychange", n, !1), () => {
|
|
3085
3085
|
window.removeEventListener("visibilitychange", n);
|
|
@@ -3092,16 +3092,16 @@ var ct, We, Rt, ei, bl = (ei = class extends tn {
|
|
|
3092
3092
|
}
|
|
3093
3093
|
onUnsubscribe() {
|
|
3094
3094
|
var t;
|
|
3095
|
-
this.hasListeners() || ((t = a(this, We)) == null || t.call(this),
|
|
3095
|
+
this.hasListeners() || ((t = a(this, We)) == null || t.call(this), x(this, We, void 0));
|
|
3096
3096
|
}
|
|
3097
3097
|
setEventListener(t) {
|
|
3098
3098
|
var n;
|
|
3099
|
-
|
|
3099
|
+
x(this, Rt, t), (n = a(this, We)) == null || n.call(this), x(this, We, t((s) => {
|
|
3100
3100
|
typeof s == "boolean" ? this.setFocused(s) : this.onFocus();
|
|
3101
3101
|
}));
|
|
3102
3102
|
}
|
|
3103
3103
|
setFocused(t) {
|
|
3104
|
-
a(this, ct) !== t && (
|
|
3104
|
+
a(this, ct) !== t && (x(this, ct, t), this.onFocus());
|
|
3105
3105
|
}
|
|
3106
3106
|
onFocus() {
|
|
3107
3107
|
this.listeners.forEach((t) => {
|
|
@@ -3112,14 +3112,14 @@ var ct, We, Rt, ei, bl = (ei = class extends tn {
|
|
|
3112
3112
|
var t;
|
|
3113
3113
|
return typeof a(this, ct) == "boolean" ? a(this, ct) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
|
|
3114
3114
|
}
|
|
3115
|
-
}, ct = new WeakMap(), We = new WeakMap(), Rt = new WeakMap(),
|
|
3115
|
+
}, ct = new WeakMap(), We = new WeakMap(), Rt = new WeakMap(), ti), Hn = new Sl(), Dt, He, Mt, ni, Pl = (ni = class extends tn {
|
|
3116
3116
|
constructor() {
|
|
3117
3117
|
super();
|
|
3118
3118
|
R(this, Dt, !0);
|
|
3119
3119
|
R(this, He, void 0);
|
|
3120
3120
|
R(this, Mt, void 0);
|
|
3121
|
-
|
|
3122
|
-
if (!
|
|
3121
|
+
x(this, Mt, (t) => {
|
|
3122
|
+
if (!Xt && window.addEventListener) {
|
|
3123
3123
|
const n = () => t(!0), s = () => t(!1);
|
|
3124
3124
|
return window.addEventListener("online", n, !1), window.addEventListener("offline", s, !1), () => {
|
|
3125
3125
|
window.removeEventListener("online", n), window.removeEventListener("offline", s);
|
|
@@ -3132,22 +3132,22 @@ var ct, We, Rt, ei, bl = (ei = class extends tn {
|
|
|
3132
3132
|
}
|
|
3133
3133
|
onUnsubscribe() {
|
|
3134
3134
|
var t;
|
|
3135
|
-
this.hasListeners() || ((t = a(this, He)) == null || t.call(this),
|
|
3135
|
+
this.hasListeners() || ((t = a(this, He)) == null || t.call(this), x(this, He, void 0));
|
|
3136
3136
|
}
|
|
3137
3137
|
setEventListener(t) {
|
|
3138
3138
|
var n;
|
|
3139
|
-
|
|
3139
|
+
x(this, Mt, t), (n = a(this, He)) == null || n.call(this), x(this, He, t(this.setOnline.bind(this)));
|
|
3140
3140
|
}
|
|
3141
3141
|
setOnline(t) {
|
|
3142
|
-
a(this, Dt) !== t && (
|
|
3142
|
+
a(this, Dt) !== t && (x(this, Dt, t), this.listeners.forEach((s) => {
|
|
3143
3143
|
s(t);
|
|
3144
3144
|
}));
|
|
3145
3145
|
}
|
|
3146
3146
|
isOnline() {
|
|
3147
3147
|
return a(this, Dt);
|
|
3148
3148
|
}
|
|
3149
|
-
}, Dt = new WeakMap(), He = new WeakMap(), Mt = new WeakMap(),
|
|
3150
|
-
function
|
|
3149
|
+
}, Dt = new WeakMap(), He = new WeakMap(), Mt = new WeakMap(), ni), Jn = new Pl();
|
|
3150
|
+
function kl(e) {
|
|
3151
3151
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
3152
3152
|
}
|
|
3153
3153
|
function ls(e) {
|
|
@@ -3178,7 +3178,7 @@ function wo(e) {
|
|
|
3178
3178
|
}, g = (y) => {
|
|
3179
3179
|
var A;
|
|
3180
3180
|
s || (s = !0, (A = e.onError) == null || A.call(e, y), r == null || r(), o(y));
|
|
3181
|
-
},
|
|
3181
|
+
}, O = () => new Promise((y) => {
|
|
3182
3182
|
var A;
|
|
3183
3183
|
r = (I) => {
|
|
3184
3184
|
const B = s || !p();
|
|
@@ -3187,7 +3187,7 @@ function wo(e) {
|
|
|
3187
3187
|
}).then(() => {
|
|
3188
3188
|
var y;
|
|
3189
3189
|
r = void 0, s || (y = e.onContinue) == null || y.call(e);
|
|
3190
|
-
}),
|
|
3190
|
+
}), C = () => {
|
|
3191
3191
|
if (s)
|
|
3192
3192
|
return;
|
|
3193
3193
|
let y;
|
|
@@ -3200,20 +3200,20 @@ function wo(e) {
|
|
|
3200
3200
|
var F;
|
|
3201
3201
|
if (s)
|
|
3202
3202
|
return;
|
|
3203
|
-
const I = e.retry ?? (
|
|
3204
|
-
if (t || !
|
|
3203
|
+
const I = e.retry ?? (Xt ? 0 : 3), B = e.retryDelay ?? kl, b = typeof B == "function" ? B(n, A) : B, k = I === !0 || typeof I == "number" && n < I || typeof I == "function" && I(n, A);
|
|
3204
|
+
if (t || !k) {
|
|
3205
3205
|
g(A);
|
|
3206
3206
|
return;
|
|
3207
3207
|
}
|
|
3208
3208
|
n++, (F = e.onFail) == null || F.call(e, n, A), vo(b).then(() => {
|
|
3209
3209
|
if (p())
|
|
3210
|
-
return
|
|
3210
|
+
return O();
|
|
3211
3211
|
}).then(() => {
|
|
3212
|
-
t ? g(A) :
|
|
3212
|
+
t ? g(A) : C();
|
|
3213
3213
|
});
|
|
3214
3214
|
});
|
|
3215
3215
|
};
|
|
3216
|
-
return ls(e.networkMode) ?
|
|
3216
|
+
return ls(e.networkMode) ? C() : O().then(C), {
|
|
3217
3217
|
promise: c,
|
|
3218
3218
|
cancel: l,
|
|
3219
3219
|
continue: () => (r == null ? void 0 : r()) ? c : Promise.resolve(),
|
|
@@ -3221,7 +3221,7 @@ function wo(e) {
|
|
|
3221
3221
|
continueRetry: f
|
|
3222
3222
|
};
|
|
3223
3223
|
}
|
|
3224
|
-
function
|
|
3224
|
+
function xl() {
|
|
3225
3225
|
let e = [], t = 0, n = (f) => {
|
|
3226
3226
|
f();
|
|
3227
3227
|
}, s = (f) => {
|
|
@@ -3237,7 +3237,7 @@ function Pl() {
|
|
|
3237
3237
|
}
|
|
3238
3238
|
return p;
|
|
3239
3239
|
}, i = (f) => {
|
|
3240
|
-
t ? e.push(f) :
|
|
3240
|
+
t ? e.push(f) : Yr(() => {
|
|
3241
3241
|
n(f);
|
|
3242
3242
|
});
|
|
3243
3243
|
}, o = (f) => (...p) => {
|
|
@@ -3246,7 +3246,7 @@ function Pl() {
|
|
|
3246
3246
|
});
|
|
3247
3247
|
}, c = () => {
|
|
3248
3248
|
const f = e;
|
|
3249
|
-
e = [], f.length &&
|
|
3249
|
+
e = [], f.length && Yr(() => {
|
|
3250
3250
|
s(() => {
|
|
3251
3251
|
f.forEach((p) => {
|
|
3252
3252
|
n(p);
|
|
@@ -3266,7 +3266,7 @@ function Pl() {
|
|
|
3266
3266
|
}
|
|
3267
3267
|
};
|
|
3268
3268
|
}
|
|
3269
|
-
var ie =
|
|
3269
|
+
var ie = xl(), ut, si, So = (si = class {
|
|
3270
3270
|
constructor() {
|
|
3271
3271
|
R(this, ut, void 0);
|
|
3272
3272
|
}
|
|
@@ -3274,20 +3274,20 @@ var ie = Pl(), ut, ni, So = (ni = class {
|
|
|
3274
3274
|
this.clearGcTimeout();
|
|
3275
3275
|
}
|
|
3276
3276
|
scheduleGc() {
|
|
3277
|
-
this.clearGcTimeout(), Cs(this.gcTime) &&
|
|
3277
|
+
this.clearGcTimeout(), Cs(this.gcTime) && x(this, ut, setTimeout(() => {
|
|
3278
3278
|
this.optionalRemove();
|
|
3279
3279
|
}, this.gcTime));
|
|
3280
3280
|
}
|
|
3281
3281
|
updateGcTime(e) {
|
|
3282
3282
|
this.gcTime = Math.max(
|
|
3283
3283
|
this.gcTime || 0,
|
|
3284
|
-
e ?? (
|
|
3284
|
+
e ?? (Xt ? 1 / 0 : 5 * 60 * 1e3)
|
|
3285
3285
|
);
|
|
3286
3286
|
}
|
|
3287
3287
|
clearGcTimeout() {
|
|
3288
|
-
a(this, ut) && (clearTimeout(a(this, ut)),
|
|
3288
|
+
a(this, ut) && (clearTimeout(a(this, ut)), x(this, ut, void 0));
|
|
3289
3289
|
}
|
|
3290
|
-
}, ut = new WeakMap(),
|
|
3290
|
+
}, ut = new WeakMap(), si), Lt, Nt, ye, Je, ve, oe, mn, lt, Tt, Qn, Ae, Ne, ri, Al = (ri = class extends So {
|
|
3291
3291
|
constructor(t) {
|
|
3292
3292
|
super();
|
|
3293
3293
|
R(this, Tt);
|
|
@@ -3300,7 +3300,7 @@ var ie = Pl(), ut, ni, So = (ni = class {
|
|
|
3300
3300
|
R(this, oe, void 0);
|
|
3301
3301
|
R(this, mn, void 0);
|
|
3302
3302
|
R(this, lt, void 0);
|
|
3303
|
-
|
|
3303
|
+
x(this, lt, !1), x(this, mn, t.defaultOptions), Q(this, Tt, Qn).call(this, t.options), x(this, oe, []), x(this, ye, t.cache), this.queryKey = t.queryKey, this.queryHash = t.queryHash, x(this, Lt, t.state || El(this.options)), this.state = a(this, Lt), this.scheduleGc();
|
|
3304
3304
|
}
|
|
3305
3305
|
get meta() {
|
|
3306
3306
|
return this.options.meta;
|
|
@@ -3309,7 +3309,7 @@ var ie = Pl(), ut, ni, So = (ni = class {
|
|
|
3309
3309
|
!a(this, oe).length && this.state.fetchStatus === "idle" && a(this, ye).remove(this);
|
|
3310
3310
|
}
|
|
3311
3311
|
setData(t, n) {
|
|
3312
|
-
const s =
|
|
3312
|
+
const s = js(this.state.data, t, this.options);
|
|
3313
3313
|
return Q(this, Ae, Ne).call(this, {
|
|
3314
3314
|
data: s,
|
|
3315
3315
|
type: "success",
|
|
@@ -3359,7 +3359,7 @@ var ie = Pl(), ut, ni, So = (ni = class {
|
|
|
3359
3359
|
a(this, oe).includes(t) || (a(this, oe).push(t), this.clearGcTimeout(), a(this, ye).notify({ type: "observerAdded", query: this, observer: t }));
|
|
3360
3360
|
}
|
|
3361
3361
|
removeObserver(t) {
|
|
3362
|
-
a(this, oe).includes(t) && (
|
|
3362
|
+
a(this, oe).includes(t) && (x(this, oe, a(this, oe).filter((n) => n !== t)), a(this, oe).length || (a(this, ve) && (a(this, lt) ? a(this, ve).cancel({ revert: !0 }) : a(this, ve).cancelRetry()), this.scheduleGc()), a(this, ye).notify({ type: "observerRemoved", query: this, observer: t }));
|
|
3363
3363
|
}
|
|
3364
3364
|
getObserversCount() {
|
|
3365
3365
|
return a(this, oe).length;
|
|
@@ -3376,7 +3376,7 @@ var ie = Pl(), ut, ni, So = (ni = class {
|
|
|
3376
3376
|
return (u = a(this, ve)) == null || u.continueRetry(), a(this, Je);
|
|
3377
3377
|
}
|
|
3378
3378
|
if (t && Q(this, Tt, Qn).call(this, t), !this.options.queryFn) {
|
|
3379
|
-
const g = a(this, oe).find((
|
|
3379
|
+
const g = a(this, oe).find((O) => O.options.queryFn);
|
|
3380
3380
|
g && Q(this, Tt, Qn).call(this, g.options);
|
|
3381
3381
|
}
|
|
3382
3382
|
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
|
|
@@ -3388,11 +3388,11 @@ var ie = Pl(), ut, ni, So = (ni = class {
|
|
|
3388
3388
|
}, i = (g) => {
|
|
3389
3389
|
Object.defineProperty(g, "signal", {
|
|
3390
3390
|
enumerable: !0,
|
|
3391
|
-
get: () => (
|
|
3391
|
+
get: () => (x(this, lt, !0), s.signal)
|
|
3392
3392
|
});
|
|
3393
3393
|
};
|
|
3394
3394
|
i(r);
|
|
3395
|
-
const o = () => this.options.queryFn ? (
|
|
3395
|
+
const o = () => this.options.queryFn ? (x(this, lt, !1), this.options.persister ? this.options.persister(
|
|
3396
3396
|
this.options.queryFn,
|
|
3397
3397
|
r,
|
|
3398
3398
|
this
|
|
@@ -3410,14 +3410,14 @@ var ie = Pl(), ut, ni, So = (ni = class {
|
|
|
3410
3410
|
i(c), (f = this.options.behavior) == null || f.onFetch(
|
|
3411
3411
|
c,
|
|
3412
3412
|
this
|
|
3413
|
-
),
|
|
3413
|
+
), x(this, Nt, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((p = c.fetchOptions) == null ? void 0 : p.meta)) && Q(this, Ae, Ne).call(this, { type: "fetch", meta: (P = c.fetchOptions) == null ? void 0 : P.meta });
|
|
3414
3414
|
const l = (g) => {
|
|
3415
|
-
var
|
|
3415
|
+
var O, C, y, A;
|
|
3416
3416
|
bs(g) && g.silent || Q(this, Ae, Ne).call(this, {
|
|
3417
3417
|
type: "error",
|
|
3418
3418
|
error: g
|
|
3419
|
-
}), bs(g) || ((
|
|
3420
|
-
|
|
3419
|
+
}), bs(g) || ((C = (O = a(this, ye).config).onError) == null || C.call(
|
|
3420
|
+
O,
|
|
3421
3421
|
g,
|
|
3422
3422
|
this
|
|
3423
3423
|
), (A = (y = a(this, ye).config).onSettled) == null || A.call(
|
|
@@ -3427,18 +3427,18 @@ var ie = Pl(), ut, ni, So = (ni = class {
|
|
|
3427
3427
|
this
|
|
3428
3428
|
)), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
3429
3429
|
};
|
|
3430
|
-
return
|
|
3430
|
+
return x(this, ve, wo({
|
|
3431
3431
|
fn: c.fetchFn,
|
|
3432
3432
|
abort: s.abort.bind(s),
|
|
3433
3433
|
onSuccess: (g) => {
|
|
3434
|
-
var
|
|
3434
|
+
var O, C, y, A;
|
|
3435
3435
|
if (typeof g > "u") {
|
|
3436
3436
|
process.env.NODE_ENV !== "production" && console.error(
|
|
3437
3437
|
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
3438
3438
|
), l(new Error(`${this.queryHash} data is undefined`));
|
|
3439
3439
|
return;
|
|
3440
3440
|
}
|
|
3441
|
-
this.setData(g), (
|
|
3441
|
+
this.setData(g), (C = (O = a(this, ye).config).onSuccess) == null || C.call(O, g, this), (A = (y = a(this, ye).config).onSettled) == null || A.call(
|
|
3442
3442
|
y,
|
|
3443
3443
|
g,
|
|
3444
3444
|
this.state.error,
|
|
@@ -3446,8 +3446,8 @@ var ie = Pl(), ut, ni, So = (ni = class {
|
|
|
3446
3446
|
), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
3447
3447
|
},
|
|
3448
3448
|
onError: l,
|
|
3449
|
-
onFail: (g,
|
|
3450
|
-
Q(this, Ae, Ne).call(this, { type: "failed", failureCount: g, error:
|
|
3449
|
+
onFail: (g, O) => {
|
|
3450
|
+
Q(this, Ae, Ne).call(this, { type: "failed", failureCount: g, error: O });
|
|
3451
3451
|
},
|
|
3452
3452
|
onPause: () => {
|
|
3453
3453
|
Q(this, Ae, Ne).call(this, { type: "pause" });
|
|
@@ -3458,7 +3458,7 @@ var ie = Pl(), ut, ni, So = (ni = class {
|
|
|
3458
3458
|
retry: c.options.retry,
|
|
3459
3459
|
retryDelay: c.options.retryDelay,
|
|
3460
3460
|
networkMode: c.options.networkMode
|
|
3461
|
-
})),
|
|
3461
|
+
})), x(this, Je, a(this, ve).promise), a(this, Je);
|
|
3462
3462
|
}
|
|
3463
3463
|
}, Lt = new WeakMap(), Nt = new WeakMap(), ye = new WeakMap(), Je = new WeakMap(), ve = new WeakMap(), oe = new WeakMap(), mn = new WeakMap(), lt = new WeakMap(), Tt = new WeakSet(), Qn = function(t) {
|
|
3464
3464
|
this.options = { ...a(this, mn), ...t }, this.updateGcTime(this.options.gcTime);
|
|
@@ -3537,8 +3537,8 @@ var ie = Pl(), ut, ni, So = (ni = class {
|
|
|
3537
3537
|
s.onQueryUpdate();
|
|
3538
3538
|
}), a(this, ye).notify({ query: this, type: "updated", action: t });
|
|
3539
3539
|
});
|
|
3540
|
-
},
|
|
3541
|
-
function
|
|
3540
|
+
}, ri);
|
|
3541
|
+
function El(e) {
|
|
3542
3542
|
const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, n = typeof t < "u", s = n ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
|
|
3543
3543
|
return {
|
|
3544
3544
|
data: t,
|
|
@@ -3555,16 +3555,16 @@ function kl(e) {
|
|
|
3555
3555
|
fetchStatus: "idle"
|
|
3556
3556
|
};
|
|
3557
3557
|
}
|
|
3558
|
-
var Ie,
|
|
3558
|
+
var Ie, ii, Ol = (ii = class extends tn {
|
|
3559
3559
|
constructor(t = {}) {
|
|
3560
3560
|
super();
|
|
3561
3561
|
R(this, Ie, void 0);
|
|
3562
|
-
this.config = t,
|
|
3562
|
+
this.config = t, x(this, Ie, /* @__PURE__ */ new Map());
|
|
3563
3563
|
}
|
|
3564
3564
|
build(t, n, s) {
|
|
3565
|
-
const r = n.queryKey, i = n.queryHash ??
|
|
3565
|
+
const r = n.queryKey, i = n.queryHash ?? sr(r, n);
|
|
3566
3566
|
let o = this.get(i);
|
|
3567
|
-
return o || (o = new
|
|
3567
|
+
return o || (o = new Al({
|
|
3568
3568
|
cache: this,
|
|
3569
3569
|
queryKey: r,
|
|
3570
3570
|
queryHash: i,
|
|
@@ -3599,12 +3599,12 @@ var Ie, ri, Al = (ri = class extends tn {
|
|
|
3599
3599
|
find(t) {
|
|
3600
3600
|
const n = { exact: !0, ...t };
|
|
3601
3601
|
return this.getAll().find(
|
|
3602
|
-
(s) =>
|
|
3602
|
+
(s) => Gr(n, s)
|
|
3603
3603
|
);
|
|
3604
3604
|
}
|
|
3605
3605
|
findAll(t = {}) {
|
|
3606
3606
|
const n = this.getAll();
|
|
3607
|
-
return Object.keys(t).length > 0 ? n.filter((s) =>
|
|
3607
|
+
return Object.keys(t).length > 0 ? n.filter((s) => Gr(t, s)) : n;
|
|
3608
3608
|
}
|
|
3609
3609
|
notify(t) {
|
|
3610
3610
|
ie.batch(() => {
|
|
@@ -3627,7 +3627,7 @@ var Ie, ri, Al = (ri = class extends tn {
|
|
|
3627
3627
|
});
|
|
3628
3628
|
});
|
|
3629
3629
|
}
|
|
3630
|
-
}, Ie = new WeakMap(),
|
|
3630
|
+
}, Ie = new WeakMap(), ii), je, gn, me, Ft, Be, Ve, oi, _l = (oi = class extends So {
|
|
3631
3631
|
constructor(t) {
|
|
3632
3632
|
super();
|
|
3633
3633
|
R(this, Be);
|
|
@@ -3635,7 +3635,7 @@ var Ie, ri, Al = (ri = class extends tn {
|
|
|
3635
3635
|
R(this, gn, void 0);
|
|
3636
3636
|
R(this, me, void 0);
|
|
3637
3637
|
R(this, Ft, void 0);
|
|
3638
|
-
this.mutationId = t.mutationId,
|
|
3638
|
+
this.mutationId = t.mutationId, x(this, gn, t.defaultOptions), x(this, me, t.mutationCache), x(this, je, []), this.state = t.state || Po(), this.setOptions(t.options), this.scheduleGc();
|
|
3639
3639
|
}
|
|
3640
3640
|
setOptions(t) {
|
|
3641
3641
|
this.options = { ...a(this, gn), ...t }, this.updateGcTime(this.options.gcTime);
|
|
@@ -3651,7 +3651,7 @@ var Ie, ri, Al = (ri = class extends tn {
|
|
|
3651
3651
|
}));
|
|
3652
3652
|
}
|
|
3653
3653
|
removeObserver(t) {
|
|
3654
|
-
|
|
3654
|
+
x(this, je, a(this, je).filter((n) => n !== t)), this.scheduleGc(), a(this, me).notify({
|
|
3655
3655
|
type: "observerRemoved",
|
|
3656
3656
|
mutation: this,
|
|
3657
3657
|
observer: t
|
|
@@ -3666,8 +3666,8 @@ var Ie, ri, Al = (ri = class extends tn {
|
|
|
3666
3666
|
this.execute(this.state.variables);
|
|
3667
3667
|
}
|
|
3668
3668
|
async execute(t) {
|
|
3669
|
-
var r, i, o, c, l, u, f, p, P, g,
|
|
3670
|
-
const n = () => (
|
|
3669
|
+
var r, i, o, c, l, u, f, p, P, g, O, C, y, A, I, B, b, k, F, T;
|
|
3670
|
+
const n = () => (x(this, Ft, wo({
|
|
3671
3671
|
fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
|
|
3672
3672
|
onFail: (M, m) => {
|
|
3673
3673
|
Q(this, Be, Ve).call(this, { type: "failed", failureCount: M, error: m });
|
|
@@ -3710,7 +3710,7 @@ var Ie, ri, Al = (ri = class extends tn {
|
|
|
3710
3710
|
this.state.variables,
|
|
3711
3711
|
this.state.context,
|
|
3712
3712
|
this
|
|
3713
|
-
)), await ((
|
|
3713
|
+
)), await ((C = (O = this.options).onSettled) == null ? void 0 : C.call(O, M, null, t, this.state.context)), Q(this, Be, Ve).call(this, { type: "success", data: M }), M;
|
|
3714
3714
|
} catch (M) {
|
|
3715
3715
|
try {
|
|
3716
3716
|
throw await ((A = (y = a(this, me).config).onError) == null ? void 0 : A.call(
|
|
@@ -3724,7 +3724,7 @@ var Ie, ri, Al = (ri = class extends tn {
|
|
|
3724
3724
|
M,
|
|
3725
3725
|
t,
|
|
3726
3726
|
this.state.context
|
|
3727
|
-
)), await ((
|
|
3727
|
+
)), await ((k = (b = a(this, me).config).onSettled) == null ? void 0 : k.call(
|
|
3728
3728
|
b,
|
|
3729
3729
|
void 0,
|
|
3730
3730
|
M,
|
|
@@ -3806,7 +3806,7 @@ var Ie, ri, Al = (ri = class extends tn {
|
|
|
3806
3806
|
action: t
|
|
3807
3807
|
});
|
|
3808
3808
|
});
|
|
3809
|
-
},
|
|
3809
|
+
}, oi);
|
|
3810
3810
|
function Po() {
|
|
3811
3811
|
return {
|
|
3812
3812
|
context: void 0,
|
|
@@ -3820,16 +3820,16 @@ function Po() {
|
|
|
3820
3820
|
submittedAt: 0
|
|
3821
3821
|
};
|
|
3822
3822
|
}
|
|
3823
|
-
var be, yn, dt,
|
|
3823
|
+
var be, yn, dt, ai, Cl = (ai = class extends tn {
|
|
3824
3824
|
constructor(t = {}) {
|
|
3825
3825
|
super();
|
|
3826
3826
|
R(this, be, void 0);
|
|
3827
3827
|
R(this, yn, void 0);
|
|
3828
3828
|
R(this, dt, void 0);
|
|
3829
|
-
this.config = t,
|
|
3829
|
+
this.config = t, x(this, be, []), x(this, yn, 0);
|
|
3830
3830
|
}
|
|
3831
3831
|
build(t, n, s) {
|
|
3832
|
-
const r = new
|
|
3832
|
+
const r = new _l({
|
|
3833
3833
|
mutationCache: this,
|
|
3834
3834
|
mutationId: ++Bn(this, yn)._,
|
|
3835
3835
|
options: t.defaultMutationOptions(n),
|
|
@@ -3841,7 +3841,7 @@ var be, yn, dt, oi, Ol = (oi = class extends tn {
|
|
|
3841
3841
|
a(this, be).push(t), this.notify({ type: "added", mutation: t });
|
|
3842
3842
|
}
|
|
3843
3843
|
remove(t) {
|
|
3844
|
-
|
|
3844
|
+
x(this, be, a(this, be).filter((n) => n !== t)), this.notify({ type: "removed", mutation: t });
|
|
3845
3845
|
}
|
|
3846
3846
|
clear() {
|
|
3847
3847
|
ie.batch(() => {
|
|
@@ -3856,12 +3856,12 @@ var be, yn, dt, oi, Ol = (oi = class extends tn {
|
|
|
3856
3856
|
find(t) {
|
|
3857
3857
|
const n = { exact: !0, ...t };
|
|
3858
3858
|
return a(this, be).find(
|
|
3859
|
-
(s) =>
|
|
3859
|
+
(s) => Wr(n, s)
|
|
3860
3860
|
);
|
|
3861
3861
|
}
|
|
3862
3862
|
findAll(t = {}) {
|
|
3863
3863
|
return a(this, be).filter(
|
|
3864
|
-
(n) =>
|
|
3864
|
+
(n) => Wr(t, n)
|
|
3865
3865
|
);
|
|
3866
3866
|
}
|
|
3867
3867
|
notify(t) {
|
|
@@ -3872,7 +3872,7 @@ var be, yn, dt, oi, Ol = (oi = class extends tn {
|
|
|
3872
3872
|
});
|
|
3873
3873
|
}
|
|
3874
3874
|
resumePausedMutations() {
|
|
3875
|
-
return
|
|
3875
|
+
return x(this, dt, (a(this, dt) ?? Promise.resolve()).then(() => {
|
|
3876
3876
|
const t = a(this, be).filter((n) => n.state.isPaused);
|
|
3877
3877
|
return ie.batch(
|
|
3878
3878
|
() => t.reduce(
|
|
@@ -3881,16 +3881,16 @@ var be, yn, dt, oi, Ol = (oi = class extends tn {
|
|
|
3881
3881
|
)
|
|
3882
3882
|
);
|
|
3883
3883
|
}).then(() => {
|
|
3884
|
-
|
|
3884
|
+
x(this, dt, void 0);
|
|
3885
3885
|
})), a(this, dt);
|
|
3886
3886
|
}
|
|
3887
|
-
}, be = new WeakMap(), yn = new WeakMap(), dt = new WeakMap(),
|
|
3888
|
-
function
|
|
3887
|
+
}, be = new WeakMap(), yn = new WeakMap(), dt = new WeakMap(), ai);
|
|
3888
|
+
function Il(e) {
|
|
3889
3889
|
return {
|
|
3890
3890
|
onFetch: (t, n) => {
|
|
3891
3891
|
const s = async () => {
|
|
3892
|
-
var
|
|
3893
|
-
const r = t.options, i = (y = (
|
|
3892
|
+
var O, C, y, A, I;
|
|
3893
|
+
const r = t.options, i = (y = (C = (O = t.fetchOptions) == null ? void 0 : O.meta) == null ? void 0 : C.fetchMore) == null ? void 0 : y.direction, o = ((A = t.state.data) == null ? void 0 : A.pages) || [], c = ((I = t.state.data) == null ? void 0 : I.pageParams) || [], l = { pages: [], pageParams: [] };
|
|
3894
3894
|
let u = !1;
|
|
3895
3895
|
const f = (B) => {
|
|
3896
3896
|
Object.defineProperty(B, "signal", {
|
|
@@ -3901,7 +3901,7 @@ function Cl(e) {
|
|
|
3901
3901
|
});
|
|
3902
3902
|
}, p = t.options.queryFn || (() => Promise.reject(
|
|
3903
3903
|
new Error(`Missing queryFn: '${t.options.queryHash}'`)
|
|
3904
|
-
)), P = async (B, b,
|
|
3904
|
+
)), P = async (B, b, k) => {
|
|
3905
3905
|
if (u)
|
|
3906
3906
|
return Promise.reject();
|
|
3907
3907
|
if (b == null && B.pages.length)
|
|
@@ -3909,13 +3909,13 @@ function Cl(e) {
|
|
|
3909
3909
|
const F = {
|
|
3910
3910
|
queryKey: t.queryKey,
|
|
3911
3911
|
pageParam: b,
|
|
3912
|
-
direction:
|
|
3912
|
+
direction: k ? "backward" : "forward",
|
|
3913
3913
|
meta: t.options.meta
|
|
3914
3914
|
};
|
|
3915
3915
|
f(F);
|
|
3916
3916
|
const T = await p(
|
|
3917
3917
|
F
|
|
3918
|
-
), { maxPages: M } = t.options, m =
|
|
3918
|
+
), { maxPages: M } = t.options, m = k ? wl : bl;
|
|
3919
3919
|
return {
|
|
3920
3920
|
pages: m(B.pages, T, M),
|
|
3921
3921
|
pageParams: m(B.pageParams, b, M)
|
|
@@ -3923,11 +3923,11 @@ function Cl(e) {
|
|
|
3923
3923
|
};
|
|
3924
3924
|
let g;
|
|
3925
3925
|
if (i && o.length) {
|
|
3926
|
-
const B = i === "backward", b = B ?
|
|
3926
|
+
const B = i === "backward", b = B ? jl : Xr, k = {
|
|
3927
3927
|
pages: o,
|
|
3928
3928
|
pageParams: c
|
|
3929
|
-
}, F = b(r,
|
|
3930
|
-
g = await P(
|
|
3929
|
+
}, F = b(r, k);
|
|
3930
|
+
g = await P(k, F, B);
|
|
3931
3931
|
} else {
|
|
3932
3932
|
g = await P(
|
|
3933
3933
|
l,
|
|
@@ -3935,8 +3935,8 @@ function Cl(e) {
|
|
|
3935
3935
|
);
|
|
3936
3936
|
const B = e ?? o.length;
|
|
3937
3937
|
for (let b = 1; b < B; b++) {
|
|
3938
|
-
const
|
|
3939
|
-
g = await P(g,
|
|
3938
|
+
const k = Xr(r, g);
|
|
3939
|
+
g = await P(g, k);
|
|
3940
3940
|
}
|
|
3941
3941
|
}
|
|
3942
3942
|
return g;
|
|
@@ -3957,7 +3957,7 @@ function Cl(e) {
|
|
|
3957
3957
|
}
|
|
3958
3958
|
};
|
|
3959
3959
|
}
|
|
3960
|
-
function
|
|
3960
|
+
function Xr(e, { pages: t, pageParams: n }) {
|
|
3961
3961
|
const s = t.length - 1;
|
|
3962
3962
|
return e.getNextPageParam(
|
|
3963
3963
|
t[s],
|
|
@@ -3966,7 +3966,7 @@ function Yr(e, { pages: t, pageParams: n }) {
|
|
|
3966
3966
|
n
|
|
3967
3967
|
);
|
|
3968
3968
|
}
|
|
3969
|
-
function
|
|
3969
|
+
function jl(e, { pages: t, pageParams: n }) {
|
|
3970
3970
|
var s;
|
|
3971
3971
|
return (s = e.getPreviousPageParam) == null ? void 0 : s.call(
|
|
3972
3972
|
e,
|
|
@@ -3976,28 +3976,28 @@ function _l(e, { pages: t, pageParams: n }) {
|
|
|
3976
3976
|
n
|
|
3977
3977
|
);
|
|
3978
3978
|
}
|
|
3979
|
-
var re, Ye,
|
|
3979
|
+
var re, Ye, Xe, Ut, qt, Ze, $t, Qt, ci, Bl = (ci = class {
|
|
3980
3980
|
constructor(e = {}) {
|
|
3981
3981
|
R(this, re, void 0);
|
|
3982
3982
|
R(this, Ye, void 0);
|
|
3983
|
-
R(this,
|
|
3983
|
+
R(this, Xe, void 0);
|
|
3984
3984
|
R(this, Ut, void 0);
|
|
3985
3985
|
R(this, qt, void 0);
|
|
3986
|
-
R(this,
|
|
3986
|
+
R(this, Ze, void 0);
|
|
3987
3987
|
R(this, $t, void 0);
|
|
3988
3988
|
R(this, Qt, void 0);
|
|
3989
|
-
|
|
3989
|
+
x(this, re, e.queryCache || new Ol()), x(this, Ye, e.mutationCache || new Cl()), x(this, Xe, e.defaultOptions || {}), x(this, Ut, /* @__PURE__ */ new Map()), x(this, qt, /* @__PURE__ */ new Map()), x(this, Ze, 0);
|
|
3990
3990
|
}
|
|
3991
3991
|
mount() {
|
|
3992
|
-
Bn(this,
|
|
3992
|
+
Bn(this, Ze)._++, a(this, Ze) === 1 && (x(this, $t, Hn.subscribe(() => {
|
|
3993
3993
|
Hn.isFocused() && (this.resumePausedMutations(), a(this, re).onFocus());
|
|
3994
|
-
})),
|
|
3994
|
+
})), x(this, Qt, Jn.subscribe(() => {
|
|
3995
3995
|
Jn.isOnline() && (this.resumePausedMutations(), a(this, re).onOnline());
|
|
3996
3996
|
})));
|
|
3997
3997
|
}
|
|
3998
3998
|
unmount() {
|
|
3999
3999
|
var e, t;
|
|
4000
|
-
Bn(this,
|
|
4000
|
+
Bn(this, Ze)._--, a(this, Ze) === 0 && ((e = a(this, $t)) == null || e.call(this), x(this, $t, void 0), (t = a(this, Qt)) == null || t.call(this), x(this, Qt, void 0));
|
|
4001
4001
|
}
|
|
4002
4002
|
isFetching(e) {
|
|
4003
4003
|
return a(this, re).findAll({ ...e, fetchStatus: "fetching" }).length;
|
|
@@ -4020,7 +4020,7 @@ var re, Ye, Ze, Ut, qt, Xe, $t, Qt, ai, Il = (ai = class {
|
|
|
4020
4020
|
});
|
|
4021
4021
|
}
|
|
4022
4022
|
setQueryData(e, t, n) {
|
|
4023
|
-
const s = a(this, re).find({ queryKey: e }), r = s == null ? void 0 : s.state.data, i =
|
|
4023
|
+
const s = a(this, re).find({ queryKey: e }), r = s == null ? void 0 : s.state.data, i = vl(t, r);
|
|
4024
4024
|
if (typeof i > "u")
|
|
4025
4025
|
return;
|
|
4026
4026
|
const o = this.defaultQueryOptions({ queryKey: e });
|
|
@@ -4096,7 +4096,7 @@ var re, Ye, Ze, Ut, qt, Xe, $t, Qt, ai, Il = (ai = class {
|
|
|
4096
4096
|
return this.fetchQuery(e).then(Se).catch(Se);
|
|
4097
4097
|
}
|
|
4098
4098
|
fetchInfiniteQuery(e) {
|
|
4099
|
-
return e.behavior =
|
|
4099
|
+
return e.behavior = Il(e.pages), this.fetchQuery(e);
|
|
4100
4100
|
}
|
|
4101
4101
|
prefetchInfiniteQuery(e) {
|
|
4102
4102
|
return this.fetchInfiniteQuery(e).then(Se).catch(Se);
|
|
@@ -4111,10 +4111,10 @@ var re, Ye, Ze, Ut, qt, Xe, $t, Qt, ai, Il = (ai = class {
|
|
|
4111
4111
|
return a(this, Ye);
|
|
4112
4112
|
}
|
|
4113
4113
|
getDefaultOptions() {
|
|
4114
|
-
return a(this,
|
|
4114
|
+
return a(this, Xe);
|
|
4115
4115
|
}
|
|
4116
4116
|
setDefaultOptions(e) {
|
|
4117
|
-
|
|
4117
|
+
x(this, Xe, e);
|
|
4118
4118
|
}
|
|
4119
4119
|
setQueryDefaults(e, t) {
|
|
4120
4120
|
a(this, Ut).set(hn(e), {
|
|
@@ -4146,19 +4146,19 @@ var re, Ye, Ze, Ut, qt, Xe, $t, Qt, ai, Il = (ai = class {
|
|
|
4146
4146
|
if (e != null && e._defaulted)
|
|
4147
4147
|
return e;
|
|
4148
4148
|
const t = {
|
|
4149
|
-
...a(this,
|
|
4149
|
+
...a(this, Xe).queries,
|
|
4150
4150
|
...(e == null ? void 0 : e.queryKey) && this.getQueryDefaults(e.queryKey),
|
|
4151
4151
|
...e,
|
|
4152
4152
|
_defaulted: !0
|
|
4153
4153
|
};
|
|
4154
|
-
return t.queryHash || (t.queryHash =
|
|
4154
|
+
return t.queryHash || (t.queryHash = sr(
|
|
4155
4155
|
t.queryKey,
|
|
4156
4156
|
t
|
|
4157
4157
|
)), typeof t.refetchOnReconnect > "u" && (t.refetchOnReconnect = t.networkMode !== "always"), typeof t.throwOnError > "u" && (t.throwOnError = !!t.suspense), typeof t.networkMode > "u" && t.persister && (t.networkMode = "offlineFirst"), t;
|
|
4158
4158
|
}
|
|
4159
4159
|
defaultMutationOptions(e) {
|
|
4160
4160
|
return e != null && e._defaulted ? e : {
|
|
4161
|
-
...a(this,
|
|
4161
|
+
...a(this, Xe).mutations,
|
|
4162
4162
|
...(e == null ? void 0 : e.mutationKey) && this.getMutationDefaults(e.mutationKey),
|
|
4163
4163
|
...e,
|
|
4164
4164
|
_defaulted: !0
|
|
@@ -4167,7 +4167,7 @@ var re, Ye, Ze, Ut, qt, Xe, $t, Qt, ai, Il = (ai = class {
|
|
|
4167
4167
|
clear() {
|
|
4168
4168
|
a(this, re).clear(), a(this, Ye).clear();
|
|
4169
4169
|
}
|
|
4170
|
-
}, re = new WeakMap(), Ye = new WeakMap(),
|
|
4170
|
+
}, re = new WeakMap(), Ye = new WeakMap(), Xe = new WeakMap(), Ut = new WeakMap(), qt = new WeakMap(), Ze = new WeakMap(), $t = new WeakMap(), Qt = new WeakMap(), ci), fe, Z, Vt, ue, ft, Kt, Re, vn, zt, Gt, ht, pt, et, mt, gt, on, bn, Bs, wn, Rs, Sn, Ds, Pn, Ms, kn, Ls, xn, Ns, An, Ts, Yn, ko, ui, Rl = (ui = class extends tn {
|
|
4171
4171
|
constructor(t, n) {
|
|
4172
4172
|
super();
|
|
4173
4173
|
R(this, gt);
|
|
@@ -4175,12 +4175,12 @@ var re, Ye, Ze, Ut, qt, Xe, $t, Qt, ai, Il = (ai = class {
|
|
|
4175
4175
|
R(this, wn);
|
|
4176
4176
|
R(this, Sn);
|
|
4177
4177
|
R(this, Pn);
|
|
4178
|
-
R(this, xn);
|
|
4179
4178
|
R(this, kn);
|
|
4179
|
+
R(this, xn);
|
|
4180
4180
|
R(this, An);
|
|
4181
4181
|
R(this, Yn);
|
|
4182
4182
|
R(this, fe, void 0);
|
|
4183
|
-
R(this,
|
|
4183
|
+
R(this, Z, void 0);
|
|
4184
4184
|
R(this, Vt, void 0);
|
|
4185
4185
|
R(this, ue, void 0);
|
|
4186
4186
|
R(this, ft, void 0);
|
|
@@ -4195,56 +4195,56 @@ var re, Ye, Ze, Ut, qt, Xe, $t, Qt, ai, Il = (ai = class {
|
|
|
4195
4195
|
R(this, pt, void 0);
|
|
4196
4196
|
R(this, et, void 0);
|
|
4197
4197
|
R(this, mt, void 0);
|
|
4198
|
-
|
|
4198
|
+
x(this, Z, void 0), x(this, Vt, void 0), x(this, ue, void 0), x(this, mt, /* @__PURE__ */ new Set()), x(this, fe, t), this.options = n, x(this, Re, null), this.bindMethods(), this.setOptions(n);
|
|
4199
4199
|
}
|
|
4200
4200
|
bindMethods() {
|
|
4201
4201
|
this.refetch = this.refetch.bind(this);
|
|
4202
4202
|
}
|
|
4203
4203
|
onSubscribe() {
|
|
4204
|
-
this.listeners.size === 1 && (a(this,
|
|
4204
|
+
this.listeners.size === 1 && (a(this, Z).addObserver(this), Zr(a(this, Z), this.options) ? Q(this, gt, on).call(this) : this.updateResult(), Q(this, Pn, Ms).call(this));
|
|
4205
4205
|
}
|
|
4206
4206
|
onUnsubscribe() {
|
|
4207
4207
|
this.hasListeners() || this.destroy();
|
|
4208
4208
|
}
|
|
4209
4209
|
shouldFetchOnReconnect() {
|
|
4210
|
-
return
|
|
4211
|
-
a(this,
|
|
4210
|
+
return Fs(
|
|
4211
|
+
a(this, Z),
|
|
4212
4212
|
this.options,
|
|
4213
4213
|
this.options.refetchOnReconnect
|
|
4214
4214
|
);
|
|
4215
4215
|
}
|
|
4216
4216
|
shouldFetchOnWindowFocus() {
|
|
4217
|
-
return
|
|
4218
|
-
a(this,
|
|
4217
|
+
return Fs(
|
|
4218
|
+
a(this, Z),
|
|
4219
4219
|
this.options,
|
|
4220
4220
|
this.options.refetchOnWindowFocus
|
|
4221
4221
|
);
|
|
4222
4222
|
}
|
|
4223
4223
|
destroy() {
|
|
4224
|
-
this.listeners = /* @__PURE__ */ new Set(), Q(this,
|
|
4224
|
+
this.listeners = /* @__PURE__ */ new Set(), Q(this, kn, Ls).call(this), Q(this, xn, Ns).call(this), a(this, Z).removeObserver(this);
|
|
4225
4225
|
}
|
|
4226
4226
|
setOptions(t, n) {
|
|
4227
|
-
const s = this.options, r = a(this,
|
|
4227
|
+
const s = this.options, r = a(this, Z);
|
|
4228
4228
|
if (this.options = a(this, fe).defaultQueryOptions(t), Wn(s, this.options) || a(this, fe).getQueryCache().notify({
|
|
4229
4229
|
type: "observerOptionsUpdated",
|
|
4230
|
-
query: a(this,
|
|
4230
|
+
query: a(this, Z),
|
|
4231
4231
|
observer: this
|
|
4232
4232
|
}), typeof this.options.enabled < "u" && typeof this.options.enabled != "boolean")
|
|
4233
4233
|
throw new Error("Expected enabled to be a boolean");
|
|
4234
|
-
this.options.queryKey || (this.options.queryKey = s.queryKey), Q(this, An,
|
|
4234
|
+
this.options.queryKey || (this.options.queryKey = s.queryKey), Q(this, An, Ts).call(this);
|
|
4235
4235
|
const i = this.hasListeners();
|
|
4236
|
-
i &&
|
|
4237
|
-
a(this,
|
|
4236
|
+
i && ei(
|
|
4237
|
+
a(this, Z),
|
|
4238
4238
|
r,
|
|
4239
4239
|
this.options,
|
|
4240
4240
|
s
|
|
4241
|
-
) && Q(this, gt, on).call(this), this.updateResult(n), i && (a(this,
|
|
4242
|
-
const o = Q(this, wn,
|
|
4243
|
-
i && (a(this,
|
|
4241
|
+
) && Q(this, gt, on).call(this), this.updateResult(n), i && (a(this, Z) !== r || this.options.enabled !== s.enabled || this.options.staleTime !== s.staleTime) && Q(this, bn, Bs).call(this);
|
|
4242
|
+
const o = Q(this, wn, Rs).call(this);
|
|
4243
|
+
i && (a(this, Z) !== r || this.options.enabled !== s.enabled || o !== a(this, et)) && Q(this, Sn, Ds).call(this, o);
|
|
4244
4244
|
}
|
|
4245
4245
|
getOptimisticResult(t) {
|
|
4246
4246
|
const n = a(this, fe).getQueryCache().build(a(this, fe), t), s = this.createResult(n, t);
|
|
4247
|
-
return
|
|
4247
|
+
return Ml(this, s) && (x(this, ue, s), x(this, Kt, this.options), x(this, ft, a(this, Z).state)), s;
|
|
4248
4248
|
}
|
|
4249
4249
|
getCurrentResult() {
|
|
4250
4250
|
return a(this, ue);
|
|
@@ -4260,7 +4260,7 @@ var re, Ye, Ze, Ut, qt, Xe, $t, Qt, ai, Il = (ai = class {
|
|
|
4260
4260
|
}), n;
|
|
4261
4261
|
}
|
|
4262
4262
|
getCurrentQuery() {
|
|
4263
|
-
return a(this,
|
|
4263
|
+
return a(this, Z);
|
|
4264
4264
|
}
|
|
4265
4265
|
refetch({ ...t } = {}) {
|
|
4266
4266
|
return this.fetch({
|
|
@@ -4279,24 +4279,24 @@ var re, Ye, Ze, Ut, qt, Xe, $t, Qt, ai, Il = (ai = class {
|
|
|
4279
4279
|
}
|
|
4280
4280
|
createResult(t, n) {
|
|
4281
4281
|
var F;
|
|
4282
|
-
const s = a(this,
|
|
4283
|
-
let { error: p, errorUpdatedAt: P, fetchStatus: g, status:
|
|
4282
|
+
const s = a(this, Z), r = this.options, i = a(this, ue), o = a(this, ft), c = a(this, Kt), u = t !== s ? t.state : a(this, Vt), { state: f } = t;
|
|
4283
|
+
let { error: p, errorUpdatedAt: P, fetchStatus: g, status: O } = f, C = !1, y;
|
|
4284
4284
|
if (n._optimisticResults) {
|
|
4285
|
-
const T = this.hasListeners(), M = !T && Zr(t, n), m = T &&
|
|
4286
|
-
(M || m) && (g = ls(t.options.networkMode) ? "fetching" : "paused", f.dataUpdatedAt || (
|
|
4285
|
+
const T = this.hasListeners(), M = !T && Zr(t, n), m = T && ei(t, s, n, r);
|
|
4286
|
+
(M || m) && (g = ls(t.options.networkMode) ? "fetching" : "paused", f.dataUpdatedAt || (O = "pending")), n._optimisticResults === "isRestoring" && (g = "idle");
|
|
4287
4287
|
}
|
|
4288
4288
|
if (n.select && typeof f.data < "u")
|
|
4289
4289
|
if (i && f.data === (o == null ? void 0 : o.data) && n.select === a(this, vn))
|
|
4290
4290
|
y = a(this, zt);
|
|
4291
4291
|
else
|
|
4292
4292
|
try {
|
|
4293
|
-
|
|
4293
|
+
x(this, vn, n.select), y = n.select(f.data), y = js(i == null ? void 0 : i.data, y, n), x(this, zt, y), x(this, Re, null);
|
|
4294
4294
|
} catch (T) {
|
|
4295
|
-
|
|
4295
|
+
x(this, Re, T);
|
|
4296
4296
|
}
|
|
4297
4297
|
else
|
|
4298
4298
|
y = f.data;
|
|
4299
|
-
if (typeof n.placeholderData < "u" && typeof y > "u" &&
|
|
4299
|
+
if (typeof n.placeholderData < "u" && typeof y > "u" && O === "pending") {
|
|
4300
4300
|
let T;
|
|
4301
4301
|
if (i != null && i.isPlaceholderData && n.placeholderData === (c == null ? void 0 : c.placeholderData))
|
|
4302
4302
|
T = i.data;
|
|
@@ -4305,23 +4305,23 @@ var re, Ye, Ze, Ut, qt, Xe, $t, Qt, ai, Il = (ai = class {
|
|
|
4305
4305
|
a(this, Gt)
|
|
4306
4306
|
) : n.placeholderData, n.select && typeof T < "u")
|
|
4307
4307
|
try {
|
|
4308
|
-
T = n.select(T),
|
|
4308
|
+
T = n.select(T), x(this, Re, null);
|
|
4309
4309
|
} catch (M) {
|
|
4310
|
-
|
|
4310
|
+
x(this, Re, M);
|
|
4311
4311
|
}
|
|
4312
|
-
typeof T < "u" && (
|
|
4312
|
+
typeof T < "u" && (O = "success", y = js(
|
|
4313
4313
|
i == null ? void 0 : i.data,
|
|
4314
4314
|
T,
|
|
4315
4315
|
n
|
|
4316
|
-
),
|
|
4316
|
+
), C = !0);
|
|
4317
4317
|
}
|
|
4318
|
-
a(this, Re) && (p = a(this, Re), y = a(this, zt), P = Date.now(),
|
|
4319
|
-
const A = g === "fetching", I =
|
|
4318
|
+
a(this, Re) && (p = a(this, Re), y = a(this, zt), P = Date.now(), O = "error");
|
|
4319
|
+
const A = g === "fetching", I = O === "pending", B = O === "error", b = I && A;
|
|
4320
4320
|
return {
|
|
4321
|
-
status:
|
|
4321
|
+
status: O,
|
|
4322
4322
|
fetchStatus: g,
|
|
4323
4323
|
isPending: I,
|
|
4324
|
-
isSuccess:
|
|
4324
|
+
isSuccess: O === "success",
|
|
4325
4325
|
isError: B,
|
|
4326
4326
|
isInitialLoading: b,
|
|
4327
4327
|
isLoading: b,
|
|
@@ -4338,17 +4338,17 @@ var re, Ye, Ze, Ut, qt, Xe, $t, Qt, ai, Il = (ai = class {
|
|
|
4338
4338
|
isRefetching: A && !I,
|
|
4339
4339
|
isLoadingError: B && f.dataUpdatedAt === 0,
|
|
4340
4340
|
isPaused: g === "paused",
|
|
4341
|
-
isPlaceholderData:
|
|
4341
|
+
isPlaceholderData: C,
|
|
4342
4342
|
isRefetchError: B && f.dataUpdatedAt !== 0,
|
|
4343
|
-
isStale:
|
|
4343
|
+
isStale: rr(t, n),
|
|
4344
4344
|
refetch: this.refetch
|
|
4345
4345
|
};
|
|
4346
4346
|
}
|
|
4347
4347
|
updateResult(t) {
|
|
4348
|
-
const n = a(this, ue), s = this.createResult(a(this,
|
|
4349
|
-
if (
|
|
4348
|
+
const n = a(this, ue), s = this.createResult(a(this, Z), this.options);
|
|
4349
|
+
if (x(this, ft, a(this, Z).state), x(this, Kt, this.options), a(this, ft).data !== void 0 && x(this, Gt, a(this, Z)), Wn(s, n))
|
|
4350
4350
|
return;
|
|
4351
|
-
|
|
4351
|
+
x(this, ue, s);
|
|
4352
4352
|
const r = {}, i = () => {
|
|
4353
4353
|
if (!n)
|
|
4354
4354
|
return !0;
|
|
@@ -4363,79 +4363,79 @@ var re, Ye, Ze, Ut, qt, Xe, $t, Qt, ai, Il = (ai = class {
|
|
|
4363
4363
|
return a(this, ue)[f] !== n[f] && l.has(f);
|
|
4364
4364
|
});
|
|
4365
4365
|
};
|
|
4366
|
-
(t == null ? void 0 : t.listeners) !== !1 && i() && (r.listeners = !0), Q(this, Yn,
|
|
4366
|
+
(t == null ? void 0 : t.listeners) !== !1 && i() && (r.listeners = !0), Q(this, Yn, ko).call(this, { ...r, ...t });
|
|
4367
4367
|
}
|
|
4368
4368
|
onQueryUpdate() {
|
|
4369
|
-
this.updateResult(), this.hasListeners() && Q(this, Pn,
|
|
4369
|
+
this.updateResult(), this.hasListeners() && Q(this, Pn, Ms).call(this);
|
|
4370
4370
|
}
|
|
4371
|
-
}, fe = new WeakMap(),
|
|
4372
|
-
Q(this, An,
|
|
4373
|
-
let n = a(this,
|
|
4371
|
+
}, fe = new WeakMap(), Z = new WeakMap(), Vt = new WeakMap(), ue = new WeakMap(), ft = new WeakMap(), Kt = new WeakMap(), Re = new WeakMap(), vn = new WeakMap(), zt = new WeakMap(), Gt = new WeakMap(), ht = new WeakMap(), pt = new WeakMap(), et = new WeakMap(), mt = new WeakMap(), gt = new WeakSet(), on = function(t) {
|
|
4372
|
+
Q(this, An, Ts).call(this);
|
|
4373
|
+
let n = a(this, Z).fetch(
|
|
4374
4374
|
this.options,
|
|
4375
4375
|
t
|
|
4376
4376
|
);
|
|
4377
4377
|
return t != null && t.throwOnError || (n = n.catch(Se)), n;
|
|
4378
|
-
}, bn = new WeakSet(),
|
|
4379
|
-
if (Q(this,
|
|
4378
|
+
}, bn = new WeakSet(), Bs = function() {
|
|
4379
|
+
if (Q(this, kn, Ls).call(this), Xt || a(this, ue).isStale || !Cs(this.options.staleTime))
|
|
4380
4380
|
return;
|
|
4381
4381
|
const n = go(
|
|
4382
4382
|
a(this, ue).dataUpdatedAt,
|
|
4383
4383
|
this.options.staleTime
|
|
4384
4384
|
) + 1;
|
|
4385
|
-
|
|
4385
|
+
x(this, ht, setTimeout(() => {
|
|
4386
4386
|
a(this, ue).isStale || this.updateResult();
|
|
4387
4387
|
}, n));
|
|
4388
|
-
}, wn = new WeakSet(),
|
|
4389
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(a(this,
|
|
4390
|
-
}, Sn = new WeakSet(),
|
|
4391
|
-
Q(this,
|
|
4388
|
+
}, wn = new WeakSet(), Rs = function() {
|
|
4389
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(a(this, Z)) : this.options.refetchInterval) ?? !1;
|
|
4390
|
+
}, Sn = new WeakSet(), Ds = function(t) {
|
|
4391
|
+
Q(this, xn, Ns).call(this), x(this, et, t), !(Xt || this.options.enabled === !1 || !Cs(a(this, et)) || a(this, et) === 0) && x(this, pt, setInterval(() => {
|
|
4392
4392
|
(this.options.refetchIntervalInBackground || Hn.isFocused()) && Q(this, gt, on).call(this);
|
|
4393
4393
|
}, a(this, et)));
|
|
4394
|
-
}, Pn = new WeakSet(),
|
|
4395
|
-
Q(this, bn,
|
|
4396
|
-
}, xn = new WeakSet(), Ms = function() {
|
|
4397
|
-
a(this, ht) && (clearTimeout(a(this, ht)), k(this, ht, void 0));
|
|
4394
|
+
}, Pn = new WeakSet(), Ms = function() {
|
|
4395
|
+
Q(this, bn, Bs).call(this), Q(this, Sn, Ds).call(this, Q(this, wn, Rs).call(this));
|
|
4398
4396
|
}, kn = new WeakSet(), Ls = function() {
|
|
4399
|
-
a(this,
|
|
4400
|
-
},
|
|
4397
|
+
a(this, ht) && (clearTimeout(a(this, ht)), x(this, ht, void 0));
|
|
4398
|
+
}, xn = new WeakSet(), Ns = function() {
|
|
4399
|
+
a(this, pt) && (clearInterval(a(this, pt)), x(this, pt, void 0));
|
|
4400
|
+
}, An = new WeakSet(), Ts = function() {
|
|
4401
4401
|
const t = a(this, fe).getQueryCache().build(a(this, fe), this.options);
|
|
4402
|
-
if (t === a(this,
|
|
4402
|
+
if (t === a(this, Z))
|
|
4403
4403
|
return;
|
|
4404
|
-
const n = a(this,
|
|
4405
|
-
|
|
4406
|
-
}, Yn = new WeakSet(),
|
|
4404
|
+
const n = a(this, Z);
|
|
4405
|
+
x(this, Z, t), x(this, Vt, t.state), this.hasListeners() && (n == null || n.removeObserver(this), t.addObserver(this));
|
|
4406
|
+
}, Yn = new WeakSet(), ko = function(t) {
|
|
4407
4407
|
ie.batch(() => {
|
|
4408
4408
|
t.listeners && this.listeners.forEach((n) => {
|
|
4409
4409
|
n(a(this, ue));
|
|
4410
4410
|
}), a(this, fe).getQueryCache().notify({
|
|
4411
|
-
query: a(this,
|
|
4411
|
+
query: a(this, Z),
|
|
4412
4412
|
type: "observerResultsUpdated"
|
|
4413
4413
|
});
|
|
4414
4414
|
});
|
|
4415
|
-
},
|
|
4416
|
-
function
|
|
4415
|
+
}, ui);
|
|
4416
|
+
function Dl(e, t) {
|
|
4417
4417
|
return t.enabled !== !1 && !e.state.dataUpdatedAt && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
4418
4418
|
}
|
|
4419
4419
|
function Zr(e, t) {
|
|
4420
|
-
return
|
|
4420
|
+
return Dl(e, t) || e.state.dataUpdatedAt > 0 && Fs(e, t, t.refetchOnMount);
|
|
4421
4421
|
}
|
|
4422
|
-
function
|
|
4422
|
+
function Fs(e, t, n) {
|
|
4423
4423
|
if (t.enabled !== !1) {
|
|
4424
4424
|
const s = typeof n == "function" ? n(e) : n;
|
|
4425
|
-
return s === "always" || s !== !1 &&
|
|
4425
|
+
return s === "always" || s !== !1 && rr(e, t);
|
|
4426
4426
|
}
|
|
4427
4427
|
return !1;
|
|
4428
4428
|
}
|
|
4429
|
-
function
|
|
4430
|
-
return n.enabled !== !1 && (e !== t || s.enabled === !1) && (!n.suspense || e.state.status !== "error") &&
|
|
4429
|
+
function ei(e, t, n, s) {
|
|
4430
|
+
return n.enabled !== !1 && (e !== t || s.enabled === !1) && (!n.suspense || e.state.status !== "error") && rr(e, n);
|
|
4431
4431
|
}
|
|
4432
|
-
function
|
|
4432
|
+
function rr(e, t) {
|
|
4433
4433
|
return e.isStaleByTime(t.staleTime);
|
|
4434
4434
|
}
|
|
4435
|
-
function
|
|
4435
|
+
function Ml(e, t) {
|
|
4436
4436
|
return !Wn(e.getCurrentResult(), t);
|
|
4437
4437
|
}
|
|
4438
|
-
var tt, le, we, Te, Wt, Vn, En,
|
|
4438
|
+
var tt, le, we, Te, Wt, Vn, En, Us, li, Ll = (li = class extends tn {
|
|
4439
4439
|
constructor(t, n) {
|
|
4440
4440
|
super();
|
|
4441
4441
|
R(this, Wt);
|
|
@@ -4444,7 +4444,7 @@ var tt, le, we, Te, Wt, Vn, En, Fs, ui, Dl = (ui = class extends tn {
|
|
|
4444
4444
|
R(this, le, void 0);
|
|
4445
4445
|
R(this, we, void 0);
|
|
4446
4446
|
R(this, Te, void 0);
|
|
4447
|
-
|
|
4447
|
+
x(this, le, void 0), x(this, tt, t), this.setOptions(n), this.bindMethods(), Q(this, Wt, Vn).call(this);
|
|
4448
4448
|
}
|
|
4449
4449
|
bindMethods() {
|
|
4450
4450
|
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
@@ -4463,22 +4463,22 @@ var tt, le, we, Te, Wt, Vn, En, Fs, ui, Dl = (ui = class extends tn {
|
|
|
4463
4463
|
this.hasListeners() || (t = a(this, we)) == null || t.removeObserver(this);
|
|
4464
4464
|
}
|
|
4465
4465
|
onMutationUpdate(t) {
|
|
4466
|
-
Q(this, Wt, Vn).call(this), Q(this, En,
|
|
4466
|
+
Q(this, Wt, Vn).call(this), Q(this, En, Us).call(this, t);
|
|
4467
4467
|
}
|
|
4468
4468
|
getCurrentResult() {
|
|
4469
4469
|
return a(this, le);
|
|
4470
4470
|
}
|
|
4471
4471
|
reset() {
|
|
4472
|
-
|
|
4472
|
+
x(this, we, void 0), Q(this, Wt, Vn).call(this), Q(this, En, Us).call(this);
|
|
4473
4473
|
}
|
|
4474
4474
|
mutate(t, n) {
|
|
4475
4475
|
var s;
|
|
4476
|
-
return
|
|
4476
|
+
return x(this, Te, n), (s = a(this, we)) == null || s.removeObserver(this), x(this, we, a(this, tt).getMutationCache().build(a(this, tt), this.options)), a(this, we).addObserver(this), a(this, we).execute(t);
|
|
4477
4477
|
}
|
|
4478
4478
|
}, tt = new WeakMap(), le = new WeakMap(), we = new WeakMap(), Te = new WeakMap(), Wt = new WeakSet(), Vn = function() {
|
|
4479
4479
|
var n;
|
|
4480
4480
|
const t = ((n = a(this, we)) == null ? void 0 : n.state) ?? Po();
|
|
4481
|
-
|
|
4481
|
+
x(this, le, {
|
|
4482
4482
|
...t,
|
|
4483
4483
|
isPending: t.status === "pending",
|
|
4484
4484
|
isSuccess: t.status === "success",
|
|
@@ -4487,7 +4487,7 @@ var tt, le, we, Te, Wt, Vn, En, Fs, ui, Dl = (ui = class extends tn {
|
|
|
4487
4487
|
mutate: this.mutate,
|
|
4488
4488
|
reset: this.reset
|
|
4489
4489
|
});
|
|
4490
|
-
}, En = new WeakSet(),
|
|
4490
|
+
}, En = new WeakSet(), Us = function(t) {
|
|
4491
4491
|
ie.batch(() => {
|
|
4492
4492
|
var n, s, r, i, o, c, l, u;
|
|
4493
4493
|
a(this, Te) && this.hasListeners() && ((t == null ? void 0 : t.type) === "success" ? ((s = (n = a(this, Te)).onSuccess) == null || s.call(
|
|
@@ -4516,23 +4516,23 @@ var tt, le, we, Te, Wt, Vn, En, Fs, ui, Dl = (ui = class extends tn {
|
|
|
4516
4516
|
f(a(this, le));
|
|
4517
4517
|
});
|
|
4518
4518
|
});
|
|
4519
|
-
},
|
|
4519
|
+
}, li), xo = ae.createContext(
|
|
4520
4520
|
void 0
|
|
4521
4521
|
), qe = (e) => {
|
|
4522
|
-
const t = ae.useContext(
|
|
4522
|
+
const t = ae.useContext(xo);
|
|
4523
4523
|
if (e)
|
|
4524
4524
|
return e;
|
|
4525
4525
|
if (!t)
|
|
4526
4526
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
4527
4527
|
return t;
|
|
4528
|
-
},
|
|
4528
|
+
}, Nl = ({
|
|
4529
4529
|
client: e,
|
|
4530
4530
|
children: t
|
|
4531
4531
|
}) => (ae.useEffect(() => (e.mount(), () => {
|
|
4532
4532
|
e.unmount();
|
|
4533
|
-
}), [e]), /* @__PURE__ */ ae.createElement(
|
|
4533
|
+
}), [e]), /* @__PURE__ */ ae.createElement(xo.Provider, { value: e }, t)), Ao = ae.createContext(!1), Tl = () => ae.useContext(Ao);
|
|
4534
4534
|
Ao.Provider;
|
|
4535
|
-
function
|
|
4535
|
+
function Fl() {
|
|
4536
4536
|
let e = !1;
|
|
4537
4537
|
return {
|
|
4538
4538
|
clearReset: () => {
|
|
@@ -4544,33 +4544,33 @@ function Nl() {
|
|
|
4544
4544
|
isReset: () => e
|
|
4545
4545
|
};
|
|
4546
4546
|
}
|
|
4547
|
-
var
|
|
4547
|
+
var Ul = ae.createContext(Fl()), ql = () => ae.useContext(Ul);
|
|
4548
4548
|
function Eo(e, t) {
|
|
4549
4549
|
return typeof e == "function" ? e(...t) : !!e;
|
|
4550
4550
|
}
|
|
4551
|
-
var
|
|
4551
|
+
var $l = (e, t) => {
|
|
4552
4552
|
(e.suspense || e.throwOnError) && (t.isReset() || (e.retryOnMount = !1));
|
|
4553
|
-
},
|
|
4553
|
+
}, Ql = (e) => {
|
|
4554
4554
|
ae.useEffect(() => {
|
|
4555
4555
|
e.clearReset();
|
|
4556
4556
|
}, [e]);
|
|
4557
|
-
},
|
|
4557
|
+
}, Vl = ({
|
|
4558
4558
|
result: e,
|
|
4559
4559
|
errorResetBoundary: t,
|
|
4560
4560
|
throwOnError: n,
|
|
4561
4561
|
query: s
|
|
4562
|
-
}) => e.isError && !t.isReset() && !e.isFetching && Eo(n, [e.error, s]),
|
|
4562
|
+
}) => e.isError && !t.isReset() && !e.isFetching && Eo(n, [e.error, s]), Kl = (e) => {
|
|
4563
4563
|
e.suspense && typeof e.staleTime != "number" && (e.staleTime = 1e3);
|
|
4564
|
-
},
|
|
4564
|
+
}, zl = (e, t) => (e == null ? void 0 : e.suspense) && t.isPending, Gl = (e, t, n) => t.fetchOptimistic(e).catch(() => {
|
|
4565
4565
|
n.clearReset();
|
|
4566
4566
|
});
|
|
4567
|
-
function
|
|
4567
|
+
function Wl(e, t, n) {
|
|
4568
4568
|
if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
|
|
4569
4569
|
throw new Error(
|
|
4570
4570
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
4571
4571
|
);
|
|
4572
|
-
const s = qe(n), r =
|
|
4573
|
-
o._optimisticResults = r ? "isRestoring" : "optimistic",
|
|
4572
|
+
const s = qe(n), r = Tl(), i = ql(), o = s.defaultQueryOptions(e);
|
|
4573
|
+
o._optimisticResults = r ? "isRestoring" : "optimistic", Kl(o), $l(o, i), Ql(i);
|
|
4574
4574
|
const [c] = ae.useState(
|
|
4575
4575
|
() => new t(
|
|
4576
4576
|
s,
|
|
@@ -4590,9 +4590,9 @@ function zl(e, t, n) {
|
|
|
4590
4590
|
() => c.getCurrentResult()
|
|
4591
4591
|
), ae.useEffect(() => {
|
|
4592
4592
|
c.setOptions(o, { listeners: !1 });
|
|
4593
|
-
}, [o, c]),
|
|
4594
|
-
throw
|
|
4595
|
-
if (
|
|
4593
|
+
}, [o, c]), zl(o, l))
|
|
4594
|
+
throw Gl(o, c, i);
|
|
4595
|
+
if (Vl({
|
|
4596
4596
|
result: l,
|
|
4597
4597
|
errorResetBoundary: i,
|
|
4598
4598
|
throwOnError: o.throwOnError,
|
|
@@ -4601,12 +4601,12 @@ function zl(e, t, n) {
|
|
|
4601
4601
|
throw l.error;
|
|
4602
4602
|
return o.notifyOnChangeProps ? l : c.trackResult(l);
|
|
4603
4603
|
}
|
|
4604
|
-
function
|
|
4605
|
-
return
|
|
4604
|
+
function Cn(e, t) {
|
|
4605
|
+
return Wl(e, Rl, t);
|
|
4606
4606
|
}
|
|
4607
4607
|
function $e(e, t) {
|
|
4608
4608
|
const n = qe(t), [s] = ae.useState(
|
|
4609
|
-
() => new
|
|
4609
|
+
() => new Ll(
|
|
4610
4610
|
n,
|
|
4611
4611
|
e
|
|
4612
4612
|
)
|
|
@@ -4623,7 +4623,7 @@ function $e(e, t) {
|
|
|
4623
4623
|
() => s.getCurrentResult()
|
|
4624
4624
|
), i = ae.useCallback(
|
|
4625
4625
|
(o, c) => {
|
|
4626
|
-
s.mutate(o, c).catch(
|
|
4626
|
+
s.mutate(o, c).catch(Hl);
|
|
4627
4627
|
},
|
|
4628
4628
|
[s]
|
|
4629
4629
|
);
|
|
@@ -4631,102 +4631,13 @@ function $e(e, t) {
|
|
|
4631
4631
|
throw r.error;
|
|
4632
4632
|
return { ...r, mutate: i, mutateAsync: r.mutate };
|
|
4633
4633
|
}
|
|
4634
|
-
function
|
|
4634
|
+
function Hl() {
|
|
4635
4635
|
}
|
|
4636
4636
|
function pe() {
|
|
4637
4637
|
return qe().getQueryData(["apiBaseUrl"]) || "/api/chaibuilder";
|
|
4638
4638
|
}
|
|
4639
|
-
const
|
|
4640
|
-
const
|
|
4641
|
-
return $e({
|
|
4642
|
-
mutationFn: async (n) => {
|
|
4643
|
-
const s = await fetch(`${e}/authenticate`, { method: "POST", body: JSON.stringify(n) });
|
|
4644
|
-
if (s.ok)
|
|
4645
|
-
return await s.json();
|
|
4646
|
-
throw new Error("INvalid");
|
|
4647
|
-
},
|
|
4648
|
-
onSuccess: (n) => {
|
|
4649
|
-
if (!n.token) {
|
|
4650
|
-
Ue.error("Something went wrong. Please try again.");
|
|
4651
|
-
return;
|
|
4652
|
-
}
|
|
4653
|
-
localStorage.setItem("__anon_token", n.token), t.invalidateQueries({ queryKey: ["verify"] }), Ue.success("Authenticated successfully.");
|
|
4654
|
-
},
|
|
4655
|
-
onError: () => {
|
|
4656
|
-
Ue.error("Incorrect password. Please try again.");
|
|
4657
|
-
}
|
|
4658
|
-
});
|
|
4659
|
-
}, Hl = () => {
|
|
4660
|
-
const e = pe();
|
|
4661
|
-
return _n({
|
|
4662
|
-
queryKey: ["verify"],
|
|
4663
|
-
queryFn: async () => {
|
|
4664
|
-
const t = localStorage.getItem("__anon_token");
|
|
4665
|
-
if (!t)
|
|
4666
|
-
return { valid: !1 };
|
|
4667
|
-
const n = await fetch(`${e}/verify?token=` + t, { method: "GET" });
|
|
4668
|
-
return n.ok ? (await n.json()).result === "success" ? { valid: !0 } : (localStorage.removeItem("__anon_token"), { valid: !1 }) : (localStorage.removeItem("__anon_token"), { valid: !0 });
|
|
4669
|
-
}
|
|
4670
|
-
});
|
|
4671
|
-
}, Jl = ({ logo: e }) => {
|
|
4672
|
-
const [t, n] = li(""), { mutate: s, isPending: r } = Wl(), i = () => {
|
|
4673
|
-
s({ password: t });
|
|
4674
|
-
};
|
|
4675
|
-
return /* @__PURE__ */ O.jsx("section", { className: "py-10 h-screen bg-gray-50 sm:py-16 lg:py-24", children: /* @__PURE__ */ O.jsxs("div", { className: "px-4 mx-auto max-w-7xl sm:px-6 lg:px-8", children: [
|
|
4676
|
-
/* @__PURE__ */ O.jsxs("div", { className: "max-w-2xl mx-auto text-center", children: [
|
|
4677
|
-
/* @__PURE__ */ O.jsx(Et, { children: e ? Zn.createElement(e) : "" }),
|
|
4678
|
-
/* @__PURE__ */ O.jsx("p", { className: "max-w-xl mx-auto mt-4 text-base leading-relaxed text-gray-600", children: "Enter password to continue" })
|
|
4679
|
-
] }),
|
|
4680
|
-
/* @__PURE__ */ O.jsx("div", { className: "relative max-w-md mx-auto mt-8 md:mt-16", children: /* @__PURE__ */ O.jsx("div", { className: "overflow-hidden bg-white rounded-md shadow-md", children: /* @__PURE__ */ O.jsx("div", { className: "px-4 py-6 sm:px-8 sm:py-7", children: /* @__PURE__ */ O.jsx("div", { children: /* @__PURE__ */ O.jsxs("div", { className: "space-y-5", children: [
|
|
4681
|
-
/* @__PURE__ */ O.jsxs("div", { children: [
|
|
4682
|
-
/* @__PURE__ */ O.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ O.jsx("label", { htmlFor: "pwd", className: "text-base font-medium text-gray-900", children: "Password" }) }),
|
|
4683
|
-
/* @__PURE__ */ O.jsxs("div", { className: "mt-2.5 relative text-gray-400 focus-within:text-gray-600", children: [
|
|
4684
|
-
/* @__PURE__ */ O.jsx("div", { className: "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none", children: /* @__PURE__ */ O.jsx(
|
|
4685
|
-
"svg",
|
|
4686
|
-
{
|
|
4687
|
-
className: "w-5 h-5",
|
|
4688
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4689
|
-
fill: "none",
|
|
4690
|
-
viewBox: "0 0 24 24",
|
|
4691
|
-
stroke: "currentColor",
|
|
4692
|
-
children: /* @__PURE__ */ O.jsx(
|
|
4693
|
-
"path",
|
|
4694
|
-
{
|
|
4695
|
-
strokeLinecap: "round",
|
|
4696
|
-
strokeLinejoin: "round",
|
|
4697
|
-
strokeWidth: "2",
|
|
4698
|
-
d: "M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4"
|
|
4699
|
-
}
|
|
4700
|
-
)
|
|
4701
|
-
}
|
|
4702
|
-
) }),
|
|
4703
|
-
/* @__PURE__ */ O.jsx(
|
|
4704
|
-
"input",
|
|
4705
|
-
{
|
|
4706
|
-
value: t,
|
|
4707
|
-
onChange: (o) => n(o.target.value),
|
|
4708
|
-
type: "password",
|
|
4709
|
-
id: "pwd",
|
|
4710
|
-
placeholder: "Enter password",
|
|
4711
|
-
className: "block w-full py-4 pl-10 pr-4 text-black placeholder-gray-500 transition-all duration-200 bg-white border border-gray-200 rounded-md focus:outline-none focus:border-blue-600 caret-blue-600"
|
|
4712
|
-
}
|
|
4713
|
-
)
|
|
4714
|
-
] })
|
|
4715
|
-
] }),
|
|
4716
|
-
/* @__PURE__ */ O.jsx("div", { children: /* @__PURE__ */ O.jsx(
|
|
4717
|
-
"button",
|
|
4718
|
-
{
|
|
4719
|
-
disabled: r || Le(t) || t.length < 3,
|
|
4720
|
-
onClick: i,
|
|
4721
|
-
type: "button",
|
|
4722
|
-
className: "inline-flex disabled:bg-gray-400 items-center justify-center w-full px-4 py-4 text-base font-semibold text-white transition-all duration-200 bg-blue-600 border border-transparent rounded-md focus:outline-none hover:bg-blue-700 focus:bg-blue-700",
|
|
4723
|
-
children: r ? "Authenticating..." : "Authenticate"
|
|
4724
|
-
}
|
|
4725
|
-
) })
|
|
4726
|
-
] }) }) }) }) })
|
|
4727
|
-
] }) });
|
|
4728
|
-
}, In = () => {
|
|
4729
|
-
const { data: e, refetch: t } = _n({
|
|
4639
|
+
const In = () => {
|
|
4640
|
+
const { data: e, refetch: t } = Cn({
|
|
4730
4641
|
queryKey: ["currentPage"],
|
|
4731
4642
|
queryFn: () => localStorage.getItem("currentPage") || ""
|
|
4732
4643
|
});
|
|
@@ -4738,7 +4649,7 @@ const Wl = () => {
|
|
|
4738
4649
|
];
|
|
4739
4650
|
}, Oo = () => {
|
|
4740
4651
|
const [e, t] = In(), n = pe();
|
|
4741
|
-
return
|
|
4652
|
+
return Cn({
|
|
4742
4653
|
queryKey: ["project"],
|
|
4743
4654
|
queryFn: async () => {
|
|
4744
4655
|
const s = await fetch(`${n}/project`).then((r) => r.json());
|
|
@@ -4749,15 +4660,15 @@ const Wl = () => {
|
|
|
4749
4660
|
return s;
|
|
4750
4661
|
}
|
|
4751
4662
|
});
|
|
4752
|
-
},
|
|
4663
|
+
}, _o = () => {
|
|
4753
4664
|
const e = pe();
|
|
4754
|
-
return
|
|
4665
|
+
return Cn({
|
|
4755
4666
|
queryKey: ["pages"],
|
|
4756
4667
|
queryFn: async () => await fetch(`${e}/pages`).then((n) => n.json()) || []
|
|
4757
4668
|
});
|
|
4758
|
-
},
|
|
4669
|
+
}, Jl = () => {
|
|
4759
4670
|
const [e, t] = In(), { data: n } = Oo(), s = pe();
|
|
4760
|
-
return
|
|
4671
|
+
return Cn({
|
|
4761
4672
|
queryKey: ["page_data", e],
|
|
4762
4673
|
queryFn: async () => {
|
|
4763
4674
|
const r = await fetch(`${s}/page?uuid=${e}`);
|
|
@@ -4766,36 +4677,15 @@ const Wl = () => {
|
|
|
4766
4677
|
enabled: !!e,
|
|
4767
4678
|
staleTime: 3e3
|
|
4768
4679
|
});
|
|
4769
|
-
},
|
|
4770
|
-
/* @__PURE__ */
|
|
4771
|
-
"
|
|
4772
|
-
{
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
children: [
|
|
4779
|
-
/* @__PURE__ */ O.jsx(
|
|
4780
|
-
"path",
|
|
4781
|
-
{
|
|
4782
|
-
d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
|
|
4783
|
-
fill: "currentColor"
|
|
4784
|
-
}
|
|
4785
|
-
),
|
|
4786
|
-
/* @__PURE__ */ O.jsx(
|
|
4787
|
-
"path",
|
|
4788
|
-
{
|
|
4789
|
-
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
4790
|
-
fill: "currentFill"
|
|
4791
|
-
}
|
|
4792
|
-
)
|
|
4793
|
-
]
|
|
4794
|
-
}
|
|
4795
|
-
),
|
|
4796
|
-
/* @__PURE__ */ O.jsx("p", { children: "Loading... Please wait..." }),
|
|
4797
|
-
/* @__PURE__ */ O.jsx("span", { className: "sr-only", children: "Loading..." })
|
|
4798
|
-
] }) }) }), Zl = (e = "Project updated successfully.") => {
|
|
4680
|
+
}, qs = () => /* @__PURE__ */ _.jsx("div", { className: "h-screen w-screen bg-gray-200", children: /* @__PURE__ */ _.jsxs("div", { className: "flex flex-col h-full w-full justify-center items-center", children: [
|
|
4681
|
+
/* @__PURE__ */ _.jsxs("div", { className: "flex flex-row gap-2", children: [
|
|
4682
|
+
/* @__PURE__ */ _.jsx("div", { className: "w-4 h-4 rounded-full bg-orange-600 animate-bounce [animation-delay:.6s]" }),
|
|
4683
|
+
/* @__PURE__ */ _.jsx("div", { className: "w-4 h-4 rounded-full bg-blue-600 animate-bounce [animation-delay:.4s]" }),
|
|
4684
|
+
/* @__PURE__ */ _.jsx("div", { className: "w-4 h-4 rounded-full bg-green-600 animate-bounce [animation-delay:.2s]" }),
|
|
4685
|
+
/* @__PURE__ */ _.jsx("div", { className: "w-4 h-4 rounded-full bg-yellow-600 animate-bounce [animation-delay:.0s]" })
|
|
4686
|
+
] }),
|
|
4687
|
+
/* @__PURE__ */ _.jsx("div", { className: "text-gray-700 font-thin", children: "Loading Builder..." })
|
|
4688
|
+
] }) }), Yl = (e = "Project updated successfully.") => {
|
|
4799
4689
|
const t = qe(), n = pe();
|
|
4800
4690
|
return $e({
|
|
4801
4691
|
mutationFn: async (s) => await fetch(`${n}/project`, {
|
|
@@ -4811,7 +4701,7 @@ const Wl = () => {
|
|
|
4811
4701
|
return (r) => e !== "SAVED" ? (Ue.error("You have unsaved changes. Please save before changing the page."), !1) : t === r.uuid ? !1 : (s(), setTimeout(() => {
|
|
4812
4702
|
n(r.uuid);
|
|
4813
4703
|
}, 100), !0);
|
|
4814
|
-
},
|
|
4704
|
+
}, wf = () => {
|
|
4815
4705
|
const e = qe(), t = Xl(), n = pe();
|
|
4816
4706
|
return $e({
|
|
4817
4707
|
mutationFn: async (s) => fetch(`${n}/pages`, {
|
|
@@ -4822,7 +4712,7 @@ const Wl = () => {
|
|
|
4822
4712
|
e.invalidateQueries({ queryKey: ["pages"] }), t({ uuid: s.uuid, slug: s.slug }), Ue.success("Page added successfully.");
|
|
4823
4713
|
}
|
|
4824
4714
|
});
|
|
4825
|
-
},
|
|
4715
|
+
}, Zl = () => {
|
|
4826
4716
|
const e = pe();
|
|
4827
4717
|
return $e({
|
|
4828
4718
|
mutationFn: async (t) => fetch(`${e}/page`, { method: "PUT", body: JSON.stringify(t) }),
|
|
@@ -4830,8 +4720,8 @@ const Wl = () => {
|
|
|
4830
4720
|
Ue.success("Page saved successfully.");
|
|
4831
4721
|
}
|
|
4832
4722
|
});
|
|
4833
|
-
},
|
|
4834
|
-
const e = pe(), { data: t } =
|
|
4723
|
+
}, ed = () => {
|
|
4724
|
+
const e = pe(), { data: t } = _o(), [n] = In();
|
|
4835
4725
|
return $e({
|
|
4836
4726
|
mutationFn: async () => {
|
|
4837
4727
|
const s = t.find((r) => r.uuid === n).slug;
|
|
@@ -4844,7 +4734,7 @@ const Wl = () => {
|
|
|
4844
4734
|
});
|
|
4845
4735
|
}
|
|
4846
4736
|
});
|
|
4847
|
-
},
|
|
4737
|
+
}, Sf = () => {
|
|
4848
4738
|
const e = qe(), t = pe();
|
|
4849
4739
|
return $e({
|
|
4850
4740
|
mutationFn: async (n) => fetch(`${t}/page`, {
|
|
@@ -4855,18 +4745,18 @@ const Wl = () => {
|
|
|
4855
4745
|
Ue.success("Page deleted successfully."), e.invalidateQueries({ queryKey: ["pages"] });
|
|
4856
4746
|
}
|
|
4857
4747
|
});
|
|
4858
|
-
},
|
|
4748
|
+
}, td = () => {
|
|
4859
4749
|
const e = pe();
|
|
4860
4750
|
return $e({
|
|
4861
4751
|
mutationFn: async () => {
|
|
4862
4752
|
const t = await fetch(`${e}/library`).then((n) => n.json());
|
|
4863
|
-
return
|
|
4753
|
+
return Ps(
|
|
4864
4754
|
te(t, (n) => !es(n, "hidden")),
|
|
4865
4755
|
"group"
|
|
4866
4756
|
);
|
|
4867
4757
|
}
|
|
4868
4758
|
});
|
|
4869
|
-
},
|
|
4759
|
+
}, nd = () => {
|
|
4870
4760
|
const e = pe();
|
|
4871
4761
|
return $e({
|
|
4872
4762
|
mutationFn: async (t) => {
|
|
@@ -4883,7 +4773,7 @@ const Wl = () => {
|
|
|
4883
4773
|
}
|
|
4884
4774
|
}
|
|
4885
4775
|
});
|
|
4886
|
-
},
|
|
4776
|
+
}, sd = () => {
|
|
4887
4777
|
const e = pe();
|
|
4888
4778
|
return $e({
|
|
4889
4779
|
mutationFn: async (t) => {
|
|
@@ -4894,10 +4784,10 @@ const Wl = () => {
|
|
|
4894
4784
|
})).json();
|
|
4895
4785
|
}
|
|
4896
4786
|
});
|
|
4897
|
-
},
|
|
4787
|
+
}, rd = Pt(() => import("./PagesPanel-78e3bbb9.js")), id = Pt(() => import("./ProjectPanel-22ec7598.js")), od = Pt(() => import("./CurrentPage-6ca95592.js")), ad = () => /* @__PURE__ */ _.jsx("h2", { children: "Your Logo" }), cd = () => {
|
|
4898
4788
|
const e = qe();
|
|
4899
|
-
return /* @__PURE__ */
|
|
4900
|
-
|
|
4789
|
+
return /* @__PURE__ */ _.jsx("div", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ _.jsx(
|
|
4790
|
+
oa,
|
|
4901
4791
|
{
|
|
4902
4792
|
className: "w-4 h-4 text-red-500",
|
|
4903
4793
|
onClick: () => {
|
|
@@ -4905,22 +4795,22 @@ const Wl = () => {
|
|
|
4905
4795
|
}
|
|
4906
4796
|
}
|
|
4907
4797
|
) });
|
|
4908
|
-
},
|
|
4909
|
-
const { mutate: e } =
|
|
4910
|
-
return /* @__PURE__ */
|
|
4911
|
-
},
|
|
4912
|
-
const { data: t, isLoading: n } = Oo(), { data: s, isLoading: r } =
|
|
4798
|
+
}, ud = () => {
|
|
4799
|
+
const { mutate: e } = ed();
|
|
4800
|
+
return /* @__PURE__ */ _.jsx(mi, { onClick: e, className: "bg-blue-600 text-white", children: "Publish" });
|
|
4801
|
+
}, ld = (e) => {
|
|
4802
|
+
const { data: t, isLoading: n } = Oo(), { data: s, isLoading: r } = _o(), { data: i } = Jl(), { mutate: o } = Yl(), { mutate: c } = Zl(), [l] = In(), u = sd(), f = td(), p = nd(), P = pe(), g = W(
|
|
4913
4803
|
async (I) => await u.mutateAsync(I),
|
|
4914
4804
|
[u]
|
|
4915
|
-
),
|
|
4805
|
+
), O = W(async () => await f.mutateAsync(), [f]), C = W(
|
|
4916
4806
|
async (I) => await p.mutateAsync(I),
|
|
4917
4807
|
[p]
|
|
4918
4808
|
), y = async (I = 20, B = 0) => {
|
|
4919
4809
|
const b = `limit=${I}&offset=${B}`;
|
|
4920
|
-
return await fetch(`${P}/assets?${b}`).then((
|
|
4921
|
-
}, { logo: A =
|
|
4922
|
-
return n || !t ? /* @__PURE__ */
|
|
4923
|
-
|
|
4810
|
+
return await fetch(`${P}/assets?${b}`).then((k) => k.json());
|
|
4811
|
+
}, { logo: A = ad } = e;
|
|
4812
|
+
return n || !t ? /* @__PURE__ */ _.jsx(qs, {}) : r || !s ? /* @__PURE__ */ _.jsx(qs, {}) : /* @__PURE__ */ _.jsx("div", { className: "bg-background text-foreground", children: /* @__PURE__ */ _.jsx(
|
|
4813
|
+
yl,
|
|
4924
4814
|
{
|
|
4925
4815
|
blocks: (i == null ? void 0 : i.blocks) || [],
|
|
4926
4816
|
brandingOptions: t.brandingOptions,
|
|
@@ -4933,109 +4823,201 @@ const Wl = () => {
|
|
|
4933
4823
|
},
|
|
4934
4824
|
topBarComponents: {
|
|
4935
4825
|
left: [A],
|
|
4936
|
-
center: [
|
|
4937
|
-
right: [
|
|
4826
|
+
center: [od],
|
|
4827
|
+
right: [ud]
|
|
4938
4828
|
},
|
|
4939
4829
|
sideBarComponents: {
|
|
4940
4830
|
top: [
|
|
4941
|
-
{ icon:
|
|
4942
|
-
{ icon:
|
|
4831
|
+
{ icon: na, name: "pages", panel: rd },
|
|
4832
|
+
{ icon: sa, name: "settings", panel: id }
|
|
4943
4833
|
],
|
|
4944
|
-
bottom: [
|
|
4834
|
+
bottom: [cd]
|
|
4945
4835
|
},
|
|
4946
4836
|
uploadMediaCallback: g,
|
|
4947
4837
|
fetchMediaCallback: y,
|
|
4948
|
-
getUILibraryBlocks:
|
|
4949
|
-
getExternalPredefinedBlock:
|
|
4838
|
+
getUILibraryBlocks: O,
|
|
4839
|
+
getExternalPredefinedBlock: C
|
|
4950
4840
|
}
|
|
4951
4841
|
) });
|
|
4952
|
-
},
|
|
4953
|
-
const
|
|
4842
|
+
}, dd = () => {
|
|
4843
|
+
const e = pe(), t = qe();
|
|
4844
|
+
return $e({
|
|
4845
|
+
mutationFn: async (n) => {
|
|
4846
|
+
const s = await fetch(`${e}/authenticate`, { method: "POST", body: JSON.stringify(n) });
|
|
4847
|
+
if (s.ok)
|
|
4848
|
+
return await s.json();
|
|
4849
|
+
throw new Error("INvalid");
|
|
4850
|
+
},
|
|
4851
|
+
onSuccess: (n) => {
|
|
4852
|
+
if (!n.token) {
|
|
4853
|
+
Ue.error("Something went wrong. Please try again.");
|
|
4854
|
+
return;
|
|
4855
|
+
}
|
|
4856
|
+
localStorage.setItem("__anon_token", n.token), t.invalidateQueries({ queryKey: ["verify"] }), Ue.success("Authenticated successfully.");
|
|
4857
|
+
},
|
|
4858
|
+
onError: () => {
|
|
4859
|
+
Ue.error("Incorrect password. Please try again.");
|
|
4860
|
+
}
|
|
4861
|
+
});
|
|
4862
|
+
}, fd = () => {
|
|
4863
|
+
const e = pe();
|
|
4864
|
+
return Cn({
|
|
4865
|
+
queryKey: ["verify"],
|
|
4866
|
+
queryFn: async () => {
|
|
4867
|
+
const t = localStorage.getItem("__anon_token");
|
|
4868
|
+
if (!t)
|
|
4869
|
+
return { valid: !1 };
|
|
4870
|
+
const n = await fetch(`${e}/verify?token=` + t, { method: "GET" });
|
|
4871
|
+
return n.ok ? (await n.json()).result === "success" ? { valid: !0 } : (localStorage.removeItem("__anon_token"), { valid: !1 }) : (localStorage.removeItem("__anon_token"), { valid: !0 });
|
|
4872
|
+
}
|
|
4873
|
+
});
|
|
4874
|
+
}, hd = ({ logo: e }) => {
|
|
4875
|
+
const [t, n] = ws(!1), [s, r] = ws(""), { mutate: i, isPending: o } = dd(), c = () => {
|
|
4876
|
+
i({ password: s });
|
|
4877
|
+
};
|
|
4878
|
+
return /* @__PURE__ */ _.jsx("section", { className: "h-screen w-screen flex items-center justify-center bg-[radial-gradient(#AAA,transparent_0.5px)] duration-300 [background-size:6px_6px]", children: /* @__PURE__ */ _.jsx("div", { className: "overflow-hidden bg-white rounded-xl w-96 drop-shadow-2xl duration-300", children: /* @__PURE__ */ _.jsxs("div", { className: "p-12", children: [
|
|
4879
|
+
/* @__PURE__ */ _.jsxs("div", { className: "max-w-2xl mx-auto text-center", children: [
|
|
4880
|
+
/* @__PURE__ */ _.jsx(Et, { children: e ? Xn.createElement(e) : "" }),
|
|
4881
|
+
/* @__PURE__ */ _.jsx("p", { className: "max-w-xl mx-auto text-base leading-relaxed text-gray-700 font-thin", children: "Enter your app password to continue" })
|
|
4882
|
+
] }),
|
|
4883
|
+
/* @__PURE__ */ _.jsx("div", { className: "mt-8", children: /* @__PURE__ */ _.jsxs("div", { className: "space-y-5", children: [
|
|
4884
|
+
/* @__PURE__ */ _.jsx("div", { children: /* @__PURE__ */ _.jsxs("div", { className: "mt-2.5 relative text-gray-400 focus-within:text-gray-600", children: [
|
|
4885
|
+
/* @__PURE__ */ _.jsx("div", { className: "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none", children: /* @__PURE__ */ _.jsx(
|
|
4886
|
+
"svg",
|
|
4887
|
+
{
|
|
4888
|
+
className: "w-5 h-5",
|
|
4889
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4890
|
+
fill: "none",
|
|
4891
|
+
viewBox: "0 0 24 24",
|
|
4892
|
+
stroke: "currentColor",
|
|
4893
|
+
children: /* @__PURE__ */ _.jsx(
|
|
4894
|
+
"path",
|
|
4895
|
+
{
|
|
4896
|
+
strokeLinecap: "round",
|
|
4897
|
+
strokeLinejoin: "round",
|
|
4898
|
+
strokeWidth: "2",
|
|
4899
|
+
d: "M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4"
|
|
4900
|
+
}
|
|
4901
|
+
)
|
|
4902
|
+
}
|
|
4903
|
+
) }),
|
|
4904
|
+
/* @__PURE__ */ _.jsx(
|
|
4905
|
+
"input",
|
|
4906
|
+
{
|
|
4907
|
+
value: s,
|
|
4908
|
+
onChange: (l) => r(l.target.value),
|
|
4909
|
+
type: t ? "text" : "password",
|
|
4910
|
+
id: "pwd",
|
|
4911
|
+
placeholder: "Enter password",
|
|
4912
|
+
className: "block w-full py-4 px-10 text-black placeholder-gray-500 transition-all duration-200 bg-white border border-gray-200 rounded-md focus:outline-none focus:border-blue-600 caret-blue-600"
|
|
4913
|
+
}
|
|
4914
|
+
),
|
|
4915
|
+
/* @__PURE__ */ _.jsx(
|
|
4916
|
+
"button",
|
|
4917
|
+
{
|
|
4918
|
+
className: "absolute inset-y-0 right-4 flex items-center pl-3 cursor-pointer",
|
|
4919
|
+
onClick: () => n(!t),
|
|
4920
|
+
children: t ? /* @__PURE__ */ _.jsx(ra, {}) : /* @__PURE__ */ _.jsx(ia, {})
|
|
4921
|
+
}
|
|
4922
|
+
)
|
|
4923
|
+
] }) }),
|
|
4924
|
+
/* @__PURE__ */ _.jsx("div", { children: /* @__PURE__ */ _.jsx(
|
|
4925
|
+
"button",
|
|
4926
|
+
{
|
|
4927
|
+
disabled: o || Le(s) || s.length < 3,
|
|
4928
|
+
onClick: c,
|
|
4929
|
+
type: "button",
|
|
4930
|
+
className: "inline-flex disabled:bg-gray-400 items-center justify-center w-full px-4 py-4 text-base font-semibold text-white transition-all duration-200 bg-blue-600 border border-transparent rounded-md focus:outline-none hover:bg-blue-700 focus:bg-blue-700",
|
|
4931
|
+
children: o ? "Authenticating..." : "Authenticate"
|
|
4932
|
+
}
|
|
4933
|
+
) })
|
|
4934
|
+
] }) })
|
|
4935
|
+
] }) }) });
|
|
4936
|
+
}, pd = (e) => {
|
|
4937
|
+
const { data: t, isLoading: n } = fd(), s = qe();
|
|
4954
4938
|
return Ee(() => {
|
|
4955
4939
|
s.setQueryData(["apiBaseUrl"], e.apiBaseUrl || "/api/chaibuilder");
|
|
4956
|
-
}, [e.apiBaseUrl, s]), n ? /* @__PURE__ */
|
|
4957
|
-
},
|
|
4958
|
-
/* @__PURE__ */
|
|
4959
|
-
/* @__PURE__ */
|
|
4960
|
-
] })
|
|
4940
|
+
}, [e.apiBaseUrl, s]), n ? /* @__PURE__ */ _.jsx(qs, {}) : t != null && t.valid ? /* @__PURE__ */ _.jsx(ld, { ...e }) : /* @__PURE__ */ _.jsx(hd, { logo: e.logo });
|
|
4941
|
+
}, md = new Bl(), Pf = (e) => /* @__PURE__ */ _.jsxs(Nl, { client: md, children: [
|
|
4942
|
+
/* @__PURE__ */ _.jsx(aa, { richColors: !0 }),
|
|
4943
|
+
/* @__PURE__ */ _.jsx(pd, { ...e })
|
|
4944
|
+
] });
|
|
4961
4945
|
export {
|
|
4962
4946
|
qe as $,
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4947
|
+
Qd as A,
|
|
4948
|
+
Pc as B,
|
|
4949
|
+
af as C,
|
|
4950
|
+
Hc as D,
|
|
4951
|
+
ya as E,
|
|
4952
|
+
gr as F,
|
|
4953
|
+
mr as G,
|
|
4954
|
+
Kd as H,
|
|
4955
|
+
tf as I,
|
|
4956
|
+
rf as J,
|
|
4957
|
+
sf as K,
|
|
4958
|
+
$d as L,
|
|
4959
|
+
gc as M,
|
|
4960
|
+
_o as N,
|
|
4961
|
+
Yl as O,
|
|
4978
4962
|
Oo as P,
|
|
4979
4963
|
Xl as Q,
|
|
4980
4964
|
In as R,
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
wf as ao,
|
|
5016
|
-
Ka as b,
|
|
4965
|
+
Yd as S,
|
|
4966
|
+
Vd as T,
|
|
4967
|
+
bf as U,
|
|
4968
|
+
qd as V,
|
|
4969
|
+
mf as W,
|
|
4970
|
+
xc as X,
|
|
4971
|
+
Ac as Y,
|
|
4972
|
+
wf as Z,
|
|
4973
|
+
Xd as _,
|
|
4974
|
+
kc as a,
|
|
4975
|
+
Zl as a0,
|
|
4976
|
+
Sf as a1,
|
|
4977
|
+
yl as a2,
|
|
4978
|
+
Gi as a3,
|
|
4979
|
+
uf as a4,
|
|
4980
|
+
cf as a5,
|
|
4981
|
+
ac as a6,
|
|
4982
|
+
dc as a7,
|
|
4983
|
+
Jd as a8,
|
|
4984
|
+
Mi as a9,
|
|
4985
|
+
Zd as aa,
|
|
4986
|
+
ef as ab,
|
|
4987
|
+
hf as ac,
|
|
4988
|
+
nf as ad,
|
|
4989
|
+
Ec as ae,
|
|
4990
|
+
Td as af,
|
|
4991
|
+
of as ag,
|
|
4992
|
+
lf as ah,
|
|
4993
|
+
df as ai,
|
|
4994
|
+
gf as aj,
|
|
4995
|
+
yf as ak,
|
|
4996
|
+
vf as al,
|
|
4997
|
+
Pf as am,
|
|
4998
|
+
Ga as b,
|
|
5017
4999
|
rs as c,
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5000
|
+
Hd as d,
|
|
5001
|
+
Gd as e,
|
|
5002
|
+
ff as f,
|
|
5003
|
+
Wa as g,
|
|
5004
|
+
xt as h,
|
|
5023
5005
|
Oi as i,
|
|
5024
|
-
|
|
5025
|
-
|
|
5006
|
+
pf as j,
|
|
5007
|
+
Wd as k,
|
|
5026
5008
|
$i as l,
|
|
5027
5009
|
Ui as m,
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5010
|
+
_c as n,
|
|
5011
|
+
Dc as o,
|
|
5012
|
+
Ci as p,
|
|
5013
|
+
Lc as q,
|
|
5014
|
+
mc as r,
|
|
5015
|
+
bc as s,
|
|
5016
|
+
Fd as t,
|
|
5017
|
+
zd as u,
|
|
5018
|
+
Ud as v,
|
|
5037
5019
|
Ii as w,
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5020
|
+
Bc as x,
|
|
5021
|
+
ec as y,
|
|
5022
|
+
yc as z
|
|
5041
5023
|
};
|