@chaibuilder/sdk 1.2.6 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/{AddBlocks-gbfzju1d.js → AddBlocks-tMxKPoen.js} +50 -50
  2. package/dist/{AddBlocks-wuKI1ieB.cjs → AddBlocks-x2LkOHSj.cjs} +1 -1
  3. package/dist/BrandingOptions-EzT9UYd6.cjs +1 -0
  4. package/dist/{BrandingOptions-mZXO7thQ.js → BrandingOptions-QJJ1y5ez.js} +55 -50
  5. package/dist/{CanvasArea-7GpvsKP6.js → CanvasArea-EfZgx-gN.js} +406 -404
  6. package/dist/CanvasArea-rIDwPHl5.cjs +60 -0
  7. package/dist/{CurrentPage-tHBommaV.cjs → CurrentPage-QNFPD078.cjs} +1 -1
  8. package/dist/{CurrentPage-C52wu_r7.js → CurrentPage-ulHTz4MD.js} +7 -7
  9. package/dist/{Layers-NDtp2-im.js → Layers-rehZkz78.js} +171 -148
  10. package/dist/Layers-v-7k3W2I.cjs +1 -0
  11. package/dist/{MarkAsGlobalBlock-SPWd6Flk.js → MarkAsGlobalBlock-BjP-Rqlf.js} +6 -5
  12. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +1 -0
  13. package/dist/{PagesPanel-qV7yGT-K.js → PagesPanel-acGVGJf-.js} +5 -5
  14. package/dist/{PagesPanel-qZ_-tybb.cjs → PagesPanel-x5ms_LOD.cjs} +1 -1
  15. package/dist/{ProjectPanel-vzyFbBNU.cjs → ProjectPanel-5BHQ5ANP.cjs} +1 -1
  16. package/dist/{ProjectPanel-RJqNz-uq.js → ProjectPanel-aLFJq49M.js} +5 -5
  17. package/dist/Settings-iOjfw5NQ.cjs +1 -0
  18. package/dist/{Settings-t0I7LKxe.js → Settings-v-txwlII.js} +172 -171
  19. package/dist/{SidePanels-rXx-fGjB.js → SidePanels-Vdc-J5wK.js} +96 -93
  20. package/dist/SidePanels-t0g9ZQFT.cjs +1 -0
  21. package/dist/Topbar-V8xCetWF.cjs +1 -0
  22. package/dist/{Topbar-ks1ckGLz.js → Topbar-j4t4AgCq.js} +4 -3
  23. package/dist/{UnsplashImages-8vJPuqrF.js → UnsplashImages-41Y3q5_Q.js} +7 -6
  24. package/dist/UnsplashImages-DbHky6cj.cjs +1 -0
  25. package/dist/UploadImages-DnQ95_NW.cjs +1 -0
  26. package/dist/{UploadImages-6N6UrjLo.js → UploadImages-xBg-kbKv.js} +13 -12
  27. package/dist/{add-page-modal-a8r8poMY.cjs → add-page-modal-0YAI9dXr.cjs} +1 -1
  28. package/dist/{add-page-modal-2VlONTs5.js → add-page-modal-6DlGzdA4.js} +5 -5
  29. package/dist/{confirm-alert-f3DYO5Hj.cjs → confirm-alert-U7-NcG7G.cjs} +1 -1
  30. package/dist/{confirm-alert-biqvaLT-.js → confirm-alert-i4pM3mOt.js} +4 -3
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.js +19 -19
  33. package/dist/{delete-page-modal-_8O4RCkG.js → delete-page-modal-T_rlQfNd.js} +4 -4
  34. package/dist/{delete-page-modal-NmwHGjZP.cjs → delete-page-modal-qXpi_2xR.cjs} +1 -1
  35. package/dist/email-blocks.cjs +1 -1
  36. package/dist/email-blocks.js +263 -24
  37. package/dist/{form-Moz_psOw.js → form-OVmsLOrc.js} +1 -1
  38. package/dist/{form-lJhy9DEC.cjs → form-VbouZlAW.cjs} +1 -1
  39. package/dist/html-to-json-2PeOCVey.cjs +1 -0
  40. package/dist/{html-to-json-yjzEN9OX.js → html-to-json-57841sEK.js} +25 -26
  41. package/dist/{index-482XFRhB.js → index-EGUphg4R.js} +5402 -5366
  42. package/dist/index-H6vIwGfD.cjs +1 -0
  43. package/dist/index-e0c8PmRQ.js +205 -0
  44. package/dist/index-gi1LIOCw.cjs +1 -0
  45. package/dist/{index-3OU9zl6c.cjs → index-jw8RxsTv.cjs} +33 -33
  46. package/dist/{index-_OgCuSUz.js → index-niHREMmR.js} +1051 -1043
  47. package/dist/lib.cjs +1 -1
  48. package/dist/lib.js +20 -21
  49. package/dist/mockServiceWorker.js +1 -1
  50. package/dist/{page-viewer-ajtG_WZC.js → page-viewer-EoYYnA56.js} +5 -5
  51. package/dist/{page-viewer-k2VlWE3T.cjs → page-viewer-Ou8vDXGV.cjs} +1 -1
  52. package/dist/{project-general-setting-tAgCjUtR.cjs → project-general-setting-92q4oEYv.cjs} +1 -1
  53. package/dist/{project-general-setting-TIHLI4Qg.js → project-general-setting-DC_nADG-.js} +5 -5
  54. package/dist/{project-seo-setting-9JGBPzcA.cjs → project-seo-setting-Snn2nZgS.cjs} +1 -1
  55. package/dist/{project-seo-setting-dXclexQW.js → project-seo-setting-wxAGEkd_.js} +8 -7
  56. package/dist/{single-page-detail-6btKDNjs.cjs → single-page-detail-QmmhR_h2.cjs} +1 -1
  57. package/dist/{single-page-detail-lST7hWvC.js → single-page-detail-xtNZ9YxX.js} +6 -6
  58. package/dist/studio.cjs +1 -1
  59. package/dist/studio.js +4 -4
  60. package/dist/style.css +1 -1
  61. package/dist/ui.cjs +1 -1
  62. package/dist/ui.js +134 -133
  63. package/dist/{useAddBlockByDrop-uPXvrg4G.js → useAddBlockByDrop-_nwI4W3q.js} +1 -1
  64. package/dist/{useAddBlockByDrop-_nd8yZBa.cjs → useAddBlockByDrop-inkD7Lck.cjs} +1 -1
  65. package/dist/web-blocks.cjs +2 -2
  66. package/dist/web-blocks.js +138 -139
  67. package/package.json +5 -5
  68. package/dist/BrandingOptions-arKT1zCy.cjs +0 -1
  69. package/dist/CanvasArea-jvwkPvtQ.cjs +0 -59
  70. package/dist/Layers-4G-0aNk9.cjs +0 -1
  71. package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +0 -1
  72. package/dist/Settings-SV08lVcH.cjs +0 -1
  73. package/dist/SidePanels-TOJotvzn.cjs +0 -1
  74. package/dist/Topbar-u5XKdWgQ.cjs +0 -1
  75. package/dist/UnsplashImages-V8oKEHfi.cjs +0 -1
  76. package/dist/UploadImages-eHYxwWAp.cjs +0 -1
  77. package/dist/html-to-json-5UoswV2Q.cjs +0 -1
  78. package/dist/index-IIJ_o44s.cjs +0 -1
