@chaibuilder/sdk 1.0.9 → 1.0.10

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 (162) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +123 -21
  3. package/dist/AddBlocks-tdvDe7xL.cjs +3 -0
  4. package/dist/{AddBlocks-d10b7b87.js → AddBlocks-xR2s2BVa.js} +47 -44
  5. package/dist/BrandingOptions-DpJ-oNnf.cjs +1 -0
  6. package/dist/{BrandingOptions-f4ab5d9f.js → BrandingOptions-cHK2bVZy.js} +14 -18
  7. package/dist/{CanvasArea-10356200.js → CanvasArea-2zqT1lSE.js} +492 -503
  8. package/dist/CanvasArea-Br8bBSeT.cjs +46 -0
  9. package/dist/ChaiBuilderEditor-SacH75l4.cjs +163 -0
  10. package/dist/{index-aa42febc.js → ChaiBuilderEditor-h9bXC4l-.js} +11215 -15404
  11. package/dist/Class-_uCzl5v1.cjs +1 -0
  12. package/dist/{html-to-json-45e0e3b5.js → Class-l7qYbuoN.js} +185 -366
  13. package/dist/{CurrentPage-35e14043.js → CurrentPage-4lTETR2f.js} +26 -23
  14. package/dist/CurrentPage-nlUWJiUA.cjs +1 -0
  15. package/dist/{ImagesPanel-8b7a989d.cjs → ImagesPanel-6us7hiLN.cjs} +1 -1
  16. package/dist/{ImagesPanel-47ac13c3.js → ImagesPanel-oaHOD-Ex.js} +4 -4
  17. package/dist/Layers-Vw4XE6YB.cjs +1 -0
  18. package/dist/{Layers-c3dd4fc8.js → Layers-wOfijZnb.js} +42 -41
  19. package/dist/MarkAsGlobalBlock-1J_YyL1L.cjs +1 -0
  20. package/dist/{MarkAsGlobalBlock-505ae793.js → MarkAsGlobalBlock-xRyn29gC.js} +17 -20
  21. package/dist/{PagesPanel-bafc506f.js → PagesPanel-82gCVzHS.js} +16 -13
  22. package/dist/PagesPanel-ZKRdK-mI.cjs +1 -0
  23. package/dist/ProjectPanel-kYg4KkJu.cjs +1 -0
  24. package/dist/{ProjectPanel-6113f394.js → ProjectPanel-vz5WOyqZ.js} +22 -19
  25. package/dist/Settings-1E3Y_5r6.cjs +1 -0
  26. package/dist/{Settings-1c41c514.js → Settings-IuAF359L.js} +297 -296
  27. package/dist/SidePanels-WL1UioF2.cjs +1 -0
  28. package/dist/{SidePanels-c13f87dc.js → SidePanels-xssTWt4M.js} +34 -42
  29. package/dist/Topbar-3ozdWfSy.cjs +1 -0
  30. package/dist/{Topbar-b38d5d50.js → Topbar-H0f0EL6-.js} +33 -35
  31. package/dist/UnsplashImages-BoBBSi1a.cjs +1 -0
  32. package/dist/{UnsplashImages-4edb97e7.js → UnsplashImages-gPcBLjgB.js} +13 -14
  33. package/dist/UploadImages-T6kW0s3G.cjs +1 -0
  34. package/dist/{UploadImages-52181c3e.js → UploadImages-_ZyUU66E.js} +11 -12
  35. package/dist/{accordion-c0176dc5.js → accordion-oPUeqPCZ.js} +2 -2
  36. package/dist/{accordion-0afd8143.cjs → accordion-ynvFtV_p.cjs} +1 -1
  37. package/dist/{add-page-modal-08a19915.js → add-page-modal-J1E7rh1U.js} +25 -22
  38. package/dist/add-page-modal-eiiUZCJX.cjs +1 -0
  39. package/dist/alert-dialog-GNfnpqFB.js +64 -0
  40. package/dist/alert-dialog-Mv0-wAvS.cjs +1 -0
  41. package/dist/{command-b1103666.cjs → command-ThdTuUxt.cjs} +1 -1
  42. package/dist/{command-6f260f61.js → command-VHca6CcN.js} +3 -3
  43. package/dist/confirm-alert-8EHe0OOd.cjs +1 -0
  44. package/dist/confirm-alert-b0e_BLhF.js +36 -0
  45. package/dist/{context-menu-e1c240ce.js → context-menu-8dC9uGXj.js} +2 -2
  46. package/dist/{context-menu-fec580f2.cjs → context-menu-IgLbIuth.cjs} +1 -1
  47. package/dist/controls-Ni5kEzLz.js +103 -0
  48. package/dist/controls-xUKa23ic.cjs +1 -0
  49. package/dist/core.cjs +1 -1
  50. package/dist/core.d.ts +1 -10
  51. package/dist/core.js +116 -69
  52. package/dist/delete-page-modal-TGTmRjyn.cjs +1 -0
  53. package/dist/{delete-page-modal-9b37665b.js → delete-page-modal-ysj4O0bM.js} +25 -22
  54. package/dist/{dialog-170eaad9.cjs → dialog-S_QbL1iq.cjs} +1 -1
  55. package/dist/{dialog-18207bef.js → dialog-jrw9DF1f.js} +2 -2
  56. package/dist/{dropdown-menu-ae3ed09b.js → dropdown-menu-S03K_fNs.js} +2 -2
  57. package/dist/{dropdown-menu-84b2439e.cjs → dropdown-menu-sMXR59cB.cjs} +1 -1
  58. package/dist/{form-25e1af37.js → form-dVpOAyRl.js} +2 -2
  59. package/dist/{form-ea21db6c.cjs → form-nRAvKPQj.cjs} +1 -1
  60. package/dist/{functions-83b1de8d.js → functions-nNTuSTsR.js} +1 -1
  61. package/dist/functions-pcUZhFJM.js +12 -0
  62. package/dist/{functions-f84d5e2a.cjs → functions-sCuB7nvZ.cjs} +1 -1
  63. package/dist/functions-uw7QP2kT.cjs +1 -0
  64. package/dist/html-to-json-P6GpbcQX.cjs +1 -0
  65. package/dist/html-to-json-pdHQfRkN.js +178 -0
  66. package/dist/index-8L3zCc6V.cjs +1 -0
  67. package/dist/index-cZ4uo6aT.js +2256 -0
  68. package/dist/{label-e770a087.js → label-KaP7MRrs.js} +2 -2
  69. package/dist/{label-167415e5.cjs → label-tFm8HZdb.cjs} +1 -1
  70. package/dist/lib.cjs +1 -1
  71. package/dist/lib.d.ts +20 -13
  72. package/dist/lib.js +24 -23
  73. package/dist/{link-57de608a.js → link-6o6n2Tnd.js} +4 -4
  74. package/dist/link-ece8dZGH.cjs +1 -0
  75. package/dist/{page-viewer-5c733179.js → page-viewer-84Giu0Rs.js} +29 -26
  76. package/dist/page-viewer-OdVEG83P.cjs +1 -0
  77. package/dist/{popover-f7addcf4.js → popover-a84pbVhQ.js} +2 -2
  78. package/dist/{popover-7cb9079b.cjs → popover-fKjgcRUx.cjs} +1 -1
  79. package/dist/{project-general-setting-d9736056.js → project-general-setting-8OEVVxzn.js} +20 -17
  80. package/dist/project-general-setting-laHNQPW5.cjs +1 -0
  81. package/dist/{project-seo-setting-d81fc1e3.js → project-seo-setting-9kD_stdI.js} +11 -12
  82. package/dist/project-seo-setting-F3Opt9Uj.cjs +1 -0
  83. package/dist/render.cjs +1 -1
  84. package/dist/render.d.ts +7 -7
  85. package/dist/render.js +3 -3
  86. package/dist/{scroll-area-bb343b86.cjs → scroll-area-FiHvy-TZ.cjs} +1 -1
  87. package/dist/{scroll-area-83bd9e8f.js → scroll-area-ewXbxc3n.js} +2 -2
  88. package/dist/{select-0e32300c.cjs → select-7bjg-rr9.cjs} +1 -1
  89. package/dist/{select-7fddd7c3.js → select-POGdEDHT.js} +2 -2
  90. package/dist/{separator-a597dba7.cjs → separator-3Civ-6hb.cjs} +1 -1
  91. package/dist/{separator-a80d065b.js → separator-SctTn0Qi.js} +2 -2
  92. package/dist/server.d.ts +7 -10
  93. package/dist/server.js +0 -3
  94. package/dist/single-page-detail-X0TGlsT4.cjs +1 -0
  95. package/dist/{single-page-detail-04410e64.js → single-page-detail-iXpavDy8.js} +32 -29
  96. package/dist/skeleton-CU_FIbg3.js +239 -0
  97. package/dist/skeleton-JHP9zwL2.cjs +1 -0
  98. package/dist/studio.cjs +1 -0
  99. package/dist/studio.d.ts +13 -0
  100. package/dist/studio.js +39 -0
  101. package/dist/{tabs-85caa1e8.js → tabs-Gb9v5dVb.js} +2 -2
  102. package/dist/{tabs-860e37aa.cjs → tabs-iWeaaVrg.cjs} +1 -1
  103. package/dist/{textarea-a338ede6.cjs → textarea-1kZEh7ki.cjs} +1 -1
  104. package/dist/{textarea-0750bcd2.js → textarea-b2QvVhrK.js} +2 -2
  105. package/dist/{toggle-00c9d11e.js → toggle-ASJRAaGP.js} +2 -2
  106. package/dist/{toggle-b90fed97.cjs → toggle-ehNIPmme.cjs} +1 -1
  107. package/dist/ui.cjs +1 -1
  108. package/dist/ui.d.ts +69 -4
  109. package/dist/ui.js +272 -212
  110. package/dist/useAddBlock-1cMXaOVk.cjs +1 -0
  111. package/dist/useAddBlock-BOjrGBEO.js +86 -0
  112. package/dist/useAllBlocks-RU_Xw8j9.cjs +1 -0
  113. package/dist/useAllBlocks-lX6uVO39.js +20 -0
  114. package/dist/useChaiExternalData-4K9WxANa.js +6 -0
  115. package/dist/useChaiExternalData-DkyBJ81C.cjs +1 -0
  116. package/dist/useDarkMode-JWkrNFpH.js +23 -0
  117. package/dist/useDarkMode-zeTW_UUR.cjs +1 -0
  118. package/dist/useFeatureSupport-jWSuY7wk.js +16 -0
  119. package/dist/useFeatureSupport-tZ0QfBxp.cjs +1 -0
  120. package/dist/useHiddenBlocks-3MsGOJ1s.js +15 -0
  121. package/dist/useHiddenBlocks-oJuQDmTy.cjs +1 -0
  122. package/dist/useLanguage-O1uu2Bzu.js +216 -0
  123. package/dist/useLanguage-Y3qgAbgG.cjs +1 -0
  124. package/dist/useMarkAsGlobalBlock-DB5B1UP6.js +25 -0
  125. package/dist/useMarkAsGlobalBlock-toxRSLc_.cjs +1 -0
  126. package/dist/useUiLibraries-4hPOi8DI.js +12 -0
  127. package/dist/useUiLibraries-9FhQCpKo.cjs +1 -0
  128. package/package.json +19 -5
  129. package/dist/AddBlocks-76275943.cjs +0 -3
  130. package/dist/BrandingOptions-d3b3309a.cjs +0 -1
  131. package/dist/CanvasArea-9f94cd28.cjs +0 -46
  132. package/dist/CurrentPage-edb509db.cjs +0 -1
  133. package/dist/Layers-ecba52c1.cjs +0 -1
  134. package/dist/MarkAsGlobalBlock-3a06a159.cjs +0 -1
  135. package/dist/PagesPanel-f4329082.cjs +0 -1
  136. package/dist/ProjectPanel-ce3116d3.cjs +0 -1
  137. package/dist/Settings-b6a2bef6.cjs +0 -1
  138. package/dist/SidePanels-2cc72c0b.cjs +0 -1
  139. package/dist/Topbar-3b9db9f3.cjs +0 -1
  140. package/dist/UnsplashImages-98c085c2.cjs +0 -1
  141. package/dist/UploadImages-61ef83ad.cjs +0 -1
  142. package/dist/add-page-modal-7f9ff733.cjs +0 -1
  143. package/dist/confirm-alert-c1fdf1e4.js +0 -35
  144. package/dist/confirm-alert-e1ea5110.cjs +0 -1
  145. package/dist/delete-page-modal-7066b01f.cjs +0 -1
  146. package/dist/html-to-json-aadcbf66.cjs +0 -1
  147. package/dist/index-c535cc95.cjs +0 -164
  148. package/dist/link-24679521.cjs +0 -1
  149. package/dist/page-viewer-da99c71e.cjs +0 -1
  150. package/dist/project-general-setting-90f8416d.cjs +0 -1
  151. package/dist/project-seo-setting-6eef8387.cjs +0 -1
  152. package/dist/single-page-detail-90f49d7a.cjs +0 -1
  153. package/dist/useBuilderProp-21feb2da.js +0 -296
  154. package/dist/useBuilderProp-adacf42f.cjs +0 -1
  155. package/dist/useChaiExternalData-192c7896.js +0 -5
  156. package/dist/useChaiExternalData-a90e8aac.cjs +0 -1
  157. /package/dist/{MODIFIERS-2f19c314.js → MODIFIERS-DsEzQ3aH.js} +0 -0
  158. /package/dist/{MODIFIERS-4716c669.cjs → MODIFIERS-Fx6WAZcw.cjs} +0 -0
  159. /package/dist/{jsx-runtime-5c3ac4f7.cjs → jsx-runtime-JYMCiFoE.cjs} +0 -0
  160. /package/dist/{jsx-runtime-944c88e2.js → jsx-runtime-Sp0orL4X.js} +0 -0
  161. /package/dist/{utils-ac68b2c8.js → utils-dze1SGvB.js} +0 -0
  162. /package/dist/{utils-3c452dd0.cjs → utils-qK_SjzzV.cjs} +0 -0
