@chaibuilder/sdk 1.0.13 → 1.0.15

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 (168) hide show
  1. package/dist/{AddBlocks-H7BZYHUC.js → AddBlocks-eoo1CzaK.js} +114 -111
  2. package/dist/AddBlocks-jU0NwP_s.cjs +3 -0
  3. package/dist/BrandingOptions-WSCFnWAf.cjs +1 -0
  4. package/dist/{BrandingOptions-PAgY-kvj.js → BrandingOptions-_Og7VUHA.js} +57 -41
  5. package/dist/{CanvasArea-zn2ox-5h.js → CanvasArea-cky_d2Lu.js} +517 -519
  6. package/dist/CanvasArea-hT9uHhkz.cjs +46 -0
  7. package/dist/Class-RZuPYbUS.cjs +1 -0
  8. package/dist/{Class-l7qYbuoN.js → Class-nQk08vqd.js} +204 -124
  9. package/dist/{CurrentPage-6Jp4xAWK.js → CurrentPage--OlBwyNE.js} +58 -40
  10. package/dist/CurrentPage-x6Ez11gP.cjs +1 -0
  11. package/dist/Layers-gEA0qWYP.cjs +1 -0
  12. package/dist/{Layers-WkZ48AUm.js → Layers-uzA3QA-4.js} +158 -141
  13. package/dist/MarkAsGlobalBlock-lYL8cO9x.cjs +1 -0
  14. package/dist/MarkAsGlobalBlock-ySc-D4SB.js +84 -0
  15. package/dist/PagesPanel-5t0bV9T2.cjs +1 -0
  16. package/dist/PagesPanel-tH6c9Mnv.js +70 -0
  17. package/dist/ProjectPanel-NdrR6a8t.cjs +1 -0
  18. package/dist/ProjectPanel-Q2-15-In.js +91 -0
  19. package/dist/Settings-DBiwm1hY.cjs +1 -0
  20. package/dist/{Settings-fH8fZKpm.js → Settings-LOqpvQ_1.js} +411 -408
  21. package/dist/SidePanels-8JWYXGqN.cjs +1 -0
  22. package/dist/{SidePanels-w8ZHKJaR.js → SidePanels-F7ccs2Xf.js} +106 -88
  23. package/dist/{Topbar-hm1D_5sb.js → Topbar-lX9OMPwj.js} +47 -45
  24. package/dist/Topbar-qi5ab8rR.cjs +1 -0
  25. package/dist/UnsplashImages-a2r7b3kB.cjs +1 -0
  26. package/dist/{UnsplashImages-gPcBLjgB.js → UnsplashImages-u_QTABzi.js} +56 -44
  27. package/dist/{UploadImages-_ZyUU66E.js → UploadImages-gV5xDHIu.js} +55 -34
  28. package/dist/UploadImages-jLQgLujd.cjs +1 -0
  29. package/dist/add-page-modal-U5ramelz.js +110 -0
  30. package/dist/add-page-modal-tIt3N8jH.cjs +1 -0
  31. package/dist/confirm-alert-ZQ-sxX0X.js +58 -0
  32. package/dist/confirm-alert-z74-fGOT.cjs +1 -0
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.js +99 -124
  35. package/dist/delete-page-modal-5XuSfQT0.cjs +1 -0
  36. package/dist/delete-page-modal-_E87bVUZ.js +89 -0
  37. package/dist/form-Osm1AmO5.cjs +1 -0
  38. package/dist/{form-dVpOAyRl.js → form-zZJyZuNH.js} +12 -12
  39. package/dist/index-2EHcmZqL.js +2947 -0
  40. package/dist/index-RVm8Txnj.js +1149 -0
  41. package/dist/index-_jFEo7h5.cjs +206 -0
  42. package/dist/index-c8zW_D2V.cjs +1 -0
  43. package/dist/index-cU5eyVRU.js +40872 -0
  44. package/dist/index-fwo4wa7u.cjs +1 -0
  45. package/dist/index-gmZcUXyn.js +25 -0
  46. package/dist/index-m2muA80V.cjs +9 -0
  47. package/dist/{jsx-runtime-JYMCiFoE.cjs → jsx-runtime-WKRPbKtm.cjs} +7 -7
  48. package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-qAwJ85SY.js} +109 -106
  49. package/dist/lib.cjs +2 -1
  50. package/dist/lib.js +1333 -71
  51. package/dist/page-viewer-BSc-5M4B.cjs +1 -0
  52. package/dist/{page-viewer-Y4YiaZ_m.js → page-viewer-nLqIs_9w.js} +62 -44
  53. package/dist/project-general-setting-14MA_cX5.cjs +1 -0
  54. package/dist/{project-general-setting-U4S_KlhU.js → project-general-setting-kXh5myAr.js} +46 -36
  55. package/dist/project-seo-setting-POGPEJZ8.cjs +1 -0
  56. package/dist/project-seo-setting-nT1qo1Bb.js +89 -0
  57. package/dist/render.cjs +1 -1
  58. package/dist/render.js +23 -19
  59. package/dist/server.cjs +1 -1
  60. package/dist/server.js +1 -1
  61. package/dist/single-page-detail-EgQd9TSA.cjs +1 -0
  62. package/dist/{single-page-detail-pAxCy_Pe.js → single-page-detail-fV-A6vJR.js} +90 -80
  63. package/dist/studio.cjs +1 -1
  64. package/dist/studio.js +45 -25
  65. package/dist/ui.cjs +1 -1
  66. package/dist/ui.js +156 -357
  67. package/package.json +1 -1
  68. package/dist/AddBlocks-7ACJv8LW.cjs +0 -3
  69. package/dist/BrandingOptions-5j-XszLM.cjs +0 -1
  70. package/dist/CanvasArea-Dnm-yeus.cjs +0 -46
  71. package/dist/ChaiBuilderEditor-BoE-sArB.cjs +0 -163
  72. package/dist/ChaiBuilderEditor-hEuUONQ3.js +0 -27094
  73. package/dist/Class-_uCzl5v1.cjs +0 -1
  74. package/dist/CurrentPage-YMpqOqx7.cjs +0 -1
  75. package/dist/ImagesPanel-6us7hiLN.cjs +0 -1
  76. package/dist/ImagesPanel-oaHOD-Ex.js +0 -27
  77. package/dist/Layers-EzOZdWvd.cjs +0 -1
  78. package/dist/MODIFIERS-DsEzQ3aH.js +0 -73
  79. package/dist/MODIFIERS-Fx6WAZcw.cjs +0 -1
  80. package/dist/MarkAsGlobalBlock-0HubcRkY.js +0 -77
  81. package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +0 -1
  82. package/dist/PagesPanel-6JuwBLFQ.js +0 -50
  83. package/dist/PagesPanel-zJq8p1ja.cjs +0 -1
  84. package/dist/ProjectPanel-Zml2F8b9.cjs +0 -1
  85. package/dist/ProjectPanel-cu2QSDW9.js +0 -73
  86. package/dist/Settings-lc9PfnmG.cjs +0 -1
  87. package/dist/SidePanels-VH72zFE2.cjs +0 -1
  88. package/dist/Topbar-vQPo9xSY.cjs +0 -1
  89. package/dist/UnsplashImages-BoBBSi1a.cjs +0 -1
  90. package/dist/UploadImages-T6kW0s3G.cjs +0 -1
  91. package/dist/accordion-oPUeqPCZ.js +0 -42
  92. package/dist/accordion-ynvFtV_p.cjs +0 -1
  93. package/dist/add-page-modal--qZSwJuB.cjs +0 -1
  94. package/dist/add-page-modal-bj7qbZuK.js +0 -99
  95. package/dist/alert-dialog-GNfnpqFB.js +0 -64
  96. package/dist/alert-dialog-Mv0-wAvS.cjs +0 -1
  97. package/dist/command-ThdTuUxt.cjs +0 -1
  98. package/dist/command-VHca6CcN.js +0 -97
  99. package/dist/confirm-alert-8EHe0OOd.cjs +0 -1
  100. package/dist/confirm-alert-b0e_BLhF.js +0 -36
  101. package/dist/context-menu-8dC9uGXj.js +0 -122
  102. package/dist/context-menu-IgLbIuth.cjs +0 -1
  103. package/dist/controls-Ni5kEzLz.js +0 -103
  104. package/dist/controls-W97-POR_.cjs +0 -1
  105. package/dist/controls-enQY7NI8.js +0 -118
  106. package/dist/controls-xUKa23ic.cjs +0 -1
  107. package/dist/delete-page-modal-2LuDLEiP.cjs +0 -1
  108. package/dist/delete-page-modal-cnrR8tWH.js +0 -69
  109. package/dist/dialog-S_QbL1iq.cjs +0 -1
  110. package/dist/dialog-jrw9DF1f.js +0 -65
  111. package/dist/dropdown-menu-S03K_fNs.js +0 -164
  112. package/dist/dropdown-menu-sMXR59cB.cjs +0 -1
  113. package/dist/form-nRAvKPQj.cjs +0 -1
  114. package/dist/functions-nNTuSTsR.js +0 -1106
  115. package/dist/functions-pcUZhFJM.js +0 -12
  116. package/dist/functions-sCuB7nvZ.cjs +0 -2
  117. package/dist/functions-uw7QP2kT.cjs +0 -1
  118. package/dist/html-to-json-P6GpbcQX.cjs +0 -1
  119. package/dist/html-to-json-pdHQfRkN.js +0 -178
  120. package/dist/index-HAue58ea.cjs +0 -1
  121. package/dist/index-T4_wfKl5.js +0 -2256
  122. package/dist/index-X9ZgD09V.cjs +0 -1
  123. package/dist/index-ehKdBRUK.js +0 -18
  124. package/dist/label-KaP7MRrs.js +0 -10
  125. package/dist/label-tFm8HZdb.cjs +0 -1
  126. package/dist/link-6o6n2Tnd.js +0 -204
  127. package/dist/link-ece8dZGH.cjs +0 -1
  128. package/dist/page-viewer-IARz6OSp.cjs +0 -1
  129. package/dist/popover-a84pbVhQ.js +0 -23
  130. package/dist/popover-fKjgcRUx.cjs +0 -1
  131. package/dist/project-general-setting-eSl3t-VH.cjs +0 -1
  132. package/dist/project-seo-setting-Ga9v_ECU.js +0 -67
  133. package/dist/project-seo-setting-rankm1z3.cjs +0 -1
  134. package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
  135. package/dist/scroll-area-ewXbxc3n.js +0 -30
  136. package/dist/select-7bjg-rr9.cjs +0 -1
  137. package/dist/select-POGdEDHT.js +0 -75
  138. package/dist/separator-3Civ-6hb.cjs +0 -1
  139. package/dist/separator-SctTn0Qi.js +0 -18
  140. package/dist/single-page-detail-yPgnu2AI.cjs +0 -1
  141. package/dist/skeleton-CU_FIbg3.js +0 -239
  142. package/dist/skeleton-JHP9zwL2.cjs +0 -1
  143. package/dist/tabs-Gb9v5dVb.js +0 -46
  144. package/dist/tabs-iWeaaVrg.cjs +0 -1
  145. package/dist/textarea-1kZEh7ki.cjs +0 -1
  146. package/dist/textarea-b2QvVhrK.js +0 -73
  147. package/dist/toggle-ASJRAaGP.js +0 -30
  148. package/dist/toggle-ehNIPmme.cjs +0 -1
  149. package/dist/useAddBlock-WJc3OgG8.js +0 -86
  150. package/dist/useAddBlock-dCKRFPRU.cjs +0 -1
  151. package/dist/useAllBlocks-6hvuNuyw.cjs +0 -1
  152. package/dist/useAllBlocks-PQKYvs-e.js +0 -20
  153. package/dist/useChaiExternalData-4K9WxANa.js +0 -6
  154. package/dist/useChaiExternalData-DkyBJ81C.cjs +0 -1
  155. package/dist/useDarkMode-ZKCO_gkt.js +0 -23
  156. package/dist/useDarkMode-dV6FM6l-.cjs +0 -1
  157. package/dist/useFeatureSupport-OLwNgEZb.js +0 -16
  158. package/dist/useFeatureSupport-c9IgPW2t.cjs +0 -1
  159. package/dist/useHiddenBlocks-3MsGOJ1s.js +0 -15
  160. package/dist/useHiddenBlocks-oJuQDmTy.cjs +0 -1
  161. package/dist/useLanguage-NKKKaxVM.cjs +0 -1
  162. package/dist/useLanguage-gVC5rxO5.js +0 -216
  163. package/dist/useMarkAsGlobalBlock-X73Vny8u.js +0 -25
  164. package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +0 -1
  165. package/dist/useUiLibraries-4hPOi8DI.js +0 -12
  166. package/dist/useUiLibraries-9FhQCpKo.cjs +0 -1
  167. package/dist/utils-dze1SGvB.js +0 -6
  168. package/dist/utils-qK_SjzzV.cjs +0 -1
