@chaibuilder/sdk 1.1.14 → 1.1.16

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 (58) hide show
  1. package/dist/AddBlocks-1DrS62uN.js +222 -0
  2. package/dist/AddBlocks-jqRRefXj.cjs +1 -0
  3. package/dist/BrandingOptions-TRVyCvVq.cjs +1 -0
  4. package/dist/{BrandingOptions-4qzTYdj5.js → BrandingOptions-zFJ28xmJ.js} +18 -19
  5. package/dist/CanvasArea-5oxRxEDL.cjs +59 -0
  6. package/dist/CanvasArea-j8iIkWN-.js +1438 -0
  7. package/dist/{CurrentPage-zxrdTVsG.cjs → CurrentPage-CsENtl7b.cjs} +1 -1
  8. package/dist/{CurrentPage-spjJpQSM.js → CurrentPage-cNRrM2vd.js} +1 -1
  9. package/dist/{Layers-QNAlCI4j.js → Layers-6Fa_6Vy2.js} +2 -2
  10. package/dist/{Layers-YyBChBtg.cjs → Layers-r6pP4nDP.cjs} +1 -1
  11. package/dist/MarkAsGlobalBlock-CDmEHNx7.cjs +1 -0
  12. package/dist/{MarkAsGlobalBlock-xOHhiMDl.js → MarkAsGlobalBlock-uhj0kGZo.js} +23 -23
  13. package/dist/{PagesPanel-BeJrveus.cjs → PagesPanel-UXqoXG-j.cjs} +1 -1
  14. package/dist/{PagesPanel--LI-BoSj.js → PagesPanel-s2qoPZc-.js} +2 -2
  15. package/dist/{ProjectPanel-VNj0jXca.js → ProjectPanel-9z6zVYBb.js} +2 -2
  16. package/dist/{ProjectPanel-MjcAymKT.cjs → ProjectPanel-izG3GYtn.cjs} +1 -1
  17. package/dist/Settings-iLeODb_n.js +2188 -0
  18. package/dist/Settings-olFxwKg4.cjs +1 -0
  19. package/dist/SidePanels-1QED7mo6.cjs +1 -0
  20. package/dist/{SidePanels-4lvmnnlw.js → SidePanels-CWAz1HdY.js} +125 -124
  21. package/dist/add-page-modal-rn0OScnT.cjs +1 -0
  22. package/dist/{add-page-modal-fZnKopNf.js → add-page-modal-vT0-45wi.js} +6 -7
  23. package/dist/controls-QnyBNkXG.cjs +36 -0
  24. package/dist/controls-kEuiMMDf.js +4600 -0
  25. package/dist/core.cjs +1 -1
  26. package/dist/core.js +1 -1
  27. package/dist/{delete-page-modal-P_KKu12n.cjs → delete-page-modal-EZ4gIG3s.cjs} +1 -1
  28. package/dist/{delete-page-modal-fRoXPfhG.js → delete-page-modal-hWmFarnh.js} +1 -1
  29. package/dist/index-Ge20J9Pa.cjs +206 -0
  30. package/dist/{index-CQz6j3ex.js → index-TWBwhGkh.js} +4957 -4262
  31. package/dist/mockServiceWorker.js +10 -18
  32. package/dist/{page-viewer-39ZtxLzx.js → page-viewer-TZC26UCW.js} +2 -2
  33. package/dist/{page-viewer-_lc8vqU4.cjs → page-viewer-yH4HdYhv.cjs} +1 -1
  34. package/dist/{project-general-setting-CCVuGyHh.js → project-general-setting-SjVbcwgp.js} +7 -8
  35. package/dist/project-general-setting-eEQDxjVm.cjs +1 -0
  36. package/dist/{project-seo-setting-Wo7E46w7.js → project-seo-setting-EhqUcTKy.js} +7 -8
  37. package/dist/project-seo-setting-N0OnBCvh.cjs +1 -0
  38. package/dist/single-page-detail-76T7ZZzC.cjs +1 -0
  39. package/dist/{single-page-detail-r1GJF00l.js → single-page-detail-ePzFhs8m.js} +47 -48
  40. package/dist/studio.cjs +1 -1
  41. package/dist/studio.js +1 -1
  42. package/package.json +3 -2
  43. package/dist/AddBlocks-AG_J7s2Z.cjs +0 -1
  44. package/dist/AddBlocks-FsdsASNp.js +0 -222
  45. package/dist/BrandingOptions-xBuqDpj0.cjs +0 -1
  46. package/dist/CanvasArea-4m1-c1yq.cjs +0 -59
  47. package/dist/CanvasArea-U3egqewu.js +0 -1434
  48. package/dist/MarkAsGlobalBlock-LXDkmFUr.cjs +0 -1
  49. package/dist/Settings-BrYkhn3H.cjs +0 -1
  50. package/dist/Settings-LZJwbkO6.js +0 -2189
  51. package/dist/SidePanels-_5oUp-eI.cjs +0 -1
  52. package/dist/add-page-modal-rWhPuGd9.cjs +0 -1
  53. package/dist/controls-G0puEH71.js +0 -120
  54. package/dist/controls-aHZq-q4b.cjs +0 -1
  55. package/dist/index-1Dr-VtaT.cjs +0 -206
  56. package/dist/project-general-setting-LEzDhwoq.cjs +0 -1
  57. package/dist/project-seo-setting-orwH-Ufg.cjs +0 -1
  58. package/dist/single-page-detail-jkDYF7lW.cjs +0 -1
