@chaibuilder/sdk 1.2.36 → 1.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/{AddBlocks-_wOcyJY6.cjs → AddBlocks-D6H1c91w.cjs} +1 -1
  2. package/dist/{AddBlocks-NSDb7WP1.js → AddBlocks-ah7ZuAiO.js} +1 -1
  3. package/dist/{BrandingOptions-D0NIsUGf.cjs → BrandingOptions-4D94jluh.cjs} +1 -1
  4. package/dist/{BrandingOptions-cTHORxqQ.js → BrandingOptions-d0DbWp_N.js} +1 -1
  5. package/dist/{CanvasArea-D1TUKvIF.cjs → CanvasArea-7l8qSx52.cjs} +1 -1
  6. package/dist/{CanvasArea-6nE635uC.js → CanvasArea-h3Nu-SWT.js} +2 -2
  7. package/dist/{ChaiBuilderEditor-xecsXt0z.cjs → ChaiBuilderEditor-6o0IOkBV.cjs} +1 -1
  8. package/dist/{ChaiBuilderEditor-rPo8yLDm.js → ChaiBuilderEditor-VOCsboQ9.js} +2 -2
  9. package/dist/{CurrentPage-V5uHSGUJ.cjs → CurrentPage-NTowK7yE.cjs} +1 -1
  10. package/dist/{CurrentPage-qw0ucVmW.js → CurrentPage-p6Y9JO9p.js} +2 -2
  11. package/dist/{ListTree-aamIu2qf.cjs → ListTree-4wBD1QKc.cjs} +1 -1
  12. package/dist/{ListTree-8K5aSjSH.js → ListTree-tog0B3PA.js} +3 -3
  13. package/dist/{PagesPanel-RXZ-q8Ut.cjs → PagesPanel-3pC0vx2q.cjs} +1 -1
  14. package/dist/{PagesPanel-31uE12Z7.js → PagesPanel-NPSwC_QB.js} +3 -3
  15. package/dist/{ProjectPanel-oYC1szxp.js → ProjectPanel-cTPurlHf.js} +3 -3
  16. package/dist/{ProjectPanel-LMe85RwX.cjs → ProjectPanel-tvtrXbyb.cjs} +1 -1
  17. package/dist/{Settings-o3wnp8uI.js → Settings-P8Bbl06y.js} +2 -2
  18. package/dist/{Settings-eufW6-XQ.cjs → Settings-s19XidRS.cjs} +1 -1
  19. package/dist/{SidePanels-bmrMhSWl.cjs → SidePanels-8NwJG0mo.cjs} +1 -1
  20. package/dist/{SidePanels-nIiJwfQ7.js → SidePanels-iqAbcqUv.js} +2 -2
  21. package/dist/{Topbar--8q83rcZ.js → Topbar-8tMcFyw5.js} +1 -1
  22. package/dist/{Topbar-CVXB8DGf.cjs → Topbar-SaVYT87H.cjs} +1 -1
  23. package/dist/{UnsplashImages-aOVqzTK6.cjs → UnsplashImages-UJthlQqt.cjs} +1 -1
  24. package/dist/{UnsplashImages-SDBkrhpm.js → UnsplashImages-qTNzA02V.js} +1 -1
  25. package/dist/{UploadImages-e3dCOlqV.js → UploadImages-PJyejbcA.js} +1 -1
  26. package/dist/{UploadImages-vGCEvksG.cjs → UploadImages-zPJBckqp.cjs} +1 -1
  27. package/dist/{add-page-modal-Co1d8dlm.js → add-page-modal-9SkVr8qi.js} +3 -3
  28. package/dist/{add-page-modal-VMs_u3IX.cjs → add-page-modal-jzDXOPVp.cjs} +1 -1
  29. package/dist/{confirm-alert-t1ESMHKf.cjs → confirm-alert-NECBDLLG.cjs} +1 -1
  30. package/dist/{confirm-alert-N9xn7uVF.js → confirm-alert-mPe-H0Yj.js} +1 -1
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.js +1 -1
  33. package/dist/{delete-page-modal-GxRd1jPl.js → delete-page-modal-kHnMpsjv.js} +2 -2
  34. package/dist/{delete-page-modal-MK--z13p.cjs → delete-page-modal-pRepvBUK.cjs} +1 -1
  35. package/dist/email.cjs +1 -1
  36. package/dist/email.js +1 -1
  37. package/dist/{form-UuH4B151.cjs → form-5-WyQ9J_.cjs} +1 -1
  38. package/dist/{form-IoNGO0Ov.js → form-prkciikc.js} +1 -1
  39. package/dist/{index-ntl3hbnf.js → index-X3veo7pJ.js} +2 -2
  40. package/dist/{index-Jy9Zfhj_.cjs → index-wnXwbbRk.cjs} +1 -1
  41. package/dist/{page-viewer-inM0HSLv.cjs → page-viewer-HGX57lyj.cjs} +1 -1
  42. package/dist/{page-viewer-eIxEA6s_.js → page-viewer-jsyCYHKL.js} +3 -3
  43. package/dist/{project-general-setting-N_Cg6F3x.cjs → project-general-setting-2yhhHbME.cjs} +1 -1
  44. package/dist/{project-general-setting-VDnseYOn.js → project-general-setting-sVRpF1o-.js} +3 -3
  45. package/dist/{project-seo-setting-crFlVR2_.cjs → project-seo-setting-FMpb2qiM.cjs} +1 -1
  46. package/dist/{project-seo-setting-9nwQDhti.js → project-seo-setting-YTVfe0Hq.js} +2 -2
  47. package/dist/{single-page-detail-W2AlRYUx.cjs → single-page-detail-Y4OBAZAL.cjs} +1 -1
  48. package/dist/{single-page-detail-DMm5KvFV.js → single-page-detail-o129SZnS.js} +4 -4
  49. package/dist/studio.cjs +1 -1
  50. package/dist/studio.js +2 -2
  51. package/dist/ui.cjs +1 -1
  52. package/dist/ui.js +1 -1
  53. package/dist/{useCanvasSettings-W54LZ1wt.cjs → useCanvasSettings-DVIzrXND.cjs} +1 -1
  54. package/dist/{useCanvasSettings-zsHMTgls.js → useCanvasSettings-J3l6fcbV.js} +1 -1
  55. package/package.json +1 -1
@@ -203,4 +203,4 @@ object-assign/index.js:
203
203
  (c) Sindre Sorhus
204
204
  @license MIT
205
205
  *)
