@chaibuilder/sdk 1.2.30 → 1.2.32

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 (69) hide show
  1. package/dist/{AddBlocks-u1FkSHNj.js → AddBlocks-0eVRNr1d.js} +1 -1
  2. package/dist/{AddBlocks-UxJOFB9M.cjs → AddBlocks-t0hKDSud.cjs} +1 -1
  3. package/dist/{BrandingOptions-RDn_Nhcq.cjs → BrandingOptions-NVmCxZfD.cjs} +1 -1
  4. package/dist/{BrandingOptions-A3_c_sd7.js → BrandingOptions-yYAznnw2.js} +1 -1
  5. package/dist/{CanvasArea-3D9rpjpk.js → CanvasArea-2b4oSjRx.js} +68 -70
  6. package/dist/{CanvasArea-e829y1ts.cjs → CanvasArea-OzyCq6UU.cjs} +4 -4
  7. package/dist/{CurrentPage-VbdmddMv.js → CurrentPage-1v40uk8K.js} +3 -3
  8. package/dist/{CurrentPage-5xKDQqvg.cjs → CurrentPage-YBMhEBZG.cjs} +1 -1
  9. package/dist/{ListTree-c9Z0kWbN.js → ListTree-0ZrRreCs.js} +1 -1
  10. package/dist/{ListTree-pdQ14QJC.cjs → ListTree-jPwxgI6R.cjs} +1 -1
  11. package/dist/{PagesPanel-_VzJ1__k.js → PagesPanel-AxQX-BX2.js} +4 -4
  12. package/dist/{PagesPanel-wex1zGzm.cjs → PagesPanel-ivEL9tIQ.cjs} +1 -1
  13. package/dist/{ProjectPanel-rPNO2QsE.js → ProjectPanel-GYdge5v9.js} +4 -4
  14. package/dist/{ProjectPanel-N6iWd_4Z.cjs → ProjectPanel-shgvg_yT.cjs} +1 -1
  15. package/dist/{Settings-jTl7IOPc.js → Settings-9JAzGHau.js} +5 -5
  16. package/dist/Settings-MMwEBADN.cjs +1 -0
  17. package/dist/{SidePanels-jYJEFpxC.js → SidePanels-bLwsW29O.js} +3 -3
  18. package/dist/{SidePanels-mx5TyZBn.cjs → SidePanels-iaaRCUeQ.cjs} +1 -1
  19. package/dist/{Topbar-VCFW9uNI.js → Topbar-0Ql8pHVc.js} +1 -1
  20. package/dist/{Topbar-J2tb4SA1.cjs → Topbar-CkUhCnSW.cjs} +1 -1
  21. package/dist/{UnsplashImages-N9h0avWO.js → UnsplashImages-NYwOOgYa.js} +1 -1
  22. package/dist/{UnsplashImages-XwjKheek.cjs → UnsplashImages-juwtWvXe.cjs} +1 -1
  23. package/dist/{UploadImages-y7LAQVrT.cjs → UploadImages-4_jmnoVi.cjs} +1 -1
  24. package/dist/{UploadImages-e70AeNGX.js → UploadImages-vpZeW-YW.js} +1 -1
  25. package/dist/{add-page-modal-v5smARyL.cjs → add-page-modal-2ZPjc54F.cjs} +1 -1
  26. package/dist/{add-page-modal-o1euqbsp.js → add-page-modal-hDyzsEU7.js} +4 -4
  27. package/dist/{confirm-alert-EDOFRmH8.js → confirm-alert-FGQKKQJU.js} +1 -1
  28. package/dist/{confirm-alert-4OQlXZTJ.cjs → confirm-alert-QRxOc76t.cjs} +1 -1
  29. package/dist/core.cjs +1 -1
  30. package/dist/core.js +2 -2
  31. package/dist/{delete-page-modal-DNjqQuop.cjs → delete-page-modal--N1nPPIL.cjs} +1 -1
  32. package/dist/{delete-page-modal-QzRkBAct.js → delete-page-modal-KxeyBri2.js} +3 -3
  33. package/dist/email.cjs +1 -1
  34. package/dist/email.js +2 -2
  35. package/dist/{form-yw3Uuk6v.js → form-77dY98bF.js} +1 -1
  36. package/dist/{form-jQj7E-hS.cjs → form-hT5dGoJH.cjs} +1 -1
  37. package/dist/functions-I6BoMqqb.js +21 -0
  38. package/dist/functions-r3ExvGGf.cjs +1 -0
  39. package/dist/{index-DtBYhldP.js → index-5zkCTSAM.js} +3 -3
  40. package/dist/{index-SEJRE2ab.js → index-AJalHhkO.js} +2 -2
  41. package/dist/index-FPBudsRF.cjs +1 -0
  42. package/dist/{index-5c_rU-9B.cjs → index-JIcsKKoG.cjs} +1 -1
  43. package/dist/{index-HiiWSXkE.js → index-hH5SIZ29.js} +358 -358
  44. package/dist/{index-DHwvjZ5z.cjs → index-sJ9Uc9UY.cjs} +2 -2
  45. package/dist/lib.cjs +3 -3
  46. package/dist/lib.js +1126 -96
  47. package/dist/{page-viewer-87wtE0pN.cjs → page-viewer-k-g15j8B.cjs} +1 -1
  48. package/dist/{page-viewer-1vswRGpL.js → page-viewer-umQaut1j.js} +4 -4
  49. package/dist/{project-general-setting-RSG7ZQSx.cjs → project-general-setting-1leAiCJQ.cjs} +1 -1
  50. package/dist/{project-general-setting-SE9QJ6mF.js → project-general-setting-uuCemMCU.js} +4 -4
  51. package/dist/{project-seo-setting-x3peNgla.js → project-seo-setting-asvbPQiI.js} +2 -2
  52. package/dist/{project-seo-setting-q2953ybQ.cjs → project-seo-setting-kDBSOzgX.cjs} +1 -1
  53. package/dist/render.cjs +1 -1
  54. package/dist/render.d.ts +0 -2
  55. package/dist/render.js +125 -166
  56. package/dist/{single-page-detail-bels-Cjo.js → single-page-detail-F6pKWyq1.js} +5 -5
  57. package/dist/{single-page-detail-8Arndzmw.cjs → single-page-detail-IFtVxwl5.cjs} +1 -1
  58. package/dist/studio.cjs +1 -1
  59. package/dist/studio.js +3 -3
  60. package/dist/ui.cjs +1 -1
  61. package/dist/ui.js +1 -1
  62. package/dist/useCanvasSettings-Am2o80hW.cjs +1 -0
  63. package/dist/{useCanvasSettings-unTQUdlP.js → useCanvasSettings-ikt217kv.js} +1 -1
  64. package/package.json +2 -2
  65. package/dist/Settings-mlh0i_1M.cjs +0 -1
  66. package/dist/defaultTheme-7VqqhOcp.cjs +0 -1
  67. package/dist/defaultTheme-D8B4-wHO.js +0 -1053
  68. package/dist/index-12HbDLon.cjs +0 -1
  69. package/dist/useCanvasSettings-MR0Glu1b.cjs +0 -1
