@chaibuilder/sdk 1.2.76 → 1.2.78

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.
@@ -3,7 +3,7 @@ var gt = (r, n, o) => n in r ? mt(r, n, { enumerable: !0, configurable: !0, writ
3
3
  var ze = (r, n, o) => (gt(r, typeof n != "symbol" ? n + "" : n, o), o);
4
4
  import { j as jsxRuntimeExports } from "./jsx-runtime-Sp0orL4X.js";
5
5
  import * as React from "react";
6
- import React__default, { createContext as createContext$1, useReducer, useEffect as useEffect$1, useDebugValue, useCallback as useCallback$1, useContext as useContext$1, useState as useState$1, Component, Children, Suspense, useMemo as useMemo$1, useRef as useRef$1, memo, createElement as createElement$1, useLayoutEffect as useLayoutEffect$1, forwardRef as forwardRef$1, cloneElement, Fragment, isValidElement, lazy } from "react";
6
+ import React__default, { createContext as createContext$1, useReducer, useEffect as useEffect$1, useDebugValue, useCallback as useCallback$1, useContext as useContext$1, useState as useState$1, Component, Children, Suspense, useMemo as useMemo$1, useRef as useRef$1, memo, createElement as createElement$1, useLayoutEffect as useLayoutEffect$1, forwardRef as forwardRef$1, cloneElement, Fragment, lazy } from "react";
7
7
  import { S as Skeleton, C as ContextMenu, a as ContextMenuTrigger, b as ContextMenuContent, c as ContextMenuItem, T as Tooltip$1, d as TooltipTrigger, e as TooltipContent, B as Button$1, f as Card, g as CardHeader, h as CardDescription, i as CardContent, L as Label, j as Textarea, k as CardFooter, D as Dialog, l as DialogTrigger, m as DialogContent, n as DialogHeader, o as DialogTitle, p as DialogDescription, q as DialogFooter, P as Popover$1, r as PopoverTrigger, s as PopoverContent, t as Command, u as CommandInput, v as CommandList, w as CommandEmpty, x as CommandGroup, y as CommandItem, z as Tabs$1, A as TabsList$1, E as TabsTrigger, F as TabsContent, G as Switch, H as Accordion, I as AccordionItem, J as AccordionTrigger, K as AccordionContent, M as useToast, N as Input$2, O as TooltipPortal, Q as DropdownMenu, R as DropdownMenuTrigger, U as DropdownMenuContent, V as ScrollArea$1, W as DropdownMenuLabel, X as DropdownMenuSeparator, Y as DropdownMenuGroup, Z as DropdownMenuItem, _ as DropdownMenuShortcut, $ as AlertDialog, a0 as AlertDialogTrigger, a1 as AlertDialogContent, a2 as AlertDialogHeader, a3 as AlertDialogTitle, a4 as AlertDialogDescription, a5 as AlertDialogFooter, a6 as AlertDialogCancel, a7 as AlertDialogAction, a8 as DropdownMenuCheckboxItem, a9 as HoverCard, aa as HoverCardTrigger, ab as HoverCardContent, ac as Separator, ad as TooltipProvider, ae as Toaster } from "./context-menu-zu6r7B6f.js";
8
8
  import { has, find, filter, flatten, map, omit, isString as isString$1, includes, without, get as get$1, set, isEmpty, forIn, isObject as isObject$2, each, first, noop as noop$1, keys, startsWith, range, values, flattenDeep, isNull, pick, sortBy, chunk, throttle, memoize as memoize$1, debounce as debounce$1, isEqual, flatMapDeep, forEach, capitalize, last, startCase, truncate, isArray as isArray$5, split, toLower, cloneDeep, reject, nth, isNumber as isNumber$1, parseInt as parseInt$1, isNaN as isNaN$1, findLast, intersection, groupBy, isFunction as isFunction$2, uniq, toUpper, round } from "lodash-es";
9
9
  import { atom as atom$1, useAtomValue as useAtomValue$1, useAtom as useAtom$1, useSetAtom as useSetAtom$1, getDefaultStore as getDefaultStore$1 } from "jotai";
@@ -14,7 +14,7 @@ import { g as getDefaultExportFromCjs, p as plugin, c as commonjsGlobal } from "
14
14
  import { useThrottledCallback, useResizeObserver, useDebouncedCallback, useIntervalEffect } from "@react-hookz/web";
15
15
  import TreeModel from "tree-model";
16
16
  import ReactQuill, { Quill } from "react-quill";
17
- import { S as SLOT_KEY, I as I18N_KEY, a as STYLES_KEY, R as ROOT_TEMP_KEY, O as OUTLINE_KEY } from "./STRINGS-rPGH65PW.js";
17
+ import { S as SLOT_KEY, I as I18N_KEY, a as STYLES_KEY, R as ROOT_TEMP_KEY } from "./STRINGS-TDN5UhWi.js";
18
18
  import { useHotkeys } from "react-hotkeys-hook";
19
19
  import { flip as flip$2 } from "@floating-ui/dom";
20
20
  import { useFloating as useFloating$1, shift, getOverflowAncestors, autoUpdate, size, offset, limitShift, flip as flip$3, inline, arrow } from "@floating-ui/react-dom";
@@ -29,6 +29,7 @@ import { twMerge } from "tailwind-merge";
29
29
  import { Provider } from "react-wrap-balancer";
30
30
  import ReactDOM, { flushSync, createPortal } from "react-dom";
31
31
  import PropTypes from "prop-types";
32
+ import { ErrorBoundary as ErrorBoundary$1 } from "react-error-boundary";
32
33
  import { Resizable } from "re-resizable";
33
34
  import validator from "@rjsf/validator-ajv8";
34
35
  import Form from "@rjsf/core";
@@ -93,35 +94,35 @@ const hasInitialValue = (r) => "init" in r, isActuallyWritableAtom = (r) => !!r.
93
94
  (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && Object.freeze(O);
94
95
  const T = r.get(k);
95
96
  if (r.set(k, O), o.has(k) || o.set(k, T), T && hasPromiseAtomValue(T)) {
96
- const M = "v" in O ? O.v instanceof Promise ? O.v : Promise.resolve(O.v) : Promise.reject(O.e);
97
- cancelPromise(T.v, M);
97
+ const B = "v" in O ? O.v instanceof Promise ? O.v : Promise.resolve(O.v) : Promise.reject(O.e);
98
+ cancelPromise(T.v, B);
98
99
  }
99
100
  }, d = (k, O, T) => {
100
- const M = /* @__PURE__ */ new Map();
101
- let V = !1;
101
+ const B = /* @__PURE__ */ new Map();
102
+ let L = !1;
102
103
  T.forEach((D, W) => {
103
- !D && W === k && (D = O), D ? (M.set(W, D), O.d.get(W) !== D && (V = !0)) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] atom state not found");
104
- }), (V || O.d.size !== M.size) && (O.d = M);
104
+ !D && W === k && (D = O), D ? (B.set(W, D), O.d.get(W) !== D && (L = !0)) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] atom state not found");
105
+ }), (L || O.d.size !== B.size) && (O.d = B);
105
106
  }, m = (k, O, T) => {
106
- const M = c(k), V = {
107
- d: (M == null ? void 0 : M.d) || /* @__PURE__ */ new Map(),
107
+ const B = c(k), L = {
108
+ d: (B == null ? void 0 : B.d) || /* @__PURE__ */ new Map(),
108
109
  v: O
109
110
  };
110
- if (T && d(k, V, T), M && isEqualAtomValue(M, V) && M.d === V.d)
111
- return M;
112
- if (M && hasPromiseAtomValue(M) && hasPromiseAtomValue(V) && isEqualPromiseAtomValue(M, V)) {
113
- if (M.d === V.d)
114
- return M;
115
- V.v = M.v;
111
+ if (T && d(k, L, T), B && isEqualAtomValue(B, L) && B.d === L.d)
112
+ return B;
113
+ if (B && hasPromiseAtomValue(B) && hasPromiseAtomValue(L) && isEqualPromiseAtomValue(B, L)) {
114
+ if (B.d === L.d)
115
+ return B;
116
+ L.v = B.v;
116
117
  }
117
- return u(k, V), V;
118
- }, p = (k, O, T, M) => {
118
+ return u(k, L), L;
119
+ }, p = (k, O, T, B) => {
119
120
  if (isPromiseLike$2(O)) {
120
- let V;
121
+ let L;
121
122
  const D = new Promise((W, J) => {
122
123
  let F = !1;
123
124
  O.then(
124
- (L) => {
125
+ (V) => {
125
126
  if (!F) {
126
127
  F = !0;
127
128
  const q = c(k), G = m(
@@ -129,10 +130,10 @@ const hasInitialValue = (r) => "init" in r, isActuallyWritableAtom = (r) => !!r.
129
130
  D,
130
131
  T
131
132
  );
132
- resolvePromise(D, L), W(L), (q == null ? void 0 : q.d) !== G.d && R(k, G, q == null ? void 0 : q.d);
133
+ resolvePromise(D, V), W(V), (q == null ? void 0 : q.d) !== G.d && R(k, G, q == null ? void 0 : q.d);
133
134
  }
134
135
  },
135
- (L) => {
136
+ (V) => {
136
137
  if (!F) {
137
138
  F = !0;
138
139
  const q = c(k), G = m(
@@ -140,40 +141,40 @@ const hasInitialValue = (r) => "init" in r, isActuallyWritableAtom = (r) => !!r.
140
141
  D,
141
142
  T
142
143
  );
143
- rejectPromise(D, L), J(L), (q == null ? void 0 : q.d) !== G.d && R(k, G, q == null ? void 0 : q.d);
144
+ rejectPromise(D, V), J(V), (q == null ? void 0 : q.d) !== G.d && R(k, G, q == null ? void 0 : q.d);
144
145
  }
145
146
  }
146
- ), V = (L) => {
147
- F || (F = !0, L.then(
147
+ ), L = (V) => {
148
+ F || (F = !0, V.then(
148
149
  (q) => resolvePromise(D, q),
149
150
  (q) => rejectPromise(D, q)
150
- ), W(L));
151
+ ), W(V));
151
152
  };
152
153
  });
153
154
  return D.orig = O, D.status = "pending", registerCancelPromise(D, (W) => {
154
- W && V(W), M == null || M();
155
+ W && L(W), B == null || B();
155
156
  }), m(k, D, T);
156
157
  }
157
158
  return m(k, O, T);
158
159
  }, g = (k, O, T) => {
159
- const M = c(k), V = {
160
- d: (M == null ? void 0 : M.d) || /* @__PURE__ */ new Map(),
160
+ const B = c(k), L = {
161
+ d: (B == null ? void 0 : B.d) || /* @__PURE__ */ new Map(),
161
162
  e: O
162
163
  };
163
- return T && d(k, V, T), M && isEqualAtomError(M, V) && M.d === V.d ? M : (u(k, V), V);
164
+ return T && d(k, L, T), B && isEqualAtomError(B, L) && B.d === L.d ? B : (u(k, L), L);
164
165
  }, h = (k) => {
165
166
  const O = c(k);
166
- if (O && (O.d.forEach((F, L) => {
167
- L !== k && !n.has(L) && h(L);
168
- }), Array.from(O.d).every(([F, L]) => {
167
+ if (O && (O.d.forEach((F, V) => {
168
+ V !== k && !n.has(V) && h(V);
169
+ }), Array.from(O.d).every(([F, V]) => {
169
170
  const q = c(F);
170
- return F === k || q === L || // TODO This is a hack, we should find a better solution.
171
- q && !hasPromiseAtomValue(q) && isEqualAtomValue(q, L);
171
+ return F === k || q === V || // TODO This is a hack, we should find a better solution.
172
+ q && !hasPromiseAtomValue(q) && isEqualAtomValue(q, V);
172
173
  })))
173
174
  return O;
174
175
  const T = /* @__PURE__ */ new Map();
175
- let M = !0;
176
- const V = (F) => {
176
+ let B = !0;
177
+ const L = (F) => {
177
178
  if (F === k) {
178
179
  const q = c(F);
179
180
  if (q)
@@ -182,8 +183,8 @@ const hasInitialValue = (r) => "init" in r, isActuallyWritableAtom = (r) => !!r.
182
183
  return T.set(F, void 0), F.init;
183
184
  throw new Error("no atom init");
184
185
  }
185
- const L = h(F);
186
- return T.set(F, L), returnAtomValue(L);
186
+ const V = h(F);
187
+ return T.set(F, V), returnAtomValue(V);
187
188
  };
188
189
  let D, W;
189
190
  const J = {
@@ -192,13 +193,13 @@ const hasInitialValue = (r) => "init" in r, isActuallyWritableAtom = (r) => !!r.
192
193
  },
193
194
  get setSelf() {
194
195
  return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && !isActuallyWritableAtom(k) && console.warn("setSelf function cannot be used with read-only atom"), !W && isActuallyWritableAtom(k) && (W = (...F) => {
195
- if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && M && console.warn("setSelf function cannot be called in sync"), !M)
196
+ if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && B && console.warn("setSelf function cannot be called in sync"), !B)
196
197
  return A(k, ...F);
197
198
  }), W;
198
199
  }
199
200
  };
200
201
  try {
201
- const F = k.read(V, J);
202
+ const F = k.read(L, J);
202
203
  return p(
203
204
  k,
204
205
  F,
@@ -208,7 +209,7 @@ const hasInitialValue = (r) => "init" in r, isActuallyWritableAtom = (r) => !!r.
208
209
  } catch (F) {
209
210
  return g(k, F, T);
210
211
  } finally {
211
- M = !1;
212
+ B = !1;
212
213
  }
213
214
  }, b = (k) => returnAtomValue(h(k)), x = (k) => {
214
215
  let O = n.get(k);
@@ -217,23 +218,23 @@ const hasInitialValue = (r) => "init" in r, isActuallyWritableAtom = (r) => !!r.
217
218
  const O = n.get(k);
218
219
  O && v(k, O) && C(k);
219
220
  }, E = (k) => {
220
- const O = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new WeakMap(), M = (D) => {
221
+ const O = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new WeakMap(), B = (D) => {
221
222
  const W = n.get(D);
222
223
  W == null || W.t.forEach((J) => {
223
224
  J !== D && (O.set(
224
225
  J,
225
226
  (O.get(J) || /* @__PURE__ */ new Set()).add(D)
226
- ), T.set(J, (T.get(J) || 0) + 1), M(J));
227
+ ), T.set(J, (T.get(J) || 0) + 1), B(J));
227
228
  });
228
229
  };
229
- M(k);
230
- const V = (D) => {
230
+ B(k);
231
+ const L = (D) => {
231
232
  const W = n.get(D);
232
233
  W == null || W.t.forEach((J) => {
233
234
  var F;
234
235
  if (J !== D) {
235
- let L = T.get(J);
236
- if (L && T.set(J, --L), !L) {
236
+ let V = T.get(J);
237
+ if (V && T.set(J, --V), !V) {
237
238
  let q = !!((F = O.get(J)) != null && F.size);
238
239
  if (q) {
239
240
  const G = c(J), ee = h(J);
@@ -241,85 +242,85 @@ const hasInitialValue = (r) => "init" in r, isActuallyWritableAtom = (r) => !!r.
241
242
  }
242
243
  q || O.forEach((G) => G.delete(J));
243
244
  }
244
- V(J);
245
+ L(J);
245
246
  }
246
247
  });
247
248
  };
248
- V(k);
249
+ L(k);
249
250
  }, w = (k, ...O) => {
250
251
  let T = !0;
251
- const M = (W) => returnAtomValue(h(W)), V = (W, ...J) => {
252
+ const B = (W) => returnAtomValue(h(W)), L = (W, ...J) => {
252
253
  let F;
253
254
  if (W === k) {
254
255
  if (!hasInitialValue(W))
255
256
  throw new Error("atom not writable");
256
- const L = c(W), q = p(W, J[0]);
257
- (!L || !isEqualAtomValue(L, q)) && E(W);
257
+ const V = c(W), q = p(W, J[0]);
258
+ (!V || !isEqualAtomValue(V, q)) && E(W);
258
259
  } else
259
260
  F = w(W, ...J);
260
261
  if (!T) {
261
- const L = I();
262
+ const V = I();
262
263
  (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.forEach(
263
- (q) => q({ type: "async-write", flushed: L })
264
+ (q) => q({ type: "async-write", flushed: V })
264
265
  );
265
266
  }
266
267
  return F;
267
- }, D = k.write(M, V, ...O);
268
+ }, D = k.write(B, L, ...O);
268
269
  return T = !1, D;
269
270
  }, A = (k, ...O) => {
270
- const T = w(k, ...O), M = I();
271
+ const T = w(k, ...O), B = I();
271
272
  return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && i.forEach(
272
- (V) => V({ type: "write", flushed: M })
273
+ (L) => L({ type: "write", flushed: B })
273
274
  ), T;
274
275
  }, P = (k, O) => {
275
276
  const T = {
276
277
  t: new Set(O && [O]),
277
278
  l: /* @__PURE__ */ new Set()
278
279
  };
279
- if (n.set(k, T), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && l.add(k), h(k).d.forEach((M, V) => {
280
- const D = n.get(V);
281
- D ? D.t.add(k) : V !== k && P(V, k);
280
+ if (n.set(k, T), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && l.add(k), h(k).d.forEach((B, L) => {
281
+ const D = n.get(L);
282
+ D ? D.t.add(k) : L !== k && P(L, k);
282
283
  }), h(k), isActuallyWritableAtom(k) && k.onMount) {
283
- const M = k.onMount((...V) => A(k, ...V));
284
- M && (T.u = M);
284
+ const B = k.onMount((...L) => A(k, ...L));
285
+ B && (T.u = B);
285
286
  }
286
287
  return T;
287
288
  }, C = (k) => {
288
289
  var O;
289
290
  const T = (O = n.get(k)) == null ? void 0 : O.u;
290
291
  T && T(), n.delete(k), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && l.delete(k);
291
- const M = c(k);
292
- M ? (hasPromiseAtomValue(M) && cancelPromise(M.v), M.d.forEach((V, D) => {
292
+ const B = c(k);
293
+ B ? (hasPromiseAtomValue(B) && cancelPromise(B.v), B.d.forEach((L, D) => {
293
294
  if (D !== k) {
294
295
  const W = n.get(D);
295
296
  W && (W.t.delete(k), v(D, W) && C(D));
296
297
  }
297
298
  })) : (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] could not find atom state to unmount", k);
298
299
  }, R = (k, O, T) => {
299
- const M = new Set(O.d.keys());
300
- T == null || T.forEach((V, D) => {
301
- if (M.has(D)) {
302
- M.delete(D);
300
+ const B = new Set(O.d.keys());
301
+ T == null || T.forEach((L, D) => {
302
+ if (B.has(D)) {
303
+ B.delete(D);
303
304
  return;
304
305
  }
305
306
  const W = n.get(D);
306
307
  W && (W.t.delete(k), v(D, W) && C(D));
307
- }), M.forEach((V) => {
308
- const D = n.get(V);
309
- D ? D.t.add(k) : n.has(k) && P(V, k);
308
+ }), B.forEach((L) => {
309
+ const D = n.get(L);
310
+ D ? D.t.add(k) : n.has(k) && P(L, k);
310
311
  });
311
312
  }, I = () => {
312
313
  let k;
313
314
  for ((define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (k = /* @__PURE__ */ new Set()); o.size; ) {
314
315
  const O = Array.from(o);
315
- o.clear(), O.forEach(([T, M]) => {
316
- const V = c(T);
317
- if (V) {
318
- V.d !== (M == null ? void 0 : M.d) && R(T, V, M == null ? void 0 : M.d);
316
+ o.clear(), O.forEach(([T, B]) => {
317
+ const L = c(T);
318
+ if (L) {
319
+ L.d !== (B == null ? void 0 : B.d) && R(T, L, B == null ? void 0 : B.d);
319
320
  const D = n.get(T);
320
321
  D && !// TODO This seems pretty hacky. Hope to fix it.
321
322
  // Maybe we could `mountDependencies` in `setAtomState`?
322
- (M && !hasPromiseAtomValue(M) && (isEqualAtomValue(M, V) || isEqualAtomError(M, V))) && (D.l.forEach((W) => W()), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && k.add(T));
323
+ (B && !hasPromiseAtomValue(B) && (isEqualAtomValue(B, L) || isEqualAtomError(B, L))) && (D.l.forEach((W) => W()), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && k.add(T));
323
324
  } else
324
325
  (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && console.warn("[Bug] no atom state to flush");
325
326
  });
@@ -327,11 +328,11 @@ const hasInitialValue = (r) => "init" in r, isActuallyWritableAtom = (r) => !!r.
327
328
  if ((define_import_meta_env_default$2 ? "production" : void 0) !== "production")
328
329
  return a.forEach((O) => O("state")), k;
329
330
  }, j = (k, O) => {
330
- const T = x(k), M = I(), V = T.l;
331
- return V.add(O), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((D) => D("sub")), i.forEach(
332
- (D) => D({ type: "sub", flushed: M })
331
+ const T = x(k), B = I(), L = T.l;
332
+ return L.add(O), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((D) => D("sub")), i.forEach(
333
+ (D) => D({ type: "sub", flushed: B })
333
334
  )), () => {
334
- V.delete(O), S(k), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((D) => D("unsub")), i.forEach((D) => D({ type: "unsub" })));
335
+ L.delete(O), S(k), (define_import_meta_env_default$2 ? "production" : void 0) !== "production" && (a.forEach((D) => D("unsub")), i.forEach((D) => D({ type: "unsub" })));
335
336
  };
336
337
  };
337
338
  return (define_import_meta_env_default$2 ? "production" : void 0) !== "production" ? {
@@ -350,8 +351,8 @@ const hasInitialValue = (r) => "init" in r, isActuallyWritableAtom = (r) => !!r.
350
351
  dev_get_atom_state: (k) => r.get(k),
351
352
  dev_get_mounted: (k) => n.get(k),
352
353
  dev_restore_atoms: (k) => {
353
- for (const [T, M] of k)
354
- hasInitialValue(T) && (p(T, M), E(T));
354
+ for (const [T, B] of k)
355
+ hasInitialValue(T) && (p(T, B), E(T));
355
356
  const O = I();
356
357
  i.forEach(
357
358
  (T) => T({ type: "restore", flushed: O })
@@ -3170,8 +3171,10 @@ const useHandleCanvasDblClick = () => {
3170
3171
  }, KeyboardHandler = () => {
3171
3172
  const { document: r } = useFrame();
3172
3173
  return useKeyEventWatcher(r), null;
3173
- }, useAddBlocksModal = () => useAtom(addBlockModalOpenAtom), { useChaiBuilderMsgListener, emitChaiBuilderMsg } = createEvent("chaiBuilderMsg")(), BUILDER_EVENTS = {
3174
- SHOW_SETTINGS: "SHOW_SETTINGS"
3174
+ }, { useChaiBuilderMsgListener, emitChaiBuilderMsg } = createEvent("chaiBuilderMsg")(), CHAI_BUILDER_EVENTS = {
3175
+ OPEN_ADD_BLOCK: "OPEN_ADD_BLOCK",
3176
+ CLOSE_ADD_BLOCK: "CLOSE_ADD_BLOCK",
3177
+ SHOW_BLOCK_SETTINGS: "SHOW_BLOCK_SETTINGS"
3175
3178
  }, BlockActionLabel = ({ block: r, label: n }) => {
3176
3179
  const [, o] = useSelectedBlockIds(), [, a] = useHighlightBlockId(), [, i] = useAtom$1(draggedBlockAtom), l = useFeature("dnd");
3177
3180
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -3191,49 +3194,55 @@ const useHandleCanvasDblClick = () => {
3191
3194
  }
3192
3195
  );
3193
3196
  }, BlockActionsStatic = ({ selectedBlockElement: r, block: n }) => {
3194
- const o = useRemoveBlocks(), a = useDuplicateBlocks(), [, i] = useSelectedBlockIds(), [, l] = useHighlightBlockId(), [, c] = useAddBlocksModal(), [, u] = useSelectedStylingBlocks(), [d] = useAtom$1(inlineEditingActiveAtom), { floatingStyles: m, refs: p, update: g } = useFloating$1({
3197
+ const o = useRemoveBlocks(), a = useDuplicateBlocks(), [, i] = useSelectedBlockIds(), [, l] = useHighlightBlockId(), [, c] = useSelectedStylingBlocks(), [u] = useAtom$1(inlineEditingActiveAtom), { floatingStyles: d, refs: m, update: p } = useFloating$1({
3195
3198
  placement: "top-start",
3196
3199
  middleware: [shift(), flip$2()],
3197
3200
  elements: {
3198
3201
  reference: r
3199
3202
  }
3200
3203
  });
3201
- useResizeObserver(r, () => g(), r !== null);
3202
- const h = get$1(n, "_parent", null), b = isEmpty(get$1(n, "_name", "")) ? get$1(n, "_type", "") : get$1(n, "_name", "");
3203
- return !r || !n || d ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
3204
+ useResizeObserver(r, () => p(), r !== null);
3205
+ const g = get$1(n, "_parent", null), h = isEmpty(get$1(n, "_name", "")) ? get$1(n, "_type", "") : get$1(n, "_name", "");
3206
+ return !r || !n || u ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
3204
3207
  "div",
3205
3208
  {
3206
3209
  role: "button",
3207
3210
  tabIndex: 0,
3208
- ref: p.setFloating,
3209
- style: m,
3210
- onClick: (x) => {
3211
- x.stopPropagation(), x.preventDefault();
3211
+ ref: m.setFloating,
3212
+ style: d,
3213
+ onClick: (b) => {
3214
+ b.stopPropagation(), b.preventDefault();
3212
3215
  },
3213
- onMouseEnter: (x) => {
3214
- x.stopPropagation(), l(null);
3216
+ onMouseEnter: (b) => {
3217
+ b.stopPropagation(), l(null);
3215
3218
  },
3216
- onKeyDown: (x) => x.stopPropagation(),
3219
+ onKeyDown: (b) => b.stopPropagation(),
3217
3220
  className: "isolate z-10 flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
3218
3221
  children: [
3219
- h && /* @__PURE__ */ jsxRuntimeExports.jsx(
3222
+ g && /* @__PURE__ */ jsxRuntimeExports.jsx(
3220
3223
  ArrowUpIcon,
3221
3224
  {
3222
3225
  className: "hover:scale-105",
3223
3226
  onClick: () => {
3224
- u([]), i([h]);
3227
+ c([]), i([g]);
3225
3228
  }
3226
3229
  }
3227
3230
  ),
3228
- /* @__PURE__ */ jsxRuntimeExports.jsx(BlockActionLabel, { label: b, block: n }),
3231
+ /* @__PURE__ */ jsxRuntimeExports.jsx(BlockActionLabel, { label: h, block: n }),
3229
3232
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 px-1", children: [
3230
- canAddChildBlock(get$1(n, "_type", "")) && /* @__PURE__ */ jsxRuntimeExports.jsx(PlusIcon, { className: "hover:scale-105", onClick: () => c(n == null ? void 0 : n._id) }),
3233
+ canAddChildBlock(get$1(n, "_type", "")) && /* @__PURE__ */ jsxRuntimeExports.jsx(
3234
+ PlusIcon,
3235
+ {
3236
+ className: "hover:scale-105",
3237
+ onClick: () => emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK, data: n })
3238
+ }
3239
+ ),
3231
3240
  canDuplicateBlock(get$1(n, "_type", "")) ? /* @__PURE__ */ jsxRuntimeExports.jsx(CopyIcon$1, { className: "hover:scale-105", onClick: () => a([n == null ? void 0 : n._id]) }) : null,
3232
3241
  /* @__PURE__ */ jsxRuntimeExports.jsx(
3233
3242
  GearIcon,
3234
3243
  {
3235
3244
  className: "text-white hover:scale-105",
3236
- onClick: () => emitChaiBuilderMsg({ name: BUILDER_EVENTS.SHOW_SETTINGS })
3245
+ onClick: () => emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.SHOW_BLOCK_SETTINGS, data: n })
3237
3246
  }
3238
3247
  ),
3239
3248
  canDeleteBlock(get$1(n, "_type", "")) ? /* @__PURE__ */ jsxRuntimeExports.jsx(TrashIcon, { className: "hover:scale-105", onClick: () => o([n == null ? void 0 : n._id]) }) : null
@@ -3457,15 +3466,15 @@ const useAllDataProviders = () => useMemo$1(() => getChaiDataProviders(), []), B
3457
3466
  const [r] = useBlocksStore(), n = isEmpty(r) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksExternalDataProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksRendererStatic, { blocks: filter(r, (o) => isEmpty(o._parent)) }) });
3458
3467
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: n });
3459
3468
  }, AddBlockAtBottom = () => {
3460
- const [, r] = useAddBlocksModal(), { t: n } = useTranslation();
3469
+ const { t: r } = useTranslation();
3461
3470
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
3462
3471
  "button",
3463
3472
  {
3464
- onClick: () => r(ROOT_TEMP_KEY),
3473
+ onClick: () => emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK }),
3465
3474
  className: "mt-1 block w-full rounded-md bg-gray-100 p-2 text-black hover:bg-gray-200 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-700",
3466
3475
  children: [
3467
3476
  "+ ",
3468
- n("add_block")
3477
+ r("add_block")
3469
3478
  ]
3470
3479
  }
3471
3480
  );
@@ -3566,29 +3575,13 @@ const useAllDataProviders = () => useMemo$1(() => getChaiDataProviders(), []), B
3566
3575
  )
3567
3576
  }
3568
3577
  ) });
3569
- }, StaticCanvas$1 = StaticCanvas;
3570
- let ErrorBoundary$2 = class extends React__default.Component {
3571
- constructor(n) {
3572
- super(n), this.state = { hasError: !1 };
3573
- }
3574
- /**
3575
- * A static method that returns an object to update the state when an error is caught.
3576
- * @returns {object} An object to update the state when an error is caught.
3577
- */
3578
- static getDerivedStateFromError() {
3579
- return { hasError: !0 };
3580
- }
3581
- render() {
3582
- return this.state.hasError ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "h-full w-full rounded-md bg-red-200 p-4 text-red-500", id: "errorBoundary", children: [
3583
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold", children: "Oops! Something went wrong." }),
3584
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Please try again later." })
3585
- ] }) : this.props.children;
3586
- }
3587
- };
3588
- const CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-QaDlSeLr.js")), CanvasArea = () => {
3589
- const [r] = useCodeEditor();
3578
+ }, StaticCanvas$1 = StaticCanvas, FallbackError = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full w-full rounded-md bg-red-200 p-4 text-red-500", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full w-full flex-col items-center justify-center", children: [
3579
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold", children: "Oops! Something went wrong." }),
3580
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Please try again." })
3581
+ ] }) }), CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-GsTOzMVg.js")), CanvasArea = () => {
3582
+ const [r] = useCodeEditor(), n = useBuilderProp("onError", noop$1);
3590
3583
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full w-full flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex h-full flex-col overflow-hidden bg-gray-100/40 px-2", children: [
3591
- /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(StaticCanvas$1, {}) }) }),
3584
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$1, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsxRuntimeExports.jsx(StaticCanvas$1, {}) }) }),
3592
3585
  r ? /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Resizable, { enable: { top: !0, bottom: !1 }, className: "max-h-[400px] min-h-[200px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CodeEditor$1, {}) }) }) : null
3593
3586
  ] }) });