206
- */W();var au1=process.env.NODE_ENV!=="production"?cu1:()=>null;function ru1(){return new URLSearchParams(window.location.search).has("dnd")}function nu1(){return new URLSearchParams(window.location.search).has("outline")}const ou1={dnd:ru1(),arborist:nu1()},Gr=l1.atom(null);Gr.debugLabel="chaiBuilderPropsAtom";const Yx=l1.atom({});Yx.debugLabel="chaiExternalDataAtom";class Xx extends h.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?S.jsxRuntimeExports.jsxs("div",{className:"h-full w-full rounded-md bg-red-200 p-4 text-red-500",id:"errorBoundary",children:[S.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Oops! Something went wrong."}),S.jsxRuntimeExports.jsx("p",{children:"Please try again later."})]}):this.props.children}}const su1=()=>!1,lu1=t=>{const e=t.replace(x4.STYLES_KEY,"").split(",");return{baseClasses:e[0],classes:e[1]}},ha=D.memoize((t,e)=>{if(!t)return!0;const c=h3.getBlockComponent(t);return c&&D.has(c,"canAcceptBlock")?c.canAcceptBlock(e):!1}),iu1=D.memoize((t,e)=>{const c=h3.getBlockComponent(e);return c&&D.has(c,"canBeNested")?c.canBeNested(t):!0}),uu1=D.memoize(t=>{const e=h3.getBlockComponent(t);return e&&D.has(e,"canDuplicate")?e.canDuplicate():!0}),du1=D.memoize(t=>{const e=h3.getBlockComponent(t);return e&&D.has(e,"canDelete")?e.canDelete():!0});function Qx(t,e,c){const a=D.filter(t,n=>n._parent===e),r=[];for(let n=0;n<a.length;n++){const o=$x(a[n]);if(Object.keys(o).length>0&&Object.keys(o).forEach(s=>{a[n][s]=`slot:${W4.generateUUID()}`}),D.filter(t,{_parent:a[n]._id}).length>0){const s=W4.generateUUID();r.push({...a[n],oldId:a[n]._id,_id:s,_parent:c}),r.push(D.flatten(Qx(t,a[n]._id,s)))}else r.push({...a[n],oldId:a[n]._id,_id:W4.generateUUID(),_parent:c})}return D.flatten(r)}function _x(t){const e={};t.forEach(a=>{e[a._id]={...a,children:[]}});const c=[];return t.forEach(a=>{if(a._parent){const r=e[a._parent];r&&r.children.push(e[a._id])}else c.push(e[a._id])}),c}const $x=t=>{const e={};return Object.keys(t).forEach(c=>{D.isString(t[c])&&t[c].startsWith("slot")&&(e[c]=t[c].replace("slot:",""))}),e},hu1=(t,e,c=null)=>{let a=D.find(t,{_id:e});a={...a,oldId:a._id,_id:W4.generateUUID()},c&&(a={...a,_parent:c});const r=[a];D.filter(t,{_parent:e}).length>0&&r.push(D.flatten(Qx(t,e,a._id)));const n=D.flatten(r);return D.map(n,o=>{const s=o,l=$x(s);return Object.keys(l).length>0&&Object.keys(l).forEach(u=>{const i=D.find(n,{oldId:l[u].replace("slot:","")});s[u]=`slot:${i._id}`}),D.omit(s,["global","oldId"])})};const S4=l1.atom([]);S4.debugLabel="presentBlocksAtom";const tL=l1.atom(t=>{const e=t(S4);return _x([...e])});tL.debugLabel="treeDSBlocks";S4.debugLabel="presentBlocksAtom";const Jr=ce1(S4);Jr.debugLabel="pageBlocksAtomsAtom";const vu1=l1.atom("");vu1.debugLabel="builderActivePageAtom";const fu1=l1.atom(-1);fu1.debugLabel="destinationDropIndexAtom";const eL=l1.atom([]);eL.debugLabel="buildingBlocksAtom";const gu1=l1.atom(t=>{const e=t(eL);return D.filter(e,c=>D.has(c,"blockId"))});gu1.debugLabel="globalBlocksAtom";const Yr=l1.atom([]);Yr.debugLabel="selectedBlockIdsAtom";const Xr=l1.atom(t=>{const e=t(S4),c=t(Yr);return D.map(D.filter(e,({_id:a})=>D.includes(c,a)),a=>({...a}))});Xr.debugLabel="selectedBlocksAtom";const ue=l1.atom(t=>{const e=t(Xr);if(e.length===0)return null;if(e.length===1)return e[0]});ue.debugLabel="selectedBlockAtom";const pu1=t=>D.get(t,"_parent",null),mu1=l1.atom(t=>{const e=t(Xr),c=D.map(e,pu1);return D.filter(t(S4),a=>D.includes(c,a._id))});mu1.debugLabel="selectedBlocksParentsAtom";const cL=l1.atom(()=>!1);cL.debugLabel="selectedBlockFlexChildAtom";const aL=l1.atom(()=>!1);aL.debugLabel="selectedBlockGridChildAtom";const Qr=l1.atom("");Qr.debugLabel="styleStateAtom";const rL=g4("styleBreakpoint","xs");rL.debugLabel="styleBreakpointAtom";const zu1=()=>({flexChild:l1.useAtomValue(cL),gridChild:l1.useAtomValue(aL)}),bu1=()=>l1.useAtomValue(ue),Mu1=l1.atom(t=>{const e=t(ue),c=t(S4);let a=e;const r=[e];do{const n=c.find(({_id:o})=>o===(a==null?void 0:a._parent));a=n,n&&r.push(n)}while(a!=null&&a._parent);return r}),nL=()=>l1.useAtomValue(Mu1),wu1=()=>{const t=nL();return h.useMemo(()=>{for(let e=0;e<t.length;e++){const c=h3.getBlockComponent(t[e]._type),a=D.cloneDeep(D.get(c,"blockState",{}));if(!D.isEmpty(a))return{settings:a,block:t[e]}}return{}},[t])},Cu1=()=>{const t=nL();return h.useMemo(()=>{let e={};for(let c=0;c<t.length;c++){const a=h3.getBlockComponent(t[c]._type),r=D.get(a,"customStylingStates",{});e={...e,...r}}return e},[t])},g3=()=>{const[t,e]=l1.useAtom(Yr),c=h.useCallback(a=>{e(r=>D.includes(r,a)?D.without(r,a):[...r,a])},[e]);return[t,e,c]},va=t=>{switch(t.type){case"singular":return t.uiSchema;case"model":const{properties:e}=t,c={};return Object.keys(e).forEach(n=>{const o=e[n];if(D.includes(["slot","styles"],o.type))return;const s=n;c[s]=va(o)}),c;case"list":const{itemProperties:a}=t,r={items:{}};return Object.keys(a).forEach(n=>{const o=a[n];if(D.includes(["slot","styles"],o.type))return;const s=n;r.items[s]=va(o)}),r;default:return{}}},fa=t=>{switch(t.type){case"singular":return t.schema;case"model":const{properties:e,title:c}=t,a={title:c,type:"object",properties:{}};return Object.keys(e).forEach(s=>{const l=e[s];if(D.includes(["slot","styles"],l.type))return;const u=s;a.properties[u]=fa(l)}),a;case"list":const{itemProperties:r,title:n}=t,o={title:n,type:"array",items:{type:"object",properties:{}}};return Object.keys(r).forEach(s=>{const l=r[s];if(D.includes(["slot","styles"],l.type))return;const u=s;o.items.properties[u]=fa(l),D.set(o.items,"title",D.get(l,"itemTitle",`${n} item`))}),o;default:return{}}},oL=t=>{if(!t)return{};const e={};return Object.keys(t).forEach(c=>{e[c]=Hu1(t[c])}),e},Vu1=t=>{if(D.isEmpty(t.default))return[];const{itemProperties:e}=t;return D.map(t.default,c=>{const a={...c};return D.forIn(c,(r,n)=>{D.has(e,n)&&D.get(e[n],"i18n",!1)&&(a[n]=x4.I18N_KEY)}),a})},Hu1=t=>{switch(t.type){case"styles":return t.default;case"slot":return`${x4.SLOT_KEY}${W4.generateUUID()}`;case"singular":const{schema:e}=t;return D.get(e,"default","");case"model":return oL(t.properties);case"list":return Vu1(t);default:return""}};var _r={exports:{}},bv1=_r.exports;(function(t){(function(){"use strict";function e(a,r,n){return a.splice(r,!n||1+n-r+(!(n<0^r>=0)&&(n<0||-1)*a.length)),a.length}let c=function(){let a=[],r=-1,n=0,o=!1,s;function l(u,i){return!u||typeof u[i]!="function"?this:(o=!0,u[i](),o=!1,this)}return{add:function(u){return o?this:(a.splice(r+1,a.length-r),a.push(u),n&&a.length>n&&e(a,0,-(n+1)),r=a.length-1,s&&s(),this)},setCallback:function(u){s=u},undo:function(){let u=a[r];if(!u)return this;const i=u.groupId;for(;u.groupId===i&&(l(u,"undo"),r-=1,u=a[r],!(!u||!u.groupId)););return s&&s(),this},redo:function(){let u=a[r+1];if(!u)return this;const i=u.groupId;for(;u.groupId===i&&(l(u,"redo"),r+=1,u=a[r+1],!(!u||!u.groupId)););return s&&s(),this},clear:function(){let u=a.length;a=[],r=-1,s&&u>0&&s()},hasUndo:function(){return r!==-1},hasRedo:function(){return r<a.length-1},getCommands:function(u){return u?a.filter(i=>i.groupId===u):a},getIndex:function(){return r},setLimit:function(u){n=u}}};t.exports?t.exports=c:window.UndoManager=c})()})(_r);var yu1=_r.exports;const xu1=V4.getDefaultExportFromCjs(yu1),Lu1=l1.atom(Ac.BRANDING_OPTIONS_DEFAULTS),Su1=l1.atom(null),de=()=>{const[t,e]=l1.useAtom(Lu1);return[D.isObject(t)?{...Ac.BRANDING_OPTIONS_DEFAULTS,...t}:Ac.BRANDING_OPTIONS_DEFAULTS,e]},Au1=()=>l1.useAtom(Su1),Fu1=l1.atom(null),sL=()=>({currentPage:l1.useAtomValue(Fu1)});function Bu1(t){return _x(t)}const $r=(t,e)=>D.flatten(t.map(c=>{if(c=e?{...c,_parent:e}:{...c},c.children){const a=[...c.children];return delete c.children,D.flatten([c,...$r(a,c._id)])}return c}));function tn(t,e=!1){for(let c=0;c<t.length;c++){const a=t[c];a.global&&!e?t[c]={type:"GlobalBlock",blockId:a.blockId,_parent:D.get(a,"_parent",null),_id:a._id}:a.children&&a.children.length&&tn(a.children)}}function lL(t){let e=[],c=D.filter(t,{type:"GlobalBlock"});return c.length>0&&(c=D.map(c,iL),D.each(c,a=>{e=[...e,...Eu1(a)]})),e}function Eu1(t){let e=[];const c=D.get(D.first(t),"_parent",null);D.set(D.first(t),"_parent",null);const a=[flatToNestedInstance.convert(uL(t))];tn(a,!0);let r=$r(a,t[0]._id);return r=D.set(r,"0._parent",c),e=[...e,r,...lL(r)],e}function iL(t){const e=D.find(ga,{_id:t._id});if(!e)return[];const c=[e],a=D.filter(ga,{_parent:t._id});return a.length?D.flatten([...c,...D.flatten(D.map(a,iL))]):D.flatten(c)}const uL=t=>JSON.parse(JSON.stringify(t));let ga=[];function Ou1(t){ga=t;const e=Bu1(uL(t));tn(e);const c=$r(e,null),a=lL(c),r={};return D.each(a,n=>D.set(r,D.first(n).blockId,n)),[c,r]}const dL=()=>{const[t]=de(),{currentPage:e}=sL(),[c]=X4();return h.useCallback(()=>{const a=D.map(c,n=>D.omit(n,["expanded","order","title","siblings","tempClasses"])),[r=[]]=Ou1(a);return{currentPage:e,blocks:r}},[t,e,c])},B2=(t,e=void 0)=>{const c=l1.useAtomValue(Gr);return D.get(c,t,e)},en=l1.atom([]);en.debugLabel="dataProvidersAtom";const cn=()=>l1.useAtom(en),j0=l1.atom("SAVED");j0.debugLabel="builderSaveStateAtom";const hL=()=>{const[t,e]=l1.useAtom(j0),c=B2("onSavePage",async u=>{}),a=B2("onSave",async u=>{}),r=B2("onSaveStateChange",D.noop),n=dL(),[o]=cn(),[s]=de();return{savePage:eg.useThrottledCallback(async()=>{e("SAVING"),r("SAVING");const u=n();return await c({blocks:u.blocks,providers:o}),await a({blocks:u.blocks,providers:o,brandingOptions:s}),setTimeout(()=>{e("SAVED"),r("SAVED")},100),!0},[n,e,s,a,r],3e3),saveState:t,setSaveState:e}},D4=new xu1;D4.setLimit(50);const he=()=>{const[,t]=l1.useAtom(j0),e=B2("onSaveStateChange",D.noop);return h.useEffect(()=>(D4.setCallback(()=>{t("UNSAVED"),e("UNSAVED")}),()=>{D4.setCallback(D.noop)}),[]),{add:D4.add,undo:D4.undo,redo:D4.redo,hasRedo:D4.hasRedo,hasUndo:D4.hasUndo,clear:D4.clear}},an=(t,e)=>{const c=[],a=D.filter(t,r=>D.includes(e,r._id)||D.includes(e,r._parent)?(c.push(r._id),!1):!0);return D.isEmpty(c)?a:an(a,c)},vL=()=>{const[t]=X4(),[e,c]=g3(),{setNewBlocks:a}=Q4();return h.useCallback(r=>{var o;const n=((o=D.find(t,{_id:r[0]}))==null?void 0:o._parent)||null;a(an(t,r)),setTimeout(()=>c(n?[n]:[]),200)},[t,c,e])};function Pu1(t,e,c,a){let r=t.filter(s=>!s._parent);c&&(r=t.filter(s=>s._parent===c));const n=a!==void 0?a:r.length;let o=t.length;for(let s=0,l=0;s<t.length;s++)if(t[s]._parent===c){if(l===n){o=s;break}l++}return!c&&a!==void 0&&a>=r.length&&(o=t.length),[...t.slice(0,o),...e,...t.slice(o)]}function Wf(t){const e=[],c=new Map;t.forEach(r=>{c.set(r._id,r)});function a(r){const n=c.get(r);e.includes(n)||(e.push(n),t.forEach(o=>{o._parent===r&&a(o._id)}))}return t.forEach(r=>{r._parent||a(r._id)}),e}const ku1=(t,e,c,a)=>{if(D.isEmpty(e))return Wf(t);function r(s,l){const u=s.filter(d=>d._parent===l);let i=[...u];return u.forEach(d=>{i=i.concat(r(s,d._id))}),i}const n=e.reduce((s,l)=>{const u=t.find(i=>i._id===l);if(u){const i=r(t,l);s.push(u,...i)}return s},[]);t=t.filter(s=>!n.includes(s)),n.forEach(s=>{e.includes(s._id)&&(s._parent=c)});let o;if(!c)o=a;else{const s=t.findIndex(l=>l._id===c);if(s===-1)o=a;else{o=s+1;let l=0;for(;l<a&&o<t.length;)t[o]._parent===c&&l++,o++}}return t.splice(o,0,...n),Wf(t)},Ru1=()=>{const[,t]=X4();return{setNewBlocks:e=>{t(e)},addBlocks:(e,c,a)=>{t(r=>Pu1(r,e,c,a))},removeBlocks:e=>{t(c=>an(c,e))},moveBlocks:(e,c,a)=>{t(r=>ku1(r,e,c,a))},updateBlocksProps:e=>{t(c=>{const a=e.map(r=>r._id);return c.map(r=>{if(a.includes(r._id)){const n=D.find(e,{_id:r._id});return{...r,...D.omit(n,"_id")}}return r})})}}},X4=()=>l1.useAtom(S4),Q4=()=>{const{add:t}=he(),[e]=X4(),{setNewBlocks:c,addBlocks:a,removeBlocks:r,moveBlocks:n,updateBlocksProps:o}=Ru1();return{moveBlocks:(p,g,m)=>{const z=D.map(p,w=>{const C=e.find(F=>F._id===w)._parent||null,L=e.filter(F=>C?F._parent===C:!F._parent).map(F=>F._id).indexOf(w);return{_id:w,oldParent:C,oldPosition:L}}),b=z.find(({_id:w})=>w===p[0]);b&&b.oldParent===g&&b.oldPosition===m||(n(p,g,m),t({undo:()=>D.each(z,({_id:w,oldParent:V,oldPosition:C})=>{n([w],V,C)}),redo:()=>n(p,g,m)}))},addBlocks:(p,g,m)=>{a(p,g,m),t({undo:()=>r(D.map(p,"_id")),redo:()=>a(p,g,m)})},removeBlocks:p=>{var b;const g=(b=D.first(p))==null?void 0:b._parent,z=e.filter(w=>g?w._parent===g:!w._parent).indexOf(D.first(p));r(D.map(p,"_id")),t({undo:()=>a(p,g,z),redo:()=>r(D.map(p,"_id"))})},updateBlocks:(p,g,m)=>{let z=[];if(m)z=D.map(p,b=>({_id:b,...m}));else{const b=D.keys(g);z=D.map(p,w=>{const V=e.find(H=>H._id===w),C={_id:w};return D.each(b,H=>C[H]=V[H]),C})}o(D.map(p,b=>({_id:b,...g}))),t({undo:()=>o(z),redo:()=>o(D.map(p,b=>({_id:b,...g})))})},updateBlocksRuntime:(p,g)=>{o(D.map(p,m=>({_id:m,...g})))},setNewBlocks:p=>{c(p),t({undo:()=>c(e),redo:()=>c(p)})},updateMultipleBlocksProps:p=>{let g=[];g=D.map(p,m=>{const z=D.keys(m),b=e.find(V=>V._id===m._id),w={};return D.each(z,V=>w[V]=b[V]),w}),o(p),t({undo:()=>o(g),redo:()=>o(p)})}}},fL=R3.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"}}),gL=x.forwardRef(({className:t,variant:e,size:c,...a},r)=>S.jsxRuntimeExports.jsx(ag.Root,{ref:r,className:s1.cn(fL({variant:e,size:c,className:t})),...a}));gL.displayName=ag.Root.displayName;const pL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(Fc.Root,{className:s1.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",t),...e,ref:c,children:S.jsxRuntimeExports.jsx(Fc.Thumb,{className:s1.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")})}));pL.displayName=Fc.Root.displayName;const ve=R3.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"}}),M0=x.forwardRef(({className:t,variant:e,size:c,asChild:a=!1,...r},n)=>{const o=a?PA.Slot:"button";return S.jsxRuntimeExports.jsx(o,{className:s1.cn(ve({variant:e,size:c,className:t})),ref:n,...r})});M0.displayName="Button";const Iu1=F3.Root,mL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(F3.Item,{ref:c,className:s1.cn("border-b",t),...e}));mL.displayName="AccordionItem";const zL=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsx(F3.Header,{className:"flex",children:S.jsxRuntimeExports.jsxs(F3.Trigger,{ref:a,className:s1.cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...c,children:[e,S.jsxRuntimeExports.jsx(d2.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));zL.displayName=F3.Trigger.displayName;const bL=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsx(F3.Content,{ref:a,className:s1.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",t),...c,children:S.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:e})}));bL.displayName=F3.Content.displayName;const Nu1=R3.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"}}),ML=x.forwardRef(({className:t,variant:e,...c},a)=>S.jsxRuntimeExports.jsx("div",{ref:a,role:"alert",className:s1.cn(Nu1({variant:e}),t),...c}));ML.displayName="Alert";const wL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("h5",{ref:c,className:s1.cn("mb-1 font-medium leading-none tracking-tight",t),...e}));wL.displayName="AlertTitle";const CL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("div",{ref:c,className:s1.cn("text-sm [&_p]:leading-relaxed",t),...e}));CL.displayName="AlertDescription";const VL=R3.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"}}),ju1=({className:t,variant:e,...c})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn(VL({variant:e}),t),...c}),Tu1=j2.Root,Du1=j2.Trigger,HL=({className:t,...e})=>S.jsxRuntimeExports.jsx(j2.Portal,{className:s1.cn(t),...e});HL.displayName=j2.Portal.displayName;const yL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(j2.Overlay,{className:s1.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",t),...e,ref:c}));yL.displayName=j2.Overlay.displayName;const xL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsxs(HL,{children:[S.jsxRuntimeExports.jsx(yL,{}),S.jsxRuntimeExports.jsx(j2.Content,{ref:c,className:s1.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",t),...e})]}));xL.displayName=j2.Content.displayName;const LL=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("flex flex-col space-y-2 text-center sm:text-left",t),...e});LL.displayName="AlertDialogHeader";const SL=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});SL.displayName="AlertDialogFooter";const AL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(j2.Title,{ref:c,className:s1.cn("text-lg font-semibold",t),...e}));AL.displayName=j2.Title.displayName;const FL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(j2.Description,{ref:c,className:s1.cn("text-sm text-muted-foreground",t),...e}));FL.displayName=j2.Description.displayName;const BL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(j2.Action,{ref:c,className:s1.cn(ve(),t),...e}));BL.displayName=j2.Action.displayName;const EL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(j2.Cancel,{ref:c,className:s1.cn(ve({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));EL.displayName=j2.Cancel.displayName;const rn=J1.Root,OL=J1.Trigger,PL=({className:t,...e})=>S.jsxRuntimeExports.jsx(J1.Portal,{className:s1.cn(t),...e});PL.displayName=J1.Portal.displayName;const kL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(J1.Overlay,{ref:c,className:s1.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",t),...e}));kL.displayName=J1.Overlay.displayName;const fe=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs(PL,{children:[S.jsxRuntimeExports.jsx(kL,{}),S.jsxRuntimeExports.jsxs(J1.Content,{ref:a,className:s1.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",t),...c,children:[e,S.jsxRuntimeExports.jsxs(J1.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:[S.jsxRuntimeExports.jsx(d2.Cross2Icon,{className:"h-4 w-4"}),S.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fe.displayName=J1.Content.displayName;const RL=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});RL.displayName="DialogHeader";const IL=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});IL.displayName="DialogFooter";const NL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(J1.Title,{ref:c,className:s1.cn("text-lg font-semibold leading-none tracking-tight",t),...e}));NL.displayName=J1.Title.displayName;const jL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(J1.Description,{ref:c,className:s1.cn("text-sm text-muted-foreground",t),...e}));jL.displayName=J1.Description.displayName;const TL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("div",{ref:c,className:s1.cn("rounded-xl border bg-card text-card-foreground shadow",t),...e}));TL.displayName="Card";const DL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("div",{ref:c,className:s1.cn("flex flex-col space-y-1.5 p-6",t),...e}));DL.displayName="CardHeader";const qL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("h3",{ref:c,className:s1.cn("font-semibold leading-none tracking-tight",t),...e}));qL.displayName="CardTitle";const ZL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("p",{ref:c,className:s1.cn("text-sm text-muted-foreground",t),...e}));ZL.displayName="CardDescription";const WL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("div",{ref:c,className:s1.cn("p-6 pt-0",t),...e}));WL.displayName="CardContent";const UL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("div",{ref:c,className:s1.cn(" flex items-center p-6 pt-0",t),...e}));UL.displayName="CardFooter";const KL=x.forwardRef(({className:t,type:e,...c},a)=>S.jsxRuntimeExports.jsx("input",{type:e,className:s1.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",t),ref:a,...c}));KL.displayName="Input";const qu1=R3.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),GL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(rg.Root,{ref:c,className:s1.cn(qu1(),t),...e}));GL.displayName=rg.Root.displayName;const nn=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("textarea",{className:s1.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",t),ref:c,...e}));nn.displayName="Textarea";const JL=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs(K2.Root,{ref:a,className:s1.cn("relative overflow-hidden",t),...c,children:[S.jsxRuntimeExports.jsx(K2.Viewport,{className:"h-full w-full rounded-[inherit]",children:e}),S.jsxRuntimeExports.jsx(on,{}),S.jsxRuntimeExports.jsx(K2.Corner,{})]}));JL.displayName=K2.Root.displayName;const on=x.forwardRef(({className:t,orientation:e="vertical",...c},a)=>S.jsxRuntimeExports.jsx(K2.ScrollAreaScrollbar,{ref:a,orientation:e,className:s1.cn("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",t),...c,children:S.jsxRuntimeExports.jsx(K2.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));on.displayName=K2.ScrollAreaScrollbar.displayName;const sn=I3.Root,ge=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(I3.List,{ref:c,className:s1.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));ge.displayName=I3.List.displayName;const w0=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(I3.Trigger,{ref:c,className:s1.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",t),...e}));w0.displayName=I3.Trigger.displayName;const C0=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(I3.Content,{ref:c,className:s1.cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));C0.displayName=I3.Content.displayName;const Zu1=V6.Portal,YL=V6.Provider,Wu1=V6.Root,Uu1=V6.Trigger,XL=x.forwardRef(({className:t,sideOffset:e=4,...c},a)=>S.jsxRuntimeExports.jsx(V6.Content,{ref:a,sideOffset:e,className:s1.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",t),...c}));XL.displayName=V6.Content.displayName;const Ku1=i0.Root,Gu1=i0.Trigger,QL=x.forwardRef(({className:t,align:e="center",sideOffset:c=4,...a},r)=>S.jsxRuntimeExports.jsx(i0.Portal,{children:S.jsxRuntimeExports.jsx(i0.Content,{ref:r,align:e,sideOffset:c,className:s1.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",t),...a})}));QL.displayName=i0.Content.displayName;const Ju1=K1.Menu,Yu1=K1.Group,Xu1=K1.Portal,Qu1=K1.Sub,_u1=K1.RadioGroup,_L=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(K1.Root,{ref:c,className:s1.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",t),...e}));_L.displayName=K1.Root.displayName;const $L=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(K1.Trigger,{ref:c,className:s1.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",t),...e}));$L.displayName=K1.Trigger.displayName;const tS=x.forwardRef(({className:t,inset:e,children:c,...a},r)=>S.jsxRuntimeExports.jsxs(K1.SubTrigger,{ref:r,className:s1.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",e&&"pl-8",t),...a,children:[c,S.jsxRuntimeExports.jsx(d2.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));tS.displayName=K1.SubTrigger.displayName;const eS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(K1.SubContent,{ref:c,className:s1.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",t),...e}));eS.displayName=K1.SubContent.displayName;const cS=x.forwardRef(({className:t,align:e="start",alignOffset:c=-4,sideOffset:a=8,...r},n)=>S.jsxRuntimeExports.jsx(K1.Portal,{children:S.jsxRuntimeExports.jsx(K1.Content,{ref:n,align:e,alignOffset:c,sideOffset:a,className:s1.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",t),...r})}));cS.displayName=K1.Content.displayName;const aS=x.forwardRef(({className:t,inset:e,...c},a)=>S.jsxRuntimeExports.jsx(K1.Item,{ref:a,className:s1.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",e&&"pl-8",t),...c}));aS.displayName=K1.Item.displayName;const rS=x.forwardRef(({className:t,children:e,checked:c,...a},r)=>S.jsxRuntimeExports.jsxs(K1.CheckboxItem,{ref:r,className:s1.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",t),checked:c,...a,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx(K1.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.CheckIcon,{className:"h-4 w-4"})})}),e]}));rS.displayName=K1.CheckboxItem.displayName;const nS=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs(K1.RadioItem,{ref:a,className:s1.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",t),...c,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx(K1.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),e]}));nS.displayName=K1.RadioItem.displayName;const oS=x.forwardRef(({className:t,inset:e,...c},a)=>S.jsxRuntimeExports.jsx(K1.Label,{ref:a,className:s1.cn("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...c}));oS.displayName=K1.Label.displayName;const sS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(K1.Separator,{ref:c,className:s1.cn("-mx-1 my-1 h-px bg-muted",t),...e}));sS.displayName=K1.Separator.displayName;const lS=({className:t,...e})=>S.jsxRuntimeExports.jsx("span",{className:s1.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});lS.displayname="MenubarShortcut";const $u1=xt.Root,td1=xt.Trigger,iS=x.forwardRef(({className:t,align:e="center",sideOffset:c=4,...a},r)=>S.jsxRuntimeExports.jsx(xt.Content,{ref:r,align:e,sideOffset:c,className:s1.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",t),...a}));iS.displayName=xt.Content.displayName;const ed1=y2.Root,cd1=y2.Group,ad1=y2.Value,uS=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs(y2.Trigger,{ref:a,className:s1.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",t),...c,children:[e,S.jsxRuntimeExports.jsx(y2.Icon,{asChild:!0,children:S.jsxRuntimeExports.jsx(d2.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));uS.displayName=y2.Trigger.displayName;const dS=x.forwardRef(({className:t,children:e,position:c="popper",...a},r)=>S.jsxRuntimeExports.jsx(y2.Portal,{children:S.jsxRuntimeExports.jsx(y2.Content,{ref:r,className:s1.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",c==="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",t),position:c,...a,children:S.jsxRuntimeExports.jsx(y2.Viewport,{className:s1.cn("p-1",c==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));dS.displayName=y2.Content.displayName;const hS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(y2.Label,{ref:c,className:s1.cn("px-2 py-1.5 text-sm font-semibold",t),...e}));hS.displayName=y2.Label.displayName;const vS=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs(y2.Item,{ref:a,className:s1.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",t),...c,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx(y2.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.CheckIcon,{className:"h-4 w-4"})})}),S.jsxRuntimeExports.jsx(y2.ItemText,{children:e})]}));vS.displayName=y2.Item.displayName;const fS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(y2.Separator,{ref:c,className:s1.cn("-mx-1 my-1 h-px bg-muted",t),...e}));fS.displayName=y2.Separator.displayName;const rd1=J1.Root,nd1=J1.Trigger,od1=J1.Close,gS=({className:t,...e})=>S.jsxRuntimeExports.jsx(J1.Portal,{className:s1.cn(t),...e});gS.displayName=J1.Portal.displayName;const pS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(J1.Overlay,{className:s1.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",t),...e,ref:c}));pS.displayName=J1.Overlay.displayName;const sd1=R3.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"}}),mS=x.forwardRef(({side:t="right",className:e,children:c,...a},r)=>S.jsxRuntimeExports.jsxs(gS,{children:[S.jsxRuntimeExports.jsx(pS,{}),S.jsxRuntimeExports.jsxs(J1.Content,{ref:r,className:s1.cn(sd1({side:t}),e),...a,children:[c,S.jsxRuntimeExports.jsxs(J1.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:[S.jsxRuntimeExports.jsx(d2.Cross2Icon,{className:"h-4 w-4"}),S.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));mS.displayName=J1.Content.displayName;const zS=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("flex flex-col space-y-2 text-center sm:text-left",t),...e});zS.displayName="SheetHeader";const bS=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});bS.displayName="SheetFooter";const MS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(J1.Title,{ref:c,className:s1.cn("text-lg font-semibold text-foreground",t),...e}));MS.displayName=J1.Title.displayName;const wS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(J1.Description,{ref:c,className:s1.cn("text-sm text-muted-foreground",t),...e}));wS.displayName=J1.Description.displayName;const CS=_1.Root,VS=_1.Trigger,ld1=_1.Group,id1=_1.Portal,ud1=_1.Sub,dd1=_1.RadioGroup,HS=x.forwardRef(({className:t,inset:e,children:c,...a},r)=>S.jsxRuntimeExports.jsxs(_1.SubTrigger,{ref:r,className:s1.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",e&&"pl-8",t),...a,children:[c,S.jsxRuntimeExports.jsx(d2.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));HS.displayName=_1.SubTrigger.displayName;const yS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(_1.SubContent,{ref:c,className:s1.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",t),...e}));yS.displayName=_1.SubContent.displayName;const ln=x.forwardRef(({className:t,sideOffset:e=4,...c},a)=>S.jsxRuntimeExports.jsx(_1.Portal,{children:S.jsxRuntimeExports.jsx(_1.Content,{ref:a,sideOffset:e,className:s1.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",t),...c})}));ln.displayName=_1.Content.displayName;const h6=x.forwardRef(({className:t,inset:e,...c},a)=>S.jsxRuntimeExports.jsx(_1.Item,{ref:a,className:s1.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",e&&"pl-8",t),...c}));h6.displayName=_1.Item.displayName;const xS=x.forwardRef(({className:t,children:e,checked:c,...a},r)=>S.jsxRuntimeExports.jsxs(_1.CheckboxItem,{ref:r,className:s1.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",t),checked:c,...a,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx(_1.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.CheckIcon,{className:"h-4 w-4"})})}),e]}));xS.displayName=_1.CheckboxItem.displayName;const LS=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs(_1.RadioItem,{ref:a,className:s1.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",t),...c,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx(_1.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),e]}));LS.displayName=_1.RadioItem.displayName;const un=x.forwardRef(({className:t,inset:e,...c},a)=>S.jsxRuntimeExports.jsx(_1.Label,{ref:a,className:s1.cn("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...c}));un.displayName=_1.Label.displayName;const dn=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(_1.Separator,{ref:c,className:s1.cn("-mx-1 my-1 h-px bg-muted",t),...e}));dn.displayName=_1.Separator.displayName;const SS=({className:t,...e})=>S.jsxRuntimeExports.jsx("span",{className:s1.cn("ml-auto text-xs tracking-widest opacity-60",t),...e});SS.displayName="DropdownMenuShortcut";const AS=x.forwardRef(({className:t,orientation:e="horizontal",decorative:c=!0,...a},r)=>S.jsxRuntimeExports.jsx(ng.Root,{ref:r,decorative:c,orientation:e,className:s1.cn("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...a}));AS.displayName=ng.Root.displayName;const hd1=1,vd1=1e6;let Lc=0;function fd1(){return Lc=(Lc+1)%Number.MAX_VALUE,Lc.toString()}const Sc=new Map,Uf=t=>{if(Sc.has(t))return;const e=setTimeout(()=>{Sc.delete(t),l0({type:"REMOVE_TOAST",toastId:t})},vd1);Sc.set(t,e)},FS=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,hd1)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(c=>c.id===e.toast.id?{...c,...e.toast}:c)};case"DISMISS_TOAST":{const{toastId:c}=e;return c?Uf(c):t.toasts.forEach(a=>{Uf(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===c||c===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(c=>c.id!==e.toastId)}}},W8=[];let U8={toasts:[]};function l0(t){U8=FS(U8,t),W8.forEach(e=>{e(U8)})}function BS({...t}){const e=fd1(),c=r=>l0({type:"UPDATE_TOAST",toast:{...r,id:e}}),a=()=>l0({type:"DISMISS_TOAST",toastId:e});return l0({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:r=>{r||a()}}}),{id:e,dismiss:a,update:c}}function hn(){const[t,e]=x.useState(U8);return x.useEffect(()=>(W8.push(e),()=>{const c=W8.indexOf(e);c>-1&&W8.splice(c,1)}),[t]),{...t,toast:BS,dismiss:c=>l0({type:"DISMISS_TOAST",toastId:c})}}const gd1=s4.Provider,ES=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(s4.Viewport,{ref:c,className:s1.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]",t),...e}));ES.displayName=s4.Viewport.displayName;const pd1=R3.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"}}),OS=x.forwardRef(({className:t,variant:e,...c},a)=>S.jsxRuntimeExports.jsx(s4.Root,{ref:a,className:s1.cn(pd1({variant:e}),t),...c}));OS.displayName=s4.Root.displayName;const md1=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(s4.Action,{ref:c,className:s1.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",t),...e}));md1.displayName=s4.Action.displayName;const PS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(s4.Close,{ref:c,className:s1.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",t),"toast-close":"",...e,children:S.jsxRuntimeExports.jsx(d2.Cross2Icon,{className:"h-4 w-4"})}));PS.displayName=s4.Close.displayName;const kS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(s4.Title,{ref:c,className:s1.cn("text-sm font-semibold [&+div]:text-xs",t),...e}));kS.displayName=s4.Title.displayName;const RS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(s4.Description,{ref:c,className:s1.cn("text-sm opacity-90",t),...e}));RS.displayName=s4.Description.displayName;function IS(){const{toasts:t}=hn();return S.jsxRuntimeExports.jsxs(gd1,{children:[t.map(({id:e,title:c,description:a,action:r,...n})=>S.jsxRuntimeExports.jsxs(OS,{...n,children:[S.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[c&&S.jsxRuntimeExports.jsx(kS,{children:c}),a&&S.jsxRuntimeExports.jsx(RS,{children:a})]}),r,S.jsxRuntimeExports.jsx(PS,{})]},e)),S.jsxRuntimeExports.jsx(ES,{})]})}const vn=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("animate-pulse rounded-md bg-primary/10",t),...e}),fn=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(X2.Command,{ref:c,className:s1.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));fn.displayName=X2.Command.displayName;const zd1=({children:t,...e})=>S.jsxRuntimeExports.jsx(rn,{...e,children:S.jsxRuntimeExports.jsx(fe,{className:"overflow-hidden p-0",children:S.jsxRuntimeExports.jsx(fn,{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:t})})}),NS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[S.jsxRuntimeExports.jsx(d2.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),S.jsxRuntimeExports.jsx(X2.Command.Input,{ref:c,className:s1.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",t),...e})]}));NS.displayName=X2.Command.Input.displayName;const jS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(X2.Command.List,{ref:c,className:s1.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));jS.displayName=X2.Command.List.displayName;const TS=x.forwardRef((t,e)=>S.jsxRuntimeExports.jsx(X2.Command.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));TS.displayName=X2.Command.Empty.displayName;const DS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(X2.Command.Group,{ref:c,className:s1.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",t),...e}));DS.displayName=X2.Command.Group.displayName;const qS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(X2.Command.Separator,{ref:c,className:s1.cn("-mx-1 h-px bg-border",t),...e}));qS.displayName=X2.Command.Separator.displayName;const ZS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(X2.Command.Item,{ref:c,className:s1.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",t),...e}));ZS.displayName=X2.Command.Item.displayName;const WS=({className:t,...e})=>S.jsxRuntimeExports.jsx("span",{className:s1.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});WS.displayName="CommandShortcut";const bd1=$1.Root,Md1=$1.Trigger,wd1=$1.Group,Cd1=$1.Portal,Vd1=$1.Sub,Hd1=$1.RadioGroup,US=x.forwardRef(({className:t,inset:e,children:c,...a},r)=>S.jsxRuntimeExports.jsxs($1.SubTrigger,{ref:r,className:s1.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",e&&"pl-8",t),...a,children:[c,S.jsxRuntimeExports.jsx(d2.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));US.displayName=$1.SubTrigger.displayName;const KS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx($1.SubContent,{ref:c,className:s1.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",t),...e}));KS.displayName=$1.SubContent.displayName;const GS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx($1.Portal,{children:S.jsxRuntimeExports.jsx($1.Content,{ref:c,className:s1.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",t),...e})}));GS.displayName=$1.Content.displayName;const JS=x.forwardRef(({className:t,inset:e,...c},a)=>S.jsxRuntimeExports.jsx($1.Item,{ref:a,className:s1.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",e&&"pl-8",t),...c}));JS.displayName=$1.Item.displayName;const YS=x.forwardRef(({className:t,children:e,checked:c,...a},r)=>S.jsxRuntimeExports.jsxs($1.CheckboxItem,{ref:r,className:s1.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",t),checked:c,...a,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx($1.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.CheckIcon,{className:"h-4 w-4"})})}),e]}));YS.displayName=$1.CheckboxItem.displayName;const XS=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs($1.RadioItem,{ref:a,className:s1.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",t),...c,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx($1.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),e]}));XS.displayName=$1.RadioItem.displayName;const QS=x.forwardRef(({className:t,inset:e,...c},a)=>S.jsxRuntimeExports.jsx($1.Label,{ref:a,className:s1.cn("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...c}));QS.displayName=$1.Label.displayName;const _S=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx($1.Separator,{ref:c,className:s1.cn("-mx-1 my-1 h-px bg-border",t),...e}));_S.displayName=$1.Separator.displayName;const $S=({className:t,...e})=>S.jsxRuntimeExports.jsx("span",{className:s1.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});$S.displayName="ContextMenuShortcut";const yd1=t=>{try{const e=document.getElementById("icon-picker-field"),c=document.createElement("div");pa.render(S.jsxRuntimeExports.jsx(cg.IconPickerItem,{value:t}),c),e.appendChild(c),c.hidden=!0;let a=c.innerHTML;setTimeout(()=>e.removeChild(c),100);const n=new DOMParser().parseFromString(a,"image/svg+xml"),o=n.querySelector("svg");return o&&(o.removeAttribute("width"),o.removeAttribute("height")),new XMLSerializer().serializeToString(n)}catch(e){return console.error(e),""}},xd1=({value:t,onChange:e})=>{const c=a=>{e("<svg />");const r=yd1(a);e(r)};return S.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[S.jsxRuntimeExports.jsxs("div",{className:"group relative h-12 w-12",children:[S.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:t?t.replace("<svg",'<svg class="h-5 w-5"'):"<svg class='h-5 w-5' />"},className:"absolute left-1/2 top-1/2 z-0 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white"}),S.jsxRuntimeExports.jsx(cg,{value:t?"BiSolidGrid":null,onChange:c,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"}})]}),S.jsxRuntimeExports.jsx("textarea",{value:t,onChange:a=>e(a.target.value),className:"h-full w-full rounded-sm border 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"})]})},Ld1=h.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-aOVqzTK6.cjs"))),Sd1=h.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-vGCEvksG.cjs"))),tA=({isModalView:t=!1,onSelect:e=()=>{}})=>{const c=B2("uploadMediaCallback"),a=B2("unsplashAccessKey"),r=c===void 0,n=a===void 0,[o,s]=h.useState(n?"upload":r?"unsplash":"upload");return S.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[S.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:S.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:t&&r?"Unsplash images":t?"Select or upload images":"Images"})}),S.jsxRuntimeExports.jsxs(sn,{value:o,onValueChange:l=>s(l),className:"flex h-full w-full flex-col py-2",children:[!(r||n)&&S.jsxRuntimeExports.jsxs(ge,{className:"w-full",children:[S.jsxRuntimeExports.jsx(w0,{value:"upload",className:"w-full",children:"Upload"}),S.jsxRuntimeExports.jsx(w0,{value:"unsplash",className:"w-full",children:"Unsplash"})]}),o==="unsplash"?S.jsxRuntimeExports.jsx(C0,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:S.jsxRuntimeExports.jsx(h.Suspense,{fallback:S.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:S.jsxRuntimeExports.jsx(Ld1,{isModalView:t,onSelect:e})})}):S.jsxRuntimeExports.jsx(C0,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:S.jsxRuntimeExports.jsx(h.Suspense,{fallback:S.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:S.jsxRuntimeExports.jsx(Sd1,{isModalView:t,onSelect:e})})})]})]})},Ad1=Object.freeze(Object.defineProperty({__proto__:null,default:tA},Symbol.toStringTag,{value:"Module"})),Kf=({children:t,onSelect:e})=>{const[c,a]=h.useState(!1),r=(...n)=>{e.call(void 0,...n),a(!1)};return S.jsxRuntimeExports.jsxs(rn,{open:c,onOpenChange:n=>a(n),children:[S.jsxRuntimeExports.jsx(OL,{asChild:!0,children:t}),S.jsxRuntimeExports.jsx(fe,{className:"flex h-3/4 max-w-5xl",children:S.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:S.jsxRuntimeExports.jsx(tA,{isModalView:!0,onSelect:r})})})]})},Fd1=({value:t,onChange:e,id:c,onBlur:a})=>{const r=B2("uploadMediaCallback"),n=B2("unsplashAccessKey"),o=r===void 0,s=n===void 0;return S.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[t?S.jsxRuntimeExports.jsx("img",{src:t,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):S.jsxRuntimeExports.jsx(Kf,{onSelect:e,children:S.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"})}),S.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[!(o&&s)&&S.jsxRuntimeExports.jsxs(S.jsxRuntimeExports.Fragment,{children:[S.jsxRuntimeExports.jsx(Kf,{onSelect:e,children:S.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:t||!D.isEmpty(t)?"Replace Image":"Choose Image"})}),S.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"})]}),S.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:t,onBlur:({target:{value:l}})=>a(c,l),onChange:l=>e(l.target.value)})]})]})},Bd1=({id:t,placeholder:e,value:c,onChange:a,onBlur:r})=>{const n={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},o=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:S.jsxRuntimeExports.jsx(YA,{id:t,value:c,onBlur:s=>r(t,s),onChange:s=>a(s),modules:n,formats:o,placeholder:e,className:"mt-1 rounded-md"})},Ed1=({schema:t,formData:e,onChange:c})=>{const[a,r]=h.useState([]),n=B2("getPages",()=>[]),{type:o="page",href:s="",target:l="self"}=e;return h.useEffect(()=>{(async()=>{const u=await n();r(u||[])})()},[]),S.jsxRuntimeExports.jsxs("div",{children:[S.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(t==null?void 0:t.title)??"Link"}),S.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[S.jsxRuntimeExports.jsx("select",{name:"type",value:o,onChange:u=>c({...e,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=>S.jsxRuntimeExports.jsx("option",{value:u.const,children:u.title},u.const))}),o==="page"?S.jsxRuntimeExports.jsxs("select",{name:"href",placeholder:"Choose Page",value:s,onChange:u=>c({...e,href:u.target.value}),children:[S.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),D.map(a,u=>S.jsxRuntimeExports.jsx("option",{value:u.slug,children:u.name},u.uuid))]}):S.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:s,onChange:u=>c({...e,href:u.target.value}),placeholder:o==="page"||o==="url"?"Enter URL":o==="scroll"?"#ElementID":"Enter detail"}),(o==="page"||o==="url")&&S.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[S.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:l==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>c({...e,target:l==="_blank"?"_self":"_blank"})}),S.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})},Od1=()=>{const[t]=X4(),[,e]=g3(),{addBlocks:c}=Q4(),{toast:a}=hn(),r=h.useCallback((o,s,l)=>{var f;for(let p=0;p<o.length;p++){const{_id:g}=o[p];o[p]._id=W4.generateUUID();const m=D.filter(o,{_parent:g});for(let z=0;z<m.length;z++)m[z]._parent=o[p]._id}const u=D.first(o);let i,d;return s&&(i=D.find(t,{_id:s}),o[0]._parent=s,d=s),!(i?ha(i._type,u._type):!0)&&i&&(o[0]._parent=i._parent,d=i._parent),c(o,d,l),e([(f=D.first(o))==null?void 0:f._id]),D.first(o)},[t,e]);return{addCoreBlock:h.useCallback((o,s,l)=>{if(D.has(o,"blocks")){const z=o.blocks;return r(z,s,l)}const u=W4.generateUUID(),i=oL(o.props),d=[];D.forIn(i,(z,b)=>{if(D.startsWith(z,x4.SLOT_KEY)){const w=z.replace(x4.SLOT_KEY,"");d.push({_id:w,_type:"Slot",_parent:u,_name:o.props[b].name,_styles:o.props[b].styles,_emptyStyles:o.props[b].emptyStyles})}});const v={_type:o.type,_id:u,...i};let f,p;if(s&&(f=D.find(t,{_id:s}),v._parent=s,p=s),!iu1(f==null?void 0:f._type,o.type)){a({variant:"destructive",title:"Error",description:`"${o.type}" cannot be added under "${f?f==null?void 0:f._type:"root"}"`}),e([]);return}!(f?ha(f._type,o.type):!0)&&f&&(v._parent=f._parent,p=f._parent);const m=[v,...d];return c(m,p,l),e([v._id]),v},[r,t,e]),addPredefinedBlock:r}},Gf={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},Jf=["xs","sm","md","lg","xl","2xl"];function Pd1(t,e){if(e===null)return"baseClasses";const c=e.mq;if(c==="xs"||e.dark||e.mod!=="")return"classes";let a="baseClasses",r=Jf.indexOf(c);for(;r>0;){const n=Jf[r-1];if(D.find(t,{mq:n,property:e.property})){a="classes";break}r--}return a}const Yf=[];function kd1(t="",e="",c=[]){t=t.trim().replace(/ +/g,"");let a=D.filter(D.map(t.split(" "),s1.constructClassObject),u=>!D.isNull(u)),r=D.filter(D.map(e.split(" "),s1.constructClassObject),u=>!D.isNull(u));r=D.filter(r,u=>!D.includes(Yf,u.property));const n=[],o=[];D.each(c,u=>{const i=s1.constructClassObject(u),d=D.find(a,D.pick(i,["dark","mq","mod","property"]));if(d&&(a=D.filter(a,v=>v.fullCls!==(d==null?void 0:d.fullCls))),n.push(i),i.mq==="xs"&&!i.dark&&i.mod===""&&(r=D.filter(r,v=>v.property!==i.property)),Pd1(a,i)==="baseClasses"&&!D.includes(Yf,i.property)){const v=D.find(r,D.pick(i,["property"]));d&&(r=D.filter(r,f=>f.fullCls!==(v==null?void 0:v.fullCls))),o.push({...i,fullCls:i.cls,mq:"xs"})}});const s=D.map(D.sortBy([...a,...n],u=>Gf[u.mq]),"fullCls").join(" ");return`${D.map(D.sortBy([...r,...o],u=>Gf[u.mq]),"fullCls").join(" ").trim()},${s.trim()}`.trim().replace(/ +/g,"")}const T0=l1.atom([]);T0.debugLabel="selectedStylingBlocksAtom";const eA=()=>l1.useAtom(T0),Rd1=t=>{const e=t.replace(x4.STYLES_KEY,"").split(",");return{baseClasses:e[0],classes:e[1]}},Id1=l1.atom(null,(t,e,{blockIds:c,newClasses:a})=>{const r=D.filter(t(Jr),o=>c.includes(t(o)._id)),n=D.first(t(T0));return D.map(r,o=>{const s=t(o),l=D.get(s,n.prop,`${x4.STYLES_KEY},`),{baseClasses:u,classes:i}=Rd1(l);return{ids:[s._id],props:{[n.prop]:`${x4.STYLES_KEY}${kd1(i,u,a)}`}}})}),Nd1=()=>{const t=l1.useSetAtom(Id1),{updateBlocks:e,updateBlocksRuntime:c}=Q4();return h.useCallback((a,r,n=!1)=>{const o=t({blockIds:a,newClasses:r});if(!n){c(a,o[0].props);return}e(a,o[0].props)},[t])},cA=()=>l1.useAtom(rL),aA=g4("canvasWidth",800),rA=l1.atom(t=>{const e=t(aA);return W4.getBreakpointValue(e).toLowerCase()}),jd1=()=>{const[t,e]=l1.useAtom(aA),c=l1.useAtomValue(rA),[a,r]=cA();return h.useEffect(()=>{a!=="xs"&&r(c)},[c,a,r]),[t,c,e]},Td1=g4("canvasZoom",100),Dd1=()=>l1.useAtom(Td1),nA=l1.atom([]),oA=()=>{const[t,e]=l1.useAtom(nA),c=l1.useSetAtom(gn),a=h.useCallback(r=>{e(r),c([])},[e,c]);return[t,a]},gn=l1.atom([]),qd1=()=>{const[t,e]=l1.useAtom(gn),c=l1.useSetAtom(nA),a=h.useCallback(r=>{e(r),c([])},[e,c]);return[t,a]},sA=g4("darkMode",!1),Zd1=()=>{const[t,e]=l1.useAtom(sA);return[t,e]},pn=()=>{const[t]=X4(),[,e]=g3(),{addBlocks:c}=Q4();return h.useCallback((a,r=null)=>{const n=[];D.each(a,o=>{const s=t.find(v=>v._id===o);r||(r=s._parent);const i=D.filter(t,v=>D.isString(r)?v._parent===r:!s._parent).indexOf(s)+1,d=hu1(t,o,r);c(d,r,i),n.push(D.get(d,"0._id",""))}),e(n)},[t,e])},Wd1=l1.atom([]),Ud1=()=>{const[t,e]=l1.useAtom(Wd1),c=h.useCallback(a=>{e(r=>D.includes(r,a)?D.without(r,a):[...r,a])},[e]);return[t,e,c]},Kd1=l1.atom(""),lA=()=>l1.useAtom(Kd1),Gd1=()=>{const t=l1.useAtomValue(S4);return h.useCallback((e,c)=>{const a=D.map(t,r=>(D.includes(e,D.get(r,"_id"))&&D.set(r,"_parent",c),r));console.log("newBlocks",a)},[t])},Jd1=()=>{console.warn("usePasteBlocks is not implemented");const t=l1.useAtomValue(gn),[e,c]=oA(),a=pn(),r=Gd1();return{canPaste:h.useMemo(()=>e.length>0||t.length>0,[t,e]),pasteBlocks:h.useCallback(o=>{D.isEmpty(t)?r(e,o):a(t,o),c(()=>[])},[e,t,a,r,c])}},Yd1=l1.atom(!1),iA=()=>{const[t,e]=l1.useAtom(Yd1);return[t,e]},Xd1=l1.atom(null,(t,e,{blockIds:c,fullClasses:a})=>{const r=D.first(t(T0)),n=D.filter(t(Jr),o=>c.includes(t(o)._id));return D.map(n,o=>{const s=t(o),l=a;let{classes:u,baseClasses:i}=lu1(D.get(s,r.prop,"styles:,"));return D.each(l,d=>{const v=d.replace(/[\[\]\/\\{}()*+?.^$|]/g,"\\$&"),f=new RegExp(`(^| )${v}($| )`,"g");u=u.replace(f," ").replace(/ +/g," ").trim();const p=D.first(d.split(":"));D.includes(["2xl","xl","lg","md","sm"],p)&&l.push(d.split(":").pop().trim())}),D.each(l,d=>{const v=new RegExp(`(^| )${d.replace("[","\\[").replace("]","\\]")}($| )`,"g");i=i.replace(v," ").replace(/ +/g," ").trim()}),{ids:[s._id],props:{[r.prop]:`${x4.STYLES_KEY}${i},${u}`}}})}),Qd1=()=>{const{updateBlocks:t}=Q4(),e=l1.useSetAtom(Xd1);return h.useCallback((c,a)=>{const r=e({blockIds:c,fullClasses:a});t(c,r[0].props)},[e])},uA=l1.atom(t=>{const e=D.first(t(T0)),c=t(ue);if(!e||e.blockId!==D.get(c,"_id",null))return[];const r=D.get(c,e.prop,`${x4.STYLES_KEY},`).replace(x4.STYLES_KEY,"").split(",").join(" ");return D.filter(D.map(r.trim().split(" "),s1.constructClassObject),n=>!D.isNull(n))}),_d1=()=>l1.useAtomValue(uA),Xf={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},$d1=l1.atom(t=>{const e=t(rA),c=t(Qr),a=t(sA),r=th1(e);let n=D.filter(t(uA),{mod:c});return D.startsWith(c,"_")||(n=D.filter(n,o=>r.includes(o.mq))),n=n.sort((o,s)=>Xf[o.mq]-Xf[s.mq]),a||(n=D.filter(n,{dark:!1})),n}),th1=t=>{let e=[];switch(t){case"xs":e=["xs"];break;case"sm":e=["xs","sm"];break;case"md":e=["xs","sm","md"];break;case"lg":e=["xs","sm","md","lg"];break;case"xl":e=["xs","sm","md","lg","xl"];break;case"2xl":e=["xs","sm","md","lg","xl","2xl"];break;default:e=["xs"];break}return e},eh1=()=>l1.useAtomValue($d1),ch1=()=>l1.useAtom(Qr),ah1=()=>{const{updateBlocks:t}=Q4();return h.useCallback((e,c,a)=>{t(e,c,a)},[t])},rh1=()=>{const{updateMultipleBlocksProps:t}=Q4();return h.useCallback(e=>{t(e)},[t])},nh1=()=>{const{updateBlocksRuntime:t}=Q4();return h.useCallback((e,c)=>{t(e,c)},[t])},dA={name:"",props:{},modalProps:{},backdropClose:!0},oh1=l1.atom(dA),sh1=()=>{const[t,e]=l1.useAtom(oh1),c=h.useCallback((r,n={},o={})=>{e({name:r,props:n,modalProps:o})},[e]),a=h.useCallback((...r)=>{D.get(t,"props.onClose",()=>{})(...r),e(dA)},[e,t]);return{activeModal:t,openModal:c,closeModal:a}},lh1=()=>(console.warn("useAllBlocks is deprecated, use useBlocksStore() instead"),l1.useAtomValue(S4)),hA=l1.atom(!1);hA.debugLabel="readOnlyModeAtom";const vA=l1.atom("online");vA.debugLabel="networkModeAtom";const ih1=l1.atom(!1);ih1.debugLabel="codeEditorOpenAtom";const fA=l1.atom(!1);fA.debugLabel="editLayerNameAtom";const uh1=l1.atom("");uh1.debugLabel="activeLanguageAtom";const dh1=l1.atom("");dh1.debugLabel="primaryLanguageAtom";const gA=l1.atom(null);gA.debugLabel="canvasIframeAtom";const pA=l1.atom("outline");pA.debugLabel="activePanelAtom";const mA=l1.atom("");mA.debugLabel="showPredefinedBlockCategoryAtom";const zA=l1.atom({undoCount:0,redoCount:0});zA.debugLabel="historyStatesAtom";const bA=l1.atom("");bA.debugLabel="inlineEditingActiveAtom";const MA=l1.atom(!1);MA.debugLabel="draggingFlagAtom";const wA=l1.atom("");wA.debugLabel="draggedBlockIdAtom";const CA=l1.atom(null);CA.debugLabel="treeRefAtom";const VA=l1.atom({});VA.debugLabel="canvasSettingsAtom";const mn=l1.atom(!1);mn.debugLabel="askAiActiveBlockAtom";const hh1=()=>l1.useAtomValue(hA),vh1=l1.atom(""),fh1=l1.atom(null),gh1=()=>l1.useAtom(vh1),ph1=()=>l1.useAtom(fh1),mh1=g4("selectedBreakpoints",["XS","MD","XL"]),zh1=()=>{const[t,e]=l1.useAtom(mh1);return[t,e]},HA=()=>{const t=l1.useSetAtom(zA),{clear:e}=he(),[,c]=g3(),[,a]=lA(),[,r]=eA();return()=>{c([]),r([]),a(""),e(),t({undoCount:0,redoCount:0})}},bh1=l1.atom([]),Mh1=()=>{const[t,e]=h.useState(!1),[c,a]=l1.useAtom(bh1),r=B2("getUILibraryBlocks",()=>[]);return h.useEffect(()=>{(async()=>c.length>0||(e(!0),a(await r()),e(!1)))()},[]),{data:c,isLoading:t}},wh1=()=>{const[t,e]=h.useState(null),c=h.useCallback(async a=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(a),e(a),!0}catch(r){return console.warn("Copy failed",r),e(null),!1}},[]);return[t,c]},Ch1=()=>{const[t,e]=iA(),{t:c}=ma.useTranslation(),a=B2("previewComponent",null);return t?S.jsxRuntimeExports.jsxs("div",{className:W4.cn("fixed inset-0 z-[999] bg-background",t?"block":"hidden"),children:[S.jsxRuntimeExports.jsxs(M0,{size:"sm",className:"absolute right-0 top-0 m-4 space-x-2",onClick:()=>e(!1),children:[S.jsxRuntimeExports.jsx(d2.EyeClosedIcon,{}),S.jsxRuntimeExports.jsx("span",{children:c("Close Preview")})]}),S.jsxRuntimeExports.jsx("div",{children:a?S.jsxRuntimeExports.jsx(h.Suspense,{fallback:S.jsxRuntimeExports.jsx(vn,{className:"h-96 w-full"}),children:h.createElement(a)}):null})]}):null},Vh1=()=>{const[t,e]=g3(),c=vL(),a=pn(),{undo:r,redo:n}=he();E6.useHotkeys("esc",()=>e([]),{},[e]),E6.useHotkeys("ctrl+d,command+d",()=>a(t),{preventDefault:!0},[t,a]),E6.useHotkeys("ctrl+z,command+z",()=>r(),{},[r]),E6.useHotkeys("ctrl+y,command+y",()=>n(),{},[n]),E6.useHotkeys("del, backspace",o=>{o.preventDefault(),c(t)},{},[t,c])},Hh1=(t,e)=>{const c=[];let a=D.find(t,{_id:e}),r=D.get(a,"_parent","");for(;D.isString(r)&&!D.isEmpty(r);)c.push(a==null?void 0:a._parent),a=D.find(t,{_id:r}),r=a==null?void 0:a._parent;return D.flatten(c)},yh1=l1.atom([]),xh1=()=>{const[t]=g3(),e=l1.useAtomValue(S4),[,c]=l1.useAtom(yh1);h.useEffect(()=>{let a=[];const r=D.first(t);D.isString(r)&&(a=[r,...Hh1(e,r)]),c(a)},[t,e,c])};const yA=()=>l1.useAtom(Yx),Lh1=()=>h.useMemo(()=>h3.getChaiDataProviders(),[]),Sh1=({children:t})=>{const[,e]=yA(),[c]=cn(),a=Lh1();return h.useEffect(()=>(e({}),D.each(c,r=>{const n=D.find(a,{providerKey:r.providerKey});if(n){const o=(n==null?void 0:n.mockFn)||(n==null?void 0:n.dataFn);o&&o(r.args).then(s=>e(l=>({...l,[r.providerKey]:s})))}}),()=>{D.each(c,r=>{e(n=>(delete n[r.providerKey],n))})}),[a,c,e]),S.jsxRuntimeExports.jsx(S.jsxRuntimeExports.Fragment,{children:t})};function Ah1(t,e,c){c.push(D.find(t,{_id:e}));const a=D.filter(t,{_parent:e});for(const r of a)c.push(...xA(r._id,t));return c}const xA=(t,e)=>{let c=[];return c=D.flattenDeep([...c,...Ah1(e,t,c)]),c},Fh1=l1.atom(!1),LA=()=>{const[t,e]=l1.useAtom(Fh1),[c,a]=h.useState(null),r=B2("askAiCallBack",null),n=rh1(),[o]=X4();return{askAi:h.useCallback(async(s,l,u)=>{if(r){e(!0),a(null);try{const i=zn.cloneDeep(xA(s,o));zn.set(i,"0._parent",null);const{blocks:d,error:v}=await r(l,i);if(v){a(v);return}n(d)}catch(i){a(i)}finally{e(!1),u&&u()}}},[r]),loading:t,error:c}};var SA={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Qf=h.createContext&&h.createContext(SA),i3=function(){return i3=Object.assign||function(t){for(var e,c=1,a=arguments.length;c<a;c++){e=arguments[c];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},i3.apply(this,arguments)},Bh1=function(t,e){var c={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(c[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(t);r<a.length;r++)e.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(t,a[r])&&(c[a[r]]=t[a[r]]);return c};function AA(t){return t&&t.map(function(e,c){return h.createElement(e.tag,i3({key:c},e.attr),AA(e.child))})}function pe(t){return function(e){return h.createElement(Eh1,i3({attr:i3({},t.attr)},e),AA(t.child))}}function Eh1(t){var e=function(c){var a=t.attr,r=t.size,n=t.title,o=Bh1(t,["attr","size","title"]),s=r||c.size||"1em",l;return c.className&&(l=c.className),t.className&&(l=(l?l+" ":"")+t.className),h.createElement("svg",i3({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},c.attr,a,o,{className:l,style:i3(i3({color:t.color||c.color},c.style),t.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),n&&h.createElement("title",null,n),t.children)};return Qf!==void 0?h.createElement(Qf.Consumer,null,function(c){return e(c)}):e(SA)}function Oh1(t){return pe({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"}}]})(t)}function Ph1(t){return pe({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"}}]})(t)}function kh1(t){return pe({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V285.7l-86.8 86.8c-10.3 10.3-17.5 23.1-21 37.2l-18.7 74.9c-2.3 9.2-1.8 18.8 1.3 27.5H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"}}]})(t)}const Rh1=[{name:"Improve writing",icon:kh1,prompt:"Improving writing in all text elements. Replacing placeholder content with meaningful relevant content."},{name:"Fix grammar",icon:d2.CheckIcon,prompt:"Fix grammar in all text elements. Ensuring the text is grammatically correct and free of errors."},{name:"Make longer",icon:d2.ArrowUpIcon,prompt:"Make all text elements longer."},{name:"Make shorter",icon:d2.ArrowDownIcon,prompt:"Make all text elements shorter."},{name:"Add emojis",icon:a0.SmileIcon,prompt:"Add emojis to text elements if relevant."},{name:"Randomize",icon:a0.ShuffleIcon,prompt:"Randomize all text elements."}];function Ih1({onClick:t}){const{loading:e}=LA();return S.jsxRuntimeExports.jsx("div",{className:e?"pointer-events-none opacity-50":"",children:S.jsxRuntimeExports.jsx("ul",{className:"space-y-2",children:Rh1.map(({name:c,icon:a,subMenus:r,prompt:n})=>r?S.jsxRuntimeExports.jsxs(CS,{children:[S.jsxRuntimeExports.jsx(VS,{asChild:!0,children:S.jsxRuntimeExports.jsxs("li",{className:"flex cursor-pointer items-center space-x-2 hover:bg-gray-100",children:[S.jsxRuntimeExports.jsx(a,{className:"h-4 w-4"}),S.jsxRuntimeExports.jsx("span",{children:c})]},c)}),S.jsxRuntimeExports.jsxs(ln,{children:[S.jsxRuntimeExports.jsx(un,{children:"My Account"}),S.jsxRuntimeExports.jsx(dn,{}),S.jsxRuntimeExports.jsx(h6,{children:"Profile"}),S.jsxRuntimeExports.jsx(h6,{children:"Billing"}),S.jsxRuntimeExports.jsx(h6,{children:"Team"}),S.jsxRuntimeExports.jsx(h6,{children:"Subscription"})]})]}):S.jsxRuntimeExports.jsxs("li",{onClick:()=>t(n),className:"flex cursor-pointer items-center space-x-2 hover:bg-gray-100",children:[S.jsxRuntimeExports.jsx(a,{className:"h-4 w-4"}),S.jsxRuntimeExports.jsx("span",{children:c})]},c))})})}const Nh1=({blockId:t})=>{const{t:e}=ma.useTranslation(),{askAi:c,loading:a,error:r}=LA(),[n,o]=h.useState(""),s=h.useRef(null);h.useEffect(()=>{var u;(u=s.current)==null||u.focus()},[]);const l=()=>{r||o("")};return t?S.jsxRuntimeExports.jsx("div",{className:"",children:S.jsxRuntimeExports.jsxs(sn,{defaultValue:"ask-ai",className:"w-full",children:[S.jsxRuntimeExports.jsx(ge,{className:"w-full",children:S.jsxRuntimeExports.jsxs(w0,{value:"ask-ai",className:"w-full",children:[S.jsxRuntimeExports.jsx(a0.SparklesIcon,{className:"mr-2 h-3"})," ",e("Ask AI")," (GPT-4o mini)"]})}),S.jsxRuntimeExports.jsxs(C0,{value:"ask-ai",className:"flex flex-col gap-2 px-2",children:[S.jsxRuntimeExports.jsx(nn,{ref:s,value:n,onChange:u=>o(u.target.value),placeholder:e("Ask AI to edit something"),className:"w-full border border-gray-400 focus:border-0",rows:3,onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),c(t,n,l))}}),S.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[a?null:S.jsxRuntimeExports.jsx(M0,{disabled:n.trim().length<5||a,onClick:()=>c(t,n,l),variant:"default",className:"w-fit",size:"sm",children:a?S.jsxRuntimeExports.jsxs(S.jsxRuntimeExports.Fragment,{children:[S.jsxRuntimeExports.jsx(a0.Loader,{className:"h-5 w-5 animate-spin"}),e("Generating... Please wait")]}):e("Edit with AI")}),a?S.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsxRuntimeExports.jsxs(vn,{className:"flex w-full items-center space-x-1 px-4 py-1 pl-2",children:[S.jsxRuntimeExports.jsx(Oh1,{className:"h-4 w-4 animate-spin text-gray-500"}),S.jsxRuntimeExports.jsx("p",{className:"text-xs",children:e("Generating... Please wait")})]}),S.jsxRuntimeExports.jsx(M0,{variant:"destructive",onClick:()=>stop(),className:"hidden w-fit",size:"sm",children:e("Stop")})]}):null]}),S.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:r&&S.jsxRuntimeExports.jsx("p",{className:"break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500",children:r.message})}),S.jsxRuntimeExports.jsx(Ih1,{onClick:u=>c(t,u,l)})]})]})}):S.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:S.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[S.jsxRuntimeExports.jsx(a0.SparklesIcon,{className:"mx-auto text-3xl"}),S.jsxRuntimeExports.jsx("h1",{children:e("no_block_selected_for_ask_ai")})]})})},jh1=()=>{const[t]=g3();return S.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 z-50 h-full w-full bg-white p-2",children:S.jsxRuntimeExports.jsx(Nh1,{blockId:D.first(t)})})},Th1=h.lazy(()=>Promise.resolve().then(()=>require("./SidePanels-bmrMhSWl.cjs"))),Dh1=h.lazy(()=>Promise.resolve().then(()=>require("./Topbar-CVXB8DGf.cjs"))),qh1=h.lazy(()=>Promise.resolve().then(()=>require("./CanvasArea-D1TUKvIF.cjs"))),Zh1=h.lazy(()=>Promise.resolve().then(()=>require("./Settings-eufW6-XQ.cjs"))),Wh1=()=>{const{savePage:t}=hL(),e=B2("autoSaveSupport",!0),c=B2("autoSaveInterval",60);eg.useIntervalEffect(()=>{e&&t()},c*1e3)},Uh1=()=>{const[t]=l1.useAtom(j0),[e]=l1.useAtom(mn),c=n=>{su1()||n.preventDefault()};Vh1(),xh1(),Wh1(),h.useEffect(()=>(t!=="SAVED"?window.onbeforeunload=()=>"":window.onbeforeunload=null,()=>{window.onbeforeunload=null}),[t]);const a=B2("editable",!0),r=B2("nonEditableComponent",null);return S.jsxRuntimeExports.jsx("div",{className:"h-screen w-screen bg-background text-foreground",children:S.jsxRuntimeExports.jsxs(YL,{children:[S.jsxRuntimeExports.jsxs("div",{onContextMenu:c,className:"flex h-screen flex-col overflow-hidden bg-background text-foreground",children:[S.jsxRuntimeExports.jsx("div",{className:"h-14 w-screen shrink-0 border-b border-border",children:S.jsxRuntimeExports.jsx(h.Suspense,{children:S.jsxRuntimeExports.jsx(Dh1,{})})}),S.jsxRuntimeExports.jsxs("main",{className:"relative flex h-full flex-1 flex-row",children:[a?null:S.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 z-[500] flex h-full w-full items-center justify-center backdrop-blur-[2px]",children:S.jsxRuntimeExports.jsx(h.Suspense,{children:h.createElement(r)})}),S.jsxRuntimeExports.jsx("div",{className:"flex h-full max-h-full w-fit border-border",style:{maxHeight:"calc(100vh - 56px)"},children:S.jsxRuntimeExports.jsx(h.Suspense,{children:S.jsxRuntimeExports.jsx(Th1,{})})}),S.jsxRuntimeExports.jsx("div",{className:"h-full flex-1 bg-slate-800/20",children:S.jsxRuntimeExports.jsx(h.Suspense,{children:S.jsxRuntimeExports.jsx(qh1,{})})}),S.jsxRuntimeExports.jsxs("div",{className:"relative flex h-[100%] w-[280px] min-w-[280px] border-l border-border pb-10",children:[S.jsxRuntimeExports.jsx(h.Suspense,{children:S.jsxRuntimeExports.jsx(Zh1,{})}),e?S.jsxRuntimeExports.jsx(jh1,{}):null]})]})]}),S.jsxRuntimeExports.jsx(Ch1,{})]})})},_f=l1.getDefaultStore(),Kh1=()=>S.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen bg-gray-900 py-12 sm:py-16 lg:py-20 xl:hidden",children:S.jsxRuntimeExports.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:S.jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-md text-center",children:[S.jsxRuntimeExports.jsx("img",{src:"https://fldwljgzcktqnysdkxnn.supabase.co/storage/v1/object/public/chaibuilder-blob-storage/175ac8d8-37fe-4707-bb4a-3c0cd6a6db75/gVH7O-Ir_400x400.png",alt:"Chai Builder",className:"mx-auto w-14 rounded-full"}),S.jsxRuntimeExports.jsx("br",{}),S.jsxRuntimeExports.jsx("h2",{className:"text-4xl font-bold text-white",children:"Screen too small"}),S.jsxRuntimeExports.jsx("p",{className:"mt-6 text-sm font-medium leading-6 text-white text-opacity-70",children:"Please view this page on greater than 1280px screen width."})]})})});let Gh1=!1;const Jh1=t=>{Gh1=t};const Yh1=t=>{const[,e]=X4(),[,c]=de(),a=HA();return h.useEffect(()=>{_f.set(Gr,D.omit(t,["blocks","subPages","brandingOptions","dataProviders"]))},[t]),h.useEffect(()=>{_f.set(en,t.dataProviders||[])},[t.dataProviders]),h.useEffect(()=>{e(h3.syncBlocksWithDefaults(t.blocks||[])),a()},[t.blocks]),h.useEffect(()=>{tg.changeLanguage(t.locale||"en")},[t.locale]),h.useEffect(()=>{Jh1(t.showDebugLogs)},[t.showDebugLogs]),h.useEffect(()=>{c(t.brandingOptions)},[t.brandingOptions,c]),S.jsxRuntimeExports.jsx(Uh1,{})},Xh1=t=>{const e=t._flags||{};return S.jsxRuntimeExports.jsxs(Xx,{children:[S.jsxRuntimeExports.jsxs(BA.FlagsProvider,{features:{...ou1,...e},children:[S.jsxRuntimeExports.jsx(au1,{}),S.jsxRuntimeExports.jsx(Kh1,{}),S.jsxRuntimeExports.jsx(Yh1,{...t})]}),S.jsxRuntimeExports.jsx(IS,{})]})};exports.Accordion=Iu1;exports.AccordionContent=bL;exports.AccordionItem=mL;exports.AccordionTrigger=zL;exports.Alert=ML;exports.AlertDescription=CL;exports.AlertDialog=Tu1;exports.AlertDialogAction=BL;exports.AlertDialogCancel=EL;exports.AlertDialogContent=xL;exports.AlertDialogDescription=FL;exports.AlertDialogFooter=SL;exports.AlertDialogHeader=LL;exports.AlertDialogTitle=AL;exports.AlertDialogTrigger=Du1;exports.AlertTitle=wL;exports.Badge=ju1;exports.BlocksExternalDataProvider=Sh1;exports.Button=M0;exports.Card=TL;exports.CardContent=WL;exports.CardDescription=ZL;exports.CardFooter=UL;exports.CardHeader=DL;exports.CardTitle=qL;exports.ChaiBuilderEditor=Xh1;exports.Command=fn;exports.CommandDialog=zd1;exports.CommandEmpty=TS;exports.CommandGroup=DS;exports.CommandInput=NS;exports.CommandItem=ZS;exports.CommandList=jS;exports.CommandSeparator=qS;exports.CommandShortcut=WS;exports.ContextMenu=bd1;exports.ContextMenuCheckboxItem=YS;exports.ContextMenuContent=GS;exports.ContextMenuGroup=wd1;exports.ContextMenuItem=JS;exports.ContextMenuLabel=QS;exports.ContextMenuPortal=Cd1;exports.ContextMenuRadioGroup=Hd1;exports.ContextMenuRadioItem=XS;exports.ContextMenuSeparator=_S;exports.ContextMenuShortcut=$S;exports.ContextMenuSub=Vd1;exports.ContextMenuSubContent=KS;exports.ContextMenuSubTrigger=US;exports.ContextMenuTrigger=Md1;exports.Dialog=rn;exports.DialogContent=fe;exports.DialogDescription=jL;exports.DialogFooter=IL;exports.DialogHeader=RL;exports.DialogTitle=NL;exports.DialogTrigger=OL;exports.DropdownMenu=CS;exports.DropdownMenuCheckboxItem=xS;exports.DropdownMenuContent=ln;exports.DropdownMenuGroup=ld1;exports.DropdownMenuItem=h6;exports.DropdownMenuLabel=un;exports.DropdownMenuPortal=id1;exports.DropdownMenuRadioGroup=dd1;exports.DropdownMenuRadioItem=LS;exports.DropdownMenuSeparator=dn;exports.DropdownMenuShortcut=SS;exports.DropdownMenuSub=ud1;exports.DropdownMenuSubContent=yS;exports.DropdownMenuSubTrigger=HS;exports.DropdownMenuTrigger=VS;exports.ErrorBoundary=Xx;exports.FaCircleCheck=Ph1;exports.GenIcon=pe;exports.HoverCard=$u1;exports.HoverCardContent=iS;exports.HoverCardTrigger=td1;exports.IconPickerField=xd1;exports.ImagePickerField=Fd1;exports.ImagesPanel=Ad1;exports.Input=KL;exports.Label=GL;exports.LinkField=Ed1;exports.Menubar=_L;exports.MenubarCheckboxItem=rS;exports.MenubarContent=cS;exports.MenubarGroup=Yu1;exports.MenubarItem=aS;exports.MenubarLabel=oS;exports.MenubarMenu=Ju1;exports.MenubarPortal=Xu1;exports.MenubarRadioGroup=_u1;exports.MenubarRadioItem=nS;exports.MenubarSeparator=sS;exports.MenubarShortcut=lS;exports.MenubarSub=Qu1;exports.MenubarSubContent=eS;exports.MenubarSubTrigger=tS;exports.MenubarTrigger=$L;exports.Popover=Ku1;exports.PopoverContent=QL;exports.PopoverTrigger=Gu1;exports.RichTextEditorField=Bd1;exports.ScrollArea=JL;exports.ScrollBar=on;exports.Select=ed1;exports.SelectContent=dS;exports.SelectGroup=cd1;exports.SelectItem=vS;exports.SelectLabel=hS;exports.SelectSeparator=fS;exports.SelectTrigger=uS;exports.SelectValue=ad1;exports.Separator=AS;exports.Sheet=rd1;exports.SheetClose=od1;exports.SheetContent=mS;exports.SheetDescription=wS;exports.SheetFooter=bS;exports.SheetHeader=zS;exports.SheetTitle=MS;exports.SheetTrigger=nd1;exports.Skeleton=vn;exports.Switch=pL;exports.Tabs=sn;exports.TabsContent=C0;exports.TabsList=ge;exports.TabsTrigger=w0;exports.Textarea=nn;exports.Toaster=IS;exports.Toggle=gL;exports.Tooltip=Wu1;exports.TooltipContent=XL;exports.TooltipPortal=Zu1;exports.TooltipProvider=YL;exports.TooltipTrigger=Uu1;exports.activePanelAtom=pA;exports.aiAssistantActiveAtom=mn;exports.badgeVariants=VL;exports.builderSaveStateAtom=j0;exports.buttonVariants=ve;exports.canAcceptChildBlock=ha;exports.canDeleteBlock=du1;exports.canDuplicateBlock=uu1;exports.canvasIframeAtom=gA;exports.canvasSettingsAtom=VA;exports.draggedBlockIdAtom=wA;exports.draggingFlagAtom=MA;exports.editLayerNameAtom=fA;exports.getBlockJSONFromSchemas=fa;exports.getBlockJSONFromUISchemas=va;exports.inlineEditingActiveAtom=bA;exports.networkModeAtom=vA;exports.reducer=FS;exports.showPredefinedBlockCategoryAtom=mA;exports.toast=BS;exports.toggleVariants=fL;exports.treeDSBlocks=tL;exports.treeRefAtom=CA;exports.useActiveModal=sh1;exports.useActivePanel=gh1;exports.useAddBlock=Od1;exports.useAddBlockParent=ph1;exports.useAddClassesToBlocks=Nd1;exports.useAllBlocks=lh1;exports.useBlocksContainer=Au1;exports.useBlocksStore=X4;exports.useBlocksStoreUndoableActions=Q4;exports.useBrandingOptions=de;exports.useBuilderProp=B2;exports.useBuilderReset=HA;exports.useCanvasWidth=jd1;exports.useCanvasZoom=Dd1;exports.useChaiExternalData=yA;exports.useCopyBlockIds=qd1;exports.useCopyToClipboard=wh1;exports.useCurrentPage=sL;exports.useCutBlockIds=oA;exports.useDarkMode=Zd1;exports.useDuplicateBlocks=pn;exports.useGetPageData=dL;exports.useHiddenBlockIds=Ud1;exports.useHighlightBlockId=lA;exports.usePageDataProviders=cn;exports.usePasteBlocks=Jd1;exports.usePreviewMode=iA;exports.useReadOnlyMode=hh1;exports.useRemoveBlocks=vL;exports.useRemoveClassesFromBlocks=Qd1;exports.useSavePage=hL;exports.useSelectedBlock=bu1;exports.useSelectedBlockAllClasses=_d1;exports.useSelectedBlockCanvasSetting=wu1;exports.useSelectedBlockCurrentClasses=eh1;exports.useSelectedBlockCustomStylingStates=Cu1;exports.useSelectedBlockIds=g3;exports.useSelectedBlocksDisplayChild=zu1;exports.useSelectedBreakpoints=zh1;exports.useSelectedStylingBlocks=eA;exports.useStylingBreakpoint=cA;exports.useStylingState=ch1;exports.useToast=hn;exports.useUILibraryBlocks=Mh1;exports.useUndoManager=he;exports.useUpdateBlocksProps=ah1;exports.useUpdateBlocksPropsRealtime=nh1;
206
+ */W();var au1=process.env.NODE_ENV!=="production"?cu1:()=>null;function ru1(){return new URLSearchParams(window.location.search).has("dnd")}function nu1(){return new URLSearchParams(window.location.search).has("outline")}const ou1={dnd:ru1(),arborist:nu1()},Gr=l1.atom(null);Gr.debugLabel="chaiBuilderPropsAtom";const Yx=l1.atom({});Yx.debugLabel="chaiExternalDataAtom";class Xx extends h.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?S.jsxRuntimeExports.jsxs("div",{className:"h-full w-full rounded-md bg-red-200 p-4 text-red-500",id:"errorBoundary",children:[S.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Oops! Something went wrong."}),S.jsxRuntimeExports.jsx("p",{children:"Please try again later."})]}):this.props.children}}const su1=()=>!1,lu1=t=>{const e=t.replace(x4.STYLES_KEY,"").split(",");return{baseClasses:e[0],classes:e[1]}},ha=D.memoize((t,e)=>{if(!t)return!0;const c=h3.getBlockComponent(t);return c&&D.has(c,"canAcceptBlock")?c.canAcceptBlock(e):!1}),iu1=D.memoize((t,e)=>{const c=h3.getBlockComponent(e);return c&&D.has(c,"canBeNested")?c.canBeNested(t):!0}),uu1=D.memoize(t=>{const e=h3.getBlockComponent(t);return e&&D.has(e,"canDuplicate")?e.canDuplicate():!0}),du1=D.memoize(t=>{const e=h3.getBlockComponent(t);return e&&D.has(e,"canDelete")?e.canDelete():!0});function Qx(t,e,c){const a=D.filter(t,n=>n._parent===e),r=[];for(let n=0;n<a.length;n++){const o=$x(a[n]);if(Object.keys(o).length>0&&Object.keys(o).forEach(s=>{a[n][s]=`slot:${W4.generateUUID()}`}),D.filter(t,{_parent:a[n]._id}).length>0){const s=W4.generateUUID();r.push({...a[n],oldId:a[n]._id,_id:s,_parent:c}),r.push(D.flatten(Qx(t,a[n]._id,s)))}else r.push({...a[n],oldId:a[n]._id,_id:W4.generateUUID(),_parent:c})}return D.flatten(r)}function _x(t){const e={};t.forEach(a=>{e[a._id]={...a,children:[]}});const c=[];return t.forEach(a=>{if(a._parent){const r=e[a._parent];r&&r.children.push(e[a._id])}else c.push(e[a._id])}),c}const $x=t=>{const e={};return Object.keys(t).forEach(c=>{D.isString(t[c])&&t[c].startsWith("slot")&&(e[c]=t[c].replace("slot:",""))}),e},hu1=(t,e,c=null)=>{let a=D.find(t,{_id:e});a={...a,oldId:a._id,_id:W4.generateUUID()},c&&(a={...a,_parent:c});const r=[a];D.filter(t,{_parent:e}).length>0&&r.push(D.flatten(Qx(t,e,a._id)));const n=D.flatten(r);return D.map(n,o=>{const s=o,l=$x(s);return Object.keys(l).length>0&&Object.keys(l).forEach(u=>{const i=D.find(n,{oldId:l[u].replace("slot:","")});s[u]=`slot:${i._id}`}),D.omit(s,["global","oldId"])})};const S4=l1.atom([]);S4.debugLabel="presentBlocksAtom";const tL=l1.atom(t=>{const e=t(S4);return _x([...e])});tL.debugLabel="treeDSBlocks";S4.debugLabel="presentBlocksAtom";const Jr=ce1(S4);Jr.debugLabel="pageBlocksAtomsAtom";const vu1=l1.atom("");vu1.debugLabel="builderActivePageAtom";const fu1=l1.atom(-1);fu1.debugLabel="destinationDropIndexAtom";const eL=l1.atom([]);eL.debugLabel="buildingBlocksAtom";const gu1=l1.atom(t=>{const e=t(eL);return D.filter(e,c=>D.has(c,"blockId"))});gu1.debugLabel="globalBlocksAtom";const Yr=l1.atom([]);Yr.debugLabel="selectedBlockIdsAtom";const Xr=l1.atom(t=>{const e=t(S4),c=t(Yr);return D.map(D.filter(e,({_id:a})=>D.includes(c,a)),a=>({...a}))});Xr.debugLabel="selectedBlocksAtom";const ue=l1.atom(t=>{const e=t(Xr);if(e.length===0)return null;if(e.length===1)return e[0]});ue.debugLabel="selectedBlockAtom";const pu1=t=>D.get(t,"_parent",null),mu1=l1.atom(t=>{const e=t(Xr),c=D.map(e,pu1);return D.filter(t(S4),a=>D.includes(c,a._id))});mu1.debugLabel="selectedBlocksParentsAtom";const cL=l1.atom(()=>!1);cL.debugLabel="selectedBlockFlexChildAtom";const aL=l1.atom(()=>!1);aL.debugLabel="selectedBlockGridChildAtom";const Qr=l1.atom("");Qr.debugLabel="styleStateAtom";const rL=g4("styleBreakpoint","xs");rL.debugLabel="styleBreakpointAtom";const zu1=()=>({flexChild:l1.useAtomValue(cL),gridChild:l1.useAtomValue(aL)}),bu1=()=>l1.useAtomValue(ue),Mu1=l1.atom(t=>{const e=t(ue),c=t(S4);let a=e;const r=[e];do{const n=c.find(({_id:o})=>o===(a==null?void 0:a._parent));a=n,n&&r.push(n)}while(a!=null&&a._parent);return r}),nL=()=>l1.useAtomValue(Mu1),wu1=()=>{const t=nL();return h.useMemo(()=>{for(let e=0;e<t.length;e++){const c=h3.getBlockComponent(t[e]._type),a=D.cloneDeep(D.get(c,"blockState",{}));if(!D.isEmpty(a))return{settings:a,block:t[e]}}return{}},[t])},Cu1=()=>{const t=nL();return h.useMemo(()=>{let e={};for(let c=0;c<t.length;c++){const a=h3.getBlockComponent(t[c]._type),r=D.get(a,"customStylingStates",{});e={...e,...r}}return e},[t])},g3=()=>{const[t,e]=l1.useAtom(Yr),c=h.useCallback(a=>{e(r=>D.includes(r,a)?D.without(r,a):[...r,a])},[e]);return[t,e,c]},va=t=>{switch(t.type){case"singular":return t.uiSchema;case"model":const{properties:e}=t,c={};return Object.keys(e).forEach(n=>{const o=e[n];if(D.includes(["slot","styles"],o.type))return;const s=n;c[s]=va(o)}),c;case"list":const{itemProperties:a}=t,r={items:{}};return Object.keys(a).forEach(n=>{const o=a[n];if(D.includes(["slot","styles"],o.type))return;const s=n;r.items[s]=va(o)}),r;default:return{}}},fa=t=>{switch(t.type){case"singular":return t.schema;case"model":const{properties:e,title:c}=t,a={title:c,type:"object",properties:{}};return Object.keys(e).forEach(s=>{const l=e[s];if(D.includes(["slot","styles"],l.type))return;const u=s;a.properties[u]=fa(l)}),a;case"list":const{itemProperties:r,title:n}=t,o={title:n,type:"array",items:{type:"object",properties:{}}};return Object.keys(r).forEach(s=>{const l=r[s];if(D.includes(["slot","styles"],l.type))return;const u=s;o.items.properties[u]=fa(l),D.set(o.items,"title",D.get(l,"itemTitle",`${n} item`))}),o;default:return{}}},oL=t=>{if(!t)return{};const e={};return Object.keys(t).forEach(c=>{e[c]=Hu1(t[c])}),e},Vu1=t=>{if(D.isEmpty(t.default))return[];const{itemProperties:e}=t;return D.map(t.default,c=>{const a={...c};return D.forIn(c,(r,n)=>{D.has(e,n)&&D.get(e[n],"i18n",!1)&&(a[n]=x4.I18N_KEY)}),a})},Hu1=t=>{switch(t.type){case"styles":return t.default;case"slot":return`${x4.SLOT_KEY}${W4.generateUUID()}`;case"singular":const{schema:e}=t;return D.get(e,"default","");case"model":return oL(t.properties);case"list":return Vu1(t);default:return""}};var _r={exports:{}},bv1=_r.exports;(function(t){(function(){"use strict";function e(a,r,n){return a.splice(r,!n||1+n-r+(!(n<0^r>=0)&&(n<0||-1)*a.length)),a.length}let c=function(){let a=[],r=-1,n=0,o=!1,s;function l(u,i){return!u||typeof u[i]!="function"?this:(o=!0,u[i](),o=!1,this)}return{add:function(u){return o?this:(a.splice(r+1,a.length-r),a.push(u),n&&a.length>n&&e(a,0,-(n+1)),r=a.length-1,s&&s(),this)},setCallback:function(u){s=u},undo:function(){let u=a[r];if(!u)return this;const i=u.groupId;for(;u.groupId===i&&(l(u,"undo"),r-=1,u=a[r],!(!u||!u.groupId)););return s&&s(),this},redo:function(){let u=a[r+1];if(!u)return this;const i=u.groupId;for(;u.groupId===i&&(l(u,"redo"),r+=1,u=a[r+1],!(!u||!u.groupId)););return s&&s(),this},clear:function(){let u=a.length;a=[],r=-1,s&&u>0&&s()},hasUndo:function(){return r!==-1},hasRedo:function(){return r<a.length-1},getCommands:function(u){return u?a.filter(i=>i.groupId===u):a},getIndex:function(){return r},setLimit:function(u){n=u}}};t.exports?t.exports=c:window.UndoManager=c})()})(_r);var yu1=_r.exports;const xu1=V4.getDefaultExportFromCjs(yu1),Lu1=l1.atom(Ac.BRANDING_OPTIONS_DEFAULTS),Su1=l1.atom(null),de=()=>{const[t,e]=l1.useAtom(Lu1);return[D.isObject(t)?{...Ac.BRANDING_OPTIONS_DEFAULTS,...t}:Ac.BRANDING_OPTIONS_DEFAULTS,e]},Au1=()=>l1.useAtom(Su1),Fu1=l1.atom(null),sL=()=>({currentPage:l1.useAtomValue(Fu1)});function Bu1(t){return _x(t)}const $r=(t,e)=>D.flatten(t.map(c=>{if(c=e?{...c,_parent:e}:{...c},c.children){const a=[...c.children];return delete c.children,D.flatten([c,...$r(a,c._id)])}return c}));function tn(t,e=!1){for(let c=0;c<t.length;c++){const a=t[c];a.global&&!e?t[c]={type:"GlobalBlock",blockId:a.blockId,_parent:D.get(a,"_parent",null),_id:a._id}:a.children&&a.children.length&&tn(a.children)}}function lL(t){let e=[],c=D.filter(t,{type:"GlobalBlock"});return c.length>0&&(c=D.map(c,iL),D.each(c,a=>{e=[...e,...Eu1(a)]})),e}function Eu1(t){let e=[];const c=D.get(D.first(t),"_parent",null);D.set(D.first(t),"_parent",null);const a=[flatToNestedInstance.convert(uL(t))];tn(a,!0);let r=$r(a,t[0]._id);return r=D.set(r,"0._parent",c),e=[...e,r,...lL(r)],e}function iL(t){const e=D.find(ga,{_id:t._id});if(!e)return[];const c=[e],a=D.filter(ga,{_parent:t._id});return a.length?D.flatten([...c,...D.flatten(D.map(a,iL))]):D.flatten(c)}const uL=t=>JSON.parse(JSON.stringify(t));let ga=[];function Ou1(t){ga=t;const e=Bu1(uL(t));tn(e);const c=$r(e,null),a=lL(c),r={};return D.each(a,n=>D.set(r,D.first(n).blockId,n)),[c,r]}const dL=()=>{const[t]=de(),{currentPage:e}=sL(),[c]=X4();return h.useCallback(()=>{const a=D.map(c,n=>D.omit(n,["expanded","order","title","siblings","tempClasses"])),[r=[]]=Ou1(a);return{currentPage:e,blocks:r}},[t,e,c])},B2=(t,e=void 0)=>{const c=l1.useAtomValue(Gr);return D.get(c,t,e)},en=l1.atom([]);en.debugLabel="dataProvidersAtom";const cn=()=>l1.useAtom(en),j0=l1.atom("SAVED");j0.debugLabel="builderSaveStateAtom";const hL=()=>{const[t,e]=l1.useAtom(j0),c=B2("onSavePage",async u=>{}),a=B2("onSave",async u=>{}),r=B2("onSaveStateChange",D.noop),n=dL(),[o]=cn(),[s]=de();return{savePage:eg.useThrottledCallback(async()=>{e("SAVING"),r("SAVING");const u=n();return await c({blocks:u.blocks,providers:o}),await a({blocks:u.blocks,providers:o,brandingOptions:s}),setTimeout(()=>{e("SAVED"),r("SAVED")},100),!0},[n,e,s,a,r],3e3),saveState:t,setSaveState:e}},D4=new xu1;D4.setLimit(50);const he=()=>{const[,t]=l1.useAtom(j0),e=B2("onSaveStateChange",D.noop);return h.useEffect(()=>(D4.setCallback(()=>{t("UNSAVED"),e("UNSAVED")}),()=>{D4.setCallback(D.noop)}),[]),{add:D4.add,undo:D4.undo,redo:D4.redo,hasRedo:D4.hasRedo,hasUndo:D4.hasUndo,clear:D4.clear}},an=(t,e)=>{const c=[],a=D.filter(t,r=>D.includes(e,r._id)||D.includes(e,r._parent)?(c.push(r._id),!1):!0);return D.isEmpty(c)?a:an(a,c)},vL=()=>{const[t]=X4(),[e,c]=g3(),{setNewBlocks:a}=Q4();return h.useCallback(r=>{var o;const n=((o=D.find(t,{_id:r[0]}))==null?void 0:o._parent)||null;a(an(t,r)),setTimeout(()=>c(n?[n]:[]),200)},[t,c,e])};function Pu1(t,e,c,a){let r=t.filter(s=>!s._parent);c&&(r=t.filter(s=>s._parent===c));const n=a!==void 0?a:r.length;let o=t.length;for(let s=0,l=0;s<t.length;s++)if(t[s]._parent===c){if(l===n){o=s;break}l++}return!c&&a!==void 0&&a>=r.length&&(o=t.length),[...t.slice(0,o),...e,...t.slice(o)]}function Wf(t){const e=[],c=new Map;t.forEach(r=>{c.set(r._id,r)});function a(r){const n=c.get(r);e.includes(n)||(e.push(n),t.forEach(o=>{o._parent===r&&a(o._id)}))}return t.forEach(r=>{r._parent||a(r._id)}),e}const ku1=(t,e,c,a)=>{if(D.isEmpty(e))return Wf(t);function r(s,l){const u=s.filter(d=>d._parent===l);let i=[...u];return u.forEach(d=>{i=i.concat(r(s,d._id))}),i}const n=e.reduce((s,l)=>{const u=t.find(i=>i._id===l);if(u){const i=r(t,l);s.push(u,...i)}return s},[]);t=t.filter(s=>!n.includes(s)),n.forEach(s=>{e.includes(s._id)&&(s._parent=c)});let o;if(!c)o=a;else{const s=t.findIndex(l=>l._id===c);if(s===-1)o=a;else{o=s+1;let l=0;for(;l<a&&o<t.length;)t[o]._parent===c&&l++,o++}}return t.splice(o,0,...n),Wf(t)},Ru1=()=>{const[,t]=X4();return{setNewBlocks:e=>{t(e)},addBlocks:(e,c,a)=>{t(r=>Pu1(r,e,c,a))},removeBlocks:e=>{t(c=>an(c,e))},moveBlocks:(e,c,a)=>{t(r=>ku1(r,e,c,a))},updateBlocksProps:e=>{t(c=>{const a=e.map(r=>r._id);return c.map(r=>{if(a.includes(r._id)){const n=D.find(e,{_id:r._id});return{...r,...D.omit(n,"_id")}}return r})})}}},X4=()=>l1.useAtom(S4),Q4=()=>{const{add:t}=he(),[e]=X4(),{setNewBlocks:c,addBlocks:a,removeBlocks:r,moveBlocks:n,updateBlocksProps:o}=Ru1();return{moveBlocks:(p,g,m)=>{const z=D.map(p,w=>{const C=e.find(F=>F._id===w)._parent||null,L=e.filter(F=>C?F._parent===C:!F._parent).map(F=>F._id).indexOf(w);return{_id:w,oldParent:C,oldPosition:L}}),b=z.find(({_id:w})=>w===p[0]);b&&b.oldParent===g&&b.oldPosition===m||(n(p,g,m),t({undo:()=>D.each(z,({_id:w,oldParent:V,oldPosition:C})=>{n([w],V,C)}),redo:()=>n(p,g,m)}))},addBlocks:(p,g,m)=>{a(p,g,m),t({undo:()=>r(D.map(p,"_id")),redo:()=>a(p,g,m)})},removeBlocks:p=>{var b;const g=(b=D.first(p))==null?void 0:b._parent,z=e.filter(w=>g?w._parent===g:!w._parent).indexOf(D.first(p));r(D.map(p,"_id")),t({undo:()=>a(p,g,z),redo:()=>r(D.map(p,"_id"))})},updateBlocks:(p,g,m)=>{let z=[];if(m)z=D.map(p,b=>({_id:b,...m}));else{const b=D.keys(g);z=D.map(p,w=>{const V=e.find(H=>H._id===w),C={_id:w};return D.each(b,H=>C[H]=V[H]),C})}o(D.map(p,b=>({_id:b,...g}))),t({undo:()=>o(z),redo:()=>o(D.map(p,b=>({_id:b,...g})))})},updateBlocksRuntime:(p,g)=>{o(D.map(p,m=>({_id:m,...g})))},setNewBlocks:p=>{c(p),t({undo:()=>c(e),redo:()=>c(p)})},updateMultipleBlocksProps:p=>{let g=[];g=D.map(p,m=>{const z=D.keys(m),b=e.find(V=>V._id===m._id),w={};return D.each(z,V=>w[V]=b[V]),w}),o(p),t({undo:()=>o(g),redo:()=>o(p)})}}},fL=R3.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"}}),gL=x.forwardRef(({className:t,variant:e,size:c,...a},r)=>S.jsxRuntimeExports.jsx(ag.Root,{ref:r,className:s1.cn(fL({variant:e,size:c,className:t})),...a}));gL.displayName=ag.Root.displayName;const pL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(Fc.Root,{className:s1.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",t),...e,ref:c,children:S.jsxRuntimeExports.jsx(Fc.Thumb,{className:s1.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")})}));pL.displayName=Fc.Root.displayName;const ve=R3.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"}}),M0=x.forwardRef(({className:t,variant:e,size:c,asChild:a=!1,...r},n)=>{const o=a?PA.Slot:"button";return S.jsxRuntimeExports.jsx(o,{className:s1.cn(ve({variant:e,size:c,className:t})),ref:n,...r})});M0.displayName="Button";const Iu1=F3.Root,mL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(F3.Item,{ref:c,className:s1.cn("border-b",t),...e}));mL.displayName="AccordionItem";const zL=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsx(F3.Header,{className:"flex",children:S.jsxRuntimeExports.jsxs(F3.Trigger,{ref:a,className:s1.cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...c,children:[e,S.jsxRuntimeExports.jsx(d2.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));zL.displayName=F3.Trigger.displayName;const bL=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsx(F3.Content,{ref:a,className:s1.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",t),...c,children:S.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:e})}));bL.displayName=F3.Content.displayName;const Nu1=R3.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"}}),ML=x.forwardRef(({className:t,variant:e,...c},a)=>S.jsxRuntimeExports.jsx("div",{ref:a,role:"alert",className:s1.cn(Nu1({variant:e}),t),...c}));ML.displayName="Alert";const wL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("h5",{ref:c,className:s1.cn("mb-1 font-medium leading-none tracking-tight",t),...e}));wL.displayName="AlertTitle";const CL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("div",{ref:c,className:s1.cn("text-sm [&_p]:leading-relaxed",t),...e}));CL.displayName="AlertDescription";const VL=R3.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"}}),ju1=({className:t,variant:e,...c})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn(VL({variant:e}),t),...c}),Tu1=j2.Root,Du1=j2.Trigger,HL=({className:t,...e})=>S.jsxRuntimeExports.jsx(j2.Portal,{className:s1.cn(t),...e});HL.displayName=j2.Portal.displayName;const yL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(j2.Overlay,{className:s1.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",t),...e,ref:c}));yL.displayName=j2.Overlay.displayName;const xL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsxs(HL,{children:[S.jsxRuntimeExports.jsx(yL,{}),S.jsxRuntimeExports.jsx(j2.Content,{ref:c,className:s1.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",t),...e})]}));xL.displayName=j2.Content.displayName;const LL=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("flex flex-col space-y-2 text-center sm:text-left",t),...e});LL.displayName="AlertDialogHeader";const SL=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});SL.displayName="AlertDialogFooter";const AL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(j2.Title,{ref:c,className:s1.cn("text-lg font-semibold",t),...e}));AL.displayName=j2.Title.displayName;const FL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(j2.Description,{ref:c,className:s1.cn("text-sm text-muted-foreground",t),...e}));FL.displayName=j2.Description.displayName;const BL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(j2.Action,{ref:c,className:s1.cn(ve(),t),...e}));BL.displayName=j2.Action.displayName;const EL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(j2.Cancel,{ref:c,className:s1.cn(ve({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));EL.displayName=j2.Cancel.displayName;const rn=J1.Root,OL=J1.Trigger,PL=({className:t,...e})=>S.jsxRuntimeExports.jsx(J1.Portal,{className:s1.cn(t),...e});PL.displayName=J1.Portal.displayName;const kL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(J1.Overlay,{ref:c,className:s1.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",t),...e}));kL.displayName=J1.Overlay.displayName;const fe=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs(PL,{children:[S.jsxRuntimeExports.jsx(kL,{}),S.jsxRuntimeExports.jsxs(J1.Content,{ref:a,className:s1.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",t),...c,children:[e,S.jsxRuntimeExports.jsxs(J1.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:[S.jsxRuntimeExports.jsx(d2.Cross2Icon,{className:"h-4 w-4"}),S.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fe.displayName=J1.Content.displayName;const RL=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});RL.displayName="DialogHeader";const IL=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});IL.displayName="DialogFooter";const NL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(J1.Title,{ref:c,className:s1.cn("text-lg font-semibold leading-none tracking-tight",t),...e}));NL.displayName=J1.Title.displayName;const jL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(J1.Description,{ref:c,className:s1.cn("text-sm text-muted-foreground",t),...e}));jL.displayName=J1.Description.displayName;const TL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("div",{ref:c,className:s1.cn("rounded-xl border bg-card text-card-foreground shadow",t),...e}));TL.displayName="Card";const DL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("div",{ref:c,className:s1.cn("flex flex-col space-y-1.5 p-6",t),...e}));DL.displayName="CardHeader";const qL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("h3",{ref:c,className:s1.cn("font-semibold leading-none tracking-tight",t),...e}));qL.displayName="CardTitle";const ZL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("p",{ref:c,className:s1.cn("text-sm text-muted-foreground",t),...e}));ZL.displayName="CardDescription";const WL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("div",{ref:c,className:s1.cn("p-6 pt-0",t),...e}));WL.displayName="CardContent";const UL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("div",{ref:c,className:s1.cn(" flex items-center p-6 pt-0",t),...e}));UL.displayName="CardFooter";const KL=x.forwardRef(({className:t,type:e,...c},a)=>S.jsxRuntimeExports.jsx("input",{type:e,className:s1.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",t),ref:a,...c}));KL.displayName="Input";const qu1=R3.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),GL=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(rg.Root,{ref:c,className:s1.cn(qu1(),t),...e}));GL.displayName=rg.Root.displayName;const nn=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx("textarea",{className:s1.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",t),ref:c,...e}));nn.displayName="Textarea";const JL=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs(K2.Root,{ref:a,className:s1.cn("relative overflow-hidden",t),...c,children:[S.jsxRuntimeExports.jsx(K2.Viewport,{className:"h-full w-full rounded-[inherit]",children:e}),S.jsxRuntimeExports.jsx(on,{}),S.jsxRuntimeExports.jsx(K2.Corner,{})]}));JL.displayName=K2.Root.displayName;const on=x.forwardRef(({className:t,orientation:e="vertical",...c},a)=>S.jsxRuntimeExports.jsx(K2.ScrollAreaScrollbar,{ref:a,orientation:e,className:s1.cn("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",t),...c,children:S.jsxRuntimeExports.jsx(K2.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));on.displayName=K2.ScrollAreaScrollbar.displayName;const sn=I3.Root,ge=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(I3.List,{ref:c,className:s1.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));ge.displayName=I3.List.displayName;const w0=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(I3.Trigger,{ref:c,className:s1.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",t),...e}));w0.displayName=I3.Trigger.displayName;const C0=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(I3.Content,{ref:c,className:s1.cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));C0.displayName=I3.Content.displayName;const Zu1=V6.Portal,YL=V6.Provider,Wu1=V6.Root,Uu1=V6.Trigger,XL=x.forwardRef(({className:t,sideOffset:e=4,...c},a)=>S.jsxRuntimeExports.jsx(V6.Content,{ref:a,sideOffset:e,className:s1.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",t),...c}));XL.displayName=V6.Content.displayName;const Ku1=i0.Root,Gu1=i0.Trigger,QL=x.forwardRef(({className:t,align:e="center",sideOffset:c=4,...a},r)=>S.jsxRuntimeExports.jsx(i0.Portal,{children:S.jsxRuntimeExports.jsx(i0.Content,{ref:r,align:e,sideOffset:c,className:s1.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",t),...a})}));QL.displayName=i0.Content.displayName;const Ju1=K1.Menu,Yu1=K1.Group,Xu1=K1.Portal,Qu1=K1.Sub,_u1=K1.RadioGroup,_L=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(K1.Root,{ref:c,className:s1.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",t),...e}));_L.displayName=K1.Root.displayName;const $L=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(K1.Trigger,{ref:c,className:s1.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",t),...e}));$L.displayName=K1.Trigger.displayName;const tS=x.forwardRef(({className:t,inset:e,children:c,...a},r)=>S.jsxRuntimeExports.jsxs(K1.SubTrigger,{ref:r,className:s1.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",e&&"pl-8",t),...a,children:[c,S.jsxRuntimeExports.jsx(d2.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));tS.displayName=K1.SubTrigger.displayName;const eS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(K1.SubContent,{ref:c,className:s1.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",t),...e}));eS.displayName=K1.SubContent.displayName;const cS=x.forwardRef(({className:t,align:e="start",alignOffset:c=-4,sideOffset:a=8,...r},n)=>S.jsxRuntimeExports.jsx(K1.Portal,{children:S.jsxRuntimeExports.jsx(K1.Content,{ref:n,align:e,alignOffset:c,sideOffset:a,className:s1.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",t),...r})}));cS.displayName=K1.Content.displayName;const aS=x.forwardRef(({className:t,inset:e,...c},a)=>S.jsxRuntimeExports.jsx(K1.Item,{ref:a,className:s1.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",e&&"pl-8",t),...c}));aS.displayName=K1.Item.displayName;const rS=x.forwardRef(({className:t,children:e,checked:c,...a},r)=>S.jsxRuntimeExports.jsxs(K1.CheckboxItem,{ref:r,className:s1.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",t),checked:c,...a,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx(K1.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.CheckIcon,{className:"h-4 w-4"})})}),e]}));rS.displayName=K1.CheckboxItem.displayName;const nS=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs(K1.RadioItem,{ref:a,className:s1.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",t),...c,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx(K1.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),e]}));nS.displayName=K1.RadioItem.displayName;const oS=x.forwardRef(({className:t,inset:e,...c},a)=>S.jsxRuntimeExports.jsx(K1.Label,{ref:a,className:s1.cn("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...c}));oS.displayName=K1.Label.displayName;const sS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(K1.Separator,{ref:c,className:s1.cn("-mx-1 my-1 h-px bg-muted",t),...e}));sS.displayName=K1.Separator.displayName;const lS=({className:t,...e})=>S.jsxRuntimeExports.jsx("span",{className:s1.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});lS.displayname="MenubarShortcut";const $u1=xt.Root,td1=xt.Trigger,iS=x.forwardRef(({className:t,align:e="center",sideOffset:c=4,...a},r)=>S.jsxRuntimeExports.jsx(xt.Content,{ref:r,align:e,sideOffset:c,className:s1.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",t),...a}));iS.displayName=xt.Content.displayName;const ed1=y2.Root,cd1=y2.Group,ad1=y2.Value,uS=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs(y2.Trigger,{ref:a,className:s1.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",t),...c,children:[e,S.jsxRuntimeExports.jsx(y2.Icon,{asChild:!0,children:S.jsxRuntimeExports.jsx(d2.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));uS.displayName=y2.Trigger.displayName;const dS=x.forwardRef(({className:t,children:e,position:c="popper",...a},r)=>S.jsxRuntimeExports.jsx(y2.Portal,{children:S.jsxRuntimeExports.jsx(y2.Content,{ref:r,className:s1.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",c==="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",t),position:c,...a,children:S.jsxRuntimeExports.jsx(y2.Viewport,{className:s1.cn("p-1",c==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));dS.displayName=y2.Content.displayName;const hS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(y2.Label,{ref:c,className:s1.cn("px-2 py-1.5 text-sm font-semibold",t),...e}));hS.displayName=y2.Label.displayName;const vS=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs(y2.Item,{ref:a,className:s1.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",t),...c,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx(y2.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.CheckIcon,{className:"h-4 w-4"})})}),S.jsxRuntimeExports.jsx(y2.ItemText,{children:e})]}));vS.displayName=y2.Item.displayName;const fS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(y2.Separator,{ref:c,className:s1.cn("-mx-1 my-1 h-px bg-muted",t),...e}));fS.displayName=y2.Separator.displayName;const rd1=J1.Root,nd1=J1.Trigger,od1=J1.Close,gS=({className:t,...e})=>S.jsxRuntimeExports.jsx(J1.Portal,{className:s1.cn(t),...e});gS.displayName=J1.Portal.displayName;const pS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(J1.Overlay,{className:s1.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",t),...e,ref:c}));pS.displayName=J1.Overlay.displayName;const sd1=R3.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"}}),mS=x.forwardRef(({side:t="right",className:e,children:c,...a},r)=>S.jsxRuntimeExports.jsxs(gS,{children:[S.jsxRuntimeExports.jsx(pS,{}),S.jsxRuntimeExports.jsxs(J1.Content,{ref:r,className:s1.cn(sd1({side:t}),e),...a,children:[c,S.jsxRuntimeExports.jsxs(J1.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:[S.jsxRuntimeExports.jsx(d2.Cross2Icon,{className:"h-4 w-4"}),S.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));mS.displayName=J1.Content.displayName;const zS=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("flex flex-col space-y-2 text-center sm:text-left",t),...e});zS.displayName="SheetHeader";const bS=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});bS.displayName="SheetFooter";const MS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(J1.Title,{ref:c,className:s1.cn("text-lg font-semibold text-foreground",t),...e}));MS.displayName=J1.Title.displayName;const wS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(J1.Description,{ref:c,className:s1.cn("text-sm text-muted-foreground",t),...e}));wS.displayName=J1.Description.displayName;const CS=_1.Root,VS=_1.Trigger,ld1=_1.Group,id1=_1.Portal,ud1=_1.Sub,dd1=_1.RadioGroup,HS=x.forwardRef(({className:t,inset:e,children:c,...a},r)=>S.jsxRuntimeExports.jsxs(_1.SubTrigger,{ref:r,className:s1.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",e&&"pl-8",t),...a,children:[c,S.jsxRuntimeExports.jsx(d2.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));HS.displayName=_1.SubTrigger.displayName;const yS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(_1.SubContent,{ref:c,className:s1.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",t),...e}));yS.displayName=_1.SubContent.displayName;const ln=x.forwardRef(({className:t,sideOffset:e=4,...c},a)=>S.jsxRuntimeExports.jsx(_1.Portal,{children:S.jsxRuntimeExports.jsx(_1.Content,{ref:a,sideOffset:e,className:s1.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",t),...c})}));ln.displayName=_1.Content.displayName;const h6=x.forwardRef(({className:t,inset:e,...c},a)=>S.jsxRuntimeExports.jsx(_1.Item,{ref:a,className:s1.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",e&&"pl-8",t),...c}));h6.displayName=_1.Item.displayName;const xS=x.forwardRef(({className:t,children:e,checked:c,...a},r)=>S.jsxRuntimeExports.jsxs(_1.CheckboxItem,{ref:r,className:s1.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",t),checked:c,...a,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx(_1.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.CheckIcon,{className:"h-4 w-4"})})}),e]}));xS.displayName=_1.CheckboxItem.displayName;const LS=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs(_1.RadioItem,{ref:a,className:s1.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",t),...c,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx(_1.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),e]}));LS.displayName=_1.RadioItem.displayName;const un=x.forwardRef(({className:t,inset:e,...c},a)=>S.jsxRuntimeExports.jsx(_1.Label,{ref:a,className:s1.cn("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...c}));un.displayName=_1.Label.displayName;const dn=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(_1.Separator,{ref:c,className:s1.cn("-mx-1 my-1 h-px bg-muted",t),...e}));dn.displayName=_1.Separator.displayName;const SS=({className:t,...e})=>S.jsxRuntimeExports.jsx("span",{className:s1.cn("ml-auto text-xs tracking-widest opacity-60",t),...e});SS.displayName="DropdownMenuShortcut";const AS=x.forwardRef(({className:t,orientation:e="horizontal",decorative:c=!0,...a},r)=>S.jsxRuntimeExports.jsx(ng.Root,{ref:r,decorative:c,orientation:e,className:s1.cn("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...a}));AS.displayName=ng.Root.displayName;const hd1=1,vd1=1e6;let Lc=0;function fd1(){return Lc=(Lc+1)%Number.MAX_VALUE,Lc.toString()}const Sc=new Map,Uf=t=>{if(Sc.has(t))return;const e=setTimeout(()=>{Sc.delete(t),l0({type:"REMOVE_TOAST",toastId:t})},vd1);Sc.set(t,e)},FS=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,hd1)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(c=>c.id===e.toast.id?{...c,...e.toast}:c)};case"DISMISS_TOAST":{const{toastId:c}=e;return c?Uf(c):t.toasts.forEach(a=>{Uf(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===c||c===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(c=>c.id!==e.toastId)}}},W8=[];let U8={toasts:[]};function l0(t){U8=FS(U8,t),W8.forEach(e=>{e(U8)})}function BS({...t}){const e=fd1(),c=r=>l0({type:"UPDATE_TOAST",toast:{...r,id:e}}),a=()=>l0({type:"DISMISS_TOAST",toastId:e});return l0({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:r=>{r||a()}}}),{id:e,dismiss:a,update:c}}function hn(){const[t,e]=x.useState(U8);return x.useEffect(()=>(W8.push(e),()=>{const c=W8.indexOf(e);c>-1&&W8.splice(c,1)}),[t]),{...t,toast:BS,dismiss:c=>l0({type:"DISMISS_TOAST",toastId:c})}}const gd1=s4.Provider,ES=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(s4.Viewport,{ref:c,className:s1.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]",t),...e}));ES.displayName=s4.Viewport.displayName;const pd1=R3.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"}}),OS=x.forwardRef(({className:t,variant:e,...c},a)=>S.jsxRuntimeExports.jsx(s4.Root,{ref:a,className:s1.cn(pd1({variant:e}),t),...c}));OS.displayName=s4.Root.displayName;const md1=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(s4.Action,{ref:c,className:s1.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",t),...e}));md1.displayName=s4.Action.displayName;const PS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(s4.Close,{ref:c,className:s1.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",t),"toast-close":"",...e,children:S.jsxRuntimeExports.jsx(d2.Cross2Icon,{className:"h-4 w-4"})}));PS.displayName=s4.Close.displayName;const kS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(s4.Title,{ref:c,className:s1.cn("text-sm font-semibold [&+div]:text-xs",t),...e}));kS.displayName=s4.Title.displayName;const RS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(s4.Description,{ref:c,className:s1.cn("text-sm opacity-90",t),...e}));RS.displayName=s4.Description.displayName;function IS(){const{toasts:t}=hn();return S.jsxRuntimeExports.jsxs(gd1,{children:[t.map(({id:e,title:c,description:a,action:r,...n})=>S.jsxRuntimeExports.jsxs(OS,{...n,children:[S.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[c&&S.jsxRuntimeExports.jsx(kS,{children:c}),a&&S.jsxRuntimeExports.jsx(RS,{children:a})]}),r,S.jsxRuntimeExports.jsx(PS,{})]},e)),S.jsxRuntimeExports.jsx(ES,{})]})}const vn=({className:t,...e})=>S.jsxRuntimeExports.jsx("div",{className:s1.cn("animate-pulse rounded-md bg-primary/10",t),...e}),fn=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(X2.Command,{ref:c,className:s1.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));fn.displayName=X2.Command.displayName;const zd1=({children:t,...e})=>S.jsxRuntimeExports.jsx(rn,{...e,children:S.jsxRuntimeExports.jsx(fe,{className:"overflow-hidden p-0",children:S.jsxRuntimeExports.jsx(fn,{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:t})})}),NS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[S.jsxRuntimeExports.jsx(d2.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),S.jsxRuntimeExports.jsx(X2.Command.Input,{ref:c,className:s1.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",t),...e})]}));NS.displayName=X2.Command.Input.displayName;const jS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(X2.Command.List,{ref:c,className:s1.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));jS.displayName=X2.Command.List.displayName;const TS=x.forwardRef((t,e)=>S.jsxRuntimeExports.jsx(X2.Command.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));TS.displayName=X2.Command.Empty.displayName;const DS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(X2.Command.Group,{ref:c,className:s1.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",t),...e}));DS.displayName=X2.Command.Group.displayName;const qS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(X2.Command.Separator,{ref:c,className:s1.cn("-mx-1 h-px bg-border",t),...e}));qS.displayName=X2.Command.Separator.displayName;const ZS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx(X2.Command.Item,{ref:c,className:s1.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",t),...e}));ZS.displayName=X2.Command.Item.displayName;const WS=({className:t,...e})=>S.jsxRuntimeExports.jsx("span",{className:s1.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});WS.displayName="CommandShortcut";const bd1=$1.Root,Md1=$1.Trigger,wd1=$1.Group,Cd1=$1.Portal,Vd1=$1.Sub,Hd1=$1.RadioGroup,US=x.forwardRef(({className:t,inset:e,children:c,...a},r)=>S.jsxRuntimeExports.jsxs($1.SubTrigger,{ref:r,className:s1.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",e&&"pl-8",t),...a,children:[c,S.jsxRuntimeExports.jsx(d2.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));US.displayName=$1.SubTrigger.displayName;const KS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx($1.SubContent,{ref:c,className:s1.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",t),...e}));KS.displayName=$1.SubContent.displayName;const GS=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx($1.Portal,{children:S.jsxRuntimeExports.jsx($1.Content,{ref:c,className:s1.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",t),...e})}));GS.displayName=$1.Content.displayName;const JS=x.forwardRef(({className:t,inset:e,...c},a)=>S.jsxRuntimeExports.jsx($1.Item,{ref:a,className:s1.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",e&&"pl-8",t),...c}));JS.displayName=$1.Item.displayName;const YS=x.forwardRef(({className:t,children:e,checked:c,...a},r)=>S.jsxRuntimeExports.jsxs($1.CheckboxItem,{ref:r,className:s1.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",t),checked:c,...a,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx($1.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.CheckIcon,{className:"h-4 w-4"})})}),e]}));YS.displayName=$1.CheckboxItem.displayName;const XS=x.forwardRef(({className:t,children:e,...c},a)=>S.jsxRuntimeExports.jsxs($1.RadioItem,{ref:a,className:s1.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",t),...c,children:[S.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsxRuntimeExports.jsx($1.ItemIndicator,{children:S.jsxRuntimeExports.jsx(d2.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),e]}));XS.displayName=$1.RadioItem.displayName;const QS=x.forwardRef(({className:t,inset:e,...c},a)=>S.jsxRuntimeExports.jsx($1.Label,{ref:a,className:s1.cn("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...c}));QS.displayName=$1.Label.displayName;const _S=x.forwardRef(({className:t,...e},c)=>S.jsxRuntimeExports.jsx($1.Separator,{ref:c,className:s1.cn("-mx-1 my-1 h-px bg-border",t),...e}));_S.displayName=$1.Separator.displayName;const $S=({className:t,...e})=>S.jsxRuntimeExports.jsx("span",{className:s1.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});$S.displayName="ContextMenuShortcut";const yd1=t=>{try{const e=document.getElementById("icon-picker-field"),c=document.createElement("div");pa.render(S.jsxRuntimeExports.jsx(cg.IconPickerItem,{value:t}),c),e.appendChild(c),c.hidden=!0;let a=c.innerHTML;setTimeout(()=>e.removeChild(c),100);const n=new DOMParser().parseFromString(a,"image/svg+xml"),o=n.querySelector("svg");return o&&(o.removeAttribute("width"),o.removeAttribute("height")),new XMLSerializer().serializeToString(n)}catch(e){return console.error(e),""}},xd1=({value:t,onChange:e})=>{const c=a=>{e("<svg />");const r=yd1(a);e(r)};return S.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[S.jsxRuntimeExports.jsxs("div",{className:"group relative h-12 w-12",children:[S.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:t?t.replace("<svg",'<svg class="h-5 w-5"'):"<svg class='h-5 w-5' />"},className:"absolute left-1/2 top-1/2 z-0 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white"}),S.jsxRuntimeExports.jsx(cg,{value:t?"BiSolidGrid":null,onChange:c,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"}})]}),S.jsxRuntimeExports.jsx("textarea",{value:t,onChange:a=>e(a.target.value),className:"h-full w-full rounded-sm border 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"})]})},Ld1=h.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-UJthlQqt.cjs"))),Sd1=h.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-zPJBckqp.cjs"))),tA=({isModalView:t=!1,onSelect:e=()=>{}})=>{const c=B2("uploadMediaCallback"),a=B2("unsplashAccessKey"),r=c===void 0,n=a===void 0,[o,s]=h.useState(n?"upload":r?"unsplash":"upload");return S.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[S.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:S.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:t&&r?"Unsplash images":t?"Select or upload images":"Images"})}),S.jsxRuntimeExports.jsxs(sn,{value:o,onValueChange:l=>s(l),className:"flex h-full w-full flex-col py-2",children:[!(r||n)&&S.jsxRuntimeExports.jsxs(ge,{className:"w-full",children:[S.jsxRuntimeExports.jsx(w0,{value:"upload",className:"w-full",children:"Upload"}),S.jsxRuntimeExports.jsx(w0,{value:"unsplash",className:"w-full",children:"Unsplash"})]}),o==="unsplash"?S.jsxRuntimeExports.jsx(C0,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:S.jsxRuntimeExports.jsx(h.Suspense,{fallback:S.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:S.jsxRuntimeExports.jsx(Ld1,{isModalView:t,onSelect:e})})}):S.jsxRuntimeExports.jsx(C0,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:S.jsxRuntimeExports.jsx(h.Suspense,{fallback:S.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:S.jsxRuntimeExports.jsx(Sd1,{isModalView:t,onSelect:e})})})]})]})},Ad1=Object.freeze(Object.defineProperty({__proto__:null,default:tA},Symbol.toStringTag,{value:"Module"})),Kf=({children:t,onSelect:e})=>{const[c,a]=h.useState(!1),r=(...n)=>{e.call(void 0,...n),a(!1)};return S.jsxRuntimeExports.jsxs(rn,{open:c,onOpenChange:n=>a(n),children:[S.jsxRuntimeExports.jsx(OL,{asChild:!0,children:t}),S.jsxRuntimeExports.jsx(fe,{className:"flex h-3/4 max-w-5xl",children:S.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:S.jsxRuntimeExports.jsx(tA,{isModalView:!0,onSelect:r})})})]})},Fd1=({value:t,onChange:e,id:c,onBlur:a})=>{const r=B2("uploadMediaCallback"),n=B2("unsplashAccessKey"),o=r===void 0,s=n===void 0;return S.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[t?S.jsxRuntimeExports.jsx("img",{src:t,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):S.jsxRuntimeExports.jsx(Kf,{onSelect:e,children:S.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"})}),S.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[!(o&&s)&&S.jsxRuntimeExports.jsxs(S.jsxRuntimeExports.Fragment,{children:[S.jsxRuntimeExports.jsx(Kf,{onSelect:e,children:S.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:t||!D.isEmpty(t)?"Replace Image":"Choose Image"})}),S.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"})]}),S.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:t,onBlur:({target:{value:l}})=>a(c,l),onChange:l=>e(l.target.value)})]})]})},Bd1=({id:t,placeholder:e,value:c,onChange:a,onBlur:r})=>{const n={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},o=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:S.jsxRuntimeExports.jsx(YA,{id:t,value:c,onBlur:s=>r(t,s),onChange:s=>a(s),modules:n,formats:o,placeholder:e,className:"mt-1 rounded-md"})},Ed1=({schema:t,formData:e,onChange:c})=>{const[a,r]=h.useState([]),n=B2("getPages",()=>[]),{type:o="page",href:s="",target:l="self"}=e;return h.useEffect(()=>{(async()=>{const u=await n();r(u||[])})()},[]),S.jsxRuntimeExports.jsxs("div",{children:[S.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(t==null?void 0:t.title)??"Link"}),S.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[S.jsxRuntimeExports.jsx("select",{name:"type",value:o,onChange:u=>c({...e,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=>S.jsxRuntimeExports.jsx("option",{value:u.const,children:u.title},u.const))}),o==="page"?S.jsxRuntimeExports.jsxs("select",{name:"href",placeholder:"Choose Page",value:s,onChange:u=>c({...e,href:u.target.value}),children:[S.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),D.map(a,u=>S.jsxRuntimeExports.jsx("option",{value:u.slug,children:u.name},u.uuid))]}):S.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:s,onChange:u=>c({...e,href:u.target.value}),placeholder:o==="page"||o==="url"?"Enter URL":o==="scroll"?"#ElementID":"Enter detail"}),(o==="page"||o==="url")&&S.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[S.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:l==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>c({...e,target:l==="_blank"?"_self":"_blank"})}),S.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})},Od1=()=>{const[t]=X4(),[,e]=g3(),{addBlocks:c}=Q4(),{toast:a}=hn(),r=h.useCallback((o,s,l)=>{var f;for(let p=0;p<o.length;p++){const{_id:g}=o[p];o[p]._id=W4.generateUUID();const m=D.filter(o,{_parent:g});for(let z=0;z<m.length;z++)m[z]._parent=o[p]._id}const u=D.first(o);let i,d;return s&&(i=D.find(t,{_id:s}),o[0]._parent=s,d=s),!(i?ha(i._type,u._type):!0)&&i&&(o[0]._parent=i._parent,d=i._parent),c(o,d,l),e([(f=D.first(o))==null?void 0:f._id]),D.first(o)},[t,e]);return{addCoreBlock:h.useCallback((o,s,l)=>{if(D.has(o,"blocks")){const z=o.blocks;return r(z,s,l)}const u=W4.generateUUID(),i=oL(o.props),d=[];D.forIn(i,(z,b)=>{if(D.startsWith(z,x4.SLOT_KEY)){const w=z.replace(x4.SLOT_KEY,"");d.push({_id:w,_type:"Slot",_parent:u,_name:o.props[b].name,_styles:o.props[b].styles,_emptyStyles:o.props[b].emptyStyles})}});const v={_type:o.type,_id:u,...i};let f,p;if(s&&(f=D.find(t,{_id:s}),v._parent=s,p=s),!iu1(f==null?void 0:f._type,o.type)){a({variant:"destructive",title:"Error",description:`"${o.type}" cannot be added under "${f?f==null?void 0:f._type:"root"}"`}),e([]);return}!(f?ha(f._type,o.type):!0)&&f&&(v._parent=f._parent,p=f._parent);const m=[v,...d];return c(m,p,l),e([v._id]),v},[r,t,e]),addPredefinedBlock:r}},Gf={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},Jf=["xs","sm","md","lg","xl","2xl"];function Pd1(t,e){if(e===null)return"baseClasses";const c=e.mq;if(c==="xs"||e.dark||e.mod!=="")return"classes";let a="baseClasses",r=Jf.indexOf(c);for(;r>0;){const n=Jf[r-1];if(D.find(t,{mq:n,property:e.property})){a="classes";break}r--}return a}const Yf=[];function kd1(t="",e="",c=[]){t=t.trim().replace(/ +/g,"");let a=D.filter(D.map(t.split(" "),s1.constructClassObject),u=>!D.isNull(u)),r=D.filter(D.map(e.split(" "),s1.constructClassObject),u=>!D.isNull(u));r=D.filter(r,u=>!D.includes(Yf,u.property));const n=[],o=[];D.each(c,u=>{const i=s1.constructClassObject(u),d=D.find(a,D.pick(i,["dark","mq","mod","property"]));if(d&&(a=D.filter(a,v=>v.fullCls!==(d==null?void 0:d.fullCls))),n.push(i),i.mq==="xs"&&!i.dark&&i.mod===""&&(r=D.filter(r,v=>v.property!==i.property)),Pd1(a,i)==="baseClasses"&&!D.includes(Yf,i.property)){const v=D.find(r,D.pick(i,["property"]));d&&(r=D.filter(r,f=>f.fullCls!==(v==null?void 0:v.fullCls))),o.push({...i,fullCls:i.cls,mq:"xs"})}});const s=D.map(D.sortBy([...a,...n],u=>Gf[u.mq]),"fullCls").join(" ");return`${D.map(D.sortBy([...r,...o],u=>Gf[u.mq]),"fullCls").join(" ").trim()},${s.trim()}`.trim().replace(/ +/g,"")}const T0=l1.atom([]);T0.debugLabel="selectedStylingBlocksAtom";const eA=()=>l1.useAtom(T0),Rd1=t=>{const e=t.replace(x4.STYLES_KEY,"").split(",");return{baseClasses:e[0],classes:e[1]}},Id1=l1.atom(null,(t,e,{blockIds:c,newClasses:a})=>{const r=D.filter(t(Jr),o=>c.includes(t(o)._id)),n=D.first(t(T0));return D.map(r,o=>{const s=t(o),l=D.get(s,n.prop,`${x4.STYLES_KEY},`),{baseClasses:u,classes:i}=Rd1(l);return{ids:[s._id],props:{[n.prop]:`${x4.STYLES_KEY}${kd1(i,u,a)}`}}})}),Nd1=()=>{const t=l1.useSetAtom(Id1),{updateBlocks:e,updateBlocksRuntime:c}=Q4();return h.useCallback((a,r,n=!1)=>{const o=t({blockIds:a,newClasses:r});if(!n){c(a,o[0].props);return}e(a,o[0].props)},[t])},cA=()=>l1.useAtom(rL),aA=g4("canvasWidth",800),rA=l1.atom(t=>{const e=t(aA);return W4.getBreakpointValue(e).toLowerCase()}),jd1=()=>{const[t,e]=l1.useAtom(aA),c=l1.useAtomValue(rA),[a,r]=cA();return h.useEffect(()=>{a!=="xs"&&r(c)},[c,a,r]),[t,c,e]},Td1=g4("canvasZoom",100),Dd1=()=>l1.useAtom(Td1),nA=l1.atom([]),oA=()=>{const[t,e]=l1.useAtom(nA),c=l1.useSetAtom(gn),a=h.useCallback(r=>{e(r),c([])},[e,c]);return[t,a]},gn=l1.atom([]),qd1=()=>{const[t,e]=l1.useAtom(gn),c=l1.useSetAtom(nA),a=h.useCallback(r=>{e(r),c([])},[e,c]);return[t,a]},sA=g4("darkMode",!1),Zd1=()=>{const[t,e]=l1.useAtom(sA);return[t,e]},pn=()=>{const[t]=X4(),[,e]=g3(),{addBlocks:c}=Q4();return h.useCallback((a,r=null)=>{const n=[];D.each(a,o=>{const s=t.find(v=>v._id===o);r||(r=s._parent);const i=D.filter(t,v=>D.isString(r)?v._parent===r:!s._parent).indexOf(s)+1,d=hu1(t,o,r);c(d,r,i),n.push(D.get(d,"0._id",""))}),e(n)},[t,e])},Wd1=l1.atom([]),Ud1=()=>{const[t,e]=l1.useAtom(Wd1),c=h.useCallback(a=>{e(r=>D.includes(r,a)?D.without(r,a):[...r,a])},[e]);return[t,e,c]},Kd1=l1.atom(""),lA=()=>l1.useAtom(Kd1),Gd1=()=>{const t=l1.useAtomValue(S4);return h.useCallback((e,c)=>{const a=D.map(t,r=>(D.includes(e,D.get(r,"_id"))&&D.set(r,"_parent",c),r));console.log("newBlocks",a)},[t])},Jd1=()=>{console.warn("usePasteBlocks is not implemented");const t=l1.useAtomValue(gn),[e,c]=oA(),a=pn(),r=Gd1();return{canPaste:h.useMemo(()=>e.length>0||t.length>0,[t,e]),pasteBlocks:h.useCallback(o=>{D.isEmpty(t)?r(e,o):a(t,o),c(()=>[])},[e,t,a,r,c])}},Yd1=l1.atom(!1),iA=()=>{const[t,e]=l1.useAtom(Yd1);return[t,e]},Xd1=l1.atom(null,(t,e,{blockIds:c,fullClasses:a})=>{const r=D.first(t(T0)),n=D.filter(t(Jr),o=>c.includes(t(o)._id));return D.map(n,o=>{const s=t(o),l=a;let{classes:u,baseClasses:i}=lu1(D.get(s,r.prop,"styles:,"));return D.each(l,d=>{const v=d.replace(/[\[\]\/\\{}()*+?.^$|]/g,"\\$&"),f=new RegExp(`(^| )${v}($| )`,"g");u=u.replace(f," ").replace(/ +/g," ").trim();const p=D.first(d.split(":"));D.includes(["2xl","xl","lg","md","sm"],p)&&l.push(d.split(":").pop().trim())}),D.each(l,d=>{const v=new RegExp(`(^| )${d.replace("[","\\[").replace("]","\\]")}($| )`,"g");i=i.replace(v," ").replace(/ +/g," ").trim()}),{ids:[s._id],props:{[r.prop]:`${x4.STYLES_KEY}${i},${u}`}}})}),Qd1=()=>{const{updateBlocks:t}=Q4(),e=l1.useSetAtom(Xd1);return h.useCallback((c,a)=>{const r=e({blockIds:c,fullClasses:a});t(c,r[0].props)},[e])},uA=l1.atom(t=>{const e=D.first(t(T0)),c=t(ue);if(!e||e.blockId!==D.get(c,"_id",null))return[];const r=D.get(c,e.prop,`${x4.STYLES_KEY},`).replace(x4.STYLES_KEY,"").split(",").join(" ");return D.filter(D.map(r.trim().split(" "),s1.constructClassObject),n=>!D.isNull(n))}),_d1=()=>l1.useAtomValue(uA),Xf={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},$d1=l1.atom(t=>{const e=t(rA),c=t(Qr),a=t(sA),r=th1(e);let n=D.filter(t(uA),{mod:c});return D.startsWith(c,"_")||(n=D.filter(n,o=>r.includes(o.mq))),n=n.sort((o,s)=>Xf[o.mq]-Xf[s.mq]),a||(n=D.filter(n,{dark:!1})),n}),th1=t=>{let e=[];switch(t){case"xs":e=["xs"];break;case"sm":e=["xs","sm"];break;case"md":e=["xs","sm","md"];break;case"lg":e=["xs","sm","md","lg"];break;case"xl":e=["xs","sm","md","lg","xl"];break;case"2xl":e=["xs","sm","md","lg","xl","2xl"];break;default:e=["xs"];break}return e},eh1=()=>l1.useAtomValue($d1),ch1=()=>l1.useAtom(Qr),ah1=()=>{const{updateBlocks:t}=Q4();return h.useCallback((e,c,a)=>{t(e,c,a)},[t])},rh1=()=>{const{updateMultipleBlocksProps:t}=Q4();return h.useCallback(e=>{t(e)},[t])},nh1=()=>{const{updateBlocksRuntime:t}=Q4();return h.useCallback((e,c)=>{t(e,c)},[t])},dA={name:"",props:{},modalProps:{},backdropClose:!0},oh1=l1.atom(dA),sh1=()=>{const[t,e]=l1.useAtom(oh1),c=h.useCallback((r,n={},o={})=>{e({name:r,props:n,modalProps:o})},[e]),a=h.useCallback((...r)=>{D.get(t,"props.onClose",()=>{})(...r),e(dA)},[e,t]);return{activeModal:t,openModal:c,closeModal:a}},lh1=()=>(console.warn("useAllBlocks is deprecated, use useBlocksStore() instead"),l1.useAtomValue(S4)),hA=l1.atom(!1);hA.debugLabel="readOnlyModeAtom";const vA=l1.atom("online");vA.debugLabel="networkModeAtom";const ih1=l1.atom(!1);ih1.debugLabel="codeEditorOpenAtom";const fA=l1.atom(!1);fA.debugLabel="editLayerNameAtom";const uh1=l1.atom("");uh1.debugLabel="activeLanguageAtom";const dh1=l1.atom("");dh1.debugLabel="primaryLanguageAtom";const gA=l1.atom(null);gA.debugLabel="canvasIframeAtom";const pA=l1.atom("outline");pA.debugLabel="activePanelAtom";const mA=l1.atom("");mA.debugLabel="showPredefinedBlockCategoryAtom";const zA=l1.atom({undoCount:0,redoCount:0});zA.debugLabel="historyStatesAtom";const bA=l1.atom("");bA.debugLabel="inlineEditingActiveAtom";const MA=l1.atom(!1);MA.debugLabel="draggingFlagAtom";const wA=l1.atom("");wA.debugLabel="draggedBlockIdAtom";const CA=l1.atom(null);CA.debugLabel="treeRefAtom";const VA=l1.atom({});VA.debugLabel="canvasSettingsAtom";const mn=l1.atom(!1);mn.debugLabel="askAiActiveBlockAtom";const hh1=()=>l1.useAtomValue(hA),vh1=l1.atom(""),fh1=l1.atom(null),gh1=()=>l1.useAtom(vh1),ph1=()=>l1.useAtom(fh1),mh1=g4("selectedBreakpoints",["XS","MD","XL"]),zh1=()=>{const[t,e]=l1.useAtom(mh1);return[t,e]},HA=()=>{const t=l1.useSetAtom(zA),{clear:e}=he(),[,c]=g3(),[,a]=lA(),[,r]=eA();return()=>{c([]),r([]),a(""),e(),t({undoCount:0,redoCount:0})}},bh1=l1.atom([]),Mh1=()=>{const[t,e]=h.useState(!1),[c,a]=l1.useAtom(bh1),r=B2("getUILibraryBlocks",()=>[]);return h.useEffect(()=>{(async()=>c.length>0||(e(!0),a(await r()),e(!1)))()},[]),{data:c,isLoading:t}},wh1=()=>{const[t,e]=h.useState(null),c=h.useCallback(async a=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(a),e(a),!0}catch(r){return console.warn("Copy failed",r),e(null),!1}},[]);return[t,c]},Ch1=()=>{const[t,e]=iA(),{t:c}=ma.useTranslation(),a=B2("previewComponent",null);return t?S.jsxRuntimeExports.jsxs("div",{className:W4.cn("fixed inset-0 z-[999] bg-background",t?"block":"hidden"),children:[S.jsxRuntimeExports.jsxs(M0,{size:"sm",className:"absolute right-0 top-0 m-4 space-x-2",onClick:()=>e(!1),children:[S.jsxRuntimeExports.jsx(d2.EyeClosedIcon,{}),S.jsxRuntimeExports.jsx("span",{children:c("Close Preview")})]}),S.jsxRuntimeExports.jsx("div",{children:a?S.jsxRuntimeExports.jsx(h.Suspense,{fallback:S.jsxRuntimeExports.jsx(vn,{className:"h-96 w-full"}),children:h.createElement(a)}):null})]}):null},Vh1=()=>{const[t,e]=g3(),c=vL(),a=pn(),{undo:r,redo:n}=he();E6.useHotkeys("esc",()=>e([]),{},[e]),E6.useHotkeys("ctrl+d,command+d",()=>a(t),{preventDefault:!0},[t,a]),E6.useHotkeys("ctrl+z,command+z",()=>r(),{},[r]),E6.useHotkeys("ctrl+y,command+y",()=>n(),{},[n]),E6.useHotkeys("del, backspace",o=>{o.preventDefault(),c(t)},{},[t,c])},Hh1=(t,e)=>{const c=[];let a=D.find(t,{_id:e}),r=D.get(a,"_parent","");for(;D.isString(r)&&!D.isEmpty(r);)c.push(a==null?void 0:a._parent),a=D.find(t,{_id:r}),r=a==null?void 0:a._parent;return D.flatten(c)},yh1=l1.atom([]),xh1=()=>{const[t]=g3(),e=l1.useAtomValue(S4),[,c]=l1.useAtom(yh1);h.useEffect(()=>{let a=[];const r=D.first(t);D.isString(r)&&(a=[r,...Hh1(e,r)]),c(a)},[t,e,c])};const yA=()=>l1.useAtom(Yx),Lh1=()=>h.useMemo(()=>h3.getChaiDataProviders(),[]),Sh1=({children:t})=>{const[,e]=yA(),[c]=cn(),a=Lh1();return h.useEffect(()=>(e({}),D.each(c,r=>{const n=D.find(a,{providerKey:r.providerKey});if(n){const o=(n==null?void 0:n.mockFn)||(n==null?void 0:n.dataFn);o&&o(r.args).then(s=>e(l=>({...l,[r.providerKey]:s})))}}),()=>{D.each(c,r=>{e(n=>(delete n[r.providerKey],n))})}),[a,c,e]),S.jsxRuntimeExports.jsx(S.jsxRuntimeExports.Fragment,{children:t})};function Ah1(t,e,c){c.push(D.find(t,{_id:e}));const a=D.filter(t,{_parent:e});for(const r of a)c.push(...xA(r._id,t));return c}const xA=(t,e)=>{let c=[];return c=D.flattenDeep([...c,...Ah1(e,t,c)]),c},Fh1=l1.atom(!1),LA=()=>{const[t,e]=l1.useAtom(Fh1),[c,a]=h.useState(null),r=B2("askAiCallBack",null),n=rh1(),[o]=X4();return{askAi:h.useCallback(async(s,l,u)=>{if(r){e(!0),a(null);try{const i=zn.cloneDeep(xA(s,o));zn.set(i,"0._parent",null);const{blocks:d,error:v}=await r(l,i);if(v){a(v);return}n(d)}catch(i){a(i)}finally{e(!1),u&&u()}}},[r]),loading:t,error:c}};var SA={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Qf=h.createContext&&h.createContext(SA),i3=function(){return i3=Object.assign||function(t){for(var e,c=1,a=arguments.length;c<a;c++){e=arguments[c];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},i3.apply(this,arguments)},Bh1=function(t,e){var c={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(c[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(t);r<a.length;r++)e.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(t,a[r])&&(c[a[r]]=t[a[r]]);return c};function AA(t){return t&&t.map(function(e,c){return h.createElement(e.tag,i3({key:c},e.attr),AA(e.child))})}function pe(t){return function(e){return h.createElement(Eh1,i3({attr:i3({},t.attr)},e),AA(t.child))}}function Eh1(t){var e=function(c){var a=t.attr,r=t.size,n=t.title,o=Bh1(t,["attr","size","title"]),s=r||c.size||"1em",l;return c.className&&(l=c.className),t.className&&(l=(l?l+" ":"")+t.className),h.createElement("svg",i3({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},c.attr,a,o,{className:l,style:i3(i3({color:t.color||c.color},c.style),t.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),n&&h.createElement("title",null,n),t.children)};return Qf!==void 0?h.createElement(Qf.Consumer,null,function(c){return e(c)}):e(SA)}function Oh1(t){return pe({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"}}]})(t)}function Ph1(t){return pe({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"}}]})(t)}function kh1(t){return pe({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V285.7l-86.8 86.8c-10.3 10.3-17.5 23.1-21 37.2l-18.7 74.9c-2.3 9.2-1.8 18.8 1.3 27.5H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"}}]})(t)}const Rh1=[{name:"Improve writing",icon:kh1,prompt:"Improving writing in all text elements. Replacing placeholder content with meaningful relevant content."},{name:"Fix grammar",icon:d2.CheckIcon,prompt:"Fix grammar in all text elements. Ensuring the text is grammatically correct and free of errors."},{name:"Make longer",icon:d2.ArrowUpIcon,prompt:"Make all text elements longer."},{name:"Make shorter",icon:d2.ArrowDownIcon,prompt:"Make all text elements shorter."},{name:"Add emojis",icon:a0.SmileIcon,prompt:"Add emojis to text elements if relevant."},{name:"Randomize",icon:a0.ShuffleIcon,prompt:"Randomize all text elements."}];function Ih1({onClick:t}){const{loading:e}=LA();return S.jsxRuntimeExports.jsx("div",{className:e?"pointer-events-none opacity-50":"",children:S.jsxRuntimeExports.jsx("ul",{className:"space-y-2",children:Rh1.map(({name:c,icon:a,subMenus:r,prompt:n})=>r?S.jsxRuntimeExports.jsxs(CS,{children:[S.jsxRuntimeExports.jsx(VS,{asChild:!0,children:S.jsxRuntimeExports.jsxs("li",{className:"flex cursor-pointer items-center space-x-2 hover:bg-gray-100",children:[S.jsxRuntimeExports.jsx(a,{className:"h-4 w-4"}),S.jsxRuntimeExports.jsx("span",{children:c})]},c)}),S.jsxRuntimeExports.jsxs(ln,{children:[S.jsxRuntimeExports.jsx(un,{children:"My Account"}),S.jsxRuntimeExports.jsx(dn,{}),S.jsxRuntimeExports.jsx(h6,{children:"Profile"}),S.jsxRuntimeExports.jsx(h6,{children:"Billing"}),S.jsxRuntimeExports.jsx(h6,{children:"Team"}),S.jsxRuntimeExports.jsx(h6,{children:"Subscription"})]})]}):S.jsxRuntimeExports.jsxs("li",{onClick:()=>t(n),className:"flex cursor-pointer items-center space-x-2 hover:bg-gray-100",children:[S.jsxRuntimeExports.jsx(a,{className:"h-4 w-4"}),S.jsxRuntimeExports.jsx("span",{children:c})]},c))})})}const Nh1=({blockId:t})=>{const{t:e}=ma.useTranslation(),{askAi:c,loading:a,error:r}=LA(),[n,o]=h.useState(""),s=h.useRef(null);h.useEffect(()=>{var u;(u=s.current)==null||u.focus()},[]);const l=()=>{r||o("")};return t?S.jsxRuntimeExports.jsx("div",{className:"",children:S.jsxRuntimeExports.jsxs(sn,{defaultValue:"ask-ai",className:"w-full",children:[S.jsxRuntimeExports.jsx(ge,{className:"w-full",children:S.jsxRuntimeExports.jsxs(w0,{value:"ask-ai",className:"w-full",children:[S.jsxRuntimeExports.jsx(a0.SparklesIcon,{className:"mr-2 h-3"})," ",e("Ask AI")," (GPT-4o mini)"]})}),S.jsxRuntimeExports.jsxs(C0,{value:"ask-ai",className:"flex flex-col gap-2 px-2",children:[S.jsxRuntimeExports.jsx(nn,{ref:s,value:n,onChange:u=>o(u.target.value),placeholder:e("Ask AI to edit something"),className:"w-full border border-gray-400 focus:border-0",rows:3,onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),c(t,n,l))}}),S.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[a?null:S.jsxRuntimeExports.jsx(M0,{disabled:n.trim().length<5||a,onClick:()=>c(t,n,l),variant:"default",className:"w-fit",size:"sm",children:a?S.jsxRuntimeExports.jsxs(S.jsxRuntimeExports.Fragment,{children:[S.jsxRuntimeExports.jsx(a0.Loader,{className:"h-5 w-5 animate-spin"}),e("Generating... Please wait")]}):e("Edit with AI")}),a?S.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsxRuntimeExports.jsxs(vn,{className:"flex w-full items-center space-x-1 px-4 py-1 pl-2",children:[S.jsxRuntimeExports.jsx(Oh1,{className:"h-4 w-4 animate-spin text-gray-500"}),S.jsxRuntimeExports.jsx("p",{className:"text-xs",children:e("Generating... Please wait")})]}),S.jsxRuntimeExports.jsx(M0,{variant:"destructive",onClick:()=>stop(),className:"hidden w-fit",size:"sm",children:e("Stop")})]}):null]}),S.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:r&&S.jsxRuntimeExports.jsx("p",{className:"break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500",children:r.message})}),S.jsxRuntimeExports.jsx(Ih1,{onClick:u=>c(t,u,l)})]})]})}):S.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:S.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[S.jsxRuntimeExports.jsx(a0.SparklesIcon,{className:"mx-auto text-3xl"}),S.jsxRuntimeExports.jsx("h1",{children:e("no_block_selected_for_ask_ai")})]})})},jh1=()=>{const[t]=g3();return S.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 z-50 h-full w-full bg-white p-2",children:S.jsxRuntimeExports.jsx(Nh1,{blockId:D.first(t)})})},Th1=h.lazy(()=>Promise.resolve().then(()=>require("./SidePanels-8NwJG0mo.cjs"))),Dh1=h.lazy(()=>Promise.resolve().then(()=>require("./Topbar-SaVYT87H.cjs"))),qh1=h.lazy(()=>Promise.resolve().then(()=>require("./CanvasArea-7l8qSx52.cjs"))),Zh1=h.lazy(()=>Promise.resolve().then(()=>require("./Settings-s19XidRS.cjs"))),Wh1=()=>{const{savePage:t}=hL(),e=B2("autoSaveSupport",!0),c=B2("autoSaveInterval",60);eg.useIntervalEffect(()=>{e&&t()},c*1e3)},Uh1=()=>{const[t]=l1.useAtom(j0),[e]=l1.useAtom(mn),c=n=>{su1()||n.preventDefault()};Vh1(),xh1(),Wh1(),h.useEffect(()=>(t!=="SAVED"?window.onbeforeunload=()=>"":window.onbeforeunload=null,()=>{window.onbeforeunload=null}),[t]);const a=B2("editable",!0),r=B2("nonEditableComponent",null);return S.jsxRuntimeExports.jsx("div",{className:"h-screen w-screen bg-background text-foreground",children:S.jsxRuntimeExports.jsxs(YL,{children:[S.jsxRuntimeExports.jsxs("div",{onContextMenu:c,className:"flex h-screen flex-col overflow-hidden bg-background text-foreground",children:[S.jsxRuntimeExports.jsx("div",{className:"h-14 w-screen shrink-0 border-b border-border",children:S.jsxRuntimeExports.jsx(h.Suspense,{children:S.jsxRuntimeExports.jsx(Dh1,{})})}),S.jsxRuntimeExports.jsxs("main",{className:"relative flex h-full flex-1 flex-row",children:[a?null:S.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 z-[500] flex h-full w-full items-center justify-center backdrop-blur-[2px]",children:S.jsxRuntimeExports.jsx(h.Suspense,{children:h.createElement(r)})}),S.jsxRuntimeExports.jsx("div",{className:"flex h-full max-h-full w-fit border-border",style:{maxHeight:"calc(100vh - 56px)"},children:S.jsxRuntimeExports.jsx(h.Suspense,{children:S.jsxRuntimeExports.jsx(Th1,{})})}),S.jsxRuntimeExports.jsx("div",{className:"h-full flex-1 bg-slate-800/20",children:S.jsxRuntimeExports.jsx(h.Suspense,{children:S.jsxRuntimeExports.jsx(qh1,{})})}),S.jsxRuntimeExports.jsxs("div",{className:"relative flex h-[100%] w-[280px] min-w-[280px] border-l border-border pb-10",children:[S.jsxRuntimeExports.jsx(h.Suspense,{children:S.jsxRuntimeExports.jsx(Zh1,{})}),e?S.jsxRuntimeExports.jsx(jh1,{}):null]})]})]}),S.jsxRuntimeExports.jsx(Ch1,{})]})})},_f=l1.getDefaultStore(),Kh1=()=>S.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen bg-gray-900 py-12 sm:py-16 lg:py-20 xl:hidden",children:S.jsxRuntimeExports.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:S.jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-md text-center",children:[S.jsxRuntimeExports.jsx("img",{src:"https://fldwljgzcktqnysdkxnn.supabase.co/storage/v1/object/public/chaibuilder-blob-storage/175ac8d8-37fe-4707-bb4a-3c0cd6a6db75/gVH7O-Ir_400x400.png",alt:"Chai Builder",className:"mx-auto w-14 rounded-full"}),S.jsxRuntimeExports.jsx("br",{}),S.jsxRuntimeExports.jsx("h2",{className:"text-4xl font-bold text-white",children:"Screen too small"}),S.jsxRuntimeExports.jsx("p",{className:"mt-6 text-sm font-medium leading-6 text-white text-opacity-70",children:"Please view this page on greater than 1280px screen width."})]})})});let Gh1=!1;const Jh1=t=>{Gh1=t};const Yh1=t=>{const[,e]=X4(),[,c]=de(),a=HA();return h.useEffect(()=>{_f.set(Gr,D.omit(t,["blocks","subPages","brandingOptions","dataProviders"]))},[t]),h.useEffect(()=>{_f.set(en,t.dataProviders||[])},[t.dataProviders]),h.useEffect(()=>{e(h3.syncBlocksWithDefaults(t.blocks||[])),a()},[t.blocks]),h.useEffect(()=>{tg.changeLanguage(t.locale||"en")},[t.locale]),h.useEffect(()=>{Jh1(t.showDebugLogs)},[t.showDebugLogs]),h.useEffect(()=>{c(t.brandingOptions)},[t.brandingOptions,c]),S.jsxRuntimeExports.jsx(Uh1,{})},Xh1=t=>{const e=t._flags||{};return S.jsxRuntimeExports.jsxs(Xx,{children:[S.jsxRuntimeExports.jsxs(BA.FlagsProvider,{features:{...ou1,...e},children:[S.jsxRuntimeExports.jsx(au1,{}),S.jsxRuntimeExports.jsx(Kh1,{}),S.jsxRuntimeExports.jsx(Yh1,{...t})]}),S.jsxRuntimeExports.jsx(IS,{})]})};exports.Accordion=Iu1;exports.AccordionContent=bL;exports.AccordionItem=mL;exports.AccordionTrigger=zL;exports.Alert=ML;exports.AlertDescription=CL;exports.AlertDialog=Tu1;exports.AlertDialogAction=BL;exports.AlertDialogCancel=EL;exports.AlertDialogContent=xL;exports.AlertDialogDescription=FL;exports.AlertDialogFooter=SL;exports.AlertDialogHeader=LL;exports.AlertDialogTitle=AL;exports.AlertDialogTrigger=Du1;exports.AlertTitle=wL;exports.Badge=ju1;exports.BlocksExternalDataProvider=Sh1;exports.Button=M0;exports.Card=TL;exports.CardContent=WL;exports.CardDescription=ZL;exports.CardFooter=UL;exports.CardHeader=DL;exports.CardTitle=qL;exports.ChaiBuilderEditor=Xh1;exports.Command=fn;exports.CommandDialog=zd1;exports.CommandEmpty=TS;exports.CommandGroup=DS;exports.CommandInput=NS;exports.CommandItem=ZS;exports.CommandList=jS;exports.CommandSeparator=qS;exports.CommandShortcut=WS;exports.ContextMenu=bd1;exports.ContextMenuCheckboxItem=YS;exports.ContextMenuContent=GS;exports.ContextMenuGroup=wd1;exports.ContextMenuItem=JS;exports.ContextMenuLabel=QS;exports.ContextMenuPortal=Cd1;exports.ContextMenuRadioGroup=Hd1;exports.ContextMenuRadioItem=XS;exports.ContextMenuSeparator=_S;exports.ContextMenuShortcut=$S;exports.ContextMenuSub=Vd1;exports.ContextMenuSubContent=KS;exports.ContextMenuSubTrigger=US;exports.ContextMenuTrigger=Md1;exports.Dialog=rn;exports.DialogContent=fe;exports.DialogDescription=jL;exports.DialogFooter=IL;exports.DialogHeader=RL;exports.DialogTitle=NL;exports.DialogTrigger=OL;exports.DropdownMenu=CS;exports.DropdownMenuCheckboxItem=xS;exports.DropdownMenuContent=ln;exports.DropdownMenuGroup=ld1;exports.DropdownMenuItem=h6;exports.DropdownMenuLabel=un;exports.DropdownMenuPortal=id1;exports.DropdownMenuRadioGroup=dd1;exports.DropdownMenuRadioItem=LS;exports.DropdownMenuSeparator=dn;exports.DropdownMenuShortcut=SS;exports.DropdownMenuSub=ud1;exports.DropdownMenuSubContent=yS;exports.DropdownMenuSubTrigger=HS;exports.DropdownMenuTrigger=VS;exports.ErrorBoundary=Xx;exports.FaCircleCheck=Ph1;exports.GenIcon=pe;exports.HoverCard=$u1;exports.HoverCardContent=iS;exports.HoverCardTrigger=td1;exports.IconPickerField=xd1;exports.ImagePickerField=Fd1;exports.ImagesPanel=Ad1;exports.Input=KL;exports.Label=GL;exports.LinkField=Ed1;exports.Menubar=_L;exports.MenubarCheckboxItem=rS;exports.MenubarContent=cS;exports.MenubarGroup=Yu1;exports.MenubarItem=aS;exports.MenubarLabel=oS;exports.MenubarMenu=Ju1;exports.MenubarPortal=Xu1;exports.MenubarRadioGroup=_u1;exports.MenubarRadioItem=nS;exports.MenubarSeparator=sS;exports.MenubarShortcut=lS;exports.MenubarSub=Qu1;exports.MenubarSubContent=eS;exports.MenubarSubTrigger=tS;exports.MenubarTrigger=$L;exports.Popover=Ku1;exports.PopoverContent=QL;exports.PopoverTrigger=Gu1;exports.RichTextEditorField=Bd1;exports.ScrollArea=JL;exports.ScrollBar=on;exports.Select=ed1;exports.SelectContent=dS;exports.SelectGroup=cd1;exports.SelectItem=vS;exports.SelectLabel=hS;exports.SelectSeparator=fS;exports.SelectTrigger=uS;exports.SelectValue=ad1;exports.Separator=AS;exports.Sheet=rd1;exports.SheetClose=od1;exports.SheetContent=mS;exports.SheetDescription=wS;exports.SheetFooter=bS;exports.SheetHeader=zS;exports.SheetTitle=MS;exports.SheetTrigger=nd1;exports.Skeleton=vn;exports.Switch=pL;exports.Tabs=sn;exports.TabsContent=C0;exports.TabsList=ge;exports.TabsTrigger=w0;exports.Textarea=nn;exports.Toaster=IS;exports.Toggle=gL;exports.Tooltip=Wu1;exports.TooltipContent=XL;exports.TooltipPortal=Zu1;exports.TooltipProvider=YL;exports.TooltipTrigger=Uu1;exports.activePanelAtom=pA;exports.aiAssistantActiveAtom=mn;exports.badgeVariants=VL;exports.builderSaveStateAtom=j0;exports.buttonVariants=ve;exports.canAcceptChildBlock=ha;exports.canDeleteBlock=du1;exports.canDuplicateBlock=uu1;exports.canvasIframeAtom=gA;exports.canvasSettingsAtom=VA;exports.draggedBlockIdAtom=wA;exports.draggingFlagAtom=MA;exports.editLayerNameAtom=fA;exports.getBlockJSONFromSchemas=fa;exports.getBlockJSONFromUISchemas=va;exports.inlineEditingActiveAtom=bA;exports.networkModeAtom=vA;exports.reducer=FS;exports.showPredefinedBlockCategoryAtom=mA;exports.toast=BS;exports.toggleVariants=fL;exports.treeDSBlocks=tL;exports.treeRefAtom=CA;exports.useActiveModal=sh1;exports.useActivePanel=gh1;exports.useAddBlock=Od1;exports.useAddBlockParent=ph1;exports.useAddClassesToBlocks=Nd1;exports.useAllBlocks=lh1;exports.useBlocksContainer=Au1;exports.useBlocksStore=X4;exports.useBlocksStoreUndoableActions=Q4;exports.useBrandingOptions=de;exports.useBuilderProp=B2;exports.useBuilderReset=HA;exports.useCanvasWidth=jd1;exports.useCanvasZoom=Dd1;exports.useChaiExternalData=yA;exports.useCopyBlockIds=qd1;exports.useCopyToClipboard=wh1;exports.useCurrentPage=sL;exports.useCutBlockIds=oA;exports.useDarkMode=Zd1;exports.useDuplicateBlocks=pn;exports.useGetPageData=dL;exports.useHiddenBlockIds=Ud1;exports.useHighlightBlockId=lA;exports.usePageDataProviders=cn;exports.usePasteBlocks=Jd1;exports.usePreviewMode=iA;exports.useReadOnlyMode=hh1;exports.useRemoveBlocks=vL;exports.useRemoveClassesFromBlocks=Qd1;exports.useSavePage=hL;exports.useSelectedBlock=bu1;exports.useSelectedBlockAllClasses=_d1;exports.useSelectedBlockCanvasSetting=wu1;exports.useSelectedBlockCurrentClasses=eh1;exports.useSelectedBlockCustomStylingStates=Cu1;exports.useSelectedBlockIds=g3;exports.useSelectedBlocksDisplayChild=zu1;exports.useSelectedBreakpoints=zh1;exports.useSelectedStylingBlocks=eA;exports.useStylingBreakpoint=cA;exports.useStylingState=ch1;exports.useToast=hn;exports.useUILibraryBlocks=Mh1;exports.useUndoManager=he;exports.useUpdateBlocksProps=ah1;exports.useUpdateBlocksPropsRealtime=nh1;
@@ -41734,7 +41734,7 @@ const Ed1 = (t) => {
41734
41734
  }
41735
41735
  )
41736
41736
  ] });
