@chaibuilder/sdk 1.2.20 → 1.2.22
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-X9eh8OWJ.cjs → AddBlocks-157fSrJX.cjs} +1 -1
- package/dist/{AddBlocks-VIWJkaHJ.js → AddBlocks-WgpssWmQ.js} +2 -2
- package/dist/{BrandingOptions-5ss0k1nb.js → BrandingOptions-4961TxX2.js} +2 -2
- package/dist/{BrandingOptions-PzPdafIT.cjs → BrandingOptions-nwXR9TMl.cjs} +1 -1
- package/dist/{CanvasArea-TTGqlBKO.js → CanvasArea-MajWGr9z.js} +3 -3
- package/dist/{CanvasArea-hoyr4dfb.cjs → CanvasArea-MmTlc5Vb.cjs} +1 -1
- package/dist/{CurrentPage-EddxgHU-.cjs → CurrentPage-LpLr0lDI.cjs} +1 -1
- package/dist/{CurrentPage-a3T2uy8Q.js → CurrentPage-oPZN6Gwj.js} +3 -3
- package/dist/ListTree-dvxHTXs4.js +167 -0
- package/dist/ListTree-gTmusfso.cjs +1 -0
- package/dist/{Outline-rNFJGkap.js → Outline-2OxsXs1-.js} +3 -3
- package/dist/{Outline-3IHYlOzF.cjs → Outline-7CCnnzmK.cjs} +1 -1
- package/dist/{PagesPanel-B33hWN11.cjs → PagesPanel-8536oBWB.cjs} +1 -1
- package/dist/{PagesPanel-0bL28ofN.js → PagesPanel-pRKHw-AZ.js} +4 -4
- package/dist/{ProjectPanel-sBRkUXnY.js → ProjectPanel-iU6DY-Yp.js} +4 -4
- package/dist/{ProjectPanel-qtRTXNOP.cjs → ProjectPanel-oILsUWOH.cjs} +1 -1
- package/dist/{Settings-HgGe1ANj.js → Settings-BhSrj-cE.js} +552 -532
- package/dist/Settings-jHiYmt0y.cjs +1 -0
- package/dist/{SidePanels-R_g9rSjP.js → SidePanels-OLOUpKn4.js} +45 -45
- package/dist/{SidePanels-aAm-2A3s.cjs → SidePanels-bcJJocSq.cjs} +1 -1
- package/dist/{Topbar-cXtxVswU.cjs → Topbar-NMvzqQHW.cjs} +1 -1
- package/dist/{Topbar-AUTKpVHO.js → Topbar-Ny9T-7Zb.js} +1 -1
- package/dist/{UnsplashImages-p34UJJWJ.cjs → UnsplashImages-6tZv1q2_.cjs} +1 -1
- package/dist/{UnsplashImages-1RFHZIte.js → UnsplashImages-Y8RGFVSh.js} +1 -1
- package/dist/{UploadImages-CLfyNo1i.cjs → UploadImages-VLlVg9Ur.cjs} +1 -1
- package/dist/{UploadImages-G2orrhmZ.js → UploadImages-dd8LfyFr.js} +1 -1
- package/dist/{add-page-modal-KCy_Khfe.cjs → add-page-modal-IsqDdK7X.cjs} +1 -1
- package/dist/{add-page-modal-DUthvJNJ.js → add-page-modal-Jni6CY1x.js} +4 -4
- package/dist/{confirm-alert-T8vimDRx.cjs → confirm-alert-f26zJ7Js.cjs} +1 -1
- package/dist/{confirm-alert-nk2WQHud.js → confirm-alert-sc8RaWvD.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +2 -2
- package/dist/{delete-page-modal-WvWRQUgU.js → delete-page-modal-0WiMZFxr.js} +3 -3
- package/dist/{delete-page-modal-_pFjWLJn.cjs → delete-page-modal-c3b-GCap.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +2 -2
- package/dist/{form-kXQX4L2W.js → form-Nj6Kdn3g.js} +1 -1
- package/dist/{form-YnnWtUGk.cjs → form-n1Q6u16z.cjs} +1 -1
- package/dist/{index-e5cgISUO.cjs → index-0bwkNnA0.cjs} +2 -2
- package/dist/index-9PHdn80L.cjs +1 -0
- package/dist/{index-la4rqGKN.js → index-IPJAbzzO.js} +965 -928
- package/dist/{index-QIbDWoML.js → index-UP_4awU9.js} +2 -2
- package/dist/{index--Pt4B5bv.js → index-_VPpjzJu.js} +3 -3
- package/dist/{index-JqRQZLN5.cjs → index-nwAgi0aD.cjs} +1 -1
- package/dist/{page-viewer-s_lHBVfx.js → page-viewer-L1Dmgj-c.js} +4 -4
- package/dist/{page-viewer-6phtctz6.cjs → page-viewer-TnxHhq7S.cjs} +1 -1
- package/dist/{project-general-setting-SaNOMXEl.cjs → project-general-setting-1Ot1RU43.cjs} +1 -1
- package/dist/{project-general-setting-gj4A0X5W.js → project-general-setting-sUP7JqWK.js} +4 -4
- package/dist/{project-seo-setting-bMDdgKRZ.cjs → project-seo-setting-3-vBkx2v.cjs} +1 -1
- package/dist/{project-seo-setting-aCPg-IIc.js → project-seo-setting-NNvAGt4T.js} +2 -2
- package/dist/{single-page-detail-TP-cxVIT.js → single-page-detail-FXg_NebW.js} +5 -5
- package/dist/{single-page-detail-er8i2FIF.cjs → single-page-detail-btEKYXjE.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 +1 -1
- package/dist/{useAddBlockByDrop-_vczk5o_.js → useAddBlockByDrop-V8xo-PNQ.js} +1 -1
- package/dist/{useAddBlockByDrop-LSV8adwE.cjs → useAddBlockByDrop-qRHgy8_0.cjs} +1 -1
- package/package.json +24 -25
- package/dist/ListTree-kergCZrw.js +0 -126
- package/dist/ListTree-tADrgsqZ.cjs +0 -1
- package/dist/Settings-rXxS3RGM.cjs +0 -1
- package/dist/index-DeHH1q_1.cjs +0 -1
package/dist/index-DeHH1q_1.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const k=require("react"),i=require("lodash-es"),oe=require("./Functions-N3yhPYKY.cjs"),Se=require("@chaibuilder/runtime"),p=require("jotai"),W=require("./MODIFIERS-9EwxLM8V.cjs"),on=require("./_commonjsHelpers-wDK0ZLPo.cjs"),nn=require("@react-hookz/web"),r=require("./jsx-runtime-Z_BpKhVy.cjs"),rn=require("@radix-ui/react-toggle"),le=require("class-variance-authority"),u=require("./Class-MmCxz2Ay.cjs"),an=require("@radix-ui/react-switch"),ln=require("@radix-ui/react-slot"),cn=require("@radix-ui/react-accordion"),F=require("@radix-ui/react-icons"),dn=require("@radix-ui/react-alert-dialog"),un=require("@radix-ui/react-dialog"),mn=require("@radix-ui/react-label"),pn=require("@radix-ui/react-scroll-area"),fn=require("@radix-ui/react-tabs"),xn=require("@radix-ui/react-tooltip"),gn=require("@radix-ui/react-popover"),hn=require("@radix-ui/react-menubar"),bn=require("@radix-ui/react-hover-card"),vn=require("@radix-ui/react-select"),yn=require("@radix-ui/react-dropdown-menu"),jn=require("@radix-ui/react-separator"),wn=require("@radix-ui/react-toast"),H=require("cmdk"),Rn=require("@radix-ui/react-context-menu"),yt=require("react-icons-picker"),kn=require("react-dom"),Nn=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(rn),De=L(an),ie=L(cn),U=L(dn),B=L(un),wt=L(mn),ae=L(pn),ce=L(fn),pe=L(xn),he=L(gn),A=L(hn),Ce=L(bn),O=L(vn),T=L(yn),Rt=L(jn),K=L(wn),P=L(Rn);var z={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let Sn=0;function X(e,t){const s=`atom${++Sn}`,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 Be=e=>"init"in e,Te=e=>!!e.write,Re=new WeakMap,Cn=(e,t)=>{Re.set(e,t),e.catch(()=>{}).finally(()=>Re.delete(e))},lt=(e,t)=>{const s=Re.get(e);s&&(Re.delete(e),s(t))},ct=(e,t)=>{e.status="fulfilled",e.value=t},dt=(e,t)=>{e.status="rejected",e.reason=t},En=e=>typeof(e==null?void 0:e.then)=="function",xe=(e,t)=>"v"in e&&"v"in t&&Object.is(e.v,t.v),ut=(e,t)=>"e"in e&&"e"in t&&Object.is(e.e,t.e),ue=e=>"v"in e&&e.v instanceof Promise,An=(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);lt(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)&&An(b,w)){if(b.d===w.d)return b;w.v=b.v}return d(m,w),w},x=(m,h,j,b)=>{if(En(h)){let w;const y=new Promise((S,M)=>{let C=!1;h.then(_=>{if(!C){C=!0;const E=a(m),Q=c(m,y,j);ct(y,_),S(_),(E==null?void 0:E.d)!==Q.d&&Y(m,Q,E==null?void 0:E.d)}},_=>{if(!C){C=!0;const E=a(m),Q=c(m,y,j);dt(y,_),M(_),(E==null?void 0:E.d)!==Q.d&&Y(m,Q,E==null?void 0:E.d)}}),w=_=>{C||(C=!0,_.then(E=>ct(y,E),E=>dt(y,E)),S(_))}});return y.orig=h,y.status="pending",Cn(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&&ut(b,w)&&b.d===w.d?b:(d(m,w),w)},R=m=>{const h=a(m);if(h&&(h.d.forEach((C,_)=>{_!==m&&!t.has(_)&&R(_)}),Array.from(h.d).every(([C,_])=>{const E=a(C);return C===m||E===_||E&&!ue(E)&&xe(E,_)})))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(Be(C))return j.set(C,void 0),C.init;throw new Error("no atom init")}const _=R(C);return j.set(C,_),ye(_)};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 _=j.get(M);if(_&&j.set(M,--_),!_){let E=!!((C=h.get(M))!=null&&C.size);if(E){const Q=a(M),sn=R(M);E=!Q||!xe(Q,sn)}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(!Be(S))throw new Error("atom not writable");const _=a(S),E=x(S,M[0]);(!_||!xe(_,E))&&$(S)}else C=G(S,...M);if(!j){const _=te();(z?"production":void 0)!=="production"&&n.forEach(E=>E({type:"async-write",flushed:_}))}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)&<(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)||ut(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)Be(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 _n=()=>(Pe||(Pe=kt()),Pe);var Bn={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Tn=k.createContext(void 0),Fe=e=>{const t=k.useContext(Tn);return(e==null?void 0:e.store)||t||_n()};const Pn=e=>typeof(e==null?void 0:e.then)=="function",In=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=Fe(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),Pn(d)?In(d):d}function St(e,t){const s=Fe(t);return k.useCallback((...n)=>{if((Bn?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return s.set(e,...n)},[s,e])}function Mn(e,t){return[Nt(e,t),St(e,t)]}var Ue={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Ct=Symbol();const mt=(e,t,s)=>(t.has(s)?t:t.set(s,e())).get(s),Dn=new WeakMap,On=(e,t,s)=>{const o=mt(()=>new WeakMap,Dn,t);return mt(e,o,s)},Ln={},pt=e=>!!e.write,zn=e=>typeof e=="function";function Vn(e,t){return On(()=>{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=zn(J)?J(Y[se]):J;V(e,[...Y.slice(0,se),m,...Y.slice(se+1)])};x[N]=pt(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)});(Ue?"production":void 0)!=="production"&&(n.debugPrivate=!0),n.init=void 0;const l=pt(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||Ln)}function Fn(e){const t=Symbol(),s=X(t);(Ue?"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 Un=e=>typeof(e==null?void 0:e.then)=="function";function qn(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 Un(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 $n=qn(()=>typeof window<"u"?window.localStorage:void 0);function fe(e,t,s=$n,o){const n=o==null?void 0:o.unstable_getOnInit,l=X(n?s.getItem(e,t):t);return(Ue?"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 qe=p.atom(null);qe.debugLabel="chaiBuilderPropsAtom";const Et=p.atom({});Et.debugLabel="chaiExternalDataAtom";const Gn=()=>!1,Wn=e=>{const t=e.replace(W.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},Oe=(e,t)=>{if(!e)return!0;const s=Se.getBlockComponent(e);return s&&i.has(s,"canAcceptBlock")?s.canAcceptBlock(t):!1},Hn=(e,t)=>{const s=Se.getBlockComponent(t);return s&&i.has(s,"canBeNested")?s.canBeNested(e):!0},Yn=e=>{const t=Se.getBlockComponent(e);return t&&i.has(t,"canDuplicate")?t.canDuplicate():!0},Kn=e=>{const t=Se.getBlockComponent(e);return t&&i.has(t,"canDelete")?t.canDelete():!0},Jn=(e,{dragSource:t,dropTarget:s})=>{const o=i.get(t,"data._type",""),n=i.get(s,"data._type","");return Oe(n,o)};function At(e,t,s){const o=i.filter(e,l=>l._parent===t),n=[];for(let l=0;l<o.length;l++){const a=Bt(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(At(e,o[l]._id,d)))}else n.push({...o[l],oldId:o[l]._id,_id:oe.generateUUID(),_parent:s})}return i.flatten(n)}function _t(e){const t={};e.forEach(o=>{t[o._id]={...o,children:[]}});const s=[];return e.forEach(o=>{if(o._parent){const n=t[o._parent];n&&n.children.push(t[o._id])}else s.push(t[o._id])}),s}const Bt=e=>{const t={};return Object.keys(e).forEach(s=>{i.isString(e[s])&&e[s].startsWith("slot")&&(t[s]=e[s].replace("slot:",""))}),t},Qn=(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(At(e,t,o._id)));const l=i.flatten(n);return i.map(l,a=>{const d=a,g=Bt(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 Z=p.atom([]);Z.debugLabel="presentBlocksAtom";const Tt=p.atom(e=>{const t=e(Z);return _t([...t])});Tt.debugLabel="treeDSBlocks";Z.debugLabel="presentBlocksAtom";const $e=Vn(Z);$e.debugLabel="pageBlocksAtomsAtom";const Xn=p.atom("");Xn.debugLabel="builderActivePageAtom";const Zn=p.atom(-1);Zn.debugLabel="destinationDropIndexAtom";const Pt=p.atom([]);Pt.debugLabel="buildingBlocksAtom";const er=p.atom(e=>{const t=e(Pt);return i.filter(t,s=>i.has(s,"blockId"))});er.debugLabel="globalBlocksAtom";const Ge=p.atom([]);Ge.debugLabel="selectedBlockIdsAtom";const We=p.atom(e=>{const t=e(Z),s=e(Ge);return i.map(i.filter(t,({_id:o})=>i.includes(s,o)),o=>({...o}))});We.debugLabel="selectedBlocksAtom";const He=p.atom(e=>{const t=e(We);return t.length===0?null:t.length===1?t[0]:{type:"Multiple",id:i.map(t,"id")}});He.debugLabel="selectedBlockAtom";const tr=e=>i.get(e,"parent",null),sr=p.atom(e=>{const t=e(We),s=i.map(t,tr);return i.filter(e(Z),o=>i.includes(s,o._id))});sr.debugLabel="selectedBlocksParentsAtom";const It=p.atom(()=>!1);It.debugLabel="selectedBlockFlexChildAtom";const Mt=p.atom(()=>!1);Mt.debugLabel="selectedBlockGridChildAtom";const Ye=p.atom("");Ye.debugLabel="styleStateAtom";const Dt=fe("styleBreakpoint","xs");Dt.debugLabel="styleBreakpointAtom";const or=()=>({flexChild:p.useAtomValue(It),gridChild:p.useAtomValue(Mt)}),nr=()=>p.useAtomValue(He);const be=()=>{const[e,t]=p.useAtom(Ge),s=k.useCallback(o=>{t(n=>i.includes(n,o)?i.without(n,o):[...n,o])},[t]);return[e,t,s]},Le=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]=Le(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]=Le(a)}),n;default:return{}}},ze=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]=ze(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]=ze(g),i.set(a.items,"title",i.get(g,"itemTitle",`${l} item`))}),a;default:return{}}},Ot=e=>{if(!e)return{};const t={};return Object.keys(e).forEach(s=>{t[s]=ar(e[s])}),t},rr=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})},ar=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 Ot(e.properties);case"list":return rr(e);default:return""}};var Ke={exports:{}},ui=Ke.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})()})(Ke);var ir=Ke.exports;const lr=on.getDefaultExportFromCjs(ir),cr=p.atom(W.BRANDING_OPTIONS_DEFAULTS),dr=p.atom(null),Je=()=>{const[e,t]=p.useAtom(cr);return[i.isObject(e)?{...W.BRANDING_OPTIONS_DEFAULTS,...e}:W.BRANDING_OPTIONS_DEFAULTS,t]},ur=()=>p.useAtom(dr),mr=p.atom(null),Lt=()=>({currentPage:p.useAtomValue(mr)});function pr(e){return _t(e)}const Qe=(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,...Qe(o,s._id)])}return s}));function Xe(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&&Xe(o.children)}}function zt(e){let t=[],s=i.filter(e,{type:"GlobalBlock"});return s.length>0&&(s=i.map(s,Vt),i.each(s,o=>{t=[...t,...fr(o)]})),t}function fr(e){let t=[];const s=i.get(i.first(e),"parent",null);i.set(i.first(e),"parent",null);const o=[flatToNestedInstance.convert(Ft(e))];Xe(o,!0);let n=Qe(o,e[0]._id);return n=i.set(n,"0.parent",s),t=[...t,n,...zt(n)],t}function Vt(e){const t=i.find(Ve,{_id:e._id});if(!t)return[];const s=[t],o=i.filter(Ve,{_parent:e._id});return o.length?i.flatten([...s,...i.flatten(i.map(o,Vt))]):i.flatten(s)}const Ft=e=>JSON.parse(JSON.stringify(e));let Ve=[];function xr(e){Ve=e;const t=pr(Ft(e));Xe(t);const s=Qe(t,null),o=zt(s),n={};return i.each(o,l=>i.set(n,i.first(l).blockId,l)),[s,n]}const Ut=()=>{const[e]=Je(),{currentPage:t}=Lt(),[s]=de();return k.useCallback(()=>{const o=i.map(s,l=>i.omit(l,["expanded","order","title","siblings","tempClasses"])),[n=[]]=xr(o);return{currentPage:t,blocks:n}},[e,t,s])},me=(e,t=void 0)=>{const s=p.useAtomValue(qe);return i.get(s,e,t)},Ze=p.atom([]);Ze.debugLabel="dataProvidersAtom";const qt=()=>p.useAtom(Ze),Ee=p.atom("SAVED");Ee.debugLabel="pageSyncStateAtom";const gr=()=>{const[e,t]=p.useAtom(Ee),s=me("onSavePage",async c=>{}),o=me("onSave",async c=>{}),n=me("onSyncStatusChange",c=>{}),l=Ut(),[a]=qt(),[d]=Je();return{savePage:nn.useThrottledCallback(async()=>{t("SAVING"),n("SAVING");const c=l();return await s({blocks:c.blocks,providers:a}),await o({blocks:c.blocks,providers:a,brandingOptions:d}),setTimeout(()=>{t("SAVED"),n("SAVED")},100),!0},[l,t,d,o,n],5e3),syncState:e,setSyncState:t}},ee=new lr;ee.setLimit(50);const et=()=>{const[,e]=p.useAtom(Ee);return k.useEffect(()=>(ee.setCallback(()=>e("UNSAVED")),()=>{ee.setCallback(i.noop)}),[]),{add:ee.add,undo:ee.undo,redo:ee.redo,hasRedo:ee.hasRedo,hasUndo:ee.hasUndo,clear:ee.clear}},tt=(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:tt(o,s)},hr=()=>{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(tt(e,n)),setTimeout(()=>s(l?[l]:[]),200)},[e,s,t])};function br(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 vr=()=>{const[,e]=de();return{setNewBlocks:t=>{e(t)},addBlocks:(t,s,o)=>{e(n=>br(n,t,s,o))},removeBlocks:t=>{e(s=>tt(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(Z),ne=()=>{const{add:e}=et(),[t]=de(),{setNewBlocks:s,addBlocks:o,removeBlocks:n,updateBlocksProps:l}=vr();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)})}}},$t=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"}}),Gt=f.forwardRef(({className:e,variant:t,size:s,...o},n)=>r.jsxRuntimeExports.jsx(jt.Root,{ref:n,className:u.cn($t({variant:t,size:s,className:e})),...o}));Gt.displayName=jt.Root.displayName;const Wt=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")})}));Wt.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"}}),Ht=f.forwardRef(({className:e,variant:t,size:s,asChild:o=!1,...n},l)=>{const a=o?ln.Slot:"button";return r.jsxRuntimeExports.jsx(a,{className:u.cn(Ae({variant:t,size:s,className:e})),ref:l,...n})});Ht.displayName="Button";const yr=ie.Root,Yt=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(ie.Item,{ref:s,className:u.cn("border-b",e),...t}));Yt.displayName="AccordionItem";const Kt=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"})]})}));Kt.displayName=ie.Trigger.displayName;const Jt=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})}));Jt.displayName=ie.Content.displayName;const jr=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"}}),Qt=f.forwardRef(({className:e,variant:t,...s},o)=>r.jsxRuntimeExports.jsx("div",{ref:o,role:"alert",className:u.cn(jr({variant:t}),e),...s}));Qt.displayName="Alert";const Xt=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}));Xt.displayName="AlertTitle";const Zt=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("text-sm [&_p]:leading-relaxed",e),...t}));Zt.displayName="AlertDescription";const es=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"}}),wr=({className:e,variant:t,...s})=>r.jsxRuntimeExports.jsx("div",{className:u.cn(es({variant:t}),e),...s}),Rr=U.Root,kr=U.Trigger,ts=({className:e,...t})=>r.jsxRuntimeExports.jsx(U.Portal,{className:u.cn(e),...t});ts.displayName=U.Portal.displayName;const ss=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}));ss.displayName=U.Overlay.displayName;const os=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsxs(ts,{children:[r.jsxRuntimeExports.jsx(ss,{}),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})]}));os.displayName=U.Content.displayName;const ns=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});ns.displayName="AlertDialogHeader";const rs=({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});rs.displayName="AlertDialogFooter";const as=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Title,{ref:s,className:u.cn("text-lg font-semibold",e),...t}));as.displayName=U.Title.displayName;const is=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Description,{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));is.displayName=U.Description.displayName;const ls=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(U.Action,{ref:s,className:u.cn(Ae(),e),...t}));ls.displayName=U.Action.displayName;const cs=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}));cs.displayName=U.Cancel.displayName;const st=B.Root,ds=B.Trigger,us=({className:e,...t})=>r.jsxRuntimeExports.jsx(B.Portal,{className:u.cn(e),...t});us.displayName=B.Portal.displayName;const ms=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(B.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}));ms.displayName=B.Overlay.displayName;const _e=f.forwardRef(({className:e,children:t,...s},o)=>r.jsxRuntimeExports.jsxs(us,{children:[r.jsxRuntimeExports.jsx(ms,{}),r.jsxRuntimeExports.jsxs(B.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(B.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"})]})]})]}));_e.displayName=B.Content.displayName;const ps=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ps.displayName="DialogHeader";const fs=({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});fs.displayName="DialogFooter";const xs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(B.Title,{ref:s,className:u.cn("text-lg font-semibold leading-none tracking-tight",e),...t}));xs.displayName=B.Title.displayName;const gs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(B.Description,{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));gs.displayName=B.Description.displayName;const hs=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}));hs.displayName="Card";const bs=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}));bs.displayName="CardHeader";const vs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("h3",{ref:s,className:u.cn("font-semibold leading-none tracking-tight",e),...t}));vs.displayName="CardTitle";const ys=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("p",{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));ys.displayName="CardDescription";const js=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn("p-6 pt-0",e),...t}));js.displayName="CardContent";const ws=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx("div",{ref:s,className:u.cn(" flex items-center p-6 pt-0",e),...t}));ws.displayName="CardFooter";const Rs=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}));Rs.displayName="Input";const Nr=le.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ks=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(wt.Root,{ref:s,className:u.cn(Nr(),e),...t}));ks.displayName=wt.Root.displayName;const Ns=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}));Ns.displayName="Textarea";const Ss=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(ot,{}),r.jsxRuntimeExports.jsx(ae.Corner,{})]}));Ss.displayName=ae.Root.displayName;const ot=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"})}));ot.displayName=ae.ScrollAreaScrollbar.displayName;const Cs=ce.Root,nt=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}));nt.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 Sr=pe.Portal,Cr=pe.Provider,Er=pe.Root,Ar=pe.Trigger,Es=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}));Es.displayName=pe.Content.displayName;const _r=he.Root,Br=he.Trigger,As=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})}));As.displayName=he.Content.displayName;const Tr=A.Menu,Pr=A.Group,Ir=A.Portal,Mr=A.Sub,Dr=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 Bs=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}));Bs.displayName=A.Trigger.displayName;const Ts=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"})]}));Ts.displayName=A.SubTrigger.displayName;const Ps=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}));Ps.displayName=A.SubContent.displayName;const Is=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})}));Is.displayName=A.Content.displayName;const Ms=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}));Ms.displayName=A.Item.displayName;const Ds=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]}));Ds.displayName=A.CheckboxItem.displayName;const Os=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]}));Os.displayName=A.RadioItem.displayName;const Ls=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}));Ls.displayName=A.Label.displayName;const zs=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}));zs.displayName=A.Separator.displayName;const Vs=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Vs.displayname="MenubarShortcut";const Or=Ce.Root,Lr=Ce.Trigger,Fs=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}));Fs.displayName=Ce.Content.displayName;const zr=O.Root,Vr=O.Group,Fr=O.Value,Us=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"})})]}));Us.displayName=O.Trigger.displayName;const qs=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})})}));qs.displayName=O.Content.displayName;const $s=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}));$s.displayName=O.Label.displayName;const Gs=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})]}));Gs.displayName=O.Item.displayName;const Ws=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}));Ws.displayName=O.Separator.displayName;const Ur=B.Root,qr=B.Trigger,$r=B.Close,Hs=({className:e,...t})=>r.jsxRuntimeExports.jsx(B.Portal,{className:u.cn(e),...t});Hs.displayName=B.Portal.displayName;const Ys=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(B.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}));Ys.displayName=B.Overlay.displayName;const Gr=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"}}),Ks=f.forwardRef(({side:e="right",className:t,children:s,...o},n)=>r.jsxRuntimeExports.jsxs(Hs,{children:[r.jsxRuntimeExports.jsx(Ys,{}),r.jsxRuntimeExports.jsxs(B.Content,{ref:n,className:u.cn(Gr({side:e}),t),...o,children:[s,r.jsxRuntimeExports.jsxs(B.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"})]})]})]}));Ks.displayName=B.Content.displayName;const Js=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});Js.displayName="SheetHeader";const Qs=({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});Qs.displayName="SheetFooter";const Xs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(B.Title,{ref:s,className:u.cn("text-lg font-semibold text-foreground",e),...t}));Xs.displayName=B.Title.displayName;const Zs=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(B.Description,{ref:s,className:u.cn("text-sm text-muted-foreground",e),...t}));Zs.displayName=B.Description.displayName;const Wr=T.Root,Hr=T.Trigger,Yr=T.Group,Kr=T.Portal,Jr=T.Sub,Qr=T.RadioGroup,eo=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"})]}));eo.displayName=T.SubTrigger.displayName;const to=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}));to.displayName=T.SubContent.displayName;const so=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})}));so.displayName=T.Content.displayName;const oo=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}));oo.displayName=T.Item.displayName;const no=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]}));no.displayName=T.CheckboxItem.displayName;const ro=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]}));ro.displayName=T.RadioItem.displayName;const ao=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}));ao.displayName=T.Label.displayName;const io=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}));io.displayName=T.Separator.displayName;const lo=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest opacity-60",e),...t});lo.displayName="DropdownMenuShortcut";const co=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}));co.displayName=Rt.Root.displayName;const Xr=1,Zr=1e6;let Ie=0;function ea(){return Ie=(Ie+1)%Number.MAX_VALUE,Ie.toString()}const Me=new Map,ft=e=>{if(Me.has(e))return;const t=setTimeout(()=>{Me.delete(e),ge({type:"REMOVE_TOAST",toastId:e})},Zr);Me.set(e,t)},uo=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Xr)};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?ft(s):e.toasts.forEach(o=>{ft(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=uo(we,e),je.forEach(t=>{t(we)})}function mo({...e}){const t=ea(),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 rt(){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:mo,dismiss:s=>ge({type:"DISMISS_TOAST",toastId:s})}}const ta=K.Provider,po=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}));po.displayName=K.Viewport.displayName;const sa=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"}}),fo=f.forwardRef(({className:e,variant:t,...s},o)=>r.jsxRuntimeExports.jsx(K.Root,{ref:o,className:u.cn(sa({variant:t}),e),...s}));fo.displayName=K.Root.displayName;const oa=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}));oa.displayName=K.Action.displayName;const xo=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"})}));xo.displayName=K.Close.displayName;const go=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}));go.displayName=K.Title.displayName;const ho=f.forwardRef(({className:e,...t},s)=>r.jsxRuntimeExports.jsx(K.Description,{ref:s,className:u.cn("text-sm opacity-90",e),...t}));ho.displayName=K.Description.displayName;function na(){const{toasts:e}=rt();return r.jsxRuntimeExports.jsxs(ta,{children:[e.map(({id:t,title:s,description:o,action:n,...l})=>r.jsxRuntimeExports.jsxs(fo,{...l,children:[r.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[s&&r.jsxRuntimeExports.jsx(go,{children:s}),o&&r.jsxRuntimeExports.jsx(ho,{children:o})]}),n,r.jsxRuntimeExports.jsx(xo,{})]},t)),r.jsxRuntimeExports.jsx(po,{})]})}const ra=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.cn("animate-pulse rounded-md bg-primary/10",e),...t}),at=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}));at.displayName=H.Command.displayName;const aa=({children:e,...t})=>r.jsxRuntimeExports.jsx(st,{...t,children:r.jsxRuntimeExports.jsx(_e,{className:"overflow-hidden p-0",children:r.jsxRuntimeExports.jsx(at,{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})})}),bo=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})]}));bo.displayName=H.Command.Input.displayName;const vo=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}));vo.displayName=H.Command.List.displayName;const yo=f.forwardRef((e,t)=>r.jsxRuntimeExports.jsx(H.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));yo.displayName=H.Command.Empty.displayName;const jo=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}));jo.displayName=H.Command.Group.displayName;const wo=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}));wo.displayName=H.Command.Separator.displayName;const Ro=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}));Ro.displayName=H.Command.Item.displayName;const ko=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});ko.displayName="CommandShortcut";const ia=P.Root,la=P.Trigger,ca=P.Group,da=P.Portal,ua=P.Sub,ma=P.RadioGroup,No=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"})]}));No.displayName=P.SubTrigger.displayName;const So=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}));So.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 Eo=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}));Eo.displayName=P.Item.displayName;const Ao=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]}));Ao.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 Bo=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}));Bo.displayName=P.Label.displayName;const To=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}));To.displayName=P.Separator.displayName;const Po=({className:e,...t})=>r.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Po.displayName="ContextMenuShortcut";const pa=e=>{try{const t=document.getElementById("icon-picker-field"),s=document.createElement("div");kn.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),""}},fa=({value:e,onChange:t})=>{const s=o=>{t("<svg />");const n=pa(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"})]})},xa=k.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-p34UJJWJ.cjs"))),ga=k.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-CLfyNo1i.cjs"))),Io=({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(Cs,{value:s,onValueChange:n=>o(n),className:"flex h-full w-full flex-col py-2",children:[r.jsxRuntimeExports.jsxs(nt,{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(xa,{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(ga,{isModalView:e,onSelect:t})})})]})]})},ha=Object.freeze(Object.defineProperty({__proto__:null,default:Io},Symbol.toStringTag,{value:"Module"})),xt=({children:e,onSelect:t})=>{const[s,o]=k.useState(!1),n=(...l)=>{t.call(void 0,...l),o(!1)};return r.jsxRuntimeExports.jsxs(st,{open:s,onOpenChange:l=>o(l),children:[r.jsxRuntimeExports.jsx(ds,{asChild:!0,children:e}),r.jsxRuntimeExports.jsx(_e,{className:"flex h-3/4 max-w-5xl",children:r.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:r.jsxRuntimeExports.jsx(Io,{isModalView:!0,onSelect:n})})})]})},ba=({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(xt,{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(xt,{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)})]})]}),va=({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(Nn,{id:e,value:s,onBlur:d=>n(e,d),onChange:d=>o(d),modules:l,formats:a,placeholder:t,className:"mt-1 rounded-md"})},ya=({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"})]})]})]})},ja=()=>{const[e]=de(),[,t]=be(),{addBlocks:s}=ne(),{toast:o}=rt(),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?Oe(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=Ot(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),!Hn(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?Oe(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}},gt={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},ht=["xs","sm","md","lg","xl","2xl"];function wa(e,t){if(t===null)return"baseClasses";const s=t.mq;if(s==="xs"||t.dark||t.mod!=="")return"classes";let o="baseClasses",n=ht.indexOf(s);for(;n>0;){const l=ht[n-1];if(i.find(e,{mq:l,property:t.property})){o="classes";break}n--}return o}const bt=[];function Ra(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(bt,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)),wa(o,x)==="baseClasses"&&!i.includes(bt,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=>gt[c.mq]),"fullCls").join(" ");return`${i.map(i.sortBy([...n,...a],c=>gt[c.mq]),"fullCls").join(" ").trim()},${d.trim()}`.trim().replace(/ +/g,"")}const ve=p.atom([]);ve.debugLabel="selectedStylingBlocksAtom";const Mo=()=>p.useAtom(ve),ka=e=>{const t=e.replace(W.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},Na=p.atom(null,(e,t,{blockIds:s,newClasses:o})=>{const n=i.filter(e($e),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}=ka(g);return{ids:[d._id],props:{[l.prop]:`${W.STYLES_KEY}${Ra(x,c,o)}`}}})}),Sa=()=>{const e=p.useSetAtom(Na),{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])},Do=()=>p.useAtom(Dt),Oo=fe("canvasWidth",800),Lo=p.atom(e=>{const t=e(Oo);return oe.getBreakpointValue(t).toLowerCase()}),Ca=()=>{const[e,t]=p.useAtom(Oo),s=p.useAtomValue(Lo),[o,n]=Do();return k.useEffect(()=>{o!=="xs"&&n(s)},[s,o,n]),[e,s,t]},Ea=fe("canvasZoom",100),Aa=()=>p.useAtom(Ea),zo=p.atom([]),Vo=()=>{const[e,t]=p.useAtom(zo),s=p.useSetAtom(it),o=k.useCallback(n=>{t(n),s([])},[t,s]);return[e,o]},it=p.atom([]),_a=()=>{const[e,t]=p.useAtom(it),s=p.useSetAtom(zo),o=k.useCallback(n=>{t(n),s([])},[t,s]);return[e,o]},Fo=fe("darkMode",!1),Ba=()=>{const[e,t]=p.useAtom(Fo);return[e,t]},Uo=()=>{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=Qn(e,a,n);s(v,n,x),l.push(i.get(v,"0._id",""))}),t(l)},[e,t])},Ta=p.atom([]),Pa=()=>{const[e,t]=p.useAtom(Ta),s=k.useCallback(o=>{t(n=>i.includes(n,o)?i.without(n,o):[...n,o])},[t]);return[e,t,s]},Ia=p.atom(""),qo=()=>p.useAtom(Ia),Ma=()=>{const e=p.useAtomValue(Z);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])},Da=()=>{console.warn("usePasteBlocks is not implemented");const e=p.useAtomValue(it),[t,s]=Vo(),o=Uo(),n=Ma();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])}},Oa=p.atom(!1),La=()=>{const[e,t]=p.useAtom(Oa);return[e,t]},za=p.atom(null,(e,t,{blockIds:s,fullClasses:o})=>{const n=i.first(e(ve)),l=i.filter(e($e),a=>s.includes(e(a)._id));return i.map(l,a=>{const d=e(a),g=o;let{classes:c,baseClasses:x}=Wn(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}`}}})}),Va=()=>{const{updateBlocks:e}=ne(),t=p.useSetAtom(za);return k.useCallback((s,o)=>{const n=t({blockIds:s,fullClasses:o});e(s,n[0].props)},[t])},$o=p.atom(e=>{const t=i.first(e(ve)),s=e(He);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))}),Fa=()=>p.useAtomValue($o),vt={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},Ua=p.atom(e=>{const t=e(Lo),s=e(Ye),o=e(Fo),n=qa(t);let l=i.filter(e($o),{mod:s});return i.startsWith(s,"_")||(l=i.filter(l,a=>n.includes(a.mq))),l=l.sort((a,d)=>vt[a.mq]-vt[d.mq]),o||(l=i.filter(l,{dark:!1})),l}),qa=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},$a=()=>p.useAtomValue(Ua),Ga=()=>p.useAtom(Ye),Wa=()=>{const{updateBlocks:e}=ne();return k.useCallback((t,s,o)=>{e(t,s,o)},[e])},Ha=()=>{const{updateBlocksRuntime:e}=ne();return k.useCallback((t,s)=>{e(t,s)},[e])},Go={name:"",props:{},modalProps:{},backdropClose:!0},Ya=p.atom(Go),Ka=()=>{const[e,t]=p.useAtom(Ya),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(Go)},[t,e]);return{activeModal:e,openModal:s,closeModal:o}},Ja=()=>(console.warn("useAllBlocks is deprecated, use useBlocksStore() instead"),p.useAtomValue(Z)),Wo=p.atom(!1);Wo.debugLabel="readOnlyModeAtom";const Ho=p.atom("online");Ho.debugLabel="networkModeAtom";const Qa=p.atom(!1);Qa.debugLabel="codeEditorOpenAtom";const Yo=p.atom(!1);Yo.debugLabel="editLayerNameAtom";const Xa=p.atom("");Xa.debugLabel="activeLanguageAtom";const Za=p.atom("");Za.debugLabel="primaryLanguageAtom";const Ko=p.atom(null);Ko.debugLabel="canvasIframeAtom";const Jo=p.atom("outline");Jo.debugLabel="activePanelAtom";const Qo=p.atom("");Qo.debugLabel="showPredefinedBlockCategoryAtom";const Xo=p.atom({undoCount:0,redoCount:0});Xo.debugLabel="historyStatesAtom";const Zo=p.atom("");Zo.debugLabel="inlineEditingActiveAtom";const en=p.atom(!1);en.debugLabel="draggingFlagAtom";const tn=p.atom("");tn.debugLabel="draggedBlockIdAtom";const ei=()=>p.useAtomValue(Wo),ti=p.atom(""),si=p.atom(null),oi=()=>p.useAtom(ti),ni=()=>p.useAtom(si),ri=fe("selectedBreakpoints",["XS","MD","XL"]),ai=()=>{const[e,t]=p.useAtom(ri);return[e,t]},ii=()=>{const e=p.useSetAtom(Xo),{clear:t}=et(),[,s]=be(),[,o]=qo(),[,n]=Mo();return()=>{s([]),n([]),o(""),t(),e({undoCount:0,redoCount:0})}},li=p.atom([]),ci=()=>{const[e,t]=k.useState(!1),[s,o]=p.useAtom(li),n=me("getUILibraryBlocks",()=>[]);return k.useEffect(()=>{(async()=>s.length>0||(t(!0),o(await n()),t(!1)))()},[]),{data:s,isLoading:e}},di=()=>{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=yr;exports.AccordionContent=Jt;exports.AccordionItem=Yt;exports.AccordionTrigger=Kt;exports.Alert=Qt;exports.AlertDescription=Zt;exports.AlertDialog=Rr;exports.AlertDialogAction=ls;exports.AlertDialogCancel=cs;exports.AlertDialogContent=os;exports.AlertDialogDescription=is;exports.AlertDialogFooter=rs;exports.AlertDialogHeader=ns;exports.AlertDialogTitle=as;exports.AlertDialogTrigger=kr;exports.AlertTitle=Xt;exports.Badge=wr;exports.Button=Ht;exports.Card=hs;exports.CardContent=js;exports.CardDescription=ys;exports.CardFooter=ws;exports.CardHeader=bs;exports.CardTitle=vs;exports.Command=at;exports.CommandDialog=aa;exports.CommandEmpty=yo;exports.CommandGroup=jo;exports.CommandInput=bo;exports.CommandItem=Ro;exports.CommandList=vo;exports.CommandSeparator=wo;exports.CommandShortcut=ko;exports.ContextMenu=ia;exports.ContextMenuCheckboxItem=Ao;exports.ContextMenuContent=Co;exports.ContextMenuGroup=ca;exports.ContextMenuItem=Eo;exports.ContextMenuLabel=Bo;exports.ContextMenuPortal=da;exports.ContextMenuRadioGroup=ma;exports.ContextMenuRadioItem=_o;exports.ContextMenuSeparator=To;exports.ContextMenuShortcut=Po;exports.ContextMenuSub=ua;exports.ContextMenuSubContent=So;exports.ContextMenuSubTrigger=No;exports.ContextMenuTrigger=la;exports.Dialog=st;exports.DialogContent=_e;exports.DialogDescription=gs;exports.DialogFooter=fs;exports.DialogHeader=ps;exports.DialogTitle=xs;exports.DialogTrigger=ds;exports.DropdownMenu=Wr;exports.DropdownMenuCheckboxItem=no;exports.DropdownMenuContent=so;exports.DropdownMenuGroup=Yr;exports.DropdownMenuItem=oo;exports.DropdownMenuLabel=ao;exports.DropdownMenuPortal=Kr;exports.DropdownMenuRadioGroup=Qr;exports.DropdownMenuRadioItem=ro;exports.DropdownMenuSeparator=io;exports.DropdownMenuShortcut=lo;exports.DropdownMenuSub=Jr;exports.DropdownMenuSubContent=to;exports.DropdownMenuSubTrigger=eo;exports.DropdownMenuTrigger=Hr;exports.HoverCard=Or;exports.HoverCardContent=Fs;exports.HoverCardTrigger=Lr;exports.IconPickerField=fa;exports.ImagePickerField=ba;exports.ImagesPanel=ha;exports.Input=Rs;exports.Label=ks;exports.LinkField=ya;exports.Menubar=_s;exports.MenubarCheckboxItem=Ds;exports.MenubarContent=Is;exports.MenubarGroup=Pr;exports.MenubarItem=Ms;exports.MenubarLabel=Ls;exports.MenubarMenu=Tr;exports.MenubarPortal=Ir;exports.MenubarRadioGroup=Dr;exports.MenubarRadioItem=Os;exports.MenubarSeparator=zs;exports.MenubarShortcut=Vs;exports.MenubarSub=Mr;exports.MenubarSubContent=Ps;exports.MenubarSubTrigger=Ts;exports.MenubarTrigger=Bs;exports.Popover=_r;exports.PopoverContent=As;exports.PopoverTrigger=Br;exports.RichTextEditorField=va;exports.ScrollArea=Ss;exports.ScrollBar=ot;exports.Select=zr;exports.SelectContent=qs;exports.SelectGroup=Vr;exports.SelectItem=Gs;exports.SelectLabel=$s;exports.SelectSeparator=Ws;exports.SelectTrigger=Us;exports.SelectValue=Fr;exports.Separator=co;exports.Sheet=Ur;exports.SheetClose=$r;exports.SheetContent=Ks;exports.SheetDescription=Zs;exports.SheetFooter=Qs;exports.SheetHeader=Js;exports.SheetTitle=Xs;exports.SheetTrigger=qr;exports.Skeleton=ra;exports.Switch=Wt;exports.Tabs=Cs;exports.TabsContent=Ne;exports.TabsList=nt;exports.TabsTrigger=ke;exports.Textarea=Ns;exports.Toaster=na;exports.Toggle=Gt;exports.Tooltip=Er;exports.TooltipContent=Es;exports.TooltipPortal=Sr;exports.TooltipProvider=Cr;exports.TooltipTrigger=Ar;exports.activePanelAtom=Jo;exports.atom=X;exports.atomWithDefault=Fn;exports.atomWithStorage=fe;exports.badgeVariants=es;exports.buttonVariants=Ae;exports.canDeleteBlock=Kn;exports.canDropBlock=Jn;exports.canDuplicateBlock=Yn;exports.canvasIframeAtom=Ko;exports.chaiBuilderPropsAtom=qe;exports.chaiExternalDataAtom=Et;exports.createStore=kt;exports.dataProvidersAtom=Ze;exports.draggedBlockIdAtom=tn;exports.draggingFlagAtom=en;exports.editLayerNameAtom=Yo;exports.getBlockJSONFromSchemas=ze;exports.getBlockJSONFromUISchemas=Le;exports.inlineEditingActiveAtom=Zo;exports.isDevelopment=Gn;exports.networkModeAtom=Ho;exports.pageSyncStateAtom=Ee;exports.presentBlocksAtom=Z;exports.reducer=uo;exports.showPredefinedBlockCategoryAtom=Qo;exports.toast=mo;exports.toggleVariants=$t;exports.treeDSBlocks=Tt;exports.useActiveModal=Ka;exports.useActivePanel=oi;exports.useAddBlock=ja;exports.useAddBlockParent=ni;exports.useAddClassesToBlocks=Sa;exports.useAllBlocks=Ja;exports.useAtom=Mn;exports.useAtomValue=Nt;exports.useBlocksContainer=ur;exports.useBlocksStore=de;exports.useBlocksStoreUndoableActions=ne;exports.useBrandingOptions=Je;exports.useBuilderProp=me;exports.useBuilderReset=ii;exports.useCanvasWidth=Ca;exports.useCanvasZoom=Aa;exports.useCopyBlockIds=_a;exports.useCopyToClipboard=di;exports.useCurrentPage=Lt;exports.useCutBlockIds=Vo;exports.useDarkMode=Ba;exports.useDuplicateBlocks=Uo;exports.useGetPageData=Ut;exports.useHiddenBlockIds=Pa;exports.useHighlightBlockId=qo;exports.usePageDataProviders=qt;exports.usePasteBlocks=Da;exports.usePreviewMode=La;exports.useReadOnlyMode=ei;exports.useRemoveBlocks=hr;exports.useRemoveClassesFromBlocks=Va;exports.useSavePage=gr;exports.useSelectedBlock=nr;exports.useSelectedBlockAllClasses=Fa;exports.useSelectedBlockCurrentClasses=$a;exports.useSelectedBlockIds=be;exports.useSelectedBlocksDisplayChild=or;exports.useSelectedBreakpoints=ai;exports.useSelectedStylingBlocks=Mo;exports.useSetAtom=St;exports.useStore=Fe;exports.useStylingBreakpoint=Do;exports.useStylingState=Ga;exports.useToast=rt;exports.useUILibraryBlocks=ci;exports.useUndoManager=et;exports.useUpdateBlocksProps=Wa;exports.useUpdateBlocksPropsRealtime=Ha;
|