@chaibuilder/sdk 1.1.2 → 1.1.4

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 (60) hide show
  1. package/dist/{AddBlocks-P3qHuE5J.cjs → AddBlocks-Wsoku0Sm.cjs} +1 -1
  2. package/dist/{AddBlocks-imyQSCbI.js → AddBlocks-rteGefHR.js} +20 -20
  3. package/dist/{BrandingOptions-tSNtQ1Kv.js → BrandingOptions-4l1Yo42i.js} +1 -1
  4. package/dist/{BrandingOptions-_2XBEPab.cjs → BrandingOptions-CqVvc-GC.cjs} +1 -1
  5. package/dist/CanvasArea-_WcM6PCy.js +1426 -0
  6. package/dist/CanvasArea-jzvQJnbQ.cjs +59 -0
  7. package/dist/{CurrentPage-hHwsHam-.cjs → CurrentPage-8AWFWOJ8.cjs} +1 -1
  8. package/dist/{CurrentPage-uRwS0DQC.js → CurrentPage-tnHIOkX2.js} +5 -5
  9. package/dist/{Layers-eXMT1ncm.js → Layers-6PHQWIbV.js} +15 -15
  10. package/dist/{Layers--5nyqOjK.cjs → Layers-jsOPQbVU.cjs} +1 -1
  11. package/dist/{MarkAsGlobalBlock-aqik3ouc.js → MarkAsGlobalBlock-9pfqCgrO.js} +1 -1
  12. package/dist/{MarkAsGlobalBlock-p_wvHkQZ.cjs → MarkAsGlobalBlock-bXkERbl2.cjs} +1 -1
  13. package/dist/{PagesPanel-WZgw7xVs.cjs → PagesPanel-Zvy5ZKPf.cjs} +1 -1
  14. package/dist/{PagesPanel-xRUnAMIb.js → PagesPanel-cmJ1UiP0.js} +3 -3
  15. package/dist/{ProjectPanel-FC03TiyG.cjs → ProjectPanel-4BsxvZu-.cjs} +1 -1
  16. package/dist/{ProjectPanel-8l4Bi3Kh.js → ProjectPanel-VxbDdgA2.js} +5 -5
  17. package/dist/Settings-AJet4HbF.cjs +1 -0
  18. package/dist/{Settings-4v3M1bRS.js → Settings-zzs6KaRd.js} +294 -303
  19. package/dist/{SidePanels-0xaw3Td6.js → SidePanels-UGgpWdPF.js} +9 -9
  20. package/dist/{SidePanels-5e5q3c7J.cjs → SidePanels-_8tt1l6S.cjs} +1 -1
  21. package/dist/{Topbar-ZjAs5fDc.cjs → Topbar-geYx1fCH.cjs} +1 -1
  22. package/dist/{Topbar-Jc74a6oE.js → Topbar-zw_KlpKs.js} +5 -5
  23. package/dist/{UnsplashImages-nXceZLmd.cjs → UnsplashImages-C4_dg08Y.cjs} +1 -1
  24. package/dist/{UnsplashImages-_PxEYx5c.js → UnsplashImages-yk5eowZf.js} +4 -4
  25. package/dist/{UploadImages-tcQb5NZu.cjs → UploadImages-hLrNjSXF.cjs} +1 -1
  26. package/dist/{UploadImages-zzSgKmP9.js → UploadImages-ioTAmtvl.js} +10 -10
  27. package/dist/{add-page-modal-K5isTZOT.js → add-page-modal-31-dJjna.js} +3 -3
  28. package/dist/{add-page-modal-JRSQ_N56.cjs → add-page-modal-Gsa-gnsn.cjs} +1 -1
  29. package/dist/{confirm-alert-2JxcNf3T.js → confirm-alert-c7sRVjK8.js} +1 -1
  30. package/dist/{confirm-alert-mzlwOW9w.cjs → confirm-alert-zqK8LIx8.cjs} +1 -1
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.d.ts +0 -25
  33. package/dist/core.js +51 -55
  34. package/dist/{delete-page-modal-x81Ed4jF.js → delete-page-modal-5xqoPPl3.js} +2 -2
  35. package/dist/{delete-page-modal-c8nB2y7w.cjs → delete-page-modal-jEsSWzKN.cjs} +1 -1
  36. package/dist/{form-TQ7vwDYO.js → form-5tYo3gKa.js} +1 -1
  37. package/dist/{form-bSW-Pkw9.cjs → form-hHv26OT7.cjs} +1 -1
  38. package/dist/{index-HjvZqhVh.js → index-K_TiChPs.js} +4 -4
  39. package/dist/index-LLhN-70p.cjs +1 -0
  40. package/dist/{index-ORFlyrBx.js → index-pJPfM9Bm.js} +874 -878
  41. package/dist/{index-7NRFGya_.cjs → index-rdttRR05.cjs} +2 -2
  42. package/dist/{page-viewer-huD5B1om.cjs → page-viewer-DJqp04Tr.cjs} +1 -1
  43. package/dist/{page-viewer-fFaDQOOI.js → page-viewer-Oku6zrcm.js} +3 -3
  44. package/dist/{project-general-setting-rH_1r38b.js → project-general-setting-hrJZUYnV.js} +3 -3
  45. package/dist/{project-general-setting-rNNI-K6l.cjs → project-general-setting-rVhljgfP.cjs} +1 -1
  46. package/dist/{project-seo-setting-cERASO9j.cjs → project-seo-setting-Xg6cVYXo.cjs} +1 -1
  47. package/dist/{project-seo-setting-k0HlefUD.js → project-seo-setting-fwyxNcY-.js} +2 -2
  48. package/dist/{single-page-detail-CrgTQFUX.js → single-page-detail-1UCpERBU.js} +4 -4
  49. package/dist/{single-page-detail-52_cuxNe.cjs → single-page-detail-ilh1I9gv.cjs} +1 -1
  50. package/dist/studio.cjs +1 -1
  51. package/dist/studio.js +2 -2
  52. package/dist/ui.cjs +1 -1
  53. package/dist/ui.js +41 -41
  54. package/dist/{useAddBlockByDrop-UA_Iw_4l.js → useAddBlockByDrop-UJ6QE7aE.js} +1 -1
  55. package/dist/{useAddBlockByDrop-DPV32UHP.cjs → useAddBlockByDrop-jJ_MnZ5y.cjs} +1 -1
  56. package/package.json +1 -1
  57. package/dist/CanvasArea-UtFK5IS6.cjs +0 -58
  58. package/dist/CanvasArea-dkwSFbQA.js +0 -1412
  59. package/dist/Settings-kcmKFymH.cjs +0 -1
  60. package/dist/index-zkc4SQCu.cjs +0 -1
package/dist/core.js CHANGED
@@ -1,6 +1,6 @@
1
- import { k as os } from "./index-HjvZqhVh.js";
2
- import { ak as rs, N as is, af as ps, O as ms, ah as us, P as ls, ae as cs, an as ds, x as Bs, i as ks, y as ns, Q as gs, p as Cs, R as Ps, U as Ss, k as vs, V as ys, n as As, W as Ms, X as hs, m as Ds, L as Is, Y as Ls, Z as Rs, _ as fs, am as xs, $ as Ts, a0 as Us, o as bs, h as js, al as ws, a1 as Hs, M as Os, l as Fs, a3 as Gs, ag as Ws, a6 as Zs, a5 as Es, a4 as Ns, j as Qs, ad as Vs, ai as Xs, aj as Ys, w as _s, a7 as $s, a9 as qs, a2 as zs, aa as Js, a8 as Ks, ab as se, ac as ee } from "./index-ORFlyrBx.js";
3
- import { useTranslation as oe } from "react-i18next";
1
+ import { k as as } from "./index-K_TiChPs.js";
2
+ import { N as rs, af as is, O as ps, ah as ms, P as ls, ae as us, x as cs, i as ds, y as Bs, Q as ks, p as ns, R as Ss, U as Cs, k as Ps, V as vs, n as gs, W as ys, X as As, m as Ms, L as hs, Y as Ds, Z as Is, _ as Rs, $ as fs, a0 as xs, o as Ts, h as Us, a1 as bs, M as js, l as ws, a3 as Hs, ag as Os, a6 as Fs, a5 as Gs, a4 as Ls, j as Ws, ad as Zs, ai as Es, aj as Ns, w as Qs, a7 as Vs, a9 as Xs, a2 as Ys, aa as _s, a8 as $s, ab as qs, ac as zs } from "./index-pJPfM9Bm.js";
3
+ import { useTranslation as Ks } from "react-i18next";
4
4
  import "i18next";
5
5
  import "./jsx-runtime-NV737rRe.js";
6
6
  import "./MODIFIERS-MLfpKQY1.js";
@@ -57,57 +57,53 @@ import "flat-to-nested";
57
57
  import "redux-undo";
58
58
  import "@react-hookz/web";