package/dist/ui.js CHANGED
@@ -1,38 +1,39 @@
1
- import { T as we, t as Me } from "./toggle-00c9d11e.js";
2
- import { D as ve, f as De, d as je, k as Ie, e as Re, h as Ae, l as ke, p as Pe, g as Le, i as Fe, j as Ge, m as He, n as ze, o as Ve, c as Be, H as Ee, b as Oe, a as qe, S as Je } from "./dropdown-menu-ae3ed09b.js";
3
- import { A as Qe, k as Ue, i as We, d as Xe, g as Ye, h as Ze, e as _e, f as $e, b as et, B as tt, S as at, a as ot, l as st, n as rt, o as nt, T as it, m as dt, j as lt, r as mt, t as ct, p as pt } from "./useBuilderProp-21feb2da.js";
4
- import { A as ft, c as gt, a as xt, b as bt } from "./accordion-c0176dc5.js";
5
- import { A as Ct, b as yt, a as Nt, C as St, g as wt, f as Mt, d as Tt, c as vt, e as Dt, T as jt } from "./textarea-0750bcd2.js";
6
- import { j as a } from "./jsx-runtime-944c88e2.js";
7
- import { cva as m } from "class-variance-authority";
8
- import { c as r } from "./utils-ac68b2c8.js";
9
- import { D as Rt, b as At, f as kt, d as Pt, c as Lt, e as Ft, a as Gt } from "./dialog-18207bef.js";
10
- import { C as zt, a as Vt, d as Bt, e as Et, b as Ot, f as qt, c as Jt, h as Kt, g as Qt, I as Ut } from "./command-6f260f61.js";
11
- import { L as Xt } from "./label-e770a087.js";
12
- import { S as Zt, a as _t } from "./scroll-area-83bd9e8f.js";
13
- import { T as ea, c as ta, a as aa, b as oa } from "./tabs-85caa1e8.js";
14
- import { P as ra, b as na, a as ia } from "./popover-f7addcf4.js";
15
- import * as i from "react";
1
+ import { T as we, t as Te } from "./toggle-ASJRAaGP.js";
2
+ import { D as De, f as je, d as Ie, k as Re, e as Ae, h as ke, l as Le, p as Pe, g as Fe, i as Ee, j as Ge, m as He, n as ze, o as Ue, c as Ve, H as Be, b as Oe, a as qe, S as Je } from "./dropdown-menu-S03K_fNs.js";
3
+ import { B as Qe, S as We, g as Xe, T as Ye, c as Ze, e as _e, d as $e, a as ea, b as aa, r as ta, t as oa, f as ra } from "./skeleton-CU_FIbg3.js";
4
+ import { A as na, c as da, a as ia, b as la } from "./accordion-oPUeqPCZ.js";
5
+ import { A as ma, b as pa, a as ua, C as fa, g as ga, f as xa, d as ba, c as ha, e as va, T as ya } from "./textarea-b2QvVhrK.js";
6
+ import { j as t } from "./jsx-runtime-Sp0orL4X.js";
7
+ import { cva as c } from "class-variance-authority";
8
+ import { c as s } from "./utils-dze1SGvB.js";
9
+ import { A as Na, g as Sa, h as wa, b as Ta, f as Ma, d as Da, c as ja, e as Ia, a as Ra } from "./alert-dialog-GNfnpqFB.js";
10
+ import { D as ka, b as La, f as Pa, d as Fa, c as Ea, e as Ga, a as Ha } from "./dialog-jrw9DF1f.js";
11
+ import { C as Ua, a as Va, d as Ba, e as Oa, b as qa, f as Ja, c as Ka, h as Qa, g as Wa, I as Xa } from "./command-VHca6CcN.js";
12
+ import { L as Za } from "./label-KaP7MRrs.js";
13
+ import { S as $a, a as et } from "./scroll-area-ewXbxc3n.js";
14
+ import { T as tt, c as ot, a as rt, b as st } from "./tabs-Gb9v5dVb.js";
15
+ import { P as dt, b as it, a as lt } from "./popover-a84pbVhQ.js";
16
+ import * as d from "react";
16
17
  import { ChevronRightIcon as f, CheckIcon as g, DotFilledIcon as x, Cross2Icon as b } from "@radix-ui/react-icons";