@@ -1 +0,0 @@
1
- "use strict";const n=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("react"),pn=require("@radix-ui/react-toggle"),ie=require("class-variance-authority"),u=require("./utils-PTxFk6qT.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"),yt=require("react-icons-picker"),Bn=require("react-dom"),i=require("lodash-es"),Pn=require("react-quill"),d=require("jotai"),jt=require("flat-to-nested"),X=require("./Functions-N3yhPYKY.cjs"),xe=require("redux-undo"),F=require("./MODIFIERS-2FeVfZQ9.cjs"),Tn=require("@chaibuilder/runtime"),In=require("@react-hookz/web");require("react-i18next");function D(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const f=D(w),wt=D(pn),Le=D(fn),ae=D(gn),V=D(bn),_=D(hn),Rt=D(vn),ne=D(yn),le=D(jn),ue=D(wn),be=D(Rn),C=D(kn),Ne=D(Nn),M=D(Sn),B=D(An),kt=D(Cn),G=D(En),P=D(_n);var O={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let Mn=0;function K(e,t){const s=`atom${++Mn}`,o={toString:()=>s};return typeof e=="function"?o.read=e:(o.init=e,o.read=r=>r(o),o.write=(r,a,l)=>a(o,typeof l=="function"?l(r(o)):l)),t&&(o.write=t),o}const Te=e=>"init"in e,Ie=e=>!!e.write,we=new WeakMap,Dn=(e,t)=>{we.set(e,t),e.catch(()=>{}).finally(()=>we.delete(e))},at=(e,t)=>{const s=we.get(e);s&&(we.delete(e),s(t))},it=(e,t)=>{e.status="fulfilled",e.value=t},lt=(e,t)=>{e.status="rejected",e.reason=t},On=e=>typeof(e==null?void 0:e.then)=="function",fe=(e,t)=>"v"in e&&"v"in t&&Object.is(e.v,t.v),ct=(e,t)=>"e"in e&&"e"in t&&Object.is(e.e,t.e),de=e=>"v"in e&&e.v instanceof Promise,Ln=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,ve=e=>{if("e"in e)throw e.e;return e.v},Nt=()=>{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&&de(y)){const b="v"in g?g.v instanceof Promise?g.v:Promise.resolve(g.v):Promise.reject(g.e);at(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)},c=(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&&fe(b,j)&&b.d===j.d)return b;if(b&&de(b)&&de(j)&&Ln(b,j)){if(b.d===j.d)return b;j.v=b.v}return p(m,j),j},h=(m,g,y,b)=>{if(On(g)){let j;const v=new Promise((k,T)=>{let S=!1;g.then(E=>{if(!S){S=!0;const A=l(m),J=c(m,v,y);it(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=c(m,v,y);lt(v,E),T(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=>it(v,A),A=>lt(v,A)),k(E))}});return v.orig=g,v.status="pending",Dn(v,k=>{k&&j(k),b==null||b()}),c(m,v,y)}return c(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&&ct(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&&!de(A)&&fe(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),ve(A);if(Te(S))return y.set(S,void 0),S.init;throw new Error("no atom init")}const E=N(S);return y.set(S,E),ve(E)};let v,k;const T={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,T);return h(m,S,y,()=>v==null?void 0:v.abort())}catch(S){return R(m,S,y)}finally{b=!1}},I=m=>ve(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)),Z=m=>{const g=t.get(m);g&&z(m,g)&&oe(m)},ce=m=>{const g=new Map,y=new WeakMap,b=v=>{const k=t.get(v);k==null||k.t.forEach(T=>{T!==v&&(g.set(T,(g.get(T)||new Set).add(v)),y.set(T,(y.get(T)||0)+1),b(T))})};b(m);const j=v=>{const k=t.get(v);k==null||k.t.forEach(T=>{var S;if(T!==v){let E=y.get(T);if(E&&y.set(T,--E),!E){let A=!!((S=g.get(T))!=null&&S.size);if(A){const J=l(T),mn=N(T);A=!J||!fe(J,mn)}A||g.forEach(J=>J.delete(T))}j(T)}})};j(m)},ee=(m,...g)=>{let y=!0;const b=k=>ve(N(k)),j=(k,...T)=>{let S;if(k===m){if(!Te(k))throw new Error("atom not writable");const E=l(k),A=h(k,T[0]);(!E||!fe(E,A))&&ce(k)}else S=ee(k,...T);if(!y){const E=te();(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=ee(m,...g),b=te();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},oe=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?(de(b)&&at(b.v),b.d.forEach((j,v)=>{if(v!==m){const k=t.get(v);k&&(k.t.delete(m),z(v,k)&&oe(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)&&oe(v))}),b.forEach(j=>{const v=t.get(j);v?v.t.add(m):t.has(m)&&Y(j,m)})},te=()=>{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&&!de(b)&&(fe(b,j)||ct(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},se=(m,g)=>{const y=q(m),b=te(),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),Z(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:se,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)Te(y)&&(h(y,b),ce(y));const g=te();r.forEach(y=>y({type:"restore",flushed:g}))}}:{get:I,set:Q,sub:se}};let Me;const Vn=()=>(Me||(Me=Nt()),Me);var zn={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Fn=w.createContext(void 0),Ue=e=>{const t=w.useContext(Fn);return(e==null?void 0:e.store)||t||Vn()};const qn=e=>typeof(e==null?void 0:e.then)=="function",Un=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 St(e,t){const s=Ue(t),[[o,r,a],l]=w.useReducer(c=>{const h=s.get(e);return Object.is(c[0],h)&&c[1]===s&&c[2]===e?c:[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 c=s.sub(e,()=>{if(typeof x=="number"){setTimeout(l,x);return}l()});return l(),c},[s,e,x]),w.useDebugValue(p),qn(p)?Un(p):p}function At(e,t){const s=Ue(t);return w.useCallback((...r)=>{if((zn?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return s.set(e,...r)},[s,e])}function $n(e,t){return[St(e,t),At(e,t)]}var $e={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Ct=Symbol();function Gn(e,t){const s=K(e,(o,r,a)=>r(s,t(o(s),a)));return s}const dt=(e,t,s)=>(t.has(s)?t:t.set(s,e())).get(s),Hn=new WeakMap,Wn=(e,t,s)=>{const o=dt(()=>new WeakMap,Hn,t);return dt(e,o,s)},Yn={},ut=e=>!!e.write,Kn=e=>typeof e=="function";function Jn(e,t){return Wn(()=>{const s=new WeakMap,o=(l,p)=>{let x=s.get(l);if(x)return x;const c=p&&s.get(p),h=[],R=[];return l.forEach((N,I)=>{const q=t?t(N):I;R[I]=q;const z=c&&c.atomList[c.keyList.indexOf(q)];if(z){h[I]=z;return}const Z=ee=>{const Q=ee(r),Y=ee(e),$=o(Y,Q==null?void 0:Q.arr).keyList.indexOf(q);if($<0||$>=Y.length){const te=l[o(l).keyList.indexOf(q)];if(te)return te;throw new Error("splitAtom: index out of bounds for read")}return Y[$]},ce=(ee,Q,Y)=>{const oe=ee(r),$=ee(e),se=o($,oe==null?void 0:oe.arr).keyList.indexOf(q);if(se<0||se>=$.length)throw new Error("splitAtom: index out of bounds for write");const m=Kn(Y)?Y($[se]):Y;Q(e,[...$.slice(0,se),m,...$.slice(se+1)])};h[I]=ut(e)?K(Z,ce):K(Z)}),c&&c.keyList.length===R.length&&c.keyList.every((N,I)=>N===R[I])?x=c: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)});($e?"production":void 0)!=="production"&&(r.debugPrivate=!0),r.init=void 0;const a=ut(e)?K(l=>l(r).atomList,(l,p,x)=>{switch(x.type){case"remove":{const c=l(a).indexOf(x.atom);if(c>=0){const h=l(e);p(e,[...h.slice(0,c),...h.slice(c+1)])}break}case"insert":{const c=x.before?l(a).indexOf(x.before):l(a).length;if(c>=0){const h=l(e);p(e,[...h.slice(0,c),x.value,...h.slice(c)])}break}case"move":{const c=l(a).indexOf(x.atom),h=x.before?l(a).indexOf(x.before):l(a).length;if(c>=0&&h>=0){const R=l(e);c<h?p(e,[...R.slice(0,c),...R.slice(c+1,h),R[c],...R.slice(h)]):p(e,[...R.slice(0,h),R[c],...R.slice(h,c),...R.slice(c+1)])}break}}}):K(l=>l(r).atomList);return a},e,t||Yn)}function Qn(e){const t=Symbol(),s=K(t);($e?"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===Ct)a(s,t);else if(typeof l=="function"){const p=r(o);a(s,l(p))}else a(s,l)});return o}const Xn=e=>typeof(e==null?void 0:e.then)=="function";function Zn(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},c=(p=(l=e())==null?void 0:l.getItem(r))!=null?p:null;return Xn(c)?c.then(x):x(c)},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 c;try{c=JSON.parse(x.newValue||"")}catch{c=l}a(c)}};return window.addEventListener("storage",p),()=>{window.removeEventListener("storage",p)}}),o}const er=Zn(()=>typeof window<"u"?window.localStorage:void 0);function me(e,t,s=er,o){const r=o==null?void 0:o.unstable_getOnInit,a=K(r?s.getItem(e,t):t);return($e?"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,c)=>{const h=typeof c=="function"?c(p(a)):c;return h===Ct?(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=d.atom(null);Se.debugLabel="chaiBuilderPropsAtom";const Et=d.atom({});Et.debugLabel="chaiExternalDataAtom";const tr=()=>!1,sr=e=>{const t=e.replace(F.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}};const or=new jt({children:"blockNodes"}),_t=(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,..._t(o,s._id)])}return s}));function Bt(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:${X.generateUUID()}`}),i.filter(e,{_parent:o[a]._id}).length>0){const p=X.generateUUID();r.push({...o[a],oldId:o[a]._id,_id:p,_parent:s}),r.push(i.flatten(Bt(e,o[a]._id,p)))}else r.push({...o[a],oldId:o[a]._id,_id:X.generateUUID(),_parent:s})}return i.flatten(r)}function nr(e){let t=or.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},rr=(e,t,s=null)=>{let o=i.find(e,{_id:t});o={...o,oldId:o._id,_id:X.generateUUID()},s&&(o={...o,_parent:s});const r=[o];i.filter(e,{_parent:t}).length>0&&r.push(i.flatten(Bt(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(c=>{const h=i.find(a,{oldId:x[c].replace("slot:","")});p[c]=`slot:${h._id}`}),i.omit(p,["global","oldId"])})};const ar=xe((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:xe.excludeAction(["update_props_realtime","add_duplicate_blocks","set_page_blocks"])}),Ae=Gn({past:[],present:[],future:[]},ar);Ae.debugLabel="pageBlocksAtom";const H=d.atom(e=>{var t;return(t=e(Ae))==null?void 0:t.present});H.debugLabel="presentBlocksAtom";const Ge=Jn(H);Ge.debugLabel="pageBlocksAtomsAtom";const Tt=d.atom(e=>nr(e(H)));Tt.debugLabel="pageBlocksTreeAtom";const ir=d.atom("");ir.debugLabel="builderActivePageAtom";const lr=d.atom(-1);lr.debugLabel="destinationDropIndexAtom";const It=d.atom([]);It.debugLabel="buildingBlocksAtom";const Mt=d.atom(e=>{const t=e(It);return i.filter(t,s=>i.has(s,"blockId"))});Mt.debugLabel="globalBlocksAtom";const W=()=>{const[,e]=d.useAtom(Ae);return e},cr=()=>{const e=W(),t=d.useAtomValue(Tt),s=w.useCallback(o=>{const r=_t(o);e({type:"set_page_blocks",payload:r})},[e]);return[t,s]},dr=()=>{const e=W();return[w.useCallback(s=>{e({type:"set_page_blocks",payload:s})},[e])]},Dt=e=>["Box","Slot","Form","Link","Paragraph","Heading","List","ListItem","Table","TableCell"].includes(e),ur=e=>!["Slot"].includes(e),mr=e=>!["Slot"].includes(e);function Ve(e,t){return e==="Slot"||t==="List"&&e!=="ListItem"||t==="Row"&&e!=="Column"||t==="Heading"&&!i.includes(["Span","Text"],e)||t==="Paragraph"&&!i.includes(["Span","Text"],e)?!1:Dt(t)}const pr=(e,{dragSource:t,dropTarget:s})=>{const o=i.get(t,"data._type",""),r=i.get(s,"data._type","");return o==="Slot"||i.get(t,"id")&&i.get(t,"id")===i.get(s,"id")?!1:i.isEmpty(r)?!0:Ve(o,r)},He=d.atom([]);He.debugLabel="selectedBlockIdsAtom";const We=d.atom(e=>{const t=e(H),s=e(He);return i.map(i.filter(t,({_id:o})=>i.includes(s,o)),o=>({...o}))});We.debugLabel="selectedBlocksAtom";const Ye=d.atom(e=>{const t=e(We);return t.length===0?null:t.length===1?t[0]:{type:"Multiple",id:i.map(t,"id")}});Ye.debugLabel="selectedBlockAtom";const fr=e=>i.get(e,"parent",null),xr=d.atom(e=>{const t=e(We),s=i.map(t,fr);return i.filter(e(H),o=>i.includes(s,o._id))});xr.debugLabel="selectedBlocksParentsAtom";const Ot=d.atom(()=>!1);Ot.debugLabel="selectedBlockFlexChildAtom";const Lt=d.atom(()=>!1);Lt.debugLabel="selectedBlockGridChildAtom";const Ke=d.atom("");Ke.debugLabel="styleStateAtom";const Vt=me("styleBreakpoint","xs");Vt.debugLabel="styleBreakpointAtom";const gr=()=>({flexChild:d.useAtomValue(Ot),gridChild:d.useAtomValue(Lt)}),br=()=>d.useAtomValue(Ye);const pe=()=>{const[e,t]=d.useAtom(He),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 c=p;o.properties[c]=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 c=p;l.items.properties[c]=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]=vr(e[s])}),t},hr=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})},vr=e=>{switch(e.type){case"styles":return e.default;case"slot":return`${F.SLOT_KEY}${X.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 hr(e);default:return""}};const Ft=()=>d.useAtomValue(H);function mt(e,t,s,o,r){if(s!==null){const x=i.findIndex(e,{_parent:t}),c=(x===-1?0:x)+s;return e.splice(c,0,...o),e}if(!r){const c=i.findIndex(e,{_id:t})+1;return e.splice(c,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 yr=()=>{const e=W(),t=Ft(),[,s]=pe(),o=w.useCallback((a,l,p)=>{var R;for(let N=0;N<a.length;N++){const{_id:I}=a[N];a[N]._id=X.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 c;l&&(c=i.find(t,{_id:l}),a[0]._parent=l);const h=c?Ve(x._type,c._type):!0;return!h&&c&&(a[0]._parent=c._parent),e({type:"set_blocks",payload:mt(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=X.generateUUID(),c=zt(a.props),h=[];i.forIn(c,(z,Z)=>{if(i.startsWith(z,F.SLOT_KEY)){const ce=z.replace(F.SLOT_KEY,"");h.push({_id:ce,_type:"Slot",_parent:x,_name:a.props[Z].name,_styles:a.props[Z].styles,_emptyStyles:a.props[Z].emptyStyles})}});const R={_type:a.type,_id:x,...c};let N;l&&(N=i.find(t,{_id:l}),R._parent=l);const I=N?Ve(a.type,N._type):!0;!I&&N&&(R._parent=N._parent);const q=[R,...h];return e({type:"set_blocks",payload:mt(t,l||null,p||null,q,I)}),s([R._id]),R},[o,t,e,s]),addPredefinedBlock:o}},pt={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},ft=["xs","sm","md","lg","xl","2xl"];function jr(e,t){if(t===null)return"baseClasses";const s=t.mq;if(s==="xs"||t.dark||t.mod!=="")return"classes";let o="baseClasses",r=ft.indexOf(s);for(;r>0;){const a=ft[r-1];if(i.find(e,{mq:a,property:t.property})){o="classes";break}r--}return o}const xt=[];function wr(e="",t="",s=[]){e=e.trim().replace(/ +/g,"");let o=i.filter(i.map(e.split(" "),u.constructClassObject),c=>!i.isNull(c)),r=i.filter(i.map(t.split(" "),u.constructClassObject),c=>!i.isNull(c));r=i.filter(r,c=>!i.includes(xt,c.property));const a=[],l=[];i.each(s,c=>{const h=u.constructClassObject(c),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)),jr(o,h)==="baseClasses"&&!i.includes(xt,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],c=>pt[c.mq]),"fullCls").join(" ");return`${i.map(i.sortBy([...r,...l],c=>pt[c.mq]),"fullCls").join(" ").trim()},${p.trim()}`.trim().replace(/ +/g,"")}const he=d.atom([]);he.debugLabel="selectedStylingBlocksAtom";const Je=()=>d.useAtom(he),Rr=e=>{const t=e.replace(F.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},kr=d.atom(null,(e,t,{blockIds:s,newClasses:o,dispatch:r})=>{const a=i.filter(e(Ge),p=>s.includes(e(p)._id)),l=i.first(e(he));i.each(a,p=>{const x=e(p),c=i.get(x,l.prop,`${F.STYLES_KEY},`),{baseClasses:h,classes:R}=Rr(c);r({type:"update_props_realtime",payload:{ids:[x._id],props:{[l.prop]:`${F.STYLES_KEY}${wr(R,h,o)}`}}})})}),Nr=()=>{const e=W(),t=d.useSetAtom(kr);return w.useCallback((s,o,r)=>{t({blockIds:s,newClasses:o,dispatch:e}),r&&setTimeout(()=>e({type:"create_snapshot"}),500)},[e,t])},gt=()=>{},qt=()=>{const e=Tn.useChaiBlocks(),t=d.useAtomValue(Mt),s=()=>{gt()},o=w.useCallback(()=>gt(),[]);return[e,t,s,o]},Sr=d.atom(!1),Ut=()=>{const[e,t]=d.useAtom(Sr);return[e,t]},Ar=d.atom(F.BRANDING_OPTIONS_DEFAULTS),$t=()=>{const[e,t]=d.useAtom(Ar);return[i.isObject(e)?{...F.BRANDING_OPTIONS_DEFAULTS,...e}:F.BRANDING_OPTIONS_DEFAULTS,t]},Cr=d.atom(null),Gt=()=>({currentPage:d.useAtomValue(Cr)}),Ht=new jt({});function Er(e){let t=Ht.convert(e);return t=!t.type&&t.children&&t.children.length?t.children:i.isEmpty(t)?[]:[t],t}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 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,..._r(o)]})),t}function _r(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))];Xe(o,!0);let r=Qe(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 Br(e){qe=e;const t=Er(Kt(e));Xe(t);const s=Qe(t,null),o=Wt(s),r={};return i.each(o,a=>i.set(r,i.first(a).blockId,a)),[s,r]}const Ze=()=>{const[e]=$t(),{currentPage:t}=Gt(),s=d.useAtomValue(H);return w.useCallback(()=>{const o=i.map(s,l=>i.omit(l,["expanded","order","title","siblings","tempClasses"])),[r=[],a=[]]=Br(o);return{currentPage:t,blocks:r,globalBlocks:a}},[e,t,s])},re=(e,t=void 0)=>{const s=d.useAtomValue(Se);return i.get(s,e,t)},Jt=d.atom(!1);Jt.debugLabel="readOnlyModeAtom";const Qt=d.atom(!1);Qt.debugLabel="advanceStylingOpenAtom";const Xt=d.atom("online");Xt.debugLabel="networkModeAtom";const Pr=d.atom(!1);Pr.debugLabel="codeEditorOpenAtom";const Zt=d.atom(!1);Zt.debugLabel="editLayerNameAtom";const Tr=d.atom("");Tr.debugLabel="activeLanguageAtom";const Ir=d.atom("");Ir.debugLabel="primaryLanguageAtom";const es=d.atom(null);es.debugLabel="canvasIframeAtom";const ts=d.atom("layers");ts.debugLabel="activePanelAtom";const ss=d.atom("");ss.debugLabel="showPredefinedBlockCategoryAtom";const Ce=d.atom({undoCount:0,redoCount:0});Ce.debugLabel="historyStatesAtom";const os=d.atom("");os.debugLabel="inlineEditingActiveAtom";const ns=d.atom(!1);ns.debugLabel="draggingFlagAtom";const rs=d.atom("");rs.debugLabel="draggedBlockIdAtom";const et=d.atom([]);et.debugLabel="dataProvidersAtom";const as=()=>d.useAtom(et),Ee=d.atom("SAVED");Ee.debugLabel="pageSyncStateAtom";const Mr=()=>{const[e,t]=d.useAtom(Ee),s=re("onSaveBlocks",async()=>{}),o=re("onSavePage",async()=>{}),r=re("onSyncStatusChange",()=>{}),a=Ze(),l=d.useSetAtom(Ce),{undoCount:p,redoCount:x}=_e(),[c]=as();return{savePage:In.useThrottledCallback(async()=>{t("SAVING"),r("SAVING");const R=a();return await o({blocks:R.blocks,providers:c}),setTimeout(()=>{l({undoCount:p,redoCount:x}),t("SAVED"),r("SAVED")},100),!0},[a,t,r,s],5e3),syncState:e,setSyncState:t}},_e=()=>{const e=d.useAtomValue(Ae),[{undoCount:t,redoCount:s}]=d.useAtom(Ce),o=W(),[r]=Ut(),[,a]=pe(),[,l]=Je(),[p,x]=d.useAtom(Ee),c=re("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"),c("UNSAVED"))},[e==null?void 0:e.past.length,e==null?void 0:e.future.length,t,s,c,x,p]),{undoCount:e==null?void 0:e.past.length,redoCount:e==null?void 0:e.future.length,undo:w.useCallback(()=>{r||(o(xe.ActionCreators.undo()),setTimeout(()=>{l([]),a([])},200))},[o,r,a,l]),redo:w.useCallback(()=>{r||(o(xe.ActionCreators.redo()),setTimeout(()=>{l([]),a([])},200))},[r,o,l,a]),clear:()=>{o(xe.ActionCreators.clearHistory())},createSnapshot:h}},is=()=>d.useAtom(Vt),ls=me("canvasWidth",800),cs=d.atom(e=>{const t=e(ls);return X.getBreakpointValue(t).toLowerCase()}),Dr=()=>{const[e,t]=d.useAtom(ls),s=d.useAtomValue(cs),[o,r]=is();return w.useEffect(()=>{o!=="xs"&&r(s)},[s,o,r]),[e,s,t]},Or=me("canvasZoom",100),Lr=()=>d.useAtom(Or),ds=d.atom([]),us=()=>{const[e,t]=d.useAtom(ds),s=d.useSetAtom(tt),o=w.useCallback(r=>{t(r),s([])},[t,s]);return[e,o]},tt=d.atom([]),Vr=()=>{const[e,t]=d.useAtom(tt),s=d.useSetAtom(ds),o=w.useCallback(r=>{t(r),s([])},[t,s]);return[e,o]},ms=me("darkMode",!1),zr=()=>{const[e,t]=d.useAtom(ms);return[e,t]},Fr=d.atom(!1),qr=()=>{const[e,t]=d.useAtom(Fr);return[e,t]},ps=()=>{const e=W(),t=d.useAtomValue(H),[,s]=pe();return w.useCallback((o,r=null)=>{const a=[];i.each(o,l=>{const x=rr(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])},Ur=d.atom([]),$r=()=>{const[e,t]=d.useAtom(Ur),s=w.useCallback(o=>{t(r=>i.includes(r,o)?i.without(r,o):[...r,o])},[t]);return[e,t,s]},Gr=d.atom(""),fs=()=>d.useAtom(Gr),Hr=()=>{const e=d.useAtomValue(H),t=W(),s=Ze(),[,,o]=qt();return w.useCallback(async(r,a)=>{const l=X.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])},Wr=()=>({}),Yr=()=>{const e=d.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])},Kr=()=>{const e=d.useAtomValue(tt),[t,s]=us(),o=ps(),r=Yr();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])}},Jr=d.atom(""),Qr=()=>{const e=d.useAtomValue(Jr),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)},Xr=()=>{const e=W(),t=d.useAtomValue(H),[s,o]=pe();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])},Zr=d.atom(null,(e,t,{blockIds:s,fullClasses:o,dispatch:r})=>{const a=i.first(e(he)),l=i.filter(e(Ge),p=>s.includes(e(p)._id));i.each(l,p=>{const x=e(p),c=o;let{classes:h,baseClasses:R}=sr(i.get(x,a.prop,"styles:,"));i.each(c,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)&&c.push(N.split(":").pop().trim())}),i.each(c,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}`}}})})}),ea=()=>{const e=W(),t=d.useSetAtom(Zr);return w.useCallback((s,o)=>{t({blockIds:s,fullClasses:o,dispatch:e}),setTimeout(()=>e({type:"create_snapshot"}))},[e,t])},gs=d.atom(e=>{const t=i.first(e(he)),s=e(Ye);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(" "),u.constructClassObject),a=>!i.isNull(a))}),ta=()=>d.useAtomValue(gs),bt={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},sa=d.atom(e=>{const t=e(cs),s=e(Ke),o=e(ms),r=oa(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)=>bt[l.mq]-bt[p.mq]),o||(a=i.filter(a,{dark:!1})),a}),oa=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},na=()=>d.useAtomValue(sa),ra=()=>d.useAtom(Ke),bs=d.atom(null,(e,t,{blockIds:s,props:o,dispatch:r})=>{r({type:"update_props_realtime",payload:{ids:s,props:o}})}),aa=()=>{const{createSnapshot:e}=_e(),t=W(),s=d.useSetAtom(bs);return w.useCallback((o,r)=>{s({blockIds:o,props:r,dispatch:t}),e()},[e,t,s])},ia=()=>{const e=W(),t=d.useSetAtom(bs);return w.useCallback((s,o)=>{t({blockIds:s,props:o,dispatch:e})},[e,t])},hs={name:"",props:{},modalProps:{},backdropClose:!0},la=d.atom(hs),ca=()=>{const[e,t]=d.useAtom(la),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}},da=()=>d.useAtomValue(Jt),ua=d.atom(""),ma=d.atom(null),pa=()=>d.useAtom(ua),fa=()=>d.useAtom(ma),xa=me("selectedBreakpoints",["XS","MD","XL"]),ga=()=>{const[e,t]=d.useAtom(xa);return[e,t]},ba=()=>{const e=d.useSetAtom(Ce),{clear:t}=_e(),[,s]=pe(),[,o]=fs(),[,r]=Je();return()=>{s([]),r([]),o(""),t(),e({undoCount:0,redoCount:0})}},ha=d.atom({en:{}}),va=()=>{const[e,t]=d.useAtom(ha),s=w.useCallback((o,r,a)=>{i.set(e,`${o}.${r}`,a),t(e)},[e,t]);return[e,s]},ya=(e,t)=>{const[s]=d.useAtom(Se);return i.get(s,e,t)},ja=d.atom([]),wa=()=>{const[e,t]=w.useState(!1),[s,o]=d.useAtom(ja),r=re("getUILibraryBlocks",()=>[]);return w.useEffect(()=>{(async()=>s.length>0||(t(!0),o(await r()),t(!1)))()},[]),{data:s,isLoading:e}},vs=ie.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(wt.Root,{ref:r,className:u.cn(vs({variant:t,size:s,className:e})),...o}));ys.displayName=wt.Root.displayName;const js=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(Le.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:n.jsxRuntimeExports.jsx(Le.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")})}));js.displayName=Le.Root.displayName;const Be=ie.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:u.cn(Be({variant:t,size:s,className:e})),ref:a,...r})});ws.displayName="Button";const Ra=ae.Root,Rs=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ae.Item,{ref:s,className:u.cn("border-b",e),...t}));Rs.displayName="AccordionItem";const ks=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsx(ae.Header,{className:"flex",children:n.jsxRuntimeExports.jsxs(ae.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,n.jsxRuntimeExports.jsx(L.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));ks.displayName=ae.Trigger.displayName;const Ns=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsx(ae.Content,{ref:o,className:u.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=ae.Content.displayName;const ka=ie.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:u.cn(ka({variant:t}),e),...s}));Ss.displayName="Alert";const As=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx("h5",{ref:s,className:u.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:u.cn("text-sm [&_p]:leading-relaxed",e),...t}));Cs.displayName="AlertDescription";const Es=ie.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"}}),Na=({className:e,variant:t,...s})=>n.jsxRuntimeExports.jsx("div",{className:u.cn(Es({variant:t}),e),...s}),Sa=V.Root,Aa=V.Trigger,_s=({className:e,...t})=>n.jsxRuntimeExports.jsx(V.Portal,{className:u.cn(e),...t});_s.displayName=V.Portal.displayName;const Bs=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(V.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}));Bs.displayName=V.Overlay.displayName;const Ps=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsxs(_s,{children:[n.jsxRuntimeExports.jsx(Bs,{}),n.jsxRuntimeExports.jsx(V.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})]}));Ps.displayName=V.Content.displayName;const Ts=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:u.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ts.displayName="AlertDialogHeader";const Is=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:u.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:u.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:u.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:u.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:u.cn(Be({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ls.displayName=V.Cancel.displayName;const st=_.Root,Vs=_.Trigger,zs=({className:e,...t})=>n.jsxRuntimeExports.jsx(_.Portal,{className:u.cn(e),...t});zs.displayName=_.Portal.displayName;const Fs=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Overlay,{ref:s,className:u.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Fs.displayName=_.Overlay.displayName;const Pe=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(zs,{children:[n.jsxRuntimeExports.jsx(Fs,{}),n.jsxRuntimeExports.jsxs(_.Content,{ref:o,className:u.cn("fixed left-[50%] top-[50%] z-[999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...s,children:[t,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"})]})]})]}));Pe.displayName=_.Content.displayName;const qs=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:u.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:u.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:u.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:u.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:u.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:u.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:u.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:u.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:u.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:u.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: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}));Xs.displayName="Input";const Ca=ie.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(Rt.Root,{ref:s,className:u.cn(Ca(),e),...t}));Zs.displayName=Rt.Root.displayName;const eo=f.forwardRef(({className:e,...t},s)=>n.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}));eo.displayName="Textarea";const to=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(ne.Root,{ref:o,className:u.cn("relative overflow-hidden",e),...s,children:[n.jsxRuntimeExports.jsx(ne.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),n.jsxRuntimeExports.jsx(ot,{}),n.jsxRuntimeExports.jsx(ne.Corner,{})]}));to.displayName=ne.Root.displayName;const ot=f.forwardRef(({className:e,orientation:t="vertical",...s},o)=>n.jsxRuntimeExports.jsx(ne.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:n.jsxRuntimeExports.jsx(ne.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));ot.displayName=ne.ScrollAreaScrollbar.displayName;const so=le.Root,nt=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(le.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=le.List.displayName;const Re=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(le.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}));Re.displayName=le.Trigger.displayName;const ke=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(le.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}));ke.displayName=le.Content.displayName;const Ea=ue.Portal,_a=ue.Provider,Ba=ue.Root,Pa=ue.Trigger,oo=f.forwardRef(({className:e,sideOffset:t=4,...s},o)=>n.jsxRuntimeExports.jsx(ue.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}));oo.displayName=ue.Content.displayName;const Ta=be.Root,Ia=be.Trigger,no=f.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},r)=>n.jsxRuntimeExports.jsx(be.Portal,{children:n.jsxRuntimeExports.jsx(be.Content,{ref:r,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})}));no.displayName=be.Content.displayName;const Ma=C.Menu,Da=C.Group,Oa=C.Portal,La=C.Sub,Va=C.RadioGroup,ro=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.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}));ro.displayName=C.Root.displayName;const ao=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(C.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}));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: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,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: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}));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: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),...r})}));co.displayName=C.Content.displayName;const uo=f.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(C.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}));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: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:[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: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:[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:u.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:u.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:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});go.displayname="MenubarShortcut";const za=Ne.Root,Fa=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: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}));bo.displayName=Ne.Content.displayName;const qa=M.Root,Ua=M.Group,$a=M.Value,ho=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(M.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,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: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:n.jsxRuntimeExports.jsx(M.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})})}));vo.displayName=M.Content.displayName;const yo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(M.Label,{ref:s,className:u.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: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:[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:u.cn("-mx-1 my-1 h-px bg-muted",e),...t}));wo.displayName=M.Separator.displayName;const Ga=_.Root,Ha=_.Trigger,Wa=_.Close,Ro=({className:e,...t})=>n.jsxRuntimeExports.jsx(_.Portal,{className:u.cn(e),...t});Ro.displayName=_.Portal.displayName;const ko=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(_.Overlay,{className:u.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));ko.displayName=_.Overlay.displayName;const Ya=ie.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:u.cn(Ya({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:u.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:u.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:u.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:u.cn("text-sm text-muted-foreground",e),...t}));Eo.displayName=_.Description.displayName;const Ka=B.Root,Ja=B.Trigger,Qa=B.Group,Xa=B.Portal,Za=B.Sub,ei=B.RadioGroup,_o=f.forwardRef(({className:e,inset:t,children:s,...o},r)=>n.jsxRuntimeExports.jsxs(B.SubTrigger,{ref:r,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,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: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}));Bo.displayName=B.SubContent.displayName;const Po=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: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})}));Po.displayName=B.Content.displayName;const To=f.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(B.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}));To.displayName=B.Item.displayName;const Io=f.forwardRef(({className:e,children:t,checked:s,...o},r)=>n.jsxRuntimeExports.jsxs(B.CheckboxItem,{ref:r,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:[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: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:[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:u.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:u.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:u.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(kt.Root,{ref:r,decorative:s,orientation:t,className:u.cn("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Vo.displayName=kt.Root.displayName;const ti=1,si=1e6;let De=0;function oi(){return De=(De+1)%Number.MAX_VALUE,De.toString()}const Oe=new Map,ht=e=>{if(Oe.has(e))return;const t=setTimeout(()=>{Oe.delete(e),ge({type:"REMOVE_TOAST",toastId:e})},si);Oe.set(e,t)},zo=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ti)};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?ht(s):e.toasts.forEach(o=>{ht(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)}}},ye=[];let je={toasts:[]};function ge(e){je=zo(je,e),ye.forEach(t=>{t(je)})}function Fo({...e}){const t=oi(),s=r=>ge({type:"UPDATE_TOAST",toast:{...r,id:t}}),o=()=>ge({type:"DISMISS_TOAST",toastId:t});return ge({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(je);return f.useEffect(()=>(ye.push(t),()=>{const s=ye.indexOf(t);s>-1&&ye.splice(s,1)}),[e]),{...e,toast:Fo,dismiss:s=>ge({type:"DISMISS_TOAST",toastId:s})}}const ni=G.Provider,Uo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(G.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}));Uo.displayName=G.Viewport.displayName;const ri=ie.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:u.cn(ri({variant:t}),e),...s}));$o.displayName=G.Root.displayName;const ai=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(G.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}));ai.displayName=G.Action.displayName;const Go=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(G.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: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:u.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:u.cn("text-sm opacity-90",e),...t}));Wo.displayName=G.Description.displayName;function ii(){const{toasts:e}=qo();return n.jsxRuntimeExports.jsxs(ni,{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 li=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:u.cn("animate-pulse rounded-md bg-primary/10",e),...t}),rt=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Command,{ref:s,className:u.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));rt.displayName=U.Command.displayName;const ci=({children:e,...t})=>n.jsxRuntimeExports.jsx(st,{...t,children:n.jsxRuntimeExports.jsx(Pe,{className:"overflow-hidden p-0",children:n.jsxRuntimeExports.jsx(rt,{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: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})]}));Yo.displayName=U.Command.Input.displayName;const Ko=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Command.List,{ref:s,className:u.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: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}));Qo.displayName=U.Command.Group.displayName;const Xo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(U.Command.Separator,{ref:s,className:u.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: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}));Zo.displayName=U.Command.Item.displayName;const en=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});en.displayName="CommandShortcut";const di=P.Root,ui=P.Trigger,mi=P.Group,pi=P.Portal,fi=P.Sub,xi=P.RadioGroup,tn=f.forwardRef(({className:e,inset:t,children:s,...o},r)=>n.jsxRuntimeExports.jsxs(P.SubTrigger,{ref:r,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,n.jsxRuntimeExports.jsx(L.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));tn.displayName=P.SubTrigger.displayName;const sn=f.forwardRef(({className:e,...t},s)=>n.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}));sn.displayName=P.SubContent.displayName;const on=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(P.Portal,{children:n.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})}));on.displayName=P.Content.displayName;const nn=f.forwardRef(({className:e,inset:t,...s},o)=>n.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}));nn.displayName=P.Item.displayName;const rn=f.forwardRef(({className:e,children:t,checked:s,...o},r)=>n.jsxRuntimeExports.jsxs(P.CheckboxItem,{ref:r,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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(P.ItemIndicator,{children:n.jsxRuntimeExports.jsx(L.CheckIcon,{className:"h-4 w-4"})})}),t]}));rn.displayName=P.CheckboxItem.displayName;const an=f.forwardRef(({className:e,children:t,...s},o)=>n.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:[n.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsxRuntimeExports.jsx(P.ItemIndicator,{children:n.jsxRuntimeExports.jsx(L.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));an.displayName=P.RadioItem.displayName;const ln=f.forwardRef(({className:e,inset:t,...s},o)=>n.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}));ln.displayName=P.Label.displayName;const cn=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(P.Separator,{ref:s,className:u.cn("-mx-1 my-1 h-px bg-border",e),...t}));cn.displayName=P.Separator.displayName;const dn=({className:e,...t})=>n.jsxRuntimeExports.jsx("span",{className:u.cn("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});dn.displayName="ContextMenuShortcut";const gi=e=>{try{const t=document.getElementById("icon-picker-field"),s=document.createElement("div");Bn.render(n.jsxRuntimeExports.jsx(yt.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""}},bi=({value:e,onChange:t,onBlur:s,id:o})=>{const r=a=>{t("<svg />");const l=gi(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(yt,{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"})]})},hi=w.lazy(()=>Promise.resolve().then(()=>require("./UnsplashImages-V8oKEHfi.cjs"))),vi=w.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-eHYxwWAp.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(nt,{className:"w-full",children:[n.jsxRuntimeExports.jsx(Re,{value:"upload",className:"w-1/2",children:"Upload"}),n.jsxRuntimeExports.jsx(Re,{value:"unsplash",className:"w-1/2",children:"Unsplash"})]}),s==="unsplash"?n.jsxRuntimeExports.jsx(ke,{value:"unsplash",className:"flex h-full flex-col overflow-hidden",children:n.jsxRuntimeExports.jsx(w.Suspense,{fallback:n.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:n.jsxRuntimeExports.jsx(hi,{isModalView:e,onSelect:t})})}):n.jsxRuntimeExports.jsx(ke,{value:"upload",className:"flex h-full flex-col overflow-hidden",children:n.jsxRuntimeExports.jsx(w.Suspense,{fallback:n.jsxRuntimeExports.jsx("div",{className:"h-64 w-full animate-pulse bg-gray-100"}),children:n.jsxRuntimeExports.jsx(vi,{isModalView:e,onSelect:t})})})]})]})},yi=Object.freeze(Object.defineProperty({__proto__:null,default:un},Symbol.toStringTag,{value:"Module"})),vt=({children:e,onSelect:t})=>{const[s,o]=w.useState(!1),r=(...a)=>{t.call(void 0,...a),o(!1)};return n.jsxRuntimeExports.jsxs(st,{open:s,onOpenChange:a=>o(a),children:[n.jsxRuntimeExports.jsx(Vs,{asChild:!0,children:e}),n.jsxRuntimeExports.jsx(Pe,{className:"flex h-3/4 max-w-5xl",children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:n.jsxRuntimeExports.jsx(un,{isModalView:!0,onSelect:r})})})]})},ji=({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(vt,{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(vt,{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)})]})]}),wi=({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(Pn,{id:e,value:s,onBlur:p=>r(e,p),onChange:p=>o(p),modules:a,formats:l,placeholder:t,className:"mt-1 rounded-md"})},Ri=({schema:e,formData:t,onChange:s})=>{const[o,r]=w.useState([]),a=re("getPages",()=>[]),{type:l="page",href:p="",target:x="self"}=t;return w.useEffect(()=>{(async()=>{const c=await a();r(c||[])})()},[]),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: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=>n.jsxRuntimeExports.jsx("option",{value:c.const,children:c.title},c.const))}),l==="page"?n.jsxRuntimeExports.jsxs("select",{name:"href",placeholder:"Choose Page",value:p,onChange:c=>s({...t,href:c.target.value}),children:[n.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),i.map(o,c=>n.jsxRuntimeExports.jsx("option",{value:c.slug,children:c.name},c.uuid))]}):n.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:p,onChange:c=>s({...t,href:c.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=Ra;exports.AccordionContent=Ns;exports.AccordionItem=Rs;exports.AccordionTrigger=ks;exports.Alert=Ss;exports.AlertDescription=Cs;exports.AlertDialog=Sa;exports.AlertDialogAction=Os;exports.AlertDialogCancel=Ls;exports.AlertDialogContent=Ps;exports.AlertDialogDescription=Ds;exports.AlertDialogFooter=Is;exports.AlertDialogHeader=Ts;exports.AlertDialogTitle=Ms;exports.AlertDialogTrigger=Aa;exports.AlertTitle=As;exports.Badge=Na;exports.Button=ws;exports.Card=Hs;exports.CardContent=Js;exports.CardDescription=Ks;exports.CardFooter=Qs;exports.CardHeader=Ws;exports.CardTitle=Ys;exports.Command=rt;exports.CommandDialog=ci;exports.CommandEmpty=Jo;exports.CommandGroup=Qo;exports.CommandInput=Yo;exports.CommandItem=Zo;exports.CommandList=Ko;exports.CommandSeparator=Xo;exports.CommandShortcut=en;exports.ContextMenu=di;exports.ContextMenuCheckboxItem=rn;exports.ContextMenuContent=on;exports.ContextMenuGroup=mi;exports.ContextMenuItem=nn;exports.ContextMenuLabel=ln;exports.ContextMenuPortal=pi;exports.ContextMenuRadioGroup=xi;exports.ContextMenuRadioItem=an;exports.ContextMenuSeparator=cn;exports.ContextMenuShortcut=dn;exports.ContextMenuSub=fi;exports.ContextMenuSubContent=sn;exports.ContextMenuSubTrigger=tn;exports.ContextMenuTrigger=ui;exports.Dialog=st;exports.DialogContent=Pe;exports.DialogDescription=Gs;exports.DialogFooter=Us;exports.DialogHeader=qs;exports.DialogTitle=$s;exports.DialogTrigger=Vs;exports.DropdownMenu=Ka;exports.DropdownMenuCheckboxItem=Io;exports.DropdownMenuContent=Po;exports.DropdownMenuGroup=Qa;exports.DropdownMenuItem=To;exports.DropdownMenuLabel=Do;exports.DropdownMenuPortal=Xa;exports.DropdownMenuRadioGroup=ei;exports.DropdownMenuRadioItem=Mo;exports.DropdownMenuSeparator=Oo;exports.DropdownMenuShortcut=Lo;exports.DropdownMenuSub=Za;exports.DropdownMenuSubContent=Bo;exports.DropdownMenuSubTrigger=_o;exports.DropdownMenuTrigger=Ja;exports.HoverCard=za;exports.HoverCardContent=bo;exports.HoverCardTrigger=Fa;exports.IconPickerField=bi;exports.ImagePickerField=ji;exports.ImagesPanel=yi;exports.Input=Xs;exports.Label=Zs;exports.LinkField=Ri;exports.Menubar=ro;exports.MenubarCheckboxItem=mo;exports.MenubarContent=co;exports.MenubarGroup=Da;exports.MenubarItem=uo;exports.MenubarLabel=fo;exports.MenubarMenu=Ma;exports.MenubarPortal=Oa;exports.MenubarRadioGroup=Va;exports.MenubarRadioItem=po;exports.MenubarSeparator=xo;exports.MenubarShortcut=go;exports.MenubarSub=La;exports.MenubarSubContent=lo;exports.MenubarSubTrigger=io;exports.MenubarTrigger=ao;exports.Popover=Ta;exports.PopoverContent=no;exports.PopoverTrigger=Ia;exports.RichTextEditorField=wi;exports.ScrollArea=to;exports.ScrollBar=ot;exports.Select=qa;exports.SelectContent=vo;exports.SelectGroup=Ua;exports.SelectItem=jo;exports.SelectLabel=yo;exports.SelectSeparator=wo;exports.SelectTrigger=ho;exports.SelectValue=$a;exports.Separator=Vo;exports.Sheet=Ga;exports.SheetClose=Wa;exports.SheetContent=No;exports.SheetDescription=Eo;exports.SheetFooter=Ao;exports.SheetHeader=So;exports.SheetTitle=Co;exports.SheetTrigger=Ha;exports.Skeleton=li;exports.Switch=js;exports.Tabs=so;exports.TabsContent=ke;exports.TabsList=nt;exports.TabsTrigger=Re;exports.Textarea=eo;exports.Toaster=ii;exports.Toggle=ys;exports.Tooltip=Ba;exports.TooltipContent=oo;exports.TooltipPortal=Ea;exports.TooltipProvider=_a;exports.TooltipTrigger=Pa;exports.activePanelAtom=ts;exports.advanceStylingOpenAtom=Qt;exports.atom=K;exports.atomWithDefault=Qn;exports.atomWithStorage=me;exports.badgeVariants=Es;exports.buttonVariants=Be;exports.canAddChildBlock=Dt;exports.canDeleteBlock=mr;exports.canDropBlock=pr;exports.canDuplicateBlock=ur;exports.canvasIframeAtom=es;exports.chaiBuilderPropsAtom=Se;exports.chaiExternalDataAtom=Et;exports.createStore=Nt;exports.dataProvidersAtom=et;exports.draggedBlockIdAtom=rs;exports.draggingFlagAtom=ns;exports.editLayerNameAtom=Zt;exports.getBlockJSONFromSchemas=Fe;exports.getBlockJSONFromUISchemas=ze;exports.inlineEditingActiveAtom=os;exports.isDevelopment=tr;exports.networkModeAtom=Xt;exports.pageSyncStateAtom=Ee;exports.presentBlocksAtom=H;exports.reducer=zo;exports.showPredefinedBlockCategoryAtom=ss;exports.toast=Fo;exports.toggleVariants=vs;exports.useActiveModal=ca;exports.useActivePanel=pa;exports.useAddBlock=yr;exports.useAddBlockParent=fa;exports.useAddClassesToBlocks=Nr;exports.useAllBlocks=Ft;exports.useAtom=$n;exports.useAtomValue=St;exports.useBrandingOptions=$t;exports.useBuilderProp=re;exports.useBuilderReset=ba;exports.useBuildingBlocks=qt;exports.useCanvasHistory=_e;exports.useCanvasWidth=Dr;exports.useCanvasZoom=Lr;exports.useCopyBlockIds=Vr;exports.useCurrentPage=Gt;exports.useCutBlockIds=us;exports.useDarkMode=zr;exports.useDeveloperPreviewMode=qr;exports.useDuplicateBlocks=ps;exports.useFeatureSupport=ya;exports.useGetPageData=Ze;exports.useHiddenBlockIds=$r;exports.useHighlightBlockId=fs;exports.useMarkAsGlobalBlock=Hr;exports.useMoveBlocks=Wr;exports.usePageDataProviders=as;exports.usePasteBlocks=Kr;exports.usePreviewMode=Ut;exports.useProject=Qr;exports.useReadOnlyMode=da;exports.useRemoveBlocks=Xr;exports.useRemoveClassesFromBlocks=ea;exports.useSavePage=Mr;exports.useSelectedBlock=br;exports.useSelectedBlockAllClasses=ta;exports.useSelectedBlockCurrentClasses=na;exports.useSelectedBlockIds=pe;exports.useSelectedBlocksDisplayChild=gr;exports.useSelectedBreakpoints=ga;exports.useSelectedStylingBlocks=Je;exports.useSetAllBlocks=dr;exports.useSetAtom=At;exports.useStore=Ue;exports.useStylingBreakpoint=is;exports.useStylingState=ra;exports.useToast=qo;exports.useTranslations=va;exports.useTreeData=cr;exports.useUILibraryBlocks=wa;exports.useUpdateBlocksProps=aa;exports.useUpdateBlocksPropsRealtime=ia;