59
59
  export {
60
- os as ChaiBuilderEditor,
61
- rs as useActiveLanguage,
62
- is as useActiveModal,
63
- ps as useActivePanel,
64
- ms as useAddBlock,
65
- us as useAddBlockParent,
60
+ as as ChaiBuilderEditor,
61
+ rs as useActiveModal,
62
+ is as useActivePanel,
63
+ ps as useAddBlock,
64
+ ms as useAddBlockParent,
66
65
  ls as useAddClassesToBlocks,
67
- cs as useAllBlocks,
68
- ds as useBlockContentByLanguage,
69
- Bs as useBrandingOptions,
70
- ks as useBuilderProp,
71
- ns as useBuilderReset,
72
- gs as useBuildingBlocks,
73
- Cs as useCanvasHistory,
74
- Ps as useCanvasWidth,
75
- Ss as useCanvasZoom,
76
- vs as useCopyBlockIds,
77
- ys as useCurrentPage,
78
- As as useCutBlockIds,
79
- Ms as useDarkMode,
80
- hs as useDeveloperPreviewMode,
81
- Ds as useDuplicateBlocks,
82
- Is as useFeatureSupport,
83
- Ls as useGetPageData,
84
- Rs as useHiddenBlockIds,
85
- fs as useHighlightBlockId,
86
- xs as useLanguages,
87
- Ts as useMarkAsGlobalBlock,
88
- Us as useMoveBlocks,
89
- bs as usePasteBlocks,
90
- js as usePreviewMode,
91
- ws as usePrimaryLanguage,
92
- Hs as useProject,
93
- Os as useReadOnlyMode,
94
- Fs as useRemoveBlocks,
95
- Gs as useRemoveClassesFromBlocks,
96
- Ws as useSavePage,
97
- Zs as useSelectedBlock,
98
- Es as useSelectedBlockAllClasses,
99
- Ns as useSelectedBlockCurrentClasses,
100
- Qs as useSelectedBlockIds,
101
- Vs as useSelectedBlocksDisplayChild,
102
- Xs as useSelectedBreakpoints,
103
- Ys as useSelectedStylingBlocks,
104
- _s as useSetAllBlocks,
105
- $s as useStylingBreakpoint,
106
- qs as useStylingState,
107
- oe as useTranslation,
108
- zs as useTranslations,
109
- Js as useTreeData,
110
- Ks as useUILibraryBlocks,
111
- se as useUpdateBlocksProps,
112
- ee as useUpdateBlocksPropsRealtime
66
+ us as useAllBlocks,
67
+ cs as useBrandingOptions,
68
+ ds as useBuilderProp,
69
+ Bs as useBuilderReset,
70
+ ks as useBuildingBlocks,
71
+ ns as useCanvasHistory,
72
+ Ss as useCanvasWidth,
73
+ Cs as useCanvasZoom,
74
+ Ps as useCopyBlockIds,
75
+ vs as useCurrentPage,
76
+ gs as useCutBlockIds,
77
+ ys as useDarkMode,
78
+ As as useDeveloperPreviewMode,
79
+ Ms as useDuplicateBlocks,
80
+ hs as useFeatureSupport,
81
+ Ds as useGetPageData,
82
+ Is as useHiddenBlockIds,
83
+ Rs as useHighlightBlockId,
84
+ fs as useMarkAsGlobalBlock,
85
+ xs as useMoveBlocks,
86
+ Ts as usePasteBlocks,
87
+ Us as usePreviewMode,
88
+ bs as useProject,
89
+ js as useReadOnlyMode,
90
+ ws as useRemoveBlocks,
91
+ Hs as useRemoveClassesFromBlocks,
92
+ Os as useSavePage,
93
+ Fs as useSelectedBlock,
94
+ Gs as useSelectedBlockAllClasses,
95
+ Ls as useSelectedBlockCurrentClasses,
96
+ Ws as useSelectedBlockIds,
97
+ Zs as useSelectedBlocksDisplayChild,
98
+ Es as useSelectedBreakpoints,
99
+ Ns as useSelectedStylingBlocks,
100
+ Qs as useSetAllBlocks,
101
+ Vs as useStylingBreakpoint,
102
+ Xs as useStylingState,
103
+ Ks as useTranslation,
104
+ Ys as useTranslations,
105
+ _s as useTreeData,
106
+ $s as useUILibraryBlocks,
107
+ qs as useUpdateBlocksProps,
108
+ zs as useUpdateBlocksPropsRealtime
113
109
  };
@@ -1,6 +1,6 @@
1
1
  import { j as r } from "./jsx-runtime-NV737rRe.js";
2
- import { D as s, E as l, F as n, H as d, I as a, K as c, B as u } from "./index-ORFlyrBx.js";
3
- import { j as x } from "./index-HjvZqhVh.js";
2
+ import { D as s, E as l, F as n, H as d, I as a, K as c, B as u } from "./index-pJPfM9Bm.js";
3
+ import { j as x } from "./index-K_TiChPs.js";
4
4
  import { TrashIcon as h } from "@radix-ui/react-icons";
5
5
  import "./MODIFIERS-MLfpKQY1.js";