@@ -0,0 +1,2188 @@
1
+ import { j as e } from "./jsx-runtime-NV737rRe.js";
2
+ import * as ne from "react";
3
+ import $, { useState as j, useMemo as _, useEffect as M, useCallback as B, memo as ct, createContext as Oe, useContext as le } from "react";
4
+ import { useThrottledCallback as ve } from "@react-hookz/web";
5
+ import { f as ue, L as ie, o as pt, M as ut, c as A, g, h as ge, N as gt, O as Y, P as se, a as m, d as C, j as xt, l as we, b as je, s as Me, k as yt, Q as ht, u as bt, R as mt, S as Ve, e as W, T as ft, p as vt, U as ze, V as wt, n as U, W as Ye, t as be, A as jt } from "./lodash-3gkdNK5u.js";
6
+ import { useTranslation as K } from "react-i18next";
7
+ import { PlusIcon as Ne, Cross2Icon as Xe, EyeOpenIcon as Ct, EyeClosedIcon as He, BorderAllIcon as P, WidthIcon as T, HeightIcon as R, ArrowUpIcon as Q, ArrowRightIcon as ee, ArrowDownIcon as te, ArrowLeftIcon as re, ArrowTopLeftIcon as kt, ArrowTopRightIcon as Nt, ArrowBottomRightIcon as _t, ArrowBottomLeftIcon as St, AlignLeftIcon as Tt, AlignCenterHorizontallyIcon as Rt, AlignRightIcon as Vt, StretchHorizontallyIcon as Ht, FontItalicIcon as Bt, UnderlineIcon as Dt, OverlineIcon as $t, LetterCaseUppercaseIcon as It, Cross1Icon as Pt, InfoCircledIcon as _e, MinusIcon as At, BoxIcon as Fe, RowSpacingIcon as Lt, TriangleDownIcon as Et, CrossCircledIcon as Ot, TrashIcon as Mt, MixerHorizontalIcon as Ze } from "@radix-ui/react-icons";
8
+ import { b0 as zt, b1 as Yt, B as xe, b2 as Xt, b3 as Ft, b4 as Zt, b5 as Wt, b6 as Ut, b7 as Kt, b8 as qt, a6 as q, am as Gt, an as Jt, ao as Qt, b9 as er, ak as tr, ba as rr, al as sr, aD as X, aE as F, aG as Z, bb as lr, bc as or, bd as ar, be as nr, bf as ir, bg as dr, p as We, ac as Ue, i as cr, bh as Ke, bi as de, bj as ce, bk as pe, aj as Se, P as qe, a3 as Ge, j as Je, aI as Te, bl as pr, bm as ur, a4 as ye, W as gr, a9 as Qe, R as Be, ag as xr, ad as yr, bn as hr, aq as br, ar as mr, as as fr, at as vr, au as V, bo as et, ax as wr, ay as jr, az as De, aA as $e } from "./index-0OqmBgqo.js";
9
+ import { R as Cr } from "./controls-kEuiMMDf.js";
10
+ import { Check as kr, EditIcon as Nr, TrashIcon as _r } from "lucide-react";
11
+ import { getBlockComponent as tt, getChaiDataProviders as Sr } from "@chaibuilder/runtime";
12
+ import { E as rt, u as st } from "./index-TWBwhGkh.js";
13
+ import Tr from "@rjsf/core";
14
+ import Rr from "@rjsf/validator-ajv8";
15
+ import { useAtom as Vr } from "jotai";
16
+ import Hr from "react-autosuggest";
17
+ import Br from "fuse.js";
18
+ import { A as Dr, C as he, e as $r } from "./utils-XsPKXMVo.js";
19
+ import { a as Ir } from "./MODIFIERS-MLfpKQY1.js";
20
+ import "@radix-ui/react-toggle";
21
+ import "class-variance-authority";
22
+ import "@radix-ui/react-switch";
23
+ import "@radix-ui/react-slot";
24
+ import "@radix-ui/react-accordion";
25
+ import "@radix-ui/react-alert-dialog";
26
+ import "@radix-ui/react-dialog";
27
+ import "@radix-ui/react-label";
28
+ import "@radix-ui/react-scroll-area";
29
+ import "@radix-ui/react-tabs";
30
+ import "@radix-ui/react-tooltip";
31
+ import "@radix-ui/react-popover";
32
+ import "@radix-ui/react-menubar";
33
+ import "@radix-ui/react-hover-card";
34
+ import "@radix-ui/react-select";
35
+ import "@radix-ui/react-dropdown-menu";
36
+ import "@radix-ui/react-separator";
37
+ import "@radix-ui/react-toast";
38
+ import "cmdk";
39
+ import "@radix-ui/react-context-menu";
40
+ import "react-icons-picker";
41
+ import "react-dom";
42
+ import "react-quill";
43
+ import "flat-to-nested";
44
+ import "redux-undo";
45
+ import "i18next";
46
+ import "clsx";
47
+ import "@floating-ui/react-dom";
48
+ import "react-textarea-autosize";
49
+ import "flagged";
50
+ import "react-dnd";
51
+ import "@minoru/react-dnd-treeview";
52
+ import "react-hotkeys-hook";
53
+ import "sonner";
54
+ import "./html-to-json-Y5M0N8PH.js";
55
+ import "himalaya";
56
+ import "tailwind-merge";
57
+ const Pr = $.lazy(() => import("react-json-view"));
58
+ function Ar(r) {
59
+ const l = [], t = {};
60
+ function o(s, d) {
61
+ ue(d, (a, c) => {
62
+ const i = s ? `${s}.${c}` : c, p = ie(a) ? "list" : typeof a;
63
+ l.push(i), t[i] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !ie(a) && o(i, a);
64
+ });
65
+ }
66
+ return o("", pt(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: l, pathsType: t };
67
+ }
68
+ const Ce = ({ data: r, fullView: l }) => {
69
+ if (!r)
70
+ return null;
71
+ const t = typeof r;
72
+ return l ? typeof r == "object" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
73
+ /* @__PURE__ */ e.jsx("div", { className: "h-3" }),
74
+ /* @__PURE__ */ e.jsx(rt, { children: /* @__PURE__ */ e.jsx(
75
+ Pr,
76
+ {
77
+ style: { maxHeight: "40vh", overflowY: "auto" },
78
+ name: "Content",
79
+ enableClipboard: !1,
80
+ displayObjectSize: !1,
81
+ displayDataTypes: !1,
82
+ src: r,
83
+ collapsed: !0
84
+ }
85
+ ) })
86
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: "text-gray-800/50 text-[12px] leading-4 w-full max-h-36 overflow-x-hidden overflow-y-auto", children: [
87
+ /* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800/80", children: "Content: " }),
88
+ r
89
+ ] }) : /* @__PURE__ */ e.jsx("div", { className: "text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full", children: ut(t === "object" ? JSON.stringify(r) : r, { length: 40 }) });
90
+ }, Ie = ({
91
+ type: r,
92
+ value: l = "",
93
+ setValue: t,
94
+ data: o,
95
+ onChange: s,
96
+ dataType: d,
97
+ appliedBindings: a
98
+ }) => {
99
+ const { paths: c, pathsType: i } = Ar(o), p = r === "PROP" ? tt(o == null ? void 0 : o._type) : {}, h = r === "PROP", [n, y] = j(!1), x = _(() => r === "PROP" ? c.filter(
100
+ (u) => !A(a, u) && g(p, `props.${ge(gt(u, "."))}.binding`)
101
+ ) : c.filter((u) => d === g(i, u, "")), [r, c, a, d, p]);
102
+ return M(() => {
103
+ l && s(l);
104
+ }, [l, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
105
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
106
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: Y(se(r)) }),
107
+ /* @__PURE__ */ e.jsxs(zt, { open: n, onOpenChange: y, children: [
108
+ /* @__PURE__ */ e.jsx(Yt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
109
+ xe,
110
+ {
111
+ variant: "outline",
112
+ size: "sm",
113
+ className: ` ${m(l) ? "bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white w-44 justify-center" : "min-w-[350px] justify-between items-center"}`,
114
+ children: l ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
115
+ /* @__PURE__ */ e.jsxs("span", { className: "text-sm pr-8", children: [
116
+ h && /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full", children: Y(d) }),
117
+ l
118
+ ] }),
119
+ /* @__PURE__ */ e.jsx("span", { className: "text-[9px] text-blue-400 underline cursor-pointer hover:text-blue-700", children: "Change" })
120
+ ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
121
+ "+ Set ",
122
+ Y(se(r))
123
+ ] })
124
+ }
125
+ ) }),
126
+ /* @__PURE__ */ e.jsx(Xt, { className: "p-0 z-[999] min-w-[300px]", side: "right", align: "start", children: /* @__PURE__ */ e.jsxs(Ft, { children: [
127
+ /* @__PURE__ */ e.jsx(Zt, { placeholder: `Choose ${se(r)}...` }),
128
+ /* @__PURE__ */ e.jsxs(Wt, { children: [
129
+ /* @__PURE__ */ e.jsx(Ut, { children: "No results found." }),
130
+ /* @__PURE__ */ e.jsx(Kt, { children: C(x, (u) => /* @__PURE__ */ e.jsxs(
131
+ qt,
132
+ {
133
+ value: u,
134
+ className: `cursor-pointer ${h ? "flex justify-between items-center" : "flex flex-col items-start justify-start"}`,
135
+ onSelect: (f) => {
136
+ t(xt(x, (k) => k === f) || null), y(!1);
137
+ },
138
+ children: [
139
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
140
+ /* @__PURE__ */ e.jsx(kr, { className: `w-4 h-4 text-green-500 ${l === u ? "" : "opacity-0"}` }),
141
+ u
142
+ ] }),
143
+ h ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full", children: Y(g(i, u, "")) }) }) : /* @__PURE__ */ e.jsx("div", { className: "pl-6", children: /* @__PURE__ */ e.jsx(Ce, { data: g(o, u) }) })
144
+ ]
145
+ },
146
+ u
147
+ )) })
148
+ ] })
149
+ ] }) })
150
+ ] })
151
+ ] }),
152
+ !h && !m(l) && /* @__PURE__ */ e.jsx("div", { className: "pt-2", children: /* @__PURE__ */ e.jsx(Ce, { data: g(o, l, ""), fullView: !0 }) })
153
+ ] });
154
+ }, Lr = ({
155
+ appliedBindings: r = [],
156
+ onAddBinding: l,
157
+ editMode: t,
158
+ item: o
159
+ }) => {
160
+ const [s, d] = j(t ? o.key : ""), [a, c] = j(t ? o.value : ""), i = q(), [p] = st(), h = B(
161
+ (x, u) => {
162
+ if (m(x))
163
+ return "";
164
+ {
165
+ const f = g(u === "PROP" ? i : p, x, "");
166
+ if (ie(f))
167
+ return "list";
168
+ const k = typeof f;
169
+ return k === "string" ? "text" : k === "object" ? "model" : k;
170
+ }
171
+ },
172
+ [i, p]
173
+ ), [n, y] = j(t ? h(o.key, "PROP") : "");
174
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
175
+ /* @__PURE__ */ e.jsxs(Gt, { children: [
176
+ /* @__PURE__ */ e.jsx(Jt, { children: "Add Data Binding" }),
177
+ /* @__PURE__ */ e.jsx(Qt, { className: "text-xs", children: "Add prop and path of binding. Click save when you're done." })
178
+ ] }),
179
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 relative", children: [
180
+ /* @__PURE__ */ e.jsx(
181
+ Ie,
182
+ {
183
+ type: "PROP",
184
+ isDisabled: !1,
185
+ placeholder: "Enter prop key",
186
+ value: s,
187
+ setValue: d,
188
+ onChange: (x) => {
189
+ const u = h(x, "PROP");
190
+ d(x), n !== u && c(""), y(u);
191
+ },
192
+ data: i,
193
+ dataType: n,
194
+ appliedBindings: r
195
+ }
196
+ ),
197
+ /* @__PURE__ */ e.jsx("div", { className: "h-2" }),
198
+ /* @__PURE__ */ e.jsx(
199
+ Ie,
200
+ {
201
+ type: "PATH",
202
+ isDisabled: m(s),
203
+ placeholder: "Enter data path",
204
+ value: a,
205
+ setValue: c,
206
+ onChange: (x) => {
207
+ const u = h(x, "PATH");
208
+ c(n === u ? x : "");
209
+ },
210
+ data: p,
211
+ dataType: n,
212
+ appliedBindings: r
213
+ }
214
+ )
215
+ ] }),
216
+ /* @__PURE__ */ e.jsx(er, { children: /* @__PURE__ */ e.jsx(
217
+ xe,
218
+ {
219
+ type: "submit",
220
+ className: "mt-4",
221
+ disabled: m(s) && m(a),
222
+ onClick: () => l({ key: s, value: a }),
223
+ children: "Save"
224
+ }
225
+ ) })
226
+ ] });
227
+ }, lt = ({ disabled: r, children: l, onAddBinding: t, appliedBindings: o, editMode: s = !0, item: d = {} }) => {
228
+ const [a, c] = j(!1);
229
+ return /* @__PURE__ */ e.jsxs(tr, { children: [
230
+ /* @__PURE__ */ e.jsx(rr, { disabled: r, asChild: !0, onClick: () => c(!0), children: l }),
231
+ a && /* @__PURE__ */ e.jsx(sr, { children: /* @__PURE__ */ e.jsx(
232
+ Lr,
233
+ {
234
+ item: d,
235
+ editMode: s,
236
+ appliedBindings: o,
237
+ onAddBinding: (i) => {
238
+ t(i), c(!1);
239
+ }
240
+ }
241
+ ) })
242
+ ] });
243
+ }, Er = ({
244
+ item: r,
245
+ onAddBinding: l,
246
+ onRemove: t,
247
+ selectedBlock: o,
248
+ dataProvider: s,
249
+ appliedBindings: d
250
+ }) => {
251
+ const [a, c] = j("string"), i = (p, h) => {
252
+ if (m(p))
253
+ return "";
254
+ {
255
+ const n = g(h === "PROP" ? o : s, p, "");
256
+ if (ie(n))
257
+ return "list";
258
+ const y = typeof n;
259
+ return y === "string" ? "text" : y === "object" ? "model" : y;
260
+ }
261
+ };
262
+ return M(() => c(() => i(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col border border-gray-200 relative rounded-md p-2", children: [
263
+ /* @__PURE__ */ e.jsx("div", { className: "text-gray-500 font-normal text-sm", children: r.key }),
264
+ /* @__PURE__ */ e.jsx("div", { className: "font-medium leading-5", children: r.value }),
265
+ /* @__PURE__ */ e.jsx(Ce, { data: g(s, r.value, "") }),
266
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
267
+ /* @__PURE__ */ e.jsx(lt, { editMode: !0, onAddBinding: l, appliedBindings: d, item: r, children: /* @__PURE__ */ e.jsx(Nr, { className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-blue-400 hover:text-white border-blue-400 p-1 text-blue-400 hover:scale-105 duration-200" }) }),
268
+ /* @__PURE__ */ e.jsx(
269
+ _r,
270
+ {
271
+ onClick: () => t(),
272
+ className: "h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"
273
+ }
274
+ )
275
+ ] }),
276
+ !m(a) && !m(r.key) && /* @__PURE__ */ e.jsx("div", { className: "mt-px absolute right-0 top-1 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full", children: Y(a) })
277
+ ] });
278
+ }, Or = ({ bindingData: r, onChange: l }) => {
279
+ const t = q(), [o] = st(), s = Sr(), [d, a] = j(
280
+ C(r, (n, y) => ({ key: y, value: n }))
281
+ );
282
+ M(() => {
283
+ a(C(r, (n, y) => ({ key: y, value: n })));
284
+ }, [t == null ? void 0 : t._id]);
285
+ const c = _(() => {
286
+ if (m(o))
287
+ return !0;
288
+ if (m(d))
289
+ return !1;
290
+ const n = we(d);
291
+ return m(n == null ? void 0 : n.key) || m(n == null ? void 0 : n.value);
292
+ }, [o, d]), i = (n) => {
293
+ const y = je(d, (x) => x.key !== n.key);
294
+ a([...y, n]), h([...y, n]);
295
+ }, p = (n) => {
296
+ const y = je(d, (x, u) => n !== u);
297
+ h([...y]);
298
+ }, h = B(
299
+ (n = []) => {
300
+ if (a(n), m(n)) {
301
+ l({});
302
+ return;
303
+ }
304
+ const y = {};
305
+ ue(n, (x) => {
306
+ !m(x == null ? void 0 : x.key) && !m(x == null ? void 0 : x.value) && Me(y, x.key, x.value);
307
+ }), l(y);
308
+ },
309
+ [l]
310
+ );
311
+ return m(s) ? /* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs", children: [
312
+ "You have no data providers registered. Please add a data provider to your project. ",
313
+ /* @__PURE__ */ e.jsx("br", {}),
314
+ /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
315
+ ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
316
+ C(d, (n, y) => /* @__PURE__ */ e.jsx(
317
+ Er,
318
+ {
319
+ item: n,
320
+ onAddBinding: i,
321
+ onRemove: () => p(y),
322
+ selectedBlock: t,
323
+ dataProvider: o,
324
+ appliedBindings: C(d, "key")
325
+ },
326
+ n.key
327
+ )),
328
+ /* @__PURE__ */ e.jsxs(X, { delayDuration: 200, children: [
329
+ /* @__PURE__ */ e.jsx(F, { className: "w-full", children: /* @__PURE__ */ e.jsx(
330
+ lt,
331
+ {
332
+ disabled: c,
333
+ appliedBindings: C(d, "key"),
334
+ onAddBinding: i,
335
+ children: /* @__PURE__ */ e.jsx(
336
+ "span",
337
+ {
338
+ className: `w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${c ? "cursor-not-allowed bg-gray-200 text-gray-400" : "bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,
339
+ children: m(o) ? /* @__PURE__ */ e.jsx("small", { className: "text-gray-500 text-[9.5px]", children: "No data provider has been set up for this page" }) : "+ Add Data Binding"
340
+ }
341
+ )
342
+ }
343
+ ) }),
344
+ c && /* @__PURE__ */ e.jsx(Z, { sideOffset: -55, className: "text-[11px]", children: m(o) ? "No data provider has been set up for this page." : "Complete last added data binding to add more" })
345
+ ] })
346
+ ] });
347
+ }, Mr = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), me = ct(({ createHistorySnapshot: r, properties: l, formData: t, onChange: o }) => {
348
+ const s = { type: "object", properties: {} }, d = {};
349
+ return Object.keys(l).forEach((a) => {
350
+ const c = l[a];
351
+ if (A(["slot", "styles"], c.type))
352
+ return;
353
+ const i = a;
354
+ s.properties[i] = lr(c), d[i] = or(c);
355
+ }), /* @__PURE__ */ e.jsx(
356
+ Tr,
357
+ {
358
+ widgets: {
359
+ binding: Mr,
360
+ richtext: ar,
361
+ icon: nr,
362
+ image: ir
363
+ },
364
+ fields: { link: dr },
365
+ idSeparator: ".",
366
+ autoComplete: "off",
367
+ omitExtraData: !1,
368
+ liveOmit: !1,
369
+ liveValidate: !0,
370
+ validator: Rr,
371
+ uiSchema: d,
372
+ onBlur: r,
373
+ schema: s,
374
+ formData: t,
375
+ onChange: o
376
+ }
377
+ );
378
+ });
379
+ function zr() {
380
+ const r = q(), { createSnapshot: l } = We(), t = Ue(), o = tt(r._type), s = { ...r }, d = cr("dataBindingSupport", !1), a = () => l(), c = ({ formData: n }, y) => {
381
+ if (y) {
382
+ const x = y.replace("root.", "");
383
+ t([r._id], { [x]: g(n, x) });
384
+ }
385
+ }, i = {
386
+ _name: Cr({
387
+ title: "Name",
388
+ default: g(r, "_name", r._type)
389
+ })
390
+ }, p = yt(g(s, "_bindings", {})), h = _(() => {
391
+ const n = ht(g(o, "props", {}));
392
+ return d && ue(p, (y) => delete n[y]), n;
393
+ }, [o, p, d]);
394
+ return /* @__PURE__ */ e.jsxs("div", { className: "overflow-x-hidden", children: [
395
+ /* @__PURE__ */ e.jsx(
396
+ me,
397
+ {
398
+ onChange: c,
399
+ createHistorySnapshot: a,
400
+ formData: s,
401
+ properties: i
402
+ }
403
+ ),
404
+ /* @__PURE__ */ e.jsx("hr", { className: "mt-4" }),
405
+ d ? /* @__PURE__ */ e.jsxs(Ke, { type: "multiple", defaultValue: ["STATIC", "BINDING"], className: "h-full w-full", children: [
406
+ /* @__PURE__ */ e.jsxs(de, { value: "BINDING", children: [
407
+ /* @__PURE__ */ e.jsx(ce, { className: "px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
408
+ /* @__PURE__ */ e.jsx(
409
+ "div",
410
+ {
411
+ className: `h-[8px] w-[8px] rounded-full ${m(g(r, "_bindings", {})) ? "bg-gray-300" : "bg-blue-500"}`
412
+ }
413
+ ),
414
+ "Data Binding"
415
+ ] }) }),
416
+ /* @__PURE__ */ e.jsx(pe, { className: "pt-4 px-4", children: /* @__PURE__ */ e.jsx(
417
+ Or,
418
+ {
419
+ bindingData: g(s, "_bindings", {}),
420
+ onChange: (n) => {
421
+ c({ formData: { ...s, _bindings: n } }, "root._bindings");
422
+ }
423
+ }
424
+ ) })
425
+ ] }),
426
+ /* @__PURE__ */ e.jsxs(de, { value: "STATIC", children: [
427
+ /* @__PURE__ */ e.jsx(ce, { className: "px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
428
+ /* @__PURE__ */ e.jsx("div", { className: "h-[8px] w-[8px] rounded-full bg-blue-500" }),
429
+ "Static Content"
430
+ ] }) }),
431
+ /* @__PURE__ */ e.jsxs(pe, { className: "pt-4", children: [
432
+ m(p) ? "" : /* @__PURE__ */ e.jsxs("div", { className: "text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100", children: [
433
+ "Data binding is set for ",
434
+ /* @__PURE__ */ e.jsx("b", { children: C(p, bt).join(", ") }),
435
+ " ",
436
+ p.length === 1 ? "property" : "properties",
437
+ ". Remove data binding to edit static content."
438
+ ] }),
439
+ /* @__PURE__ */ e.jsx(
440
+ me,
441
+ {
442
+ onChange: c,
443
+ createHistorySnapshot: a,
444
+ formData: s,
445
+ properties: h
446
+ }
447
+ )
448
+ ] })
449
+ ] })
450
+ ] }) : /* @__PURE__ */ e.jsx(
451
+ me,
452
+ {
453
+ onChange: c,
454
+ createHistorySnapshot: a,
455
+ formData: s,
456
+ properties: h
457
+ }
458
+ ),
459
+ /* @__PURE__ */ e.jsx("div", { className: "pb-60" })
460
+ ] });
461
+ }
462
+ const Pe = new Br(Dr, {
463
+ isCaseSensitive: !1,
464
+ threshold: 0.2,
465
+ minMatchCharLength: 2,
466
+ keys: ["name"]
467
+ });
468
+ function Yr() {
469
+ var L;
470
+ const [r] = Se(), l = q(), t = qe(), o = Ge(), [s] = Je(), [d, a] = j(""), c = (L = ge(r)) == null ? void 0 : L.prop, i = mt((g(l, c, "").replace(Ir, "").split(",").pop() || "").split(" "), m), p = () => {
471
+ const w = d.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
472
+ t(s, w, !0), a("");
473
+ }, [h, n] = j([]), y = ({ value: w }) => {
474
+ const I = w.trim().toLowerCase(), E = I.match(/.+:/g);
475
+ let N = [];
476
+ if (E && E.length > 0) {
477
+ const [D] = E, z = I.replace(D, "");
478
+ N = Pe.search(z).map((b) => ({
479
+ ...b,
480
+ item: { ...b.item, name: D + b.item.name }
481
+ }));
482
+ } else
483
+ N = Pe.search(I);
484
+ n(C(N, "item"));
485
+ }, x = () => {
486
+ n([]);
487
+ }, u = (w) => w.name, f = (w) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: w.name }), k = {
488
+ autoComplete: "off",
489
+ autoCorrect: "off",
490
+ autoCapitalize: "off",
491
+ spellCheck: !1,
492
+ placeholder: "Enter class name",
493
+ value: d,
494
+ onKeyDown: (w) => {
495
+ w.key === "Enter" && d.trim() !== "" && p();
496
+ },
497
+ onChange: (w, { newValue: I }) => a(I),
498
+ className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
499
+ };
500
+ return /* @__PURE__ */ e.jsxs(
501
+ "div",
502
+ {
503
+ className: `no-scrollbar flex ${h.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
504
+ children: [
505
+ /* @__PURE__ */ e.jsx(Te, { className: "mt-2", children: "Add Tailwind classes" }),
506
+ /* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
507
+ /* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
508
+ Hr,
509
+ {
510
+ suggestions: h,
511
+ onSuggestionsFetchRequested: y,
512
+ onSuggestionsClearRequested: x,
513
+ getSuggestionValue: u,
514
+ renderSuggestion: f,
515
+ inputProps: k,
516
+ containerProps: {
517
+ className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
518
+ },
519
+ theme: {
520
+ suggestion: "bg-transparent",
521
+ suggestionHighlighted: "bg-gray-700 ",
522
+ suggestionsContainerOpen: "absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"
523
+ }
524
+ }
525
+ ) }),
526
+ /* @__PURE__ */ e.jsx(
527
+ xe,
528
+ {
529
+ variant: "outline",
530
+ className: "h-6 border-gray-700",
531
+ onClick: p,
532
+ disabled: d.trim() === "",
533
+ size: "sm",
534
+ children: /* @__PURE__ */ e.jsx(Ne, {})
535
+ }
536
+ )
537
+ ] }),
538
+ /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
539
+ m(i) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
540
+ ne.Children.toArray(
541
+ i.map((w) => /* @__PURE__ */ e.jsxs(
542
+ "div",
543
+ {
544
+ className: "group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",
545
+ children: [
546
+ w,
547
+ /* @__PURE__ */ e.jsx(
548
+ Xe,
549
+ {
550
+ onClick: () => o(s, [w]),
551
+ className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
552
+ }
553
+ )
554
+ ]
555
+ },
556
+ w
557
+ ))
558
+ )
559
+ ] })
560
+ ]
561
+ }
562
+ );
563
+ }
564
+ const H = ["px", "%", "em", "rem", "ch", "vh", "vw"], Xr = {
565
+ heading: "flex.heading",
566
+ items: [
567
+ { type: "arbitrary", label: "flex.basis", units: H, property: "flexBasis" },
568
+ { type: "range", label: "flex.order", property: "order" },
569
+ { type: "dropdown", label: "flex.flex", property: "flexGrowShrink" },
570
+ { type: "dropdown", label: "flex.grow", property: "flexGrow" },
571
+ { type: "dropdown", label: "flex.shrink", property: "flexShrink" }
572
+ ]
573
+ }, Fr = {
574
+ heading: "grid.heading",
575
+ items: [
576
+ { type: "range", label: "grid.col_span", property: "gridColSpan" },
577
+ { type: "range", label: "grid.col_start", property: "gridColStart" },
578
+ { type: "range", label: "grid.col_end", property: "gridColEnd" },
579
+ { type: "range", label: "grid.row_span", property: "gridRowSpan" },
580
+ { type: "range", label: "grid.row_start", property: "gridRowStart" },
581
+ { type: "range", label: "grid.row_end", property: "gridRowEnd" },
582
+ { type: "range", label: "grid.order", property: "order" }
583
+ ]
584
+ }, Zr = [
585
+ {
586
+ heading: "layout.heading",
587
+ items: [
588
+ { type: "arbitrary", label: "layout.width", units: H.concat("auto"), property: "width" },
589
+ { type: "arbitrary", label: "layout.height", units: H.concat("auto"), property: "height" },
590
+ {
591
+ styleType: "multiple",
592
+ label: "layout.margin",
593
+ negative: !0,
594
+ units: [...H, "auto"],
595
+ options: [
596
+ { key: "margin", label: "layout.margin_all" },
597
+ { key: "marginX", label: "layout.margin_lr" },
598
+ { key: "marginY", label: "layout.margin_tb" },
599
+ { key: "marginTop", label: "layout.margin_top" },
600
+ { key: "marginRight", label: "layout.margin_right" },
601
+ { key: "marginBottom", label: "layout.margin_bottom" },
602
+ { key: "marginLeft", label: "layout.margin_left" }
603
+ ]
604
+ },
605
+ {
606
+ styleType: "multiple",
607
+ label: "layout.padding",
608
+ options: [
609
+ { key: "padding", label: "layout.padding_all" },
610
+ { key: "paddingX", label: "layout.padding_lr" },
611
+ { key: "paddingY", label: "layout.padding_tb" },
612
+ { key: "paddingTop", label: "layout.padding_top" },
613
+ { key: "paddingRight", label: "layout.padding_right" },
614
+ { key: "paddingBottom", label: "layout.padding_bottom" },
615
+ { key: "paddingLeft", label: "layout.padding_left" }
616
+ ]
617
+ },
618
+ {
619
+ styleType: "multiple",
620
+ label: "layout.space_bt",
621
+ options: [
622
+ { key: "spaceX", label: "layout.space_lr" },
623
+ { key: "spaceY", label: "layout.space_tb" }
624
+ ]
625
+ }
626
+ ]
627
+ },
628
+ {
629
+ heading: "size.heading",
630
+ items: [
631
+ {
632
+ styleType: "accordion",
633
+ heading: "size.min_width_height",
634
+ items: [
635
+ { type: "arbitrary", label: "size.min_width", units: H.concat("auto"), property: "minWidth" },
636
+ { type: "arbitrary", label: "size.min_height", units: H.concat("auto"), property: "minHeight" }
637
+ ]
638
+ },
639
+ {
640
+ styleType: "accordion",
641
+ heading: "size.max_width_height",
642
+ items: [
643
+ { type: "arbitrary", label: "size.max_width", units: H.concat("auto"), property: "maxWidth" },
644
+ { type: "arbitrary", label: "size.max_height", units: H.concat("auto"), property: "maxHeight" }
645
+ ]
646
+ },
647
+ {
648
+ styleType: "accordion",
649
+ heading: "size.object_options_aspect_ratio",
650
+ items: [
651
+ { type: "dropdown", label: "size.aspect", property: "aspectRatio" },
652
+ { type: "dropdown", label: "size.fit", property: "objectFit" },
653
+ { type: "dropdown", label: "size.position", property: "objectPosition" }
654
+ ]
655
+ }
656
+ ]
657
+ },
658
+ {
659
+ heading: "display.heading",
660
+ items: [
661
+ { type: "dropdown", label: "display.display", property: "display", units: H },
662
+ {
663
+ styleType: "accordion",
664
+ heading: "display.flex_options",
665
+ items: [
666
+ { type: "dropdown", label: "display.flex_direction", property: "flexDirection" },
667
+ { type: "dropdown", label: "display.flex_wrap", property: "flexWrap" },
668
+ { type: "dropdown", label: "display.justify_content", property: "justifyContent" },
669
+ { type: "dropdown", label: "display.align_content", property: "alignContent" },
670
+ { type: "dropdown", label: "display.align_items", property: "alignItems" },
671
+ {
672
+ styleType: "multiple",
673
+ label: "display.gap",
674
+ options: [
675
+ { key: "gap", label: "display.gap_all" },
676
+ { key: "gapX", label: "display.gap_lr" },
677
+ { key: "gapY", label: "display.gap_tb" }
678
+ ]
679
+ }
680
+ ],
681
+ conditions: { display: "flex" }
682
+ },
683
+ {
684
+ styleType: "accordion",
685
+ heading: "display.grid_options",
686
+ items: [
687
+ { type: "range", label: "display.grid_columns", property: "gridColumns" },
688
+ { type: "range", label: "display.grid_rows", property: "gridRows" },
689
+ { type: "dropdown", label: "display.grid_auto_flow", property: "gridAutoFlow" },
690
+ { type: "dropdown", label: "display.grid_auto_cols", property: "gridAutoColumns" },
691
+ { type: "dropdown", label: "display.grid_auto_rows", property: "gridAutoRows" },
692
+ { type: "dropdown", label: "display.justify_content", property: "justifyContent" },
693
+ { type: "dropdown", label: "display.align_content", property: "alignContent" },
694
+ { type: "dropdown", label: "display.align_items", property: "alignItems" },
695
+ {
696
+ styleType: "multiple",
697
+ label: "display.gap",
698
+ units: ["px", "rem"],
699
+ options: [
700
+ { key: "gap", label: "display.gap_all" },
701
+ { key: "gapX", label: "display.gap_lr" },
702
+ { key: "gapY", label: "display.gap_tb" }
703
+ ]
704
+ }
705
+ ],
706
+ conditions: { display: "grid" }
707
+ },
708
+ {
709
+ styleType: "accordion",
710
+ heading: "display.visibility_opacity",
711
+ items: [
712
+ { type: "dropdown", label: "display.visibility", property: "visibility", units: H },
713
+ { type: "arbitrary", label: "display.opacity", property: "opacity", units: ["-"] }
714
+ ]
715
+ }
716
+ ]
717
+ },
718
+ {
719
+ heading: "position.heading",
720
+ items: [
721
+ { type: "icons", label: "position.position", property: "position" },
722
+ {
723
+ styleType: "accordion",
724
+ heading: "position.options",
725
+ items: [
726
+ {
727
+ styleType: "multiple",
728
+ label: "position.direction",
729
+ options: [
730
+ { key: "top", label: "position.top" },
731
+ { key: "right", label: "position.right" },
732
+ { key: "bottom", label: "position.bottom" },
733
+ { key: "left", label: "position.left" }
734
+ ]
735
+ },
736
+ {
737
+ styleType: "multiple",
738
+ label: "position.inset",
739
+ options: [
740
+ { key: "inset", label: "position.all" },
741
+ { key: "insetX", label: "position.lr" },
742
+ { key: "insetY", label: "position.tb" }
743
+ ]
744
+ },
745
+ { type: "arbitrary", label: "position.z_index", units: ["-", "auto"], property: "zIndex" }
746
+ ]
747
+ },
748
+ {
749
+ styleType: "accordion",
750
+ heading: "position.float_clear",
751
+ items: [
752
+ { type: "icons", label: "position.float", property: "float" },
753
+ { type: "dropdown", label: "position.clear", property: "clear" }
754
+ ]
755
+ },
756
+ {
757
+ styleType: "accordion",
758
+ heading: "position.overflow_overscroll",
759
+ items: [
760
+ {
761
+ styleType: "multiple",
762
+ type: "dropdown",
763
+ label: "position.overflow",
764
+ options: [
765
+ { key: "overflow", label: "position.all" },
766
+ { key: "overflowX", label: "position.lr" },
767
+ { key: "overflowY", label: "position.tb" }
768
+ ]
769
+ },
770
+ {
771
+ styleType: "multiple",
772
+ type: "dropdown",
773
+ label: "position.overscroll",
774
+ options: [
775
+ { key: "overscroll", label: "position.all" },
776
+ { key: "overscrollX", label: "position.lr" },
777
+ { key: "overscrollY", label: "position.tb" }
778
+ ]
779
+ }
780
+ ]
781
+ }
782
+ ]
783
+ },
784
+ {
785
+ heading: "typography.heading",
786
+ items: [
787
+ { type: "dropdown", property: "typography.font", label: "typography.font" },
788
+ { type: "arbitrary", property: "typography.size", label: "typography.size", units: H },
789
+ { type: "arbitrary", property: "typography.height", label: "typography.height", units: H.concat("-") },
790
+ { type: "range", property: "typography.weight", label: "typography.weight" },
791
+ { type: "color", property: "typography.color", label: "typography.color" },
792
+ {
793
+ styleType: "accordion",
794
+ heading: "typography.alignments",
795
+ items: [
796
+ { type: "dropdown", property: "typography.align", label: "typography.align" },
797
+ { type: "dropdown", property: "typography.valign", label: "typography.valign" }
798
+ ]
799
+ },
800
+ {
801
+ styleType: "accordion",
802
+ heading: "typography.spacing_decoration_more",
803
+ items: [
804
+ { type: "dropdown", property: "typography.spacing", label: "typography.spacing" },
805
+ { type: "dropdown", property: "typography.decoration", label: "typography.decoration" },
806
+ { type: "range", property: "typography.thickness", label: "typography.thickness" },
807
+ { type: "dropdown", property: "typography.transform", label: "typography.transform" }
808
+ ]
809
+ },
810
+ {
811
+ styleType: "accordion",
812
+ heading: "typography.whitespace_breaks",
813
+ items: [
814
+ { type: "dropdown", property: "typography.whitespace", label: "typography.whitespace" },
815
+ { type: "dropdown", property: "typography.wordbreak", label: "typography.wordbreak" }
816
+ ]
817
+ }
818
+ ]
819
+ },
820
+ {
821
+ heading: "background.heading",
822
+ items: [
823
+ { type: "color", label: "background.bgcolor", property: "backgroundColor" },
824
+ {
825
+ styleType: "accordion",
826
+ heading: "background.position_size_more",
827
+ items: [
828
+ { type: "dropdown", label: "background.attachment", property: "backgroundAttachment" },
829
+ { type: "dropdown", label: "background.clipping", property: "backgroundClip" },
830
+ { type: "dropdown", label: "background.origin", property: "backgroundOrigin" },
831
+ { type: "dropdown", label: "background.position", property: "backgroundPosition" },
832
+ { type: "dropdown", label: "background.repeat", property: "backgroundRepeat" },
833
+ { type: "dropdown", label: "background.size", property: "backgroundSize" }
834
+ ]
835
+ },
836
+ { type: "dropdown", label: "background.gradient", property: "backgroundGradient" },
837
+ {
838
+ styleType: "accordion",
839
+ heading: "background.gradient_colors",
840
+ items: [
841
+ { type: "color", label: "background.from_color", property: "fromColor" },
842
+ { type: "color", label: "background.via_color", property: "viaColor" },
843
+ { type: "color", label: "background.to_color", property: "toColor" }
844
+ ]
845
+ }
846
+ ]
847
+ },
848
+ {
849
+ heading: "border.heading",
850
+ items: [
851
+ {
852
+ styleType: "multiple",
853
+ type: "dropdown",
854
+ label: "border.width",
855
+ options: [
856
+ { key: "border", label: "border.all" },
857
+ { key: "borderX", label: "border.lr" },
858
+ { key: "borderY", label: "border.tb" },
859
+ { key: "borderTop", label: "border.top" },
860
+ { key: "borderRight", label: "border.right" },
861
+ { key: "borderBottom", label: "border.bottom" },
862
+ { key: "borderLeft", label: "border.left" }
863
+ ]
864
+ },
865
+ {
866
+ styleType: "multiple",
867
+ type: "dropdown",
868
+ label: "border.corners",
869
+ options: [
870
+ { key: "borderRadius", label: "border.all" },
871
+ { key: "borderRadiusTop", label: "border.top" },
872
+ { key: "borderRadiusRight", label: "border.right" },
873
+ { key: "borderRadiusBottom", label: "border.bottom" },
874
+ { key: "borderRadiusLeft", label: "border.left" },
875
+ { key: "borderRadiusTopLeft", label: "border.top_left" },
876
+ { key: "borderRadiusTopRight", label: "border.top_right" },
877
+ { key: "borderRadiusBottomRight", label: "border.bottom_right" },
878
+ { key: "borderRadiusBottomLeft", label: "border.bottom_left" }
879
+ ]
880
+ },
881
+ { type: "color", label: "border.color", property: "borderColor" },
882
+ { type: "dropdown", label: "border.style", property: "borderStyle" },
883
+ {
884
+ styleType: "accordion",
885
+ heading: "border.divide_options",
886
+ items: [
887
+ {
888
+ styleType: "multiple",
889
+ type: "range",
890
+ label: "border.width",
891
+ options: [
892
+ { key: "divideXWidth", label: "border.lr" },
893
+ { key: "divideYWidth", label: "border.tb" }
894
+ ]
895
+ },
896
+ { type: "color", label: "border.divide_color", property: "divideColor" },
897
+ { type: "dropdown", label: "border.divide_style", property: "divideStyle" }
898
+ ]
899
+ },
900
+ {
901
+ styleType: "accordion",
902
+ heading: "border.outline_styling",
903
+ items: [
904
+ { type: "range", label: "border.outline_width", property: "outlineWidth" },
905
+ { type: "range", label: "border.outline_offset", property: "outlineOffset" },
906
+ { type: "dropdown", label: "border.outline_style", property: "outlineStyle" }
907
+ ]
908
+ },
909
+ {
910
+ styleType: "accordion",
911
+ heading: "border.ring_options",
912
+ items: [
913
+ { type: "range", label: "border.ring_width", property: "ringWidth" },
914
+ { type: "color", label: "border.ring_color", property: "ringColor" },
915
+ { type: "range", label: "border.ring_offset_width", property: "ringOffsetWidth" },
916
+ { type: "color", label: "border.ring_offset_color", property: "ringOffsetColor" }
917
+ ]
918
+ }
919
+ ]
920
+ },
921
+ {
922
+ heading: "effect.heading",
923
+ items: [
924
+ { type: "range", label: "effect.shadow", property: "boxShadow" },
925
+ { type: "color", label: "effect.color", property: "boxShadowColor" },
926
+ { type: "dropdown", label: "effect.cursor", property: "cursor" },
927
+ {
928
+ styleType: "accordion",
929
+ heading: "effect.blend_cursor",
930
+ items: [
931
+ { type: "dropdown", label: "effect.mix_blend", property: "mixBlendMode" },
932
+ { type: "dropdown", label: "effect.bg_blend", property: "bgBlendMode" }
933
+ ]
934
+ },
935
+ {
936
+ styleType: "accordion",
937
+ heading: "effect.transform",
938
+ items: [
939
+ { type: "dropdown", label: "effect.origin", property: "transformOrigin" },
940
+ {
941
+ styleType: "multiple",
942
+ label: "effect.scale",
943
+ units: ["-"],
944
+ options: [
945
+ { key: "scale", label: "effect.all" },
946
+ { key: "scaleX", label: "effect.lr" },
947
+ { key: "scaleY", label: "effect.tb" }
948
+ ]
949
+ },
950
+ {
951
+ styleType: "multiple",
952
+ label: "effect.skew",
953
+ units: ["deg"],
954
+ options: [
955
+ { key: "skewX", label: "effect.lr" },
956
+ { key: "skewY", label: "effect.tb" }
957
+ ]
958
+ },
959
+ {
960
+ styleType: "multiple",
961
+ label: "effect.translate",
962
+ negative: !0,
963
+ options: [
964
+ { key: "translateX", label: "effect.lr" },
965
+ { key: "translateY", label: "effect.tb" }
966
+ ]
967
+ },
968
+ { type: "arbitrary", units: ["deg"], negative: !0, label: "effect.rotate", property: "rotate" }
969
+ ]
970
+ },
971
+ {
972
+ styleType: "accordion",
973
+ heading: "effect.animation",
974
+ items: [
975
+ { type: "dropdown", label: "effect.animation", property: "animation" },
976
+ { type: "dropdown", label: "effect.transition", property: "transition" },
977
+ { type: "dropdown", label: "effect.easing", property: "transitionEase" },
978
+ { type: "arbitrary", units: ["ms"], label: "effect.duration", property: "duration" },
979
+ { type: "arbitrary", units: ["ms"], label: "effect.delay", property: "delay" }
980
+ ]
981
+ }
982
+ ]
983
+ },
984
+ {
985
+ heading: "classes.heading",
986
+ items: [{ component: Yr }]
987
+ }
988
+ ], ot = {
989
+ "not-italic": () => /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z", fill: "white" }) }),
990
+ // visibility
991
+ visible: Ct,
992
+ invisible: He,
993
+ // display
994
+ hidden: He,
995
+ gap: P,
996
+ gapX: T,
997
+ gapY: R,
998
+ spaceX: T,
999
+ spaceY: R,
1000
+ overscroll: P,
1001
+ overscrollX: T,
1002
+ overscrollY: R,
1003
+ overflow: P,
1004
+ overflowX: T,
1005
+ overflowY: R,
1006
+ top: Q,
1007
+ right: ee,
1008
+ bottom: te,
1009
+ left: re,
1010
+ inset: P,
1011
+ insetX: T,
1012
+ insetY: R,
1013
+ border: P,
1014
+ borderX: T,
1015
+ borderY: R,
1016
+ borderTop: Q,
1017
+ borderRight: ee,
1018
+ borderBottom: te,
1019
+ borderLeft: re,
1020
+ borderRadius: P,
1021
+ borderRadiusX: T,
1022
+ borderRadiusY: R,
1023
+ borderRadiusTop: Q,
1024
+ borderRadiusRight: ee,
1025
+ borderRadiusBottom: te,
1026
+ borderRadiusLeft: re,
1027
+ borderRadiusTopLeft: kt,
1028
+ borderRadiusTopRight: Nt,
1029
+ borderRadiusBottomRight: _t,
1030
+ borderRadiusBottomLeft: St,
1031
+ divideXWidth: T,
1032
+ divideYWidth: R,
1033
+ scale: P,
1034
+ scaleX: T,
1035
+ scaleY: R,
1036
+ skewX: T,
1037
+ skewY: R,
1038
+ translateX: T,
1039
+ translateY: R,
1040
+ // padding
1041
+ padding: P,
1042
+ paddingX: T,
1043
+ paddingY: R,
1044
+ paddingTop: Q,
1045
+ paddingRight: ee,
1046
+ paddingBottom: te,
1047
+ paddingLeft: re,
1048
+ // margin
1049
+ margin: P,
1050
+ marginX: T,
1051
+ marginY: R,
1052
+ marginTop: Q,
1053
+ marginRight: ee,
1054
+ marginBottom: te,
1055
+ marginLeft: re,
1056
+ // text-align
1057
+ textLeft: Tt,
1058
+ textCenter: Rt,
1059
+ textRight: Vt,
1060
+ textJustify: Ht,
1061
+ // font style
1062
+ italic: Bt,
1063
+ // "not-italic": "",
1064
+ // decoration
1065
+ underline: Dt,
1066
+ overline: $t,
1067
+ // transform
1068
+ uppercase: It,
1069
+ block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1070
+ /* @__PURE__ */ e.jsx(
1071
+ "path",
1072
+ {
1073
+ opacity: "0.6",
1074
+ fillRule: "evenodd",
1075
+ clipRule: "evenodd",
1076
+ d: "M2 2H14V14H2V2ZM1 1H15V15H1V1Z",
1077
+ fill: "currentColor"
1078
+ }
1079
+ ),
1080
+ /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7 4H4V12H7V4ZM9 4H12V12H9V4Z", fill: "currentColor" })
1081
+ ] }),
1082
+ // floats
1083
+ "float-right": () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1084
+ /* @__PURE__ */ e.jsx("path", { d: "M8 4H16V12H8V4Z", fill: "currentColor" }),
1085
+ /* @__PURE__ */ e.jsx(
1086
+ "path",
1087
+ {
1088
+ opacity: "0.6",
1089
+ fillRule: "evenodd",
1090
+ clipRule: "evenodd",
1091
+ d: "M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",
1092
+ fill: "currentColor"
1093
+ }
1094
+ )
1095
+ ] }),
1096
+ "float-left": () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1097
+ /* @__PURE__ */ e.jsx("path", { d: "M0 4H8V12H0V4Z", fill: "currentColor" }),
1098
+ /* @__PURE__ */ e.jsx(
1099
+ "path",
1100
+ {
1101
+ opacity: "0.6",
1102
+ fillRule: "evenodd",
1103
+ clipRule: "evenodd",
1104
+ d: "M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",
1105
+ fill: "currentColor"
1106
+ }
1107
+ )
1108
+ ] }),
1109
+ "float-none": Xe,
1110
+ // position
1111
+ fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1112
+ /* @__PURE__ */ e.jsx(
1113
+ "path",
1114
+ {
1115
+ opacity: "0.6",
1116
+ fillRule: "evenodd",
1117
+ clipRule: "evenodd",
1118
+ d: "M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",
1119
+ fill: "currentColor"
1120
+ }
1121
+ ),
1122
+ /* @__PURE__ */ e.jsx(
1123
+ "path",
1124
+ {
1125
+ fillRule: "evenodd",
1126
+ clipRule: "evenodd",
1127
+ d: "M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",
1128
+ fill: "currentColor"
1129
+ }
1130
+ )
1131
+ ] }),
1132
+ absolute: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1133
+ /* @__PURE__ */ e.jsx(
1134
+ "path",
1135
+ {
1136
+ opacity: "0.6",
1137
+ fillRule: "evenodd",
1138
+ clipRule: "evenodd",
1139
+ d: "M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",
1140
+ fill: "currentColor"
1141
+ }
1142
+ ),
1143
+ /* @__PURE__ */ e.jsx(
1144
+ "path",
1145
+ {
1146
+ fillRule: "evenodd",
1147
+ clipRule: "evenodd",
1148
+ d: "M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",
1149
+ fill: "currentColor"
1150
+ }
1151
+ )
1152
+ ] }),
1153
+ relative: () => /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e.jsx(
1154
+ "path",
1155
+ {
1156
+ fillRule: "evenodd",
1157
+ clipRule: "evenodd",
1158
+ d: "M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",
1159
+ fill: "currentColor"
1160
+ }
1161
+ ) }),
1162
+ sticky: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1163
+ /* @__PURE__ */ e.jsx(
1164
+ "path",
1165
+ {
1166
+ d: "M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",
1167
+ fill: "currentColor"
1168
+ }
1169
+ ),
1170
+ /* @__PURE__ */ e.jsx(
1171
+ "path",
1172
+ {
1173
+ opacity: "0.6",
1174
+ fillRule: "evenodd",
1175
+ clipRule: "evenodd",
1176
+ d: "M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",
1177
+ fill: "currentColor"
1178
+ }
1179
+ )
1180
+ ] }),
1181
+ static: Pt
1182
+ }, oe = Oe({ canReset: !1, canChange: !0 }), Wr = ({ children: r, canReset: l = !1, canChange: t = !0 }) => (
1183
+ // eslint-disable-next-line react/jsx-no-constructed-context-values
1184
+ /* @__PURE__ */ e.jsx(oe.Provider, { value: { canReset: l, canChange: t }, children: r })
1185
+ ), at = ({ label: r, property: l, onChange: t }) => {
1186
+ const o = _(() => g(he, `${l}.classes`, [""]), [l]), s = ae(l), d = _(() => g(s, "cls", ""), [s]), { canChange: a } = le(oe), c = /\[.*\]/g.test(d);
1187
+ return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded " : "grow", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
1188
+ /* @__PURE__ */ e.jsx(pr, { className: "w-[70%] rounded py-1", readOnly: !0, value: d }),
1189
+ /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
1190
+ /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(_e, {}) }) }),
1191
+ /* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind arbitrary value." })
1192
+ ] })
1193
+ ] }) : /* @__PURE__ */ e.jsx(
1194
+ ke,
1195
+ {
1196
+ rounded: r,
1197
+ onChange: (i) => t(i, l),
1198
+ selected: d,
1199
+ options: o,
1200
+ disabled: !a
1201
+ }
1202
+ ) });
1203
+ };
1204
+ function ke({ selected: r, onChange: l, rounded: t = !1, options: o, disabled: s = !1 }) {
1205
+ const d = r.replace(/.*:/g, "").trim(), { undo: a, redo: c } = We();
1206
+ return /* @__PURE__ */ e.jsxs(
1207
+ "select",
1208
+ {
1209
+ disabled: !o.length || s,
1210
+ className: `${t ? "rounded-md border border-border" : "border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
1211
+ onChange: (i) => l(i.target.value),
1212
+ onKeyDown: (i) => {
1213
+ i.ctrlKey && (i.key === "z" && a(), i.key === "y" && c());
1214
+ },
1215
+ value: d,
1216
+ children: [
1217
+ /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
1218
+ $.Children.toArray(
1219
+ o.map((i) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: i, children: i }))
1220
+ )
1221
+ ]
1222
+ }
1223
+ );
1224
+ }
1225
+ const Ur = ({ property: r, onChange: l }) => {
1226
+ const { canReset: t, canChange: o } = le(oe), s = ae(r), d = _(() => g(s, "cls", ""), [s]), a = _(() => g(he, `${r}.classes`, [""]), [r]), c = a.indexOf(d) > -1 ? a.indexOf(d) : 0, i = /\[.*\]/g.test(d);
1227
+ return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: i ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: d }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1228
+ /* @__PURE__ */ e.jsx(
1229
+ "button",
1230
+ {
1231
+ type: "button",
1232
+ className: "box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",
1233
+ disabled: !o && (!t || c - 1 < 0),
1234
+ onClick: () => l(Ve(a, c - 1), r),
1235
+ children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1236
+ At,
1237
+ {
1238
+ className: !o && (!t || c - 1 < 0) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1239
+ }
1240
+ ) })
1241
+ }
1242
+ ),
1243
+ /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(at, { label: !1, property: r, onChange: l }) }),
1244
+ /* @__PURE__ */ e.jsx(
1245
+ "button",
1246
+ {
1247
+ type: "button",
1248
+ className: "w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",
1249
+ disabled: !o && (!t || c + 1 >= a.length),
1250
+ onClick: () => l(Ve(a, c + 1), r),
1251
+ children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
1252
+ Ne,
1253
+ {
1254
+ className: !o && (!t || c + 1 >= a.length) ? "text-gray-500" : "text-black/60 dark:text-white/60"
1255
+ }
1256
+ ) })
1257
+ }
1258
+ )
1259
+ ] }) });
1260
+ }, Kr = ({ property: r, onChange: l }) => {
1261
+ const t = _(() => g(he, `${r}.classes`, [""]), [r]), { canChange: o } = le(oe), s = ae(r), d = _(() => g(s, "cls", ""), [s]);
1262
+ return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: C(t, (a) => /* @__PURE__ */ e.jsxs(X, { children: [
1263
+ /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1264
+ "button",
1265
+ {
1266
+ type: "button",
1267
+ disabled: !o,
1268
+ onClick: () => l(a, r),
1269
+ className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${d === a ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
1270
+ children: $.createElement(g(ot, a, Fe))
1271
+ }
1272
+ ) }),
1273
+ /* @__PURE__ */ e.jsx(Z, { children: Y(se(a)) })
1274
+ ] })) });
1275
+ }, qr = {
1276
+ backgroundColor: "bg",
1277
+ textColor: "text",
1278
+ borderColor: "border",
1279
+ boxShadowColor: "shadow",
1280
+ outlineColor: "outline",
1281
+ divideColor: "divide",
1282
+ fromColor: "from",
1283
+ viaColor: "via",
1284
+ toColor: "to",
1285
+ ringColor: "ring",
1286
+ ringOffsetColor: "ring-offset"
1287
+ }, Gr = ({ property: r, onChange: l }) => {
1288
+ const t = ae(r), o = _(() => g(t, "cls", ""), [t]), { canChange: s } = le(oe), [d, a] = j([]), [c, i] = j({ color: "", shade: "" }), p = o.split("-"), h = g(p, "1", ""), n = g(p, "2", ""), y = B(
1289
+ // eslint-disable-next-line no-shadow
1290
+ (u) => {
1291
+ ["current", "inherit", "transparent", "black", "white"].includes(u) ? (a([]), i({ color: u })) : (a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), i((f) => ({ ...f, color: u, shade: f.shade ? f.shade : "500" })));
1292
+ },
1293
+ [a, i]
1294
+ );
1295
+ M(() => {
1296
+ if (["current", "inherit", "transparent", "black", "white"].includes(h))
1297
+ return a([]);
1298
+ a(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
1299
+ }, [h]);
1300
+ const x = B(
1301
+ // eslint-disable-next-line no-shadow
1302
+ (u) => {
1303
+ i({ color: h, shade: u });
1304
+ },
1305
+ [h]
1306
+ );
1307
+ return M(() => {
1308
+ i({ color: "", shade: "" });
1309
+ }, [t]), M(() => {
1310
+ const f = `${g(qr, r, "")}-${c.color}${c.shade ? `-${c.shade}` : ""}`;
1311
+ f.match(new RegExp(g(he, `${r}.regExp`, ""))) && l(f, r);
1312
+ }, [c, l, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
1313
+ /* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
1314
+ ke,
1315
+ {
1316
+ disabled: !s,
1317
+ rounded: !0,
1318
+ selected: h,
1319
+ onChange: y,
1320
+ options: [
1321
+ "current",
1322
+ "transparent",
1323
+ "primary",
1324
+ "secondary",
1325
+ "black",
1326
+ "white",
1327
+ "slate",
1328
+ "gray",
1329
+ "zinc",
1330
+ "neutral",
1331
+ "stone",
1332
+ "red",
1333
+ "orange",
1334
+ "amber",
1335
+ "yellow",
1336
+ "lime",
1337
+ "green",
1338
+ "emerald",
1339
+ "teal",
1340
+ "cyan",
1341
+ "sky",
1342
+ "blue",
1343
+ "indigo",
1344
+ "violet",
1345
+ "purple",
1346
+ "fuchsia",
1347
+ "pink",
1348
+ "rose"
1349
+ ]
1350
+ }
1351
+ ) }),
1352
+ /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ke, { rounded: !0, selected: n, disabled: !h || !s, onChange: x, options: d }) })
1353
+ ] });
1354
+ }, Ae = (r, l) => {
1355
+ r = r.toLowerCase();
1356
+ let t = r.trim().replace(/ |\+/g, "");
1357
+ if ((t === "auto" || t === "none") && l.includes(t))
1358
+ return { value: "", unit: t };
1359
+ const o = l.length ? new RegExp(l.join("|"), "g") : /XXXXXX/g;
1360
+ t = t.replace(o, "");
1361
+ const s = r.match(o), d = s && s.length > 1, a = !m(t) && Number.isNaN(Number(t));
1362
+ return d || a ? { error: "Invalid value" } : s && (s[0] === "auto" || s[0] === "none") ? { value: s[0], unit: "" } : { value: t, unit: s ? s[0] : "" };
1363
+ };
1364
+ const Jr = (r) => {
1365
+ const l = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1366
+ if (["auto", "none"].includes(t))
1367
+ return { value: "", unit: t };
1368
+ if (t === "px")
1369
+ return { value: "1", unit: "px" };
1370
+ if (t === "screen")
1371
+ return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
1372
+ if (t === "full")
1373
+ return { value: "100", unit: "%" };
1374
+ if (A(r, "skew-"))
1375
+ return { value: `${l}${t}`, unit: "deg" };
1376
+ if (A(r, "rotate-"))
1377
+ return { value: `${l}${t}`, unit: "deg" };
1378
+ if (A(r, "opacity-"))
1379
+ return { value: `${t / 100}`, unit: "-" };
1380
+ if (A(r, "duration-") || A(r, "delay-"))
1381
+ return { value: `${t}`, unit: "ms" };
1382
+ if (A(r, "translate-") && !t.includes("/"))
1383
+ return { value: `${l}${`${t / 4}`}`, unit: "rem" };
1384
+ if (A(r, "scale-"))
1385
+ return { value: `${l}${`${t / 100}`}`, unit: "-" };
1386
+ if (W(r, "border")) {
1387
+ const o = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1388
+ if (o)
1389
+ return { value: o[0].split("-").pop(), unit: "px" };
1390
+ if (r.match(/border-?(x|y|t|r|b|l)?/g))
1391
+ return { value: "1", unit: "px" };
1392
+ }
1393
+ if (W(r, "max-w-")) {
1394
+ if (r === "max-w-screen-sm")
1395
+ return { value: "640", unit: "px" };
1396
+ if (r === "max-w-screen-md")
1397
+ return { value: "768", unit: "px" };
1398
+ if (r === "max-w-screen-lg")
1399
+ return { value: "1024", unit: "px" };
1400
+ if (r === "max-w-screen-xl")
1401
+ return { value: "1280", unit: "px" };
1402
+ if (r === "max-w-screen-2xl")
1403
+ return { value: "1536", unit: "px" };
1404
+ if (t === "xs")
1405
+ return { value: "320", unit: "px" };
1406
+ if (t === "sm")
1407
+ return { value: "384", unit: "px" };
1408
+ if (t === "md")
1409
+ return { value: "448", unit: "px" };
1410
+ if (t === "lg")
1411
+ return { value: "512", unit: "px" };
1412
+ if (t === "xl")
1413
+ return { value: "576", unit: "px" };
1414
+ if (t === "2xl")
1415
+ return { value: "672", unit: "px" };
1416
+ if (t === "3xl")
1417
+ return { value: "768", unit: "px" };
1418
+ if (t === "4xl")
1419
+ return { value: "896", unit: "px" };
1420
+ if (t === "5xl")
1421
+ return { value: "1024", unit: "px" };
1422
+ if (t === "6xl")
1423
+ return { value: "1152", unit: "px" };
1424
+ if (t === "7xl")
1425
+ return { value: "1280", unit: "px" };
1426
+ if (t === "prose")
1427
+ return { value: "65", unit: "ch" };
1428
+ }
1429
+ if (W(r, "text-")) {
1430
+ if (t === "xs")
1431
+ return { value: "12", unit: "px" };
1432
+ if (t === "sm")
1433
+ return { value: "14", unit: "px" };
1434
+ if (t === "base")
1435
+ return { value: "16", unit: "px" };
1436
+ if (t === "lg")
1437
+ return { value: "18", unit: "px" };
1438
+ if (t === "xl")
1439
+ return { value: "20", unit: "px" };
1440
+ if (t === "2xl")
1441
+ return { value: "24", unit: "px" };
1442
+ if (t === "3xl")
1443
+ return { value: "30", unit: "px" };
1444
+ if (t === "4xl")
1445
+ return { value: "36", unit: "px" };
1446
+ if (t === "5xl")
1447
+ return { value: "48", unit: "px" };
1448
+ if (t === "6xl")
1449
+ return { value: "60", unit: "px" };
1450
+ if (t === "7xl")
1451
+ return { value: "72", unit: "px" };
1452
+ if (t === "8xl")
1453
+ return { value: "96", unit: "px" };
1454
+ if (t === "9xl")
1455
+ return { value: "128", unit: "px" };
1456
+ }
1457
+ if (W(r, "leading-")) {
1458
+ if (t === "none")
1459
+ return { value: "1", unit: "-" };
1460
+ if (t === "tight")
1461
+ return { value: "1.25", unit: "-" };
1462
+ if (t === "snug")
1463
+ return { value: "1.375", unit: "-" };
1464
+ if (t === "normal")
1465
+ return { value: "1.5", unit: "-" };
1466
+ if (t === "relaxed")
1467
+ return { value: "1.625", unit: "-" };
1468
+ if (t === "loose")
1469
+ return { value: "2", unit: "-" };
1470
+ }
1471
+ if (W(r, "tracking-")) {
1472
+ if (t === "tighter")
1473
+ return { value: "-0.05", unit: "em" };
1474
+ if (t === "tight")
1475
+ return { value: "-0.025", unit: "em" };
1476
+ if (t === "normal")
1477
+ return { value: "0", unit: "em" };
1478
+ if (t === "wide")
1479
+ return { value: "0.025", unit: "em" };
1480
+ if (t === "wider")
1481
+ return { value: "0.05", unit: "em" };
1482
+ if (t === "widest")
1483
+ return { value: "0.1", unit: "em" };
1484
+ }
1485
+ if (["max", "min", "fit"].includes(t))
1486
+ return { value: r, unit: "class" };
1487
+ if (t.includes("/")) {
1488
+ const [o, s] = C(t.split("/"), (d) => parseInt(d, 10));
1489
+ return { value: l + (o / s * 100).toFixed(2).replace(".00", ""), unit: "%" };
1490
+ }
1491
+ return ft(parseFloat(t)) ? { value: `${l + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1492
+ };
1493
+ const Qr = (r) => {
1494
+ if (m(r))
1495
+ return { value: "", unit: "" };
1496
+ const l = r.match(/\[.*\]/g);
1497
+ if (l === null)
1498
+ return es(r);
1499
+ const t = g(l, "0", "").replace(/\[|\]/g, ""), o = r.startsWith("-") ? "-" : "", s = ge(t.match(/\d+.\d+|\d+/g));
1500
+ return { value: `${o}${s}`, unit: t.replace(s, "") };
1501
+ }, es = (r) => m(r) ? { value: "", unit: "" } : Jr(r), nt = $.createContext({
1502
+ setDragData: () => {
1503
+ }
1504
+ }), ts = ({
1505
+ unit: r,
1506
+ currentValue: l,
1507
+ onDrag: t,
1508
+ onDragEnd: o,
1509
+ onDragStart: s,
1510
+ negative: d,
1511
+ cssProperty: a
1512
+ }) => {
1513
+ const { setDragData: c } = le(nt);
1514
+ return /* @__PURE__ */ e.jsx(
1515
+ "button",
1516
+ {
1517
+ type: "button",
1518
+ onMouseDown: (i) => {
1519
+ const p = {
1520
+ onDrag: t,
1521
+ onDragEnd: o,
1522
+ dragging: !0,
1523
+ dragStartY: i.pageY,
1524
+ dragStartValue: `${l}`,
1525
+ dragUnit: r,
1526
+ negative: d,
1527
+ cssProperty: a
1528
+ };
1529
+ s(p), c(p);
1530
+ },
1531
+ color: void 0,
1532
+ className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
1533
+ children: /* @__PURE__ */ e.jsx(Lt, {})
1534
+ }
1535
+ );
1536
+ }, rs = ({ onSelect: r, current: l, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((o) => /* @__PURE__ */ e.jsx(
1537
+ xe,
1538
+ {
1539
+ className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
1540
+ color: l === o ? "primary" : void 0,
1541
+ size: "sm",
1542
+ onClick: (s) => {
1543
+ s.stopPropagation(), r(o);
1544
+ },
1545
+ children: o
1546
+ },
1547
+ o
1548
+ )) }), Le = 50, ss = (r) => {
1549
+ const [l, t] = j(!1), [o, s] = j(""), { currentClass: d, onChange: a, classPrefix: c, cssProperty: i, units: p, negative: h } = r, [n, y] = j(i != null && i.toLowerCase().includes("width") ? "%" : p[0]), [x, u] = j(!1), [f, k] = j(""), [L, w] = j(!1), [I, E] = j(!1);
1550
+ M(() => {
1551
+ const { value: b, unit: v } = Qr(d);
1552
+ if (v === "") {
1553
+ s(b), y(i != null && i.toLowerCase().includes("width") ? "%" : ge(p));
1554
+ return;
1555
+ }
1556
+ y(v), s(v === "class" || m(b) ? "" : b);
1557
+ }, [d, i, p]);
1558
+ const N = ve((b) => a(b), [a], Le), D = ve((b) => a(b, !1), [a], Le), z = B(
1559
+ (b = !1) => {
1560
+ const v = Ae(`${o}`, p);
1561
+ if (g(v, "error", !1)) {
1562
+ u(!0);
1563
+ return;
1564
+ }
1565
+ const S = g(v, "unit") !== "" ? g(v, "unit") : n;
1566
+ if (S === "auto" || S === "none") {
1567
+ N(`${c}${S}`);
1568
+ return;
1569
+ }
1570
+ if (g(v, "value") === "")
1571
+ return;
1572
+ const J = `${g(v, "value", "").startsWith("-") ? "-" : ""}${c}[${g(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1573
+ b ? D(J) : N(J);
1574
+ },
1575
+ [N, D, o, n, c, p]
1576
+ ), G = B(
1577
+ (b) => {
1578
+ const v = Ae(`${o}`, p);
1579
+ if (g(v, "error", !1)) {
1580
+ u(!0);
1581
+ return;
1582
+ }
1583
+ if (b === "auto" || b === "none") {
1584
+ N(`${c}${b}`);
1585
+ return;
1586
+ }
1587
+ if (g(v, "value") === "")
1588
+ return;
1589
+ const S = g(v, "unit") !== "" ? g(v, "unit") : b, J = `${g(v, "value", "").startsWith("-") ? "-" : ""}${c}[${g(v, "value", "").replace("-", "")}${S === "-" ? "" : S}]`;
1590
+ N(J);
1591
+ },
1592
+ [N, o, c, p]
1593
+ );
1594
+ return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: n === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1595
+ /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: d }),
1596
+ /* @__PURE__ */ e.jsxs(X, { children: [
1597
+ /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(_e, {}) }) }),
1598
+ /* @__PURE__ */ e.jsx(Z, { children: "Current value is using a Tailwind preset class." })
1599
+ ] })
1600
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${L ? "z-auto" : ""}`, children: [
1601
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
1602
+ ["none", "auto"].indexOf(n) !== -1 ? null : /* @__PURE__ */ e.jsx(
1603
+ "input",
1604
+ {
1605
+ readOnly: n === "class",
1606
+ onKeyPress: (b) => {
1607
+ b.key === "Enter" && z();
1608
+ },
1609
+ onKeyDown: (b) => {
1610
+ if (b.keyCode !== 38 && b.keyCode !== 40)
1611
+ return;
1612
+ b.preventDefault(), E(!0);
1613
+ const v = vt(b.target.value);
1614
+ let S = ze(v) ? 0 : v;
1615
+ b.keyCode === 38 && (S += 1), b.keyCode === 40 && (S -= 1);
1616
+ const O = `${S}`, dt = `${O.startsWith("-") ? "-" : ""}${c}[${O.replace("-", "")}${n === "-" ? "" : n}]`;
1617
+ D(dt);
1618
+ },
1619
+ onKeyUp: (b) => {
1620
+ I && (b.preventDefault(), E(!1));
1621
+ },
1622
+ onBlur: () => z(),
1623
+ onChange: (b) => {
1624
+ u(!1), s(b.target.value);
1625
+ },
1626
+ onClick: (b) => {
1627
+ var v;
1628
+ (v = b == null ? void 0 : b.target) == null || v.select(), t(!1);
1629
+ },
1630
+ value: L ? f : o,
1631
+ className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
1632
+ " ",
1633
+ x ? "border-red-500 text-red-500" : "border-foreground/20"
1634
+ )
1635
+ }
1636
+ ),
1637
+ /* @__PURE__ */ e.jsxs(X, { open: l, delayDuration: 100, children: [
1638
+ /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1639
+ "button",
1640
+ {
1641
+ type: "button",
1642
+ onClick: () => t(!l),
1643
+ className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
1644
+ children: [
1645
+ /* @__PURE__ */ e.jsx("span", { className: `inline-block ${p.length === 1 ? "px-2 font-semibold" : ""}`, children: n }),
1646
+ p.length > 1 ? /* @__PURE__ */ e.jsx(Et, {}) : null
1647
+ ]
1648
+ }
1649
+ ) }),
1650
+ /* @__PURE__ */ e.jsx(ur, { children: /* @__PURE__ */ e.jsx(Z, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1651
+ rs,
1652
+ {
1653
+ units: p,
1654
+ current: n,
1655
+ onSelect: (b) => {
1656
+ t(!1), y(b), G(b);
1657
+ }
1658
+ }
1659
+ ) }) })
1660
+ ] })
1661
+ ] }),
1662
+ ["none", "auto"].indexOf(n) !== -1 || L ? null : /* @__PURE__ */ e.jsx(
1663
+ ts,
1664
+ {
1665
+ onDragStart: () => w(!0),
1666
+ onDragEnd: (b) => {
1667
+ if (k(() => ""), w(!1), m(b))
1668
+ return;
1669
+ const v = `${b}`, O = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${n === "-" ? "" : n}]`;
1670
+ N(O);
1671
+ },
1672
+ onDrag: (b) => {
1673
+ if (m(b))
1674
+ return;
1675
+ k(b);
1676
+ const v = `${b}`, O = `${v.startsWith("-") ? "-" : ""}${c}[${v.replace("-", "")}${n === "-" ? "" : n}]`;
1677
+ D(O);
1678
+ },
1679
+ currentValue: o,
1680
+ unit: n,
1681
+ negative: h,
1682
+ cssProperty: i
1683
+ }
1684
+ )
1685
+ ] }) }) });
1686
+ }, ae = (r) => {
1687
+ const l = ye();
1688
+ return wt(l, { property: r });
1689
+ }, ls = (r, l) => {
1690
+ const t = {
1691
+ xs: 0,
1692
+ sm: 1,
1693
+ md: 2,
1694
+ lg: 3,
1695
+ xl: 4,
1696
+ "2xl": 5
1697
+ };
1698
+ return t[g(r, "mq", "xs")] <= t[l];
1699
+ }, os = {
1700
+ width: "w-",
1701
+ height: "h-",
1702
+ minWidth: "min-w-",
1703
+ minHeight: "min-h-",
1704
+ maxWidth: "max-w-",
1705
+ maxHeight: "max-h-",
1706
+ zIndex: "z-",
1707
+ gap: "gap-",
1708
+ gapX: "gap-x-",
1709
+ gapY: "gap-y-",
1710
+ margin: "m-",
1711
+ marginX: "mx-",
1712
+ marginY: "my-",
1713
+ marginTop: "mt-",
1714
+ marginBottom: "mb-",
1715
+ marginLeft: "ml-",
1716
+ marginRight: "mr-",
1717
+ padding: "p-",
1718
+ paddingX: "px-",
1719
+ paddingY: "py-",
1720
+ paddingTop: "pt-",
1721
+ paddingBottom: "pb-",
1722
+ paddingLeft: "pl-",
1723
+ paddingRight: "pr-",
1724
+ spaceX: "space-x-",
1725
+ spaceY: "space-y-",
1726
+ border: "border-",
1727
+ borderTop: "border-t-",
1728
+ borderBottom: "border-b-",
1729
+ borderLeft: "border-l-",
1730
+ borderRight: "border-r-",
1731
+ borderX: "border-x-",
1732
+ borderY: "border-y-",
1733
+ borderRadius: "rounded-",
1734
+ borderRadiusTop: "rounded-t-",
1735
+ borderRadiusRight: "rounded-r-",
1736
+ borderRadiusBottom: "rounded-b-",
1737
+ borderRadiusLeft: "rounded-l-",
1738
+ borderRadiusTopLeft: "rounded-tl-",
1739
+ borderRadiusTopRight: "rounded-tr-",
1740
+ borderRadiusBottomRight: "rounded-br-",
1741
+ borderRadiusBottomLeft: "rounded-bl-",
1742
+ fontSize: "text-",
1743
+ lineHeight: "leading-",
1744
+ letterSpacing: "tracking-",
1745
+ textIndent: "indent-",
1746
+ rotate: "rotate-",
1747
+ duration: "duration-",
1748
+ transitionDelay: "delay-",
1749
+ scale: "scale-",
1750
+ scaleX: "scale-x-",
1751
+ scaleY: "scale-y-",
1752
+ translateX: "translate-x-",
1753
+ translateY: "translate-y-",
1754
+ skewX: "skew-x-",
1755
+ skewY: "skew-y-",
1756
+ top: "top-",
1757
+ bottom: "bottom-",
1758
+ left: "left-",
1759
+ right: "right-",
1760
+ inset: "inset-",
1761
+ insetX: "inset-x-",
1762
+ insetY: "inset-y-",
1763
+ opacity: "opacity-",
1764
+ flexBasis: "basis-"
1765
+ }, Ee = {
1766
+ xs: "",
1767
+ sm: "640px",
1768
+ md: "768px",
1769
+ lg: "1024px",
1770
+ xl: "1280px",
1771
+ "2xl": "1536px"
1772
+ }, as = (r) => `${r.toUpperCase()} ${Ee[r] ? `(${Ee[r]} & up)` : ""}`, Re = (r) => {
1773
+ const { t: l } = K(), { type: t = "icons", label: o, property: s, onEmitChange: d = () => {
1774
+ }, units: a, negative: c = !1 } = r, [i] = gr(), [p] = Qe(), [, h] = Be(), n = ae(s), y = qe(), x = Ge(), [u] = Je(), f = _(() => g(n, "fullCls", ""), [n]), k = B(
1775
+ (D, z = !0) => {
1776
+ const G = { dark: i, mq: h, mod: p, cls: D, property: s, fullCls: "" };
1777
+ (i || p !== "") && (G.mq = "xs");
1778
+ const b = $r(G);
1779
+ y(u, [b], z);
1780
+ },
1781
+ [u, i, h, p, s, y]
1782
+ ), L = B(() => {
1783
+ x(u, [f]);
1784
+ }, [u, f, x]), w = _(() => ls(n, h), [n, h]);
1785
+ M(() => {
1786
+ d(w, n);
1787
+ }, [w, d, n]);
1788
+ const [, , I] = Be(), E = B(
1789
+ (D) => {
1790
+ I({
1791
+ xs: 400,
1792
+ sm: 640,
1793
+ md: 800,
1794
+ lg: 1024,
1795
+ xl: 1420,
1796
+ "2xl": 1920
1797
+ }[D]);
1798
+ },
1799
+ [I]
1800
+ ), N = g(n, "dark", null) === i && g(n, "mod", null) === p && g(n, "mq", null) === h;
1801
+ return /* @__PURE__ */ e.jsx(Wr, { canChange: w, canReset: n && N, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1802
+ /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${n && !N ? "text-foreground" : ""}`, children: l(o) }) }),
1803
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
1804
+ /* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
1805
+ t === "arbitrary" ? /* @__PURE__ */ e.jsx(
1806
+ ss,
1807
+ {
1808
+ currentClass: g(n, "cls", ""),
1809
+ classPrefix: g(os, s, ""),
1810
+ units: a || [],
1811
+ onChange: k,
1812
+ negative: c,
1813
+ cssProperty: s
1814
+ }
1815
+ ) : null,
1816
+ t === "icons" && /* @__PURE__ */ e.jsx(Kr, { property: s, onChange: k }),
1817
+ t === "range" && /* @__PURE__ */ e.jsx(Ur, { property: s, onChange: k }),
1818
+ t === "color" && /* @__PURE__ */ e.jsx(Gr, { property: s, onChange: k }),
1819
+ t === "dropdown" && /* @__PURE__ */ e.jsx(at, { label: o, property: s, onChange: k })
1820
+ ] }),
1821
+ /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${f ? "visible" : "invisible"}`, children: N ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => L(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Ot, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : w && n ? /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
1822
+ /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1823
+ "button",
1824
+ {
1825
+ type: "button",
1826
+ className: "invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",
1827
+ children: /* @__PURE__ */ e.jsx(_e, {})
1828
+ }
1829
+ ) }),
1830
+ /* @__PURE__ */ e.jsx(Z, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
1831
+ "Current style is set at  ",
1832
+ /* @__PURE__ */ e.jsxs("span", { className: "font-bold ", children: [
1833
+ as(g(n, "mq")),
1834
+ i && !n.dark ? "(Light mode)" : ""
1835
+ ] }),
1836
+ /* @__PURE__ */ e.jsx("br", {}),
1837
+ /* @__PURE__ */ e.jsxs(
1838
+ "button",
1839
+ {
1840
+ type: "button",
1841
+ onClick: () => E(g(n, "mq")),
1842
+ className: "block w-full cursor-default text-right font-semibold text-blue-500",
1843
+ children: [
1844
+ "Switch to ",
1845
+ g(n, "mq").toUpperCase()
1846
+ ]
1847
+ }
1848
+ )
1849
+ ] }) }) })
1850
+ ] }) : null })
1851
+ ] })
1852
+ ] }) });
1853
+ }, ns = ["px", "%", "em", "rem", "ch", "vh", "vw"], it = ({
1854
+ label: r,
1855
+ options: l,
1856
+ borderB: t = !1,
1857
+ borderT: o = !1,
1858
+ type: s = "arbitrary",
1859
+ units: d = ns,
1860
+ negative: a = !1
1861
+ }) => {
1862
+ const { t: c } = K(), [i, p] = j(l[0].key), h = ye(), n = B((y) => C(h, "property").includes(y), [h]);
1863
+ return /* @__PURE__ */ e.jsxs(
1864
+ "div",
1865
+ {
1866
+ className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${o ? "border-t" : ""}`,
1867
+ children: [
1868
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
1869
+ r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: c(r) }),
1870
+ /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
1871
+ l.map(({ label: y, key: x }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(X, { children: [
1872
+ /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1873
+ "button",
1874
+ {
1875
+ type: "button",
1876
+ onClick: () => p(x),
1877
+ className: `relative cursor-pointer rounded-full p-1 text-[8px] ${x === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1878
+ children: [
1879
+ $.createElement("div", {
1880
+ className: n(x) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1881
+ }),
1882
+ $.createElement(g(ot, x, Fe), { className: "text-inherit w-3 h-3" })
1883
+ ]
1884
+ }
1885
+ ) }),
1886
+ /* @__PURE__ */ e.jsx(Z, { children: Y(se(y)) })
1887
+ ] }) }))
1888
+ ) })
1889
+ ] }),
1890
+ /* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
1891
+ Re,
1892
+ {
1893
+ type: s,
1894
+ units: [...d],
1895
+ label: "",
1896
+ property: i,
1897
+ negative: a
1898
+ }
1899
+ ) })
1900
+ ]
1901
+ }
1902
+ );
1903
+ }, is = ({ heading: r, items: l }) => {
1904
+ const { t } = K(), o = ye(), s = _(() => {
1905
+ const d = (i) => U(
1906
+ i.map((p) => p.styleType === "multiple" ? C(p.options, "key") : p.property)
1907
+ ), a = U(
1908
+ l.map((i) => i.styleType === "accordion" ? d(i.items) : i.styleType === "multiple" ? C(i.options, "key") : i.property)
1909
+ ), c = C(o, "property");
1910
+ return Ye(a, c).length > 0;
1911
+ }, [o, l]);
1912
+ return /* @__PURE__ */ e.jsxs("details", { children: [
1913
+ /* @__PURE__ */ e.jsx("summary", { className: "my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground", children: /* @__PURE__ */ e.jsxs("div", { className: "inline", children: [
1914
+ t(r),
1915
+ s ? /* @__PURE__ */ e.jsx(
1916
+ "span",
1917
+ {
1918
+ className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${s ? "bg-blue-500" : "bg-gray-300"}`
1919
+ }
1920
+ ) : null
1921
+ ] }) }),
1922
+ /* @__PURE__ */ e.jsx("div", { className: "p-2", children: l.map((d) => d.styleType === "multiple" ? /* @__PURE__ */ e.jsx(it, { ...d }, d.label) : /* @__PURE__ */ e.jsx(Re, { ...d }, d.label)) })
1923
+ ] });
1924
+ }, ds = Oe({}), fe = ({ section: r }) => {
1925
+ const { t: l } = K(), t = ye(), o = B(
1926
+ (a = []) => {
1927
+ const c = {};
1928
+ for (let p = 0; p < t.length; p++)
1929
+ c[t[p].property] = t[p].cls;
1930
+ let i = !0;
1931
+ for (const p in a)
1932
+ if (!be(c, p) || c[p] !== a[p]) {
1933
+ i = !1;
1934
+ break;
1935
+ }
1936
+ return i;
1937
+ },
1938
+ [t]
1939
+ ), s = _(() => {
1940
+ if (t.length > 0 && r.heading === "classes.heading")
1941
+ return !0;
1942
+ const a = (p) => U(
1943
+ p.map((h) => h.styleType === "multiple" ? U(C(h.options, "key")) : h.property)
1944
+ ), c = U(
1945
+ r.items.map((p) => p.styleType === "accordion" ? a(p.items) : p.styleType === "multiple" ? U(C(p.options, "key")) : p.property)
1946
+ ), i = C(t, "property");
1947
+ return Ye(c, i).length > 0;
1948
+ }, [t, r.heading, r.items]), d = _(() => ({}), []);
1949
+ return /* @__PURE__ */ e.jsx(ds.Provider, { value: d, children: /* @__PURE__ */ e.jsxs(de, { value: r.heading, children: [
1950
+ /* @__PURE__ */ e.jsx(ce, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
1951
+ /* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${s ? "bg-blue-500" : "bg-gray-300"}` }),
1952
+ l(r.heading)
1953
+ ] }) }),
1954
+ /* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children: $.Children.toArray(
1955
+ r.items.map((a) => be(a, "component") ? $.createElement(a.component, { key: a.label }) : be(a, "styleType") ? a.styleType === "multiple" ? /* @__PURE__ */ e.jsx(it, { ...a }, a.label) : a.styleType === "accordion" && o(a == null ? void 0 : a.conditions) ? /* @__PURE__ */ e.jsx(is, { ...a }, a.label) : null : /* @__PURE__ */ e.jsx(Re, { ...a }, a.label))
1956
+ ) })
1957
+ ] }) });
1958
+ }, cs = ({
1959
+ item: r,
1960
+ index: l,
1961
+ canDelete: t,
1962
+ onChange: o,
1963
+ onRemove: s
1964
+ }) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${t ? "border-b" : ""}`, children: [
1965
+ /* @__PURE__ */ e.jsx(
1966
+ "input",
1967
+ {
1968
+ name: "key",
1969
+ onChange: (d) => o(d, l),
1970
+ value: r.key,
1971
+ placeholder: "Key",
1972
+ className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
1973
+ autoComplete: "off",
1974
+ autoCapitalize: "off"
1975
+ }
1976
+ ),
1977
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-1.5", children: [
1978
+ /* @__PURE__ */ e.jsx(
1979
+ "input",
1980
+ {
1981
+ name: "value",
1982
+ onChange: (d) => m(r.key) ? {} : o(d, l),
1983
+ value: r.value,
1984
+ placeholder: "Value",
1985
+ className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
1986
+ autoComplete: "off",
1987
+ autoCapitalize: "off"
1988
+ }
1989
+ ),
1990
+ /* @__PURE__ */ e.jsx(
1991
+ Mt,
1992
+ {
1993
+ onClick: s,
1994
+ className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
1995
+ }
1996
+ )
1997
+ ] })
1998
+ ] }), ps = ({ section: r }) => {
1999
+ var y;
2000
+ const { setSyncState: l } = xr(), t = q(), [o, s] = j([]), [d] = Se(), a = Ue(), c = `${g(d, "0.prop")}_attrs`;
2001
+ ne.useEffect(() => {
2002
+ const x = C(g(t, c), (u, f) => ({ key: f, value: u }));
2003
+ m(x) ? s([]) : s(x);
2004
+ }, [g(t, c)]);
2005
+ const i = () => s([...o, { key: "", value: "" }]), p = (x) => {
2006
+ const u = je(o, (f, k) => x !== k);
2007
+ n(u);
2008
+ }, h = (x, u) => {
2009
+ const f = [...o];
2010
+ f[u][x.target.name] = x.target.value, n(f);
2011
+ }, n = ne.useCallback(
2012
+ (x = []) => {
2013
+ const u = {};
2014
+ ue(x, (f) => {
2015
+ m(f.key) || Me(u, f.key, f.value);
2016
+ }), a([g(t, "_id")], { [c]: u }), l("UNSAVED");
2017
+ },
2018
+ [t, l, a, c]
2019
+ );
2020
+ return /* @__PURE__ */ e.jsxs(de, { value: r.heading, children: [
2021
+ /* @__PURE__ */ e.jsx(ce, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
2022
+ /* @__PURE__ */ e.jsx(
2023
+ "div",
2024
+ {
2025
+ className: `h-[8px] w-[8px] rounded-full ${m(g(t, c)) ? "bg-gray-300" : "bg-blue-500"}`
2026
+ }
2027
+ ),
2028
+ "Attributes"
2029
+ ] }) }),
2030
+ /* @__PURE__ */ e.jsx(pe, { className: "bg-gray-100 px-3.5 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px", children: [
2031
+ /* @__PURE__ */ e.jsxs(Te, { className: "mt-2 flex w-full items-center justify-between", children: [
2032
+ "Add Custom attributes",
2033
+ /* @__PURE__ */ e.jsxs(
2034
+ "div",
2035
+ {
2036
+ className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!m(o) && m((y = we(o)) == null ? void 0 : y.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
2037
+ onClick: () => {
2038
+ var x;
2039
+ !m(o) && m((x = we(o)) == null ? void 0 : x.key) || i();
2040
+ },
2041
+ children: [
2042
+ /* @__PURE__ */ e.jsx(Ne, { width: 12, height: 12 }),
2043
+ " Add"
2044
+ ]
2045
+ }
2046
+ )
2047
+ ] }),
2048
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
2049
+ m(o) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
2050
+ ne.Children.toArray(
2051
+ C(o, (x, u) => {
2052
+ const f = o.length > 0 && u < o.length - 1;
2053
+ return /* @__PURE__ */ e.jsx(
2054
+ cs,
2055
+ {
2056
+ item: x,
2057
+ index: u,
2058
+ canDelete: f,
2059
+ onChange: h,
2060
+ onRemove: () => p(u)
2061
+ }
2062
+ );
2063
+ })
2064
+ )
2065
+ ] })
2066
+ ] }) })
2067
+ ] });
2068
+ };
2069
+ function us() {
2070
+ const [r, l] = Qe(), { flexChild: t, gridChild: o } = yr(), [, s] = Vr(hr), { t: d } = K(), [a] = Se();
2071
+ return m(a) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2072
+ /* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
2073
+ /* @__PURE__ */ e.jsx("h1", { children: d("no_styling_block_selected") }),
2074
+ /* @__PURE__ */ e.jsxs("p", { className: "text-xs ", children: [
2075
+ "Hint: Styling allowed blocks are highlighted with",
2076
+ " ",
2077
+ /* @__PURE__ */ e.jsx("span", { className: "border border-orange-500 p-px", children: "orange" }),
2078
+ " border"
2079
+ ] })
2080
+ ] }) }) : (
2081
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
2082
+ /* @__PURE__ */ e.jsxs("div", { onClick: () => s(!1), className: "flex h-full flex-col", children: [
2083
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-x-4 space-y-3 border-b h-12 border-border px-4 py-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
2084
+ /* @__PURE__ */ e.jsx(Te, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
2085
+ /* @__PURE__ */ e.jsxs(br, { defaultValue: r, onValueChange: (c) => l(c), children: [
2086
+ /* @__PURE__ */ e.jsx(mr, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(fr, { placeholder: "State" }) }),
2087
+ /* @__PURE__ */ e.jsxs(vr, { children: [
2088
+ /* @__PURE__ */ e.jsx(V, { value: "", children: "Normal" }),
2089
+ /* @__PURE__ */ e.jsx(V, { value: "hover", children: "Hover" }),
2090
+ /* @__PURE__ */ e.jsx(V, { value: "active", children: "Active" }),
2091
+ /* @__PURE__ */ e.jsx(V, { value: "focus", children: "Focus" }),
2092
+ /* @__PURE__ */ e.jsx(V, { value: "before", children: "Before" }),
2093
+ /* @__PURE__ */ e.jsx(V, { value: "after", children: "After" }),
2094
+ /* @__PURE__ */ e.jsx(V, { value: "only", children: "Only" }),
2095
+ /* @__PURE__ */ e.jsx(V, { value: "first", children: "First" }),
2096
+ /* @__PURE__ */ e.jsx(V, { value: "last", children: "Last" }),
2097
+ /* @__PURE__ */ e.jsx(V, { value: "first-letter", children: "First Letter" }),
2098
+ /* @__PURE__ */ e.jsx(V, { value: "first-line", children: "First Line" }),
2099
+ /* @__PURE__ */ e.jsx(V, { value: "disabled", children: "Disabled" })
2100
+ ] })
2101
+ ] })
2102
+ ] }) }),
2103
+ /* @__PURE__ */ e.jsx(et, { className: "no-scrollbar -mx-1 flex-1 max-h-full overflow-y-hidden overflow-x-hidden", children: /* @__PURE__ */ e.jsxs(Ke, { defaultValue: ["Layout"], type: "multiple", className: "w-full", children: [
2104
+ t && /* @__PURE__ */ e.jsx(fe, { section: Xr }),
2105
+ o ? /* @__PURE__ */ e.jsx(fe, { section: Fr }) : null,
2106
+ Zr.map((c) => /* @__PURE__ */ e.jsx(fe, { section: c }, c.heading)),
2107
+ /* @__PURE__ */ e.jsx(ps, { section: { heading: "Attributes" } })
2108
+ ] }) })
2109
+ ] })
2110
+ );
2111
+ }
2112
+ const gs = {
2113
+ px: 1,
2114
+ "%": 1,
2115
+ em: 100,
2116
+ rem: 100,
2117
+ ch: 1,
2118
+ vw: 1,
2119
+ vh: 1,
2120
+ "-": 1,
2121
+ deg: 1,
2122
+ ms: 0.1
2123
+ }, yl = () => {
2124
+ const r = q(), { t: l } = K(), [t, o] = $.useState(""), [s, d] = $.useState({
2125
+ onDrag: (i) => i,
2126
+ onDragEnd: (i) => i,
2127
+ dragStartY: 0,
2128
+ dragging: !1,
2129
+ dragStartValue: 0,
2130
+ dragUnit: "",
2131
+ negative: !1,
2132
+ cssProperty: ""
2133
+ }), a = ve(
2134
+ (i) => {
2135
+ const p = !g(s, "negative", !1), h = g(s, "cssProperty", "");
2136
+ let n = parseFloat(s.dragStartValue);
2137
+ n = ze(n) ? 0 : n;
2138
+ let y = gs[s.dragUnit];
2139
+ (W(h, "scale") || h === "opacity") && (y = 10);
2140
+ let u = (s.dragStartY - i.pageY) / y + n;
2141
+ p && u < 0 && (u = 0), h === "opacity" && u > 1 && (u = 1), s.onDrag(`${u}`), o(`${u}`);
2142
+ },
2143
+ [s],
2144
+ 50
2145
+ ), c = B(() => {
2146
+ setTimeout(() => s.onDragEnd(`${t}`), 100), d({
2147
+ onDrag: (i) => i,
2148
+ onDragEnd: (i) => i,
2149
+ dragStartY: 0,
2150
+ dragging: !1,
2151
+ dragStartValue: 0,
2152
+ dragUnit: "",
2153
+ negative: !1,
2154
+ cssProperty: ""
2155
+ });
2156
+ }, [s, t, d]);
2157
+ return jt(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
2158
+ /* @__PURE__ */ e.jsx(Ze, { className: "mx-auto text-3xl" }),
2159
+ /* @__PURE__ */ e.jsx("h1", { children: l("no_block_selected_for_styling") })
2160
+ ] }) }) : /* @__PURE__ */ e.jsx(rt, { children: /* @__PURE__ */ e.jsxs(nt.Provider, { value: { setDragData: d }, children: [
2161
+ s.dragging ? /* @__PURE__ */ e.jsx(
2162
+ "div",
2163
+ {
2164
+ onMouseMove: a,
2165
+ onMouseUp: () => c(),
2166
+ className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "
2167
+ }
2168
+ ) : null,
2169
+ /* @__PURE__ */ e.jsxs(wr, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
2170
+ /* @__PURE__ */ e.jsxs(jr, { className: "mx-1 grid grid-cols-2", children: [
2171
+ /* @__PURE__ */ e.jsx(De, { value: "settings", children: l("settings") }),
2172
+ /* @__PURE__ */ e.jsx(De, { value: "styling", children: l("styling") })
2173
+ ] }),
2174
+ /* @__PURE__ */ e.jsx(
2175
+ $e,
2176
+ {
2177
+ value: "settings",
2178
+ className: "no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",
2179
+ children: /* @__PURE__ */ e.jsx(et, { className: "no-scrollbar -mx-1 pb-5 flex-1 max-h-full overflow-y-hidden overflow-x-hidden", children: /* @__PURE__ */ e.jsx(zr, {}) })
2180
+ }
2181
+ ),
2182
+ /* @__PURE__ */ e.jsx($e, { value: "styling", className: "flex-1 h-full overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(us, {}) })
2183
+ ] })
2184
+ ] }) });
2185
+ };
2186
+ export {
2187
+ yl as default
2188
+ };