@chaibuilder/sdk 1.2.25 → 1.2.27

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.
Files changed (183) hide show
  1. package/dist/AddBlocks-S-4jzdWv.cjs +1 -0
  2. package/dist/AddBlocks-ksZjjn0k.js +205 -0
  3. package/dist/BrandingOptions-EMCT0Wa3.cjs +1 -0
  4. package/dist/{BrandingOptions-iTyWpwTs.js → BrandingOptions-T_kbQFQv.js} +53 -40
  5. package/dist/CanvasArea-SDzbubar.cjs +55 -0
  6. package/dist/{CanvasArea-dZjng782.js → CanvasArea-rhOeubmu.js} +323 -340
  7. package/dist/{Class-ahc3NIbq.js → Class-3k8xjeiM.js} +29 -26
  8. package/dist/Class-MmCxz2Ay.cjs +1 -0
  9. package/dist/{CurrentPage-Kmfp-kFk.js → CurrentPage-0eeU1V_c.js} +53 -40
  10. package/dist/CurrentPage-aTjWjc3o.cjs +1 -0
  11. package/dist/Functions-7jnEwJyw.js +15 -0
  12. package/dist/Functions-N3yhPYKY.cjs +1 -0
  13. package/dist/{ListTree-N3jeD790.js → ListTree-Muu4rAtp.js} +96 -87
  14. package/dist/ListTree-SWsqdfcG.cjs +1 -0
  15. package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
  16. package/dist/{MODIFIERS-CNqNUapY.js → MODIFIERS-WQdaNvb8.js} +8 -10
  17. package/dist/PagesPanel-n3x-0ozR.cjs +1 -0
  18. package/dist/{PagesPanel-u1IB-nRr.js → PagesPanel-rYN28QpN.js} +44 -29
  19. package/dist/ProjectPanel-ivFOhdcz.js +84 -0
  20. package/dist/ProjectPanel-pBePMOta.cjs +1 -0
  21. package/dist/Settings-JRyJayf5.cjs +1 -0
  22. package/dist/{Settings-jCcd-VE6.js → Settings-XWmKzRl9.js} +400 -407
  23. package/dist/SidePanels-BtUeo6M9.cjs +1 -0
  24. package/dist/{SidePanels-pHMYprpW.js → SidePanels-ODktnGbC.js} +117 -108
  25. package/dist/Topbar-QMeD3hvq.cjs +1 -0
  26. package/dist/Topbar-Yunooh00.js +131 -0
  27. package/dist/UnsplashImages-05JR8oIu.cjs +1 -0
  28. package/dist/{UnsplashImages-L7x_3RQf.js → UnsplashImages-QMl0bxix.js} +59 -47
  29. package/dist/UploadImages-OgSN1HVt.cjs +1 -0
  30. package/dist/{UploadImages-zdEJRLD8.js → UploadImages-Si-A26bc.js} +58 -36
  31. package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
  32. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
  33. package/dist/add-page-modal-9pTKItY-.cjs +1 -0
  34. package/dist/add-page-modal-U7AUUrI1.js +103 -0
  35. package/dist/confirm-alert-DhRc-Zcd.cjs +1 -0
  36. package/dist/confirm-alert-kV5-c70T.js +59 -0
  37. package/dist/controls-KK2oLIa8.cjs +1 -0
  38. package/dist/{controls-IS5qnRce.js → controls-OfJWSEqC.js} +85 -20
  39. package/dist/core.cjs +1 -1
  40. package/dist/core.js +74 -150
  41. package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
  42. package/dist/{defaultTheme-4kA60XdB.js → defaultTheme-gunU_Fe5.js} +8 -6
  43. package/dist/delete-page-modal-4s-6AIy4.cjs +1 -0
  44. package/dist/delete-page-modal-UCBpdjLe.js +82 -0
  45. package/dist/email-blocks.cjs +1 -1
  46. package/dist/email-blocks.js +292 -3
  47. package/dist/email.cjs +1 -1
  48. package/dist/email.js +36 -18
  49. package/dist/empty-slot-ZBlsQi6m.js +15 -0
  50. package/dist/empty-slot-nzYOgZuS.cjs +1 -0
  51. package/dist/form-Ap63cNec.cjs +1 -0
  52. package/dist/{form-0_RLz2TB.js → form-zmlTjM9j.js} +12 -12
  53. package/dist/html-to-json-C_Eobs_d.cjs +1 -0
  54. package/dist/{html-to-json-2xtb7520.js → html-to-json-p__Fgqdg.js} +65 -40
  55. package/dist/index-CFUoB97-.js +3079 -0
  56. package/dist/index-F4AQQ6qq.cjs +1 -0
  57. package/dist/index-Qk028f-N.cjs +1 -0
  58. package/dist/index-YpnaudSM.js +63 -0
  59. package/dist/index-e0c8PmRQ.js +205 -0
  60. package/dist/index-ecnGWzh9.cjs +1 -0
  61. package/dist/index-f0AbmoYY.js +2201 -0
  62. package/dist/index-gi1LIOCw.cjs +1 -0
  63. package/dist/index-l19JVVXI.cjs +206 -0
  64. package/dist/index-lOJfSheQ.js +39503 -0
  65. package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-WbnYoNE9.js} +109 -106
  66. package/dist/jsx-runtime-Z_BpKhVy.cjs +27 -0
  67. package/dist/lib.cjs +3 -3
  68. package/dist/lib.js +59 -56
  69. package/dist/page-viewer-YFrIG3L7.cjs +1 -0
  70. package/dist/{page-viewer-NnOwmAmu.js → page-viewer-jOwy--9A.js} +56 -43
  71. package/dist/{project-general-setting-9ju3TDju.js → project-general-setting-3N8HZ2fe.js} +42 -35
  72. package/dist/project-general-setting-hK7I7FuN.cjs +1 -0
  73. package/dist/{project-seo-setting-36CdUszM.js → project-seo-setting-bSiNgO_1.js} +39 -23
  74. package/dist/project-seo-setting-x-FK0pez.cjs +1 -0
  75. package/dist/render.cjs +1 -1
  76. package/dist/render.js +16 -16
  77. package/dist/{single-page-detail-hD1jKZ8k.js → single-page-detail--AZlZ-pC.js} +73 -66
  78. package/dist/single-page-detail-9abF2g2R.cjs +1 -0
  79. package/dist/studio.cjs +1 -1
  80. package/dist/studio.js +39 -24
  81. package/dist/ui.cjs +1 -1
  82. package/dist/ui.js +158 -364
  83. package/dist/web-blocks.cjs +1 -1
  84. package/dist/web-blocks.js +1052 -3
  85. package/package.json +1 -1
  86. package/dist/AddBlocks-Ol3iIVKa.js +0 -207
  87. package/dist/AddBlocks-a1c-7Ewz.cjs +0 -1
  88. package/dist/BrandingOptions-6rnt0UaA.cjs +0 -1
  89. package/dist/CanvasArea-R4ogF9AT.cjs +0 -55
  90. package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +0 -163
  91. package/dist/ChaiBuilderEditor-vP4at00I.js +0 -27974
  92. package/dist/Class-eieto7e-.cjs +0 -1
  93. package/dist/Controls-3Cc1XYXg.js +0 -105
  94. package/dist/Controls-ky25Ebo3.cjs +0 -1
  95. package/dist/CurrentPage-3gQTH0Zt.cjs +0 -1
  96. package/dist/Functions-Hvon6AMZ.cjs +0 -1
  97. package/dist/Functions-NzT2Six_.js +0 -15
  98. package/dist/ImagesPanel-J1RlG7xG.cjs +0 -1
  99. package/dist/ImagesPanel-Wb0GF_NA.js +0 -29
  100. package/dist/ListTree-CZ-mtjZ9.cjs +0 -1
  101. package/dist/MODIFIERS-o1p3VnpS.cjs +0 -1
  102. package/dist/PagesPanel-Gi0z6gaf.cjs +0 -1
  103. package/dist/ProjectPanel-EydGZmMW.js +0 -71
  104. package/dist/ProjectPanel-kiiljG4H.cjs +0 -1
  105. package/dist/STRINGS-b432aBJJ.js +0 -7
  106. package/dist/STRINGS-gPz7CUOk.cjs +0 -1
  107. package/dist/Settings-8ilCSH8b.cjs +0 -1
  108. package/dist/SidePanels-T36C6Lhc.cjs +0 -1
  109. package/dist/Topbar-CvWQuspR.cjs +0 -1
  110. package/dist/Topbar-pbIDUE_B.js +0 -122
  111. package/dist/UnsplashImages-KBZPd9dv.cjs +0 -1
  112. package/dist/UploadImages-GkkJVAgG.cjs +0 -1
  113. package/dist/accordion-oPUeqPCZ.js +0 -42
  114. package/dist/accordion-ynvFtV_p.cjs +0 -1
  115. package/dist/add-page-modal-9SGv2hgc.cjs +0 -1
  116. package/dist/add-page-modal-JCDXZIPW.js +0 -95
  117. package/dist/alert-dialog-P9xMMB6C.cjs +0 -1
  118. package/dist/alert-dialog-rypfO5ly.js +0 -64
  119. package/dist/badge-E-S7CqUt.cjs +0 -1
  120. package/dist/badge-tEwO7C51.js +0 -23
  121. package/dist/block-helpers-OKHmRRol.cjs +0 -1
  122. package/dist/block-helpers-oSFpSsGz.js +0 -23
  123. package/dist/command-BxR6jaCI.cjs +0 -1
  124. package/dist/command-Pn3HKDuV.js +0 -97
  125. package/dist/confirm-alert-uNm0lZ0y.cjs +0 -1
  126. package/dist/confirm-alert-wR5_VJ1l.js +0 -36
  127. package/dist/context-menu-8dC9uGXj.js +0 -122
  128. package/dist/context-menu-IgLbIuth.cjs +0 -1
  129. package/dist/controls-L7DPvB0m.cjs +0 -1
  130. package/dist/defaultTheme-mrkeGFGI.cjs +0 -1
  131. package/dist/delete-page-modal-7KmP1elv.js +0 -67
  132. package/dist/delete-page-modal-SgfwvfNu.cjs +0 -1
  133. package/dist/dropdown-menu-El86_9Uo.js +0 -124
  134. package/dist/dropdown-menu-SiHzqWwZ.cjs +0 -1
  135. package/dist/form-W58AVUdf.cjs +0 -1
  136. package/dist/hover-card-KUwpDkW8.cjs +0 -1
  137. package/dist/hover-card-q138xxXR.js +0 -45
  138. package/dist/html-to-json-uSnxl72F.cjs +0 -1
  139. package/dist/iconBase-gbUAAO2L.cjs +0 -1
  140. package/dist/iconBase-h4DuR_XT.js +0 -63
  141. package/dist/index-9MmykVSc.cjs +0 -1
  142. package/dist/index-hElOGcFr.js +0 -2200
  143. package/dist/index-lDTsQp7h.js +0 -188
  144. package/dist/index-rq5Y9ZDy.cjs +0 -1
  145. package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
  146. package/dist/label-KaP7MRrs.js +0 -10
  147. package/dist/label-tFm8HZdb.cjs +0 -1
  148. package/dist/link-WbcKdQ9k.cjs +0 -1
  149. package/dist/link-xuhP-4dN.js +0 -196
  150. package/dist/page-viewer-Hx5hxHKm.cjs +0 -1
  151. package/dist/popover-a84pbVhQ.js +0 -23
  152. package/dist/popover-fKjgcRUx.cjs +0 -1
  153. package/dist/project-general-setting-FxkwjvJz.cjs +0 -1
  154. package/dist/project-seo-setting-RU7qiXxb.cjs +0 -1
  155. package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
  156. package/dist/scroll-area-ewXbxc3n.js +0 -30
  157. package/dist/select-7bjg-rr9.cjs +0 -1
  158. package/dist/select-POGdEDHT.js +0 -75
  159. package/dist/separator-3Civ-6hb.cjs +0 -1
  160. package/dist/separator-SctTn0Qi.js +0 -18
  161. package/dist/single-page-detail-beY0MT1b.cjs +0 -1
  162. package/dist/skeleton-STeL9VrJ.cjs +0 -1
  163. package/dist/skeleton-lu8e7q2y.js +0 -239
  164. package/dist/tabs-_4WbA1cc.cjs +0 -1
  165. package/dist/tabs-yQ3oGziM.js +0 -106
  166. package/dist/textarea-1kZEh7ki.cjs +0 -1
  167. package/dist/textarea-b2QvVhrK.js +0 -73
  168. package/dist/useAddBlock-8pxOEYIl.cjs +0 -1
  169. package/dist/useAddBlock-FEKFJNwQ.js +0 -69
  170. package/dist/useChaiExternalData-fkFgoS80.js +0 -6
  171. package/dist/useChaiExternalData-rwoAZ6uU.cjs +0 -1
  172. package/dist/useDarkMode-7i57segK.cjs +0 -1
  173. package/dist/useDarkMode-8VHJlYyE.js +0 -23
  174. package/dist/useSelectedBreakpoints-6NK5qd7T.js +0 -10
  175. package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +0 -1
  176. package/dist/useStylingState-Iuj84yvc.js +0 -186
  177. package/dist/useStylingState-OIvJMV6p.cjs +0 -1
  178. package/dist/useUiLibraries-nCdauJ4N.cjs +0 -1
  179. package/dist/useUiLibraries-psyWFbNc.js +0 -12
  180. package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +0 -1
  181. package/dist/useUpdateBlocksProps-vWcDp-P9.js +0 -23
  182. package/dist/utils-dze1SGvB.js +0 -6
  183. package/dist/utils-qK_SjzzV.cjs +0 -1
