@chaibuilder/sdk 1.2.26 → 1.2.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/AddBlocks-S-4jzdWv.cjs +1 -0
  2. package/dist/{AddBlocks-l1JENNvq.js → AddBlocks-ksZjjn0k.js} +6 -7
  3. package/dist/BrandingOptions-EMCT0Wa3.cjs +1 -0
  4. package/dist/{BrandingOptions-udtH5yJs.js → BrandingOptions-T_kbQFQv.js} +5 -6
  5. package/dist/{CanvasArea-zme1r3Zi.cjs → CanvasArea-SDzbubar.cjs} +2 -2
  6. package/dist/{CanvasArea-h0W-Tyha.js → CanvasArea-rhOeubmu.js} +7 -8
  7. package/dist/{Class-lGzsNBOK.js → Class-3k8xjeiM.js} +1 -1
  8. package/dist/{Class-PoYusiA5.cjs → Class-MmCxz2Ay.cjs} +1 -1
  9. package/dist/{CurrentPage-tJUjXWdb.js → CurrentPage-0eeU1V_c.js} +8 -9
  10. package/dist/CurrentPage-aTjWjc3o.cjs +1 -0
  11. package/dist/{ListTree-cZ-Ihlt3.js → ListTree-Muu4rAtp.js} +8 -9
  12. package/dist/ListTree-SWsqdfcG.cjs +1 -0
  13. package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
  14. package/dist/{MODIFIERS-dytZ-osO.js → MODIFIERS-WQdaNvb8.js} +8 -4
  15. package/dist/PagesPanel-n3x-0ozR.cjs +1 -0
  16. package/dist/{PagesPanel-6rrLXEO-.js → PagesPanel-rYN28QpN.js} +8 -9
  17. package/dist/{ProjectPanel-tz3bjdXy.js → ProjectPanel-ivFOhdcz.js} +13 -14
  18. package/dist/ProjectPanel-pBePMOta.cjs +1 -0
  19. package/dist/Settings-JRyJayf5.cjs +1 -0
  20. package/dist/{Settings-4s2LUVmC.js → Settings-XWmKzRl9.js} +6 -7
  21. package/dist/SidePanels-BtUeo6M9.cjs +1 -0
  22. package/dist/{SidePanels-bugFfInz.js → SidePanels-ODktnGbC.js} +16 -17
  23. package/dist/Topbar-QMeD3hvq.cjs +1 -0
  24. package/dist/{Topbar-pWzBEOed.js → Topbar-Yunooh00.js} +5 -6
  25. package/dist/UnsplashImages-05JR8oIu.cjs +1 -0
  26. package/dist/{UnsplashImages-qvwFbV-E.js → UnsplashImages-QMl0bxix.js} +15 -16
  27. package/dist/UploadImages-OgSN1HVt.cjs +1 -0
  28. package/dist/{UploadImages-9NapgXBq.js → UploadImages-Si-A26bc.js} +10 -11
  29. package/dist/add-page-modal-9pTKItY-.cjs +1 -0
  30. package/dist/{add-page-modal-k2Kb92HS.js → add-page-modal-U7AUUrI1.js} +24 -25
  31. package/dist/confirm-alert-DhRc-Zcd.cjs +1 -0
  32. package/dist/{confirm-alert-GUhZ_G8w.js → confirm-alert-kV5-c70T.js} +5 -6
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.js +46 -47
  35. package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
  36. package/dist/{defaultTheme-D8B4-wHO.js → defaultTheme-gunU_Fe5.js} +1 -1
  37. package/dist/delete-page-modal-4s-6AIy4.cjs +1 -0
  38. package/dist/{delete-page-modal-zONvdebd.js → delete-page-modal-UCBpdjLe.js} +8 -9
  39. package/dist/email-blocks.cjs +1 -1
  40. package/dist/email-blocks.js +1 -1
  41. package/dist/email.cjs +1 -1
  42. package/dist/email.js +6 -7
  43. package/dist/{form-lBQ_76Uw.cjs → form-Ap63cNec.cjs} +1 -1
  44. package/dist/{form-STUz-6nE.js → form-zmlTjM9j.js} +1 -1
  45. package/dist/html-to-json-C_Eobs_d.cjs +1 -0
  46. package/dist/{html-to-json-ngX9ef2u.js → html-to-json-p__Fgqdg.js} +75 -50
  47. package/dist/{index-Gk6sASBd.js → index-CFUoB97-.js} +128 -129
  48. package/dist/index-F4AQQ6qq.cjs +1 -0
  49. package/dist/{index-mbyqq81O.cjs → index-Qk028f-N.cjs} +1 -1
  50. package/dist/{index-llTXLDGE.js → index-f0AbmoYY.js} +4 -4
  51. package/dist/{index-OB199Izc.cjs → index-l19JVVXI.cjs} +2 -2
  52. package/dist/{index-SkyM3d6Q.js → index-lOJfSheQ.js} +2 -2
  53. package/dist/lib.cjs +3 -3
  54. package/dist/lib.js +16 -17
  55. package/dist/page-viewer-YFrIG3L7.cjs +1 -0
  56. package/dist/{page-viewer-Pdg9F5Hv.js → page-viewer-jOwy--9A.js} +9 -10
  57. package/dist/{project-general-setting-f8Ebsn6K.js → project-general-setting-3N8HZ2fe.js} +9 -10
  58. package/dist/project-general-setting-hK7I7FuN.cjs +1 -0
  59. package/dist/{project-seo-setting-pX34Qsym.js → project-seo-setting-bSiNgO_1.js} +6 -7
  60. package/dist/project-seo-setting-x-FK0pez.cjs +1 -0
  61. package/dist/render.cjs +1 -1
  62. package/dist/render.js +13 -14
  63. package/dist/{single-page-detail-dpe5LT0M.js → single-page-detail--AZlZ-pC.js} +10 -11
  64. package/dist/single-page-detail-9abF2g2R.cjs +1 -0
  65. package/dist/studio.cjs +1 -1
  66. package/dist/studio.js +7 -8
  67. package/dist/ui.cjs +1 -1
  68. package/dist/ui.js +137 -138
  69. package/dist/web-blocks.cjs +1 -6
  70. package/dist/web-blocks.js +385 -486
  71. package/package.json +1 -1
  72. package/dist/AddBlocks-zPPKkeKs.cjs +0 -1
  73. package/dist/BrandingOptions-DkpqGARR.cjs +0 -1
  74. package/dist/CurrentPage-Hl52iub_.cjs +0 -1
  75. package/dist/ListTree-WvTjY5rr.cjs +0 -1
  76. package/dist/MODIFIERS-0g14w5RS.cjs +0 -1
  77. package/dist/PagesPanel-WzCocl6u.cjs +0 -1
  78. package/dist/ProjectPanel-o7gdcwPn.cjs +0 -1
  79. package/dist/STRINGS--j49GZJP.js +0 -7
  80. package/dist/STRINGS-gPz7CUOk.cjs +0 -1
  81. package/dist/Settings-AqoKwR92.cjs +0 -1
  82. package/dist/SidePanels-3o6Okmvu.cjs +0 -1
  83. package/dist/Topbar-CqW7G360.cjs +0 -1
  84. package/dist/UnsplashImages-NGskB93R.cjs +0 -1
  85. package/dist/UploadImages-Oh7Glr9A.cjs +0 -1
  86. package/dist/add-page-modal--6TTBRYa.cjs +0 -1
  87. package/dist/confirm-alert-C4M9eF-o.cjs +0 -1
  88. package/dist/defaultTheme-7VqqhOcp.cjs +0 -1
  89. package/dist/delete-page-modal-cFoL-wdo.cjs +0 -1
  90. package/dist/html-to-json-efmv1pCj.cjs +0 -1
  91. package/dist/index-h-hd6EvN.cjs +0 -1
  92. package/dist/page-viewer-2kwnKM6v.cjs +0 -1
  93. package/dist/project-general-setting-CnNL98NM.cjs +0 -1
  94. package/dist/project-seo-setting-mlxL_e2_.cjs +0 -1
  95. package/dist/single-page-detail-XfzrGlzA.cjs +0 -1
@@ -3,16 +3,15 @@ import T, { memo as f, useMemo as v, useCallback as R, useEffect as H } from "re
3
3
  import { useAtom as P } from "jotai";
4
4
  import { useDebouncedCallback as w } from "@react-hookz/web";
5
5
  import { Tree as A } from "react-arborist";
6
- import { E as D, r as b, s as z, a1 as _, bs as N, aS as E, t as L, bt as F, aR as V, bu as O, bv as $, h as U, Y as q, bw as y, ap as G, aq as K, ar as W, bx as Y, a5 as J, ac as Q, aM as X } from "./index-Gk6sASBd.js";
6
+ import { E as D, r as b, s as z, a1 as _, bs as N, aS as E, t as L, bt as F, aR as O, bu as V, bv as $, h as U, Y as q, bw as y, ap as G, aq as K, ar as W, bx as Y, a5 as J, ac as Q, aM as X } from "./index-CFUoB97-.js";
7
7
  import { c as M } from "./Functions-7jnEwJyw.js";
8
8
  import { BoxModelIcon as Z, BoxIcon as ee, DragHandleHorizontalIcon as te, ViewHorizontalIcon as se, BorderAllIcon as re, BorderTopIcon as oe, TableIcon as ne, DropdownMenuIcon as ce, RadiobuttonIcon as ae, InputIcon as ie, ButtonIcon as I, CheckboxIcon as le, GroupIcon as ue, SpaceBetweenVerticallyIcon as de, ColumnsIcon as xe, RowsIcon as k, TextIcon as C, SketchLogoIcon as pe, DividerHorizontalIcon as me, CodeIcon as he, CursorTextIcon as ge, VideoIcon as je, Link1Icon as fe, HeadingIcon as be, ImageIcon as ye, TrashIcon as ve, CopyIcon as Ie, TriangleRightIcon as ke } from "@radix-ui/react-icons";
9
9
  import { DatabaseIcon as Ce } from "lucide-react";
10
10
  import { find as B, first as Be } from "lodash-es";
11
11
  import "./_commonjsHelpers-UyOWmZb0.js";
12
12
  import "@chaibuilder/runtime";
13
- import "./STRINGS--j49GZJP.js";
14
- import "./MODIFIERS-dytZ-osO.js";
15
- import "./Class-lGzsNBOK.js";
13
+ import "./MODIFIERS-WQdaNvb8.js";
14
+ import "./Class-3k8xjeiM.js";
16
15
  import "clsx";
17
16
  import "tailwind-merge";
18
17
  import "react-i18next";
@@ -156,7 +155,7 @@ const S = (t) => {
156
155
  /* @__PURE__ */ e.jsxs(
157
156
  N,
158
157
  {
159
- disabled: !V(s == null ? void 0 : s._type),
158
+ disabled: !O(s == null ? void 0 : s._type),
160
159
  className: "flex items-center gap-x-4 text-xs",
161
160
  onClick: l,
162
161
  children: [
@@ -167,14 +166,14 @@ const S = (t) => {
167
166
  ),
168
167
  /* @__PURE__ */ e.jsx(Ne, {})
169
168
  ] });
170
- }, Se = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(O, { children: [
169
+ }, Se = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { children: [
171
170
  /* @__PURE__ */ e.jsx($, { children: t }),
172
171
  /* @__PURE__ */ e.jsx(Me, {})
173
172
  ] }) }), Re = f(({ node: t, style: r, dragHandle: s }) => {
174
173
  const l = U("outlineMenuItems", []), [, o] = q(), x = t.children.length > 0, { id: d, data: a, isSelected: m, willReceiveDrop: p, isDragging: h, isEditing: g, handleClick: j } = t, n = w((c) => o(c), [], 300), i = (c) => {
175
174
  c.stopPropagation(), t.toggle();
176
175
  }, u = (c) => {
177
- c.stopPropagation(), t.toggle(), j(c);
176
+ c.stopPropagation(), t.isOpen || t.toggle(), j(c);
178
177
  };
179
178
  return H(() => {
180
179
  const c = setTimeout(() => {
@@ -255,7 +254,7 @@ const S = (t) => {
255
254
  }));
256
255
  return y(l, o);
257
256
  };
258
- }, kt = () => {
257
+ }, It = () => {
259
258
  const [t] = P(Y), [r, s] = b(), l = J(), [, o] = Q(), { moveBlocks: x } = X(), d = Pe(), a = () => {
260
259
  s([]), o([]);
261
260
  }, m = ({ id: n, name: i, node: u }) => {
@@ -305,5 +304,5 @@ const S = (t) => {
305
304
  ) }) });
306
305
  };
