@chaibuilder/sdk 1.1.2 → 1.1.4
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.
- package/dist/{AddBlocks-P3qHuE5J.cjs → AddBlocks-Wsoku0Sm.cjs} +1 -1
- package/dist/{AddBlocks-imyQSCbI.js → AddBlocks-rteGefHR.js} +20 -20
- package/dist/{BrandingOptions-tSNtQ1Kv.js → BrandingOptions-4l1Yo42i.js} +1 -1
- package/dist/{BrandingOptions-_2XBEPab.cjs → BrandingOptions-CqVvc-GC.cjs} +1 -1
- package/dist/CanvasArea-_WcM6PCy.js +1426 -0
- package/dist/CanvasArea-jzvQJnbQ.cjs +59 -0
- package/dist/{CurrentPage-hHwsHam-.cjs → CurrentPage-8AWFWOJ8.cjs} +1 -1
- package/dist/{CurrentPage-uRwS0DQC.js → CurrentPage-tnHIOkX2.js} +5 -5
- package/dist/{Layers-eXMT1ncm.js → Layers-6PHQWIbV.js} +15 -15
- package/dist/{Layers--5nyqOjK.cjs → Layers-jsOPQbVU.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-aqik3ouc.js → MarkAsGlobalBlock-9pfqCgrO.js} +1 -1
- package/dist/{MarkAsGlobalBlock-p_wvHkQZ.cjs → MarkAsGlobalBlock-bXkERbl2.cjs} +1 -1
- package/dist/{PagesPanel-WZgw7xVs.cjs → PagesPanel-Zvy5ZKPf.cjs} +1 -1
- package/dist/{PagesPanel-xRUnAMIb.js → PagesPanel-cmJ1UiP0.js} +3 -3
- package/dist/{ProjectPanel-FC03TiyG.cjs → ProjectPanel-4BsxvZu-.cjs} +1 -1
- package/dist/{ProjectPanel-8l4Bi3Kh.js → ProjectPanel-VxbDdgA2.js} +5 -5
- package/dist/Settings-AJet4HbF.cjs +1 -0
- package/dist/{Settings-4v3M1bRS.js → Settings-zzs6KaRd.js} +294 -303
- package/dist/{SidePanels-0xaw3Td6.js → SidePanels-UGgpWdPF.js} +9 -9
- package/dist/{SidePanels-5e5q3c7J.cjs → SidePanels-_8tt1l6S.cjs} +1 -1
- package/dist/{Topbar-ZjAs5fDc.cjs → Topbar-geYx1fCH.cjs} +1 -1
- package/dist/{Topbar-Jc74a6oE.js → Topbar-zw_KlpKs.js} +5 -5
- package/dist/{UnsplashImages-nXceZLmd.cjs → UnsplashImages-C4_dg08Y.cjs} +1 -1
- package/dist/{UnsplashImages-_PxEYx5c.js → UnsplashImages-yk5eowZf.js} +4 -4
- package/dist/{UploadImages-tcQb5NZu.cjs → UploadImages-hLrNjSXF.cjs} +1 -1
- package/dist/{UploadImages-zzSgKmP9.js → UploadImages-ioTAmtvl.js} +10 -10
- package/dist/{add-page-modal-K5isTZOT.js → add-page-modal-31-dJjna.js} +3 -3
- package/dist/{add-page-modal-JRSQ_N56.cjs → add-page-modal-Gsa-gnsn.cjs} +1 -1
- package/dist/{confirm-alert-2JxcNf3T.js → confirm-alert-c7sRVjK8.js} +1 -1
- package/dist/{confirm-alert-mzlwOW9w.cjs → confirm-alert-zqK8LIx8.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +0 -25
- package/dist/core.js +51 -55
- package/dist/{delete-page-modal-x81Ed4jF.js → delete-page-modal-5xqoPPl3.js} +2 -2
- package/dist/{delete-page-modal-c8nB2y7w.cjs → delete-page-modal-jEsSWzKN.cjs} +1 -1
- package/dist/{form-TQ7vwDYO.js → form-5tYo3gKa.js} +1 -1
- package/dist/{form-bSW-Pkw9.cjs → form-hHv26OT7.cjs} +1 -1
- package/dist/{index-HjvZqhVh.js → index-K_TiChPs.js} +4 -4
- package/dist/index-LLhN-70p.cjs +1 -0
- package/dist/{index-ORFlyrBx.js → index-pJPfM9Bm.js} +874 -878
- package/dist/{index-7NRFGya_.cjs → index-rdttRR05.cjs} +2 -2
- package/dist/{page-viewer-huD5B1om.cjs → page-viewer-DJqp04Tr.cjs} +1 -1
- package/dist/{page-viewer-fFaDQOOI.js → page-viewer-Oku6zrcm.js} +3 -3
- package/dist/{project-general-setting-rH_1r38b.js → project-general-setting-hrJZUYnV.js} +3 -3
- package/dist/{project-general-setting-rNNI-K6l.cjs → project-general-setting-rVhljgfP.cjs} +1 -1
- package/dist/{project-seo-setting-cERASO9j.cjs → project-seo-setting-Xg6cVYXo.cjs} +1 -1
- package/dist/{project-seo-setting-k0HlefUD.js → project-seo-setting-fwyxNcY-.js} +2 -2
- package/dist/{single-page-detail-CrgTQFUX.js → single-page-detail-1UCpERBU.js} +4 -4
- package/dist/{single-page-detail-52_cuxNe.cjs → single-page-detail-ilh1I9gv.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +41 -41
- package/dist/{useAddBlockByDrop-UA_Iw_4l.js → useAddBlockByDrop-UJ6QE7aE.js} +1 -1
- package/dist/{useAddBlockByDrop-DPV32UHP.cjs → useAddBlockByDrop-jJ_MnZ5y.cjs} +1 -1
- package/package.json +1 -1
- package/dist/CanvasArea-UtFK5IS6.cjs +0 -58
- package/dist/CanvasArea-dkwSFbQA.js +0 -1412
- package/dist/Settings-kcmKFymH.cjs +0 -1
- package/dist/index-zkc4SQCu.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var ae=Object.create;var U=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty;var ce=(s,n,r,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of pe(n))!xe.call(s,l)&&l!==r&&U(s,l,{get:()=>n[l],enumerable:!(i=ue(n,l))||i.enumerable});return s};var me=(s,n,r)=>(r=s!=null?ae(de(s)):{},ce(n||!s||!s.__esModule?U(r,"default",{value:s,enumerable:!0}):r,s));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),m=require("react"),W=require("@react-hookz/web"),t=require("lodash"),te=require("react-i18next"),d=require("@radix-ui/react-icons"),o=require("./index-zkc4SQCu.cjs"),ge=require("@rjsf/core"),he=require("@rjsf/validator-ajv8"),ye=require("./controls-aHZq-q4b.cjs"),F=require("lucide-react"),Z=require("@chaibuilder/runtime"),O=require("./index-7NRFGya_.cjs"),je=require("jotai"),be=require("react-autosuggest"),fe=require("fuse.js"),V=require("./utils-It2K33fU.cjs"),ve=require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("flat-to-nested");require("redux-undo");require("i18next");require("clsx");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("tailwind-merge");require("react-hotkeys-hook");require("sonner");function Re(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:()=>s[r]})}}return n.default=s,Object.freeze(n)}const M=Re(m),Ee=m.lazy(()=>import("react-json-view"));function we(s){const n=[],r={};function i(l,a){t.forEach(a,(x,p)=>{const u=l?`${l}.${p}`:p,g=t.isArray(x)?"list":typeof x;n.push(u),r[u]=g==="string"?"text":g==="object"?"model":g,g==="object"&&!t.isArray(x)&&i(u,x)})}return i("",t.omit(s,["styles","_type","_id","_name","_bindings"])),{paths:n,pathsType:r}}const Y=({data:s,fullView:n})=>{if(!s)return null;const r=typeof s;return n?typeof s=="object"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"h-3"}),e.jsxRuntimeExports.jsx(O.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(Ee,{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})})},G=({type:s,value:n="",setValue:r,data:i,onChange:l,dataType:a,appliedBindings:x})=>{const{paths:p,pathsType:u}=we(i),g=s==="PROP"?Z.getBlockComponent(i==null?void 0:i._type):{},y=s==="PROP",[c,b]=m.useState(!1),j=m.useMemo(()=>s==="PROP"?p.filter(h=>!t.includes(x,h)&&t.get(g,`props.${t.first(t.split(h,"."))}.binding`)):p.filter(h=>a===t.get(u,h,"")),[s,p,x,a,g]);return m.useEffect(()=>{n&&l(n)},[n,s]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:t.startCase(t.toLower(s))}),e.jsxRuntimeExports.jsxs(o.Popover,{open:c,onOpenChange:b,children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",size:"sm",className:` ${t.isEmpty(n)?"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:n?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{className:"text-sm pr-8",children:[y&&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)}),n]}),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(o.PopoverContent,{className:"p-0 z-[999] min-w-[300px]",side:"right",align:"start",children:e.jsxRuntimeExports.jsxs(o.Command,{children:[e.jsxRuntimeExports.jsx(o.CommandInput,{placeholder:`Choose ${t.toLower(s)}...`}),e.jsxRuntimeExports.jsxs(o.CommandList,{children:[e.jsxRuntimeExports.jsx(o.CommandEmpty,{children:"No results found."}),e.jsxRuntimeExports.jsx(o.CommandGroup,{children:t.map(j,h=>e.jsxRuntimeExports.jsxs(o.CommandItem,{value:h,className:`cursor-pointer ${y?"flex justify-between items-center":"flex flex-col items-start justify-start"}`,onSelect:v=>{r(t.find(j,C=>C===v)||null),b(!1)},children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx(F.Check,{className:`w-4 h-4 text-green-500 ${n===h?"":"opacity-0"}`}),h]}),y?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(u,h,""))})}):e.jsxRuntimeExports.jsx("div",{className:"pl-6",children:e.jsxRuntimeExports.jsx(Y,{data:t.get(i,h)})})]},h))})]})]})})]})]}),!y&&!t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"pt-2",children:e.jsxRuntimeExports.jsx(Y,{data:t.get(i,n,""),fullView:!0})})]})},Ce=({appliedBindings:s=[],onAddBinding:n,editMode:r,item:i})=>{const[l,a]=m.useState(r?i.key:""),[x,p]=m.useState(r?i.value:""),u=o.useSelectedBlock(),[g]=O.useChaiExternalData(),y=m.useCallback((j,h)=>{if(t.isEmpty(j))return"";{const v=t.get(h==="PROP"?u:g,j,"");if(t.isArray(v))return"list";const C=typeof v;return C==="string"?"text":C==="object"?"model":C}},[u,g]),[c,b]=m.useState(r?y(i.key,"PROP"):"");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(o.DialogHeader,{children:[e.jsxRuntimeExports.jsx(o.DialogTitle,{children:"Add Data Binding"}),e.jsxRuntimeExports.jsx(o.DialogDescription,{className:"text-xs",children:"Add prop and path of binding. Click save when you're done."})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 relative",children:[e.jsxRuntimeExports.jsx(G,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",value:l,setValue:a,onChange:j=>{const h=y(j,"PROP");a(j),c!==h&&p(""),b(h)},data:u,dataType:c,appliedBindings:s}),e.jsxRuntimeExports.jsx("div",{className:"h-2"}),e.jsxRuntimeExports.jsx(G,{type:"PATH",isDisabled:t.isEmpty(l),placeholder:"Enter data path",value:x,setValue:p,onChange:j=>{const h=y(j,"PATH");p(c===h?j:"")},data:g,dataType:c,appliedBindings:s})]}),e.jsxRuntimeExports.jsx(o.DialogFooter,{children:e.jsxRuntimeExports.jsx(o.Button,{type:"submit",className:"mt-4",disabled:t.isEmpty(l)&&t.isEmpty(x),onClick:()=>n({key:l,value:x}),children:"Save"})})]})},se=({disabled:s,children:n,onAddBinding:r,appliedBindings:i,editMode:l=!0,item:a={}})=>{const[x,p]=m.useState(!1);return e.jsxRuntimeExports.jsxs(o.Dialog,{children:[e.jsxRuntimeExports.jsx(o.DialogTrigger,{disabled:s,asChild:!0,onClick:()=>p(!0),children:n}),x&&e.jsxRuntimeExports.jsx(o.DialogContent,{children:e.jsxRuntimeExports.jsx(Ce,{item:a,editMode:l,appliedBindings:i,onAddBinding:u=>{r(u),p(!1)}})})]})},ke=({item:s,onAddBinding:n,onRemove:r,selectedBlock:i,dataProvider:l,appliedBindings:a})=>{const[x,p]=m.useState("string"),u=(g,y)=>{if(t.isEmpty(g))return"";{const c=t.get(y==="PROP"?i:l,g,"");if(t.isArray(c))return"list";const b=typeof c;return b==="string"?"text":b==="object"?"model":b}};return m.useEffect(()=>p(()=>u(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(Y,{data:t.get(l,s.value,"")}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-2",children:[e.jsxRuntimeExports.jsx(se,{editMode:!0,onAddBinding:n,appliedBindings:a,item:s,children:e.jsxRuntimeExports.jsx(F.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(F.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(x)&&!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(x)})]})},Ne=({bindingData:s,onChange:n})=>{const r=o.useSelectedBlock(),[i]=O.useChaiExternalData(),l=Z.getChaiDataProviders(),[a,x]=m.useState(t.map(s,(c,b)=>({key:b,value:c})));m.useEffect(()=>{x(t.map(s,(c,b)=>({key:b,value:c})))},[r==null?void 0:r._id]);const p=m.useMemo(()=>{if(t.isEmpty(i))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)},[i,a]),u=c=>{const b=t.filter(a,j=>j.key!==c.key);x([...b,c]),y([...b,c])},g=c=>{const b=t.filter(a,(j,h)=>c!==h);y([...b])},y=m.useCallback((c=[])=>{if(x(c),t.isEmpty(c)){n({});return}const b={};t.forEach(c,j=>{!t.isEmpty(j==null?void 0:j.key)&&!t.isEmpty(j==null?void 0:j.value)&&t.set(b,j.key,j.value)}),n(b)},[n]);return t.isEmpty(l)?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(ke,{item:c,onAddBinding:u,onRemove:()=>g(b),selectedBlock:r,dataProvider:i,appliedBindings:t.map(a,"key")},c.key)),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(se,{disabled:p,appliedBindings:t.map(a,"key"),onAddBinding:u,children:e.jsxRuntimeExports.jsx("span",{className:`w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${p?"cursor-not-allowed bg-gray-200 text-gray-400":"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,children:t.isEmpty(i)?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"})})}),p&&e.jsxRuntimeExports.jsx(o.TooltipContent,{sideOffset:-55,className:"text-[11px]",children:t.isEmpty(i)?"No data provider has been set up for this page.":"Complete last added data binding to add more"})]})]})},Se=()=>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"}),q=m.memo(({createHistorySnapshot:s,properties:n,formData:r,onChange:i})=>{const[l]=o.useActiveLanguage(),a={type:"object",properties:{}},x={};return Object.keys(n).forEach(p=>{const u=n[p];if(t.includes(["slot","styles"],u.type))return;const g=t.get(u,"i18n",!1)?`${p}-${l}`:p;a.properties[g]=o.getBlockJSONFromSchemas(u,l),x[g]=o.getBlockJSONFromUISchemas(u,l)}),e.jsxRuntimeExports.jsx(ge,{widgets:{binding:Se,richtext:o.RichTextEditorField,icon:o.IconPickerField,image:o.ImagePickerField},fields:{link:o.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!0,validator:he,uiSchema:x,onBlur:s,schema:a,formData:r,onChange:i})});function Te(){const s=o.useSelectedBlock(),{createSnapshot:n}=o.useCanvasHistory(),r=o.useUpdateBlocksPropsRealtime(),i=Z.getBlockComponent(s._type),l={...s},a=o.useBuilderProp("dataBindingSupport",!1),x=()=>n(),p=({formData:c},b)=>{if(b){const j=b.replace("root.","");r([s._id],{[j]:t.get(c,j)})}},u={_name:ye.u({title:"Name",default:t.get(s,"_name",s._type)})},g=t.keys(t.get(l,"_bindings",{})),y=m.useMemo(()=>{const c=t.cloneDeep(t.get(i,"props",{}));return a&&t.each(g,b=>delete c[b]),c},[i,g,a]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(q,{onChange:p,createHistorySnapshot:x,formData:l,properties:u}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),a?e.jsxRuntimeExports.jsxs(o.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"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(o.AccordionContent,{className:"pt-4 px-4",children:e.jsxRuntimeExports.jsx(Ne,{bindingData:t.get(l,"_bindings",{}),onChange:c=>{p({formData:{...l,_bindings:c}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(o.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(o.AccordionContent,{className:"pt-4",children:[t.isEmpty(g)?"":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(g,t.capitalize).join(", ")})," ",g.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(q,{onChange:p,createHistorySnapshot:x,formData:l,properties:y})]})]})]}):e.jsxRuntimeExports.jsx(q,{onChange:p,createHistorySnapshot:x,formData:l,properties:y}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const K=new fe(V.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function Ie(){var S;const[s]=o.useSelectedStylingBlocks(),n=o.useSelectedBlock(),r=o.useAddClassesToBlocks(),i=o.useRemoveClassesFromBlocks(),[l]=o.useSelectedBlockIds(),[a,x]=m.useState(""),p=(S=t.first(s))==null?void 0:S.prop,u=t.reject((t.get(n,p,"").replace(ve.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),g=()=>{const E=a.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");r(l,E,!0),x("")},[y,c]=m.useState([]),b=({value:E})=>{const B=E.trim().toLowerCase(),T=B.match(/.+:/g);let w=[];if(T&&T.length>0){const[I]=T,H=B.replace(I,"");w=K.search(H).map(f=>({...f,item:{...f.item,name:I+f.item.name}}))}else w=K.search(B);c(t.map(w,"item"))},j=()=>{c([])},h=E=>E.name,v=E=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:E.name}),C={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:a,onKeyDown:E=>{E.key==="Enter"&&a.trim()!==""&&g()},onChange:(E,{newValue:B})=>x(B),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 ${y.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(o.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(be,{suggestions:y,onSuggestionsFetchRequested:b,onSuggestionsClearRequested:j,getSuggestionValue:h,renderSuggestion:v,inputProps:C,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:g,disabled:a.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(d.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(u)&&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"}),M.Children.toArray(u.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(d.Cross2Icon,{onClick:()=>i(l,[E]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},E)))]})]})}const N=["px","%","em","rem","ch","vh","vw"],Be={heading:"Flex Child",items:[{type:"arbitrary",label:"Basis",units:N,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"}]},Ae={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"}]},He=[{heading:"Layout",items:[{type:"arbitrary",label:"Width",units:N.concat("auto"),property:"width"},{type:"arbitrary",label:"Height",units:N.concat("auto"),property:"height"},{styleType:"multiple",label:"Margin",negative:!0,units:[...N,"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 Bt.",options:[{key:"spaceX",label:"Left-Right"},{key:"spaceY",label:"Top-Bottom"}]}]},{heading:"Size",items:[{styleType:"accordion",heading:"Min width & height",items:[{type:"arbitrary",label:"Min Width",units:N.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"Min Height",units:N.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"Max width & height",items:[{type:"arbitrary",label:"Max Width",units:N.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"Max Height",units:N.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:"Display",items:[{type:"dropdown",label:"Display",property:"display",units:N},{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:N},{type:"arbitrary",label:"Opacity",property:"opacity",units:["-"]}]}]},{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:N},{type:"arbitrary",property:"lineHeight",label:"Height",units:N.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:Ie}]}],re={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:d.EyeOpenIcon,invisible:d.EyeClosedIcon,hidden:d.EyeClosedIcon,gap:d.BorderAllIcon,gapX:d.WidthIcon,gapY:d.HeightIcon,spaceX:d.WidthIcon,spaceY:d.HeightIcon,overscroll:d.BorderAllIcon,overscrollX:d.WidthIcon,overscrollY:d.HeightIcon,overflow:d.BorderAllIcon,overflowX:d.WidthIcon,overflowY:d.HeightIcon,top:d.ArrowUpIcon,right:d.ArrowRightIcon,bottom:d.ArrowDownIcon,left:d.ArrowLeftIcon,inset:d.BorderAllIcon,insetX:d.WidthIcon,insetY:d.HeightIcon,border:d.BorderAllIcon,borderX:d.WidthIcon,borderY:d.HeightIcon,borderTop:d.ArrowUpIcon,borderRight:d.ArrowRightIcon,borderBottom:d.ArrowDownIcon,borderLeft:d.ArrowLeftIcon,borderRadius:d.BorderAllIcon,borderRadiusX:d.WidthIcon,borderRadiusY:d.HeightIcon,borderRadiusTop:d.ArrowUpIcon,borderRadiusRight:d.ArrowRightIcon,borderRadiusBottom:d.ArrowDownIcon,borderRadiusLeft:d.ArrowLeftIcon,borderRadiusTopLeft:d.ArrowTopLeftIcon,borderRadiusTopRight:d.ArrowTopRightIcon,borderRadiusBottomRight:d.ArrowBottomRightIcon,borderRadiusBottomLeft:d.ArrowBottomLeftIcon,divideXWidth:d.WidthIcon,divideYWidth:d.HeightIcon,scale:d.BorderAllIcon,scaleX:d.WidthIcon,scaleY:d.HeightIcon,skewX:d.WidthIcon,skewY:d.HeightIcon,translateX:d.WidthIcon,translateY:d.HeightIcon,padding:d.BorderAllIcon,paddingX:d.WidthIcon,paddingY:d.HeightIcon,paddingTop:d.ArrowUpIcon,paddingRight:d.ArrowRightIcon,paddingBottom:d.ArrowDownIcon,paddingLeft:d.ArrowLeftIcon,margin:d.BorderAllIcon,marginX:d.WidthIcon,marginY:d.HeightIcon,marginTop:d.ArrowUpIcon,marginRight:d.ArrowRightIcon,marginBottom:d.ArrowDownIcon,marginLeft:d.ArrowLeftIcon,textLeft:d.AlignLeftIcon,textCenter:d.AlignCenterHorizontallyIcon,textRight:d.AlignRightIcon,textJustify:d.StretchHorizontallyIcon,italic:d.FontItalicIcon,underline:d.UnderlineIcon,overline:d.OverlineIcon,uppercase:d.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":d.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:d.Cross1Icon},L=m.createContext({canReset:!1,canChange:!0}),Ve=({children:s,canReset:n=!1,canChange:r=!0})=>e.jsxRuntimeExports.jsx(L.Provider,{value:{canReset:n,canChange:r},children:s}),oe=({label:s,property:n,onChange:r})=>{const i=m.useMemo(()=>t.get(V.CLASSES_LIST,`${n}.classes`,[""]),[n]),l=P(n),a=m.useMemo(()=>t.get(l,"cls",""),[l]),{canChange:x}=m.useContext(L),p=/\[.*\]/g.test(a);return e.jsxRuntimeExports.jsx("div",{className:s?"w-full rounded ":"grow",children:p?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(o.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:a}),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(d.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(X,{rounded:s,onChange:u=>r(u,n),selected:a,options:i,disabled:!x})})};function X({selected:s,onChange:n,rounded:r=!1,options:i,disabled:l=!1}){const a=s.replace(/.*:/g,"").trim(),{undo:x,redo:p}=o.useCanvasHistory();return e.jsxRuntimeExports.jsxs("select",{disabled:!i.length||l,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:u=>n(u.target.value),onKeyDown:u=>{u.ctrlKey&&(u.key==="z"&&x(),u.key==="y"&&p())},value:a,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),m.Children.toArray(i.map(u=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:u,children:u})))]})}const De=({property:s,onChange:n})=>{const{canReset:r,canChange:i}=m.useContext(L),l=P(s),a=m.useMemo(()=>t.get(l,"cls",""),[l]),x=m.useMemo(()=>t.get(V.CLASSES_LIST,`${s}.classes`,[""]),[s]),p=x.indexOf(a)>-1?x.indexOf(a):0,u=/\[.*\]/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:u?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:!i&&(!r||p-1<0),onClick:()=>n(t.nth(x,p-1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(d.MinusIcon,{className:!i&&(!r||p-1<0)?"text-gray-500":"text-black/60 dark:text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(oe,{label:!1,property:s,onChange:n})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!i&&(!r||p+1>=x.length),onClick:()=>n(t.nth(x,p+1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(d.PlusIcon,{className:!i&&(!r||p+1>=x.length)?"text-gray-500":"text-black/60 dark:text-white/60"})})})]})})},Le=({property:s,onChange:n})=>{const r=m.useMemo(()=>t.get(V.CLASSES_LIST,`${s}.classes`,[""]),[s]),{canChange:i}=m.useContext(L),l=P(s),a=m.useMemo(()=>t.get(l,"cls",""),[l]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(r,x=>e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!i,onClick:()=>n(x,s),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${a===x?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:m.createElement(t.get(re,x,d.BoxIcon))})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(x))})]}))})},Pe={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},$e=({property:s,onChange:n})=>{const r=P(s),i=m.useMemo(()=>t.get(r,"cls",""),[r]),{canChange:l}=m.useContext(L),[a,x]=m.useState([]),[p,u]=m.useState({color:"",shade:""}),g=i.split("-"),y=t.get(g,"1",""),c=t.get(g,"2",""),b=m.useCallback(h=>{["current","inherit","transparent","black","white"].includes(h)?(x([]),u({color:h})):(x(["50","100","200","300","400","500","600","700","800","900"]),u(v=>({...v,color:h,shade:v.shade?v.shade:"500"})))},[x,u]);m.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(y))return x([]);x(["50","100","200","300","400","500","600","700","800","900"])},[y]);const j=m.useCallback(h=>{u({color:y,shade:h})},[y]);return m.useEffect(()=>{u({color:"",shade:""})},[r]),m.useEffect(()=>{const v=`${t.get(Pe,s,"")}-${p.color}${p.shade?`-${p.shade}`:""}`;v.match(new RegExp(t.get(V.CLASSES_LIST,`${s}.regExp`,"")))&&n(v,s)},[p,n,s]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(X,{disabled:!l,rounded:!0,selected:y,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(X,{rounded:!0,selected:c,disabled:!y||!l,onChange:j,options:a})})]})},J=(s,n)=>{s=s.toLowerCase();let r=s.trim().replace(/ |\+/g,"");if((r==="auto"||r==="none")&&n.includes(r))return{value:"",unit:r};const i=n.length?new RegExp(n.join("|"),"g"):/XXXXXX/g;r=r.replace(i,"");const l=s.match(i),a=l&&l.length>1,x=!t.isEmpty(r)&&Number.isNaN(Number(r));return a||x?{error:"Invalid value"}:l&&(l[0]==="auto"||l[0]==="none")?{value:l[0],unit:""}:{value:r,unit:l?l[0]:""}};const Me=s=>{const n=s.startsWith("-")?"-":"",r=s.split("-").pop();if(["auto","none"].includes(r))return{value:"",unit:r};if(r==="px")return{value:"1",unit:"px"};if(r==="screen")return{value:"100",unit:s.indexOf("w-")!==-1?"vw":"vh"};if(r==="full")return{value:"100",unit:"%"};if(t.includes(s,"skew-"))return{value:`${n}${r}`,unit:"deg"};if(t.includes(s,"rotate-"))return{value:`${n}${r}`,unit:"deg"};if(t.includes(s,"opacity-"))return{value:`${r/100}`,unit:"-"};if(t.includes(s,"duration-")||t.includes(s,"delay-"))return{value:`${r}`,unit:"ms"};if(t.includes(s,"translate-")&&!r.includes("/"))return{value:`${n}${`${r/4}`}`,unit:"rem"};if(t.includes(s,"scale-"))return{value:`${n}${`${r/100}`}`,unit:"-"};if(t.startsWith(s,"border")){const i=s.match(/border-?(x|y|t|r|b|l)?\d+/g);if(i)return{value:i[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[i,l]=t.map(r.split("/"),a=>parseInt(a,10));return{value:n+(i/l*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(r))?{value:`${n+parseFloat(r)*4}`,unit:"px"}:{value:r,unit:"class"}};const Oe=s=>{if(t.isEmpty(s))return{value:"",unit:""};const n=s.match(/\[.*\]/g);if(n===null)return qe(s);const r=t.get(n,"0","").replace(/\[|\]/g,""),i=s.startsWith("-")?"-":"",l=t.first(r.match(/\d+.\d+|\d+/g));return{value:`${i}${l}`,unit:r.replace(l,"")}},qe=s=>t.isEmpty(s)?{value:"",unit:""}:Me(s),ne=m.createContext({setDragData:()=>{}}),_e=({unit:s,currentValue:n,onDrag:r,onDragEnd:i,onDragStart:l,negative:a,cssProperty:x})=>{const{setDragData:p}=m.useContext(ne);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:u=>{const g={onDrag:r,onDragEnd:i,dragging:!0,dragStartY:u.pageY,dragStartValue:`${n}`,dragUnit:s,negative:a,cssProperty:x};l(g),p(g)},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(d.RowSpacingIcon,{})})},We=({onSelect:s,current:n,units:r})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:r.map(i=>e.jsxRuntimeExports.jsx(o.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:n===i?"primary":void 0,size:"sm",onClick:l=>{l.stopPropagation(),s(i)},children:i},i))}),Q=50,Fe=s=>{const[n,r]=m.useState(!1),[i,l]=m.useState(""),{currentClass:a,onChange:x,classPrefix:p,cssProperty:u,units:g,negative:y}=s,[c,b]=m.useState(u!=null&&u.toLowerCase().includes("width")?"%":g[0]),[j,h]=m.useState(!1),[v,C]=m.useState(""),[S,E]=m.useState(!1),[B,T]=m.useState(!1);m.useEffect(()=>{const{value:f,unit:R}=Oe(a);if(R===""){l(f),b(u!=null&&u.toLowerCase().includes("width")?"%":t.first(g));return}b(R),l(R==="class"||t.isEmpty(f)?"":f)},[a,u,g]);const w=W.useThrottledCallback(f=>x(f),[x],Q),I=W.useThrottledCallback(f=>x(f,!1),[x],Q),H=m.useCallback((f=!1)=>{const R=J(`${i}`,g);if(t.get(R,"error",!1)){h(!0);return}const k=t.get(R,"unit")!==""?t.get(R,"unit"):c;if(k==="auto"||k==="none"){w(`${p}${k}`);return}if(t.get(R,"value")==="")return;const D=`${t.get(R,"value","").startsWith("-")?"-":""}${p}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;f?I(D):w(D)},[w,I,i,c,p,g]),$=m.useCallback(f=>{const R=J(`${i}`,g);if(t.get(R,"error",!1)){h(!0);return}if(f==="auto"||f==="none"){w(`${p}${f}`);return}if(t.get(R,"value")==="")return;const k=t.get(R,"unit")!==""?t.get(R,"unit"):f,D=`${t.get(R,"value","").startsWith("-")?"-":""}${p}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;w(D)},[w,i,p,g]);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(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(d.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${S?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(c)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:c==="class",onKeyPress:f=>{f.key==="Enter"&&H()},onKeyDown:f=>{if(f.keyCode!==38&&f.keyCode!==40)return;f.preventDefault(),T(!0);const R=t.parseInt(f.target.value);let k=t.isNaN(R)?0:R;f.keyCode===38&&(k+=1),f.keyCode===40&&(k-=1);const A=`${k}`,le=`${A.startsWith("-")?"-":""}${p}[${A.replace("-","")}${c==="-"?"":c}]`;I(le)},onKeyUp:f=>{B&&(f.preventDefault(),T(!1))},onBlur:()=>H(),onChange:f=>{h(!1),l(f.target.value)},onClick:f=>{var R;(R=f==null?void 0:f.target)==null||R.select(),r(!1)},value:S?v:i,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",j?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(o.Tooltip,{open:n,delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>r(!n),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${g.length===1?"px-2 font-semibold":""}`,children:c}),g.length>1?e.jsxRuntimeExports.jsx(d.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(o.TooltipPortal,{children:e.jsxRuntimeExports.jsx(o.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(We,{units:g,current:c,onSelect:f=>{r(!1),b(f),$(f)}})})})]})]}),["none","auto"].indexOf(c)!==-1||S?null:e.jsxRuntimeExports.jsx(_e,{onDragStart:()=>E(!0),onDragEnd:f=>{if(C(()=>""),E(!1),t.isEmpty(f))return;const R=`${f}`,A=`${R.startsWith("-")?"-":""}${p}[${R.replace("-","")}${c==="-"?"":c}]`;w(A)},onDrag:f=>{if(t.isEmpty(f))return;C(f);const R=`${f}`,A=`${R.startsWith("-")?"-":""}${p}[${R.replace("-","")}${c==="-"?"":c}]`;I(A)},currentValue:i,unit:c,negative:y,cssProperty:u})]})})})},P=s=>{const n=o.useSelectedBlockCurrentClasses();return t.findLast(n,{property:s})},Ye=(s,n)=>{const r={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return r[t.get(s,"mq","xs")]<=r[n]},Xe={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-"},ee={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},Ze=s=>`${s.toUpperCase()} ${ee[s]?`(${ee[s]} & up)`:""}`,z=s=>{const{type:n="icons",label:r,property:i,onEmitChange:l=()=>{},units:a,negative:x=!1}=s,[p]=o.useDarkMode(),[u]=o.useStylingState(),[,g]=o.useCanvasWidth(),y=P(i),c=o.useAddClassesToBlocks(),b=o.useRemoveClassesFromBlocks(),[j]=o.useSelectedBlockIds(),h=m.useMemo(()=>t.get(y,"fullCls",""),[y]),v=m.useCallback((w,I=!0)=>{const H={dark:p,mq:g,mod:u,cls:w,property:i,fullCls:""};(p||u!=="")&&(H.mq="xs");const $=V.generateFullClsName(H);c(j,[$],I)},[j,p,g,u,i,c]),C=m.useCallback(()=>{b(j,[h])},[j,h,b]),S=m.useMemo(()=>Ye(y,g),[y,g]);m.useEffect(()=>{l(S,y)},[S,l,y]);const[,,E]=o.useCanvasWidth(),B=m.useCallback(w=>{E({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[w])},[E]),T=t.get(y,"dark",null)===p&&t.get(y,"mod",null)===u&&t.get(y,"mq",null)===g;return e.jsxRuntimeExports.jsx(Ve,{canChange:S,canReset:y&&T,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] ${y&&!T?"text-foreground":""}`,children:r})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[n==="arbitrary"?e.jsxRuntimeExports.jsx(Fe,{currentClass:t.get(y,"cls",""),classPrefix:t.get(Xe,i,""),units:a||[],onChange:v,negative:x,cssProperty:i}):null,n==="icons"&&e.jsxRuntimeExports.jsx(Le,{property:i,onChange:v}),n==="range"&&e.jsxRuntimeExports.jsx(De,{property:i,onChange:v}),n==="color"&&e.jsxRuntimeExports.jsx($e,{property:i,onChange:v}),n==="dropdown"&&e.jsxRuntimeExports.jsx(oe,{label:r,property:i,onChange:v})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${h?"visible":"invisible"}`,children:T?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>C(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(d.CrossCircledIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):S&&y?e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(d.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold ",children:[Ze(t.get(y,"mq")),p&&!y.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>B(t.get(y,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(y,"mq").toUpperCase()]})]})})})]}):null})]})]})})},ze=["px","%","em","rem","ch","vh","vw"],ie=({label:s,options:n,borderB:r=!1,borderT:i=!1,type:l="arbitrary",units:a=ze,negative:x=!1})=>{const[p,u]=m.useState(n[0].key),g=o.useSelectedBlockCurrentClasses(),y=m.useCallback(c=>t.map(g,"property").includes(c),[g]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r?"border-b":""} ${i?"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:m.Children.toArray(n.map(({label:c,key:b})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>u(b),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${b===p?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[m.createElement("div",{className:y(b)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),m.createElement(t.get(re,b,d.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(c))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(z,{type:l,units:[...a],label:"",property:p,negative:x})})]})},Ue=({heading:s,items:n})=>{const r=o.useSelectedBlockCurrentClasses(),i=m.useMemo(()=>{const l=p=>t.flatten(p.map(u=>u.styleType==="multiple"?t.map(u.options,"key"):u.property)),a=t.flatten(n.map(p=>p.styleType==="accordion"?l(p.items):p.styleType==="multiple"?t.map(p.options,"key"):p.property)),x=t.map(r,"property");return t.intersection(a,x).length>0},[r,n]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[s,i?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:n.map(l=>l.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...l},l.label):e.jsxRuntimeExports.jsx(z,{...l},l.label))})]})},Ge=m.createContext({}),_=({section:s})=>{const n=o.useSelectedBlockCurrentClasses(),r=m.useCallback((a=[])=>{const x={};for(let u=0;u<n.length;u++)x[n[u].property]=n[u].cls;let p=!0;for(const u in a)if(!t.has(x,u)||x[u]!==a[u]){p=!1;break}return p},[n]),i=m.useMemo(()=>{if(n.length>0&&s.heading==="Classes")return!0;const a=u=>t.flatten(u.map(g=>g.styleType==="multiple"?t.flatten(t.map(g.options,"key")):g.property)),x=t.flatten(s.items.map(u=>u.styleType==="accordion"?a(u.items):u.styleType==="multiple"?t.flatten(t.map(u.options,"key")):u.property)),p=t.map(n,"property");return t.intersection(x,p).length>0},[n,s.heading,s.items]),l=m.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(Ge.Provider,{value:l,children:e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}),s.heading]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:m.Children.toArray(s.items.map(a=>t.has(a,"component")?m.createElement(a.component,{key:a.label}):t.has(a,"styleType")?a.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...a},a.label):a.styleType==="accordion"&&r(a==null?void 0:a.conditions)?e.jsxRuntimeExports.jsx(Ue,{...a},a.label):null:e.jsxRuntimeExports.jsx(z,{...a},a.label)))})]})})},Ke=({item:s,index:n,canDelete:r,onChange:i,onRemove:l})=>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=>i(a,n),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)?{}:i(a,n),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(d.TrashIcon,{onClick:l,className:"h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"})]})]}),Je=({section:s})=>{var b;const{setSyncState:n}=o.useSavePage(),r=o.useSelectedBlock(),[i,l]=m.useState([]),[a]=o.useSelectedStylingBlocks(),x=o.useUpdateBlocksPropsRealtime(),p=`${t.get(a,"0.prop")}_attrs`;M.useEffect(()=>{const j=t.map(t.get(r,p),(h,v)=>({key:v,value:h}));t.isEmpty(j)?l([]):l(j)},[t.get(r,p)]);const u=()=>l([...i,{key:"",value:""}]),g=j=>{const h=t.filter(i,(v,C)=>j!==C);c(h)},y=(j,h)=>{const v=[...i];v[h][j.target.name]=j.target.value,c(v)},c=M.useCallback((j=[])=>{const h={};t.forEach(j,v=>{t.isEmpty(v.key)||t.set(h,v.key,v.value)}),x([t.get(r,"_id")],{[p]:h}),n("UNSAVED")},[r,n,x,p]);return e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(r,p))?"bg-gray-300":"bg-blue-500"}`}),"Attributes"]})}),e.jsxRuntimeExports.jsx(o.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(o.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(i)&&t.isEmpty((b=t.last(i))==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 j;!t.isEmpty(i)&&t.isEmpty((j=t.last(i))==null?void 0:j.key)||u()},children:[e.jsxRuntimeExports.jsx(d.PlusIcon,{width:12,height:12})," Add"]})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[t.isEmpty(i)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-12 items-center justify-center text-sm text-gray-400",children:"Click + Add to add attributes"}),M.Children.toArray(t.map(i,(j,h)=>{const v=i.length>0&&h<i.length-1;return e.jsxRuntimeExports.jsx(Ke,{item:j,index:h,canDelete:v,onChange:y,onRemove:()=>g(h)})}))]})]})})]})};function Qe(){const[s,n]=o.useStylingState(),{flexChild:r,gridChild:i}=o.useSelectedBlocksDisplayChild(),[,l]=je.useAtom(o.advanceStylingOpenAtom),{t:a}=te.useTranslation(),[x]=o.useSelectedStylingBlocks();return t.isEmpty(x)?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(d.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:()=>l(!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(o.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(o.Select,{defaultValue:s,onValueChange:p=>n(p),children:[e.jsxRuntimeExports.jsx(o.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(o.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(o.SelectContent,{children:[e.jsxRuntimeExports.jsx(o.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),e.jsxRuntimeExports.jsxs(o.ScrollArea,{className:"no-scrollbar -mx-1 h-full overflow-x-hidden",children:[e.jsxRuntimeExports.jsxs(o.Accordion,{defaultValue:["Layout"],type:"multiple",className:"h-full w-full",children:[r&&e.jsxRuntimeExports.jsx(_,{section:Be}),i?e.jsxRuntimeExports.jsx(_,{section:Ae}):null,He.map(p=>e.jsxRuntimeExports.jsx(_,{section:p},p.heading)),e.jsxRuntimeExports.jsx(Je,{section:{heading:"Attributes"}})]}),e.jsxRuntimeExports.jsx("div",{className:"h-60"})]})]})}const et={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},tt=()=>{const s=o.useSelectedBlock(),{t:n}=te.useTranslation(),[r,i]=m.useState(""),[l,a]=m.useState({onDrag:u=>u,onDragEnd:u=>u,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),x=W.useThrottledCallback(u=>{const g=!t.get(l,"negative",!1),y=t.get(l,"cssProperty","");let c=parseFloat(l.dragStartValue);c=t.isNaN(c)?0:c;let b=et[l.dragUnit];(t.startsWith(y,"scale")||y==="opacity")&&(b=10);let h=(l.dragStartY-u.pageY)/b+c;g&&h<0&&(h=0),y==="opacity"&&h>1&&(h=1),l.onDrag(`${h}`),i(`${h}`)},[l],50),p=m.useCallback(()=>{setTimeout(()=>l.onDragEnd(`${r}`),100),a({onDrag:u=>u,onDragEnd:u=>u,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[l,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(d.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:n("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsx(O.ErrorBoundary,{children:e.jsxRuntimeExports.jsxs(ne.Provider,{value:{setDragData:a},children:[l.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:x,onMouseUp:()=>p(),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(Te,{})}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"styling",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Qe,{})})]})]})})};exports.default=tt;
|
package/dist/index-zkc4SQCu.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("./jsx-runtime-WUGKV8jN.cjs"),w=require("react"),pn=require("@radix-ui/react-toggle"),re=require("class-variance-authority"),c=require("./utils-It2K33fU.cjs"),fn=require("@radix-ui/react-switch"),xn=require("@radix-ui/react-slot"),gn=require("@radix-ui/react-accordion"),O=require("@radix-ui/react-icons"),bn=require("@radix-ui/react-alert-dialog"),hn=require("@radix-ui/react-dialog"),vn=require("@radix-ui/react-label"),yn=require("@radix-ui/react-scroll-area"),jn=require("@radix-ui/react-tabs"),wn=require("@radix-ui/react-tooltip"),Rn=require("@radix-ui/react-popover"),kn=require("@radix-ui/react-menubar"),An=require("@radix-ui/react-hover-card"),Nn=require("@radix-ui/react-select"),Sn=require("@radix-ui/react-dropdown-menu"),Cn=require("@radix-ui/react-separator"),En=require("@radix-ui/react-toast"),F=require("cmdk"),_n=require("@radix-ui/react-context-menu"),vt=require("react-icons-picker"),Bn=require("react-dom"),i=require("lodash"),Pn=require("react-quill"),d=require("jotai"),yt=require("flat-to-nested"),fe=require("redux-undo"),$=require("./MODIFIERS-WFzDQfiT.cjs"),Tn=require("@chaibuilder/runtime"),In=require("@react-hookz/web");require("react-i18next");function D(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const x=D(w),jt=D(pn),Oe=D(fn),ae=D(gn),V=D(bn),_=D(hn),wt=D(vn),oe=D(yn),ie=D(jn),de=D(wn),ge=D(Rn),C=D(kn),Ae=D(An),M=D(Nn),B=D(Sn),Rt=D(Cn),U=D(En),P=D(_n);var L={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let Mn=0;function K(e,t){const s=`atom${++Mn}`,o={toString:()=>s};return typeof e=="function"?o.read=e:(o.init=e,o.read=a=>a(o),o.write=(a,r,l)=>r(o,typeof l=="function"?l(a(o)):l)),t&&(o.write=t),o}const Te=e=>"init"in e,Ie=e=>!!e.write,je=new WeakMap,Dn=(e,t)=>{je.set(e,t),e.catch(()=>{}).finally(()=>je.delete(e))},at=(e,t)=>{const s=je.get(e);s&&(je.delete(e),s(t))},rt=(e,t)=>{e.status="fulfilled",e.value=t},it=(e,t)=>{e.status="rejected",e.reason=t},Ln=e=>typeof(e==null?void 0:e.then)=="function",pe=(e,t)=>"v"in e&&"v"in t&&Object.is(e.v,t.v),lt=(e,t)=>"e"in e&&"e"in t&&Object.is(e.e,t.e),ce=e=>"v"in e&&e.v instanceof Promise,On=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,he=e=>{if("e"in e)throw e.e;return e.v},kt=()=>{const e=new WeakMap,t=new WeakMap,s=new Map;let o,a,r;(L?"production":void 0)!=="production"&&(o=new Set,a=new Set,r=new Set);const l=m=>e.get(m),p=(m,b)=>{(L?"production":void 0)!=="production"&&Object.freeze(b);const y=e.get(m);if(e.set(m,b),s.has(m)||s.set(m,y),y&&ce(y)){const h="v"in b?b.v instanceof Promise?b.v:Promise.resolve(b.v):Promise.reject(b.e);at(y.v,h)}},f=(m,b,y)=>{const h=new Map;let j=!1;y.forEach((v,k)=>{!v&&k===m&&(v=b),v?(h.set(k,v),b.d.get(k)!==v&&(j=!0)):(L?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(j||b.d.size!==h.size)&&(b.d=h)},u=(m,b,y)=>{const h=l(m),j={d:(h==null?void 0:h.d)||new Map,v:b};if(y&&f(m,j,y),h&&pe(h,j)&&h.d===j.d)return h;if(h&&ce(h)&&ce(j)&&On(h,j)){if(h.d===j.d)return h;j.v=h.v}return p(m,j),j},g=(m,b,y,h)=>{if(Ln(b)){let j;const v=new Promise((k,T)=>{let N=!1;b.then(E=>{if(!N){N=!0;const S=l(m),J=u(m,v,y);rt(v,E),k(E),(S==null?void 0:S.d)!==J.d&&q(m,J,S==null?void 0:S.d)}},E=>{if(!N){N=!0;const S=l(m),J=u(m,v,y);it(v,E),T(E),(S==null?void 0:S.d)!==J.d&&q(m,J,S==null?void 0:S.d)}}),j=E=>{N||(N=!0,E.then(S=>rt(v,S),S=>it(v,S)),k(E))}});return v.orig=b,v.status="pending",Dn(v,k=>{k&&j(k),h==null||h()}),u(m,v,y)}return u(m,b,y)},R=(m,b,y)=>{const h=l(m),j={d:(h==null?void 0:h.d)||new Map,e:b};return y&&f(m,j,y),h&<(h,j)&&h.d===j.d?h:(p(m,j),j)},A=m=>{const b=l(m);if(b&&(b.d.forEach((N,E)=>{E!==m&&!t.has(E)&&A(E)}),Array.from(b.d).every(([N,E])=>{const S=l(N);return N===m||S===E||S&&!ce(S)&&pe(S,E)})))return b;const y=new Map;let h=!0;const j=N=>{if(N===m){const S=l(N);if(S)return y.set(N,S),he(S);if(Te(N))return y.set(N,void 0),N.init;throw new Error("no atom init")}const E=A(N);return y.set(N,E),he(E)};let v,k;const T={get signal(){return v||(v=new AbortController),v.signal},get setSelf(){return(L?"production":void 0)!=="production"&&!Ie(m)&&console.warn("setSelf function cannot be used with read-only atom"),!k&&Ie(m)&&(k=(...N)=>{if((L?"production":void 0)!=="production"&&h&&console.warn("setSelf function cannot be called in sync"),!h)return Q(m,...N)}),k}};try{const N=m.read(j,T);return g(m,N,y,()=>v==null?void 0:v.abort())}catch(N){return R(m,N,y)}finally{h=!1}},I=m=>he(A(m)),z=m=>{let b=t.get(m);return b||(b=Y(m)),b},W=(m,b)=>!b.l.size&&(!b.t.size||b.t.size===1&&b.t.has(m)),X=m=>{const b=t.get(m);b&&W(m,b)&&se(m)},le=m=>{const b=new Map,y=new WeakMap,h=v=>{const k=t.get(v);k==null||k.t.forEach(T=>{T!==v&&(b.set(T,(b.get(T)||new Set).add(v)),y.set(T,(y.get(T)||0)+1),h(T))})};h(m);const j=v=>{const k=t.get(v);k==null||k.t.forEach(T=>{var N;if(T!==v){let E=y.get(T);if(E&&y.set(T,--E),!E){let S=!!((N=b.get(T))!=null&&N.size);if(S){const J=l(T),mn=A(T);S=!J||!pe(J,mn)}S||b.forEach(J=>J.delete(T))}j(T)}})};j(m)},Z=(m,...b)=>{let y=!0;const h=k=>he(A(k)),j=(k,...T)=>{let N;if(k===m){if(!Te(k))throw new Error("atom not writable");const E=l(k),S=g(k,T[0]);(!E||!pe(E,S))&&le(k)}else N=Z(k,...T);if(!y){const E=ee();(L?"production":void 0)!=="production"&&a.forEach(S=>S({type:"async-write",flushed:E}))}return N},v=m.write(h,j,...b);return y=!1,v},Q=(m,...b)=>{const y=Z(m,...b),h=ee();return(L?"production":void 0)!=="production"&&a.forEach(j=>j({type:"write",flushed:h})),y},Y=(m,b)=>{const y={t:new Set(b&&[b]),l:new Set};if(t.set(m,y),(L?"production":void 0)!=="production"&&r.add(m),A(m).d.forEach((h,j)=>{const v=t.get(j);v?v.t.add(m):j!==m&&Y(j,m)}),A(m),Ie(m)&&m.onMount){const h=m.onMount((...j)=>Q(m,...j));h&&(y.u=h)}return y},se=m=>{var b;const y=(b=t.get(m))==null?void 0:b.u;y&&y(),t.delete(m),(L?"production":void 0)!=="production"&&r.delete(m);const h=l(m);h?(ce(h)&&at(h.v),h.d.forEach((j,v)=>{if(v!==m){const k=t.get(v);k&&(k.t.delete(m),W(v,k)&&se(v))}})):(L?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",m)},q=(m,b,y)=>{const h=new Set(b.d.keys());y==null||y.forEach((j,v)=>{if(h.has(v)){h.delete(v);return}const k=t.get(v);k&&(k.t.delete(m),W(v,k)&&se(v))}),h.forEach(j=>{const v=t.get(j);v?v.t.add(m):t.has(m)&&Y(j,m)})},ee=()=>{let m;for((L?"production":void 0)!=="production"&&(m=new Set);s.size;){const b=Array.from(s);s.clear(),b.forEach(([y,h])=>{const j=l(y);if(j){j.d!==(h==null?void 0:h.d)&&q(y,j,h==null?void 0:h.d);const v=t.get(y);v&&!(h&&!ce(h)&&(pe(h,j)||lt(h,j)))&&(v.l.forEach(k=>k()),(L?"production":void 0)!=="production"&&m.add(y))}else(L?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((L?"production":void 0)!=="production")return o.forEach(b=>b("state")),m},te=(m,b)=>{const y=z(m),h=ee(),j=y.l;return j.add(b),(L?"production":void 0)!=="production"&&(o.forEach(v=>v("sub")),a.forEach(v=>v({type:"sub",flushed:h}))),()=>{j.delete(b),X(m),(L?"production":void 0)!=="production"&&(o.forEach(v=>v("unsub")),a.forEach(v=>v({type:"unsub"})))}};return(L?"production":void 0)!=="production"?{get:I,set:Q,sub:te,dev_subscribe_store:(m,b)=>b!==2?(console.warn("The current StoreListener revision is 2. The older ones are deprecated."),o.add(m),()=>{o.delete(m)}):(a.add(m),()=>{a.delete(m)}),dev_get_mounted_atoms:()=>r.values(),dev_get_atom_state:m=>e.get(m),dev_get_mounted:m=>t.get(m),dev_restore_atoms:m=>{for(const[y,h]of m)Te(y)&&(g(y,h),le(y));const b=ee();a.forEach(y=>y({type:"restore",flushed:b}))}}:{get:I,set:Q,sub:te}};let Me;const Vn=()=>(Me||(Me=kt()),Me);var zn={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const $n=w.createContext(void 0),Fe=e=>{const t=w.useContext($n);return(e==null?void 0:e.store)||t||Vn()};const Fn=e=>typeof(e==null?void 0:e.then)=="function",qn=w.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)});function At(e,t){const s=Fe(t),[[o,a,r],l]=w.useReducer(u=>{const g=s.get(e);return Object.is(u[0],g)&&u[1]===s&&u[2]===e?u:[g,s,e]},void 0,()=>[s.get(e),s,e]);let p=o;(a!==s||r!==e)&&(l(),p=s.get(e));const f=t==null?void 0:t.delay;return w.useEffect(()=>{const u=s.sub(e,()=>{if(typeof f=="number"){setTimeout(l,f);return}l()});return l(),u},[s,e,f]),w.useDebugValue(p),Fn(p)?qn(p):p}function Nt(e,t){const s=Fe(t);return w.useCallback((...a)=>{if((zn?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return s.set(e,...a)},[s,e])}function Un(e,t){return[At(e,t),Nt(e,t)]}var qe={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const St=Symbol();function Gn(e,t){const s=K(e,(o,a,r)=>a(s,t(o(s),r)));return s}const ct=(e,t,s)=>(t.has(s)?t:t.set(s,e())).get(s),Hn=new WeakMap,Wn=(e,t,s)=>{const o=ct(()=>new WeakMap,Hn,t);return ct(e,o,s)},Yn={},dt=e=>!!e.write,Kn=e=>typeof e=="function";function Jn(e,t){return Wn(()=>{const s=new WeakMap,o=(l,p)=>{let f=s.get(l);if(f)return f;const u=p&&s.get(p),g=[],R=[];return l.forEach((A,I)=>{const z=t?t(A):I;R[I]=z;const W=u&&u.atomList[u.keyList.indexOf(z)];if(W){g[I]=W;return}const X=Z=>{const Q=Z(a),Y=Z(e),q=o(Y,Q==null?void 0:Q.arr).keyList.indexOf(z);if(q<0||q>=Y.length){const ee=l[o(l).keyList.indexOf(z)];if(ee)return ee;throw new Error("splitAtom: index out of bounds for read")}return Y[q]},le=(Z,Q,Y)=>{const se=Z(a),q=Z(e),te=o(q,se==null?void 0:se.arr).keyList.indexOf(z);if(te<0||te>=q.length)throw new Error("splitAtom: index out of bounds for write");const m=Kn(Y)?Y(q[te]):Y;Q(e,[...q.slice(0,te),m,...q.slice(te+1)])};g[I]=dt(e)?K(X,le):K(X)}),u&&u.keyList.length===R.length&&u.keyList.every((A,I)=>A===R[I])?f=u:f={arr:l,atomList:g,keyList:R},s.set(l,f),f},a=K(l=>{const p=l(a),f=l(e);return o(f,p==null?void 0:p.arr)});(qe?"production":void 0)!=="production"&&(a.debugPrivate=!0),a.init=void 0;const r=dt(e)?K(l=>l(a).atomList,(l,p,f)=>{switch(f.type){case"remove":{const u=l(r).indexOf(f.atom);if(u>=0){const g=l(e);p(e,[...g.slice(0,u),...g.slice(u+1)])}break}case"insert":{const u=f.before?l(r).indexOf(f.before):l(r).length;if(u>=0){const g=l(e);p(e,[...g.slice(0,u),f.value,...g.slice(u)])}break}case"move":{const u=l(r).indexOf(f.atom),g=f.before?l(r).indexOf(f.before):l(r).length;if(u>=0&&g>=0){const R=l(e);u<g?p(e,[...R.slice(0,u),...R.slice(u+1,g),R[u],...R.slice(g)]):p(e,[...R.slice(0,g),R[u],...R.slice(g,u),...R.slice(u+1)])}break}}}):K(l=>l(a).atomList);return r},e,t||Yn)}function Qn(e){const t=Symbol(),s=K(t);(qe?"production":void 0)!=="production"&&(s.debugPrivate=!0);const o=K((a,r)=>{const l=a(s);return l!==t?l:e(a,r)},(a,r,l)=>{if(l===St)r(s,t);else if(typeof l=="function"){const p=a(o);r(s,l(p))}else r(s,l)});return o}const Xn=e=>typeof(e==null?void 0:e.then)=="function";function Zn(e){let t,s;const o={getItem:(a,r)=>{var l,p;const f=g=>{if(g=g||"",t!==g){try{s=JSON.parse(g)}catch{return r}t=g}return s},u=(p=(l=e())==null?void 0:l.getItem(a))!=null?p:null;return Xn(u)?u.then(f):f(u)},setItem:(a,r)=>{var l;return(l=e())==null?void 0:l.setItem(a,JSON.stringify(r))},removeItem:a=>{var r;return(r=e())==null?void 0:r.removeItem(a)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(o.subscribe=(a,r,l)=>{if(!(e()instanceof window.Storage))return()=>{};const p=f=>{if(f.storageArea===e()&&f.key===a){let u;try{u=JSON.parse(f.newValue||"")}catch{u=l}r(u)}};return window.addEventListener("storage",p),()=>{window.removeEventListener("storage",p)}}),o}const ea=Zn(()=>typeof window<"u"?window.localStorage:void 0);function ue(e,t,s=ea,o){const a=o==null?void 0:o.unstable_getOnInit,r=K(a?s.getItem(e,t):t);return(qe?"production":void 0)!=="production"&&(r.debugPrivate=!0),r.onMount=p=>{a||p(s.getItem(e,t));let f;return s.subscribe&&(f=s.subscribe(e,p,t)),f},K(p=>p(r),(p,f,u)=>{const g=typeof u=="function"?u(p(r)):u;return g===St?(f(r,t),s.removeItem(e)):g instanceof Promise?g.then(R=>(f(r,R),s.setItem(e,R))):(f(r,g),s.setItem(e,g))})}const Ne=d.atom(null);Ne.debugLabel="chaiBuilderPropsAtom";const Ct=d.atom({});Ct.debugLabel="chaiExternalDataAtom";const ta=()=>!1,sa=e=>{const t=e.replace($.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}};const oa=new yt({children:"blockNodes"}),Et=(e,t=null)=>i.flatten(e.map(s=>{if(s=t!==null?{...s,parent:t}:s,s.children&&s.children.length){const o=[...s.children];return delete s.children,i.flatten([s,...Et(o,s._id)])}return s}));function _t(e,t,s){const o=i.filter(e,r=>r._parent===t),a=[];for(let r=0;r<o.length;r++){const l=Bt(o[r]);if(Object.keys(l).length>0&&Object.keys(l).forEach(p=>{o[r][p]=`slot:${c.generateUUID()}`}),i.filter(e,{_parent:o[r]._id}).length>0){const p=c.generateUUID();a.push({...o[r],oldId:o[r]._id,_id:p,_parent:s}),a.push(i.flatten(_t(e,o[r]._id,p)))}else a.push({...o[r],oldId:o[r]._id,_id:c.generateUUID(),_parent:s})}return i.flatten(a)}function na(e){let t=oa.convert(e.map(s=>i.omit(s,["settings"])));return t=!t.type&&t.blockNodes?t.blockNodes:i.isEmpty(t)?[]:[t],t}const Bt=e=>{const t={};return Object.keys(e).forEach(s=>{i.isString(e[s])&&e[s].startsWith("slot")&&(t[s]=e[s].replace("slot:",""))}),t},aa=(e,t,s=null)=>{let o=i.find(e,{_id:t});o={...o,oldId:o._id,_id:c.generateUUID()},s&&(o={...o,_parent:s});const a=[o];i.filter(e,{_parent:t}).length>0&&a.push(i.flatten(_t(e,t,o._id)));const r=i.flatten(a);return i.map(r,l=>{const p=l,f=Bt(p);return Object.keys(f).length>0&&Object.keys(f).forEach(u=>{const g=i.find(r,{oldId:f[u].replace("slot:","")});p[u]=`slot:${g._id}`}),i.omit(p,["global","oldId"])})};const ra=fe((e=[],t)=>{switch(t.type){case"add_new_blocks":case"add_duplicate_blocks":return[...e,...t.payload];case"create_snapshot":return[...e];case"set_blocks":case"set_page_blocks":return[...t.payload];case"update_props":case"update_props_realtime":const{payload:s}=t;return e.map(o=>(s.ids.includes(o._id)&&!i.isEmpty(t.payload.props)&&Object.keys(t.payload.props).forEach(a=>{i.set(o,a,t.payload.props[a])}),o));default:return e}},{debug:!1,ignoreInitialState:!1,limit:30,filter:fe.excludeAction(["update_props_realtime","add_duplicate_blocks","set_page_blocks"])}),Se=Gn({past:[],present:[],future:[]},ra);Se.debugLabel="pageBlocksAtom";const G=d.atom(e=>{var t;return(t=e(Se))==null?void 0:t.present});G.debugLabel="presentBlocksAtom";const Ue=Jn(G);Ue.debugLabel="pageBlocksAtomsAtom";const Pt=d.atom(e=>na(e(G)));Pt.debugLabel="pageBlocksTreeAtom";const ia=d.atom("");ia.debugLabel="builderActivePageAtom";const la=d.atom(-1);la.debugLabel="destinationDropIndexAtom";const Tt=d.atom(!1);Tt.debugLabel="addBlocksModalAtom";const It=d.atom([]);It.debugLabel="buildingBlocksAtom";const Mt=d.atom(e=>{const t=e(It);return i.filter(t,s=>i.has(s,"blockId"))});Mt.debugLabel="globalBlocksAtom";const H=()=>{const[,e]=d.useAtom(Se);return e},ca=()=>{const e=H(),t=d.useAtomValue(Pt),s=w.useCallback(o=>{const a=Et(o);e({type:"set_page_blocks",payload:a})},[e]);return[t,s]},da=()=>{const e=H();return[w.useCallback(s=>{e({type:"set_page_blocks",payload:s})},[e])]},we=e=>["Box","Slot","Form","DataProvider","Link","List","ListItem","Row","Column","Table","Row","TableCell"].includes(e),ua=e=>!["Slot"].includes(e),ma=e=>!["Slot"].includes(e);function pa(e,t){return e==="Slot"||t==="List"&&e!=="ListItem"||t==="Row"&&e!=="Column"?!1:we(t)}const fa=(e,{dragSource:t,dropTarget:s})=>{const o=i.get(t,"data._type",""),a=i.get(s,"data._type","");return o==="Slot"||i.get(t,"id")&&i.get(t,"id")===i.get(s,"id")?!1:i.isEmpty(a)?!0:pa(o,a)},Ge=d.atom([]);Ge.debugLabel="selectedBlockIdsAtom";const He=d.atom(e=>{const t=e(G),s=e(Ge);return i.map(i.filter(t,({_id:o})=>i.includes(s,o)),o=>({...o}))});He.debugLabel="selectedBlocksAtom";const We=d.atom(e=>{const t=e(He);return t.length===0?null:t.length===1?t[0]:{type:"Multiple",id:i.map(t,"id")}});We.debugLabel="selectedBlockAtom";const xa=e=>i.get(e,"parent",null),ga=d.atom(e=>{const t=e(He),s=i.map(t,xa);return i.filter(e(G),o=>i.includes(s,o._id))});ga.debugLabel="selectedBlocksParentsAtom";const Dt=d.atom(()=>!1);Dt.debugLabel="selectedBlockFlexChildAtom";const Lt=d.atom(()=>!1);Lt.debugLabel="selectedBlockGridChildAtom";const Ye=d.atom("");Ye.debugLabel="styleStateAtom";const Ot=ue("styleBreakpoint","xs");Ot.debugLabel="styleBreakpointAtom";const ba=()=>({flexChild:d.useAtomValue(Dt),gridChild:d.useAtomValue(Lt)}),ha=()=>d.useAtomValue(We);const me=()=>{const[e,t]=d.useAtom(Ge),s=w.useCallback(o=>{t(a=>i.includes(a,o)?i.without(a,o):[...a,o])},[t]);return[e,t,s]},Ve=(e,t="")=>{switch(e.type){case"singular":return e.uiSchema;case"model":const{properties:s}=e,o={};return Object.keys(s).forEach(l=>{const p=s[l];if(i.includes(["slot","styles"],p.type))return;const f=i.get(p,"i18n",!1)?`${l}-${t}`:l;o[f]=Ve(p,t)}),o;case"list":const{itemProperties:a}=e,r={items:{}};return Object.keys(a).forEach(l=>{const p=a[l];if(i.includes(["slot","styles"],p.type))return;const f=i.get(p,"i18n",!1)?`${l}-${t}`:l;r.items[f]=Ve(p,t)}),r;default:return{}}},ze=(e,t="")=>{switch(e.type){case"singular":return e.schema;case"model":const{properties:s,title:o}=e,a={title:o,type:"object",properties:{}};return Object.keys(s).forEach(f=>{const u=s[f];if(i.includes(["slot","styles"],u.type))return;const g=i.get(u,"i18n",!1)?`${f}-${t}`:f;a.properties[g]=ze(u,t)}),a;case"list":const{itemProperties:r,title:l}=e,p={title:l,type:"array",items:{type:"object",properties:{}}};return Object.keys(r).forEach(f=>{const u=r[f];if(i.includes(["slot","styles"],u.type))return;const g=i.get(u,"i18n",!1)?`${f}-${t}`:f;p.items.properties[g]=ze(u,t),i.set(p.items,"title",i.get(u,"itemTitle",`${l} item`))}),p;default:return{}}},Vt=e=>{const t={};return Object.keys(e).forEach(s=>{t[s]=ya(e[s])}),t},va=e=>{if(i.isEmpty(e.default))return[];const{itemProperties:t}=e;return i.map(e.default,s=>{const o={...s};return i.forIn(s,(a,r)=>{i.has(t,r)&&i.get(t[r],"i18n",!1)&&(o[r]=$.I18N_KEY)}),o})},ya=e=>{switch(e.type){case"styles":return e.default;case"slot":return`${$.SLOT_KEY}${c.generateUUID()}`;case"singular":const{i18n:t,schema:s}=e;return t?$.I18N_KEY:i.get(s,"default","");case"model":return Vt(e.properties);case"list":return va(e);default:return""}};const zt=()=>d.useAtomValue(G);function ut(e,t,s,o,a){if(s!==null){const f=i.findIndex(e,{_parent:t}),u=(f===-1?0:f)+s;return e.splice(u,0,...o),e}if(!a){const u=i.findIndex(e,{_id:t})+1;return e.splice(u,0,...o),e}let r=i.findIndex(e,{_id:t});const l=i.filter(e,{_parent:t});i.isEmpty(l)||(r=i.findIndex(e,{_id:i.last(l)._id}));const p=r+1;return e.splice(p,0,...o),e}const ja=()=>{const e=H(),t=zt(),[,s]=me(),o=w.useCallback((r,l,p)=>{var g;for(let R=0;R<r.length;R++){const{_id:A}=r[R];r[R]._id=c.generateUUID();const I=i.filter(r,{_parent:A});for(let z=0;z<I.length;z++)I[z]._parent=r[R]._id}let f;l&&(f=i.find(t,{_id:l}),r[0]._parent=l);const u=f?we(f._type):!0;return!u&&f&&(r[0]._parent=f._parent),e({type:"set_blocks",payload:ut(t,l||null,p||null,r,u)}),s([(g=i.first(r))==null?void 0:g._id]),i.first(r)},[t,e,s]);return{addCoreBlock:w.useCallback((r,l,p)=>{if(i.has(r,"blocks")){const W=r.blocks;return o(W,l,p)}const f=c.generateUUID(),u=Vt(r.props),g=[];i.forIn(u,(W,X)=>{if(i.startsWith(W,$.SLOT_KEY)){const le=W.replace($.SLOT_KEY,"");g.push({_id:le,_type:"Slot",_parent:f,_name:r.props[X].name,_styles:r.props[X].styles,_emptyStyles:r.props[X].emptyStyles})}});const R={_type:r.type,_id:f,...u};let A;l&&(A=i.find(t,{_id:l}),R._parent=l);const I=A?we(A._type):!0;!I&&A&&(R._parent=A._parent);const z=[R,...g];return e({type:"set_blocks",payload:ut(t,l||null,p||null,z,I)}),s([R._id]),R},[o,t,e,s]),addPredefinedBlock:o}},mt={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},pt=["xs","sm","md","lg","xl","2xl"];function wa(e,t){if(t===null)return"baseClasses";const s=t.mq;if(s==="xs"||t.dark||t.mod!=="")return"classes";let o="baseClasses",a=pt.indexOf(s);for(;a>0;){const r=pt[a-1];if(i.find(e,{mq:r,property:t.property})){o="classes";break}a--}return o}const ft=[];function Ra(e="",t="",s=[]){e=e.trim().replace(/ +/g,"");let o=i.filter(i.map(e.split(" "),c.constructClassObject),u=>!i.isNull(u)),a=i.filter(i.map(t.split(" "),c.constructClassObject),u=>!i.isNull(u));a=i.filter(a,u=>!i.includes(ft,u.property));const r=[],l=[];i.each(s,u=>{const g=c.constructClassObject(u),R=i.find(o,i.pick(g,["dark","mq","mod","property"]));if(R&&(o=i.filter(o,A=>A.fullCls!==(R==null?void 0:R.fullCls))),r.push(g),g.mq==="xs"&&!g.dark&&g.mod===""&&(a=i.filter(a,A=>A.property!==g.property)),wa(o,g)==="baseClasses"&&!i.includes(ft,g.property)){const A=i.find(a,i.pick(g,["property"]));R&&(a=i.filter(a,I=>I.fullCls!==(A==null?void 0:A.fullCls))),l.push({...g,fullCls:g.cls,mq:"xs"})}});const p=i.map(i.sortBy([...o,...r],u=>mt[u.mq]),"fullCls").join(" ");return`${i.map(i.sortBy([...a,...l],u=>mt[u.mq]),"fullCls").join(" ").trim()},${p.trim()}`.trim().replace(/ +/g,"")}const be=d.atom([]);be.debugLabel="selectedStylingBlocksAtom";const Ke=()=>d.useAtom(be),ka=e=>{const t=e.replace($.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},Aa=d.atom(null,(e,t,{blockIds:s,newClasses:o,dispatch:a})=>{const r=i.filter(e(Ue),p=>s.includes(e(p)._id)),l=i.first(e(be));i.each(r,p=>{const f=e(p),u=i.get(f,l.prop,`${$.STYLES_KEY},`),{baseClasses:g,classes:R}=ka(u);a({type:"update_props_realtime",payload:{ids:[f._id],props:{[l.prop]:`${$.STYLES_KEY}${Ra(R,g,o)}`}}})})}),Na=()=>{const e=H(),t=d.useSetAtom(Aa);return w.useCallback((s,o,a)=>{t({blockIds:s,newClasses:o,dispatch:e}),a&&setTimeout(()=>e({type:"create_snapshot"}),500)},[e,t])},xt=()=>{},$t=()=>{const e=Tn.useChaiBlocks(),t=d.useAtomValue(Mt),s=()=>{xt()},o=w.useCallback(()=>xt(),[]);return[e,t,s,o]},Sa=d.atom(!1),Ft=()=>{const[e,t]=d.useAtom(Sa);return[e,t]},Ca=d.atom($.BRANDING_OPTIONS_DEFAULTS),qt=()=>{const[e,t]=d.useAtom(Ca);return[i.isObject(e)?{...$.BRANDING_OPTIONS_DEFAULTS,...e}:$.BRANDING_OPTIONS_DEFAULTS,t]},Ea=d.atom(null),Ut=()=>({currentPage:d.useAtomValue(Ea)}),Gt=new yt({});function _a(e){let t=Gt.convert(e);return t=!t.type&&t.children&&t.children.length?t.children:i.isEmpty(t)?[]:[t],t}const Je=(e,t)=>i.flatten(e.map(s=>{if(s=t?{...s,parent:t}:{...s},s.children){const o=[...s.children];return delete s.children,i.flatten([s,...Je(o,s._id)])}return s}));function Qe(e,t=!1){for(let s=0;s<e.length;s++){const o=e[s];o.global&&!t?e[s]={type:"GlobalBlock",blockId:o.blockId,_parent:i.get(o,"parent",null),_id:o._id}:o.children&&o.children.length&&Qe(o.children)}}function Ht(e){let t=[],s=i.filter(e,{type:"GlobalBlock"});return s.length>0&&(s=i.map(s,Wt),i.each(s,o=>{t=[...t,...Ba(o)]})),t}function Ba(e){let t=[];const s=i.get(i.first(e),"parent",null);i.set(i.first(e),"parent",null);const o=[Gt.convert(Yt(e))];Qe(o,!0);let a=Je(o,e[0]._id);return a=i.set(a,"0.parent",s),t=[...t,a,...Ht(a)],t}function Wt(e){const t=i.find($e,{_id:e._id});if(!t)return[];const s=[t],o=i.filter($e,{_parent:e._id});return o.length?i.flatten([...s,...i.flatten(i.map(o,Wt))]):i.flatten(s)}const Yt=e=>JSON.parse(JSON.stringify(e));let $e=[];function Pa(e){$e=e;const t=_a(Yt(e));Qe(t);const s=Je(t,null),o=Ht(s),a={};return i.each(o,r=>i.set(a,i.first(r).blockId,r)),[s,a]}const Xe=()=>{const[e]=qt(),{currentPage:t}=Ut(),s=d.useAtomValue(G);return w.useCallback(()=>{const o=i.map(s,l=>i.omit(l,["expanded","order","title","siblings","tempClasses"])),[a=[],r=[]]=Pa(o);return{currentPage:t,blocks:a,globalBlocks:r}},[e,t,s])},ne=(e,t=void 0)=>{const s=d.useAtomValue(Ne);return i.get(s,e,t)},Kt=d.atom(!1);Kt.debugLabel="readOnlyModeAtom";const Jt=d.atom(!1);Jt.debugLabel="advanceStylingOpenAtom";const Qt=d.atom("online");Qt.debugLabel="networkModeAtom";const Ta=d.atom(!1);Ta.debugLabel="codeEditorOpenAtom";const Xt=d.atom(!1);Xt.debugLabel="editLayerNameAtom";const Ia=d.atom("");Ia.debugLabel="activeLanguageAtom";const Ma=d.atom("");Ma.debugLabel="primaryLanguageAtom";const Zt=d.atom(null);Zt.debugLabel="canvasIframeAtom";const es=d.atom("layers");es.debugLabel="activePanelAtom";const ts=d.atom(!1);ts.debugLabel="addBlockOffCanvasAtom";const ss=d.atom("");ss.debugLabel="showPredefinedBlockCategoryAtom";const Ce=d.atom({undoCount:0,redoCount:0});Ce.debugLabel="historyStatesAtom";const os=d.atom("");os.debugLabel="inlineEditingActiveAtom";const ns=d.atom(!1);ns.debugLabel="isDraggingAtom";const Ze=d.atom([]);Ze.debugLabel="dataProvidersAtom";const as=()=>d.useAtom(Ze),Ee=d.atom("SAVED");Ee.debugLabel="pageSyncStateAtom";const Da=()=>{const[e,t]=d.useAtom(Ee),s=ne("onSaveBlocks",async()=>{}),o=ne("onSavePage",async()=>{}),a=ne("onSyncStatusChange",()=>{}),r=Xe(),l=d.useSetAtom(Ce),{undoCount:p,redoCount:f}=_e(),[u]=as();return{savePage:In.useThrottledCallback(async()=>{t("SAVING"),a("SAVING");const R=r();return await o({blocks:R.blocks,providers:u}),setTimeout(()=>{l({undoCount:p,redoCount:f}),t("SAVED"),a("SAVED")},100),!0},[r,t,a,s],5e3),syncState:e,setSyncState:t}},_e=()=>{const e=d.useAtomValue(Se),[{undoCount:t,redoCount:s}]=d.useAtom(Ce),o=H(),[a]=Ft(),[,r]=me(),[,l]=Ke(),[p,f]=d.useAtom(Ee),u=ne("onSyncStatusChange",()=>{}),g=w.useCallback(()=>{o({type:"create_snapshot"})},[o]);return w.useEffect(()=>{(p==="SAVED"&&t!==(e==null?void 0:e.past.length)||s!==(e==null?void 0:e.future.length))&&(f("UNSAVED"),u("UNSAVED"))},[e==null?void 0:e.past.length,e==null?void 0:e.future.length,t,s,u,f,p]),{undoCount:e==null?void 0:e.past.length,redoCount:e==null?void 0:e.future.length,undo:w.useCallback(()=>{a||(o(fe.ActionCreators.undo()),setTimeout(()=>{l([]),r([])},200))},[o,a,r,l]),redo:w.useCallback(()=>{a||(o(fe.ActionCreators.redo()),setTimeout(()=>{l([]),r([])},200))},[a,o,l,r]),clear:()=>{o(fe.ActionCreators.clearHistory())},createSnapshot:g}},rs=()=>d.useAtom(Ot),is=ue("canvasWidth",800),ls=d.atom(e=>{const t=e(is);return c.getBreakpointValue(t).toLowerCase()}),La=()=>{const[e,t]=d.useAtom(is),s=d.useAtomValue(ls),[o,a]=rs();return w.useEffect(()=>{o!=="xs"&&a(s)},[s,o,a]),[e,s,t]},Oa=ue("canvasZoom",100),Va=()=>d.useAtom(Oa),cs=d.atom([]),ds=()=>{const[e,t]=d.useAtom(cs),s=d.useSetAtom(et),o=w.useCallback(a=>{t(a),s([])},[t,s]);return[e,o]},et=d.atom([]),za=()=>{const[e,t]=d.useAtom(et),s=d.useSetAtom(cs),o=w.useCallback(a=>{t(a),s([])},[t,s]);return[e,o]},us=ue("darkMode",!1),$a=()=>{const[e,t]=d.useAtom(us);return[e,t]},Fa=d.atom(!1),qa=()=>{const[e,t]=d.useAtom(Fa);return[e,t]},ms=()=>{const e=H(),t=d.useAtomValue(G),[,s]=me();return w.useCallback((o,a=null)=>{const r=[];i.each(o,l=>{const f=aa(t,l,a===l?null:a);r.push(i.get(f,"0._id","")),e({type:"add_duplicate_blocks",payload:f})}),s(r),e({type:"create_snapshot"})},[t,s,e])},Ua=d.atom([]),Ga=()=>{const[e,t]=d.useAtom(Ua),s=w.useCallback(o=>{t(a=>i.includes(a,o)?i.without(a,o):[...a,o])},[t]);return[e,t,s]},Ha=d.atom(""),ps=()=>d.useAtom(Ha),Wa=()=>{const e=d.useAtomValue(G),t=H(),s=Xe(),[,,o]=$t();return w.useCallback(async(a,r)=>{const l=c.generateUUID(16),p=i.map(e,f=>(f._id===a&&(f._globalBlockId=l,f._name=r),f));t({type:"set_page_blocks",payload:p}),o()},[e,t,s,o])},Ya=()=>({}),Ka=()=>{const e=d.useAtomValue(G),t=H();return w.useCallback((s,o)=>{const a=i.map(e,r=>(i.includes(s,i.get(r,"_id"))&&i.set(r,"_parent",o),r));t({type:"set_blocks",payload:a})},[e,t])},Ja=()=>{const e=d.useAtomValue(et),[t,s]=ds(),o=ms(),a=Ka();return{canPaste:w.useMemo(()=>t.length>0||e.length>0,[e,t]),pasteBlocks:w.useCallback(l=>{i.isEmpty(e)?a(t,l):o(e,l),s(()=>[])},[t,e,o,a,s])}},Qa=d.atom(""),Xa=()=>{const e=d.useAtomValue(Qa),t=w.useCallback(()=>{},[]),s=w.useCallback(()=>{},[]),o=w.useCallback(()=>{},[]);return{currentProject:e,createProject:o,deleteProject:t,updateProject:s}},fs=(e,t)=>{const s=[],o=i.filter(e,a=>i.includes(t,a._id)||i.includes(t,a._parent)?(s.push(a._id),!1):!0);return i.isEmpty(s)?o:fs(o,s)},Za=()=>{const e=H(),t=d.useAtomValue(G),[s,o]=me();return w.useCallback(a=>{var p;const r=((p=i.find(t,{_id:a[0]}))==null?void 0:p._parent)||null,l=fs(t,a);e({type:"set_blocks",payload:l}),o(r?[r]:[])},[t,o,e,s])},er=d.atom(null,(e,t,{blockIds:s,fullClasses:o,dispatch:a})=>{const r=i.first(e(be)),l=i.filter(e(Ue),p=>s.includes(e(p)._id));i.each(l,p=>{const f=e(p),u=o;let{classes:g,baseClasses:R}=sa(i.get(f,r.prop,"styles:,"));i.each(u,A=>{const I=new RegExp(`(^| )${A.replace("[","\\[").replace("]","\\]")}($| )`,"g");g=g.replace(I," ").replace(/ +/g," ").trim();const z=i.first(A.split(":"));i.includes(["2xl","xl","lg","md","sm"],z)&&u.push(A.split(":").pop().trim())}),i.each(u,A=>{const I=new RegExp(`(^| )${A.replace("[","\\[").replace("]","\\]")}($| )`,"g");R=R.replace(I," ").replace(/ +/g," ").trim()}),a({type:"update_props_realtime",payload:{ids:[f._id],props:{[r.prop]:`${$.STYLES_KEY}${R},${g}`}}})})}),tr=()=>{const e=H(),t=d.useSetAtom(er);return w.useCallback((s,o)=>{t({blockIds:s,fullClasses:o,dispatch:e}),setTimeout(()=>e({type:"create_snapshot"}))},[e,t])},xs=d.atom(e=>{const t=i.first(e(be)),s=e(We);if(!t||t.blockId!==i.get(s,"_id",null))return[];const a=i.get(s,t.prop,`${$.STYLES_KEY},`).replace($.STYLES_KEY,"").split(",").join(" ");return i.filter(i.map(a.trim().split(" "),c.constructClassObject),r=>!i.isNull(r))}),sr=()=>d.useAtomValue(xs),gt={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},or=d.atom(e=>{const t=e(ls),s=e(Ye),o=e(us),a=nr(t);let r=i.filter(e(xs),{mod:s});return i.startsWith(s,"_")||(r=i.filter(r,l=>a.includes(l.mq))),r=r.sort((l,p)=>gt[l.mq]-gt[p.mq]),o||(r=i.filter(r,{dark:!1})),r}),nr=e=>{let t=[];switch(e){case"xs":t=["xs"];break;case"sm":t=["xs","sm"];break;case"md":t=["xs","sm","md"];break;case"lg":t=["xs","sm","md","lg"];break;case"xl":t=["xs","sm","md","lg","xl"];break;case"2xl":t=["xs","sm","md","lg","xl","2xl"];break;default:t=["xs"];break}return t},ar=()=>d.useAtomValue(or),rr=()=>d.useAtom(Ye),gs=d.atom(null,(e,t,{blockIds:s,props:o,dispatch:a})=>{a({type:"update_props_realtime",payload:{ids:s,props:o}})}),ir=()=>{const{createSnapshot:e}=_e(),t=H(),s=d.useSetAtom(gs);return w.useCallback((o,a)=>{s({blockIds:o,props:a,dispatch:t}),e()},[e,t,s])},lr=()=>{const e=H(),t=d.useSetAtom(gs);return w.useCallback((s,o)=>{t({blockIds:s,props:o,dispatch:e})},[e,t])},bs={name:"",props:{},modalProps:{},backdropClose:!0},cr=d.atom(bs),dr=()=>{const[e,t]=d.useAtom(cr),s=w.useCallback((a,r={},l={})=>{t({name:a,props:r,modalProps:l})},[t]),o=w.useCallback((...a)=>{i.get(e,"props.onClose",()=>{})(...a),t(bs)},[t,e]);return{activeModal:e,openModal:s,closeModal:o}},ur=()=>d.useAtomValue(Kt),mr=d.atom(""),pr=d.atom(null),fr=()=>d.useAtom(mr),xr=()=>d.useAtom(pr),gr=ue("selectedBreakpoints",["XS","MD","XL"]),br=()=>{const[e,t]=d.useAtom(gr);return[e,t]},hr=()=>{const e=d.useSetAtom(Ce),{clear:t}=_e(),[,s]=me(),[,o]=ps(),[,a]=Ke();return()=>{s([]),a([]),o(""),t(),e({undoCount:0,redoCount:0})}},vr=d.atom({en:{}}),yr=()=>{const[e,t]=d.useAtom(vr),s=w.useCallback((o,a,r)=>{i.set(e,`${o}.${a}`,r),t(e)},[e,t]);return[e,s]},jr=(e,t)=>{const[s]=d.useAtom(Ne);return i.get(s,e,t)},wr=d.atom([]),Rr=()=>{const[e,t]=w.useState(!1),[s,o]=d.useAtom(wr),a=ne("getUILibraryBlocks",()=>[]);return w.useEffect(()=>{(async()=>s.length>0||(t(!0),o(await a()),t(!1)))()},[]),{data:s,isLoading:e}},kr=d.atom("en"),Ar=d.atom("en"),Nr=d.atom(["en"]),hs=()=>d.useAtom(kr),Sr=()=>d.useAtom(Ar),Cr=()=>d.useAtom(Nr),Er=(e,t)=>{const[s]=hs(),o=`${e}${s?`-${s}`:""}`;return{content:i.get(t,o,i.get(t,e,"")),propKey:e}},vs=re.cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),ys=x.forwardRef(({className:e,variant:t,size:s,...o},a)=>n.jsxRuntimeExports.jsx(jt.Root,{ref:a,className:c.cn(vs({variant:t,size:s,className:e})),...o}));ys.displayName=jt.Root.displayName;const js=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(Oe.Root,{className:c.cn("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",e),...t,ref:s,children:n.jsxRuntimeExports.jsx(Oe.Thumb,{className:c.cn("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950")})}));js.displayName=Oe.Root.displayName;const Be=re.cva("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ws=x.forwardRef(({className:e,variant:t,size:s,asChild:o=!1,...a},r)=>{const l=o?xn.Slot:"button";return n.jsxRuntimeExports.jsx(l,{className:c.cn(Be({variant:t,size:s,className:e})),ref:r,...a})});ws.displayName="Button";const _r=ae.Root,Rs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ae.Item,{ref:s,className:c.cn("border-b",e),...t}));Rs.displayName="AccordionItem";const ks=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsx(ae.Header,{className:"flex",children:n.jsxRuntimeExports.jsxs(ae.Trigger,{ref:o,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),...s,children:[t,n.jsxRuntimeExports.jsx(O.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));ks.displayName=ae.Trigger.displayName;const As=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsx(ae.Content,{ref:o,className:c.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...s,children:n.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:t})}));As.displayName=ae.Content.displayName;const Br=re.cva("relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Ns=x.forwardRef(({className:e,variant:t,...s},o)=>n.jsxRuntimeExports.jsx("div",{ref:o,role:"alert",className:c.cn(Br({variant:t}),e),...s}));Ns.displayName="Alert";const Ss=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("h5",{ref:s,className:c.cn("mb-1 font-medium leading-none tracking-tight",e),...t}));Ss.displayName="AlertTitle";const Cs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("text-sm [&_p]:leading-relaxed",e),...t}));Cs.displayName="AlertDescription";const Es=re.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),Pr=({className:e,variant:t,...s})=>n.jsxRuntimeExports.jsx("div",{className:c.cn(Es({variant:t}),e),...s}),Tr=V.Root,Ir=V.Trigger,_s=({className:e,...t})=>n.jsxRuntimeExports.jsx(V.Portal,{className:c.cn(e),...t});_s.displayName=V.Portal.displayName;const Bs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Overlay,{className:c.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:s}));Bs.displayName=V.Overlay.displayName;const Ps=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsxs(_s,{children:[n.jsxRuntimeExports.jsx(Bs,{}),n.jsxRuntimeExports.jsx(V.Content,{ref:s,className:c.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})]}));Ps.displayName=V.Content.displayName;const Ts=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ts.displayName="AlertDialogHeader";const Is=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Is.displayName="AlertDialogFooter";const Ms=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Title,{ref:s,className:c.cn("text-lg font-semibold",e),...t}));Ms.displayName=V.Title.displayName;const Ds=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Ds.displayName=V.Description.displayName;const Ls=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Action,{ref:s,className:c.cn(Be(),e),...t}));Ls.displayName=V.Action.displayName;const Os=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Cancel,{ref:s,className:c.cn(Be({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Os.displayName=V.Cancel.displayName;const tt=_.Root,Vs=_.Trigger,zs=({className:e,...t})=>n.jsxRuntimeExports.jsx(_.Portal,{className:c.cn(e),...t});zs.displayName=_.Portal.displayName;const $s=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Overlay,{ref:s,className:c.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}));$s.displayName=_.Overlay.displayName;const Pe=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(zs,{children:[n.jsxRuntimeExports.jsx($s,{}),n.jsxRuntimeExports.jsxs(_.Content,{ref:o,className:c.cn("fixed left-[50%] top-[50%] z-[999] 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),...s,children:[t,n.jsxRuntimeExports.jsxs(_.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[n.jsxRuntimeExports.jsx(O.Cross2Icon,{className:"h-4 w-4"}),n.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Pe.displayName=_.Content.displayName;const Fs=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Fs.displayName="DialogHeader";const qs=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});qs.displayName="DialogFooter";const Us=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Title,{ref:s,className:c.cn("text-lg font-semibold leading-none tracking-tight",e),...t}));Us.displayName=_.Title.displayName;const Gs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Gs.displayName=_.Description.displayName;const Hs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Hs.displayName="Card";const Ws=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("flex flex-col space-y-1.5 p-6",e),...t}));Ws.displayName="CardHeader";const Ys=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("h3",{ref:s,className:c.cn("font-semibold leading-none tracking-tight",e),...t}));Ys.displayName="CardTitle";const Ks=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("p",{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Ks.displayName="CardDescription";const Js=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("p-6 pt-0",e),...t}));Js.displayName="CardContent";const Qs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn(" flex items-center p-6 pt-0",e),...t}));Qs.displayName="CardFooter";const Xs=x.forwardRef(({className:e,type:t,...s},o)=>n.jsxRuntimeExports.jsx("input",{type:t,className:c.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:o,...s}));Xs.displayName="Input";const Mr=re.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Zs=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(wt.Root,{ref:s,className:c.cn(Mr(),e),...t}));Zs.displayName=wt.Root.displayName;const eo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("textarea",{className:c.cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm 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:s,...t}));eo.displayName="Textarea";const to=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(oe.Root,{ref:o,className:c.cn("relative overflow-hidden",e),...s,children:[n.jsxRuntimeExports.jsx(oe.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),n.jsxRuntimeExports.jsx(st,{}),n.jsxRuntimeExports.jsx(oe.Corner,{})]}));to.displayName=oe.Root.displayName;const st=x.forwardRef(({className:e,orientation:t="vertical",...s},o)=>n.jsxRuntimeExports.jsx(oe.ScrollAreaScrollbar,{ref:o,orientation:t,className:c.cn("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",e),...s,children:n.jsxRuntimeExports.jsx(oe.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));st.displayName=oe.ScrollAreaScrollbar.displayName;const so=ie.Root,ot=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ie.List,{ref:s,className:c.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));ot.displayName=ie.List.displayName;const Re=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ie.Trigger,{ref:s,className:c.cn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Re.displayName=ie.Trigger.displayName;const ke=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ie.Content,{ref:s,className:c.cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ke.displayName=ie.Content.displayName;const Dr=de.Portal,Lr=de.Provider,Or=de.Root,Vr=de.Trigger,oo=x.forwardRef(({className:e,sideOffset:t=4,...s},o)=>n.jsxRuntimeExports.jsx(de.Content,{ref:o,sideOffset:t,className:c.cn("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s}));oo.displayName=de.Content.displayName;const zr=ge.Root,$r=ge.Trigger,no=x.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},a)=>n.jsxRuntimeExports.jsx(ge.Portal,{children:n.jsxRuntimeExports.jsx(ge.Content,{ref:a,align:t,sideOffset:s,className:c.cn("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));no.displayName=ge.Content.displayName;const Fr=C.Menu,qr=C.Group,Ur=C.Portal,Gr=C.Sub,Hr=C.RadioGroup,ao=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.Root,{ref:s,className:c.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",e),...t}));ao.displayName=C.Root.displayName;const ro=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.Trigger,{ref:s,className:c.cn("flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e),...t}));ro.displayName=C.Trigger.displayName;const io=x.forwardRef(({className:e,inset:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(C.SubTrigger,{ref:a,className:c.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[s,n.jsxRuntimeExports.jsx(O.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));io.displayName=C.SubTrigger.displayName;const lo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.SubContent,{ref:s,className:c.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));lo.displayName=C.SubContent.displayName;const co=x.forwardRef(({className:e,align:t="start",alignOffset:s=-4,sideOffset:o=8,...a},r)=>n.jsxRuntimeExports.jsx(C.Portal,{children:n.jsxRuntimeExports.jsx(C.Content,{ref:r,align:t,alignOffset:s,sideOffset:o,className:c.cn("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));co.displayName=C.Content.displayName;const uo=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(C.Item,{ref:o,className:c.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));uo.displayName=C.Item.displayName;const mo=x.forwardRef(({className:e,children:t,checked:s,...o},a)=>n.jsxRuntimeExports.jsxs(C.CheckboxItem,{ref:a,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(C.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.CheckIcon,{className:"h-4 w-4"})})}),t]}));mo.displayName=C.CheckboxItem.displayName;const po=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(C.RadioItem,{ref:o,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(C.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));po.displayName=C.RadioItem.displayName;const fo=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(C.Label,{ref:o,className:c.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));fo.displayName=C.Label.displayName;const xo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",e),...t}));xo.displayName=C.Separator.displayName;const go=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});go.displayname="MenubarShortcut";const Wr=Ae.Root,Yr=Ae.Trigger,bo=x.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},a)=>n.jsxRuntimeExports.jsx(Ae.Content,{ref:a,align:t,sideOffset:s,className:c.cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));bo.displayName=Ae.Content.displayName;const Kr=M.Root,Jr=M.Group,Qr=M.Value,ho=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(M.Trigger,{ref:o,className:c.cn("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...s,children:[t,n.jsxRuntimeExports.jsx(M.Icon,{asChild:!0,children:n.jsxRuntimeExports.jsx(O.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));ho.displayName=M.Trigger.displayName;const vo=x.forwardRef(({className:e,children:t,position:s="popper",...o},a)=>n.jsxRuntimeExports.jsx(M.Portal,{children:n.jsxRuntimeExports.jsx(M.Content,{ref:a,className:c.cn("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:s,...o,children:n.jsxRuntimeExports.jsx(M.Viewport,{className:c.cn("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));vo.displayName=M.Content.displayName;const yo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(M.Label,{ref:s,className:c.cn("px-2 py-1.5 text-sm font-semibold",e),...t}));yo.displayName=M.Label.displayName;const jo=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(M.Item,{ref:o,className:c.cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(M.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.CheckIcon,{className:"h-4 w-4"})})}),n.jsxRuntimeExports.jsx(M.ItemText,{children:t})]}));jo.displayName=M.Item.displayName;const wo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(M.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",e),...t}));wo.displayName=M.Separator.displayName;const Xr=_.Root,Zr=_.Trigger,ei=_.Close,Ro=({className:e,...t})=>n.jsxRuntimeExports.jsx(_.Portal,{className:c.cn(e),...t});Ro.displayName=_.Portal.displayName;const ko=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Overlay,{className:c.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:s}));ko.displayName=_.Overlay.displayName;const ti=re.cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Ao=x.forwardRef(({side:e="right",className:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(Ro,{children:[n.jsxRuntimeExports.jsx(ko,{}),n.jsxRuntimeExports.jsxs(_.Content,{ref:a,className:c.cn(ti({side:e}),t),...o,children:[s,n.jsxRuntimeExports.jsxs(_.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[n.jsxRuntimeExports.jsx(O.Cross2Icon,{className:"h-4 w-4"}),n.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ao.displayName=_.Content.displayName;const No=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});No.displayName="SheetHeader";const So=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});So.displayName="SheetFooter";const Co=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Title,{ref:s,className:c.cn("text-lg font-semibold text-foreground",e),...t}));Co.displayName=_.Title.displayName;const Eo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Eo.displayName=_.Description.displayName;const si=B.Root,oi=B.Trigger,ni=B.Group,ai=B.Portal,ri=B.Sub,ii=B.RadioGroup,_o=x.forwardRef(({className:e,inset:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(B.SubTrigger,{ref:a,className:c.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...o,children:[s,n.jsxRuntimeExports.jsx(O.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));_o.displayName=B.SubTrigger.displayName;const Bo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(B.SubContent,{ref:s,className:c.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Bo.displayName=B.SubContent.displayName;const Po=x.forwardRef(({className:e,sideOffset:t=4,...s},o)=>n.jsxRuntimeExports.jsx(B.Portal,{children:n.jsxRuntimeExports.jsx(B.Content,{ref:o,sideOffset:t,className:c.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));Po.displayName=B.Content.displayName;const To=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(B.Item,{ref:o,className:c.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));To.displayName=B.Item.displayName;const Io=x.forwardRef(({className:e,children:t,checked:s,...o},a)=>n.jsxRuntimeExports.jsxs(B.CheckboxItem,{ref:a,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(B.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.CheckIcon,{className:"h-4 w-4"})})}),t]}));Io.displayName=B.CheckboxItem.displayName;const Mo=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(B.RadioItem,{ref:o,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(B.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Mo.displayName=B.RadioItem.displayName;const Do=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(B.Label,{ref:o,className:c.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));Do.displayName=B.Label.displayName;const Lo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(B.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",e),...t}));Lo.displayName=B.Separator.displayName;const Oo=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest opacity-60",e),...t});Oo.displayName="DropdownMenuShortcut";const Vo=x.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...o},a)=>n.jsxRuntimeExports.jsx(Rt.Root,{ref:a,decorative:s,orientation:t,className:c.cn("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Vo.displayName=Rt.Root.displayName;const li=1,ci=1e6;let De=0;function di(){return De=(De+1)%Number.MAX_VALUE,De.toString()}const Le=new Map,bt=e=>{if(Le.has(e))return;const t=setTimeout(()=>{Le.delete(e),xe({type:"REMOVE_TOAST",toastId:e})},ci);Le.set(e,t)},zo=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,li)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case"DISMISS_TOAST":{const{toastId:s}=t;return s?bt(s):e.toasts.forEach(o=>{bt(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===s||s===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)}}},ve=[];let ye={toasts:[]};function xe(e){ye=zo(ye,e),ve.forEach(t=>{t(ye)})}function $o({...e}){const t=di(),s=a=>xe({type:"UPDATE_TOAST",toast:{...a,id:t}}),o=()=>xe({type:"DISMISS_TOAST",toastId:t});return xe({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||o()}}}),{id:t,dismiss:o,update:s}}function Fo(){const[e,t]=x.useState(ye);return x.useEffect(()=>(ve.push(t),()=>{const s=ve.indexOf(t);s>-1&&ve.splice(s,1)}),[e]),{...e,toast:$o,dismiss:s=>xe({type:"DISMISS_TOAST",toastId:s})}}const ui=U.Provider,qo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Viewport,{ref:s,className:c.cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));qo.displayName=U.Viewport.displayName;const mi=re.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Uo=x.forwardRef(({className:e,variant:t,...s},o)=>n.jsxRuntimeExports.jsx(U.Root,{ref:o,className:c.cn(mi({variant:t}),e),...s}));Uo.displayName=U.Root.displayName;const pi=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Action,{ref:s,className:c.cn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));pi.displayName=U.Action.displayName;const Go=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Close,{ref:s,className:c.cn("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:n.jsxRuntimeExports.jsx(O.Cross2Icon,{className:"h-4 w-4"})}));Go.displayName=U.Close.displayName;const Ho=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Title,{ref:s,className:c.cn("text-sm font-semibold [&+div]:text-xs",e),...t}));Ho.displayName=U.Title.displayName;const Wo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Description,{ref:s,className:c.cn("text-sm opacity-90",e),...t}));Wo.displayName=U.Description.displayName;function fi(){const{toasts:e}=Fo();return n.jsxRuntimeExports.jsxs(ui,{children:[e.map(({id:t,title:s,description:o,action:a,...r})=>n.jsxRuntimeExports.jsxs(Uo,{...r,children:[n.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[s&&n.jsxRuntimeExports.jsx(Ho,{children:s}),o&&n.jsxRuntimeExports.jsx(Wo,{children:o})]}),a,n.jsxRuntimeExports.jsx(Go,{})]},t)),n.jsxRuntimeExports.jsx(qo,{})]})}const xi=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("animate-pulse rounded-md bg-primary/10",e),...t}),nt=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command,{ref:s,className:c.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));nt.displayName=F.Command.displayName;const gi=({children:e,...t})=>n.jsxRuntimeExports.jsx(tt,{...t,children:n.jsxRuntimeExports.jsx(Pe,{className:"overflow-hidden p-0",children:n.jsxRuntimeExports.jsx(nt,{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})})}),Yo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[n.jsxRuntimeExports.jsx(O.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),n.jsxRuntimeExports.jsx(F.Command.Input,{ref:s,className:c.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})]}));Yo.displayName=F.Command.Input.displayName;const Ko=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command.List,{ref:s,className:c.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Ko.displayName=F.Command.List.displayName;const Jo=x.forwardRef((e,t)=>n.jsxRuntimeExports.jsx(F.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Jo.displayName=F.Command.Empty.displayName;const Qo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command.Group,{ref:s,className:c.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}));Qo.displayName=F.Command.Group.displayName;const Xo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command.Separator,{ref:s,className:c.cn("-mx-1 h-px bg-border",e),...t}));Xo.displayName=F.Command.Separator.displayName;const Zo=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(F.Command.Item,{ref:s,className:c.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}));Zo.displayName=F.Command.Item.displayName;const en=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});en.displayName="CommandShortcut";const bi=P.Root,hi=P.Trigger,vi=P.Group,yi=P.Portal,ji=P.Sub,wi=P.RadioGroup,tn=x.forwardRef(({className:e,inset:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(P.SubTrigger,{ref:a,className:c.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[s,n.jsxRuntimeExports.jsx(O.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));tn.displayName=P.SubTrigger.displayName;const sn=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(P.SubContent,{ref:s,className:c.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));sn.displayName=P.SubContent.displayName;const on=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(P.Portal,{children:n.jsxRuntimeExports.jsx(P.Content,{ref:s,className:c.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));on.displayName=P.Content.displayName;const nn=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(P.Item,{ref:o,className:c.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));nn.displayName=P.Item.displayName;const an=x.forwardRef(({className:e,children:t,checked:s,...o},a)=>n.jsxRuntimeExports.jsxs(P.CheckboxItem,{ref:a,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(P.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.CheckIcon,{className:"h-4 w-4"})})}),t]}));an.displayName=P.CheckboxItem.displayName;const rn=x.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(P.RadioItem,{ref:o,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(P.ItemIndicator,{children:n.jsxRuntimeExports.jsx(O.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));rn.displayName=P.RadioItem.displayName;const ln=x.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(P.Label,{ref:o,className:c.cn("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...s}));ln.displayName=P.Label.displayName;const cn=x.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(P.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-border",e),...t}));cn.displayName=P.Separator.displayName;const dn=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});dn.displayName="ContextMenuShortcut";const Ri=e=>{try{const t=document.getElementById("icon-picker-field"),s=document.createElement("div");Bn.render(n.jsxRuntimeExports.jsx(vt.IconPickerItem,{value:e}),s),t.appendChild(s),s.hidden=!0;let o=s.innerHTML;setTimeout(()=>t.removeChild(s),1e3);const r=new DOMParser().parseFromString(o,"image/svg+xml"),l=r.querySelector("svg");return l&&(l.removeAttribute("width"),l.removeAttribute("height")),new XMLSerializer().serializeToString(r)}catch{return""}},ki=({value:e,onChange:t,onBlur:s,id:o})=>{const a=r=>{t("<svg />");const l=Ri(r);t(l),s(o,l)};return n.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[n.jsxRuntimeExports.jsxs("div",{className:"relative h-12 w-12 group",children:[n.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e==null?void 0:e.replace("<svg",'<svg class="h-5 w-5"')},className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white z-0"}),n.jsxRuntimeExports.jsx(vt,{value:e?"BiSolidGrid":null,onChange:a,pickButtonStyle:{position:"relative",height:"48px",width:"48px",border:"1px solid #BBBBBB",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",backgroundColor:"transparent",zIndex:1},searchInputStyle:{backgroundColor:"transparent",width:"100%",border:"1px solid #BBBBBB",margin:"0px 10px",padding:"10px"}})]}),n.jsxRuntimeExports.jsx("textarea",{value:e,onChange:r=>t(r.target.value),className:"h-full border w-full rounded-sm border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",placeholder:"Choose icon or enter svg"})]})},Ai=w.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-nXceZLmd.cjs"))),Ni=w.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-tcQb5NZu.cjs"))),un=({isModalView:e=!1,onSelect:t=()=>{}})=>{const[s,o]=w.useState("upload");return n.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[n.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:n.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:e?"Select or upload images":"Images"})}),n.jsxRuntimeExports.jsxs(so,{value:s,onValueChange:a=>o(a),className:"flex h-full w-full flex-col py-2",children:[n.jsxRuntimeExports.jsxs(ot,{className:"w-full",children:[n.jsxRuntimeExports.jsx(Re,{value:"upload",className:"w-1/2",children:"Upload"}),n.jsxRuntimeExports.jsx(Re,{value:"unsplash",className:"w-1/2",children:"Unsplash"})]}),s==="unsplash"?n.jsxRuntimeExports.jsx(ke,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:n.jsxRuntimeExports.jsx(w.Suspense,{fallback:n.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:n.jsxRuntimeExports.jsx(Ai,{isModalView:e,onSelect:t})})}):n.jsxRuntimeExports.jsx(ke,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:n.jsxRuntimeExports.jsx(w.Suspense,{fallback:n.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:n.jsxRuntimeExports.jsx(Ni,{isModalView:e,onSelect:t})})})]})]})},Si=Object.freeze(Object.defineProperty({__proto__:null,default:un},Symbol.toStringTag,{value:"Module"})),ht=({children:e,onSelect:t})=>{const[s,o]=w.useState(!1),a=(...r)=>{t.call(void 0,...r),o(!1)};return n.jsxRuntimeExports.jsxs(tt,{open:s,onOpenChange:r=>o(r),children:[n.jsxRuntimeExports.jsx(Vs,{asChild:!0,children:e}),n.jsxRuntimeExports.jsx(Pe,{className:"flex h-3/4 max-w-5xl",children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:n.jsxRuntimeExports.jsx(un,{isModalView:!0,onSelect:a})})})]})},Ci=({value:e,onChange:t,id:s,onBlur:o})=>n.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[e?n.jsxRuntimeExports.jsx("img",{src:e,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):n.jsxRuntimeExports.jsx(ht,{onSelect:t,children:n.jsxRuntimeExports.jsx("div",{className:"h-20 w-20 cursor-pointer rounded-md border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px] hover:border-gray-400"})}),n.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[n.jsxRuntimeExports.jsx(ht,{onSelect:t,children:n.jsxRuntimeExports.jsx("small",{className:"cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700",children:e||!i.isEmpty(e)?"Replace Image":"Choose Image"})}),n.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"}),n.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:e,onBlur:({target:{value:a}})=>o(s,a),onChange:a=>t(a.target.value)})]})]}),Ei=({id:e,placeholder:t,value:s,onChange:o,onBlur:a})=>{const r={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},l=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:n.jsxRuntimeExports.jsx(Pn,{id:e,value:s,onBlur:p=>a(e,p),onChange:p=>o(p),modules:r,formats:l,placeholder:t,className:"mt-1 rounded-md"})},_i=({schema:e,formData:t,onChange:s})=>{const[o,a]=w.useState([]),r=ne("getPages",()=>[]),{type:l="page",href:p="",target:f="self"}=t;return w.useEffect(()=>{(async()=>{const u=await r();a(u||[])})()},[]),n.jsxRuntimeExports.jsxs("div",{children:[n.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(e==null?void 0:e.title)??"Link"}),n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[n.jsxRuntimeExports.jsx("select",{name:"type",value:l,onChange:u=>s({...t,type:u.target.value}),children:[{const:"page",title:"Open Page"},{const:"url",title:"Open URL"},{const:"email",title:"Compose Email"},{const:"telephone",title:"Call Phone"},{const:"scroll",title:"Scroll to element"}].map(u=>n.jsxRuntimeExports.jsx("option",{value:u.const,children:u.title},u.const))}),l==="page"?n.jsxRuntimeExports.jsxs("select",{name:"href",placeholder:"Choose Page",value:p,onChange:u=>s({...t,href:u.target.value}),children:[n.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),i.map(o,u=>n.jsxRuntimeExports.jsx("option",{value:u.slug,children:u.name},u.uuid))]}):n.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:p,onChange:u=>s({...t,href:u.target.value}),placeholder:l==="page"||l==="url"?"Enter URL":l==="scroll"?"#ElementID":"Enter detail"}),(l==="page"||l==="url")&&n.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[n.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:f==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>s({...t,target:f==="_blank"?"_self":"_blank"})}),n.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})};exports.Accordion=_r;exports.AccordionContent=As;exports.AccordionItem=Rs;exports.AccordionTrigger=ks;exports.Alert=Ns;exports.AlertDescription=Cs;exports.AlertDialog=Tr;exports.AlertDialogAction=Ls;exports.AlertDialogCancel=Os;exports.AlertDialogContent=Ps;exports.AlertDialogDescription=Ds;exports.AlertDialogFooter=Is;exports.AlertDialogHeader=Ts;exports.AlertDialogTitle=Ms;exports.AlertDialogTrigger=Ir;exports.AlertTitle=Ss;exports.Badge=Pr;exports.Button=ws;exports.Card=Hs;exports.CardContent=Js;exports.CardDescription=Ks;exports.CardFooter=Qs;exports.CardHeader=Ws;exports.CardTitle=Ys;exports.Command=nt;exports.CommandDialog=gi;exports.CommandEmpty=Jo;exports.CommandGroup=Qo;exports.CommandInput=Yo;exports.CommandItem=Zo;exports.CommandList=Ko;exports.CommandSeparator=Xo;exports.CommandShortcut=en;exports.ContextMenu=bi;exports.ContextMenuCheckboxItem=an;exports.ContextMenuContent=on;exports.ContextMenuGroup=vi;exports.ContextMenuItem=nn;exports.ContextMenuLabel=ln;exports.ContextMenuPortal=yi;exports.ContextMenuRadioGroup=wi;exports.ContextMenuRadioItem=rn;exports.ContextMenuSeparator=cn;exports.ContextMenuShortcut=dn;exports.ContextMenuSub=ji;exports.ContextMenuSubContent=sn;exports.ContextMenuSubTrigger=tn;exports.ContextMenuTrigger=hi;exports.Dialog=tt;exports.DialogContent=Pe;exports.DialogDescription=Gs;exports.DialogFooter=qs;exports.DialogHeader=Fs;exports.DialogTitle=Us;exports.DialogTrigger=Vs;exports.DropdownMenu=si;exports.DropdownMenuCheckboxItem=Io;exports.DropdownMenuContent=Po;exports.DropdownMenuGroup=ni;exports.DropdownMenuItem=To;exports.DropdownMenuLabel=Do;exports.DropdownMenuPortal=ai;exports.DropdownMenuRadioGroup=ii;exports.DropdownMenuRadioItem=Mo;exports.DropdownMenuSeparator=Lo;exports.DropdownMenuShortcut=Oo;exports.DropdownMenuSub=ri;exports.DropdownMenuSubContent=Bo;exports.DropdownMenuSubTrigger=_o;exports.DropdownMenuTrigger=oi;exports.HoverCard=Wr;exports.HoverCardContent=bo;exports.HoverCardTrigger=Yr;exports.IconPickerField=ki;exports.ImagePickerField=Ci;exports.ImagesPanel=Si;exports.Input=Xs;exports.Label=Zs;exports.LinkField=_i;exports.Menubar=ao;exports.MenubarCheckboxItem=mo;exports.MenubarContent=co;exports.MenubarGroup=qr;exports.MenubarItem=uo;exports.MenubarLabel=fo;exports.MenubarMenu=Fr;exports.MenubarPortal=Ur;exports.MenubarRadioGroup=Hr;exports.MenubarRadioItem=po;exports.MenubarSeparator=xo;exports.MenubarShortcut=go;exports.MenubarSub=Gr;exports.MenubarSubContent=lo;exports.MenubarSubTrigger=io;exports.MenubarTrigger=ro;exports.Popover=zr;exports.PopoverContent=no;exports.PopoverTrigger=$r;exports.RichTextEditorField=Ei;exports.ScrollArea=to;exports.ScrollBar=st;exports.Select=Kr;exports.SelectContent=vo;exports.SelectGroup=Jr;exports.SelectItem=jo;exports.SelectLabel=yo;exports.SelectSeparator=wo;exports.SelectTrigger=ho;exports.SelectValue=Qr;exports.Separator=Vo;exports.Sheet=Xr;exports.SheetClose=ei;exports.SheetContent=Ao;exports.SheetDescription=Eo;exports.SheetFooter=So;exports.SheetHeader=No;exports.SheetTitle=Co;exports.SheetTrigger=Zr;exports.Skeleton=xi;exports.Switch=js;exports.Tabs=so;exports.TabsContent=ke;exports.TabsList=ot;exports.TabsTrigger=Re;exports.Textarea=eo;exports.Toaster=fi;exports.Toggle=ys;exports.Tooltip=Or;exports.TooltipContent=oo;exports.TooltipPortal=Dr;exports.TooltipProvider=Lr;exports.TooltipTrigger=Vr;exports.activePanelAtom=es;exports.addBlockOffCanvasAtom=ts;exports.addBlocksModalAtom=Tt;exports.advanceStylingOpenAtom=Jt;exports.atom=K;exports.atomWithDefault=Qn;exports.atomWithStorage=ue;exports.badgeVariants=Es;exports.buttonVariants=Be;exports.canAddChildBlock=we;exports.canDeleteBlock=ma;exports.canDropBlock=fa;exports.canDuplicateBlock=ua;exports.canvasIframeAtom=Zt;exports.chaiBuilderPropsAtom=Ne;exports.chaiExternalDataAtom=Ct;exports.createStore=kt;exports.dataProvidersAtom=Ze;exports.draggingFlagAtom=ns;exports.editLayerNameAtom=Xt;exports.getBlockJSONFromSchemas=ze;exports.getBlockJSONFromUISchemas=Ve;exports.inlineEditingActiveAtom=os;exports.isDevelopment=ta;exports.networkModeAtom=Qt;exports.pageSyncStateAtom=Ee;exports.presentBlocksAtom=G;exports.reducer=zo;exports.showPredefinedBlockCategoryAtom=ss;exports.toast=$o;exports.toggleVariants=vs;exports.useActiveLanguage=hs;exports.useActiveModal=dr;exports.useActivePanel=fr;exports.useAddBlock=ja;exports.useAddBlockParent=xr;exports.useAddClassesToBlocks=Na;exports.useAllBlocks=zt;exports.useAtom=Un;exports.useAtomValue=At;exports.useBlockContentByLanguage=Er;exports.useBrandingOptions=qt;exports.useBuilderProp=ne;exports.useBuilderReset=hr;exports.useBuildingBlocks=$t;exports.useCanvasHistory=_e;exports.useCanvasWidth=La;exports.useCanvasZoom=Va;exports.useCopyBlockIds=za;exports.useCurrentPage=Ut;exports.useCutBlockIds=ds;exports.useDarkMode=$a;exports.useDeveloperPreviewMode=qa;exports.useDuplicateBlocks=ms;exports.useFeatureSupport=jr;exports.useGetPageData=Xe;exports.useHiddenBlockIds=Ga;exports.useHighlightBlockId=ps;exports.useLanguages=Cr;exports.useMarkAsGlobalBlock=Wa;exports.useMoveBlocks=Ya;exports.usePageDataProviders=as;exports.usePasteBlocks=Ja;exports.usePreviewMode=Ft;exports.usePrimaryLanguage=Sr;exports.useProject=Xa;exports.useReadOnlyMode=ur;exports.useRemoveBlocks=Za;exports.useRemoveClassesFromBlocks=tr;exports.useSavePage=Da;exports.useSelectedBlock=ha;exports.useSelectedBlockAllClasses=sr;exports.useSelectedBlockCurrentClasses=ar;exports.useSelectedBlockIds=me;exports.useSelectedBlocksDisplayChild=ba;exports.useSelectedBreakpoints=br;exports.useSelectedStylingBlocks=Ke;exports.useSetAllBlocks=da;exports.useSetAtom=Nt;exports.useStore=Fe;exports.useStylingBreakpoint=rs;exports.useStylingState=rr;exports.useToast=Fo;exports.useTranslations=yr;exports.useTreeData=ca;exports.useUILibraryBlocks=Rr;exports.useUpdateBlocksProps=ir;exports.useUpdateBlocksPropsRealtime=lr;
|