3594
3587
  }, CanvasArea$1 = CanvasArea, ColorField = ({ value: r, onChange: n, id: o, onBlur: a }) => {
@@ -3887,7 +3880,7 @@ const CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-QaDlSeLr.js"
3887
3880
  }
3888
3881
  );
3889
3882
  }, BlockContextMenuContent = () => {
3890
- const { t: r } = useTranslation(), [n] = useSelectedBlockIds(), o = useDuplicateBlocks(), a = useSelectedBlock(), [, i] = useAddBlocksModal(), l = useCallback$1(() => {
3883
+ const { t: r } = useTranslation(), [n] = useSelectedBlockIds(), o = useDuplicateBlocks(), a = useSelectedBlock(), i = useCallback$1(() => {
3891
3884
  o(n);
3892
3885
  }, [n, o]);
3893
3886
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(ContextMenuContent, { className: "text-xs", children: [
@@ -3896,7 +3889,7 @@ const CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-QaDlSeLr.js"
3896
3889
  {
3897
3890
  disabled: !canAddChildBlock(a == null ? void 0 : a._type),
3898
3891
  className: "flex items-center gap-x-4 text-xs",
3899
- onClick: () => i(a == null ? void 0 : a._id),
3892
+ onClick: () => emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK, data: a }),
3900
3893
  children: [
3901
3894
  /* @__PURE__ */ jsxRuntimeExports.jsx(PlusIcon$1, { size: "14" }),
3902
3895
  " ",
@@ -3909,7 +3902,7 @@ const CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-QaDlSeLr.js"
3909
3902
  {
3910
3903
  disabled: !canDuplicateBlock(a == null ? void 0 : a._type),
3911
3904
  className: "flex items-center gap-x-4 text-xs",
3912
- onClick: l,
3905
+ onClick: i,
3913
3906
  children: [
3914
3907
  /* @__PURE__ */ jsxRuntimeExports.jsx(CardStackPlusIcon, {}),
3915
3908
  " ",
@@ -3968,7 +3961,7 @@ function BsLightningFill(r) {
3968
3961
  function TbEyeDown(r) {
3969
3962
  return GenIcon({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M12 18c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6" }, child: [] }, { tag: "path", attr: { d: "M19 16v6" }, child: [] }, { tag: "path", attr: { d: "M22 19l-3 3l-3 -3" }, child: [] }] })(r);
3970
3963
  }
3971
- const Node = memo(({ node: r, style: n, dragHandle: o }) => {
3964
+ const useAddBlocksModal = () => useAtom(addBlockModalOpenAtom), Node = memo(({ node: r, style: n, dragHandle: o }) => {
3972
3965
  const a = useBuilderProp("outlineMenuItems", []), [, i] = useAddBlocksModal(), { t: l } = useTranslation(), [c] = useAtom$1(canvasIframeAtom);
3973
3966
  let u = null;
3974
3967
  const d = r.children.length > 0, { id: m, data: p, isSelected: g, willReceiveDrop: h, isDragging: b, isEditing: x, handleClick: v } = r, S = (R) => {
@@ -4003,7 +3996,7 @@ const Node = memo(({ node: r, style: n, dragHandle: o }) => {
4003
3996
  return m === ROOT_TEMP_KEY ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
4004
3997
  "button",
4005
3998
  {
4006
- onClick: () => i(ROOT_TEMP_KEY),
3999
+ onClick: () => emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK }),
4007
4000
  className: "mb-10 mt-5 w-full rounded bg-gray-100 p-1 hover:bg-gray-200",
4008
4001
  children: [
4009
4002
  "+ ",
@@ -4117,7 +4110,7 @@ const Node = memo(({ node: r, style: n, dragHandle: o }) => {
4117
4110
  return canAcceptChildBlock(a, i);
4118
4111
  };
4119
4112
  }, ListTree = () => {
4120
- const [treeData] = useAtom$1(treeDSBlocks), [ids, setIds] = useSelectedBlockIds(), [cutBlocksIds] = useCutBlockIds(), updateBlockProps = useUpdateBlocksProps(), [, setStyleBlocks] = useSelectedStylingBlocks(), { moveBlocks } = useBlocksStoreUndoableActions(), canMove = useCanMove(), treeRef = useRef$1(null), [, setTreeRef] = useAtom$1(treeRefAtom), { t } = useTranslation(), [, setOpen] = useAddBlocksModal(), clearSelection = () => {
4113
+ const [treeData] = useAtom$1(treeDSBlocks), [ids, setIds] = useSelectedBlockIds(), [cutBlocksIds] = useCutBlockIds(), updateBlockProps = useUpdateBlocksProps(), [, setStyleBlocks] = useSelectedStylingBlocks(), { moveBlocks } = useBlocksStoreUndoableActions(), canMove = useCanMove(), treeRef = useRef$1(null), [, setTreeRef] = useAtom$1(treeRefAtom), { t } = useTranslation(), clearSelection = () => {
4121
4114
  setIds([]), setStyleBlocks([]);
4122
4115
  }, filteredTreeData = useMemo$1(() => {
4123
4116
  const r = (o, a) => o.filter((i) => !a.includes(i._id)).map((i) => ({
@@ -4187,7 +4180,18 @@ const Node = memo(({ node: r, style: n, dragHandle: o }) => {
4187
4180
  t("page_is_empty"),
4188
4181
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
4189
4182
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
4190
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { onClick: () => setOpen(ROOT_TEMP_KEY), variant: "default", size: "sm", children: t("add_block") })
4183
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
4184
+ Button$1,
4185
+ {
4186
+ onClick: () => emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK }),
4187
+ variant: "default",
4188
+ size: "sm",
4189
+ children: [
4190
+ "+ ",
4191
+ t("add_block")
4192
+ ]
4193
+ }
4194
+ )
4191
4195
  ] }) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("flex h-full select-none flex-col space-y-1"), onClick: () => clearSelection(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4192
4196
  "div",
4193
4197
  {
@@ -4405,30 +4409,30 @@ const Node = memo(({ node: r, style: n, dragHandle: o }) => {
4405
4409
  }, getBlocksFromHTML = (r) => {
4406
4410
  const n = parse$1(getSanitizedHTML(r));
4407
4411
  return isEmpty(r) ? [] : flatten(traverseNodes(n));
4408
- }, ImportHTML = () => {
4409
- const { t: r } = useTranslation(), [n, o] = useState$1(""), { addPredefinedBlock: a } = useAddBlock(), [i] = useSelectedBlockIds(), [, l] = useAtom$1(activePanelAtom$1), [, c] = useAddBlocksModal(), u = () => {
4410
- const d = getBlocksFromHTML(n);
4411
- a([...d], first(i) || null), o(""), c(""), l(OUTLINE_KEY);
4412
+ }, ImportHTML = ({ parentId: r }) => {
4413
+ const { t: n } = useTranslation(), [o, a] = useState$1(""), { addPredefinedBlock: i } = useAddBlock(), l = () => {
4414
+ const c = getBlocksFromHTML(o);
4415
+ i([...c], r), a(""), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
4412
4416
  };
4413
4417
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: "border-border/0 p-0 shadow-none", children: [
4414
- /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { className: "p-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardDescription, { children: r("html_snippet_description") }) }),
4418
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { className: "p-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardDescription, { children: n("html_snippet_description") }) }),
4415
4419
  /* @__PURE__ */ jsxRuntimeExports.jsx(CardContent, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1", children: [
4416
- /* @__PURE__ */ jsxRuntimeExports.jsx(Label, { htmlFor: "current", className: "text-sm", children: r("tailwind_html_snippet") }),
4420
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label, { htmlFor: "current", className: "text-sm", children: n("tailwind_html_snippet") }),
4417
4421
  /* @__PURE__ */ jsxRuntimeExports.jsx(
4418
4422
  Textarea,
4419
4423
  {
4420
4424
  autoFocus: !0,
4421
4425
  tabIndex: 1,
4422
- ref: (d) => d && d.focus(),
4423
- onChange: (d) => o(d.target.value),
4426
+ ref: (c) => c && c.focus(),
4427
+ onChange: (c) => a(c.target.value),
4424
4428
  rows: 12,
4425
- value: n,
4426
- placeholder: r("enter_code_snippet"),
4429
+ value: o,
4430
+ placeholder: n("enter_code_snippet"),
4427
4431
  className: "resize-none overflow-x-auto whitespace-pre bg-gray-100 font-mono text-xs font-normal"
4428
4432
  }
4429
4433
  )
4430
4434
  ] }) }),
4431
- /* @__PURE__ */ jsxRuntimeExports.jsx(CardFooter, { className: "flex flex-col justify-end p-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { disabled: n.trim() === "", onClick: () => u(), size: "sm", className: "w-full", children: r("import_html") }) })
4435
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardFooter, { className: "flex flex-col justify-end p-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { disabled: o.trim() === "", onClick: () => l(), size: "sm", className: "w-full", children: n("import_html") }) })
4432
4436
  ] });
4433
4437
  }, ImportHTML$1 = ImportHTML, isBoolean = (r) => typeof r == "boolean" || r instanceof Boolean, isNumber = (r) => typeof r == "number" || r instanceof Number, isBigInt = (r) => typeof r == "bigint" || r instanceof BigInt, isDate = (r) => !!r && r instanceof Date, isString = (r) => typeof r == "string" || r instanceof String, isArray$4 = (r) => Array.isArray(r), isObject$1 = (r) => r instanceof Object && r !== null;
4434
4438
  function useBool(r) {
@@ -4623,12 +4627,13 @@ function getPathAndTypes(r) {
4623
4627
  return a("", omit(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: n, pathsType: o };
4624
4628
  }
4625
4629
  const ViewData = ({ data: r, fullView: n }) => {
4630
+ const o = useBuilderProp("onError", noop$1);
4626
4631
  if (!r)
4627
4632
  return null;
4628
- const o = typeof r;
4633
+ const a = typeof r;
4629
4634
  return n ? typeof r == "object" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
4630
4635
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-3" }),
4631
- /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4636
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$1, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(FallbackError, {}), onError: o, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4632
4637
  JsonView,
4633
4638
  {
4634
4639
  data: r,
@@ -4644,7 +4649,7 @@ const ViewData = ({ data: r, fullView: n }) => {
4644
4649
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50", children: [
4645
4650
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
4646
4651
  r
4647
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: truncate(o === "object" ? JSON.stringify(r) : r, { length: 40 }) });
4652
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50", children: truncate(a === "object" ? JSON.stringify(r) : r, { length: 40 }) });
4648
4653
  }, DataProvidersSuggester = ({
4649
4654
  type: r,
4650
4655
  value: n = "",
@@ -4970,7 +4975,7 @@ const ViewData = ({ data: r, fullView: n }) => {
4970
4975
  }
4971
4976
  )
4972
4977
  ] });
4973
- }, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-fsj0Hn0B.js")), UploadImages = React__default.lazy(() => import("./UploadImages-lDHrM-Jw.js")), ImagesPanel = ({
4978
+ }, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-SUnc-2ZG.js")), UploadImages = React__default.lazy(() => import("./UploadImages-iewW_N13.js")), ImagesPanel = ({
4974
4979
  isModalView: r = !1,
4975
4980
  onSelect: n = () => {
4976
4981
  }
@@ -5325,7 +5330,7 @@ function FaRecycle(r) {
5325
5330
  function FaSpinner(r) {
5326
5331
  return GenIcon({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z" }, child: [] }] })(r);
5327
5332
  }
5328
- const SECONDS = 4;
5333
+ const SECONDS = 10;
5329
5334
  function Countdown() {
5330
5335
  const [r, n] = useState$1(SECONDS), [o, a] = useState$1(!1);
5331
5336
  useEffect$1(() => {
@@ -5378,14 +5383,14 @@ function Countdown() {
5378
5383
  ] });
5379
5384
  }
5380
5385
  const AskAIStyles = ({ blockId: r }) => {
5381
- const { t: n } = useTranslation(), { askAi: o, loading: a, error: i } = useAskAi(), [l, c] = useState$1(""), u = useRef$1(null), [d, m] = useState$1();
5386
+ const { t: n } = useTranslation(), { askAi: o, loading: a, error: i } = useAskAi(), [l, c] = useState$1(""), u = useRef$1(null), d = useRef$1(null), [m, p] = useState$1();
5382
5387
  useEffect$1(() => {
5383
- var g;
5384
- (g = u.current) == null || g.focus();
5388
+ var h;
5389
+ (h = u.current) == null || h.focus();
5385
5390
  }, []);
5386
- const p = (g) => {
5387
- const { usage: h } = g || {};
5388
- !i && h && m(h), setTimeout(() => m(void 0), 4e3), i || c("");
5391
+ const g = (h) => {
5392
+ const { usage: b } = h || {};
5393
+ !i && b && p(b), d.current = setTimeout(() => p(void 0), 1e4), i || c("");
5389
5394
  };
5390
5395
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "", children: [
5391
5396
  /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "mb-1 text-sm font-semibold leading-none tracking-tight", children: n("ask_ai") }),
@@ -5394,12 +5399,12 @@ const AskAIStyles = ({ blockId: r }) => {
5394
5399
  {
5395
5400
  ref: u,
5396
5401
  value: l,
5397
- onChange: (g) => c(g.target.value),
5402
+ onChange: (h) => c(h.target.value),
5398
5403
  placeholder: n("ask_ai_to_edit_styles"),
5399
5404
  className: "w-full border border-gray-400 focus:border-0",
5400
5405
  rows: 3,
5401
- onKeyDown: (g) => {
5402
- g.key === "Enter" && (g.preventDefault(), o("styles", r, l, p));
5406
+ onKeyDown: (h) => {
5407
+ h.key === "Enter" && (h.preventDefault(), d.current && clearTimeout(d.current), p(void 0), o("styles", r, l, g));
5403
5408
  }
5404
5409
  }
5405
5410
  ),
@@ -5409,7 +5414,7 @@ const AskAIStyles = ({ blockId: r }) => {
5409
5414
  {
5410
5415
  disabled: l.trim().length < 5 || a,
5411
5416
  onClick: () => {
5412
- m(void 0), o("styles", r, l, p);
5417
+ d.current && clearTimeout(d.current), p(void 0), o("styles", r, l, g);
5413
5418
  },
5414
5419
  variant: "default",
5415
5420
  className: "w-fit",
@@ -5428,11 +5433,11 @@ const AskAIStyles = ({ blockId: r }) => {
5428
5433
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: n("stop") })
5429
5434
  ] }) : null
5430
5435
  ] }),
5431
- d ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mb-1 flex justify-between break-words rounded border border-blue-500 bg-blue-100 p-1 text-xs text-blue-500", children: [
5436
+ m ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mb-1 flex justify-between break-words rounded border border-blue-500 bg-blue-100 p-1 text-xs text-blue-500", children: [
5432
5437
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
5433
5438
  n("Total tokens used"),
5434
5439
  ": ",
5435
- d.totalTokens
5440
+ m.totalTokens
5436
5441
  ] }),
5437
5442
  /* @__PURE__ */ jsxRuntimeExports.jsx(Countdown, {})
5438
5443
  ] }) }) : null,
@@ -5454,9 +5459,9 @@ function ManualClasses() {
5454
5459
  let k = [];
5455
5460
  if (j && j.length > 0) {
5456
5461
  const [O] = j, T = I.replace(O, "");
5457
- k = fuse.search(T).map((V) => ({
5458
- ...V,
5459
- item: { ...V.item, name: O + V.item.name }
5462
+ k = fuse.search(T).map((L) => ({
5463
+ ...L,
5464
+ item: { ...L.item, name: O + L.item.name }
5460
5465
  }));
5461
5466
  } else
5462
5467
  k = fuse.search(I);
@@ -6231,8 +6236,8 @@ const RangeChoices = ({ property: r, onChange: n }) => {
6231
6236
  }
6232
6237
  if (get$1(O, "value") === "")
6233
6238
  return;
6234
- const V = `${get$1(O, "value", "").startsWith("-") ? "-" : ""}${u}[${get$1(O, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
6235
- k ? R(V) : C(V);
6239
+ const L = `${get$1(O, "value", "").startsWith("-") ? "-" : ""}${u}[${get$1(O, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
6240
+ k ? R(L) : C(L);
6236
6241
  },
6237
6242
  [C, R, a, g, u, m]
6238
6243
  ), j = useCallback$1(
@@ -6248,8 +6253,8 @@ const RangeChoices = ({ property: r, onChange: n }) => {
6248
6253
  }
6249
6254
  if (get$1(O, "value") === "")
6250
6255
  return;
6251
- const T = get$1(O, "unit") !== "" ? get$1(O, "unit") : k, V = `${get$1(O, "value", "").startsWith("-") ? "-" : ""}${u}[${get$1(O, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
6252
- C(V);
6256
+ const T = get$1(O, "unit") !== "" ? get$1(O, "unit") : k, L = `${get$1(O, "value", "").startsWith("-") ? "-" : ""}${u}[${get$1(O, "value", "").replace("-", "")}${T === "-" ? "" : T}]`;
6257
+ C(L);
6253
6258
  },
6254
6259
  [C, a, u, m]
6255
6260
  );
@@ -6275,7 +6280,7 @@ const RangeChoices = ({ property: r, onChange: n }) => {
6275
6280
  const O = parseInt$1(k.target.value);
6276
6281
  let T = isNaN$1(O) ? 0 : O;
6277
6282
  k.keyCode === 38 && (T += 1), k.keyCode === 40 && (T -= 1);
6278
- const M = `${T}`, D = `${M.startsWith("-") ? "-" : ""}${u}[${M.replace("-", "")}${g === "-" ? "" : g}]`;
6283
+ const B = `${T}`, D = `${B.startsWith("-") ? "-" : ""}${u}[${B.replace("-", "")}${g === "-" ? "" : g}]`;
6279
6284
  R(D);
6280
6285
  },
6281
6286
  onKeyUp: (k) => {
@@ -6328,15 +6333,15 @@ const RangeChoices = ({ property: r, onChange: n }) => {
6328
6333
  onDragEnd: (k) => {
6329
6334
  if (S(() => ""), w(!1), isEmpty(k))
6330
6335
  return;
6331
- const O = `${k}`, M = `${O.startsWith("-") ? "-" : ""}${u}[${O.replace("-", "")}${g === "-" ? "" : g}]`;
6332
- C(M);
6336
+ const O = `${k}`, B = `${O.startsWith("-") ? "-" : ""}${u}[${O.replace("-", "")}${g === "-" ? "" : g}]`;
6337
+ C(B);
6333
6338
  },
6334
6339
  onDrag: (k) => {
6335
6340
  if (isEmpty(k))
6336
6341
  return;
6337
6342
  S(k);
6338
- const O = `${k}`, M = `${O.startsWith("-") ? "-" : ""}${u}[${O.replace("-", "")}${g === "-" ? "" : g}]`;
6339
- R(M);
6343
+ const O = `${k}`, B = `${O.startsWith("-") ? "-" : ""}${u}[${O.replace("-", "")}${g === "-" ? "" : g}]`;
6344
+ R(B);
6340
6345
  },
6341
6346
  currentValue: a,
6342
6347
  unit: g,
@@ -6754,38 +6759,37 @@ function UILibrariesSelect({
6754
6759
  }
6755
6760
  const BlockCard = ({
6756
6761
  block: r,
6757
- closePopover: n,
6758
- library: o
6762
+ library: n,
6763
+ parentId: o = void 0
6759
6764
  }) => {
6760
- const [a, i] = useState$1(!1), l = useBuilderProp("getUILibraryBlock", noop$1), { addCoreBlock: c, addPredefinedBlock: u } = useAddBlock(), [d, m] = useSelectedBlockIds(), [, p] = useHighlightBlockId(), g = get$1(r, "name", get$1(r, "label")), h = useFeature("dnd"), [, b] = useAtom$1(draggedBlockAtom), x = (E) => {
6761
- const w = has(E, "styles_attrs.data-page-section");
6762
- return E._type === "Box" && w;
6763
- }, v = useCallback$1(
6764
- async (E) => {
6765
- if (E.stopPropagation(), has(r, "component")) {
6766
- c(r, first(d)), n();
6765
+ const [a, i] = useState$1(!1), l = useBuilderProp("getUILibraryBlock", noop$1), { addCoreBlock: c, addPredefinedBlock: u } = useAddBlock(), [, d] = useSelectedBlockIds(), [, m] = useHighlightBlockId(), p = get$1(r, "name", get$1(r, "label")), g = useFeature("dnd"), [, h] = useAtom$1(draggedBlockAtom), b = (S) => {
6766
+ const E = has(S, "styles_attrs.data-page-section");
6767
+ return S._type === "Box" && E;
6768
+ }, x = useCallback$1(
6769
+ async (S) => {
6770
+ if (S.stopPropagation(), has(r, "component")) {
6771
+ c(r, o), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
6767
6772
  return;
6768
6773
  }
6769
6774
  i(!0);
6770
- const w = await l(o, r);
6771
- let A = first(d);
6772
- isEmpty(w) || u(syncBlocksWithDefaults(w), A), n();
6775
+ const E = await l(n, r);
6776
+ isEmpty(E) || u(syncBlocksWithDefaults(E), o), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
6773
6777
  },
6774
6778
  [r]
6775
- ), S = async (E) => {
6776
- const w = await l(o, r);
6777
- let A = first(d);
6778
- if (x(first(w)) && (A = null), !isEmpty(w)) {
6779
- const P = { blocks: w, uiLibrary: !0, parent: A };
6780
- if (E.dataTransfer.setData("text/plain", JSON.stringify(P)), r.preview) {
6781
- const C = new Image();
6782
- C.src = r.preview, C.onload = () => {
6783
- E.dataTransfer.setDragImage(C, 0, 0);
6779
+ ), v = async (S) => {
6780
+ const E = await l(n, r);
6781
+ let w = o;
6782
+ if (b(first(E)) && (w = null), !isEmpty(E)) {
6783
+ const A = { blocks: E, uiLibrary: !0, parent: w };
6784
+ if (S.dataTransfer.setData("text/plain", JSON.stringify(A)), r.preview) {
6785
+ const P = new Image();
6786
+ P.src = r.preview, P.onload = () => {
6787
+ S.dataTransfer.setDragImage(P, 0, 0);
6784
6788
  };
6785
6789
  } else
6786
- E.dataTransfer.setDragImage(new Image(), 0, 0);
6787
- b(P), setTimeout(() => {
6788
- m([]), p(null), n();
6790
+ S.dataTransfer.setDragImage(new Image(), 0, 0);
6791
+ h(A), setTimeout(() => {
6792
+ d([]), m(null), emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
6789
6793
  }, 200);
6790
6794
  }
6791
6795
  };
@@ -6794,9 +6798,9 @@ const BlockCard = ({
6794
6798
  "div",
6795
6799
  {
6796
6800
  onClick: a ? () => {
6797
- } : v,
6798
- draggable: h ? "true" : "false",
6799
- onDragStart: S,
6801
+ } : x,
6802
+ draggable: g ? "true" : "false",
6803
+ onDragStart: v,
6800
6804
  className: clsx(
6801
6805
  "relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl"
6802
6806
  ),
@@ -6805,11 +6809,11 @@ const BlockCard = ({
6805
6809
  /* @__PURE__ */ jsxRuntimeExports.jsx(Loader$1, { className: "animate-spin", size: 15, color: "white" }),
6806
6810
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
6807
6811
  ] }),
6808
- r.preview ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: r.preview, className: "min-h-[45px] w-full rounded-md", alt: g }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "max-w-xs text-center text-sm text-gray-700", children: g }) })
6812
+ r.preview ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: r.preview, className: "min-h-[45px] w-full rounded-md", alt: p }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "max-w-xs text-center text-sm text-gray-700", children: p }) })
6809
6813
  ]
6810
6814
  }
6811
6815
  ) }),
6812
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: g }) })
6816
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: p }) })
6813
6817
  ] });
6814
6818
  }, libraryBlocksAtom = atom$1(
6815
6819
  {}
@@ -6824,34 +6828,34 @@ const BlockCard = ({
6824
6828
  c.current = "idle", o((d) => ({ ...d, [r == null ? void 0 : r.uuid]: { loading: "complete", blocks: u || [] } }));
6825
6829
  })();
6826
6830
  }, [r, i, l, c]), { data: i || [], isLoading: l === "loading" };
6827
- }, UILibrarySection = () => {
6828
- const [r, n] = useAtom$1(selectedLibraryAtom), o = useBuilderProp("uiLibraries", []), a = useChaiBlocks(), i = values(a).filter((w) => w.category === "custom"), l = o.find((w) => w.uuid === r) || first(o), { data: c, isLoading: u } = useLibraryBlocks(l), d = groupBy([...c, ...i], "group"), [m, p] = useState$1("Hero"), g = get$1(d, m, []), h = useRef$1(null), [, b] = useAddBlocksModal(), { t: x } = useTranslation(), v = (w) => {
6829
- h.current && (clearTimeout(h.current), h.current = null), h.current = setTimeout(() => {
6830
- h.current && p(w);
6831
+ }, UILibrarySection = ({ parentId: r }) => {
6832
+ const [n, o] = useAtom$1(selectedLibraryAtom), a = useBuilderProp("uiLibraries", []), i = useChaiBlocks(), l = values(i).filter((w) => w.category === "custom"), c = a.find((w) => w.uuid === n) || first(a), { data: u, isLoading: d } = useLibraryBlocks(c), m = groupBy([...u, ...l], "group"), [p, g] = useState$1("Hero"), h = get$1(m, p, []), b = useRef$1(null), { t: x } = useTranslation(), v = (w) => {
6833
+ b.current && (clearTimeout(b.current), b.current = null), b.current = setTimeout(() => {
6834
+ b.current && g(w);
6831
6835
  }, 300);
6832
6836
  };
6833
- if (u)
6837
+ if (d)
6834
6838
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 grid h-full w-full grid-cols-12 gap-2", children: [
6835
6839
  /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-3 h-full" }),
6836
6840
  /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-9 h-full" })
6837
6841
  ] });
6838
- const S = filter(g, (w, A) => A % 2 === 0), E = filter(g, (w, A) => A % 2 === 1);
6839
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full pt-2", children: [
6840
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full w-52 flex-col gap-1 px-1", children: [
6841
- /* @__PURE__ */ jsxRuntimeExports.jsx(UILibrariesSelect, { library: l == null ? void 0 : l.uuid, setLibrary: n, uiLibraries: o }),
6842
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 flex flex-col", children: [
6842
+ const S = filter(h, (w, A) => A % 2 === 0), E = filter(h, (w, A) => A % 2 === 1);
6843
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative mt-2 flex h-full max-h-full flex-col overflow-hidden bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full pt-2", children: [
6844
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full w-60 flex-col gap-1 px-1 pr-2", children: [
6845
+ /* @__PURE__ */ jsxRuntimeExports.jsx(UILibrariesSelect, { library: c == null ? void 0 : c.uuid, setLibrary: o, uiLibraries: a }),
6846
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 flex h-full max-h-full flex-col", children: [
6843
6847
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-500", children: x("groups") }),
6844
6848
  /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "mt-1" }),
6845
- /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea$1, { className: "mt-2 h-full flex-1 overflow-y-auto", children: React__default.Children.toArray(
6846
- map(d, (w, A) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
6849
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea$1, { className: "no-scrollbar mt-2 h-full max-h-full overflow-y-auto", children: React__default.Children.toArray(
6850
+ map(m, (w, A) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
6847
6851
  "div",
6848
6852
  {
6849
6853
  onMouseEnter: () => v(A),
6850
- onMouseLeave: () => clearTimeout(h.current),
6851
- onClick: () => p(A),
6854
+ onMouseLeave: () => clearTimeout(b.current),
6855
+ onClick: () => g(A),
6852
6856
  className: cn(
6853
6857
  "flex w-full cursor-pointer items-center justify-between rounded-md p-2 text-sm transition-all ease-in-out hover:bg-gray-200",
6854
- A === m ? "bg-blue-500 text-white hover:bg-blue-600" : ""
6858
+ A === p ? "bg-blue-500 text-white hover:bg-blue-600" : ""
6855
6859
  ),
6856
6860
  children: [
6857
6861
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: capitalize(x(A.toLowerCase())) }),
@@ -6866,15 +6870,15 @@ const BlockCard = ({
6866
6870
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
6867
6871
  ScrollArea$1,
6868
6872
  {
6869
- onMouseEnter: () => h.current ? clearTimeout(h.current) : null,
6873
+ onMouseEnter: () => b.current ? clearTimeout(b.current) : null,
6870
6874
  className: "z-10 -mt-2 flex h-full max-h-full w-full flex-col gap-2 border-l border-gray-300 transition-all ease-linear",
6871
6875
  children: [
6872
6876
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-2 px-2", children: [
6873
6877
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
6874
- S.map((w) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { block: w, library: l, closePopover: () => b("") }))
6878
+ S.map((w) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: r, block: w, library: c }))
6875
6879
  ) }),
6876
6880
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1", children: React__default.Children.toArray(
6877
- E.map((w) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { block: w, library: l, closePopover: () => b("") }))
6881
+ E.map((w) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlockCard, { parentId: r, block: w, library: c }))
6878
6882
  ) })
6879
6883
  ] }),
6880
6884
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
@@ -6884,7 +6888,7 @@ const BlockCard = ({
6884
6888
  }
6885
6889
  )
6886
6890
  ] }) }) });
6887
- }, UILibrariesPanel = () => /* @__PURE__ */ jsxRuntimeExports.jsx(UILibrarySection, {}), UILibraries = UILibrariesPanel, add_block = "Add block", enter_paste_tailwind_html = "(Enter or paste TailwindCSS HTML snippet)", click_to_add_block = "(Click to add block to page)", core = "Core", custom_blocks = "Custom Blocks", ui_library = "UI Library", html_snippet_description = "Use HTML snippets from Tailwind CSS component libraries etc. or just copy paste your own HTML code.", tailwind_html_snippet = "Tailwind HTML snippet:", enter_code_snippet = "Enter your code snippet here...", import_html = "Import HTML", note_imported_html = "NOTE: Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page.", dark_mode = "Dark mode", tree_view_no_blocks = "This page has no blocks. Add a block by clicking the + button", canvas_empty = "This page is empty", no_block_selected_for_styling = "Please select a block to edit settings or styles", no_block_selected_for_ask_ai = "Please select a block to ask AI", no_styling_block_selected = "Please select a styling block", drop_here_message = "Drop your block here", use_setting = "Use setting", mobile_xs_title = "Mobile (XS)", mobile_xs_content = "Styles set here are applied to all screen unless edited at higher breakpoint", mobile_sm_title = "Mobile landscape (SM)", mobile_sm_content = "Styles set here are applied at 640px and up unless edited at higher breakpoint", tablet_md_title = "Tablet (MD)", tablet_md_content = "Styles set here are applied at 768px and up", tablet_lg_title = "Tablet Landscape (LG)", tablet_lg_content = "Styles set here are applied at 1024px and up unless edited at higher breakpoint", desktop_xl_title = "Desktop (XL)", desktop_xl_content = "Styles set here are applied at 1280px and up unless edited at higher breakpoint", large_desktop_2xl_title = "Large Desktop (2XL)", large_desktop_2xl_content = "Styles set here are applied at 1536px and up", Breakpoints$1 = "Breakpoints", clear = "Clear", clear_canvas_title = "Clear whole canvas?", clear_canvas_description = "Are you sure you want to clear the whole canvas?", cancel = "Cancel", yes = "Yes", preview = "Preview", settings = "Settings", styling = "Styling", data_provider = "Data Provider", remove_provider_confirmation = "Are you sure you want to remove <span class='text-blue-500'>{name}</span> provider?", remove_provider_warning = "Your data provider will be removed from this page and all added data binding will be not visible on blocks.", remove = "Remove", no_data_providers = "You have no data providers registered. Please add a data provider to your project.", learn_more = "Learn more", add_data_providers = "Add data providers:", select_provider = "Select a provider", choose = "Choose", page_data_providers = "Page data providers:", view_data = "View Data", mark_as_global = "Mark as Global", global_block_note = "Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks.", global_block_indicator = "Global blocks are indicated with", global_block_category = "Global blocks are available under 'Global' category", enter_global_block_name = "Enter global block name", eg_header_footer = "Eg: Header, Footer", blocks_selected = "{{length}} blocks selected.", cut = "Cut", copy$1 = "Copy", clear_selection = "Clear Selection", dev_mode_message = "This is dev mode. Visit", to_see_page_preview = "to see page preview", theme_config = {
6891
+ }, UILibrariesPanel = ({ parentId: r }) => /* @__PURE__ */ jsxRuntimeExports.jsx(UILibrarySection, { parentId: r }), UILibraries = UILibrariesPanel, add_block = "Add block", enter_paste_tailwind_html = "(Enter or paste TailwindCSS HTML snippet)", click_to_add_block = "(Click to add block to page)", core = "Core", custom_blocks = "Custom Blocks", ui_library = "UI Library", html_snippet_description = "Use HTML snippets from Tailwind CSS component libraries etc. or just copy paste your own HTML code.", tailwind_html_snippet = "Tailwind HTML snippet:", enter_code_snippet = "Enter your code snippet here...", import_html = "Import HTML", note_imported_html = "NOTE: Imported html will be added to the currently selected block. If no block is selected, the html will be added to the page.", dark_mode = "Dark mode", tree_view_no_blocks = "This page has no blocks. Add a block by clicking the + button", canvas_empty = "This page is empty", no_block_selected_for_styling = "Please select a block to edit settings or styles", no_block_selected_for_ask_ai = "Please select a block to ask AI", no_styling_block_selected = "Please select a styling block", drop_here_message = "Drop your block here", use_setting = "Use setting", mobile_xs_title = "Mobile (XS)", mobile_xs_content = "Styles set here are applied to all screen unless edited at higher breakpoint", mobile_sm_title = "Mobile landscape (SM)", mobile_sm_content = "Styles set here are applied at 640px and up unless edited at higher breakpoint", tablet_md_title = "Tablet (MD)", tablet_md_content = "Styles set here are applied at 768px and up", tablet_lg_title = "Tablet Landscape (LG)", tablet_lg_content = "Styles set here are applied at 1024px and up unless edited at higher breakpoint", desktop_xl_title = "Desktop (XL)", desktop_xl_content = "Styles set here are applied at 1280px and up unless edited at higher breakpoint", large_desktop_2xl_title = "Large Desktop (2XL)", large_desktop_2xl_content = "Styles set here are applied at 1536px and up", Breakpoints$1 = "Breakpoints", clear = "Clear", clear_canvas_title = "Clear whole canvas?", clear_canvas_description = "Are you sure you want to clear the whole canvas?", cancel = "Cancel", yes = "Yes", preview = "Preview", settings = "Settings", styling = "Styling", data_provider = "Data Provider", remove_provider_confirmation = "Are you sure you want to remove <span class='text-blue-500'>{name}</span> provider?", remove_provider_warning = "Your data provider will be removed from this page and all added data binding will be not visible on blocks.", remove = "Remove", no_data_providers = "You have no data providers registered. Please add a data provider to your project.", learn_more = "Learn more", add_data_providers = "Add data providers:", select_provider = "Select a provider", choose = "Choose", page_data_providers = "Page data providers:", view_data = "View Data", mark_as_global = "Mark as Global", global_block_note = "Note: Global blocks are single instances. Editing global blocks will be reflected on all pages using these blocks.", global_block_indicator = "Global blocks are indicated with", global_block_category = "Global blocks are available under 'Global' category", enter_global_block_name = "Enter global block name", eg_header_footer = "Eg: Header, Footer", blocks_selected = "{{length}} blocks selected.", cut = "Cut", copy$1 = "Copy", clear_selection = "Clear Selection", dev_mode_message = "This is dev mode. Visit", to_see_page_preview = "to see page preview", theme_config = {
6888
6892
  heading_font: "Heading Font",
6889
6893
  body_font: "Body Font",
6890
6894
  rounded_corner: "Rounded Corners",
@@ -7318,49 +7322,50 @@ i18n.use(initReactI18next).init({
7318
7322
  // react already safes from xss => https://www.i18next.com/translation-function/interpolation#unescape
7319
7323
  }
7320
7324
  });
7321
- const CoreBlock = ({ block: r, disabled: n }) => {
7322
- const [, o] = useAtom$1(draggedBlockAtom), { type: a, icon: i, label: l } = r, { addCoreBlock: c, addPredefinedBlock: u } = useAddBlock(), [, d] = useSelectedBlockIds(), [, m] = useHighlightBlockId(), [, p] = useAtom$1(activePanelAtom$1), [g, h] = useAddBlocksModal(), b = () => {
7323
- if (has(r, "blocks")) {
7324
- const S = isFunction$2(r.blocks) ? r.blocks() : r.blocks;
7325
- u(syncBlocksWithDefaults(S), g === ROOT_TEMP_KEY ? null : g);
7325
+ const CoreBlock = ({ block: r, disabled: n, parentId: o }) => {
7326
+ const [, a] = useAtom$1(draggedBlockAtom), { type: i, icon: l, label: c } = r, { addCoreBlock: u, addPredefinedBlock: d } = useAddBlock(), [, m] = useSelectedBlockIds(), [, p] = useHighlightBlockId(), g = () => {
7327
+ if (console.log("addBlockToPage", r, o), has(r, "blocks")) {
7328
+ const x = isFunction$2(r.blocks) ? r.blocks() : r.blocks;
7329
+ d(syncBlocksWithDefaults(x), o || null);
7326
7330
  } else
7327
- c(r, g === ROOT_TEMP_KEY ? null : g);
7328
- h(""), p(OUTLINE_KEY);
7329
- }, x = useFeature("dnd"), { t: v } = useTranslation();
7331
+ u(r, o || null);
7332
+ emitChaiBuilderMsg({ name: CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK });
7333
+ }, h = useFeature("dnd"), { t: b } = useTranslation();
7330
7334
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip$1, { children: [
7331
7335
  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
7332
7336
  "button",
7333
7337
  {
7334
7338
  disabled: n,
7335
- onClick: b,
7339
+ onClick: g,
7336
7340
  type: "button",
7337
- onDragStart: (S) => {
7338
- S.dataTransfer.setData("text/plain", JSON.stringify(omit(r, ["component", "icon"]))), S.dataTransfer.setDragImage(new Image(), 0, 0), o(omit(r, ["component", "icon"])), setTimeout(() => {
7339
- d([]), m(null), p(OUTLINE_KEY);
7341
+ onDragStart: (x) => {
7342
+ x.dataTransfer.setData("text/plain", JSON.stringify(omit(r, ["component", "icon"]))), x.dataTransfer.setDragImage(new Image(), 0, 0), a(omit(r, ["component", "icon"])), setTimeout(() => {
7343
+ m([]), p(null);
7340
7344
  }, 200);
7341
7345
  },
7342
- draggable: x ? "true" : "false",
7346
+ draggable: h ? "true" : "false",
7343
7347
  className: "cursor-pointer space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400",
7344
7348
  children: [
7345
- createElement$1(i || BoxIcon, { className: "w-4 h-4 mx-auto" }),
7346
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "truncate text-xs", children: capitalize(v(l || a)) })
7349
+ createElement$1(l || BoxIcon, { className: "w-4 h-4 mx-auto" }),
7350
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "truncate text-xs", children: capitalize(b(c || i)) })
7347
7351
  ]
7348
7352
  }
7349
7353
  ) }),
7350
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: v(l || a) }) })
7354
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: b(c || i) }) })
7351
7355
  ] }) });
7352
- }, CORE_GROUPS = ["basic", "typography", "media", "layout", "form", "advanced", "other"], ChaiBuilderBlocks = ({ groups: r, blocks: n }) => {
7356
+ }, CORE_GROUPS = ["basic", "typography", "media", "layout", "form", "advanced", "other"], ChaiBuilderBlocks = ({ groups: r, blocks: n, parentId: o }) => {
7353
7357
  var c;
7354
- const { t: o } = useTranslation(), [a] = useBlocksStore(), [i] = useAddBlocksModal(), l = (c = find(a, (u) => u._id === i)) == null ? void 0 : c._type;
7358
+ const { t: a } = useTranslation(), [i] = useBlocksStore(), l = (c = find(i, (u) => u._id === o)) == null ? void 0 : c._type;
7355
7359
  return React__default.Children.toArray(
7356
7360
  map(
7357
7361
  sortBy(r, (u) => CORE_GROUPS.indexOf(u) === -1 ? 99 : CORE_GROUPS.indexOf(u)),
7358
7362
  (u) => reject(filter(values(n), { group: u }), { hidden: !0 }).length ? /* @__PURE__ */ jsxRuntimeExports.jsx(Accordion, { type: "single", value: u, collapsible: !0, className: "w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AccordionItem, { value: u, children: [
7359
- /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionTrigger, { className: "rounded-md bg-gray-100 px-4 py-2 capitalize hover:no-underline", children: capitalize(o(u.toLowerCase())) }),
7363
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionTrigger, { className: "rounded-md bg-gray-100 px-4 py-2 capitalize hover:no-underline", children: capitalize(a(u.toLowerCase())) }),
7360
7364
  /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContent, { className: "mx-auto max-w-xl p-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-4 gap-2", children: React__default.Children.toArray(
7361
7365
  reject(filter(values(n), { group: u }), { hidden: !0 }).map((d) => /* @__PURE__ */ jsxRuntimeExports.jsx(
7362
7366
  CoreBlock,
7363
7367
  {
7368
+ parentId: o,
7364
7369
  block: d,
7365
7370
  disabled: !canAcceptChildBlock(l, d.type) || !canBeNestedInside(l, d.type)
7366
7371
  }
@@ -7369,33 +7374,37 @@ const CoreBlock = ({ block: r, disabled: n }) => {
7369
7374
  ] }) }) : null
7370
7375
  )
7371
7376
  );
7372
- }, AddBlocksPanel = ({ className: r, showHeading: n = !0 }) => {
7373
- const { t: o } = useTranslation(), [a, i] = useState$1("library"), [l, c] = useState$1("basic"), u = useChaiBlocks(), [, d] = useAtom$1(showPredefinedBlockCategoryAtom), m = useBuilderProp("importHTMLSupport", !0), p = useBuilderProp("filterChaiBlock", () => !0), g = filter(u, p), h = groupBy(g, "category"), b = uniq(map(h.core, "group"));
7377
+ }, AddBlocksPanel = ({
7378
+ className: r,
7379
+ showHeading: n = !0,
7380
+ parentId: o = void 0
7381
+ }) => {
7382
+ const { t: a } = useTranslation(), [i, l] = useState$1("library"), [c, u] = useState$1("basic"), d = useChaiBlocks(), [, m] = useAtom$1(showPredefinedBlockCategoryAtom), p = useBuilderProp("importHTMLSupport", !0), g = useBuilderProp("filterChaiBlock", () => !0), h = filter(d, g), b = groupBy(h, "category"), x = uniq(map(b.core, "group"));
7374
7383
  return useEffect$1(() => {
7375
- !includes(b, l) && !isEmpty(b) && !isEmpty(l) && c(first(b));
7376
- }, [b, l]), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex h-full w-full flex-col overflow-hidden", r), children: [
7384
+ !includes(x, c) && !isEmpty(x) && !isEmpty(c) && u(first(x));
7385
+ }, [x, c]), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex h-full w-full flex-col overflow-hidden", r), children: [
7377
7386
  n ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
7378
- /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children: o("add_block") }),
7379
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: o(a === "html" ? "enter_paste_tailwind_html" : "click_to_add_block") })
7387
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children: a("add_block") }),
7388
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: a(i === "html" ? "enter_paste_tailwind_html" : "click_to_add_block") })
7380
7389
  ] }) : null,
7381
7390
  /* @__PURE__ */ jsxRuntimeExports.jsx(
7382
7391
  Tabs$1,
7383
7392
  {
7384
- onValueChange: (x) => {
7385
- d(""), i(x);
7393
+ onValueChange: (v) => {
7394
+ m(""), l(v);
7386
7395
  },
7387
- value: a,
7388
- className: cn("h-max", m ? "" : "hidden"),
7389
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsList$1, { className: "grid w-full " + (m ? "grid-cols-3" : "grid-cols-1"), children: [
7390
- /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "library", children: o("library") }),
7391
- /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "core", children: o("blocks") }),
7392
- m ? /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "html", children: o("import") }) : null
7396
+ value: i,
7397
+ className: cn("h-max", p ? "" : "hidden"),
7398
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsList$1, { className: "grid w-full " + (p ? "grid-cols-3" : "grid-cols-1"), children: [
7399
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "library", children: a("library") }),
7400
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "core", children: a("blocks") }),
7401
+ p ? /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "html", children: a("import") }) : null
7393
7402
  ] })
7394
7403
  }
7395
7404
  ),
7396
- a === "core" && /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea$1, { className: "-mx-1.5 h-[calc(100vh-156px)] overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChaiBuilderBlocks, { groups: b, blocks: h.core }) }) }),
7397
- a === "library" && /* @__PURE__ */ jsxRuntimeExports.jsx(UILibraries, {}),
7398
- a === "html" && m ? /* @__PURE__ */ jsxRuntimeExports.jsx(ImportHTML$1, {}) : null
7405
+ i === "core" && /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea$1, { className: "-mx-1.5 h-[calc(100vh-156px)] overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChaiBuilderBlocks, { parentId: o, groups: x, blocks: b.core }) }) }),
7406
+ i === "library" && /* @__PURE__ */ jsxRuntimeExports.jsx(UILibraries, { parentId: o }),
7407
+ i === "html" && p ? /* @__PURE__ */ jsxRuntimeExports.jsx(ImportHTML$1, { parentId: o }) : null
7399
7408
  ] });
7400
7409
  }, AddBlocksPanel$1 = AddBlocksPanel;
7401
7410
  function FaCheck(r) {
@@ -7484,14 +7493,14 @@ function QuickPrompts({ onClick: r }) {
7484
7493
  ) }) });
7485
7494
  }
7486
7495
  const AIUserPrompt = ({ blockId: r }) => {
7487
- const { t: n } = useTranslation(), { askAi: o, loading: a, error: i } = useAskAi(), [l, c] = useState$1(""), [u, d] = useState$1(!0), [m, p] = useState$1(), g = useRef$1(null);
7496
+ const { t: n } = useTranslation(), { askAi: o, loading: a, error: i } = useAskAi(), [l, c] = useState$1(""), [u, d] = useState$1(!0), [m, p] = useState$1(), g = useRef$1(null), h = useRef$1(null);
7488
7497
  useEffect$1(() => {
7489
- var b;
7490
- (b = g.current) == null || b.focus();
7498
+ var x;
7499
+ (x = g.current) == null || x.focus();
7491
7500
  }, []);
7492
- const h = (b) => {
7493
- const { usage: x } = b || {};
7494
- !i && x && p(x), setTimeout(() => p(void 0), 4e3), i || c("");
7501
+ const b = (x) => {
7502
+ const { usage: v } = x || {};
7503
+ !i && v && p(v), h.current = setTimeout(() => p(void 0), 1e4), i || c("");
7495
7504
  };
7496
7505
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "", children: [
7497
7506
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -7511,12 +7520,12 @@ const AIUserPrompt = ({ blockId: r }) => {
7511
7520
  {
7512
7521
  ref: g,
7513
7522
  value: l,
7514
- onChange: (b) => c(b.target.value),
7523
+ onChange: (x) => c(x.target.value),
7515
7524
  placeholder: n("ask_ai_to_edit_content"),
7516
7525
  className: "w-full border border-gray-400 focus:border-0",
7517
7526
  rows: 3,
7518
- onKeyDown: (b) => {
7519
- b.key === "Enter" && (b.preventDefault(), p(void 0), o("content", r, l, h));
7527
+ onKeyDown: (x) => {
7528
+ x.key === "Enter" && (x.preventDefault(), h.current && clearTimeout(h.current), p(void 0), o("content", r, l, b));
7520
7529
  }
7521
7530
  }
7522
7531
  ),
@@ -7526,7 +7535,7 @@ const AIUserPrompt = ({ blockId: r }) => {
7526
7535
  {
7527
7536
  disabled: l.trim().length < 5 || a,
7528
7537
  onClick: () => {
7529
- p(void 0), o("content", r, l, h);
7538
+ h.current && clearTimeout(h.current), p(void 0), o("content", r, l, b);
7530
7539
  },
7531
7540
  variant: "default",
7532
7541
  className: "w-fit",
@@ -7557,8 +7566,8 @@ const AIUserPrompt = ({ blockId: r }) => {
7557
7566
  /* @__PURE__ */ jsxRuntimeExports.jsx(
7558
7567
  QuickPrompts,
7559
7568
  {
7560
- onClick: (b) => {
7561
- p(void 0), o("content", r, b, h);
7569
+ onClick: (x) => {
7570
+ h.current && clearTimeout(h.current), p(void 0), o("content", r, x, b);
7562
7571
  }
7563
7572
  }
7564
7573
  )
@@ -8647,9 +8656,9 @@ function requireReactIs_development() {
8647
8656
  }
8648
8657
  }
8649
8658
  }
8650
- var C = d, R = m, I = u, j = c, k = n, O = p, T = a, M = x, V = b, D = o, W = l, J = i, F = g, L = !1;
8659
+ var C = d, R = m, I = u, j = c, k = n, O = p, T = a, B = x, L = b, D = o, W = l, J = i, F = g, V = !1;
8651
8660
  function q(K) {
8652
- return L || (L = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), G(K) || P(K) === d;
8661
+ return V || (V = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), G(K) || P(K) === d;
8653
8662
  }
8654
8663
  function G(K) {
8655
8664
  return P(K) === m;
@@ -8687,7 +8696,7 @@ function requireReactIs_development() {
8687
8696
  function se(K) {
8688
8697
  return P(K) === g;
8689
8698
  }
8690
- reactIs_development.AsyncMode = C, reactIs_development.ConcurrentMode = R, reactIs_development.ContextConsumer = I, reactIs_development.ContextProvider = j, reactIs_development.Element = k, reactIs_development.ForwardRef = O, reactIs_development.Fragment = T, reactIs_development.Lazy = M, reactIs_development.Memo = V, reactIs_development.Portal = D, reactIs_development.Profiler = W, reactIs_development.StrictMode = J, reactIs_development.Suspense = F, reactIs_development.isAsyncMode = q, reactIs_development.isConcurrentMode = G, reactIs_development.isContextConsumer = ee, reactIs_development.isContextProvider = z, reactIs_development.isElement = U, reactIs_development.isForwardRef = te, reactIs_development.isFragment = _, reactIs_development.isLazy = Q, reactIs_development.isMemo = ne, reactIs_development.isPortal = re, reactIs_development.isProfiler = $, reactIs_development.isStrictMode = ae, reactIs_development.isSuspense = se, reactIs_development.isValidElementType = A, reactIs_development.typeOf = P;
8699
+ reactIs_development.AsyncMode = C, reactIs_development.ConcurrentMode = R, reactIs_development.ContextConsumer = I, reactIs_development.ContextProvider = j, reactIs_development.Element = k, reactIs_development.ForwardRef = O, reactIs_development.Fragment = T, reactIs_development.Lazy = B, reactIs_development.Memo = L, reactIs_development.Portal = D, reactIs_development.Profiler = W, reactIs_development.StrictMode = J, reactIs_development.Suspense = F, reactIs_development.isAsyncMode = q, reactIs_development.isConcurrentMode = G, reactIs_development.isContextConsumer = ee, reactIs_development.isContextProvider = z, reactIs_development.isElement = U, reactIs_development.isForwardRef = te, reactIs_development.isFragment = _, reactIs_development.isLazy = Q, reactIs_development.isMemo = ne, reactIs_development.isPortal = re, reactIs_development.isProfiler = $, reactIs_development.isStrictMode = ae, reactIs_development.isSuspense = se, reactIs_development.isValidElementType = A, reactIs_development.typeOf = P;
8691
8700
  }()), reactIs_development;
8692
8701
  }
8693
8702
  process.env.NODE_ENV === "production" ? reactIs$1.exports = requireReactIs_production_min() : reactIs$1.exports = requireReactIs_development();
@@ -10930,13 +10939,13 @@ function extractSystemStyles(r) {
10930
10939
  fs: k,
10931
10940
  tt: O,
10932
10941
  td: T,
10933
- w: M,
10934
- miw: V,
10942
+ w: B,
10943
+ miw: L,
10935
10944
  maw: D,
10936
10945
  h: W,
10937
10946
  mih: J,
10938
10947
  mah: F,
10939
- bgsz: L,
10948
+ bgsz: V,
10940
10949
  bgp: q,
10941
10950
  bgr: G,
10942
10951
  bga: ee,
@@ -11019,13 +11028,13 @@ function extractSystemStyles(r) {
11019
11028
  fs: k,
11020
11029
  tt: O,
11021
11030
  td: T,
11022
- w: M,
11023
- miw: V,
11031
+ w: B,
11032
+ miw: L,
11024
11033
  maw: D,
11025
11034
  h: W,
11026
11035
  mih: J,
11027
11036
  mah: F,
11028
- bgsz: L,
11037
+ bgsz: V,
11029
11038
  bgp: q,
11030
11039
  bgr: G,
11031
11040
  bga: ee,
@@ -12841,9 +12850,9 @@ const useHover = function(r, n) {
12841
12850
  D === void 0 && (D = !0);
12842
12851
  const W = getDelay(w.current, "close", A.current);
12843
12852
  W && !C.current ? (clearTimeout(P.current), P.current = setTimeout(() => m(!1), W)) : D && (clearTimeout(P.current), m(!1));
12844
- }, [w, m]), M = React.useCallback(() => {
12853
+ }, [w, m]), B = React.useCallback(() => {
12845
12854
  k.current(), C.current = void 0;
12846
- }, []), V = React.useCallback(() => {
12855
+ }, []), L = React.useCallback(() => {
12847
12856
  if (j.current) {
12848
12857
  const D = getDocument(x.floating.current).body;
12849
12858
  D.style.pointerEvents = "", D.removeAttribute(safePolygonIdentifier), j.current = !1;
@@ -12855,16 +12864,16 @@ const useHover = function(r, n) {
12855
12864
  function D() {
12856
12865
  return p.current.openEvent ? ["click", "mousedown"].includes(p.current.openEvent.type) : !1;
12857
12866
  }
12858
- function W(L) {
12867
+ function W(V) {
12859
12868
  if (clearTimeout(P.current), I.current = !1, l && !isMouseLikePointerType(A.current) || c > 0 && getDelay(w.current, "open") === 0)
12860
12869
  return;
12861
- p.current.openEvent = L;
12870
+ p.current.openEvent = V;
12862
12871
  const q = getDelay(w.current, "open", A.current);
12863
12872
  q ? P.current = setTimeout(() => {
12864
12873
  m(!0);
12865
12874
  }, q) : m(!0);
12866
12875
  }
12867
- function J(L) {
12876
+ function J(V) {
12868
12877
  if (D())
12869
12878
  return;
12870
12879
  k.current();
@@ -12873,10 +12882,10 @@ const useHover = function(r, n) {
12873
12882
  d || clearTimeout(P.current), C.current = E.current({
12874
12883
  ...r,
12875
12884
  tree: v,
12876
- x: L.clientX,
12877
- y: L.clientY,
12885
+ x: V.clientX,
12886
+ y: V.clientY,
12878
12887
  onClose() {
12879
- V(), M(), T();
12888
+ L(), B(), T();
12880
12889
  }
12881
12890
  });
12882
12891
  const G = C.current;
@@ -12887,42 +12896,42 @@ const useHover = function(r, n) {
12887
12896
  }
12888
12897
  T();
12889
12898
  }
12890
- function F(L) {
12899
+ function F(V) {
12891
12900
  D() || E.current == null || E.current({
12892
12901
  ...r,
12893
12902
  tree: v,
12894
- x: L.clientX,
12895
- y: L.clientY,
12903
+ x: V.clientX,
12904
+ y: V.clientY,
12896
12905
  onClose() {
12897
- V(), M(), T();
12906
+ L(), B(), T();
12898
12907
  }
12899
- })(L);
12908
+ })(V);
12900
12909
  }
12901
12910
  if (isElement(h)) {
12902
- const L = h;
12903
- return d && L.addEventListener("mouseleave", F), b == null || b.addEventListener("mouseleave", F), u && L.addEventListener("mousemove", W, {
12911
+ const V = h;
12912
+ return d && V.addEventListener("mouseleave", F), b == null || b.addEventListener("mouseleave", F), u && V.addEventListener("mousemove", W, {
12904
12913
  once: !0
12905
- }), L.addEventListener("mouseenter", W), L.addEventListener("mouseleave", J), () => {
12906
- d && L.removeEventListener("mouseleave", F), b == null || b.removeEventListener("mouseleave", F), u && L.removeEventListener("mousemove", W), L.removeEventListener("mouseenter", W), L.removeEventListener("mouseleave", J);
12914
+ }), V.addEventListener("mouseenter", W), V.addEventListener("mouseleave", J), () => {
12915
+ d && V.removeEventListener("mouseleave", F), b == null || b.removeEventListener("mouseleave", F), u && V.removeEventListener("mousemove", W), V.removeEventListener("mouseenter", W), V.removeEventListener("mouseleave", J);
12907
12916
  };
12908
12917
  }
12909
- }, [h, b, o, r, l, c, u, T, M, V, m, d, v, w, E, p]), index(() => {
12918
+ }, [h, b, o, r, l, c, u, T, B, L, m, d, v, w, E, p]), index(() => {
12910
12919
  var D;
12911
12920
  if (o && d && (D = E.current) != null && D.__options.blockPointerEvents && O()) {
12912
12921
  const F = getDocument(b).body;
12913
12922
  if (F.setAttribute(safePolygonIdentifier, ""), F.style.pointerEvents = "none", j.current = !0, isElement(h) && b) {
12914
12923
  var W, J;
12915
- const L = h, q = v == null || (W = v.nodesRef.current.find((G) => G.id === S)) == null || (J = W.context) == null ? void 0 : J.elements.floating;
12916
- return q && (q.style.pointerEvents = ""), L.style.pointerEvents = "auto", b.style.pointerEvents = "auto", () => {
12917
- L.style.pointerEvents = "", b.style.pointerEvents = "";
12924
+ const V = h, q = v == null || (W = v.nodesRef.current.find((G) => G.id === S)) == null || (J = W.context) == null ? void 0 : J.elements.floating;
12925
+ return q && (q.style.pointerEvents = ""), V.style.pointerEvents = "auto", b.style.pointerEvents = "auto", () => {
12926
+ V.style.pointerEvents = "", b.style.pointerEvents = "";
12918
12927
  };
12919
12928
  }
12920
12929
  }
12921
12930
  }, [o, d, S, b, h, v, E, p, O]), index(() => {
12922
- d || (A.current = void 0, M(), V());
12923
- }, [d, M, V]), React.useEffect(() => () => {
12924
- M(), clearTimeout(P.current), clearTimeout(R.current), V();
12925
- }, [o, M, V]), React.useMemo(() => {
12931
+ d || (A.current = void 0, B(), L());
12932
+ }, [d, B, L]), React.useEffect(() => () => {
12933
+ B(), clearTimeout(P.current), clearTimeout(R.current), L();
12934
+ }, [o, B, L]), React.useMemo(() => {
12926
12935
  if (!o)
12927
12936
  return {};
12928
12937
  function D(W) {
@@ -13150,8 +13159,8 @@ const bubbleHandlerKeys = {
13150
13159
  if (W.length > 0) {
13151
13160
  let J = !0;
13152
13161
  if (W.forEach((F) => {
13153
- var L;
13154
- if ((L = F.context) != null && L.open && !F.context.dataRef.current.__escapeKeyBubbles) {
13162
+ var V;
13163
+ if ((V = F.context) != null && V.open && !F.context.dataRef.current.__escapeKeyBubbles) {
13155
13164
  J = !1;
13156
13165
  return;
13157
13166
  }
@@ -13185,10 +13194,10 @@ const bubbleHandlerKeys = {
13185
13194
  });
13186
13195
  if (isEventTargetWithin(D, d) || isEventTargetWithin(D, u) || F)
13187
13196
  return;
13188
- const L = w ? getChildren(w.nodesRef.current, l) : [];
13189
- if (L.length > 0) {
13197
+ const V = w ? getChildren(w.nodesRef.current, l) : [];
13198
+ if (V.length > 0) {
13190
13199
  let q = !0;
13191
- if (L.forEach((G) => {
13200
+ if (V.forEach((G) => {
13192
13201
  var ee;
13193
13202
  if ((ee = G.context) != null && ee.open && !G.context.dataRef.current.__outsidePressBubbles) {
13194
13203
  q = !1;
@@ -13209,18 +13218,18 @@ const bubbleHandlerKeys = {
13209
13218
  function T() {
13210
13219
  a(!1);
13211
13220
  }
13212
- const M = getDocument(d);
13213
- g && M.addEventListener("keydown", k), C && M.addEventListener(b, O);
13214
- let V = [];
13215
- return S && (isElement(u) && (V = getOverflowAncestors(u)), isElement(d) && (V = V.concat(getOverflowAncestors(d))), !isElement(c) && c && c.contextElement && (V = V.concat(getOverflowAncestors(c.contextElement)))), V = V.filter((D) => {
13221
+ const B = getDocument(d);
13222
+ g && B.addEventListener("keydown", k), C && B.addEventListener(b, O);
13223
+ let L = [];
13224
+ return S && (isElement(u) && (L = getOverflowAncestors(u)), isElement(d) && (L = L.concat(getOverflowAncestors(d))), !isElement(c) && c && c.contextElement && (L = L.concat(getOverflowAncestors(c.contextElement)))), L = L.filter((D) => {
13216
13225
  var W;
13217
- return D !== ((W = M.defaultView) == null ? void 0 : W.visualViewport);
13218
- }), V.forEach((D) => {
13226
+ return D !== ((W = B.defaultView) == null ? void 0 : W.visualViewport);
13227
+ }), L.forEach((D) => {
13219
13228
  D.addEventListener("scroll", T, {
13220
13229
  passive: !0
13221
13230
  });
13222
13231
  }), () => {
13223
- g && M.removeEventListener("keydown", k), C && M.removeEventListener(b, O), V.forEach((D) => {
13232
+ g && B.removeEventListener("keydown", k), C && B.removeEventListener(b, O), L.forEach((D) => {
13224
13233
  D.removeEventListener("scroll", T);
13225
13234
  });
13226
13235
  };
@@ -13918,13 +13927,13 @@ function Popover(r) {
13918
13927
  styles: k,
13919
13928
  closeOnClickOutside: O,
13920
13929
  withinPortal: T,
13921
- portalProps: M,
13922
- closeOnEscape: V,
13930
+ portalProps: B,
13931
+ closeOnEscape: L,
13923
13932
  clickOutsideEvents: D,
13924
13933
  trapFocus: W,
13925
13934
  onClose: J,
13926
13935
  onOpen: F,
13927
- onChange: L,
13936
+ onChange: V,
13928
13937
  zIndex: q,
13929
13938
  radius: G,
13930
13939
  shadow: ee,
@@ -13985,7 +13994,7 @@ function Popover(r) {
13985
13994
  positionDependencies: b,
13986
13995
  opened: x,
13987
13996
  defaultOpened: U,
13988
- onChange: L,
13997
+ onChange: V,
13989
13998
  onOpen: F,
13990
13999
  onClose: J
13991
14000
  });
@@ -14018,11 +14027,11 @@ function Popover(r) {
14018
14027
  placement: be.floating.placement,
14019
14028
  trapFocus: W,
14020
14029
  withinPortal: T,
14021
- portalProps: M,
14030
+ portalProps: B,
14022
14031
  zIndex: q,
14023
14032
  radius: G,
14024
14033
  shadow: ee,
14025
- closeOnEscape: V,
14034
+ closeOnEscape: L,
14026
14035
  onClose: be.onClose,
14027
14036
  onToggle: be.onToggle,
14028
14037
  getTargetId: () => `${fe}-target`,
@@ -14205,7 +14214,7 @@ function useInputProps(r, n, o) {
14205
14214
  "inputWrapperOrder",
14206
14215
  "withAsterisk",
14207
14216
  "variant"
14208
- ]), O = useId$2(w), { systemStyles: T, rest: M } = extractSystemStyles(k), V = __spreadValues$R({
14217
+ ]), O = useId$2(w), { systemStyles: T, rest: B } = extractSystemStyles(k), L = __spreadValues$R({
14209
14218
  label: i,
14210
14219
  description: l,
14211
14220
  error: c,
@@ -14227,11 +14236,11 @@ function useInputProps(r, n, o) {
14227
14236
  withAsterisk: I,
14228
14237
  variant: j
14229
14238
  }, E);
14230
- return __spreadProps$z(__spreadValues$R({}, M), {
14239
+ return __spreadProps$z(__spreadValues$R({}, B), {
14231
14240
  classNames: d,
14232
14241
  styles: m,
14233
14242
  unstyled: g,
14234
- wrapperProps: __spreadValues$R(__spreadValues$R({}, V), T),
14243
+ wrapperProps: __spreadValues$R(__spreadValues$R({}, L), T),
14235
14244
  inputProps: {
14236
14245
  required: u,
14237
14246
  classNames: d,
@@ -14544,23 +14553,23 @@ const defaultProps$q = {
14544
14553
  size: S,
14545
14554
  variant: R,
14546
14555
  __staticSelector: w
14547
- }, T = typeof C == "boolean" ? C : c, M = u ? `${u}-error` : b == null ? void 0 : b.id, V = u ? `${u}-description` : h == null ? void 0 : h.id, W = `${!!d && typeof d != "boolean" ? M : ""} ${m ? V : ""}`, J = W.trim().length > 0 ? W.trim() : void 0, F = i && /* @__PURE__ */ React__default.createElement(InputLabel, __spreadValues$M(__spreadValues$M({
14556
+ }, T = typeof C == "boolean" ? C : c, B = u ? `${u}-error` : b == null ? void 0 : b.id, L = u ? `${u}-description` : h == null ? void 0 : h.id, W = `${!!d && typeof d != "boolean" ? B : ""} ${m ? L : ""}`, J = W.trim().length > 0 ? W.trim() : void 0, F = i && /* @__PURE__ */ React__default.createElement(InputLabel, __spreadValues$M(__spreadValues$M({
14548
14557
  key: "label",
14549
14558
  labelElement: p,
14550
14559
  id: u ? `${u}-label` : void 0,
14551
14560
  htmlFor: u,
14552
14561
  required: T
14553
- }, O), g), i), L = m && /* @__PURE__ */ React__default.createElement(InputDescription, __spreadProps$x(__spreadValues$M(__spreadValues$M({
14562
+ }, O), g), i), V = m && /* @__PURE__ */ React__default.createElement(InputDescription, __spreadProps$x(__spreadValues$M(__spreadValues$M({
14554
14563
  key: "description"
14555
14564
  }, h), O), {
14556
14565
  size: (h == null ? void 0 : h.size) || O.size,
14557
- id: (h == null ? void 0 : h.id) || V
14566
+ id: (h == null ? void 0 : h.id) || L
14558
14567
  }), m), q = /* @__PURE__ */ React__default.createElement(Fragment, {
14559
14568
  key: "input"
14560
14569
  }, E(l)), G = typeof d != "boolean" && d && /* @__PURE__ */ React__default.createElement(InputError, __spreadProps$x(__spreadValues$M(__spreadValues$M({}, b), O), {
14561
14570
  size: (b == null ? void 0 : b.size) || O.size,
14562
14571
  key: "error",
14563
- id: (b == null ? void 0 : b.id) || M
14572
+ id: (b == null ? void 0 : b.id) || B
14564
14573
  }), d), ee = P.map((z) => {
14565
14574
  switch (z) {
14566
14575
  case "label":
@@ -14568,7 +14577,7 @@ const defaultProps$q = {
14568
14577
  case "input":
14569
14578
  return q;
14570
14579
  case "description":
14571
- return L;
14580
+ return V;
14572
14581
  case "error":
14573
14582
  return G;
14574
14583
  default:
@@ -14579,7 +14588,7 @@ const defaultProps$q = {
14579
14588
  value: __spreadValues$M({
14580
14589
  describedBy: J
14581
14590
  }, getInputOffsets(P, {
14582
- hasDescription: !!L,
14591
+ hasDescription: !!V,
14583
14592
  hasError: !!G
14584
14593
  }))
14585
14594
  }, /* @__PURE__ */ React__default.createElement(Box, __spreadValues$M({
@@ -14825,7 +14834,7 @@ const defaultProps$o = {
14825
14834
  "sx",
14826
14835
  "unstyled",
14827
14836
  "pointer"
14828
- ]), { offsetBottom: k, offsetTop: O, describedBy: T } = useInputWrapperContext(), { classes: M, cx: V } = useStyles$v({
14837
+ ]), { offsetBottom: k, offsetTop: O, describedBy: T } = useInputWrapperContext(), { classes: B, cx: L } = useStyles$v({
14829
14838
  radius: x,
14830
14839
  multiline: P,
14831
14840
  invalid: !!i,
@@ -14837,11 +14846,11 @@ const defaultProps$o = {
14837
14846
  pointer: I
14838
14847
  }, { classNames: E, styles: w, name: ["Input", A], unstyled: R, variant: u, size: v }), { systemStyles: D, rest: W } = extractSystemStyles(j);
14839
14848
  return /* @__PURE__ */ React__default.createElement(Box, __spreadValues$J(__spreadValues$J({
14840
- className: V(M.wrapper, a),
14849
+ className: L(B.wrapper, a),
14841
14850
  sx: C,
14842
14851
  style: m
14843
14852
  }, D), S), d && /* @__PURE__ */ React__default.createElement("div", {
14844
- className: M.icon
14853
+ className: B.icon
14845
14854
  }, d), /* @__PURE__ */ React__default.createElement(Box, __spreadProps$v(__spreadValues$J({
14846
14855
  component: "input"
14847
14856
  }, W), {
@@ -14853,9 +14862,9 @@ const defaultProps$o = {
14853
14862
  "data-disabled": c || void 0,
14854
14863
  "data-with-icon": !!d || void 0,
14855
14864
  "data-invalid": !!i || void 0,
14856
- className: M.input
14865
+ className: B.input
14857
14866
  })), h && /* @__PURE__ */ React__default.createElement("div", __spreadProps$v(__spreadValues$J({}, b), {
14858
- className: M.rightSection
14867
+ className: B.rightSection
14859
14868
  }), h));
14860
14869
  });
14861
14870
  _Input.displayName = "@mantine/core/Input";
@@ -15265,7 +15274,7 @@ const defaultProps$l = {
15265
15274
  gradient: A,
15266
15275
  withLeftIcon: !!m,
15267
15276
  withRightIcon: !!p
15268
- }, { name: "Button", unstyled: R, classNames: P, styles: C, variant: h, size: i }), T = O.fn.variant({ color: l, variant: h }), M = /* @__PURE__ */ React__default.createElement(Loader, __spreadValues$E({
15277
+ }, { name: "Button", unstyled: R, classNames: P, styles: C, variant: h, size: i }), T = O.fn.variant({ color: l, variant: h }), B = /* @__PURE__ */ React__default.createElement(Loader, __spreadValues$E({
15269
15278
  color: T.color,
15270
15279
  size: `calc(${getSize({ size: i, sizes: sizes$1 }).height} / 2)`
15271
15280
  }, w));
@@ -15282,14 +15291,14 @@ const defaultProps$l = {
15282
15291
  className: j.inner
15283
15292
  }, (m || S && E === "left") && /* @__PURE__ */ React__default.createElement("span", {
15284
15293
  className: k(j.icon, j.leftIcon)
15285
- }, S && E === "left" ? M : m), S && E === "center" && /* @__PURE__ */ React__default.createElement("span", {
15294
+ }, S && E === "left" ? B : m), S && E === "center" && /* @__PURE__ */ React__default.createElement("span", {
15286
15295
  className: j.centerLoader
15287
- }, M), /* @__PURE__ */ React__default.createElement("span", {
15296
+ }, B), /* @__PURE__ */ React__default.createElement("span", {
15288
15297
  className: j.label,
15289
15298
  style: { textTransform: x ? "uppercase" : void 0 }
15290
15299
  }, d), (p || S && E === "right") && /* @__PURE__ */ React__default.createElement("span", {
15291
15300
  className: k(j.icon, j.rightIcon)
15292
- }, S && E === "right" ? M : p)));
15301
+ }, S && E === "right" ? B : p)));
15293
15302
  });
15294
15303
  _Button.displayName = "@mantine/core/Button";
15295
15304
  _Button.Group = ButtonGroup;
@@ -16201,14 +16210,14 @@ const defaultProps$c = {
16201
16210
  defaultValue: E,
16202
16211
  finalValue: !1,
16203
16212
  onChange: w
16204
- }), M = !!v, V = (D) => {
16205
- M ? (D.preventDefault(), R == null || R(D), T(!O)) : R == null || R(D);
16213
+ }), B = !!v, L = (D) => {
16214
+ B ? (D.preventDefault(), R == null || R(D), T(!O)) : R == null || R(D);
16206
16215
  };
16207
16216
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(UnstyledButton, __spreadValues$m({
16208
16217
  ref: n,
16209
16218
  className: k(j.root, u),
16210
16219
  "data-active": g || void 0,
16211
- onClick: V,
16220
+ onClick: L,
16212
16221
  unstyled: p,
16213
16222
  "data-expanded": O || void 0,
16214
16223
  "data-disabled": C || void 0,
@@ -16227,10 +16236,10 @@ const defaultProps$c = {
16227
16236
  size: "xs",
16228
16237
  "data-active": g || void 0,
16229
16238
  className: j.description
16230
- }, i)), (M || c) && /* @__PURE__ */ React__default.createElement("span", {
16239
+ }, i)), (B || c) && /* @__PURE__ */ React__default.createElement("span", {
16231
16240
  className: j.rightSection,
16232
16241
  "data-rotate": O && !A || void 0
16233
- }, M ? c || /* @__PURE__ */ React__default.createElement(ChevronIcon$1, {
16242
+ }, B ? c || /* @__PURE__ */ React__default.createElement(ChevronIcon$1, {
16234
16243
  width: rem(14),
16235
16244
  height: rem(14),
16236
16245
  style: { transform: "rotate(-90deg)" }
@@ -16427,7 +16436,7 @@ function TooltipFloating(r) {
16427
16436
  "zIndex",
16428
16437
  "disabled",
16429
16438
  "variant"
16430
- ]), { handleMouseMove: I, x: j, y: k, opened: O, boundaryRef: T, floating: M, setOpened: V } = useFloatingTooltip({
16439
+ ]), { handleMouseMove: I, x: j, y: k, opened: O, boundaryRef: T, floating: B, setOpened: L } = useFloatingTooltip({
16431
16440
  offset: v,
16432
16441
  position: S
16433
16442
  }), { classes: D, cx: W } = useStyles$h({ radius: h, color: b, multiline: E, width: w }, { name: "TooltipFloating", classNames: m, styles: p, unstyled: g, variant: C });
@@ -16435,15 +16444,15 @@ function TooltipFloating(r) {
16435
16444
  throw new Error(TOOLTIP_ERRORS.children);
16436
16445
  const J = useMergedRef(T, a.ref), F = (q) => {
16437
16446
  var G, ee;
16438
- (ee = (G = a.props).onMouseEnter) == null || ee.call(G, q), I(q), V(!0);
16439
- }, L = (q) => {
16447
+ (ee = (G = a.props).onMouseEnter) == null || ee.call(G, q), I(q), L(!0);
16448
+ }, V = (q) => {
16440
16449
  var G, ee;
16441
- (ee = (G = a.props).onMouseLeave) == null || ee.call(G, q), V(!1);
16450
+ (ee = (G = a.props).onMouseLeave) == null || ee.call(G, q), L(!1);
16442
16451
  };
16443
16452
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(OptionalPortal, __spreadProps$g(__spreadValues$j({}, c), {
16444
16453
  withinPortal: l
16445
16454
  }), /* @__PURE__ */ React__default.createElement(Box, __spreadProps$g(__spreadValues$j({}, R), {
16446
- ref: M,
16455
+ ref: B,
16447
16456
  className: W(D.tooltip, d),
16448
16457
  style: __spreadProps$g(__spreadValues$j({}, u), {
16449
16458
  zIndex: A,
@@ -16454,7 +16463,7 @@ function TooltipFloating(r) {
16454
16463
  }), x)), cloneElement(a, __spreadProps$g(__spreadValues$j({}, a.props), {
16455
16464
  [i]: J,
16456
16465
  onMouseEnter: F,
16457
- onMouseLeave: L
16466
+ onMouseLeave: V
16458
16467
  })));
16459
16468
  }
16460
16469
  TooltipFloating.displayName = "@mantine/core/TooltipFloating";
@@ -16572,13 +16581,13 @@ const defaultProps$9 = {
16572
16581
  arrowRadius: k,
16573
16582
  arrowPosition: O,
16574
16583
  offset: T,
16575
- transitionProps: M,
16576
- multiline: V,
16584
+ transitionProps: B,
16585
+ multiline: L,
16577
16586
  width: D,
16578
16587
  events: W,
16579
16588
  zIndex: J,
16580
16589
  disabled: F,
16581
- positionDependencies: L,
16590
+ positionDependencies: V,
16582
16591
  onClick: q,
16583
16592
  onMouseEnter: G,
16584
16593
  onMouseLeave: ee,
@@ -16622,7 +16631,7 @@ const defaultProps$9 = {
16622
16631
  "inline",
16623
16632
  "variant",
16624
16633
  "keepMounted"
16625
- ]), { classes: Q, cx: ne, theme: re } = useStyles$h({ radius: v, color: S, width: D, multiline: V }, { name: "Tooltip", classNames: E, styles: w, unstyled: A, variant: U }), $ = useTooltip({
16634
+ ]), { classes: Q, cx: ne, theme: re } = useStyles$h({ radius: v, color: S, width: D, multiline: L }, { name: "Tooltip", classNames: E, styles: w, unstyled: A, variant: U }), $ = useTooltip({
16626
16635
  position: getFloatingPosition(re.dir, c),
16627
16636
  closeDelay: p,
16628
16637
  openDelay: m,
@@ -16632,7 +16641,7 @@ const defaultProps$9 = {
16632
16641
  arrowRef: a,
16633
16642
  arrowOffset: j,
16634
16643
  offset: T + (R ? I / 2 : 0),
16635
- positionDependencies: [...L, l],
16644
+ positionDependencies: [...V, l],
16636
16645
  inline: z
16637
16646
  });
16638
16647
  if (!isElement$1(l))
@@ -16643,9 +16652,9 @@ const defaultProps$9 = {
16643
16652
  }), /* @__PURE__ */ React__default.createElement(Transition, __spreadProps$f(__spreadValues$i({
16644
16653
  keepMounted: te,
16645
16654
  mounted: !F && $.opened
16646
- }, M), {
16647
- transition: M.transition || "fade",
16648
- duration: $.isGroupPhase ? 10 : (o = M.duration) != null ? o : 100
16655
+ }, B), {
16656
+ transition: B.transition || "fade",
16657
+ duration: $.isGroupPhase ? 10 : (o = B.duration) != null ? o : 100
16649
16658
  }), (se) => {
16650
16659
  var K, Z;
16651
16660
  return /* @__PURE__ */ React__default.createElement(Box, __spreadValues$i(__spreadValues$i({}, _), $.getFloatingProps({
@@ -16788,13 +16797,13 @@ const defaultProps$8 = {
16788
16797
  disabled: k,
16789
16798
  onSearchChange: O,
16790
16799
  searchValue: T,
16791
- rightSection: M,
16792
- rightSectionWidth: V,
16800
+ rightSection: B,
16801
+ rightSectionWidth: L,
16793
16802
  creatable: D,
16794
16803
  getCreateLabel: W,
16795
16804
  shouldCreate: J,
16796
16805
  selectOnBlur: F,
16797
- onCreate: L,
16806
+ onCreate: V,
16798
16807
  dropdownComponent: q,
16799
16808
  onDropdownClose: G,
16800
16809
  onDropdownOpen: ee,
@@ -16862,7 +16871,7 @@ const defaultProps$8 = {
16862
16871
  "readOnly",
16863
16872
  "clearButtonProps",
16864
16873
  "hoverOnSearchChange"
16865
- ]), { classes: be, cx: Ze, theme: Ne } = useStyles$g(), [ge, Ge] = useState$1(v), [ke, ve] = useState$1(-1), He = useRef$1(), Fe = useRef$1({}), [Je, rt] = useState$1("column"), Ce = Je === "column", { scrollIntoView: De, targetRef: Ve, scrollableRef: nt } = useScrollIntoView({
16874
+ ]), { classes: be, cx: Ze, theme: Ne } = useStyles$g(), [ge, Ge] = useState$1(v), [ke, ve] = useState$1(-1), He = useRef$1(), Fe = useRef$1({}), [Je, rt] = useState$1("column"), Ce = Je === "column", { scrollIntoView: De, targetRef: Le, scrollableRef: nt } = useScrollIntoView({
16866
16875
  duration: 0,
16867
16876
  offset: 5,
16868
16877
  cancelable: !1,
@@ -16875,7 +16884,7 @@ const defaultProps$8 = {
16875
16884
  }
16876
16885
  }, qe = D && typeof W == "function";
16877
16886
  let We = null;
16878
- const ot = c.map((H) => typeof H == "string" ? { label: H, value: H } : H), Ue = groupOptions({ data: ot }), [Re, Me, Xe] = useUncontrolled({
16887
+ const ot = c.map((H) => typeof H == "string" ? { label: H, value: H } : H), Ue = groupOptions({ data: ot }), [Re, Be, Xe] = useUncontrolled({
16879
16888
  value: u,
16880
16889
  defaultValue: d,
16881
16890
  finalValue: null,
@@ -16889,7 +16898,7 @@ const defaultProps$8 = {
16889
16898
  at(H), C && typeof O == "function" && O(H);
16890
16899
  }, st = () => {
16891
16900
  var H;
16892
- Z || (Me(null), Xe || Oe(""), (H = He.current) == null || H.focus());
16901
+ Z || (Be(null), Xe || Oe(""), (H = He.current) == null || H.focus());
16893
16902
  };
16894
16903
  useEffect$1(() => {
16895
16904
  const H = Ue.find((ie) => ie.value === Re);
@@ -16900,13 +16909,13 @@ const defaultProps$8 = {
16900
16909
  const je = (H) => {
16901
16910
  if (!Z)
16902
16911
  if (Ye && (Pe == null ? void 0 : Pe.value) === H.value)
16903
- Me(null), Se(!1);
16912
+ Be(null), Se(!1);
16904
16913
  else {
16905
- if (H.creatable && typeof L == "function") {
16906
- const ie = L(H.value);
16907
- typeof ie < "u" && ie !== null && Me(typeof ie == "string" ? ie : ie.value);
16914
+ if (H.creatable && typeof V == "function") {
16915
+ const ie = V(H.value);
16916
+ typeof ie < "u" && ie !== null && Be(typeof ie == "string" ? ie : ie.value);
16908
16917
  } else
16909
- Me(H.value);
16918
+ Be(H.value);
16910
16919
  Xe || Oe(H.label), ve(-1), Se(!1), He.current.focus();
16911
16920
  }
16912
16921
  }, he = filterData({
@@ -16929,21 +16938,21 @@ const defaultProps$8 = {
16929
16938
  useDidUpdate(() => {
16930
16939
  ve(fe && Ie ? 0 : -1);
16931
16940
  }, [Ie, fe]);
16932
- const Le = Re ? he.findIndex((H) => H.value === Re) : 0, Ee = !Z && (he.length > 0 ? ge : ge && !!I), _e = () => {
16941
+ const Ve = Re ? he.findIndex((H) => H.value === Re) : 0, Ee = !Z && (he.length > 0 ? ge : ge && !!I), _e = () => {
16933
16942
  ve((H) => {
16934
16943
  var ie;
16935
16944
  const ue = Qe(H, (de) => de - 1, (de) => de > 0);
16936
- return Ve.current = Fe.current[(ie = he[ue]) == null ? void 0 : ie.value], Ee && De({ alignment: Ce ? "start" : "end" }), ue;
16945
+ return Le.current = Fe.current[(ie = he[ue]) == null ? void 0 : ie.value], Ee && De({ alignment: Ce ? "start" : "end" }), ue;
16937
16946
  });
16938
16947
  }, $e = () => {
16939
16948
  ve((H) => {
16940
16949
  var ie;
16941
16950
  const ue = Qe(H, (de) => de + 1, (de) => de < he.length - 1);
16942
- return Ve.current = Fe.current[(ie = he[ue]) == null ? void 0 : ie.value], Ee && De({ alignment: Ce ? "end" : "start" }), ue;
16951
+ return Le.current = Fe.current[(ie = he[ue]) == null ? void 0 : ie.value], Ee && De({ alignment: Ce ? "end" : "start" }), ue;
16943
16952
  });
16944
16953
  }, Ke = () => window.setTimeout(() => {
16945
16954
  var H;
16946
- Ve.current = Fe.current[(H = he[Le]) == null ? void 0 : H.value], De({ alignment: Ce ? "end" : "start" });
16955
+ Le.current = Fe.current[(H = he[Ve]) == null ? void 0 : H.value], De({ alignment: Ce ? "end" : "start" });
16947
16956
  }, 50);
16948
16957
  useDidUpdate(() => {
16949
16958
  Ee && Ke();
@@ -16951,11 +16960,11 @@ const defaultProps$8 = {
16951
16960
  const N = (H) => {
16952
16961
  switch (typeof g == "function" && g(H), H.key) {
16953
16962
  case "ArrowUp": {
16954
- H.preventDefault(), ge ? Ce ? _e() : $e() : (ve(Le), Se(!0), Ke());
16963
+ H.preventDefault(), ge ? Ce ? _e() : $e() : (ve(Ve), Se(!0), Ke());
16955
16964
  break;
16956
16965
  }
16957
16966
  case "ArrowDown": {
16958
- H.preventDefault(), ge ? Ce ? $e() : _e() : (ve(Le), Se(!0), Ke());
16967
+ H.preventDefault(), ge ? Ce ? $e() : _e() : (ve(Ve), Se(!0), Ke());
16959
16968
  break;
16960
16969
  }
16961
16970
  case "Home": {
@@ -16979,22 +16988,22 @@ const defaultProps$8 = {
16979
16988
  break;
16980
16989
  }
16981
16990
  case " ": {
16982
- C || (H.preventDefault(), he[ke] && ge ? je(he[ke]) : (Se(!0), ve(Le), Ke()));
16991
+ C || (H.preventDefault(), he[ke] && ge ? je(he[ke]) : (Se(!0), ve(Ve), Ke()));
16983
16992
  break;
16984
16993
  }
16985
16994
  case "Enter":
16986
16995
  C || H.preventDefault(), he[ke] && ge && (H.preventDefault(), je(he[ke]));
16987
16996
  }
16988
- }, B = (H) => {
16997
+ }, M = (H) => {
16989
16998
  typeof h == "function" && h(H);
16990
16999
  const ie = Ue.find((ue) => ue.value === Re);
16991
17000
  F && he[ke] && ge && je(he[ke]), Oe((ie == null ? void 0 : ie.label) || ""), Se(!1);
16992
17001
  }, Y = (H) => {
16993
17002
  typeof b == "function" && b(H), C && Se(!0);
16994
17003
  }, oe = (H) => {
16995
- Z || (Oe(H.currentTarget.value), R && H.currentTarget.value === "" && Me(null), ve(-1), Se(!0));
17004
+ Z || (Oe(H.currentTarget.value), R && H.currentTarget.value === "" && Be(null), ve(-1), Se(!0));
16996
17005
  }, ce = () => {
16997
- Z || (Se(!ge), Re && !ge && ve(Le));
17006
+ Z || (Se(!ge), Re && !ge && ve(Ve));
16998
17007
  };
16999
17008
  return /* @__PURE__ */ React__default.createElement(Input.Wrapper, __spreadProps$e(__spreadValues$h({}, i), {
17000
17009
  __staticSelector: "Select"
@@ -17042,7 +17051,7 @@ const defaultProps$8 = {
17042
17051
  "aria-controls": Ee ? `${a.id}-items` : null,
17043
17052
  "aria-activedescendant": ke >= 0 ? `${a.id}-${ke}` : null,
17044
17053
  onMouseDown: ce,
17045
- onBlur: B,
17054
+ onBlur: M,
17046
17055
  onFocus: Y,
17047
17056
  readOnly: !C || Z,
17048
17057
  disabled: k,
@@ -17053,8 +17062,8 @@ const defaultProps$8 = {
17053
17062
  })
17054
17063
  }), getSelectRightSectionProps({
17055
17064
  theme: Ne,
17056
- rightSection: M,
17057
- rightSectionWidth: V,
17065
+ rightSection: B,
17066
+ rightSectionWidth: L,
17058
17067
  styles: w,
17059
17068
  size: a.size,
17060
17069
  shouldClear: R && !!Pe,
@@ -17212,7 +17221,7 @@ const Thumb = forwardRef$1(({
17212
17221
  thumbSize: j,
17213
17222
  variant: k
17214
17223
  }, O) => {
17215
- const { classes: T, cx: M, theme: V } = useStyles$d({ color: d, disabled: R, thumbSize: j }, { name: "Slider", classNames: m, styles: p, unstyled: I, variant: k, size: g }), [D, W] = useState$1(!1), J = v || l || D || A && P;
17224
+ const { classes: T, cx: B, theme: L } = useStyles$d({ color: d, disabled: R, thumbSize: j }, { name: "Slider", classNames: m, styles: p, unstyled: I, variant: k, size: g }), [D, W] = useState$1(!1), J = v || l || D || A && P;
17216
17225
  return /* @__PURE__ */ React__default.createElement(Box, {
17217
17226
  tabIndex: 0,
17218
17227
  role: "slider",
@@ -17221,7 +17230,7 @@ const Thumb = forwardRef$1(({
17221
17230
  "aria-valuemin": n,
17222
17231
  "aria-valuenow": o,
17223
17232
  ref: O,
17224
- className: M(T.thumb, { [T.dragging]: l }),
17233
+ className: B(T.thumb, { [T.dragging]: l }),
17225
17234
  onFocus: () => {
17226
17235
  W(!0), typeof E == "function" && E();
17227
17236
  },
@@ -17232,12 +17241,12 @@ const Thumb = forwardRef$1(({
17232
17241
  onMouseDown: c,
17233
17242
  onKeyDownCapture: u,
17234
17243
  onClick: (F) => F.stopPropagation(),
17235
- style: { [V.dir === "rtl" ? "right" : "left"]: `${a}%` }
17244
+ style: { [L.dir === "rtl" ? "right" : "left"]: `${a}%` }
17236
17245
  }, C, /* @__PURE__ */ React__default.createElement(Transition, {
17237
17246
  mounted: i != null && J,
17238
17247
  duration: b,
17239
17248
  transition: h,
17240
- timingFunction: x || V.transitionTimingFunction
17249
+ timingFunction: x || L.transitionTimingFunction
17241
17250
  }, (F) => /* @__PURE__ */ React__default.createElement("div", {
17242
17251
  style: F,
17243
17252
  className: T.label
@@ -17566,8 +17575,8 @@ const defaultProps$7 = {
17566
17575
  thumbChildren: k,
17567
17576
  disabled: O,
17568
17577
  unstyled: T,
17569
- thumbSize: M,
17570
- scale: V,
17578
+ thumbSize: B,
17579
+ scale: L,
17571
17580
  inverted: D,
17572
17581
  variant: W
17573
17582
  } = o, J = __objRest$9(o, [
@@ -17600,17 +17609,17 @@ const defaultProps$7 = {
17600
17609
  "scale",
17601
17610
  "inverted",
17602
17611
  "variant"
17603
- ]), F = x ?? getPrecision(b), L = useMantineTheme(), [q, G] = useState$1(!1), [ee, z] = useUncontrolled({
17612
+ ]), F = x ?? getPrecision(b), V = useMantineTheme(), [q, G] = useState$1(!1), [ee, z] = useUncontrolled({
17604
17613
  value: typeof c == "number" ? clamp$1(c, g, h) : c,
17605
17614
  defaultValue: typeof v == "number" ? clamp$1(v, g, h) : v,
17606
17615
  finalValue: clamp$1(0, g, h),
17607
17616
  onChange: u
17608
- }), U = useRef$1(ee), te = useRef$1(), _ = useRef$1(), Q = getPosition({ value: ee, min: g, max: h }), ne = V(ee), re = typeof w == "function" ? w(ne) : w, $ = useCallback$1(({ x: Z }) => {
17617
+ }), U = useRef$1(ee), te = useRef$1(), _ = useRef$1(), Q = getPosition({ value: ee, min: g, max: h }), ne = L(ee), re = typeof w == "function" ? w(ne) : w, $ = useCallback$1(({ x: Z }) => {
17609
17618
  if (!O) {
17610
17619
  const le = getChangeValue({ value: Z, min: g, max: h, step: b, precision: F });
17611
17620
  z(le), U.current = le;
17612
17621
  }
17613
- }, [O, g, h, b, F, z]), { ref: ae, active: se } = useMove($, { onScrubEnd: () => d == null ? void 0 : d(U.current) }, L.dir), K = (Z) => {
17622
+ }, [O, g, h, b, F, z]), { ref: ae, active: se } = useMove($, { onScrubEnd: () => d == null ? void 0 : d(U.current) }, V.dir), K = (Z) => {
17614
17623
  if (!O)
17615
17624
  switch (Z.key) {
17616
17625
  case "ArrowUp": {
@@ -17621,7 +17630,7 @@ const defaultProps$7 = {
17621
17630
  }
17622
17631
  case "ArrowRight": {
17623
17632
  Z.preventDefault(), _.current.focus();
17624
- const le = getFloatingValue(Math.min(Math.max(L.dir === "rtl" ? ee - b : ee + b, g), h), F);
17633
+ const le = getFloatingValue(Math.min(Math.max(V.dir === "rtl" ? ee - b : ee + b, g), h), F);
17625
17634
  d == null || d(le), z(le);
17626
17635
  break;
17627
17636
  }
@@ -17633,7 +17642,7 @@ const defaultProps$7 = {
17633
17642
  }
17634
17643
  case "ArrowLeft": {
17635
17644
  Z.preventDefault(), _.current.focus();
17636
- const le = getFloatingValue(Math.min(Math.max(L.dir === "rtl" ? ee + b : ee - b, g), h), F);
17645
+ const le = getFloatingValue(Math.min(Math.max(V.dir === "rtl" ? ee + b : ee - b, g), h), F);
17637
17646
  d == null || d(le), z(le);
17638
17647
  break;
17639
17648
  }
@@ -17666,7 +17675,7 @@ const defaultProps$7 = {
17666
17675
  filled: Q,
17667
17676
  marks: E,
17668
17677
  size: m,
17669
- thumbSize: M,
17678
+ thumbSize: B,
17670
17679
  radius: p,
17671
17680
  color: l,
17672
17681
  min: g,
@@ -17704,7 +17713,7 @@ const defaultProps$7 = {
17704
17713
  isHovered: q,
17705
17714
  disabled: O,
17706
17715
  unstyled: T,
17707
- thumbSize: M,
17716
+ thumbSize: B,
17708
17717
  variant: W
17709
17718
  }, k)), /* @__PURE__ */ React__default.createElement("input", {
17710
17719
  type: "hidden",
@@ -18827,12 +18836,12 @@ function useWindowSplitterPanelGroupBehavior({
18827
18836
  switch (T.key) {
18828
18837
  case "Enter": {
18829
18838
  T.preventDefault();
18830
- const M = v.findIndex((V) => V.current.id === S);
18831
- if (M >= 0) {
18832
- const V = v[M], D = i[M];
18839
+ const B = v.findIndex((L) => L.current.id === S);
18840
+ if (B >= 0) {
18841
+ const L = v[B], D = i[B];
18833
18842
  if (D != null) {
18834
18843
  let W = 0;
18835
- D.toPrecision(PRECISION) <= V.current.minSize.toPrecision(PRECISION) ? W = c === "horizontal" ? p : m : W = -(c === "horizontal" ? p : m);
18844
+ D.toPrecision(PRECISION) <= L.current.minSize.toPrecision(PRECISION) ? W = c === "horizontal" ? p : m : W = -(c === "horizontal" ? p : m);
18836
18845
  const J = adjustByDelta(T, u, S, E, W, i, l.current, null);
18837
18846
  i !== J && a(J);
18838
18847
  }
@@ -19089,8 +19098,8 @@ function PanelGroupWithForwardedRef({
19089
19098
  return F;
19090
19099
  },
19091
19100
  setLayout: (F) => {
19092
- const L = F.reduce((z, U) => z + U, 0);
19093
- assert(L === 100, "Panel sizes must add up to 100%");
19101
+ const V = F.reduce((z, U) => z + U, 0);
19102
+ assert(V === 100, "Panel sizes must add up to 100%");
19094
19103
  const {
19095
19104
  panels: q
19096
19105
  } = I.current, G = w.current, ee = panelsMapToSortedArray(q);
@@ -19109,24 +19118,24 @@ function PanelGroupWithForwardedRef({
19109
19118
  const {
19110
19119
  onLayout: F
19111
19120
  } = E.current, {
19112
- panels: L,
19121
+ panels: V,
19113
19122
  sizes: q
19114
19123
  } = I.current;
19115
19124
  if (q.length > 0) {
19116
19125
  F && F(q);
19117
- const G = w.current, ee = panelsMapToSortedArray(L);
19126
+ const G = w.current, ee = panelsMapToSortedArray(V);
19118
19127
  callPanelCallbacks(ee, q, G);
19119
19128
  }
19120
19129
  }, [A]), useIsomorphicLayoutEffect(() => {
19121
19130
  if (I.current.sizes.length === x.size)
19122
19131
  return;
19123
- let L = null;
19132
+ let V = null;
19124
19133
  if (r) {
19125
19134
  const q = panelsMapToSortedArray(x);
19126
- L = loadPanelLayout(r, q, d);
19135
+ V = loadPanelLayout(r, q, d);
19127
19136
  }
19128
- if (L != null)
19129
- P(L);
19137
+ if (V != null)
19138
+ P(V);
19130
19139
  else {
19131
19140
  const q = panelsMapToSortedArray(x);
19132
19141
  let G = 0, ee = 0, z = 0;
@@ -19148,13 +19157,13 @@ function PanelGroupWithForwardedRef({
19148
19157
  debounceMap[r] || (debounceMap[r] = debounce(savePanelGroupLayout, 100)), debounceMap[r](r, F, A, d);
19149
19158
  }
19150
19159
  }, [r, x, A, d]);
19151
- const j = useCallback((F, L) => {
19160
+ const j = useCallback((F, V) => {
19152
19161
  const {
19153
19162
  panels: q
19154
19163
  } = I.current;
19155
19164
  return q.size === 0 ? {
19156
19165
  flexBasis: 0,
19157
- flexGrow: L ?? void 0,
19166
+ flexGrow: V ?? void 0,
19158
19167
  flexShrink: 1,
19159
19168
  // Without this, Panel sizes may be unintentionally overridden by their content.
19160
19169
  overflow: "hidden"
@@ -19168,12 +19177,12 @@ function PanelGroupWithForwardedRef({
19168
19177
  // This avoid edge cases like nested iframes.
19169
19178
  pointerEvents: i && h !== null ? "none" : void 0
19170
19179
  };
19171
- }, [h, i, A]), k = useCallback((F, L) => {
19180
+ }, [h, i, A]), k = useCallback((F, V) => {
19172
19181
  v((q) => {
19173
19182
  if (q.has(F))
19174
19183
  return q;
19175
19184
  const G = new Map(q);
19176
- return G.set(F, L), G;
19185
+ return G.set(F, V), G;
19177
19186
  });
19178
19187
  }, []), O = useCallback((F) => (q) => {
19179
19188
  q.preventDefault();
@@ -19196,17 +19205,17 @@ function PanelGroupWithForwardedRef({
19196
19205
  }
19197
19206
  R.current = se;
19198
19207
  }, [g]), T = useCallback((F) => {
19199
- v((L) => {
19200
- if (!L.has(F))
19201
- return L;
19202
- const q = new Map(L);
19208
+ v((V) => {
19209
+ if (!V.has(F))
19210
+ return V;
19211
+ const q = new Map(V);
19203
19212
  return q.delete(F), q;
19204
19213
  });
19205
- }, []), M = useCallback((F) => {
19214
+ }, []), B = useCallback((F) => {
19206
19215
  const {
19207
- panels: L,
19216
+ panels: V,
19208
19217
  sizes: q
19209
- } = I.current, G = L.get(F);
19218
+ } = I.current, G = V.get(F);
19210
19219
  if (G == null)
19211
19220
  return;
19212
19221
  const {
@@ -19215,7 +19224,7 @@ function PanelGroupWithForwardedRef({
19215
19224
  } = G.current;
19216
19225
  if (!z)
19217
19226
  return;
19218
- const U = panelsMapToSortedArray(L), te = U.indexOf(G);
19227
+ const U = panelsMapToSortedArray(V), te = U.indexOf(G);
19219
19228
  if (te < 0)
19220
19229
  return;
19221
19230
  const _ = q[te];
@@ -19225,16 +19234,16 @@ function PanelGroupWithForwardedRef({
19225
19234
  const [Q, ne] = getBeforeAndAfterIds(F, U);
19226
19235
  if (Q == null || ne == null)
19227
19236
  return;
19228
- const $ = te === U.length - 1 ? _ : ee - _, ae = adjustByDelta(null, L, Q, ne, $, q, C.current, null);
19237
+ const $ = te === U.length - 1 ? _ : ee - _, ae = adjustByDelta(null, V, Q, ne, $, q, C.current, null);
19229
19238
  if (q !== ae) {
19230
19239
  const se = w.current;
19231
19240
  P(ae), callPanelCallbacks(U, ae, se);
19232
19241
  }
19233
- }, []), V = useCallback((F) => {
19242
+ }, []), L = useCallback((F) => {
19234
19243
  const {
19235
- panels: L,
19244
+ panels: V,
19236
19245
  sizes: q
19237
- } = I.current, G = L.get(F);
19246
+ } = I.current, G = V.get(F);
19238
19247
  if (G == null)
19239
19248
  return;
19240
19249
  const {
@@ -19243,18 +19252,18 @@ function PanelGroupWithForwardedRef({
19243
19252
  } = G.current, U = C.current.get(F) || z;
19244
19253
  if (!U)
19245
19254
  return;
19246
- const te = panelsMapToSortedArray(L), _ = te.indexOf(G);
19255
+ const te = panelsMapToSortedArray(V), _ = te.indexOf(G);
19247
19256
  if (_ < 0 || q[_] !== ee)
19248
19257
  return;
19249
19258
  const [ne, re] = getBeforeAndAfterIds(F, te);
19250
19259
  if (ne == null || re == null)
19251
19260
  return;
19252
- const ae = _ === te.length - 1 ? ee - U : U, se = adjustByDelta(null, L, ne, re, ae, q, C.current, null);
19261
+ const ae = _ === te.length - 1 ? ee - U : U, se = adjustByDelta(null, V, ne, re, ae, q, C.current, null);
19253
19262
  if (q !== se) {
19254
19263
  const K = w.current;
19255
19264
  P(se), callPanelCallbacks(te, se, K);
19256
19265
  }
19257
- }, []), D = useCallback((F, L) => {
19266
+ }, []), D = useCallback((F, V) => {
19258
19267
  const {
19259
19268
  panels: q,
19260
19269
  sizes: G
@@ -19270,33 +19279,33 @@ function PanelGroupWithForwardedRef({
19270
19279
  if (ne < 0)
19271
19280
  return;
19272
19281
  const re = G[ne];
19273
- if (re === L)
19282
+ if (re === V)
19274
19283
  return;
19275
- U && L === z || (L = Math.min(te, Math.max(_, L)));
19284
+ U && V === z || (V = Math.min(te, Math.max(_, V)));
19276
19285
  const [$, ae] = getBeforeAndAfterIds(F, Q);
19277
19286
  if ($ == null || ae == null)
19278
19287
  return;
19279
- const K = ne === Q.length - 1 ? re - L : L - re, Z = adjustByDelta(null, q, $, ae, K, G, C.current, null);
19288
+ const K = ne === Q.length - 1 ? re - V : V - re, Z = adjustByDelta(null, q, $, ae, K, G, C.current, null);
19280
19289
  if (G !== Z) {
19281
19290
  const le = w.current;
19282
19291
  P(Z), callPanelCallbacks(Q, Z, le);
19283
19292
  }
19284
19293
  }, []), W = useMemo(() => ({
19285
19294
  activeHandleId: h,
19286
- collapsePanel: M,
19295
+ collapsePanel: B,
19287
19296
  direction: a,
19288
- expandPanel: V,
19297
+ expandPanel: L,
19289
19298
  getPanelStyle: j,
19290
19299
  groupId: g,
19291
19300
  registerPanel: k,
19292
19301
  registerResizeHandle: O,
19293
19302
  resizePanel: D,
19294
- startDragging: (F, L) => {
19295
- if (b(F), isMouseEvent(L) || isTouchEvent(L)) {
19303
+ startDragging: (F, V) => {
19304
+ if (b(F), isMouseEvent(V) || isTouchEvent(V)) {
19296
19305
  const q = getResizeHandle(F);
19297
19306
  S.current = {
19298
19307
  dragHandleRect: q.getBoundingClientRect(),
19299
- dragOffset: getDragOffset(L, F, a),
19308
+ dragOffset: getDragOffset(V, F, a),
19300
19309
  sizes: I.current.sizes
19301
19310
  };
19302
19311
  }
@@ -19305,7 +19314,7 @@ function PanelGroupWithForwardedRef({
19305
19314
  resetGlobalCursorStyle(), b(null), S.current = null;
19306
19315
  },
19307
19316
  unregisterPanel: T
19308
- }), [h, M, a, V, j, g, k, O, D, T]), J = {
19317
+ }), [h, B, a, L, j, g, k, O, D, T]), J = {
19309
19318
  display: "flex",
19310
19319
  flexDirection: a === "horizontal" ? "row" : "column",
19311
19320
  height: "100%",
@@ -19375,10 +19384,10 @@ function PanelResizeHandle$1({
19375
19384
  }, [o, S, b]), useEffect(() => {
19376
19385
  if (o || P == null || !E)
19377
19386
  return;
19378
- const j = (M) => {
19379
- P(M);
19380
- }, k = (M) => {
19381
- P(M);
19387
+ const j = (B) => {
19388
+ P(B);
19389
+ }, k = (B) => {
19390
+ P(B);
19382
19391
  }, T = u.current.ownerDocument;
19383
19392
  return T.body.addEventListener("contextmenu", R), T.body.addEventListener("mousemove", j), T.body.addEventListener("touchmove", j), T.body.addEventListener("mouseleave", k), window.addEventListener("mouseup", R), window.addEventListener("touchend", R), () => {
19384
19393
  T.body.removeEventListener("contextmenu", R), T.body.removeEventListener("mousemove", j), T.body.removeEventListener("touchmove", j), T.body.removeEventListener("mouseleave", k), window.removeEventListener("mouseup", R), window.removeEventListener("touchend", R);
@@ -22858,36 +22867,36 @@ var Prism$1 = function() {
22858
22867
  var k = P.pattern.toString().match(/[imsuy]*$/)[0];
22859
22868
  P.pattern = RegExp(P.pattern.source, k + "g");
22860
22869
  }
22861
- for (var O = P.pattern || P, T = x.next, M = v; T !== h.tail && !(S && M >= S.reach); M += T.value.length, T = T.next) {
22862
- var V = T.value;
22870
+ for (var O = P.pattern || P, T = x.next, B = v; T !== h.tail && !(S && B >= S.reach); B += T.value.length, T = T.next) {
22871
+ var L = T.value;
22863
22872
  if (h.length > g.length)
22864
22873
  return;
22865
- if (!(V instanceof i)) {
22874
+ if (!(L instanceof i)) {
22866
22875
  var D = 1, W;
22867
22876
  if (I) {
22868
- if (W = l(O, M, g, R), !W || W.index >= g.length)
22877
+ if (W = l(O, B, g, R), !W || W.index >= g.length)
22869
22878
  break;
22870
- var q = W.index, J = W.index + W[0].length, F = M;
22879
+ var q = W.index, J = W.index + W[0].length, F = B;
22871
22880
  for (F += T.value.length; q >= F; )
22872
22881
  T = T.next, F += T.value.length;
22873
- if (F -= T.value.length, M = F, T.value instanceof i)
22882
+ if (F -= T.value.length, B = F, T.value instanceof i)
22874
22883
  continue;
22875
- for (var L = T; L !== h.tail && (F < J || typeof L.value == "string"); L = L.next)
22876
- D++, F += L.value.length;
22877
- D--, V = g.slice(M, F), W.index -= M;
22878
- } else if (W = l(O, 0, V, R), !W)
22884
+ for (var V = T; V !== h.tail && (F < J || typeof V.value == "string"); V = V.next)
22885
+ D++, F += V.value.length;
22886
+ D--, L = g.slice(B, F), W.index -= B;
22887
+ } else if (W = l(O, 0, L, R), !W)
22879
22888
  continue;
22880
- var q = W.index, G = W[0], ee = V.slice(0, q), z = V.slice(q + G.length), U = M + V.length;
22889
+ var q = W.index, G = W[0], ee = L.slice(0, q), z = L.slice(q + G.length), U = B + L.length;
22881
22890
  S && U > S.reach && (S.reach = U);
22882
22891
  var te = T.prev;
22883
- ee && (te = d(h, te, ee), M += ee.length), m(h, te, D);
22892
+ ee && (te = d(h, te, ee), B += ee.length), m(h, te, D);
22884
22893
  var _ = new i(E, C ? a.tokenize(G, C) : G, j, G);
22885
22894
  if (T = d(h, te, _), z && d(h, T, z), D > 1) {
22886
22895
  var Q = {
22887
22896
  cause: E + "," + A,
22888
22897
  reach: U
22889
22898
  };
22890
- c(g, h, b, T.prev, M, Q), S && Q.reach > S.reach && (S.reach = Q.reach);
22899
+ c(g, h, b, T.prev, B, Q), S && Q.reach > S.reach && (S.reach = Q.reach);
22891
22900
  }
22892
22901
  }
22893
22902
  }
@@ -24382,19 +24391,19 @@ prism.languages.sql = {
24382
24391
  var O = C[E], T = typeof k == "string" ? k : (
24383
24392
  /** @type {string} */
24384
24393
  k.content
24385
- ), M = T.indexOf(O);
24386
- if (M !== -1) {
24394
+ ), B = T.indexOf(O);
24395
+ if (B !== -1) {
24387
24396
  ++E;
24388
- var V = T.substring(0, M), D = m(w[O]), W = T.substring(M + O.length), J = [];
24389
- if (V && J.push(V), J.push(D), W) {
24397
+ var L = T.substring(0, B), D = m(w[O]), W = T.substring(B + O.length), J = [];
24398
+ if (L && J.push(L), J.push(D), W) {
24390
24399
  var F = [W];
24391
24400
  R(F), J.push.apply(J, F);
24392
24401
  }
24393
24402
  typeof k == "string" ? (I.splice.apply(I, [j, 1].concat(J)), j += J.length - 1) : k.content = J;
24394
24403
  }
24395
24404
  } else {
24396
- var L = k.content;
24397
- Array.isArray(L) ? R(L) : R([L]);
24405
+ var V = k.content;
24406
+ Array.isArray(V) ? R(V) : R([V]);
24398
24407
  }
24399
24408
  }
24400
24409
  }
@@ -25926,8 +25935,8 @@ const prismDefaultProps = {
25926
25935
  code: C,
25927
25936
  language: l
25928
25937
  }), ({
25929
- className: M,
25930
- style: V,
25938
+ className: B,
25939
+ style: L,
25931
25940
  tokens: D,
25932
25941
  getLineProps: W,
25933
25942
  getTokenProps: J
@@ -25935,15 +25944,15 @@ const prismDefaultProps = {
25935
25944
  className: O.scrollArea,
25936
25945
  dir: "ltr"
25937
25946
  }, /* @__PURE__ */ React__default.createElement("pre", {
25938
- className: T(O.code, M),
25939
- style: V,
25947
+ className: T(O.code, B),
25948
+ style: L,
25940
25949
  dir: "ltr"
25941
- }, D.map((F, L) => {
25950
+ }, D.map((F, V) => {
25942
25951
  var q, G, ee, z;
25943
- if (L === D.length - 1 && F.length === 1 && F[0].content === `
25952
+ if (V === D.length - 1 && F.length === 1 && F[0].content === `
25944
25953
  `)
25945
25954
  return null;
25946
- const U = L + 1, te = W({ line: F, key: L }), _ = U in h, Q = k === "dark" ? I.fn.rgba(I.fn.themeColor((q = h[U]) == null ? void 0 : q.color, 9), 0.25) : I.fn.themeColor((G = h[U]) == null ? void 0 : G.color, 0);
25955
+ const U = V + 1, te = W({ line: F, key: V }), _ = U in h, Q = k === "dark" ? I.fn.rgba(I.fn.themeColor((q = h[U]) == null ? void 0 : q.color, 9), 0.25) : I.fn.themeColor((G = h[U]) == null ? void 0 : G.color, 0);
25947
25956
  return /* @__PURE__ */ React__default.createElement("div", __spreadProps$2(__spreadValues$2({}, te), {
25948
25957
  className: T(O.line, te.className),
25949
25958
  style: __spreadValues$2({}, _ ? { backgroundColor: Q } : null)
@@ -26088,90 +26097,6 @@ PrismExport.Tabs = PrismTabs;
26088
26097
  PrismExport.Tab = Tabs.Tab;
26089
26098
  PrismExport.TabsList = Tabs.List;
26090
26099
  PrismExport.Panel = PrismPanel;
26091
- const ErrorBoundaryContext = createContext$1(null), initialState = {
26092
- didCatch: !1,
26093
- error: null
26094
- };
26095
- let ErrorBoundary$1 = class extends Component {
26096
- constructor(n) {
26097
- super(n), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = initialState;
26098
- }
26099
- static getDerivedStateFromError(n) {
26100
- return {
26101
- didCatch: !0,
26102
- error: n
26103
- };
26104
- }
26105
- resetErrorBoundary() {
26106
- const {
26107
- error: n
26108
- } = this.state;
26109
- if (n !== null) {
26110
- for (var o, a, i = arguments.length, l = new Array(i), c = 0; c < i; c++)
26111
- l[c] = arguments[c];
26112
- (o = (a = this.props).onReset) === null || o === void 0 || o.call(a, {
26113
- args: l,
26114
- reason: "imperative-api"
26115
- }), this.setState(initialState);
26116
- }
26117
- }
26118
- componentDidCatch(n, o) {
26119
- var a, i;
26120
- (a = (i = this.props).onError) === null || a === void 0 || a.call(i, n, o);
26121
- }
26122
- componentDidUpdate(n, o) {
26123
- const {
26124
- didCatch: a
26125
- } = this.state, {
26126
- resetKeys: i
26127
- } = this.props;
26128
- if (a && o.error !== null && hasArrayChanged(n.resetKeys, i)) {
26129
- var l, c;
26130
- (l = (c = this.props).onReset) === null || l === void 0 || l.call(c, {
26131
- next: i,
26132
- prev: n.resetKeys,
26133
- reason: "keys"
26134
- }), this.setState(initialState);
26135
- }
26136
- }
26137
- render() {
26138
- const {
26139
- children: n,
26140
- fallbackRender: o,
26141
- FallbackComponent: a,
26142
- fallback: i
26143
- } = this.props, {
26144
- didCatch: l,
26145
- error: c
26146
- } = this.state;
26147
- let u = n;
26148
- if (l) {
26149
- const d = {
26150
- error: c,
26151
- resetErrorBoundary: this.resetErrorBoundary
26152
- };
26153
- if (isValidElement(i))
26154
- u = i;
26155
- else if (typeof o == "function")
26156
- u = o(d);
26157
- else if (a)
26158
- u = createElement$1(a, d);
26159
- else
26160
- throw c;
26161
- }
26162
- return createElement$1(ErrorBoundaryContext.Provider, {
26163
- value: {
26164
- didCatch: l,
26165
- error: c,
26166
- resetErrorBoundary: this.resetErrorBoundary
26167
- }
26168
- }, u);
26169
- }
26170
- };
26171
- function hasArrayChanged() {
26172
- let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
26173
- return r.length !== n.length || r.some((o, a) => !Object.is(o, n[a]));
26174
- }
26175
26100
  var diffMatchPatch = { exports: {} };
26176
26101
  (function(r) {
26177
26102
  var n = function() {
@@ -26269,26 +26194,26 @@ var diffMatchPatch = { exports: {} };
26269
26194
  else if (E) {
26270
26195
  var T = g + S - I;
26271
26196
  if (T >= 0 && T < h && x[T] != -1) {
26272
- var M = d - x[T];
26273
- if (k >= M)
26197
+ var B = d - x[T];
26198
+ if (k >= B)
26274
26199
  return this.diff_bisectSplit_(l, c, k, O, u);
26275
26200
  }
26276
26201
  }
26277
26202
  }
26278
- for (var V = -R + P; V <= R - C; V += 2) {
26279
- var T = g + V, M;
26280
- V == -R || V != R && x[T - 1] < x[T + 1] ? M = x[T + 1] : M = x[T - 1] + 1;
26281
- for (var D = M - V; M < d && D < m && l.charAt(d - M - 1) == c.charAt(m - D - 1); )
26282
- M++, D++;
26283
- if (x[T] = M, M > d)
26203
+ for (var L = -R + P; L <= R - C; L += 2) {
26204
+ var T = g + L, B;
26205
+ L == -R || L != R && x[T - 1] < x[T + 1] ? B = x[T + 1] : B = x[T - 1] + 1;
26206
+ for (var D = B - L; B < d && D < m && l.charAt(d - B - 1) == c.charAt(m - D - 1); )
26207
+ B++, D++;
26208
+ if (x[T] = B, B > d)
26284
26209
  C += 2;
26285
26210
  else if (D > m)
26286
26211
  P += 2;
26287
26212
  else if (!E) {
26288
- var j = g + S - V;
26213
+ var j = g + S - L;
26289
26214
  if (j >= 0 && j < h && b[j] != -1) {
26290
26215
  var k = b[j], O = g + k - j;
26291
- if (M = d - M, k >= M)
26216
+ if (B = d - B, k >= B)
26292
26217
  return this.diff_bisectSplit_(l, c, k, O, u);
26293
26218
  }
26294
26219
  }
@@ -26357,21 +26282,21 @@ var diffMatchPatch = { exports: {} };
26357
26282
  return null;
26358
26283
  var m = this;
26359
26284
  function p(A, P, C) {
26360
- for (var R = A.substring(C, C + Math.floor(A.length / 4)), I = -1, j = "", k, O, T, M; (I = P.indexOf(R, I + 1)) != -1; ) {
26361
- var V = m.diff_commonPrefix(
26285
+ for (var R = A.substring(C, C + Math.floor(A.length / 4)), I = -1, j = "", k, O, T, B; (I = P.indexOf(R, I + 1)) != -1; ) {
26286
+ var L = m.diff_commonPrefix(
26362
26287
  A.substring(C),
26363
26288
  P.substring(I)
26364
26289
  ), D = m.diff_commonSuffix(
26365
26290
  A.substring(0, C),
26366
26291
  P.substring(0, I)
26367
26292
  );
26368
- j.length < D + V && (j = P.substring(I - D, I) + P.substring(I, I + V), k = A.substring(0, C - D), O = A.substring(C + V), T = P.substring(0, I - D), M = P.substring(I + V));
26293
+ j.length < D + L && (j = P.substring(I - D, I) + P.substring(I, I + L), k = A.substring(0, C - D), O = A.substring(C + L), T = P.substring(0, I - D), B = P.substring(I + L));
26369
26294
  }
26370
26295
  return j.length * 2 >= A.length ? [
26371
26296
  k,
26372
26297
  O,
26373
26298
  T,
26374
- M,
26299
+ B,
26375
26300
  j
26376
26301
  ] : null;
26377
26302
  }
@@ -26418,8 +26343,8 @@ var diffMatchPatch = { exports: {} };
26418
26343
  function c(w, A) {
26419
26344
  if (!w || !A)
26420
26345
  return 6;
26421
- var P = w.charAt(w.length - 1), C = A.charAt(0), R = P.match(n.nonAlphaNumericRegex_), I = C.match(n.nonAlphaNumericRegex_), j = R && P.match(n.whitespaceRegex_), k = I && C.match(n.whitespaceRegex_), O = j && P.match(n.linebreakRegex_), T = k && C.match(n.linebreakRegex_), M = O && w.match(n.blanklineEndRegex_), V = T && A.match(n.blanklineStartRegex_);
26422
- return M || V ? 5 : O || T ? 4 : R && !j && k ? 3 : j || k ? 2 : R || I ? 1 : 0;
26346
+ var P = w.charAt(w.length - 1), C = A.charAt(0), R = P.match(n.nonAlphaNumericRegex_), I = C.match(n.nonAlphaNumericRegex_), j = R && P.match(n.whitespaceRegex_), k = I && C.match(n.whitespaceRegex_), O = j && P.match(n.linebreakRegex_), T = k && C.match(n.linebreakRegex_), B = O && w.match(n.blanklineEndRegex_), L = T && A.match(n.blanklineStartRegex_);
26347
+ return B || L ? 5 : O || T ? 4 : R && !j && k ? 3 : j || k ? 2 : R || I ? 1 : 0;
26423
26348
  }
26424
26349
  for (var u = 1; u < l.length - 1; ) {
26425
26350
  if (l[u - 1][0] == i && l[u + 1][0] == i) {
@@ -26570,8 +26495,8 @@ var diffMatchPatch = { exports: {} };
26570
26495
  throw new Error("Pattern too long for this browser.");
26571
26496
  var d = this.match_alphabet_(c), m = this;
26572
26497
  function p(k, O) {
26573
- var T = k / c.length, M = Math.abs(u - O);
26574
- return m.Match_Distance ? T + M / m.Match_Distance : M ? 1 : T;
26498
+ var T = k / c.length, B = Math.abs(u - O);
26499
+ return m.Match_Distance ? T + B / m.Match_Distance : B ? 1 : T;
26575
26500
  }
26576
26501
  var g = this.Match_Threshold, h = l.indexOf(c, u);
26577
26502
  h != -1 && (g = Math.min(p(0, h), g), h = l.lastIndexOf(c, u + c.length), h != -1 && (g = Math.min(p(0, h), g)));
@@ -28521,7 +28446,7 @@ var require_react_is_production_min = __commonJS({
28521
28446
  }
28522
28447
  }
28523
28448
  }
28524
- var R = m, I = p, j = d, k = u, O = o, T = g, M = i, V = v, D = x, W = a, J = c, F = l, L = h, q = !1;
28449
+ var R = m, I = p, j = d, k = u, O = o, T = g, B = i, L = v, D = x, W = a, J = c, F = l, V = h, q = !1;
28525
28450
  function G(Z) {
28526
28451
  return q || (q = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), ee(Z) || C(Z) === m;
28527
28452
  }
@@ -28561,7 +28486,7 @@ var require_react_is_production_min = __commonJS({
28561
28486
  function K(Z) {
28562
28487
  return C(Z) === h;
28563
28488
  }
28564
- r.AsyncMode = R, r.ConcurrentMode = I, r.ContextConsumer = j, r.ContextProvider = k, r.Element = O, r.ForwardRef = T, r.Fragment = M, r.Lazy = V, r.Memo = D, r.Portal = W, r.Profiler = J, r.StrictMode = F, r.Suspense = L, r.isAsyncMode = G, r.isConcurrentMode = ee, r.isContextConsumer = z, r.isContextProvider = U, r.isElement = te, r.isForwardRef = _, r.isFragment = Q, r.isLazy = ne, r.isMemo = re, r.isPortal = $, r.isProfiler = ae, r.isStrictMode = se, r.isSuspense = K, r.isValidElementType = P, r.typeOf = C;
28489
+ r.AsyncMode = R, r.ConcurrentMode = I, r.ContextConsumer = j, r.ContextProvider = k, r.Element = O, r.ForwardRef = T, r.Fragment = B, r.Lazy = L, r.Memo = D, r.Portal = W, r.Profiler = J, r.StrictMode = F, r.Suspense = V, r.isAsyncMode = G, r.isConcurrentMode = ee, r.isContextConsumer = z, r.isContextProvider = U, r.isElement = te, r.isForwardRef = _, r.isFragment = Q, r.isLazy = ne, r.isMemo = re, r.isPortal = $, r.isProfiler = ae, r.isStrictMode = se, r.isSuspense = K, r.isValidElementType = P, r.typeOf = C;
28565
28490
  }();
28566
28491
  }
28567
28492
  }), require_react_is = __commonJS({
@@ -28706,7 +28631,7 @@ var require_react_is_production_min = __commonJS({
28706
28631
  element: R(),
28707
28632
  elementType: I(),
28708
28633
  instanceOf: j,
28709
- node: M(),
28634
+ node: B(),
28710
28635
  objectOf: O,
28711
28636
  oneOf: k,
28712
28637
  oneOfType: T,
@@ -28745,7 +28670,7 @@ var require_react_is_production_min = __commonJS({
28745
28670
  }
28746
28671
  function A(z) {
28747
28672
  function U(te, _, Q, ne, re, $) {
28748
- var ae = te[_], se = L(ae);
28673
+ var ae = te[_], se = V(ae);
28749
28674
  if (se !== z) {
28750
28675
  var K = q(ae);
28751
28676
  return new E(
@@ -28766,7 +28691,7 @@ var require_react_is_production_min = __commonJS({
28766
28691
  return new E("Property `" + re + "` of component `" + Q + "` has invalid PropType notation inside arrayOf.");
28767
28692
  var $ = te[_];
28768
28693
  if (!Array.isArray($)) {
28769
- var ae = L($);
28694
+ var ae = V($);
28770
28695
  return new E("Invalid " + ne + " `" + re + "` of type " + ("`" + ae + "` supplied to `" + Q + "`, expected an array."));
28771
28696
  }
28772
28697
  for (var se = 0; se < $.length; se++) {
@@ -28782,7 +28707,7 @@ var require_react_is_production_min = __commonJS({
28782
28707
  function z(U, te, _, Q, ne) {
28783
28708
  var re = U[te];
28784
28709
  if (!m(re)) {
28785
- var $ = L(re);
28710
+ var $ = V(re);
28786
28711
  return new E("Invalid " + Q + " `" + ne + "` of type " + ("`" + $ + "` supplied to `" + _ + "`, expected a single ReactElement."));
28787
28712
  }
28788
28713
  return null;
@@ -28793,7 +28718,7 @@ var require_react_is_production_min = __commonJS({
28793
28718
  function z(U, te, _, Q, ne) {
28794
28719
  var re = U[te];
28795
28720
  if (!o.isValidElementType(re)) {
28796
- var $ = L(re);
28721
+ var $ = V(re);
28797
28722
  return new E("Invalid " + Q + " `" + ne + "` of type " + ("`" + $ + "` supplied to `" + _ + "`, expected a single ReactElement type."));
28798
28723
  }
28799
28724
  return null;
@@ -28831,7 +28756,7 @@ var require_react_is_production_min = __commonJS({
28831
28756
  function U(te, _, Q, ne, re) {
28832
28757
  if (typeof z != "function")
28833
28758
  return new E("Property `" + re + "` of component `" + Q + "` has invalid PropType notation inside objectOf.");
28834
- var $ = te[_], ae = L($);
28759
+ var $ = te[_], ae = V($);
28835
28760
  if (ae !== "object")
28836
28761
  return new E("Invalid " + ne + " `" + re + "` of type " + ("`" + ae + "` supplied to `" + Q + "`, expected an object."));
28837
28762
  for (var se in $)
@@ -28866,26 +28791,26 @@ var require_react_is_production_min = __commonJS({
28866
28791
  }
28867
28792
  return w(_);
28868
28793
  }
28869
- function M() {
28794
+ function B() {
28870
28795
  function z(U, te, _, Q, ne) {
28871
28796
  return J(U[te]) ? null : new E("Invalid " + Q + " `" + ne + "` supplied to " + ("`" + _ + "`, expected a ReactNode."));
28872
28797
  }
28873
28798
  return w(z);
28874
28799
  }
28875
- function V(z, U, te, _, Q) {
28800
+ function L(z, U, te, _, Q) {
28876
28801
  return new E(
28877
28802
  (z || "React class") + ": " + U + " type `" + te + "." + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + Q + "`."
28878
28803
  );
28879
28804
  }
28880
28805
  function D(z) {
28881
28806
  function U(te, _, Q, ne, re) {
28882
- var $ = te[_], ae = L($);
28807
+ var $ = te[_], ae = V($);
28883
28808
  if (ae !== "object")
28884
28809
  return new E("Invalid " + ne + " `" + re + "` of type `" + ae + "` " + ("supplied to `" + Q + "`, expected `object`."));
28885
28810
  for (var se in z) {
28886
28811
  var K = z[se];
28887
28812
  if (typeof K != "function")
28888
- return V(Q, ne, re, se, q(K));
28813
+ return L(Q, ne, re, se, q(K));
28889
28814
  var Z = K($, se, Q, ne, re + "." + se, i);
28890
28815
  if (Z)
28891
28816
  return Z;
@@ -28896,14 +28821,14 @@ var require_react_is_production_min = __commonJS({
28896
28821
  }
28897
28822
  function W(z) {
28898
28823
  function U(te, _, Q, ne, re) {
28899
- var $ = te[_], ae = L($);
28824
+ var $ = te[_], ae = V($);
28900
28825
  if (ae !== "object")
28901
28826
  return new E("Invalid " + ne + " `" + re + "` of type `" + ae + "` " + ("supplied to `" + Q + "`, expected `object`."));
28902
28827
  var se = a({}, te[_], z);
28903
28828
  for (var K in se) {
28904
28829
  var Z = z[K];
28905
28830
  if (l(z, K) && typeof Z != "function")
28906
- return V(Q, ne, re, K, q(Z));
28831
+ return L(Q, ne, re, K, q(Z));
28907
28832
  if (!Z)
28908
28833
  return new E(
28909
28834
  "Invalid " + ne + " `" + re + "` key `" + K + "` supplied to `" + Q + "`.\nBad object: " + JSON.stringify(te[_], null, " ") + `
@@ -28953,14 +28878,14 @@ Valid keys: ` + JSON.stringify(Object.keys(z), null, " ")
28953
28878
  function F(z, U) {
28954
28879
  return z === "symbol" ? !0 : U ? U["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && U instanceof Symbol : !1;
28955
28880
  }
28956
- function L(z) {
28881
+ function V(z) {
28957
28882
  var U = typeof z;
28958
28883
  return Array.isArray(z) ? "array" : z instanceof RegExp ? "object" : F(U, z) ? "symbol" : U;
28959
28884
  }
28960
28885
  function q(z) {
28961
28886
  if (typeof z > "u" || z === null)
28962
28887
  return "" + z;
28963
- var U = L(z);
28888
+ var U = V(z);
28964
28889
  if (U === "object") {
28965
28890
  if (z instanceof Date)
28966
28891
  return "date";
@@ -30091,10 +30016,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
30091
30016
  r.marrakesh = n(O);
30092
30017
  var T = require_mocha();
30093
30018
  r.mocha = n(T);
30094
- var M = require_monokai();
30095
- r.monokai = n(M);
30096
- var V = require_ocean();
30097
- r.ocean = n(V);
30019
+ var B = require_monokai();
30020
+ r.monokai = n(B);
30021
+ var L = require_ocean();
30022
+ r.ocean = n(L);
30098
30023
  var D = require_paraiso();
30099
30024
  r.paraiso = n(D);
30100
30025
  var W = require_pop();
@@ -30103,8 +30028,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
30103
30028
  r.railscasts = n(J);
30104
30029
  var F = require_shapeshifter();
30105
30030
  r.shapeshifter = n(F);
30106
- var L = require_solarized();
30107
- r.solarized = n(L);
30031
+ var V = require_solarized();
30032
+ r.solarized = n(V);
30108
30033
  var q = require_summerfruit();
30109
30034
  r.summerfruit = n(q);
30110
30035
  var G = require_tomorrow();
@@ -31147,67 +31072,67 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
31147
31072
  ["partial", m],
31148
31073
  ["partialRight", p],
31149
31074
  ["rearg", h]
31150
- ], A = "[object Function]", P = "[object GeneratorFunction]", C = "[object Symbol]", R = /[\\^$.*+?()[\]{}|]/g, I = /^\s+|\s+$/g, j = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, k = /\{\n\/\* \[wrapped with (.+)\] \*/, O = /,? & /, T = /^[-+]0x[0-9a-f]+$/i, M = /^0b[01]+$/i, V = /^\[object .+?Constructor\]$/, D = /^0o[0-7]+$/i, W = /^(?:0|[1-9]\d*)$/, J = parseInt, F = typeof global == "object" && global && global.Object === Object && global, L = typeof self == "object" && self && self.Object === Object && self, q = F || L || Function("return this")();
31151
- function G(N, B, Y) {
31075
+ ], A = "[object Function]", P = "[object GeneratorFunction]", C = "[object Symbol]", R = /[\\^$.*+?()[\]{}|]/g, I = /^\s+|\s+$/g, j = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, k = /\{\n\/\* \[wrapped with (.+)\] \*/, O = /,? & /, T = /^[-+]0x[0-9a-f]+$/i, B = /^0b[01]+$/i, L = /^\[object .+?Constructor\]$/, D = /^0o[0-7]+$/i, W = /^(?:0|[1-9]\d*)$/, J = parseInt, F = typeof global == "object" && global && global.Object === Object && global, V = typeof self == "object" && self && self.Object === Object && self, q = F || V || Function("return this")();
31076
+ function G(N, M, Y) {
31152
31077
  switch (Y.length) {
31153
31078
  case 0:
31154
- return N.call(B);
31079
+ return N.call(M);
31155
31080
  case 1:
31156
- return N.call(B, Y[0]);
31081
+ return N.call(M, Y[0]);
31157
31082
  case 2:
31158
- return N.call(B, Y[0], Y[1]);
31083
+ return N.call(M, Y[0], Y[1]);
31159
31084
  case 3:
31160
- return N.call(B, Y[0], Y[1], Y[2]);
31085
+ return N.call(M, Y[0], Y[1], Y[2]);
31161
31086
  }
31162
- return N.apply(B, Y);
31087
+ return N.apply(M, Y);
31163
31088
  }
31164
- function ee(N, B) {
31165
- for (var Y = -1, oe = N ? N.length : 0; ++Y < oe && B(N[Y], Y, N) !== !1; )
31089
+ function ee(N, M) {
31090
+ for (var Y = -1, oe = N ? N.length : 0; ++Y < oe && M(N[Y], Y, N) !== !1; )
31166
31091
  ;
31167
31092
  return N;
31168
31093
  }
31169
- function z(N, B) {
31094
+ function z(N, M) {
31170
31095
  var Y = N ? N.length : 0;
31171
- return !!Y && te(N, B, 0) > -1;
31096
+ return !!Y && te(N, M, 0) > -1;
31172
31097
  }
31173
- function U(N, B, Y, oe) {
31098
+ function U(N, M, Y, oe) {
31174
31099
  for (var ce = N.length, H = Y + (oe ? 1 : -1); oe ? H-- : ++H < ce; )
31175
- if (B(N[H], H, N))
31100
+ if (M(N[H], H, N))
31176
31101
  return H;
31177
31102
  return -1;
31178
31103
  }
31179
- function te(N, B, Y) {
31180
- if (B !== B)
31104
+ function te(N, M, Y) {
31105
+ if (M !== M)
31181
31106
  return U(N, _, Y);
31182
31107
  for (var oe = Y - 1, ce = N.length; ++oe < ce; )
31183
- if (N[oe] === B)
31108
+ if (N[oe] === M)
31184
31109
  return oe;
31185
31110
  return -1;
31186
31111
  }
31187
31112
  function _(N) {
31188
31113
  return N !== N;
31189
31114
  }
31190
- function Q(N, B) {
31115
+ function Q(N, M) {
31191
31116
  for (var Y = N.length, oe = 0; Y--; )
31192
- N[Y] === B && oe++;
31117
+ N[Y] === M && oe++;
31193
31118
  return oe;
31194
31119
  }
31195
- function ne(N, B) {
31196
- return N == null ? void 0 : N[B];
31120
+ function ne(N, M) {
31121
+ return N == null ? void 0 : N[M];
31197
31122
  }
31198
31123
  function re(N) {
31199
- var B = !1;
31124
+ var M = !1;
31200
31125
  if (N != null && typeof N.toString != "function")
31201
31126
  try {
31202
- B = !!(N + "");
31127
+ M = !!(N + "");
31203
31128
  } catch {
31204
31129
  }
31205
- return B;
31130
+ return M;
31206
31131
  }
31207
- function $(N, B) {
31132
+ function $(N, M) {
31208
31133
  for (var Y = -1, oe = N.length, ce = 0, H = []; ++Y < oe; ) {
31209
31134
  var ie = N[Y];
31210
- (ie === B || ie === a) && (N[Y] = a, H[ce++] = Y);
31135
+ (ie === M || ie === a) && (N[Y] = a, H[ce++] = Y);
31211
31136
  }
31212
31137
  return H;
31213
31138
  }
@@ -31217,44 +31142,44 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
31217
31142
  }(), le = ae.toString, fe = se.hasOwnProperty, Te = se.toString, be = RegExp(
31218
31143
  "^" + le.call(fe).replace(R, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
31219
31144
  ), Ze = Object.create, Ne = Math.max, ge = Math.min, Ge = function() {
31220
- var N = We(Object, "defineProperty"), B = We.name;
31221
- return B && B.length > 2 ? N : void 0;
31145
+ var N = We(Object, "defineProperty"), M = We.name;
31146
+ return M && M.length > 2 ? N : void 0;
31222
31147
  }();
31223
31148
  function ke(N) {
31224
31149
  return je(N) ? Ze(N) : {};
31225
31150
  }
31226
31151
  function ve(N) {
31227
- if (!je(N) || Me(N))
31152
+ if (!je(N) || Be(N))
31228
31153
  return !1;
31229
- var B = st(N) || re(N) ? be : V;
31230
- return B.test(Ie(N));
31154
+ var M = st(N) || re(N) ? be : L;
31155
+ return M.test(Ie(N));
31231
31156
  }
31232
- function He(N, B, Y, oe) {
31233
- for (var ce = -1, H = N.length, ie = Y.length, ue = -1, de = B.length, me = Ne(H - ie, 0), pe = Array(de + me), xe = !oe; ++ue < de; )
31234
- pe[ue] = B[ue];
31157
+ function He(N, M, Y, oe) {
31158
+ for (var ce = -1, H = N.length, ie = Y.length, ue = -1, de = M.length, me = Ne(H - ie, 0), pe = Array(de + me), xe = !oe; ++ue < de; )
31159
+ pe[ue] = M[ue];
31235
31160
  for (; ++ce < ie; )
31236
31161
  (xe || ce < H) && (pe[Y[ce]] = N[ce]);
31237
31162
  for (; me--; )
31238
31163
  pe[ue++] = N[ce++];
31239
31164
  return pe;
31240
31165
  }
31241
- function Fe(N, B, Y, oe) {
31242
- for (var ce = -1, H = N.length, ie = -1, ue = Y.length, de = -1, me = B.length, pe = Ne(H - ue, 0), xe = Array(pe + me), ye = !oe; ++ce < pe; )
31166
+ function Fe(N, M, Y, oe) {
31167
+ for (var ce = -1, H = N.length, ie = -1, ue = Y.length, de = -1, me = M.length, pe = Ne(H - ue, 0), xe = Array(pe + me), ye = !oe; ++ce < pe; )
31243
31168
  xe[ce] = N[ce];
31244
31169
  for (var we = ce; ++de < me; )
31245
- xe[we + de] = B[de];
31170
+ xe[we + de] = M[de];
31246
31171
  for (; ++ie < ue; )
31247
31172
  (ye || ce < H) && (xe[we + Y[ie]] = N[ce++]);
31248
31173
  return xe;
31249
31174
  }
31250
- function Je(N, B) {
31175
+ function Je(N, M) {
31251
31176
  var Y = -1, oe = N.length;
31252
- for (B || (B = Array(oe)); ++Y < oe; )
31253
- B[Y] = N[Y];
31254
- return B;
31177
+ for (M || (M = Array(oe)); ++Y < oe; )
31178
+ M[Y] = N[Y];
31179
+ return M;
31255
31180
  }
31256
- function rt(N, B, Y) {
31257
- var oe = B & i, ce = Ce(N);
31181
+ function rt(N, M, Y) {
31182
+ var oe = M & i, ce = Ce(N);
31258
31183
  function H() {
31259
31184
  var ie = this && this !== q && this instanceof H ? ce : N;
31260
31185
  return ie.apply(oe ? Y : this, arguments);
@@ -31263,30 +31188,30 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
31263
31188
  }
31264
31189
  function Ce(N) {
31265
31190
  return function() {
31266
- var B = arguments;
31267
- switch (B.length) {
31191
+ var M = arguments;
31192
+ switch (M.length) {
31268
31193
  case 0:
31269
31194
  return new N();
31270
31195
  case 1:
31271
- return new N(B[0]);
31196
+ return new N(M[0]);
31272
31197
  case 2:
31273
- return new N(B[0], B[1]);
31198
+ return new N(M[0], M[1]);
31274
31199
  case 3:
31275
- return new N(B[0], B[1], B[2]);
31200
+ return new N(M[0], M[1], M[2]);
31276
31201
  case 4:
31277
- return new N(B[0], B[1], B[2], B[3]);
31202
+ return new N(M[0], M[1], M[2], M[3]);
31278
31203
  case 5:
31279
- return new N(B[0], B[1], B[2], B[3], B[4]);
31204
+ return new N(M[0], M[1], M[2], M[3], M[4]);
31280
31205
  case 6:
31281
- return new N(B[0], B[1], B[2], B[3], B[4], B[5]);
31206
+ return new N(M[0], M[1], M[2], M[3], M[4], M[5]);
31282
31207
  case 7:
31283
- return new N(B[0], B[1], B[2], B[3], B[4], B[5], B[6]);
31208
+ return new N(M[0], M[1], M[2], M[3], M[4], M[5], M[6]);
31284
31209
  }
31285
- var Y = ke(N.prototype), oe = N.apply(Y, B);
31210
+ var Y = ke(N.prototype), oe = N.apply(Y, M);
31286
31211
  return je(oe) ? oe : Y;
31287
31212
  };
31288
31213
  }
31289
- function De(N, B, Y) {
31214
+ function De(N, M, Y) {
31290
31215
  var oe = Ce(N);
31291
31216
  function ce() {
31292
31217
  for (var H = arguments.length, ie = Array(H), ue = H, de = qe(ce); ue--; )
@@ -31295,8 +31220,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
31295
31220
  if (H -= me.length, H < Y)
31296
31221
  return Ye(
31297
31222
  N,
31298
- B,
31299
- Ve,
31223
+ M,
31224
+ Le,
31300
31225
  ce.placeholder,
31301
31226
  void 0,
31302
31227
  ie,
@@ -31310,35 +31235,35 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
31310
31235
  }
31311
31236
  return ce;
31312
31237
  }
31313
- function Ve(N, B, Y, oe, ce, H, ie, ue, de, me) {
31314
- var pe = B & g, xe = B & i, ye = B & l, we = B & (u | d), it = B & b, et = ye ? void 0 : Ce(N);
31238
+ function Le(N, M, Y, oe, ce, H, ie, ue, de, me) {
31239
+ var pe = M & g, xe = M & i, ye = M & l, we = M & (u | d), it = M & b, et = ye ? void 0 : Ce(N);
31315
31240
  function tt() {
31316
- for (var Be = arguments.length, Ae = Array(Be), lt = Be; lt--; )
31241
+ for (var Me = arguments.length, Ae = Array(Me), lt = Me; lt--; )
31317
31242
  Ae[lt] = arguments[lt];
31318
31243
  if (we)
31319
31244
  var ut = qe(tt), pt = Q(Ae, ut);
31320
- if (oe && (Ae = He(Ae, oe, ce, we)), H && (Ae = Fe(Ae, H, ie, we)), Be -= pt, we && Be < me) {
31245
+ if (oe && (Ae = He(Ae, oe, ce, we)), H && (Ae = Fe(Ae, H, ie, we)), Me -= pt, we && Me < me) {
31321
31246
  var ft = $(Ae, ut);
31322
31247
  return Ye(
31323
31248
  N,
31324
- B,
31325
- Ve,
31249
+ M,
31250
+ Le,
31326
31251
  tt.placeholder,
31327
31252
  Y,
31328
31253
  Ae,
31329
31254
  ft,
31330
31255
  ue,
31331
31256
  de,
31332
- me - Be
31257
+ me - Me
31333
31258
  );
31334
31259
  }
31335
31260
  var dt = xe ? Y : this, ct = ye ? dt[N] : N;
31336
- return Be = Ae.length, ue ? Ae = Xe(Ae, ue) : it && Be > 1 && Ae.reverse(), pe && de < Be && (Ae.length = de), this && this !== q && this instanceof tt && (ct = et || Ce(ct)), ct.apply(dt, Ae);
31261
+ return Me = Ae.length, ue ? Ae = Xe(Ae, ue) : it && Me > 1 && Ae.reverse(), pe && de < Me && (Ae.length = de), this && this !== q && this instanceof tt && (ct = et || Ce(ct)), ct.apply(dt, Ae);
31337
31262
  }
31338
31263
  return tt;
31339
31264
  }
31340
- function nt(N, B, Y, oe) {
31341
- var ce = B & i, H = Ce(N);
31265
+ function nt(N, M, Y, oe) {
31266
+ var ce = M & i, H = Ce(N);
31342
31267
  function ie() {
31343
31268
  for (var ue = -1, de = arguments.length, me = -1, pe = oe.length, xe = Array(pe + de), ye = this && this !== q && this instanceof ie ? H : N; ++me < pe; )
31344
31269
  xe[me] = oe[me];
@@ -31348,24 +31273,24 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
31348
31273
  }
31349
31274
  return ie;
31350
31275
  }
31351
- function Ye(N, B, Y, oe, ce, H, ie, ue, de, me) {
31352
- var pe = B & u, xe = pe ? ie : void 0, ye = pe ? void 0 : ie, we = pe ? H : void 0, it = pe ? void 0 : H;
31353
- B |= pe ? m : p, B &= ~(pe ? p : m), B & c || (B &= ~(i | l));
31354
- var et = Y(N, B, ce, we, xe, it, ye, ue, de, me);
31355
- return et.placeholder = oe, Pe(et, N, B);
31276
+ function Ye(N, M, Y, oe, ce, H, ie, ue, de, me) {
31277
+ var pe = M & u, xe = pe ? ie : void 0, ye = pe ? void 0 : ie, we = pe ? H : void 0, it = pe ? void 0 : H;
31278
+ M |= pe ? m : p, M &= ~(pe ? p : m), M & c || (M &= ~(i | l));
31279
+ var et = Y(N, M, ce, we, xe, it, ye, ue, de, me);
31280
+ return et.placeholder = oe, Pe(et, N, M);
31356
31281
  }
31357
- function Se(N, B, Y, oe, ce, H, ie, ue) {
31358
- var de = B & l;
31282
+ function Se(N, M, Y, oe, ce, H, ie, ue) {
31283
+ var de = M & l;
31359
31284
  if (!de && typeof N != "function")
31360
31285
  throw new TypeError(o);
31361
31286
  var me = oe ? oe.length : 0;
31362
- if (me || (B &= ~(m | p), oe = ce = void 0), ie = ie === void 0 ? ie : Ne(Ee(ie), 0), ue = ue === void 0 ? ue : Ee(ue), me -= ce ? ce.length : 0, B & p) {
31287
+ if (me || (M &= ~(m | p), oe = ce = void 0), ie = ie === void 0 ? ie : Ne(Ee(ie), 0), ue = ue === void 0 ? ue : Ee(ue), me -= ce ? ce.length : 0, M & p) {
31363
31288
  var pe = oe, xe = ce;
31364
31289
  oe = ce = void 0;
31365
31290
  }
31366
31291
  var ye = [
31367
31292
  N,
31368
- B,
31293
+ M,
31369
31294
  Y,
31370
31295
  oe,
31371
31296
  ce,
@@ -31375,45 +31300,45 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
31375
31300
  ie,
31376
31301
  ue
31377
31302
  ];
31378
- if (N = ye[0], B = ye[1], Y = ye[2], oe = ye[3], ce = ye[4], ue = ye[9] = ye[9] == null ? de ? 0 : N.length : Ne(ye[9] - me, 0), !ue && B & (u | d) && (B &= ~(u | d)), !B || B == i)
31379
- var we = rt(N, B, Y);
31303
+ if (N = ye[0], M = ye[1], Y = ye[2], oe = ye[3], ce = ye[4], ue = ye[9] = ye[9] == null ? de ? 0 : N.length : Ne(ye[9] - me, 0), !ue && M & (u | d) && (M &= ~(u | d)), !M || M == i)
31304
+ var we = rt(N, M, Y);
31380
31305
  else
31381
- B == u || B == d ? we = De(N, B, ue) : (B == m || B == (i | m)) && !ce.length ? we = nt(N, B, Y, oe) : we = Ve.apply(void 0, ye);
31382
- return Pe(we, N, B);
31306
+ M == u || M == d ? we = De(N, M, ue) : (M == m || M == (i | m)) && !ce.length ? we = nt(N, M, Y, oe) : we = Le.apply(void 0, ye);
31307
+ return Pe(we, N, M);
31383
31308
  }
31384
31309
  function qe(N) {
31385
- var B = N;
31386
- return B.placeholder;
31310
+ var M = N;
31311
+ return M.placeholder;
31387
31312
  }
31388
- function We(N, B) {
31389
- var Y = ne(N, B);
31313
+ function We(N, M) {
31314
+ var Y = ne(N, M);
31390
31315
  return ve(Y) ? Y : void 0;
31391
31316
  }
31392
31317
  function ot(N) {
31393
- var B = N.match(k);
31394
- return B ? B[1].split(O) : [];
31318
+ var M = N.match(k);
31319
+ return M ? M[1].split(O) : [];
31395
31320
  }
31396
- function Ue(N, B) {
31397
- var Y = B.length, oe = Y - 1;
31398
- return B[oe] = (Y > 1 ? "& " : "") + B[oe], B = B.join(Y > 2 ? ", " : " "), N.replace(j, `{
31399
- /* [wrapped with ` + B + `] */
31321
+ function Ue(N, M) {
31322
+ var Y = M.length, oe = Y - 1;
31323
+ return M[oe] = (Y > 1 ? "& " : "") + M[oe], M = M.join(Y > 2 ? ", " : " "), N.replace(j, `{
31324
+ /* [wrapped with ` + M + `] */
31400
31325
  `);
31401
31326
  }
31402
- function Re(N, B) {
31403
- return B = B ?? v, !!B && (typeof N == "number" || W.test(N)) && N > -1 && N % 1 == 0 && N < B;
31327
+ function Re(N, M) {
31328
+ return M = M ?? v, !!M && (typeof N == "number" || W.test(N)) && N > -1 && N % 1 == 0 && N < M;
31404
31329
  }
31405
- function Me(N) {
31330
+ function Be(N) {
31406
31331
  return !!Z && Z in N;
31407
31332
  }
31408
- function Xe(N, B) {
31409
- for (var Y = N.length, oe = ge(B.length, Y), ce = Je(N); oe--; ) {
31410
- var H = B[oe];
31333
+ function Xe(N, M) {
31334
+ for (var Y = N.length, oe = ge(M.length, Y), ce = Je(N); oe--; ) {
31335
+ var H = M[oe];
31411
31336
  N[oe] = Re(H, Y) ? ce[H] : void 0;
31412
31337
  }
31413
31338
  return N;
31414
31339
  }
31415
- var Pe = Ge ? function(N, B, Y) {
31416
- var oe = B + "";
31340
+ var Pe = Ge ? function(N, M, Y) {
31341
+ var oe = M + "";
31417
31342
  return Ge(N, "toString", {
31418
31343
  configurable: !0,
31419
31344
  enumerable: !1,
@@ -31433,24 +31358,24 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
31433
31358
  }
31434
31359
  return "";
31435
31360
  }
31436
- function at(N, B) {
31361
+ function at(N, M) {
31437
31362
  return ee(w, function(Y) {
31438
31363
  var oe = "_." + Y[0];
31439
- B & Y[1] && !z(N, oe) && N.push(oe);
31364
+ M & Y[1] && !z(N, oe) && N.push(oe);
31440
31365
  }), N.sort();
31441
31366
  }
31442
- function Oe(N, B, Y) {
31443
- B = Y ? void 0 : B;
31444
- var oe = Se(N, u, void 0, void 0, void 0, void 0, void 0, B);
31367
+ function Oe(N, M, Y) {
31368
+ M = Y ? void 0 : M;
31369
+ var oe = Se(N, u, void 0, void 0, void 0, void 0, void 0, M);
31445
31370
  return oe.placeholder = Oe.placeholder, oe;
31446
31371
  }
31447
31372
  function st(N) {
31448
- var B = je(N) ? Te.call(N) : "";
31449
- return B == A || B == P;
31373
+ var M = je(N) ? Te.call(N) : "";
31374
+ return M == A || M == P;
31450
31375
  }
31451
31376
  function je(N) {
31452
- var B = typeof N;
31453
- return !!N && (B == "object" || B == "function");
31377
+ var M = typeof N;
31378
+ return !!N && (M == "object" || M == "function");
31454
31379
  }
31455
31380
  function he(N) {
31456
31381
  return !!N && typeof N == "object";
@@ -31458,18 +31383,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
31458
31383
  function Qe(N) {
31459
31384
  return typeof N == "symbol" || he(N) && Te.call(N) == C;
31460
31385
  }
31461
- function Le(N) {
31386
+ function Ve(N) {
31462
31387
  if (!N)
31463
31388
  return N === 0 ? N : 0;
31464
31389
  if (N = _e(N), N === x || N === -x) {
31465
- var B = N < 0 ? -1 : 1;
31466
- return B * S;
31390
+ var M = N < 0 ? -1 : 1;
31391
+ return M * S;
31467
31392
  }
31468
31393
  return N === N ? N : 0;
31469
31394
  }
31470
31395
  function Ee(N) {
31471
- var B = Le(N), Y = B % 1;
31472
- return B === B ? Y ? B - Y : B : 0;
31396
+ var M = Ve(N), Y = M % 1;
31397
+ return M === M ? Y ? M - Y : M : 0;
31473
31398
  }
31474
31399
  function _e(N) {
31475
31400
  if (typeof N == "number")
@@ -31477,13 +31402,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
31477
31402
  if (Qe(N))
31478
31403
  return E;
31479
31404
  if (je(N)) {
31480
- var B = typeof N.valueOf == "function" ? N.valueOf() : N;
31481
- N = je(B) ? B + "" : B;
31405
+ var M = typeof N.valueOf == "function" ? N.valueOf() : N;
31406
+ N = je(M) ? M + "" : M;
31482
31407
  }
31483
31408
  if (typeof N != "string")
31484
31409
  return N === 0 ? N : +N;
31485
31410
  N = N.replace(I, "");
31486
- var Y = M.test(N);
31411
+ var Y = B.test(N);
31487
31412
  return Y || D.test(N) ? J(N.slice(2), Y ? 2 : 8) : T.test(N) ? E : +N;
31488
31413
  }
31489
31414
  function $e(N) {
@@ -33947,18 +33872,29 @@ const TabletIcon = ({ landscape: r = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
33947
33872
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full items-center space-x-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ClearCanvas, {}) })
33948
33873
  ] });
33949
33874
  }, AddBlocksDialog = () => {
33950
- const { t: r } = useTranslation(), [n, o] = useAddBlocksModal();
33951
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialog, { open: !isEmpty(n), onOpenChange: () => n ? o("") : "", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogContent, { className: "max-h-[80vh] max-w-5xl overflow-hidden", children: [
33952
- /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogTitle, { children: r("add_block") }) }),
33953
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "no-scrollbar h-[500px] max-h-full overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AddBlocksPanel$1, { showHeading: !1 }) }),
33954
- /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogFooter, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogCancel, { children: r("Close") }) })
33875
+ const { t: r } = useTranslation(), [n, o] = useState$1(""), [a, i] = useState$1(!1);
33876
+ return useChaiBuilderMsgListener(({ name: l, data: c = void 0 }) => {
33877
+ l === CHAI_BUILDER_EVENTS.OPEN_ADD_BLOCK && (o(c == null ? void 0 : c._id), i(!0)), l === CHAI_BUILDER_EVENTS.CLOSE_ADD_BLOCK && (o(""), i(!1));
33878
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialog, { open: a, onOpenChange: () => a ? i(!1) : "", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogContent, { className: "max-h-[80vh] max-w-5xl overflow-hidden", children: [
33879
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogHeader, { className: "flex flex-row items-center justify-between", children: [
33880
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogTitle, { children: r("add_block") }),
33881
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
33882
+ "button",
33883
+ {
33884
+ onClick: () => i(!1),
33885
+ className: "text-gray-500 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-300",
33886
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Cross2Icon, { className: "h-6 w-6" })
33887
+ }
33888
+ )
33889
+ ] }),
33890
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "no-scrollbar h-[500px] max-h-full overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AddBlocksPanel$1, { parentId: n, showHeading: !1 }) })
33955
33891
  ] }) });
33956
33892
  }, SettingsPanel = () => {
33957
- const r = useSelectedBlock(), { t: n } = useTranslation(), [o, a] = useState$1(!0);
33893
+ const r = useSelectedBlock(), { t: n } = useTranslation(), [o, a] = useState$1(!0), i = useBuilderProp("onError", noop$1);
33958
33894
  return isNull(r) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
33959
33895
  /* @__PURE__ */ jsxRuntimeExports.jsx(MixerHorizontalIcon, { className: "mx-auto text-3xl" }),
33960
33896
  /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: n("please_select_a_block_to_edit") })
33961
- ] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex w-full flex-col", children: [
33897
+ ] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$1, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(FallbackError, {}), onError: i, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex w-full flex-col", children: [
33962
33898
  /* @__PURE__ */ jsxRuntimeExports.jsx(BlockSettings, {}),
33963
33899
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
33964
33900
  /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyling, {}),
@@ -33978,7 +33914,7 @@ const TabletIcon = ({ landscape: r = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
33978
33914
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
33979
33915
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {})
33980
33916
  ] }) });
33981
- }, SettingsPanel$1 = SettingsPanel, TopBar = lazy(() => import("./Topbar-wHQxajBp.js")), menuItems = [
33917
+ }, SettingsPanel$1 = SettingsPanel, TopBar = lazy(() => import("./Topbar-Nc6eEWWP.js")), menuItems = [
33982
33918
  { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Layers, { size: 20 }), label: "sidebar.outline", component: Outline$1 },
33983
33919
  { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, { size: 16 }), label: "sidebar.edit_block", component: SettingsPanel$1 },
33984
33920
  { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(LightningBoltIcon, { className: "size-5" }), label: "sidebar.ai_assistant", component: AskAI },
@@ -33995,7 +33931,7 @@ const TabletIcon = ({ landscape: r = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
33995
33931
  }, RootLayout = () => {
33996
33932
  const [r, n] = useState$1(0);
33997
33933
  useChaiBuilderMsgListener(({ name: u }) => {
33998
- u === BUILDER_EVENTS.SHOW_SETTINGS && n(1);
33934
+ u === CHAI_BUILDER_EVENTS.SHOW_BLOCK_SETTINGS && n(1);
33999
33935
  });
34000
33936
  const o = useBuilderProp("sideBarComponents.top", []), a = (u) => {
34001
33937
  u.preventDefault();
@@ -34096,50 +34032,53 @@ const TabletIcon = ({ landscape: r = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
34096
34032
  window.onbeforeunload = null;
34097
34033
  }), [i]), /* @__PURE__ */ jsxRuntimeExports.jsx(l, {});
34098
34034
  }, ChaiBuilderEditor = (r) => {
34099
- const n = r._flags || {};
34100
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(FlagsProvider, { features: { ...FEATURE_TOGGLES, ...n }, children: [
34035
+ const n = r._flags || {}, o = r.onError || noop$1;
34036
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-screen w-screen", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$1, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(FallbackError, {}), onError: o, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(FlagsProvider, { features: { ...FEATURE_TOGGLES, ...n }, children: [
34101
34037
  /* @__PURE__ */ jsxRuntimeExports.jsx(DevTools, {}),
34102
34038
  /* @__PURE__ */ jsxRuntimeExports.jsx(SmallScreenMessage, {}),
34103
34039
  /* @__PURE__ */ jsxRuntimeExports.jsx(ChaiBuilderComponent, { ...r }),
34104
34040
  /* @__PURE__ */ jsxRuntimeExports.jsx(PreviewScreen, {}),
34105
34041
  /* @__PURE__ */ jsxRuntimeExports.jsx(Toaster, {})
34106
- ] }) });
34042
+ ] }) }) });
34107
34043
  };
34108
34044
  export {
34109
- useSelectedBlocksDisplayChild as $,
34045
+ useStylingBreakpoint as $,
34110
34046
  AddBlocksPanel$1 as A,
34111
34047
  BlockSettings as B,
34112
34048
  ChaiSelect$1 as C,
34113
34049
  DarkMode as D,
34114
- useCopyToClipboard as E,
34050
+ useCanvasWidth as E,
34115
34051
  FaCheck as F,
34116
- useCurrentPage as G,
34117
- useCutBlockIds as H,
34052
+ useCanvasZoom as G,
34053
+ useCopyBlockIds as H,
34118
34054
  ImportHTML$1 as I,
34119
- useDarkMode as J,
34120
- useDuplicateBlocks as K,
34121
- useGetPageData as L,
34122
- useHiddenBlockIds as M,
34123
- useHighlightBlockId as N,
34055
+ useCopyToClipboard as J,
34056
+ useCurrentPage as K,
34057
+ useCutBlockIds as L,
34058
+ useDarkMode as M,
34059
+ useDuplicateBlocks as N,
34124
34060
  Outline$1 as O,
34125
- usePasteBlocks as P,
34126
- useBrandingOptions as Q,
34127
- useRemoveBlocks as R,
34128
- useRemoveClassesFromBlocks as S,
34061
+ useGetPageData as P,
34062
+ useHiddenBlockIds as Q,
34063
+ useHighlightBlockId as R,
34064
+ usePasteBlocks as S,
34129
34065
  ThemeOptions as T,
34130
34066
  UILibraries as U,
34131
- useSelectedBlockCurrentClasses as V,
34132
- useSelectedBlockAllClasses as W,
34133
- useSelectedBlock as X,
34134
- useStylingBreakpoint as Y,
34135
- useUILibraryBlocks as Z,
34136
- useStylingState as _,
34067
+ useBrandingOptions as V,
34068
+ useRemoveBlocks as W,
34069
+ useRemoveClassesFromBlocks as X,
34070
+ useSelectedBlockCurrentClasses as Y,
34071
+ useSelectedBlockAllClasses as Z,
34072
+ useSelectedBlock as _,
34137
34073
  useSelectedBlockIds as a,
34138
- useAllBlocks as a0,
34139
- useActivePanel as a1,
34140
- useAddBlockParent as a2,
34141
- useSelectedBreakpoints as a3,
34142
- useSelectedStylingBlocks as a4,
34074
+ useUILibraryBlocks as a0,
34075
+ useStylingState as a1,
34076
+ useSelectedBlocksDisplayChild as a2,
34077
+ useAllBlocks as a3,
34078
+ useActivePanel as a4,
34079
+ useAddBlockParent as a5,
34080
+ useSelectedBreakpoints as a6,
34081
+ useSelectedStylingBlocks as a7,
34143
34082
  useUpdateBlocksProps as b,
34144
34083
  useUpdateBlocksPropsRealtime as c,
34145
34084
  useBuilderProp as d,
@@ -34147,22 +34086,22 @@ export {
34147
34086
  usePreviewMode as f,
34148
34087
  CanvasArea$1 as g,
34149
34088
  BlockStyling as h,
34150
- AISetContext as i,
34151
- AIUserPrompt as j,
34152
- BlockAttributesEditor as k,
34153
- ChaiBuilderEditor as l,
34154
- Breakpoints as m,
34155
- UndoRedo as n,
34156
- getBlocksFromHTML as o,
34157
- useBlocksStore as p,
34158
- useUndoManager as q,
34159
- useBuilderReset as r,
34160
- useReadOnlyMode as s,
34161
- useActiveModal as t,
34089
+ emitChaiBuilderMsg as i,
34090
+ useChaiBuilderMsgListener as j,
34091
+ CHAI_BUILDER_EVENTS as k,
34092
+ AISetContext as l,
34093
+ AIUserPrompt as m,
34094
+ BlockAttributesEditor as n,
34095
+ ChaiBuilderEditor as o,
34096
+ Breakpoints as p,
34097
+ UndoRedo as q,
34098
+ getBlocksFromHTML as r,
34099
+ useBlocksStore as s,
34100
+ useUndoManager as t,
34162
34101
  useCodeEditor as u,
34163
- useAddBlock as v,
34164
- useAddClassesToBlocks as w,
34165
- useCanvasWidth as x,
34166
- useCanvasZoom as y,
34167
- useCopyBlockIds as z
34102
+ useBuilderReset as v,
34103
+ useReadOnlyMode as w,
34104
+ useActiveModal as x,
34105
+ useAddBlock as y,
34106
+ useAddClassesToBlocks as z
34168
34107
  };