@chaibuilder/sdk 1.2.11 → 1.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddBlocks-k2p8Hy1n.cjs → AddBlocks-tomDo_Is.cjs} +1 -1
- package/dist/{AddBlocks-TSt8uJY4.js → AddBlocks-zN5--UP6.js} +11 -11
- package/dist/{BrandingOptions-WyVWfFVz.cjs → BrandingOptions-BUmE4f72.cjs} +1 -1
- package/dist/{BrandingOptions-uFTyYJZj.js → BrandingOptions-LbizrmRI.js} +2 -2
- package/dist/{CanvasArea-iRQqpOak.js → CanvasArea-OSH8wqt1.js} +22 -22
- package/dist/{CanvasArea-5erOZYLy.cjs → CanvasArea-nT6ZJh_V.cjs} +1 -1
- package/dist/{CurrentPage-RCxTz9Mc.js → CurrentPage-FzqNBLy4.js} +3 -3
- package/dist/{CurrentPage-NzmJloN7.cjs → CurrentPage-SWR9WU4k.cjs} +1 -1
- package/dist/{Layers-xDG7oltg.cjs → Layers-FRHRlPIH.cjs} +1 -1
- package/dist/{Layers-tXB5Pwid.js → Layers-g5_pwwgO.js} +57 -57
- package/dist/{PagesPanel-72nzYB1k.cjs → PagesPanel-3jcf5-iH.cjs} +1 -1
- package/dist/{PagesPanel-Jaz9jvye.js → PagesPanel-PSg6aqlK.js} +4 -4
- package/dist/{ProjectPanel-RU0QvH6e.cjs → ProjectPanel-EyEcNyh8.cjs} +1 -1
- package/dist/{ProjectPanel--S014Xx3.js → ProjectPanel-XW_Bx880.js} +4 -4
- package/dist/{Settings-gjvl5V1k.js → Settings--7qJ7ciF.js} +60 -60
- package/dist/{Settings-5EuwaVb3.cjs → Settings-h1c8ukpI.cjs} +1 -1
- package/dist/{SidePanels-Fq3kRwR0.js → SidePanels-Lmj0Qkd1.js} +8 -8
- package/dist/{SidePanels-uNCxnGte.cjs → SidePanels-NbM1mfsY.cjs} +1 -1
- package/dist/{Topbar-JqW89xI5.cjs → Topbar-2sOsQD2d.cjs} +1 -1
- package/dist/{Topbar-m5dbbI1f.js → Topbar-xvrno03z.js} +4 -4
- package/dist/{UnsplashImages-vACw5hbK.cjs → UnsplashImages-EiYSWkBa.cjs} +1 -1
- package/dist/{UnsplashImages-GhBD6owT.js → UnsplashImages-hhPOf7kt.js} +7 -7
- package/dist/{UploadImages-PzHdEKHT.cjs → UploadImages-GGCExfQd.cjs} +1 -1
- package/dist/{UploadImages-S1HgxeGb.js → UploadImages-JKjE44i7.js} +1 -1
- package/dist/{add-page-modal-GAizM2Jw.cjs → add-page-modal-65wltt_4.cjs} +1 -1
- package/dist/{add-page-modal-2P5hGXOQ.js → add-page-modal-Bl6y65im.js} +13 -13
- package/dist/{confirm-alert-57Xq5foA.js → confirm-alert-Nw1JCtuu.js} +1 -1
- package/dist/{confirm-alert-Uf84DpdR.cjs → confirm-alert-_DCO6hCV.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +8 -0
- package/dist/core.js +39 -37
- package/dist/{delete-page-modal-MG42FdnU.cjs → delete-page-modal-Q3Si4nyd.cjs} +1 -1
- package/dist/{delete-page-modal-ix5IjaFW.js → delete-page-modal-tiJ2UA5f.js} +3 -3
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +27 -27
- package/dist/email.cjs +1 -1
- package/dist/email.js +4 -4
- package/dist/{empty-slot-TF2kd-0X.cjs → empty-slot-2LSrWJaY.cjs} +1 -1
- package/dist/{empty-slot-MWycClTb.js → empty-slot-5FRrRq1E.js} +33 -33
- package/dist/{form-SYcFyACJ.js → form-lbFCPUoE.js} +1 -1
- package/dist/{form-KBb3kA8g.cjs → form-vNgf0kO2.cjs} +1 -1
- package/dist/{index-aiHDvS5v.cjs → index-bfKqnRvZ.cjs} +1 -1
- package/dist/{index-cM3eKmlx.cjs → index-hS9T9Nub.cjs} +33 -33
- package/dist/{index-pNYv0oAF.js → index-m9VziIOy.js} +307 -295
- package/dist/{index-Fj3ead-J.js → index-wwk4px_E.js} +2069 -2059
- package/dist/{page-viewer-VxqOevr4.js → page-viewer-rLCyM4QC.js} +4 -4
- package/dist/{page-viewer-Sh99FGYk.cjs → page-viewer-w-ahza8q.cjs} +1 -1
- package/dist/{project-general-setting-VTLHa-Ik.cjs → project-general-setting-RTcIwUWc.cjs} +1 -1
- package/dist/{project-general-setting-nWOjPiin.js → project-general-setting-pY-Mkc8G.js} +4 -4
- package/dist/{project-seo-setting-70bWTwsB.js → project-seo-setting-9V67NFil.js} +3 -3
- package/dist/{project-seo-setting-ENAKc2Dl.cjs → project-seo-setting-aRDdqu88.cjs} +1 -1
- package/dist/{single-page-detail-3z7TF-Yy.js → single-page-detail-HYX4R3U0.js} +5 -5
- package/dist/{single-page-detail-6L38HJC4.cjs → single-page-detail-wHDpn40R.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +3 -3
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +25 -25
- package/dist/{useAddBlockByDrop-7mUMwNSG.cjs → useAddBlockByDrop-1WvPoBXa.cjs} +1 -1
- package/dist/{useAddBlockByDrop-tjQ5DgiO.js → useAddBlockByDrop-bs_SH7Tw.js} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +129 -129
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const N=require("react"),i=require("lodash-es"),oe=require("./Functions-N3yhPYKY.cjs"),Se=require("@chaibuilder/runtime"),p=require("jotai"),vt=require("flat-to-nested"),W=require("./MODIFIERS-2FeVfZQ9.cjs"),rn=require("./_commonjsHelpers-wDK0ZLPo.cjs"),an=require("@react-hookz/web"),r=require("./jsx-runtime-Z_BpKhVy.cjs"),ln=require("@radix-ui/react-toggle"),le=require("class-variance-authority"),u=require("./Class-5ARpH_Tu.cjs"),cn=require("@radix-ui/react-switch"),dn=require("@radix-ui/react-slot"),un=require("@radix-ui/react-accordion"),F=require("@radix-ui/react-icons"),mn=require("@radix-ui/react-alert-dialog"),pn=require("@radix-ui/react-dialog"),fn=require("@radix-ui/react-label"),xn=require("@radix-ui/react-scroll-area"),gn=require("@radix-ui/react-tabs"),hn=require("@radix-ui/react-tooltip"),bn=require("@radix-ui/react-popover"),vn=require("@radix-ui/react-menubar"),yn=require("@radix-ui/react-hover-card"),jn=require("@radix-ui/react-select"),wn=require("@radix-ui/react-dropdown-menu"),Rn=require("@radix-ui/react-separator"),kn=require("@radix-ui/react-toast"),H=require("cmdk"),Nn=require("@radix-ui/react-context-menu"),yt=require("react-icons-picker"),Sn=require("react-dom"),En=require("react-quill");require("react-i18next");function L(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const f=L(N),jt=L(ln),De=L(cn),ie=L(un),U=L(mn),_=L(pn),wt=L(fn),ae=L(xn),ce=L(gn),pe=L(hn),he=L(bn),A=L(vn),Ee=L(yn),O=L(jn),T=L(wn),Rt=L(Rn),K=L(kn),P=L(Nn);var z={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let Cn=0;function X(e,t){const s=`atom${++Cn}`,o={toString:()=>s};return typeof e=="function"?o.read=e:(o.init=e,o.read=n=>n(o),o.write=(n,l,a)=>l(o,typeof a=="function"?a(n(o)):a)),t&&(o.write=t),o}const _e=e=>"init"in e,Te=e=>!!e.write,Re=new WeakMap,An=(e,t)=>{Re.set(e,t),e.catch(()=>{}).finally(()=>Re.delete(e))},at=(e,t)=>{const s=Re.get(e);s&&(Re.delete(e),s(t))},it=(e,t)=>{e.status="fulfilled",e.value=t},lt=(e,t)=>{e.status="rejected",e.reason=t},Bn=e=>typeof(e==null?void 0:e.then)=="function",xe=(e,t)=>"v"in e&&"v"in t&&Object.is(e.v,t.v),ct=(e,t)=>"e"in e&&"e"in t&&Object.is(e.e,t.e),ue=e=>"v"in e&&e.v instanceof Promise,_n=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,ye=e=>{if("e"in e)throw e.e;return e.v},kt=()=>{const e=new WeakMap,t=new WeakMap,s=new Map;let o,n,l;(z?"production":void 0)!=="production"&&(o=new Set,n=new Set,l=new Set);const a=m=>e.get(m),d=(m,h)=>{(z?"production":void 0)!=="production"&&Object.freeze(h);const j=e.get(m);if(e.set(m,h),s.has(m)||s.set(m,j),j&&ue(j)){const b="v"in h?h.v instanceof Promise?h.v:Promise.resolve(h.v):Promise.reject(h.e);at(j.v,b)}},g=(m,h,j)=>{const b=new Map;let w=!1;j.forEach((y,k)=>{!y&&k===m&&(y=h),y?(b.set(k,y),h.d.get(k)!==y&&(w=!0)):(z?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(w||h.d.size!==b.size)&&(h.d=b)},c=(m,h,j)=>{const b=a(m),w={d:(b==null?void 0:b.d)||new Map,v:h};if(j&&g(m,w,j),b&&xe(b,w)&&b.d===w.d)return b;if(b&&ue(b)&&ue(w)&&_n(b,w)){if(b.d===w.d)return b;w.v=b.v}return d(m,w),w},x=(m,h,j,b)=>{if(Bn(h)){let w;const y=new Promise((k,M)=>{let E=!1;h.then(B=>{if(!E){E=!0;const C=a(m),Q=c(m,y,j);it(y,B),k(B),(C==null?void 0:C.d)!==Q.d&&Y(m,Q,C==null?void 0:C.d)}},B=>{if(!E){E=!0;const C=a(m),Q=c(m,y,j);lt(y,B),M(B),(C==null?void 0:C.d)!==Q.d&&Y(m,Q,C==null?void 0:C.d)}}),w=B=>{E||(E=!0,B.then(C=>it(y,C),C=>lt(y,C)),k(B))}});return y.orig=h,y.status="pending",An(y,k=>{k&&w(k),b==null||b()}),c(m,y,j)}return c(m,h,j)},v=(m,h,j)=>{const b=a(m),w={d:(b==null?void 0:b.d)||new Map,e:h};return j&&g(m,w,j),b&&ct(b,w)&&b.d===w.d?b:(d(m,w),w)},R=m=>{const h=a(m);if(h&&(h.d.forEach((E,B)=>{B!==m&&!t.has(B)&&R(B)}),Array.from(h.d).every(([E,B])=>{const C=a(E);return E===m||C===B||C&&!ue(C)&&xe(C,B)})))return h;const j=new Map;let b=!0;const w=E=>{if(E===m){const C=a(E);if(C)return j.set(E,C),ye(C);if(_e(E))return j.set(E,void 0),E.init;throw new Error("no atom init")}const B=R(E);return j.set(E,B),ye(B)};let y,k;const M={get signal(){return y||(y=new AbortController),y.signal},get setSelf(){return(z?"production":void 0)!=="production"&&!Te(m)&&console.warn("setSelf function cannot be used with read-only atom"),!k&&Te(m)&&(k=(...E)=>{if((z?"production":void 0)!=="production"&&b&&console.warn("setSelf function cannot be called in sync"),!b)return V(m,...E)}),k}};try{const E=m.read(w,M);return x(m,E,j,()=>y==null?void 0:y.abort())}catch(E){return v(m,E,j)}finally{b=!1}},S=m=>ye(R(m)),I=m=>{let h=t.get(m);return h||(h=J(m)),h},D=(m,h)=>!h.l.size&&(!h.t.size||h.t.size===1&&h.t.has(m)),q=m=>{const h=t.get(m);h&&D(m,h)&&re(m)},$=m=>{const h=new Map,j=new WeakMap,b=y=>{const k=t.get(y);k==null||k.t.forEach(M=>{M!==y&&(h.set(M,(h.get(M)||new Set).add(y)),j.set(M,(j.get(M)||0)+1),b(M))})};b(m);const w=y=>{const k=t.get(y);k==null||k.t.forEach(M=>{var E;if(M!==y){let B=j.get(M);if(B&&j.set(M,--B),!B){let C=!!((E=h.get(M))!=null&&E.size);if(C){const Q=a(M),nn=R(M);C=!Q||!xe(Q,nn)}C||h.forEach(Q=>Q.delete(M))}w(M)}})};w(m)},G=(m,...h)=>{let j=!0;const b=k=>ye(R(k)),w=(k,...M)=>{let E;if(k===m){if(!_e(k))throw new Error("atom not writable");const B=a(k),C=x(k,M[0]);(!B||!xe(B,C))&&$(k)}else E=G(k,...M);if(!j){const B=te();(z?"production":void 0)!=="production"&&n.forEach(C=>C({type:"async-write",flushed:B}))}return E},y=m.write(b,w,...h);return j=!1,y},V=(m,...h)=>{const j=G(m,...h),b=te();return(z?"production":void 0)!=="production"&&n.forEach(w=>w({type:"write",flushed:b})),j},J=(m,h)=>{const j={t:new Set(h&&[h]),l:new Set};if(t.set(m,j),(z?"production":void 0)!=="production"&&l.add(m),R(m).d.forEach((b,w)=>{const y=t.get(w);y?y.t.add(m):w!==m&&J(w,m)}),R(m),Te(m)&&m.onMount){const b=m.onMount((...w)=>V(m,...w));b&&(j.u=b)}return j},re=m=>{var h;const j=(h=t.get(m))==null?void 0:h.u;j&&j(),t.delete(m),(z?"production":void 0)!=="production"&&l.delete(m);const b=a(m);b?(ue(b)&&at(b.v),b.d.forEach((w,y)=>{if(y!==m){const k=t.get(y);k&&(k.t.delete(m),D(y,k)&&re(y))}})):(z?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",m)},Y=(m,h,j)=>{const b=new Set(h.d.keys());j==null||j.forEach((w,y)=>{if(b.has(y)){b.delete(y);return}const k=t.get(y);k&&(k.t.delete(m),D(y,k)&&re(y))}),b.forEach(w=>{const y=t.get(w);y?y.t.add(m):t.has(m)&&J(w,m)})},te=()=>{let m;for((z?"production":void 0)!=="production"&&(m=new Set);s.size;){const h=Array.from(s);s.clear(),h.forEach(([j,b])=>{const w=a(j);if(w){w.d!==(b==null?void 0:b.d)&&Y(j,w,b==null?void 0:b.d);const y=t.get(j);y&&!(b&&!ue(b)&&(xe(b,w)||ct(b,w)))&&(y.l.forEach(k=>k()),(z?"production":void 0)!=="production"&&m.add(j))}else(z?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((z?"production":void 0)!=="production")return o.forEach(h=>h("state")),m},se=(m,h)=>{const j=I(m),b=te(),w=j.l;return w.add(h),(z?"production":void 0)!=="production"&&(o.forEach(y=>y("sub")),n.forEach(y=>y({type:"sub",flushed:b}))),()=>{w.delete(h),q(m),(z?"production":void 0)!=="production"&&(o.forEach(y=>y("unsub")),n.forEach(y=>y({type:"unsub"})))}};return(z?"production":void 0)!=="production"?{get:S,set:V,sub:se,dev_subscribe_store:(m,h)=>h!==2?(console.warn("The current StoreListener revision is 2. The older ones are deprecated."),o.add(m),()=>{o.delete(m)}):(n.add(m),()=>{n.delete(m)}),dev_get_mounted_atoms:()=>l.values(),dev_get_atom_state:m=>e.get(m),dev_get_mounted:m=>t.get(m),dev_restore_atoms:m=>{for(const[j,b]of m)_e(j)&&(x(j,b),$(j));const h=te();n.forEach(j=>j({type:"restore",flushed:h}))}}:{get:S,set:V,sub:se}};let Pe;const Tn=()=>(Pe||(Pe=kt()),Pe);var Pn={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const In=N.createContext(void 0),Ve=e=>{const t=N.useContext(In);return(e==null?void 0:e.store)||t||Tn()};const Mn=e=>typeof(e==null?void 0:e.then)=="function",Dn=N.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)});function Nt(e,t){const s=Ve(t),[[o,n,l],a]=N.useReducer(c=>{const x=s.get(e);return Object.is(c[0],x)&&c[1]===s&&c[2]===e?c:[x,s,e]},void 0,()=>[s.get(e),s,e]);let d=o;(n!==s||l!==e)&&(a(),d=s.get(e));const g=t==null?void 0:t.delay;return N.useEffect(()=>{const c=s.sub(e,()=>{if(typeof g=="number"){setTimeout(a,g);return}a()});return a(),c},[s,e,g]),N.useDebugValue(d),Mn(d)?Dn(d):d}function St(e,t){const s=Ve(t);return N.useCallback((...n)=>{if((Pn?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return s.set(e,...n)},[s,e])}function On(e,t){return[Nt(e,t),St(e,t)]}var Fe={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Et=Symbol();const dt=(e,t,s)=>(t.has(s)?t:t.set(s,e())).get(s),Ln=new WeakMap,zn=(e,t,s)=>{const o=dt(()=>new WeakMap,Ln,t);return dt(e,o,s)},Vn={},ut=e=>!!e.write,Fn=e=>typeof e=="function";function Un(e,t){return zn(()=>{const s=new WeakMap,o=(a,d)=>{let g=s.get(a);if(g)return g;const c=d&&s.get(d),x=[],v=[];return a.forEach((R,S)=>{const I=t?t(R):S;v[S]=I;const D=c&&c.atomList[c.keyList.indexOf(I)];if(D){x[S]=D;return}const q=G=>{const V=G(n),J=G(e),Y=o(J,V==null?void 0:V.arr).keyList.indexOf(I);if(Y<0||Y>=J.length){const te=a[o(a).keyList.indexOf(I)];if(te)return te;throw new Error("splitAtom: index out of bounds for read")}return J[Y]},$=(G,V,J)=>{const re=G(n),Y=G(e),se=o(Y,re==null?void 0:re.arr).keyList.indexOf(I);if(se<0||se>=Y.length)throw new Error("splitAtom: index out of bounds for write");const m=Fn(J)?J(Y[se]):J;V(e,[...Y.slice(0,se),m,...Y.slice(se+1)])};x[S]=ut(e)?X(q,$):X(q)}),c&&c.keyList.length===v.length&&c.keyList.every((R,S)=>R===v[S])?g=c:g={arr:a,atomList:x,keyList:v},s.set(a,g),g},n=X(a=>{const d=a(n),g=a(e);return o(g,d==null?void 0:d.arr)});(Fe?"production":void 0)!=="production"&&(n.debugPrivate=!0),n.init=void 0;const l=ut(e)?X(a=>a(n).atomList,(a,d,g)=>{switch(g.type){case"remove":{const c=a(l).indexOf(g.atom);if(c>=0){const x=a(e);d(e,[...x.slice(0,c),...x.slice(c+1)])}break}case"insert":{const c=g.before?a(l).indexOf(g.before):a(l).length;if(c>=0){const x=a(e);d(e,[...x.slice(0,c),g.value,...x.slice(c)])}break}case"move":{const c=a(l).indexOf(g.atom),x=g.before?a(l).indexOf(g.before):a(l).length;if(c>=0&&x>=0){const v=a(e);c<x?d(e,[...v.slice(0,c),...v.slice(c+1,x),v[c],...v.slice(x)]):d(e,[...v.slice(0,x),v[c],...v.slice(x,c),...v.slice(c+1)])}break}}}):X(a=>a(n).atomList);return l},e,t||Vn)}function qn(e){const t=Symbol(),s=X(t);(Fe?"production":void 0)!=="production"&&(s.debugPrivate=!0);const o=X((n,l)=>{const a=n(s);return a!==t?a:e(n,l)},(n,l,a)=>{if(a===Et)l(s,t);else if(typeof a=="function"){const d=n(o);l(s,a(d))}else l(s,a)});return o}const $n=e=>typeof(e==null?void 0:e.then)=="function";function Gn(e){let t,s;const o={getItem:(n,l)=>{var a,d;const g=x=>{if(x=x||"",t!==x){try{s=JSON.parse(x)}catch{return l}t=x}return s},c=(d=(a=e())==null?void 0:a.getItem(n))!=null?d:null;return $n(c)?c.then(g):g(c)},setItem:(n,l)=>{var a;return(a=e())==null?void 0:a.setItem(n,JSON.stringify(l))},removeItem:n=>{var l;return(l=e())==null?void 0:l.removeItem(n)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(o.subscribe=(n,l,a)=>{if(!(e()instanceof window.Storage))return()=>{};const d=g=>{if(g.storageArea===e()&&g.key===n){let c;try{c=JSON.parse(g.newValue||"")}catch{c=a}l(c)}};return window.addEventListener("storage",d),()=>{window.removeEventListener("storage",d)}}),o}const Wn=Gn(()=>typeof window<"u"?window.localStorage:void 0);function fe(e,t,s=Wn,o){const n=o==null?void 0:o.unstable_getOnInit,l=X(n?s.getItem(e,t):t);return(Fe?"production":void 0)!=="production"&&(l.debugPrivate=!0),l.onMount=d=>{n||d(s.getItem(e,t));let g;return s.subscribe&&(g=s.subscribe(e,d,t)),g},X(d=>d(l),(d,g,c)=>{const x=typeof c=="function"?c(d(l)):c;return x===Et?(g(l,t),s.removeItem(e)):x instanceof Promise?x.then(v=>(g(l,v),s.setItem(e,v))):(g(l,x),s.setItem(e,x))})}const Ue=p.atom(null);Ue.debugLabel="chaiBuilderPropsAtom";const Ct=p.atom({});Ct.debugLabel="chaiExternalDataAtom";const Hn=()=>!1,Yn=e=>{const t=e.replace(W.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},mt=(e,t)=>{if(!e)return!0;const s=Se.getBlockComponent(e);return s&&i.has(s,"canAcceptBlock")?s.canAcceptBlock(t):!1},At=(e,t)=>{const s=Se.getBlockComponent(t);return s&&i.has(s,"canBeNested")?s.canBeNested(e):!0},Kn=e=>{const t=Se.getBlockComponent(e);return t&&i.has(t,"canDuplicate")?t.canDuplicate():!0},Jn=e=>{const t=Se.getBlockComponent(e);return t&&i.has(t,"canDelete")?t.canDelete():!0},Qn=(e,{dragSource:t,dropTarget:s})=>{const o=i.get(t,"data._type",""),n=i.get(s,"data._type","");return At(n,o)};const Xn=new vt({children:"blockNodes"});function Bt(e,t,s){const o=i.filter(e,l=>l._parent===t),n=[];for(let l=0;l<o.length;l++){const a=_t(o[l]);if(Object.keys(a).length>0&&Object.keys(a).forEach(d=>{o[l][d]=`slot:${oe.generateUUID()}`}),i.filter(e,{_parent:o[l]._id}).length>0){const d=oe.generateUUID();n.push({...o[l],oldId:o[l]._id,_id:d,_parent:s}),n.push(i.flatten(Bt(e,o[l]._id,d)))}else n.push({...o[l],oldId:o[l]._id,_id:oe.generateUUID(),_parent:s})}return i.flatten(n)}function Zn(e){let t=Xn.convert(e.map(s=>i.omit(s,["settings"])));return t=!t.type&&t.blockNodes?t.blockNodes:i.isEmpty(t)?[]:[t],t}const _t=e=>{const t={};return Object.keys(e).forEach(s=>{i.isString(e[s])&&e[s].startsWith("slot")&&(t[s]=e[s].replace("slot:",""))}),t},er=(e,t,s=null)=>{let o=i.find(e,{_id:t});o={...o,oldId:o._id,_id:oe.generateUUID()},s&&(o={...o,_parent:s});const n=[o];i.filter(e,{_parent:t}).length>0&&n.push(i.flatten(Bt(e,t,o._id)));const l=i.flatten(n);return i.map(l,a=>{const d=a,g=_t(d);return Object.keys(g).length>0&&Object.keys(g).forEach(c=>{const x=i.find(l,{oldId:g[c].replace("slot:","")});d[c]=`slot:${x._id}`}),i.omit(d,["global","oldId"])})};const ee=p.atom([]);ee.debugLabel="presentBlocksAtom";const qe=Un(ee);qe.debugLabel="pageBlocksAtomsAtom";const tr=p.atom(e=>Zn(e(ee)));tr.debugLabel="pageBlocksTreeAtom";const sr=p.atom("");sr.debugLabel="builderActivePageAtom";const or=p.atom(-1);or.debugLabel="destinationDropIndexAtom";const Tt=p.atom([]);Tt.debugLabel="buildingBlocksAtom";const nr=p.atom(e=>{const t=e(Tt);return i.filter(t,s=>i.has(s,"blockId"))});nr.debugLabel="globalBlocksAtom";const $e=p.atom([]);$e.debugLabel="selectedBlockIdsAtom";const Ge=p.atom(e=>{const t=e(ee),s=e($e);return i.map(i.filter(t,({_id:o})=>i.includes(s,o)),o=>({...o}))});Ge.debugLabel="selectedBlocksAtom";const We=p.atom(e=>{const t=e(Ge);return t.length===0?null:t.length===1?t[0]:{type:"Multiple",id:i.map(t,"id")}});We.debugLabel="selectedBlockAtom";const rr=e=>i.get(e,"parent",null),ar=p.atom(e=>{const t=e(Ge),s=i.map(t,rr);return i.filter(e(ee),o=>i.includes(s,o._id))});ar.debugLabel="selectedBlocksParentsAtom";const Pt=p.atom(()=>!1);Pt.debugLabel="selectedBlockFlexChildAtom";const It=p.atom(()=>!1);It.debugLabel="selectedBlockGridChildAtom";const He=p.atom("");He.debugLabel="styleStateAtom";const Mt=fe("styleBreakpoint","xs");Mt.debugLabel="styleBreakpointAtom";const ir=()=>({flexChild:p.useAtomValue(Pt),gridChild:p.useAtomValue(It)}),lr=()=>p.useAtomValue(We);const be=()=>{const[e,t]=p.useAtom($e),s=N.useCallback(o=>{t(n=>i.includes(n,o)?i.without(n,o):[...n,o])},[t]);return[e,t,s]},Oe=e=>{switch(e.type){case"singular":return e.uiSchema;case"model":const{properties:t}=e,s={};return Object.keys(t).forEach(l=>{const a=t[l];if(i.includes(["slot","styles"],a.type))return;const d=l;s[d]=Oe(a)}),s;case"list":const{itemProperties:o}=e,n={items:{}};return Object.keys(o).forEach(l=>{const a=o[l];if(i.includes(["slot","styles"],a.type))return;const d=l;n.items[d]=Oe(a)}),n;default:return{}}},Le=e=>{switch(e.type){case"singular":return e.schema;case"model":const{properties:t,title:s}=e,o={title:s,type:"object",properties:{}};return Object.keys(t).forEach(d=>{const g=t[d];if(i.includes(["slot","styles"],g.type))return;const c=d;o.properties[c]=Le(g)}),o;case"list":const{itemProperties:n,title:l}=e,a={title:l,type:"array",items:{type:"object",properties:{}}};return Object.keys(n).forEach(d=>{const g=n[d];if(i.includes(["slot","styles"],g.type))return;const c=d;a.items.properties[c]=Le(g),i.set(a.items,"title",i.get(g,"itemTitle",`${l} item`))}),a;default:return{}}},Dt=e=>{if(!e)return{};const t={};return Object.keys(e).forEach(s=>{t[s]=dr(e[s])}),t},cr=e=>{if(i.isEmpty(e.default))return[];const{itemProperties:t}=e;return i.map(e.default,s=>{const o={...s};return i.forIn(s,(n,l)=>{i.has(t,l)&&i.get(t[l],"i18n",!1)&&(o[l]=W.I18N_KEY)}),o})},dr=e=>{switch(e.type){case"styles":return e.default;case"slot":return`${W.SLOT_KEY}${oe.generateUUID()}`;case"singular":const{i18n:t,schema:s}=e;return t?W.I18N_KEY:i.get(s,"default","");case"model":return Dt(e.properties);case"list":return cr(e);default:return""}};var Ye={exports:{}},fi=Ye.exports;(function(e){(function(){"use strict";function t(o,n,l){return o.splice(n,!l||1+l-n+(!(l<0^n>=0)&&(l<0||-1)*o.length)),o.length}let s=function(){let o=[],n=-1,l=0,a=!1,d;function g(c,x){return!c||typeof c[x]!="function"?this:(a=!0,c[x](),a=!1,this)}return{add:function(c){return a?this:(o.splice(n+1,o.length-n),o.push(c),l&&o.length>l&&t(o,0,-(l+1)),n=o.length-1,d&&d(),this)},setCallback:function(c){d=c},undo:function(){let c=o[n];if(!c)return this;const x=c.groupId;for(;c.groupId===x&&(g(c,"undo"),n-=1,c=o[n],!(!c||!c.groupId)););return d&&d(),this},redo:function(){let c=o[n+1];if(!c)return this;const x=c.groupId;for(;c.groupId===x&&(g(c,"redo"),n+=1,c=o[n+1],!(!c||!c.groupId)););return d&&d(),this},clear:function(){let c=o.length;o=[],n=-1,d&&c>0&&d()},hasUndo:function(){return n!==-1},hasRedo:function(){return n<o.length-1},getCommands:function(c){return c?o.filter(x=>x.groupId===c):o},getIndex:function(){return n},setLimit:function(c){l=c}}};e.exports?e.exports=s:window.UndoManager=s})()})(Ye);var ur=Ye.exports;const mr=rn.getDefaultExportFromCjs(ur),pr=p.atom(W.BRANDING_OPTIONS_DEFAULTS),fr=p.atom(null),Ot=()=>{const[e,t]=p.useAtom(pr);return[i.isObject(e)?{...W.BRANDING_OPTIONS_DEFAULTS,...e}:W.BRANDING_OPTIONS_DEFAULTS,t]},xr=()=>p.useAtom(fr),gr=p.atom(null),Lt=()=>({currentPage:p.useAtomValue(gr)}),zt=new vt({});function hr(e){let t=zt.convert(e);return t=!t.type&&t.children&&t.children.length?t.children:i.isEmpty(t)?[]:[t],t}const Ke=(e,t)=>i.flatten(e.map(s=>{if(s=t?{...s,parent:t}:{...s},s.children){const o=[...s.children];return delete s.children,i.flatten([s,...Ke(o,s._id)])}return s}));function Je(e,t=!1){for(let s=0;s<e.length;s++){const o=e[s];o.global&&!t?e[s]={type:"GlobalBlock",blockId:o.blockId,_parent:i.get(o,"parent",null),_id:o._id}:o.children&&o.children.length&&Je(o.children)}}function Vt(e){let t=[],s=i.filter(e,{type:"GlobalBlock"});return s.length>0&&(s=i.map(s,Ft),i.each(s,o=>{t=[...t,...br(o)]})),t}function br(e){let t=[];const s=i.get(i.first(e),"parent",null);i.set(i.first(e),"parent",null);const o=[zt.convert(Ut(e))];Je(o,!0);let n=Ke(o,e[0]._id);return n=i.set(n,"0.parent",s),t=[...t,n,...Vt(n)],t}function Ft(e){const t=i.find(ze,{_id:e._id});if(!t)return[];const s=[t],o=i.filter(ze,{_parent:e._id});return o.length?i.flatten([...s,...i.flatten(i.map(o,Ft))]):i.flatten(s)}const Ut=e=>JSON.parse(JSON.stringify(e));let ze=[];function vr(e){ze=e;const t=hr(Ut(e));Je(t);const s=Ke(t,null),o=Vt(s),n={};return i.each(o,l=>i.set(n,i.first(l).blockId,l)),[s,n]}const qt=()=>{const[e]=Ot(),{currentPage:t}=Lt(),[s]=de();return N.useCallback(()=>{const o=i.map(s,a=>i.omit(a,["expanded","order","title","siblings","tempClasses"])),[n=[],l=[]]=vr(o);return{currentPage:t,blocks:n,globalBlocks:l}},[e,t,s])},me=(e,t=void 0)=>{const s=p.useAtomValue(Ue);return i.get(s,e,t)},Qe=p.atom([]);Qe.debugLabel="dataProvidersAtom";const $t=()=>p.useAtom(Qe),Ce=p.atom("SAVED");Ce.debugLabel="pageSyncStateAtom";const yr=()=>{const[e,t]=p.useAtom(Ce),s=me("onSaveBlocks",async()=>{}),o=me("onSavePage",async()=>{}),n=me("onSyncStatusChange",()=>{}),l=qt(),[a]=$t();return{savePage:an.useThrottledCallback(async()=>{t("SAVING"),n("SAVING");const g=l();return await o({blocks:g.blocks,providers:a}),setTimeout(()=>{t("SAVED"),n("SAVED")},100),!0},[l,t,n,s],5e3),syncState:e,setSyncState:t}},Z=new mr;Z.setLimit(50);const Xe=()=>{const[,e]=p.useAtom(Ce);return N.useEffect(()=>(Z.setCallback(()=>e("UNSAVED")),()=>{Z.setCallback(i.noop)}),[]),{add:Z.add,undo:Z.undo,redo:Z.redo,hasRedo:Z.hasRedo,hasUndo:Z.hasUndo,clear:Z.clear}},Ze=(e,t)=>{const s=[],o=i.filter(e,n=>i.includes(t,n._id)||i.includes(t,n._parent)?(s.push(n._id),!1):!0);return i.isEmpty(s)?o:Ze(o,s)},jr=()=>{const[e]=de(),[t,s]=be(),{setNewBlocks:o}=ne();return N.useCallback(n=>{var a;const l=((a=i.find(e,{_id:n[0]}))==null?void 0:a._parent)||null;o(Ze(e,n)),setTimeout(()=>s(l?[l]:[]),200)},[e,s,t])};function wr(e,t,s,o){let n=e.filter(d=>!d._parent);s&&(n=e.filter(d=>d._parent===s));const l=o!==void 0?o:n.length;let a=e.length;for(let d=0,g=0;d<e.length;d++)if(e[d]._parent===s){if(g===l){a=d;break}g++}return!s&&o!==void 0&&o>=n.length&&(a=e.length),[...e.slice(0,a),...t,...e.slice(a)]}const Rr=()=>{const[,e]=de();return{setNewBlocks:t=>{e(t)},addBlocks:(t,s,o)=>{e(n=>wr(n,t,s,o))},removeBlocks:t=>{e(s=>Ze(s,t))},updateBlocksProps:t=>{e(s=>{const o=t.map(n=>n._id);return s.map(n=>{if(o.includes(n._id)){const l=i.find(t,{_id:n._id});return{...n,...i.omit(l,"_id")}}return n})})}}},de=()=>p.useAtom(ee),ne=()=>{const{add:e}=Xe(),[t]=de(),{setNewBlocks:s,addBlocks:o,removeBlocks:n,updateBlocksProps:l}=Rr();return{addBlocks:(v,R,S)=>{o(v,R,S),e({undo:()=>n(i.map(v,"_id")),redo:()=>o(v,R,S)})},removeBlocks:v=>{var D;const R=(D=i.first(v))==null?void 0:D._parent,I=t.filter(q=>R?q._parent===R:!q._parent).indexOf(i.first(v));n(i.map(v,"_id")),e({undo:()=>o(v,R,I),redo:()=>n(i.map(v,"_id"))})},updateBlocks:(v,R,S)=>{let I=[];if(S)I=i.map(v,D=>({_id:D,...S}));else{const D=i.keys(R);I=i.map(v,q=>{const $=t.find(V=>V._id===q),G={_id:q};return i.each(D,V=>G[V]=$[V]),G})}l(i.map(v,D=>({_id:D,...R}))),e({undo:()=>l(I),redo:()=>l(i.map(v,D=>({_id:D,...R})))})},updateBlocksRuntime:(v,R)=>{l(i.map(v,S=>({_id:S,...R})))},setNewBlocks:v=>{s(v),e({undo:()=>s(t),redo:()=>s(v)})}}},Gt=le.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"}}),Wt=f.forwardRef(({className:e,variant:t,size:s,...o},n)=>r.jsxRuntimeExports.jsx(jt.Root,{ref:n,className:u.cn(Gt({variant:t,size:s,className:e})),...o}));Wt.displayName=jt.Root.displayName;const Ht=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(De.Root,{className:u.cn("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",e),...t,ref:s,children:r.jsxRuntimeExports.jsx(De.Thumb,{className:u.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")})}));Ht.displayName=De.Root.displayName;const Ae=le.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"}}),Yt=f.forwardRef(({className:e,variant:t,size:s,asChild:o=!1,...n},l)=>{const a=o?dn.Slot:"button";return r.jsxRuntimeExports.jsx(a,{className:u.cn(Ae({variant:t,size:s,className:e})),ref:l,...n})});Yt.displayName="Button";const kr=ie.Root,Kt=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(ie.Item,{ref:s,className:u.cn("border-b",e),...t}));Kt.displayName="AccordionItem";const Jt=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsx(ie.Header,{className:"flex",children:r.jsxRuntimeExports.jsxs(ie.Trigger,{ref:o,className:u.cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...s,children:[t,r.jsxRuntimeExports.jsx(F.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));Jt.displayName=ie.Trigger.displayName;const Qt=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsx(ie.Content,{ref:o,className:u.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...s,children:r.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:t})}));Qt.displayName=ie.Content.displayName;const Nr=le.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"}}),Xt=f.forwardRef(({className:e,variant:t,...s},o)=>r.jsxRuntimeExports.jsx("div",{ref:o,role:"alert",className:u.cn(Nr({variant:t}),e),...s}));Xt.displayName="Alert";const Zt=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("h5",{ref:s,className:u.cn("mb-1 font-medium leading-none tracking-tight",e),...t}));Zt.displayName="AlertTitle";const es=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("text-sm [&_p]:leading-relaxed",e),...t}));es.displayName="AlertDescription";const ts=le.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"}}),Sr=({className:e,variant:t,...s})=>r.jsxRuntimeExports.jsx("div",{className:u.cn(ts({variant:t}),e),...s}),Er=U.Root,Cr=U.Trigger,ss=({className:e,...t})=>r.jsxRuntimeExports.jsx(U.Portal,{className:u.cn(e),...t});ss.displayName=U.Portal.displayName;const os=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Overlay,{className:u.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));os.displayName=U.Overlay.displayName;const ns=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsxs(ss,{children:[r.jsxRuntimeExports.jsx(os,{}),r.jsxRuntimeExports.jsx(U.Content,{ref:s,className:u.cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...t})]}));ns.displayName=U.Content.displayName;const rs=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});rs.displayName="AlertDialogHeader";const as=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});as.displayName="AlertDialogFooter";const is=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Title,{ref:s,className:u.cn("text-lg font-semibold",e),...t}));is.displayName=U.Title.displayName;const ls=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Description,{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));ls.displayName=U.Description.displayName;const cs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Action,{ref:s,className:u.cn(Ae(),e),...t}));cs.displayName=U.Action.displayName;const ds=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Cancel,{ref:s,className:u.cn(Ae({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ds.displayName=U.Cancel.displayName;const et=_.Root,us=_.Trigger,ms=({className:e,...t})=>r.jsxRuntimeExports.jsx(_.Portal,{className:u.cn(e),...t});ms.displayName=_.Portal.displayName;const ps=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(_.Overlay,{ref:s,className:u.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ps.displayName=_.Overlay.displayName;const Be=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(ms,{children:[r.jsxRuntimeExports.jsx(ps,{}),r.jsxRuntimeExports.jsxs(_.Content,{ref:o,className:u.cn("fixed left-[50%] top-[50%] z-[999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...s,children:[t,r.jsxRuntimeExports.jsxs(_.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[r.jsxRuntimeExports.jsx(F.Cross2Icon,{className:"h-4 w-4"}),r.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Be.displayName=_.Content.displayName;const fs=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});fs.displayName="DialogHeader";const xs=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xs.displayName="DialogFooter";const gs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(_.Title,{ref:s,className:u.cn("text-lg font-semibold leading-none tracking-tight",e),...t}));gs.displayName=_.Title.displayName;const hs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(_.Description,{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));hs.displayName=_.Description.displayName;const bs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("rounded-xl border bg-card text-card-foreground shadow",e),...t}));bs.displayName="Card";const vs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("flex flex-col space-y-1.5 p-6",e),...t}));vs.displayName="CardHeader";const ys=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("h3",{ref:s,className:u.cn("font-semibold leading-none tracking-tight",e),...t}));ys.displayName="CardTitle";const js=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("p",{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));js.displayName="CardDescription";const ws=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("p-6 pt-0",e),...t}));ws.displayName="CardContent";const Rs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn(" flex items-center p-6 pt-0",e),...t}));Rs.displayName="CardFooter";const ks=f.forwardRef(({className:e,type:t,...s},o)=>r.jsxRuntimeExports.jsx("input",{type:t,className:u.cn("flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...s}));ks.displayName="Input";const Ar=le.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ns=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(wt.Root,{ref:s,className:u.cn(Ar(),e),...t}));Ns.displayName=wt.Root.displayName;const Ss=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("textarea",{className:u.cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...t}));Ss.displayName="Textarea";const Es=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(ae.Root,{ref:o,className:u.cn("relative overflow-hidden",e),...s,children:[r.jsxRuntimeExports.jsx(ae.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),r.jsxRuntimeExports.jsx(tt,{}),r.jsxRuntimeExports.jsx(ae.Corner,{})]}));Es.displayName=ae.Root.displayName;const tt=f.forwardRef(({className:e,orientation:t="vertical",...s},o)=>r.jsxRuntimeExports.jsx(ae.ScrollAreaScrollbar,{ref:o,orientation:t,className:u.cn("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",e),...s,children:r.jsxRuntimeExports.jsx(ae.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));tt.displayName=ae.ScrollAreaScrollbar.displayName;const Cs=ce.Root,st=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(ce.List,{ref:s,className:u.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));st.displayName=ce.List.displayName;const ke=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(ce.Trigger,{ref:s,className:u.cn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));ke.displayName=ce.Trigger.displayName;const Ne=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(ce.Content,{ref:s,className:u.cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ne.displayName=ce.Content.displayName;const Br=pe.Portal,_r=pe.Provider,Tr=pe.Root,Pr=pe.Trigger,As=f.forwardRef(({className:e,sideOffset:t=4,...s},o)=>r.jsxRuntimeExports.jsx(pe.Content,{ref:o,sideOffset:t,className:u.cn("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s}));As.displayName=pe.Content.displayName;const Ir=he.Root,Mr=he.Trigger,Bs=f.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},n)=>r.jsxRuntimeExports.jsx(he.Portal,{children:r.jsxRuntimeExports.jsx(he.Content,{ref:n,align:t,sideOffset:s,className:u.cn("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Bs.displayName=he.Content.displayName;const Dr=A.Menu,Or=A.Group,Lr=A.Portal,zr=A.Sub,Vr=A.RadioGroup,_s=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(A.Root,{ref:s,className:u.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",e),...t}));_s.displayName=A.Root.displayName;const Ts=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(A.Trigger,{ref:s,className:u.cn("flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e),...t}));Ts.displayName=A.Trigger.displayName;const Ps=f.forwardRef(({className:e,inset:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(A.SubTrigger,{ref:n,className:u.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[s,r.jsxRuntimeExports.jsx(F.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));Ps.displayName=A.SubTrigger.displayName;const Is=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(A.SubContent,{ref:s,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Is.displayName=A.SubContent.displayName;const Ms=f.forwardRef(({className:e,align:t="start",alignOffset:s=-4,sideOffset:o=8,...n},l)=>r.jsxRuntimeExports.jsx(A.Portal,{children:r.jsxRuntimeExports.jsx(A.Content,{ref:l,align:t,alignOffset:s,sideOffset:o,className:u.cn("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ms.displayName=A.Content.displayName;const Ds=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(A.Item,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));Ds.displayName=A.Item.displayName;const Os=f.forwardRef(({className:e,children:t,checked:s,...o},n)=>r.jsxRuntimeExports.jsxs(A.CheckboxItem,{ref:n,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(A.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.CheckIcon,{className:"h-4 w-4"})})}),t]}));Os.displayName=A.CheckboxItem.displayName;const Ls=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(A.RadioItem,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(A.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Ls.displayName=A.RadioItem.displayName;const zs=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(A.Label,{ref:o,className:u.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));zs.displayName=A.Label.displayName;const Vs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(A.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-muted",e),...t}));Vs.displayName=A.Separator.displayName;const Fs=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Fs.displayname="MenubarShortcut";const Fr=Ee.Root,Ur=Ee.Trigger,Us=f.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},n)=>r.jsxRuntimeExports.jsx(Ee.Content,{ref:n,align:t,sideOffset:s,className:u.cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));Us.displayName=Ee.Content.displayName;const qr=O.Root,$r=O.Group,Gr=O.Value,qs=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(O.Trigger,{ref:o,className:u.cn("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...s,children:[t,r.jsxRuntimeExports.jsx(O.Icon,{asChild:!0,children:r.jsxRuntimeExports.jsx(F.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));qs.displayName=O.Trigger.displayName;const $s=f.forwardRef(({className:e,children:t,position:s="popper",...o},n)=>r.jsxRuntimeExports.jsx(O.Portal,{children:r.jsxRuntimeExports.jsx(O.Content,{ref:n,className:u.cn("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:s,...o,children:r.jsxRuntimeExports.jsx(O.Viewport,{className:u.cn("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));$s.displayName=O.Content.displayName;const Gs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(O.Label,{ref:s,className:u.cn("px-2 py-1.5 text-sm font-semibold",e),...t}));Gs.displayName=O.Label.displayName;const Ws=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(O.Item,{ref:o,className:u.cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(O.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.CheckIcon,{className:"h-4 w-4"})})}),r.jsxRuntimeExports.jsx(O.ItemText,{children:t})]}));Ws.displayName=O.Item.displayName;const Hs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(O.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-muted",e),...t}));Hs.displayName=O.Separator.displayName;const Wr=_.Root,Hr=_.Trigger,Yr=_.Close,Ys=({className:e,...t})=>r.jsxRuntimeExports.jsx(_.Portal,{className:u.cn(e),...t});Ys.displayName=_.Portal.displayName;const Ks=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(_.Overlay,{className:u.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));Ks.displayName=_.Overlay.displayName;const Kr=le.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"}}),Js=f.forwardRef(({side:e="right",className:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(Ys,{children:[r.jsxRuntimeExports.jsx(Ks,{}),r.jsxRuntimeExports.jsxs(_.Content,{ref:n,className:u.cn(Kr({side:e}),t),...o,children:[s,r.jsxRuntimeExports.jsxs(_.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[r.jsxRuntimeExports.jsx(F.Cross2Icon,{className:"h-4 w-4"}),r.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Js.displayName=_.Content.displayName;const Qs=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});Qs.displayName="SheetHeader";const Xs=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xs.displayName="SheetFooter";const Zs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(_.Title,{ref:s,className:u.cn("text-lg font-semibold text-foreground",e),...t}));Zs.displayName=_.Title.displayName;const eo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(_.Description,{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));eo.displayName=_.Description.displayName;const Jr=T.Root,Qr=T.Trigger,Xr=T.Group,Zr=T.Portal,ea=T.Sub,ta=T.RadioGroup,to=f.forwardRef(({className:e,inset:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(T.SubTrigger,{ref:n,className:u.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...o,children:[s,r.jsxRuntimeExports.jsx(F.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));to.displayName=T.SubTrigger.displayName;const so=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(T.SubContent,{ref:s,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));so.displayName=T.SubContent.displayName;const oo=f.forwardRef(({className:e,sideOffset:t=4,...s},o)=>r.jsxRuntimeExports.jsx(T.Portal,{children:r.jsxRuntimeExports.jsx(T.Content,{ref:o,sideOffset:t,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));oo.displayName=T.Content.displayName;const no=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(T.Item,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));no.displayName=T.Item.displayName;const ro=f.forwardRef(({className:e,children:t,checked:s,...o},n)=>r.jsxRuntimeExports.jsxs(T.CheckboxItem,{ref:n,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(T.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.CheckIcon,{className:"h-4 w-4"})})}),t]}));ro.displayName=T.CheckboxItem.displayName;const ao=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(T.RadioItem,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(T.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));ao.displayName=T.RadioItem.displayName;const io=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(T.Label,{ref:o,className:u.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));io.displayName=T.Label.displayName;const lo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(T.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-muted",e),...t}));lo.displayName=T.Separator.displayName;const co=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest opacity-60",e),...t});co.displayName="DropdownMenuShortcut";const uo=f.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...o},n)=>r.jsxRuntimeExports.jsx(Rt.Root,{ref:n,decorative:s,orientation:t,className:u.cn("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));uo.displayName=Rt.Root.displayName;const sa=1,oa=1e6;let Ie=0;function na(){return Ie=(Ie+1)%Number.MAX_VALUE,Ie.toString()}const Me=new Map,pt=e=>{if(Me.has(e))return;const t=setTimeout(()=>{Me.delete(e),ge({type:"REMOVE_TOAST",toastId:e})},oa);Me.set(e,t)},mo=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,sa)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case"DISMISS_TOAST":{const{toastId:s}=t;return s?pt(s):e.toasts.forEach(o=>{pt(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===s||s===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)}}},je=[];let we={toasts:[]};function ge(e){we=mo(we,e),je.forEach(t=>{t(we)})}function po({...e}){const t=na(),s=n=>ge({type:"UPDATE_TOAST",toast:{...n,id:t}}),o=()=>ge({type:"DISMISS_TOAST",toastId:t});return ge({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:n=>{n||o()}}}),{id:t,dismiss:o,update:s}}function ot(){const[e,t]=f.useState(we);return f.useEffect(()=>(je.push(t),()=>{const s=je.indexOf(t);s>-1&&je.splice(s,1)}),[e]),{...e,toast:po,dismiss:s=>ge({type:"DISMISS_TOAST",toastId:s})}}const ra=K.Provider,fo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(K.Viewport,{ref:s,className:u.cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));fo.displayName=K.Viewport.displayName;const aa=le.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"}}),xo=f.forwardRef(({className:e,variant:t,...s},o)=>r.jsxRuntimeExports.jsx(K.Root,{ref:o,className:u.cn(aa({variant:t}),e),...s}));xo.displayName=K.Root.displayName;const ia=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(K.Action,{ref:s,className:u.cn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));ia.displayName=K.Action.displayName;const go=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(K.Close,{ref:s,className:u.cn("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:r.jsxRuntimeExports.jsx(F.Cross2Icon,{className:"h-4 w-4"})}));go.displayName=K.Close.displayName;const ho=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(K.Title,{ref:s,className:u.cn("text-sm font-semibold [&+div]:text-xs",e),...t}));ho.displayName=K.Title.displayName;const bo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(K.Description,{ref:s,className:u.cn("text-sm opacity-90",e),...t}));bo.displayName=K.Description.displayName;function la(){const{toasts:e}=ot();return r.jsxRuntimeExports.jsxs(ra,{children:[e.map(({id:t,title:s,description:o,action:n,...l})=>r.jsxRuntimeExports.jsxs(xo,{...l,children:[r.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[s&&r.jsxRuntimeExports.jsx(ho,{children:s}),o&&r.jsxRuntimeExports.jsx(bo,{children:o})]}),n,r.jsxRuntimeExports.jsx(go,{})]},t)),r.jsxRuntimeExports.jsx(fo,{})]})}const ca=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("animate-pulse rounded-md bg-primary/10",e),...t}),nt=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(H.Command,{ref:s,className:u.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));nt.displayName=H.Command.displayName;const da=({children:e,...t})=>r.jsxRuntimeExports.jsx(et,{...t,children:r.jsxRuntimeExports.jsx(Be,{className:"overflow-hidden p-0",children:r.jsxRuntimeExports.jsx(nt,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),vo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[r.jsxRuntimeExports.jsx(F.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),r.jsxRuntimeExports.jsx(H.Command.Input,{ref:s,className:u.cn("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));vo.displayName=H.Command.Input.displayName;const yo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(H.Command.List,{ref:s,className:u.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));yo.displayName=H.Command.List.displayName;const jo=f.forwardRef((e,t)=>r.jsxRuntimeExports.jsx(H.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));jo.displayName=H.Command.Empty.displayName;const wo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(H.Command.Group,{ref:s,className:u.cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));wo.displayName=H.Command.Group.displayName;const Ro=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(H.Command.Separator,{ref:s,className:u.cn("-mx-1 h-px bg-border",e),...t}));Ro.displayName=H.Command.Separator.displayName;const ko=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(H.Command.Item,{ref:s,className:u.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));ko.displayName=H.Command.Item.displayName;const No=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});No.displayName="CommandShortcut";const ua=P.Root,ma=P.Trigger,pa=P.Group,fa=P.Portal,xa=P.Sub,ga=P.RadioGroup,So=f.forwardRef(({className:e,inset:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(P.SubTrigger,{ref:n,className:u.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[s,r.jsxRuntimeExports.jsx(F.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));So.displayName=P.SubTrigger.displayName;const Eo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(P.SubContent,{ref:s,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Eo.displayName=P.SubContent.displayName;const Co=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(P.Portal,{children:r.jsxRuntimeExports.jsx(P.Content,{ref:s,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));Co.displayName=P.Content.displayName;const Ao=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(P.Item,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));Ao.displayName=P.Item.displayName;const Bo=f.forwardRef(({className:e,children:t,checked:s,...o},n)=>r.jsxRuntimeExports.jsxs(P.CheckboxItem,{ref:n,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(P.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.CheckIcon,{className:"h-4 w-4"})})}),t]}));Bo.displayName=P.CheckboxItem.displayName;const _o=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(P.RadioItem,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(P.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));_o.displayName=P.RadioItem.displayName;const To=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(P.Label,{ref:o,className:u.cn("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...s}));To.displayName=P.Label.displayName;const Po=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(P.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-border",e),...t}));Po.displayName=P.Separator.displayName;const Io=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Io.displayName="ContextMenuShortcut";const ha=e=>{try{const t=document.getElementById("icon-picker-field"),s=document.createElement("div");Sn.render(r.jsxRuntimeExports.jsx(yt.IconPickerItem,{value:e}),s),t.appendChild(s),s.hidden=!0;let o=s.innerHTML;setTimeout(()=>t.removeChild(s),100);const l=new DOMParser().parseFromString(o,"image/svg+xml"),a=l.querySelector("svg");return a&&(a.removeAttribute("width"),a.removeAttribute("height")),new XMLSerializer().serializeToString(l)}catch(t){return console.error(t),""}},ba=({value:e,onChange:t})=>{const s=o=>{t("<svg />");const n=ha(o);t(n)};return r.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[r.jsxRuntimeExports.jsxs("div",{className:"group relative h-12 w-12",children:[r.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e?e.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"}),r.jsxRuntimeExports.jsx(yt,{value:e?"BiSolidGrid":null,onChange:s,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"}})]}),r.jsxRuntimeExports.jsx("textarea",{value:e,onChange:o=>t(o.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"})]})},va=N.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-vACw5hbK.cjs"))),ya=N.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-PzHdEKHT.cjs"))),Mo=({isModalView:e=!1,onSelect:t=()=>{}})=>{const[s,o]=N.useState("upload");return r.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[r.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:r.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:e?"Select or upload images":"Images"})}),r.jsxRuntimeExports.jsxs(Cs,{value:s,onValueChange:n=>o(n),className:"flex h-full w-full flex-col py-2",children:[r.jsxRuntimeExports.jsxs(st,{className:"w-full",children:[r.jsxRuntimeExports.jsx(ke,{value:"upload",className:"w-1/2",children:"Upload"}),r.jsxRuntimeExports.jsx(ke,{value:"unsplash",className:"w-1/2",children:"Unsplash"})]}),s==="unsplash"?r.jsxRuntimeExports.jsx(Ne,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:r.jsxRuntimeExports.jsx(N.Suspense,{fallback:r.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:r.jsxRuntimeExports.jsx(va,{isModalView:e,onSelect:t})})}):r.jsxRuntimeExports.jsx(Ne,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:r.jsxRuntimeExports.jsx(N.Suspense,{fallback:r.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:r.jsxRuntimeExports.jsx(ya,{isModalView:e,onSelect:t})})})]})]})},ja=Object.freeze(Object.defineProperty({__proto__:null,default:Mo},Symbol.toStringTag,{value:"Module"})),ft=({children:e,onSelect:t})=>{const[s,o]=N.useState(!1),n=(...l)=>{t.call(void 0,...l),o(!1)};return r.jsxRuntimeExports.jsxs(et,{open:s,onOpenChange:l=>o(l),children:[r.jsxRuntimeExports.jsx(us,{asChild:!0,children:e}),r.jsxRuntimeExports.jsx(Be,{className:"flex h-3/4 max-w-5xl",children:r.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:r.jsxRuntimeExports.jsx(Mo,{isModalView:!0,onSelect:n})})})]})},wa=({value:e,onChange:t,id:s,onBlur:o})=>r.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[e?r.jsxRuntimeExports.jsx("img",{src:e,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):r.jsxRuntimeExports.jsx(ft,{onSelect:t,children:r.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"})}),r.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[r.jsxRuntimeExports.jsx(ft,{onSelect:t,children:r.jsxRuntimeExports.jsx("small",{className:"cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700",children:e||!i.isEmpty(e)?"Replace Image":"Choose Image"})}),r.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"}),r.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:e,onBlur:({target:{value:n}})=>o(s,n),onChange:n=>t(n.target.value)})]})]}),Ra=({id:e,placeholder:t,value:s,onChange:o,onBlur:n})=>{const l={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},a=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:r.jsxRuntimeExports.jsx(En,{id:e,value:s,onBlur:d=>n(e,d),onChange:d=>o(d),modules:l,formats:a,placeholder:t,className:"mt-1 rounded-md"})},ka=({schema:e,formData:t,onChange:s})=>{const[o,n]=N.useState([]),l=me("getPages",()=>[]),{type:a="page",href:d="",target:g="self"}=t;return N.useEffect(()=>{(async()=>{const c=await l();n(c||[])})()},[]),r.jsxRuntimeExports.jsxs("div",{children:[r.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(e==null?void 0:e.title)??"Link"}),r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[r.jsxRuntimeExports.jsx("select",{name:"type",value:a,onChange:c=>s({...t,type:c.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(c=>r.jsxRuntimeExports.jsx("option",{value:c.const,children:c.title},c.const))}),a==="page"?r.jsxRuntimeExports.jsxs("select",{name:"href",placeholder:"Choose Page",value:d,onChange:c=>s({...t,href:c.target.value}),children:[r.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),i.map(o,c=>r.jsxRuntimeExports.jsx("option",{value:c.slug,children:c.name},c.uuid))]}):r.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:d,onChange:c=>s({...t,href:c.target.value}),placeholder:a==="page"||a==="url"?"Enter URL":a==="scroll"?"#ElementID":"Enter detail"}),(a==="page"||a==="url")&&r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[r.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:g==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>s({...t,target:g==="_blank"?"_self":"_blank"})}),r.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})},Na=()=>{const[e]=de(),[,t]=be(),{addBlocks:s}=ne(),{toast:o}=ot(),n=N.useCallback((a,d,g)=>{var S;for(let I=0;I<a.length;I++){const{_id:D}=a[I];a[I]._id=oe.generateUUID();const q=i.filter(a,{_parent:D});for(let $=0;$<q.length;$++)q[$]._parent=a[I]._id}const c=i.first(a);let x,v;return d&&(x=i.find(e,{_id:d}),a[0]._parent=d,v=d),!(x?mt(x._type,c._type):!0)&&x&&(a[0]._parent=x._parent,v=x._parent),s(a,v,g),t([(S=i.first(a))==null?void 0:S._id]),i.first(a)},[e,t]);return{addCoreBlock:N.useCallback((a,d,g)=>{if(i.has(a,"blocks")){const $=a.blocks;return n($,d,g)}const c=oe.generateUUID(),x=Dt(a.props),v=[];i.forIn(x,($,G)=>{if(i.startsWith($,W.SLOT_KEY)){const V=$.replace(W.SLOT_KEY,"");v.push({_id:V,_type:"Slot",_parent:c,_name:a.props[G].name,_styles:a.props[G].styles,_emptyStyles:a.props[G].emptyStyles})}});const R={_type:a.type,_id:c,...x};let S,I;if(d&&(S=i.find(e,{_id:d}),R._parent=d,I=d),!At(S==null?void 0:S._type,a.type)){o({variant:"destructive",title:"Error",description:`"${a.type}" cannot be added under "${S._type}"`});return}!(S?mt(S._type,a.type):!0)&&S&&(R._parent=S._parent,I=S._parent);const q=[R,...v];return s(q,I,g),t([R._id]),R},[n,e,t]),addPredefinedBlock:n}},xt={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},gt=["xs","sm","md","lg","xl","2xl"];function Sa(e,t){if(t===null)return"baseClasses";const s=t.mq;if(s==="xs"||t.dark||t.mod!=="")return"classes";let o="baseClasses",n=gt.indexOf(s);for(;n>0;){const l=gt[n-1];if(i.find(e,{mq:l,property:t.property})){o="classes";break}n--}return o}const ht=[];function Ea(e="",t="",s=[]){e=e.trim().replace(/ +/g,"");let o=i.filter(i.map(e.split(" "),u.constructClassObject),c=>!i.isNull(c)),n=i.filter(i.map(t.split(" "),u.constructClassObject),c=>!i.isNull(c));n=i.filter(n,c=>!i.includes(ht,c.property));const l=[],a=[];i.each(s,c=>{const x=u.constructClassObject(c),v=i.find(o,i.pick(x,["dark","mq","mod","property"]));if(v&&(o=i.filter(o,R=>R.fullCls!==(v==null?void 0:v.fullCls))),l.push(x),x.mq==="xs"&&!x.dark&&x.mod===""&&(n=i.filter(n,R=>R.property!==x.property)),Sa(o,x)==="baseClasses"&&!i.includes(ht,x.property)){const R=i.find(n,i.pick(x,["property"]));v&&(n=i.filter(n,S=>S.fullCls!==(R==null?void 0:R.fullCls))),a.push({...x,fullCls:x.cls,mq:"xs"})}});const d=i.map(i.sortBy([...o,...l],c=>xt[c.mq]),"fullCls").join(" ");return`${i.map(i.sortBy([...n,...a],c=>xt[c.mq]),"fullCls").join(" ").trim()},${d.trim()}`.trim().replace(/ +/g,"")}const ve=p.atom([]);ve.debugLabel="selectedStylingBlocksAtom";const Do=()=>p.useAtom(ve),Ca=e=>{const t=e.replace(W.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},Aa=p.atom(null,(e,t,{blockIds:s,newClasses:o})=>{const n=i.filter(e(qe),a=>s.includes(e(a)._id)),l=i.first(e(ve));return i.map(n,a=>{const d=e(a),g=i.get(d,l.prop,`${W.STYLES_KEY},`),{baseClasses:c,classes:x}=Ca(g);return{ids:[d._id],props:{[l.prop]:`${W.STYLES_KEY}${Ea(x,c,o)}`}}})}),Ba=()=>{const e=p.useSetAtom(Aa),{updateBlocks:t,updateBlocksRuntime:s}=ne();return N.useCallback((o,n,l=!1)=>{const a=e({blockIds:o,newClasses:n});if(!l){s(o,a[0].props);return}t(o,a[0].props)},[e])},Oo=()=>p.useAtom(Mt),Lo=fe("canvasWidth",800),zo=p.atom(e=>{const t=e(Lo);return oe.getBreakpointValue(t).toLowerCase()}),_a=()=>{const[e,t]=p.useAtom(Lo),s=p.useAtomValue(zo),[o,n]=Oo();return N.useEffect(()=>{o!=="xs"&&n(s)},[s,o,n]),[e,s,t]},Ta=fe("canvasZoom",100),Pa=()=>p.useAtom(Ta),Vo=p.atom([]),Fo=()=>{const[e,t]=p.useAtom(Vo),s=p.useSetAtom(rt),o=N.useCallback(n=>{t(n),s([])},[t,s]);return[e,o]},rt=p.atom([]),Ia=()=>{const[e,t]=p.useAtom(rt),s=p.useSetAtom(Vo),o=N.useCallback(n=>{t(n),s([])},[t,s]);return[e,o]},Uo=fe("darkMode",!1),Ma=()=>{const[e,t]=p.useAtom(Uo);return[e,t]},qo=()=>{const[e]=de(),[,t]=be(),{addBlocks:s}=ne();return N.useCallback((o,n=null)=>{const l=[];i.each(o,a=>{const d=e.find(R=>R._id===a);n||(n=d._parent);const x=i.filter(e,R=>i.isString(n)?R._parent===n:!d._parent).indexOf(d)+1,v=er(e,a,n);s(v,n,x),l.push(i.get(v,"0._id",""))}),t(l)},[e,t])},Da=p.atom([]),Oa=()=>{const[e,t]=p.useAtom(Da),s=N.useCallback(o=>{t(n=>i.includes(n,o)?i.without(n,o):[...n,o])},[t]);return[e,t,s]},La=p.atom(""),$o=()=>p.useAtom(La),za=()=>{const e=p.useAtomValue(ee);return N.useCallback((t,s)=>{const o=i.map(e,n=>(i.includes(t,i.get(n,"_id"))&&i.set(n,"_parent",s),n));console.log("newBlocks",o)},[e])},Va=()=>{console.warn("usePasteBlocks is not implemented");const e=p.useAtomValue(rt),[t,s]=Fo(),o=qo(),n=za();return{canPaste:N.useMemo(()=>t.length>0||e.length>0,[e,t]),pasteBlocks:N.useCallback(a=>{i.isEmpty(e)?n(t,a):o(e,a),s(()=>[])},[t,e,o,n,s])}},Fa=p.atom(!1),Ua=()=>{const[e,t]=p.useAtom(Fa);return[e,t]},qa=p.atom(null,(e,t,{blockIds:s,fullClasses:o})=>{const n=i.first(e(ve)),l=i.filter(e(qe),a=>s.includes(e(a)._id));return i.map(l,a=>{const d=e(a),g=o;let{classes:c,baseClasses:x}=Yn(i.get(d,n.prop,"styles:,"));return i.each(g,v=>{const R=new RegExp(`(^| )${v.replace("[","\\[").replace("]","\\]")}($| )`,"g");c=c.replace(R," ").replace(/ +/g," ").trim();const S=i.first(v.split(":"));i.includes(["2xl","xl","lg","md","sm"],S)&&g.push(v.split(":").pop().trim())}),i.each(g,v=>{const R=new RegExp(`(^| )${v.replace("[","\\[").replace("]","\\]")}($| )`,"g");x=x.replace(R," ").replace(/ +/g," ").trim()}),{ids:[d._id],props:{[n.prop]:`${W.STYLES_KEY}${x},${c}`}}})}),$a=()=>{const{updateBlocks:e}=ne(),t=p.useSetAtom(qa);return N.useCallback((s,o)=>{const n=t({blockIds:s,fullClasses:o});e(s,n[0].props)},[t])},Go=p.atom(e=>{const t=i.first(e(ve)),s=e(We);if(!t||t.blockId!==i.get(s,"_id",null))return[];const n=i.get(s,t.prop,`${W.STYLES_KEY},`).replace(W.STYLES_KEY,"").split(",").join(" ");return i.filter(i.map(n.trim().split(" "),u.constructClassObject),l=>!i.isNull(l))}),Ga=()=>p.useAtomValue(Go),bt={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},Wa=p.atom(e=>{const t=e(zo),s=e(He),o=e(Uo),n=Ha(t);let l=i.filter(e(Go),{mod:s});return i.startsWith(s,"_")||(l=i.filter(l,a=>n.includes(a.mq))),l=l.sort((a,d)=>bt[a.mq]-bt[d.mq]),o||(l=i.filter(l,{dark:!1})),l}),Ha=e=>{let t=[];switch(e){case"xs":t=["xs"];break;case"sm":t=["xs","sm"];break;case"md":t=["xs","sm","md"];break;case"lg":t=["xs","sm","md","lg"];break;case"xl":t=["xs","sm","md","lg","xl"];break;case"2xl":t=["xs","sm","md","lg","xl","2xl"];break;default:t=["xs"];break}return t},Ya=()=>p.useAtomValue(Wa),Ka=()=>p.useAtom(He),Ja=()=>{const{updateBlocks:e}=ne();return N.useCallback((t,s,o)=>{e(t,s,o)},[e])},Qa=()=>{const{updateBlocksRuntime:e}=ne();return N.useCallback((t,s)=>{e(t,s)},[e])},Wo={name:"",props:{},modalProps:{},backdropClose:!0},Xa=p.atom(Wo),Za=()=>{const[e,t]=p.useAtom(Xa),s=N.useCallback((n,l={},a={})=>{t({name:n,props:l,modalProps:a})},[t]),o=N.useCallback((...n)=>{i.get(e,"props.onClose",()=>{})(...n),t(Wo)},[t,e]);return{activeModal:e,openModal:s,closeModal:o}},ei=()=>(console.warn("useAllBlocks is deprecated, use useBlocksStore() instead"),p.useAtomValue(ee)),Ho=p.atom(!1);Ho.debugLabel="readOnlyModeAtom";const Yo=p.atom(!1);Yo.debugLabel="advanceStylingOpenAtom";const Ko=p.atom("online");Ko.debugLabel="networkModeAtom";const ti=p.atom(!1);ti.debugLabel="codeEditorOpenAtom";const Jo=p.atom(!1);Jo.debugLabel="editLayerNameAtom";const si=p.atom("");si.debugLabel="activeLanguageAtom";const oi=p.atom("");oi.debugLabel="primaryLanguageAtom";const Qo=p.atom(null);Qo.debugLabel="canvasIframeAtom";const Xo=p.atom("layers");Xo.debugLabel="activePanelAtom";const Zo=p.atom("");Zo.debugLabel="showPredefinedBlockCategoryAtom";const en=p.atom({undoCount:0,redoCount:0});en.debugLabel="historyStatesAtom";const tn=p.atom("");tn.debugLabel="inlineEditingActiveAtom";const sn=p.atom(!1);sn.debugLabel="draggingFlagAtom";const on=p.atom("");on.debugLabel="draggedBlockIdAtom";const ni=()=>p.useAtomValue(Ho),ri=p.atom(""),ai=p.atom(null),ii=()=>p.useAtom(ri),li=()=>p.useAtom(ai),ci=fe("selectedBreakpoints",["XS","MD","XL"]),di=()=>{const[e,t]=p.useAtom(ci);return[e,t]},ui=()=>{const e=p.useSetAtom(en),{clear:t}=Xe(),[,s]=be(),[,o]=$o(),[,n]=Do();return()=>{s([]),n([]),o(""),t(),e({undoCount:0,redoCount:0})}},mi=p.atom([]),pi=()=>{const[e,t]=N.useState(!1),[s,o]=p.useAtom(mi),n=me("getUILibraryBlocks",()=>[]);return N.useEffect(()=>{(async()=>s.length>0||(t(!0),o(await n()),t(!1)))()},[]),{data:s,isLoading:e}};exports.Accordion=kr;exports.AccordionContent=Qt;exports.AccordionItem=Kt;exports.AccordionTrigger=Jt;exports.Alert=Xt;exports.AlertDescription=es;exports.AlertDialog=Er;exports.AlertDialogAction=cs;exports.AlertDialogCancel=ds;exports.AlertDialogContent=ns;exports.AlertDialogDescription=ls;exports.AlertDialogFooter=as;exports.AlertDialogHeader=rs;exports.AlertDialogTitle=is;exports.AlertDialogTrigger=Cr;exports.AlertTitle=Zt;exports.Badge=Sr;exports.Button=Yt;exports.Card=bs;exports.CardContent=ws;exports.CardDescription=js;exports.CardFooter=Rs;exports.CardHeader=vs;exports.CardTitle=ys;exports.Command=nt;exports.CommandDialog=da;exports.CommandEmpty=jo;exports.CommandGroup=wo;exports.CommandInput=vo;exports.CommandItem=ko;exports.CommandList=yo;exports.CommandSeparator=Ro;exports.CommandShortcut=No;exports.ContextMenu=ua;exports.ContextMenuCheckboxItem=Bo;exports.ContextMenuContent=Co;exports.ContextMenuGroup=pa;exports.ContextMenuItem=Ao;exports.ContextMenuLabel=To;exports.ContextMenuPortal=fa;exports.ContextMenuRadioGroup=ga;exports.ContextMenuRadioItem=_o;exports.ContextMenuSeparator=Po;exports.ContextMenuShortcut=Io;exports.ContextMenuSub=xa;exports.ContextMenuSubContent=Eo;exports.ContextMenuSubTrigger=So;exports.ContextMenuTrigger=ma;exports.Dialog=et;exports.DialogContent=Be;exports.DialogDescription=hs;exports.DialogFooter=xs;exports.DialogHeader=fs;exports.DialogTitle=gs;exports.DialogTrigger=us;exports.DropdownMenu=Jr;exports.DropdownMenuCheckboxItem=ro;exports.DropdownMenuContent=oo;exports.DropdownMenuGroup=Xr;exports.DropdownMenuItem=no;exports.DropdownMenuLabel=io;exports.DropdownMenuPortal=Zr;exports.DropdownMenuRadioGroup=ta;exports.DropdownMenuRadioItem=ao;exports.DropdownMenuSeparator=lo;exports.DropdownMenuShortcut=co;exports.DropdownMenuSub=ea;exports.DropdownMenuSubContent=so;exports.DropdownMenuSubTrigger=to;exports.DropdownMenuTrigger=Qr;exports.HoverCard=Fr;exports.HoverCardContent=Us;exports.HoverCardTrigger=Ur;exports.IconPickerField=ba;exports.ImagePickerField=wa;exports.ImagesPanel=ja;exports.Input=ks;exports.Label=Ns;exports.LinkField=ka;exports.Menubar=_s;exports.MenubarCheckboxItem=Os;exports.MenubarContent=Ms;exports.MenubarGroup=Or;exports.MenubarItem=Ds;exports.MenubarLabel=zs;exports.MenubarMenu=Dr;exports.MenubarPortal=Lr;exports.MenubarRadioGroup=Vr;exports.MenubarRadioItem=Ls;exports.MenubarSeparator=Vs;exports.MenubarShortcut=Fs;exports.MenubarSub=zr;exports.MenubarSubContent=Is;exports.MenubarSubTrigger=Ps;exports.MenubarTrigger=Ts;exports.Popover=Ir;exports.PopoverContent=Bs;exports.PopoverTrigger=Mr;exports.RichTextEditorField=Ra;exports.ScrollArea=Es;exports.ScrollBar=tt;exports.Select=qr;exports.SelectContent=$s;exports.SelectGroup=$r;exports.SelectItem=Ws;exports.SelectLabel=Gs;exports.SelectSeparator=Hs;exports.SelectTrigger=qs;exports.SelectValue=Gr;exports.Separator=uo;exports.Sheet=Wr;exports.SheetClose=Yr;exports.SheetContent=Js;exports.SheetDescription=eo;exports.SheetFooter=Xs;exports.SheetHeader=Qs;exports.SheetTitle=Zs;exports.SheetTrigger=Hr;exports.Skeleton=ca;exports.Switch=Ht;exports.Tabs=Cs;exports.TabsContent=Ne;exports.TabsList=st;exports.TabsTrigger=ke;exports.Textarea=Ss;exports.Toaster=la;exports.Toggle=Wt;exports.Tooltip=Tr;exports.TooltipContent=As;exports.TooltipPortal=Br;exports.TooltipProvider=_r;exports.TooltipTrigger=Pr;exports.activePanelAtom=Xo;exports.advanceStylingOpenAtom=Yo;exports.atom=X;exports.atomWithDefault=qn;exports.atomWithStorage=fe;exports.badgeVariants=ts;exports.buttonVariants=Ae;exports.canDeleteBlock=Jn;exports.canDropBlock=Qn;exports.canDuplicateBlock=Kn;exports.canvasIframeAtom=Qo;exports.chaiBuilderPropsAtom=Ue;exports.chaiExternalDataAtom=Ct;exports.createStore=kt;exports.dataProvidersAtom=Qe;exports.draggedBlockIdAtom=on;exports.draggingFlagAtom=sn;exports.editLayerNameAtom=Jo;exports.getBlockJSONFromSchemas=Le;exports.getBlockJSONFromUISchemas=Oe;exports.inlineEditingActiveAtom=tn;exports.isDevelopment=Hn;exports.networkModeAtom=Ko;exports.pageSyncStateAtom=Ce;exports.presentBlocksAtom=ee;exports.reducer=mo;exports.showPredefinedBlockCategoryAtom=Zo;exports.toast=po;exports.toggleVariants=Gt;exports.useActiveModal=Za;exports.useActivePanel=ii;exports.useAddBlock=Na;exports.useAddBlockParent=li;exports.useAddClassesToBlocks=Ba;exports.useAllBlocks=ei;exports.useAtom=On;exports.useAtomValue=Nt;exports.useBlocksContainer=xr;exports.useBlocksStore=de;exports.useBlocksStoreUndoableActions=ne;exports.useBrandingOptions=Ot;exports.useBuilderProp=me;exports.useBuilderReset=ui;exports.useCanvasWidth=_a;exports.useCanvasZoom=Pa;exports.useCopyBlockIds=Ia;exports.useCurrentPage=Lt;exports.useCutBlockIds=Fo;exports.useDarkMode=Ma;exports.useDuplicateBlocks=qo;exports.useGetPageData=qt;exports.useHiddenBlockIds=Oa;exports.useHighlightBlockId=$o;exports.usePageDataProviders=$t;exports.usePasteBlocks=Va;exports.usePreviewMode=Ua;exports.useReadOnlyMode=ni;exports.useRemoveBlocks=jr;exports.useRemoveClassesFromBlocks=$a;exports.useSavePage=yr;exports.useSelectedBlock=lr;exports.useSelectedBlockAllClasses=Ga;exports.useSelectedBlockCurrentClasses=Ya;exports.useSelectedBlockIds=be;exports.useSelectedBlocksDisplayChild=ir;exports.useSelectedBreakpoints=di;exports.useSelectedStylingBlocks=Do;exports.useSetAtom=St;exports.useStore=Ve;exports.useStylingBreakpoint=Oo;exports.useStylingState=Ka;exports.useToast=ot;exports.useUILibraryBlocks=pi;exports.useUndoManager=Xe;exports.useUpdateBlocksProps=Ja;exports.useUpdateBlocksPropsRealtime=Qa;
|
|
1
|
+
"use strict";const k=require("react"),i=require("lodash-es"),oe=require("./Functions-N3yhPYKY.cjs"),Se=require("@chaibuilder/runtime"),p=require("jotai"),vt=require("flat-to-nested"),W=require("./MODIFIERS-2FeVfZQ9.cjs"),rn=require("./_commonjsHelpers-wDK0ZLPo.cjs"),an=require("@react-hookz/web"),r=require("./jsx-runtime-Z_BpKhVy.cjs"),ln=require("@radix-ui/react-toggle"),le=require("class-variance-authority"),u=require("./Class-5ARpH_Tu.cjs"),cn=require("@radix-ui/react-switch"),dn=require("@radix-ui/react-slot"),un=require("@radix-ui/react-accordion"),F=require("@radix-ui/react-icons"),mn=require("@radix-ui/react-alert-dialog"),pn=require("@radix-ui/react-dialog"),fn=require("@radix-ui/react-label"),xn=require("@radix-ui/react-scroll-area"),gn=require("@radix-ui/react-tabs"),hn=require("@radix-ui/react-tooltip"),bn=require("@radix-ui/react-popover"),vn=require("@radix-ui/react-menubar"),yn=require("@radix-ui/react-hover-card"),jn=require("@radix-ui/react-select"),wn=require("@radix-ui/react-dropdown-menu"),Rn=require("@radix-ui/react-separator"),kn=require("@radix-ui/react-toast"),H=require("cmdk"),Nn=require("@radix-ui/react-context-menu"),yt=require("react-icons-picker"),Sn=require("react-dom"),Cn=require("react-quill");require("react-i18next");function L(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const f=L(k),jt=L(ln),De=L(cn),ie=L(un),U=L(mn),_=L(pn),wt=L(fn),ae=L(xn),ce=L(gn),pe=L(hn),he=L(bn),A=L(vn),Ce=L(yn),O=L(jn),T=L(wn),Rt=L(Rn),K=L(kn),P=L(Nn);var z={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let En=0;function X(e,t){const s=`atom${++En}`,o={toString:()=>s};return typeof e=="function"?o.read=e:(o.init=e,o.read=n=>n(o),o.write=(n,l,a)=>l(o,typeof a=="function"?a(n(o)):a)),t&&(o.write=t),o}const _e=e=>"init"in e,Te=e=>!!e.write,Re=new WeakMap,An=(e,t)=>{Re.set(e,t),e.catch(()=>{}).finally(()=>Re.delete(e))},at=(e,t)=>{const s=Re.get(e);s&&(Re.delete(e),s(t))},it=(e,t)=>{e.status="fulfilled",e.value=t},lt=(e,t)=>{e.status="rejected",e.reason=t},Bn=e=>typeof(e==null?void 0:e.then)=="function",xe=(e,t)=>"v"in e&&"v"in t&&Object.is(e.v,t.v),ct=(e,t)=>"e"in e&&"e"in t&&Object.is(e.e,t.e),ue=e=>"v"in e&&e.v instanceof Promise,_n=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,ye=e=>{if("e"in e)throw e.e;return e.v},kt=()=>{const e=new WeakMap,t=new WeakMap,s=new Map;let o,n,l;(z?"production":void 0)!=="production"&&(o=new Set,n=new Set,l=new Set);const a=m=>e.get(m),d=(m,h)=>{(z?"production":void 0)!=="production"&&Object.freeze(h);const j=e.get(m);if(e.set(m,h),s.has(m)||s.set(m,j),j&&ue(j)){const b="v"in h?h.v instanceof Promise?h.v:Promise.resolve(h.v):Promise.reject(h.e);at(j.v,b)}},g=(m,h,j)=>{const b=new Map;let w=!1;j.forEach((y,S)=>{!y&&S===m&&(y=h),y?(b.set(S,y),h.d.get(S)!==y&&(w=!0)):(z?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(w||h.d.size!==b.size)&&(h.d=b)},c=(m,h,j)=>{const b=a(m),w={d:(b==null?void 0:b.d)||new Map,v:h};if(j&&g(m,w,j),b&&xe(b,w)&&b.d===w.d)return b;if(b&&ue(b)&&ue(w)&&_n(b,w)){if(b.d===w.d)return b;w.v=b.v}return d(m,w),w},x=(m,h,j,b)=>{if(Bn(h)){let w;const y=new Promise((S,M)=>{let C=!1;h.then(B=>{if(!C){C=!0;const E=a(m),Q=c(m,y,j);it(y,B),S(B),(E==null?void 0:E.d)!==Q.d&&Y(m,Q,E==null?void 0:E.d)}},B=>{if(!C){C=!0;const E=a(m),Q=c(m,y,j);lt(y,B),M(B),(E==null?void 0:E.d)!==Q.d&&Y(m,Q,E==null?void 0:E.d)}}),w=B=>{C||(C=!0,B.then(E=>it(y,E),E=>lt(y,E)),S(B))}});return y.orig=h,y.status="pending",An(y,S=>{S&&w(S),b==null||b()}),c(m,y,j)}return c(m,h,j)},v=(m,h,j)=>{const b=a(m),w={d:(b==null?void 0:b.d)||new Map,e:h};return j&&g(m,w,j),b&&ct(b,w)&&b.d===w.d?b:(d(m,w),w)},R=m=>{const h=a(m);if(h&&(h.d.forEach((C,B)=>{B!==m&&!t.has(B)&&R(B)}),Array.from(h.d).every(([C,B])=>{const E=a(C);return C===m||E===B||E&&!ue(E)&&xe(E,B)})))return h;const j=new Map;let b=!0;const w=C=>{if(C===m){const E=a(C);if(E)return j.set(C,E),ye(E);if(_e(C))return j.set(C,void 0),C.init;throw new Error("no atom init")}const B=R(C);return j.set(C,B),ye(B)};let y,S;const M={get signal(){return y||(y=new AbortController),y.signal},get setSelf(){return(z?"production":void 0)!=="production"&&!Te(m)&&console.warn("setSelf function cannot be used with read-only atom"),!S&&Te(m)&&(S=(...C)=>{if((z?"production":void 0)!=="production"&&b&&console.warn("setSelf function cannot be called in sync"),!b)return V(m,...C)}),S}};try{const C=m.read(w,M);return x(m,C,j,()=>y==null?void 0:y.abort())}catch(C){return v(m,C,j)}finally{b=!1}},N=m=>ye(R(m)),I=m=>{let h=t.get(m);return h||(h=J(m)),h},D=(m,h)=>!h.l.size&&(!h.t.size||h.t.size===1&&h.t.has(m)),q=m=>{const h=t.get(m);h&&D(m,h)&&re(m)},$=m=>{const h=new Map,j=new WeakMap,b=y=>{const S=t.get(y);S==null||S.t.forEach(M=>{M!==y&&(h.set(M,(h.get(M)||new Set).add(y)),j.set(M,(j.get(M)||0)+1),b(M))})};b(m);const w=y=>{const S=t.get(y);S==null||S.t.forEach(M=>{var C;if(M!==y){let B=j.get(M);if(B&&j.set(M,--B),!B){let E=!!((C=h.get(M))!=null&&C.size);if(E){const Q=a(M),nn=R(M);E=!Q||!xe(Q,nn)}E||h.forEach(Q=>Q.delete(M))}w(M)}})};w(m)},G=(m,...h)=>{let j=!0;const b=S=>ye(R(S)),w=(S,...M)=>{let C;if(S===m){if(!_e(S))throw new Error("atom not writable");const B=a(S),E=x(S,M[0]);(!B||!xe(B,E))&&$(S)}else C=G(S,...M);if(!j){const B=te();(z?"production":void 0)!=="production"&&n.forEach(E=>E({type:"async-write",flushed:B}))}return C},y=m.write(b,w,...h);return j=!1,y},V=(m,...h)=>{const j=G(m,...h),b=te();return(z?"production":void 0)!=="production"&&n.forEach(w=>w({type:"write",flushed:b})),j},J=(m,h)=>{const j={t:new Set(h&&[h]),l:new Set};if(t.set(m,j),(z?"production":void 0)!=="production"&&l.add(m),R(m).d.forEach((b,w)=>{const y=t.get(w);y?y.t.add(m):w!==m&&J(w,m)}),R(m),Te(m)&&m.onMount){const b=m.onMount((...w)=>V(m,...w));b&&(j.u=b)}return j},re=m=>{var h;const j=(h=t.get(m))==null?void 0:h.u;j&&j(),t.delete(m),(z?"production":void 0)!=="production"&&l.delete(m);const b=a(m);b?(ue(b)&&at(b.v),b.d.forEach((w,y)=>{if(y!==m){const S=t.get(y);S&&(S.t.delete(m),D(y,S)&&re(y))}})):(z?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",m)},Y=(m,h,j)=>{const b=new Set(h.d.keys());j==null||j.forEach((w,y)=>{if(b.has(y)){b.delete(y);return}const S=t.get(y);S&&(S.t.delete(m),D(y,S)&&re(y))}),b.forEach(w=>{const y=t.get(w);y?y.t.add(m):t.has(m)&&J(w,m)})},te=()=>{let m;for((z?"production":void 0)!=="production"&&(m=new Set);s.size;){const h=Array.from(s);s.clear(),h.forEach(([j,b])=>{const w=a(j);if(w){w.d!==(b==null?void 0:b.d)&&Y(j,w,b==null?void 0:b.d);const y=t.get(j);y&&!(b&&!ue(b)&&(xe(b,w)||ct(b,w)))&&(y.l.forEach(S=>S()),(z?"production":void 0)!=="production"&&m.add(j))}else(z?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((z?"production":void 0)!=="production")return o.forEach(h=>h("state")),m},se=(m,h)=>{const j=I(m),b=te(),w=j.l;return w.add(h),(z?"production":void 0)!=="production"&&(o.forEach(y=>y("sub")),n.forEach(y=>y({type:"sub",flushed:b}))),()=>{w.delete(h),q(m),(z?"production":void 0)!=="production"&&(o.forEach(y=>y("unsub")),n.forEach(y=>y({type:"unsub"})))}};return(z?"production":void 0)!=="production"?{get:N,set:V,sub:se,dev_subscribe_store:(m,h)=>h!==2?(console.warn("The current StoreListener revision is 2. The older ones are deprecated."),o.add(m),()=>{o.delete(m)}):(n.add(m),()=>{n.delete(m)}),dev_get_mounted_atoms:()=>l.values(),dev_get_atom_state:m=>e.get(m),dev_get_mounted:m=>t.get(m),dev_restore_atoms:m=>{for(const[j,b]of m)_e(j)&&(x(j,b),$(j));const h=te();n.forEach(j=>j({type:"restore",flushed:h}))}}:{get:N,set:V,sub:se}};let Pe;const Tn=()=>(Pe||(Pe=kt()),Pe);var Pn={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const In=k.createContext(void 0),Ve=e=>{const t=k.useContext(In);return(e==null?void 0:e.store)||t||Tn()};const Mn=e=>typeof(e==null?void 0:e.then)=="function",Dn=k.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)});function Nt(e,t){const s=Ve(t),[[o,n,l],a]=k.useReducer(c=>{const x=s.get(e);return Object.is(c[0],x)&&c[1]===s&&c[2]===e?c:[x,s,e]},void 0,()=>[s.get(e),s,e]);let d=o;(n!==s||l!==e)&&(a(),d=s.get(e));const g=t==null?void 0:t.delay;return k.useEffect(()=>{const c=s.sub(e,()=>{if(typeof g=="number"){setTimeout(a,g);return}a()});return a(),c},[s,e,g]),k.useDebugValue(d),Mn(d)?Dn(d):d}function St(e,t){const s=Ve(t);return k.useCallback((...n)=>{if((Pn?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return s.set(e,...n)},[s,e])}function On(e,t){return[Nt(e,t),St(e,t)]}var Fe={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Ct=Symbol();const dt=(e,t,s)=>(t.has(s)?t:t.set(s,e())).get(s),Ln=new WeakMap,zn=(e,t,s)=>{const o=dt(()=>new WeakMap,Ln,t);return dt(e,o,s)},Vn={},ut=e=>!!e.write,Fn=e=>typeof e=="function";function Un(e,t){return zn(()=>{const s=new WeakMap,o=(a,d)=>{let g=s.get(a);if(g)return g;const c=d&&s.get(d),x=[],v=[];return a.forEach((R,N)=>{const I=t?t(R):N;v[N]=I;const D=c&&c.atomList[c.keyList.indexOf(I)];if(D){x[N]=D;return}const q=G=>{const V=G(n),J=G(e),Y=o(J,V==null?void 0:V.arr).keyList.indexOf(I);if(Y<0||Y>=J.length){const te=a[o(a).keyList.indexOf(I)];if(te)return te;throw new Error("splitAtom: index out of bounds for read")}return J[Y]},$=(G,V,J)=>{const re=G(n),Y=G(e),se=o(Y,re==null?void 0:re.arr).keyList.indexOf(I);if(se<0||se>=Y.length)throw new Error("splitAtom: index out of bounds for write");const m=Fn(J)?J(Y[se]):J;V(e,[...Y.slice(0,se),m,...Y.slice(se+1)])};x[N]=ut(e)?X(q,$):X(q)}),c&&c.keyList.length===v.length&&c.keyList.every((R,N)=>R===v[N])?g=c:g={arr:a,atomList:x,keyList:v},s.set(a,g),g},n=X(a=>{const d=a(n),g=a(e);return o(g,d==null?void 0:d.arr)});(Fe?"production":void 0)!=="production"&&(n.debugPrivate=!0),n.init=void 0;const l=ut(e)?X(a=>a(n).atomList,(a,d,g)=>{switch(g.type){case"remove":{const c=a(l).indexOf(g.atom);if(c>=0){const x=a(e);d(e,[...x.slice(0,c),...x.slice(c+1)])}break}case"insert":{const c=g.before?a(l).indexOf(g.before):a(l).length;if(c>=0){const x=a(e);d(e,[...x.slice(0,c),g.value,...x.slice(c)])}break}case"move":{const c=a(l).indexOf(g.atom),x=g.before?a(l).indexOf(g.before):a(l).length;if(c>=0&&x>=0){const v=a(e);c<x?d(e,[...v.slice(0,c),...v.slice(c+1,x),v[c],...v.slice(x)]):d(e,[...v.slice(0,x),v[c],...v.slice(x,c),...v.slice(c+1)])}break}}}):X(a=>a(n).atomList);return l},e,t||Vn)}function qn(e){const t=Symbol(),s=X(t);(Fe?"production":void 0)!=="production"&&(s.debugPrivate=!0);const o=X((n,l)=>{const a=n(s);return a!==t?a:e(n,l)},(n,l,a)=>{if(a===Ct)l(s,t);else if(typeof a=="function"){const d=n(o);l(s,a(d))}else l(s,a)});return o}const $n=e=>typeof(e==null?void 0:e.then)=="function";function Gn(e){let t,s;const o={getItem:(n,l)=>{var a,d;const g=x=>{if(x=x||"",t!==x){try{s=JSON.parse(x)}catch{return l}t=x}return s},c=(d=(a=e())==null?void 0:a.getItem(n))!=null?d:null;return $n(c)?c.then(g):g(c)},setItem:(n,l)=>{var a;return(a=e())==null?void 0:a.setItem(n,JSON.stringify(l))},removeItem:n=>{var l;return(l=e())==null?void 0:l.removeItem(n)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(o.subscribe=(n,l,a)=>{if(!(e()instanceof window.Storage))return()=>{};const d=g=>{if(g.storageArea===e()&&g.key===n){let c;try{c=JSON.parse(g.newValue||"")}catch{c=a}l(c)}};return window.addEventListener("storage",d),()=>{window.removeEventListener("storage",d)}}),o}const Wn=Gn(()=>typeof window<"u"?window.localStorage:void 0);function fe(e,t,s=Wn,o){const n=o==null?void 0:o.unstable_getOnInit,l=X(n?s.getItem(e,t):t);return(Fe?"production":void 0)!=="production"&&(l.debugPrivate=!0),l.onMount=d=>{n||d(s.getItem(e,t));let g;return s.subscribe&&(g=s.subscribe(e,d,t)),g},X(d=>d(l),(d,g,c)=>{const x=typeof c=="function"?c(d(l)):c;return x===Ct?(g(l,t),s.removeItem(e)):x instanceof Promise?x.then(v=>(g(l,v),s.setItem(e,v))):(g(l,x),s.setItem(e,x))})}const Ue=p.atom(null);Ue.debugLabel="chaiBuilderPropsAtom";const Et=p.atom({});Et.debugLabel="chaiExternalDataAtom";const Hn=()=>!1,Yn=e=>{const t=e.replace(W.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},mt=(e,t)=>{if(!e)return!0;const s=Se.getBlockComponent(e);return s&&i.has(s,"canAcceptBlock")?s.canAcceptBlock(t):!1},At=(e,t)=>{const s=Se.getBlockComponent(t);return s&&i.has(s,"canBeNested")?s.canBeNested(e):!0},Kn=e=>{const t=Se.getBlockComponent(e);return t&&i.has(t,"canDuplicate")?t.canDuplicate():!0},Jn=e=>{const t=Se.getBlockComponent(e);return t&&i.has(t,"canDelete")?t.canDelete():!0},Qn=(e,{dragSource:t,dropTarget:s})=>{const o=i.get(t,"data._type",""),n=i.get(s,"data._type","");return At(n,o)};const Xn=new vt({children:"blockNodes"});function Bt(e,t,s){const o=i.filter(e,l=>l._parent===t),n=[];for(let l=0;l<o.length;l++){const a=_t(o[l]);if(Object.keys(a).length>0&&Object.keys(a).forEach(d=>{o[l][d]=`slot:${oe.generateUUID()}`}),i.filter(e,{_parent:o[l]._id}).length>0){const d=oe.generateUUID();n.push({...o[l],oldId:o[l]._id,_id:d,_parent:s}),n.push(i.flatten(Bt(e,o[l]._id,d)))}else n.push({...o[l],oldId:o[l]._id,_id:oe.generateUUID(),_parent:s})}return i.flatten(n)}function Zn(e){let t=Xn.convert(e.map(s=>i.omit(s,["settings"])));return t=!t.type&&t.blockNodes?t.blockNodes:i.isEmpty(t)?[]:[t],t}const _t=e=>{const t={};return Object.keys(e).forEach(s=>{i.isString(e[s])&&e[s].startsWith("slot")&&(t[s]=e[s].replace("slot:",""))}),t},er=(e,t,s=null)=>{let o=i.find(e,{_id:t});o={...o,oldId:o._id,_id:oe.generateUUID()},s&&(o={...o,_parent:s});const n=[o];i.filter(e,{_parent:t}).length>0&&n.push(i.flatten(Bt(e,t,o._id)));const l=i.flatten(n);return i.map(l,a=>{const d=a,g=_t(d);return Object.keys(g).length>0&&Object.keys(g).forEach(c=>{const x=i.find(l,{oldId:g[c].replace("slot:","")});d[c]=`slot:${x._id}`}),i.omit(d,["global","oldId"])})};const ee=p.atom([]);ee.debugLabel="presentBlocksAtom";const qe=Un(ee);qe.debugLabel="pageBlocksAtomsAtom";const tr=p.atom(e=>Zn(e(ee)));tr.debugLabel="pageBlocksTreeAtom";const sr=p.atom("");sr.debugLabel="builderActivePageAtom";const or=p.atom(-1);or.debugLabel="destinationDropIndexAtom";const Tt=p.atom([]);Tt.debugLabel="buildingBlocksAtom";const nr=p.atom(e=>{const t=e(Tt);return i.filter(t,s=>i.has(s,"blockId"))});nr.debugLabel="globalBlocksAtom";const $e=p.atom([]);$e.debugLabel="selectedBlockIdsAtom";const Ge=p.atom(e=>{const t=e(ee),s=e($e);return i.map(i.filter(t,({_id:o})=>i.includes(s,o)),o=>({...o}))});Ge.debugLabel="selectedBlocksAtom";const We=p.atom(e=>{const t=e(Ge);return t.length===0?null:t.length===1?t[0]:{type:"Multiple",id:i.map(t,"id")}});We.debugLabel="selectedBlockAtom";const rr=e=>i.get(e,"parent",null),ar=p.atom(e=>{const t=e(Ge),s=i.map(t,rr);return i.filter(e(ee),o=>i.includes(s,o._id))});ar.debugLabel="selectedBlocksParentsAtom";const Pt=p.atom(()=>!1);Pt.debugLabel="selectedBlockFlexChildAtom";const It=p.atom(()=>!1);It.debugLabel="selectedBlockGridChildAtom";const He=p.atom("");He.debugLabel="styleStateAtom";const Mt=fe("styleBreakpoint","xs");Mt.debugLabel="styleBreakpointAtom";const ir=()=>({flexChild:p.useAtomValue(Pt),gridChild:p.useAtomValue(It)}),lr=()=>p.useAtomValue(We);const be=()=>{const[e,t]=p.useAtom($e),s=k.useCallback(o=>{t(n=>i.includes(n,o)?i.without(n,o):[...n,o])},[t]);return[e,t,s]},Oe=e=>{switch(e.type){case"singular":return e.uiSchema;case"model":const{properties:t}=e,s={};return Object.keys(t).forEach(l=>{const a=t[l];if(i.includes(["slot","styles"],a.type))return;const d=l;s[d]=Oe(a)}),s;case"list":const{itemProperties:o}=e,n={items:{}};return Object.keys(o).forEach(l=>{const a=o[l];if(i.includes(["slot","styles"],a.type))return;const d=l;n.items[d]=Oe(a)}),n;default:return{}}},Le=e=>{switch(e.type){case"singular":return e.schema;case"model":const{properties:t,title:s}=e,o={title:s,type:"object",properties:{}};return Object.keys(t).forEach(d=>{const g=t[d];if(i.includes(["slot","styles"],g.type))return;const c=d;o.properties[c]=Le(g)}),o;case"list":const{itemProperties:n,title:l}=e,a={title:l,type:"array",items:{type:"object",properties:{}}};return Object.keys(n).forEach(d=>{const g=n[d];if(i.includes(["slot","styles"],g.type))return;const c=d;a.items.properties[c]=Le(g),i.set(a.items,"title",i.get(g,"itemTitle",`${l} item`))}),a;default:return{}}},Dt=e=>{if(!e)return{};const t={};return Object.keys(e).forEach(s=>{t[s]=dr(e[s])}),t},cr=e=>{if(i.isEmpty(e.default))return[];const{itemProperties:t}=e;return i.map(e.default,s=>{const o={...s};return i.forIn(s,(n,l)=>{i.has(t,l)&&i.get(t[l],"i18n",!1)&&(o[l]=W.I18N_KEY)}),o})},dr=e=>{switch(e.type){case"styles":return e.default;case"slot":return`${W.SLOT_KEY}${oe.generateUUID()}`;case"singular":const{i18n:t,schema:s}=e;return t?W.I18N_KEY:i.get(s,"default","");case"model":return Dt(e.properties);case"list":return cr(e);default:return""}};var Ye={exports:{}},xi=Ye.exports;(function(e){(function(){"use strict";function t(o,n,l){return o.splice(n,!l||1+l-n+(!(l<0^n>=0)&&(l<0||-1)*o.length)),o.length}let s=function(){let o=[],n=-1,l=0,a=!1,d;function g(c,x){return!c||typeof c[x]!="function"?this:(a=!0,c[x](),a=!1,this)}return{add:function(c){return a?this:(o.splice(n+1,o.length-n),o.push(c),l&&o.length>l&&t(o,0,-(l+1)),n=o.length-1,d&&d(),this)},setCallback:function(c){d=c},undo:function(){let c=o[n];if(!c)return this;const x=c.groupId;for(;c.groupId===x&&(g(c,"undo"),n-=1,c=o[n],!(!c||!c.groupId)););return d&&d(),this},redo:function(){let c=o[n+1];if(!c)return this;const x=c.groupId;for(;c.groupId===x&&(g(c,"redo"),n+=1,c=o[n+1],!(!c||!c.groupId)););return d&&d(),this},clear:function(){let c=o.length;o=[],n=-1,d&&c>0&&d()},hasUndo:function(){return n!==-1},hasRedo:function(){return n<o.length-1},getCommands:function(c){return c?o.filter(x=>x.groupId===c):o},getIndex:function(){return n},setLimit:function(c){l=c}}};e.exports?e.exports=s:window.UndoManager=s})()})(Ye);var ur=Ye.exports;const mr=rn.getDefaultExportFromCjs(ur),pr=p.atom(W.BRANDING_OPTIONS_DEFAULTS),fr=p.atom(null),Ot=()=>{const[e,t]=p.useAtom(pr);return[i.isObject(e)?{...W.BRANDING_OPTIONS_DEFAULTS,...e}:W.BRANDING_OPTIONS_DEFAULTS,t]},xr=()=>p.useAtom(fr),gr=p.atom(null),Lt=()=>({currentPage:p.useAtomValue(gr)}),zt=new vt({});function hr(e){let t=zt.convert(e);return t=!t.type&&t.children&&t.children.length?t.children:i.isEmpty(t)?[]:[t],t}const Ke=(e,t)=>i.flatten(e.map(s=>{if(s=t?{...s,parent:t}:{...s},s.children){const o=[...s.children];return delete s.children,i.flatten([s,...Ke(o,s._id)])}return s}));function Je(e,t=!1){for(let s=0;s<e.length;s++){const o=e[s];o.global&&!t?e[s]={type:"GlobalBlock",blockId:o.blockId,_parent:i.get(o,"parent",null),_id:o._id}:o.children&&o.children.length&&Je(o.children)}}function Vt(e){let t=[],s=i.filter(e,{type:"GlobalBlock"});return s.length>0&&(s=i.map(s,Ft),i.each(s,o=>{t=[...t,...br(o)]})),t}function br(e){let t=[];const s=i.get(i.first(e),"parent",null);i.set(i.first(e),"parent",null);const o=[zt.convert(Ut(e))];Je(o,!0);let n=Ke(o,e[0]._id);return n=i.set(n,"0.parent",s),t=[...t,n,...Vt(n)],t}function Ft(e){const t=i.find(ze,{_id:e._id});if(!t)return[];const s=[t],o=i.filter(ze,{_parent:e._id});return o.length?i.flatten([...s,...i.flatten(i.map(o,Ft))]):i.flatten(s)}const Ut=e=>JSON.parse(JSON.stringify(e));let ze=[];function vr(e){ze=e;const t=hr(Ut(e));Je(t);const s=Ke(t,null),o=Vt(s),n={};return i.each(o,l=>i.set(n,i.first(l).blockId,l)),[s,n]}const qt=()=>{const[e]=Ot(),{currentPage:t}=Lt(),[s]=de();return k.useCallback(()=>{const o=i.map(s,a=>i.omit(a,["expanded","order","title","siblings","tempClasses"])),[n=[],l=[]]=vr(o);return{currentPage:t,blocks:n,globalBlocks:l}},[e,t,s])},me=(e,t=void 0)=>{const s=p.useAtomValue(Ue);return i.get(s,e,t)},Qe=p.atom([]);Qe.debugLabel="dataProvidersAtom";const $t=()=>p.useAtom(Qe),Ee=p.atom("SAVED");Ee.debugLabel="pageSyncStateAtom";const yr=()=>{const[e,t]=p.useAtom(Ee),s=me("onSaveBlocks",async()=>{}),o=me("onSavePage",async()=>{}),n=me("onSyncStatusChange",()=>{}),l=qt(),[a]=$t();return{savePage:an.useThrottledCallback(async()=>{t("SAVING"),n("SAVING");const g=l();return await o({blocks:g.blocks,providers:a}),setTimeout(()=>{t("SAVED"),n("SAVED")},100),!0},[l,t,n,s],5e3),syncState:e,setSyncState:t}},Z=new mr;Z.setLimit(50);const Xe=()=>{const[,e]=p.useAtom(Ee);return k.useEffect(()=>(Z.setCallback(()=>e("UNSAVED")),()=>{Z.setCallback(i.noop)}),[]),{add:Z.add,undo:Z.undo,redo:Z.redo,hasRedo:Z.hasRedo,hasUndo:Z.hasUndo,clear:Z.clear}},Ze=(e,t)=>{const s=[],o=i.filter(e,n=>i.includes(t,n._id)||i.includes(t,n._parent)?(s.push(n._id),!1):!0);return i.isEmpty(s)?o:Ze(o,s)},jr=()=>{const[e]=de(),[t,s]=be(),{setNewBlocks:o}=ne();return k.useCallback(n=>{var a;const l=((a=i.find(e,{_id:n[0]}))==null?void 0:a._parent)||null;o(Ze(e,n)),setTimeout(()=>s(l?[l]:[]),200)},[e,s,t])};function wr(e,t,s,o){let n=e.filter(d=>!d._parent);s&&(n=e.filter(d=>d._parent===s));const l=o!==void 0?o:n.length;let a=e.length;for(let d=0,g=0;d<e.length;d++)if(e[d]._parent===s){if(g===l){a=d;break}g++}return!s&&o!==void 0&&o>=n.length&&(a=e.length),[...e.slice(0,a),...t,...e.slice(a)]}const Rr=()=>{const[,e]=de();return{setNewBlocks:t=>{e(t)},addBlocks:(t,s,o)=>{e(n=>wr(n,t,s,o))},removeBlocks:t=>{e(s=>Ze(s,t))},updateBlocksProps:t=>{e(s=>{const o=t.map(n=>n._id);return s.map(n=>{if(o.includes(n._id)){const l=i.find(t,{_id:n._id});return{...n,...i.omit(l,"_id")}}return n})})}}},de=()=>p.useAtom(ee),ne=()=>{const{add:e}=Xe(),[t]=de(),{setNewBlocks:s,addBlocks:o,removeBlocks:n,updateBlocksProps:l}=Rr();return{addBlocks:(v,R,N)=>{o(v,R,N),e({undo:()=>n(i.map(v,"_id")),redo:()=>o(v,R,N)})},removeBlocks:v=>{var D;const R=(D=i.first(v))==null?void 0:D._parent,I=t.filter(q=>R?q._parent===R:!q._parent).indexOf(i.first(v));n(i.map(v,"_id")),e({undo:()=>o(v,R,I),redo:()=>n(i.map(v,"_id"))})},updateBlocks:(v,R,N)=>{let I=[];if(N)I=i.map(v,D=>({_id:D,...N}));else{const D=i.keys(R);I=i.map(v,q=>{const $=t.find(V=>V._id===q),G={_id:q};return i.each(D,V=>G[V]=$[V]),G})}l(i.map(v,D=>({_id:D,...R}))),e({undo:()=>l(I),redo:()=>l(i.map(v,D=>({_id:D,...R})))})},updateBlocksRuntime:(v,R)=>{l(i.map(v,N=>({_id:N,...R})))},setNewBlocks:v=>{s(v),e({undo:()=>s(t),redo:()=>s(v)})}}},Gt=le.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"}}),Wt=f.forwardRef(({className:e,variant:t,size:s,...o},n)=>r.jsxRuntimeExports.jsx(jt.Root,{ref:n,className:u.cn(Gt({variant:t,size:s,className:e})),...o}));Wt.displayName=jt.Root.displayName;const Ht=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(De.Root,{className:u.cn("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",e),...t,ref:s,children:r.jsxRuntimeExports.jsx(De.Thumb,{className:u.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")})}));Ht.displayName=De.Root.displayName;const Ae=le.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"}}),Yt=f.forwardRef(({className:e,variant:t,size:s,asChild:o=!1,...n},l)=>{const a=o?dn.Slot:"button";return r.jsxRuntimeExports.jsx(a,{className:u.cn(Ae({variant:t,size:s,className:e})),ref:l,...n})});Yt.displayName="Button";const kr=ie.Root,Kt=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(ie.Item,{ref:s,className:u.cn("border-b",e),...t}));Kt.displayName="AccordionItem";const Jt=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsx(ie.Header,{className:"flex",children:r.jsxRuntimeExports.jsxs(ie.Trigger,{ref:o,className:u.cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...s,children:[t,r.jsxRuntimeExports.jsx(F.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));Jt.displayName=ie.Trigger.displayName;const Qt=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsx(ie.Content,{ref:o,className:u.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...s,children:r.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:t})}));Qt.displayName=ie.Content.displayName;const Nr=le.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"}}),Xt=f.forwardRef(({className:e,variant:t,...s},o)=>r.jsxRuntimeExports.jsx("div",{ref:o,role:"alert",className:u.cn(Nr({variant:t}),e),...s}));Xt.displayName="Alert";const Zt=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("h5",{ref:s,className:u.cn("mb-1 font-medium leading-none tracking-tight",e),...t}));Zt.displayName="AlertTitle";const es=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("text-sm [&_p]:leading-relaxed",e),...t}));es.displayName="AlertDescription";const ts=le.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"}}),Sr=({className:e,variant:t,...s})=>r.jsxRuntimeExports.jsx("div",{className:u.cn(ts({variant:t}),e),...s}),Cr=U.Root,Er=U.Trigger,ss=({className:e,...t})=>r.jsxRuntimeExports.jsx(U.Portal,{className:u.cn(e),...t});ss.displayName=U.Portal.displayName;const os=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Overlay,{className:u.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));os.displayName=U.Overlay.displayName;const ns=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsxs(ss,{children:[r.jsxRuntimeExports.jsx(os,{}),r.jsxRuntimeExports.jsx(U.Content,{ref:s,className:u.cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...t})]}));ns.displayName=U.Content.displayName;const rs=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});rs.displayName="AlertDialogHeader";const as=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});as.displayName="AlertDialogFooter";const is=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Title,{ref:s,className:u.cn("text-lg font-semibold",e),...t}));is.displayName=U.Title.displayName;const ls=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Description,{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));ls.displayName=U.Description.displayName;const cs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Action,{ref:s,className:u.cn(Ae(),e),...t}));cs.displayName=U.Action.displayName;const ds=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Cancel,{ref:s,className:u.cn(Ae({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ds.displayName=U.Cancel.displayName;const et=_.Root,us=_.Trigger,ms=({className:e,...t})=>r.jsxRuntimeExports.jsx(_.Portal,{className:u.cn(e),...t});ms.displayName=_.Portal.displayName;const ps=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(_.Overlay,{ref:s,className:u.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ps.displayName=_.Overlay.displayName;const Be=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(ms,{children:[r.jsxRuntimeExports.jsx(ps,{}),r.jsxRuntimeExports.jsxs(_.Content,{ref:o,className:u.cn("fixed left-[50%] top-[50%] z-[999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...s,children:[t,r.jsxRuntimeExports.jsxs(_.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[r.jsxRuntimeExports.jsx(F.Cross2Icon,{className:"h-4 w-4"}),r.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Be.displayName=_.Content.displayName;const fs=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});fs.displayName="DialogHeader";const xs=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xs.displayName="DialogFooter";const gs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(_.Title,{ref:s,className:u.cn("text-lg font-semibold leading-none tracking-tight",e),...t}));gs.displayName=_.Title.displayName;const hs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(_.Description,{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));hs.displayName=_.Description.displayName;const bs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("rounded-xl border bg-card text-card-foreground shadow",e),...t}));bs.displayName="Card";const vs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("flex flex-col space-y-1.5 p-6",e),...t}));vs.displayName="CardHeader";const ys=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("h3",{ref:s,className:u.cn("font-semibold leading-none tracking-tight",e),...t}));ys.displayName="CardTitle";const js=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("p",{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));js.displayName="CardDescription";const ws=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("p-6 pt-0",e),...t}));ws.displayName="CardContent";const Rs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn(" flex items-center p-6 pt-0",e),...t}));Rs.displayName="CardFooter";const ks=f.forwardRef(({className:e,type:t,...s},o)=>r.jsxRuntimeExports.jsx("input",{type:t,className:u.cn("flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...s}));ks.displayName="Input";const Ar=le.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ns=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(wt.Root,{ref:s,className:u.cn(Ar(),e),...t}));Ns.displayName=wt.Root.displayName;const Ss=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("textarea",{className:u.cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...t}));Ss.displayName="Textarea";const Cs=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(ae.Root,{ref:o,className:u.cn("relative overflow-hidden",e),...s,children:[r.jsxRuntimeExports.jsx(ae.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),r.jsxRuntimeExports.jsx(tt,{}),r.jsxRuntimeExports.jsx(ae.Corner,{})]}));Cs.displayName=ae.Root.displayName;const tt=f.forwardRef(({className:e,orientation:t="vertical",...s},o)=>r.jsxRuntimeExports.jsx(ae.ScrollAreaScrollbar,{ref:o,orientation:t,className:u.cn("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",e),...s,children:r.jsxRuntimeExports.jsx(ae.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));tt.displayName=ae.ScrollAreaScrollbar.displayName;const Es=ce.Root,st=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(ce.List,{ref:s,className:u.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));st.displayName=ce.List.displayName;const ke=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(ce.Trigger,{ref:s,className:u.cn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));ke.displayName=ce.Trigger.displayName;const Ne=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(ce.Content,{ref:s,className:u.cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ne.displayName=ce.Content.displayName;const Br=pe.Portal,_r=pe.Provider,Tr=pe.Root,Pr=pe.Trigger,As=f.forwardRef(({className:e,sideOffset:t=4,...s},o)=>r.jsxRuntimeExports.jsx(pe.Content,{ref:o,sideOffset:t,className:u.cn("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s}));As.displayName=pe.Content.displayName;const Ir=he.Root,Mr=he.Trigger,Bs=f.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},n)=>r.jsxRuntimeExports.jsx(he.Portal,{children:r.jsxRuntimeExports.jsx(he.Content,{ref:n,align:t,sideOffset:s,className:u.cn("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Bs.displayName=he.Content.displayName;const Dr=A.Menu,Or=A.Group,Lr=A.Portal,zr=A.Sub,Vr=A.RadioGroup,_s=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(A.Root,{ref:s,className:u.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",e),...t}));_s.displayName=A.Root.displayName;const Ts=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(A.Trigger,{ref:s,className:u.cn("flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e),...t}));Ts.displayName=A.Trigger.displayName;const Ps=f.forwardRef(({className:e,inset:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(A.SubTrigger,{ref:n,className:u.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[s,r.jsxRuntimeExports.jsx(F.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));Ps.displayName=A.SubTrigger.displayName;const Is=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(A.SubContent,{ref:s,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Is.displayName=A.SubContent.displayName;const Ms=f.forwardRef(({className:e,align:t="start",alignOffset:s=-4,sideOffset:o=8,...n},l)=>r.jsxRuntimeExports.jsx(A.Portal,{children:r.jsxRuntimeExports.jsx(A.Content,{ref:l,align:t,alignOffset:s,sideOffset:o,className:u.cn("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ms.displayName=A.Content.displayName;const Ds=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(A.Item,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));Ds.displayName=A.Item.displayName;const Os=f.forwardRef(({className:e,children:t,checked:s,...o},n)=>r.jsxRuntimeExports.jsxs(A.CheckboxItem,{ref:n,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(A.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.CheckIcon,{className:"h-4 w-4"})})}),t]}));Os.displayName=A.CheckboxItem.displayName;const Ls=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(A.RadioItem,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(A.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Ls.displayName=A.RadioItem.displayName;const zs=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(A.Label,{ref:o,className:u.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));zs.displayName=A.Label.displayName;const Vs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(A.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-muted",e),...t}));Vs.displayName=A.Separator.displayName;const Fs=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Fs.displayname="MenubarShortcut";const Fr=Ce.Root,Ur=Ce.Trigger,Us=f.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},n)=>r.jsxRuntimeExports.jsx(Ce.Content,{ref:n,align:t,sideOffset:s,className:u.cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));Us.displayName=Ce.Content.displayName;const qr=O.Root,$r=O.Group,Gr=O.Value,qs=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(O.Trigger,{ref:o,className:u.cn("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...s,children:[t,r.jsxRuntimeExports.jsx(O.Icon,{asChild:!0,children:r.jsxRuntimeExports.jsx(F.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));qs.displayName=O.Trigger.displayName;const $s=f.forwardRef(({className:e,children:t,position:s="popper",...o},n)=>r.jsxRuntimeExports.jsx(O.Portal,{children:r.jsxRuntimeExports.jsx(O.Content,{ref:n,className:u.cn("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:s,...o,children:r.jsxRuntimeExports.jsx(O.Viewport,{className:u.cn("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));$s.displayName=O.Content.displayName;const Gs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(O.Label,{ref:s,className:u.cn("px-2 py-1.5 text-sm font-semibold",e),...t}));Gs.displayName=O.Label.displayName;const Ws=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(O.Item,{ref:o,className:u.cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(O.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.CheckIcon,{className:"h-4 w-4"})})}),r.jsxRuntimeExports.jsx(O.ItemText,{children:t})]}));Ws.displayName=O.Item.displayName;const Hs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(O.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-muted",e),...t}));Hs.displayName=O.Separator.displayName;const Wr=_.Root,Hr=_.Trigger,Yr=_.Close,Ys=({className:e,...t})=>r.jsxRuntimeExports.jsx(_.Portal,{className:u.cn(e),...t});Ys.displayName=_.Portal.displayName;const Ks=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(_.Overlay,{className:u.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));Ks.displayName=_.Overlay.displayName;const Kr=le.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"}}),Js=f.forwardRef(({side:e="right",className:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(Ys,{children:[r.jsxRuntimeExports.jsx(Ks,{}),r.jsxRuntimeExports.jsxs(_.Content,{ref:n,className:u.cn(Kr({side:e}),t),...o,children:[s,r.jsxRuntimeExports.jsxs(_.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[r.jsxRuntimeExports.jsx(F.Cross2Icon,{className:"h-4 w-4"}),r.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Js.displayName=_.Content.displayName;const Qs=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});Qs.displayName="SheetHeader";const Xs=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xs.displayName="SheetFooter";const Zs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(_.Title,{ref:s,className:u.cn("text-lg font-semibold text-foreground",e),...t}));Zs.displayName=_.Title.displayName;const eo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(_.Description,{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));eo.displayName=_.Description.displayName;const Jr=T.Root,Qr=T.Trigger,Xr=T.Group,Zr=T.Portal,ea=T.Sub,ta=T.RadioGroup,to=f.forwardRef(({className:e,inset:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(T.SubTrigger,{ref:n,className:u.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...o,children:[s,r.jsxRuntimeExports.jsx(F.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));to.displayName=T.SubTrigger.displayName;const so=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(T.SubContent,{ref:s,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));so.displayName=T.SubContent.displayName;const oo=f.forwardRef(({className:e,sideOffset:t=4,...s},o)=>r.jsxRuntimeExports.jsx(T.Portal,{children:r.jsxRuntimeExports.jsx(T.Content,{ref:o,sideOffset:t,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));oo.displayName=T.Content.displayName;const no=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(T.Item,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));no.displayName=T.Item.displayName;const ro=f.forwardRef(({className:e,children:t,checked:s,...o},n)=>r.jsxRuntimeExports.jsxs(T.CheckboxItem,{ref:n,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(T.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.CheckIcon,{className:"h-4 w-4"})})}),t]}));ro.displayName=T.CheckboxItem.displayName;const ao=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(T.RadioItem,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(T.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));ao.displayName=T.RadioItem.displayName;const io=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(T.Label,{ref:o,className:u.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));io.displayName=T.Label.displayName;const lo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(T.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-muted",e),...t}));lo.displayName=T.Separator.displayName;const co=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest opacity-60",e),...t});co.displayName="DropdownMenuShortcut";const uo=f.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...o},n)=>r.jsxRuntimeExports.jsx(Rt.Root,{ref:n,decorative:s,orientation:t,className:u.cn("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));uo.displayName=Rt.Root.displayName;const sa=1,oa=1e6;let Ie=0;function na(){return Ie=(Ie+1)%Number.MAX_VALUE,Ie.toString()}const Me=new Map,pt=e=>{if(Me.has(e))return;const t=setTimeout(()=>{Me.delete(e),ge({type:"REMOVE_TOAST",toastId:e})},oa);Me.set(e,t)},mo=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,sa)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case"DISMISS_TOAST":{const{toastId:s}=t;return s?pt(s):e.toasts.forEach(o=>{pt(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===s||s===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)}}},je=[];let we={toasts:[]};function ge(e){we=mo(we,e),je.forEach(t=>{t(we)})}function po({...e}){const t=na(),s=n=>ge({type:"UPDATE_TOAST",toast:{...n,id:t}}),o=()=>ge({type:"DISMISS_TOAST",toastId:t});return ge({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:n=>{n||o()}}}),{id:t,dismiss:o,update:s}}function ot(){const[e,t]=f.useState(we);return f.useEffect(()=>(je.push(t),()=>{const s=je.indexOf(t);s>-1&&je.splice(s,1)}),[e]),{...e,toast:po,dismiss:s=>ge({type:"DISMISS_TOAST",toastId:s})}}const ra=K.Provider,fo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(K.Viewport,{ref:s,className:u.cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));fo.displayName=K.Viewport.displayName;const aa=le.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"}}),xo=f.forwardRef(({className:e,variant:t,...s},o)=>r.jsxRuntimeExports.jsx(K.Root,{ref:o,className:u.cn(aa({variant:t}),e),...s}));xo.displayName=K.Root.displayName;const ia=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(K.Action,{ref:s,className:u.cn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));ia.displayName=K.Action.displayName;const go=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(K.Close,{ref:s,className:u.cn("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:r.jsxRuntimeExports.jsx(F.Cross2Icon,{className:"h-4 w-4"})}));go.displayName=K.Close.displayName;const ho=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(K.Title,{ref:s,className:u.cn("text-sm font-semibold [&+div]:text-xs",e),...t}));ho.displayName=K.Title.displayName;const bo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(K.Description,{ref:s,className:u.cn("text-sm opacity-90",e),...t}));bo.displayName=K.Description.displayName;function la(){const{toasts:e}=ot();return r.jsxRuntimeExports.jsxs(ra,{children:[e.map(({id:t,title:s,description:o,action:n,...l})=>r.jsxRuntimeExports.jsxs(xo,{...l,children:[r.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[s&&r.jsxRuntimeExports.jsx(ho,{children:s}),o&&r.jsxRuntimeExports.jsx(bo,{children:o})]}),n,r.jsxRuntimeExports.jsx(go,{})]},t)),r.jsxRuntimeExports.jsx(fo,{})]})}const ca=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("animate-pulse rounded-md bg-primary/10",e),...t}),nt=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(H.Command,{ref:s,className:u.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));nt.displayName=H.Command.displayName;const da=({children:e,...t})=>r.jsxRuntimeExports.jsx(et,{...t,children:r.jsxRuntimeExports.jsx(Be,{className:"overflow-hidden p-0",children:r.jsxRuntimeExports.jsx(nt,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),vo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[r.jsxRuntimeExports.jsx(F.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),r.jsxRuntimeExports.jsx(H.Command.Input,{ref:s,className:u.cn("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));vo.displayName=H.Command.Input.displayName;const yo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(H.Command.List,{ref:s,className:u.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));yo.displayName=H.Command.List.displayName;const jo=f.forwardRef((e,t)=>r.jsxRuntimeExports.jsx(H.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));jo.displayName=H.Command.Empty.displayName;const wo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(H.Command.Group,{ref:s,className:u.cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));wo.displayName=H.Command.Group.displayName;const Ro=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(H.Command.Separator,{ref:s,className:u.cn("-mx-1 h-px bg-border",e),...t}));Ro.displayName=H.Command.Separator.displayName;const ko=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(H.Command.Item,{ref:s,className:u.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));ko.displayName=H.Command.Item.displayName;const No=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});No.displayName="CommandShortcut";const ua=P.Root,ma=P.Trigger,pa=P.Group,fa=P.Portal,xa=P.Sub,ga=P.RadioGroup,So=f.forwardRef(({className:e,inset:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(P.SubTrigger,{ref:n,className:u.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[s,r.jsxRuntimeExports.jsx(F.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));So.displayName=P.SubTrigger.displayName;const Co=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(P.SubContent,{ref:s,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Co.displayName=P.SubContent.displayName;const Eo=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(P.Portal,{children:r.jsxRuntimeExports.jsx(P.Content,{ref:s,className:u.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));Eo.displayName=P.Content.displayName;const Ao=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(P.Item,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));Ao.displayName=P.Item.displayName;const Bo=f.forwardRef(({className:e,children:t,checked:s,...o},n)=>r.jsxRuntimeExports.jsxs(P.CheckboxItem,{ref:n,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(P.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.CheckIcon,{className:"h-4 w-4"})})}),t]}));Bo.displayName=P.CheckboxItem.displayName;const _o=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(P.RadioItem,{ref:o,className:u.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsxRuntimeExports.jsx(P.ItemIndicator,{children:r.jsxRuntimeExports.jsx(F.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));_o.displayName=P.RadioItem.displayName;const To=f.forwardRef(({className:e,inset:t,...s},o)=>r.jsxRuntimeExports.jsx(P.Label,{ref:o,className:u.cn("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...s}));To.displayName=P.Label.displayName;const Po=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(P.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-border",e),...t}));Po.displayName=P.Separator.displayName;const Io=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Io.displayName="ContextMenuShortcut";const ha=e=>{try{const t=document.getElementById("icon-picker-field"),s=document.createElement("div");Sn.render(r.jsxRuntimeExports.jsx(yt.IconPickerItem,{value:e}),s),t.appendChild(s),s.hidden=!0;let o=s.innerHTML;setTimeout(()=>t.removeChild(s),100);const l=new DOMParser().parseFromString(o,"image/svg+xml"),a=l.querySelector("svg");return a&&(a.removeAttribute("width"),a.removeAttribute("height")),new XMLSerializer().serializeToString(l)}catch(t){return console.error(t),""}},ba=({value:e,onChange:t})=>{const s=o=>{t("<svg />");const n=ha(o);t(n)};return r.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[r.jsxRuntimeExports.jsxs("div",{className:"group relative h-12 w-12",children:[r.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e?e.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"}),r.jsxRuntimeExports.jsx(yt,{value:e?"BiSolidGrid":null,onChange:s,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"}})]}),r.jsxRuntimeExports.jsx("textarea",{value:e,onChange:o=>t(o.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"})]})},va=k.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-EiYSWkBa.cjs"))),ya=k.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-GGCExfQd.cjs"))),Mo=({isModalView:e=!1,onSelect:t=()=>{}})=>{const[s,o]=k.useState("upload");return r.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[r.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:r.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:e?"Select or upload images":"Images"})}),r.jsxRuntimeExports.jsxs(Es,{value:s,onValueChange:n=>o(n),className:"flex h-full w-full flex-col py-2",children:[r.jsxRuntimeExports.jsxs(st,{className:"w-full",children:[r.jsxRuntimeExports.jsx(ke,{value:"upload",className:"w-1/2",children:"Upload"}),r.jsxRuntimeExports.jsx(ke,{value:"unsplash",className:"w-1/2",children:"Unsplash"})]}),s==="unsplash"?r.jsxRuntimeExports.jsx(Ne,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:r.jsxRuntimeExports.jsx(k.Suspense,{fallback:r.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:r.jsxRuntimeExports.jsx(va,{isModalView:e,onSelect:t})})}):r.jsxRuntimeExports.jsx(Ne,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:r.jsxRuntimeExports.jsx(k.Suspense,{fallback:r.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:r.jsxRuntimeExports.jsx(ya,{isModalView:e,onSelect:t})})})]})]})},ja=Object.freeze(Object.defineProperty({__proto__:null,default:Mo},Symbol.toStringTag,{value:"Module"})),ft=({children:e,onSelect:t})=>{const[s,o]=k.useState(!1),n=(...l)=>{t.call(void 0,...l),o(!1)};return r.jsxRuntimeExports.jsxs(et,{open:s,onOpenChange:l=>o(l),children:[r.jsxRuntimeExports.jsx(us,{asChild:!0,children:e}),r.jsxRuntimeExports.jsx(Be,{className:"flex h-3/4 max-w-5xl",children:r.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:r.jsxRuntimeExports.jsx(Mo,{isModalView:!0,onSelect:n})})})]})},wa=({value:e,onChange:t,id:s,onBlur:o})=>r.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[e?r.jsxRuntimeExports.jsx("img",{src:e,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):r.jsxRuntimeExports.jsx(ft,{onSelect:t,children:r.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"})}),r.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[r.jsxRuntimeExports.jsx(ft,{onSelect:t,children:r.jsxRuntimeExports.jsx("small",{className:"cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700",children:e||!i.isEmpty(e)?"Replace Image":"Choose Image"})}),r.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"}),r.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:e,onBlur:({target:{value:n}})=>o(s,n),onChange:n=>t(n.target.value)})]})]}),Ra=({id:e,placeholder:t,value:s,onChange:o,onBlur:n})=>{const l={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},a=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:r.jsxRuntimeExports.jsx(Cn,{id:e,value:s,onBlur:d=>n(e,d),onChange:d=>o(d),modules:l,formats:a,placeholder:t,className:"mt-1 rounded-md"})},ka=({schema:e,formData:t,onChange:s})=>{const[o,n]=k.useState([]),l=me("getPages",()=>[]),{type:a="page",href:d="",target:g="self"}=t;return k.useEffect(()=>{(async()=>{const c=await l();n(c||[])})()},[]),r.jsxRuntimeExports.jsxs("div",{children:[r.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(e==null?void 0:e.title)??"Link"}),r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[r.jsxRuntimeExports.jsx("select",{name:"type",value:a,onChange:c=>s({...t,type:c.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(c=>r.jsxRuntimeExports.jsx("option",{value:c.const,children:c.title},c.const))}),a==="page"?r.jsxRuntimeExports.jsxs("select",{name:"href",placeholder:"Choose Page",value:d,onChange:c=>s({...t,href:c.target.value}),children:[r.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),i.map(o,c=>r.jsxRuntimeExports.jsx("option",{value:c.slug,children:c.name},c.uuid))]}):r.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:d,onChange:c=>s({...t,href:c.target.value}),placeholder:a==="page"||a==="url"?"Enter URL":a==="scroll"?"#ElementID":"Enter detail"}),(a==="page"||a==="url")&&r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[r.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:g==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>s({...t,target:g==="_blank"?"_self":"_blank"})}),r.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})},Na=()=>{const[e]=de(),[,t]=be(),{addBlocks:s}=ne(),{toast:o}=ot(),n=k.useCallback((a,d,g)=>{var N;for(let I=0;I<a.length;I++){const{_id:D}=a[I];a[I]._id=oe.generateUUID();const q=i.filter(a,{_parent:D});for(let $=0;$<q.length;$++)q[$]._parent=a[I]._id}const c=i.first(a);let x,v;return d&&(x=i.find(e,{_id:d}),a[0]._parent=d,v=d),!(x?mt(x._type,c._type):!0)&&x&&(a[0]._parent=x._parent,v=x._parent),s(a,v,g),t([(N=i.first(a))==null?void 0:N._id]),i.first(a)},[e,t]);return{addCoreBlock:k.useCallback((a,d,g)=>{if(i.has(a,"blocks")){const $=a.blocks;return n($,d,g)}const c=oe.generateUUID(),x=Dt(a.props),v=[];i.forIn(x,($,G)=>{if(i.startsWith($,W.SLOT_KEY)){const V=$.replace(W.SLOT_KEY,"");v.push({_id:V,_type:"Slot",_parent:c,_name:a.props[G].name,_styles:a.props[G].styles,_emptyStyles:a.props[G].emptyStyles})}});const R={_type:a.type,_id:c,...x};let N,I;if(d&&(N=i.find(e,{_id:d}),R._parent=d,I=d),!At(N==null?void 0:N._type,a.type)){o({variant:"destructive",title:"Error",description:`"${a.type}" cannot be added under "${N?N==null?void 0:N._type:"root"}"`}),t([]);return}!(N?mt(N._type,a.type):!0)&&N&&(R._parent=N._parent,I=N._parent);const q=[R,...v];return s(q,I,g),t([R._id]),R},[n,e,t]),addPredefinedBlock:n}},xt={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},gt=["xs","sm","md","lg","xl","2xl"];function Sa(e,t){if(t===null)return"baseClasses";const s=t.mq;if(s==="xs"||t.dark||t.mod!=="")return"classes";let o="baseClasses",n=gt.indexOf(s);for(;n>0;){const l=gt[n-1];if(i.find(e,{mq:l,property:t.property})){o="classes";break}n--}return o}const ht=[];function Ca(e="",t="",s=[]){e=e.trim().replace(/ +/g,"");let o=i.filter(i.map(e.split(" "),u.constructClassObject),c=>!i.isNull(c)),n=i.filter(i.map(t.split(" "),u.constructClassObject),c=>!i.isNull(c));n=i.filter(n,c=>!i.includes(ht,c.property));const l=[],a=[];i.each(s,c=>{const x=u.constructClassObject(c),v=i.find(o,i.pick(x,["dark","mq","mod","property"]));if(v&&(o=i.filter(o,R=>R.fullCls!==(v==null?void 0:v.fullCls))),l.push(x),x.mq==="xs"&&!x.dark&&x.mod===""&&(n=i.filter(n,R=>R.property!==x.property)),Sa(o,x)==="baseClasses"&&!i.includes(ht,x.property)){const R=i.find(n,i.pick(x,["property"]));v&&(n=i.filter(n,N=>N.fullCls!==(R==null?void 0:R.fullCls))),a.push({...x,fullCls:x.cls,mq:"xs"})}});const d=i.map(i.sortBy([...o,...l],c=>xt[c.mq]),"fullCls").join(" ");return`${i.map(i.sortBy([...n,...a],c=>xt[c.mq]),"fullCls").join(" ").trim()},${d.trim()}`.trim().replace(/ +/g,"")}const ve=p.atom([]);ve.debugLabel="selectedStylingBlocksAtom";const Do=()=>p.useAtom(ve),Ea=e=>{const t=e.replace(W.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},Aa=p.atom(null,(e,t,{blockIds:s,newClasses:o})=>{const n=i.filter(e(qe),a=>s.includes(e(a)._id)),l=i.first(e(ve));return i.map(n,a=>{const d=e(a),g=i.get(d,l.prop,`${W.STYLES_KEY},`),{baseClasses:c,classes:x}=Ea(g);return{ids:[d._id],props:{[l.prop]:`${W.STYLES_KEY}${Ca(x,c,o)}`}}})}),Ba=()=>{const e=p.useSetAtom(Aa),{updateBlocks:t,updateBlocksRuntime:s}=ne();return k.useCallback((o,n,l=!1)=>{const a=e({blockIds:o,newClasses:n});if(!l){s(o,a[0].props);return}t(o,a[0].props)},[e])},Oo=()=>p.useAtom(Mt),Lo=fe("canvasWidth",800),zo=p.atom(e=>{const t=e(Lo);return oe.getBreakpointValue(t).toLowerCase()}),_a=()=>{const[e,t]=p.useAtom(Lo),s=p.useAtomValue(zo),[o,n]=Oo();return k.useEffect(()=>{o!=="xs"&&n(s)},[s,o,n]),[e,s,t]},Ta=fe("canvasZoom",100),Pa=()=>p.useAtom(Ta),Vo=p.atom([]),Fo=()=>{const[e,t]=p.useAtom(Vo),s=p.useSetAtom(rt),o=k.useCallback(n=>{t(n),s([])},[t,s]);return[e,o]},rt=p.atom([]),Ia=()=>{const[e,t]=p.useAtom(rt),s=p.useSetAtom(Vo),o=k.useCallback(n=>{t(n),s([])},[t,s]);return[e,o]},Uo=fe("darkMode",!1),Ma=()=>{const[e,t]=p.useAtom(Uo);return[e,t]},qo=()=>{const[e]=de(),[,t]=be(),{addBlocks:s}=ne();return k.useCallback((o,n=null)=>{const l=[];i.each(o,a=>{const d=e.find(R=>R._id===a);n||(n=d._parent);const x=i.filter(e,R=>i.isString(n)?R._parent===n:!d._parent).indexOf(d)+1,v=er(e,a,n);s(v,n,x),l.push(i.get(v,"0._id",""))}),t(l)},[e,t])},Da=p.atom([]),Oa=()=>{const[e,t]=p.useAtom(Da),s=k.useCallback(o=>{t(n=>i.includes(n,o)?i.without(n,o):[...n,o])},[t]);return[e,t,s]},La=p.atom(""),$o=()=>p.useAtom(La),za=()=>{const e=p.useAtomValue(ee);return k.useCallback((t,s)=>{const o=i.map(e,n=>(i.includes(t,i.get(n,"_id"))&&i.set(n,"_parent",s),n));console.log("newBlocks",o)},[e])},Va=()=>{console.warn("usePasteBlocks is not implemented");const e=p.useAtomValue(rt),[t,s]=Fo(),o=qo(),n=za();return{canPaste:k.useMemo(()=>t.length>0||e.length>0,[e,t]),pasteBlocks:k.useCallback(a=>{i.isEmpty(e)?n(t,a):o(e,a),s(()=>[])},[t,e,o,n,s])}},Fa=p.atom(!1),Ua=()=>{const[e,t]=p.useAtom(Fa);return[e,t]},qa=p.atom(null,(e,t,{blockIds:s,fullClasses:o})=>{const n=i.first(e(ve)),l=i.filter(e(qe),a=>s.includes(e(a)._id));return i.map(l,a=>{const d=e(a),g=o;let{classes:c,baseClasses:x}=Yn(i.get(d,n.prop,"styles:,"));return i.each(g,v=>{const R=new RegExp(`(^| )${v.replace("[","\\[").replace("]","\\]")}($| )`,"g");c=c.replace(R," ").replace(/ +/g," ").trim();const N=i.first(v.split(":"));i.includes(["2xl","xl","lg","md","sm"],N)&&g.push(v.split(":").pop().trim())}),i.each(g,v=>{const R=new RegExp(`(^| )${v.replace("[","\\[").replace("]","\\]")}($| )`,"g");x=x.replace(R," ").replace(/ +/g," ").trim()}),{ids:[d._id],props:{[n.prop]:`${W.STYLES_KEY}${x},${c}`}}})}),$a=()=>{const{updateBlocks:e}=ne(),t=p.useSetAtom(qa);return k.useCallback((s,o)=>{const n=t({blockIds:s,fullClasses:o});e(s,n[0].props)},[t])},Go=p.atom(e=>{const t=i.first(e(ve)),s=e(We);if(!t||t.blockId!==i.get(s,"_id",null))return[];const n=i.get(s,t.prop,`${W.STYLES_KEY},`).replace(W.STYLES_KEY,"").split(",").join(" ");return i.filter(i.map(n.trim().split(" "),u.constructClassObject),l=>!i.isNull(l))}),Ga=()=>p.useAtomValue(Go),bt={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},Wa=p.atom(e=>{const t=e(zo),s=e(He),o=e(Uo),n=Ha(t);let l=i.filter(e(Go),{mod:s});return i.startsWith(s,"_")||(l=i.filter(l,a=>n.includes(a.mq))),l=l.sort((a,d)=>bt[a.mq]-bt[d.mq]),o||(l=i.filter(l,{dark:!1})),l}),Ha=e=>{let t=[];switch(e){case"xs":t=["xs"];break;case"sm":t=["xs","sm"];break;case"md":t=["xs","sm","md"];break;case"lg":t=["xs","sm","md","lg"];break;case"xl":t=["xs","sm","md","lg","xl"];break;case"2xl":t=["xs","sm","md","lg","xl","2xl"];break;default:t=["xs"];break}return t},Ya=()=>p.useAtomValue(Wa),Ka=()=>p.useAtom(He),Ja=()=>{const{updateBlocks:e}=ne();return k.useCallback((t,s,o)=>{e(t,s,o)},[e])},Qa=()=>{const{updateBlocksRuntime:e}=ne();return k.useCallback((t,s)=>{e(t,s)},[e])},Wo={name:"",props:{},modalProps:{},backdropClose:!0},Xa=p.atom(Wo),Za=()=>{const[e,t]=p.useAtom(Xa),s=k.useCallback((n,l={},a={})=>{t({name:n,props:l,modalProps:a})},[t]),o=k.useCallback((...n)=>{i.get(e,"props.onClose",()=>{})(...n),t(Wo)},[t,e]);return{activeModal:e,openModal:s,closeModal:o}},ei=()=>(console.warn("useAllBlocks is deprecated, use useBlocksStore() instead"),p.useAtomValue(ee)),Ho=p.atom(!1);Ho.debugLabel="readOnlyModeAtom";const Yo=p.atom(!1);Yo.debugLabel="advanceStylingOpenAtom";const Ko=p.atom("online");Ko.debugLabel="networkModeAtom";const ti=p.atom(!1);ti.debugLabel="codeEditorOpenAtom";const Jo=p.atom(!1);Jo.debugLabel="editLayerNameAtom";const si=p.atom("");si.debugLabel="activeLanguageAtom";const oi=p.atom("");oi.debugLabel="primaryLanguageAtom";const Qo=p.atom(null);Qo.debugLabel="canvasIframeAtom";const Xo=p.atom("layers");Xo.debugLabel="activePanelAtom";const Zo=p.atom("");Zo.debugLabel="showPredefinedBlockCategoryAtom";const en=p.atom({undoCount:0,redoCount:0});en.debugLabel="historyStatesAtom";const tn=p.atom("");tn.debugLabel="inlineEditingActiveAtom";const sn=p.atom(!1);sn.debugLabel="draggingFlagAtom";const on=p.atom("");on.debugLabel="draggedBlockIdAtom";const ni=()=>p.useAtomValue(Ho),ri=p.atom(""),ai=p.atom(null),ii=()=>p.useAtom(ri),li=()=>p.useAtom(ai),ci=fe("selectedBreakpoints",["XS","MD","XL"]),di=()=>{const[e,t]=p.useAtom(ci);return[e,t]},ui=()=>{const e=p.useSetAtom(en),{clear:t}=Xe(),[,s]=be(),[,o]=$o(),[,n]=Do();return()=>{s([]),n([]),o(""),t(),e({undoCount:0,redoCount:0})}},mi=p.atom([]),pi=()=>{const[e,t]=k.useState(!1),[s,o]=p.useAtom(mi),n=me("getUILibraryBlocks",()=>[]);return k.useEffect(()=>{(async()=>s.length>0||(t(!0),o(await n()),t(!1)))()},[]),{data:s,isLoading:e}},fi=()=>{const[e,t]=k.useState(null),s=k.useCallback(async o=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(o),t(o),!0}catch(n){return console.warn("Copy failed",n),t(null),!1}},[]);return[e,s]};exports.Accordion=kr;exports.AccordionContent=Qt;exports.AccordionItem=Kt;exports.AccordionTrigger=Jt;exports.Alert=Xt;exports.AlertDescription=es;exports.AlertDialog=Cr;exports.AlertDialogAction=cs;exports.AlertDialogCancel=ds;exports.AlertDialogContent=ns;exports.AlertDialogDescription=ls;exports.AlertDialogFooter=as;exports.AlertDialogHeader=rs;exports.AlertDialogTitle=is;exports.AlertDialogTrigger=Er;exports.AlertTitle=Zt;exports.Badge=Sr;exports.Button=Yt;exports.Card=bs;exports.CardContent=ws;exports.CardDescription=js;exports.CardFooter=Rs;exports.CardHeader=vs;exports.CardTitle=ys;exports.Command=nt;exports.CommandDialog=da;exports.CommandEmpty=jo;exports.CommandGroup=wo;exports.CommandInput=vo;exports.CommandItem=ko;exports.CommandList=yo;exports.CommandSeparator=Ro;exports.CommandShortcut=No;exports.ContextMenu=ua;exports.ContextMenuCheckboxItem=Bo;exports.ContextMenuContent=Eo;exports.ContextMenuGroup=pa;exports.ContextMenuItem=Ao;exports.ContextMenuLabel=To;exports.ContextMenuPortal=fa;exports.ContextMenuRadioGroup=ga;exports.ContextMenuRadioItem=_o;exports.ContextMenuSeparator=Po;exports.ContextMenuShortcut=Io;exports.ContextMenuSub=xa;exports.ContextMenuSubContent=Co;exports.ContextMenuSubTrigger=So;exports.ContextMenuTrigger=ma;exports.Dialog=et;exports.DialogContent=Be;exports.DialogDescription=hs;exports.DialogFooter=xs;exports.DialogHeader=fs;exports.DialogTitle=gs;exports.DialogTrigger=us;exports.DropdownMenu=Jr;exports.DropdownMenuCheckboxItem=ro;exports.DropdownMenuContent=oo;exports.DropdownMenuGroup=Xr;exports.DropdownMenuItem=no;exports.DropdownMenuLabel=io;exports.DropdownMenuPortal=Zr;exports.DropdownMenuRadioGroup=ta;exports.DropdownMenuRadioItem=ao;exports.DropdownMenuSeparator=lo;exports.DropdownMenuShortcut=co;exports.DropdownMenuSub=ea;exports.DropdownMenuSubContent=so;exports.DropdownMenuSubTrigger=to;exports.DropdownMenuTrigger=Qr;exports.HoverCard=Fr;exports.HoverCardContent=Us;exports.HoverCardTrigger=Ur;exports.IconPickerField=ba;exports.ImagePickerField=wa;exports.ImagesPanel=ja;exports.Input=ks;exports.Label=Ns;exports.LinkField=ka;exports.Menubar=_s;exports.MenubarCheckboxItem=Os;exports.MenubarContent=Ms;exports.MenubarGroup=Or;exports.MenubarItem=Ds;exports.MenubarLabel=zs;exports.MenubarMenu=Dr;exports.MenubarPortal=Lr;exports.MenubarRadioGroup=Vr;exports.MenubarRadioItem=Ls;exports.MenubarSeparator=Vs;exports.MenubarShortcut=Fs;exports.MenubarSub=zr;exports.MenubarSubContent=Is;exports.MenubarSubTrigger=Ps;exports.MenubarTrigger=Ts;exports.Popover=Ir;exports.PopoverContent=Bs;exports.PopoverTrigger=Mr;exports.RichTextEditorField=Ra;exports.ScrollArea=Cs;exports.ScrollBar=tt;exports.Select=qr;exports.SelectContent=$s;exports.SelectGroup=$r;exports.SelectItem=Ws;exports.SelectLabel=Gs;exports.SelectSeparator=Hs;exports.SelectTrigger=qs;exports.SelectValue=Gr;exports.Separator=uo;exports.Sheet=Wr;exports.SheetClose=Yr;exports.SheetContent=Js;exports.SheetDescription=eo;exports.SheetFooter=Xs;exports.SheetHeader=Qs;exports.SheetTitle=Zs;exports.SheetTrigger=Hr;exports.Skeleton=ca;exports.Switch=Ht;exports.Tabs=Es;exports.TabsContent=Ne;exports.TabsList=st;exports.TabsTrigger=ke;exports.Textarea=Ss;exports.Toaster=la;exports.Toggle=Wt;exports.Tooltip=Tr;exports.TooltipContent=As;exports.TooltipPortal=Br;exports.TooltipProvider=_r;exports.TooltipTrigger=Pr;exports.activePanelAtom=Xo;exports.advanceStylingOpenAtom=Yo;exports.atom=X;exports.atomWithDefault=qn;exports.atomWithStorage=fe;exports.badgeVariants=ts;exports.buttonVariants=Ae;exports.canDeleteBlock=Jn;exports.canDropBlock=Qn;exports.canDuplicateBlock=Kn;exports.canvasIframeAtom=Qo;exports.chaiBuilderPropsAtom=Ue;exports.chaiExternalDataAtom=Et;exports.createStore=kt;exports.dataProvidersAtom=Qe;exports.draggedBlockIdAtom=on;exports.draggingFlagAtom=sn;exports.editLayerNameAtom=Jo;exports.getBlockJSONFromSchemas=Le;exports.getBlockJSONFromUISchemas=Oe;exports.inlineEditingActiveAtom=tn;exports.isDevelopment=Hn;exports.networkModeAtom=Ko;exports.pageSyncStateAtom=Ee;exports.presentBlocksAtom=ee;exports.reducer=mo;exports.showPredefinedBlockCategoryAtom=Zo;exports.toast=po;exports.toggleVariants=Gt;exports.useActiveModal=Za;exports.useActivePanel=ii;exports.useAddBlock=Na;exports.useAddBlockParent=li;exports.useAddClassesToBlocks=Ba;exports.useAllBlocks=ei;exports.useAtom=On;exports.useAtomValue=Nt;exports.useBlocksContainer=xr;exports.useBlocksStore=de;exports.useBlocksStoreUndoableActions=ne;exports.useBrandingOptions=Ot;exports.useBuilderProp=me;exports.useBuilderReset=ui;exports.useCanvasWidth=_a;exports.useCanvasZoom=Pa;exports.useCopyBlockIds=Ia;exports.useCopyToClipboard=fi;exports.useCurrentPage=Lt;exports.useCutBlockIds=Fo;exports.useDarkMode=Ma;exports.useDuplicateBlocks=qo;exports.useGetPageData=qt;exports.useHiddenBlockIds=Oa;exports.useHighlightBlockId=$o;exports.usePageDataProviders=$t;exports.usePasteBlocks=Va;exports.usePreviewMode=Ua;exports.useReadOnlyMode=ni;exports.useRemoveBlocks=jr;exports.useRemoveClassesFromBlocks=$a;exports.useSavePage=yr;exports.useSelectedBlock=lr;exports.useSelectedBlockAllClasses=Ga;exports.useSelectedBlockCurrentClasses=Ya;exports.useSelectedBlockIds=be;exports.useSelectedBlocksDisplayChild=ir;exports.useSelectedBreakpoints=di;exports.useSelectedStylingBlocks=Do;exports.useSetAtom=St;exports.useStore=Ve;exports.useStylingBreakpoint=Oo;exports.useStylingState=Ka;exports.useToast=ot;exports.useUILibraryBlocks=pi;exports.useUndoManager=Xe;exports.useUpdateBlocksProps=Ja;exports.useUpdateBlocksPropsRealtime=Qa;
|