6
6
  import "react";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),r=require("./index-zkc4SQCu.cjs"),q=require("./index-7NRFGya_.cjs"),l=require("@radix-ui/react-icons");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("lodash");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("sonner");require("lucide-react");const d=({pageData:i,projectData:t})=>{const n={},u=q.useDeletePage(),s=i.uuid===t.homepage,o=()=>{u.mutate(i,{onSuccess:()=>{n({uuid:t.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:s,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${s?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(l.TrashIcon,{})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(r.Button,{variant:"destructive",onClick:o,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),r=require("./index-LLhN-70p.cjs"),q=require("./index-rdttRR05.cjs"),l=require("@radix-ui/react-icons");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("lodash");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("sonner");require("lucide-react");const d=({pageData:i,projectData:t})=>{const n={},u=q.useDeletePage(),s=i.uuid===t.homepage,o=()=>{u.mutate(i,{onSuccess:()=>{n({uuid:t.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:s,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${s?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(l.TrashIcon,{})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(r.Button,{variant:"destructive",onClick:o,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
@@ -2,7 +2,7 @@ import { j as u } from "./jsx-runtime-NV737rRe.js";
2
2
  import b from "@rjsf/core";
3
3
  import x from "@rjsf/validator-ajv8";
4
4
  import { includes as h, get as a, set as $, first as F } from "lodash";
5
- import { bg as P, bh as E, bi as O, bj as S } from "./index-ORFlyrBx.js";
5
+ import { bd as P, be as E, bf as O, bg as S } from "./index-pJPfM9Bm.js";
6
6
  const d = (i, l = "") => {
7
7
  switch (i.type) {
8
8
  case "singular":
@@ -1 +1 @@
1
- "use strict";const f=require("./jsx-runtime-WUGKV8jN.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash"),d=require("./index-zkc4SQCu.cjs"),h=(c,n="")=>{switch(c.type){case"singular":return c.uiSchema;case"model":const{properties:p}=c,u={};return Object.keys(p).forEach(r=>{const e=p[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;u[o]=h(e,n)}),u;case"list":const{itemProperties:m}=c,l={items:{}};return Object.keys(m).forEach(r=>{const e=m[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;l.items[o]=h(e,n)}),l;default:return{}}},x=(c,n="")=>{switch(c.type){case"singular":return c.schema;case"model":const{properties:p,title:u}=c,m={title:u,type:"object",properties:{}};return Object.keys(p).forEach(o=>{const t=p[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;m.properties[s]=x(t,n)}),m;case"list":const{itemProperties:l,title:r}=c,e={title:r,type:"array",items:{type:"object",properties:{}}};return Object.keys(l).forEach(o=>{const t=l[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;e.items.properties[s]=x(t,n),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:c,properties:n={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(n).forEach(t=>{const s=n[t];if(i.includes(["slot","styles"],s.type))return;const a=i.get(s,"i18n",!1)?`${t}-${l}`:t;r.properties[a]=x(s,l),e[a]=h(s,l)});const o=({...t},s)=>{const a=s==null?void 0:s.replace("root.","").split("/").pop();if(!s||!a)return;const j=i.first(a.split("."));s&&j&&u({...t},j)};return f.jsxRuntimeExports.jsxs(f.jsxRuntimeExports.Fragment,{children:[c&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:c}),f.jsxRuntimeExports.jsx("div",{className:"-mx-3",children:f.jsxRuntimeExports.jsx(y,{widgets:{richtext:d.RichTextEditorField,icon:d.IconPickerField,image:d.ImagePickerField},fields:{link:d.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:e,schema:r,formData:p,validator:E,onChange:o,disabled:m})})]})};exports.Form=$;
1
+ "use strict";const f=require("./jsx-runtime-WUGKV8jN.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash"),d=require("./index-LLhN-70p.cjs"),h=(c,n="")=>{switch(c.type){case"singular":return c.uiSchema;case"model":const{properties:p}=c,u={};return Object.keys(p).forEach(r=>{const e=p[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;u[o]=h(e,n)}),u;case"list":const{itemProperties:m}=c,l={items:{}};return Object.keys(m).forEach(r=>{const e=m[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;l.items[o]=h(e,n)}),l;default:return{}}},x=(c,n="")=>{switch(c.type){case"singular":return c.schema;case"model":const{properties:p,title:u}=c,m={title:u,type:"object",properties:{}};return Object.keys(p).forEach(o=>{const t=p[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;m.properties[s]=x(t,n)}),m;case"list":const{itemProperties:l,title:r}=c,e={title:r,type:"array",items:{type:"object",properties:{}}};return Object.keys(l).forEach(o=>{const t=l[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;e.items.properties[s]=x(t,n),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:c,properties:n={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(n).forEach(t=>{const s=n[t];if(i.includes(["slot","styles"],s.type))return;const a=i.get(s,"i18n",!1)?`${t}-${l}`:t;r.properties[a]=x(s,l),e[a]=h(s,l)});const o=({...t},s)=>{const a=s==null?void 0:s.replace("root.","").split("/").pop();if(!s||!a)return;const j=i.first(a.split("."));s&&j&&u({...t},j)};return f.jsxRuntimeExports.jsxs(f.jsxRuntimeExports.Fragment,{children:[c&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:c}),f.jsxRuntimeExports.jsx("div",{className:"-mx-3",children:f.jsxRuntimeExports.jsx(y,{widgets:{richtext:d.RichTextEditorField,icon:d.IconPickerField,image:d.ImagePickerField},fields:{link:d.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:e,schema:r,formData:p,validator:E,onChange:o,disabled:m})})]})};exports.Form=$;
@@ -20,7 +20,7 @@ import { initReactI18next as oS } from "react-i18next";
20
20
  import { j as n1 } from "./jsx-runtime-NV737rRe.js";
21
21
  import * as O from "react";
22
22
  import p, { useState as g1, useRef as z1, useLayoutEffect as L3, useEffect as L1, useCallback as D1, useDebugValue as o91, useContext as Et, forwardRef as Q, createContext as $t, useReducer as cS, useMemo as fa, cloneElement as Ae, Fragment as hS, Children as br, Component as Ff, isValidElement as sS, createElement as G4, memo as vS, Suspense as Ue, lazy as v0 } from "react";
23
- import { u as O3, a as h2, c as qf, b as wt, d as Pe, e as s2, f as d0, g as Wf, h as dS, i as J4, B as S3, S as uS, j as Kf, k as gS, l as fS, m as pS, n as zS, o as MS, p as mS, q as HS, r as VS, s as wS, t as bS, v as yS, T as xS, w as LS, x as OS, y as Uf, z as SS, A as CS, C as BS, D as AS, E as PS, F as ES, G as IS, H as kS, I as NS, J as RS, K as TS } from "./index-ORFlyrBx.js";
23
+ import { u as O3, a as h2, c as qf, b as wt, d as Pe, e as s2, f as d0, g as Wf, h as dS, i as J4, B as S3, S as uS, j as Kf, k as gS, l as fS, m as pS, n as zS, o as MS, p as mS, q as HS, r as VS, s as wS, t as bS, v as yS, T as xS, w as LS, x as OS, y as Uf, z as SS, A as CS, C as BS, D as AS, E as PS, F as ES, G as IS, H as kS, I as NS, J as RS, K as TS } from "./index-pJPfM9Bm.js";
24
24
  import { g as Ii, c as j0 } from "./MODIFIERS-MLfpKQY1.js";
25
25
  import Zf from "clsx";
26
26
  import { flushSync as DS, createPortal as jS } from "react-dom";
@@ -38598,7 +38598,7 @@ const Eh1 = () => {
38598
38598
  e((l) => (delete l[n.providerKey], l));
38599
38599
  });
38600
38600
  }), [r, a, e]), /* @__PURE__ */ n1.jsx(n1.Fragment, { children: t });
38601
- }, Dh1 = v0(() => import("./SidePanels-0xaw3Td6.js")), jh1 = v0(() => import("./Topbar-Jc74a6oE.js")), Fh1 = v0(() => import("./CanvasArea-dkwSFbQA.js")), qh1 = v0(() => import("./Settings-4v3M1bRS.js")), Wh1 = () => {
38601
+ }, Dh1 = v0(() => import("./SidePanels-UGgpWdPF.js")), jh1 = v0(() => import("./Topbar-zw_KlpKs.js")), Fh1 = v0(() => import("./CanvasArea-_WcM6PCy.js")), qh1 = v0(() => import("./Settings-zzs6KaRd.js")), Wh1 = () => {
38602
38602
  const [t] = ki(bS), e = (n) => {
38603
38603
  yS() || n.preventDefault();
38604
38604
  };
@@ -40492,7 +40492,7 @@ const v2 = {
40492
40492
  return;
40493
40493
  }
40494
40494
  ae.success("Page published successfully.", {
40495
- position: "top-right",
40495
+ position: "bottom-right",
40496
40496
  duration: 2e3
40497
40497
  });
40498
40498
  }
@@ -40728,7 +40728,7 @@ const Fs1 = () => {
40728
40728
  ] })
40729
40729
  ] })
40730
40730
  ] });
40731
- }, Zs1 = () => /* @__PURE__ */ n1.jsx(Us1, { children: /* @__PURE__ */ n1.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ n1.jsx(zC, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), Gs1 = v0(() => import("./PagesPanel-xRUnAMIb.js")), Js1 = v0(() => import("./ProjectPanel-8l4Bi3Kh.js")), Ys1 = v0(() => import("./CurrentPage-uRwS0DQC.js")), Qs1 = () => /* @__PURE__ */ n1.jsx("h2", { children: "Your Logo" }), Xs1 = () => {
40731
+ }, Zs1 = () => /* @__PURE__ */ n1.jsx(Us1, { children: /* @__PURE__ */ n1.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ n1.jsx(zC, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), Gs1 = v0(() => import("./PagesPanel-cmJ1UiP0.js")), Js1 = v0(() => import("./ProjectPanel-VxbDdgA2.js")), Ys1 = v0(() => import("./CurrentPage-tnHIOkX2.js")), Qs1 = () => /* @__PURE__ */ n1.jsx("h2", { children: "Your Logo" }), Xs1 = () => {
40732
40732
  const { mutate: t } = Es1();
40733
40733
  return J4("editable", !0) ? /* @__PURE__ */ n1.jsx(S3, { onClick: t, className: "bg-blue-600 text-white", children: "Publish" }) : null;
40734
40734
  }, _s1 = (t) => {
@@ -0,0 +1 @@
1
+ "use strict";const n=require("./jsx-runtime-WUGKV8jN.cjs"),w=require("react"),pn=require("@radix-ui/react-toggle"),re=require("class-variance-authority"),c=require("./utils-It2K33fU.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"),An=require("@radix-ui/react-select"),Sn=require("@radix-ui/react-dropdown-menu"),Cn=require("@radix-ui/react-separator"),En=require("@radix-ui/react-toast"),q=require("cmdk"),_n=require("@radix-ui/react-context-menu"),vt=require("react-icons-picker"),Bn=require("react-dom"),i=require("lodash"),Pn=require("react-quill"),d=require("jotai"),yt=require("flat-to-nested"),fe=require("redux-undo"),F=require("./MODIFIERS-WFzDQfiT.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),jt=D(pn),Le=D(fn),ae=D(gn),V=D(bn),_=D(hn),wt=D(vn),oe=D(yn),ie=D(jn),de=D(wn),ge=D(Rn),C=D(kn),Ne=D(Nn),M=D(An),B=D(Sn),Rt=D(Cn),$=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=a=>a(o),o.write=(a,r,l)=>r(o,typeof l=="function"?l(a(o)):l)),t&&(o.write=t),o}const Te=e=>"init"in e,Ie=e=>!!e.write,je=new WeakMap,Dn=(e,t)=>{je.set(e,t),e.catch(()=>{}).finally(()=>je.delete(e))},at=(e,t)=>{const s=je.get(e);s&&(je.delete(e),s(t))},rt=(e,t)=>{e.status="fulfilled",e.value=t},it=(e,t)=>{e.status="rejected",e.reason=t},On=e=>typeof(e==null?void 0:e.then)=="function",pe=(e,t)=>"v"in e&&"v"in t&&Object.is(e.v,t.v),lt=(e,t)=>"e"in e&&"e"in t&&Object.is(e.e,t.e),ce=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,he=e=>{if("e"in e)throw e.e;return e.v},kt=()=>{const e=new WeakMap,t=new WeakMap,s=new Map;let o,a,r;(O?"production":void 0)!=="production"&&(o=new Set,a=new Set,r=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);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)},u=(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)&&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 A=!1;g.then(E=>{if(!A){A=!0;const S=l(m),J=u(m,v,y);rt(v,E),k(E),(S==null?void 0:S.d)!==J.d&&U(m,J,S==null?void 0:S.d)}},E=>{if(!A){A=!0;const S=l(m),J=u(m,v,y);it(v,E),T(E),(S==null?void 0:S.d)!==J.d&&U(m,J,S==null?void 0:S.d)}}),j=E=>{A||(A=!0,E.then(S=>rt(v,S),S=>it(v,S)),k(E))}});return v.orig=g,v.status="pending",Dn(v,k=>{k&&j(k),b==null||b()}),u(m,v,y)}return u(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&&lt(b,j)&&b.d===j.d?b:(p(m,j),j)},N=m=>{const g=l(m);if(g&&(g.d.forEach((A,E)=>{E!==m&&!t.has(E)&&N(E)}),Array.from(g.d).every(([A,E])=>{const S=l(A);return A===m||S===E||S&&!ce(S)&&pe(S,E)})))return g;const y=new Map;let b=!0;const j=A=>{if(A===m){const S=l(A);if(S)return y.set(A,S),he(S);if(Te(A))return y.set(A,void 0),A.init;throw new Error("no atom init")}const E=N(A);return y.set(A,E),he(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=(...A)=>{if((O?"production":void 0)!=="production"&&b&&console.warn("setSelf function cannot be called in sync"),!b)return Q(m,...A)}),k}};try{const A=m.read(j,T);return h(m,A,y,()=>v==null?void 0:v.abort())}catch(A){return R(m,A,y)}finally{b=!1}},I=m=>he(N(m)),z=m=>{let g=t.get(m);return g||(g=Y(m)),g},W=(m,g)=>!g.l.size&&(!g.t.size||g.t.size===1&&g.t.has(m)),X=m=>{const g=t.get(m);g&&W(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(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 A;if(T!==v){let E=y.get(T);if(E&&y.set(T,--E),!E){let S=!!((A=g.get(T))!=null&&A.size);if(S){const J=l(T),mn=N(T);S=!J||!pe(J,mn)}S||g.forEach(J=>J.delete(T))}j(T)}})};j(m)},Z=(m,...g)=>{let y=!0;const b=k=>he(N(k)),j=(k,...T)=>{let A;if(k===m){if(!Te(k))throw new Error("atom not writable");const E=l(k),S=h(k,T[0]);(!E||!pe(E,S))&&le(k)}else A=Z(k,...T);if(!y){const E=ee();(O?"production":void 0)!=="production"&&a.forEach(S=>S({type:"async-write",flushed:E}))}return A},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"&&a.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"&&r.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"&&r.delete(m);const b=l(m);b?(ce(b)&&at(b.v),b.d.forEach((j,v)=>{if(v!==m){const k=t.get(v);k&&(k.t.delete(m),W(v,k)&&se(v))}})):(O?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",m)},U=(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),W(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)&&U(y,j,b==null?void 0:b.d);const v=t.get(y);v&&!(b&&!ce(b)&&(pe(b,j)||lt(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=z(m),b=ee(),j=y.l;return j.add(g),(O?"production":void 0)!=="production"&&(o.forEach(v=>v("sub")),a.forEach(v=>v({type:"sub",flushed:b}))),()=>{j.delete(g),X(m),(O?"production":void 0)!=="production"&&(o.forEach(v=>v("unsub")),a.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)}):(a.add(m),()=>{a.delete(m)}),dev_get_mounted_atoms:()=>r.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),le(y));const g=ee();a.forEach(y=>y({type:"restore",flushed:g}))}}:{get:I,set:Q,sub:te}};let Me;const Vn=()=>(Me||(Me=kt()),Me);var zn={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Fn=w.createContext(void 0),qe=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 Nt(e,t){const s=qe(t),[[o,a,r],l]=w.useReducer(u=>{const h=s.get(e);return Object.is(u[0],h)&&u[1]===s&&u[2]===e?u:[h,s,e]},void 0,()=>[s.get(e),s,e]);let p=o;(a!==s||r!==e)&&(l(),p=s.get(e));const x=t==null?void 0:t.delay;return w.useEffect(()=>{const u=s.sub(e,()=>{if(typeof x=="number"){setTimeout(l,x);return}l()});return l(),u},[s,e,x]),w.useDebugValue(p),qn(p)?Un(p):p}function At(e,t){const s=qe(t);return w.useCallback((...a)=>{if((zn?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return s.set(e,...a)},[s,e])}function $n(e,t){return[Nt(e,t),At(e,t)]}var Ue={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const St=Symbol();function Gn(e,t){const s=K(e,(o,a,r)=>a(s,t(o(s),r)));return s}const ct=(e,t,s)=>(t.has(s)?t:t.set(s,e())).get(s),Hn=new WeakMap,Wn=(e,t,s)=>{const o=ct(()=>new WeakMap,Hn,t);return ct(e,o,s)},Yn={},dt=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 u=p&&s.get(p),h=[],R=[];return l.forEach((N,I)=>{const z=t?t(N):I;R[I]=z;const W=u&&u.atomList[u.keyList.indexOf(z)];if(W){h[I]=W;return}const X=Z=>{const Q=Z(a),Y=Z(e),U=o(Y,Q==null?void 0:Q.arr).keyList.indexOf(z);if(U<0||U>=Y.length){const ee=l[o(l).keyList.indexOf(z)];if(ee)return ee;throw new Error("splitAtom: index out of bounds for read")}return Y[U]},le=(Z,Q,Y)=>{const se=Z(a),U=Z(e),te=o(U,se==null?void 0:se.arr).keyList.indexOf(z);if(te<0||te>=U.length)throw new Error("splitAtom: index out of bounds for write");const m=Kn(Y)?Y(U[te]):Y;Q(e,[...U.slice(0,te),m,...U.slice(te+1)])};h[I]=dt(e)?K(X,le):K(X)}),u&&u.keyList.length===R.length&&u.keyList.every((N,I)=>N===R[I])?x=u:x={arr:l,atomList:h,keyList:R},s.set(l,x),x},a=K(l=>{const p=l(a),x=l(e);return o(x,p==null?void 0:p.arr)});(Ue?"production":void 0)!=="production"&&(a.debugPrivate=!0),a.init=void 0;const r=dt(e)?K(l=>l(a).atomList,(l,p,x)=>{switch(x.type){case"remove":{const u=l(r).indexOf(x.atom);if(u>=0){const h=l(e);p(e,[...h.slice(0,u),...h.slice(u+1)])}break}case"insert":{const u=x.before?l(r).indexOf(x.before):l(r).length;if(u>=0){const h=l(e);p(e,[...h.slice(0,u),x.value,...h.slice(u)])}break}case"move":{const u=l(r).indexOf(x.atom),h=x.before?l(r).indexOf(x.before):l(r).length;if(u>=0&&h>=0){const R=l(e);u<h?p(e,[...R.slice(0,u),...R.slice(u+1,h),R[u],...R.slice(h)]):p(e,[...R.slice(0,h),R[u],...R.slice(h,u),...R.slice(u+1)])}break}}}):K(l=>l(a).atomList);return r},e,t||Yn)}function Qn(e){const t=Symbol(),s=K(t);(Ue?"production":void 0)!=="production"&&(s.debugPrivate=!0);const o=K((a,r)=>{const l=a(s);return l!==t?l:e(a,r)},(a,r,l)=>{if(l===St)r(s,t);else if(typeof l=="function"){const p=a(o);r(s,l(p))}else r(s,l)});return o}const Xn=e=>typeof(e==null?void 0:e.then)=="function";function Zn(e){let t,s;const o={getItem:(a,r)=>{var l,p;const x=h=>{if(h=h||"",t!==h){try{s=JSON.parse(h)}catch{return r}t=h}return s},u=(p=(l=e())==null?void 0:l.getItem(a))!=null?p:null;return Xn(u)?u.then(x):x(u)},setItem:(a,r)=>{var l;return(l=e())==null?void 0:l.setItem(a,JSON.stringify(r))},removeItem:a=>{var r;return(r=e())==null?void 0:r.removeItem(a)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(o.subscribe=(a,r,l)=>{if(!(e()instanceof window.Storage))return()=>{};const p=x=>{if(x.storageArea===e()&&x.key===a){let u;try{u=JSON.parse(x.newValue||"")}catch{u=l}r(u)}};return window.addEventListener("storage",p),()=>{window.removeEventListener("storage",p)}}),o}const ea=Zn(()=>typeof window<"u"?window.localStorage:void 0);function ue(e,t,s=ea,o){const a=o==null?void 0:o.unstable_getOnInit,r=K(a?s.getItem(e,t):t);return(Ue?"production":void 0)!=="production"&&(r.debugPrivate=!0),r.onMount=p=>{a||p(s.getItem(e,t));let x;return s.subscribe&&(x=s.subscribe(e,p,t)),x},K(p=>p(r),(p,x,u)=>{const h=typeof u=="function"?u(p(r)):u;return h===St?(x(r,t),s.removeItem(e)):h instanceof Promise?h.then(R=>(x(r,R),s.setItem(e,R))):(x(r,h),s.setItem(e,h))})}const Ae=d.atom(null);Ae.debugLabel="chaiBuilderPropsAtom";const Ct=d.atom({});Ct.debugLabel="chaiExternalDataAtom";const ta=()=>!1,sa=e=>{const t=e.replace(F.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}};const oa=new yt({children:"blockNodes"}),Et=(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,...Et(o,s._id)])}return s}));function _t(e,t,s){const o=i.filter(e,r=>r._parent===t),a=[];for(let r=0;r<o.length;r++){const l=Bt(o[r]);if(Object.keys(l).length>0&&Object.keys(l).forEach(p=>{o[r][p]=`slot:${c.generateUUID()}`}),i.filter(e,{_parent:o[r]._id}).length>0){const p=c.generateUUID();a.push({...o[r],oldId:o[r]._id,_id:p,_parent:s}),a.push(i.flatten(_t(e,o[r]._id,p)))}else a.push({...o[r],oldId:o[r]._id,_id:c.generateUUID(),_parent:s})}return i.flatten(a)}function na(e){let t=oa.convert(e.map(s=>i.omit(s,["settings"])));return t=!t.type&&t.blockNodes?t.blockNodes:i.isEmpty(t)?[]:[t],t}const Bt=e=>{const t={};return Object.keys(e).forEach(s=>{i.isString(e[s])&&e[s].startsWith("slot")&&(t[s]=e[s].replace("slot:",""))}),t},aa=(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 a=[o];i.filter(e,{_parent:t}).length>0&&a.push(i.flatten(_t(e,t,o._id)));const r=i.flatten(a);return i.map(r,l=>{const p=l,x=Bt(p);return Object.keys(x).length>0&&Object.keys(x).forEach(u=>{const h=i.find(r,{oldId:x[u].replace("slot:","")});p[u]=`slot:${h._id}`}),i.omit(p,["global","oldId"])})};const ra=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(a=>{i.set(o,a,t.payload.props[a])}),o));default:return e}},{debug:!1,ignoreInitialState:!1,limit:30,filter:fe.excludeAction(["update_props_realtime","add_duplicate_blocks","set_page_blocks"])}),Se=Gn({past:[],present:[],future:[]},ra);Se.debugLabel="pageBlocksAtom";const G=d.atom(e=>{var t;return(t=e(Se))==null?void 0:t.present});G.debugLabel="presentBlocksAtom";const $e=Jn(G);$e.debugLabel="pageBlocksAtomsAtom";const Pt=d.atom(e=>na(e(G)));Pt.debugLabel="pageBlocksTreeAtom";const ia=d.atom("");ia.debugLabel="builderActivePageAtom";const la=d.atom(-1);la.debugLabel="destinationDropIndexAtom";const Tt=d.atom(!1);Tt.debugLabel="addBlocksModalAtom";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 H=()=>{const[,e]=d.useAtom(Se);return e},ca=()=>{const e=H(),t=d.useAtomValue(Pt),s=w.useCallback(o=>{const a=Et(o);e({type:"set_page_blocks",payload:a})},[e]);return[t,s]},da=()=>{const e=H();return[w.useCallback(s=>{e({type:"set_page_blocks",payload:s})},[e])]},we=e=>["Box","Slot","Form","DataProvider","Link","List","ListItem","Row","Column","Table","Row","TableCell"].includes(e),ua=e=>!["Slot"].includes(e),ma=e=>!["Slot"].includes(e);function pa(e,t){return e==="Slot"||t==="List"&&e!=="ListItem"||t==="Row"&&e!=="Column"?!1:we(t)}const fa=(e,{dragSource:t,dropTarget:s})=>{const o=i.get(t,"data._type",""),a=i.get(s,"data._type","");return o==="Slot"||i.get(t,"id")&&i.get(t,"id")===i.get(s,"id")?!1:i.isEmpty(a)?!0:pa(o,a)},Ge=d.atom([]);Ge.debugLabel="selectedBlockIdsAtom";const He=d.atom(e=>{const t=e(G),s=e(Ge);return i.map(i.filter(t,({_id:o})=>i.includes(s,o)),o=>({...o}))});He.debugLabel="selectedBlocksAtom";const We=d.atom(e=>{const t=e(He);return t.length===0?null:t.length===1?t[0]:{type:"Multiple",id:i.map(t,"id")}});We.debugLabel="selectedBlockAtom";const xa=e=>i.get(e,"parent",null),ga=d.atom(e=>{const t=e(He),s=i.map(t,xa);return i.filter(e(G),o=>i.includes(s,o._id))});ga.debugLabel="selectedBlocksParentsAtom";const Dt=d.atom(()=>!1);Dt.debugLabel="selectedBlockFlexChildAtom";const Ot=d.atom(()=>!1);Ot.debugLabel="selectedBlockGridChildAtom";const Ye=d.atom("");Ye.debugLabel="styleStateAtom";const Lt=ue("styleBreakpoint","xs");Lt.debugLabel="styleBreakpointAtom";const ba=()=>({flexChild:d.useAtomValue(Dt),gridChild:d.useAtomValue(Ot)}),ha=()=>d.useAtomValue(We);const me=()=>{const[e,t]=d.useAtom(Ge),s=w.useCallback(o=>{t(a=>i.includes(a,o)?i.without(a,o):[...a,o])},[t]);return[e,t,s]},Ve=e=>{switch(e.type){case"singular":return e.uiSchema;case"model":const{properties:t}=e,s={};return Object.keys(t).forEach(r=>{const l=t[r];if(i.includes(["slot","styles"],l.type))return;const p=r;s[p]=Ve(l)}),s;case"list":const{itemProperties:o}=e,a={items:{}};return Object.keys(o).forEach(r=>{const l=o[r];if(i.includes(["slot","styles"],l.type))return;const p=r;a.items[p]=Ve(l)}),a;default:return{}}},ze=e=>{switch(e.type){case"singular":return e.schema;case"model":const{properties:t,title:s}=e,o={title:s,type:"object",properties:{}};return Object.keys(t).forEach(p=>{const x=t[p];if(i.includes(["slot","styles"],x.type))return;const u=p;o.properties[u]=ze(x)}),o;case"list":const{itemProperties:a,title:r}=e,l={title:r,type:"array",items:{type:"object",properties:{}}};return Object.keys(a).forEach(p=>{const x=a[p];if(i.includes(["slot","styles"],x.type))return;const u=p;l.items.properties[u]=ze(x),i.set(l.items,"title",i.get(x,"itemTitle",`${r} item`))}),l;default:return{}}},Vt=e=>{const t={};return Object.keys(e).forEach(s=>{t[s]=ya(e[s])}),t},va=e=>{if(i.isEmpty(e.default))return[];const{itemProperties:t}=e;return i.map(e.default,s=>{const o={...s};return i.forIn(s,(a,r)=>{i.has(t,r)&&i.get(t[r],"i18n",!1)&&(o[r]=F.I18N_KEY)}),o})},ya=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 Vt(e.properties);case"list":return va(e);default:return""}};const zt=()=>d.useAtomValue(G);function ut(e,t,s,o,a){if(s!==null){const x=i.findIndex(e,{_parent:t}),u=(x===-1?0:x)+s;return e.splice(u,0,...o),e}if(!a){const u=i.findIndex(e,{_id:t})+1;return e.splice(u,0,...o),e}let r=i.findIndex(e,{_id:t});const l=i.filter(e,{_parent:t});i.isEmpty(l)||(r=i.findIndex(e,{_id:i.last(l)._id}));const p=r+1;return e.splice(p,0,...o),e}const ja=()=>{const e=H(),t=zt(),[,s]=me(),o=w.useCallback((r,l,p)=>{var h;for(let R=0;R<r.length;R++){const{_id:N}=r[R];r[R]._id=c.generateUUID();const I=i.filter(r,{_parent:N});for(let z=0;z<I.length;z++)I[z]._parent=r[R]._id}let x;l&&(x=i.find(t,{_id:l}),r[0]._parent=l);const u=x?we(x._type):!0;return!u&&x&&(r[0]._parent=x._parent),e({type:"set_blocks",payload:ut(t,l||null,p||null,r,u)}),s([(h=i.first(r))==null?void 0:h._id]),i.first(r)},[t,e,s]);return{addCoreBlock:w.useCallback((r,l,p)=>{if(i.has(r,"blocks")){const W=r.blocks;return o(W,l,p)}const x=c.generateUUID(),u=Vt(r.props),h=[];i.forIn(u,(W,X)=>{if(i.startsWith(W,F.SLOT_KEY)){const le=W.replace(F.SLOT_KEY,"");h.push({_id:le,_type:"Slot",_parent:x,_name:r.props[X].name,_styles:r.props[X].styles,_emptyStyles:r.props[X].emptyStyles})}});const R={_type:r.type,_id:x,...u};let N;l&&(N=i.find(t,{_id:l}),R._parent=l);const I=N?we(N._type):!0;!I&&N&&(R._parent=N._parent);const z=[R,...h];return e({type:"set_blocks",payload:ut(t,l||null,p||null,z,I)}),s([R._id]),R},[o,t,e,s]),addPredefinedBlock:o}},mt={xs:420,sm:620,md:768,lg:1024,xl:1280,"2xl":1536},pt=["xs","sm","md","lg","xl","2xl"];function wa(e,t){if(t===null)return"baseClasses";const s=t.mq;if(s==="xs"||t.dark||t.mod!=="")return"classes";let o="baseClasses",a=pt.indexOf(s);for(;a>0;){const r=pt[a-1];if(i.find(e,{mq:r,property:t.property})){o="classes";break}a--}return o}const ft=[];function Ra(e="",t="",s=[]){e=e.trim().replace(/ +/g,"");let o=i.filter(i.map(e.split(" "),c.constructClassObject),u=>!i.isNull(u)),a=i.filter(i.map(t.split(" "),c.constructClassObject),u=>!i.isNull(u));a=i.filter(a,u=>!i.includes(ft,u.property));const r=[],l=[];i.each(s,u=>{const h=c.constructClassObject(u),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))),r.push(h),h.mq==="xs"&&!h.dark&&h.mod===""&&(a=i.filter(a,N=>N.property!==h.property)),wa(o,h)==="baseClasses"&&!i.includes(ft,h.property)){const N=i.find(a,i.pick(h,["property"]));R&&(a=i.filter(a,I=>I.fullCls!==(N==null?void 0:N.fullCls))),l.push({...h,fullCls:h.cls,mq:"xs"})}});const p=i.map(i.sortBy([...o,...r],u=>mt[u.mq]),"fullCls").join(" ");return`${i.map(i.sortBy([...a,...l],u=>mt[u.mq]),"fullCls").join(" ").trim()},${p.trim()}`.trim().replace(/ +/g,"")}const be=d.atom([]);be.debugLabel="selectedStylingBlocksAtom";const Ke=()=>d.useAtom(be),ka=e=>{const t=e.replace(F.STYLES_KEY,"").split(",");return{baseClasses:t[0],classes:t[1]}},Na=d.atom(null,(e,t,{blockIds:s,newClasses:o,dispatch:a})=>{const r=i.filter(e($e),p=>s.includes(e(p)._id)),l=i.first(e(be));i.each(r,p=>{const x=e(p),u=i.get(x,l.prop,`${F.STYLES_KEY},`),{baseClasses:h,classes:R}=ka(u);a({type:"update_props_realtime",payload:{ids:[x._id],props:{[l.prop]:`${F.STYLES_KEY}${Ra(R,h,o)}`}}})})}),Aa=()=>{const e=H(),t=d.useSetAtom(Na);return w.useCallback((s,o,a)=>{t({blockIds:s,newClasses:o,dispatch:e}),a&&setTimeout(()=>e({type:"create_snapshot"}),500)},[e,t])},xt=()=>{},Ft=()=>{const e=Tn.useChaiBlocks(),t=d.useAtomValue(Mt),s=()=>{xt()},o=w.useCallback(()=>xt(),[]);return[e,t,s,o]},Sa=d.atom(!1),qt=()=>{const[e,t]=d.useAtom(Sa);return[e,t]},Ca=d.atom(F.BRANDING_OPTIONS_DEFAULTS),Ut=()=>{const[e,t]=d.useAtom(Ca);return[i.isObject(e)?{...F.BRANDING_OPTIONS_DEFAULTS,...e}:F.BRANDING_OPTIONS_DEFAULTS,t]},Ea=d.atom(null),$t=()=>({currentPage:d.useAtomValue(Ea)}),Gt=new yt({});function _a(e){let t=Gt.convert(e);return t=!t.type&&t.children&&t.children.length?t.children:i.isEmpty(t)?[]:[t],t}const Je=(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,...Je(o,s._id)])}return s}));function Qe(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&&Qe(o.children)}}function Ht(e){let t=[],s=i.filter(e,{type:"GlobalBlock"});return s.length>0&&(s=i.map(s,Wt),i.each(s,o=>{t=[...t,...Ba(o)]})),t}function Ba(e){let t=[];const s=i.get(i.first(e),"parent",null);i.set(i.first(e),"parent",null);const o=[Gt.convert(Yt(e))];Qe(o,!0);let a=Je(o,e[0]._id);return a=i.set(a,"0.parent",s),t=[...t,a,...Ht(a)],t}function Wt(e){const t=i.find(Fe,{_id:e._id});if(!t)return[];const s=[t],o=i.filter(Fe,{_parent:e._id});return o.length?i.flatten([...s,...i.flatten(i.map(o,Wt))]):i.flatten(s)}const Yt=e=>JSON.parse(JSON.stringify(e));let Fe=[];function Pa(e){Fe=e;const t=_a(Yt(e));Qe(t);const s=Je(t,null),o=Ht(s),a={};return i.each(o,r=>i.set(a,i.first(r).blockId,r)),[s,a]}const Xe=()=>{const[e]=Ut(),{currentPage:t}=$t(),s=d.useAtomValue(G);return w.useCallback(()=>{const o=i.map(s,l=>i.omit(l,["expanded","order","title","siblings","tempClasses"])),[a=[],r=[]]=Pa(o);return{currentPage:t,blocks:a,globalBlocks:r}},[e,t,s])},ne=(e,t=void 0)=>{const s=d.useAtomValue(Ae);return i.get(s,e,t)},Kt=d.atom(!1);Kt.debugLabel="readOnlyModeAtom";const Jt=d.atom(!1);Jt.debugLabel="advanceStylingOpenAtom";const Qt=d.atom("online");Qt.debugLabel="networkModeAtom";const Ta=d.atom(!1);Ta.debugLabel="codeEditorOpenAtom";const Xt=d.atom(!1);Xt.debugLabel="editLayerNameAtom";const Ia=d.atom("");Ia.debugLabel="activeLanguageAtom";const Ma=d.atom("");Ma.debugLabel="primaryLanguageAtom";const Zt=d.atom(null);Zt.debugLabel="canvasIframeAtom";const es=d.atom("layers");es.debugLabel="activePanelAtom";const ts=d.atom(!1);ts.debugLabel="addBlockOffCanvasAtom";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 as=d.atom("");as.debugLabel="draggedBlockIdAtom";const Ze=d.atom([]);Ze.debugLabel="dataProvidersAtom";const rs=()=>d.useAtom(Ze),Ee=d.atom("SAVED");Ee.debugLabel="pageSyncStateAtom";const Da=()=>{const[e,t]=d.useAtom(Ee),s=ne("onSaveBlocks",async()=>{}),o=ne("onSavePage",async()=>{}),a=ne("onSyncStatusChange",()=>{}),r=Xe(),l=d.useSetAtom(Ce),{undoCount:p,redoCount:x}=_e(),[u]=rs();return{savePage:In.useThrottledCallback(async()=>{t("SAVING"),a("SAVING");const R=r();return await o({blocks:R.blocks,providers:u}),setTimeout(()=>{l({undoCount:p,redoCount:x}),t("SAVED"),a("SAVED")},100),!0},[r,t,a,s],5e3),syncState:e,setSyncState:t}},_e=()=>{const e=d.useAtomValue(Se),[{undoCount:t,redoCount:s}]=d.useAtom(Ce),o=H(),[a]=qt(),[,r]=me(),[,l]=Ke(),[p,x]=d.useAtom(Ee),u=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"),u("UNSAVED"))},[e==null?void 0:e.past.length,e==null?void 0:e.future.length,t,s,u,x,p]),{undoCount:e==null?void 0:e.past.length,redoCount:e==null?void 0:e.future.length,undo:w.useCallback(()=>{a||(o(fe.ActionCreators.undo()),setTimeout(()=>{l([]),r([])},200))},[o,a,r,l]),redo:w.useCallback(()=>{a||(o(fe.ActionCreators.redo()),setTimeout(()=>{l([]),r([])},200))},[a,o,l,r]),clear:()=>{o(fe.ActionCreators.clearHistory())},createSnapshot:h}},is=()=>d.useAtom(Lt),ls=ue("canvasWidth",800),cs=d.atom(e=>{const t=e(ls);return c.getBreakpointValue(t).toLowerCase()}),Oa=()=>{const[e,t]=d.useAtom(ls),s=d.useAtomValue(cs),[o,a]=is();return w.useEffect(()=>{o!=="xs"&&a(s)},[s,o,a]),[e,s,t]},La=ue("canvasZoom",100),Va=()=>d.useAtom(La),ds=d.atom([]),us=()=>{const[e,t]=d.useAtom(ds),s=d.useSetAtom(et),o=w.useCallback(a=>{t(a),s([])},[t,s]);return[e,o]},et=d.atom([]),za=()=>{const[e,t]=d.useAtom(et),s=d.useSetAtom(ds),o=w.useCallback(a=>{t(a),s([])},[t,s]);return[e,o]},ms=ue("darkMode",!1),Fa=()=>{const[e,t]=d.useAtom(ms);return[e,t]},qa=d.atom(!1),Ua=()=>{const[e,t]=d.useAtom(qa);return[e,t]},ps=()=>{const e=H(),t=d.useAtomValue(G),[,s]=me();return w.useCallback((o,a=null)=>{const r=[];i.each(o,l=>{const x=aa(t,l,a===l?null:a);r.push(i.get(x,"0._id","")),e({type:"add_duplicate_blocks",payload:x})}),s(r),e({type:"create_snapshot"})},[t,s,e])},$a=d.atom([]),Ga=()=>{const[e,t]=d.useAtom($a),s=w.useCallback(o=>{t(a=>i.includes(a,o)?i.without(a,o):[...a,o])},[t]);return[e,t,s]},Ha=d.atom(""),fs=()=>d.useAtom(Ha),Wa=()=>{const e=d.useAtomValue(G),t=H(),s=Xe(),[,,o]=Ft();return w.useCallback(async(a,r)=>{const l=c.generateUUID(16),p=i.map(e,x=>(x._id===a&&(x._globalBlockId=l,x._name=r),x));t({type:"set_page_blocks",payload:p}),o()},[e,t,s,o])},Ya=()=>({}),Ka=()=>{const e=d.useAtomValue(G),t=H();return w.useCallback((s,o)=>{const a=i.map(e,r=>(i.includes(s,i.get(r,"_id"))&&i.set(r,"_parent",o),r));t({type:"set_blocks",payload:a})},[e,t])},Ja=()=>{const e=d.useAtomValue(et),[t,s]=us(),o=ps(),a=Ka();return{canPaste:w.useMemo(()=>t.length>0||e.length>0,[e,t]),pasteBlocks:w.useCallback(l=>{i.isEmpty(e)?a(t,l):o(e,l),s(()=>[])},[t,e,o,a,s])}},Qa=d.atom(""),Xa=()=>{const e=d.useAtomValue(Qa),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,a=>i.includes(t,a._id)||i.includes(t,a._parent)?(s.push(a._id),!1):!0);return i.isEmpty(s)?o:xs(o,s)},Za=()=>{const e=H(),t=d.useAtomValue(G),[s,o]=me();return w.useCallback(a=>{var p;const r=((p=i.find(t,{_id:a[0]}))==null?void 0:p._parent)||null,l=xs(t,a);e({type:"set_blocks",payload:l}),o(r?[r]:[])},[t,o,e,s])},er=d.atom(null,(e,t,{blockIds:s,fullClasses:o,dispatch:a})=>{const r=i.first(e(be)),l=i.filter(e($e),p=>s.includes(e(p)._id));i.each(l,p=>{const x=e(p),u=o;let{classes:h,baseClasses:R}=sa(i.get(x,r.prop,"styles:,"));i.each(u,N=>{const I=new RegExp(`(^| )${N.replace("[","\\[").replace("]","\\]")}($| )`,"g");h=h.replace(I," ").replace(/ +/g," ").trim();const z=i.first(N.split(":"));i.includes(["2xl","xl","lg","md","sm"],z)&&u.push(N.split(":").pop().trim())}),i.each(u,N=>{const I=new RegExp(`(^| )${N.replace("[","\\[").replace("]","\\]")}($| )`,"g");R=R.replace(I," ").replace(/ +/g," ").trim()}),a({type:"update_props_realtime",payload:{ids:[x._id],props:{[r.prop]:`${F.STYLES_KEY}${R},${h}`}}})})}),tr=()=>{const e=H(),t=d.useSetAtom(er);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(be)),s=e(We);if(!t||t.blockId!==i.get(s,"_id",null))return[];const a=i.get(s,t.prop,`${F.STYLES_KEY},`).replace(F.STYLES_KEY,"").split(",").join(" ");return i.filter(i.map(a.trim().split(" "),c.constructClassObject),r=>!i.isNull(r))}),sr=()=>d.useAtomValue(gs),gt={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5},or=d.atom(e=>{const t=e(cs),s=e(Ye),o=e(ms),a=nr(t);let r=i.filter(e(gs),{mod:s});return i.startsWith(s,"_")||(r=i.filter(r,l=>a.includes(l.mq))),r=r.sort((l,p)=>gt[l.mq]-gt[p.mq]),o||(r=i.filter(r,{dark:!1})),r}),nr=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},ar=()=>d.useAtomValue(or),rr=()=>d.useAtom(Ye),bs=d.atom(null,(e,t,{blockIds:s,props:o,dispatch:a})=>{a({type:"update_props_realtime",payload:{ids:s,props:o}})}),ir=()=>{const{createSnapshot:e}=_e(),t=H(),s=d.useSetAtom(bs);return w.useCallback((o,a)=>{s({blockIds:o,props:a,dispatch:t}),e()},[e,t,s])},lr=()=>{const e=H(),t=d.useSetAtom(bs);return w.useCallback((s,o)=>{t({blockIds:s,props:o,dispatch:e})},[e,t])},hs={name:"",props:{},modalProps:{},backdropClose:!0},cr=d.atom(hs),dr=()=>{const[e,t]=d.useAtom(cr),s=w.useCallback((a,r={},l={})=>{t({name:a,props:r,modalProps:l})},[t]),o=w.useCallback((...a)=>{i.get(e,"props.onClose",()=>{})(...a),t(hs)},[t,e]);return{activeModal:e,openModal:s,closeModal:o}},ur=()=>d.useAtomValue(Kt),mr=d.atom(""),pr=d.atom(null),fr=()=>d.useAtom(mr),xr=()=>d.useAtom(pr),gr=ue("selectedBreakpoints",["XS","MD","XL"]),br=()=>{const[e,t]=d.useAtom(gr);return[e,t]},hr=()=>{const e=d.useSetAtom(Ce),{clear:t}=_e(),[,s]=me(),[,o]=fs(),[,a]=Ke();return()=>{s([]),a([]),o(""),t(),e({undoCount:0,redoCount:0})}},vr=d.atom({en:{}}),yr=()=>{const[e,t]=d.useAtom(vr),s=w.useCallback((o,a,r)=>{i.set(e,`${o}.${a}`,r),t(e)},[e,t]);return[e,s]},jr=(e,t)=>{const[s]=d.useAtom(Ae);return i.get(s,e,t)},wr=d.atom([]),Rr=()=>{const[e,t]=w.useState(!1),[s,o]=d.useAtom(wr),a=ne("getUILibraryBlocks",()=>[]);return w.useEffect(()=>{(async()=>s.length>0||(t(!0),o(await a()),t(!1)))()},[]),{data:s,isLoading:e}},vs=re.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},a)=>n.jsxRuntimeExports.jsx(jt.Root,{ref:a,className:c.cn(vs({variant:t,size:s,className:e})),...o}));ys.displayName=jt.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=re.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,...a},r)=>{const l=o?xn.Slot:"button";return n.jsxRuntimeExports.jsx(l,{className:c.cn(Be({variant:t,size:s,className:e})),ref:r,...a})});ws.displayName="Button";const kr=ae.Root,Rs=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ae.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(ae.Header,{className:"flex",children:n.jsxRuntimeExports.jsxs(ae.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=ae.Trigger.displayName;const Ns=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsx(ae.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=ae.Content.displayName;const Nr=re.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"}}),As=f.forwardRef(({className:e,variant:t,...s},o)=>n.jsxRuntimeExports.jsx("div",{ref:o,role:"alert",className:c.cn(Nr({variant:t}),e),...s}));As.displayName="Alert";const Ss=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}));Ss.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=re.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"}}),Ar=({className:e,variant:t,...s})=>n.jsxRuntimeExports.jsx("div",{className:c.cn(Es({variant:t}),e),...s}),Sr=V.Root,Cr=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 Ps=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})]}));Ps.displayName=V.Content.displayName;const Ts=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.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: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 tt=_.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 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: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"})]})]})]}));Pe.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 Er=re.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(wt.Root,{ref:s,className:c.cn(Er(),e),...t}));Zs.displayName=wt.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(st,{}),n.jsxRuntimeExports.jsx(oe.Corner,{})]}));to.displayName=oe.Root.displayName;const st=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"})}));st.displayName=oe.ScrollAreaScrollbar.displayName;const so=ie.Root,ot=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}));ot.displayName=ie.List.displayName;const Re=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}));Re.displayName=ie.Trigger.displayName;const ke=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}));ke.displayName=ie.Content.displayName;const _r=de.Portal,Br=de.Provider,Pr=de.Root,Tr=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 Ir=ge.Root,Mr=ge.Trigger,no=f.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},a)=>n.jsxRuntimeExports.jsx(ge.Portal,{children:n.jsxRuntimeExports.jsx(ge.Content,{ref:a,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 Dr=C.Menu,Or=C.Group,Lr=C.Portal,Vr=C.Sub,zr=C.RadioGroup,ao=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}));ao.displayName=C.Root.displayName;const ro=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}));ro.displayName=C.Trigger.displayName;const io=f.forwardRef(({className:e,inset:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(C.SubTrigger,{ref:a,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,...a},r)=>n.jsxRuntimeExports.jsx(C.Portal,{children:n.jsxRuntimeExports.jsx(C.Content,{ref:r,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),...a})}));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},a)=>n.jsxRuntimeExports.jsxs(C.CheckboxItem,{ref:a,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 Fr=Ne.Root,qr=Ne.Trigger,bo=f.forwardRef(({className:e,align:t="center",sideOffset:s=4,...o},a)=>n.jsxRuntimeExports.jsx(Ne.Content,{ref:a,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 Ur=M.Root,$r=M.Group,Gr=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},a)=>n.jsxRuntimeExports.jsx(M.Portal,{children:n.jsxRuntimeExports.jsx(M.Content,{ref:a,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 Hr=_.Root,Wr=_.Trigger,Yr=_.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 Kr=re.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},a)=>n.jsxRuntimeExports.jsxs(Ro,{children:[n.jsxRuntimeExports.jsx(ko,{}),n.jsxRuntimeExports.jsxs(_.Content,{ref:a,className:c.cn(Kr({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 Ao=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:c.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ao.displayName="SheetHeader";const So=({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});So.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 Jr=B.Root,Qr=B.Trigger,Xr=B.Group,Zr=B.Portal,ei=B.Sub,ti=B.RadioGroup,_o=f.forwardRef(({className:e,inset:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(B.SubTrigger,{ref:a,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 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: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})}));Po.displayName=B.Content.displayName;const To=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}));To.displayName=B.Item.displayName;const Io=f.forwardRef(({className:e,children:t,checked:s,...o},a)=>n.jsxRuntimeExports.jsxs(B.CheckboxItem,{ref:a,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},a)=>n.jsxRuntimeExports.jsx(Rt.Root,{ref:a,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=Rt.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,bt=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?bt(s):e.toasts.forEach(o=>{bt(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=a=>xe({type:"UPDATE_TOAST",toast:{...a,id:t}}),o=()=>xe({type:"DISMISS_TOAST",toastId:t});return xe({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||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 ai=$.Provider,Uo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx($.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=$.Viewport.displayName;const ri=re.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($.Root,{ref:o,className:c.cn(ri({variant:t}),e),...s}));$o.displayName=$.Root.displayName;const ii=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx($.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=$.Action.displayName;const Go=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx($.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=$.Close.displayName;const Ho=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx($.Title,{ref:s,className:c.cn("text-sm font-semibold [&+div]:text-xs",e),...t}));Ho.displayName=$.Title.displayName;const Wo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx($.Description,{ref:s,className:c.cn("text-sm opacity-90",e),...t}));Wo.displayName=$.Description.displayName;function li(){const{toasts:e}=qo();return n.jsxRuntimeExports.jsxs(ai,{children:[e.map(({id:t,title:s,description:o,action:a,...r})=>n.jsxRuntimeExports.jsxs($o,{...r,children:[n.jsxRuntimeExports.jsxs("div",{className:"grid gap-1",children:[s&&n.jsxRuntimeExports.jsx(Ho,{children:s}),o&&n.jsxRuntimeExports.jsx(Wo,{children:o})]}),a,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}),nt=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(q.Command,{ref:s,className:c.cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));nt.displayName=q.Command.displayName;const di=({children:e,...t})=>n.jsxRuntimeExports.jsx(tt,{...t,children:n.jsxRuntimeExports.jsx(Pe,{className:"overflow-hidden p-0",children:n.jsxRuntimeExports.jsx(nt,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),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(q.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=q.Command.Input.displayName;const Ko=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(q.Command.List,{ref:s,className:c.cn("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Ko.displayName=q.Command.List.displayName;const Jo=f.forwardRef((e,t)=>n.jsxRuntimeExports.jsx(q.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Jo.displayName=q.Command.Empty.displayName;const Qo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(q.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=q.Command.Group.displayName;const Xo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(q.Command.Separator,{ref:s,className:c.cn("-mx-1 h-px bg-border",e),...t}));Xo.displayName=q.Command.Separator.displayName;const Zo=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(q.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=q.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=P.Root,mi=P.Trigger,pi=P.Group,fi=P.Portal,xi=P.Sub,gi=P.RadioGroup,tn=f.forwardRef(({className:e,inset:t,children:s,...o},a)=>n.jsxRuntimeExports.jsxs(P.SubTrigger,{ref:a,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=P.SubTrigger.displayName;const sn=f.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(P.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=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: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=P.Content.displayName;const nn=f.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(P.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=P.Item.displayName;const an=f.forwardRef(({className:e,children:t,checked:s,...o},a)=>n.jsxRuntimeExports.jsxs(P.CheckboxItem,{ref:a,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(P.ItemIndicator,{children:n.jsxRuntimeExports.jsx(L.CheckIcon,{className:"h-4 w-4"})})}),t]}));an.displayName=P.CheckboxItem.displayName;const rn=f.forwardRef(({className:e,children:t,...s},o)=>n.jsxRuntimeExports.jsxs(P.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(P.ItemIndicator,{children:n.jsxRuntimeExports.jsx(L.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));rn.displayName=P.RadioItem.displayName;const ln=f.forwardRef(({className:e,inset:t,...s},o)=>n.jsxRuntimeExports.jsx(P.Label,{ref:o,className:c.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:c.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: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(vt.IconPickerItem,{value:e}),s),t.appendChild(s),s.hidden=!0;let o=s.innerHTML;setTimeout(()=>t.removeChild(s),1e3);const r=new DOMParser().parseFromString(o,"image/svg+xml"),l=r.querySelector("svg");return l&&(l.removeAttribute("width"),l.removeAttribute("height")),new XMLSerializer().serializeToString(r)}catch{return""}},hi=({value:e,onChange:t,onBlur:s,id:o})=>{const a=r=>{t("<svg />");const l=bi(r);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(vt,{value:e?"BiSolidGrid":null,onChange:a,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:r=>t(r.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-C4_dg08Y.cjs"))),yi=w.lazy(()=>Promise.resolve().then(()=>require("./UploadImages-hLrNjSXF.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:a=>o(a),className:"flex h-full w-full flex-col py-2",children:[n.jsxRuntimeExports.jsxs(ot,{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(vi,{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(yi,{isModalView:e,onSelect:t})})})]})]})},ji=Object.freeze(Object.defineProperty({__proto__:null,default:un},Symbol.toStringTag,{value:"Module"})),ht=({children:e,onSelect:t})=>{const[s,o]=w.useState(!1),a=(...r)=>{t.call(void 0,...r),o(!1)};return n.jsxRuntimeExports.jsxs(tt,{open:s,onOpenChange:r=>o(r),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:a})})})]})},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(ht,{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(ht,{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:a}})=>o(s,a),onChange:a=>t(a.target.value)})]})]}),Ri=({id:e,placeholder:t,value:s,onChange:o,onBlur:a})=>{const r={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=>a(e,p),onChange:p=>o(p),modules:r,formats:l,placeholder:t,className:"mt-1 rounded-md"})},ki=({schema:e,formData:t,onChange:s})=>{const[o,a]=w.useState([]),r=ne("getPages",()=>[]),{type:l="page",href:p="",target:x="self"}=t;return w.useEffect(()=>{(async()=>{const u=await r();a(u||[])})()},[]),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:u=>s({...t,type:u.target.value}),children:[{const:"page",title:"Open Page"},{const:"url",title:"Open URL"},{const:"email",title:"Compose Email"},{const:"telephone",title:"Call Phone"},{const:"scroll",title:"Scroll to element"}].map(u=>n.jsxRuntimeExports.jsx("option",{value:u.const,children:u.title},u.const))}),l==="page"?n.jsxRuntimeExports.jsxs("select",{name:"href",placeholder:"Choose Page",value:p,onChange:u=>s({...t,href:u.target.value}),children:[n.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),i.map(o,u=>n.jsxRuntimeExports.jsx("option",{value:u.slug,children:u.name},u.uuid))]}):n.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:p,onChange:u=>s({...t,href:u.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=kr;exports.AccordionContent=Ns;exports.AccordionItem=Rs;exports.AccordionTrigger=ks;exports.Alert=As;exports.AlertDescription=Cs;exports.AlertDialog=Sr;exports.AlertDialogAction=Os;exports.AlertDialogCancel=Ls;exports.AlertDialogContent=Ps;exports.AlertDialogDescription=Ds;exports.AlertDialogFooter=Is;exports.AlertDialogHeader=Ts;exports.AlertDialogTitle=Ms;exports.AlertDialogTrigger=Cr;exports.AlertTitle=Ss;exports.Badge=Ar;exports.Button=ws;exports.Card=Hs;exports.CardContent=Js;exports.CardDescription=Ks;exports.CardFooter=Qs;exports.CardHeader=Ws;exports.CardTitle=Ys;exports.Command=nt;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=an;exports.ContextMenuContent=on;exports.ContextMenuGroup=pi;exports.ContextMenuItem=nn;exports.ContextMenuLabel=ln;exports.ContextMenuPortal=fi;exports.ContextMenuRadioGroup=gi;exports.ContextMenuRadioItem=rn;exports.ContextMenuSeparator=cn;exports.ContextMenuShortcut=dn;exports.ContextMenuSub=xi;exports.ContextMenuSubContent=sn;exports.ContextMenuSubTrigger=tn;exports.ContextMenuTrigger=mi;exports.Dialog=tt;exports.DialogContent=Pe;exports.DialogDescription=Gs;exports.DialogFooter=Us;exports.DialogHeader=qs;exports.DialogTitle=$s;exports.DialogTrigger=Vs;exports.DropdownMenu=Jr;exports.DropdownMenuCheckboxItem=Io;exports.DropdownMenuContent=Po;exports.DropdownMenuGroup=Xr;exports.DropdownMenuItem=To;exports.DropdownMenuLabel=Do;exports.DropdownMenuPortal=Zr;exports.DropdownMenuRadioGroup=ti;exports.DropdownMenuRadioItem=Mo;exports.DropdownMenuSeparator=Oo;exports.DropdownMenuShortcut=Lo;exports.DropdownMenuSub=ei;exports.DropdownMenuSubContent=Bo;exports.DropdownMenuSubTrigger=_o;exports.DropdownMenuTrigger=Qr;exports.HoverCard=Fr;exports.HoverCardContent=bo;exports.HoverCardTrigger=qr;exports.IconPickerField=hi;exports.ImagePickerField=wi;exports.ImagesPanel=ji;exports.Input=Xs;exports.Label=Zs;exports.LinkField=ki;exports.Menubar=ao;exports.MenubarCheckboxItem=mo;exports.MenubarContent=co;exports.MenubarGroup=Or;exports.MenubarItem=uo;exports.MenubarLabel=fo;exports.MenubarMenu=Dr;exports.MenubarPortal=Lr;exports.MenubarRadioGroup=zr;exports.MenubarRadioItem=po;exports.MenubarSeparator=xo;exports.MenubarShortcut=go;exports.MenubarSub=Vr;exports.MenubarSubContent=lo;exports.MenubarSubTrigger=io;exports.MenubarTrigger=ro;exports.Popover=Ir;exports.PopoverContent=no;exports.PopoverTrigger=Mr;exports.RichTextEditorField=Ri;exports.ScrollArea=to;exports.ScrollBar=st;exports.Select=Ur;exports.SelectContent=vo;exports.SelectGroup=$r;exports.SelectItem=jo;exports.SelectLabel=yo;exports.SelectSeparator=wo;exports.SelectTrigger=ho;exports.SelectValue=Gr;exports.Separator=Vo;exports.Sheet=Hr;exports.SheetClose=Yr;exports.SheetContent=No;exports.SheetDescription=Eo;exports.SheetFooter=So;exports.SheetHeader=Ao;exports.SheetTitle=Co;exports.SheetTrigger=Wr;exports.Skeleton=ci;exports.Switch=js;exports.Tabs=so;exports.TabsContent=ke;exports.TabsList=ot;exports.TabsTrigger=Re;exports.Textarea=eo;exports.Toaster=li;exports.Toggle=ys;exports.Tooltip=Pr;exports.TooltipContent=oo;exports.TooltipPortal=_r;exports.TooltipProvider=Br;exports.TooltipTrigger=Tr;exports.activePanelAtom=es;exports.addBlockOffCanvasAtom=ts;exports.addBlocksModalAtom=Tt;exports.advanceStylingOpenAtom=Jt;exports.atom=K;exports.atomWithDefault=Qn;exports.atomWithStorage=ue;exports.badgeVariants=Es;exports.buttonVariants=Be;exports.canAddChildBlock=we;exports.canDeleteBlock=ma;exports.canDropBlock=fa;exports.canDuplicateBlock=ua;exports.canvasIframeAtom=Zt;exports.chaiBuilderPropsAtom=Ae;exports.chaiExternalDataAtom=Ct;exports.createStore=kt;exports.dataProvidersAtom=Ze;exports.draggedBlockIdAtom=as;exports.draggingFlagAtom=ns;exports.editLayerNameAtom=Xt;exports.getBlockJSONFromSchemas=ze;exports.getBlockJSONFromUISchemas=Ve;exports.inlineEditingActiveAtom=os;exports.isDevelopment=ta;exports.networkModeAtom=Qt;exports.pageSyncStateAtom=Ee;exports.presentBlocksAtom=G;exports.reducer=zo;exports.showPredefinedBlockCategoryAtom=ss;exports.toast=Fo;exports.toggleVariants=vs;exports.useActiveModal=dr;exports.useActivePanel=fr;exports.useAddBlock=ja;exports.useAddBlockParent=xr;exports.useAddClassesToBlocks=Aa;exports.useAllBlocks=zt;exports.useAtom=$n;exports.useAtomValue=Nt;exports.useBrandingOptions=Ut;exports.useBuilderProp=ne;exports.useBuilderReset=hr;exports.useBuildingBlocks=Ft;exports.useCanvasHistory=_e;exports.useCanvasWidth=Oa;exports.useCanvasZoom=Va;exports.useCopyBlockIds=za;exports.useCurrentPage=$t;exports.useCutBlockIds=us;exports.useDarkMode=Fa;exports.useDeveloperPreviewMode=Ua;exports.useDuplicateBlocks=ps;exports.useFeatureSupport=jr;exports.useGetPageData=Xe;exports.useHiddenBlockIds=Ga;exports.useHighlightBlockId=fs;exports.useMarkAsGlobalBlock=Wa;exports.useMoveBlocks=Ya;exports.usePageDataProviders=rs;exports.usePasteBlocks=Ja;exports.usePreviewMode=qt;exports.useProject=Xa;exports.useReadOnlyMode=ur;exports.useRemoveBlocks=Za;exports.useRemoveClassesFromBlocks=tr;exports.useSavePage=Da;exports.useSelectedBlock=ha;exports.useSelectedBlockAllClasses=sr;exports.useSelectedBlockCurrentClasses=ar;exports.useSelectedBlockIds=me;exports.useSelectedBlocksDisplayChild=ba;exports.useSelectedBreakpoints=br;exports.useSelectedStylingBlocks=Ke;exports.useSetAllBlocks=da;exports.useSetAtom=At;exports.useStore=qe;exports.useStylingBreakpoint=is;exports.useStylingState=rr;exports.useToast=qo;exports.useTranslations=yr;exports.useTreeData=ca;exports.useUILibraryBlocks=Rr;exports.useUpdateBlocksProps=ir;exports.useUpdateBlocksPropsRealtime=lr;