@chaibuilder/sdk 1.2.5 → 1.2.7
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-MKhgtI8x.cjs +1 -0
- package/dist/{AddBlocks-gbfzju1d.js → AddBlocks-pjLrzkvz.js} +52 -53
- package/dist/{BrandingOptions-mZXO7thQ.js → BrandingOptions-PXCI0z-H.js} +57 -53
- package/dist/BrandingOptions-tZaUILYP.cjs +1 -0
- package/dist/CanvasArea-C2ak1ui1.cjs +60 -0
- package/dist/{CanvasArea-WS9dnLyS.js → CanvasArea-Fhg-6_nZ.js} +407 -407
- package/dist/CurrentPage-4O-iqW3w.cjs +1 -0
- package/dist/{CurrentPage-iaGHiR2B.js → CurrentPage-Zz9LEdez.js} +15 -17
- package/dist/{Layers-V15IDskJ.js → Layers-cgmxKAP9.js} +173 -152
- package/dist/Layers-uo4KpGCs.cjs +1 -0
- package/dist/MarkAsGlobalBlock-1kOwPbPm.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-SPWd6Flk.js → MarkAsGlobalBlock-htrpRVJM.js} +6 -6
- package/dist/{PagesPanel-wfyKhLJ5.js → PagesPanel-TYBKN2Am.js} +8 -10
- package/dist/PagesPanel-z5qHpU24.cjs +1 -0
- package/dist/{ProjectPanel-aiKhpNvr.js → ProjectPanel-PJ1iPaLY.js} +15 -17
- package/dist/ProjectPanel-mEVh8sLb.cjs +1 -0
- package/dist/{Settings-JjYbPJrt.js → Settings-Na0NVS-E.js} +334 -334
- package/dist/Settings-YNxmjfAl.cjs +1 -0
- package/dist/{SidePanels-XABN8kD3.js → SidePanels-bHll6xCt.js} +99 -98
- package/dist/SidePanels-jsHvSEtM.cjs +1 -0
- package/dist/{Topbar-ks1ckGLz.js → Topbar-JKdXHH8P.js} +4 -4
- package/dist/Topbar-jWRuTvxv.cjs +1 -0
- package/dist/UnsplashImages-dBdqJNux.cjs +1 -0
- package/dist/{UnsplashImages-8vJPuqrF.js → UnsplashImages-jiOES16m.js} +7 -7
- package/dist/UploadImages-OD3RPS7j.cjs +1 -0
- package/dist/{UploadImages-6N6UrjLo.js → UploadImages-imersU7l.js} +4 -4
- package/dist/{add-page-modal-Gwhl6J1F.js → add-page-modal-EQWWxbry.js} +10 -11
- package/dist/add-page-modal-nFQ8TUBM.cjs +1 -0
- package/dist/{confirm-alert-biqvaLT-.js → confirm-alert-HOs52FKE.js} +4 -4
- package/dist/confirm-alert-j6hcFSlG.cjs +1 -0
- package/dist/{controls-XPXGHKht.js → controls-QGClapUl.js} +9 -45
- package/dist/{controls-Dy1qa8Dc.cjs → controls-hpe3HxsR.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +56 -58
- package/dist/{delete-page-modal-xGWX8RHn.js → delete-page-modal-DU388lPm.js} +21 -23
- package/dist/delete-page-modal-bkSWhTxz.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +263 -24
- package/dist/{form-Moz_psOw.js → form-7E1GY3U7.js} +1 -1
- package/dist/{form-lJhy9DEC.cjs → form-lF5eSfMe.cjs} +1 -1
- package/dist/html-to-json-JS8zQjYB.cjs +1 -0
- package/dist/{html-to-json-yjzEN9OX.js → html-to-json-lNLC8Y7D.js} +26 -27
- package/dist/{index-7mV_OcXd.js → index-7vwIQQ-T.js} +5402 -5366
- package/dist/index-98CxilGX.cjs +1 -0
- package/dist/{index-mUPP605-.cjs → index-Hf23Fq9m.cjs} +33 -33
- package/dist/{index-_OgCuSUz.js → index-WKIG_VPl.js} +1043 -1036
- package/dist/index-e0c8PmRQ.js +205 -0
- package/dist/index-gi1LIOCw.cjs +1 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +20 -22
- package/dist/mockServiceWorker.js +1 -1
- package/dist/page-viewer-6a4GFMUg.cjs +1 -0
- package/dist/{page-viewer-Xl1i1V3J.js → page-viewer-fohh_Dwv.js} +9 -11
- package/dist/{project-general-setting-8H1Rka2z.js → project-general-setting-Ryf5OhPd.js} +10 -11
- package/dist/project-general-setting-j4lKlLUE.cjs +1 -0
- package/dist/project-seo-setting-CATo4bEL.cjs +1 -0
- package/dist/{project-seo-setting-dXclexQW.js → project-seo-setting-KKOCl416.js} +6 -6
- package/dist/{single-page-detail-1hsqXV8c.js → single-page-detail-mJBo7VRe.js} +11 -12
- package/dist/single-page-detail-zms-5Fa_.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +7 -9
- package/dist/style.css +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +18 -18
- package/dist/{useAddBlockByDrop-uPXvrg4G.js → useAddBlockByDrop-CmSt8dRr.js} +1 -1
- package/dist/{useAddBlockByDrop-_nd8yZBa.cjs → useAddBlockByDrop-pVcDjcgp.cjs} +1 -1
- package/dist/{utils-AvyFzbPC.js → utils-Jw11nj1S.js} +35 -26
- package/dist/utils-j7Kg63NR.cjs +1 -0
- package/dist/web-blocks.cjs +1 -9
- package/dist/web-blocks.js +3 -1049
- package/package.json +5 -5
- package/dist/AddBlocks-wuKI1ieB.cjs +0 -1
- package/dist/BrandingOptions-arKT1zCy.cjs +0 -1
- package/dist/CanvasArea-wpskKN1H.cjs +0 -59
- package/dist/CurrentPage-X9fCVXgY.cjs +0 -1
- package/dist/Functions-7jnEwJyw.js +0 -15
- package/dist/Functions-N3yhPYKY.cjs +0 -1
- package/dist/Layers-EGhZWmvD.cjs +0 -1
- package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +0 -1
- package/dist/PagesPanel-Vla7HZkm.cjs +0 -1
- package/dist/ProjectPanel-YLS4oOuU.cjs +0 -1
- package/dist/Settings-rnHnjhZ4.cjs +0 -1
- package/dist/SidePanels-vcWHxatg.cjs +0 -1
- package/dist/Topbar-u5XKdWgQ.cjs +0 -1
- package/dist/UnsplashImages-V8oKEHfi.cjs +0 -1
- package/dist/UploadImages-eHYxwWAp.cjs +0 -1
- package/dist/add-page-modal-o5dy8nwt.cjs +0 -1
- package/dist/confirm-alert-f3DYO5Hj.cjs +0 -1
- package/dist/delete-page-modal-IO_9ZCm4.cjs +0 -1
- package/dist/html-to-json-5UoswV2Q.cjs +0 -1
- package/dist/index-IIJ_o44s.cjs +0 -1
- package/dist/page-viewer-pJFW_LaN.cjs +0 -1
- package/dist/project-general-setting-lNEoQK1n.cjs +0 -1
- package/dist/project-seo-setting-9JGBPzcA.cjs +0 -1
- package/dist/single-page-detail-VKqGt-s1.cjs +0 -1
- package/dist/utils-PTxFk6qT.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("react"),pn=require("@radix-ui/react-toggle"),ae=require("class-variance-authority"),c=require("./utils-j7Kg63NR.cjs"),fn=require("@radix-ui/react-switch"),xn=require("@radix-ui/react-slot"),gn=require("@radix-ui/react-accordion"),L=require("@radix-ui/react-icons"),bn=require("@radix-ui/react-alert-dialog"),hn=require("@radix-ui/react-dialog"),vn=require("@radix-ui/react-label"),yn=require("@radix-ui/react-scroll-area"),jn=require("@radix-ui/react-tabs"),wn=require("@radix-ui/react-tooltip"),Rn=require("@radix-ui/react-popover"),kn=require("@radix-ui/react-menubar"),Nn=require("@radix-ui/react-hover-card"),Sn=require("@radix-ui/react-select"),An=require("@radix-ui/react-dropdown-menu"),Cn=require("@radix-ui/react-separator"),En=require("@radix-ui/react-toast"),U=require("cmdk"),_n=require("@radix-ui/react-context-menu"),jt=require("react-icons-picker"),Bn=require("react-dom"),i=require("lodash-es"),Tn=require("react-quill"),u=require("jotai"),wt=require("flat-to-nested"),fe=require("redux-undo"),ke=require("@chaibuilder/runtime"),Ue=require("lodash"),F=require("./MODIFIERS-2FeVfZQ9.cjs"),Pn=require("@react-hookz/web");require("react-i18next");function D(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const f=D(w),Rt=D(pn),Le=D(fn),re=D(gn),V=D(bn),_=D(hn),kt=D(vn),oe=D(yn),ie=D(jn),de=D(wn),ge=D(Rn),C=D(kn),Ne=D(Nn),M=D(Sn),B=D(An),Nt=D(Cn),G=D(En),T=D(_n);var O={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let In=0;function K(e,t){const s=`atom${++In}`,o={toString:()=>s};return typeof e=="function"?o.read=e:(o.init=e,o.read=r=>r(o),o.write=(r,a,l)=>a(o,typeof l=="function"?l(r(o)):l)),t&&(o.write=t),o}const Pe=e=>"init"in e,Ie=e=>!!e.write,je=new WeakMap,Mn=(e,t)=>{je.set(e,t),e.catch(()=>{}).finally(()=>je.delete(e))},it=(e,t)=>{const s=je.get(e);s&&(je.delete(e),s(t))},lt=(e,t)=>{e.status="fulfilled",e.value=t},ct=(e,t)=>{e.status="rejected",e.reason=t},Dn=e=>typeof(e==null?void 0:e.then)=="function",pe=(e,t)=>"v"in e&&"v"in t&&Object.is(e.v,t.v),dt=(e,t)=>"e"in e&&"e"in t&&Object.is(e.e,t.e),ce=e=>"v"in e&&e.v instanceof Promise,On=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,he=e=>{if("e"in e)throw e.e;return e.v},St=()=>{const e=new WeakMap,t=new WeakMap,s=new Map;let o,r,a;(O?"production":void 0)!=="production"&&(o=new Set,r=new Set,a=new Set);const l=m=>e.get(m),p=(m,g)=>{(O?"production":void 0)!=="production"&&Object.freeze(g);const y=e.get(m);if(e.set(m,g),s.has(m)||s.set(m,y),y&&ce(y)){const b="v"in g?g.v instanceof Promise?g.v:Promise.resolve(g.v):Promise.reject(g.e);it(y.v,b)}},x=(m,g,y)=>{const b=new Map;let j=!1;y.forEach((v,k)=>{!v&&k===m&&(v=g),v?(b.set(k,v),g.d.get(k)!==v&&(j=!0)):(O?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(j||g.d.size!==b.size)&&(g.d=b)},d=(m,g,y)=>{const b=l(m),j={d:(b==null?void 0:b.d)||new Map,v:g};if(y&&x(m,j,y),b&&pe(b,j)&&b.d===j.d)return b;if(b&&ce(b)&&ce(j)&&On(b,j)){if(b.d===j.d)return b;j.v=b.v}return p(m,j),j},h=(m,g,y,b)=>{if(Dn(g)){let j;const v=new Promise((k,P)=>{let S=!1;g.then(E=>{if(!S){S=!0;const A=l(m),J=d(m,v,y);lt(v,E),k(E),(A==null?void 0:A.d)!==J.d&&$(m,J,A==null?void 0:A.d)}},E=>{if(!S){S=!0;const A=l(m),J=d(m,v,y);ct(v,E),P(E),(A==null?void 0:A.d)!==J.d&&$(m,J,A==null?void 0:A.d)}}),j=E=>{S||(S=!0,E.then(A=>lt(v,A),A=>ct(v,A)),k(E))}});return v.orig=g,v.status="pending",Mn(v,k=>{k&&j(k),b==null||b()}),d(m,v,y)}return d(m,g,y)},R=(m,g,y)=>{const b=l(m),j={d:(b==null?void 0:b.d)||new Map,e:g};return y&&x(m,j,y),b&&dt(b,j)&&b.d===j.d?b:(p(m,j),j)},N=m=>{const g=l(m);if(g&&(g.d.forEach((S,E)=>{E!==m&&!t.has(E)&&N(E)}),Array.from(g.d).every(([S,E])=>{const A=l(S);return S===m||A===E||A&&!ce(A)&&pe(A,E)})))return g;const y=new Map;let b=!0;const j=S=>{if(S===m){const A=l(S);if(A)return y.set(S,A),he(A);if(Pe(S))return y.set(S,void 0),S.init;throw new Error("no atom init")}const E=N(S);return y.set(S,E),he(E)};let v,k;const P={get signal(){return v||(v=new AbortController),v.signal},get setSelf(){return(O?"production":void 0)!=="production"&&!Ie(m)&&console.warn("setSelf function cannot be used with read-only atom"),!k&&Ie(m)&&(k=(...S)=>{if((O?"production":void 0)!=="production"&&b&&console.warn("setSelf function cannot be called in sync"),!b)return Q(m,...S)}),k}};try{const S=m.read(j,P);return h(m,S,y,()=>v==null?void 0:v.abort())}catch(S){return R(m,S,y)}finally{b=!1}},I=m=>he(N(m)),q=m=>{let g=t.get(m);return g||(g=Y(m)),g},z=(m,g)=>!g.l.size&&(!g.t.size||g.t.size===1&&g.t.has(m)),X=m=>{const g=t.get(m);g&&z(m,g)&&se(m)},le=m=>{const g=new Map,y=new WeakMap,b=v=>{const k=t.get(v);k==null||k.t.forEach(P=>{P!==v&&(g.set(P,(g.get(P)||new Set).add(v)),y.set(P,(y.get(P)||0)+1),b(P))})};b(m);const j=v=>{const k=t.get(v);k==null||k.t.forEach(P=>{var S;if(P!==v){let E=y.get(P);if(E&&y.set(P,--E),!E){let A=!!((S=g.get(P))!=null&&S.size);if(A){const J=l(P),mn=N(P);A=!J||!pe(J,mn)}A||g.forEach(J=>J.delete(P))}j(P)}})};j(m)},Z=(m,...g)=>{let y=!0;const b=k=>he(N(k)),j=(k,...P)=>{let S;if(k===m){if(!Pe(k))throw new Error("atom not writable");const E=l(k),A=h(k,P[0]);(!E||!pe(E,A))&&le(k)}else S=Z(k,...P);if(!y){const E=ee();(O?"production":void 0)!=="production"&&r.forEach(A=>A({type:"async-write",flushed:E}))}return S},v=m.write(b,j,...g);return y=!1,v},Q=(m,...g)=>{const y=Z(m,...g),b=ee();return(O?"production":void 0)!=="production"&&r.forEach(j=>j({type:"write",flushed:b})),y},Y=(m,g)=>{const y={t:new Set(g&&[g]),l:new Set};if(t.set(m,y),(O?"production":void 0)!=="production"&&a.add(m),N(m).d.forEach((b,j)=>{const v=t.get(j);v?v.t.add(m):j!==m&&Y(j,m)}),N(m),Ie(m)&&m.onMount){const b=m.onMount((...j)=>Q(m,...j));b&&(y.u=b)}return y},se=m=>{var g;const y=(g=t.get(m))==null?void 0:g.u;y&&y(),t.delete(m),(O?"production":void 0)!=="production"&&a.delete(m);const b=l(m);b?(ce(b)&&it(b.v),b.d.forEach((j,v)=>{if(v!==m){const k=t.get(v);k&&(k.t.delete(m),z(v,k)&&se(v))}})):(O?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",m)},$=(m,g,y)=>{const b=new Set(g.d.keys());y==null||y.forEach((j,v)=>{if(b.has(v)){b.delete(v);return}const k=t.get(v);k&&(k.t.delete(m),z(v,k)&&se(v))}),b.forEach(j=>{const v=t.get(j);v?v.t.add(m):t.has(m)&&Y(j,m)})},ee=()=>{let m;for((O?"production":void 0)!=="production"&&(m=new Set);s.size;){const g=Array.from(s);s.clear(),g.forEach(([y,b])=>{const j=l(y);if(j){j.d!==(b==null?void 0:b.d)&&$(y,j,b==null?void 0:b.d);const v=t.get(y);v&&!(b&&!ce(b)&&(pe(b,j)||dt(b,j)))&&(v.l.forEach(k=>k()),(O?"production":void 0)!=="production"&&m.add(y))}else(O?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((O?"production":void 0)!=="production")return o.forEach(g=>g("state")),m},te=(m,g)=>{const y=q(m),b=ee(),j=y.l;return j.add(g),(O?"production":void 0)!=="production"&&(o.forEach(v=>v("sub")),r.forEach(v=>v({type:"sub",flushed:b}))),()=>{j.delete(g),X(m),(O?"production":void 0)!=="production"&&(o.forEach(v=>v("unsub")),r.forEach(v=>v({type:"unsub"})))}};return(O?"production":void 0)!=="production"?{get:I,set:Q,sub:te,dev_subscribe_store:(m,g)=>g!==2?(console.warn("The current StoreListener revision is 2. The older ones are deprecated."),o.add(m),()=>{o.delete(m)}):(r.add(m),()=>{r.delete(m)}),dev_get_mounted_atoms:()=>a.values(),dev_get_atom_state:m=>e.get(m),dev_get_mounted:m=>t.get(m),dev_restore_atoms:m=>{for(const[y,b]of m)Pe(y)&&(h(y,b),le(y));const g=ee();r.forEach(y=>y({type:"restore",flushed:g}))}}:{get:I,set:Q,sub:te}};let Me;const Ln=()=>(Me||(Me=St()),Me);var Vn={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const zn=w.createContext(void 0),$e=e=>{const t=w.useContext(zn);return(e==null?void 0:e.store)||t||Ln()};const Fn=e=>typeof(e==null?void 0:e.then)=="function",qn=w.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)});function At(e,t){const s=$e(t),[[o,r,a],l]=w.useReducer(d=>{const h=s.get(e);return Object.is(d[0],h)&&d[1]===s&&d[2]===e?d:[h,s,e]},void 0,()=>[s.get(e),s,e]);let p=o;(r!==s||a!==e)&&(l(),p=s.get(e));const x=t==null?void 0:t.delay;return w.useEffect(()=>{const d=s.sub(e,()=>{if(typeof x=="number"){setTimeout(l,x);return}l()});return l(),d},[s,e,x]),w.useDebugValue(p),Fn(p)?qn(p):p}function Ct(e,t){const s=$e(t);return w.useCallback((...r)=>{if((Vn?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return s.set(e,...r)},[s,e])}function Un(e,t){return[At(e,t),Ct(e,t)]}var Ge={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Et=Symbol();function $n(e,t){const s=K(e,(o,r,a)=>r(s,t(o(s),a)));return s}const ut=(e,t,s)=>(t.has(s)?t:t.set(s,e())).get(s),Gn=new WeakMap,Hn=(e,t,s)=>{const o=ut(()=>new WeakMap,Gn,t);return ut(e,o,s)},Wn={},mt=e=>!!e.write,Yn=e=>typeof e=="function";function Kn(e,t){return Hn(()=>{const s=new WeakMap,o=(l,p)=>{let x=s.get(l);if(x)return x;const d=p&&s.get(p),h=[],R=[];return l.forEach((N,I)=>{const q=t?t(N):I;R[I]=q;const z=d&&d.atomList[d.keyList.indexOf(q)];if(z){h[I]=z;return}const X=Z=>{const Q=Z(r),Y=Z(e),$=o(Y,Q==null?void 0:Q.arr).keyList.indexOf(q);if($<0||$>=Y.length){const ee=l[o(l).keyList.indexOf(q)];if(ee)return ee;throw new Error("splitAtom: index out of bounds for read")}return Y[$]},le=(Z,Q,Y)=>{const se=Z(r),$=Z(e),te=o($,se==null?void 0:se.arr).keyList.indexOf(q);if(te<0||te>=$.length)throw new Error("splitAtom: index out of bounds for write");const m=Yn(Y)?Y($[te]):Y;Q(e,[...$.slice(0,te),m,...$.slice(te+1)])};h[I]=mt(e)?K(X,le):K(X)}),d&&d.keyList.length===R.length&&d.keyList.every((N,I)=>N===R[I])?x=d:x={arr:l,atomList:h,keyList:R},s.set(l,x),x},r=K(l=>{const p=l(r),x=l(e);return o(x,p==null?void 0:p.arr)});(Ge?"production":void 0)!=="production"&&(r.debugPrivate=!0),r.init=void 0;const a=mt(e)?K(l=>l(r).atomList,(l,p,x)=>{switch(x.type){case"remove":{const d=l(a).indexOf(x.atom);if(d>=0){const h=l(e);p(e,[...h.slice(0,d),...h.slice(d+1)])}break}case"insert":{const d=x.before?l(a).indexOf(x.before):l(a).length;if(d>=0){const h=l(e);p(e,[...h.slice(0,d),x.value,...h.slice(d)])}break}case"move":{const d=l(a).indexOf(x.atom),h=x.before?l(a).indexOf(x.before):l(a).length;if(d>=0&&h>=0){const R=l(e);d<h?p(e,[...R.slice(0,d),...R.slice(d+1,h),R[d],...R.slice(h)]):p(e,[...R.slice(0,h),R[d],...R.slice(h,d),...R.slice(d+1)])}break}}}):K(l=>l(r).atomList);return a},e,t||Wn)}function Jn(e){const t=Symbol(),s=K(t);(Ge?"production":void 0)!=="production"&&(s.debugPrivate=!0);const o=K((r,a)=>{const l=r(s);return l!==t?l:e(r,a)},(r,a,l)=>{if(l===Et)a(s,t);else if(typeof l=="function"){const p=r(o);a(s,l(p))}else a(s,l)});return o}const Qn=e=>typeof(e==null?void 0:e.then)=="function";function Xn(e){let t,s;const o={getItem:(r,a)=>{var l,p;const x=h=>{if(h=h||"",t!==h){try{s=JSON.parse(h)}catch{return a}t=h}return s},d=(p=(l=e())==null?void 0:l.getItem(r))!=null?p:null;return Qn(d)?d.then(x):x(d)},setItem:(r,a)=>{var l;return(l=e())==null?void 0:l.setItem(r,JSON.stringify(a))},removeItem:r=>{var a;return(a=e())==null?void 0:a.removeItem(r)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(o.subscribe=(r,a,l)=>{if(!(e()instanceof window.Storage))return()=>{};const p=x=>{if(x.storageArea===e()&&x.key===r){let d;try{d=JSON.parse(x.newValue||"")}catch{d=l}a(d)}};return window.addEventListener("storage",p),()=>{window.removeEventListener("storage",p)}}),o}const Zn=Xn(()=>typeof window<"u"?window.localStorage:void 0);function ue(e,t,s=Zn,o){const r=o==null?void 0:o.unstable_getOnInit,a=K(r?s.getItem(e,t):t);return(Ge?"production":void 0)!=="production"&&(a.debugPrivate=!0),a.onMount=p=>{r||p(s.getItem(e,t));let x;return s.subscribe&&(x=s.subscribe(e,p,t)),x},K(p=>p(a),(p,x,d)=>{const h=typeof d=="function"?d(p(a)):d;return h===Et?(x(a,t),s.removeItem(e)):h instanceof Promise?h.then(R=>(x(a,R),s.setItem(e,R))):(x(a,h),s.setItem(e,h))})}const Se=u.atom(null);Se.debugLabel="chaiBuilderPropsAtom";const _t=u.atom({});_t.debugLabel="chaiExternalDataAtom";const er=()=>!1,tr=e=>{const t=e.replace(F.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}};const sr=new wt({children:"blockNodes"}),Bt=(e,t=null)=>i.flatten(e.map(s=>{if(s=t!==null?{...s,parent:t}:s,s.children&&s.children.length){const o=[...s.children];return delete s.children,i.flatten([s,...Bt(o,s._id)])}return s}));function Tt(e,t,s){const o=i.filter(e,a=>a._parent===t),r=[];for(let a=0;a<o.length;a++){const l=Pt(o[a]);if(Object.keys(l).length>0&&Object.keys(l).forEach(p=>{o[a][p]=`slot:${c.generateUUID()}`}),i.filter(e,{_parent:o[a]._id}).length>0){const p=c.generateUUID();r.push({...o[a],oldId:o[a]._id,_id:p,_parent:s}),r.push(i.flatten(Tt(e,o[a]._id,p)))}else r.push({...o[a],oldId:o[a]._id,_id:c.generateUUID(),_parent:s})}return i.flatten(r)}function or(e){let t=sr.convert(e.map(s=>i.omit(s,["settings"])));return t=!t.type&&t.blockNodes?t.blockNodes:i.isEmpty(t)?[]:[t],t}const Pt=e=>{const t={};return Object.keys(e).forEach(s=>{i.isString(e[s])&&e[s].startsWith("slot")&&(t[s]=e[s].replace("slot:",""))}),t},nr=(e,t,s=null)=>{let o=i.find(e,{_id:t});o={...o,oldId:o._id,_id:c.generateUUID()},s&&(o={...o,_parent:s});const r=[o];i.filter(e,{_parent:t}).length>0&&r.push(i.flatten(Tt(e,t,o._id)));const a=i.flatten(r);return i.map(a,l=>{const p=l,x=Pt(p);return Object.keys(x).length>0&&Object.keys(x).forEach(d=>{const h=i.find(a,{oldId:x[d].replace("slot:","")});p[d]=`slot:${h._id}`}),i.omit(p,["global","oldId"])})};const rr=fe((e=[],t)=>{switch(t.type){case"add_new_blocks":case"add_duplicate_blocks":return[...e,...t.payload];case"create_snapshot":return[...e];case"set_blocks":case"set_page_blocks":return[...t.payload];case"update_props":case"update_props_realtime":const{payload:s}=t;return e.map(o=>(s.ids.includes(o._id)&&!i.isEmpty(t.payload.props)&&Object.keys(t.payload.props).forEach(r=>{i.set(o,r,t.payload.props[r])}),o));default:return e}},{debug:!1,ignoreInitialState:!1,limit:30,filter:fe.excludeAction(["update_props_realtime","add_duplicate_blocks","set_page_blocks"])}),Ae=$n({past:[],present:[],future:[]},rr);Ae.debugLabel="pageBlocksAtom";const H=u.atom(e=>{var t;return(t=e(Ae))==null?void 0:t.present});H.debugLabel="presentBlocksAtom";const He=Kn(H);He.debugLabel="pageBlocksAtomsAtom";const It=u.atom(e=>or(e(H)));It.debugLabel="pageBlocksTreeAtom";const ar=u.atom("");ar.debugLabel="builderActivePageAtom";const ir=u.atom(-1);ir.debugLabel="destinationDropIndexAtom";const Mt=u.atom([]);Mt.debugLabel="buildingBlocksAtom";const Dt=u.atom(e=>{const t=e(Mt);return i.filter(t,s=>i.has(s,"blockId"))});Dt.debugLabel="globalBlocksAtom";const W=()=>{const[,e]=u.useAtom(Ae);return e},lr=()=>{const e=W(),t=u.useAtomValue(It),s=w.useCallback(o=>{const r=Bt(o);e({type:"set_page_blocks",payload:r})},[e]);return[t,s]},cr=()=>{const e=W();return[w.useCallback(s=>{e({type:"set_page_blocks",payload:s})},[e])]},Ve=(e,t)=>{if(!e)return!0;const s=ke.getBlockComponent(e);return s&&Ue.has(s,"canAcceptBlock")?s.canAcceptBlock(t):!1},dr=e=>{const t=ke.getBlockComponent(e);return t&&Ue.has(t,"canDuplicate")?t.canDuplicate():!0},ur=e=>{const t=ke.getBlockComponent(e);return t&&Ue.has(t,"canDelete")?t.canDelete():!0},mr=(e,{dragSource:t,dropTarget:s})=>{const o=i.get(t,"data._type",""),r=i.get(s,"data._type","");return Ve(r,o)},We=u.atom([]);We.debugLabel="selectedBlockIdsAtom";const Ye=u.atom(e=>{const t=e(H),s=e(We);return i.map(i.filter(t,({_id:o})=>i.includes(s,o)),o=>({...o}))});Ye.debugLabel="selectedBlocksAtom";const Ke=u.atom(e=>{const t=e(Ye);return t.length===0?null:t.length===1?t[0]:{type:"Multiple",id:i.map(t,"id")}});Ke.debugLabel="selectedBlockAtom";const pr=e=>i.get(e,"parent",null),fr=u.atom(e=>{const t=e(Ye),s=i.map(t,pr);return i.filter(e(H),o=>i.includes(s,o._id))});fr.debugLabel="selectedBlocksParentsAtom";const Ot=u.atom(()=>!1);Ot.debugLabel="selectedBlockFlexChildAtom";const Lt=u.atom(()=>!1);Lt.debugLabel="selectedBlockGridChildAtom";const Je=u.atom("");Je.debugLabel="styleStateAtom";const Vt=ue("styleBreakpoint","xs");Vt.debugLabel="styleBreakpointAtom";const xr=()=>({flexChild:u.useAtomValue(Ot),gridChild:u.useAtomValue(Lt)}),gr=()=>u.useAtomValue(Ke);const me=()=>{const[e,t]=u.useAtom(We),s=w.useCallback(o=>{t(r=>i.includes(r,o)?i.without(r,o):[...r,o])},[t]);return[e,t,s]},ze=e=>{switch(e.type){case"singular":return e.uiSchema;case"model":const{properties:t}=e,s={};return Object.keys(t).forEach(a=>{const l=t[a];if(i.includes(["slot","styles"],l.type))return;const p=a;s[p]=ze(l)}),s;case"list":const{itemProperties:o}=e,r={items:{}};return Object.keys(o).forEach(a=>{const l=o[a];if(i.includes(["slot","styles"],l.type))return;const p=a;r.items[p]=ze(l)}),r;default:return{}}},Fe=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(p=>{const x=t[p];if(i.includes(["slot","styles"],x.type))return;const d=p;o.properties[d]=Fe(x)}),o;case"list":const{itemProperties:r,title:a}=e,l={title:a,type:"array",items:{type:"object",properties:{}}};return Object.keys(r).forEach(p=>{const x=r[p];if(i.includes(["slot","styles"],x.type))return;const d=p;l.items.properties[d]=Fe(x),i.set(l.items,"title",i.get(x,"itemTitle",`${a} item`))}),l;default:return{}}},zt=e=>{const t={};return Object.keys(e).forEach(s=>{t[s]=hr(e[s])}),t},br=e=>{if(i.isEmpty(e.default))return[];const{itemProperties:t}=e;return i.map(e.default,s=>{const o={...s};return i.forIn(s,(r,a)=>{i.has(t,a)&&i.get(t[a],"i18n",!1)&&(o[a]=F.I18N_KEY)}),o})},hr=e=>{switch(e.type){case"styles":return e.default;case"slot":return`${F.SLOT_KEY}${c.generateUUID()}`;case"singular":const{i18n:t,schema:s}=e;return t?F.I18N_KEY:i.get(s,"default","");case"model":return zt(e.properties);case"list":return br(e);default:return""}};const Ft=()=>u.useAtomValue(H);function pt(e,t,s,o,r){if(s!==null){const x=i.findIndex(e,{_parent:t}),d=(x===-1?0:x)+s;return e.splice(d,0,...o),e}if(!r){const d=i.findIndex(e,{_id:t})+1;return e.splice(d,0,...o),e}let a=i.findIndex(e,{_id:t});const l=i.filter(e,{_parent:t});i.isEmpty(l)||(a=i.findIndex(e,{_id:i.last(l)._id}));const p=a+1;return e.splice(p,0,...o),e}const vr=()=>{const e=W(),t=Ft(),[,s]=me(),o=w.useCallback((a,l,p)=>{var R;for(let N=0;N<a.length;N++){const{_id:I}=a[N];a[N]._id=c.generateUUID();const q=i.filter(a,{_parent:I});for(let z=0;z<q.length;z++)q[z]._parent=a[N]._id}const x=i.first(a);let d;l&&(d=i.find(t,{_id:l}),a[0]._parent=l);const h=d?Ve(d._type,x._type):!0;return!h&&d&&(a[0]._parent=d._parent),e({type:"set_blocks",payload:pt(t,l||null,p||null,a,h)}),s([(R=i.first(a))==null?void 0:R._id]),i.first(a)},[t,e,s]);return{addCoreBlock:w.useCallback((a,l,p)=>{if(i.has(a,"blocks")){const z=a.blocks;return o(z,l,p)}const x=c.generateUUID(),d=zt(a.props),h=[];i.forIn(d,(z,X)=>{if(i.startsWith(z,F.SLOT_KEY)){const le=z.replace(F.SLOT_KEY,"");h.push({_id:le,_type:"Slot",_parent:x,_name:a.props[X].name,_styles:a.props[X].styles,_emptyStyles:a.props[X].emptyStyles})}});const R={_type:a.type,_id:x,...d};let N;l&&(N=i.find(t,{_id:l}),R._parent=l);const I=N?Ve(N._type,a.type):!0;!I&&N&&(R._parent=N._parent);const q=[R,...h];return e({type:"set_blocks",payload:pt(t,l||null,p||null,q,I)}),s([R._id]),R},[o,t,e,s]),addPredefinedBlock:o}},ft={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},xt=["xs","sm","md","lg","xl","2xl"];function yr(e,t){if(t===null)return"baseClasses";const s=t.mq;if(s==="xs"||t.dark||t.mod!=="")return"classes";let o="baseClasses",r=xt.indexOf(s);for(;r>0;){const a=xt[r-1];if(i.find(e,{mq:a,property:t.property})){o="classes";break}r--}return o}const gt=[];function jr(e="",t="",s=[]){e=e.trim().replace(/ +/g,"");let o=i.filter(i.map(e.split(" "),c.constructClassObject),d=>!i.isNull(d)),r=i.filter(i.map(t.split(" "),c.constructClassObject),d=>!i.isNull(d));r=i.filter(r,d=>!i.includes(gt,d.property));const a=[],l=[];i.each(s,d=>{const h=c.constructClassObject(d),R=i.find(o,i.pick(h,["dark","mq","mod","property"]));if(R&&(o=i.filter(o,N=>N.fullCls!==(R==null?void 0:R.fullCls))),a.push(h),h.mq==="xs"&&!h.dark&&h.mod===""&&(r=i.filter(r,N=>N.property!==h.property)),yr(o,h)==="baseClasses"&&!i.includes(gt,h.property)){const N=i.find(r,i.pick(h,["property"]));R&&(r=i.filter(r,I=>I.fullCls!==(N==null?void 0:N.fullCls))),l.push({...h,fullCls:h.cls,mq:"xs"})}});const p=i.map(i.sortBy([...o,...a],d=>ft[d.mq]),"fullCls").join(" ");return`${i.map(i.sortBy([...r,...l],d=>ft[d.mq]),"fullCls").join(" ").trim()},${p.trim()}`.trim().replace(/ +/g,"")}const be=u.atom([]);be.debugLabel="selectedStylingBlocksAtom";const Qe=()=>u.useAtom(be),wr=e=>{const t=e.replace(F.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},Rr=u.atom(null,(e,t,{blockIds:s,newClasses:o,dispatch:r})=>{const a=i.filter(e(He),p=>s.includes(e(p)._id)),l=i.first(e(be));i.each(a,p=>{const x=e(p),d=i.get(x,l.prop,`${F.STYLES_KEY},`),{baseClasses:h,classes:R}=wr(d);r({type:"update_props_realtime",payload:{ids:[x._id],props:{[l.prop]:`${F.STYLES_KEY}${jr(R,h,o)}`}}})})}),kr=()=>{const e=W(),t=u.useSetAtom(Rr);return w.useCallback((s,o,r)=>{t({blockIds:s,newClasses:o,dispatch:e}),r&&setTimeout(()=>e({type:"create_snapshot"}),500)},[e,t])},bt=()=>{},qt=()=>{const e=ke.useChaiBlocks(),t=u.useAtomValue(Dt),s=()=>{bt()},o=w.useCallback(()=>bt(),[]);return[e,t,s,o]},Nr=u.atom(!1),Ut=()=>{const[e,t]=u.useAtom(Nr);return[e,t]},Sr=u.atom(F.BRANDING_OPTIONS_DEFAULTS),Ar=u.atom(null),$t=()=>{const[e,t]=u.useAtom(Sr);return[i.isObject(e)?{...F.BRANDING_OPTIONS_DEFAULTS,...e}:F.BRANDING_OPTIONS_DEFAULTS,t]},Cr=()=>u.useAtom(Ar),Er=u.atom(null),Gt=()=>({currentPage:u.useAtomValue(Er)}),Ht=new wt({});function _r(e){let t=Ht.convert(e);return t=!t.type&&t.children&&t.children.length?t.children:i.isEmpty(t)?[]:[t],t}const Xe=(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,...Xe(o,s._id)])}return s}));function Ze(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&&Ze(o.children)}}function Wt(e){let t=[],s=i.filter(e,{type:"GlobalBlock"});return s.length>0&&(s=i.map(s,Yt),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=[Ht.convert(Kt(e))];Ze(o,!0);let r=Xe(o,e[0]._id);return r=i.set(r,"0.parent",s),t=[...t,r,...Wt(r)],t}function Yt(e){const t=i.find(qe,{_id:e._id});if(!t)return[];const s=[t],o=i.filter(qe,{_parent:e._id});return o.length?i.flatten([...s,...i.flatten(i.map(o,Yt))]):i.flatten(s)}const Kt=e=>JSON.parse(JSON.stringify(e));let qe=[];function Tr(e){qe=e;const t=_r(Kt(e));Ze(t);const s=Xe(t,null),o=Wt(s),r={};return i.each(o,a=>i.set(r,i.first(a).blockId,a)),[s,r]}const et=()=>{const[e]=$t(),{currentPage:t}=Gt(),s=u.useAtomValue(H);return w.useCallback(()=>{const o=i.map(s,l=>i.omit(l,["expanded","order","title","siblings","tempClasses"])),[r=[],a=[]]=Tr(o);return{currentPage:t,blocks:r,globalBlocks:a}},[e,t,s])},ne=(e,t=void 0)=>{const s=u.useAtomValue(Se);return i.get(s,e,t)},Jt=u.atom(!1);Jt.debugLabel="readOnlyModeAtom";const Qt=u.atom(!1);Qt.debugLabel="advanceStylingOpenAtom";const Xt=u.atom("online");Xt.debugLabel="networkModeAtom";const Pr=u.atom(!1);Pr.debugLabel="codeEditorOpenAtom";const Zt=u.atom(!1);Zt.debugLabel="editLayerNameAtom";const Ir=u.atom("");Ir.debugLabel="activeLanguageAtom";const Mr=u.atom("");Mr.debugLabel="primaryLanguageAtom";const es=u.atom(null);es.debugLabel="canvasIframeAtom";const ts=u.atom("layers");ts.debugLabel="activePanelAtom";const ss=u.atom("");ss.debugLabel="showPredefinedBlockCategoryAtom";const Ce=u.atom({undoCount:0,redoCount:0});Ce.debugLabel="historyStatesAtom";const os=u.atom("");os.debugLabel="inlineEditingActiveAtom";const ns=u.atom(!1);ns.debugLabel="draggingFlagAtom";const rs=u.atom("");rs.debugLabel="draggedBlockIdAtom";const tt=u.atom([]);tt.debugLabel="dataProvidersAtom";const as=()=>u.useAtom(tt),Ee=u.atom("SAVED");Ee.debugLabel="pageSyncStateAtom";const Dr=()=>{const[e,t]=u.useAtom(Ee),s=ne("onSaveBlocks",async()=>{}),o=ne("onSavePage",async()=>{}),r=ne("onSyncStatusChange",()=>{}),a=et(),l=u.useSetAtom(Ce),{undoCount:p,redoCount:x}=_e(),[d]=as();return{savePage:Pn.useThrottledCallback(async()=>{t("SAVING"),r("SAVING");const R=a();return await o({blocks:R.blocks,providers:d}),setTimeout(()=>{l({undoCount:p,redoCount:x}),t("SAVED"),r("SAVED")},100),!0},[a,t,r,s],5e3),syncState:e,setSyncState:t}},_e=()=>{const e=u.useAtomValue(Ae),[{undoCount:t,redoCount:s}]=u.useAtom(Ce),o=W(),[r]=Ut(),[,a]=me(),[,l]=Qe(),[p,x]=u.useAtom(Ee),d=ne("onSyncStatusChange",()=>{}),h=w.useCallback(()=>{o({type:"create_snapshot"})},[o]);return w.useEffect(()=>{(p==="SAVED"&&t!==(e==null?void 0:e.past.length)||s!==(e==null?void 0:e.future.length))&&(x("UNSAVED"),d("UNSAVED"))},[e==null?void 0:e.past.length,e==null?void 0:e.future.length,t,s,d,x,p]),{undoCount:e==null?void 0:e.past.length,redoCount:e==null?void 0:e.future.length,undo:w.useCallback(()=>{r||(o(fe.ActionCreators.undo()),setTimeout(()=>{l([]),a([])},200))},[o,r,a,l]),redo:w.useCallback(()=>{r||(o(fe.ActionCreators.redo()),setTimeout(()=>{l([]),a([])},200))},[r,o,l,a]),clear:()=>{o(fe.ActionCreators.clearHistory())},createSnapshot:h}},is=()=>u.useAtom(Vt),ls=ue("canvasWidth",800),cs=u.atom(e=>{const t=e(ls);return c.getBreakpointValue(t).toLowerCase()}),Or=()=>{const[e,t]=u.useAtom(ls),s=u.useAtomValue(cs),[o,r]=is();return w.useEffect(()=>{o!=="xs"&&r(s)},[s,o,r]),[e,s,t]},Lr=ue("canvasZoom",100),Vr=()=>u.useAtom(Lr),ds=u.atom([]),us=()=>{const[e,t]=u.useAtom(ds),s=u.useSetAtom(st),o=w.useCallback(r=>{t(r),s([])},[t,s]);return[e,o]},st=u.atom([]),zr=()=>{const[e,t]=u.useAtom(st),s=u.useSetAtom(ds),o=w.useCallback(r=>{t(r),s([])},[t,s]);return[e,o]},ms=ue("darkMode",!1),Fr=()=>{const[e,t]=u.useAtom(ms);return[e,t]},qr=u.atom(!1),Ur=()=>{const[e,t]=u.useAtom(qr);return[e,t]},ps=()=>{const e=W(),t=u.useAtomValue(H),[,s]=me();return w.useCallback((o,r=null)=>{const a=[];i.each(o,l=>{const x=nr(t,l,r===l?null:r);a.push(i.get(x,"0._id","")),e({type:"add_duplicate_blocks",payload:x})}),s(a),e({type:"create_snapshot"})},[t,s,e])},$r=u.atom([]),Gr=()=>{const[e,t]=u.useAtom($r),s=w.useCallback(o=>{t(r=>i.includes(r,o)?i.without(r,o):[...r,o])},[t]);return[e,t,s]},Hr=u.atom(""),fs=()=>u.useAtom(Hr),Wr=()=>{const e=u.useAtomValue(H),t=W(),s=et(),[,,o]=qt();return w.useCallback(async(r,a)=>{const l=c.generateUUID(16),p=i.map(e,x=>(x._id===r&&(x._globalBlockId=l,x._name=a),x));t({type:"set_page_blocks",payload:p}),o()},[e,t,s,o])},Yr=()=>({}),Kr=()=>{const e=u.useAtomValue(H),t=W();return w.useCallback((s,o)=>{const r=i.map(e,a=>(i.includes(s,i.get(a,"_id"))&&i.set(a,"_parent",o),a));t({type:"set_blocks",payload:r})},[e,t])},Jr=()=>{const e=u.useAtomValue(st),[t,s]=us(),o=ps(),r=Kr();return{canPaste:w.useMemo(()=>t.length>0||e.length>0,[e,t]),pasteBlocks:w.useCallback(l=>{i.isEmpty(e)?r(t,l):o(e,l),s(()=>[])},[t,e,o,r,s])}},Qr=u.atom(""),Xr=()=>{const e=u.useAtomValue(Qr),t=w.useCallback(()=>{},[]),s=w.useCallback(()=>{},[]),o=w.useCallback(()=>{},[]);return{currentProject:e,createProject:o,deleteProject:t,updateProject:s}},xs=(e,t)=>{const s=[],o=i.filter(e,r=>i.includes(t,r._id)||i.includes(t,r._parent)?(s.push(r._id),!1):!0);return i.isEmpty(s)?o:xs(o,s)},Zr=()=>{const e=W(),t=u.useAtomValue(H),[s,o]=me();return w.useCallback(r=>{var p;const a=((p=i.find(t,{_id:r[0]}))==null?void 0:p._parent)||null,l=xs(t,r);e({type:"set_blocks",payload:l}),setTimeout(()=>o(a?[a]:[]),200)},[t,o,e,s])},ea=u.atom(null,(e,t,{blockIds:s,fullClasses:o,dispatch:r})=>{const a=i.first(e(be)),l=i.filter(e(He),p=>s.includes(e(p)._id));i.each(l,p=>{const x=e(p),d=o;let{classes:h,baseClasses:R}=tr(i.get(x,a.prop,"styles:,"));i.each(d,N=>{const I=new RegExp(`(^| )${N.replace("[","\\[").replace("]","\\]")}($| )`,"g");h=h.replace(I," ").replace(/ +/g," ").trim();const q=i.first(N.split(":"));i.includes(["2xl","xl","lg","md","sm"],q)&&d.push(N.split(":").pop().trim())}),i.each(d,N=>{const I=new RegExp(`(^| )${N.replace("[","\\[").replace("]","\\]")}($| )`,"g");R=R.replace(I," ").replace(/ +/g," ").trim()}),r({type:"update_props_realtime",payload:{ids:[x._id],props:{[a.prop]:`${F.STYLES_KEY}${R},${h}`}}})})}),ta=()=>{const e=W(),t=u.useSetAtom(ea);return w.useCallback((s,o)=>{t({blockIds:s,fullClasses:o,dispatch:e}),setTimeout(()=>e({type:"create_snapshot"}))},[e,t])},gs=u.atom(e=>{const t=i.first(e(be)),s=e(Ke);if(!t||t.blockId!==i.get(s,"_id",null))return[];const r=i.get(s,t.prop,`${F.STYLES_KEY},`).replace(F.STYLES_KEY,"").split(",").join(" ");return i.filter(i.map(r.trim().split(" "),c.constructClassObject),a=>!i.isNull(a))}),sa=()=>u.useAtomValue(gs),ht={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},oa=u.atom(e=>{const t=e(cs),s=e(Je),o=e(ms),r=na(t);let a=i.filter(e(gs),{mod:s});return i.startsWith(s,"_")||(a=i.filter(a,l=>r.includes(l.mq))),a=a.sort((l,p)=>ht[l.mq]-ht[p.mq]),o||(a=i.filter(a,{dark:!1})),a}),na=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},ra=()=>u.useAtomValue(oa),aa=()=>u.useAtom(Je),bs=u.atom(null,(e,t,{blockIds:s,props:o,dispatch:r})=>{r({type:"update_props_realtime",payload:{ids:s,props:o}})}),ia=()=>{const{createSnapshot:e}=_e(),t=W(),s=u.useSetAtom(bs);return w.useCallback((o,r)=>{s({blockIds:o,props:r,dispatch:t}),e()},[e,t,s])},la=()=>{const e=W(),t=u.useSetAtom(bs);return w.useCallback((s,o)=>{t({blockIds:s,props:o,dispatch:e})},[e,t])},hs={name:"",props:{},modalProps:{},backdropClose:!0},ca=u.atom(hs),da=()=>{const[e,t]=u.useAtom(ca),s=w.useCallback((r,a={},l={})=>{t({name:r,props:a,modalProps:l})},[t]),o=w.useCallback((...r)=>{i.get(e,"props.onClose",()=>{})(...r),t(hs)},[t,e]);return{activeModal:e,openModal:s,closeModal:o}},ua=()=>u.useAtomValue(Jt),ma=u.atom(""),pa=u.atom(null),fa=()=>u.useAtom(ma),xa=()=>u.useAtom(pa),ga=ue("selectedBreakpoints",["XS","MD","XL"]),ba=()=>{const[e,t]=u.useAtom(ga);return[e,t]},ha=()=>{const e=u.useSetAtom(Ce),{clear:t}=_e(),[,s]=me(),[,o]=fs(),[,r]=Qe();return()=>{s([]),r([]),o(""),t(),e({undoCount:0,redoCount:0})}},va=u.atom({en:{}}),ya=()=>{const[e,t]=u.useAtom(va),s=w.useCallback((o,r,a)=>{i.set(e,`${o}.${r}`,a),t(e)},[e,t]);return[e,s]},ja=(e,t)=>{const[s]=u.useAtom(Se);return i.get(s,e,t)},wa=u.atom([]),Ra=()=>{const[e,t]=w.useState(!1),[s,o]=u.useAtom(wa),r=ne("getUILibraryBlocks",()=>[]);return w.useEffect(()=>{(async()=>s.length>0||(t(!0),o(await r()),t(!1)))()},[]),{data:s,isLoading:e}},vs=ae.cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),ys=f.forwardRef(({className:e,variant:t,size:s,...o},r)=>n.jsxRuntimeExports.jsx(Rt.Root,{ref:r,className:c.cn(vs({variant:t,size:s,className:e})),...o}));ys.displayName=Rt.Root.displayName;const js=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(Le.Root,{className:c.cn("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",e),...t,ref:s,children:n.jsxRuntimeExports.jsx(Le.Thumb,{className:c.cn("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950")})}));js.displayName=Le.Root.displayName;const Be=ae.cva("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ws=f.forwardRef(({className:e,variant:t,size:s,asChild:o=!1,...r},a)=>{const l=o?xn.Slot:"button";return n.jsxRuntimeExports.jsx(l,{className:c.cn(Be({variant:t,size:s,className:e})),ref:a,...r})});ws.displayName="Button";const ka=re.Root,Rs=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(re.Item,{ref:s,className:c.cn("border-b",e),...t}));Rs.displayName="AccordionItem";const ks=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsx(re.Header,{className:"flex",children:n.jsxRuntimeExports.jsxs(re.Trigger,{ref:o,className:c.cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...s,children:[t,n.jsxRuntimeExports.jsx(L.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));ks.displayName=re.Trigger.displayName;const Ns=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsx(re.Content,{ref:o,className:c.cn("text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...s,children:n.jsxRuntimeExports.jsx("div",{className:"pb-4 pt-0",children:t})}));Ns.displayName=re.Content.displayName;const Na=ae.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"}}),Ss=f.forwardRef(({className:e,variant:t,...s},o)=>n.jsxRuntimeExports.jsx("div",{ref:o,role:"alert",className:c.cn(Na({variant:t}),e),...s}));Ss.displayName="Alert";const As=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("h5",{ref:s,className:c.cn("mb-1 font-medium leading-none tracking-tight",e),...t}));As.displayName="AlertTitle";const Cs=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("text-sm [&_p]:leading-relaxed",e),...t}));Cs.displayName="AlertDescription";const Es=ae.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"}}),Sa=({className:e,variant:t,...s})=>n.jsxRuntimeExports.jsx("div",{className:c.cn(Es({variant:t}),e),...s}),Aa=V.Root,Ca=V.Trigger,_s=({className:e,...t})=>n.jsxRuntimeExports.jsx(V.Portal,{className:c.cn(e),...t});_s.displayName=V.Portal.displayName;const Bs=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Overlay,{className:c.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));Bs.displayName=V.Overlay.displayName;const Ts=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsxs(_s,{children:[n.jsxRuntimeExports.jsx(Bs,{}),n.jsxRuntimeExports.jsx(V.Content,{ref:s,className:c.cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...t})]}));Ts.displayName=V.Content.displayName;const Ps=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ps.displayName="AlertDialogHeader";const Is=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Is.displayName="AlertDialogFooter";const Ms=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Title,{ref:s,className:c.cn("text-lg font-semibold",e),...t}));Ms.displayName=V.Title.displayName;const Ds=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Ds.displayName=V.Description.displayName;const Os=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Action,{ref:s,className:c.cn(Be(),e),...t}));Os.displayName=V.Action.displayName;const Ls=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.Cancel,{ref:s,className:c.cn(Be({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ls.displayName=V.Cancel.displayName;const ot=_.Root,Vs=_.Trigger,zs=({className:e,...t})=>n.jsxRuntimeExports.jsx(_.Portal,{className:c.cn(e),...t});zs.displayName=_.Portal.displayName;const Fs=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Overlay,{ref:s,className:c.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Fs.displayName=_.Overlay.displayName;const Te=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(zs,{children:[n.jsxRuntimeExports.jsx(Fs,{}),n.jsxRuntimeExports.jsxs(_.Content,{ref:o,className:c.cn("fixed left-[50%] top-[50%] z-[999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...s,children:[t,n.jsxRuntimeExports.jsxs(_.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[n.jsxRuntimeExports.jsx(L.Cross2Icon,{className:"h-4 w-4"}),n.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Te.displayName=_.Content.displayName;const qs=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});qs.displayName="DialogHeader";const Us=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Us.displayName="DialogFooter";const $s=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Title,{ref:s,className:c.cn("text-lg font-semibold leading-none tracking-tight",e),...t}));$s.displayName=_.Title.displayName;const Gs=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Gs.displayName=_.Description.displayName;const Hs=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Hs.displayName="Card";const Ws=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("flex flex-col space-y-1.5 p-6",e),...t}));Ws.displayName="CardHeader";const Ys=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("h3",{ref:s,className:c.cn("font-semibold leading-none tracking-tight",e),...t}));Ys.displayName="CardTitle";const Ks=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("p",{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Ks.displayName="CardDescription";const Js=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn("p-6 pt-0",e),...t}));Js.displayName="CardContent";const Qs=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("div",{ref:s,className:c.cn(" flex items-center p-6 pt-0",e),...t}));Qs.displayName="CardFooter";const Xs=f.forwardRef(({className:e,type:t,...s},o)=>n.jsxRuntimeExports.jsx("input",{type:t,className:c.cn("flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...s}));Xs.displayName="Input";const Ea=ae.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Zs=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(kt.Root,{ref:s,className:c.cn(Ea(),e),...t}));Zs.displayName=kt.Root.displayName;const eo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("textarea",{className:c.cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...t}));eo.displayName="Textarea";const to=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(oe.Root,{ref:o,className:c.cn("relative overflow-hidden",e),...s,children:[n.jsxRuntimeExports.jsx(oe.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),n.jsxRuntimeExports.jsx(nt,{}),n.jsxRuntimeExports.jsx(oe.Corner,{})]}));to.displayName=oe.Root.displayName;const nt=f.forwardRef(({className:e,orientation:t="vertical",...s},o)=>n.jsxRuntimeExports.jsx(oe.ScrollAreaScrollbar,{ref:o,orientation:t,className:c.cn("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",e),...s,children:n.jsxRuntimeExports.jsx(oe.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));nt.displayName=oe.ScrollAreaScrollbar.displayName;const so=ie.Root,rt=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ie.List,{ref:s,className:c.cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));rt.displayName=ie.List.displayName;const we=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ie.Trigger,{ref:s,className:c.cn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));we.displayName=ie.Trigger.displayName;const Re=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ie.Content,{ref:s,className:c.cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Re.displayName=ie.Content.displayName;const _a=de.Portal,Ba=de.Provider,Ta=de.Root,Pa=de.Trigger,oo=f.forwardRef(({className:e,sideOffset:t=4,...s},o)=>n.jsxRuntimeExports.jsx(de.Content,{ref:o,sideOffset:t,className:c.cn("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s}));oo.displayName=de.Content.displayName;const Ia=ge.Root,Ma=ge.Trigger,no=f.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},r)=>n.jsxRuntimeExports.jsx(ge.Portal,{children:n.jsxRuntimeExports.jsx(ge.Content,{ref:r,align:t,sideOffset:s,className:c.cn("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));no.displayName=ge.Content.displayName;const Da=C.Menu,Oa=C.Group,La=C.Portal,Va=C.Sub,za=C.RadioGroup,ro=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.Root,{ref:s,className:c.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",e),...t}));ro.displayName=C.Root.displayName;const ao=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.Trigger,{ref:s,className:c.cn("flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e),...t}));ao.displayName=C.Trigger.displayName;const io=f.forwardRef(({className:e,inset:t,children:s,...o},r)=>n.jsxRuntimeExports.jsxs(C.SubTrigger,{ref:r,className:c.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[s,n.jsxRuntimeExports.jsx(L.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));io.displayName=C.SubTrigger.displayName;const lo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.SubContent,{ref:s,className:c.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));lo.displayName=C.SubContent.displayName;const co=f.forwardRef(({className:e,align:t="start",alignOffset:s=-4,sideOffset:o=8,...r},a)=>n.jsxRuntimeExports.jsx(C.Portal,{children:n.jsxRuntimeExports.jsx(C.Content,{ref:a,align:t,alignOffset:s,sideOffset:o,className:c.cn("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));co.displayName=C.Content.displayName;const uo=f.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(C.Item,{ref:o,className:c.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));uo.displayName=C.Item.displayName;const mo=f.forwardRef(({className:e,children:t,checked:s,...o},r)=>n.jsxRuntimeExports.jsxs(C.CheckboxItem,{ref:r,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(C.ItemIndicator,{children:n.jsxRuntimeExports.jsx(L.CheckIcon,{className:"h-4 w-4"})})}),t]}));mo.displayName=C.CheckboxItem.displayName;const po=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(C.RadioItem,{ref:o,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(C.ItemIndicator,{children:n.jsxRuntimeExports.jsx(L.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));po.displayName=C.RadioItem.displayName;const fo=f.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(C.Label,{ref:o,className:c.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));fo.displayName=C.Label.displayName;const xo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",e),...t}));xo.displayName=C.Separator.displayName;const go=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});go.displayname="MenubarShortcut";const Fa=Ne.Root,qa=Ne.Trigger,bo=f.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},r)=>n.jsxRuntimeExports.jsx(Ne.Content,{ref:r,align:t,sideOffset:s,className:c.cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));bo.displayName=Ne.Content.displayName;const Ua=M.Root,$a=M.Group,Ga=M.Value,ho=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(M.Trigger,{ref:o,className:c.cn("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...s,children:[t,n.jsxRuntimeExports.jsx(M.Icon,{asChild:!0,children:n.jsxRuntimeExports.jsx(L.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));ho.displayName=M.Trigger.displayName;const vo=f.forwardRef(({className:e,children:t,position:s="popper",...o},r)=>n.jsxRuntimeExports.jsx(M.Portal,{children:n.jsxRuntimeExports.jsx(M.Content,{ref:r,className:c.cn("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:s,...o,children:n.jsxRuntimeExports.jsx(M.Viewport,{className:c.cn("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));vo.displayName=M.Content.displayName;const yo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(M.Label,{ref:s,className:c.cn("px-2 py-1.5 text-sm font-semibold",e),...t}));yo.displayName=M.Label.displayName;const jo=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(M.Item,{ref:o,className:c.cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(M.ItemIndicator,{children:n.jsxRuntimeExports.jsx(L.CheckIcon,{className:"h-4 w-4"})})}),n.jsxRuntimeExports.jsx(M.ItemText,{children:t})]}));jo.displayName=M.Item.displayName;const wo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(M.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",e),...t}));wo.displayName=M.Separator.displayName;const Ha=_.Root,Wa=_.Trigger,Ya=_.Close,Ro=({className:e,...t})=>n.jsxRuntimeExports.jsx(_.Portal,{className:c.cn(e),...t});Ro.displayName=_.Portal.displayName;const ko=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Overlay,{className:c.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));ko.displayName=_.Overlay.displayName;const Ka=ae.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"}}),No=f.forwardRef(({side:e="right",className:t,children:s,...o},r)=>n.jsxRuntimeExports.jsxs(Ro,{children:[n.jsxRuntimeExports.jsx(ko,{}),n.jsxRuntimeExports.jsxs(_.Content,{ref:r,className:c.cn(Ka({side:e}),t),...o,children:[s,n.jsxRuntimeExports.jsxs(_.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[n.jsxRuntimeExports.jsx(L.Cross2Icon,{className:"h-4 w-4"}),n.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));No.displayName=_.Content.displayName;const So=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});So.displayName="SheetHeader";const Ao=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ao.displayName="SheetFooter";const Co=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Title,{ref:s,className:c.cn("text-lg font-semibold text-foreground",e),...t}));Co.displayName=_.Title.displayName;const Eo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Description,{ref:s,className:c.cn("text-sm text-muted-foreground",e),...t}));Eo.displayName=_.Description.displayName;const Ja=B.Root,Qa=B.Trigger,Xa=B.Group,Za=B.Portal,ei=B.Sub,ti=B.RadioGroup,_o=f.forwardRef(({className:e,inset:t,children:s,...o},r)=>n.jsxRuntimeExports.jsxs(B.SubTrigger,{ref:r,className:c.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...o,children:[s,n.jsxRuntimeExports.jsx(L.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));_o.displayName=B.SubTrigger.displayName;const Bo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(B.SubContent,{ref:s,className:c.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Bo.displayName=B.SubContent.displayName;const To=f.forwardRef(({className:e,sideOffset:t=4,...s},o)=>n.jsxRuntimeExports.jsx(B.Portal,{children:n.jsxRuntimeExports.jsx(B.Content,{ref:o,sideOffset:t,className:c.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));To.displayName=B.Content.displayName;const Po=f.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(B.Item,{ref:o,className:c.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));Po.displayName=B.Item.displayName;const Io=f.forwardRef(({className:e,children:t,checked:s,...o},r)=>n.jsxRuntimeExports.jsxs(B.CheckboxItem,{ref:r,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(B.ItemIndicator,{children:n.jsxRuntimeExports.jsx(L.CheckIcon,{className:"h-4 w-4"})})}),t]}));Io.displayName=B.CheckboxItem.displayName;const Mo=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(B.RadioItem,{ref:o,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(B.ItemIndicator,{children:n.jsxRuntimeExports.jsx(L.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Mo.displayName=B.RadioItem.displayName;const Do=f.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(B.Label,{ref:o,className:c.cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));Do.displayName=B.Label.displayName;const Oo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(B.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-muted",e),...t}));Oo.displayName=B.Separator.displayName;const Lo=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest opacity-60",e),...t});Lo.displayName="DropdownMenuShortcut";const Vo=f.forwardRef(({className:e,orientation:t="horizontal",decorative:s=!0,...o},r)=>n.jsxRuntimeExports.jsx(Nt.Root,{ref:r,decorative:s,orientation:t,className:c.cn("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Vo.displayName=Nt.Root.displayName;const si=1,oi=1e6;let De=0;function ni(){return De=(De+1)%Number.MAX_VALUE,De.toString()}const Oe=new Map,vt=e=>{if(Oe.has(e))return;const t=setTimeout(()=>{Oe.delete(e),xe({type:"REMOVE_TOAST",toastId:e})},oi);Oe.set(e,t)},zo=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,si)};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?vt(s):e.toasts.forEach(o=>{vt(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===s||s===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)}}},ve=[];let ye={toasts:[]};function xe(e){ye=zo(ye,e),ve.forEach(t=>{t(ye)})}function Fo({...e}){const t=ni(),s=r=>xe({type:"UPDATE_TOAST",toast:{...r,id:t}}),o=()=>xe({type:"DISMISS_TOAST",toastId:t});return xe({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:r=>{r||o()}}}),{id:t,dismiss:o,update:s}}function qo(){const[e,t]=f.useState(ye);return f.useEffect(()=>(ve.push(t),()=>{const s=ve.indexOf(t);s>-1&&ve.splice(s,1)}),[e]),{...e,toast:Fo,dismiss:s=>xe({type:"DISMISS_TOAST",toastId:s})}}const ri=G.Provider,Uo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(G.Viewport,{ref:s,className:c.cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Uo.displayName=G.Viewport.displayName;const ai=ae.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"}}),$o=f.forwardRef(({className:e,variant:t,...s},o)=>n.jsxRuntimeExports.jsx(G.Root,{ref:o,className:c.cn(ai({variant:t}),e),...s}));$o.displayName=G.Root.displayName;const ii=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(G.Action,{ref:s,className:c.cn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));ii.displayName=G.Action.displayName;const Go=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(G.Close,{ref:s,className:c.cn("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:n.jsxRuntimeExports.jsx(L.Cross2Icon,{className:"h-4 w-4"})}));Go.displayName=G.Close.displayName;const Ho=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(G.Title,{ref:s,className:c.cn("text-sm font-semibold [&+div]:text-xs",e),...t}));Ho.displayName=G.Title.displayName;const Wo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(G.Description,{ref:s,className:c.cn("text-sm opacity-90",e),...t}));Wo.displayName=G.Description.displayName;function li(){const{toasts:e}=qo();return n.jsxRuntimeExports.jsxs(ri,{children:[e.map(({id:t,title:s,description:o,action:r,...a})=>n.jsxRuntimeExports.jsxs($o,{...a,children:[n.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[s&&n.jsxRuntimeExports.jsx(Ho,{children:s}),o&&n.jsxRuntimeExports.jsx(Wo,{children:o})]}),r,n.jsxRuntimeExports.jsx(Go,{})]},t)),n.jsxRuntimeExports.jsx(Uo,{})]})}const ci=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("animate-pulse rounded-md bg-primary/10",e),...t}),at=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Command,{ref:s,className:c.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));at.displayName=U.Command.displayName;const di=({children:e,...t})=>n.jsxRuntimeExports.jsx(ot,{...t,children:n.jsxRuntimeExports.jsx(Te,{className:"overflow-hidden p-0",children:n.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})})}),Yo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[n.jsxRuntimeExports.jsx(L.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),n.jsxRuntimeExports.jsx(U.Command.Input,{ref:s,className:c.cn("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Yo.displayName=U.Command.Input.displayName;const Ko=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Command.List,{ref:s,className:c.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Ko.displayName=U.Command.List.displayName;const Jo=f.forwardRef((e,t)=>n.jsxRuntimeExports.jsx(U.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Jo.displayName=U.Command.Empty.displayName;const Qo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Command.Group,{ref:s,className:c.cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Qo.displayName=U.Command.Group.displayName;const Xo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Command.Separator,{ref:s,className:c.cn("-mx-1 h-px bg-border",e),...t}));Xo.displayName=U.Command.Separator.displayName;const Zo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Command.Item,{ref:s,className:c.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Zo.displayName=U.Command.Item.displayName;const en=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});en.displayName="CommandShortcut";const ui=T.Root,mi=T.Trigger,pi=T.Group,fi=T.Portal,xi=T.Sub,gi=T.RadioGroup,tn=f.forwardRef(({className:e,inset:t,children:s,...o},r)=>n.jsxRuntimeExports.jsxs(T.SubTrigger,{ref:r,className:c.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...o,children:[s,n.jsxRuntimeExports.jsx(L.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));tn.displayName=T.SubTrigger.displayName;const sn=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(T.SubContent,{ref:s,className:c.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));sn.displayName=T.SubContent.displayName;const on=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(T.Portal,{children:n.jsxRuntimeExports.jsx(T.Content,{ref:s,className:c.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));on.displayName=T.Content.displayName;const nn=f.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(T.Item,{ref:o,className:c.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...s}));nn.displayName=T.Item.displayName;const rn=f.forwardRef(({className:e,children:t,checked:s,...o},r)=>n.jsxRuntimeExports.jsxs(T.CheckboxItem,{ref:r,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(T.ItemIndicator,{children:n.jsxRuntimeExports.jsx(L.CheckIcon,{className:"h-4 w-4"})})}),t]}));rn.displayName=T.CheckboxItem.displayName;const an=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(T.RadioItem,{ref:o,className:c.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(T.ItemIndicator,{children:n.jsxRuntimeExports.jsx(L.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));an.displayName=T.RadioItem.displayName;const ln=f.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(T.Label,{ref:o,className:c.cn("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...s}));ln.displayName=T.Label.displayName;const cn=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(T.Separator,{ref:s,className:c.cn("-mx-1 my-1 h-px bg-border",e),...t}));cn.displayName=T.Separator.displayName;const dn=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:c.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});dn.displayName="ContextMenuShortcut";const bi=e=>{try{const t=document.getElementById("icon-picker-field"),s=document.createElement("div");Bn.render(n.jsxRuntimeExports.jsx(jt.IconPickerItem,{value:e}),s),t.appendChild(s),s.hidden=!0;let o=s.innerHTML;setTimeout(()=>t.removeChild(s),1e3);const a=new DOMParser().parseFromString(o,"image/svg+xml"),l=a.querySelector("svg");return l&&(l.removeAttribute("width"),l.removeAttribute("height")),new XMLSerializer().serializeToString(a)}catch{return""}},hi=({value:e,onChange:t,onBlur:s,id:o})=>{const r=a=>{t("<svg />");const l=bi(a);t(l),s(o,l)};return n.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[n.jsxRuntimeExports.jsxs("div",{className:"relative h-12 w-12 group",children:[n.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e==null?void 0:e.replace("<svg",'<svg class="h-5 w-5"')},className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white z-0"}),n.jsxRuntimeExports.jsx(jt,{value:e?"BiSolidGrid":null,onChange:r,pickButtonStyle:{position:"relative",height:"48px",width:"48px",border:"1px solid #BBBBBB",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",backgroundColor:"transparent",zIndex:1},searchInputStyle:{backgroundColor:"transparent",width:"100%",border:"1px solid #BBBBBB",margin:"0px 10px",padding:"10px"}})]}),n.jsxRuntimeExports.jsx("textarea",{value:e,onChange:a=>t(a.target.value),className:"h-full border w-full rounded-sm border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",placeholder:"Choose icon or enter svg"})]})},vi=w.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-dBdqJNux.cjs"))),yi=w.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-OD3RPS7j.cjs"))),un=({isModalView:e=!1,onSelect:t=()=>{}})=>{const[s,o]=w.useState("upload");return n.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[n.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:n.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:e?"Select or upload images":"Images"})}),n.jsxRuntimeExports.jsxs(so,{value:s,onValueChange:r=>o(r),className:"flex h-full w-full flex-col py-2",children:[n.jsxRuntimeExports.jsxs(rt,{className:"w-full",children:[n.jsxRuntimeExports.jsx(we,{value:"upload",className:"w-1/2",children:"Upload"}),n.jsxRuntimeExports.jsx(we,{value:"unsplash",className:"w-1/2",children:"Unsplash"})]}),s==="unsplash"?n.jsxRuntimeExports.jsx(Re,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:n.jsxRuntimeExports.jsx(w.Suspense,{fallback:n.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:n.jsxRuntimeExports.jsx(vi,{isModalView:e,onSelect:t})})}):n.jsxRuntimeExports.jsx(Re,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:n.jsxRuntimeExports.jsx(w.Suspense,{fallback:n.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:n.jsxRuntimeExports.jsx(yi,{isModalView:e,onSelect:t})})})]})]})},ji=Object.freeze(Object.defineProperty({__proto__:null,default:un},Symbol.toStringTag,{value:"Module"})),yt=({children:e,onSelect:t})=>{const[s,o]=w.useState(!1),r=(...a)=>{t.call(void 0,...a),o(!1)};return n.jsxRuntimeExports.jsxs(ot,{open:s,onOpenChange:a=>o(a),children:[n.jsxRuntimeExports.jsx(Vs,{asChild:!0,children:e}),n.jsxRuntimeExports.jsx(Te,{className:"flex h-3/4 max-w-5xl",children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:n.jsxRuntimeExports.jsx(un,{isModalView:!0,onSelect:r})})})]})},wi=({value:e,onChange:t,id:s,onBlur:o})=>n.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[e?n.jsxRuntimeExports.jsx("img",{src:e,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):n.jsxRuntimeExports.jsx(yt,{onSelect:t,children:n.jsxRuntimeExports.jsx("div",{className:"h-20 w-20 cursor-pointer rounded-md border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px] hover:border-gray-400"})}),n.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[n.jsxRuntimeExports.jsx(yt,{onSelect:t,children:n.jsxRuntimeExports.jsx("small",{className:"cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700",children:e||!i.isEmpty(e)?"Replace Image":"Choose Image"})}),n.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"}),n.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:e,onBlur:({target:{value:r}})=>o(s,r),onChange:r=>t(r.target.value)})]})]}),Ri=({id:e,placeholder:t,value:s,onChange:o,onBlur:r})=>{const a={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},l=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:n.jsxRuntimeExports.jsx(Tn,{id:e,value:s,onBlur:p=>r(e,p),onChange:p=>o(p),modules:a,formats:l,placeholder:t,className:"mt-1 rounded-md"})},ki=({schema:e,formData:t,onChange:s})=>{const[o,r]=w.useState([]),a=ne("getPages",()=>[]),{type:l="page",href:p="",target:x="self"}=t;return w.useEffect(()=>{(async()=>{const d=await a();r(d||[])})()},[]),n.jsxRuntimeExports.jsxs("div",{children:[n.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(e==null?void 0:e.title)??"Link"}),n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[n.jsxRuntimeExports.jsx("select",{name:"type",value:l,onChange:d=>s({...t,type:d.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(d=>n.jsxRuntimeExports.jsx("option",{value:d.const,children:d.title},d.const))}),l==="page"?n.jsxRuntimeExports.jsxs("select",{name:"href",placeholder:"Choose Page",value:p,onChange:d=>s({...t,href:d.target.value}),children:[n.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),i.map(o,d=>n.jsxRuntimeExports.jsx("option",{value:d.slug,children:d.name},d.uuid))]}):n.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:p,onChange:d=>s({...t,href:d.target.value}),placeholder:l==="page"||l==="url"?"Enter URL":l==="scroll"?"#ElementID":"Enter detail"}),(l==="page"||l==="url")&&n.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[n.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:x==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>s({...t,target:x==="_blank"?"_self":"_blank"})}),n.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})};exports.Accordion=ka;exports.AccordionContent=Ns;exports.AccordionItem=Rs;exports.AccordionTrigger=ks;exports.Alert=Ss;exports.AlertDescription=Cs;exports.AlertDialog=Aa;exports.AlertDialogAction=Os;exports.AlertDialogCancel=Ls;exports.AlertDialogContent=Ts;exports.AlertDialogDescription=Ds;exports.AlertDialogFooter=Is;exports.AlertDialogHeader=Ps;exports.AlertDialogTitle=Ms;exports.AlertDialogTrigger=Ca;exports.AlertTitle=As;exports.Badge=Sa;exports.Button=ws;exports.Card=Hs;exports.CardContent=Js;exports.CardDescription=Ks;exports.CardFooter=Qs;exports.CardHeader=Ws;exports.CardTitle=Ys;exports.Command=at;exports.CommandDialog=di;exports.CommandEmpty=Jo;exports.CommandGroup=Qo;exports.CommandInput=Yo;exports.CommandItem=Zo;exports.CommandList=Ko;exports.CommandSeparator=Xo;exports.CommandShortcut=en;exports.ContextMenu=ui;exports.ContextMenuCheckboxItem=rn;exports.ContextMenuContent=on;exports.ContextMenuGroup=pi;exports.ContextMenuItem=nn;exports.ContextMenuLabel=ln;exports.ContextMenuPortal=fi;exports.ContextMenuRadioGroup=gi;exports.ContextMenuRadioItem=an;exports.ContextMenuSeparator=cn;exports.ContextMenuShortcut=dn;exports.ContextMenuSub=xi;exports.ContextMenuSubContent=sn;exports.ContextMenuSubTrigger=tn;exports.ContextMenuTrigger=mi;exports.Dialog=ot;exports.DialogContent=Te;exports.DialogDescription=Gs;exports.DialogFooter=Us;exports.DialogHeader=qs;exports.DialogTitle=$s;exports.DialogTrigger=Vs;exports.DropdownMenu=Ja;exports.DropdownMenuCheckboxItem=Io;exports.DropdownMenuContent=To;exports.DropdownMenuGroup=Xa;exports.DropdownMenuItem=Po;exports.DropdownMenuLabel=Do;exports.DropdownMenuPortal=Za;exports.DropdownMenuRadioGroup=ti;exports.DropdownMenuRadioItem=Mo;exports.DropdownMenuSeparator=Oo;exports.DropdownMenuShortcut=Lo;exports.DropdownMenuSub=ei;exports.DropdownMenuSubContent=Bo;exports.DropdownMenuSubTrigger=_o;exports.DropdownMenuTrigger=Qa;exports.HoverCard=Fa;exports.HoverCardContent=bo;exports.HoverCardTrigger=qa;exports.IconPickerField=hi;exports.ImagePickerField=wi;exports.ImagesPanel=ji;exports.Input=Xs;exports.Label=Zs;exports.LinkField=ki;exports.Menubar=ro;exports.MenubarCheckboxItem=mo;exports.MenubarContent=co;exports.MenubarGroup=Oa;exports.MenubarItem=uo;exports.MenubarLabel=fo;exports.MenubarMenu=Da;exports.MenubarPortal=La;exports.MenubarRadioGroup=za;exports.MenubarRadioItem=po;exports.MenubarSeparator=xo;exports.MenubarShortcut=go;exports.MenubarSub=Va;exports.MenubarSubContent=lo;exports.MenubarSubTrigger=io;exports.MenubarTrigger=ao;exports.Popover=Ia;exports.PopoverContent=no;exports.PopoverTrigger=Ma;exports.RichTextEditorField=Ri;exports.ScrollArea=to;exports.ScrollBar=nt;exports.Select=Ua;exports.SelectContent=vo;exports.SelectGroup=$a;exports.SelectItem=jo;exports.SelectLabel=yo;exports.SelectSeparator=wo;exports.SelectTrigger=ho;exports.SelectValue=Ga;exports.Separator=Vo;exports.Sheet=Ha;exports.SheetClose=Ya;exports.SheetContent=No;exports.SheetDescription=Eo;exports.SheetFooter=Ao;exports.SheetHeader=So;exports.SheetTitle=Co;exports.SheetTrigger=Wa;exports.Skeleton=ci;exports.Switch=js;exports.Tabs=so;exports.TabsContent=Re;exports.TabsList=rt;exports.TabsTrigger=we;exports.Textarea=eo;exports.Toaster=li;exports.Toggle=ys;exports.Tooltip=Ta;exports.TooltipContent=oo;exports.TooltipPortal=_a;exports.TooltipProvider=Ba;exports.TooltipTrigger=Pa;exports.activePanelAtom=ts;exports.advanceStylingOpenAtom=Qt;exports.atom=K;exports.atomWithDefault=Jn;exports.atomWithStorage=ue;exports.badgeVariants=Es;exports.buttonVariants=Be;exports.canDeleteBlock=ur;exports.canDropBlock=mr;exports.canDuplicateBlock=dr;exports.canvasIframeAtom=es;exports.chaiBuilderPropsAtom=Se;exports.chaiExternalDataAtom=_t;exports.createStore=St;exports.dataProvidersAtom=tt;exports.draggedBlockIdAtom=rs;exports.draggingFlagAtom=ns;exports.editLayerNameAtom=Zt;exports.getBlockJSONFromSchemas=Fe;exports.getBlockJSONFromUISchemas=ze;exports.inlineEditingActiveAtom=os;exports.isDevelopment=er;exports.networkModeAtom=Xt;exports.pageSyncStateAtom=Ee;exports.presentBlocksAtom=H;exports.reducer=zo;exports.showPredefinedBlockCategoryAtom=ss;exports.toast=Fo;exports.toggleVariants=vs;exports.useActiveModal=da;exports.useActivePanel=fa;exports.useAddBlock=vr;exports.useAddBlockParent=xa;exports.useAddClassesToBlocks=kr;exports.useAllBlocks=Ft;exports.useAtom=Un;exports.useAtomValue=At;exports.useBlocksContainer=Cr;exports.useBrandingOptions=$t;exports.useBuilderProp=ne;exports.useBuilderReset=ha;exports.useBuildingBlocks=qt;exports.useCanvasHistory=_e;exports.useCanvasWidth=Or;exports.useCanvasZoom=Vr;exports.useCopyBlockIds=zr;exports.useCurrentPage=Gt;exports.useCutBlockIds=us;exports.useDarkMode=Fr;exports.useDeveloperPreviewMode=Ur;exports.useDuplicateBlocks=ps;exports.useFeatureSupport=ja;exports.useGetPageData=et;exports.useHiddenBlockIds=Gr;exports.useHighlightBlockId=fs;exports.useMarkAsGlobalBlock=Wr;exports.useMoveBlocks=Yr;exports.usePageDataProviders=as;exports.usePasteBlocks=Jr;exports.usePreviewMode=Ut;exports.useProject=Xr;exports.useReadOnlyMode=ua;exports.useRemoveBlocks=Zr;exports.useRemoveClassesFromBlocks=ta;exports.useSavePage=Dr;exports.useSelectedBlock=gr;exports.useSelectedBlockAllClasses=sa;exports.useSelectedBlockCurrentClasses=ra;exports.useSelectedBlockIds=me;exports.useSelectedBlocksDisplayChild=xr;exports.useSelectedBreakpoints=ba;exports.useSelectedStylingBlocks=Qe;exports.useSetAllBlocks=cr;exports.useSetAtom=Ct;exports.useStore=$e;exports.useStylingBreakpoint=is;exports.useStylingState=aa;exports.useToast=qo;exports.useTranslations=ya;exports.useTreeData=lr;exports.useUILibraryBlocks=Ra;exports.useUpdateBlocksProps=ia;exports.useUpdateBlocksPropsRealtime=la;
|