@@ -1,6 +1,6 @@
1
- "use strict";var ne=Object.defineProperty;var oe=(o,n,e)=>n in o?ne(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e;var C=(o,n,e)=>(oe(o,typeof n!="symbol"?n+"":n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),h=require("react"),a=require("lodash-es"),k=require("@radix-ui/react-icons"),i=require("./index-12HbDLon.cjs"),T=require("react-i18next"),E=require("jotai"),H=require("react-dom"),b=require("prop-types"),re=require("react-quill"),K=require("flagged"),ie=require("@floating-ui/dom"),O=require("@floating-ui/react-dom"),le=require("@react-hookz/web"),ce=require("@bobthered/tailwindcss-palette-generator"),ae=require("@tailwindcss/typography"),de=require("@tailwindcss/forms"),ue=require("@tailwindcss/aspect-ratio"),pe=require("react-wrap-balancer"),he=require("tailwind-merge"),_=require("./STRINGS-gPz7CUOk.cjs"),xe=require("@chaibuilder/runtime"),P=require("./index-DHwvjZ5z.cjs"),me=require("./useCanvasSettings-MR0Glu1b.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.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-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("i18next");require("react-hotkeys-hook");const ge=()=>{const{hasUndo:o,hasRedo:n,undo:e,redo:t}=i.useUndoManager();return r.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[r.jsxRuntimeExports.jsx(i.Button,{disabled:!o(),size:"sm",onClick:e,className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(k.ResetIcon,{})}),r.jsxRuntimeExports.jsx(i.Button,{disabled:!n(),onClick:t,size:"sm",className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(k.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function fe(){const[o,n]=i.useDarkMode(),{t:e}=T.useTranslation();return r.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[r.jsxRuntimeExports.jsx(i.Label,{htmlFor:"dark-mode-switch",children:e("dark_mode")}),r.jsxRuntimeExports.jsxs(i.Switch,{id:"dark-mode-switch",checked:o,onCheckedChange:()=>{n(!o)},className:`${o?"bg-violet-600":"bg-violet-300"}
1
+ "use strict";var ne=Object.defineProperty;var oe=(o,n,e)=>n in o?ne(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e;var C=(o,n,e)=>(oe(o,typeof n!="symbol"?n+"":n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),h=require("react"),a=require("lodash-es"),k=require("@radix-ui/react-icons"),i=require("./index-FPBudsRF.cjs"),M=require("react-i18next"),E=require("jotai"),H=require("react-dom"),b=require("prop-types"),re=require("react-quill"),K=require("flagged"),ie=require("@floating-ui/dom"),O=require("@floating-ui/react-dom"),le=require("@react-hookz/web"),ce=require("@tailwindcss/typography"),ae=require("@tailwindcss/forms"),de=require("@tailwindcss/aspect-ratio"),ue=require("tailwindcss-palette-generator"),pe=require("react-wrap-balancer"),he=require("tailwind-merge"),_=require("./STRINGS-gPz7CUOk.cjs"),xe=require("@chaibuilder/runtime"),P=require("./index-sJ9Uc9UY.cjs"),me=require("./useCanvasSettings-Am2o80hW.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.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-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("i18next");require("react-hotkeys-hook");const ge=()=>{const{hasUndo:o,hasRedo:n,undo:e,redo:t}=i.useUndoManager();return r.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[r.jsxRuntimeExports.jsx(i.Button,{disabled:!o(),size:"sm",onClick:e,className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(k.ResetIcon,{})}),r.jsxRuntimeExports.jsx(i.Button,{disabled:!n(),onClick:t,size:"sm",className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(k.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function fe(){const[o,n]=i.useDarkMode(),{t:e}=M.useTranslation();return r.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[r.jsxRuntimeExports.jsx(i.Label,{htmlFor:"dark-mode-switch",children:e("dark_mode")}),r.jsxRuntimeExports.jsxs(i.Switch,{id:"dark-mode-switch",checked:o,onCheckedChange:()=>{n(!o)},className:`${o?"bg-violet-600":"bg-violet-300"}
2
2
  relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,children:[r.jsxRuntimeExports.jsx("span",{className:"sr-only",children:e("use_setting")}),r.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${o?"translate-x-5":"translate-x-0"}
3
- pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`})]})]})}const U=({landscape:o=!1})=>r.jsxRuntimeExports.jsxs("svg",{className:o?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[r.jsxRuntimeExports.jsx("g",{strokeWidth:0}),r.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),r.jsxRuntimeExports.jsx("path",{d:"M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",style:{fill:"#000"}})]}),ve=[{title:"mobile_xs_title",content:"mobile_xs_content",breakpoint:"xs",icon:r.jsxRuntimeExports.jsx(k.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:r.jsxRuntimeExports.jsx(k.MobileIcon,{className:"rotate-90"}),width:640},{title:"tablet_md_title",content:"tablet_md_content",breakpoint:"md",icon:r.jsxRuntimeExports.jsx(U,{}),width:800},{title:"tablet_lg_title",content:"tablet_lg_content",breakpoint:"lg",icon:r.jsxRuntimeExports.jsx(U,{landscape:!0}),width:1024},{title:"desktop_xl_title",content:"desktop_xl_content",breakpoint:"xl",icon:r.jsxRuntimeExports.jsx(k.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:r.jsxRuntimeExports.jsx(k.DesktopIcon,{}),width:1920}],z=({title:o,content:n,currentBreakpoint:e,breakpoint:t,width:s,icon:p,onClick:c})=>{const{t:l}=T.useTranslation();return r.jsxRuntimeExports.jsxs(i.HoverCard,{children:[r.jsxRuntimeExports.jsx(i.HoverCardTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsx(i.Button,{onClick:()=>c(s),size:"sm",variant:t===e?"secondary":"ghost",children:p})}),r.jsxRuntimeExports.jsx(i.HoverCardContent,{className:"w-52 border-border",children:r.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:r.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[r.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:l(o)}),r.jsxRuntimeExports.jsx("p",{className:"text-xs",children:l(n)})]})})})]})},$e=()=>{const[,o,n]=i.useCanvasWidth(),[e,t]=i.useSelectedBreakpoints(),{t:s}=T.useTranslation(),p=i.useBuilderProp("breakpoints",ve),c=l=>{e.includes(l)?e.length>2&&t(e.filter(d=>d!==l)):t(d=>[...d,l])};return p.length<4?r.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:a.map(p,l=>h.createElement(z,{...l,onClick:n,key:l.breakpoint,currentBreakpoint:o}))}):r.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[a.map(p.filter(l=>a.includes(e,a.toUpper(l.breakpoint))),l=>h.createElement(z,{...l,onClick:n,key:l.breakpoint,currentBreakpoint:o})),r.jsxRuntimeExports.jsxs(i.DropdownMenu,{children:[r.jsxRuntimeExports.jsx(i.DropdownMenuTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:r.jsxRuntimeExports.jsx(k.DotsVerticalIcon,{className:"scale-90 transform"})})}),r.jsxRuntimeExports.jsxs(i.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[r.jsxRuntimeExports.jsx(i.DropdownMenuLabel,{children:s("Breakpoints")}),r.jsxRuntimeExports.jsx(i.DropdownMenuSeparator,{}),a.map(p,l=>r.jsxRuntimeExports.jsx(i.DropdownMenuCheckboxItem,{disabled:l.breakpoint==="xs",onCheckedChange:()=>c(a.toUpper(l.breakpoint)),checked:a.includes(e,a.toUpper(l.breakpoint)),children:s(l.title)},l.breakpoint))]})]})]})},je=()=>{const{t:o}=T.useTranslation(),{setNewBlocks:n}=i.useBlocksStoreUndoableActions(),[,e]=i.useSelectedBlockIds(),[,t]=i.useSelectedStylingBlocks(),s=h.useCallback(()=>{n([]),e([]),t([])},[n]);return r.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:r.jsxRuntimeExports.jsxs(i.AlertDialog,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsxs(i.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[r.jsxRuntimeExports.jsx(k.EraserIcon,{})," ",o("clear")]})}),r.jsxRuntimeExports.jsxs(i.AlertDialogContent,{className:"border-border",children:[r.jsxRuntimeExports.jsxs(i.AlertDialogHeader,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogTitle,{children:o("clear_canvas_title")}),r.jsxRuntimeExports.jsx(i.AlertDialogDescription,{children:o("clear_canvas_description")})]}),r.jsxRuntimeExports.jsxs(i.AlertDialogFooter,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogCancel,{children:o("cancel")}),r.jsxRuntimeExports.jsx(i.AlertDialogAction,{onClick:s,children:o("yes")})]})]})]})})},ye=()=>{const o=i.useBuilderProp("darkMode",!1),[n]=i.useCanvasZoom();return r.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[r.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[o?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(fe,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"})]}):null,r.jsxRuntimeExports.jsx($e,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsxs("div",{className:"flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium",children:[r.jsxRuntimeExports.jsx(k.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",r.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[a.round(n,0),"%"]})]}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(ge,{})]}),r.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(je,{})]})]})},be=`<!doctype html>
3
+ pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`})]})]})}const U=({landscape:o=!1})=>r.jsxRuntimeExports.jsxs("svg",{className:o?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[r.jsxRuntimeExports.jsx("g",{strokeWidth:0}),r.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),r.jsxRuntimeExports.jsx("path",{d:"M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",style:{fill:"#000"}})]}),ve=[{title:"mobile_xs_title",content:"mobile_xs_content",breakpoint:"xs",icon:r.jsxRuntimeExports.jsx(k.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:r.jsxRuntimeExports.jsx(k.MobileIcon,{className:"rotate-90"}),width:640},{title:"tablet_md_title",content:"tablet_md_content",breakpoint:"md",icon:r.jsxRuntimeExports.jsx(U,{}),width:800},{title:"tablet_lg_title",content:"tablet_lg_content",breakpoint:"lg",icon:r.jsxRuntimeExports.jsx(U,{landscape:!0}),width:1024},{title:"desktop_xl_title",content:"desktop_xl_content",breakpoint:"xl",icon:r.jsxRuntimeExports.jsx(k.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:r.jsxRuntimeExports.jsx(k.DesktopIcon,{}),width:1920}],z=({title:o,content:n,currentBreakpoint:e,breakpoint:t,width:s,icon:p,onClick:c})=>{const{t:l}=M.useTranslation();return r.jsxRuntimeExports.jsxs(i.HoverCard,{children:[r.jsxRuntimeExports.jsx(i.HoverCardTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsx(i.Button,{onClick:()=>c(s),size:"sm",variant:t===e?"secondary":"ghost",children:p})}),r.jsxRuntimeExports.jsx(i.HoverCardContent,{className:"w-52 border-border",children:r.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:r.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[r.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:l(o)}),r.jsxRuntimeExports.jsx("p",{className:"text-xs",children:l(n)})]})})})]})},$e=()=>{const[,o,n]=i.useCanvasWidth(),[e,t]=i.useSelectedBreakpoints(),{t:s}=M.useTranslation(),p=i.useBuilderProp("breakpoints",ve),c=l=>{e.includes(l)?e.length>2&&t(e.filter(d=>d!==l)):t(d=>[...d,l])};return p.length<4?r.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:a.map(p,l=>h.createElement(z,{...l,onClick:n,key:l.breakpoint,currentBreakpoint:o}))}):r.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[a.map(p.filter(l=>a.includes(e,a.toUpper(l.breakpoint))),l=>h.createElement(z,{...l,onClick:n,key:l.breakpoint,currentBreakpoint:o})),r.jsxRuntimeExports.jsxs(i.DropdownMenu,{children:[r.jsxRuntimeExports.jsx(i.DropdownMenuTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:r.jsxRuntimeExports.jsx(k.DotsVerticalIcon,{className:"scale-90 transform"})})}),r.jsxRuntimeExports.jsxs(i.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[r.jsxRuntimeExports.jsx(i.DropdownMenuLabel,{children:s("Breakpoints")}),r.jsxRuntimeExports.jsx(i.DropdownMenuSeparator,{}),a.map(p,l=>r.jsxRuntimeExports.jsx(i.DropdownMenuCheckboxItem,{disabled:l.breakpoint==="xs",onCheckedChange:()=>c(a.toUpper(l.breakpoint)),checked:a.includes(e,a.toUpper(l.breakpoint)),children:s(l.title)},l.breakpoint))]})]})]})},je=()=>{const{t:o}=M.useTranslation(),{setNewBlocks:n}=i.useBlocksStoreUndoableActions(),[,e]=i.useSelectedBlockIds(),[,t]=i.useSelectedStylingBlocks(),s=h.useCallback(()=>{n([]),e([]),t([])},[n]);return r.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:r.jsxRuntimeExports.jsxs(i.AlertDialog,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsxs(i.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[r.jsxRuntimeExports.jsx(k.EraserIcon,{})," ",o("clear")]})}),r.jsxRuntimeExports.jsxs(i.AlertDialogContent,{className:"border-border",children:[r.jsxRuntimeExports.jsxs(i.AlertDialogHeader,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogTitle,{children:o("clear_canvas_title")}),r.jsxRuntimeExports.jsx(i.AlertDialogDescription,{children:o("clear_canvas_description")})]}),r.jsxRuntimeExports.jsxs(i.AlertDialogFooter,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogCancel,{children:o("cancel")}),r.jsxRuntimeExports.jsx(i.AlertDialogAction,{onClick:s,children:o("yes")})]})]})]})})},ye=()=>{const o=i.useBuilderProp("darkMode",!1),[n]=i.useCanvasZoom();return r.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[r.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[o?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(fe,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"})]}):null,r.jsxRuntimeExports.jsx($e,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsxs("div",{className:"flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium",children:[r.jsxRuntimeExports.jsx(k.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",r.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[a.round(n,0),"%"]})]}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(ge,{})]}),r.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(je,{})]})]})},be=`<!doctype html>
4
4
  <html class="scroll-smooth h-full overflow-y-auto">
5
5
  <head>
6
6
  <meta charset="UTF-8">
@@ -48,8 +48,8 @@
48
48
  <div class="frame-root h-full"></div>
49
49
  <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
50
50
  </body>
51
- </html>`,ke=o=>{const[n]=i.useCanvasWidth(),[,e]=i.useCanvasZoom(),[t,s]=h.useState({}),p=h.useCallback(()=>{const{width:c,height:l}=o;if(c<n){const d=parseFloat((c/n).toFixed(2).toString());let u={};const x=l*d;l&&(u={height:100+(l-x)/x*100+"%"}),s({position:"relative",top:0,transform:`scale(${d})`,transformOrigin:"top left",...u,maxWidth:"none"}),e(d*100)}else s({}),e(100)},[n,o,e]);return h.useEffect(()=>{p()},[n,o,e,p]),t};let Y,Z;typeof document<"u"&&(Y=document);typeof window<"u"&&(Z=window);const G=h.createContext({document:Y,window:Z}),M=()=>h.useContext(G),{Provider:Ee,Consumer:Ve}=G;class Q extends h.Component{componentDidMount(){this.props.contentDidMount()}componentDidUpdate(){this.props.contentDidUpdate()}render(){return h.Children.only(this.props.children)}}C(Q,"propTypes",{children:b.element.isRequired,contentDidMount:b.func.isRequired,contentDidUpdate:b.func.isRequired});class q extends h.Component{constructor(e,t){super(e,t);C(this,"setRef",e=>{this.nodeRef.current=e;const{forwardedRef:t}=this.props;typeof t=="function"?t(e):t&&(t.current=e)});C(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});C(this,"loadCheck",()=>setInterval(()=>{this.handleLoad()},500));this._isMounted=!1,this.nodeRef=h.createRef(),this.state={iframeLoaded:!1}}componentDidMount(){this._isMounted=!0,this.getDoc()&&this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded",this.handleLoad)}componentWillUnmount(){this._isMounted=!1,this.nodeRef.current.removeEventListener("DOMContentLoaded",this.handleLoad)}getDoc(){return this.nodeRef.current?this.nodeRef.current.contentDocument:null}getMountTarget(){const e=this.getDoc();return this.props.mountTarget?e.querySelector(this.props.mountTarget):e.body.children[0]}renderFrameContents(){if(!this._isMounted)return null;const e=this.getDoc();if(!e)return null;const t=this.props.contentDidMount,s=this.props.contentDidUpdate,p=e.defaultView||e.parentView,c=r.jsxRuntimeExports.jsx(Q,{contentDidMount:t,contentDidUpdate:s,children:r.jsxRuntimeExports.jsx(Ee,{value:{document:e,window:p},children:r.jsxRuntimeExports.jsx("div",{className:"frame-content",children:this.props.children})})}),l=this.getMountTarget();return[H.createPortal(this.props.head,this.getDoc().head),H.createPortal(c,l)]}render(){const e={...this.props,srcDoc:this.props.initialContent,children:void 0};return delete e.head,delete e.initialContent,delete e.mountTarget,delete e.contentDidMount,delete e.contentDidUpdate,delete e.forwardedRef,r.jsxRuntimeExports.jsx("iframe",{...e,ref:this.setRef,onLoad:this.handleLoad,children:this.state.iframeLoaded&&this.renderFrameContents()})}}C(q,"propTypes",{style:b.object,head:b.node,initialContent:b.string,mountTarget:b.string,contentDidMount:b.func,contentDidUpdate:b.func,children:b.oneOfType([b.element,b.arrayOf(b.element)])}),C(q,"defaultProps",{style:{},head:null,children:void 0,mountTarget:void 0,contentDidMount:()=>{},contentDidUpdate:()=>{},initialContent:'<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'});const we=h.forwardRef((o,n)=>r.jsxRuntimeExports.jsx(q,{...o,forwardedRef:n})),Re=()=>{const{addCoreBlock:o}=i.useAddBlock(),n=i.useBuilderProp("getExternalPredefinedBlock",a.noop);return h.useCallback(async e=>{const{block:t,dropTargetId:s,relativeIndex:p}=e;if(a.has(t,"format")){const c=await n(t);return o({blocks:c},s===0?null:s,p)}return o(t,s===0?null:s,p)},[o])};let R=null,A=[],D=null,J=null;function Se(o){const n=window.getComputedStyle(o),e=parseInt(n.paddingLeft,10),t=parseInt(n.paddingTop,10),s=parseInt(n.paddingRight,10),p=parseInt(n.paddingBottom,10);return{paddingLeft:e,paddingTop:t,paddingRight:s,paddingBottom:p}}const W=(o,n,e)=>{if(!R)return;const t=o.getBoundingClientRect(),s=R==null?void 0:R.getElementById("placeholder"),{paddingLeft:p,paddingTop:c,paddingRight:l,paddingBottom:d}=Se(o);s.style.width=n==="vertical"?t.width-p-l+"px":"2px",s.style.height=n==="vertical"?"2px":t.height-c-d+"px",s.style.display="block";const u=A.reduce((x,f)=>Math.abs(f-e)<Math.abs(x-e)?f:x);J=A.indexOf(u),n==="vertical"?(s.style.top=o.offsetTop+u+"px",s.style.left=o.offsetLeft+p+"px"):(s.style.top=o.offsetTop+c+"px",s.style.left=o.offsetLeft+u+"px")},Be=o=>{const n=X(o),e=window.getComputedStyle(o),t=n==="horizontal",s=parseInt(e.paddingLeft),p=parseInt(e.paddingTop);let c=t?s:p;A=[c],Array.from(o.children).forEach(l=>{const d=window.getComputedStyle(l),u=parseInt(t?d.marginLeft+d.marginRight:d.marginTop+d.marginBottom),x=t?l.offsetWidth:l.offsetHeight;A.push(c+x+u),c+=x+u})};function X(o){const n=window.getComputedStyle(o).display,e=window.getComputedStyle(o).flexDirection;if(n==="flex")return e==="column"||e==="column-reverse"?"vertical":"horizontal";if(n==="grid"){const t=window.getComputedStyle(o).gridTemplateRows,s=window.getComputedStyle(o).gridTemplateColumns;if(t.includes("auto"))return"vertical";if(s.includes("auto"))return"horizontal"}return n==="block"?"vertical":"horizontal"}const Ce=a.throttle(o=>{const n=o.target,e=X(n);if(e==="vertical"){const t=o.clientY-n.offsetTop;W(n,e,t)}else{const t=o.clientX-n.offsetLeft;W(n,e,t)}},200),Ie=o=>{o.preventDefault(),o.stopPropagation(),Ce(o)};function N(){const o=R==null?void 0:R.getElementById("placeholder");o.style.display="none"}const De=()=>{const{document:o}=M(),[n,e]=E.useAtom(i.draggingFlagAtom),t=Re(),s=K.useFeature("dnd"),[,p]=i.useHighlightBlockId(),[,c]=i.useSelectedBlockIds();return R=o,{isDragging:n,"data-dnd":"branch",onDragOver:s?Ie:a.noop,onDrop:s?l=>{D==null||D.classList.remove("outline","outline-green-300","outline-2","-outline-offset-2");const d=JSON.parse(l.dataTransfer.getData("text/plain"));let u=l.target.getAttribute("data-block-id");u===null&&(u=l.target.parentElement.getAttribute("data-block-id")),t({block:d,dropTargetId:u||null,relativeIndex:J}),e(!1),N(),setTimeout(()=>{N()},300)}:a.noop,onDragEnter:s?l=>{const d=l;D=d.target,d.stopPropagation(),d.preventDefault(),A=[];const u=d.target;Be(u),u.classList.add("outline","outline-green-300","outline-2","-outline-offset-2"),e(!0),p(""),c([])}:a.noop,onDragLeave:s?l=>{const d=l;D=null,d.stopPropagation(),d.preventDefault(),d.target.classList.remove("outline","outline-green-300","outline-2","-outline-offset-2")}:a.noop,onMouseOut:s?()=>{e(!1),N()}:a.noop}};function F(o){return o.getAttribute("data-block-id")?o:o.closest("[data-block-id]")}function Ae(o){o.container.innerHTML="",o.container.parentNode.removeChild(o.container);var n=document.querySelector(".ql-toolbar");n&&n.parentNode.removeChild(n),o=null}const _e=()=>{const o=["Heading","Paragraph","Text","Link","Span","Button"],n=i.useUpdateBlocksProps(),[,e]=i.useHighlightBlockId(),[t,s]=E.useAtom(i.inlineEditingActiveAtom);return p=>{var f;if(t)return;const c=F(p.target),l=c.getAttribute("data-block-type");if(!l||!o.includes(l))return;const d=c.cloneNode(!0);c.style.display="none",Array.from(d.attributes).forEach(g=>{g.name!=="class"&&d.removeAttribute(g.name)}),l==="Text"&&(d.style.display="inline-block"),c.parentNode.insertBefore(d,c.nextSibling);const u=new re.Quill(d,{placeholder:"Type here..."});function x(){const g=u.getText(0,u.getLength());n([c.getAttribute("data-block-id")],{content:g}),c.removeAttribute("style"),d.removeEventListener("blur",x,!0),Ae(u),s(""),e("")}d.addEventListener("blur",x,!0),u.focus(),(f=d.querySelector(".ql-clipboard"))==null||f.remove(),s(c.getAttribute("data-block-id"))}},Te=()=>{const[,o]=i.useSelectedStylingBlocks(),[,n]=i.useSelectedBlockIds(),[,e]=i.useHighlightBlockId(),[t]=E.useAtom(i.inlineEditingActiveAtom),[s]=E.useAtom(i.treeRefAtom);return p=>{if(t)return;s.closeAll(),p.stopPropagation();const c=F(p.target);if(c!=null&&c.getAttribute("data-block-id")&&(c==null?void 0:c.getAttribute("data-block-id"))==="container"){n([]),o([]),e("");return}if(c!=null&&c.getAttribute("data-block-parent")){const l=c.getAttribute("data-style-prop"),d=c.getAttribute("data-style-id"),u=c.getAttribute("data-block-parent");o([{id:d,prop:l,blockId:u}]),n([u])}else c!=null&&c.getAttribute("data-block-id")&&n([c.getAttribute("data-block-id")]);e("")}},Me=a.throttle((o,n)=>{const e=F(o.target);e!=null&&e.getAttribute("data-style-id")&&n(e.getAttribute("data-style-id"))},100),Ne=()=>{const[,o]=i.useHighlightBlockId(),[n]=E.useAtom(i.inlineEditingActiveAtom);return e=>{n||Me(e,o)}},qe=({children:o})=>{const{document:n}=M(),[e]=i.useSelectedBlockIds(),[t,s]=i.useSelectedStylingBlocks();h.useEffect(()=>{setTimeout(()=>{if(!a.isEmpty(t))return;const u=V(n,a.first(e));if(u){const x=u.getAttribute("data-style-prop");if(x){const f=u.getAttribute("data-style-id"),g=u.getAttribute("data-block-parent");s([{id:f,prop:x,blockId:g}])}}},100)},[n,e,s,t]);const p=_e(),c=Te(),l=Ne(),d=De();return r.jsxRuntimeExports.jsx("div",{"data-block-id":"container",id:"canvas",onClick:c,onDoubleClick:p,onMouseMove:l,...a.omit(d,"isDragging"),className:"relative mb-5 h-full max-w-full "+(d.isDragging?"dragging":""),children:o})},V=(o,n)=>o.querySelector(`[data-block-id="${n}"]`),Le=()=>{const{window:o}=M(),[n,e]=i.useSelectedBlockIds(),[t]=i.useBlocksStore(),[,s]=i.useSelectedStylingBlocks(),{undo:p,redo:c}=i.useUndoManager(),l=i.useDuplicateBlocks(),[,d]=i.usePreviewMode(),u=i.useRemoveBlocks(),{savePage:x}=i.useSavePage(),[f]=E.useAtom(i.inlineEditingActiveAtom),[,g]=E.useAtom(i.editLayerNameAtom),y=v=>{v.key==="Enter"&&(v.preventDefault(),n.length===1&&g(a.first(n)))},w=v=>{const m=t.find(j=>j._id===v);return m?m._parent:null};return h.useEffect(()=>{const v=m=>{if(m.key==="Escape"){e([]),s([]);return}if(y(m),!f&&(m.key==="Delete"||m.key==="Backspace")&&(m.preventDefault(),u(n)),m.ctrlKey||m.metaKey){if(m.key==="ArrowUp"){m.preventDefault();const j=n.length>0?w(n[0]):null;j&&e([j])}if(["z","y","d","x","c","p","s","v"].includes(m.key)){if(f&&["x","z","v"].includes(m.key))return!0;m.preventDefault()}m.key==="s"&&(m.stopPropagation(),m.preventDefault(),x()),m.key==="z"&&p(),m.key==="y"&&c(),m.key==="d"&&l(n)}};return o.removeEventListener("keydown",v),o.addEventListener("keydown",v),()=>{o.removeEventListener("keydown",v)}},[n,e,p,u,d,c,l,f,x,o]),null},Pe=({block:o,label:n})=>{const[,e]=i.useSelectedBlockIds(),[,t]=i.useHighlightBlockId(),[,s]=E.useAtom(i.draggedBlockIdAtom),p=K.useFeature("dnd");return r.jsxRuntimeExports.jsxs("div",{className:"mr-10 flex cursor-grab items-center space-x-1 px-1",draggable:p?"true":"false",onDragStart:c=>{c.dataTransfer.setData("text/plain",JSON.stringify(a.pick(o,["_id","_type"]))),s(o._id),setTimeout(()=>{e([]),t(null)},200)},children:[r.jsxRuntimeExports.jsx(k.DragHandleDots2Icon,{}),n]})},Fe=({selectedBlockElement:o,block:n})=>{const e=i.useRemoveBlocks(),t=i.useDuplicateBlocks(),[,s]=i.useSelectedBlockIds(),[,p]=i.useSelectedStylingBlocks(),[c]=E.useAtom(i.inlineEditingActiveAtom),{floatingStyles:l,refs:d,update:u}=O.useFloating({placement:"top-start",middleware:[O.shift(),ie.flip()],elements:{reference:o}});le.useResizeObserver(o,()=>u(),o!==null);const x=a.get(n,"_parent",null),f=a.isEmpty(a.get(n,"_name",""))?a.get(n,"_type",""):a.get(n,"_name","");return!o||!n||c?null:r.jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,ref:d.setFloating,style:l,onClick:g=>{g.stopPropagation(),g.preventDefault()},onKeyDown:g=>g.stopPropagation(),className:"z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",children:[r.jsxRuntimeExports.jsx(Pe,{label:f,block:n}),r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 px-1",children:[x&&r.jsxRuntimeExports.jsx(k.ArrowUpIcon,{className:"hover:scale-105",onClick:()=>{p([]),s([x])}}),i.canDuplicateBlock(a.get(n,"_type",""))?r.jsxRuntimeExports.jsx(k.CopyIcon,{className:"hover:scale-105",onClick:()=>t([n==null?void 0:n._id])}):null,i.canDeleteBlock(a.get(n,"_type",""))?r.jsxRuntimeExports.jsx(k.TrashIcon,{className:"hover:scale-105",onClick:()=>e([n==null?void 0:n._id])}):null]})]})},He=({addVariant:o,e:n})=>{o("hs-dropdown-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-dropdown.open > .${n(`hs-dropdown-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-dropdown.open .hs-dropdown-toggle .${n(`hs-dropdown-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-dropdown.open > .hs-dropdown-menu > .${n(`hs-dropdown-open${t}${s}`)}`)}]),o("hs-removing",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-removing.${n(`hs-removing${t}${s}`)}`)}),o("hs-tooltip-shown",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-tooltip.show .${n(`hs-tooltip-shown${t}${s}`)}`)}),o("hs-accordion-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active.${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .hs-accordion-toggle .${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle .${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .hs-accordion-toggle.${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle.${n(`hs-accordion-active${t}${s}`)}`)}]),o("hs-accordion-selected",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion .selected.${n(`hs-accordion-selected${t}${s}`)}`)}),o("hs-collapse-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-collapse.open .${n(`hs-collapse-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-collapse.open.${n(`hs-collapse-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-collapse-toggle.open .${n(`hs-collapse-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-collapse-toggle.open.${n(`hs-collapse-open${t}${s}`)}`)}]),o("hs-tab-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`[data-hs-tab].active.${n(`hs-tab-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`[data-hs-tab].active .${n(`hs-tab-active${t}${s}`)}`)}]),o("hs-overlay-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.open.${n(`hs-overlay-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.open .${n(`hs-overlay-open${t}${s}`)}`)}]),o("hs-overlay-layout-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-overlay-body-open.${n(`hs-overlay-layout-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-overlay-body-open .${n(`hs-overlay-layout-open${t}${s}`)}`)}]),o("hs-overlay-backdrop-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-overlay-backdrop.${n(`hs-overlay-backdrop-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-overlay-backdrop .${n(`hs-overlay-backdrop-open${t}${s}`)}`)}]),o("hs-scrollspy-active",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-scrollspy-active${t}${s}`)}`)}),o("hs-carousel-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-carousel-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-carousel-active${t}${s}`)}`)}]),o("hs-carousel-disabled",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled.${n(`hs-carousel${t}disabled${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled .${n(`hs-carousel${t}disabled${t}${s}`)}`)}]),o("hs-selected",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.selected.${n(`hs-selected${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.selected .${n(`hs-selected${t}${s}`)}`)}]),o("hs-select-disabled",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled.${n(`hs-select-disabled${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled .${n(`hs-select-disabled${t}${s}`)}`)}]),o("hs-select-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-select-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-select-active${t}${s}`)}`)}]),o("hs-input-number-disabled",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled.${n(`hs-input-number-disabled${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled .${n(`hs-input-number-disabled${t}${s}`)}`)}]),o("hs-pin-input-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-pin-input-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-pin-input-active${t}${s}`)}`)}]),o("hs-select-opened",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.opened.${n(`hs-select-opened${t}${s}`)}`)}]),o("hs-password-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-password-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-password-active${t}${s}`)}`)}]),o("hs-stepper-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-stepper-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-stepper-active${t}${s}`)}`)}]),o("hs-stepper-success",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.success.${n(`hs-stepper-success${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.success .${n(`hs-stepper-success${t}${s}`)}`)}]),o("hs-stepper-completed",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.completed.${n(`hs-stepper-completed${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.completed .${n(`hs-stepper-completed${t}${s}`)}`)}]),o("hs-stepper-error",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.error.${n(`hs-stepper-error${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.error .${n(`hs-stepper-error${t}${s}`)}`)}]),o("hs-stepper-processed",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.processed.${n(`hs-stepper-processed${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.processed .${n(`hs-stepper-processed${t}${s}`)}`)}]),o("hs-stepper-disabled",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled.${n(`hs-stepper-disabled${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled .${n(`hs-stepper-disabled${t}${s}`)}`)}]),o("hs-stepper-skipped",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.skipped.${n(`hs-stepper-skipped${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.skipped .${n(`hs-stepper-skipped${t}${s}`)}`)}]),o("hs-strong-password",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.passed.${n(`hs-strong-password${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.passed .${n(`hs-strong-password${t}${s}`)}`)}]),o("hs-strong-password-accepted",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.accepted.${n(`hs-strong-password-accepted${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.accepted .${n(`hs-strong-password-accepted${t}${s}`)}`)}]),o("hs-strong-password-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-strong-password-active${t}${s}`)}`)}]),o("hs-combo-box-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-combo-box-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-combo-box-active${t}${s}`)}`)}]),o("hs-combo-box-selected",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.selected .${n(`hs-combo-box-selected${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.selected.${n(`hs-combo-box-selected${t}${s}`)}`)}]),o("hs-combo-box-tab-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-combo-box-tab-active${t}${s}`)}`)}]),o("hs-apexcharts-tooltip-dark",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.dark.${n(`hs-apexcharts-tooltip-dark${t}${s}`)}`)}]),o("hs-success",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.success .${n(`hs-success${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.success.${n(`hs-success${t}${s}`)}`)}]),o("hs-error",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.error .${n(`hs-error${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.error.${n(`hs-error${t}${s}`)}`)}]),o("hs-default-mode-active",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.default .${n(`hs-default-mode-active${t}${s}`)}`)}),o("hs-dark-mode-active",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.dark .${n(`hs-dark-mode-active${t}${s}`)}`)}),o("hs-auto-mode-active",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.auto .${n(`hs-auto-mode-active${t}${s}`)}`)})},Oe=({model:o})=>{const[n]=i.useBrandingOptions(),[e]=i.useSelectedBlockIds(),[t]=i.useDarkMode(),[s]=i.useHighlightBlockId(),[p]=i.useSelectedStylingBlocks(),[c]=E.useAtom(i.draggedBlockIdAtom),{document:l,window:d}=M(),[u]=h.useState(l==null?void 0:l.getElementById("highlighted-block")),[x]=h.useState(l==null?void 0:l.getElementById("selected-block")),[f]=h.useState(l==null?void 0:l.getElementById("selected-styling-block")),[g]=h.useState(l==null?void 0:l.getElementById("dragged-block"));h.useEffect(()=>{t?l==null||l.documentElement.classList.add("dark"):l==null||l.documentElement.classList.remove("dark")},[t,l]);const y=a.get(n,"headingFont","DM Sans"),w=a.get(n,"bodyFont","DM Sans");return h.useEffect(()=>{const v=a.get(n,"primaryColor","#000"),m=a.get(n,"secondaryColor","#FFF"),j=ce.tailwindcssPaletteGenerator({colors:[v,m],names:["primary","secondary"]});j.primary.DEFAULT=v,j.secondary.DEFAULT=m;const I=a.get(n,"roundedCorners","0");!d||!d.tailwind||(d.tailwind.config={darkMode:"class",theme:{fontFamily:{heading:[y],body:[w]},extend:{borderRadius:{global:`${I||"0"}px`},colors:j}},plugins:[ae,de,ue,d.tailwind.plugin.withOptions(()=>He)]})},[n,d,y,w]),h.useEffect(()=>{x&&(x.textContent=`${a.map(e,v=>`[data-block-id="${v}"]`).join(",")}{
51
+ </html>`,ke=o=>{const[n]=i.useCanvasWidth(),[,e]=i.useCanvasZoom(),[t,s]=h.useState({}),p=h.useCallback(()=>{const{width:c,height:l}=o;if(c<n){const d=parseFloat((c/n).toFixed(2).toString());let u={};const x=l*d;l&&(u={height:100+(l-x)/x*100+"%"}),s({position:"relative",top:0,transform:`scale(${d})`,transformOrigin:"top left",...u,maxWidth:"none"}),e(d*100)}else s({}),e(100)},[n,o,e]);return h.useEffect(()=>{p()},[n,o,e,p]),t};let Y,Z;typeof document<"u"&&(Y=document);typeof window<"u"&&(Z=window);const Q=h.createContext({document:Y,window:Z}),T=()=>h.useContext(Q),{Provider:Ee,Consumer:Ve}=Q;class J extends h.Component{componentDidMount(){this.props.contentDidMount()}componentDidUpdate(){this.props.contentDidUpdate()}render(){return h.Children.only(this.props.children)}}C(J,"propTypes",{children:b.element.isRequired,contentDidMount:b.func.isRequired,contentDidUpdate:b.func.isRequired});class q extends h.Component{constructor(e,t){super(e,t);C(this,"setRef",e=>{this.nodeRef.current=e;const{forwardedRef:t}=this.props;typeof t=="function"?t(e):t&&(t.current=e)});C(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});C(this,"loadCheck",()=>setInterval(()=>{this.handleLoad()},500));this._isMounted=!1,this.nodeRef=h.createRef(),this.state={iframeLoaded:!1}}componentDidMount(){this._isMounted=!0,this.getDoc()&&this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded",this.handleLoad)}componentWillUnmount(){this._isMounted=!1,this.nodeRef.current.removeEventListener("DOMContentLoaded",this.handleLoad)}getDoc(){return this.nodeRef.current?this.nodeRef.current.contentDocument:null}getMountTarget(){const e=this.getDoc();return this.props.mountTarget?e.querySelector(this.props.mountTarget):e.body.children[0]}renderFrameContents(){if(!this._isMounted)return null;const e=this.getDoc();if(!e)return null;const t=this.props.contentDidMount,s=this.props.contentDidUpdate,p=e.defaultView||e.parentView,c=r.jsxRuntimeExports.jsx(J,{contentDidMount:t,contentDidUpdate:s,children:r.jsxRuntimeExports.jsx(Ee,{value:{document:e,window:p},children:r.jsxRuntimeExports.jsx("div",{className:"frame-content",children:this.props.children})})}),l=this.getMountTarget();return[H.createPortal(this.props.head,this.getDoc().head),H.createPortal(c,l)]}render(){const e={...this.props,srcDoc:this.props.initialContent,children:void 0};return delete e.head,delete e.initialContent,delete e.mountTarget,delete e.contentDidMount,delete e.contentDidUpdate,delete e.forwardedRef,r.jsxRuntimeExports.jsx("iframe",{...e,ref:this.setRef,onLoad:this.handleLoad,children:this.state.iframeLoaded&&this.renderFrameContents()})}}C(q,"propTypes",{style:b.object,head:b.node,initialContent:b.string,mountTarget:b.string,contentDidMount:b.func,contentDidUpdate:b.func,children:b.oneOfType([b.element,b.arrayOf(b.element)])}),C(q,"defaultProps",{style:{},head:null,children:void 0,mountTarget:void 0,contentDidMount:()=>{},contentDidUpdate:()=>{},initialContent:'<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'});const Re=h.forwardRef((o,n)=>r.jsxRuntimeExports.jsx(q,{...o,forwardedRef:n})),we=()=>{const{addCoreBlock:o}=i.useAddBlock(),n=i.useBuilderProp("getExternalPredefinedBlock",a.noop);return h.useCallback(async e=>{const{block:t,dropTargetId:s,relativeIndex:p}=e;if(a.has(t,"format")){const c=await n(t);return o({blocks:c},s===0?null:s,p)}return o(t,s===0?null:s,p)},[o])};let w=null,A=[],D=null,G=null;function Se(o){const n=window.getComputedStyle(o),e=parseInt(n.paddingLeft,10),t=parseInt(n.paddingTop,10),s=parseInt(n.paddingRight,10),p=parseInt(n.paddingBottom,10);return{paddingLeft:e,paddingTop:t,paddingRight:s,paddingBottom:p}}const W=(o,n,e)=>{if(!w)return;const t=o.getBoundingClientRect(),s=w==null?void 0:w.getElementById("placeholder"),{paddingLeft:p,paddingTop:c,paddingRight:l,paddingBottom:d}=Se(o);s.style.width=n==="vertical"?t.width-p-l+"px":"2px",s.style.height=n==="vertical"?"2px":t.height-c-d+"px",s.style.display="block";const u=A.reduce((x,f)=>Math.abs(f-e)<Math.abs(x-e)?f:x);G=A.indexOf(u),n==="vertical"?(s.style.top=o.offsetTop+u+"px",s.style.left=o.offsetLeft+p+"px"):(s.style.top=o.offsetTop+c+"px",s.style.left=o.offsetLeft+u+"px")},Be=o=>{const n=X(o),e=window.getComputedStyle(o),t=n==="horizontal",s=parseInt(e.paddingLeft),p=parseInt(e.paddingTop);let c=t?s:p;A=[c],Array.from(o.children).forEach(l=>{const d=window.getComputedStyle(l),u=parseInt(t?d.marginLeft+d.marginRight:d.marginTop+d.marginBottom),x=t?l.offsetWidth:l.offsetHeight;A.push(c+x+u),c+=x+u})};function X(o){const n=window.getComputedStyle(o).display,e=window.getComputedStyle(o).flexDirection;if(n==="flex")return e==="column"||e==="column-reverse"?"vertical":"horizontal";if(n==="grid"){const t=window.getComputedStyle(o).gridTemplateRows,s=window.getComputedStyle(o).gridTemplateColumns;if(t.includes("auto"))return"vertical";if(s.includes("auto"))return"horizontal"}return n==="block"?"vertical":"horizontal"}const Ce=a.throttle(o=>{const n=o.target,e=X(n);if(e==="vertical"){const t=o.clientY-n.offsetTop;W(n,e,t)}else{const t=o.clientX-n.offsetLeft;W(n,e,t)}},200),Ie=o=>{o.preventDefault(),o.stopPropagation(),Ce(o)};function N(){const o=w==null?void 0:w.getElementById("placeholder");o.style.display="none"}const De=()=>{const{document:o}=T(),[n,e]=E.useAtom(i.draggingFlagAtom),t=we(),s=K.useFeature("dnd"),[,p]=i.useHighlightBlockId(),[,c]=i.useSelectedBlockIds();return w=o,{isDragging:n,"data-dnd":"branch",onDragOver:s?Ie:a.noop,onDrop:s?l=>{D==null||D.classList.remove("outline","outline-green-300","outline-2","-outline-offset-2");const d=JSON.parse(l.dataTransfer.getData("text/plain"));let u=l.target.getAttribute("data-block-id");u===null&&(u=l.target.parentElement.getAttribute("data-block-id")),t({block:d,dropTargetId:u||null,relativeIndex:G}),e(!1),N(),setTimeout(()=>{N()},300)}:a.noop,onDragEnter:s?l=>{const d=l;D=d.target,d.stopPropagation(),d.preventDefault(),A=[];const u=d.target;Be(u),u.classList.add("outline","outline-green-300","outline-2","-outline-offset-2"),e(!0),p(""),c([])}:a.noop,onDragLeave:s?l=>{const d=l;D=null,d.stopPropagation(),d.preventDefault(),d.target.classList.remove("outline","outline-green-300","outline-2","-outline-offset-2")}:a.noop,onMouseOut:s?()=>{e(!1),N()}:a.noop}};function F(o){return o.getAttribute("data-block-id")?o:o.closest("[data-block-id]")}function Ae(o){o.container.innerHTML="",o.container.parentNode.removeChild(o.container);var n=document.querySelector(".ql-toolbar");n&&n.parentNode.removeChild(n),o=null}const _e=()=>{const o=["Heading","Paragraph","Text","Link","Span","Button"],n=i.useUpdateBlocksProps(),[,e]=i.useHighlightBlockId(),[t,s]=E.useAtom(i.inlineEditingActiveAtom);return p=>{var f;if(t)return;const c=F(p.target),l=c.getAttribute("data-block-type");if(!l||!o.includes(l))return;const d=c.cloneNode(!0);c.style.display="none",Array.from(d.attributes).forEach(g=>{g.name!=="class"&&d.removeAttribute(g.name)}),l==="Text"&&(d.style.display="inline-block"),c.parentNode.insertBefore(d,c.nextSibling);const u=new re.Quill(d,{placeholder:"Type here..."});function x(){const g=u.getText(0,u.getLength());n([c.getAttribute("data-block-id")],{content:g}),c.removeAttribute("style"),d.removeEventListener("blur",x,!0),Ae(u),s(""),e("")}d.addEventListener("blur",x,!0),u.focus(),(f=d.querySelector(".ql-clipboard"))==null||f.remove(),s(c.getAttribute("data-block-id"))}},Me=()=>{const[,o]=i.useSelectedStylingBlocks(),[,n]=i.useSelectedBlockIds(),[,e]=i.useHighlightBlockId(),[t]=E.useAtom(i.inlineEditingActiveAtom),[s]=E.useAtom(i.treeRefAtom);return p=>{if(t)return;s.closeAll(),p.stopPropagation();const c=F(p.target);if(c!=null&&c.getAttribute("data-block-id")&&(c==null?void 0:c.getAttribute("data-block-id"))==="container"){n([]),o([]),e("");return}if(c!=null&&c.getAttribute("data-block-parent")){const l=c.getAttribute("data-style-prop"),d=c.getAttribute("data-style-id"),u=c.getAttribute("data-block-parent");o([{id:d,prop:l,blockId:u}]),n([u])}else c!=null&&c.getAttribute("data-block-id")&&n([c.getAttribute("data-block-id")]);e("")}},Te=a.throttle((o,n)=>{const e=F(o.target);e!=null&&e.getAttribute("data-style-id")&&n(e.getAttribute("data-style-id"))},100),Ne=()=>{const[,o]=i.useHighlightBlockId(),[n]=E.useAtom(i.inlineEditingActiveAtom);return e=>{n||Te(e,o)}},qe=({children:o})=>{const{document:n}=T(),[e]=i.useSelectedBlockIds(),[t,s]=i.useSelectedStylingBlocks();h.useEffect(()=>{setTimeout(()=>{if(!a.isEmpty(t))return;const u=V(n,a.first(e));if(u){const x=u.getAttribute("data-style-prop");if(x){const f=u.getAttribute("data-style-id"),g=u.getAttribute("data-block-parent");s([{id:f,prop:x,blockId:g}])}}},100)},[n,e,s,t]);const p=_e(),c=Me(),l=Ne(),d=De();return r.jsxRuntimeExports.jsx("div",{"data-block-id":"container",id:"canvas",onClick:c,onDoubleClick:p,onMouseMove:l,...a.omit(d,"isDragging"),className:"relative mb-5 h-full max-w-full "+(d.isDragging?"dragging":""),children:o})},V=(o,n)=>o.querySelector(`[data-block-id="${n}"]`),Le=()=>{const{window:o}=T(),[n,e]=i.useSelectedBlockIds(),[t]=i.useBlocksStore(),[,s]=i.useSelectedStylingBlocks(),{undo:p,redo:c}=i.useUndoManager(),l=i.useDuplicateBlocks(),[,d]=i.usePreviewMode(),u=i.useRemoveBlocks(),{savePage:x}=i.useSavePage(),[f]=E.useAtom(i.inlineEditingActiveAtom),[,g]=E.useAtom(i.editLayerNameAtom),j=v=>{v.key==="Enter"&&(v.preventDefault(),n.length===1&&g(a.first(n)))},R=v=>{const m=t.find(y=>y._id===v);return m?m._parent:null};return h.useEffect(()=>{const v=m=>{if(m.key==="Escape"){e([]),s([]);return}if(j(m),!f&&(m.key==="Delete"||m.key==="Backspace")&&(m.preventDefault(),u(n)),m.ctrlKey||m.metaKey){if(m.key==="ArrowUp"){m.preventDefault();const y=n.length>0?R(n[0]):null;y&&e([y])}if(["z","y","d","x","c","p","s","v"].includes(m.key)){if(f&&["x","z","v"].includes(m.key))return!0;m.preventDefault()}m.key==="s"&&(m.stopPropagation(),m.preventDefault(),x()),m.key==="z"&&p(),m.key==="y"&&c(),m.key==="d"&&l(n)}};return o.removeEventListener("keydown",v),o.addEventListener("keydown",v),()=>{o.removeEventListener("keydown",v)}},[n,e,p,u,d,c,l,f,x,o]),null},Pe=({block:o,label:n})=>{const[,e]=i.useSelectedBlockIds(),[,t]=i.useHighlightBlockId(),[,s]=E.useAtom(i.draggedBlockIdAtom),p=K.useFeature("dnd");return r.jsxRuntimeExports.jsxs("div",{className:"mr-10 flex cursor-grab items-center space-x-1 px-1",draggable:p?"true":"false",onDragStart:c=>{c.dataTransfer.setData("text/plain",JSON.stringify(a.pick(o,["_id","_type"]))),s(o._id),setTimeout(()=>{e([]),t(null)},200)},children:[r.jsxRuntimeExports.jsx(k.DragHandleDots2Icon,{}),n]})},Fe=({selectedBlockElement:o,block:n})=>{const e=i.useRemoveBlocks(),t=i.useDuplicateBlocks(),[,s]=i.useSelectedBlockIds(),[,p]=i.useSelectedStylingBlocks(),[c]=E.useAtom(i.inlineEditingActiveAtom),{floatingStyles:l,refs:d,update:u}=O.useFloating({placement:"top-start",middleware:[O.shift(),ie.flip()],elements:{reference:o}});le.useResizeObserver(o,()=>u(),o!==null);const x=a.get(n,"_parent",null),f=a.isEmpty(a.get(n,"_name",""))?a.get(n,"_type",""):a.get(n,"_name","");return!o||!n||c?null:r.jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,ref:d.setFloating,style:l,onClick:g=>{g.stopPropagation(),g.preventDefault()},onKeyDown:g=>g.stopPropagation(),className:"z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",children:[r.jsxRuntimeExports.jsx(Pe,{label:f,block:n}),r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 px-1",children:[x&&r.jsxRuntimeExports.jsx(k.ArrowUpIcon,{className:"hover:scale-105",onClick:()=>{p([]),s([x])}}),i.canDuplicateBlock(a.get(n,"_type",""))?r.jsxRuntimeExports.jsx(k.CopyIcon,{className:"hover:scale-105",onClick:()=>t([n==null?void 0:n._id])}):null,i.canDeleteBlock(a.get(n,"_type",""))?r.jsxRuntimeExports.jsx(k.TrashIcon,{className:"hover:scale-105",onClick:()=>e([n==null?void 0:n._id])}):null]})]})},He=({addVariant:o,e:n})=>{o("hs-dropdown-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-dropdown.open > .${n(`hs-dropdown-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-dropdown.open .hs-dropdown-toggle .${n(`hs-dropdown-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-dropdown.open > .hs-dropdown-menu > .${n(`hs-dropdown-open${t}${s}`)}`)}]),o("hs-removing",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-removing.${n(`hs-removing${t}${s}`)}`)}),o("hs-tooltip-shown",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-tooltip.show .${n(`hs-tooltip-shown${t}${s}`)}`)}),o("hs-accordion-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active.${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .hs-accordion-toggle .${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle .${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .hs-accordion-toggle.${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle.${n(`hs-accordion-active${t}${s}`)}`)}]),o("hs-accordion-selected",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion .selected.${n(`hs-accordion-selected${t}${s}`)}`)}),o("hs-collapse-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-collapse.open .${n(`hs-collapse-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-collapse.open.${n(`hs-collapse-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-collapse-toggle.open .${n(`hs-collapse-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-collapse-toggle.open.${n(`hs-collapse-open${t}${s}`)}`)}]),o("hs-tab-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`[data-hs-tab].active.${n(`hs-tab-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`[data-hs-tab].active .${n(`hs-tab-active${t}${s}`)}`)}]),o("hs-overlay-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.open.${n(`hs-overlay-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.open .${n(`hs-overlay-open${t}${s}`)}`)}]),o("hs-overlay-layout-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-overlay-body-open.${n(`hs-overlay-layout-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-overlay-body-open .${n(`hs-overlay-layout-open${t}${s}`)}`)}]),o("hs-overlay-backdrop-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-overlay-backdrop.${n(`hs-overlay-backdrop-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-overlay-backdrop .${n(`hs-overlay-backdrop-open${t}${s}`)}`)}]),o("hs-scrollspy-active",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-scrollspy-active${t}${s}`)}`)}),o("hs-carousel-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-carousel-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-carousel-active${t}${s}`)}`)}]),o("hs-carousel-disabled",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled.${n(`hs-carousel${t}disabled${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled .${n(`hs-carousel${t}disabled${t}${s}`)}`)}]),o("hs-selected",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.selected.${n(`hs-selected${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.selected .${n(`hs-selected${t}${s}`)}`)}]),o("hs-select-disabled",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled.${n(`hs-select-disabled${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled .${n(`hs-select-disabled${t}${s}`)}`)}]),o("hs-select-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-select-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-select-active${t}${s}`)}`)}]),o("hs-input-number-disabled",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled.${n(`hs-input-number-disabled${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled .${n(`hs-input-number-disabled${t}${s}`)}`)}]),o("hs-pin-input-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-pin-input-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-pin-input-active${t}${s}`)}`)}]),o("hs-select-opened",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.opened.${n(`hs-select-opened${t}${s}`)}`)}]),o("hs-password-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-password-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-password-active${t}${s}`)}`)}]),o("hs-stepper-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-stepper-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-stepper-active${t}${s}`)}`)}]),o("hs-stepper-success",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.success.${n(`hs-stepper-success${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.success .${n(`hs-stepper-success${t}${s}`)}`)}]),o("hs-stepper-completed",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.completed.${n(`hs-stepper-completed${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.completed .${n(`hs-stepper-completed${t}${s}`)}`)}]),o("hs-stepper-error",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.error.${n(`hs-stepper-error${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.error .${n(`hs-stepper-error${t}${s}`)}`)}]),o("hs-stepper-processed",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.processed.${n(`hs-stepper-processed${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.processed .${n(`hs-stepper-processed${t}${s}`)}`)}]),o("hs-stepper-disabled",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled.${n(`hs-stepper-disabled${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled .${n(`hs-stepper-disabled${t}${s}`)}`)}]),o("hs-stepper-skipped",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.skipped.${n(`hs-stepper-skipped${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.skipped .${n(`hs-stepper-skipped${t}${s}`)}`)}]),o("hs-strong-password",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.passed.${n(`hs-strong-password${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.passed .${n(`hs-strong-password${t}${s}`)}`)}]),o("hs-strong-password-accepted",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.accepted.${n(`hs-strong-password-accepted${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.accepted .${n(`hs-strong-password-accepted${t}${s}`)}`)}]),o("hs-strong-password-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-strong-password-active${t}${s}`)}`)}]),o("hs-combo-box-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-combo-box-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-combo-box-active${t}${s}`)}`)}]),o("hs-combo-box-selected",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.selected .${n(`hs-combo-box-selected${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.selected.${n(`hs-combo-box-selected${t}${s}`)}`)}]),o("hs-combo-box-tab-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-combo-box-tab-active${t}${s}`)}`)}]),o("hs-apexcharts-tooltip-dark",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.dark.${n(`hs-apexcharts-tooltip-dark${t}${s}`)}`)}]),o("hs-success",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.success .${n(`hs-success${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.success.${n(`hs-success${t}${s}`)}`)}]),o("hs-error",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.error .${n(`hs-error${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.error.${n(`hs-error${t}${s}`)}`)}]),o("hs-default-mode-active",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.default .${n(`hs-default-mode-active${t}${s}`)}`)}),o("hs-dark-mode-active",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.dark .${n(`hs-dark-mode-active${t}${s}`)}`)}),o("hs-auto-mode-active",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.auto .${n(`hs-auto-mode-active${t}${s}`)}`)})},Oe=({model:o})=>{const[n]=i.useBrandingOptions(),[e]=i.useSelectedBlockIds(),[t]=i.useDarkMode(),[s]=i.useHighlightBlockId(),[p]=i.useSelectedStylingBlocks(),[c]=E.useAtom(i.draggedBlockIdAtom),{document:l,window:d}=T(),[u]=h.useState(l==null?void 0:l.getElementById("highlighted-block")),[x]=h.useState(l==null?void 0:l.getElementById("selected-block")),[f]=h.useState(l==null?void 0:l.getElementById("selected-styling-block")),[g]=h.useState(l==null?void 0:l.getElementById("dragged-block"));h.useEffect(()=>{t?l==null||l.documentElement.classList.add("dark"):l==null||l.documentElement.classList.remove("dark")},[t,l]);const j=a.get(n,"headingFont","DM Sans"),R=a.get(n,"bodyFont","DM Sans");return h.useEffect(()=>{const v=a.get(n,"primaryColor","#000"),m=a.get(n,"secondaryColor","#FFF"),y=ue([{color:v,name:"primary"},{color:m,name:"secondary"}]),I=a.get(n,"roundedCorners","0");!d||!d.tailwind||(d.tailwind.config={darkMode:"class",theme:{fontFamily:{heading:[j],body:[R]},extend:{borderRadius:{global:`${I||"0"}px`},colors:y}},plugins:[ce,ae,de,d.tailwind.plugin.withOptions(()=>He)]})},[n,d,j,R]),h.useEffect(()=>{x&&(x.textContent=`${a.map(e,v=>`[data-block-id="${v}"]`).join(",")}{
52
52
  outline: 1px solid ${e.length===1?"#42a1fc":"orange"} !important; outline-offset: -1px;
53
53
  }`)},[e,x]),h.useEffect(()=>{if(!c){g.textContent="";return}g.textContent=`[data-block-id="${c}"]{ pointer-events: none !important; opacity: 0.2 !important}`},[c]),h.useEffect(()=>{u&&(u.textContent=s?`[data-style-id="${s}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}`:"")},[s,e,u]),h.useEffect(()=>{f&&(f.textContent=`${a.map(p,({id:v})=>`[data-style-id="${v}"]`).join(",")}{
54
54
  outline: 1px solid #42a1fc !important; outline-offset: -1px;
55
- }`)},[p,f]),h.useEffect(()=>{const v=a.get(n,"bodyTextLightColor","#64748b"),m=a.get(n,"bodyTextDarkColor","#94a3b8"),j=a.get(n,"bodyBgLightColor","#FFFFFF"),I=a.get(n,"bodyBgDarkColor","#0f172a");l.body.className=`font-body antialiased text-[${v}] bg-[${j}] dark:text-[${m}] dark:bg-[${I}]`},[n,l,o]),o==="page"?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[y&&r.jsxRuntimeExports.jsx("link",{id:"heading-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${y.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),w&&y!==w&&r.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${w.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),y&&r.jsxRuntimeExports.jsx("style",{children:`h1,h2,h3,h4,h5,h6{font-family: "${y}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}`})]}):null},Ue=o=>{const n={};return Object.keys(o).forEach(e=>{a.isString(o[e])&&o[e].startsWith(_.SLOT_KEY)&&(n[e]=o[e].replace(_.SLOT_KEY,"").split(","))}),n},ze=a.memoize(o=>{const n=o.replace(_.STYLES_KEY,"").split(",");return he.twMerge(n[0],n[1])});function We(o,n){return a.get(o,`${n}_attrs`,{})}function Ke(o){const n={};return Object.keys(o).forEach(e=>{if(a.isString(o[e])&&o[e].startsWith(_.STYLES_KEY)){const t=ze(o[e]);n[e]={className:t,"data-style-prop":e,"data-block-parent":o._id,"data-style-id":`${e}-${o._id}`,...We(o,e)}}}),n}function Ye(o,n){const e=a.get(o,"_bindings",{});return a.isEmpty(e)?{...o}:(a.each(e,(t,s)=>{a.isString(t)&&a.get(n,t,null)&&(o[s]=a.get(n,t,null))}),o)}function L({blocks:o}){const[n]=i.useBlocksStore(),[e]=me.useCanvasSettings(),t=h.useCallback(l=>Ke(l),[]),[s]=P.useChaiExternalData(),[p]=E.useAtom(i.inlineEditingActiveAtom),c=h.useCallback(l=>l.reduce((d,u)=>{const x=a.get(e,u,{});return{...d,...x}},{}),[e,n]);return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:h.Children.toArray(o.map((l,d)=>{if(p===l._id)return null;const u=Ue(l),x={};a.isEmpty(u)||Object.keys(u).forEach(m=>{x[m]=h.Children.toArray(u[m].map(j=>r.jsxRuntimeExports.jsx(L,{blocks:[a.find(n,{_id:j})]})))});const f=a.filter(n,{_parent:l._id});x.children=f.length?r.jsxRuntimeExports.jsx(L,{blocks:f}):null;const g=xe.getBlockComponent(l._type),y=a.get(g,"builderComponent",a.get(g,"component",null));if(a.isNull(y))return r.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${l==null?void 0:l._type} not registered -->`});const w=a.has(g,"getBlockStateFrom")?g==null?void 0:g.getBlockStateFrom(l,n):[],v=c(w);return r.jsxRuntimeExports.jsx(h.Suspense,{children:h.createElement(y,{blockProps:{"data-block-id":l._id,"data-block-type":l._type,"data-dnd":a.has(g,"canAcceptBlock")?"branch":"leaf"},index:d,...Ye(l,s),...t(l),...x,inBuilder:!0,blockState:v})})}))})}const Ze=()=>{const[o]=i.useBlocksStore(),n=a.isEmpty(o)?null:r.jsxRuntimeExports.jsx(P.BlocksExternalDataProvider,{children:r.jsxRuntimeExports.jsx(L,{blocks:a.filter(o,e=>a.isEmpty(e._parent))})});return r.jsxRuntimeExports.jsx(pe.Provider,{children:n})},Ge=(o,n)=>o.querySelector(`[data-style-id="${n}"]`),Qe=()=>{const[o]=E.useAtom(i.networkModeAtom),[n]=i.usePreviewMode(),[e]=i.useCanvasWidth(),[,t]=i.useSelectedBlockIds(),s=i.useSelectedBlock(),[,p]=i.useHighlightBlockId(),c=h.useRef(null),l=h.useRef(null),[d,u]=h.useState({width:0,height:0}),x=ke(d),[f,g]=h.useState(0),[y,w]=h.useState([]),[,v]=h.useState([]),[,m]=E.useAtom(i.canvasIframeAtom),[j,I]=i.useSelectedStylingBlocks(),ee=i.useBuilderProp("loading",!1);h.useEffect(()=>{const{clientWidth:$,clientHeight:S}=l.current;u({width:$,height:S}),f===0&&g($)},[l,e,f]);const te=($,S=0)=>{const{top:B}=$.getBoundingClientRect();return B+S>=0&&B-S<=window.innerHeight};h.useEffect(()=>{var $,S;if(s&&s.type!=="Multiple"&&c.current){const B=V(c.current.contentDocument,s._id);B&&(te(B)||(S=($=c.current)==null?void 0:$.contentWindow)==null||S.scrollTo({top:B.offsetTop,behavior:"smooth"}),w([B]))}},[s]),h.useEffect(()=>{if(!a.isEmpty(j)&&c.current){const $=Ge(c.current.contentDocument,a.first(j).id);v($?[$]:[null])}else v([null])},[j]);const se=h.useMemo(()=>{let $=be;return o==="offline"&&($=$.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),$=$.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),$=$.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),$},[o]);return r.jsxRuntimeExports.jsx("div",{onClick:()=>{t([]),I([])},onMouseLeave:()=>setTimeout(()=>p(""),300),className:"relative mx-auto h-full w-full overflow-hidden",style:f>0&&!a.isEmpty(x)?{width:n?"100%":f}:{},ref:l,children:r.jsxRuntimeExports.jsxs(we,{contentDidMount:()=>m(c.current),ref:c,id:"canvas-iframe",style:{width:`${e}px`,...x},className:"relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",initialContent:se,children:[r.jsxRuntimeExports.jsx(Le,{}),r.jsxRuntimeExports.jsx(Fe,{block:s,selectedBlockElement:a.first(y)}),r.jsxRuntimeExports.jsx(Oe,{model:"page"}),r.jsxRuntimeExports.jsx(qe,{children:ee?r.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:r.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full"})}):r.jsxRuntimeExports.jsx(Ze,{})}),r.jsxRuntimeExports.jsx("br",{}),r.jsxRuntimeExports.jsx("div",{id:"placeholder",className:"absolute z-[99999] max-w-full bg-green-500 transition-transform"})]})})},Je=()=>r.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col",children:[r.jsxRuntimeExports.jsx(ye,{}),r.jsxRuntimeExports.jsx("div",{className:"relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2",children:r.jsxRuntimeExports.jsx(h.Suspense,{fallback:r.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full"}),children:r.jsxRuntimeExports.jsx(P.ErrorBoundary,{children:r.jsxRuntimeExports.jsx(Qe,{})})})})]});exports.default=Je;
55
+ }`)},[p,f]),h.useEffect(()=>{const v=a.get(n,"bodyTextLightColor","#64748b"),m=a.get(n,"bodyTextDarkColor","#94a3b8"),y=a.get(n,"bodyBgLightColor","#FFFFFF"),I=a.get(n,"bodyBgDarkColor","#0f172a");l.body.className=`font-body antialiased text-[${v}] bg-[${y}] dark:text-[${m}] dark:bg-[${I}]`},[n,l,o]),o==="page"?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[j&&r.jsxRuntimeExports.jsx("link",{id:"heading-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${j.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),R&&j!==R&&r.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${R.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),j&&r.jsxRuntimeExports.jsx("style",{children:`h1,h2,h3,h4,h5,h6{font-family: "${j}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}`})]}):null},Ue=o=>{const n={};return Object.keys(o).forEach(e=>{a.isString(o[e])&&o[e].startsWith(_.SLOT_KEY)&&(n[e]=o[e].replace(_.SLOT_KEY,"").split(","))}),n},ze=a.memoize(o=>{const n=o.replace(_.STYLES_KEY,"").split(",");return he.twMerge(n[0],n[1])});function We(o,n){return a.get(o,`${n}_attrs`,{})}function Ke(o){const n={};return Object.keys(o).forEach(e=>{if(a.isString(o[e])&&o[e].startsWith(_.STYLES_KEY)){const t=ze(o[e]);n[e]={className:t,"data-style-prop":e,"data-block-parent":o._id,"data-style-id":`${e}-${o._id}`,...We(o,e)}}}),n}function Ye(o,n){const e=a.get(o,"_bindings",{});return a.isEmpty(e)?{...o}:(a.each(e,(t,s)=>{a.isString(t)&&a.get(n,t,null)&&(o[s]=a.get(n,t,null))}),o)}function L({blocks:o}){const[n]=i.useBlocksStore(),[e]=me.useCanvasSettings(),t=h.useCallback(l=>Ke(l),[]),[s]=P.useChaiExternalData(),[p]=E.useAtom(i.inlineEditingActiveAtom),c=h.useCallback(l=>l.reduce((d,u)=>{const x=a.get(e,u,{});return{...d,...x}},{}),[e,n]);return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:h.Children.toArray(o.map((l,d)=>{if(p===l._id)return null;const u=Ue(l),x={};a.isEmpty(u)||Object.keys(u).forEach(m=>{x[m]=h.Children.toArray(u[m].map(y=>r.jsxRuntimeExports.jsx(L,{blocks:[a.find(n,{_id:y})]})))});const f=a.filter(n,{_parent:l._id});x.children=f.length?r.jsxRuntimeExports.jsx(L,{blocks:f}):null;const g=xe.getBlockComponent(l._type),j=a.get(g,"builderComponent",a.get(g,"component",null));if(a.isNull(j))return r.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${l==null?void 0:l._type} not registered -->`});const R=a.has(g,"getBlockStateFrom")?g==null?void 0:g.getBlockStateFrom(l,n):[],v=c(R);return r.jsxRuntimeExports.jsx(h.Suspense,{children:h.createElement(j,{blockProps:{"data-block-id":l._id,"data-block-type":l._type,"data-dnd":a.has(g,"canAcceptBlock")?"branch":"leaf"},index:d,...Ye(l,s),...t(l),...x,inBuilder:!0,blockState:v})})}))})}const Ze=()=>{const[o]=i.useBlocksStore(),n=a.isEmpty(o)?null:r.jsxRuntimeExports.jsx(P.BlocksExternalDataProvider,{children:r.jsxRuntimeExports.jsx(L,{blocks:a.filter(o,e=>a.isEmpty(e._parent))})});return r.jsxRuntimeExports.jsx(pe.Provider,{children:n})},Qe=(o,n)=>o.querySelector(`[data-style-id="${n}"]`),Je=()=>{const[o]=E.useAtom(i.networkModeAtom),[n]=i.usePreviewMode(),[e]=i.useCanvasWidth(),[,t]=i.useSelectedBlockIds(),s=i.useSelectedBlock(),[,p]=i.useHighlightBlockId(),c=h.useRef(null),l=h.useRef(null),[d,u]=h.useState({width:0,height:0}),x=ke(d),[f,g]=h.useState(0),[j,R]=h.useState([]),[,v]=h.useState([]),[,m]=E.useAtom(i.canvasIframeAtom),[y,I]=i.useSelectedStylingBlocks(),ee=i.useBuilderProp("loading",!1);h.useEffect(()=>{const{clientWidth:$,clientHeight:S}=l.current;u({width:$,height:S}),f===0&&g($)},[l,e,f]);const te=($,S=0)=>{const{top:B}=$.getBoundingClientRect();return B+S>=0&&B-S<=window.innerHeight};h.useEffect(()=>{var $,S;if(s&&s.type!=="Multiple"&&c.current){const B=V(c.current.contentDocument,s._id);B&&(te(B)||(S=($=c.current)==null?void 0:$.contentWindow)==null||S.scrollTo({top:B.offsetTop,behavior:"smooth"}),R([B]))}},[s]),h.useEffect(()=>{if(!a.isEmpty(y)&&c.current){const $=Qe(c.current.contentDocument,a.first(y).id);v($?[$]:[null])}else v([null])},[y]);const se=h.useMemo(()=>{let $=be;return o==="offline"&&($=$.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),$=$.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),$=$.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),$},[o]);return r.jsxRuntimeExports.jsx("div",{onClick:()=>{t([]),I([])},onMouseLeave:()=>setTimeout(()=>p(""),300),className:"relative mx-auto h-full w-full overflow-hidden",style:f>0&&!a.isEmpty(x)?{width:n?"100%":f}:{},ref:l,children:r.jsxRuntimeExports.jsxs(Re,{contentDidMount:()=>m(c.current),ref:c,id:"canvas-iframe",style:{width:`${e}px`,...x},className:"relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",initialContent:se,children:[r.jsxRuntimeExports.jsx(Le,{}),r.jsxRuntimeExports.jsx(Fe,{block:s,selectedBlockElement:a.first(j)}),r.jsxRuntimeExports.jsx(Oe,{model:"page"}),r.jsxRuntimeExports.jsx(qe,{children:ee?r.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:r.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full"})}):r.jsxRuntimeExports.jsx(Ze,{})}),r.jsxRuntimeExports.jsx("br",{}),r.jsxRuntimeExports.jsx("div",{id:"placeholder",className:"absolute z-[99999] max-w-full bg-green-500 transition-transform"})]})})},Ge=()=>r.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col",children:[r.jsxRuntimeExports.jsx(ye,{}),r.jsxRuntimeExports.jsx("div",{className:"relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2",children:r.jsxRuntimeExports.jsx(h.Suspense,{fallback:r.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full"}),children:r.jsxRuntimeExports.jsx(P.ErrorBoundary,{children:r.jsxRuntimeExports.jsx(Je,{})})})})]});exports.default=Ge;
@@ -1,9 +1,9 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { z as h, aj as f, ak as j, al as y, am as v, an as P } from "./index-HiiWSXkE.js";
2
+ import { z as h, aj as f, ak as j, al as y, am as v, an as P } from "./index-hH5SIZ29.js";
3
3
  import { sortBy as b, filter as k, get as w, isEmpty as m, find as n, capitalize as C, map as N } from "lodash-es";