@@ -0,0 +1,3079 @@
1
+ import * as f from "react";
2
+ import tt, { createContext as Es, useContext as Os, useRef as xr, createElement as vr, useReducer as Ls, useEffect as Ae, useDebugValue as zs, useCallback as $, useMemo as Vs, useState as Ce, Suspense as yt } from "react";
3
+ import { memoize as Oe, has as pe, get as J, flatten as re, filter as E, isString as zt, find as oe, map as I, omit as st, each as ce, set as Se, includes as Y, isUndefined as wr, without as Vt, isEmpty as Be, forIn as $t, isObject as $s, first as ee, noop as qe, keys as Fs, startsWith as Ft, isNull as Ke, pick as wt, sortBy as Nt } from "lodash-es";
4
+ import { g as de, a as Us } from "./Functions-7jnEwJyw.js";
5
+ import { getBlockComponent as Le } from "@chaibuilder/runtime";
6
+ import { atom as w, useAtomValue as te, useAtom as O, useSetAtom as _e } from "jotai";
7
+ import { a as fe, I as Ut, S as Je, B as Ye } from "./MODIFIERS-WQdaNvb8.js";
8
+ import { g as Ws } from "./_commonjsHelpers-UyOWmZb0.js";
9
+ import { useThrottledCallback as Gs } from "@react-hookz/web";
10
+ import { a as d, c as Ie } from "./Class-3k8xjeiM.js";
11
+ import "react-i18next";
12
+ import { j as a } from "./jsx-runtime-WbnYoNE9.js";
13
+ import * as Wt from "@radix-ui/react-toggle";
14
+ import { cva as ge } from "class-variance-authority";
15
+ import * as Qe from "@radix-ui/react-switch";
16
+ import { Slot as Hs } from "@radix-ui/react-slot";
17
+ import * as me from "@radix-ui/react-accordion";
18
+ import { ChevronDownIcon as qs, Cross2Icon as ot, ChevronRightIcon as nt, CheckIcon as ze, DotFilledIcon as at, CaretSortIcon as Ks, MagnifyingGlassIcon as Js } from "@radix-ui/react-icons";
19
+ import * as H from "@radix-ui/react-alert-dialog";
20
+ import * as P from "@radix-ui/react-dialog";
21
+ import * as Gt from "@radix-ui/react-label";
22
+ import * as ue from "@radix-ui/react-scroll-area";
23
+ import * as be from "@radix-ui/react-tabs";
24
+ import * as ye from "@radix-ui/react-tooltip";
25
+ import * as je from "@radix-ui/react-popover";
26
+ import * as _ from "@radix-ui/react-menubar";
27
+ import * as Ve from "@radix-ui/react-hover-card";
28
+ import * as U from "@radix-ui/react-select";
29
+ import * as M from "@radix-ui/react-dropdown-menu";
30
+ import * as Ht from "@radix-ui/react-separator";
31
+ import * as Z from "@radix-ui/react-toast";
32
+ import { Command as Q } from "cmdk";
33
+ import * as D from "@radix-ui/react-context-menu";
34
+ import Ys, { IconPickerItem as Qs } from "react-icons-picker";
35
+ import Xs from "react-dom";
36
+ import Zs from "react-quill";
37
+ var W = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
38
+ let eo = 0;
39
+ function ae(e, t) {
40
+ const s = `atom${++eo}`, o = {
41
+ toString: () => s
42
+ };
43
+ return typeof e == "function" ? o.read = e : (o.init = e, o.read = (n) => n(o), o.write = (n, i, r) => i(
44
+ o,
45
+ typeof r == "function" ? r(n(o)) : r
46
+ )), t && (o.write = t), o;
47
+ }
48
+ const Fe = (e) => "init" in e, Ue = (e) => !!e.write, Ee = /* @__PURE__ */ new WeakMap(), to = (e, t) => {
49
+ Ee.set(e, t), e.catch(() => {
50
+ }).finally(() => Ee.delete(e));
51
+ }, kt = (e, t) => {
52
+ const s = Ee.get(e);
53
+ s && (Ee.delete(e), s(t));
54
+ }, St = (e, t) => {
55
+ e.status = "fulfilled", e.value = t;
56
+ }, jt = (e, t) => {
57
+ e.status = "rejected", e.reason = t;
58
+ }, so = (e) => typeof (e == null ? void 0 : e.then) == "function", Ne = (e, t) => "v" in e && "v" in t && Object.is(e.v, t.v), At = (e, t) => "e" in e && "e" in t && Object.is(e.e, t.e), xe = (e) => "v" in e && e.v instanceof Promise, oo = (e, t) => "v" in e && "v" in t && e.v.orig && e.v.orig === t.v.orig, Te = (e) => {
59
+ if ("e" in e)
60
+ throw e.e;
61
+ return e.v;
62
+ }, no = () => {
63
+ const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new Map();
64
+ let o, n, i;
65
+ (W ? "production" : void 0) !== "production" && (o = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set());
66
+ const r = (u) => e.get(u), c = (u, g) => {
67
+ (W ? "production" : void 0) !== "production" && Object.freeze(g);
68
+ const x = e.get(u);
69
+ if (e.set(u, g), s.has(u) || s.set(u, x), x && xe(x)) {
70
+ const b = "v" in g ? g.v instanceof Promise ? g.v : Promise.resolve(g.v) : Promise.reject(g.e);
71
+ kt(x.v, b);
72
+ }
73
+ }, p = (u, g, x) => {
74
+ const b = /* @__PURE__ */ new Map();
75
+ let y = !1;
76
+ x.forEach((h, k) => {
77
+ !h && k === u && (h = g), h ? (b.set(k, h), g.d.get(k) !== h && (y = !0)) : (W ? "production" : void 0) !== "production" && console.warn("[Bug] atom state not found");
78
+ }), (y || g.d.size !== b.size) && (g.d = b);
79
+ }, l = (u, g, x) => {
80
+ const b = r(u), y = {
81
+ d: (b == null ? void 0 : b.d) || /* @__PURE__ */ new Map(),
82
+ v: g
83
+ };
84
+ if (x && p(u, y, x), b && Ne(b, y) && b.d === y.d)
85
+ return b;
86
+ if (b && xe(b) && xe(y) && oo(b, y)) {
87
+ if (b.d === y.d)
88
+ return b;
89
+ y.v = b.v;
90
+ }
91
+ return c(u, y), y;
92
+ }, m = (u, g, x, b) => {
93
+ if (so(g)) {
94
+ let y;
95
+ const h = new Promise((k, z) => {
96
+ let A = !1;
97
+ g.then(
98
+ (R) => {
99
+ if (!A) {
100
+ A = !0;
101
+ const C = r(u), se = l(
102
+ u,
103
+ h,
104
+ x
105
+ );
106
+ St(h, R), k(R), (C == null ? void 0 : C.d) !== se.d && q(u, se, C == null ? void 0 : C.d);
107
+ }
108
+ },
109
+ (R) => {
110
+ if (!A) {
111
+ A = !0;
112
+ const C = r(u), se = l(
113
+ u,
114
+ h,
115
+ x
116
+ );
117
+ jt(h, R), z(R), (C == null ? void 0 : C.d) !== se.d && q(u, se, C == null ? void 0 : C.d);
118
+ }
119
+ }
120
+ ), y = (R) => {
121
+ A || (A = !0, R.then(
122
+ (C) => St(h, C),
123
+ (C) => jt(h, C)
124
+ ), k(R));
125
+ };
126
+ });
127
+ return h.orig = g, h.status = "pending", to(h, (k) => {
128
+ k && y(k), b == null || b();
129
+ }), l(u, h, x);
130
+ }
131
+ return l(u, g, x);
132
+ }, N = (u, g, x) => {
133
+ const b = r(u), y = {
134
+ d: (b == null ? void 0 : b.d) || /* @__PURE__ */ new Map(),
135
+ e: g
136
+ };
137
+ return x && p(u, y, x), b && At(b, y) && b.d === y.d ? b : (c(u, y), y);
138
+ }, S = (u) => {
139
+ const g = r(u);
140
+ if (g && (g.d.forEach((A, R) => {
141
+ R !== u && !t.has(R) && S(R);
142
+ }), Array.from(g.d).every(([A, R]) => {
143
+ const C = r(A);
144
+ return A === u || C === R || // TODO This is a hack, we should find a better solution.
145
+ C && !xe(C) && Ne(C, R);
146
+ })))
147
+ return g;
148
+ const x = /* @__PURE__ */ new Map();
149
+ let b = !0;
150
+ const y = (A) => {
151
+ if (A === u) {
152
+ const C = r(A);
153
+ if (C)
154
+ return x.set(A, C), Te(C);
155
+ if (Fe(A))
156
+ return x.set(A, void 0), A.init;
157
+ throw new Error("no atom init");
158
+ }
159
+ const R = S(A);
160
+ return x.set(A, R), Te(R);
161
+ };
162
+ let h, k;
163
+ const z = {
164
+ get signal() {
165
+ return h || (h = new AbortController()), h.signal;
166
+ },
167
+ get setSelf() {
168
+ return (W ? "production" : void 0) !== "production" && !Ue(u) && console.warn("setSelf function cannot be used with read-only atom"), !k && Ue(u) && (k = (...A) => {
169
+ if ((W ? "production" : void 0) !== "production" && b && console.warn("setSelf function cannot be called in sync"), !b)
170
+ return G(u, ...A);
171
+ }), k;
172
+ }
173
+ };
174
+ try {
175
+ const A = u.read(y, z);
176
+ return m(
177
+ u,
178
+ A,
179
+ x,
180
+ () => h == null ? void 0 : h.abort()
181
+ );
182
+ } catch (A) {
183
+ return N(u, A, x);
184
+ } finally {
185
+ b = !1;
186
+ }
187
+ }, v = (u) => Te(S(u)), j = (u) => {
188
+ let g = t.get(u);
189
+ return g || (g = V(u)), g;
190
+ }, L = (u, g) => !g.l.size && (!g.t.size || g.t.size === 1 && g.t.has(u)), F = (u) => {
191
+ const g = t.get(u);
192
+ g && L(u, g) && X(u);
193
+ }, B = (u) => {
194
+ const g = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new WeakMap(), b = (h) => {
195
+ const k = t.get(h);
196
+ k == null || k.t.forEach((z) => {
197
+ z !== h && (g.set(
198
+ z,
199
+ (g.get(z) || /* @__PURE__ */ new Set()).add(h)
200
+ ), x.set(z, (x.get(z) || 0) + 1), b(z));
201
+ });
202
+ };
203
+ b(u);
204
+ const y = (h) => {
205
+ const k = t.get(h);
206
+ k == null || k.t.forEach((z) => {
207
+ var A;
208
+ if (z !== h) {
209
+ let R = x.get(z);
210
+ if (R && x.set(z, --R), !R) {
211
+ let C = !!((A = g.get(z)) != null && A.size);
212
+ if (C) {
213
+ const se = r(z), Ds = S(z);
214
+ C = !se || !Ne(se, Ds);
215
+ }
216
+ C || g.forEach((se) => se.delete(z));
217
+ }
218
+ y(z);
219
+ }
220
+ });
221
+ };
222
+ y(u);
223
+ }, T = (u, ...g) => {
224
+ let x = !0;
225
+ const b = (k) => Te(S(k)), y = (k, ...z) => {
226
+ let A;
227
+ if (k === u) {
228
+ if (!Fe(k))
229
+ throw new Error("atom not writable");
230
+ const R = r(k), C = m(k, z[0]);
231
+ (!R || !Ne(R, C)) && B(k);
232
+ } else
233
+ A = T(k, ...z);
234
+ if (!x) {
235
+ const R = K();
236
+ (W ? "production" : void 0) !== "production" && n.forEach(
237
+ (C) => C({ type: "async-write", flushed: R })
238
+ );
239
+ }
240
+ return A;
241
+ }, h = u.write(b, y, ...g);
242
+ return x = !1, h;
243
+ }, G = (u, ...g) => {
244
+ const x = T(u, ...g), b = K();
245
+ return (W ? "production" : void 0) !== "production" && n.forEach(
246
+ (y) => y({ type: "write", flushed: b })
247
+ ), x;
248
+ }, V = (u, g) => {
249
+ const x = {
250
+ t: new Set(g && [g]),
251
+ l: /* @__PURE__ */ new Set()
252
+ };
253
+ if (t.set(u, x), (W ? "production" : void 0) !== "production" && i.add(u), S(u).d.forEach((b, y) => {
254
+ const h = t.get(y);
255
+ h ? h.t.add(u) : y !== u && V(y, u);
256
+ }), S(u), Ue(u) && u.onMount) {
257
+ const b = u.onMount((...y) => G(u, ...y));
258
+ b && (x.u = b);
259
+ }
260
+ return x;
261
+ }, X = (u) => {
262
+ var g;
263
+ const x = (g = t.get(u)) == null ? void 0 : g.u;
264
+ x && x(), t.delete(u), (W ? "production" : void 0) !== "production" && i.delete(u);
265
+ const b = r(u);
266
+ b ? (xe(b) && kt(b.v), b.d.forEach((y, h) => {
267
+ if (h !== u) {
268
+ const k = t.get(h);
269
+ k && (k.t.delete(u), L(h, k) && X(h));
270
+ }
271
+ })) : (W ? "production" : void 0) !== "production" && console.warn("[Bug] could not find atom state to unmount", u);
272
+ }, q = (u, g, x) => {
273
+ const b = new Set(g.d.keys());
274
+ x == null || x.forEach((y, h) => {
275
+ if (b.has(h)) {
276
+ b.delete(h);
277
+ return;
278
+ }
279
+ const k = t.get(h);
280
+ k && (k.t.delete(u), L(h, k) && X(h));
281
+ }), b.forEach((y) => {
282
+ const h = t.get(y);
283
+ h ? h.t.add(u) : t.has(u) && V(y, u);
284
+ });
285
+ }, K = () => {
286
+ let u;
287
+ for ((W ? "production" : void 0) !== "production" && (u = /* @__PURE__ */ new Set()); s.size; ) {
288
+ const g = Array.from(s);
289
+ s.clear(), g.forEach(([x, b]) => {
290
+ const y = r(x);
291
+ if (y) {
292
+ y.d !== (b == null ? void 0 : b.d) && q(x, y, b == null ? void 0 : b.d);
293
+ const h = t.get(x);
294
+ h && !// TODO This seems pretty hacky. Hope to fix it.
295
+ // Maybe we could `mountDependencies` in `setAtomState`?
296
+ (b && !xe(b) && (Ne(b, y) || At(b, y))) && (h.l.forEach((k) => k()), (W ? "production" : void 0) !== "production" && u.add(x));
297
+ } else
298
+ (W ? "production" : void 0) !== "production" && console.warn("[Bug] no atom state to flush");
299
+ });
300
+ }
301
+ if ((W ? "production" : void 0) !== "production")
302
+ return o.forEach((g) => g("state")), u;
303
+ }, le = (u, g) => {
304
+ const x = j(u), b = K(), y = x.l;
305
+ return y.add(g), (W ? "production" : void 0) !== "production" && (o.forEach((h) => h("sub")), n.forEach(
306
+ (h) => h({ type: "sub", flushed: b })
307
+ )), () => {
308
+ y.delete(g), F(u), (W ? "production" : void 0) !== "production" && (o.forEach((h) => h("unsub")), n.forEach((h) => h({ type: "unsub" })));
309
+ };
310
+ };
311
+ return (W ? "production" : void 0) !== "production" ? {
312
+ get: v,
313
+ set: G,
314
+ sub: le,
315
+ // store dev methods (these are tentative and subject to change without notice)
316
+ dev_subscribe_store: (u, g) => g !== 2 ? (console.warn(
317
+ "The current StoreListener revision is 2. The older ones are deprecated."
318
+ ), o.add(u), () => {
319
+ o.delete(u);
320
+ }) : (n.add(u), () => {
321
+ n.delete(u);
322
+ }),
323
+ dev_get_mounted_atoms: () => i.values(),
324
+ dev_get_atom_state: (u) => e.get(u),
325
+ dev_get_mounted: (u) => t.get(u),
326
+ dev_restore_atoms: (u) => {
327
+ for (const [x, b] of u)
328
+ Fe(x) && (m(x, b), B(x));
329
+ const g = K();
330
+ n.forEach(
331
+ (x) => x({ type: "restore", flushed: g })
332
+ );
333
+ }
334
+ } : {
335
+ get: v,
336
+ set: G,
337
+ sub: le
338
+ };
339
+ };
340
+ let We;
341
+ const ao = () => (We || (We = no()), We);
342
+ var ro = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
343
+ const io = Es(void 0), qt = (e) => {
344
+ const t = Os(io);
345
+ return (e == null ? void 0 : e.store) || t || ao();
346
+ };
347
+ const lo = (e) => typeof (e == null ? void 0 : e.then) == "function", co = tt.use || ((e) => {
348
+ if (e.status === "pending")
349
+ throw e;
350
+ if (e.status === "fulfilled")
351
+ return e.value;
352
+ throw e.status === "rejected" ? e.reason : (e.status = "pending", e.then(
353
+ (t) => {
354
+ e.status = "fulfilled", e.value = t;
355
+ },
356
+ (t) => {
357
+ e.status = "rejected", e.reason = t;
358
+ }
359
+ ), e);
360
+ });
361
+ function uo(e, t) {
362
+ const s = qt(t), [[o, n, i], r] = Ls(
363
+ (l) => {
364
+ const m = s.get(e);
365
+ return Object.is(l[0], m) && l[1] === s && l[2] === e ? l : [m, s, e];
366
+ },
367
+ void 0,
368
+ () => [s.get(e), s, e]
369
+ );
370
+ let c = o;
371
+ (n !== s || i !== e) && (r(), c = s.get(e));
372
+ const p = t == null ? void 0 : t.delay;
373
+ return Ae(() => {
374
+ const l = s.sub(e, () => {
375
+ if (typeof p == "number") {
376
+ setTimeout(r, p);
377
+ return;
378
+ }
379
+ r();
380
+ });
381
+ return r(), l;
382
+ }, [s, e, p]), zs(c), lo(c) ? co(c) : c;
383
+ }
384
+ function fo(e, t) {
385
+ const s = qt(t);
386
+ return $(
387
+ (...n) => {
388
+ if ((ro ? "production" : void 0) !== "production" && !("write" in e))
389
+ throw new Error("not writable atom");
390
+ return s.set(e, ...n);
391
+ },
392
+ [s, e]
393
+ );
394
+ }
395
+ function Lr(e, t) {
396
+ return [
397
+ uo(e, t),
398
+ // We do wrong type assertion here, which results in throwing an error.
399
+ fo(e, t)
400
+ ];
401
+ }
402
+ var rt = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
403
+ const Kt = Symbol();
404
+ const Ct = (e, t, s) => (t.has(s) ? t : t.set(s, e())).get(s), mo = /* @__PURE__ */ new WeakMap(), po = (e, t, s) => {
405
+ const o = Ct(() => /* @__PURE__ */ new WeakMap(), mo, t);
406
+ return Ct(e, o, s);
407
+ }, go = {}, Bt = (e) => !!e.write, bo = (e) => typeof e == "function";
408
+ function ho(e, t) {
409
+ return po(
410
+ () => {
411
+ const s = /* @__PURE__ */ new WeakMap(), o = (r, c) => {
412
+ let p = s.get(r);
413
+ if (p)
414
+ return p;
415
+ const l = c && s.get(c), m = [], N = [];
416
+ return r.forEach((S, v) => {
417
+ const j = t ? t(S) : v;
418
+ N[v] = j;
419
+ const L = l && l.atomList[l.keyList.indexOf(j)];
420
+ if (L) {
421
+ m[v] = L;
422
+ return;
423
+ }
424
+ const F = (T) => {
425
+ const G = T(n), V = T(e), q = o(V, G == null ? void 0 : G.arr).keyList.indexOf(j);
426
+ if (q < 0 || q >= V.length) {
427
+ const K = r[o(r).keyList.indexOf(j)];
428
+ if (K)
429
+ return K;
430
+ throw new Error("splitAtom: index out of bounds for read");
431
+ }
432
+ return V[q];
433
+ }, B = (T, G, V) => {
434
+ const X = T(n), q = T(e), le = o(q, X == null ? void 0 : X.arr).keyList.indexOf(j);
435
+ if (le < 0 || le >= q.length)
436
+ throw new Error("splitAtom: index out of bounds for write");
437
+ const u = bo(V) ? V(q[le]) : V;
438
+ G(e, [
439
+ ...q.slice(0, le),
440
+ u,
441
+ ...q.slice(le + 1)
442
+ ]);
443
+ };
444
+ m[v] = Bt(e) ? ae(F, B) : ae(F);
445
+ }), l && l.keyList.length === N.length && l.keyList.every((S, v) => S === N[v]) ? p = l : p = { arr: r, atomList: m, keyList: N }, s.set(r, p), p;
446
+ }, n = ae((r) => {
447
+ const c = r(n), p = r(e);
448
+ return o(p, c == null ? void 0 : c.arr);
449
+ });
450
+ (rt ? "production" : void 0) !== "production" && (n.debugPrivate = !0), n.init = void 0;
451
+ const i = Bt(e) ? ae(
452
+ (r) => r(n).atomList,
453
+ (r, c, p) => {
454
+ switch (p.type) {
455
+ case "remove": {
456
+ const l = r(i).indexOf(p.atom);
457
+ if (l >= 0) {
458
+ const m = r(e);
459
+ c(e, [
460
+ ...m.slice(0, l),
461
+ ...m.slice(l + 1)
462
+ ]);
463
+ }
464
+ break;
465
+ }
466
+ case "insert": {
467
+ const l = p.before ? r(i).indexOf(p.before) : r(i).length;
468
+ if (l >= 0) {
469
+ const m = r(e);
470
+ c(e, [
471
+ ...m.slice(0, l),
472
+ p.value,
473
+ ...m.slice(l)
474
+ ]);
475
+ }
476
+ break;
477
+ }
478
+ case "move": {
479
+ const l = r(i).indexOf(p.atom), m = p.before ? r(i).indexOf(p.before) : r(i).length;
480
+ if (l >= 0 && m >= 0) {
481
+ const N = r(e);
482
+ l < m ? c(e, [
483
+ ...N.slice(0, l),
484
+ ...N.slice(l + 1, m),
485
+ N[l],
486
+ ...N.slice(m)
487
+ ]) : c(e, [
488
+ ...N.slice(0, m),
489
+ N[l],
490
+ ...N.slice(m, l),
491
+ ...N.slice(l + 1)
492
+ ]);
493
+ }
494
+ break;
495
+ }
496
+ }
497
+ }
498
+ ) : ae((r) => r(n).atomList);
499
+ return i;
500
+ },
501
+ e,
502
+ t || go
503
+ );
504
+ }
505
+ function zr(e) {
506
+ const t = Symbol(), s = ae(t);
507
+ (rt ? "production" : void 0) !== "production" && (s.debugPrivate = !0);
508
+ const o = ae(
509
+ (n, i) => {
510
+ const r = n(s);
511
+ return r !== t ? r : e(n, i);
512
+ },
513
+ (n, i, r) => {
514
+ if (r === Kt)
515
+ i(s, t);
516
+ else if (typeof r == "function") {
517
+ const c = n(o);
518
+ i(s, r(c));
519
+ } else
520
+ i(s, r);
521
+ }
522
+ );
523
+ return o;
524
+ }
525
+ const xo = (e) => typeof (e == null ? void 0 : e.then) == "function";
526
+ function vo(e) {
527
+ let t, s;
528
+ const o = {
529
+ getItem: (n, i) => {
530
+ var r, c;
531
+ const p = (m) => {
532
+ if (m = m || "", t !== m) {
533
+ try {
534
+ s = JSON.parse(m);
535
+ } catch {
536
+ return i;
537
+ }
538
+ t = m;
539
+ }
540
+ return s;
541
+ }, l = (c = (r = e()) == null ? void 0 : r.getItem(n)) != null ? c : null;
542
+ return xo(l) ? l.then(p) : p(l);
543
+ },
544
+ setItem: (n, i) => {
545
+ var r;
546
+ return (r = e()) == null ? void 0 : r.setItem(n, JSON.stringify(i));
547
+ },
548
+ removeItem: (n) => {
549
+ var i;
550
+ return (i = e()) == null ? void 0 : i.removeItem(n);
551
+ }
552
+ };
553
+ return typeof window < "u" && typeof window.addEventListener == "function" && (o.subscribe = (n, i, r) => {
554
+ if (!(e() instanceof window.Storage))
555
+ return () => {
556
+ };
557
+ const c = (p) => {
558
+ if (p.storageArea === e() && p.key === n) {
559
+ let l;
560
+ try {
561
+ l = JSON.parse(p.newValue || "");
562
+ } catch {
563
+ l = r;
564
+ }
565
+ i(l);
566
+ }
567
+ };
568
+ return window.addEventListener("storage", c), () => {
569
+ window.removeEventListener("storage", c);
570
+ };
571
+ }), o;
572
+ }
573
+ const yo = vo(
574
+ () => typeof window < "u" ? window.localStorage : void 0
575
+ );
576
+ function Re(e, t, s = yo, o) {
577
+ const n = o == null ? void 0 : o.unstable_getOnInit, i = ae(
578
+ n ? s.getItem(e, t) : t
579
+ );
580
+ return (rt ? "production" : void 0) !== "production" && (i.debugPrivate = !0), i.onMount = (c) => {
581
+ n || c(s.getItem(e, t));
582
+ let p;
583
+ return s.subscribe && (p = s.subscribe(e, c, t)), p;
584
+ }, ae(
585
+ (c) => c(i),
586
+ (c, p, l) => {
587
+ const m = typeof l == "function" ? l(c(i)) : l;
588
+ return m === Kt ? (p(i, t), s.removeItem(e)) : m instanceof Promise ? m.then((N) => (p(i, N), s.setItem(e, N))) : (p(i, m), s.setItem(e, m));
589
+ }
590
+ );
591
+ }
592
+ const Jt = w(null);
593
+ Jt.debugLabel = "chaiBuilderPropsAtom";
594
+ const wo = w({});
595
+ wo.debugLabel = "chaiExternalDataAtom";
596
+ const Vr = () => !1, No = (e) => {
597
+ const t = e.replace(fe, "").split(",");
598
+ return { baseClasses: t[0], classes: t[1] };
599
+ }, _t = Oe((e, t) => {
600
+ if (!e)
601
+ return !0;
602
+ const s = Le(e);
603
+ return s && pe(s, "canAcceptBlock") ? s.canAcceptBlock(t) : !1;
604
+ }), ko = Oe((e, t) => {
605
+ const s = Le(t);
606
+ return s && pe(s, "canBeNested") ? s.canBeNested(e) : !0;
607
+ }), $r = Oe((e) => {
608
+ const t = Le(e);
609
+ return t && pe(t, "canDuplicate") ? t.canDuplicate() : !0;
610
+ }), Fr = Oe((e) => {
611
+ const t = Le(e);
612
+ return t && pe(t, "canDelete") ? t.canDelete() : !0;
613
+ });
614
+ function Yt(e, t, s) {
615
+ const o = E(e, (i) => i._parent === t), n = [];
616
+ for (let i = 0; i < o.length; i++) {
617
+ const r = Xt(o[i]);
618
+ if (Object.keys(r).length > 0 && Object.keys(r).forEach((c) => {
619
+ o[i][c] = `slot:${de()}`;
620
+ }), E(e, { _parent: o[i]._id }).length > 0) {
621
+ const c = de();
622
+ n.push({ ...o[i], oldId: o[i]._id, _id: c, _parent: s }), n.push(re(Yt(e, o[i]._id, c)));
623
+ } else
624
+ n.push({
625
+ ...o[i],
626
+ oldId: o[i]._id,
627
+ _id: de(),
628
+ _parent: s
629
+ });
630
+ }
631
+ return re(n);
632
+ }
633
+ function Qt(e) {
634
+ const t = {};
635
+ e.forEach((o) => {
636
+ t[o._id] = { ...o, children: [] };
637
+ });
638
+ const s = [];
639
+ return e.forEach((o) => {
640
+ if (o._parent) {
641
+ const n = t[o._parent];
642
+ n && n.children.push(t[o._id]);
643
+ } else
644
+ s.push(t[o._id]);
645
+ }), s;
646
+ }
647
+ const Xt = (e) => {
648
+ const t = {};
649
+ return Object.keys(e).forEach((s) => {
650
+ zt(e[s]) && e[s].startsWith("slot") && (t[s] = e[s].replace("slot:", ""));
651
+ }), t;
652
+ }, So = (e, t, s = null) => {
653
+ let o = oe(e, { _id: t });
654
+ o = { ...o, oldId: o._id, _id: de() }, s && (o = { ...o, _parent: s });
655
+ const n = [o];
656
+ E(e, { _parent: t }).length > 0 && n.push(re(Yt(e, t, o._id)));
657
+ const i = re(n);
658
+ return I(i, (r) => {
659
+ const c = r, p = Xt(c);
660
+ return Object.keys(p).length > 0 && Object.keys(p).forEach((l) => {
661
+ const m = oe(i, { oldId: p[l].replace("slot:", "") });
662
+ c[l] = `slot:${m._id}`;
663
+ }), st(c, ["global", "oldId"]);
664
+ });
665
+ };
666
+ const ie = w([]);
667
+ ie.debugLabel = "presentBlocksAtom";
668
+ const jo = w((e) => {
669
+ const t = e(ie);
670
+ return Qt([...t]);
671
+ });
672
+ jo.debugLabel = "treeDSBlocks";
673
+ ie.debugLabel = "presentBlocksAtom";
674
+ const it = ho(ie);
675
+ it.debugLabel = "pageBlocksAtomsAtom";
676
+ const Ao = w("");
677
+ Ao.debugLabel = "builderActivePageAtom";
678
+ const Co = w(-1);
679
+ Co.debugLabel = "destinationDropIndexAtom";
680
+ const Zt = w([]);
681
+ Zt.debugLabel = "buildingBlocksAtom";
682
+ const Bo = w((e) => {
683
+ const t = e(Zt);
684
+ return E(t, (s) => pe(s, "blockId"));
685
+ });
686
+ Bo.debugLabel = "globalBlocksAtom";
687
+ const lt = w([]);
688
+ lt.debugLabel = "selectedBlockIdsAtom";
689
+ const ct = w((e) => {
690
+ const t = e(ie), s = e(lt);
691
+ return I(
692
+ E(t, ({ _id: o }) => Y(s, o)),
693
+ (o) => ({ ...o })
694
+ );
695
+ });
696
+ ct.debugLabel = "selectedBlocksAtom";
697
+ const dt = w((e) => {
698
+ const t = e(ct);
699
+ return t.length === 0 ? null : t.length === 1 ? t[0] : {
700
+ type: "Multiple",
701
+ id: I(t, "id")
702
+ };
703
+ });
704
+ dt.debugLabel = "selectedBlockAtom";
705
+ const _o = (e) => J(e, "parent", null), Ro = w((e) => {
706
+ const t = e(ct), s = I(t, _o);
707
+ return E(e(ie), (o) => Y(s, o._id));
708
+ });
709
+ Ro.debugLabel = "selectedBlocksParentsAtom";
710
+ const es = w(() => !1);
711
+ es.debugLabel = "selectedBlockFlexChildAtom";
712
+ const ts = w(() => !1);
713
+ ts.debugLabel = "selectedBlockGridChildAtom";
714
+ const ut = w("");
715
+ ut.debugLabel = "styleStateAtom";
716
+ const ss = Re("styleBreakpoint", "xs");
717
+ ss.debugLabel = "styleBreakpointAtom";
718
+ const Ur = () => ({
719
+ flexChild: te(es),
720
+ gridChild: te(ts)
721
+ }), Wr = () => te(dt);
722
+ const $e = () => {
723
+ const [e, t] = O(lt), s = $(
724
+ (o) => {
725
+ t((n) => Y(n, o) ? Vt(n, o) : [...n, o]);
726
+ },
727
+ [t]
728
+ );
729
+ return [e, t, s];
730
+ }, Rt = (e) => {
731
+ switch (e.type) {
732
+ case "singular":
733
+ return e.uiSchema;
734
+ case "model":
735
+ const { properties: t } = e, s = {};
736
+ return Object.keys(t).forEach((i) => {
737
+ const r = t[i];
738
+ if (Y(["slot", "styles"], r.type))
739
+ return;
740
+ const c = i;
741
+ s[c] = Rt(r);
742
+ }), s;
743
+ case "list":
744
+ const { itemProperties: o } = e, n = {
745
+ items: {}
746
+ };
747
+ return Object.keys(o).forEach((i) => {
748
+ const r = o[i];
749
+ if (Y(["slot", "styles"], r.type))
750
+ return;
751
+ const c = i;
752
+ n.items[c] = Rt(r);
753
+ }), n;
754
+ default:
755
+ return {};
756
+ }
757
+ }, Pt = (e) => {
758
+ switch (e.type) {
759
+ case "singular":
760
+ return e.schema;
761
+ case "model":
762
+ const { properties: t, title: s } = e, o = {
763
+ title: s,
764
+ type: "object",
765
+ properties: {}
766
+ };
767
+ return Object.keys(t).forEach((c) => {
768
+ const p = t[c];
769
+ if (Y(["slot", "styles"], p.type))
770
+ return;
771
+ const l = c;
772
+ o.properties[l] = Pt(p);
773
+ }), o;
774
+ case "list":
775
+ const { itemProperties: n, title: i } = e, r = {
776
+ title: i,
777
+ type: "array",
778
+ items: {
779
+ type: "object",
780
+ properties: {}
781
+ }
782
+ };
783
+ return Object.keys(n).forEach((c) => {
784
+ const p = n[c];
785
+ if (Y(["slot", "styles"], p.type))
786
+ return;
787
+ const l = c;
788
+ r.items.properties[l] = Pt(p), Se(r.items, "title", J(p, "itemTitle", `${i} item`));
789
+ }), r;
790
+ default:
791
+ return {};
792
+ }
793
+ }, os = (e) => {
794
+ if (!e)
795
+ return {};
796
+ const t = {};
797
+ return Object.keys(e).forEach((s) => {
798
+ t[s] = To(e[s]);
799
+ }), t;
800
+ }, Po = (e) => {
801
+ if (Be(e.default))
802
+ return [];
803
+ const { itemProperties: t } = e;
804
+ return I(e.default, (s) => {
805
+ const o = { ...s };
806
+ return $t(s, (n, i) => {
807
+ pe(t, i) && J(t[i], "i18n", !1) && (o[i] = Ut);
808
+ }), o;
809
+ });
810
+ }, To = (e) => {
811
+ switch (e.type) {
812
+ case "styles":
813
+ return e.default;
814
+ case "slot":
815
+ return `${Je}${de()}`;
816
+ case "singular":
817
+ const { i18n: t, schema: s } = e;
818
+ return t ? Ut : J(s, "default", "");
819
+ case "model":
820
+ return os(e.properties);
821
+ case "list":
822
+ return Po(e);
823
+ default:
824
+ return "";
825
+ }
826
+ };
827
+ var ft = { exports: {} }, Gr = ft.exports;
828
+ (function(e) {
829
+ (function() {
830
+ "use strict";
831
+ function t(o, n, i) {
832
+ return o.splice(
833
+ n,
834
+ !i || 1 + i - n + (!(i < 0 ^ n >= 0) && (i < 0 || -1) * o.length)
835
+ ), o.length;
836
+ }
837
+ let s = function() {
838
+ let o = [], n = -1, i = 0, r = !1, c;
839
+ function p(l, m) {
840
+ return !l || typeof l[m] != "function" ? this : (r = !0, l[m](), r = !1, this);
841
+ }
842
+ return {
843
+ /**
844
+ * Adds a command to the queue.
845
+ * @property {object} command - Command
846
+ * @property {function} command.undo - Undo function
847
+ * @property {function} command.redo - Redo function
848
+ * @property {string} [command.groupId] - Optional group id
849
+ */
850
+ add: function(l) {
851
+ return r ? this : (o.splice(n + 1, o.length - n), o.push(l), i && o.length > i && t(o, 0, -(i + 1)), n = o.length - 1, c && c(), this);
852
+ },
853
+ /**
854
+ * Pass a function to be called on undo and redo actions.
855
+ * @property {function} callbackFunc - Callback function
856
+ */
857
+ setCallback: function(l) {
858
+ c = l;
859
+ },
860
+ /**
861
+ * Performs undo: call the undo function at the current index and decrease the index by 1.
862
+ */
863
+ undo: function() {
864
+ let l = o[n];
865
+ if (!l)
866
+ return this;
867
+ const m = l.groupId;
868
+ for (; l.groupId === m && (p(l, "undo"), n -= 1, l = o[n], !(!l || !l.groupId)); )
869
+ ;
870
+ return c && c(), this;
871
+ },
872
+ /**
873
+ * Performs redo: call the redo function at the next index and increase the index by 1.
874
+ */
875
+ redo: function() {
876
+ let l = o[n + 1];
877
+ if (!l)
878
+ return this;
879
+ const m = l.groupId;
880
+ for (; l.groupId === m && (p(l, "redo"), n += 1, l = o[n + 1], !(!l || !l.groupId)); )
881
+ ;
882
+ return c && c(), this;
883
+ },
884
+ /**
885
+ * Clears the memory, losing all stored states. Resets the index.
886
+ */
887
+ clear: function() {
888
+ let l = o.length;
889
+ o = [], n = -1, c && l > 0 && c();
890
+ },
891
+ /**
892
+ * Tests if any undo actions exist.
893
+ * @returns {boolean}
894
+ */
895
+ hasUndo: function() {
896
+ return n !== -1;
897
+ },
898
+ /**
899
+ * Tests if any redo actions exist.
900
+ * @returns {boolean}
901
+ */
902
+ hasRedo: function() {
903
+ return n < o.length - 1;
904
+ },
905
+ /**
906
+ * Returns the list of queued commands.
907
+ * @param {string} [groupId] - Optionally filter commands by group ID
908
+ * @returns {array}
909
+ */
910
+ getCommands: function(l) {
911
+ return l ? o.filter((m) => m.groupId === l) : o;
912
+ },
913
+ /**
914
+ * Returns the index of the actions list.
915
+ * @returns {number}
916
+ */
917
+ getIndex: function() {
918
+ return n;
919
+ },
920
+ /**
921
+ * Sets the maximum number of undo steps. Default: 0 (unlimited).
922
+ * @property {number} max - Maximum number of undo steps
923
+ */
924
+ setLimit: function(l) {
925
+ i = l;
926
+ }
927
+ };
928
+ };
929
+ e.exports ? e.exports = s : window.UndoManager = s;
930
+ })();
931
+ })(ft);
932
+ var Io = ft.exports;
933
+ const Mo = /* @__PURE__ */ Ws(Io), Do = w(Ye), Eo = w(null), ns = () => {
934
+ const [e, t] = O(Do);
935
+ return [
936
+ $s(e) ? { ...Ye, ...e } : Ye,
937
+ t
938
+ ];
939
+ }, Hr = () => O(Eo), Oo = w(null), Lo = () => ({ currentPage: te(Oo) });
940
+ function zo(e) {
941
+ return Qt(e);
942
+ }
943
+ const mt = (e, t) => re(
944
+ e.map((s) => {
945
+ if (s = t ? { ...s, parent: t } : { ...s }, s.children) {
946
+ const o = [...s.children];
947
+ return delete s.children, re([s, ...mt(o, s._id)]);
948
+ }
949
+ return s;
950
+ })
951
+ );
952
+ function pt(e, t = !1) {
953
+ for (let s = 0; s < e.length; s++) {
954
+ const o = e[s];
955
+ o.global && !t ? e[s] = {
956
+ type: "GlobalBlock",
957
+ blockId: o.blockId,
958
+ _parent: J(o, "parent", null),
959
+ _id: o._id
960
+ } : o.children && o.children.length && pt(o.children);
961
+ }
962
+ }
963
+ function as(e) {
964
+ let t = [], s = E(e, { type: "GlobalBlock" });
965
+ return s.length > 0 && (s = I(s, rs), ce(s, (o) => {
966
+ t = [...t, ...Vo(o)];
967
+ })), t;
968
+ }
969
+ function Vo(e) {
970
+ let t = [];
971
+ const s = J(ee(e), "parent", null);
972
+ Se(ee(e), "parent", null);
973
+ const o = [flatToNestedInstance.convert(is(e))];
974
+ pt(o, !0);
975
+ let n = mt(o, e[0]._id);
976
+ return n = Se(n, "0.parent", s), t = [...t, n, ...as(n)], t;
977
+ }
978
+ function rs(e) {
979
+ const t = oe(Xe, { _id: e._id });
980
+ if (!t)
981
+ return [];
982
+ const s = [t], o = E(Xe, { _parent: e._id });
983
+ return o.length ? re([...s, ...re(I(o, rs))]) : re(s);
984
+ }
985
+ const is = (e) => JSON.parse(JSON.stringify(e));
986
+ let Xe = [];
987
+ function $o(e) {
988
+ Xe = e;
989
+ const t = zo(is(e));
990
+ pt(t);
991
+ const s = mt(t, null), o = as(s), n = {};
992
+ return ce(o, (i) => Se(n, ee(i).blockId, i)), [s, n];
993
+ }
994
+ const Fo = () => {
995
+ const [e] = ns(), { currentPage: t } = Lo(), [s] = we();
996
+ return $(() => {
997
+ const o = I(
998
+ s,
999
+ (i) => st(i, ["expanded", "order", "title", "siblings", "tempClasses"])
1000
+ ), [n = []] = $o(o);
1001
+ return {
1002
+ currentPage: t,
1003
+ blocks: n
1004
+ };
1005
+ }, [e, t, s]);
1006
+ }, ve = (e, t = void 0) => {
1007
+ const s = te(Jt);
1008
+ return J(s, e, t);
1009
+ }, ls = w([]);
1010
+ ls.debugLabel = "dataProvidersAtom";
1011
+ const Uo = () => O(ls), gt = w("SAVED");
1012
+ gt.debugLabel = "builderSaveStateAtom";
1013
+ const qr = () => {
1014
+ const [e, t] = O(gt), s = ve("onSavePage", async (l) => {
1015
+ }), o = ve("onSave", async (l) => {
1016
+ }), n = ve("onSaveStateChange", qe), i = Fo(), [r] = Uo(), [c] = ns();
1017
+ return { savePage: Gs(
1018
+ async () => {
1019
+ t("SAVING"), n("SAVING");
1020
+ const l = i();
1021
+ return await s({ blocks: l.blocks, providers: r }), await o({ blocks: l.blocks, providers: r, brandingOptions: c }), setTimeout(() => {
1022
+ t("SAVED"), n("SAVED");
1023
+ }, 100), !0;
1024
+ },
1025
+ [i, t, c, o, n],
1026
+ 3e3
1027
+ // save only every 5 seconds
1028
+ ), saveState: e, setSaveState: t };
1029
+ }, ne = new Mo();
1030
+ ne.setLimit(50);
1031
+ const cs = () => {
1032
+ const [, e] = O(gt), t = ve("onSaveStateChange", qe);
1033
+ return Ae(() => (ne.setCallback(() => {
1034
+ e("UNSAVED"), t("UNSAVED");
1035
+ }), () => {
1036
+ ne.setCallback(qe);
1037
+ }), []), {
1038
+ add: ne.add,
1039
+ undo: ne.undo,
1040
+ redo: ne.redo,
1041
+ hasRedo: ne.hasRedo,
1042
+ hasUndo: ne.hasUndo,
1043
+ clear: ne.clear
1044
+ };
1045
+ }, bt = (e, t) => {
1046
+ const s = [], o = E(e, (n) => Y(t, n._id) || Y(t, n._parent) ? (s.push(n._id), !1) : !0);
1047
+ return Be(s) ? o : bt(o, s);
1048
+ }, Kr = () => {
1049
+ const [e] = we(), [t, s] = $e(), { setNewBlocks: o } = he();
1050
+ return $(
1051
+ (n) => {
1052
+ var r;
1053
+ const i = ((r = oe(e, { _id: n[0] })) == null ? void 0 : r._parent) || null;
1054
+ o(bt(e, n)), setTimeout(() => s(i ? [i] : []), 200);
1055
+ },
1056
+ [e, s, t]
1057
+ );
1058
+ };
1059
+ function Wo(e, t, s, o) {
1060
+ let n = e.filter((c) => !c._parent);
1061
+ s && (n = e.filter((c) => c._parent === s));
1062
+ const i = o !== void 0 ? o : n.length;
1063
+ let r = e.length;
1064
+ for (let c = 0, p = 0; c < e.length; c++)
1065
+ if (e[c]._parent === s) {
1066
+ if (p === i) {
1067
+ r = c;
1068
+ break;
1069
+ }
1070
+ p++;
1071
+ }
1072
+ return !s && o !== void 0 && o >= n.length && (r = e.length), [...e.slice(0, r), ...t, ...e.slice(r)];
1073
+ }
1074
+ function Tt(e) {
1075
+ const t = [], s = /* @__PURE__ */ new Map();
1076
+ e.forEach((n) => {
1077
+ s.set(n._id, n);
1078
+ });
1079
+ function o(n) {
1080
+ const i = s.get(n);
1081
+ t.includes(i) || (t.push(i), e.forEach((r) => {
1082
+ r._parent === n && o(r._id);
1083
+ }));
1084
+ }
1085
+ return e.forEach((n) => {
1086
+ n._parent || o(n._id);
1087
+ }), t;
1088
+ }
1089
+ const Go = (e, t, s, o) => {
1090
+ if (Be(t))
1091
+ return Tt(e);
1092
+ function n(c, p) {
1093
+ const l = c.filter((N) => N._parent === p);
1094
+ let m = [...l];
1095
+ return l.forEach((N) => {
1096
+ m = m.concat(n(c, N._id));
1097
+ }), m;
1098
+ }
1099
+ const i = t.reduce((c, p) => {
1100
+ const l = e.find((m) => m._id === p);
1101
+ if (l) {
1102
+ const m = n(e, p);
1103
+ c.push(l, ...m);
1104
+ }
1105
+ return c;
1106
+ }, []);
1107
+ e = e.filter((c) => !i.includes(c)), i.forEach((c) => {
1108
+ t.includes(c._id) && (c._parent = s);
1109
+ });
1110
+ let r;
1111
+ if (!s)
1112
+ r = o;
1113
+ else {
1114
+ const c = e.findIndex((p) => p._id === s);
1115
+ if (c === -1)
1116
+ r = o;
1117
+ else {
1118
+ r = c + 1;
1119
+ let p = 0;
1120
+ for (; p < o && r < e.length; )
1121
+ e[r]._parent === s && p++, r++;
1122
+ }
1123
+ }
1124
+ return e.splice(r, 0, ...i), Tt(e);
1125
+ }, Ho = () => {
1126
+ const [, e] = we();
1127
+ return {
1128
+ setNewBlocks: (t) => {
1129
+ e(t);
1130
+ },
1131
+ addBlocks: (t, s, o) => {
1132
+ e((n) => Wo(n, t, s, o));
1133
+ },
1134
+ removeBlocks: (t) => {
1135
+ e((s) => bt(s, t));
1136
+ },
1137
+ moveBlocks: (t, s, o) => {
1138
+ e((n) => Go(n, t, s, o));
1139
+ },
1140
+ updateBlocksProps: (t) => {
1141
+ e((s) => {
1142
+ const o = t.map((n) => n._id);
1143
+ return s.map((n) => {
1144
+ if (o.includes(n._id)) {
1145
+ const i = oe(t, { _id: n._id });
1146
+ return { ...n, ...st(i, "_id") };
1147
+ }
1148
+ return n;
1149
+ });
1150
+ });
1151
+ }
1152
+ };
1153
+ }, we = () => O(ie), he = () => {
1154
+ const { add: e } = cs(), [t] = we(), {
1155
+ setNewBlocks: s,
1156
+ addBlocks: o,
1157
+ removeBlocks: n,
1158
+ moveBlocks: i,
1159
+ updateBlocksProps: r
1160
+ } = Ho();
1161
+ return {
1162
+ moveBlocks: (v, j, L) => {
1163
+ const F = I(v, (T) => {
1164
+ const V = t.find((K) => K._id === T)._parent || null, q = t.filter((K) => V ? K._parent === V : !K._parent).map((K) => K._id).indexOf(T);
1165
+ return { _id: T, oldParent: V, oldPosition: q };
1166
+ }), B = F.find(({ _id: T }) => T === v[0]);
1167
+ B && B.oldParent === j && B.oldPosition === L || (i(v, j, L), e({
1168
+ undo: () => ce(F, ({ _id: T, oldParent: G, oldPosition: V }) => {
1169
+ i([T], G, V);
1170
+ }),
1171
+ redo: () => i(v, j, L)
1172
+ }));
1173
+ },
1174
+ addBlocks: (v, j, L) => {
1175
+ o(v, j, L), e({
1176
+ undo: () => n(I(v, "_id")),
1177
+ redo: () => o(v, j, L)
1178
+ });
1179
+ },
1180
+ removeBlocks: (v) => {
1181
+ var B;
1182
+ const j = (B = ee(v)) == null ? void 0 : B._parent, F = t.filter((T) => j ? T._parent === j : !T._parent).indexOf(ee(v));
1183
+ n(I(v, "_id")), e({
1184
+ undo: () => o(v, j, F),
1185
+ redo: () => n(I(v, "_id"))
1186
+ });
1187
+ },
1188
+ updateBlocks: (v, j, L) => {
1189
+ let F = [];
1190
+ if (L)
1191
+ F = I(v, (B) => ({ _id: B, ...L }));
1192
+ else {
1193
+ const B = Fs(j);
1194
+ F = I(v, (T) => {
1195
+ const G = t.find((X) => X._id === T), V = { _id: T };
1196
+ return ce(B, (X) => V[X] = G[X]), V;
1197
+ });
1198
+ }
1199
+ r(I(v, (B) => ({ _id: B, ...j }))), e({
1200
+ undo: () => r(F),
1201
+ redo: () => r(I(v, (B) => ({ _id: B, ...j })))
1202
+ });
1203
+ },
1204
+ updateBlocksRuntime: (v, j) => {
1205
+ r(I(v, (L) => ({ _id: L, ...j })));
1206
+ },
1207
+ setNewBlocks: (v) => {
1208
+ s(v), e({
1209
+ undo: () => s(t),
1210
+ redo: () => s(v)
1211
+ });
1212
+ }
1213
+ };
1214
+ }, qo = ge(
1215
+ "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
1216
+ {
1217
+ variants: {
1218
+ variant: {
1219
+ default: "bg-transparent",
1220
+ outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
1221
+ },
1222
+ size: {
1223
+ default: "h-10 px-3",
1224
+ sm: "h-9 px-2.5",
1225
+ lg: "h-11 px-5"
1226
+ }
1227
+ },
1228
+ defaultVariants: {
1229
+ variant: "default",
1230
+ size: "default"
1231
+ }
1232
+ }
1233
+ ), Ko = f.forwardRef(({ className: e, variant: t, size: s, ...o }, n) => /* @__PURE__ */ a.jsx(Wt.Root, { ref: n, className: d(qo({ variant: t, size: s, className: e })), ...o }));
1234
+ Ko.displayName = Wt.Root.displayName;
1235
+ const Jo = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1236
+ Qe.Root,
1237
+ {
1238
+ className: d(
1239
+ "peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",
1240
+ e
1241
+ ),
1242
+ ...t,
1243
+ ref: s,
1244
+ children: /* @__PURE__ */ a.jsx(
1245
+ Qe.Thumb,
1246
+ {
1247
+ className: d(
1248
+ "pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950"
1249
+ )
1250
+ }
1251
+ )
1252
+ }
1253
+ ));
1254
+ Jo.displayName = Qe.Root.displayName;
1255
+ const ht = ge(
1256
+ "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
1257
+ {
1258
+ variants: {
1259
+ variant: {
1260
+ default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
1261
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
1262
+ outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
1263
+ secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
1264
+ ghost: "hover:bg-accent hover:text-accent-foreground",
1265
+ link: "text-primary underline-offset-4 hover:underline"
1266
+ },
1267
+ size: {
1268
+ default: "h-9 px-4 py-2",
1269
+ sm: "h-8 rounded-md px-3 text-xs",
1270
+ lg: "h-10 rounded-md px-8",
1271
+ icon: "h-9 w-9"
1272
+ }
1273
+ },
1274
+ defaultVariants: {
1275
+ variant: "default",
1276
+ size: "default"
1277
+ }
1278
+ }
1279
+ ), Yo = f.forwardRef(
1280
+ ({ className: e, variant: t, size: s, asChild: o = !1, ...n }, i) => {
1281
+ const r = o ? Hs : "button";
1282
+ return /* @__PURE__ */ a.jsx(r, { className: d(ht({ variant: t, size: s, className: e })), ref: i, ...n });
1283
+ }
1284
+ );
1285
+ Yo.displayName = "Button";
1286
+ const Jr = me.Root, Qo = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(me.Item, { ref: s, className: d("border-b", e), ...t }));
1287
+ Qo.displayName = "AccordionItem";
1288
+ const Xo = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsx(me.Header, { className: "flex", children: /* @__PURE__ */ a.jsxs(
1289
+ me.Trigger,
1290
+ {
1291
+ ref: o,
1292
+ className: d(
1293
+ "flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
1294
+ e
1295
+ ),
1296
+ ...s,
1297
+ children: [
1298
+ t,
1299
+ /* @__PURE__ */ a.jsx(qs, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })
1300
+ ]
1301
+ }
1302
+ ) }));
1303
+ Xo.displayName = me.Trigger.displayName;
1304
+ const Zo = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1305
+ me.Content,
1306
+ {
1307
+ ref: o,
1308
+ className: d(
1309
+ "text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
1310
+ e
1311
+ ),
1312
+ ...s,
1313
+ children: /* @__PURE__ */ a.jsx("div", { className: "pb-4 pt-0", children: t })
1314
+ }
1315
+ ));
1316
+ Zo.displayName = me.Content.displayName;
1317
+ const en = ge(
1318
+ "relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
1319
+ {
1320
+ variants: {
1321
+ variant: {
1322
+ default: "bg-background text-foreground",
1323
+ destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
1324
+ }
1325
+ },
1326
+ defaultVariants: {
1327
+ variant: "default"
1328
+ }
1329
+ }
1330
+ ), tn = f.forwardRef(({ className: e, variant: t, ...s }, o) => /* @__PURE__ */ a.jsx("div", { ref: o, role: "alert", className: d(en({ variant: t }), e), ...s }));
1331
+ tn.displayName = "Alert";
1332
+ const sn = f.forwardRef(
1333
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("h5", { ref: s, className: d("mb-1 font-medium leading-none tracking-tight", e), ...t })
1334
+ );
1335
+ sn.displayName = "AlertTitle";
1336
+ const on = f.forwardRef(
1337
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d("text-sm [&_p]:leading-relaxed", e), ...t })
1338
+ );
1339
+ on.displayName = "AlertDescription";
1340
+ const nn = ge(
1341
+ "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
1342
+ {
1343
+ variants: {
1344
+ variant: {
1345
+ default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
1346
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
1347
+ destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
1348
+ outline: "text-foreground"
1349
+ }
1350
+ },
1351
+ defaultVariants: {
1352
+ variant: "default"
1353
+ }
1354
+ }
1355
+ ), Yr = ({ className: e, variant: t, ...s }) => /* @__PURE__ */ a.jsx("div", { className: d(nn({ variant: t }), e), ...s }), Qr = H.Root, Xr = H.Trigger, ds = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx(H.Portal, { className: d(e), ...t });
1356
+ ds.displayName = H.Portal.displayName;
1357
+ const us = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1358
+ H.Overlay,
1359
+ {
1360
+ className: d(
1361
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1362
+ e
1363
+ ),
1364
+ ...t,
1365
+ ref: s
1366
+ }
1367
+ ));
1368
+ us.displayName = H.Overlay.displayName;
1369
+ const an = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsxs(ds, { children: [
1370
+ /* @__PURE__ */ a.jsx(us, {}),
1371
+ /* @__PURE__ */ a.jsx(
1372
+ H.Content,
1373
+ {
1374
+ ref: s,
1375
+ className: d(
1376
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
1377
+ e
1378
+ ),
1379
+ ...t
1380
+ }
1381
+ )
1382
+ ] }));
1383
+ an.displayName = H.Content.displayName;
1384
+ const rn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
1385
+ rn.displayName = "AlertDialogHeader";
1386
+ const ln = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
1387
+ ln.displayName = "AlertDialogFooter";
1388
+ const cn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(H.Title, { ref: s, className: d("text-lg font-semibold", e), ...t }));
1389
+ cn.displayName = H.Title.displayName;
1390
+ const dn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(H.Description, { ref: s, className: d("text-sm text-muted-foreground", e), ...t }));
1391
+ dn.displayName = H.Description.displayName;
1392
+ const un = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(H.Action, { ref: s, className: d(ht(), e), ...t }));
1393
+ un.displayName = H.Action.displayName;
1394
+ const fn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1395
+ H.Cancel,
1396
+ {
1397
+ ref: s,
1398
+ className: d(ht({ variant: "outline" }), "mt-2 sm:mt-0", e),
1399
+ ...t
1400
+ }
1401
+ ));
1402
+ fn.displayName = H.Cancel.displayName;
1403
+ const fs = P.Root, mn = P.Trigger, ms = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx(P.Portal, { className: d(e), ...t });
1404
+ ms.displayName = P.Portal.displayName;
1405
+ const ps = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1406
+ P.Overlay,
1407
+ {
1408
+ ref: s,
1409
+ className: d(
1410
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1411
+ e
1412
+ ),
1413
+ ...t
1414
+ }
1415
+ ));
1416
+ ps.displayName = P.Overlay.displayName;
1417
+ const xt = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(ms, { children: [
1418
+ /* @__PURE__ */ a.jsx(ps, {}),
1419
+ /* @__PURE__ */ a.jsxs(
1420
+ P.Content,
1421
+ {
1422
+ ref: o,
1423
+ className: d(
1424
+ "fixed left-[50%] top-[50%] z-[999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
1425
+ e
1426
+ ),
1427
+ ...s,
1428
+ children: [
1429
+ t,
1430
+ /* @__PURE__ */ a.jsxs(P.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
1431
+ /* @__PURE__ */ a.jsx(ot, { className: "h-4 w-4" }),
1432
+ /* @__PURE__ */ a.jsx("span", { className: "sr-only", children: "Close" })
1433
+ ] })
1434
+ ]
1435
+ }
1436
+ )
1437
+ ] }));
1438
+ xt.displayName = P.Content.displayName;
1439
+ const pn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col space-y-1.5 text-center sm:text-left", e), ...t });
1440
+ pn.displayName = "DialogHeader";
1441
+ const gn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
1442
+ gn.displayName = "DialogFooter";
1443
+ const bn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1444
+ P.Title,
1445
+ {
1446
+ ref: s,
1447
+ className: d("text-lg font-semibold leading-none tracking-tight", e),
1448
+ ...t
1449
+ }
1450
+ ));
1451
+ bn.displayName = P.Title.displayName;
1452
+ const hn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(P.Description, { ref: s, className: d("text-sm text-muted-foreground", e), ...t }));
1453
+ hn.displayName = P.Description.displayName;
1454
+ const xn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d("rounded-xl border bg-card text-card-foreground shadow", e), ...t }));
1455
+ xn.displayName = "Card";
1456
+ const vn = f.forwardRef(
1457
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d("flex flex-col space-y-1.5 p-6", e), ...t })
1458
+ );
1459
+ vn.displayName = "CardHeader";
1460
+ const yn = f.forwardRef(
1461
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("h3", { ref: s, className: d("font-semibold leading-none tracking-tight", e), ...t })
1462
+ );
1463
+ yn.displayName = "CardTitle";
1464
+ const wn = f.forwardRef(
1465
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("p", { ref: s, className: d("text-sm text-muted-foreground", e), ...t })
1466
+ );
1467
+ wn.displayName = "CardDescription";
1468
+ const Nn = f.forwardRef(
1469
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d("p-6 pt-0", e), ...t })
1470
+ );
1471
+ Nn.displayName = "CardContent";
1472
+ const kn = f.forwardRef(
1473
+ ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d(" flex items-center p-6 pt-0", e), ...t })
1474
+ );
1475
+ kn.displayName = "CardFooter";
1476
+ const Sn = f.forwardRef(({ className: e, type: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1477
+ "input",
1478
+ {
1479
+ type: t,
1480
+ className: d(
1481
+ "flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1482
+ e
1483
+ ),
1484
+ ref: o,
1485
+ ...s
1486
+ }
1487
+ ));
1488
+ Sn.displayName = "Input";
1489
+ const jn = ge("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"), An = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(Gt.Root, { ref: s, className: d(jn(), e), ...t }));
1490
+ An.displayName = Gt.Root.displayName;
1491
+ const Cn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1492
+ "textarea",
1493
+ {
1494
+ className: d(
1495
+ "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1496
+ e
1497
+ ),
1498
+ ref: s,
1499
+ ...t
1500
+ }
1501
+ ));
1502
+ Cn.displayName = "Textarea";
1503
+ const Bn = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(ue.Root, { ref: o, className: d("relative overflow-hidden", e), ...s, children: [
1504
+ /* @__PURE__ */ a.jsx(ue.Viewport, { className: "h-full w-full rounded-[inherit]", children: t }),
1505
+ /* @__PURE__ */ a.jsx(gs, {}),
1506
+ /* @__PURE__ */ a.jsx(ue.Corner, {})
1507
+ ] }));
1508
+ Bn.displayName = ue.Root.displayName;
1509
+ const gs = f.forwardRef(({ className: e, orientation: t = "vertical", ...s }, o) => /* @__PURE__ */ a.jsx(
1510
+ ue.ScrollAreaScrollbar,
1511
+ {
1512
+ ref: o,
1513
+ orientation: t,
1514
+ className: d(
1515
+ "flex touch-none select-none transition-colors",
1516
+ t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
1517
+ t === "horizontal" && "h-2.5 border-t border-t-transparent p-[1px]",
1518
+ e
1519
+ ),
1520
+ ...s,
1521
+ children: /* @__PURE__ */ a.jsx(ue.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
1522
+ }
1523
+ ));
1524
+ gs.displayName = ue.ScrollAreaScrollbar.displayName;
1525
+ const _n = be.Root, bs = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1526
+ be.List,
1527
+ {
1528
+ ref: s,
1529
+ className: d(
1530
+ "inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
1531
+ e
1532
+ ),
1533
+ ...t
1534
+ }
1535
+ ));
1536
+ bs.displayName = be.List.displayName;
1537
+ const Ze = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1538
+ be.Trigger,
1539
+ {
1540
+ ref: s,
1541
+ className: d(
1542
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
1543
+ e
1544
+ ),
1545
+ ...t
1546
+ }
1547
+ ));
1548
+ Ze.displayName = be.Trigger.displayName;
1549
+ const et = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1550
+ be.Content,
1551
+ {
1552
+ ref: s,
1553
+ className: d(
1554
+ "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1555
+ e
1556
+ ),
1557
+ ...t
1558
+ }
1559
+ ));
1560
+ et.displayName = be.Content.displayName;
1561
+ const Zr = ye.Portal, ei = ye.Provider, ti = ye.Root, si = ye.Trigger, Rn = f.forwardRef(({ className: e, sideOffset: t = 4, ...s }, o) => /* @__PURE__ */ a.jsx(
1562
+ ye.Content,
1563
+ {
1564
+ ref: o,
1565
+ sideOffset: t,
1566
+ className: d(
1567
+ "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1568
+ e
1569
+ ),
1570
+ ...s
1571
+ }
1572
+ ));
1573
+ Rn.displayName = ye.Content.displayName;
1574
+ const oi = je.Root, ni = je.Trigger, Pn = f.forwardRef(({ className: e, align: t = "center", sideOffset: s = 4, ...o }, n) => /* @__PURE__ */ a.jsx(je.Portal, { children: /* @__PURE__ */ a.jsx(
1575
+ je.Content,
1576
+ {
1577
+ ref: n,
1578
+ align: t,
1579
+ sideOffset: s,
1580
+ className: d(
1581
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1582
+ e
1583
+ ),
1584
+ ...o
1585
+ }
1586
+ ) }));
1587
+ Pn.displayName = je.Content.displayName;
1588
+ const ai = _.Menu, ri = _.Group, ii = _.Portal, li = _.Sub, ci = _.RadioGroup, Tn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1589
+ _.Root,
1590
+ {
1591
+ ref: s,
1592
+ className: d("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm", e),
1593
+ ...t
1594
+ }
1595
+ ));
1596
+ Tn.displayName = _.Root.displayName;
1597
+ const In = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1598
+ _.Trigger,
1599
+ {
1600
+ ref: s,
1601
+ className: d(
1602
+ "flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
1603
+ e
1604
+ ),
1605
+ ...t
1606
+ }
1607
+ ));
1608
+ In.displayName = _.Trigger.displayName;
1609
+ const Mn = f.forwardRef(({ className: e, inset: t, children: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
1610
+ _.SubTrigger,
1611
+ {
1612
+ ref: n,
1613
+ className: d(
1614
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
1615
+ t && "pl-8",
1616
+ e
1617
+ ),
1618
+ ...o,
1619
+ children: [
1620
+ s,
1621
+ /* @__PURE__ */ a.jsx(nt, { className: "ml-auto h-4 w-4" })
1622
+ ]
1623
+ }
1624
+ ));
1625
+ Mn.displayName = _.SubTrigger.displayName;
1626
+ const Dn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1627
+ _.SubContent,
1628
+ {
1629
+ ref: s,
1630
+ className: d(
1631
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1632
+ e
1633
+ ),
1634
+ ...t
1635
+ }
1636
+ ));
1637
+ Dn.displayName = _.SubContent.displayName;
1638
+ const En = f.forwardRef(({ className: e, align: t = "start", alignOffset: s = -4, sideOffset: o = 8, ...n }, i) => /* @__PURE__ */ a.jsx(_.Portal, { children: /* @__PURE__ */ a.jsx(
1639
+ _.Content,
1640
+ {
1641
+ ref: i,
1642
+ align: t,
1643
+ alignOffset: s,
1644
+ sideOffset: o,
1645
+ className: d(
1646
+ "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1647
+ e
1648
+ ),
1649
+ ...n
1650
+ }
1651
+ ) }));
1652
+ En.displayName = _.Content.displayName;
1653
+ const On = f.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1654
+ _.Item,
1655
+ {
1656
+ ref: o,
1657
+ className: d(
1658
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1659
+ t && "pl-8",
1660
+ e
1661
+ ),
1662
+ ...s
1663
+ }
1664
+ ));
1665
+ On.displayName = _.Item.displayName;
1666
+ const Ln = f.forwardRef(({ className: e, children: t, checked: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
1667
+ _.CheckboxItem,
1668
+ {
1669
+ ref: n,
1670
+ className: d(
1671
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1672
+ e
1673
+ ),
1674
+ checked: s,
1675
+ ...o,
1676
+ children: [
1677
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(_.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ze, { className: "h-4 w-4" }) }) }),
1678
+ t
1679
+ ]
1680
+ }
1681
+ ));
1682
+ Ln.displayName = _.CheckboxItem.displayName;
1683
+ const zn = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
1684
+ _.RadioItem,
1685
+ {
1686
+ ref: o,
1687
+ className: d(
1688
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1689
+ e
1690
+ ),
1691
+ ...s,
1692
+ children: [
1693
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(_.ItemIndicator, { children: /* @__PURE__ */ a.jsx(at, { className: "h-4 w-4 fill-current" }) }) }),
1694
+ t
1695
+ ]
1696
+ }
1697
+ ));
1698
+ zn.displayName = _.RadioItem.displayName;
1699
+ const Vn = f.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1700
+ _.Label,
1701
+ {
1702
+ ref: o,
1703
+ className: d("px-2 py-1.5 text-sm font-semibold", t && "pl-8", e),
1704
+ ...s
1705
+ }
1706
+ ));
1707
+ Vn.displayName = _.Label.displayName;
1708
+ const $n = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(_.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-muted", e), ...t }));
1709
+ $n.displayName = _.Separator.displayName;
1710
+ const Fn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: d("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
1711
+ Fn.displayname = "MenubarShortcut";
1712
+ const di = Ve.Root, ui = Ve.Trigger, Un = f.forwardRef(({ className: e, align: t = "center", sideOffset: s = 4, ...o }, n) => /* @__PURE__ */ a.jsx(
1713
+ Ve.Content,
1714
+ {
1715
+ ref: n,
1716
+ align: t,
1717
+ sideOffset: s,
1718
+ className: d(
1719
+ "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1720
+ e
1721
+ ),
1722
+ ...o
1723
+ }
1724
+ ));
1725
+ Un.displayName = Ve.Content.displayName;
1726
+ const fi = U.Root, mi = U.Group, pi = U.Value, Wn = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
1727
+ U.Trigger,
1728
+ {
1729
+ ref: o,
1730
+ className: d(
1731
+ "flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1732
+ e
1733
+ ),
1734
+ ...s,
1735
+ children: [
1736
+ t,
1737
+ /* @__PURE__ */ a.jsx(U.Icon, { asChild: !0, children: /* @__PURE__ */ a.jsx(Ks, { className: "h-4 w-4 opacity-50" }) })
1738
+ ]
1739
+ }
1740
+ ));
1741
+ Wn.displayName = U.Trigger.displayName;
1742
+ const Gn = f.forwardRef(({ className: e, children: t, position: s = "popper", ...o }, n) => /* @__PURE__ */ a.jsx(U.Portal, { children: /* @__PURE__ */ a.jsx(
1743
+ U.Content,
1744
+ {
1745
+ ref: n,
1746
+ className: d(
1747
+ "relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1748
+ s === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
1749
+ e
1750
+ ),
1751
+ position: s,
1752
+ ...o,
1753
+ children: /* @__PURE__ */ a.jsx(
1754
+ U.Viewport,
1755
+ {
1756
+ className: d(
1757
+ "p-1",
1758
+ s === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
1759
+ ),
1760
+ children: t
1761
+ }
1762
+ )
1763
+ }
1764
+ ) }));
1765
+ Gn.displayName = U.Content.displayName;
1766
+ const Hn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(U.Label, { ref: s, className: d("px-2 py-1.5 text-sm font-semibold", e), ...t }));
1767
+ Hn.displayName = U.Label.displayName;
1768
+ const qn = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
1769
+ U.Item,
1770
+ {
1771
+ ref: o,
1772
+ className: d(
1773
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1774
+ e
1775
+ ),
1776
+ ...s,
1777
+ children: [
1778
+ /* @__PURE__ */ a.jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(U.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ze, { className: "h-4 w-4" }) }) }),
1779
+ /* @__PURE__ */ a.jsx(U.ItemText, { children: t })
1780
+ ]
1781
+ }
1782
+ ));
1783
+ qn.displayName = U.Item.displayName;
1784
+ const Kn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(U.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-muted", e), ...t }));
1785
+ Kn.displayName = U.Separator.displayName;
1786
+ const gi = P.Root, bi = P.Trigger, hi = P.Close, hs = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx(P.Portal, { className: d(e), ...t });
1787
+ hs.displayName = P.Portal.displayName;
1788
+ const xs = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1789
+ P.Overlay,
1790
+ {
1791
+ className: d(
1792
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1793
+ e
1794
+ ),
1795
+ ...t,
1796
+ ref: s
1797
+ }
1798
+ ));
1799
+ xs.displayName = P.Overlay.displayName;
1800
+ const Jn = ge(
1801
+ "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
1802
+ {
1803
+ variants: {
1804
+ side: {
1805
+ top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
1806
+ bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
1807
+ left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
1808
+ right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
1809
+ }
1810
+ },
1811
+ defaultVariants: {
1812
+ side: "right"
1813
+ }
1814
+ }
1815
+ ), Yn = f.forwardRef(
1816
+ ({ side: e = "right", className: t, children: s, ...o }, n) => /* @__PURE__ */ a.jsxs(hs, { children: [
1817
+ /* @__PURE__ */ a.jsx(xs, {}),
1818
+ /* @__PURE__ */ a.jsxs(P.Content, { ref: n, className: d(Jn({ side: e }), t), ...o, children: [
1819
+ s,
1820
+ /* @__PURE__ */ a.jsxs(P.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
1821
+ /* @__PURE__ */ a.jsx(ot, { className: "h-4 w-4" }),
1822
+ /* @__PURE__ */ a.jsx("span", { className: "sr-only", children: "Close" })
1823
+ ] })
1824
+ ] })
1825
+ ] })
1826
+ );
1827
+ Yn.displayName = P.Content.displayName;
1828
+ const Qn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
1829
+ Qn.displayName = "SheetHeader";
1830
+ const Xn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
1831
+ Xn.displayName = "SheetFooter";
1832
+ const Zn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(P.Title, { ref: s, className: d("text-lg font-semibold text-foreground", e), ...t }));
1833
+ Zn.displayName = P.Title.displayName;
1834
+ const ea = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(P.Description, { ref: s, className: d("text-sm text-muted-foreground", e), ...t }));
1835
+ ea.displayName = P.Description.displayName;
1836
+ const xi = M.Root, vi = M.Trigger, yi = M.Group, wi = M.Portal, Ni = M.Sub, ki = M.RadioGroup, ta = f.forwardRef(({ className: e, inset: t, children: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
1837
+ M.SubTrigger,
1838
+ {
1839
+ ref: n,
1840
+ className: d(
1841
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
1842
+ t && "pl-8",
1843
+ e
1844
+ ),
1845
+ ...o,
1846
+ children: [
1847
+ s,
1848
+ /* @__PURE__ */ a.jsx(nt, { className: "ml-auto h-4 w-4" })
1849
+ ]
1850
+ }
1851
+ ));
1852
+ ta.displayName = M.SubTrigger.displayName;
1853
+ const sa = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1854
+ M.SubContent,
1855
+ {
1856
+ ref: s,
1857
+ className: d(
1858
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1859
+ e
1860
+ ),
1861
+ ...t
1862
+ }
1863
+ ));
1864
+ sa.displayName = M.SubContent.displayName;
1865
+ const oa = f.forwardRef(({ className: e, sideOffset: t = 4, ...s }, o) => /* @__PURE__ */ a.jsx(M.Portal, { children: /* @__PURE__ */ a.jsx(
1866
+ M.Content,
1867
+ {
1868
+ ref: o,
1869
+ sideOffset: t,
1870
+ className: d(
1871
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
1872
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1873
+ e
1874
+ ),
1875
+ ...s
1876
+ }
1877
+ ) }));
1878
+ oa.displayName = M.Content.displayName;
1879
+ const na = f.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1880
+ M.Item,
1881
+ {
1882
+ ref: o,
1883
+ className: d(
1884
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1885
+ t && "pl-8",
1886
+ e
1887
+ ),
1888
+ ...s
1889
+ }
1890
+ ));
1891
+ na.displayName = M.Item.displayName;
1892
+ const aa = f.forwardRef(({ className: e, children: t, checked: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
1893
+ M.CheckboxItem,
1894
+ {
1895
+ ref: n,
1896
+ className: d(
1897
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1898
+ e
1899
+ ),
1900
+ checked: s,
1901
+ ...o,
1902
+ children: [
1903
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(M.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ze, { className: "h-4 w-4" }) }) }),
1904
+ t
1905
+ ]
1906
+ }
1907
+ ));
1908
+ aa.displayName = M.CheckboxItem.displayName;
1909
+ const ra = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
1910
+ M.RadioItem,
1911
+ {
1912
+ ref: o,
1913
+ className: d(
1914
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1915
+ e
1916
+ ),
1917
+ ...s,
1918
+ children: [
1919
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(M.ItemIndicator, { children: /* @__PURE__ */ a.jsx(at, { className: "h-4 w-4 fill-current" }) }) }),
1920
+ t
1921
+ ]
1922
+ }
1923
+ ));
1924
+ ra.displayName = M.RadioItem.displayName;
1925
+ const ia = f.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1926
+ M.Label,
1927
+ {
1928
+ ref: o,
1929
+ className: d("px-2 py-1.5 text-sm font-semibold", t && "pl-8", e),
1930
+ ...s
1931
+ }
1932
+ ));
1933
+ ia.displayName = M.Label.displayName;
1934
+ const la = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(M.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-muted", e), ...t }));
1935
+ la.displayName = M.Separator.displayName;
1936
+ const ca = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: d("ml-auto text-xs tracking-widest opacity-60", e), ...t });
1937
+ ca.displayName = "DropdownMenuShortcut";
1938
+ const da = f.forwardRef(({ className: e, orientation: t = "horizontal", decorative: s = !0, ...o }, n) => /* @__PURE__ */ a.jsx(
1939
+ Ht.Root,
1940
+ {
1941
+ ref: n,
1942
+ decorative: s,
1943
+ orientation: t,
1944
+ className: d("shrink-0 bg-border", t === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", e),
1945
+ ...o
1946
+ }
1947
+ ));
1948
+ da.displayName = Ht.Root.displayName;
1949
+ const ua = 1, fa = 1e6;
1950
+ let Ge = 0;
1951
+ function ma() {
1952
+ return Ge = (Ge + 1) % Number.MAX_VALUE, Ge.toString();
1953
+ }
1954
+ const He = /* @__PURE__ */ new Map(), It = (e) => {
1955
+ if (He.has(e))
1956
+ return;
1957
+ const t = setTimeout(() => {
1958
+ He.delete(e), ke({
1959
+ type: "REMOVE_TOAST",
1960
+ toastId: e
1961
+ });
1962
+ }, fa);
1963
+ He.set(e, t);
1964
+ }, pa = (e, t) => {
1965
+ switch (t.type) {
1966
+ case "ADD_TOAST":
1967
+ return {
1968
+ ...e,
1969
+ toasts: [t.toast, ...e.toasts].slice(0, ua)
1970
+ };
1971
+ case "UPDATE_TOAST":
1972
+ return {
1973
+ ...e,
1974
+ toasts: e.toasts.map((s) => s.id === t.toast.id ? { ...s, ...t.toast } : s)
1975
+ };
1976
+ case "DISMISS_TOAST": {
1977
+ const { toastId: s } = t;
1978
+ return s ? It(s) : e.toasts.forEach((o) => {
1979
+ It(o.id);
1980
+ }), {
1981
+ ...e,
1982
+ toasts: e.toasts.map(
1983
+ (o) => o.id === s || s === void 0 ? {
1984
+ ...o,
1985
+ open: !1
1986
+ } : o
1987
+ )
1988
+ };
1989
+ }
1990
+ case "REMOVE_TOAST":
1991
+ return t.toastId === void 0 ? {
1992
+ ...e,
1993
+ toasts: []
1994
+ } : {
1995
+ ...e,
1996
+ toasts: e.toasts.filter((s) => s.id !== t.toastId)
1997
+ };
1998
+ }
1999
+ }, Me = [];
2000
+ let De = { toasts: [] };
2001
+ function ke(e) {
2002
+ De = pa(De, e), Me.forEach((t) => {
2003
+ t(De);
2004
+ });
2005
+ }
2006
+ function ga({ ...e }) {
2007
+ const t = ma(), s = (n) => ke({
2008
+ type: "UPDATE_TOAST",
2009
+ toast: { ...n, id: t }
2010
+ }), o = () => ke({ type: "DISMISS_TOAST", toastId: t });
2011
+ return ke({
2012
+ type: "ADD_TOAST",
2013
+ toast: {
2014
+ ...e,
2015
+ id: t,
2016
+ open: !0,
2017
+ onOpenChange: (n) => {
2018
+ n || o();
2019
+ }
2020
+ }
2021
+ }), {
2022
+ id: t,
2023
+ dismiss: o,
2024
+ update: s
2025
+ };
2026
+ }
2027
+ function vs() {
2028
+ const [e, t] = f.useState(De);
2029
+ return f.useEffect(() => (Me.push(t), () => {
2030
+ const s = Me.indexOf(t);
2031
+ s > -1 && Me.splice(s, 1);
2032
+ }), [e]), {
2033
+ ...e,
2034
+ toast: ga,
2035
+ dismiss: (s) => ke({ type: "DISMISS_TOAST", toastId: s })
2036
+ };
2037
+ }
2038
+ const ba = Z.Provider, ys = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2039
+ Z.Viewport,
2040
+ {
2041
+ ref: s,
2042
+ className: d(
2043
+ "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
2044
+ e
2045
+ ),
2046
+ ...t
2047
+ }
2048
+ ));
2049
+ ys.displayName = Z.Viewport.displayName;
2050
+ const ha = ge(
2051
+ "group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
2052
+ {
2053
+ variants: {
2054
+ variant: {
2055
+ default: "border bg-background",
2056
+ destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
2057
+ }
2058
+ },
2059
+ defaultVariants: {
2060
+ variant: "default"
2061
+ }
2062
+ }
2063
+ ), ws = f.forwardRef(({ className: e, variant: t, ...s }, o) => /* @__PURE__ */ a.jsx(Z.Root, { ref: o, className: d(ha({ variant: t }), e), ...s }));
2064
+ ws.displayName = Z.Root.displayName;
2065
+ const xa = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2066
+ Z.Action,
2067
+ {
2068
+ ref: s,
2069
+ className: d(
2070
+ "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
2071
+ e
2072
+ ),
2073
+ ...t
2074
+ }
2075
+ ));
2076
+ xa.displayName = Z.Action.displayName;
2077
+ const Ns = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2078
+ Z.Close,
2079
+ {
2080
+ ref: s,
2081
+ className: d(
2082
+ "absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
2083
+ e
2084
+ ),
2085
+ "toast-close": "",
2086
+ ...t,
2087
+ children: /* @__PURE__ */ a.jsx(ot, { className: "h-4 w-4" })
2088
+ }
2089
+ ));
2090
+ Ns.displayName = Z.Close.displayName;
2091
+ const ks = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(Z.Title, { ref: s, className: d("text-sm font-semibold [&+div]:text-xs", e), ...t }));
2092
+ ks.displayName = Z.Title.displayName;
2093
+ const Ss = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(Z.Description, { ref: s, className: d("text-sm opacity-90", e), ...t }));
2094
+ Ss.displayName = Z.Description.displayName;
2095
+ function Si() {
2096
+ const { toasts: e } = vs();
2097
+ return /* @__PURE__ */ a.jsxs(ba, { children: [
2098
+ e.map(({ id: t, title: s, description: o, action: n, ...i }) => /* @__PURE__ */ a.jsxs(ws, { ...i, children: [
2099
+ /* @__PURE__ */ a.jsxs("div", { className: "grid gap-1", children: [
2100
+ s && /* @__PURE__ */ a.jsx(ks, { children: s }),
2101
+ o && /* @__PURE__ */ a.jsx(Ss, { children: o })
2102
+ ] }),
2103
+ n,
2104
+ /* @__PURE__ */ a.jsx(Ns, {})
2105
+ ] }, t)),
2106
+ /* @__PURE__ */ a.jsx(ys, {})
2107
+ ] });
2108
+ }
2109
+ const ji = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("animate-pulse rounded-md bg-primary/10", e), ...t }), js = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2110
+ Q,
2111
+ {
2112
+ ref: s,
2113
+ className: d(
2114
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
2115
+ e
2116
+ ),
2117
+ ...t
2118
+ }
2119
+ ));
2120
+ js.displayName = Q.displayName;
2121
+ const Ai = ({ children: e, ...t }) => /* @__PURE__ */ a.jsx(fs, { ...t, children: /* @__PURE__ */ a.jsx(xt, { className: "overflow-hidden p-0", children: /* @__PURE__ */ a.jsx(js, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: e }) }) }), va = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
2122
+ /* @__PURE__ */ a.jsx(Js, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
2123
+ /* @__PURE__ */ a.jsx(
2124
+ Q.Input,
2125
+ {
2126
+ ref: s,
2127
+ className: d(
2128
+ "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
2129
+ e
2130
+ ),
2131
+ ...t
2132
+ }
2133
+ )
2134
+ ] }));
2135
+ va.displayName = Q.Input.displayName;
2136
+ const ya = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2137
+ Q.List,
2138
+ {
2139
+ ref: s,
2140
+ className: d("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
2141
+ ...t
2142
+ }
2143
+ ));
2144
+ ya.displayName = Q.List.displayName;
2145
+ const wa = f.forwardRef((e, t) => /* @__PURE__ */ a.jsx(Q.Empty, { ref: t, className: "py-6 text-center text-sm", ...e }));
2146
+ wa.displayName = Q.Empty.displayName;
2147
+ const Na = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2148
+ Q.Group,
2149
+ {
2150
+ ref: s,
2151
+ className: d(
2152
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
2153
+ e
2154
+ ),
2155
+ ...t
2156
+ }
2157
+ ));
2158
+ Na.displayName = Q.Group.displayName;
2159
+ const ka = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(Q.Separator, { ref: s, className: d("-mx-1 h-px bg-border", e), ...t }));
2160
+ ka.displayName = Q.Separator.displayName;
2161
+ const Sa = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2162
+ Q.Item,
2163
+ {
2164
+ ref: s,
2165
+ className: d(
2166
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2167
+ e
2168
+ ),
2169
+ ...t
2170
+ }
2171
+ ));
2172
+ Sa.displayName = Q.Item.displayName;
2173
+ const ja = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: d("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
2174
+ ja.displayName = "CommandShortcut";
2175
+ const Ci = D.Root, Bi = D.Trigger, _i = D.Group, Ri = D.Portal, Pi = D.Sub, Ti = D.RadioGroup, Aa = f.forwardRef(({ className: e, inset: t, children: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
2176
+ D.SubTrigger,
2177
+ {
2178
+ ref: n,
2179
+ className: d(
2180
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
2181
+ t && "pl-8",
2182
+ e
2183
+ ),
2184
+ ...o,
2185
+ children: [
2186
+ s,
2187
+ /* @__PURE__ */ a.jsx(nt, { className: "ml-auto h-4 w-4" })
2188
+ ]
2189
+ }
2190
+ ));
2191
+ Aa.displayName = D.SubTrigger.displayName;
2192
+ const Ca = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2193
+ D.SubContent,
2194
+ {
2195
+ ref: s,
2196
+ className: d(
2197
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2198
+ e
2199
+ ),
2200
+ ...t
2201
+ }
2202
+ ));
2203
+ Ca.displayName = D.SubContent.displayName;
2204
+ const Ba = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(D.Portal, { children: /* @__PURE__ */ a.jsx(
2205
+ D.Content,
2206
+ {
2207
+ ref: s,
2208
+ className: d(
2209
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2210
+ e
2211
+ ),
2212
+ ...t
2213
+ }
2214
+ ) }));
2215
+ Ba.displayName = D.Content.displayName;
2216
+ const _a = f.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
2217
+ D.Item,
2218
+ {
2219
+ ref: o,
2220
+ className: d(
2221
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2222
+ t && "pl-8",
2223
+ e
2224
+ ),
2225
+ ...s
2226
+ }
2227
+ ));
2228
+ _a.displayName = D.Item.displayName;
2229
+ const Ra = f.forwardRef(({ className: e, children: t, checked: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
2230
+ D.CheckboxItem,
2231
+ {
2232
+ ref: n,
2233
+ className: d(
2234
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2235
+ e
2236
+ ),
2237
+ checked: s,
2238
+ ...o,
2239
+ children: [
2240
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(D.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ze, { className: "h-4 w-4" }) }) }),
2241
+ t
2242
+ ]
2243
+ }
2244
+ ));
2245
+ Ra.displayName = D.CheckboxItem.displayName;
2246
+ const Pa = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
2247
+ D.RadioItem,
2248
+ {
2249
+ ref: o,
2250
+ className: d(
2251
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2252
+ e
2253
+ ),
2254
+ ...s,
2255
+ children: [
2256
+ /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(D.ItemIndicator, { children: /* @__PURE__ */ a.jsx(at, { className: "h-4 w-4 fill-current" }) }) }),
2257
+ t
2258
+ ]
2259
+ }
2260
+ ));
2261
+ Pa.displayName = D.RadioItem.displayName;
2262
+ const Ta = f.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
2263
+ D.Label,
2264
+ {
2265
+ ref: o,
2266
+ className: d("px-2 py-1.5 text-sm font-semibold text-foreground", t && "pl-8", e),
2267
+ ...s
2268
+ }
2269
+ ));
2270
+ Ta.displayName = D.Label.displayName;
2271
+ const Ia = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(D.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-border", e), ...t }));
2272
+ Ia.displayName = D.Separator.displayName;
2273
+ const Ma = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: d("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
2274
+ Ma.displayName = "ContextMenuShortcut";
2275
+ const Da = (e) => {
2276
+ try {
2277
+ const t = document.getElementById("icon-picker-field"), s = document.createElement("div");
2278
+ Xs.render(/* @__PURE__ */ a.jsx(Qs, { value: e }), s), t.appendChild(s), s.hidden = !0;
2279
+ let o = s.innerHTML;
2280
+ setTimeout(() => t.removeChild(s), 100);
2281
+ const i = new DOMParser().parseFromString(o, "image/svg+xml"), r = i.querySelector("svg");
2282
+ return r && (r.removeAttribute("width"), r.removeAttribute("height")), new XMLSerializer().serializeToString(i);
2283
+ } catch (t) {
2284
+ return console.error(t), "";
2285
+ }
2286
+ }, Ii = ({ value: e, onChange: t }) => {
2287
+ const s = (o) => {
2288
+ t("<svg />");
2289
+ const n = Da(o);
2290
+ t(n);
2291
+ };
2292
+ return /* @__PURE__ */ a.jsxs("div", { className: "mt-1 flex h-20 items-center gap-x-2", id: "icon-picker-field", children: [
2293
+ /* @__PURE__ */ a.jsxs("div", { className: "group relative h-12 w-12", children: [
2294
+ /* @__PURE__ */ a.jsx(
2295
+ "div",
2296
+ {
2297
+ dangerouslySetInnerHTML: {
2298
+ __html: e ? e.replace("<svg", '<svg class="h-5 w-5"') : "<svg class='h-5 w-5' />"
2299
+ },
2300
+ className: "absolute left-1/2 top-1/2 z-0 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white"
2301
+ }
2302
+ ),
2303
+ /* @__PURE__ */ a.jsx(
2304
+ Ys,
2305
+ {
2306
+ value: e ? "BiSolidGrid" : null,
2307
+ onChange: s,
2308
+ pickButtonStyle: {
2309
+ position: "relative",
2310
+ height: "48px",
2311
+ width: "48px",
2312
+ border: "1px solid #BBBBBB",
2313
+ display: "flex",
2314
+ alignItems: "center",
2315
+ justifyContent: "center",
2316
+ borderRadius: "6px",
2317
+ backgroundColor: "transparent",
2318
+ zIndex: 1
2319
+ },
2320
+ searchInputStyle: {
2321
+ backgroundColor: "transparent",
2322
+ width: "100%",
2323
+ border: "1px solid #BBBBBB",
2324
+ margin: "0px 10px",
2325
+ padding: "10px"
2326
+ }
2327
+ }
2328
+ )
2329
+ ] }),
2330
+ /* @__PURE__ */ a.jsx(
2331
+ "textarea",
2332
+ {
2333
+ value: e,
2334
+ onChange: (o) => t(o.target.value),
2335
+ className: "h-full w-full rounded-sm border border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",
2336
+ placeholder: "Choose icon or enter svg"
2337
+ }
2338
+ )
2339
+ ] });
2340
+ }, Ea = tt.lazy(() => import("./UnsplashImages-QMl0bxix.js")), Oa = tt.lazy(() => import("./UploadImages-Si-A26bc.js")), As = ({
2341
+ isModalView: e = !1,
2342
+ onSelect: t = () => {
2343
+ }
2344
+ }) => {
2345
+ const [s, o] = Ce("upload");
2346
+ return /* @__PURE__ */ a.jsxs("div", { className: "flex h-full flex-col", children: [
2347
+ /* @__PURE__ */ a.jsx("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: /* @__PURE__ */ a.jsx("h1", { className: "px-1 font-semibold", children: e ? "Select or upload images" : "Images" }) }),
2348
+ /* @__PURE__ */ a.jsxs(_n, { value: s, onValueChange: (n) => o(n), className: "flex h-full w-full flex-col py-2", children: [
2349
+ /* @__PURE__ */ a.jsxs(bs, { className: "w-full", children: [
2350
+ /* @__PURE__ */ a.jsx(Ze, { value: "upload", className: "w-1/2", children: "Upload" }),
2351
+ /* @__PURE__ */ a.jsx(Ze, { value: "unsplash", className: "w-1/2", children: "Unsplash" })
2352
+ ] }),
2353
+ s === "unsplash" ? /* @__PURE__ */ a.jsx(et, { value: "unsplash", className: "flex h-full flex-col overflow-hidden", children: /* @__PURE__ */ a.jsx(yt, { fallback: /* @__PURE__ */ a.jsx("div", { className: "h-64 w-full animate-pulse bg-gray-100" }), children: /* @__PURE__ */ a.jsx(Ea, { isModalView: e, onSelect: t }) }) }) : /* @__PURE__ */ a.jsx(et, { value: "upload", className: "flex h-full flex-col overflow-hidden", children: /* @__PURE__ */ a.jsx(yt, { fallback: /* @__PURE__ */ a.jsx("div", { className: "h-64 w-full animate-pulse bg-gray-100" }), children: /* @__PURE__ */ a.jsx(Oa, { isModalView: e, onSelect: t }) }) })
2354
+ ] })
2355
+ ] });
2356
+ }, Mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2357
+ __proto__: null,
2358
+ default: As
2359
+ }, Symbol.toStringTag, { value: "Module" })), Mt = ({ children: e, onSelect: t }) => {
2360
+ const [s, o] = Ce(!1), n = (...i) => {
2361
+ t.call(void 0, ...i), o(!1);
2362
+ };
2363
+ return /* @__PURE__ */ a.jsxs(fs, { open: s, onOpenChange: (i) => o(i), children: [
2364
+ /* @__PURE__ */ a.jsx(mn, { asChild: !0, children: e }),
2365
+ /* @__PURE__ */ a.jsx(xt, { className: "flex h-3/4 max-w-5xl", children: /* @__PURE__ */ a.jsx("div", { className: "h-full w-full", children: /* @__PURE__ */ a.jsx(As, { isModalView: !0, onSelect: n }) }) })
2366
+ ] });
2367
+ }, Di = ({ value: e, onChange: t, id: s, onBlur: o }) => /* @__PURE__ */ a.jsxs("div", { className: "mt-1.5 flex items-center gap-x-3", children: [
2368
+ e ? /* @__PURE__ */ a.jsx("img", { src: e, className: "h-20 w-20 overflow-hidden rounded-md border object-cover", alt: "" }) : /* @__PURE__ */ a.jsx(Mt, { onSelect: t, children: /* @__PURE__ */ a.jsx("div", { className: "h-20 w-20 cursor-pointer rounded-md border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px] hover:border-gray-400" }) }),
2369
+ /* @__PURE__ */ a.jsxs("div", { className: "flex w-3/5 flex-col", children: [
2370
+ /* @__PURE__ */ a.jsx(Mt, { onSelect: t, children: /* @__PURE__ */ a.jsx("small", { className: "cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700", children: e || !Be(e) ? "Replace Image" : "Choose Image" }) }),
2371
+ /* @__PURE__ */ a.jsx("small", { className: "-pl-4 pt-2 text-center text-xs text-gray-600", children: "OR" }),
2372
+ /* @__PURE__ */ a.jsx(
2373
+ "input",
2374
+ {
2375
+ type: "url",
2376
+ className: "text-xs",
2377
+ placeholder: "Enter image URL",
2378
+ value: e,
2379
+ onBlur: ({ target: { value: n } }) => o(s, n),
2380
+ onChange: (n) => t(n.target.value)
2381
+ }
2382
+ )
2383
+ ] })
2384
+ ] }), Ei = ({ id: e, placeholder: t, value: s, onChange: o, onBlur: n }) => {
2385
+ const i = {
2386
+ toolbar: [
2387
+ ["bold", "italic", "underline", "strike", "blockquote"],
2388
+ [{ list: "ordered" }, { list: "bullet" }],
2389
+ [{ color: [] }, { background: [] }, { align: [] }],
2390
+ ["link", "clean"]
2391
+ ]
2392
+ }, r = [
2393
+ "header",
2394
+ "font",
2395
+ "list",
2396
+ "bold",
2397
+ "italic",
2398
+ "underline",
2399
+ "strike",
2400
+ "blockquote",
2401
+ "color",
2402
+ "background",
2403
+ "align",
2404
+ "link",
2405
+ "image"
2406
+ ];
2407
+ return typeof window > "u" ? null : /* @__PURE__ */ a.jsx(
2408
+ Zs,
2409
+ {
2410
+ id: e,
2411
+ value: s,
2412
+ onBlur: (c) => n(e, c),
2413
+ onChange: (c) => o(c),
2414
+ modules: i,
2415
+ formats: r,
2416
+ placeholder: t,
2417
+ className: "mt-1 rounded-md"
2418
+ }
2419
+ );
2420
+ }, Oi = ({ schema: e, formData: t, onChange: s }) => {
2421
+ const [o, n] = Ce([]), i = ve("getPages", () => []), { type: r = "page", href: c = "", target: p = "self" } = t;
2422
+ return Ae(() => {
2423
+ (async () => {
2424
+ const l = await i();
2425
+ n(l || []);
2426
+ })();
2427
+ }, []), /* @__PURE__ */ a.jsxs("div", { children: [
2428
+ /* @__PURE__ */ a.jsx("span", { className: "text-xs font-medium", children: (e == null ? void 0 : e.title) ?? "Link" }),
2429
+ /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col gap-y-1.5", children: [
2430
+ /* @__PURE__ */ a.jsx("select", { name: "type", value: r, onChange: (l) => s({ ...t, type: l.target.value }), children: [
2431
+ { const: "page", title: "Open Page" },
2432
+ { const: "url", title: "Open URL" },
2433
+ { const: "email", title: "Compose Email" },
2434
+ { const: "telephone", title: "Call Phone" },
2435
+ { const: "scroll", title: "Scroll to element" }
2436
+ ].map((l) => /* @__PURE__ */ a.jsx("option", { value: l.const, children: l.title }, l.const)) }),
2437
+ r === "page" ? /* @__PURE__ */ a.jsxs(
2438
+ "select",
2439
+ {
2440
+ name: "href",
2441
+ placeholder: "Choose Page",
2442
+ value: c,
2443
+ onChange: (l) => s({ ...t, href: l.target.value }),
2444
+ children: [
2445
+ /* @__PURE__ */ a.jsx("option", { value: "", children: "Choose page" }),
2446
+ I(o, (l) => /* @__PURE__ */ a.jsx("option", { value: l.slug, children: l.name }, l.uuid))
2447
+ ]
2448
+ }
2449
+ ) : /* @__PURE__ */ a.jsx(
2450
+ "input",
2451
+ {
2452
+ name: "href",
2453
+ type: "text",
2454
+ value: c,
2455
+ onChange: (l) => s({ ...t, href: l.target.value }),
2456
+ placeholder: r === "page" || r === "url" ? "Enter URL" : r === "scroll" ? "#ElementID" : "Enter detail"
2457
+ }
2458
+ ),
2459
+ (r === "page" || r === "url") && /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-x-2", children: [
2460
+ /* @__PURE__ */ a.jsx(
2461
+ "input",
2462
+ {
2463
+ type: "checkbox",
2464
+ defaultChecked: p === "_blank",
2465
+ className: "cursor-pointer rounded-md border border-border",
2466
+ onChange: () => s({ ...t, target: p === "_blank" ? "_self" : "_blank" })
2467
+ }
2468
+ ),
2469
+ /* @__PURE__ */ a.jsx("span", { className: "pt-1 text-xs", children: "Open in new tab" })
2470
+ ] })
2471
+ ] })
2472
+ ] });
2473
+ }, Li = () => {
2474
+ const [e] = we(), [, t] = $e(), { addBlocks: s } = he(), { toast: o } = vs(), n = $(
2475
+ (r, c, p) => {
2476
+ var v;
2477
+ for (let j = 0; j < r.length; j++) {
2478
+ const { _id: L } = r[j];
2479
+ r[j]._id = de();
2480
+ const F = E(r, { _parent: L });
2481
+ for (let B = 0; B < F.length; B++)
2482
+ F[B]._parent = r[j]._id;
2483
+ }
2484
+ const l = ee(r);
2485
+ let m, N;
2486
+ return c && (m = oe(e, { _id: c }), r[0]._parent = c, N = c), !(m ? _t(m._type, l._type) : !0) && m && (r[0]._parent = m._parent, N = m._parent), s(r, N, p), t([(v = ee(r)) == null ? void 0 : v._id]), ee(r);
2487
+ },
2488
+ [e, t]
2489
+ );
2490
+ return { addCoreBlock: $(
2491
+ (r, c, p) => {
2492
+ if (pe(r, "blocks")) {
2493
+ const B = r.blocks;
2494
+ return n(B, c, p);
2495
+ }
2496
+ const l = de(), m = os(r.props), N = [];
2497
+ $t(m, (B, T) => {
2498
+ if (Ft(B, Je)) {
2499
+ const G = B.replace(Je, "");
2500
+ N.push({
2501
+ _id: G,
2502
+ _type: "Slot",
2503
+ _parent: l,
2504
+ _name: r.props[T].name,
2505
+ _styles: r.props[T].styles,
2506
+ _emptyStyles: r.props[T].emptyStyles
2507
+ });
2508
+ }
2509
+ });
2510
+ const S = {
2511
+ _type: r.type,
2512
+ _id: l,
2513
+ ...m
2514
+ };
2515
+ let v, j;
2516
+ if (c && (v = oe(e, { _id: c }), S._parent = c, j = c), !ko(v == null ? void 0 : v._type, r.type)) {
2517
+ o({
2518
+ variant: "destructive",
2519
+ title: "Error",
2520
+ description: `"${r.type}" cannot be added under "${v ? v == null ? void 0 : v._type : "root"}"`
2521
+ }), t([]);
2522
+ return;
2523
+ }
2524
+ !(v ? _t(v._type, r.type) : !0) && v && (S._parent = v._parent, j = v._parent);
2525
+ const F = [S, ...N];
2526
+ return s(F, j, p), t([S._id]), S;
2527
+ },
2528
+ [n, e, t]
2529
+ ), addPredefinedBlock: n };
2530
+ }, Dt = {
2531
+ xs: 420,
2532
+ sm: 620,
2533
+ md: 768,
2534
+ lg: 1024,
2535
+ xl: 1280,
2536
+ "2xl": 1536
2537
+ }, Et = ["xs", "sm", "md", "lg", "xl", "2xl"];
2538
+ function La(e, t) {
2539
+ if (t === null)
2540
+ return "baseClasses";
2541
+ const s = t.mq;
2542
+ if (s === "xs" || t.dark || t.mod !== "")
2543
+ return "classes";
2544
+ let o = "baseClasses", n = Et.indexOf(s);
2545
+ for (; n > 0; ) {
2546
+ const i = Et[n - 1];
2547
+ if (oe(e, {
2548
+ mq: i,
2549
+ property: t.property
2550
+ })) {
2551
+ o = "classes";
2552
+ break;
2553
+ }
2554
+ n--;
2555
+ }
2556
+ return o;
2557
+ }
2558
+ const Ot = [];
2559
+ function za(e = "", t = "", s = []) {
2560
+ e = e.trim().replace(/ +/g, "");
2561
+ let o = E(
2562
+ I(e.split(" "), Ie),
2563
+ (l) => !Ke(l)
2564
+ ), n = E(I(t.split(" "), Ie), (l) => !Ke(l));
2565
+ n = E(
2566
+ n,
2567
+ (l) => !Y(Ot, l.property)
2568
+ );
2569
+ const i = [], r = [];
2570
+ ce(s, (l) => {
2571
+ const m = Ie(l), N = oe(o, wt(m, ["dark", "mq", "mod", "property"]));
2572
+ if (N && (o = E(
2573
+ o,
2574
+ (S) => S.fullCls !== (N == null ? void 0 : N.fullCls)
2575
+ )), i.push(m), m.mq === "xs" && !m.dark && m.mod === "" && (n = E(n, (S) => S.property !== m.property)), La(o, m) === "baseClasses" && !Y(Ot, m.property)) {
2576
+ const S = oe(n, wt(m, ["property"]));
2577
+ N && (n = E(
2578
+ n,
2579
+ (v) => v.fullCls !== (S == null ? void 0 : S.fullCls)
2580
+ )), r.push({
2581
+ ...m,
2582
+ fullCls: m.cls,
2583
+ mq: "xs"
2584
+ });
2585
+ }
2586
+ });
2587
+ const c = I(
2588
+ Nt([...o, ...i], (l) => Dt[l.mq]),
2589
+ "fullCls"
2590
+ ).join(" ");
2591
+ return `${I(
2592
+ Nt([...n, ...r], (l) => Dt[l.mq]),
2593
+ "fullCls"
2594
+ ).join(" ").trim()},${c.trim()}`.trim().replace(/ +/g, "");
2595
+ }
2596
+ const Pe = w([]);
2597
+ Pe.debugLabel = "selectedStylingBlocksAtom";
2598
+ const Va = () => O(Pe), $a = (e) => {
2599
+ const t = e.replace(fe, "").split(",");
2600
+ return { baseClasses: t[0], classes: t[1] };
2601
+ }, Fa = w(null, (e, t, { blockIds: s, newClasses: o }) => {
2602
+ const n = E(
2603
+ e(it),
2604
+ (r) => (
2605
+ // @ts-ignore
2606
+ s.includes(e(r)._id)
2607
+ )
2608
+ ), i = ee(e(Pe));
2609
+ return I(n, (r) => {
2610
+ const c = e(r), p = J(c, i.prop, `${fe},`), { baseClasses: l, classes: m } = $a(p);
2611
+ return {
2612
+ ids: [c._id],
2613
+ props: { [i.prop]: `${fe}${za(m, l, o)}` }
2614
+ };
2615
+ });
2616
+ }), zi = () => {
2617
+ const e = _e(Fa), { updateBlocks: t, updateBlocksRuntime: s } = he();
2618
+ return $(
2619
+ (o, n, i = !1) => {
2620
+ const r = e({ blockIds: o, newClasses: n });
2621
+ if (!i) {
2622
+ s(o, r[0].props);
2623
+ return;
2624
+ }
2625
+ t(o, r[0].props);
2626
+ },
2627
+ [e]
2628
+ );
2629
+ }, Ua = () => O(ss), Cs = Re("canvasWidth", 800), Bs = w((e) => {
2630
+ const t = e(Cs);
2631
+ return Us(t).toLowerCase();
2632
+ }), Vi = () => {
2633
+ const [e, t] = O(Cs), s = te(Bs), [o, n] = Ua();
2634
+ return Ae(() => {
2635
+ o !== "xs" && n(s);
2636
+ }, [s, o, n]), [e, s, t];
2637
+ }, Wa = Re("canvasZoom", 100), $i = () => O(Wa), _s = w([]), Ga = () => {
2638
+ const [e, t] = O(_s), s = _e(vt), o = $(
2639
+ (n) => {
2640
+ t(n), s([]);
2641
+ },
2642
+ [t, s]
2643
+ );
2644
+ return [e, o];
2645
+ }, vt = w([]), Fi = () => {
2646
+ const [e, t] = O(vt), s = _e(_s), o = $(
2647
+ (n) => {
2648
+ t(n), s([]);
2649
+ },
2650
+ [t, s]
2651
+ );
2652
+ return [e, o];
2653
+ }, Rs = Re("darkMode", !1), Ui = () => {
2654
+ const [e, t] = O(Rs);
2655
+ return [e, t];
2656
+ }, Ha = () => {
2657
+ const [e] = we(), [, t] = $e(), { addBlocks: s } = he();
2658
+ return $(
2659
+ (o, n = null) => {
2660
+ const i = [];
2661
+ ce(o, (r) => {
2662
+ const c = e.find((S) => S._id === r);
2663
+ n || (n = c._parent);
2664
+ const m = E(
2665
+ e,
2666
+ (S) => zt(n) ? S._parent === n : !c._parent
2667
+ ).indexOf(c) + 1, N = So(e, r, n);
2668
+ s(N, n, m), i.push(J(N, "0._id", ""));
2669
+ }), t(i);
2670
+ },
2671
+ [e, t]
2672
+ );
2673
+ }, qa = w([]), Wi = () => {
2674
+ const [e, t] = O(qa), s = $(
2675
+ (o) => {
2676
+ t((n) => Y(n, o) ? Vt(n, o) : [...n, o]);
2677
+ },
2678
+ [t]
2679
+ );
2680
+ return [e, t, s];
2681
+ }, Ka = w(""), Ja = () => O(Ka), Ya = () => {
2682
+ const e = te(ie);
2683
+ return $(
2684
+ (t, s) => {
2685
+ const o = I(e, (n) => (Y(t, J(n, "_id")) && Se(n, "_parent", s), n));
2686
+ console.log("newBlocks", o);
2687
+ },
2688
+ [e]
2689
+ );
2690
+ }, Gi = () => {
2691
+ console.warn("usePasteBlocks is not implemented");
2692
+ const e = te(vt), [t, s] = Ga(), o = Ha(), n = Ya();
2693
+ return {
2694
+ canPaste: Vs(
2695
+ () => t.length > 0 || e.length > 0,
2696
+ [e, t]
2697
+ ),
2698
+ pasteBlocks: $(
2699
+ (r) => {
2700
+ Be(e) ? n(t, r) : o(e, r), s(() => []);
2701
+ },
2702
+ [t, e, o, n, s]
2703
+ )
2704
+ };
2705
+ }, Qa = w(!1), Hi = () => {
2706
+ const [e, t] = O(Qa);
2707
+ return [e, t];
2708
+ }, Xa = w(null, (e, t, { blockIds: s, fullClasses: o }) => {
2709
+ const n = ee(e(Pe)), i = E(
2710
+ e(it),
2711
+ (r) => (
2712
+ // @ts-ignore
2713
+ s.includes(e(r)._id)
2714
+ )
2715
+ );
2716
+ return I(i, (r) => {
2717
+ const c = e(r), p = o;
2718
+ let { classes: l, baseClasses: m } = No(J(c, n.prop, "styles:,"));
2719
+ return ce(p, (N) => {
2720
+ const S = new RegExp(`(^| )${N.replace("[", "\\[").replace("]", "\\]")}($| )`, "g");
2721
+ l = l.replace(S, " ").replace(/ +/g, " ").trim();
2722
+ const v = ee(N.split(":"));
2723
+ Y(["2xl", "xl", "lg", "md", "sm"], v) && p.push(N.split(":").pop().trim());
2724
+ }), ce(p, (N) => {
2725
+ const S = new RegExp(`(^| )${N.replace("[", "\\[").replace("]", "\\]")}($| )`, "g");
2726
+ m = m.replace(S, " ").replace(/ +/g, " ").trim();
2727
+ }), {
2728
+ ids: [c._id],
2729
+ props: {
2730
+ [n.prop]: `${fe}${m},${l}`
2731
+ }
2732
+ };
2733
+ });
2734
+ }), qi = () => {
2735
+ const { updateBlocks: e } = he(), t = _e(Xa);
2736
+ return $(
2737
+ (s, o) => {
2738
+ const n = t({ blockIds: s, fullClasses: o });
2739
+ e(s, n[0].props);
2740
+ },
2741
+ [t]
2742
+ );
2743
+ }, Ps = w((e) => {
2744
+ const t = ee(e(Pe)), s = e(dt);
2745
+ if (!t || t.blockId !== J(s, "_id", null))
2746
+ return [];
2747
+ const n = J(s, t.prop, `${fe},`).replace(fe, "").split(",").join(" ");
2748
+ return E(I(n.trim().split(" "), Ie), (i) => !Ke(i));
2749
+ }), Ki = () => te(Ps), Lt = { xs: 0, sm: 1, md: 2, lg: 3, xl: 4, "2xl": 5 }, Za = w((e) => {
2750
+ const t = e(Bs), s = e(ut), o = e(Rs), n = er(t);
2751
+ let i = E(e(Ps), { mod: s });
2752
+ return Ft(s, "_") || (i = E(i, (r) => n.includes(r.mq))), i = i.sort((r, c) => Lt[r.mq] - Lt[c.mq]), o || (i = E(i, { dark: !1 })), i;
2753
+ }), er = (e) => {
2754
+ let t = [];
2755
+ switch (e) {
2756
+ case "xs":
2757
+ t = ["xs"];
2758
+ break;
2759
+ case "sm":
2760
+ t = ["xs", "sm"];
2761
+ break;
2762
+ case "md":
2763
+ t = ["xs", "sm", "md"];
2764
+ break;
2765
+ case "lg":
2766
+ t = ["xs", "sm", "md", "lg"];
2767
+ break;
2768
+ case "xl":
2769
+ t = ["xs", "sm", "md", "lg", "xl"];
2770
+ break;
2771
+ case "2xl":
2772
+ t = ["xs", "sm", "md", "lg", "xl", "2xl"];
2773
+ break;
2774
+ default:
2775
+ t = ["xs"];
2776
+ break;
2777
+ }
2778
+ return t;
2779
+ }, Ji = () => te(Za), Yi = () => O(ut), Qi = () => {
2780
+ const { updateBlocks: e } = he();
2781
+ return $(
2782
+ (t, s, o) => {
2783
+ e(t, s, o);
2784
+ },
2785
+ [e]
2786
+ );
2787
+ }, Xi = () => {
2788
+ const { updateBlocksRuntime: e } = he();
2789
+ return $(
2790
+ (t, s) => {
2791
+ e(t, s);
2792
+ },
2793
+ [e]
2794
+ );
2795
+ }, Ts = {
2796
+ name: "",
2797
+ props: {},
2798
+ modalProps: {},
2799
+ backdropClose: !0
2800
+ }, tr = w(Ts), Zi = () => {
2801
+ const [e, t] = O(tr), s = $(
2802
+ (n, i = {}, r = {}) => {
2803
+ t({ name: n, props: i, modalProps: r });
2804
+ },
2805
+ [t]
2806
+ ), o = $(
2807
+ (...n) => {
2808
+ J(e, "props.onClose", () => {
2809
+ })(...n), t(Ts);
2810
+ },
2811
+ [t, e]
2812
+ );
2813
+ return {
2814
+ activeModal: e,
2815
+ openModal: s,
2816
+ closeModal: o
2817
+ };
2818
+ }, el = () => (console.warn("useAllBlocks is deprecated, use useBlocksStore() instead"), te(ie)), Is = w(!1);
2819
+ Is.debugLabel = "readOnlyModeAtom";
2820
+ const sr = w("online");
2821
+ sr.debugLabel = "networkModeAtom";
2822
+ const or = w(!1);
2823
+ or.debugLabel = "codeEditorOpenAtom";
2824
+ const nr = w(!1);
2825
+ nr.debugLabel = "editLayerNameAtom";
2826
+ const ar = w("");
2827
+ ar.debugLabel = "activeLanguageAtom";
2828
+ const rr = w("");
2829
+ rr.debugLabel = "primaryLanguageAtom";
2830
+ const ir = w(null);
2831
+ ir.debugLabel = "canvasIframeAtom";
2832
+ const lr = w("outline");
2833
+ lr.debugLabel = "activePanelAtom";
2834
+ const cr = w("");
2835
+ cr.debugLabel = "showPredefinedBlockCategoryAtom";
2836
+ const Ms = w({ undoCount: 0, redoCount: 0 });
2837
+ Ms.debugLabel = "historyStatesAtom";
2838
+ const dr = w("");
2839
+ dr.debugLabel = "inlineEditingActiveAtom";
2840
+ const ur = w(!1);
2841
+ ur.debugLabel = "draggingFlagAtom";
2842
+ const fr = w("");
2843
+ fr.debugLabel = "draggedBlockIdAtom";
2844
+ const tl = () => te(Is), mr = w(""), pr = w(null), sl = () => O(mr), ol = () => O(pr), gr = Re("selectedBreakpoints", ["XS", "MD", "XL"]), nl = () => {
2845
+ const [e, t] = O(gr);
2846
+ return [e, t];
2847
+ }, al = () => {
2848
+ const e = _e(Ms), { clear: t } = cs(), [, s] = $e(), [, o] = Ja(), [, n] = Va();
2849
+ return () => {
2850
+ s([]), n([]), o(""), t(), e({ undoCount: 0, redoCount: 0 });
2851
+ };
2852
+ }, br = w([]), rl = () => {
2853
+ const [e, t] = Ce(!1), [s, o] = O(br), n = ve("getUILibraryBlocks", () => []);
2854
+ return Ae(() => {
2855
+ (async () => s.length > 0 || (t(!0), o(await n()), t(!1)))();
2856
+ }, []), { data: s, isLoading: e };
2857
+ }, il = () => {
2858
+ const [e, t] = Ce(null), s = $(async (o) => {
2859
+ if (!(navigator != null && navigator.clipboard))
2860
+ return console.warn("Clipboard not supported"), !1;
2861
+ try {
2862
+ return await navigator.clipboard.writeText(o), t(o), !0;
2863
+ } catch (n) {
2864
+ return console.warn("Copy failed", n), t(null), !1;
2865
+ }
2866
+ }, []);
2867
+ return [e, s];
2868
+ };
2869
+ export {
2870
+ Ji as $,
2871
+ Qr as A,
2872
+ Yo as B,
2873
+ gt as C,
2874
+ Vr as D,
2875
+ we as E,
2876
+ ns as F,
2877
+ Jt as G,
2878
+ ls as H,
2879
+ Si as I,
2880
+ tl as J,
2881
+ Zi as K,
2882
+ Li as L,
2883
+ zi as M,
2884
+ Vi as N,
2885
+ $i as O,
2886
+ Fi as P,
2887
+ il as Q,
2888
+ Lo as R,
2889
+ ji as S,
2890
+ ei as T,
2891
+ Ga as U,
2892
+ Ui as V,
2893
+ Fo as W,
2894
+ Wi as X,
2895
+ Ja as Y,
2896
+ Gi as Z,
2897
+ qi as _,
2898
+ Xr as a,
2899
+ wa as a$,
2900
+ Ki as a0,
2901
+ Wr as a1,
2902
+ Ua as a2,
2903
+ rl as a3,
2904
+ Yi as a4,
2905
+ Qi as a5,
2906
+ Xi as a6,
2907
+ Ur as a7,
2908
+ el as a8,
2909
+ sl as a9,
2910
+ da as aA,
2911
+ An as aB,
2912
+ Jo as aC,
2913
+ di as aD,
2914
+ ui as aE,
2915
+ Un as aF,
2916
+ xi as aG,
2917
+ vi as aH,
2918
+ oa as aI,
2919
+ ia as aJ,
2920
+ la as aK,
2921
+ aa as aL,
2922
+ he as aM,
2923
+ ur as aN,
2924
+ dr as aO,
2925
+ nr as aP,
2926
+ fr as aQ,
2927
+ $r as aR,
2928
+ Fr as aS,
2929
+ sr as aT,
2930
+ ir as aU,
2931
+ oi as aV,
2932
+ ni as aW,
2933
+ Pn as aX,
2934
+ js as aY,
2935
+ va as aZ,
2936
+ ya as a_,
2937
+ ol as aa,
2938
+ nl as ab,
2939
+ Va as ac,
2940
+ fs as ad,
2941
+ xt as ae,
2942
+ pn as af,
2943
+ bn as ag,
2944
+ hn as ah,
2945
+ un as ai,
2946
+ fi as aj,
2947
+ Wn as ak,
2948
+ pi as al,
2949
+ Gn as am,
2950
+ qn as an,
2951
+ mn as ao,
2952
+ ti as ap,
2953
+ si as aq,
2954
+ Rn as ar,
2955
+ Yr as as,
2956
+ lr as at,
2957
+ _n as au,
2958
+ bs as av,
2959
+ Ze as aw,
2960
+ et as ax,
2961
+ mi as ay,
2962
+ Hn as az,
2963
+ an as b,
2964
+ Qn as b$,
2965
+ Na as b0,
2966
+ Sa as b1,
2967
+ gn as b2,
2968
+ Pt as b3,
2969
+ Rt as b4,
2970
+ Ei as b5,
2971
+ Ii as b6,
2972
+ Di as b7,
2973
+ Oi as b8,
2974
+ Jr as b9,
2975
+ qo as bA,
2976
+ ht as bB,
2977
+ on as bC,
2978
+ nn as bD,
2979
+ yn as bE,
2980
+ gs as bF,
2981
+ Tn as bG,
2982
+ ai as bH,
2983
+ In as bI,
2984
+ En as bJ,
2985
+ On as bK,
2986
+ $n as bL,
2987
+ Vn as bM,
2988
+ Ln as bN,
2989
+ ci as bO,
2990
+ zn as bP,
2991
+ ii as bQ,
2992
+ Dn as bR,
2993
+ Mn as bS,
2994
+ ri as bT,
2995
+ li as bU,
2996
+ Fn as bV,
2997
+ Kn as bW,
2998
+ gi as bX,
2999
+ bi as bY,
3000
+ hi as bZ,
3001
+ Yn as b_,
3002
+ Qo as ba,
3003
+ Xo as bb,
3004
+ Zo as bc,
3005
+ Sn as bd,
3006
+ Zr as be,
3007
+ Bn as bf,
3008
+ yi as bg,
3009
+ na as bh,
3010
+ ca as bi,
3011
+ xn as bj,
3012
+ vn as bk,
3013
+ wn as bl,
3014
+ Nn as bm,
3015
+ Cn as bn,
3016
+ kn as bo,
3017
+ tn as bp,
3018
+ sn as bq,
3019
+ cr as br,
3020
+ _a as bs,
3021
+ Ba as bt,
3022
+ Ci as bu,
3023
+ Bi as bv,
3024
+ _t as bw,
3025
+ jo as bx,
3026
+ Hr as by,
3027
+ Ko as bz,
3028
+ rn as c,
3029
+ Xn as c0,
3030
+ Zn as c1,
3031
+ ea as c2,
3032
+ ra as c3,
3033
+ wi as c4,
3034
+ Ni as c5,
3035
+ sa as c6,
3036
+ ta as c7,
3037
+ ki as c8,
3038
+ pa as c9,
3039
+ vs as ca,
3040
+ ga as cb,
3041
+ Ai as cc,
3042
+ ja as cd,
3043
+ ka as ce,
3044
+ Ra as cf,
3045
+ Pa as cg,
3046
+ Ta as ch,
3047
+ Ia as ci,
3048
+ Ma as cj,
3049
+ _i as ck,
3050
+ Ri as cl,
3051
+ Pi as cm,
3052
+ Ca as cn,
3053
+ Aa as co,
3054
+ Ti as cp,
3055
+ Mi as cq,
3056
+ cn as d,
3057
+ dn as e,
3058
+ ln as f,
3059
+ fn as g,
3060
+ ve as h,
3061
+ qt as i,
3062
+ Lr as j,
3063
+ no as k,
3064
+ ae as l,
3065
+ fo as m,
3066
+ uo as n,
3067
+ Re as o,
3068
+ zr as p,
3069
+ Hi as q,
3070
+ $e as r,
3071
+ Kr as s,
3072
+ Ha as t,
3073
+ al as u,
3074
+ cs as v,
3075
+ ie as w,
3076
+ wo as x,
3077
+ Uo as y,
3078
+ qr as z
3079
+ };