41737
- }, Pd1 = p.lazy(() => import("./UnsplashImages-SDBkrhpm.js")), kd1 = p.lazy(() => import("./UploadImages-e3dCOlqV.js")), iS = ({
41737
+ }, Pd1 = p.lazy(() => import("./UnsplashImages-qTNzA02V.js")), kd1 = p.lazy(() => import("./UploadImages-PJyejbcA.js")), iS = ({
41738
41738
  isModalView: t = !1,
41739
41739
  onSelect: e = () => {
41740
41740
  }
@@ -42577,7 +42577,7 @@ const Ph1 = ({ blockId: t }) => {
42577
42577
  }, kh1 = () => {
42578
42578
  const [t] = i6();
42579
42579
  return /* @__PURE__ */ S.jsx("div", { className: "absolute inset-0 z-50 h-full w-full bg-white p-2", children: /* @__PURE__ */ S.jsx(Ph1, { blockId: e4(t) }) });
42580
- }, Ih1 = Qt(() => import("./SidePanels-nIiJwfQ7.js")), Rh1 = Qt(() => import("./Topbar--8q83rcZ.js")), Nh1 = Qt(() => import("./CanvasArea-6nE635uC.js")), Th1 = Qt(() => import("./Settings-o3wnp8uI.js")), jh1 = () => {
42580
+ }, Ih1 = Qt(() => import("./SidePanels-iqAbcqUv.js")), Rh1 = Qt(() => import("./Topbar-8tMcFyw5.js")), Nh1 = Qt(() => import("./CanvasArea-h3Nu-SWT.js")), Th1 = Qt(() => import("./Settings-P8Bbl06y.js")), jh1 = () => {
42581
42581
  const { savePage: t } = Wi1(), e = W2("autoSaveSupport", !0), c = W2("autoSaveInterval", 60);
42582
42582
  GS(() => {
42583
42583
  e && t();
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("./ChaiBuilderEditor-xecsXt0z.cjs"),i=require("lodash-es"),j=require("sonner"),l=require("react"),o=require("./index-Jy9Zfhj_.cjs"),p=require("lucide-react"),f=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-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-quill");require("react-hotkeys-hook");require("lodash");require("./core.cjs");require("./html-to-json-VPWiWWGH.cjs");require("himalaya");const E=()=>{const{data:t}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{saveState:d}=s.useSavePage(),m=o.useChangePage(),{t:q}=f.useTranslation(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(t==null?void 0:t.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&t.homepage&&!i.find(u,{uuid:n})&&a(t.homepage)},[n,u,t,a]),l.useEffect(()=>()=>a(null),[a]);const g=r=>{if(d!=="SAVED")j.toast.error(q("You have unsaved changes. Please save before changing the page."));else{const h=i.find(c,{uuid:r});m(h)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 py-1 pr-0 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(p.BriefcaseIcon,{className:"mr-2 h-4 w-4"}),i.capitalize(t.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(s.Select,{value:n||"",onValueChange:g,children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(s.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("./ChaiBuilderEditor-6o0IOkBV.cjs"),i=require("lodash-es"),j=require("sonner"),l=require("react"),o=require("./index-wnXwbbRk.cjs"),p=require("lucide-react"),f=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-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-quill");require("react-hotkeys-hook");require("lodash");require("./core.cjs");require("./html-to-json-VPWiWWGH.cjs");require("himalaya");const E=()=>{const{data:t}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{saveState:d}=s.useSavePage(),m=o.useChangePage(),{t:q}=f.useTranslation(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(t==null?void 0:t.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&t.homepage&&!i.find(u,{uuid:n})&&a(t.homepage)},[n,u,t,a]),l.useEffect(()=>()=>a(null),[a]);const g=r=>{if(d!=="SAVED")j.toast.error(q("You have unsaved changes. Please save before changing the page."));else{const h=i.find(c,{uuid:r});m(h)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 py-1 pr-0 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(p.BriefcaseIcon,{className:"mr-2 h-4 w-4"}),i.capitalize(t.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(s.Select,{value:n||"",onValueChange:g,children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(s.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=E;
@@ -1,9 +1,9 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { V as h, a6 as f, a7 as j, a8 as y, a9 as v, aa as P } from "./ChaiBuilderEditor-rPo8yLDm.js";
2
+ import { V as h, a6 as f, a7 as j, a8 as y, a9 as v, aa as P } from "./ChaiBuilderEditor-VOCsboQ9.js";
3
3
  import { sortBy as b, filter as w, get as C, isEmpty as m, find as n, capitalize as N, map as S } from "lodash-es";
4
4
  import { toast as k } from "sonner";
5
5
  import { useEffect as p } from "react";
6
- import { a as B, u as E, c as T, d as V } from "./index-ntl3hbnf.js";
6
+ import { a as B, u as E, c as T, d as V } from "./index-X3veo7pJ.js";
7
7
  import { BriefcaseIcon as I } from "lucide-react";
8
8
  import { useTranslation as L } from "react-i18next";
9
9
  import "./_commonjsHelpers-UyOWmZb0.js";