307
306
  export {
308
- kt as default
307
+ It as default
309
308
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),m=require("react"),k=require("jotai"),I=require("@react-hookz/web"),B=require("react-arborist"),n=require("./index-F4AQQ6qq.cjs"),y=require("./Functions-N3yhPYKY.cjs"),s=require("@radix-ui/react-icons"),q=require("lucide-react"),f=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@chaibuilder/runtime");require("./MODIFIERS-9EwxLM8V.cjs");require("./Class-MmCxz2Ay.cjs");require("clsx");require("tailwind-merge");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");const v=t=>{switch(t.type){case"Image":return e.jsxRuntimeExports.jsx(s.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(s.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(s.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(s.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(s.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(s.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(s.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(s.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(s.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(s.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(s.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(s.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(s.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(s.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(s.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(s.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(s.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(s.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(s.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(s.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(q.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}},C={display:"flex",alignItems:"center",zIndex:1},T=m.memo(function({top:o,left:r}){const a={position:"absolute",pointerEvents:"none",top:o+"px",left:r+"px",right:0};return e.jsxRuntimeExports.jsx("div",{style:{...C,...a},children:e.jsxRuntimeExports.jsx("div",{className:"h-0.5 flex-1 rounded-[1px] bg-green-500"})})}),w=m.memo(function({children:o,isDragging:r}){return r?e.jsxRuntimeExports.jsx("div",{className:"pointer-events-none fixed left-0 top-0 z-[100] h-full w-full",children:o}):null}),D=m.memo(({id:t,isDragging:o,mouse:r})=>{const[a]=n.useBlocksStore(),i=m.useMemo(()=>a.find(d=>d._id===t),[a,t]),j=m.useMemo(()=>({transform:`translate(${(r==null?void 0:r.x)-10}px, ${(r==null?void 0:r.y)-10}px)`}),[r]);return r?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(w,{isDragging:o,children:e.jsxRuntimeExports.jsx("div",{className:"pointer-events-none absolute z-50 rounded border border-gray-200 bg-gray-100/80 font-semibold text-blue-600 shadow-md dark:border-gray-700 dark:bg-gray-800",style:j,children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex !cursor-grab items-center p-0.5","aria-label":`Type: ${i==null?void 0:i._type}`,children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:e.jsxRuntimeExports.jsx(v,{type:i==null?void 0:i._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:(i==null?void 0:i._name)||(i==null?void 0:i._type)})]})})})}):e.jsxRuntimeExports.jsx("div",{className:"hidden"})}),S=()=>{const[t]=n.useSelectedBlockIds(),o=n.useRemoveBlocks(),r=n.useSelectedBlock();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{disabled:!n.canDeleteBlock(r==null?void 0:r._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>o(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},N=()=>{const[t]=n.useSelectedBlockIds(),o=n.useDuplicateBlocks(),r=n.useSelectedBlock(),a=m.useCallback(()=>{o(t)},[t,o]);return e.jsxRuntimeExports.jsxs(n.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{disabled:!n.canDuplicateBlock(r==null?void 0:r._type),className:"flex items-center gap-x-4 text-xs",onClick:a,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(S,{})]})},_=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(n.ContextMenu,{children:[e.jsxRuntimeExports.jsx(n.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(N,{})]})}),M=m.memo(({node:t,style:o,dragHandle:r})=>{const a=n.useBuilderProp("outlineMenuItems",[]),[,i]=n.useHighlightBlockId(),j=t.children.length>0,{id:d,data:u,isSelected:h,willReceiveDrop:R,isDragging:g,isEditing:E,handleClick:b}=t,c=I.useDebouncedCallback(x=>i(x),[],300),l=x=>{x.stopPropagation(),t.toggle()},p=x=>{x.stopPropagation(),t.isOpen||t.toggle(),b(x)};return m.useEffect(()=>{const x=setTimeout(()=>{R&&!t.isOpen&&t.toggle()},500);return()=>clearTimeout(x)},[R,t]),e.jsxRuntimeExports.jsx(_,{id:d,children:e.jsxRuntimeExports.jsxs("div",{onClick:p,onMouseEnter:()=>c(d),style:o,"data-node-id":d,ref:r,className:y.cn("group flex !h-fit w-full items-center justify-between space-x-px py-px outline-none",h?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800",R&&n.canAcceptChildBlock(u._type,"Icon")?"bg-green-200":"",g&&"opacity-20"),children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:j&&e.jsxRuntimeExports.jsx("button",{onClick:l,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:e.jsxRuntimeExports.jsx(v,{type:u==null?void 0:u._type})}),E?e.jsxRuntimeExports.jsx(P,{node:t}):e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",onDoubleClick:x=>{x.stopPropagation(),t.edit(),t.deselect()},children:(u==null?void 0:u._name)||(u==null?void 0:u._type.split("/").pop())})]})]}),e.jsxRuntimeExports.jsx("div",{className:"invisible flex items-center space-x-1 pr-2 group-hover:visible",children:a.map(x=>e.jsxRuntimeExports.jsxs(n.Tooltip,{children:[e.jsxRuntimeExports.jsx(n.TooltipTrigger,{className:"cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",asChild:!0,children:m.createElement(x.item,{blockId:d})}),e.jsxRuntimeExports.jsx(n.TooltipContent,{className:"z-[9999]",children:x.tooltip})]}))})]})})}),P=({node:t})=>e.jsxRuntimeExports.jsx("input",{autoFocus:!0,className:"ml-2 w-full rounded-sm border border-black/30 bg-transparent px-1 text-[11px] outline-none",type:"text",defaultValue:t.data.name,onFocus:o=>o.currentTarget.select(),onBlur:o=>t.submit(o.currentTarget.value),onKeyDown:o=>{o.key==="Enter"&&t.submit(o.currentTarget.value)}}),A=()=>{const[t]=n.useBlocksStore();return(o,r)=>{var j;const a=(j=f.find(t,{_id:r}))==null?void 0:j._type,i=f.first(o.map(d=>{var u;return(u=f.find(t,{_id:d}))==null?void 0:u._type}));return n.canAcceptChildBlock(a,i)}},H=()=>{const[t]=k.useAtom(n.treeDSBlocks),[o,r]=n.useSelectedBlockIds(),a=n.useUpdateBlocksProps(),[,i]=n.useSelectedStylingBlocks(),{moveBlocks:j}=n.useBlocksStoreUndoableActions(),d=A(),u=()=>{r([]),i([])},h=({id:c,name:l,node:p})=>{a([c],{_name:l},p.data._name)},R=({dragIds:c,parentId:l,index:p})=>{d(c,l)&&j(c,l,p)},g=c=>{if(c.length===0)return;const l=c[0]?c[0].id:"";i([]),r([l])},E=c=>{var x;c.preventDefault();const l=c.target,p=l.getAttribute("data-node-id")||((x=l.closest("[data-node-id]"))==null?void 0:x.getAttribute("data-node-id"));p&&(i([]),r([p]))},b=I.useDebouncedCallback(({parentNode:c,dragNodes:l})=>{var p;return!n.canAcceptChildBlock(c==null?void 0:c.data._type,(p=l[0])==null?void 0:p.data._type)},[],300);return e.jsxRuntimeExports.jsx("div",{className:y.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"),onClick:()=>u(),children:e.jsxRuntimeExports.jsx("div",{id:"outline-view",className:"no-scrollbar h-full overflow-y-auto p-1 px-2 text-xs",children:e.jsxRuntimeExports.jsx(B.Tree,{height:800,className:"no-scrollbar !h-full max-w-full !overflow-y-auto !overflow-x-hidden",selection:o[0]||"",onRename:h,openByDefault:!1,onMove:R,rowHeight:20,data:t,renderCursor:T,onSelect:g,childrenAccessor:c=>c.children,width:"100%",renderDragPreview:D,indent:10,onContextMenu:E,disableDrop:b,idAccessor:"_id",children:M})})})};exports.default=H;
@@ -0,0 +1 @@
1
+ "use strict";const e="#styles:",o="#slots:",t="#i18n",i="outline",n=["hover","focus","focus-within","focus-visible","active","visited","target","first","last","only","odd","even","first-of-type","last-of-type","only-of-type","empty","disabled","checked","indeterminate","default","required","valid","invalid","in-range","out-of-range","placeholder-shown","autofill","read-only","open","before","after","first-letter","first-line","marker","selection","file","placeholder","ui-open","ui-disabled","ui-active","ui-selected","ui-checked","ui-not-open","ui-not-disabled","ui-not-active","ui-not-selected","ui-not-checked"],r={bodyFont:"Inter",headingFont:"Inter",roundedCorners:5,primaryColor:"#570df8",secondaryColor:"#f002b8",bodyBgDarkColor:"#031022",bodyBgLightColor:"#fcfcfc",bodyTextDarkColor:"#ffffff",bodyTextLightColor:"#000000"};exports.BRANDING_OPTIONS_DEFAULTS=r;exports.I18N_KEY=t;exports.MODIFIERS=n;exports.OUTLINE_KEY=i;exports.SLOT_KEY=o;exports.STYLES_KEY=e;
@@ -1,4 +1,4 @@
1
- const e = [
1
+ const e = "#styles:", o = "#slots:", t = "#i18n", i = "outline", n = [
2
2
  "hover",
3
3
  "focus",
4
4
  "focus-within",
@@ -47,7 +47,7 @@ const e = [
47
47
  "ui-not-active",
48
48
  "ui-not-selected",
49
49
  "ui-not-checked"
50
- ], o = {
50
+ ], r = {
51
51
  bodyFont: "Inter",
52
52
  headingFont: "Inter",
53
53
  roundedCorners: 5,
@@ -59,6 +59,10 @@ const e = [
59
59
  bodyTextLightColor: "#000000"
60
60
  };
61
61
  export {
62
- o as B,
63
- e as M
62
+ r as B,
63
+ t as I,
64
+ n as M,
65
+ i as O,
66
+ o as S,
67
+ e as a
64
68
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),i=require("lodash-es"),s=require("./index-Qk028f-N.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./index-l19JVVXI.cjs");require("i18next");require("react-i18next");require("./index-F4AQQ6qq.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-C_Eobs_d.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-9pTKItY-.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-YFrIG3L7.cjs"))),d=()=>{const{data:t=[],isLoading:q}=s.usePages(),{data:r}=s.useProject(),n=i.sortBy(i.filter(t,{type:"STATIC"}),o=>i.get(o,"uuid")===(r==null?void 0:r.homepage)?0:1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Pages"}),e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"text-sm text-blue-500 underline",children:"+ New Page"}),children:e.jsxRuntimeExports.jsx(a,{})})]}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1 divide-y-2",children:e.jsxRuntimeExports.jsx(x,{isLoading:q,pages:n})})]})};exports.default=d;
@@ -1,21 +1,20 @@
1
1
  import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import i, { Suspense as s } from "react";
3
3
  import { sortBy as a, filter as d, get as n } from "lodash-es";
4
- import { u as l, a as c } from "./index-llTXLDGE.js";
4
+ import { u as l, a as c } from "./index-f0AbmoYY.js";
5
5
  import "./_commonjsHelpers-UyOWmZb0.js";
6
- import "./index-SkyM3d6Q.js";
6
+ import "./index-lOJfSheQ.js";
7
7
  import "i18next";
8
8
  import "react-i18next";
9
- import "./index-Gk6sASBd.js";
9
+ import "./index-CFUoB97-.js";
10
10
  import "./Functions-7jnEwJyw.js";
11
11
  import "clsx";
12
12
  import "tailwind-merge";
13
13
  import "@chaibuilder/runtime";
14
14
  import "jotai";
15
- import "./STRINGS--j49GZJP.js";
15
+ import "./MODIFIERS-WQdaNvb8.js";
16
16
  import "@react-hookz/web";
17
- import "./MODIFIERS-dytZ-osO.js";
18
- import "./Class-lGzsNBOK.js";
17
+ import "./Class-3k8xjeiM.js";
19
18
  import "@radix-ui/react-toggle";
20
19
  import "class-variance-authority";
21
20
  import "@radix-ui/react-switch";
@@ -44,11 +43,11 @@ import "@floating-ui/react-dom";
44
43
  import "flagged";
45
44
  import "react-hotkeys-hook";
46
45
  import "sonner";
47
- import "./html-to-json-ngX9ef2u.js";
46
+ import "./html-to-json-p__Fgqdg.js";
48
47
  import "himalaya";
49
48
  import "lucide-react";
50
49
  import "./index-YpnaudSM.js";
51
- const x = i.lazy(() => import("./add-page-modal-k2Kb92HS.js")), u = i.lazy(() => import("./page-viewer-Pdg9F5Hv.js")), lt = () => {
50
+ const x = i.lazy(() => import("./add-page-modal-U7AUUrI1.js")), u = i.lazy(() => import("./page-viewer-jOwy--9A.js")), nt = () => {
52
51
  const { data: o = [], isLoading: m } = l(), { data: r } = c(), p = a(d(o, { type: "STATIC" }), (e) => n(e, "uuid") === (r == null ? void 0 : r.homepage) ? 0 : 1);
53
52
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
54
53
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
@@ -60,5 +59,5 @@ const x = i.lazy(() => import("./add-page-modal-k2Kb92HS.js")), u = i.lazy(() =>
60
59
  ] });
61
60
  };
62
61
  export {
63
- lt as default
62
+ nt as default
64
63
  };
@@ -1,18 +1,17 @@
1
1
  import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
- import m, { useRef as x, useEffect as a, Suspense as p } from "react";
2
+ import a, { useRef as x, useEffect as m, Suspense as p } from "react";
3
3
  import { isEqual as b, isEmpty as j } from "lodash-es";
4
- import { b9 as f, ba as n, bb as l, bc as c } from "./index-Gk6sASBd.js";
5
- import { b as h, a as g } from "./index-llTXLDGE.js";
4
+ import { b9 as f, ba as n, bb as l, bc as c } from "./index-CFUoB97-.js";
5
+ import { b as h, a as g } from "./index-f0AbmoYY.js";
6
6
  import "./_commonjsHelpers-UyOWmZb0.js";
7
7
  import "./Functions-7jnEwJyw.js";
8
8
  import "clsx";
9
9
  import "tailwind-merge";
10
10
  import "@chaibuilder/runtime";
11
11
  import "jotai";
12
- import "./STRINGS--j49GZJP.js";
12
+ import "./MODIFIERS-WQdaNvb8.js";
13
13
  import "@react-hookz/web";
14
- import "./MODIFIERS-dytZ-osO.js";
15
- import "./Class-lGzsNBOK.js";
14
+ import "./Class-3k8xjeiM.js";
16
15
  import "react-i18next";
17
16
  import "@radix-ui/react-toggle";
18
17
  import "class-variance-authority";
@@ -38,32 +37,32 @@ import "@radix-ui/react-context-menu";
38
37
  import "react-icons-picker";
39
38
  import "react-dom";
40
39
  import "react-quill";
41
- import "./index-SkyM3d6Q.js";
40
+ import "./index-lOJfSheQ.js";
42
41
  import "i18next";
43
42
  import "@floating-ui/react-dom";
44
43
  import "flagged";
45
44
  import "react-hotkeys-hook";
46
45
  import "sonner";
47
- import "./html-to-json-ngX9ef2u.js";
46
+ import "./html-to-json-p__Fgqdg.js";
48
47
  import "himalaya";
49
48
  import "lucide-react";
50
49
  import "./index-YpnaudSM.js";
51
- const N = m.lazy(() => import("./project-general-setting-f8Ebsn6K.js")), S = m.lazy(() => import("./project-seo-setting-pX34Qsym.js")), d = /* @__PURE__ */ t.jsx("div", { className: "px-3", children: /* @__PURE__ */ t.jsx("div", { className: "h-52 w-full animate-pulse rounded-md bg-gray-100" }) }), u = (e) => e && j(e.seoData) ? {
50
+ const N = a.lazy(() => import("./project-general-setting-3N8HZ2fe.js")), S = a.lazy(() => import("./project-seo-setting-bSiNgO_1.js")), d = /* @__PURE__ */ t.jsx("div", { className: "px-3", children: /* @__PURE__ */ t.jsx("div", { className: "h-52 w-full animate-pulse rounded-md bg-gray-100" }) }), u = (e) => e && j(e.seoData) ? {
52
51
  ...e,
53
52
  seoData: { title: "", description: "", image: "" }
54
53
  } : e;
55
- function ht() {
56
- const e = h(), { data: s } = g(), [r, i] = m.useState(
54
+ function ft() {
55
+ const e = h(), { data: s } = g(), [r, i] = a.useState(
57
56
  u(s || {})
58
57
  ), o = x(r);
59
- return a(
58
+ return m(
60
59
  () => () => {
61
60
  b(s, o.current) || e.mutate(o.current, {
62
61
  onSuccess: () => i(o.current)
63
62
  });
64
63
  },
65
64
  [o]
66
- ), a(() => {
65
+ ), m(() => {
67
66
  o.current = r;
68
67
  }, [r]), /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
69
68
  /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: /* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: "Website Settings" }) }),
@@ -81,5 +80,5 @@ function ht() {
81
80
  ] });
82
81
  }
83
82
  export {
84
- ht as default
83
+ ft as default
85
84
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),x=require("lodash-es"),s=require("./index-F4AQQ6qq.cjs"),a=require("./index-Qk028f-N.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("./index-l19JVVXI.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-C_Eobs_d.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-hK7I7FuN.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-x-FK0pez.cjs"))),c=e.jsxRuntimeExports.jsx("div",{className:"px-3",children:e.jsxRuntimeExports.jsx("div",{className:"h-52 w-full animate-pulse rounded-md bg-gray-100"})}),l=t=>t&&x.isEmpty(t.seoData)?{...t,seoData:{title:"",description:"",image:""}}:t;function q(){const t=a.useUpdateProject(),{data:n}=a.useProject(),[i,o]=r.useState(l(n||{})),u=r.useRef(i);return r.useEffect(()=>()=>{x.isEqual(n,u.current)||t.mutate(u.current,{onSuccess:()=>o(u.current)})},[u]),r.useEffect(()=>{u.current=i},[i]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Website Settings"})}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1",children:e.jsxRuntimeExports.jsxs(s.Accordion,{type:"single",className:"w-full",defaultValue:"GENERAL",children:[e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"GENERAL",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"General Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-2 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(d,{_projectData:i,seany:o})})})]}),e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"SEO",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"SEO Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-1 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(m,{_projectData:i,seany:o})})})]})]})})]})}exports.default=q;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),g=require("react"),X=require("@react-hookz/web"),t=require("lodash-es"),_=require("react-i18next"),x=require("@radix-ui/react-icons"),o=require("./index-F4AQQ6qq.cjs"),ae=require("./controls-KK2oLIa8.cjs"),M=require("lucide-react"),$=require("@chaibuilder/runtime"),W=require("./index-l19JVVXI.cjs"),z=require("./index-gi1LIOCw.cjs"),pe=require("@rjsf/core"),ue=require("@rjsf/validator-ajv8"),de=require("react-autosuggest"),xe=require("fuse.js"),D=require("./Class-MmCxz2Ay.cjs"),ce=require("./MODIFIERS-9EwxLM8V.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("jotai");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");function me(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>s[r]})}}return n.default=s,Object.freeze(n)}const q=me(g);function ge(s){const n=[],r={};function a(i,u){t.forEach(u,(l,m)=>{const d=i?`${i}.${m}`:m,c=t.isArray(l)?"list":typeof l;n.push(d),r[d]=c==="string"?"text":c==="object"?"model":c,c==="object"&&!t.isArray(l)&&a(d,l)})}return a("",t.omit(s,["styles","_type","_id","_name","_bindings"])),{paths:n,pathsType:r}}const Z=({data:s,fullView:n})=>{if(!s)return null;const r=typeof s;return n?typeof s=="object"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"h-3"}),e.jsxRuntimeExports.jsx(W.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(z.JsonView,{data:s,shouldExpandNode:z.allExpanded,style:{...z.defaultStyles,container:"max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]}):e.jsxRuntimeExports.jsxs("div",{className:"max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50",children:[e.jsxRuntimeExports.jsx("span",{className:"font-medium text-gray-800/80",children:"Content: "}),s]}):e.jsxRuntimeExports.jsx("div",{className:"w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50",children:t.truncate(r==="object"?JSON.stringify(s):s,{length:40})})},K=({type:s,value:n="",setValue:r,data:a,onChange:i,dataType:u,appliedBindings:l})=>{const{paths:m,pathsType:d}=ge(a),c=s==="PROP"?$.getBlockComponent(a==null?void 0:a._type):{},j=s==="PROP",[p,y]=g.useState(!1),b=g.useMemo(()=>s==="PROP"?m.filter(h=>!t.includes(l,h)&&t.get(c,`props.${t.first(t.split(h,"."))}.binding`)):m.filter(h=>u===t.get(d,h,"")),[s,m,l,u,c]);return g.useEffect(()=>{n&&i(n)},[n,s]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:t.startCase(t.toLower(s))}),e.jsxRuntimeExports.jsxs(o.Popover,{open:p,onOpenChange:y,children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",size:"sm",className:` ${t.isEmpty(n)?"w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white":"min-w-[350px] items-center justify-between"}`,children:n?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{className:"pr-8 text-sm",children:[j&&e.jsxRuntimeExports.jsx("span",{className:"mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500",children:t.startCase(u)}),n]}),e.jsxRuntimeExports.jsx("span",{className:"cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700",children:"Change"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["+ Set ",t.startCase(t.toLower(s))]})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{className:"z-[999] min-w-[300px] p-0",side:"right",align:"start",children:e.jsxRuntimeExports.jsxs(o.Command,{children:[e.jsxRuntimeExports.jsx(o.CommandInput,{placeholder:`Choose ${t.toLower(s)}...`}),e.jsxRuntimeExports.jsxs(o.CommandList,{children:[e.jsxRuntimeExports.jsx(o.CommandEmpty,{children:"No results found."}),e.jsxRuntimeExports.jsx(o.CommandGroup,{children:t.map(b,h=>e.jsxRuntimeExports.jsxs(o.CommandItem,{value:h,className:`cursor-pointer ${j?"flex items-center justify-between":"flex flex-col items-start justify-start"}`,onSelect:v=>{r(t.find(b,E=>E===v)||null),y(!1)},children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx(M.Check,{className:`h-4 w-4 text-green-500 ${n===h?"":"opacity-0"}`}),h]}),j?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("span",{className:"rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500",children:t.startCase(t.get(d,h,""))})}):e.jsxRuntimeExports.jsx("div",{className:"pl-6",children:e.jsxRuntimeExports.jsx(Z,{data:t.get(a,h)})})]},h))})]})]})})]})]}),!j&&!t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"pt-2",children:e.jsxRuntimeExports.jsx(Z,{data:t.get(a,n,""),fullView:!0})})]})},he=({appliedBindings:s=[],onAddBinding:n,editMode:r,item:a})=>{const[i,u]=g.useState(r?a.key:""),[l,m]=g.useState(r?a.value:""),d=o.useSelectedBlock(),[c]=W.useChaiExternalData(),j=g.useCallback((b,h)=>{if(t.isEmpty(b))return"";{const v=t.get(h==="PROP"?d:c,b,"");if(t.isArray(v))return"list";const E=typeof v;return E==="string"?"text":E==="object"?"model":E}},[d,c]),[p,y]=g.useState(r?j(a.key,"PROP"):"");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(o.DialogHeader,{children:[e.jsxRuntimeExports.jsx(o.DialogTitle,{children:"Add Data Binding"}),e.jsxRuntimeExports.jsx(o.DialogDescription,{className:"text-xs",children:"Add prop and path of binding. Click save when you're done."})]}),e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col gap-1",children:[e.jsxRuntimeExports.jsx(K,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",value:i,setValue:u,onChange:b=>{const h=j(b,"PROP");u(b),p!==h&&m(""),y(h)},data:d,dataType:p,appliedBindings:s}),e.jsxRuntimeExports.jsx("div",{className:"h-2"}),e.jsxRuntimeExports.jsx(K,{type:"PATH",isDisabled:t.isEmpty(i),placeholder:"Enter data path",value:l,setValue:m,onChange:b=>{const h=j(b,"PATH");m(p===h?b:"")},data:c,dataType:p,appliedBindings:s})]}),e.jsxRuntimeExports.jsx(o.DialogFooter,{children:e.jsxRuntimeExports.jsx(o.Button,{type:"submit",className:"mt-4",disabled:t.isEmpty(i)&&t.isEmpty(l),onClick:()=>n({key:i,value:l}),children:"Save"})})]})},se=({disabled:s,children:n,onAddBinding:r,appliedBindings:a,editMode:i=!0,item:u={}})=>{const[l,m]=g.useState(!1);return e.jsxRuntimeExports.jsxs(o.Dialog,{children:[e.jsxRuntimeExports.jsx(o.DialogTrigger,{disabled:s,asChild:!0,onClick:()=>m(!0),children:n}),l&&e.jsxRuntimeExports.jsx(o.DialogContent,{children:e.jsxRuntimeExports.jsx(he,{item:u,editMode:i,appliedBindings:a,onAddBinding:d=>{r(d),m(!1)}})})]})},ye=({item:s,onAddBinding:n,onRemove:r,selectedBlock:a,dataProvider:i,appliedBindings:u})=>{const[l,m]=g.useState("string"),d=(c,j)=>{if(t.isEmpty(c))return"";{const p=t.get(j==="PROP"?a:i,c,"");if(t.isArray(p))return"list";const y=typeof p;return y==="string"?"text":y==="object"?"model":y}};return g.useEffect(()=>m(()=>d(s.key,"PROP")),[s.key]),e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col rounded-md border border-gray-200 p-2",children:[e.jsxRuntimeExports.jsx("div",{className:"text-sm font-normal text-gray-500",children:s.key}),e.jsxRuntimeExports.jsx("div",{className:"font-medium leading-5",children:s.value}),e.jsxRuntimeExports.jsx(Z,{data:t.get(i,s.value,"")}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-2",children:[e.jsxRuntimeExports.jsx(se,{editMode:!0,onAddBinding:n,appliedBindings:u,item:s,children:e.jsxRuntimeExports.jsx(M.EditIcon,{className:"mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white"})}),e.jsxRuntimeExports.jsx(M.TrashIcon,{onClick:()=>r(),className:"mt-1 h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 duration-200 hover:scale-105 hover:bg-red-400 hover:text-white"})]}),!t.isEmpty(l)&&!t.isEmpty(s.key)&&e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600",children:t.startCase(l)})]})},je=({bindingData:s,onChange:n})=>{const r=o.useSelectedBlock(),[a]=W.useChaiExternalData(),i=$.getChaiDataProviders(),[u,l]=g.useState(t.map(s,(p,y)=>({key:y,value:p})));g.useEffect(()=>{l(t.map(s,(p,y)=>({key:y,value:p})))},[r==null?void 0:r._id,s]);const m=g.useMemo(()=>{if(t.isEmpty(a))return!0;if(t.isEmpty(u))return!1;const p=t.last(u);return t.isEmpty(p==null?void 0:p.key)||t.isEmpty(p==null?void 0:p.value)},[a,u]),d=p=>{const y=t.filter(u,b=>b.key!==p.key);l([...y,p]),j([...y,p])},c=p=>{const y=t.filter(u,(b,h)=>p!==h);j([...y])},j=g.useCallback((p=[])=>{if(l(p),t.isEmpty(p)){n({});return}const y={};t.forEach(p,b=>{!t.isEmpty(b==null?void 0:b.key)&&!t.isEmpty(b==null?void 0:b.value)&&t.set(y,b.key,b.value)}),n(y)},[n]);return t.isEmpty(i)?e.jsxRuntimeExports.jsx("div",{className:"flex w-full items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 text-xs text-gray-500",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[t.map(u,(p,y)=>e.jsxRuntimeExports.jsx(ye,{item:p,onAddBinding:d,onRemove:()=>c(y),selectedBlock:r,dataProvider:a,appliedBindings:t.map(u,"key")},p.key)),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{disabled:t.isEmpty(a),className:"w-full",children:e.jsxRuntimeExports.jsx(se,{disabled:m,appliedBindings:t.map(u,"key"),onAddBinding:d,children:e.jsxRuntimeExports.jsx("span",{className:`w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${m?"cursor-not-allowed bg-gray-200 text-gray-400":"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,children:t.isEmpty(a)?e.jsxRuntimeExports.jsx("small",{className:"text-[9.5px] text-gray-500",children:"No data provider has been set up for this page"}):"+ Add Data Binding"})})}),m&&e.jsxRuntimeExports.jsx(o.TooltipContent,{sideOffset:-55,className:"text-[11px]",children:t.isEmpty(a)?"No data provider has been set up for this page.":"Complete last added data binding to add more"})]})]})},be=()=>e.jsxRuntimeExports.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"}),F=g.memo(({id:s,properties:n,formData:r,onChange:a})=>{const[i,u]=g.useState(r),l={type:"object",properties:{}},m={};return Object.keys(n).forEach(d=>{const c=n[d];if(t.includes(["slot","styles"],c.type))return;const j=d;l.properties[j]=o.getBlockJSONFromSchemas(c),m[j]=o.getBlockJSONFromUISchemas(c)}),g.useEffect(()=>{u(r)},[s]),e.jsxRuntimeExports.jsx(pe,{widgets:{binding:be,richtext:o.RichTextEditorField,icon:o.IconPickerField,image:o.ImagePickerField},fields:{link:o.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!1,validator:ue,uiSchema:m,schema:l,formData:i,onChange:({formData:d},c)=>{c&&(u(d),a({formData:d},c))}})});function fe(){const s=o.useSelectedBlock(),n=o.useUpdateBlocksPropsRealtime(),r=o.useUpdateBlocksProps(),a=$.getBlockComponent(s._type),i={...s},[u,l]=g.useState(i),m=o.useBuilderProp("dataBindingSupport",!1),d=({formData:h},v,E)=>{if(v&&(u==null?void 0:u._id)===s._id){const S=v.replace("root.","");r([s._id],{[S]:t.get(h,S)},E)}},c=g.useCallback(t.debounce(({formData:h},v,E)=>{d({formData:h},v,E),l(h)},1500),[s==null?void 0:s._id]),j=({formData:h},v)=>{if(v){const E=v.replace("root.","");n([s._id],{[E]:t.get(h,E)}),c({formData:h},v,{[E]:t.get(u,E)})}},p={_name:ae.u({title:"Name",default:t.get(s,"_name",s._type)})},y=t.keys(t.get(i,"_bindings",{})),b=g.useMemo(()=>{const h=t.cloneDeep(t.get(a,"props",{}));return m&&t.each(y,v=>delete h[v]),h},[a,y,m]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(F,{id:s==null?void 0:s._id,onChange:j,formData:i,properties:p}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),m?e.jsxRuntimeExports.jsxs(o.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"bg-gray-100 px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(s,"_bindings",{}))?"bg-gray-300":"bg-blue-500"}`}),"Data Binding"]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"px-4 pt-4",children:e.jsxRuntimeExports.jsx(je,{bindingData:t.get(s,"_bindings",{}),onChange:h=>{d({formData:{_bindings:h}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"bg-gray-100 px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-[8px] w-[8px] rounded-full bg-blue-500"}),"Static Content"]})}),e.jsxRuntimeExports.jsxs(o.AccordionContent,{className:"pt-4",children:[t.isEmpty(y)?null:e.jsxRuntimeExports.jsxs("div",{className:"mx-4 mb-1 mt-0 rounded-sm border border-orange-500 bg-orange-100 p-1 text-xs text-orange-500",children:["Data binding is set for ",e.jsxRuntimeExports.jsx("b",{children:t.map(y,t.capitalize).join(", ")})," ",y.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(F,{id:s==null?void 0:s._id,onChange:j,formData:i,properties:b})]})]})]}):e.jsxRuntimeExports.jsx(F,{id:s==null?void 0:s._id,onChange:j,formData:i,properties:b}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const J=new xe(D.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function ve(){var S;const[s]=o.useSelectedStylingBlocks(),n=o.useSelectedBlock(),r=o.useAddClassesToBlocks(),a=o.useRemoveClassesFromBlocks(),[i]=o.useSelectedBlockIds(),[u,l]=g.useState(""),m=(S=t.first(s))==null?void 0:S.prop,d=t.reject((t.get(n,m,"").replace(ce.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),c=()=>{const w=u.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");r(i,w,!0),l("")},[j,p]=g.useState([]),y=({value:w})=>{const I=w.trim().toLowerCase(),H=I.match(/.+:/g);let C=[];if(H&&H.length>0){const[T]=H,V=I.replace(T,"");C=J.search(V).map(f=>({...f,item:{...f.item,name:T+f.item.name}}))}else C=J.search(I);p(t.map(C,"item"))},b=()=>{p([])},h=w=>w.name,v=w=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:w.name}),E={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:u,onKeyDown:w=>{w.key==="Enter"&&u.trim()!==""&&c()},onChange:(w,{newValue:I})=>l(I),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"};return e.jsxRuntimeExports.jsxs("div",{className:`no-scrollbar flex ${j.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(o.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(de,{suggestions:j,onSuggestionsFetchRequested:y,onSuggestionsClearRequested:b,getSuggestionValue:h,renderSuggestion:v,inputProps:E,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:c,disabled:u.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(x.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(d)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-10 w-full items-center justify-center text-center text-sm text-gray-400",children:"No class added"}),q.Children.toArray(d.map(w=>e.jsxRuntimeExports.jsxs("div",{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",children:[w,e.jsxRuntimeExports.jsx(x.Cross2Icon,{onClick:()=>a(i,[w]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},w)))]})]})}const N=["px","%","em","rem","ch","vh","vw"],Re={heading:"flex.heading",items:[{type:"arbitrary",label:"flex.basis",units:N,property:"flexBasis"},{type:"range",label:"flex.order",property:"order"},{type:"dropdown",label:"flex.flex",property:"flexGrowShrink"},{type:"dropdown",label:"flex.grow",property:"flexGrow"},{type:"dropdown",label:"flex.shrink",property:"flexShrink"}]},Ee={heading:"grid.heading",items:[{type:"range",label:"grid.col_span",property:"gridColSpan"},{type:"range",label:"grid.col_start",property:"gridColStart"},{type:"range",label:"grid.col_end",property:"gridColEnd"},{type:"range",label:"grid.row_span",property:"gridRowSpan"},{type:"range",label:"grid.row_start",property:"gridRowStart"},{type:"range",label:"grid.row_end",property:"gridRowEnd"},{type:"range",label:"grid.order",property:"order"}]},we=[{heading:"layout.heading",items:[{type:"arbitrary",label:"layout.width",units:N.concat("auto"),property:"width"},{type:"arbitrary",label:"layout.height",units:N.concat("auto"),property:"height"},{styleType:"multiple",label:"layout.margin",negative:!0,units:[...N,"auto"],options:[{key:"margin",label:"layout.margin_all"},{key:"marginX",label:"layout.margin_lr"},{key:"marginY",label:"layout.margin_tb"},{key:"marginTop",label:"layout.margin_top"},{key:"marginRight",label:"layout.margin_right"},{key:"marginBottom",label:"layout.margin_bottom"},{key:"marginLeft",label:"layout.margin_left"}]},{styleType:"multiple",label:"layout.padding",options:[{key:"padding",label:"layout.padding_all"},{key:"paddingX",label:"layout.padding_lr"},{key:"paddingY",label:"layout.padding_tb"},{key:"paddingTop",label:"layout.padding_top"},{key:"paddingRight",label:"layout.padding_right"},{key:"paddingBottom",label:"layout.padding_bottom"},{key:"paddingLeft",label:"layout.padding_left"}]},{styleType:"multiple",label:"layout.space_bt",options:[{key:"spaceX",label:"layout.space_lr"},{key:"spaceY",label:"layout.space_tb"}]}]},{heading:"size.heading",items:[{styleType:"accordion",heading:"size.min_width_height",items:[{type:"arbitrary",label:"size.min_width",units:N.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"size.min_height",units:N.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"size.max_width_height",items:[{type:"arbitrary",label:"size.max_width",units:N.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"size.max_height",units:N.concat("auto"),property:"maxHeight"}]},{styleType:"accordion",heading:"size.object_options_aspect_ratio",items:[{type:"dropdown",label:"size.aspect",property:"aspectRatio"},{type:"dropdown",label:"size.fit",property:"objectFit"},{type:"dropdown",label:"size.position",property:"objectPosition"}]}]},{heading:"display.heading",items:[{type:"dropdown",label:"display.display",property:"display",units:N},{styleType:"accordion",heading:"display.flex_options",items:[{type:"dropdown",label:"display.flex_direction",property:"flexDirection"},{type:"dropdown",label:"display.flex_wrap",property:"flexWrap"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"flex"}},{styleType:"accordion",heading:"display.grid_options",items:[{type:"range",label:"display.grid_columns",property:"gridColumns"},{type:"range",label:"display.grid_rows",property:"gridRows"},{type:"dropdown",label:"display.grid_auto_flow",property:"gridAutoFlow"},{type:"dropdown",label:"display.grid_auto_cols",property:"gridAutoColumns"},{type:"dropdown",label:"display.grid_auto_rows",property:"gridAutoRows"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",units:["px","rem"],options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"grid"}},{styleType:"accordion",heading:"display.visibility_opacity",items:[{type:"dropdown",label:"display.visibility",property:"visibility",units:N},{type:"arbitrary",label:"display.opacity",property:"opacity",units:["-"]}]}]},{heading:"position.heading",items:[{type:"icons",label:"position.position",property:"position"},{styleType:"accordion",heading:"position.options",items:[{styleType:"multiple",label:"position.direction",options:[{key:"top",label:"position.top"},{key:"right",label:"position.right"},{key:"bottom",label:"position.bottom"},{key:"left",label:"position.left"}]},{styleType:"multiple",label:"position.inset",options:[{key:"inset",label:"position.all"},{key:"insetX",label:"position.lr"},{key:"insetY",label:"position.tb"}]},{type:"arbitrary",label:"position.z_index",units:["-","auto"],property:"zIndex"}]},{styleType:"accordion",heading:"position.float_clear",items:[{type:"icons",label:"position.float",property:"float"},{type:"dropdown",label:"position.clear",property:"clear"}]},{styleType:"accordion",heading:"position.overflow_overscroll",items:[{styleType:"multiple",type:"dropdown",label:"position.overflow",options:[{key:"overflow",label:"position.all"},{key:"overflowX",label:"position.lr"},{key:"overflowY",label:"position.tb"}]},{styleType:"multiple",type:"dropdown",label:"position.overscroll",options:[{key:"overscroll",label:"position.all"},{key:"overscrollX",label:"position.lr"},{key:"overscrollY",label:"position.tb"}]}]}]},{heading:"typography.heading",items:[{type:"dropdown",property:"fontFamily",label:"typography.font"},{type:"arbitrary",property:"fontSize",label:"typography.size",units:N},{type:"arbitrary",property:"lineHeight",label:"typography.height",units:N.concat("-")},{type:"range",property:"fontWeight",label:"typography.weight"},{type:"color",property:"textColor",label:"typography.color"},{styleType:"accordion",heading:"typography.alignments",items:[{type:"dropdown",property:"textAlign",label:"typography.align"},{type:"dropdown",property:"verticalAlign",label:"typography.valign"}]},{styleType:"accordion",heading:"typography.spacing_decoration_more",items:[{type:"dropdown",property:"letterSpacing",label:"typography.spacing"},{type:"dropdown",property:"textDecoration",label:"typography.decoration"},{type:"range",property:"textDecorationThickness",label:"typography.thickness"},{type:"dropdown",property:"textTransform",label:"typography.transform"}]},{styleType:"accordion",heading:"typography.whitespace_breaks",items:[{type:"dropdown",property:"whitespace",label:"typography.whitespace"},{type:"dropdown",property:"wordbreak",label:"typography.wordbreak"}]}]},{heading:"background.heading",items:[{type:"color",label:"background.bgcolor",property:"backgroundColor"},{styleType:"accordion",heading:"background.position_size_more",items:[{type:"dropdown",label:"background.attachment",property:"backgroundAttachment"},{type:"dropdown",label:"background.clipping",property:"backgroundClip"},{type:"dropdown",label:"background.origin",property:"backgroundOrigin"},{type:"dropdown",label:"background.position",property:"backgroundPosition"},{type:"dropdown",label:"background.repeat",property:"backgroundRepeat"},{type:"dropdown",label:"background.size",property:"backgroundSize"}]},{type:"dropdown",label:"background.gradient",property:"backgroundGradient"},{styleType:"accordion",heading:"background.gradient_colors",items:[{type:"color",label:"background.from_color",property:"fromColor"},{type:"color",label:"background.via_color",property:"viaColor"},{type:"color",label:"background.to_color",property:"toColor"}]}]},{heading:"border.heading",items:[{styleType:"multiple",type:"dropdown",label:"border.width",options:[{key:"border",label:"border.all"},{key:"borderX",label:"border.lr"},{key:"borderY",label:"border.tb"},{key:"borderTop",label:"border.top"},{key:"borderRight",label:"border.right"},{key:"borderBottom",label:"border.bottom"},{key:"borderLeft",label:"border.left"}]},{styleType:"multiple",type:"dropdown",label:"border.corners",options:[{key:"borderRadius",label:"border.all"},{key:"borderRadiusTop",label:"border.top"},{key:"borderRadiusRight",label:"border.right"},{key:"borderRadiusBottom",label:"border.bottom"},{key:"borderRadiusLeft",label:"border.left"},{key:"borderRadiusTopLeft",label:"border.top_left"},{key:"borderRadiusTopRight",label:"border.top_right"},{key:"borderRadiusBottomRight",label:"border.bottom_right"},{key:"borderRadiusBottomLeft",label:"border.bottom_left"}]},{type:"color",label:"border.color",property:"borderColor"},{type:"dropdown",label:"border.style",property:"borderStyle"},{styleType:"accordion",heading:"border.divide_options",items:[{styleType:"multiple",type:"range",label:"border.width",options:[{key:"divideXWidth",label:"border.lr"},{key:"divideYWidth",label:"border.tb"}]},{type:"color",label:"border.divide_color",property:"divideColor"},{type:"dropdown",label:"border.divide_style",property:"divideStyle"}]},{styleType:"accordion",heading:"border.outline_styling",items:[{type:"range",label:"border.outline_width",property:"outlineWidth"},{type:"range",label:"border.outline_offset",property:"outlineOffset"},{type:"dropdown",label:"border.outline_style",property:"outlineStyle"}]},{styleType:"accordion",heading:"border.ring_options",items:[{type:"range",label:"border.ring_width",property:"ringWidth"},{type:"color",label:"border.ring_color",property:"ringColor"},{type:"range",label:"border.ring_offset_width",property:"ringOffsetWidth"},{type:"color",label:"border.ring_offset_color",property:"ringOffsetColor"}]}]},{heading:"effect.heading",items:[{type:"range",label:"effect.shadow",property:"boxShadow"},{type:"color",label:"effect.color",property:"boxShadowColor"},{type:"dropdown",label:"effect.cursor",property:"cursor"},{styleType:"accordion",heading:"effect.blend_cursor",items:[{type:"dropdown",label:"effect.mix_blend",property:"mixBlendMode"},{type:"dropdown",label:"effect.bg_blend",property:"bgBlendMode"}]},{styleType:"accordion",heading:"effect.transform",items:[{type:"dropdown",label:"effect.origin",property:"transformOrigin"},{styleType:"multiple",label:"effect.scale",units:["-"],options:[{key:"scale",label:"effect.all"},{key:"scaleX",label:"effect.lr"},{key:"scaleY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.skew",units:["deg"],options:[{key:"skewX",label:"effect.lr"},{key:"skewY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.translate",negative:!0,options:[{key:"translateX",label:"effect.lr"},{key:"translateY",label:"effect.tb"}]},{type:"arbitrary",units:["deg"],negative:!0,label:"effect.rotate",property:"rotate"}]},{styleType:"accordion",heading:"effect.animation",items:[{type:"dropdown",label:"effect.animation",property:"animation"},{type:"dropdown",label:"effect.transition",property:"transition"},{type:"dropdown",label:"effect.easing",property:"transitionEase"},{type:"arbitrary",units:["ms"],label:"effect.duration",property:"duration"},{type:"arbitrary",units:["ms"],label:"effect.delay",property:"delay"}]}]},{heading:"classes.heading",items:[{component:ve}]}],re={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:x.EyeOpenIcon,invisible:x.EyeClosedIcon,hidden:x.EyeClosedIcon,gap:x.BorderAllIcon,gapX:x.WidthIcon,gapY:x.HeightIcon,spaceX:x.WidthIcon,spaceY:x.HeightIcon,overscroll:x.BorderAllIcon,overscrollX:x.WidthIcon,overscrollY:x.HeightIcon,overflow:x.BorderAllIcon,overflowX:x.WidthIcon,overflowY:x.HeightIcon,top:x.ArrowUpIcon,right:x.ArrowRightIcon,bottom:x.ArrowDownIcon,left:x.ArrowLeftIcon,inset:x.BorderAllIcon,insetX:x.WidthIcon,insetY:x.HeightIcon,border:x.BorderAllIcon,borderX:x.WidthIcon,borderY:x.HeightIcon,borderTop:x.ArrowUpIcon,borderRight:x.ArrowRightIcon,borderBottom:x.ArrowDownIcon,borderLeft:x.ArrowLeftIcon,borderRadius:x.BorderAllIcon,borderRadiusX:x.WidthIcon,borderRadiusY:x.HeightIcon,borderRadiusTop:x.ArrowUpIcon,borderRadiusRight:x.ArrowRightIcon,borderRadiusBottom:x.ArrowDownIcon,borderRadiusLeft:x.ArrowLeftIcon,borderRadiusTopLeft:x.ArrowTopLeftIcon,borderRadiusTopRight:x.ArrowTopRightIcon,borderRadiusBottomRight:x.ArrowBottomRightIcon,borderRadiusBottomLeft:x.ArrowBottomLeftIcon,divideXWidth:x.WidthIcon,divideYWidth:x.HeightIcon,scale:x.BorderAllIcon,scaleX:x.WidthIcon,scaleY:x.HeightIcon,skewX:x.WidthIcon,skewY:x.HeightIcon,translateX:x.WidthIcon,translateY:x.HeightIcon,padding:x.BorderAllIcon,paddingX:x.WidthIcon,paddingY:x.HeightIcon,paddingTop:x.ArrowUpIcon,paddingRight:x.ArrowRightIcon,paddingBottom:x.ArrowDownIcon,paddingLeft:x.ArrowLeftIcon,margin:x.BorderAllIcon,marginX:x.WidthIcon,marginY:x.HeightIcon,marginTop:x.ArrowUpIcon,marginRight:x.ArrowRightIcon,marginBottom:x.ArrowDownIcon,marginLeft:x.ArrowLeftIcon,textLeft:x.AlignLeftIcon,textCenter:x.AlignCenterHorizontallyIcon,textRight:x.AlignRightIcon,textJustify:x.StretchHorizontallyIcon,italic:x.FontItalicIcon,underline:x.UnderlineIcon,overline:x.OverlineIcon,uppercase:x.LetterCaseUppercaseIcon,block:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":x.Cross2Icon,fixed:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{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",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",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",fill:"currentColor"})]}),static:x.Cross1Icon},L=g.createContext({canReset:!1,canChange:!0}),Ce=({children:s,canReset:n=!1,canChange:r=!0})=>e.jsxRuntimeExports.jsx(L.Provider,{value:{canReset:n,canChange:r},children:s}),oe=({label:s,property:n,onChange:r})=>{const a=g.useMemo(()=>t.get(D.CLASSES_LIST,`${n}.classes`,[""]),[n]),i=O(n),u=g.useMemo(()=>t.get(i,"cls",""),[i]),{canChange:l}=g.useContext(L),m=/\[.*\]/g.test(u);return e.jsxRuntimeExports.jsx("div",{className:s?"w-full rounded":"grow",children:m?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(o.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:u}),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(x.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(U,{rounded:s,onChange:d=>r(d,n),selected:u,options:a,disabled:!l})})};function U({selected:s,onChange:n,rounded:r=!1,options:a,disabled:i=!1}){const u=s.replace(/.*:/g,"").trim(),{undo:l,redo:m}=o.useUndoManager();return e.jsxRuntimeExports.jsxs("select",{disabled:!a.length||i,className:`${r?"rounded-md border border-border":"border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:d=>n(d.target.value),onKeyDown:d=>{d.ctrlKey&&(d.key==="z"&&l(),d.key==="y"&&m())},value:u,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),g.Children.toArray(a.map(d=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:d,children:d})))]})}const ke=({property:s,onChange:n})=>{const{canReset:r,canChange:a}=g.useContext(L),i=O(s),u=g.useMemo(()=>t.get(i,"cls",""),[i]),l=g.useMemo(()=>t.get(D.CLASSES_LIST,`${s}.classes`,[""]),[s]),m=l.indexOf(u)>-1?l.indexOf(u):0,d=/\[.*\]/g.test(u);return e.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:d?e.jsxRuntimeExports.jsx("div",{className:"py-[5px] px-2",children:u}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",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",disabled:!a&&(!r||m-1<0),onClick:()=>n(t.nth(l,m-1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(x.MinusIcon,{className:!a&&(!r||m-1<0)?"text-gray-500":"text-black/60 dark:text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(oe,{label:!1,property:s,onChange:n})}),e.jsxRuntimeExports.jsx("button",{type:"button",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",disabled:!a&&(!r||m+1>=l.length),onClick:()=>n(t.nth(l,m+1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(x.PlusIcon,{className:!a&&(!r||m+1>=l.length)?"text-gray-500":"text-black/60 dark:text-white/60"})})})]})})},Ne=({property:s,onChange:n})=>{const r=g.useMemo(()=>t.get(D.CLASSES_LIST,`${s}.classes`,[""]),[s]),{canChange:a}=g.useContext(L),i=O(s),u=g.useMemo(()=>t.get(i,"cls",""),[i]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(r,l=>e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!a,onClick:()=>n(l,s),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${u===l?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:g.createElement(t.get(re,l,x.BoxIcon))})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(l))})]}))})},Se={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},Te=({property:s,onChange:n})=>{const r=O(s),a=g.useMemo(()=>t.get(r,"cls",""),[r]),{canChange:i}=g.useContext(L),[u,l]=g.useState([]),[m,d]=g.useState({color:"",shade:""}),c=a.split("-"),j=t.get(c,"1",""),p=t.get(c,"2",""),y=g.useCallback(h=>{["current","inherit","transparent","black","white"].includes(h)?(l([]),d({color:h})):(l(["50","100","200","300","400","500","600","700","800","900"]),d(v=>({...v,color:h,shade:v.shade?v.shade:"500"})))},[l,d]);g.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(j))return l([]);l(["50","100","200","300","400","500","600","700","800","900"])},[j]);const b=g.useCallback(h=>{d({color:j,shade:h})},[j]);return g.useEffect(()=>{d({color:"",shade:""})},[r]),g.useEffect(()=>{const v=`${t.get(Se,s,"")}-${m.color}${m.shade?`-${m.shade}`:""}`;v.match(new RegExp(t.get(D.CLASSES_LIST,`${s}.regExp`,"")))&&n(v,s)},[m,n,s]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(U,{disabled:!i,rounded:!0,selected:j,onChange:y,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:e.jsxRuntimeExports.jsx(U,{rounded:!0,selected:p,disabled:!j||!i,onChange:b,options:u})})]})},Q=(s,n)=>{s=s.toLowerCase();let r=s.trim().replace(/ |\+/g,"");if((r==="auto"||r==="none")&&n.includes(r))return{value:"",unit:r};const a=n.length?new RegExp(n.join("|"),"g"):/XXXXXX/g;r=r.replace(a,"");const i=s.match(a),u=i&&i.length>1,l=!t.isEmpty(r)&&Number.isNaN(Number(r));return u||l?{error:"Invalid value"}:i&&(i[0]==="auto"||i[0]==="none")?{value:i[0],unit:""}:{value:r,unit:i?i[0]:""}};const Ie=s=>{const n=s.startsWith("-")?"-":"",r=s.split("-").pop();if(["auto","none"].includes(r))return{value:"",unit:r};if(r==="px")return{value:"1",unit:"px"};if(r==="screen")return{value:"100",unit:s.indexOf("w-")!==-1?"vw":"vh"};if(r==="full")return{value:"100",unit:"%"};if(t.includes(s,"skew-"))return{value:`${n}${r}`,unit:"deg"};if(t.includes(s,"rotate-"))return{value:`${n}${r}`,unit:"deg"};if(t.includes(s,"opacity-"))return{value:`${r/100}`,unit:"-"};if(t.includes(s,"duration-")||t.includes(s,"delay-"))return{value:`${r}`,unit:"ms"};if(t.includes(s,"translate-")&&!r.includes("/"))return{value:`${n}${`${r/4}`}`,unit:"rem"};if(t.includes(s,"scale-"))return{value:`${n}${`${r/100}`}`,unit:"-"};if(t.startsWith(s,"border")){const a=s.match(/border-?(x|y|t|r|b|l)?\d+/g);if(a)return{value:a[0].split("-").pop(),unit:"px"};if(s.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(t.startsWith(s,"max-w-")){if(s==="max-w-screen-sm")return{value:"640",unit:"px"};if(s==="max-w-screen-md")return{value:"768",unit:"px"};if(s==="max-w-screen-lg")return{value:"1024",unit:"px"};if(s==="max-w-screen-xl")return{value:"1280",unit:"px"};if(s==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(r==="xs")return{value:"320",unit:"px"};if(r==="sm")return{value:"384",unit:"px"};if(r==="md")return{value:"448",unit:"px"};if(r==="lg")return{value:"512",unit:"px"};if(r==="xl")return{value:"576",unit:"px"};if(r==="2xl")return{value:"672",unit:"px"};if(r==="3xl")return{value:"768",unit:"px"};if(r==="4xl")return{value:"896",unit:"px"};if(r==="5xl")return{value:"1024",unit:"px"};if(r==="6xl")return{value:"1152",unit:"px"};if(r==="7xl")return{value:"1280",unit:"px"};if(r==="prose")return{value:"65",unit:"ch"}}if(t.startsWith(s,"text-")){if(r==="xs")return{value:"12",unit:"px"};if(r==="sm")return{value:"14",unit:"px"};if(r==="base")return{value:"16",unit:"px"};if(r==="lg")return{value:"18",unit:"px"};if(r==="xl")return{value:"20",unit:"px"};if(r==="2xl")return{value:"24",unit:"px"};if(r==="3xl")return{value:"30",unit:"px"};if(r==="4xl")return{value:"36",unit:"px"};if(r==="5xl")return{value:"48",unit:"px"};if(r==="6xl")return{value:"60",unit:"px"};if(r==="7xl")return{value:"72",unit:"px"};if(r==="8xl")return{value:"96",unit:"px"};if(r==="9xl")return{value:"128",unit:"px"}}if(t.startsWith(s,"leading-")){if(r==="none")return{value:"1",unit:"-"};if(r==="tight")return{value:"1.25",unit:"-"};if(r==="snug")return{value:"1.375",unit:"-"};if(r==="normal")return{value:"1.5",unit:"-"};if(r==="relaxed")return{value:"1.625",unit:"-"};if(r==="loose")return{value:"2",unit:"-"}}if(t.startsWith(s,"tracking-")){if(r==="tighter")return{value:"-0.05",unit:"em"};if(r==="tight")return{value:"-0.025",unit:"em"};if(r==="normal")return{value:"0",unit:"em"};if(r==="wide")return{value:"0.025",unit:"em"};if(r==="wider")return{value:"0.05",unit:"em"};if(r==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(r))return{value:s,unit:"class"};if(r.includes("/")){const[a,i]=t.map(r.split("/"),u=>parseInt(u,10));return{value:n+(a/i*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(r))?{value:`${n+parseFloat(r)*4}`,unit:"px"}:{value:r,unit:"class"}};const _e=s=>{if(t.isEmpty(s))return{value:"",unit:""};const n=s.match(/\[.*\]/g);if(n===null)return He(s);const r=t.get(n,"0","").replace(/\[|\]/g,""),a=s.startsWith("-")?"-":"",i=t.first(r.match(/\d+.\d+|\d+/g));return{value:`${a}${i}`,unit:r.replace(i,"")}},He=s=>t.isEmpty(s)?{value:"",unit:""}:Ie(s),ne=g.createContext({setDragData:()=>{}}),Be=({unit:s,currentValue:n,onDrag:r,onDragEnd:a,onDragStart:i,negative:u,cssProperty:l})=>{const{setDragData:m}=g.useContext(ne);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:d=>{const c={onDrag:r,onDragEnd:a,dragging:!0,dragStartY:d.pageY,dragStartValue:`${n}`,dragUnit:s,negative:u,cssProperty:l};i(c),m(c)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:e.jsxRuntimeExports.jsx(x.RowSpacingIcon,{})})},Ve=({onSelect:s,current:n,units:r})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:r.map(a=>e.jsxRuntimeExports.jsx(o.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:n===a?"primary":void 0,size:"sm",onClick:i=>{i.stopPropagation(),s(a)},children:a},a))}),ee=50,De=s=>{const[n,r]=g.useState(!1),[a,i]=g.useState(""),{currentClass:u,onChange:l,classPrefix:m,cssProperty:d,units:c,negative:j}=s,[p,y]=g.useState(d!=null&&d.toLowerCase().includes("width")?"%":c[0]),[b,h]=g.useState(!1),[v,E]=g.useState(""),[S,w]=g.useState(!1),[I,H]=g.useState(!1);g.useEffect(()=>{const{value:f,unit:R}=_e(u);if(R===""){i(f),y(d!=null&&d.toLowerCase().includes("width")?"%":t.first(c));return}y(R),i(R==="class"||t.isEmpty(f)?"":f)},[u,d,c]);const C=X.useThrottledCallback(f=>l(f),[l],ee),T=X.useThrottledCallback(f=>l(f,!1),[l],ee),V=g.useCallback((f=!1)=>{const R=Q(`${a}`,c);if(t.get(R,"error",!1)){h(!0);return}const k=t.get(R,"unit")!==""?t.get(R,"unit"):p;if(k==="auto"||k==="none"){C(`${m}${k}`);return}if(t.get(R,"value")==="")return;const P=`${t.get(R,"value","").startsWith("-")?"-":""}${m}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;f?T(P):C(P)},[C,T,a,p,m,c]),A=g.useCallback(f=>{const R=Q(`${a}`,c);if(t.get(R,"error",!1)){h(!0);return}if(f==="auto"||f==="none"){C(`${m}${f}`);return}if(t.get(R,"value")==="")return;const k=t.get(R,"unit")!==""?t.get(R,"unit"):f,P=`${t.get(R,"value","").startsWith("-")?"-":""}${m}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;C(P)},[C,a,m,c]);return e.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:p==="class"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("input",{className:"w-20 rounded py-1",readOnly:!0,value:u}),e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(x.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${S?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(p)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:p==="class",onKeyPress:f=>{f.key==="Enter"&&V()},onKeyDown:f=>{if(f.keyCode!==38&&f.keyCode!==40)return;f.preventDefault(),H(!0);const R=t.parseInt(f.target.value);let k=t.isNaN(R)?0:R;f.keyCode===38&&(k+=1),f.keyCode===40&&(k-=1);const B=`${k}`,le=`${B.startsWith("-")?"-":""}${m}[${B.replace("-","")}${p==="-"?"":p}]`;T(le)},onKeyUp:f=>{I&&(f.preventDefault(),H(!1))},onBlur:()=>V(),onChange:f=>{h(!1),i(f.target.value)},onClick:f=>{var R;(R=f==null?void 0:f.target)==null||R.select(),r(!1)},value:S?v:a,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",b?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(o.Tooltip,{open:n,delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>r(!n),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${c.length===1?"px-2 font-semibold":""}`,children:p}),c.length>1?e.jsxRuntimeExports.jsx(x.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(o.TooltipPortal,{children:e.jsxRuntimeExports.jsx(o.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(Ve,{units:c,current:p,onSelect:f=>{r(!1),y(f),A(f)}})})})]})]}),["none","auto"].indexOf(p)!==-1||S?null:e.jsxRuntimeExports.jsx(Be,{onDragStart:()=>w(!0),onDragEnd:f=>{if(E(()=>""),w(!1),t.isEmpty(f))return;const R=`${f}`,B=`${R.startsWith("-")?"-":""}${m}[${R.replace("-","")}${p==="-"?"":p}]`;C(B)},onDrag:f=>{if(t.isEmpty(f))return;E(f);const R=`${f}`,B=`${R.startsWith("-")?"-":""}${m}[${R.replace("-","")}${p==="-"?"":p}]`;T(B)},currentValue:a,unit:p,negative:j,cssProperty:d})]})})})},O=s=>{const n=o.useSelectedBlockCurrentClasses();return t.findLast(n,{property:s})},Ae=(s,n)=>{const r={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return r[t.get(s,"mq","xs")]<=r[n]},Pe={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},te={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},Me=s=>`${s.toUpperCase()} ${te[s]?`(${te[s]} & up)`:""}`,G=s=>{const{t:n}=_.useTranslation(),{type:r="icons",label:a,property:i,onEmitChange:u=()=>{},units:l,negative:m=!1}=s,[d]=o.useDarkMode(),[c]=o.useStylingState(),[,j]=o.useCanvasWidth(),p=O(i),y=o.useAddClassesToBlocks(),b=o.useRemoveClassesFromBlocks(),[h]=o.useSelectedBlockIds(),v=g.useMemo(()=>t.get(p,"fullCls",""),[p]),E=g.useCallback((T,V=!0)=>{const A={dark:d,mq:j,mod:c,cls:T,property:i,fullCls:""};(d||c!=="")&&(A.mq="xs");const f=D.generateFullClsName(A);y(h,[f],V)},[h,d,j,c,i,y]),S=g.useCallback(()=>{b(h,[v])},[h,v,b]),w=g.useMemo(()=>Ae(p,j),[p,j]);g.useEffect(()=>{u(w,p)},[w,u,p]);const[,,I]=o.useCanvasWidth(),H=g.useCallback(T=>{I({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[T])},[I]),C=t.get(p,"dark",null)===d&&t.get(p,"mod",null)===c&&t.get(p,"mq",null)===j;return e.jsxRuntimeExports.jsx(Ce,{canChange:w,canReset:p&&C,children:e.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:e.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${p&&!C?"text-foreground":""}`,children:n(a)})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[r==="arbitrary"?e.jsxRuntimeExports.jsx(De,{currentClass:t.get(p,"cls",""),classPrefix:t.get(Pe,i,""),units:l||[],onChange:E,negative:m,cssProperty:i}):null,r==="icons"&&e.jsxRuntimeExports.jsx(Ne,{property:i,onChange:E}),r==="range"&&e.jsxRuntimeExports.jsx(ke,{property:i,onChange:E}),r==="color"&&e.jsxRuntimeExports.jsx(Te,{property:i,onChange:E}),r==="dropdown"&&e.jsxRuntimeExports.jsx(oe,{label:a,property:i,onChange:E})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${v?"visible":"invisible"}`,children:C?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>S(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(x.CrossCircledIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):w&&p?e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(x.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at  ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold",children:[Me(t.get(p,"mq")),d&&!p.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>H(t.get(p,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(p,"mq").toUpperCase()]})]})})})]}):null})]})]})})},$e=["px","%","em","rem","ch","vh","vw"],ie=({label:s,options:n,borderB:r=!1,borderT:a=!1,type:i="arbitrary",units:u=$e,negative:l=!1})=>{const{t:m}=_.useTranslation(),[d,c]=g.useState(n[0].key),j=o.useSelectedBlockCurrentClasses(),p=g.useCallback(y=>t.map(j,"property").includes(y),[j]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r?"border-b":""} ${a?"border-t":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[s&&e.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:m(s)}),e.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:g.Children.toArray(n.map(({label:y,key:b})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>c(b),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${b===d?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[g.createElement("div",{className:p(b)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),g.createElement(t.get(re,b,x.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(y))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(G,{type:i,units:[...u],label:"",property:d,negative:l})})]})},Le=({heading:s,items:n})=>{const{t:r}=_.useTranslation(),a=o.useSelectedBlockCurrentClasses(),i=g.useMemo(()=>{const u=d=>t.flatten(d.map(c=>c.styleType==="multiple"?t.map(c.options,"key"):c.property)),l=t.flatten(n.map(d=>d.styleType==="accordion"?u(d.items):d.styleType==="multiple"?t.map(d.options,"key"):d.property)),m=t.map(a,"property");return t.intersection(l,m).length>0},[a,n]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[r(s),i?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:n.map(u=>u.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...u},u.label):e.jsxRuntimeExports.jsx(G,{...u},u.label))})]})},Oe=g.createContext({}),Y=({section:s})=>{const{t:n}=_.useTranslation(),r=o.useSelectedBlockCurrentClasses(),a=g.useCallback((l=[])=>{const m={};for(let c=0;c<r.length;c++)m[r[c].property]=r[c].cls;let d=!0;for(const c in l)if(!t.has(m,c)||m[c]!==l[c]){d=!1;break}return d},[r]),i=g.useMemo(()=>{if(r.length>0&&s.heading==="classes.heading")return!0;const l=c=>t.flatten(c.map(j=>j.styleType==="multiple"?t.flatten(t.map(j.options,"key")):j.property)),m=t.flatten(s.items.map(c=>c.styleType==="accordion"?l(c.items):c.styleType==="multiple"?t.flatten(t.map(c.options,"key")):c.property)),d=t.map(r,"property");return t.intersection(m,d).length>0},[r,s.heading,s.items]),u=g.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(Oe.Provider,{value:u,children:e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}),n(s.heading)]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:g.Children.toArray(s.items.map(l=>t.has(l,"component")?g.createElement(l.component,{key:l.label}):t.has(l,"styleType")?l.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...l},l.label):l.styleType==="accordion"&&a(l==null?void 0:l.conditions)?e.jsxRuntimeExports.jsx(Le,{...l},l.label):null:e.jsxRuntimeExports.jsx(G,{...l},l.label)))})]})})},qe=()=>{const s=o.useSelectedBlock(),[n]=o.useSelectedStylingBlocks(),{t:r}=_.useTranslation(),a=$.useGlobalStylingPresets(),i=o.useAddClassesToBlocks(),u=$.getBlockComponent(s._type),l=t.get(t.first(n),"prop"),m=t.get(u.props,`${l}.presets`,{});if(t.isEmpty(a)&&(!t.has(u,"props")||t.isEmpty(m)))return null;const d=c=>{const j=c.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");i([s._id],j,!0)};return e.jsxRuntimeExports.jsx("div",{className:"h-10",children:e.jsxRuntimeExports.jsxs(o.DropdownMenu,{children:[e.jsxRuntimeExports.jsx(o.DropdownMenuTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("div",{className:"px-4",children:e.jsxRuntimeExports.jsxs(o.Button,{variant:"default",className:"w-full",size:"sm",children:[r("Apply Presets"),e.jsxRuntimeExports.jsx(x.CaretDownIcon,{})]})})}),e.jsxRuntimeExports.jsx(o.DropdownMenuContent,{className:"max-h-80 w-56",children:e.jsxRuntimeExports.jsxs(o.ScrollArea,{className:"no-scrollbar h-full",children:[t.isEmpty(m)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(o.DropdownMenuLabel,{children:[u.type," ",r("presets")]}),e.jsxRuntimeExports.jsx(o.DropdownMenuSeparator,{}),e.jsxRuntimeExports.jsx(o.DropdownMenuGroup,{children:t.keys(m).map(c=>e.jsxRuntimeExports.jsxs(o.DropdownMenuItem,{className:"group text-xs",onClick:()=>d(m[c]),children:[t.capitalize(t.startCase(r(c))),e.jsxRuntimeExports.jsx(o.DropdownMenuShortcut,{className:"invisible hover:font-bold hover:text-blue-600 group-hover:visible",children:r("apply")})]}))})]}),t.isEmpty(a)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(o.DropdownMenuLabel,{children:r("Global presets")}),e.jsxRuntimeExports.jsx(o.DropdownMenuSeparator,{}),e.jsxRuntimeExports.jsx(o.DropdownMenuGroup,{children:t.keys(a).map(c=>e.jsxRuntimeExports.jsxs(o.DropdownMenuItem,{className:"group text-xs",onClick:()=>d(a[c]),children:[t.capitalize(t.startCase(r(c))),e.jsxRuntimeExports.jsx(o.DropdownMenuShortcut,{className:"invisible hover:font-bold hover:text-blue-600 group-hover:visible",children:r("apply")})]}))})]})]})})]})})};function We(){const[s,n]=o.useStylingState(),{flexChild:r,gridChild:a}=o.useSelectedBlocksDisplayChild(),{t:i}=_.useTranslation(),[u]=o.useSelectedStylingBlocks();return t.isEmpty(u)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(x.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:i("no_styling_block_selected")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx(qe,{}),e.jsxRuntimeExports.jsx("div",{className:"flex h-12 flex-col space-x-4 px-4 py-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-1.5",children:[e.jsxRuntimeExports.jsx(o.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(o.Select,{defaultValue:s,onValueChange:l=>n(l),children:[e.jsxRuntimeExports.jsx(o.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(o.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(o.SelectContent,{children:[e.jsxRuntimeExports.jsx(o.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),s!==""?e.jsxRuntimeExports.jsxs("div",{className:"m-1 flex items-center space-x-1 rounded border border-orange-500 bg-orange-200 p-px px-2 text-xs text-orange-900",children:[e.jsxRuntimeExports.jsx(M.BrushIcon,{className:"w-3"}),e.jsxRuntimeExports.jsx("span",{children:i(`Styles will be applied for (:${s}) state`)})]}):null,e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden border-t border-border",children:e.jsxRuntimeExports.jsxs(o.Accordion,{defaultValue:["Layout"],type:"multiple",className:"w-full",children:[r&&e.jsxRuntimeExports.jsx(Y,{section:Re}),a?e.jsxRuntimeExports.jsx(Y,{section:Ee}):null,we.map(l=>e.jsxRuntimeExports.jsx(Y,{section:l},l.heading))]})})]})}const ze=({onAdd:s})=>{const{t:n}=_.useTranslation(),[r,a]=g.useState({key:"",value:""}),i=()=>{t.isEmpty(r.key)||(s({...r,key:t.kebabCase(r.key)}),a({key:"",value:""}))};return e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 border-gray-200 px-1",children:[e.jsxRuntimeExports.jsx(o.Input,{name:"key",onChange:u=>a({...r,key:u.target.value}),value:r.key,placeholder:n("Name"),autoComplete:"off",autoCapitalize:"off",onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),t.isEmpty(r.key)||i())}}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center gap-x-1.5",children:e.jsxRuntimeExports.jsx(o.Input,{name:"value",onChange:u=>a({...r,value:u.target.value}),value:r.value,placeholder:n("Value"),autoComplete:"off",autoCapitalize:"off",onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),t.isEmpty(r.key)||i())}})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsxs(o.Button,{disabled:t.isEmpty(r.key),onClick:i,size:"sm",className:"flex items-center",children:[e.jsxRuntimeExports.jsxs("span",{children:[n("Add")," "]}),e.jsxRuntimeExports.jsx(x.PlusIcon,{})]}),t.isEmpty(r.key)?null:e.jsxRuntimeExports.jsx(o.Button,{variant:"ghost",onClick:()=>a({key:"",value:""}),children:n("Cancel")})]})]})},Fe=()=>{const s=o.useSelectedBlock(),[n,r]=g.useState([]),[a]=o.useSelectedStylingBlocks(),i=o.useUpdateBlocksPropsRealtime(),u=o.useUpdateBlocksProps(),{t:l}=_.useTranslation(),m=`${t.get(a,"0.prop")}_attrs`;q.useEffect(()=>{const p=t.map(t.get(s,m),(y,b)=>({key:b,value:y}));t.isEmpty(p)?r([]):r(p)},[t.get(s,m)]);const d=p=>{const y=t.filter(n,(b,h)=>p!==h);j(y)},c=p=>{const y=[...n,p];j(y)},j=q.useCallback((p=[])=>{const y={};t.forEach(p,b=>{t.isEmpty(b.key)||t.set(y,b.key,b.value)}),u([t.get(s,"_id")],{[m]:y})},[s,i,m]);return e.jsxRuntimeExports.jsx("div",{className:"px-2",children:e.jsxRuntimeExports.jsx("div",{className:"no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto",children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("ul",{className:"overflow-hidden rounded-md bg-gray-100 p-2 text-xs text-gray-700",children:[t.isEmpty(n)?e.jsxRuntimeExports.jsx("li",{className:"flex h-16 items-center justify-center",children:e.jsxRuntimeExports.jsx("p",{children:l("No custom attributes added yet")})}):e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx("span",{className:"font-bold",children:l("Custom attributes")})}),q.Children.toArray(t.map(n,p=>e.jsxRuntimeExports.jsxs("li",{className:"group flex max-w-full items-center justify-between",children:[e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:1e3,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("div",{className:"w-[90%] cursor-default truncate px-1 hover:bg-gray-200",children:[p.key," ",e.jsxRuntimeExports.jsx("span",{className:"font-bold text-orange-500",children:"="})," ",p.value]})}),e.jsxRuntimeExports.jsxs(o.TooltipContent,{className:"max-w-[200px]",children:[e.jsxRuntimeExports.jsxs("div",{children:[l("Name"),": ",p.key]}),e.jsxRuntimeExports.jsxs("div",{children:[l("Value"),": ",p.value]})]})]}),e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{className:"invisible group-hover:visible",onClick:()=>d(n.indexOf(p)),children:e.jsxRuntimeExports.jsx(M.DeleteIcon,{className:"w-4 text-gray-500"})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{className:"max-w-[200px]",children:l("Remove attribute")})]})]})))]})}),e.jsxRuntimeExports.jsx("div",{className:"py-2"}),e.jsxRuntimeExports.jsx(ze,{onAdd:p=>c(p)})]})})})},Ye={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},Xe=()=>{const s=o.useSelectedBlock(),{t:n}=_.useTranslation(),[r,a]=g.useState(""),[i,u]=g.useState({onDrag:d=>d,onDragEnd:d=>d,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),l=X.useThrottledCallback(d=>{const c=!t.get(i,"negative",!1),j=t.get(i,"cssProperty","");let p=parseFloat(i.dragStartValue);p=t.isNaN(p)?0:p;let y=Ye[i.dragUnit];(t.startsWith(j,"scale")||j==="opacity")&&(y=10);let h=(i.dragStartY-d.pageY)/y+p;c&&h<0&&(h=0),j==="opacity"&&h>1&&(h=1),i.onDrag(`${h}`),a(`${h}`)},[i],50),m=g.useCallback(()=>{setTimeout(()=>i.onDragEnd(`${r}`),100),u({onDrag:d=>d,onDragEnd:d=>d,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[i,r,u]);return t.isNull(s)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(x.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:n("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsx(W.ErrorBoundary,{children:e.jsxRuntimeExports.jsxs(ne.Provider,{value:{setDragData:u},children:[i.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:l,onMouseUp:()=>m(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"}):null,e.jsxRuntimeExports.jsxs(o.Tabs,{defaultValue:"settings",className:"flex h-full w-full flex-col py-1 text-xs",children:[e.jsxRuntimeExports.jsxs(o.TabsList,{className:"mx-1 grid grid-cols-3",children:[e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"settings",children:n("settings")}),e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"styling",children:n("styling")}),e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"attrs",children:n("Attributes")})]}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"settings",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5",children:e.jsxRuntimeExports.jsx(fe,{})})}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"styling",className:"h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(We,{})}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"attrs",className:"h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Fe,{})})]})]})})};exports.default=Xe;
@@ -5,24 +5,23 @@ import { useThrottledCallback as fe } from "@react-hookz/web";
5
5
  import { forEach as Re, isArray as pe, omit as bt, truncate as ft, includes as M, get as x, first as ae, split as vt, startCase as E, toLower as le, isEmpty as b, map as k, find as jt, last as wt, filter as ve, set as Ge, debounce as Ct, keys as je, cloneDeep as kt, each as Nt, capitalize as we, reject as _t, nth as $e, startsWith as G, isNumber as Tt, parseInt as St, isNaN as qe, findLast as Rt, flatten as q, intersection as Je, has as ce, kebabCase as Vt, isNull as Ht } from "lodash-es";
6
6
  import { useTranslation as z } from "react-i18next";
7
7
  import { PlusIcon as Ve, Cross2Icon as Qe, EyeOpenIcon as Dt, EyeClosedIcon as Ae, BorderAllIcon as A, WidthIcon as S, HeightIcon as R, ArrowUpIcon as ee, ArrowRightIcon as te, ArrowDownIcon as re, ArrowLeftIcon as se, ArrowTopLeftIcon as Bt, ArrowTopRightIcon as Pt, ArrowBottomRightIcon as It, ArrowBottomLeftIcon as $t, AlignLeftIcon as At, AlignCenterHorizontallyIcon as Mt, AlignRightIcon as Et, StretchHorizontallyIcon as Lt, FontItalicIcon as Ot, UnderlineIcon as Ft, OverlineIcon as Yt, LetterCaseUppercaseIcon as zt, Cross1Icon as Xt, InfoCircledIcon as He, MinusIcon as Zt, BoxIcon as et, RowSpacingIcon as Wt, TriangleDownIcon as Ut, CrossCircledIcon as Kt, CaretDownIcon as Gt, MixerHorizontalIcon as tt } from "@radix-ui/react-icons";
8
- import { aV as qt, aW as Jt, B as U, aX as Qt, aY as er, aZ as tr, a_ as rr, a$ as sr, b0 as lr, b1 as or, a1 as K, af as ar, ag as nr, ah as ir, b2 as dr, ad as cr, ao as pr, ae as ur, ap as O, aq as F, ar as Y, b3 as xr, b4 as gr, b5 as hr, b6 as yr, b7 as mr, b8 as br, a6 as rt, a5 as st, h as fr, b9 as lt, ba as Ce, bb as ke, bc as Ne, ac as ue, M as De, _ as ot, r as at, aB as nt, bd as _e, v as vr, be as jr, $ as xe, V as wr, a4 as it, N as Me, aG as Cr, aH as kr, aI as Nr, bf as Be, aJ as Ee, aK as Le, bg as Oe, bh as Fe, bi as Ye, a7 as _r, aj as Tr, ak as Sr, al as Rr, am as Vr, an as H, au as Hr, av as Dr, aw as he, ax as ye } from "./index-Gk6sASBd.js";
8
+ import { aV as qt, aW as Jt, B as U, aX as Qt, aY as er, aZ as tr, a_ as rr, a$ as sr, b0 as lr, b1 as or, a1 as K, af as ar, ag as nr, ah as ir, b2 as dr, ad as cr, ao as pr, ae as ur, ap as O, aq as F, ar as Y, b3 as xr, b4 as gr, b5 as hr, b6 as yr, b7 as mr, b8 as br, a6 as rt, a5 as st, h as fr, b9 as lt, ba as Ce, bb as ke, bc as Ne, ac as ue, M as De, _ as ot, r as at, aB as nt, bd as _e, v as vr, be as jr, $ as xe, V as wr, a4 as it, N as Me, aG as Cr, aH as kr, aI as Nr, bf as Be, aJ as Ee, aK as Le, bg as Oe, bh as Fe, bi as Ye, a7 as _r, aj as Tr, ak as Sr, al as Rr, am as Vr, an as H, au as Hr, av as Dr, aw as he, ax as ye } from "./index-CFUoB97-.js";
9
9
  import { u as Br } from "./controls-OfJWSEqC.js";
10
10
  import { Check as Pr, EditIcon as Ir, TrashIcon as $r, BrushIcon as Ar, DeleteIcon as Mr } from "lucide-react";
11
11
  import { getBlockComponent as Pe, getChaiDataProviders as Er, useGlobalStylingPresets as Lr } from "@chaibuilder/runtime";
12
- import { E as dt, u as ct } from "./index-SkyM3d6Q.js";
12
+ import { E as dt, u as ct } from "./index-lOJfSheQ.js";
13
13
  import { J as Or, a as Fr, d as Yr } from "./index-e0c8PmRQ.js";
14
14
  import zr from "@rjsf/core";
15
15
  import Xr from "@rjsf/validator-ajv8";
16
16
  import Zr from "react-autosuggest";
17
17
  import Wr from "fuse.js";
18
- import { A as Ur, C as ge, g as Kr } from "./Class-lGzsNBOK.js";
19
- import { a as Gr } from "./STRINGS--j49GZJP.js";
18
+ import { A as Ur, C as ge, g as Kr } from "./Class-3k8xjeiM.js";
19
+ import { a as Gr } from "./MODIFIERS-WQdaNvb8.js";
20
20
  import "./_commonjsHelpers-UyOWmZb0.js";
21
21
  import "./Functions-7jnEwJyw.js";
22
22
  import "clsx";
23
23
  import "tailwind-merge";
24
24
  import "jotai";
25
- import "./MODIFIERS-dytZ-osO.js";
26
25
  import "@radix-ui/react-toggle";
27
26
  import "class-variance-authority";
28
27
  import "@radix-ui/react-switch";
@@ -2150,7 +2149,7 @@ const _s = ({ onAdd: r }) => {
2150
2149
  "-": 1,
2151
2150
  deg: 1,
2152
2151
  ms: 0.1
2153
- }, _l = () => {
2152
+ }, Nl = () => {
2154
2153
  const r = K(), { t: s } = z(), [t, d] = $.useState(""), [l, n] = $.useState({
2155
2154
  onDrag: (i) => i,
2156
2155
  onDragEnd: (i) => i,
@@ -2209,5 +2208,5 @@ const _s = ({ onAdd: r }) => {
2209
2208
  ] }) });
2210
2209
  };
2211
2210
  export {
2212
- _l as default
2211
+ Nl as default
2213
2212
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("@radix-ui/react-icons"),i=require("react"),D=require("jotai"),u=require("lodash-es"),s=require("./index-F4AQQ6qq.cjs"),R=require("lucide-react"),_=require("@chaibuilder/runtime"),f=require("react-i18next"),w=require("./index-gi1LIOCw.cjs"),S=require("./index-l19JVVXI.cjs"),l=require("./MODIFIERS-9EwxLM8V.cjs"),K=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");const C=({provider:t,onClose:a})=>{const{t:o}=f.useTranslation(),[n,h]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(c=>h(c))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:m=>m?"":a(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[o("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(S.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(w.JsonView,{data:n,shouldExpandNode:w.allExpanded,style:{...w.defaultStyles,container:"max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]})}):null};function I({children:t,name:a,onRemove:o}){const{t:n}=f.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{dangerouslySetInnerHTML:{__html:n("remove_provider_confirmation").replace("{name}",a)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:n("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:n("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:o,className:"bg-red-600 hover:bg-red-700",children:n("remove")})]})]})]})}const P=()=>{const{t}=f.useTranslation(),a=i.useMemo(()=>_.getChaiDataProviders(),[]),[o,n]=s.usePageDataProviders(),[,h]=D.useAtom(s.builderSaveStateAtom),[m,c]=i.useState(u.filter(a,r=>u.map(o,"providerKey").includes(r.providerKey))),[b,E]=i.useState(""),[g,d]=i.useState(null),N=u.filter(a.map(r=>u.map(m,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!u.isNull(r)),y=r=>{const p=u.find(a,{providerKey:r});c(j=>[...j,p]),n(j=>[...j,{providerKey:p.providerKey,args:{}}]),E(""),h("UNSAVED")},x=r=>{c(p=>u.filter(p,j=>j.providerKey!==r.providerKey)),n(p=>u.filter(p,j=>j.providerKey!==r.providerKey)),h("UNSAVED")},v=r=>d(r);return u.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[t("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:t("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"mb-1.5 text-xs text-gray-500",children:t("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:b,onValueChange:r=>y(r),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:t("select_provider")})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:t("choose")}),N.map(r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.value,children:r.label},r.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${m.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsxs("p",{className:"flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500",children:[t("page_data_providers"),":"]}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:m.map(r=>e.jsxRuntimeExports.jsxs("div",{className:"w-full rounded-lg border bg-card text-card-foreground shadow-sm","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:r.name}),e.jsxRuntimeExports.jsx("p",{className:"pt-1 text-xs text-gray-400",children:r.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between p-2 py-2",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>v(r),className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),t("view_data")]}),e.jsxRuntimeExports.jsx(I,{onRemove:()=>x(r),name:r.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),t("remove")]})})]})]},r.providerKey))}),e.jsxRuntimeExports.jsx(C,{onClose:()=>d(null),provider:g})]})]})},L=()=>{const{t}=f.useTranslation(),a={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},o={"ctrl + S":"Save page",esc:"Deselect blocks",del:"Delete block"};return e.jsxRuntimeExports.jsxs(s.Dialog,{children:[e.jsxRuntimeExports.jsx(s.DialogTrigger,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{children:e.jsxRuntimeExports.jsx(s.Button,{size:"sm",className:"w-10",variant:"outline",children:e.jsxRuntimeExports.jsx(q.KeyboardIcon,{})})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t("Keyboard shortcuts")})})]})}),e.jsxRuntimeExports.jsxs(s.DialogContent,{className:"sm:max-w-[525px]",children:[e.jsxRuntimeExports.jsx(s.DialogHeader,{children:e.jsxRuntimeExports.jsx(s.DialogTitle,{children:t("Keyboard shortcuts")})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2",children:[e.jsxRuntimeExports.jsx("div",{className:"mr-8 flex flex-col space-y-2 border-r border-gray-200",children:Object.keys(a).map(n=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(n)}),e.jsxRuntimeExports.jsx("div",{children:t(a[n])})]},n))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(o).map(n=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(n)}),e.jsxRuntimeExports.jsx("div",{children:t(o[n])})]},n))})]})})]})]})},O=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-S-4jzdWv.cjs"))),T=i.lazy(()=>Promise.resolve().then(()=>require("./ListTree-SWsqdfcG.cjs"))),A=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-EMCT0Wa3.cjs"))),B=i.lazy(()=>Promise.resolve().then(()=>require("./index-F4AQQ6qq.cjs")).then(t=>t.ImagesPanel));let k=null;const U=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),a=s.useBuilderProp("sideBarComponents.bottom",[]),[o,n]=D.useAtom(s.activePanelAtom),[h,m]=i.useState(o),[c,b]=i.useState(null),{t:E}=f.useTranslation(),g={"add-blocks":O,[l.OUTLINE_KEY]:T,"branding-options":A,images:B};u.each(t,({name:x,panel:v})=>{g[x]=v});const d=x=>{clearTimeout(k),o!==l.OUTLINE_KEY&&x===l.OUTLINE_KEY?k=setTimeout(()=>n(l.OUTLINE_KEY),500):m(x),n(x)},N=s.useBuilderProp("dataBindingSupport",!1);function y(){const x=setTimeout(()=>{c&&(d(l.OUTLINE_KEY),clearTimeout(c))},500);b(x)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[o!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{onMouseEnter:y,onClick:()=>d(l.OUTLINE_KEY),className:"fixed inset-0 z-[50] bg-black/20"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{d("add-blocks")},size:"sm",variant:o==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(q.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(l.OUTLINE_KEY),size:"sm",variant:o===l.OUTLINE_KEY?"default":"outline",children:e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("branding-options"),size:"sm",variant:o==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(q.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:x,icon:v})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(x),size:"sm",className:"w-10",variant:o===x?"default":"outline",children:e.jsxRuntimeExports.jsx(v,{})})})))]}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2",children:[e.jsxRuntimeExports.jsx(L,{}),i.Children.toArray(a.map(x=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(x,{})})))]})]}),o!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{className:"absolute left-14 z-[50] h-full w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:K.cn("relative z-[100] h-full max-h-[98%] overflow-y-auto overflow-x-hidden bg-background p-1"),onMouseEnter:()=>{c&&clearTimeout(c)},children:i.createElement(u.get(g,o,()=>e.jsxRuntimeExports.jsx("div",{})))})})}):null,e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:N?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 grid h-10 grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"mr-2 h-3"})," ",E("Outline")]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(R.DatabaseIcon,{className:"mr-2 w-3"}),E("Data")]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(T)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(P,{})})]}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsx(s.TabsList,{className:"mx-1 grid h-10 grid-cols-1",children:e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"mr-2 h-3"})," ",E("Outline")]})}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(T)})]})})})})]})};exports.default=U;