4
4
  import { toast as S } from "sonner";
5
5
  import { useEffect as p } from "react";
6
- import { a as B, u as E, c as T, d as z } from "./index-DtBYhldP.js";
6
+ import { a as B, u as E, c as T, d as z } from "./index-5zkCTSAM.js";
7
7
  import { BriefcaseIcon as I } from "lucide-react";
8
8
  import { useTranslation as L } from "react-i18next";
9
9
  import "./_commonjsHelpers-UyOWmZb0.js";
@@ -40,7 +40,7 @@ import "@radix-ui/react-context-menu";
40
40
  import "react-icons-picker";
41
41
  import "react-dom";
42
42
  import "react-quill";
43
- import "./index-SEJRE2ab.js";
43
+ import "./index-AJalHhkO.js";
44
44
  import "i18next";
45
45
  import "@floating-ui/react-dom";
46
46
  import "flagged";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("./index-12HbDLon.cjs"),i=require("lodash-es"),j=require("sonner"),l=require("react"),o=require("./index-5c_rU-9B.cjs"),p=require("lucide-react"),f=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.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("./index-DHwvjZ5z.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");require("./index-ecnGWzh9.cjs");const E=()=>{const{data:t}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{saveState:d}=s.useSavePage(),m=o.useChangePage(),{t:q}=f.useTranslation(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(t==null?void 0:t.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&t.homepage&&!i.find(u,{uuid:n})&&a(t.homepage)},[n,u,t,a]),l.useEffect(()=>()=>a(null),[a]);const g=r=>{if(d!=="SAVED")j.toast.error(q("You have unsaved changes. Please save before changing the page."));else{const h=i.find(c,{uuid:r});m(h)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 py-1 pr-0 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(p.BriefcaseIcon,{className:"mr-2 h-4 w-4"}),i.capitalize(t.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(s.Select,{value:n||"",onValueChange:g,children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(s.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("./index-FPBudsRF.cjs"),i=require("lodash-es"),j=require("sonner"),l=require("react"),o=require("./index-JIcsKKoG.cjs"),p=require("lucide-react"),f=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.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("./index-sJ9Uc9UY.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");require("./index-ecnGWzh9.cjs");const E=()=>{const{data:t}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{saveState:d}=s.useSavePage(),m=o.useChangePage(),{t:q}=f.useTranslation(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(t==null?void 0:t.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&t.homepage&&!i.find(u,{uuid:n})&&a(t.homepage)},[n,u,t,a]),l.useEffect(()=>()=>a(null),[a]);const g=r=>{if(d!=="SAVED")j.toast.error(q("You have unsaved changes. Please save before changing the page."));else{const h=i.find(c,{uuid:r});m(h)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 py-1 pr-0 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(p.BriefcaseIcon,{className:"mr-2 h-4 w-4"}),i.capitalize(t.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(s.Select,{value:n||"",onValueChange:g,children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(s.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=E;
@@ -3,7 +3,7 @@ import _, { memo as b, useMemo as k, useCallback as z, useEffect as N, useRef as
3
3
  import { useAtom as C } from "jotai";
4
4
  import { useDebouncedCallback as R } from "@react-hookz/web";
5
5
  import { Tree as L } from "react-arborist";
6
- import { E as M, r as y, s as F, a1 as S, bx as P, aT as O, t as V, by as $, aS as U, bz as q, bA as G, h as K, Y as W, bB as v, ap as Y, aq as J, ar as Q, bC as X, a5 as Z, ac as ee, aM as te, aP as se } from "./index-HiiWSXkE.js";
6
+ import { E as M, r as y, s as F, a1 as S, bx as P, aT as O, t as V, by as $, aS as U, bz as q, bA as G, h as K, Y as W, bB as v, ap as Y, aq as J, ar as Q, bC as X, a5 as Z, ac as ee, aM as te, aP as se } from "./index-hH5SIZ29.js";
7
7
  import { c as H } from "./Functions-7jnEwJyw.js";
8
8
  import { BoxModelIcon as re, BoxIcon as oe, DragHandleHorizontalIcon as ne, ViewHorizontalIcon as ce, BorderAllIcon as ae, BorderTopIcon as ie, TableIcon as le, DropdownMenuIcon as ue, RadiobuttonIcon as de, InputIcon as pe, ButtonIcon as B, CheckboxIcon as xe, GroupIcon as me, SpaceBetweenVerticallyIcon as he, ColumnsIcon as ge, RowsIcon as T, TextIcon as w, SketchLogoIcon as fe, DividerHorizontalIcon as je, CodeIcon as be, CursorTextIcon as ye, VideoIcon as ve, Link1Icon as Ie, HeadingIcon as ke, ImageIcon as Ce, TrashIcon as Be, CopyIcon as Te, TriangleRightIcon as we } from "@radix-ui/react-icons";
9
9
  import { DatabaseIcon as De } from "lucide-react";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),v=require("jotai"),k=require("@react-hookz/web"),C=require("react-arborist"),r=require("./index-12HbDLon.cjs"),q=require("./Functions-N3yhPYKY.cjs"),s=require("@radix-ui/react-icons"),T=require("lucide-react"),I=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@chaibuilder/runtime");require("./STRINGS-gPz7CUOk.cjs");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.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 B=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(T.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}},w={display:"flex",alignItems:"center",zIndex:1},D=a.memo(function({top:i,left:n}){const l={position:"absolute",pointerEvents:"none",top:i+"px",left:n+"px",right:0};return e.jsxRuntimeExports.jsx("div",{style:{...w,...l},children:e.jsxRuntimeExports.jsx("div",{className:"h-0.5 flex-1 rounded-[1px] bg-green-500"})})}),S=a.memo(function({children:i,isDragging:n}){return n?e.jsxRuntimeExports.jsx("div",{className:"pointer-events-none fixed left-0 top-0 z-[100] h-full w-full",children:i}):null}),N=a.memo(({id:t,isDragging:i,mouse:n})=>{const[l]=r.useBlocksStore(),c=a.useMemo(()=>l.find(p=>p._id===t),[l,t]),m=a.useMemo(()=>({transform:`translate(${(n==null?void 0:n.x)-10}px, ${(n==null?void 0:n.y)-10}px)`}),[n]);return n?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(S,{isDragging:i,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:m,children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex !cursor-grab items-center p-0.5","aria-label":`Type: ${c==null?void 0:c._type}`,children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:e.jsxRuntimeExports.jsx(B,{type:c==null?void 0:c._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:(c==null?void 0:c._name)||(c==null?void 0:c._type)})]})})})}):e.jsxRuntimeExports.jsx("div",{className:"hidden"})}),_=()=>{const[t]=r.useSelectedBlockIds(),i=r.useRemoveBlocks(),n=r.useSelectedBlock();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDeleteBlock(n==null?void 0:n._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>i(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},M=()=>{const[t]=r.useSelectedBlockIds(),i=r.useDuplicateBlocks(),n=r.useSelectedBlock(),l=a.useCallback(()=>{i(t)},[t,i]);return e.jsxRuntimeExports.jsxs(r.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDuplicateBlock(n==null?void 0:n._type),className:"flex items-center gap-x-4 text-xs",onClick:l,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(_,{})]})},A=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(r.ContextMenu,{children:[e.jsxRuntimeExports.jsx(r.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(M,{})]})}),P=a.memo(({node:t,style:i,dragHandle:n})=>{const l=r.useBuilderProp("outlineMenuItems",[]),[,c]=r.useHighlightBlockId(),m=t.children.length>0,{id:p,data:x,isSelected:R,willReceiveDrop:j,isDragging:h,isEditing:g,handleClick:E}=t,f=k.useDebouncedCallback(o=>c(o),[],300),b=o=>{o.stopPropagation(),t.toggle()},u=o=>{o.stopPropagation(),t.isOpen||t.toggle(),E(o)};return a.useEffect(()=>{const o=setTimeout(()=>{j&&!t.isOpen&&t.toggle()},500);return()=>clearTimeout(o)},[j,t]),e.jsxRuntimeExports.jsx(A,{id:p,children:e.jsxRuntimeExports.jsxs("div",{onClick:u,onMouseEnter:()=>f(p),style:i,"data-node-id":p,ref:n,className:q.cn("group flex !h-fit w-full items-center justify-between space-x-px py-px outline-none",R?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800",j&&r.canAcceptChildBlock(x._type,"Icon")?"bg-green-200":"",h&&"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:m&&e.jsxRuntimeExports.jsx("button",{onClick:b,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(B,{type:x==null?void 0:x._type})}),g?e.jsxRuntimeExports.jsx(H,{node:t}):e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",onDoubleClick:o=>{o.stopPropagation(),t.edit(),t.deselect()},children:(x==null?void 0:x._name)||(x==null?void 0:x._type.split("/").pop())})]})]}),e.jsxRuntimeExports.jsx("div",{className:"invisible flex items-center space-x-1 pr-2 group-hover:visible",children:l.map(o=>e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{className:"cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",asChild:!0,children:a.createElement(o.item,{blockId:p})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{className:"z-[9999]",children:o.tooltip})]}))})]})})}),H=({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:i=>i.currentTarget.select(),onBlur:i=>t.submit(i.currentTarget.value),onKeyDown:i=>{i.key==="Enter"&&t.submit(i.currentTarget.value)}}),z=()=>{const[t]=r.useBlocksStore();return(i,n)=>{var m;const l=(m=I.find(t,{_id:n}))==null?void 0:m._type,c=I.first(i.map(p=>{var x;return(x=I.find(t,{_id:p}))==null?void 0:x._type}));return r.canAcceptChildBlock(l,c)}},L=()=>{const[t]=v.useAtom(r.treeDSBlocks),[i,n]=r.useSelectedBlockIds(),l=r.useUpdateBlocksProps(),[,c]=r.useSelectedStylingBlocks(),{moveBlocks:m}=r.useBlocksStoreUndoableActions(),p=z(),x=a.useRef(null),[,R]=v.useAtom(r.treeRefAtom),j=()=>{n([]),c([])};a.useEffect(()=>{R(x.current)},[x.current]);const h=({id:u,name:o,node:d})=>{l([u],{_name:o},d.data._name)},g=({dragIds:u,parentId:o,index:d})=>{p(u,o)&&m(u,o,d)},E=u=>{if(u.length===0)return;const o=u[0]?u[0].id:"";c([]),n([o])},f=u=>{var y;u.preventDefault();const o=u.target,d=o.getAttribute("data-node-id")||((y=o.closest("[data-node-id]"))==null?void 0:y.getAttribute("data-node-id"));d&&(c([]),n([d]))},b=k.useDebouncedCallback(({parentNode:u,dragNodes:o})=>{var d;return!r.canAcceptChildBlock(u==null?void 0:u.data._type,(d=o[0])==null?void 0:d.data._type)},[],300);return e.jsxRuntimeExports.jsx("div",{className:q.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"),onClick:()=>j(),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(C.Tree,{ref:x,height:800,className:"no-scrollbar !h-full max-w-full !overflow-y-auto !overflow-x-hidden",selection:i[0]||"",onRename:h,openByDefault:!1,onMove:g,rowHeight:20,data:t,renderCursor:D,onSelect:E,childrenAccessor:u=>u.children,width:"100%",renderDragPreview:N,indent:10,onContextMenu:f,disableDrop:b,idAccessor:"_id",children:P})})})};exports.default=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),v=require("jotai"),k=require("@react-hookz/web"),C=require("react-arborist"),r=require("./index-FPBudsRF.cjs"),q=require("./Functions-N3yhPYKY.cjs"),s=require("@radix-ui/react-icons"),T=require("lucide-react"),I=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@chaibuilder/runtime");require("./STRINGS-gPz7CUOk.cjs");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.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 B=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(T.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}},w={display:"flex",alignItems:"center",zIndex:1},D=a.memo(function({top:i,left:n}){const l={position:"absolute",pointerEvents:"none",top:i+"px",left:n+"px",right:0};return e.jsxRuntimeExports.jsx("div",{style:{...w,...l},children:e.jsxRuntimeExports.jsx("div",{className:"h-0.5 flex-1 rounded-[1px] bg-green-500"})})}),S=a.memo(function({children:i,isDragging:n}){return n?e.jsxRuntimeExports.jsx("div",{className:"pointer-events-none fixed left-0 top-0 z-[100] h-full w-full",children:i}):null}),N=a.memo(({id:t,isDragging:i,mouse:n})=>{const[l]=r.useBlocksStore(),c=a.useMemo(()=>l.find(p=>p._id===t),[l,t]),m=a.useMemo(()=>({transform:`translate(${(n==null?void 0:n.x)-10}px, ${(n==null?void 0:n.y)-10}px)`}),[n]);return n?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(S,{isDragging:i,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:m,children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex !cursor-grab items-center p-0.5","aria-label":`Type: ${c==null?void 0:c._type}`,children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-0.5 h-3 w-3",children:e.jsxRuntimeExports.jsx(B,{type:c==null?void 0:c._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:(c==null?void 0:c._name)||(c==null?void 0:c._type)})]})})})}):e.jsxRuntimeExports.jsx("div",{className:"hidden"})}),_=()=>{const[t]=r.useSelectedBlockIds(),i=r.useRemoveBlocks(),n=r.useSelectedBlock();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDeleteBlock(n==null?void 0:n._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>i(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},M=()=>{const[t]=r.useSelectedBlockIds(),i=r.useDuplicateBlocks(),n=r.useSelectedBlock(),l=a.useCallback(()=>{i(t)},[t,i]);return e.jsxRuntimeExports.jsxs(r.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:!r.canDuplicateBlock(n==null?void 0:n._type),className:"flex items-center gap-x-4 text-xs",onClick:l,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(_,{})]})},A=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(r.ContextMenu,{children:[e.jsxRuntimeExports.jsx(r.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(M,{})]})}),P=a.memo(({node:t,style:i,dragHandle:n})=>{const l=r.useBuilderProp("outlineMenuItems",[]),[,c]=r.useHighlightBlockId(),m=t.children.length>0,{id:p,data:x,isSelected:R,willReceiveDrop:j,isDragging:h,isEditing:g,handleClick:E}=t,f=k.useDebouncedCallback(o=>c(o),[],300),b=o=>{o.stopPropagation(),t.toggle()},u=o=>{o.stopPropagation(),t.isOpen||t.toggle(),E(o)};return a.useEffect(()=>{const o=setTimeout(()=>{j&&!t.isOpen&&t.toggle()},500);return()=>clearTimeout(o)},[j,t]),e.jsxRuntimeExports.jsx(A,{id:p,children:e.jsxRuntimeExports.jsxs("div",{onClick:u,onMouseEnter:()=>f(p),style:i,"data-node-id":p,ref:n,className:q.cn("group flex !h-fit w-full items-center justify-between space-x-px py-px outline-none",R?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800",j&&r.canAcceptChildBlock(x._type,"Icon")?"bg-green-200":"",h&&"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:m&&e.jsxRuntimeExports.jsx("button",{onClick:b,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(B,{type:x==null?void 0:x._type})}),g?e.jsxRuntimeExports.jsx(H,{node:t}):e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",onDoubleClick:o=>{o.stopPropagation(),t.edit(),t.deselect()},children:(x==null?void 0:x._name)||(x==null?void 0:x._type.split("/").pop())})]})]}),e.jsxRuntimeExports.jsx("div",{className:"invisible flex items-center space-x-1 pr-2 group-hover:visible",children:l.map(o=>e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{className:"cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",asChild:!0,children:a.createElement(o.item,{blockId:p})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{className:"z-[9999]",children:o.tooltip})]}))})]})})}),H=({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:i=>i.currentTarget.select(),onBlur:i=>t.submit(i.currentTarget.value),onKeyDown:i=>{i.key==="Enter"&&t.submit(i.currentTarget.value)}}),z=()=>{const[t]=r.useBlocksStore();return(i,n)=>{var m;const l=(m=I.find(t,{_id:n}))==null?void 0:m._type,c=I.first(i.map(p=>{var x;return(x=I.find(t,{_id:p}))==null?void 0:x._type}));return r.canAcceptChildBlock(l,c)}},L=()=>{const[t]=v.useAtom(r.treeDSBlocks),[i,n]=r.useSelectedBlockIds(),l=r.useUpdateBlocksProps(),[,c]=r.useSelectedStylingBlocks(),{moveBlocks:m}=r.useBlocksStoreUndoableActions(),p=z(),x=a.useRef(null),[,R]=v.useAtom(r.treeRefAtom),j=()=>{n([]),c([])};a.useEffect(()=>{R(x.current)},[x.current]);const h=({id:u,name:o,node:d})=>{l([u],{_name:o},d.data._name)},g=({dragIds:u,parentId:o,index:d})=>{p(u,o)&&m(u,o,d)},E=u=>{if(u.length===0)return;const o=u[0]?u[0].id:"";c([]),n([o])},f=u=>{var y;u.preventDefault();const o=u.target,d=o.getAttribute("data-node-id")||((y=o.closest("[data-node-id]"))==null?void 0:y.getAttribute("data-node-id"));d&&(c([]),n([d]))},b=k.useDebouncedCallback(({parentNode:u,dragNodes:o})=>{var d;return!r.canAcceptChildBlock(u==null?void 0:u.data._type,(d=o[0])==null?void 0:d.data._type)},[],300);return e.jsxRuntimeExports.jsx("div",{className:q.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"),onClick:()=>j(),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(C.Tree,{ref:x,height:800,className:"no-scrollbar !h-full max-w-full !overflow-y-auto !overflow-x-hidden",selection:i[0]||"",onRename:h,openByDefault:!1,onMove:g,rowHeight:20,data:t,renderCursor:D,onSelect:E,childrenAccessor:u=>u.children,width:"100%",renderDragPreview:N,indent:10,onContextMenu:f,disableDrop:b,idAccessor:"_id",children:P})})})};exports.default=L;
@@ -1,12 +1,12 @@
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-DtBYhldP.js";
4
+ import { u as l, a as c } from "./index-5zkCTSAM.js";
5
5
  import "./_commonjsHelpers-UyOWmZb0.js";
6
- import "./index-SEJRE2ab.js";
6
+ import "./index-AJalHhkO.js";
7
7
  import "i18next";
8
8
  import "react-i18next";
9
- import "./index-HiiWSXkE.js";
9
+ import "./index-hH5SIZ29.js";
10
10
  import "./Functions-7jnEwJyw.js";
11
11
  import "clsx";
12
12
  import "tailwind-merge";
@@ -48,7 +48,7 @@ import "./html-to-json-ZV4QjSww.js";
48
48
  import "himalaya";
49
49
  import "lucide-react";
50
50
  import "./index-YpnaudSM.js";
51
- const x = i.lazy(() => import("./add-page-modal-o1euqbsp.js")), u = i.lazy(() => import("./page-viewer-1vswRGpL.js")), lt = () => {
51
+ const x = i.lazy(() => import("./add-page-modal-hDyzsEU7.js")), u = i.lazy(() => import("./page-viewer-umQaut1j.js")), lt = () => {
52
52
  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
53
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
54
54
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
@@ -1 +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-5c_rU-9B.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./index-DHwvjZ5z.cjs");require("i18next");require("react-i18next");require("./index-12HbDLon.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.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-Xhu27KFD.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-v5smARyL.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-87wtE0pN.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
+ "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-JIcsKKoG.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./index-sJ9Uc9UY.cjs");require("i18next");require("react-i18next");require("./index-FPBudsRF.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.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-Xhu27KFD.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-2ZPjc54F.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-k-g15j8B.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,8 +1,8 @@
1
1
  import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import m, { useRef as x, useEffect as a, Suspense as p } from "react";
3
3
  import { isEqual as b, isEmpty as j } from "lodash-es";
4
- import { bb as f, bc as n, bd as l, be as c } from "./index-HiiWSXkE.js";
5
- import { b as h, a as g } from "./index-DtBYhldP.js";
4
+ import { bb as f, bc as n, bd as l, be as c } from "./index-hH5SIZ29.js";
5
+ import { b as h, a as g } from "./index-5zkCTSAM.js";
6
6
  import "./_commonjsHelpers-UyOWmZb0.js";
7
7
  import "./Functions-7jnEwJyw.js";
8
8
  import "clsx";
@@ -38,7 +38,7 @@ import "@radix-ui/react-context-menu";
38
38
  import "react-icons-picker";
39
39
  import "react-dom";
40
40
  import "react-quill";
41
- import "./index-SEJRE2ab.js";
41
+ import "./index-AJalHhkO.js";
42
42
  import "i18next";
43
43
  import "@floating-ui/react-dom";
44
44
  import "flagged";
@@ -48,7 +48,7 @@ import "./html-to-json-ZV4QjSww.js";
48
48
  import "himalaya";
49
49
  import "lucide-react";
50
50
  import "./index-YpnaudSM.js";
51
- const N = m.lazy(() => import("./project-general-setting-SE9QJ6mF.js")), S = m.lazy(() => import("./project-seo-setting-x3peNgla.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) ? {
51
+ const N = m.lazy(() => import("./project-general-setting-uuCemMCU.js")), S = m.lazy(() => import("./project-seo-setting-asvbPQiI.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
52
  ...e,
53
53
  seoData: { title: "", description: "", image: "" }
54
54
  } : e;
@@ -1 +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-12HbDLon.cjs"),a=require("./index-5c_rU-9B.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.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-DHwvjZ5z.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-RSG7ZQSx.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-q2953ybQ.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;
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-FPBudsRF.cjs"),a=require("./index-JIcsKKoG.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.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-sJ9Uc9UY.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-1leAiCJQ.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-kDBSOzgX.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;
@@ -5,15 +5,15 @@ import { useThrottledCallback as ue } from "@react-hookz/web";
5
5
  import { forEach as Re, isArray as xe, omit as vt, truncate as jt, includes as F, get as g, first as oe, split as wt, startCase as Y, toLower as le, isEmpty as b, map as C, find as Ge, last as Ct, filter as ve, set as qe, debounce as kt, keys as je, cloneDeep as Nt, each as _t, capitalize as we, reject as St, nth as $e, startsWith as W, isNumber as Tt, parseInt as Rt, isNaN as Je, findLast as Vt, flatten as J, intersection as Qe, has as ce, kebabCase as Ht, isNull as Dt } from "lodash-es";
6
6
  import { useTranslation as X } from "react-i18next";
7
7
  import { CopyIcon as Bt, PlusIcon as Ve, Cross2Icon as et, EyeOpenIcon as Pt, EyeClosedIcon as Ae, BorderAllIcon as O, WidthIcon as T, HeightIcon as R, ArrowUpIcon as ee, ArrowRightIcon as te, ArrowDownIcon as re, ArrowLeftIcon as se, ArrowTopLeftIcon as It, ArrowTopRightIcon as $t, ArrowBottomRightIcon as At, ArrowBottomLeftIcon as Mt, AlignLeftIcon as Et, AlignCenterHorizontallyIcon as Lt, AlignRightIcon as Ot, StretchHorizontallyIcon as Ft, FontItalicIcon as Yt, UnderlineIcon as zt, OverlineIcon as Xt, LetterCaseUppercaseIcon as Zt, Cross1Icon as Wt, InfoCircledIcon as He, MinusIcon as Ut, BoxIcon as tt, RowSpacingIcon as Kt, TriangleDownIcon as Gt, CrossCircledIcon as qt, CaretDownIcon as Jt, MixerHorizontalIcon as rt } from "@radix-ui/react-icons";
8
- import { aW as Qt, aX as er, B as G, aY as tr, aZ as rr, a_ as sr, a$ as lr, b0 as ar, b1 as or, b2 as nr, a1 as q, af as ir, ag as dr, ah as cr, b3 as pr, ad as ur, ao as xr, ae as gr, ap as $, aq as A, ar as M, b4 as hr, b5 as yr, b6 as mr, b7 as br, b8 as fr, b9 as vr, ba as jr, a6 as st, a5 as lt, h as wr, bb as at, bc as Ce, bd as ke, be as Ne, ac as ge, M as De, _ as ot, r as nt, bf as it, aB as dt, bg as _e, v as Cr, bh as kr, $ as he, V as Nr, a4 as ct, N as Me, aG as _r, aH as Sr, aI as Tr, bi as Be, aJ as Ee, aK as Le, bj as Oe, bk as Fe, bl as Ye, a7 as Rr, bm as Vr, aj as Hr, ak as Dr, al as Br, am as Pr, an as V, au as Ir, av as $r, aw as me, ax as be } from "./index-HiiWSXkE.js";
8
+ import { aW as Qt, aX as er, B as G, aY as tr, aZ as rr, a_ as sr, a$ as lr, b0 as ar, b1 as or, b2 as nr, a1 as q, af as ir, ag as dr, ah as cr, b3 as pr, ad as ur, ao as xr, ae as gr, ap as $, aq as A, ar as M, b4 as hr, b5 as yr, b6 as mr, b7 as br, b8 as fr, b9 as vr, ba as jr, a6 as st, a5 as lt, h as wr, bb as at, bc as Ce, bd as ke, be as Ne, ac as ge, M as De, _ as ot, r as nt, bf as it, aB as dt, bg as _e, v as Cr, bh as kr, $ as he, V as Nr, a4 as ct, N as Me, aG as _r, aH as Sr, aI as Tr, bi as Be, aJ as Ee, aK as Le, bj as Oe, bk as Fe, bl as Ye, a7 as Rr, bm as Vr, aj as Hr, ak as Dr, al as Br, am as Pr, an as V, au as Ir, av as $r, aw as me, ax as be } from "./index-hH5SIZ29.js";
9
9
  import { u as Ar } from "./controls-OfJWSEqC.js";
10
10
  import { Check as Mr, EditIcon as Er, TrashIcon as Lr, BrushIcon as Or, DeleteIcon as Fr } from "lucide-react";
11
11
  import { getBlockComponent as Pe, getChaiDataProviders as Yr, useGlobalStylingPresets as zr } from "@chaibuilder/runtime";
12
- import { E as pt, u as ut } from "./index-SEJRE2ab.js";
12
+ import { E as pt, u as ut } from "./index-AJalHhkO.js";
13
13
  import { J as Xr, a as Zr, d as Wr } from "./index-e0c8PmRQ.js";
14
14
  import Ur from "@rjsf/core";
15
15
  import Kr from "@rjsf/validator-ajv8";
16
- import { u as Gr } from "./useCanvasSettings-unTQUdlP.js";
16
+ import { u as Gr } from "./useCanvasSettings-ikt217kv.js";
17
17
  import qr from "react-autosuggest";
18
18
  import Jr from "fuse.js";
19
19
  import { A as Qr, C as ye, g as es } from "./Class-6Hz2KzYb.js";
@@ -594,14 +594,14 @@ function ds() {
594
594
  c.map((k) => /* @__PURE__ */ e.jsxs(
595
595
  "div",
596
596
  {
597
- 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",
597
+ className: "group relative truncate max-w-[260px] 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",
598
598
  children: [
599
599
  k,
600
600
  /* @__PURE__ */ e.jsx(
601
601
  et,
602
602
  {
603
603
  onClick: () => n(s, [k]),
604
- className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
604
+ className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer "
605
605
  }
606
606
  )
607
607
  ]