17
- import * as s from "@radix-ui/react-menubar";
18
- import { S as la, d as ma, a as ca, f as pa, e as ua, g as fa, c as ga, b as xa } from "./select-7fddd7c3.js";
18
+ import * as r from "@radix-ui/react-menubar";
19
+ import { S as mt, d as pt, a as ut, f as ft, e as gt, g as xt, c as bt, b as ht } from "./select-POGdEDHT.js";
19
20
  import * as n from "@radix-ui/react-dialog";
20
- import { S as ha } from "./separator-a80d065b.js";
21
- import { C as ya, d as Na, b as Sa, i as wa, c as Ma, f as Ta, j as va, n as Da, e as ja, g as Ia, h as Ra, k as Aa, l as ka, m as Pa, a as La } from "./context-menu-e1c240ce.js";
22
- import { I as Ga, a as Ha, L as za, R as Va } from "./link-57de608a.js";
21
+ import { S as yt } from "./separator-SctTn0Qi.js";
22
+ import { C as Nt, d as St, b as wt, i as Tt, c as Mt, f as Dt, j as jt, n as It, e as Rt, g as At, h as kt, k as Lt, l as Pt, m as Ft, a as Et } from "./context-menu-8dC9uGXj.js";
23
+ import { I as Ht, a as zt, L as Ut, R as Vt } from "./link-6o6n2Tnd.js";
23
24
  import "@radix-ui/react-toggle";