@@ -1 +0,0 @@
1
- "use strict";var je=Object.create;var oe=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var ve=Object.getPrototypeOf,Ee=Object.prototype.hasOwnProperty;var we=(s,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Re(o))!Ee.call(s,i)&&i!==r&&oe(s,i,{get:()=>o[i],enumerable:!(n=fe(o,i))||n.enumerable});return s};var Ce=(s,o,r)=>(r=s!=null?je(ve(s)):{},we(o||!s||!s.__esModule?oe(r,"default",{value:s,enumerable:!0}):r,s));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),x=require("react"),K=require("@react-hookz/web"),t=require("lodash"),de=require("react-i18next"),p=require("@radix-ui/react-icons"),O=require("./tabs-iWeaaVrg.cjs"),ke=require("@rjsf/core"),Ne=require("@rjsf/validator-ajv8"),w=require("./ChaiBuilderEditor-BoE-sArB.cjs"),I=require("./useLanguage-NKKKaxVM.cjs"),ne=require("./controls-xUKa23ic.cjs"),Se=require("./controls-W97-POR_.cjs"),J=require("lucide-react"),v=require("./skeleton-JHP9zwL2.cjs"),M=require("./dialog-S_QbL1iq.cjs"),Z=require("./popover-fKjgcRUx.cjs"),$=require("./command-ThdTuUxt.cjs"),te=require("./index-HAue58ea.cjs"),ce=require("./useChaiExternalData-DkyBJ81C.cjs"),T=require("./accordion-ynvFtV_p.cjs"),X=require("./link-ece8dZGH.cjs"),Te=require("jotai"),Ie=require("react-autosuggest"),Be=require("fuse.js"),q=require("./Class-_uCzl5v1.cjs"),se=require("./label-tFm8HZdb.cjs"),Ae=require("./MODIFIERS-Fx6WAZcw.cjs"),U=require("./useDarkMode-dV6FM6l-.cjs"),He=require("./scroll-area-FiHvy-TZ.cjs"),C=require("./select-7bjg-rr9.cjs");require("@radix-ui/react-tabs");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-dialog");require("@radix-ui/react-popover");require("cmdk");require("@radix-ui/react-accordion");require("react-icons-picker");require("./ImagesPanel-6us7hiLN.cjs");require("react-quill");require("@radix-ui/react-label");require("@radix-ui/react-select");function Ve(s){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>s[r]})}}return o.default=s,Object.freeze(o)}const z=Ve(x),De=x.lazy(()=>import("react-json-view"));function Le(s){const o=[],r={};function n(i,a){t.forEach(a,(d,u)=>{const l=i?`${i}.${u}`:u,m=t.isArray(d)?"list":typeof d;o.push(l),r[l]=m==="string"?"text":m==="object"?"model":m,m==="object"&&!t.isArray(d)&&n(l,d)})}return n("",t.omit(s,["styles","_type","_id","_name","_bindings"])),{paths:o,pathsType:r}}const Q=({data:s,fullView:o})=>{if(!s)return null;const r=typeof s;return o?typeof s=="object"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"h-3"}),e.jsxRuntimeExports.jsx(w.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(De,{style:{maxHeight:"40vh",overflowY:"auto"},name:"Content",enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:s,collapsed:!0})})]}):e.jsxRuntimeExports.jsxs("div",{className:"text-gray-800/50 text-[12px] leading-4 w-full max-h-36 overflow-x-hidden overflow-y-auto",children:[e.jsxRuntimeExports.jsx("span",{className:"font-medium text-gray-800/80",children:"Content: "}),s]}):e.jsxRuntimeExports.jsx("div",{className:"text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full",children:t.truncate(r==="object"?JSON.stringify(s):s,{length:40})})},ie=({type:s,value:o="",setValue:r,data:n,onChange:i,dataType:a,appliedBindings:d})=>{const{paths:u,pathsType:l}=Le(n),m=s==="PROP"?te.h(n==null?void 0:n._type):{},g=s==="PROP",[c,b]=x.useState(!1),y=x.useMemo(()=>s==="PROP"?u.filter(h=>!t.includes(d,h)&&t.get(m,`props.${t.first(t.split(h,"."))}.binding`)):u.filter(h=>a===t.get(l,h,"")),[s,u,d,a,m]);return x.useEffect(()=>{o&&i(o)},[o,s]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:t.startCase(t.toLower(s))}),e.jsxRuntimeExports.jsxs(Z.Popover,{open:c,onOpenChange:b,children:[e.jsxRuntimeExports.jsx(Z.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(v.Button,{variant:"outline",size:"sm",className:` ${t.isEmpty(o)?"bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white w-44 justify-center":"min-w-[350px] justify-between items-center"}`,children:o?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{className:"text-sm pr-8",children:[g&&e.jsxRuntimeExports.jsx("span",{className:"text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full",children:t.startCase(a)}),o]}),e.jsxRuntimeExports.jsx("span",{className:"text-[9px] text-blue-400 underline cursor-pointer hover:text-blue-700",children:"Change"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["+ Set ",t.startCase(t.toLower(s))]})})}),e.jsxRuntimeExports.jsx(Z.PopoverContent,{className:"p-0 z-[999] min-w-[300px]",side:"right",align:"start",children:e.jsxRuntimeExports.jsxs($.Command,{children:[e.jsxRuntimeExports.jsx($.CommandInput,{placeholder:`Choose ${t.toLower(s)}...`}),e.jsxRuntimeExports.jsxs($.CommandList,{children:[e.jsxRuntimeExports.jsx($.CommandEmpty,{children:"No results found."}),e.jsxRuntimeExports.jsx($.CommandGroup,{children:t.map(y,h=>e.jsxRuntimeExports.jsxs($.CommandItem,{value:h,className:`cursor-pointer ${g?"flex justify-between items-center":"flex flex-col items-start justify-start"}`,onSelect:f=>{r(t.find(y,N=>N===f)||null),b(!1)},children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx(J.Check,{className:`w-4 h-4 text-green-500 ${o===h?"":"opacity-0"}`}),h]}),g?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("span",{className:"text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full",children:t.startCase(t.get(l,h,""))})}):e.jsxRuntimeExports.jsx("div",{className:"pl-6",children:e.jsxRuntimeExports.jsx(Q,{data:t.get(n,h)})})]},h))})]})]})})]})]}),!g&&!t.isEmpty(o)&&e.jsxRuntimeExports.jsx("div",{className:"pt-2",children:e.jsxRuntimeExports.jsx(Q,{data:t.get(n,o,""),fullView:!0})})]})},Pe=({appliedBindings:s=[],onAddBinding:o,editMode:r,item:n})=>{const[i,a]=x.useState(r?n.key:""),[d,u]=x.useState(r?n.value:""),l=w.useSelectedBlock(),[m]=ce.useChaiExternalData(),g=x.useCallback((y,h)=>{if(t.isEmpty(y))return"";{const f=t.get(h==="PROP"?l:m,y,"");if(t.isArray(f))return"list";const N=typeof f;return N==="string"?"text":N==="object"?"model":N}},[l,m]),[c,b]=x.useState(r?g(n.key,"PROP"):"");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(M.DialogHeader,{children:[e.jsxRuntimeExports.jsx(M.DialogTitle,{children:"Add Data Binding"}),e.jsxRuntimeExports.jsx(M.DialogDescription,{className:"text-xs",children:"Add prop and path of binding. Click save when you're done."})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 relative",children:[e.jsxRuntimeExports.jsx(ie,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",value:i,setValue:a,onChange:y=>{const h=g(y,"PROP");a(y),c!==h&&u(""),b(h)},data:l,dataType:c,appliedBindings:s}),e.jsxRuntimeExports.jsx("div",{className:"h-2"}),e.jsxRuntimeExports.jsx(ie,{type:"PATH",isDisabled:t.isEmpty(i),placeholder:"Enter data path",value:d,setValue:u,onChange:y=>{const h=g(y,"PATH");u(c===h?y:"")},data:m,dataType:c,appliedBindings:s})]}),e.jsxRuntimeExports.jsx(M.DialogFooter,{children:e.jsxRuntimeExports.jsx(v.Button,{type:"submit",className:"mt-4",disabled:t.isEmpty(i)&&t.isEmpty(d),onClick:()=>o({key:i,value:d}),children:"Save"})})]})},xe=({children:s,onAddBinding:o,appliedBindings:r,editMode:n=!0,item:i={}})=>{const[a,d]=x.useState(!1);return e.jsxRuntimeExports.jsxs(M.Dialog,{children:[e.jsxRuntimeExports.jsx(M.DialogTrigger,{asChild:!0,onClick:()=>d(!0),children:s}),a&&e.jsxRuntimeExports.jsx(M.DialogContent,{children:e.jsxRuntimeExports.jsx(Pe,{item:i,editMode:n,appliedBindings:r,onAddBinding:u=>{o(u),d(!1)}})})]})},$e=({item:s,onAddBinding:o,onRemove:r,selectedBlock:n,dataProvider:i,appliedBindings:a})=>{const[d,u]=x.useState("string"),l=(m,g)=>{if(t.isEmpty(m))return"";{const c=t.get(g==="PROP"?n:i,m,"");if(t.isArray(c))return"list";const b=typeof c;return b==="string"?"text":b==="object"?"model":b}};return x.useEffect(()=>u(()=>l(s.key,"PROP")),[s.key]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col border border-gray-200 relative rounded-md p-2",children:[e.jsxRuntimeExports.jsx("div",{className:"text-gray-500 font-normal text-sm",children:s.key}),e.jsxRuntimeExports.jsx("div",{className:"font-medium leading-5",children:s.value}),e.jsxRuntimeExports.jsx(Q,{data:t.get(i,s.value,"")}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-2",children:[e.jsxRuntimeExports.jsx(xe,{editMode:!0,onAddBinding:o,appliedBindings:a,item:s,children:e.jsxRuntimeExports.jsx(J.EditIcon,{className:"h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-blue-400 hover:text-white border-blue-400 p-1 text-blue-400 hover:scale-105 duration-200"})}),e.jsxRuntimeExports.jsx(J.TrashIcon,{onClick:()=>r(),className:"h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"})]}),!t.isEmpty(d)&&!t.isEmpty(s.key)&&e.jsxRuntimeExports.jsx("div",{className:"mt-px absolute right-0 top-1 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full",children:t.startCase(d)})]})},Me=({bindingData:s,onChange:o})=>{const r=w.useSelectedBlock(),[n]=ce.useChaiExternalData(),i=te.A(),[a,d]=x.useState(t.map(s,(c,b)=>({key:b,value:c})));x.useEffect(()=>{d(t.map(s,(c,b)=>({key:b,value:c})))},[r==null?void 0:r._id]);const u=x.useMemo(()=>{if(t.isEmpty(n))return!0;if(t.isEmpty(a))return!1;const c=t.last(a);return t.isEmpty(c==null?void 0:c.key)||t.isEmpty(c==null?void 0:c.value)},[n,a]),l=c=>{const b=t.filter(a,y=>y.key!==c.key);d([...b,c]),g([...b,c])},m=c=>{const b=t.filter(a,(y,h)=>c!==h);g([...b])},g=x.useCallback((c=[])=>{if(d(c),t.isEmpty(c)){o({});return}const b={};t.forEach(c,y=>{!t.isEmpty(y==null?void 0:y.key)&&!t.isEmpty(y==null?void 0:y.value)&&t.set(b,y.key,y.value)}),o(b)},[o]);return t.isEmpty(i)?e.jsxRuntimeExports.jsx("div",{className:"w-full flex items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 mb-1.5 text-xs",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[t.map(a,(c,b)=>e.jsxRuntimeExports.jsx($e,{item:c,onAddBinding:l,onRemove:()=>m(b),selectedBlock:r,dataProvider:n,appliedBindings:t.map(a,"key")},c.key)),e.jsxRuntimeExports.jsxs(v.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(xe,{appliedBindings:t.map(a,"key"),onAddBinding:l,children:e.jsxRuntimeExports.jsx("button",{disabled:u,className:`w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${u?"cursor-not-allowed bg-gray-200 text-gray-400":"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,children:t.isEmpty(n)?e.jsxRuntimeExports.jsx("small",{className:"text-gray-500 text-[9.5px]",children:"No data provider has been set up for this page"}):"+ Add Data Binding"})})}),u&&e.jsxRuntimeExports.jsx(v.TooltipContent,{sideOffset:-55,className:"text-[11px]",children:t.isEmpty(n)?"No data provider has been set up for this page.":"Complete last added data binding to add more"})]})]})},Oe=Me,qe=()=>e.jsxRuntimeExports.jsx("div",{className:"text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100",children:"Data binding is set for this field"}),le=({createHistorySnapshot:s,properties:o,formData:r,onChange:n})=>{const[i]=I.useActiveLanguage(),a={type:"object",properties:{}},d={};return Object.keys(o).forEach(u=>{const l=o[u];if(t.includes(["slot","styles"],l.type))return;const m=t.get(l,"i18n",!1)?`${u}-${i}`:u;a.properties[m]=ne.getBlockJSONFromSchemas(l,i),d[m]=ne.getBlockJSONFromUISchemas(l,i)}),e.jsxRuntimeExports.jsx(ke,{widgets:{binding:qe,richtext:X.RichTextEditorField,icon:X.IconPickerField,image:X.ImagePickerField},fields:{link:X.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!0,validator:Ne,uiSchema:d,onBlur:s,schema:a,formData:r,onChange:n})};function _e(){const s=w.useSelectedBlock(),{createSnapshot:o}=w.useCanvasHistory(),r=I.useUpdateBlocksPropsRealtime(),n=te.h(s._type),i={...s},a=()=>o(),d=({formData:g},c)=>{if(c){const b=c.replace("root.","");r([s._id],{[b]:t.get(g,b)})}},u={_name:Se.u({title:"Name",default:t.get(s,"_name",s._type)})},l=t.keys(t.get(i,"_bindings",{})),m=x.useMemo(()=>{const g=t.cloneDeep(t.get(n,"props",{}));return t.each(l,c=>{delete g[c]}),g},[n,l]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(le,{onChange:d,createHistorySnapshot:a,formData:i,properties:u}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),e.jsxRuntimeExports.jsxs(T.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(s,"_bindings",{}))?"bg-gray-300":"bg-blue-500"}`}),"Data Binding"]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"pt-4 px-4",children:e.jsxRuntimeExports.jsx(Oe,{bindingData:t.get(i,"_bindings",{}),onChange:g=>{d({formData:{...i,_bindings:g}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-[8px] w-[8px] rounded-full bg-blue-500"}),"Static Content"]})}),e.jsxRuntimeExports.jsxs(T.AccordionContent,{className:"pt-4",children:[t.isEmpty(l)?"":e.jsxRuntimeExports.jsxs("div",{className:"text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100",children:["Data binding is set for ",e.jsxRuntimeExports.jsx("b",{children:t.map(l,t.capitalize).join(", ")})," ",l.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(le,{onChange:d,createHistorySnapshot:a,formData:i,properties:m})]})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const ae=new Be(q.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function We(){var A;const[s]=w.useSelectedStylingBlocks(),o=w.useSelectedBlock(),r=I.useAddClassesToBlocks(),n=I.useRemoveClassesFromBlocks(),[i]=w.useSelectedBlockIds(),[a,d]=x.useState(""),u=(A=t.first(s))==null?void 0:A.prop,l=t.reject((t.get(o,u,"").replace(Ae.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),m=()=>{const E=a.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");r(i,E,!0),d("")},[g,c]=x.useState([]),b=({value:E})=>{const D=E.trim().toLowerCase(),H=D.match(/.+:/g);let k=[];if(H&&H.length>0){const[V]=H,P=D.replace(V,"");k=ae.search(P).map(j=>({...j,item:{...j.item,name:V+j.item.name}}))}else k=ae.search(D);c(t.map(k,"item"))},y=()=>{c([])},h=E=>E.name,f=E=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:E.name}),N={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:a,onKeyDown:E=>{E.key==="Enter"&&a.trim()!==""&&m()},onChange:(E,{newValue:D})=>d(D),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"};return e.jsxRuntimeExports.jsxs("div",{className:`no-scrollbar flex ${g.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(se.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(Ie,{suggestions:g,onSuggestionsFetchRequested:b,onSuggestionsClearRequested:y,getSuggestionValue:h,renderSuggestion:f,inputProps:N,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(v.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:m,disabled:a.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(p.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(l)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-10 w-full items-center justify-center text-center text-sm text-gray-400",children:"No class added"}),z.Children.toArray(l.map(E=>e.jsxRuntimeExports.jsxs("div",{className:"group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",children:[E,e.jsxRuntimeExports.jsx(p.Cross2Icon,{onClick:()=>n(i,[E]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},E)))]})]})}const B=["px","%","em","rem","ch","vh","vw"],Fe={heading:"Flex Child",items:[{type:"arbitrary",label:"Basis",units:B,property:"flexBasis"},{type:"range",label:"Order",property:"order"},{type:"dropdown",label:"Flex",property:"flexGrowShrink"},{type:"dropdown",label:"Grow",property:"flexGrow"},{type:"dropdown",label:"Shrink",property:"flexShrink"}]},Ye={heading:"Grid Child",items:[{type:"range",label:"Col Span",property:"gridColSpan"},{type:"range",label:"Col Start",property:"gridColStart"},{type:"range",label:"Col End",property:"gridColEnd"},{type:"range",label:"Row Span",property:"gridRowSpan"},{type:"range",label:"Row Start",property:"gridRowStart"},{type:"range",label:"Row End",property:"gridRowEnd"},{type:"range",label:"Order",property:"order"}]},Xe=[{heading:"Display",items:[{type:"dropdown",label:"Display",property:"display",units:B},{styleType:"accordion",heading:"Flex options",items:[{type:"dropdown",label:"Direction",property:"flexDirection"},{type:"dropdown",label:"Wrap",property:"flexWrap"},{type:"dropdown",label:"Justify",property:"justifyContent"},{type:"dropdown",label:"Content",property:"alignContent"},{type:"dropdown",label:"Items",property:"alignItems"},{styleType:"multiple",label:"Gap",options:[{key:"gap",label:"All"},{key:"gapX",label:"Left-Right"},{key:"gapY",label:"Top-Bottom"}]}],conditions:{display:"flex"}},{styleType:"accordion",heading:"Grid options",items:[{type:"range",label:"Columns",property:"gridColumns"},{type:"range",label:"Rows",property:"gridRows"},{type:"dropdown",label:"Auto Flow",property:"gridAutoFlow"},{type:"dropdown",label:"Auto Cols",property:"gridAutoColumns"},{type:"dropdown",label:"Auto Rows",property:"gridAutoRows"},{type:"dropdown",label:"Justify",property:"justifyContent"},{type:"dropdown",label:"Content",property:"alignContent"},{type:"dropdown",label:"Items",property:"alignItems"},{styleType:"multiple",label:"Gap",units:["px","rem"],options:[{key:"gap",label:"All"},{key:"gapX",label:"Left-Right"},{key:"gapY",label:"Top-Bottom"}]}],conditions:{display:"grid"}},{styleType:"accordion",heading:"Visibility & Opacity",items:[{type:"dropdown",label:"Visibility",property:"visibility",units:B},{type:"arbitrary",label:"Opacity",property:"opacity",units:["-"]}]}]},{heading:"Spacing",items:[{styleType:"multiple",label:"Margin",negative:!0,units:[...B,"auto"],options:[{key:"margin",label:"All"},{key:"marginX",label:"Left-Right"},{key:"marginY",label:"Top-Bottom"},{key:"marginTop",label:"Top"},{key:"marginRight",label:"Right"},{key:"marginBottom",label:"Bottom"},{key:"marginLeft",label:"Left"}]},{styleType:"multiple",label:"Padding",options:[{key:"padding",label:"All"},{key:"paddingX",label:"Left-Right"},{key:"paddingY",label:"Top-Bottom"},{key:"paddingTop",label:"Top"},{key:"paddingRight",label:"Right"},{key:"paddingBottom",label:"Bottom"},{key:"paddingLeft",label:"Left"}]},{styleType:"multiple",label:"Space Between",options:[{key:"spaceX",label:"Left-Right"},{key:"spaceY",label:"Top-Bottom"}]}]},{heading:"Size",items:[{type:"arbitrary",label:"Width",units:B.concat("auto"),property:"width"},{type:"arbitrary",label:"Height",units:B.concat("auto"),property:"height"},{styleType:"accordion",heading:"Min width & height",items:[{type:"arbitrary",label:"Min Width",units:B.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"Min Height",units:B.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"Max width & height",items:[{type:"arbitrary",label:"Max Width",units:B.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"Max Height",units:B.concat("auto"),property:"maxHeight"}]},{styleType:"accordion",heading:"Object options & aspect ratio",items:[{type:"dropdown",label:"Aspect",property:"aspectRatio"},{type:"dropdown",label:"Fit",property:"objectFit"},{type:"dropdown",label:"Position",property:"objectPosition"}]}]},{heading:"Position",items:[{type:"icons",label:"Position",property:"position"},{styleType:"accordion",heading:"Position options",items:[{styleType:"multiple",label:"Direction",options:[{key:"top",label:"Top"},{key:"right",label:"Right"},{key:"bottom",label:"Bottom"},{key:"left",label:"Left"}]},{styleType:"multiple",label:"Inset",options:[{key:"inset",label:"All"},{key:"insetX",label:"Left Right"},{key:"insetY",label:"Top Bottom"}]},{type:"arbitrary",label:"Z-Chai",units:["-","auto"],property:"zIndex"}]},{styleType:"accordion",heading:"Float & Clear",items:[{type:"icons",label:"Float",property:"float"},{type:"dropdown",label:"Clear",property:"clear"}]},{styleType:"accordion",heading:"Overflow & Overscroll",items:[{styleType:"multiple",type:"dropdown",label:"Overflow",options:[{key:"overflow",label:"All"},{key:"overflowX",label:"Left-Right"},{key:"overflowY",label:"Top-Bottom"}]},{styleType:"multiple",type:"dropdown",label:"Overscroll",options:[{key:"overscroll",label:"All"},{key:"overscrollX",label:"Left-Right"},{key:"overscrollY",label:"Top-Bottom"}]}]}]},{heading:"Typography",items:[{type:"dropdown",property:"fontFamily",label:"Font"},{type:"arbitrary",property:"fontSize",label:"Size",units:B},{type:"arbitrary",property:"lineHeight",label:"Height",units:B.concat("-")},{type:"range",property:"fontWeight",label:"Weight"},{type:"color",property:"textColor",label:"Color"},{styleType:"accordion",heading:"Alignments",items:[{type:"dropdown",property:"textAlign",label:"Align"},{type:"dropdown",property:"verticalAlign",label:"V. Align"}]},{styleType:"accordion",heading:"Spacing, decoration & more",items:[{type:"dropdown",property:"letterSpacing",label:"Spacing"},{type:"dropdown",property:"textDecoration",label:"Decoration"},{type:"range",property:"textDecorationThickness",label:"Thickness"},{type:"dropdown",property:"textTransform",label:"Transform"}]},{styleType:"accordion",heading:"White space & breaks",items:[{type:"dropdown",property:"whitespace",label:"Whitespace"},{type:"dropdown",property:"wordBreak",label:"Wordbreak"}]}]},{heading:"Background",items:[{type:"color",label:"Bg. Color",property:"backgroundColor"},{styleType:"accordion",heading:"Position, Size & more",items:[{type:"dropdown",label:"Attachment",property:"backgroundAttachment"},{type:"dropdown",label:"Clipping",property:"backgroundClip"},{type:"dropdown",label:"Origin",property:"backgroundOrigin"},{type:"dropdown",label:"Position",property:"backgroundPosition"},{type:"dropdown",label:"Repeat",property:"backgroundRepeat"},{type:"dropdown",label:"Size",property:"backgroundSize"}]},{type:"dropdown",label:"Gradient",property:"backgroundGradient"},{styleType:"accordion",heading:"Gradient colors",items:[{type:"color",label:"From",property:"fromColor"},{type:"color",label:"Via",property:"viaColor"},{type:"color",label:"To",property:"toColor"}]}]},{heading:"Border & Outline",items:[{styleType:"multiple",type:"dropdown",label:"Width",options:[{key:"border",label:"All"},{key:"borderX",label:"Left Right"},{key:"borderY",label:"Top bottom"},{key:"borderTop",label:"Top"},{key:"borderRight",label:"Right"},{key:"borderBottom",label:"Bottom"},{key:"borderLeft",label:"Left"}]},{styleType:"multiple",type:"dropdown",label:"Corners",options:[{key:"borderRadius",label:"All"},{key:"borderRadiusTop",label:"Top"},{key:"borderRadiusRight",label:"Right"},{key:"borderRadiusBottom",label:"Bottom"},{key:"borderRadiusLeft",label:"Left"},{key:"borderRadiusTopLeft",label:"Top Left"},{key:"borderRadiusTopRight",label:"Top right"},{key:"borderRadiusBottomRight",label:"Bottom right"},{key:"borderRadiusBottomLeft",label:"Bottom left"}]},{type:"color",label:"Color",property:"borderColor"},{type:"dropdown",label:"Style",property:"borderStyle"},{styleType:"accordion",heading:"Divide options",items:[{styleType:"multiple",type:"range",label:"Width",options:[{key:"divideXWidth",label:"Left Right"},{key:"divideYWidth",label:"Top Bottom"}]},{type:"color",label:"Color",property:"divideColor"},{type:"dropdown",label:"Style",property:"divideStyle"}]},{styleType:"accordion",heading:"Outline styling",items:[{type:"range",label:"Width",property:"outlineWidth"},{type:"range",label:"Offset",property:"outlineOffset"},{type:"dropdown",label:"Style",property:"outlineStyle"}]},{styleType:"accordion",heading:"Ring options",items:[{type:"range",label:"Width",property:"ringWidth"},{type:"color",label:"Color",property:"ringColor"},{type:"range",label:"Offset",property:"ringOffsetWidth"},{type:"color",label:"Off. color",property:"ringOffsetColor"}]}]},{heading:"Effect & Animation",items:[{type:"range",label:"Shadow",property:"boxShadow"},{type:"color",label:"Color",property:"boxShadowColor"},{type:"dropdown",label:"Cursor",property:"cursor"},{styleType:"accordion",heading:"Blend & Cursor",items:[{type:"dropdown",label:"Mix Blend",property:"mixBlendMode"},{type:"dropdown",label:"Bg. Blend",property:"bgBlendMode"}]},{styleType:"accordion",heading:"Transform",items:[{type:"dropdown",label:"Origin",property:"transformOrigin"},{styleType:"multiple",label:"Scale",units:["-"],options:[{key:"scale",label:"All"},{key:"scaleX",label:"Left-Right"},{key:"scaleY",label:"Top-Bottom"}]},{styleType:"multiple",label:"Skew",units:["deg"],options:[{key:"skewX",label:"Left-Right"},{key:"skewY",label:"Top-Bottom"}]},{styleType:"multiple",label:"Translate",negative:!0,options:[{key:"translateX",label:"Left-Right"},{key:"translateY",label:"Top-Bottom"}]},{type:"arbitrary",units:["deg"],negative:!0,label:"Rotate",property:"rotate"}]},{styleType:"accordion",heading:"Animation",items:[{type:"dropdown",label:"Animation",property:"animation"},{type:"dropdown",label:"Transition",property:"transition"},{type:"dropdown",label:"Easing",property:"transitionEase"},{type:"arbitrary",units:["ms"],label:"Duration",property:"duration"},{type:"arbitrary",units:["ms"],label:"Delay",property:"delay"}]}]},{heading:"Classes",items:[{component:We}]}],me={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:p.EyeOpenIcon,invisible:p.EyeClosedIcon,hidden:p.EyeClosedIcon,gap:p.BorderAllIcon,gapX:p.WidthIcon,gapY:p.HeightIcon,spaceX:p.WidthIcon,spaceY:p.HeightIcon,overscroll:p.BorderAllIcon,overscrollX:p.WidthIcon,overscrollY:p.HeightIcon,overflow:p.BorderAllIcon,overflowX:p.WidthIcon,overflowY:p.HeightIcon,top:p.ArrowUpIcon,right:p.ArrowRightIcon,bottom:p.ArrowDownIcon,left:p.ArrowLeftIcon,inset:p.BorderAllIcon,insetX:p.WidthIcon,insetY:p.HeightIcon,border:p.BorderAllIcon,borderX:p.WidthIcon,borderY:p.HeightIcon,borderTop:p.ArrowUpIcon,borderRight:p.ArrowRightIcon,borderBottom:p.ArrowDownIcon,borderLeft:p.ArrowLeftIcon,borderRadius:p.BorderAllIcon,borderRadiusX:p.WidthIcon,borderRadiusY:p.HeightIcon,borderRadiusTop:p.ArrowUpIcon,borderRadiusRight:p.ArrowRightIcon,borderRadiusBottom:p.ArrowDownIcon,borderRadiusLeft:p.ArrowLeftIcon,borderRadiusTopLeft:p.ArrowTopLeftIcon,borderRadiusTopRight:p.ArrowTopRightIcon,borderRadiusBottomRight:p.ArrowBottomRightIcon,borderRadiusBottomLeft:p.ArrowBottomLeftIcon,divideXWidth:p.WidthIcon,divideYWidth:p.HeightIcon,scale:p.BorderAllIcon,scaleX:p.WidthIcon,scaleY:p.HeightIcon,skewX:p.WidthIcon,skewY:p.HeightIcon,translateX:p.WidthIcon,translateY:p.HeightIcon,padding:p.BorderAllIcon,paddingX:p.WidthIcon,paddingY:p.HeightIcon,paddingTop:p.ArrowUpIcon,paddingRight:p.ArrowRightIcon,paddingBottom:p.ArrowDownIcon,paddingLeft:p.ArrowLeftIcon,margin:p.BorderAllIcon,marginX:p.WidthIcon,marginY:p.HeightIcon,marginTop:p.ArrowUpIcon,marginRight:p.ArrowRightIcon,marginBottom:p.ArrowDownIcon,marginLeft:p.ArrowLeftIcon,textLeft:p.AlignLeftIcon,textCenter:p.AlignCenterHorizontallyIcon,textRight:p.AlignRightIcon,textJustify:p.StretchHorizontallyIcon,italic:p.FontItalicIcon,underline:p.UnderlineIcon,overline:p.OverlineIcon,uppercase:p.LetterCaseUppercaseIcon,block:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":p.Cross2Icon,fixed:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:p.Cross1Icon},W=x.createContext({canReset:!1,canChange:!0}),ze=({children:s,canReset:o=!1,canChange:r=!0})=>e.jsxRuntimeExports.jsx(W.Provider,{value:{canReset:o,canChange:r},children:s}),ge=({label:s,property:o,onChange:r})=>{const n=x.useMemo(()=>t.get(q.CLASSES_LIST,`${o}.classes`,[""]),[o]),i=F(o),a=x.useMemo(()=>t.get(i,"cls",""),[i]),{canChange:d}=x.useContext(W),u=/\[.*\]/g.test(a);return e.jsxRuntimeExports.jsx("div",{className:s?"w-full rounded ":"grow",children:u?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx($.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:a}),e.jsxRuntimeExports.jsxs(v.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(p.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(v.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(ee,{rounded:s,onChange:l=>r(l,o),selected:a,options:n,disabled:!d})})};function ee({selected:s,onChange:o,rounded:r=!1,options:n,disabled:i=!1}){const a=s.replace(/.*:/g,"").trim(),{undo:d,redo:u}=w.useCanvasHistory();return e.jsxRuntimeExports.jsxs("select",{disabled:!n.length||i,className:`${r?"rounded-md border border-border":"border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:l=>o(l.target.value),onKeyDown:l=>{l.ctrlKey&&(l.key==="z"&&d(),l.key==="y"&&u())},value:a,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),x.Children.toArray(n.map(l=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:l,children:l})))]})}const Ze=({property:s,onChange:o})=>{const{canReset:r,canChange:n}=x.useContext(W),i=F(s),a=x.useMemo(()=>t.get(i,"cls",""),[i]),d=x.useMemo(()=>t.get(q.CLASSES_LIST,`${s}.classes`,[""]),[s]),u=d.indexOf(a)>-1?d.indexOf(a):0,l=/\[.*\]/g.test(a);return e.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:l?e.jsxRuntimeExports.jsx("div",{className:"py-[5px] px-2",children:a}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!n&&(!r||u-1<0),onClick:()=>o(t.nth(d,u-1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(p.MinusIcon,{className:!n&&(!r||u-1<0)?"text-gray-500":"text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(ge,{label:!1,property:s,onChange:o})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!n&&(!r||u+1>=d.length),onClick:()=>o(t.nth(d,u+1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(p.PlusIcon,{className:!n&&(!r||u+1>=d.length)?"text-gray-500":"text-white/60"})})})]})})},Ue=({property:s,onChange:o})=>{const r=x.useMemo(()=>t.get(q.CLASSES_LIST,`${s}.classes`,[""]),[s]),{canChange:n}=x.useContext(W),i=F(s),a=x.useMemo(()=>t.get(i,"cls",""),[i]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(r,d=>e.jsxRuntimeExports.jsxs(v.Tooltip,{children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!n,onClick:()=>o(d,s),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${a===d?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:x.createElement(t.get(me,d,p.BoxIcon))})}),e.jsxRuntimeExports.jsx(v.TooltipContent,{children:t.startCase(t.toLower(d))})]}))})},Ge={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},Ke=({property:s,onChange:o})=>{const r=F(s),n=x.useMemo(()=>t.get(r,"cls",""),[r]),{canChange:i}=x.useContext(W),[a,d]=x.useState([]),[u,l]=x.useState({color:"",shade:""}),m=n.split("-"),g=t.get(m,"1",""),c=t.get(m,"2",""),b=x.useCallback(h=>{["current","inherit","transparent","black","white"].includes(h)?(d([]),l({color:h})):(d(["50","100","200","300","400","500","600","700","800","900"]),l(f=>({...f,color:h,shade:f.shade?f.shade:"500"})))},[d,l]);x.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(g))return d([]);d(["50","100","200","300","400","500","600","700","800","900"])},[g]);const y=x.useCallback(h=>{l({color:g,shade:h})},[g]);return x.useEffect(()=>{l({color:"",shade:""})},[r]),x.useEffect(()=>{const f=`${t.get(Ge,s,"")}-${u.color}${u.shade?`-${u.shade}`:""}`;f.match(new RegExp(t.get(q.CLASSES_LIST,`${s}.regExp`,"")))&&o(f,s)},[u,o,s]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(ee,{disabled:!i,rounded:!0,selected:g,onChange:b,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:e.jsxRuntimeExports.jsx(ee,{rounded:!0,selected:c,disabled:!g||!i,onChange:y,options:a})})]})},ue=(s,o)=>{s=s.toLowerCase();let r=s.trim().replace(/ |\+/g,"");if((r==="auto"||r==="none")&&o.includes(r))return{value:"",unit:r};const n=o.length?new RegExp(o.join("|"),"g"):/XXXXXX/g;r=r.replace(n,"");const i=s.match(n),a=i&&i.length>1,d=!t.isEmpty(r)&&Number.isNaN(Number(r));return a||d?{error:"Invalid value"}:i&&(i[0]==="auto"||i[0]==="none")?{value:i[0],unit:""}:{value:r,unit:i?i[0]:""}},Je=s=>{const o=s.startsWith("-")?"-":"",r=s.split("-").pop();if(["auto","none"].includes(r))return{value:"",unit:r};if(r==="px")return{value:"1",unit:"px"};if(r==="screen")return{value:"100",unit:s.indexOf("w-")!==-1?"vw":"vh"};if(r==="full")return{value:"100",unit:"%"};if(t.includes(s,"skew-"))return{value:`${o}${r}`,unit:"deg"};if(t.includes(s,"rotate-"))return{value:`${o}${r}`,unit:"deg"};if(t.includes(s,"opacity-"))return{value:`${r/100}`,unit:"-"};if(t.includes(s,"duration-")||t.includes(s,"delay-"))return{value:`${r}`,unit:"ms"};if(t.includes(s,"translate-")&&!r.includes("/"))return{value:`${o}${`${r/4}`}`,unit:"rem"};if(t.includes(s,"scale-"))return{value:`${o}${`${r/100}`}`,unit:"-"};if(t.startsWith(s,"border")){const n=s.match(/border-?(x|y|t|r|b|l)?\d+/g);if(n)return{value:n[0].split("-").pop(),unit:"px"};if(s.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(t.startsWith(s,"max-w-")){if(s==="max-w-screen-sm")return{value:"640",unit:"px"};if(s==="max-w-screen-md")return{value:"768",unit:"px"};if(s==="max-w-screen-lg")return{value:"1024",unit:"px"};if(s==="max-w-screen-xl")return{value:"1280",unit:"px"};if(s==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(r==="xs")return{value:"320",unit:"px"};if(r==="sm")return{value:"384",unit:"px"};if(r==="md")return{value:"448",unit:"px"};if(r==="lg")return{value:"512",unit:"px"};if(r==="xl")return{value:"576",unit:"px"};if(r==="2xl")return{value:"672",unit:"px"};if(r==="3xl")return{value:"768",unit:"px"};if(r==="4xl")return{value:"896",unit:"px"};if(r==="5xl")return{value:"1024",unit:"px"};if(r==="6xl")return{value:"1152",unit:"px"};if(r==="7xl")return{value:"1280",unit:"px"};if(r==="prose")return{value:"65",unit:"ch"}}if(t.startsWith(s,"text-")){if(r==="xs")return{value:"12",unit:"px"};if(r==="sm")return{value:"14",unit:"px"};if(r==="base")return{value:"16",unit:"px"};if(r==="lg")return{value:"18",unit:"px"};if(r==="xl")return{value:"20",unit:"px"};if(r==="2xl")return{value:"24",unit:"px"};if(r==="3xl")return{value:"30",unit:"px"};if(r==="4xl")return{value:"36",unit:"px"};if(r==="5xl")return{value:"48",unit:"px"};if(r==="6xl")return{value:"60",unit:"px"};if(r==="7xl")return{value:"72",unit:"px"};if(r==="8xl")return{value:"96",unit:"px"};if(r==="9xl")return{value:"128",unit:"px"}}if(t.startsWith(s,"leading-")){if(r==="none")return{value:"1",unit:"-"};if(r==="tight")return{value:"1.25",unit:"-"};if(r==="snug")return{value:"1.375",unit:"-"};if(r==="normal")return{value:"1.5",unit:"-"};if(r==="relaxed")return{value:"1.625",unit:"-"};if(r==="loose")return{value:"2",unit:"-"}}if(t.startsWith(s,"tracking-")){if(r==="tighter")return{value:"-0.05",unit:"em"};if(r==="tight")return{value:"-0.025",unit:"em"};if(r==="normal")return{value:"0",unit:"em"};if(r==="wide")return{value:"0.025",unit:"em"};if(r==="wider")return{value:"0.05",unit:"em"};if(r==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(r))return{value:s,unit:"class"};if(r.includes("/")){const[n,i]=t.map(r.split("/"),a=>parseInt(a,10));return{value:o+(n/i*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(r))?{value:`${o+parseFloat(r)*4}`,unit:"px"}:{value:r,unit:"class"}},Qe=s=>{if(t.isEmpty(s))return{value:"",unit:""};const o=s.match(/\[.*\]/g);if(o===null)return et(s);const r=t.get(o,"0","").replace(/\[|\]/g,""),n=s.startsWith("-")?"-":"",i=t.first(r.match(/\d+.\d+|\d+/g));return{value:`${n}${i}`,unit:r.replace(i,"")}},et=s=>t.isEmpty(s)?{value:"",unit:""}:Je(s),he=x.createContext({setDragData:()=>{}}),tt=({unit:s,currentValue:o,onDrag:r,onDragEnd:n,onDragStart:i,negative:a,cssProperty:d})=>{const{setDragData:u}=x.useContext(he);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:l=>{const m={onDrag:r,onDragEnd:n,dragging:!0,dragStartY:l.pageY,dragStartValue:`${o}`,dragUnit:s,negative:a,cssProperty:d};i(m),u(m)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:e.jsxRuntimeExports.jsx(p.RowSpacingIcon,{})})},st=({onSelect:s,current:o,units:r})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:r.map(n=>e.jsxRuntimeExports.jsx(v.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:o===n?"primary":void 0,size:"sm",onClick:i=>{i.stopPropagation(),s(n)},children:n},n))}),rt=s=>{const[o,r]=x.useState(!1),[n,i]=x.useState(""),{currentClass:a,onChange:d,classPrefix:u,cssProperty:l,units:m,negative:g}=s,[c,b]=x.useState(l!=null&&l.toLowerCase().includes("width")?"%":m[0]),[y,h]=x.useState(!1),[f,N]=x.useState(""),[A,E]=x.useState(!1),[D,H]=x.useState(!1);x.useEffect(()=>{const{value:j,unit:R}=Qe(a);if(R===""){i(j),b(l!=null&&l.toLowerCase().includes("width")?"%":m[0]);return}b(R),i(R==="class"||t.isEmpty(j)?"":j)},[a,l,m]);const k=K.useThrottledCallback(j=>{d(j)},[d],200),V=K.useThrottledCallback(j=>{d(j,!1)},[d],200),P=x.useCallback((j=!1)=>{const R=ue(`${n}`,m);if(t.get(R,"error",!1)){h(!0);return}const S=t.get(R,"unit")!==""?t.get(R,"unit"):c;if(S==="auto"||S==="none"){k(`${u}${S}`);return}if(t.get(R,"value")==="")return;const _=`${t.get(R,"value","").startsWith("-")?"-":""}${u}[${t.get(R,"value","").replace("-","")}${S==="-"?"":S}]`;j?V(_):k(_)},[k,V,n,c,u,m]),Y=x.useCallback(j=>{const R=ue(`${n}`,m);if(t.get(R,"error",!1)){h(!0);return}if(j==="auto"||j==="none"){k(`${u}${j}`);return}if(t.get(R,"value")==="")return;const S=t.get(R,"unit")!==""?t.get(R,"unit"):j,_=`${t.get(R,"value","").startsWith("-")?"-":""}${u}[${t.get(R,"value","").replace("-","")}${S==="-"?"":S}]`;k(_)},[k,n,u,m]);return e.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:c==="class"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("input",{className:"w-20 rounded py-1",readOnly:!0,value:a}),e.jsxRuntimeExports.jsxs(v.Tooltip,{children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(p.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(v.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${A?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(c)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:c==="class",onKeyPress:j=>{j.key==="Enter"&&P()},onKeyDown:j=>{if(j.keyCode!==38&&j.keyCode!==40)return;j.preventDefault(),H(!0);const R=t.parseInt(j.target.value);let S=t.isNaN(R)?0:R;j.keyCode===38&&(S+=1),j.keyCode===40&&(S-=1);const L=`${S}`,be=`${L.startsWith("-")?"-":""}${u}[${L.replace("-","")}${c==="-"?"":c}]`;V(be)},onKeyUp:j=>{D&&(j.preventDefault(),H(!1))},onBlur:()=>P(),onChange:j=>{h(!1),i(j.target.value)},onClick:j=>{var R;(R=j==null?void 0:j.target)==null||R.select(),r(!1)},value:A?f:n,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",y?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(v.Tooltip,{open:o,delayDuration:100,children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>r(!o),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${m.length===1?"px-2 font-semibold":""}`,children:c}),m.length>1?e.jsxRuntimeExports.jsx(p.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(v.TooltipPortal,{children:e.jsxRuntimeExports.jsx(v.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(st,{units:m,current:c,onSelect:j=>{r(!1),b(j),Y(j)}})})})]})]}),["none","auto"].indexOf(c)!==-1||A?null:e.jsxRuntimeExports.jsx(tt,{onDragStart:()=>E(!0),onDragEnd:j=>{if(N(()=>""),E(!1),t.isEmpty(j))return;const R=`${j}`,L=`${R.startsWith("-")?"-":""}${u}[${R.replace("-","")}${c==="-"?"":c}]`;k(L)},onDrag:j=>{if(t.isEmpty(j))return;N(j);const R=`${j}`,L=`${R.startsWith("-")?"-":""}${u}[${R.replace("-","")}${c==="-"?"":c}]`;V(L)},currentValue:n,unit:c,negative:g,cssProperty:l})]})})})},F=s=>{const o=I.useSelectedBlockCurrentClasses();return t.findLast(o,{property:s})},ot=(s,o)=>{const r={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return r[t.get(s,"mq","xs")]<=r[o]},nt={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},pe={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},it=s=>`${s.toUpperCase()} ${pe[s]?`(${pe[s]} & up)`:""}`,re=s=>{const{type:o="icons",label:r,property:n,onEmitChange:i=()=>{},units:a,negative:d=!1}=s,[u]=U.useDarkMode(),[l]=I.useStylingState(),[,m]=U.useCanvasWidth(),g=F(n),c=I.useAddClassesToBlocks(),b=I.useRemoveClassesFromBlocks(),[y]=w.useSelectedBlockIds(),h=x.useMemo(()=>t.get(g,"fullCls",""),[g]),f=x.useCallback((k,V=!0)=>{const P={dark:u,mq:m,mod:l,cls:k,property:n,fullCls:""};(u||l!=="")&&(P.mq="xs");const Y=q.generateFullClsName(P);c(y,[Y],V)},[y,u,m,l,n,c]),N=x.useCallback(()=>{b(y,[h])},[y,h,b]),A=x.useMemo(()=>ot(g,m),[g,m]);x.useEffect(()=>{i(A,g)},[A,i,g]);const[,,E]=U.useCanvasWidth(),D=x.useCallback(k=>{E({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[k])},[E]),H=t.get(g,"dark",null)===u&&t.get(g,"mod",null)===l&&t.get(g,"mq",null)===m;return e.jsxRuntimeExports.jsx(ze,{canChange:A,canReset:g&&H,children:e.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:e.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${g&&!H?"text-foreground":""}`,children:r})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[o==="arbitrary"?e.jsxRuntimeExports.jsx(rt,{currentClass:t.get(g,"cls",""),classPrefix:t.get(nt,n,""),units:a||[],onChange:f,negative:d,cssProperty:n}):null,o==="icons"&&e.jsxRuntimeExports.jsx(Ue,{property:n,onChange:f}),o==="range"&&e.jsxRuntimeExports.jsx(Ze,{property:n,onChange:f}),o==="color"&&e.jsxRuntimeExports.jsx(Ke,{property:n,onChange:f}),o==="dropdown"&&e.jsxRuntimeExports.jsx(ge,{label:r,property:n,onChange:f})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${h?"visible":"invisible"}`,children:H?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>N(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(p.TrashIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):A&&g?e.jsxRuntimeExports.jsxs(v.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(p.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(v.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at  ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold ",children:[it(t.get(g,"mq")),u&&!g.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>D(t.get(g,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(g,"mq").toUpperCase()]})]})})})]}):null})]})]})})},lt=["px","%","em","rem","ch","vh","vw"],ye=({label:s,options:o,borderB:r=!1,borderT:n=!1,type:i="arbitrary",units:a=lt,negative:d=!1})=>{const[u,l]=x.useState(o[0].key),m=I.useSelectedBlockCurrentClasses(),g=x.useCallback(c=>t.map(m,"property").includes(c),[m]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r?"border-b":""} ${n?"border-t":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[s&&e.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:s}),e.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:x.Children.toArray(o.map(({label:c,key:b})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(v.Tooltip,{children:[e.jsxRuntimeExports.jsx(v.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>l(b),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${b===u?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[x.createElement("div",{className:g(b)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),x.createElement(t.get(me,b,p.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(v.TooltipContent,{children:t.startCase(t.toLower(c))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(re,{type:i,units:[...a],label:"",property:u,negative:d})})]})},at=({heading:s,items:o})=>{const r=I.useSelectedBlockCurrentClasses(),n=x.useMemo(()=>{const i=u=>t.flatten(u.map(l=>l.styleType==="multiple"?t.map(l.options,"key"):l.property)),a=t.flatten(o.map(u=>u.styleType==="accordion"?i(u.items):u.styleType==="multiple"?t.map(u.options,"key"):u.property)),d=t.map(r,"property");return t.intersection(a,d).length>0},[r,o]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[s,n?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${n?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:o.map(i=>i.styleType==="multiple"?e.jsxRuntimeExports.jsx(ye,{...i},i.label):e.jsxRuntimeExports.jsx(re,{...i},i.label))})]})},ut=x.createContext({}),G=({section:s})=>{const o=I.useSelectedBlockCurrentClasses(),r=x.useCallback((a=[])=>{const d={};for(let l=0;l<o.length;l++)d[o[l].property]=o[l].cls;let u=!0;for(const l in a)if(!t.has(d,l)||d[l]!==a[l]){u=!1;break}return u},[o]),n=x.useMemo(()=>{if(o.length>0&&s.heading==="Classes")return!0;const a=l=>t.flatten(l.map(m=>m.styleType==="multiple"?t.flatten(t.map(m.options,"key")):m.property)),d=t.flatten(s.items.map(l=>l.styleType==="accordion"?a(l.items):l.styleType==="multiple"?t.flatten(t.map(l.options,"key")):l.property)),u=t.map(o,"property");return t.intersection(d,u).length>0},[o,s.heading,s.items]),i=x.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(ut.Provider,{value:i,children:e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${n?"bg-blue-500":"bg-gray-300"}`}),s.heading]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:x.Children.toArray(s.items.map(a=>t.has(a,"component")?x.createElement(a.component,{key:a.label}):t.has(a,"styleType")?a.styleType==="multiple"?e.jsxRuntimeExports.jsx(ye,{...a},a.label):a.styleType==="accordion"&&r(a==null?void 0:a.conditions)?e.jsxRuntimeExports.jsx(at,{...a},a.label):null:e.jsxRuntimeExports.jsx(re,{...a},a.label)))})]})})},pt=({item:s,index:o,canDelete:r,onChange:n,onRemove:i})=>e.jsxRuntimeExports.jsxs("div",{className:`flex flex-col gap-1 border-gray-400 py-2 ${r?"border-b":""}`,children:[e.jsxRuntimeExports.jsx("input",{name:"key",onChange:a=>n(a,o),value:s.key,placeholder:"Key",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1.5",children:[e.jsxRuntimeExports.jsx("input",{name:"value",onChange:a=>t.isEmpty(s.key)?{}:n(a,o),value:s.value,placeholder:"Value",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsx(p.TrashIcon,{onClick:i,className:"h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"})]})]}),dt=({section:s})=>{var b;const{setSyncState:o}=w.useSavePage(),r=w.useSelectedBlock(),[n,i]=x.useState([]),[a]=w.useSelectedStylingBlocks(),d=I.useUpdateBlocksPropsRealtime(),u=`${t.get(a,"0.prop")}_attrs`;z.useEffect(()=>{const y=t.map(t.get(r,u),(h,f)=>({key:f,value:h}));t.isEmpty(y)?i([]):i(y)},[t.get(r,u)]);const l=()=>i([...n,{key:"",value:""}]),m=y=>{const h=t.filter(n,(f,N)=>y!==N);c(h)},g=(y,h)=>{const f=[...n];f[h][y.target.name]=y.target.value,c(f)},c=z.useCallback((y=[])=>{const h={};t.forEach(y,f=>{t.isEmpty(f.key)||t.set(h,f.key,f.value)}),d([t.get(r,"_id")],{[u]:h}),o("UNSAVED")},[r,o,d,u]);return e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(r,u))?"bg-gray-300":"bg-blue-500"}`}),"Attributes"]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsxs(se.Label,{className:"mt-2 flex w-full items-center justify-between",children:["Add Custom attributes",e.jsxRuntimeExports.jsxs("div",{className:`flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!t.isEmpty(n)&&t.isEmpty((b=t.last(n))==null?void 0:b.key)?"cursor-not-allowed border-gray-400 text-gray-400":"cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,onClick:()=>{var y;!t.isEmpty(n)&&t.isEmpty((y=t.last(n))==null?void 0:y.key)||l()},children:[e.jsxRuntimeExports.jsx(p.PlusIcon,{width:12,height:12})," Add"]})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-12 items-center justify-center text-sm text-gray-400",children:"Click + Add to add attributes"}),z.Children.toArray(t.map(n,(y,h)=>{const f=n.length>0&&h<n.length-1;return e.jsxRuntimeExports.jsx(pt,{item:y,index:h,canDelete:f,onChange:g,onRemove:()=>m(h)})}))]})]})})]})};function ct(){const[s,o]=I.useStylingState(),{flexChild:r,gridChild:n}=w.useSelectedBlocksDisplayChild(),[,i]=Te.useAtom(w.advanceStylingOpenAtom),{t:a}=de.useTranslation(),[d]=w.useSelectedStylingBlocks();return t.isEmpty(d)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(p.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:a("no_styling_block_selected")}),e.jsxRuntimeExports.jsxs("p",{className:"text-xs ",children:["Hint: Styling allowed blocks are highlighted with"," ",e.jsxRuntimeExports.jsx("span",{className:"border border-orange-500 p-px",children:"orange"})," border"]})]})}):e.jsxRuntimeExports.jsxs("div",{onClick:()=>i(!1),className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-x-4 space-y-3 border-b border-border px-4 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-1.5",children:[e.jsxRuntimeExports.jsx(se.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(C.Select,{defaultValue:s,onValueChange:u=>o(u),children:[e.jsxRuntimeExports.jsx(C.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(C.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(C.SelectContent,{children:[e.jsxRuntimeExports.jsx(C.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(C.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),e.jsxRuntimeExports.jsxs(He.ScrollArea,{className:"no-scrollbar -mx-1 h-full overflow-x-hidden",children:[e.jsxRuntimeExports.jsxs(T.Accordion,{type:"multiple",className:"h-full w-full",children:[r&&e.jsxRuntimeExports.jsx(G,{section:Fe}),n?e.jsxRuntimeExports.jsx(G,{section:Ye}):null,Xe.map(u=>e.jsxRuntimeExports.jsx(G,{section:u},u.heading)),e.jsxRuntimeExports.jsx(dt,{section:{heading:"Attributes"}})]}),e.jsxRuntimeExports.jsx("div",{className:"h-60"})]})]})}const xt={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},mt=()=>{const s=w.useSelectedBlock(),{t:o}=de.useTranslation(),[r,n]=x.useState(""),[i,a]=x.useState({onDrag:l=>l,onDragEnd:l=>l,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),d=K.useThrottledCallback(l=>{const m=!t.get(i,"negative",!1),g=t.get(i,"cssProperty","");let c=parseFloat(i.dragStartValue);c=t.isNaN(c)?0:c;let b=xt[i.dragUnit];(t.startsWith(g,"scale")||g==="opacity")&&(b=10);let h=(i.dragStartY-l.pageY)/b+c;m&&h<0&&(h=0),g==="opacity"&&h>1&&(h=1),i.onDrag(`${h}`),n(`${h}`)},[i],50),u=x.useCallback(()=>{setTimeout(()=>i.onDragEnd(`${r}`),100),a({onDrag:l=>l,onDragEnd:l=>l,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[i,r,a]);return t.isNull(s)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(p.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:o("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsxs(he.Provider,{value:{setDragData:a},children:[i.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:d,onMouseUp:()=>u(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "}):null,e.jsxRuntimeExports.jsxs(O.Tabs,{defaultValue:"settings",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(O.TabsList,{className:"mx-1 grid grid-cols-2",children:[e.jsxRuntimeExports.jsx(O.TabsTrigger,{value:"settings",children:"Settings"}),e.jsxRuntimeExports.jsx(O.TabsTrigger,{value:"styling",children:"Styling"})]}),e.jsxRuntimeExports.jsx(O.TabsContent,{value:"settings",className:"no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(_e,{})}),e.jsxRuntimeExports.jsx(O.TabsContent,{value:"styling",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(ct,{})})]})]})};exports.default=mt;
@@ -1 +0,0 @@
1
- "use strict";var P=Object.create;var k=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var V=(s,n,r,x)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of z(n))!K.call(s,o)&&o!==r&&k(s,o,{get:()=>n[o],enumerable:!(x=T(n,o))||x.enumerable});return s};var I=(s,n,r)=>(r=s!=null?P(B(s)):{},V(n||!s||!s.__esModule?k(r,"default",{value:s,enumerable:!0}):r,s));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),C=require("@radix-ui/react-icons"),i=require("react"),q=require("jotai"),a=require("lodash"),d=require("./skeleton-JHP9zwL2.cjs"),v=require("./tabs-iWeaaVrg.cjs"),R=require("./ChaiBuilderEditor-BoE-sArB.cjs");require("react-i18next");const L=require("./utils-qK_SjzzV.cjs"),N=require("lucide-react"),M=require("./index-HAue58ea.cjs"),u=require("./alert-dialog-Mv0-wAvS.cjs"),E=require("./dialog-S_QbL1iq.cjs"),f=require("./select-7bjg-rr9.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-tabs");require("./MODIFIERS-Fx6WAZcw.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("tailwind-merge");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-select");const H=i.lazy(()=>import("react-json-view")),O=({provider:s,onClose:n})=>{const[r,x]=i.useState(null);return i.useEffect(()=>{s&&(s.mockFn?s.mockFn:s.dataFn)().then(m=>x(m))},[s]),s?e.jsxRuntimeExports.jsx(E.Dialog,{onOpenChange:o=>o?"":n(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(E.DialogContent,{children:[e.jsxRuntimeExports.jsxs(E.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(E.DialogTitle,{children:["Data Provider: ",s.name]}),e.jsxRuntimeExports.jsx(E.DialogDescription,{children:s.description})]}),e.jsxRuntimeExports.jsx(R.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(H,{style:{maxHeight:"80vh",overflowY:"auto"},name:s.providerKey,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:r})})]})}):null};function F({children:s,name:n,onRemove:r}){return e.jsxRuntimeExports.jsxs(u.AlertDialog,{children:[e.jsxRuntimeExports.jsx(u.AlertDialogTrigger,{asChild:!0,children:s}),e.jsxRuntimeExports.jsxs(u.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(u.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsxs(u.AlertDialogTitle,{children:["Are you sure, you want to remove ",e.jsxRuntimeExports.jsx("span",{className:"text-blue-500",children:n})," provider?"]}),e.jsxRuntimeExports.jsx(u.AlertDialogDescription,{children:"Your data provider will be removed from this page and all added data binding will be not visible on blocks."})]}),e.jsxRuntimeExports.jsxs(u.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(u.AlertDialogCancel,{children:"Cancel"}),e.jsxRuntimeExports.jsx(u.AlertDialogAction,{onClick:r,className:"bg-red-600 hover:bg-red-700",children:"Remove"})]})]})]})}const Y=()=>{const s=i.useMemo(()=>M.A(),[]),[n,r]=R.usePageDataProviders(),[,x]=q.useAtom(R.pageSyncStateAtom),[o,m]=i.useState(a.filter(s,t=>a.map(n,"providerKey").includes(t.providerKey))),[p,w]=i.useState(""),[b,c]=i.useState(null),y=a.filter(s.map(t=>a.map(o,"providerKey").includes(t.providerKey)?null:{value:t.providerKey,label:t.name}),t=>!a.isNull(t)),l=t=>{const h=a.find(s,{providerKey:t});m(j=>[...j,h]),r(j=>[...j,{providerKey:h.providerKey,args:{}}]),w(""),x("UNSAVED")},g=t=>{m(h=>a.filter(h,j=>j.providerKey!==t.providerKey)),r(h=>a.filter(h,j=>j.providerKey!==t.providerKey)),x("UNSAVED")},A=t=>c(t);return a.isEmpty(s)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 mb-1.5 text-xs p-4",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 mb-1.5 text-xs",children:"Add data providers:"})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(f.Select,{value:p,onValueChange:t=>l(t),children:[e.jsxRuntimeExports.jsx(f.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(f.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(f.SelectContent,{children:[e.jsxRuntimeExports.jsx(f.SelectItem,{value:"",children:"Choose"}),y.map(t=>e.jsxRuntimeExports.jsx(f.SelectItem,{value:t.value,children:t.label},t.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${o.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 pt-4 pb-1.5 text-xs flex-1 font-medium",children:"Page data providers:"}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:o.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm w-full","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex justify-between items-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:t.name}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-gray-400 pt-1",children:t.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"items-center p-2 py-2 flex justify-between",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>A(t),className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-blue-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),"View Data"]}),e.jsxRuntimeExports.jsx(F,{onRemove:()=>g(t),name:t.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),"Remove"]})})]})]},t.providerKey))}),e.jsxRuntimeExports.jsx(O,{onClose:()=>c(null),provider:b})]})]})},S=i.lazy(()=>Promise.resolve().then(()=>require("./Layers-EzOZdWvd.cjs"))),_=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-5j-XszLM.cjs"))),U=i.lazy(()=>Promise.resolve().then(()=>require("./ImagesPanel-6us7hiLN.cjs")));let D=null;const $=()=>{const s=d.useBuilderProp("sideBarComponents.top",[]),n=d.useBuilderProp("sideBarComponents.bottom",[]),[r,x]=q.useAtom(R.activePanelAtom),[o,m]=i.useState(r),[p,w]=i.useState(null),b={layers:S,"branding-options":_,images:U};a.each(s,({name:l,panel:g})=>{b[l]=g});const c=l=>{clearTimeout(D),y(!1),r!=="layers"&&l==="layers"?D=setTimeout(()=>m("layers"),500):m(l),x(l)},[,y]=q.useAtom(R.addBlocksModalAtom);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(d.Button,{onClick:()=>{y(!0),x("layers")},size:"sm",variant:r==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(C.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(d.Button,{onClick:()=>c("layers"),size:"sm",variant:r==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(N.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(d.Button,{onClick:()=>c("branding-options"),size:"sm",variant:r==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(C.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(s.map(({name:l,icon:g})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(d.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(d.Button,{onClick:()=>c(l),size:"sm",className:"w-10",variant:r===l?"default":"outline",children:e.jsxRuntimeExports.jsx(g,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:i.Children.toArray(n.map(l=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(d.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(l,{})})))})]}),e.jsxRuntimeExports.jsx("div",{onClick:()=>{c("layers")},className:"absolute inset-0 right-0 z-50 w-screen bg-black/20"+(r==="layers"?" hidden":"")}),e.jsxRuntimeExports.jsx("div",{className:`fixed left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${r!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:L.cn("relative h-full max-h-[93%] bg-background p-1",r==="layers"?"":"z-[100]"),onMouseEnter:()=>{p&&clearTimeout(p)},onMouseLeave:()=>{const l=setTimeout(()=>{p&&(c("layers"),clearTimeout(p))},1e3);w(l)},children:i.createElement(a.get(b,o,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsxs(v.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(v.TabsList,{className:"mx-1 h-10 grid grid-cols-2",children:[e.jsxRuntimeExports.jsxs(v.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(N.ListTreeIcon,{className:"h-3 mr-2"})," Layers"]}),e.jsxRuntimeExports.jsxs(v.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(N.DatabaseIcon,{className:"w-3 mr-2"}),"Data"]})]}),e.jsxRuntimeExports.jsx(v.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(S)}),e.jsxRuntimeExports.jsx(v.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Y,{})})]})})})]})};exports.default=$;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),i=require("react"),a=require("@radix-ui/react-icons"),s=require("./select-7bjg-rr9.cjs"),r=require("./skeleton-JHP9zwL2.cjs"),o=require("./separator-3Civ-6hb.cjs"),c=require("./toggle-ehNIPmme.cjs"),p=require("./ChaiBuilderEditor-BoE-sArB.cjs"),m=require("react-i18next");require("@radix-ui/react-select");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("jotai");require("lodash");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-separator");require("@radix-ui/react-toggle");require("./MODIFIERS-Fx6WAZcw.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("./index-HAue58ea.cjs");const j=()=>r.useBuilderProp("languages",["en"]),d=()=>j().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(s.Select,{children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(a.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(s.SelectContent,{children:e.jsxRuntimeExports.jsxs(s.SelectGroup,{children:[e.jsxRuntimeExports.jsx(s.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(s.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),h=()=>{const{savePage:x,syncState:t}=p.useSavePage(),{t:l}=m.useTranslation(),u=i.useMemo(()=>{switch(t){case"SAVING":return"animate-pulse bg-gray-500 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[t]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(c.Toggle,{onClick:n=>{n.preventDefault(),x()},className:`flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${u}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx("svg",{fill:"currentColor",width:"16",height:"16",viewBox:"0 0 0.32 0.32",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"})}),t==="SAVING"?"Saving...":t==="SAVED"?l("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t==="SAVING"?"Saving...":t==="SAVED"?"Saved":"Save changes"})})]})})},g=()=>{const x=r.useBuilderProp("topBarComponents.left",[]),t=r.useBuilderProp("topBarComponents.center",[]),l=r.useBuilderProp("topBarComponents.right",[]),u=r.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:i.Children.toArray(x.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:i.Children.toArray(t.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(d,{}),e.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),u?e.jsxRuntimeExports.jsx(h,{}):null,i.Children.toArray(l.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))]})]})};exports.default=g;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),i=require("react"),o=require("lodash"),A=require("@radix-ui/react-icons"),T=require("unsplash-js"),b=require("./skeleton-JHP9zwL2.cjs"),z=require("./command-ThdTuUxt.cjs"),_=require("./scroll-area-FiHvy-TZ.cjs"),g=require("./popover-fKjgcRUx.cjs"),t=require("./select-7bjg-rr9.cjs");require("react-i18next");const D=require("@react-hookz/web"),L=require("lucide-react");require("jotai");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("cmdk");require("./dialog-S_QbL1iq.cjs");require("@radix-ui/react-dialog");require("@radix-ui/react-scroll-area");require("@radix-ui/react-popover");require("@radix-ui/react-select");const R=async(d,E)=>new Promise((l,a)=>{T.createApi({accessKey:E}).search.getPhotos(d).then(c=>{l(c)}).catch(c=>a(c))}),V=({isModalView:d,onSelect:E})=>{const l=b.useBuilderProp("unsplashAccessKey"),[a,f]=i.useState([]),[c,y]=i.useState(0),[x,I]=i.useState(),[u,w]=i.useState(),[P,v]=i.useState(0),[j,C]=D.useDebouncedState("",1e3),[h,m]=i.useState(!1),k=async s=>{if(o.isEmpty(j))return;let n=c+1;s&&(s.preventDefault(),n=1),m(!0),y(n);const p={query:j,page:n};x&&(p.orientation=x),u&&(p.color=u),R(p,l).then(r=>{var q,N,S;f(n===1?((q=r==null?void 0:r.response)==null?void 0:q.results)||[]:[...a,...((N=r==null?void 0:r.response)==null?void 0:N.results)||[]]),v((S=r==null?void 0:r.response)==null?void 0:S.total_pages),m(!1)}).catch(()=>{m(!1)})};return i.useEffect(()=>{if(!o.isEmpty(j)){m(!0);const s={query:j,page:1};x&&(s.orientation=x),u&&(s.color=u),y(1),R(s,l).then(n=>{var p,r;f(((p=n==null?void 0:n.response)==null?void 0:p.results)||[]),v((r=n==null?void 0:n.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[x,u,j,l]),o.isEmpty(l)?e.jsxRuntimeExports.jsx("div",{className:"h-full flex flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"underline px-1 hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center rounded-md border bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsx(z.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>C(s.target.value)}),e.jsxRuntimeExports.jsxs(g.Popover,{children:[e.jsxRuntimeExports.jsx(g.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(A.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(g.PopoverContent,{side:d?"bottom":"right",className:"z-[9999] flex w-max items-center justify-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"py-1 text-sm font-medium",children:"Orientation"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:x,onValueChange:s=>I(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:u,onValueChange:s=>w(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:s,children:o.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(_.ScrollArea,{className:`h-full ${d&&!o.isEmpty(a)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[o.isEmpty(a)&&!h&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),d?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:a.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>E(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):a.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),h&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(L.Loader,{className:"animate-spin w-6 h-6"}),"  Loading..."]}),!o.isEmpty(a)&&c<P&&!h&&e.jsxRuntimeExports.jsx(b.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>k(void 0),disabled:h,children:h?"":"Load More"})]})]})};exports.default=V;exports.fetchImage=R;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),t=require("react"),a=require("lodash"),m=require("@radix-ui/react-icons"),E=require("jotai"),q=require("./scroll-area-FiHvy-TZ.cjs");require("react-i18next");const b=require("./skeleton-JHP9zwL2.cjs");require("@radix-ui/react-scroll-area");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");const I=E.atom([]),w=({isModalView:r,onSelect:u})=>{const R=b.useBuilderProp("uploadMediaCallback",()=>""),c=b.useBuilderProp("fetchMediaCallback",()=>[]),[n,o]=E.useAtom(I),[l,p]=t.useState(!1),[j,h]=t.useState(!1),[x,d]=t.useState(),[f,v]=t.useState("");t.useEffect(()=>{(async()=>{h(!0);const s=await c();o(s||[]),h(!1)})()},[c,o]);const y=s=>{var i,g;s&&((g=(i=s==null?void 0:s.target)==null?void 0:i.files)==null?void 0:g.length)>0&&d(s.target.files[0])},N=async()=>{p(!0);try{const{url:s}=await R(x);u(s),d(void 0);const i=await c();o(i)}catch(s){o([]),v((s==null?void 0:s.message)||"Something went wrong.")}p(!1)};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[x?e.jsxRuntimeExports.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1",children:[e.jsxRuntimeExports.jsx("img",{src:URL.createObjectURL(x),alt:"",className:"h-auto w-full max-w-sm rounded-md max-h-96 object-contain"}),f&&e.jsxRuntimeExports.jsx("div",{className:"w-full pt-2 text-center text-sm text-red-500",children:f}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-center gap-2 pt-2",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:N,disabled:l,className:"flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",children:[l?e.jsxRuntimeExports.jsx(m.GearIcon,{className:"animate-spin"}):e.jsxRuntimeExports.jsx(m.UploadIcon,{className:"animate-bounce"}),"  ",l?"Uploading...":"Upload"]}),!l&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",onClick:()=>d(void 0),children:[e.jsxRuntimeExports.jsx(m.Cross1Icon,{}),"  Cancel"]})]})]}):e.jsxRuntimeExports.jsxs("label",{htmlFor:r?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-md border border-dashed border-blue-900 bg-gray-200 py-8 hover:bg-blue-50",children:[e.jsxRuntimeExports.jsx("div",{className:"text-3xl",children:"+"}),e.jsxRuntimeExports.jsx("div",{children:"Click to choose file"})]}),e.jsxRuntimeExports.jsx("input",{type:"file",id:r?"upload-in-modal":"upload-in-panel",hidden:!0,onChange:y})]}),e.jsxRuntimeExports.jsxs(q.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${r?"px-2":""} pt-2`,children:[a.isEmpty(n)&&j&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"animate-pulse font-medium",children:"Fetching..."})}),a.isEmpty(n)&&!j&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Images"})}),r?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:a.map(n,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>u(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.thumbUrl})})},s.id))}):a.map(n,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>u(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.url})})},s.id))]})]})};exports.default=w;
@@ -1,42 +0,0 @@
1
- import { j as a } from "./jsx-runtime-Sp0orL4X.js";
2
- import * as n from "react";
3
- import * as e from "@radix-ui/react-accordion";
4
- import { ChevronDownIcon as c } from "@radix-ui/react-icons";
5
- import { c as i } from "./utils-dze1SGvB.js";
6
- const N = e.Root, m = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a.jsx(e.Item, { ref: r, className: i("border-b", o), ...t }));
7
- m.displayName = "AccordionItem";
8
- const d = n.forwardRef(({ className: o, children: t, ...r }, s) => /* @__PURE__ */ a.jsx(e.Header, { className: "flex", children: /* @__PURE__ */ a.jsxs(
9
- e.Trigger,
10
- {
11
- ref: s,
12
- className: i(
13
- "flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
14
- o
15
- ),
16
- ...r,
17
- children: [
18
- t,
19
- /* @__PURE__ */ a.jsx(c, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })
20
- ]
21
- }
22
- ) }));
23
- d.displayName = e.Trigger.displayName;
24
- const l = n.forwardRef(({ className: o, children: t, ...r }, s) => /* @__PURE__ */ a.jsx(
25
- e.Content,
26
- {
27
- ref: s,
28
- className: i(
29
- "text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
30
- o
31
- ),
32
- ...r,
33
- children: /* @__PURE__ */ a.jsx("div", { className: "pb-4 pt-0", children: t })
34
- }
35
- ));
36
- l.displayName = e.Content.displayName;
37
- export {
38
- N as A,
39
- m as a,
40
- d as b,
41
- l as c
42
- };
@@ -1 +0,0 @@
1
- "use strict";const s=require("./jsx-runtime-JYMCiFoE.cjs"),u=require("react"),x=require("@radix-ui/react-accordion"),p=require("@radix-ui/react-icons"),c=require("./utils-qK_SjzzV.cjs");function a(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const i=a(u),o=a(x),f=o.Root,d=i.forwardRef(({className:e,...n},t)=>s.jsxRuntimeExports.jsx(o.Item,{ref:t,className:c.cn("border-b",e),...n}));d.displayName="AccordionItem";const m=i.forwardRef(({className:e,children:n,...t},r)=>s.jsxRuntimeExports.jsx(o.Header,{className:"flex",children:s.jsxRuntimeExports.jsxs(o.Trigger,{ref:r,className:c.cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...t,children:[n,s.jsxRuntimeExports.jsx(p.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));m.displayName=o.Trigger.displayName;const l=i.forwardRef(({className:e,children:n,...t},r)=>s.jsxRuntimeExports.jsx(o.Content,{ref:r,className:c.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...t,children:s.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:n})}));l.displayName=o.Content.displayName;exports.Accordion=f;exports.AccordionContent=l;exports.AccordionItem=d;exports.AccordionTrigger=m;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),g=require("react"),R=require("lodash"),x=require("./skeleton-JHP9zwL2.cjs"),a=require("./dialog-S_QbL1iq.cjs"),c=require("./controls-W97-POR_.cjs"),b=require("./form-nRAvKPQj.cjs"),f=require("./index-X9ZgD09V.cjs");require("jotai");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-qK_SjzzV.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("@radix-ui/react-dialog");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./link-ece8dZGH.cjs");require("react-icons-picker");require("react-dom");require("./ImagesPanel-6us7hiLN.cjs");require("./tabs-iWeaaVrg.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("./ChaiBuilderEditor-BoE-sArB.cjs");require("./MODIFIERS-Fx6WAZcw.cjs");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./functions-uw7QP2kT.cjs");require("redux-undo");require("@react-hookz/web");require("./index-HAue58ea.cjs");require("sonner");require("./html-to-json-P6GpbcQX.cjs");require("himalaya");require("lucide-react");require("./alert-dialog-Mv0-wAvS.cjs");require("@radix-ui/react-alert-dialog");const E=({closeModal:i})=>{var o,l;const s=f.useAddPage(),[r,m]=g.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{}}),p=()=>{s.mutate(r,{onSuccess:()=>i()})},j=({formData:u},t)=>{m(h=>{var q,d;const n={[t]:u[t]};return t==="name"?n.slug=R.kebabCase((q=u[t])==null?void 0:q.replace(/\d/g,"")):t==="slug"&&(n.slug=(d=u[t])==null?void 0:d.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...h,...n}})},P={name:c.u({title:"Page Name",default:r.name}),slug:c.u({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(a.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(b.Form,{formData:r,properties:P,onChange:j,disabled:s.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(x.Button,{type:"submit",disabled:!r.name||!r.slug||((o=r.name)==null?void 0:o.length)<2||((l=r.slug)==null?void 0:l.length)<2||s.isPending,onClick:p,children:"Add Page"})})]})},C=()=>{const[i,s]=g.useState(!1);return e.jsxRuntimeExports.jsxs(a.Dialog,{open:i,onOpenChange:()=>s(!i),children:[e.jsxRuntimeExports.jsx(a.DialogTrigger,{children:e.jsxRuntimeExports.jsx(x.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>s(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(E,{closeModal:()=>s(!i)})]})};exports.default=C;
@@ -1,99 +0,0 @@
1
- import { j as t } from "./jsx-runtime-Sp0orL4X.js";
2
- import { useState as g } from "react";
3
- import { kebabCase as j } from "lodash";
4
- import { B as c } from "./skeleton-CU_FIbg3.js";
5
- import { D as b, a as C, b as A } from "./dialog-jrw9DF1f.js";
6
- import { u as d } from "./controls-enQY7NI8.js";
7
- import { F as D } from "./form-dVpOAyRl.js";
8
- import { e as N } from "./index-T4_wfKl5.js";
9
- import "jotai";
10
- import "@radix-ui/react-slot";
11
- import "class-variance-authority";
12
- import "./utils-dze1SGvB.js";
13
- import "clsx";
14
- import "tailwind-merge";
15
- import "@radix-ui/react-tooltip";
16
- import "@radix-ui/react-icons";
17
- import "@radix-ui/react-toast";
18
- import "@radix-ui/react-dialog";
19
- import "@rjsf/core";
20
- import "@rjsf/validator-ajv8";
21
- import "./link-6o6n2Tnd.js";
22
- import "react-icons-picker";
23
- import "react-dom";
24
- import "./ImagesPanel-oaHOD-Ex.js";
25
- import "./tabs-Gb9v5dVb.js";
26
- import "@radix-ui/react-tabs";
27
- import "react-quill";
28
- import "react-i18next";
29
- import "./ChaiBuilderEditor-hEuUONQ3.js";
30
- import "./MODIFIERS-DsEzQ3aH.js";
31
- import "@radix-ui/react-scroll-area";
32
- import "@floating-ui/react-dom";
33
- import "i18next";
34
- import "flagged";
35
- import "react-dnd";
36
- import "@minoru/react-dnd-treeview";
37
- import "react-hotkeys-hook";
38
- import "flat-to-nested";
39
- import "./functions-pcUZhFJM.js";
40
- import "redux-undo";
41
- import "@react-hookz/web";
42
- import "./index-ehKdBRUK.js";
43
- import "sonner";
44
- import "./html-to-json-pdHQfRkN.js";
45
- import "himalaya";
46
- import "lucide-react";
47
- import "./alert-dialog-GNfnpqFB.js";
48
- import "@radix-ui/react-alert-dialog";
49
- const S = ({ closeModal: o }) => {
50
- var s, p;
51
- const i = N(), [e, u] = g({
52
- name: "",
53
- slug: "",
54
- blocks: [],
55
- type: "STATIC",
56
- seoData: {}
57
- }), f = () => {
58
- i.mutate(e, {
59
- onSuccess: () => o()
60
- });
61
- }, x = ({ formData: m }, r) => {
62
- u((h) => {
63
- var n, l;
64
- const a = { [r]: m[r] };
65
- return r === "name" ? a.slug = j((n = m[r]) == null ? void 0 : n.replace(/\d/g, "")) : r === "slug" && (a.slug = (l = m[r]) == null ? void 0 : l.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_")), {
66
- ...h,
67
- ...a
68
- };
69
- });
70
- }, P = {
71
- name: d({
72
- title: "Page Name",
73
- default: e.name
74
- }),
75
- slug: d({ title: "Page Slug", default: e.slug })
76
- };
77
- return /* @__PURE__ */ t.jsxs(A, { children: [
78
- /* @__PURE__ */ t.jsx("div", { className: "px-1 font-bold", children: "Add Page" }),
79
- /* @__PURE__ */ t.jsx(D, { formData: e, properties: P, onChange: x, disabled: i.isPending }),
80
- /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ t.jsx(
81
- c,
82
- {
83
- type: "submit",
84
- disabled: !e.name || !e.slug || ((s = e.name) == null ? void 0 : s.length) < 2 || ((p = e.slug) == null ? void 0 : p.length) < 2 || i.isPending,
85
- onClick: f,
86
- children: "Add Page"
87
- }
88
- ) })
89
- ] });
90
- }, bt = () => {
91
- const [o, i] = g(!1);
92
- return /* @__PURE__ */ t.jsxs(b, { open: o, onOpenChange: () => i(!o), children: [
93
- /* @__PURE__ */ t.jsx(C, { children: /* @__PURE__ */ t.jsx(c, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!o), children: "+ New Page" }) }),
94
- o && /* @__PURE__ */ t.jsx(S, { closeModal: () => i(!o) })
95
- ] });
96
- };
97
- export {
98
- bt as default
99
- };
@@ -1,64 +0,0 @@
1
- import { j as o } from "./jsx-runtime-Sp0orL4X.js";
2
- import * as i from "react";
3
- import * as t from "@radix-ui/react-alert-dialog";
4
- import { c as l } from "./utils-dze1SGvB.js";
5
- import { b as r } from "./skeleton-CU_FIbg3.js";
6
- const D = t.Root, j = t.Trigger, d = ({ className: a, ...e }) => /* @__PURE__ */ o.jsx(t.Portal, { className: l(a), ...e });
7
- d.displayName = t.Portal.displayName;
8
- const n = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(
9
- t.Overlay,
10
- {
11
- className: l(
12
- "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
13
- a
14
- ),
15
- ...e,
16
- ref: s
17
- }
18
- ));
19
- n.displayName = t.Overlay.displayName;
20
- const m = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsxs(d, { children: [
21
- /* @__PURE__ */ o.jsx(n, {}),
22
- /* @__PURE__ */ o.jsx(
23
- t.Content,
24
- {
25
- ref: s,
26
- className: l(
27
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
28
- a
29
- ),
30
- ...e
31
- }
32
- )
33
- ] }));
34
- m.displayName = t.Content.displayName;
35
- const c = ({ className: a, ...e }) => /* @__PURE__ */ o.jsx("div", { className: l("flex flex-col space-y-2 text-center sm:text-left", a), ...e });
36
- c.displayName = "AlertDialogHeader";
37
- const p = ({ className: a, ...e }) => /* @__PURE__ */ o.jsx("div", { className: l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", a), ...e });
38
- p.displayName = "AlertDialogFooter";
39
- const f = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(t.Title, { ref: s, className: l("text-lg font-semibold", a), ...e }));
40
- f.displayName = t.Title.displayName;
41
- const g = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(t.Description, { ref: s, className: l("text-sm text-muted-foreground", a), ...e }));
42
- g.displayName = t.Description.displayName;
43
- const x = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(t.Action, { ref: s, className: l(r(), a), ...e }));
44
- x.displayName = t.Action.displayName;
45
- const N = i.forwardRef(({ className: a, ...e }, s) => /* @__PURE__ */ o.jsx(
46
- t.Cancel,
47
- {
48
- ref: s,
49
- className: l(r({ variant: "outline" }), "mt-2 sm:mt-0", a),
50
- ...e
51
- }
52
- ));
53
- N.displayName = t.Cancel.displayName;
54
- export {
55
- D as A,
56
- j as a,
57
- m as b,
58
- c,
59
- p as d,
60
- f as e,
61
- g as f,
62
- x as g,
63
- N as h
64
- };
@@ -1 +0,0 @@
1
- "use strict";const o=require("./jsx-runtime-JYMCiFoE.cjs"),A=require("react"),N=require("@radix-ui/react-alert-dialog"),l=require("./utils-qK_SjzzV.cjs"),n=require("./skeleton-JHP9zwL2.cjs");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const i=c(A),s=c(N),y=s.Root,R=s.Trigger,d=({className:e,...t})=>o.jsxRuntimeExports.jsx(s.Portal,{className:l.cn(e),...t});d.displayName=s.Portal.displayName;const m=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Overlay,{className:l.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));m.displayName=s.Overlay.displayName;const p=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsxs(d,{children:[o.jsxRuntimeExports.jsx(m,{}),o.jsxRuntimeExports.jsx(s.Content,{ref:a,className:l.cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...t})]}));p.displayName=s.Content.displayName;const u=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:l.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});u.displayName="AlertDialogHeader";const x=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:l.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});x.displayName="AlertDialogFooter";const g=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Title,{ref:a,className:l.cn("text-lg font-semibold",e),...t}));g.displayName=s.Title.displayName;const f=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Description,{ref:a,className:l.cn("text-sm text-muted-foreground",e),...t}));f.displayName=s.Description.displayName;const D=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Action,{ref:a,className:l.cn(n.buttonVariants(),e),...t}));D.displayName=s.Action.displayName;const j=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Cancel,{ref:a,className:l.cn(n.buttonVariants({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));j.displayName=s.Cancel.displayName;exports.AlertDialog=y;exports.AlertDialogAction=D;exports.AlertDialogCancel=j;exports.AlertDialogContent=p;exports.AlertDialogDescription=f;exports.AlertDialogFooter=x;exports.AlertDialogHeader=u;exports.AlertDialogTitle=g;exports.AlertDialogTrigger=R;
@@ -1 +0,0 @@
1
- "use strict";const a=require("./jsx-runtime-JYMCiFoE.cjs"),C=require("react"),n=require("./utils-qK_SjzzV.cjs"),j=require("@radix-ui/react-icons"),m=require("cmdk"),i=require("./dialog-S_QbL1iq.cjs");function h(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const d=h(C),p=d.forwardRef(({className:e,type:t,...o},r)=>a.jsxRuntimeExports.jsx("input",{type:t,className:n.cn("flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...o}));p.displayName="Input";const s=d.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(m.Command,{ref:o,className:n.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));s.displayName=m.Command.displayName;const N=({children:e,...t})=>a.jsxRuntimeExports.jsx(i.Dialog,{...t,children:a.jsxRuntimeExports.jsx(i.DialogContent,{className:"overflow-hidden p-0",children:a.jsxRuntimeExports.jsx(s,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),c=d.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsxRuntimeExports.jsx(j.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsxRuntimeExports.jsx(m.Command.Input,{ref:o,className:n.cn("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));c.displayName=m.Command.Input.displayName;const u=d.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(m.Command.List,{ref:o,className:n.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));u.displayName=m.Command.List.displayName;const l=d.forwardRef((e,t)=>a.jsxRuntimeExports.jsx(m.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));l.displayName=m.Command.Empty.displayName;const x=d.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(m.Command.Group,{ref:o,className:n.cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));x.displayName=m.Command.Group.displayName;const f=d.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(m.Command.Separator,{ref:o,className:n.cn("-mx-1 h-px bg-border",e),...t}));f.displayName=m.Command.Separator.displayName;const g=d.forwardRef(({className:e,...t},o)=>a.jsxRuntimeExports.jsx(m.Command.Item,{ref:o,className:n.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));g.displayName=m.Command.Item.displayName;const y=({className:e,...t})=>a.jsxRuntimeExports.jsx("span",{className:n.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});y.displayName="CommandShortcut";exports.Command=s;exports.CommandDialog=N;exports.CommandEmpty=l;exports.CommandGroup=x;exports.CommandInput=c;exports.CommandItem=g;exports.CommandList=u;exports.CommandSeparator=f;exports.CommandShortcut=y;exports.Input=p;