24
25
  import "@radix-ui/react-switch";
25
26
  import "@radix-ui/react-hover-card";
26
27
  import "@radix-ui/react-dropdown-menu";
27
- import "@radix-ui/react-alert-dialog";
28
+ import "jotai";
29
+ import "lodash";
28
30
  import "@radix-ui/react-slot";
29
31
  import "@radix-ui/react-tooltip";
30
32
  import "@radix-ui/react-toast";
31
- import "jotai";
32
- import "lodash";
33
33
  import "@radix-ui/react-accordion";
34
34
  import "clsx";
35
35
  import "tailwind-merge";
36
+ import "@radix-ui/react-alert-dialog";
36
37
  import "cmdk";
37
38
  import "@radix-ui/react-label";
38
39
  import "@radix-ui/react-scroll-area";
@@ -43,10 +44,10 @@ import "@radix-ui/react-separator";
43
44
  import "@radix-ui/react-context-menu";
44
45
  import "react-icons-picker";
45
46
  import "react-dom";
46
- import "./ImagesPanel-47ac13c3.js";
47
+ import "./ImagesPanel-oaHOD-Ex.js";
47
48
  import "react-quill";
48
49
  import "react-i18next";
49
- const h = m(
50
+ const h = c(
50
51
  "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",
51
52
  {
52
53
  variants: {
@@ -61,145 +62,145 @@ const h = m(
61
62
  variant: "default"
62
63
  }
63
64
  }
64
- ), pe = ({ className: e, variant: t, ...o }) => /* @__PURE__ */ a.jsx("div", { className: r(h({ variant: t }), e), ...o }), ue = s.Menu, fe = s.Group, ge = s.Portal, xe = s.Sub, be = s.RadioGroup, C = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(
65
- s.Root,
65
+ ), pe = ({ className: e, variant: a, ...o }) => /* @__PURE__ */ t.jsx("div", { className: s(h({ variant: a }), e), ...o }), ue = r.Menu, fe = r.Group, ge = r.Portal, xe = r.Sub, be = r.RadioGroup, v = d.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ t.jsx(
66
+ r.Root,
66
67
  {
67
68
  ref: o,
68
- className: r("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm", e),
69
- ...t
69
+ className: s("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm", e),
70
+ ...a
70
71
  }
71
72
  ));
72
- C.displayName = s.Root.displayName;
73
- const y = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(
74
- s.Trigger,
73
+ v.displayName = r.Root.displayName;
74
+ const y = d.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ t.jsx(
75
+ r.Trigger,
75
76
  {
76
77
  ref: o,
77
- className: r(
78
+ className: s(
78
79
  "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",
79
80
  e
80
81
  ),
81
- ...t
82
+ ...a
82
83
  }
83
84
  ));
84
- y.displayName = s.Trigger.displayName;
85
- const N = i.forwardRef(({ className: e, inset: t, children: o, ...d }, l) => /* @__PURE__ */ a.jsxs(
86
- s.SubTrigger,
85
+ y.displayName = r.Trigger.displayName;
86
+ const C = d.forwardRef(({ className: e, inset: a, children: o, ...i }, l) => /* @__PURE__ */ t.jsxs(
87
+ r.SubTrigger,
87
88
  {
88
89
  ref: l,
89
- className: r(
90
+ className: s(
90
91
  "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",
91
- t && "pl-8",
92
+ a && "pl-8",
92
93
  e
93
94
  ),
94
- ...d,
95
+ ...i,
95
96
  children: [
96
97
  o,
97
- /* @__PURE__ */ a.jsx(f, { className: "ml-auto h-4 w-4" })
98
+ /* @__PURE__ */ t.jsx(f, { className: "ml-auto h-4 w-4" })
98
99
  ]
99
100
  }
100
101
  ));
101
- N.displayName = s.SubTrigger.displayName;
102
- const S = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(
103
- s.SubContent,
102
+ C.displayName = r.SubTrigger.displayName;
103
+ const N = d.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ t.jsx(
104
+ r.SubContent,
104
105
  {
105
106
  ref: o,
106
- className: r(
107
+ className: s(
107
108
  "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",
108
109
  e
109
110
  ),
110
- ...t
111
+ ...a
111
112
  }
112
113
  ));
113
- S.displayName = s.SubContent.displayName;
114
- const w = i.forwardRef(({ className: e, align: t = "start", alignOffset: o = -4, sideOffset: d = 8, ...l }, u) => /* @__PURE__ */ a.jsx(s.Portal, { children: /* @__PURE__ */ a.jsx(
115
- s.Content,
114
+ N.displayName = r.SubContent.displayName;
115
+ const S = d.forwardRef(({ className: e, align: a = "start", alignOffset: o = -4, sideOffset: i = 8, ...l }, u) => /* @__PURE__ */ t.jsx(r.Portal, { children: /* @__PURE__ */ t.jsx(
116
+ r.Content,
116
117
  {
117
118
  ref: u,
118
- align: t,
119
+ align: a,
119
120
  alignOffset: o,
120
- sideOffset: d,
121
- className: r(
121
+ sideOffset: i,
122
+ className: s(
122
123
  "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",
123
124
  e
124
125
  ),
125
126
  ...l
126
127
  }
127
128
  ) }));
128
- w.displayName = s.Content.displayName;
129
- const M = i.forwardRef(({ className: e, inset: t, ...o }, d) => /* @__PURE__ */ a.jsx(
130
- s.Item,
129
+ S.displayName = r.Content.displayName;
130
+ const w = d.forwardRef(({ className: e, inset: a, ...o }, i) => /* @__PURE__ */ t.jsx(
131
+ r.Item,
131
132
  {
132
- ref: d,
133
- className: r(
133
+ ref: i,
134
+ className: s(
134
135
  "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",
135
- t && "pl-8",
136
+ a && "pl-8",
136
137
  e
137
138
  ),
138
139
  ...o
139
140
  }
140
141
  ));
141
- M.displayName = s.Item.displayName;
142
- const T = i.forwardRef(({ className: e, children: t, checked: o, ...d }, l) => /* @__PURE__ */ a.jsxs(
143
- s.CheckboxItem,
142
+ w.displayName = r.Item.displayName;
143
+ const T = d.forwardRef(({ className: e, children: a, checked: o, ...i }, l) => /* @__PURE__ */ t.jsxs(
144
+ r.CheckboxItem,
144
145
  {
145
146
  ref: l,
146
- className: r(
147
+ className: s(
147
148
  "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",
148
149
  e
149
150
  ),
150
151
  checked: o,
151
- ...d,
152
+ ...i,
152
153
  children: [
153
- /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(s.ItemIndicator, { children: /* @__PURE__ */ a.jsx(g, { className: "h-4 w-4" }) }) }),
154
- t
154
+ /* @__PURE__ */ t.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t.jsx(r.ItemIndicator, { children: /* @__PURE__ */ t.jsx(g, { className: "h-4 w-4" }) }) }),
155
+ a
155
156
  ]
156
157
  }
157
158
  ));
158
- T.displayName = s.CheckboxItem.displayName;
159
- const v = i.forwardRef(({ className: e, children: t, ...o }, d) => /* @__PURE__ */ a.jsxs(
160
- s.RadioItem,
159
+ T.displayName = r.CheckboxItem.displayName;
160
+ const M = d.forwardRef(({ className: e, children: a, ...o }, i) => /* @__PURE__ */ t.jsxs(
161
+ r.RadioItem,
161
162
  {
162
- ref: d,
163
- className: r(
163
+ ref: i,
164
+ className: s(
164
165
  "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",
165
166
  e
166
167
  ),
167
168
  ...o,
168
169
  children: [
169
- /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(s.ItemIndicator, { children: /* @__PURE__ */ a.jsx(x, { className: "h-4 w-4 fill-current" }) }) }),
170
- t
170
+ /* @__PURE__ */ t.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t.jsx(r.ItemIndicator, { children: /* @__PURE__ */ t.jsx(x, { className: "h-4 w-4 fill-current" }) }) }),
171
+ a
171
172
  ]
172
173
  }
173
174
  ));
174
- v.displayName = s.RadioItem.displayName;
175
- const D = i.forwardRef(({ className: e, inset: t, ...o }, d) => /* @__PURE__ */ a.jsx(
176
- s.Label,
175
+ M.displayName = r.RadioItem.displayName;
176
+ const D = d.forwardRef(({ className: e, inset: a, ...o }, i) => /* @__PURE__ */ t.jsx(
177
+ r.Label,
177
178
  {
178
- ref: d,
179
- className: r("px-2 py-1.5 text-sm font-semibold", t && "pl-8", e),
179
+ ref: i,
180
+ className: s("px-2 py-1.5 text-sm font-semibold", a && "pl-8", e),
180
181
  ...o
181
182
  }
182
183
  ));
183
- D.displayName = s.Label.displayName;
184
- const j = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(s.Separator, { ref: o, className: r("-mx-1 my-1 h-px bg-muted", e), ...t }));
185
- j.displayName = s.Separator.displayName;
186
- const I = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: r("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
184
+ D.displayName = r.Label.displayName;
185
+ const j = d.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ t.jsx(r.Separator, { ref: o, className: s("-mx-1 my-1 h-px bg-muted", e), ...a }));
186
+ j.displayName = r.Separator.displayName;
187
+ const I = ({ className: e, ...a }) => /* @__PURE__ */ t.jsx("span", { className: s("ml-auto text-xs tracking-widest text-muted-foreground", e), ...a });
187
188
  I.displayname = "MenubarShortcut";
188
- const he = n.Root, Ce = n.Trigger, ye = n.Close, c = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx(n.Portal, { className: r(e), ...t });
189
- c.displayName = n.Portal.displayName;
190
- const p = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(
189
+ const he = n.Root, ve = n.Trigger, ye = n.Close, m = ({ className: e, ...a }) => /* @__PURE__ */ t.jsx(n.Portal, { className: s(e), ...a });
190
+ m.displayName = n.Portal.displayName;
191
+ const p = d.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ t.jsx(
191
192
  n.Overlay,
192
193
  {
193
- className: r(
194
+ className: s(
194
195
  "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",
195
196
  e
196
197
  ),
197
- ...t,
198
+ ...a,
198
199
  ref: o
199
200
  }
200
201
  ));
201
202
  p.displayName = n.Overlay.displayName;
202
- const R = m(
203
+ const R = c(
203
204
  "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",
204
205
  {
205
206
  variants: {
@@ -214,163 +215,222 @@ const R = m(
214
215
  side: "right"
215
216
  }
216
217
  }
217
- ), A = i.forwardRef(
218
- ({ side: e = "right", className: t, children: o, ...d }, l) => /* @__PURE__ */ a.jsxs(c, { children: [
219
- /* @__PURE__ */ a.jsx(p, {}),
220
- /* @__PURE__ */ a.jsxs(n.Content, { ref: l, className: r(R({ side: e }), t), ...d, children: [
218
+ ), A = d.forwardRef(
219
+ ({ side: e = "right", className: a, children: o, ...i }, l) => /* @__PURE__ */ t.jsxs(m, { children: [
220
+ /* @__PURE__ */ t.jsx(p, {}),
221
+ /* @__PURE__ */ t.jsxs(n.Content, { ref: l, className: s(R({ side: e }), a), ...i, children: [
221
222
  o,
222
- /* @__PURE__ */ a.jsxs(n.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: [
223
- /* @__PURE__ */ a.jsx(b, { className: "h-4 w-4" }),
224
- /* @__PURE__ */ a.jsx("span", { className: "sr-only", children: "Close" })
223
+ /* @__PURE__ */ t.jsxs(n.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: [
224
+ /* @__PURE__ */ t.jsx(b, { className: "h-4 w-4" }),
225
+ /* @__PURE__ */ t.jsx("span", { className: "sr-only", children: "Close" })
225
226
  ] })
226
227
  ] })
227
228
  ] })
228
229
  );
229
230
  A.displayName = n.Content.displayName;
230
- const k = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: r("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
231
+ const k = ({ className: e, ...a }) => /* @__PURE__ */ t.jsx("div", { className: s("flex flex-col space-y-2 text-center sm:text-left", e), ...a });
231
232
  k.displayName = "SheetHeader";
232
- const P = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: r("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
233
- P.displayName = "SheetFooter";
234
- const L = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(n.Title, { ref: o, className: r("text-lg font-semibold text-foreground", e), ...t }));
235
- L.displayName = n.Title.displayName;
236
- const F = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a.jsx(n.Description, { ref: o, className: r("text-sm text-muted-foreground", e), ...t }));
233
+ const L = ({ className: e, ...a }) => /* @__PURE__ */ t.jsx("div", { className: s("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...a });
234
+ L.displayName = "SheetFooter";
235
+ const P = d.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ t.jsx(n.Title, { ref: o, className: s("text-lg font-semibold text-foreground", e), ...a }));
236
+ P.displayName = n.Title.displayName;
237
+ const F = d.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ t.jsx(n.Description, { ref: o, className: s("text-sm text-muted-foreground", e), ...a }));
237
238
  F.displayName = n.Description.displayName;
239
+ function Ce() {
240
+ return {
241
+ colors: {
242
+ border: "hsl(var(--border))",
243
+ input: "hsl(var(--input))",
244
+ ring: "hsl(var(--ring))",
245
+ background: "hsl(var(--background))",
246
+ foreground: "hsl(var(--foreground))",
247
+ primary: {
248
+ DEFAULT: "hsl(var(--primary))",
249
+ foreground: "hsl(var(--primary-foreground))"
250
+ },
251
+ secondary: {
252
+ DEFAULT: "hsl(var(--secondary))",
253
+ foreground: "hsl(var(--secondary-foreground))"
254
+ },
255
+ destructive: {
256
+ DEFAULT: "hsl(var(--destructive))",
257
+ foreground: "hsl(var(--destructive-foreground))"
258
+ },
259
+ muted: {
260
+ DEFAULT: "hsl(var(--muted))",
261
+ foreground: "hsl(var(--muted-foreground))"
262
+ },
263
+ accent: {
264
+ DEFAULT: "hsl(var(--accent))",
265
+ foreground: "hsl(var(--accent-foreground))"
266
+ },
267
+ popover: {
268
+ DEFAULT: "hsl(var(--popover))",
269
+ foreground: "hsl(var(--popover-foreground))"
270
+ },
271
+ card: {
272
+ DEFAULT: "hsl(var(--card))",
273
+ foreground: "hsl(var(--card-foreground))"
274
+ }
275
+ },
276
+ borderRadius: {
277
+ lg: "var(--radius)",
278
+ md: "calc(var(--radius) - 2px)",
279
+ sm: "calc(var(--radius) - 4px)"
280
+ },
281
+ keyframes: {
282
+ "accordion-down": {
283
+ from: { height: "0" },
284
+ to: { height: "var(--radix-accordion-content-height)" }
285
+ },
286
+ "accordion-up": {
287
+ from: { height: "var(--radix-accordion-content-height)" },
288
+ to: { height: "0" }
289
+ }
290
+ },
291
+ animation: {
292
+ "accordion-down": "accordion-down 0.2s ease-out",
293
+ "accordion-up": "accordion-up 0.2s ease-out"
294
+ }
295
+ };
296
+ }
238
297
  export {
239
- ft as Accordion,
240
- gt as AccordionContent,
241
- xt as AccordionItem,
242
- bt as AccordionTrigger,
243
- Ct as Alert,
244
- yt as AlertDescription,
245
- Qe as AlertDialog,
246
- Ue as AlertDialogAction,
247
- We as AlertDialogCancel,
248
- Xe as AlertDialogContent,
249
- Ye as AlertDialogDescription,
250
- Ze as AlertDialogFooter,
251
- _e as AlertDialogHeader,
252
- $e as AlertDialogTitle,
253
- et as AlertDialogTrigger,
254
- Nt as AlertTitle,
298
+ na as Accordion,
299
+ da as AccordionContent,
300
+ ia as AccordionItem,
301
+ la as AccordionTrigger,
302
+ ma as Alert,
303
+ pa as AlertDescription,
304
+ Na as AlertDialog,
305
+ Sa as AlertDialogAction,
306
+ wa as AlertDialogCancel,
307
+ Ta as AlertDialogContent,
308
+ Ma as AlertDialogDescription,
309
+ Da as AlertDialogFooter,
310
+ ja as AlertDialogHeader,
311
+ Ia as AlertDialogTitle,
312
+ Ra as AlertDialogTrigger,
313
+ ua as AlertTitle,
255
314
  pe as Badge,
256
- tt as Button,
257
- St as Card,
258
- wt as CardContent,
259
- Mt as CardDescription,
260
- Tt as CardFooter,
261
- vt as CardHeader,
262
- Dt as CardTitle,
263
- zt as Command,
264
- Vt as CommandDialog,
265
- Bt as CommandEmpty,
266
- Et as CommandGroup,
267
- Ot as CommandInput,
268
- qt as CommandItem,
269
- Jt as CommandList,
270
- Kt as CommandSeparator,
271
- Qt as CommandShortcut,
272
- ya as ContextMenu,
273
- Na as ContextMenuCheckboxItem,
274
- Sa as ContextMenuContent,
275
- wa as ContextMenuGroup,
276
- Ma as ContextMenuItem,
277
- Ta as ContextMenuLabel,
278
- va as ContextMenuPortal,
279
- Da as ContextMenuRadioGroup,
280
- ja as ContextMenuRadioItem,
281
- Ia as ContextMenuSeparator,
282
- Ra as ContextMenuShortcut,
283
- Aa as ContextMenuSub,
284
- ka as ContextMenuSubContent,
285
- Pa as ContextMenuSubTrigger,
286
- La as ContextMenuTrigger,
287
- Rt as Dialog,
288
- At as DialogContent,
289
- kt as DialogDescription,
290
- Pt as DialogFooter,
291
- Lt as DialogHeader,
292
- Ft as DialogTitle,
293
- Gt as DialogTrigger,
294
- ve as DropdownMenu,
295
- De as DropdownMenuCheckboxItem,
296
- je as DropdownMenuContent,
297
- Ie as DropdownMenuGroup,
298
- Re as DropdownMenuItem,
299
- Ae as DropdownMenuLabel,
300
- ke as DropdownMenuPortal,
315
+ Qe as Button,
316
+ fa as Card,
317
+ ga as CardContent,
318
+ xa as CardDescription,
319
+ ba as CardFooter,
320
+ ha as CardHeader,
321
+ va as CardTitle,
322
+ Ua as Command,
323
+ Va as CommandDialog,
324
+ Ba as CommandEmpty,
325
+ Oa as CommandGroup,
326
+ qa as CommandInput,
327
+ Ja as CommandItem,
328
+ Ka as CommandList,
329
+ Qa as CommandSeparator,
330
+ Wa as CommandShortcut,
331
+ Nt as ContextMenu,
332
+ St as ContextMenuCheckboxItem,
333
+ wt as ContextMenuContent,
334
+ Tt as ContextMenuGroup,
335
+ Mt as ContextMenuItem,
336
+ Dt as ContextMenuLabel,
337
+ jt as ContextMenuPortal,
338
+ It as ContextMenuRadioGroup,
339
+ Rt as ContextMenuRadioItem,
340
+ At as ContextMenuSeparator,
341
+ kt as ContextMenuShortcut,
342
+ Lt as ContextMenuSub,
343
+ Pt as ContextMenuSubContent,
344
+ Ft as ContextMenuSubTrigger,
345
+ Et as ContextMenuTrigger,
346
+ ka as Dialog,
347
+ La as DialogContent,
348
+ Pa as DialogDescription,
349
+ Fa as DialogFooter,
350
+ Ea as DialogHeader,
351
+ Ga as DialogTitle,
352
+ Ha as DialogTrigger,
353
+ De as DropdownMenu,
354
+ je as DropdownMenuCheckboxItem,
355
+ Ie as DropdownMenuContent,
356
+ Re as DropdownMenuGroup,
357
+ Ae as DropdownMenuItem,
358
+ ke as DropdownMenuLabel,
359
+ Le as DropdownMenuPortal,
301
360
  Pe as DropdownMenuRadioGroup,
302
- Le as DropdownMenuRadioItem,
303
- Fe as DropdownMenuSeparator,
361
+ Fe as DropdownMenuRadioItem,
362
+ Ee as DropdownMenuSeparator,
304
363
  Ge as DropdownMenuShortcut,
305
364
  He as DropdownMenuSub,
306
365
  ze as DropdownMenuSubContent,
307
- Ve as DropdownMenuSubTrigger,
308
- Be as DropdownMenuTrigger,
309
- Ee as HoverCard,
366
+ Ue as DropdownMenuSubTrigger,
367
+ Ve as DropdownMenuTrigger,
368
+ Be as HoverCard,
310
369
  Oe as HoverCardContent,
311
370
  qe as HoverCardTrigger,
312
- Ga as IconPickerField,
313
- Ha as ImagePickerField,
314
- Ut as Input,
315
- Xt as Label,
316
- za as LinkField,
317
- C as Menubar,
371
+ Ht as IconPickerField,
372
+ zt as ImagePickerField,
373
+ Xa as Input,
374
+ Za as Label,
375
+ Ut as LinkField,
376
+ v as Menubar,
318
377
  T as MenubarCheckboxItem,
319
- w as MenubarContent,
378
+ S as MenubarContent,
320
379
  fe as MenubarGroup,
321
- M as MenubarItem,
380
+ w as MenubarItem,
322
381
  D as MenubarLabel,
323
382
  ue as MenubarMenu,
324
383
  ge as MenubarPortal,
325
384
  be as MenubarRadioGroup,
326
- v as MenubarRadioItem,
385
+ M as MenubarRadioItem,
327
386
  j as MenubarSeparator,
328
387
  I as MenubarShortcut,
329
388
  xe as MenubarSub,
330
- S as MenubarSubContent,
331
- N as MenubarSubTrigger,
389
+ N as MenubarSubContent,
390
+ C as MenubarSubTrigger,
332
391
  y as MenubarTrigger,
333
- ra as Popover,
334
- na as PopoverContent,
335
- ia as PopoverTrigger,
336
- Va as RTEField,
337
- Zt as ScrollArea,
338
- _t as ScrollBar,
339
- la as Select,
340
- ma as SelectContent,
341
- ca as SelectGroup,
342
- pa as SelectItem,
343
- ua as SelectLabel,
344
- fa as SelectSeparator,
345
- ga as SelectTrigger,
346
- xa as SelectValue,
347
- ha as Separator,
392
+ dt as Popover,
393
+ it as PopoverContent,
394
+ lt as PopoverTrigger,
395
+ Vt as RTEField,
396
+ $a as ScrollArea,
397
+ et as ScrollBar,
398
+ mt as Select,
399
+ pt as SelectContent,
400
+ ut as SelectGroup,
401
+ ft as SelectItem,
402
+ gt as SelectLabel,
403
+ xt as SelectSeparator,
404
+ bt as SelectTrigger,
405
+ ht as SelectValue,
406
+ yt as Separator,
348
407
  he as Sheet,
349
408
  ye as SheetClose,
350
409
  A as SheetContent,
351
410
  F as SheetDescription,
352
- P as SheetFooter,
411
+ L as SheetFooter,
353
412
  k as SheetHeader,
354
- L as SheetTitle,
355
- Ce as SheetTrigger,
356
- at as Skeleton,
413
+ P as SheetTitle,
414
+ ve as SheetTrigger,
415
+ We as Skeleton,
357
416
  Je as Switch,
358
- ea as Tabs,
359
- ta as TabsContent,
360
- aa as TabsList,
361
- oa as TabsTrigger,
362
- jt as Textarea,
363
- ot as Toaster,
417
+ tt as Tabs,
418
+ ot as TabsContent,
419
+ rt as TabsList,
420
+ st as TabsTrigger,
421
+ ya as Textarea,
422
+ Xe as Toaster,
364
423
  we as Toggle,
365
- st as Tooltip,
366
- rt as TooltipContent,
367
- nt as TooltipPortal,
368
- it as TooltipProvider,
369
- dt as TooltipTrigger,
424
+ Ye as Tooltip,
425
+ Ze as TooltipContent,
426
+ _e as TooltipPortal,
427
+ $e as TooltipProvider,
428
+ ea as TooltipTrigger,
370
429
  h as badgeVariants,
371
- lt as buttonVariants,
372
- mt as reducer,
373
- ct as toast,
374
- Me as toggleVariants,
375
- pt as useToast
430
+ aa as buttonVariants,
431
+ Ce as chaiBuilderTheme,
432
+ ta as reducer,
433
+ oa as toast,
434
+ Te as toggleVariants,
435
+ ra as useToast
376
436
  };
@@ -0,0 +1 @@
1
+ "use strict";const S=require("react"),n=require("lodash"),q=require("./ChaiBuilderEditor-SacH75l4.cjs"),C=require("./functions-uw7QP2kT.cjs"),x=require("./useAllBlocks-RU_Xw8j9.cjs"),D=require("./controls-xUKa23ic.cjs"),I=require("./MODIFIERS-Fx6WAZcw.cjs");function g(e,i,u,o,A){if(i===null)return[...e,...o];if(u!==null){const r=n.findIndex(e,{_parent:i}),c=(r===-1?0:r)+u;return e.splice(c,0,...o),e}if(!A){const c=n.findIndex(e,{_id:i})+1;return e.splice(c,0,...o),e}let t=n.findIndex(e,{_id:i});const s=n.filter(e,{_parent:i});n.isEmpty(s)||(t=n.findIndex(e,{_id:n.last(s)._id}));const p=t+1;return e.splice(p,0,...o),e}const E=()=>{const e=q.useDispatch(),i=x.useAllBlocks(),[,u]=q.useSelectedBlockIds(),o=S.useCallback((t,s,p)=>{var l;for(let d=0;d<t.length;d++){const{_id:_}=t[d];t[d]._id=C.generateUUID();const f=n.filter(t,{_parent:_});for(let a=0;a<f.length;a++)f[a]._parent=t[d]._id}let r;s&&(r=n.find(i,{_id:s}),t[0]._parent=s);const c=r?x.canAddChildBlock(r._type):!0;return!c&&r&&(t[0]._parent=r._parent),e({type:"set_blocks",payload:g(i,s||null,p||null,t,c)}),u([(l=n.first(t))==null?void 0:l._id]),n.first(t)},[i,e,u]);return{addCoreBlock:S.useCallback((t,s,p)=>{if(n.has(t,"blocks")){const y=t.blocks;return o(y,s,p)}const r=C.generateUUID(),c=D.getBlockDefaultProps(t.props),l=[];n.forIn(c,(y,h)=>{if(n.startsWith(y,I.SLOT_KEY)){const m=y.replace(I.SLOT_KEY,"");l.push({_id:m,_type:"Slot",_parent:r,_name:t.props[h].name,_styles:t.props[h].styles,_emptyStyles:t.props[h].emptyStyles})}});const d={_type:t.type,_id:r,...c};let _;s&&(_=n.find(i,{_id:s}),d._parent=s);const f=_?x.canAddChildBlock(_._type):!0;!f&&_&&(d._parent=_._parent);const a=[d,...l];return e({type:"set_blocks",payload:g(i,s||null,p||null,a,f)}),u([d._id]),d},[o,i,e,u]),addPredefinedBlock:o}};exports.useAddBlock=E;