@chaibuilder/sdk 1.0.13 → 1.0.15

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 (168) hide show
  1. package/dist/{AddBlocks-H7BZYHUC.js → AddBlocks-eoo1CzaK.js} +114 -111
  2. package/dist/AddBlocks-jU0NwP_s.cjs +3 -0
  3. package/dist/BrandingOptions-WSCFnWAf.cjs +1 -0
  4. package/dist/{BrandingOptions-PAgY-kvj.js → BrandingOptions-_Og7VUHA.js} +57 -41
  5. package/dist/{CanvasArea-zn2ox-5h.js → CanvasArea-cky_d2Lu.js} +517 -519
  6. package/dist/CanvasArea-hT9uHhkz.cjs +46 -0
  7. package/dist/Class-RZuPYbUS.cjs +1 -0
  8. package/dist/{Class-l7qYbuoN.js → Class-nQk08vqd.js} +204 -124
  9. package/dist/{CurrentPage-6Jp4xAWK.js → CurrentPage--OlBwyNE.js} +58 -40
  10. package/dist/CurrentPage-x6Ez11gP.cjs +1 -0
  11. package/dist/Layers-gEA0qWYP.cjs +1 -0
  12. package/dist/{Layers-WkZ48AUm.js → Layers-uzA3QA-4.js} +158 -141
  13. package/dist/MarkAsGlobalBlock-lYL8cO9x.cjs +1 -0
  14. package/dist/MarkAsGlobalBlock-ySc-D4SB.js +84 -0
  15. package/dist/PagesPanel-5t0bV9T2.cjs +1 -0
  16. package/dist/PagesPanel-tH6c9Mnv.js +70 -0
  17. package/dist/ProjectPanel-NdrR6a8t.cjs +1 -0
  18. package/dist/ProjectPanel-Q2-15-In.js +91 -0
  19. package/dist/Settings-DBiwm1hY.cjs +1 -0
  20. package/dist/{Settings-fH8fZKpm.js → Settings-LOqpvQ_1.js} +411 -408
  21. package/dist/SidePanels-8JWYXGqN.cjs +1 -0
  22. package/dist/{SidePanels-w8ZHKJaR.js → SidePanels-F7ccs2Xf.js} +106 -88
  23. package/dist/{Topbar-hm1D_5sb.js → Topbar-lX9OMPwj.js} +47 -45
  24. package/dist/Topbar-qi5ab8rR.cjs +1 -0
  25. package/dist/UnsplashImages-a2r7b3kB.cjs +1 -0
  26. package/dist/{UnsplashImages-gPcBLjgB.js → UnsplashImages-u_QTABzi.js} +56 -44
  27. package/dist/{UploadImages-_ZyUU66E.js → UploadImages-gV5xDHIu.js} +55 -34
  28. package/dist/UploadImages-jLQgLujd.cjs +1 -0
  29. package/dist/add-page-modal-U5ramelz.js +110 -0
  30. package/dist/add-page-modal-tIt3N8jH.cjs +1 -0
  31. package/dist/confirm-alert-ZQ-sxX0X.js +58 -0
  32. package/dist/confirm-alert-z74-fGOT.cjs +1 -0
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.js +99 -124
  35. package/dist/delete-page-modal-5XuSfQT0.cjs +1 -0
  36. package/dist/delete-page-modal-_E87bVUZ.js +89 -0
  37. package/dist/form-Osm1AmO5.cjs +1 -0
  38. package/dist/{form-dVpOAyRl.js → form-zZJyZuNH.js} +12 -12
  39. package/dist/index-2EHcmZqL.js +2947 -0
  40. package/dist/index-RVm8Txnj.js +1149 -0
  41. package/dist/index-_jFEo7h5.cjs +206 -0
  42. package/dist/index-c8zW_D2V.cjs +1 -0
  43. package/dist/index-cU5eyVRU.js +40872 -0
  44. package/dist/index-fwo4wa7u.cjs +1 -0
  45. package/dist/index-gmZcUXyn.js +25 -0
  46. package/dist/index-m2muA80V.cjs +9 -0
  47. package/dist/{jsx-runtime-JYMCiFoE.cjs → jsx-runtime-WKRPbKtm.cjs} +7 -7
  48. package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-qAwJ85SY.js} +109 -106
  49. package/dist/lib.cjs +2 -1
  50. package/dist/lib.js +1333 -71
  51. package/dist/page-viewer-BSc-5M4B.cjs +1 -0
  52. package/dist/{page-viewer-Y4YiaZ_m.js → page-viewer-nLqIs_9w.js} +62 -44
  53. package/dist/project-general-setting-14MA_cX5.cjs +1 -0
  54. package/dist/{project-general-setting-U4S_KlhU.js → project-general-setting-kXh5myAr.js} +46 -36
  55. package/dist/project-seo-setting-POGPEJZ8.cjs +1 -0
  56. package/dist/project-seo-setting-nT1qo1Bb.js +89 -0
  57. package/dist/render.cjs +1 -1
  58. package/dist/render.js +23 -19
  59. package/dist/server.cjs +1 -1
  60. package/dist/server.js +1 -1
  61. package/dist/single-page-detail-EgQd9TSA.cjs +1 -0
  62. package/dist/{single-page-detail-pAxCy_Pe.js → single-page-detail-fV-A6vJR.js} +90 -80
  63. package/dist/studio.cjs +1 -1
  64. package/dist/studio.js +45 -25
  65. package/dist/ui.cjs +1 -1
  66. package/dist/ui.js +156 -357
  67. package/package.json +1 -1
  68. package/dist/AddBlocks-7ACJv8LW.cjs +0 -3
  69. package/dist/BrandingOptions-5j-XszLM.cjs +0 -1
  70. package/dist/CanvasArea-Dnm-yeus.cjs +0 -46
  71. package/dist/ChaiBuilderEditor-BoE-sArB.cjs +0 -163
  72. package/dist/ChaiBuilderEditor-hEuUONQ3.js +0 -27094
  73. package/dist/Class-_uCzl5v1.cjs +0 -1
  74. package/dist/CurrentPage-YMpqOqx7.cjs +0 -1
  75. package/dist/ImagesPanel-6us7hiLN.cjs +0 -1
  76. package/dist/ImagesPanel-oaHOD-Ex.js +0 -27
  77. package/dist/Layers-EzOZdWvd.cjs +0 -1
  78. package/dist/MODIFIERS-DsEzQ3aH.js +0 -73
  79. package/dist/MODIFIERS-Fx6WAZcw.cjs +0 -1
  80. package/dist/MarkAsGlobalBlock-0HubcRkY.js +0 -77
  81. package/dist/MarkAsGlobalBlock-HmeIyLCP.cjs +0 -1
  82. package/dist/PagesPanel-6JuwBLFQ.js +0 -50
  83. package/dist/PagesPanel-zJq8p1ja.cjs +0 -1
  84. package/dist/ProjectPanel-Zml2F8b9.cjs +0 -1
  85. package/dist/ProjectPanel-cu2QSDW9.js +0 -73
  86. package/dist/Settings-lc9PfnmG.cjs +0 -1
  87. package/dist/SidePanels-VH72zFE2.cjs +0 -1
  88. package/dist/Topbar-vQPo9xSY.cjs +0 -1
  89. package/dist/UnsplashImages-BoBBSi1a.cjs +0 -1
  90. package/dist/UploadImages-T6kW0s3G.cjs +0 -1
  91. package/dist/accordion-oPUeqPCZ.js +0 -42
  92. package/dist/accordion-ynvFtV_p.cjs +0 -1
  93. package/dist/add-page-modal--qZSwJuB.cjs +0 -1
  94. package/dist/add-page-modal-bj7qbZuK.js +0 -99
  95. package/dist/alert-dialog-GNfnpqFB.js +0 -64
  96. package/dist/alert-dialog-Mv0-wAvS.cjs +0 -1
  97. package/dist/command-ThdTuUxt.cjs +0 -1
  98. package/dist/command-VHca6CcN.js +0 -97
  99. package/dist/confirm-alert-8EHe0OOd.cjs +0 -1
  100. package/dist/confirm-alert-b0e_BLhF.js +0 -36
  101. package/dist/context-menu-8dC9uGXj.js +0 -122
  102. package/dist/context-menu-IgLbIuth.cjs +0 -1
  103. package/dist/controls-Ni5kEzLz.js +0 -103
  104. package/dist/controls-W97-POR_.cjs +0 -1
  105. package/dist/controls-enQY7NI8.js +0 -118
  106. package/dist/controls-xUKa23ic.cjs +0 -1
  107. package/dist/delete-page-modal-2LuDLEiP.cjs +0 -1
  108. package/dist/delete-page-modal-cnrR8tWH.js +0 -69
  109. package/dist/dialog-S_QbL1iq.cjs +0 -1
  110. package/dist/dialog-jrw9DF1f.js +0 -65
  111. package/dist/dropdown-menu-S03K_fNs.js +0 -164
  112. package/dist/dropdown-menu-sMXR59cB.cjs +0 -1
  113. package/dist/form-nRAvKPQj.cjs +0 -1
  114. package/dist/functions-nNTuSTsR.js +0 -1106
  115. package/dist/functions-pcUZhFJM.js +0 -12
  116. package/dist/functions-sCuB7nvZ.cjs +0 -2
  117. package/dist/functions-uw7QP2kT.cjs +0 -1
  118. package/dist/html-to-json-P6GpbcQX.cjs +0 -1
  119. package/dist/html-to-json-pdHQfRkN.js +0 -178
  120. package/dist/index-HAue58ea.cjs +0 -1
  121. package/dist/index-T4_wfKl5.js +0 -2256
  122. package/dist/index-X9ZgD09V.cjs +0 -1
  123. package/dist/index-ehKdBRUK.js +0 -18
  124. package/dist/label-KaP7MRrs.js +0 -10
  125. package/dist/label-tFm8HZdb.cjs +0 -1
  126. package/dist/link-6o6n2Tnd.js +0 -204
  127. package/dist/link-ece8dZGH.cjs +0 -1
  128. package/dist/page-viewer-IARz6OSp.cjs +0 -1
  129. package/dist/popover-a84pbVhQ.js +0 -23
  130. package/dist/popover-fKjgcRUx.cjs +0 -1
  131. package/dist/project-general-setting-eSl3t-VH.cjs +0 -1
  132. package/dist/project-seo-setting-Ga9v_ECU.js +0 -67
  133. package/dist/project-seo-setting-rankm1z3.cjs +0 -1
  134. package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
  135. package/dist/scroll-area-ewXbxc3n.js +0 -30
  136. package/dist/select-7bjg-rr9.cjs +0 -1
  137. package/dist/select-POGdEDHT.js +0 -75
  138. package/dist/separator-3Civ-6hb.cjs +0 -1
  139. package/dist/separator-SctTn0Qi.js +0 -18
  140. package/dist/single-page-detail-yPgnu2AI.cjs +0 -1
  141. package/dist/skeleton-CU_FIbg3.js +0 -239
  142. package/dist/skeleton-JHP9zwL2.cjs +0 -1
  143. package/dist/tabs-Gb9v5dVb.js +0 -46
  144. package/dist/tabs-iWeaaVrg.cjs +0 -1
  145. package/dist/textarea-1kZEh7ki.cjs +0 -1
  146. package/dist/textarea-b2QvVhrK.js +0 -73
  147. package/dist/toggle-ASJRAaGP.js +0 -30
  148. package/dist/toggle-ehNIPmme.cjs +0 -1
  149. package/dist/useAddBlock-WJc3OgG8.js +0 -86
  150. package/dist/useAddBlock-dCKRFPRU.cjs +0 -1
  151. package/dist/useAllBlocks-6hvuNuyw.cjs +0 -1
  152. package/dist/useAllBlocks-PQKYvs-e.js +0 -20
  153. package/dist/useChaiExternalData-4K9WxANa.js +0 -6
  154. package/dist/useChaiExternalData-DkyBJ81C.cjs +0 -1
  155. package/dist/useDarkMode-ZKCO_gkt.js +0 -23
  156. package/dist/useDarkMode-dV6FM6l-.cjs +0 -1
  157. package/dist/useFeatureSupport-OLwNgEZb.js +0 -16
  158. package/dist/useFeatureSupport-c9IgPW2t.cjs +0 -1
  159. package/dist/useHiddenBlocks-3MsGOJ1s.js +0 -15
  160. package/dist/useHiddenBlocks-oJuQDmTy.cjs +0 -1
  161. package/dist/useLanguage-NKKKaxVM.cjs +0 -1
  162. package/dist/useLanguage-gVC5rxO5.js +0 -216
  163. package/dist/useMarkAsGlobalBlock-X73Vny8u.js +0 -25
  164. package/dist/useMarkAsGlobalBlock-ebBVGHg4.cjs +0 -1
  165. package/dist/useUiLibraries-4hPOi8DI.js +0 -12
  166. package/dist/useUiLibraries-9FhQCpKo.cjs +0 -1
  167. package/dist/utils-dze1SGvB.js +0 -6
  168. package/dist/utils-qK_SjzzV.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";var k=Object.create;var b=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var P=(r,o,i,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of S(o))!A.call(r,l)&&l!==i&&b(r,l,{get:()=>o[l],enumerable:!(u=C(o,l))||u.enumerable});return r};var T=(r,o,i)=>(i=r!=null?k(D(r)):{},P(o||!r||!r.__esModule?b(i,"default",{value:r,enumerable:!0}):i,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),y=require("@radix-ui/react-icons"),n=require("react"),R=require("jotai"),x=require("lodash"),s=require("./index-c8zW_D2V.cjs");require("./lib.cjs");const E=require("lucide-react"),z=require("./index-fwo4wa7u.cjs"),B=require("./index-_jFEo7h5.cjs"),K=require("./Class-RZuPYbUS.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");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("flat-to-nested");require("redux-undo");require("@react-hookz/web");require("react-i18next");require("himalaya");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("clsx");require("tailwind-merge");require("i18next");require("./index-m2muA80V.cjs");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");const V=n.lazy(()=>import("react-json-view")),I=({provider:r,onClose:o})=>{const[i,u]=n.useState(null);return n.useEffect(()=>{r&&(r.mockFn?r.mockFn:r.dataFn)().then(d=>u(d))},[r]),r?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:l=>l?"":o(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:["Data Provider: ",r.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:r.description})]}),e.jsxRuntimeExports.jsx(B.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(V,{style:{maxHeight:"80vh",overflowY:"auto"},name:r.providerKey,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:i})})]})}):null};function L({children:r,name:o,onRemove:i}){return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:r}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogTitle,{children:["Are you sure, you want to remove ",e.jsxRuntimeExports.jsx("span",{className:"text-blue-500",children:o})," provider?"]}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:"Your data provider will be removed from this page and all added data binding will be not visible on blocks."})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:"Cancel"}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:i,className:"bg-red-600 hover:bg-red-700",children:"Remove"})]})]})]})}const M=()=>{const r=n.useMemo(()=>z.A(),[]),[o,i]=s.usePageDataProviders(),[,u]=R.useAtom(s.pageSyncStateAtom),[l,d]=n.useState(x.filter(r,t=>x.map(o,"providerKey").includes(t.providerKey))),[j,g]=n.useState(""),[v,c]=n.useState(null),f=x.filter(r.map(t=>x.map(l,"providerKey").includes(t.providerKey)?null:{value:t.providerKey,label:t.name}),t=>!x.isNull(t)),a=t=>{const p=x.find(r,{providerKey:t});d(m=>[...m,p]),i(m=>[...m,{providerKey:p.providerKey,args:{}}]),g(""),u("UNSAVED")},h=t=>{d(p=>x.filter(p,m=>m.providerKey!==t.providerKey)),i(p=>x.filter(p,m=>m.providerKey!==t.providerKey)),u("UNSAVED")},N=t=>c(t);return x.isEmpty(r)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 mb-1.5 text-xs p-4",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 mb-1.5 text-xs",children:"Add data providers:"})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:j,onValueChange:t=>a(t),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:"Choose"}),f.map(t=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:t.value,children:t.label},t.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${l.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 pt-4 pb-1.5 text-xs flex-1 font-medium",children:"Page data providers:"}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:l.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm w-full","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex justify-between items-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:t.name}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-gray-400 pt-1",children:t.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"items-center p-2 py-2 flex justify-between",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>N(t),className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-blue-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),"View Data"]}),e.jsxRuntimeExports.jsx(L,{onRemove:()=>h(t),name:t.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),"Remove"]})})]})]},t.providerKey))}),e.jsxRuntimeExports.jsx(I,{onClose:()=>c(null),provider:v})]})]})},q=n.lazy(()=>Promise.resolve().then(()=>require("./Layers-gEA0qWYP.cjs"))),H=n.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-WSCFnWAf.cjs"))),O=n.lazy(()=>Promise.resolve().then(()=>require("./index-c8zW_D2V.cjs")).then(r=>r.ImagesPanel));let w=null;const F=()=>{const r=s.useBuilderProp("sideBarComponents.top",[]),o=s.useBuilderProp("sideBarComponents.bottom",[]),[i,u]=R.useAtom(s.activePanelAtom),[l,d]=n.useState(i),[j,g]=n.useState(null),v={layers:q,"branding-options":H,images:O};x.each(r,({name:a,panel:h})=>{v[a]=h});const c=a=>{clearTimeout(w),f(!1),i!=="layers"&&a==="layers"?w=setTimeout(()=>d("layers"),500):d(a),u(a)},[,f]=R.useAtom(s.addBlocksModalAtom);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{f(!0),u("layers")},size:"sm",variant:i==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(y.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>c("layers"),size:"sm",variant:i==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>c("branding-options"),size:"sm",variant:i==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(y.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),n.Children.toArray(r.map(({name:a,icon:h})=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>c(a),size:"sm",className:"w-10",variant:i===a?"default":"outline",children:e.jsxRuntimeExports.jsx(h,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:n.Children.toArray(o.map(a=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(a,{})})))})]}),e.jsxRuntimeExports.jsx("div",{onClick:()=>{c("layers")},className:"absolute inset-0 right-0 z-50 w-screen bg-black/20"+(i==="layers"?" hidden":"")}),e.jsxRuntimeExports.jsx("div",{className:`fixed left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${i!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:K.cn("relative h-full max-h-[93%] bg-background p-1",i==="layers"?"":"z-[100]"),onMouseEnter:()=>{j&&clearTimeout(j)},onMouseLeave:()=>{const a=setTimeout(()=>{j&&(c("layers"),clearTimeout(j))},1e3);g(a)},children:n.createElement(x.get(v,l,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 h-10 grid grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"h-3 mr-2"})," Layers"]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(E.DatabaseIcon,{className:"w-3 mr-2"}),"Data"]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:n.createElement(q)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(M,{})})]})})})]})};exports.default=F;
@@ -1,54 +1,72 @@
1
- import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
- import { PlusIcon as V, Half2Icon as E } from "@radix-ui/react-icons";
3
- import h, { useMemo as L, useState as u, useEffect as M, lazy as N, Suspense as j } from "react";
1
+ import { j as e } from "./jsx-runtime-qAwJ85SY.js";
2
+ import { PlusIcon as E, Half2Icon as V } from "@radix-ui/react-icons";
3
+ import h, { useState as p, useEffect as L, useMemo as M, lazy as N, Suspense as j } from "react";
4
4
  import { useAtom as w } from "jotai";
5
- import { filter as g, map as k, isNull as H, isEmpty as I, find as R, each as _, get as F } from "lodash";
6
- import { u as C, B as b, S as D } from "./skeleton-CU_FIbg3.js";
7
- import { T as O, a as Y, b as A, c as P } from "./tabs-Gb9v5dVb.js";
8
- import { t as U, v as $, E as J, w as Z, x as q } from "./ChaiBuilderEditor-hEuUONQ3.js";
9
- import "react-i18next";
10
- import { c as G } from "./utils-dze1SGvB.js";
11
- import { ListTreeIcon as S, DatabaseIcon as Q } from "lucide-react";
12
- import { A as W } from "./index-ehKdBRUK.js";
13
- import { A as X, a as ee, b as se, c as re, e as ae, f as le, d as ie, h as te, g as oe } from "./alert-dialog-GNfnpqFB.js";
14
- import { D as ne, b as ce, c as de, e as me, f as xe } from "./dialog-jrw9DF1f.js";
15
- import { S as ue, c as pe, b as he, d as fe, f as T } from "./select-POGdEDHT.js";
16
- import "@radix-ui/react-slot";
5
+ import { filter as g, map as k, isNull as H, find as I, isEmpty as R, each as F, get as _ } from "lodash";
6
+ import { ao as O, ap as Y, aq as J, ar as U, as as $, D as q, E as G, F as Z, G as Q, H as W, I as X, J as ee, K as se, at as re, s as ae, t as ie, au as le, av as te, aw as oe, ax as ne, ay as C, i as D, az as ce, aA as de, B as b, S as A, aB as me, aC as xe, aD as P, aE as S } from "./index-2EHcmZqL.js";
7
+ import "./lib.js";
8
+ import { ListTreeIcon as T, DatabaseIcon as pe } from "lucide-react";
9
+ import { A as ue } from "./index-gmZcUXyn.js";
10
+ import { E as he } from "./index-cU5eyVRU.js";
11
+ import { b as fe } from "./Class-nQk08vqd.js";
12
+ import "@radix-ui/react-toggle";
17
13
  import "class-variance-authority";
14
+ import "@radix-ui/react-switch";
15
+ import "@radix-ui/react-slot";
16
+ import "@radix-ui/react-accordion";
17
+ import "@radix-ui/react-alert-dialog";
18
+ import "@radix-ui/react-dialog";
19
+ import "@radix-ui/react-label";
20
+ import "@radix-ui/react-scroll-area";
21
+ import "@radix-ui/react-tabs";
18
22
  import "@radix-ui/react-tooltip";
23
+ import "@radix-ui/react-popover";
24
+ import "@radix-ui/react-menubar";
25
+ import "@radix-ui/react-hover-card";
26
+ import "@radix-ui/react-select";
27
+ import "@radix-ui/react-dropdown-menu";
28
+ import "@radix-ui/react-separator";
19
29
  import "@radix-ui/react-toast";
20
- import "@radix-ui/react-tabs";
21
- import "./MODIFIERS-DsEzQ3aH.js";
22
- import "clsx";
23
- import "@radix-ui/react-scroll-area";
30
+ import "cmdk";
31
+ import "@radix-ui/react-context-menu";
32
+ import "react-icons-picker";
24
33
  import "react-dom";
25
- import "@floating-ui/react-dom";
34
+ import "react-quill";
35
+ import "flat-to-nested";
36
+ import "redux-undo";
37
+ import "@react-hookz/web";
38
+ import "react-i18next";
39
+ import "himalaya";
40
+ import "@mhsdesign/jit-browser-tailwindcss";
41
+ import "@bobthered/tailwindcss-palette-generator";
42
+ import "@tailwindcss/forms";
43
+ import "@tailwindcss/typography";
44
+ import "@tailwindcss/aspect-ratio";
45
+ import "@tailwindcss/line-clamp";
46
+ import "clsx";
47
+ import "tailwind-merge";
26
48
  import "i18next";
49
+ import "./index-RVm8Txnj.js";
50
+ import "@floating-ui/react-dom";
51
+ import "react-textarea-autosize";
27
52
  import "flagged";
28
53
  import "react-dnd";
29
54
  import "@minoru/react-dnd-treeview";
30
55
  import "react-hotkeys-hook";
31
- import "flat-to-nested";
32
- import "./functions-pcUZhFJM.js";
33
- import "redux-undo";
34
- import "@react-hookz/web";
35
- import "tailwind-merge";
36
- import "@radix-ui/react-alert-dialog";
37
- import "@radix-ui/react-dialog";
38
- import "@radix-ui/react-select";
56
+ import "sonner";
39
57
  const ve = h.lazy(() => import("react-json-view")), je = ({ provider: r, onClose: o }) => {
40
- const [a, n] = u(null);
41
- return M(() => {
58
+ const [a, n] = p(null);
59
+ return L(() => {
42
60
  r && (r.mockFn ? r.mockFn : r.dataFn)().then((c) => n(c));
43
- }, [r]), r ? /* @__PURE__ */ e.jsx(ne, { onOpenChange: (i) => i ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(ce, { children: [
44
- /* @__PURE__ */ e.jsxs(de, { children: [
45
- /* @__PURE__ */ e.jsxs(me, { children: [
61
+ }, [r]), r ? /* @__PURE__ */ e.jsx(O, { onOpenChange: (l) => l ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(Y, { children: [
62
+ /* @__PURE__ */ e.jsxs(J, { children: [
63
+ /* @__PURE__ */ e.jsxs(U, { children: [
46
64
  "Data Provider: ",
47
65
  r.name
48
66
  ] }),
49
- /* @__PURE__ */ e.jsx(xe, { children: r.description })
67
+ /* @__PURE__ */ e.jsx($, { children: r.description })
50
68
  ] }),
51
- /* @__PURE__ */ e.jsx(J, { children: /* @__PURE__ */ e.jsx(
69
+ /* @__PURE__ */ e.jsx(he, { children: /* @__PURE__ */ e.jsx(
52
70
  ve,
53
71
  {
54
72
  style: { maxHeight: "80vh", overflowY: "auto" },
@@ -66,54 +84,54 @@ function ge({
66
84
  name: o,
67
85
  onRemove: a
68
86
  }) {
69
- return /* @__PURE__ */ e.jsxs(X, { children: [
70
- /* @__PURE__ */ e.jsx(ee, { asChild: !0, children: r }),
71
- /* @__PURE__ */ e.jsxs(se, { children: [
72
- /* @__PURE__ */ e.jsxs(re, { children: [
73
- /* @__PURE__ */ e.jsxs(ae, { children: [
87
+ return /* @__PURE__ */ e.jsxs(q, { children: [
88
+ /* @__PURE__ */ e.jsx(G, { asChild: !0, children: r }),
89
+ /* @__PURE__ */ e.jsxs(Z, { children: [
90
+ /* @__PURE__ */ e.jsxs(Q, { children: [
91
+ /* @__PURE__ */ e.jsxs(W, { children: [
74
92
  "Are you sure, you want to remove ",
75
93
  /* @__PURE__ */ e.jsx("span", { className: "text-blue-500", children: o }),
76
94
  " provider?"
77
95
  ] }),
78
- /* @__PURE__ */ e.jsx(le, { children: "Your data provider will be removed from this page and all added data binding will be not visible on blocks." })
96
+ /* @__PURE__ */ e.jsx(X, { children: "Your data provider will be removed from this page and all added data binding will be not visible on blocks." })
79
97
  ] }),
80
- /* @__PURE__ */ e.jsxs(ie, { children: [
81
- /* @__PURE__ */ e.jsx(te, { children: "Cancel" }),
82
- /* @__PURE__ */ e.jsx(oe, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: "Remove" })
98
+ /* @__PURE__ */ e.jsxs(ee, { children: [
99
+ /* @__PURE__ */ e.jsx(se, { children: "Cancel" }),
100
+ /* @__PURE__ */ e.jsx(re, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: "Remove" })
83
101
  ] })
84
102
  ] })
85
103
  ] });
86
104
  }
87
105
  const be = () => {
88
- const r = L(() => W(), []), [o, a] = U(), [, n] = w($), [i, c] = u(
106
+ const r = M(() => ue(), []), [o, a] = ae(), [, n] = w(ie), [l, c] = p(
89
107
  g(r, (s) => k(o, "providerKey").includes(s.providerKey))
90
- ), [m, y] = u(""), [f, t] = u(null), v = g(
91
- r.map((s) => k(i, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
108
+ ), [m, y] = p(""), [f, t] = p(null), v = g(
109
+ r.map((s) => k(l, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
92
110
  (s) => !H(s)
93
- ), l = (s) => {
94
- const x = R(r, { providerKey: s });
111
+ ), i = (s) => {
112
+ const x = I(r, { providerKey: s });
95
113
  c((d) => [...d, x]), a((d) => [...d, { providerKey: x.providerKey, args: {} }]), y(""), n("UNSAVED");
96
- }, p = (s) => {
114
+ }, u = (s) => {
97
115
  c((x) => g(x, (d) => d.providerKey !== s.providerKey)), a((x) => g(x, (d) => d.providerKey !== s.providerKey)), n("UNSAVED");
98
116
  }, B = (s) => t(s);
99
- return I(r) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs p-4", children: [
117
+ return R(r) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs p-4", children: [
100
118
  "You have no data providers registered. Please add a data provider to your project. ",
101
119
  /* @__PURE__ */ e.jsx("br", {}),
102
120
  /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "Learn more" })
103
121
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
104
122
  /* @__PURE__ */ e.jsx("br", {}),
105
123
  /* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 mb-1.5 text-xs", children: "Add data providers:" }) }),
106
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(ue, { value: m, onValueChange: (s) => l(s), children: [
107
- /* @__PURE__ */ e.jsx(pe, { className: "w-full", children: /* @__PURE__ */ e.jsx(he, { placeholder: "Select a provider" }) }),
108
- /* @__PURE__ */ e.jsxs(fe, { children: [
109
- /* @__PURE__ */ e.jsx(T, { value: "", children: "Choose" }),
110
- v.map((s) => /* @__PURE__ */ e.jsx(T, { value: s.value, children: s.label }, s.value))
124
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(le, { value: m, onValueChange: (s) => i(s), children: [
125
+ /* @__PURE__ */ e.jsx(te, { className: "w-full", children: /* @__PURE__ */ e.jsx(oe, { placeholder: "Select a provider" }) }),
126
+ /* @__PURE__ */ e.jsxs(ne, { children: [
127
+ /* @__PURE__ */ e.jsx(C, { value: "", children: "Choose" }),
128
+ v.map((s) => /* @__PURE__ */ e.jsx(C, { value: s.value, children: s.label }, s.value))
111
129
  ] })
112
130
  ] }) }),
113
131
  /* @__PURE__ */ e.jsx("br", {}),
114
- /* @__PURE__ */ e.jsxs("div", { className: `border-t ${i.length ? "block" : "hidden"}`, children: [
132
+ /* @__PURE__ */ e.jsxs("div", { className: `border-t ${l.length ? "block" : "hidden"}`, children: [
115
133
  /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 pt-4 pb-1.5 text-xs flex-1 font-medium", children: "Page data providers:" }),
116
- /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: i.map((s) => /* @__PURE__ */ e.jsxs(
134
+ /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: l.map((s) => /* @__PURE__ */ e.jsxs(
117
135
  "div",
118
136
  {
119
137
  className: "rounded-lg border bg-card text-card-foreground shadow-sm w-full",
@@ -153,7 +171,7 @@ const be = () => {
153
171
  ]
154
172
  }
155
173
  ),
156
- /* @__PURE__ */ e.jsx(ge, { onRemove: () => p(s), name: s.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500", children: [
174
+ /* @__PURE__ */ e.jsx(ge, { onRemove: () => u(s), name: s.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500", children: [
157
175
  /* @__PURE__ */ e.jsxs(
158
176
  "svg",
159
177
  {
@@ -184,20 +202,20 @@ const be = () => {
184
202
  /* @__PURE__ */ e.jsx(je, { onClose: () => t(null), provider: f })
185
203
  ] })
186
204
  ] });
187
- }, z = N(() => import("./Layers-WkZ48AUm.js")), ye = N(() => import("./BrandingOptions-PAgY-kvj.js")), we = N(() => import("./ImagesPanel-oaHOD-Ex.js"));
205
+ }, z = N(() => import("./Layers-uzA3QA-4.js")), ye = N(() => import("./BrandingOptions-_Og7VUHA.js")), we = N(() => import("./index-2EHcmZqL.js").then((r) => r.cz));
188
206
  let K = null;
189
- const os = () => {
190
- const r = C("sideBarComponents.top", []), o = C("sideBarComponents.bottom", []), [a, n] = w(Z), [i, c] = u(a), [m, y] = u(null), f = {
207
+ const Cs = () => {
208
+ const r = D("sideBarComponents.top", []), o = D("sideBarComponents.bottom", []), [a, n] = w(ce), [l, c] = p(a), [m, y] = p(null), f = {
191
209
  layers: z,
192
210
  "branding-options": ye,
193
211
  images: we
194
212
  };
195
- _(r, ({ name: l, panel: p }) => {
196
- f[l] = p;
213
+ F(r, ({ name: i, panel: u }) => {
214
+ f[i] = u;
197
215
  });
198
- const t = (l) => {
199
- clearTimeout(K), v(!1), a !== "layers" && l === "layers" ? K = setTimeout(() => c("layers"), 500) : c(l), n(l);
200
- }, [, v] = w(q);
216
+ const t = (i) => {
217
+ clearTimeout(K), v(!1), a !== "layers" && i === "layers" ? K = setTimeout(() => c("layers"), 500) : c(i), n(i);
218
+ }, [, v] = w(de);
201
219
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
202
220
  /* @__PURE__ */ e.jsxs("div", { className: "z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2", children: [
203
221
  /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
@@ -209,7 +227,7 @@ const os = () => {
209
227
  },
210
228
  size: "sm",
211
229
  variant: a === "add-blocks" ? "default" : "outline",
212
- children: /* @__PURE__ */ e.jsx(V, { className: "text-xl" })
230
+ children: /* @__PURE__ */ e.jsx(E, { className: "text-xl" })
213
231
  }
214
232
  ),
215
233
  /* @__PURE__ */ e.jsx(
@@ -218,7 +236,7 @@ const os = () => {
218
236
  onClick: () => t("layers"),
219
237
  size: "sm",
220
238
  variant: a === "layers" ? "default" : "outline",
221
- children: /* @__PURE__ */ e.jsx(S, { className: "w-4" })
239
+ children: /* @__PURE__ */ e.jsx(T, { className: "w-4" })
222
240
  }
223
241
  ),
224
242
  /* @__PURE__ */ e.jsx(
@@ -227,24 +245,24 @@ const os = () => {
227
245
  onClick: () => t("branding-options"),
228
246
  size: "sm",
229
247
  variant: a === "branding-options" ? "default" : "outline",
230
- children: /* @__PURE__ */ e.jsx(E, { className: "w-4 max-w-[40px] text-xs" })
248
+ children: /* @__PURE__ */ e.jsx(V, { className: "w-4 max-w-[40px] text-xs" })
231
249
  }
232
250
  ),
233
251
  h.Children.toArray(
234
- r.map(({ name: l, icon: p }) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(D, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
252
+ r.map(({ name: i, icon: u }) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(A, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
235
253
  b,
236
254
  {
237
- onClick: () => t(l),
255
+ onClick: () => t(i),
238
256
  size: "sm",
239
257
  className: "w-10",
240
- variant: a === l ? "default" : "outline",
241
- children: /* @__PURE__ */ e.jsx(p, {})
258
+ variant: a === i ? "default" : "outline",
259
+ children: /* @__PURE__ */ e.jsx(u, {})
242
260
  }
243
261
  ) }))
244
262
  )
245
263
  ] }),
246
264
  /* @__PURE__ */ e.jsx("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: h.Children.toArray(
247
- o.map((l) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(D, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(l, {}) }))
265
+ o.map((i) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(A, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(i, {}) }))
248
266
  ) })
249
267
  ] }),
250
268
  /* @__PURE__ */ e.jsx(
@@ -271,17 +289,17 @@ const os = () => {
271
289
  children: /* @__PURE__ */ e.jsx(
272
290
  "div",
273
291
  {
274
- className: G("relative h-full max-h-[93%] bg-background p-1", a === "layers" ? "" : "z-[100]"),
292
+ className: fe("relative h-full max-h-[93%] bg-background p-1", a === "layers" ? "" : "z-[100]"),
275
293
  onMouseEnter: () => {
276
294
  m && clearTimeout(m);
277
295
  },
278
296
  onMouseLeave: () => {
279
- const l = setTimeout(() => {
297
+ const i = setTimeout(() => {
280
298
  m && (t("layers"), clearTimeout(m));
281
299
  }, 1e3);
282
- y(l);
300
+ y(i);
283
301
  },
284
- children: h.createElement(F(f, i, () => /* @__PURE__ */ e.jsx("div", {})))
302
+ children: h.createElement(_(f, l, () => /* @__PURE__ */ e.jsx("div", {})))
285
303
  }
286
304
  )
287
305
  }
@@ -296,24 +314,24 @@ const os = () => {
296
314
  /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
297
315
  /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
298
316
  ] }),
299
- children: /* @__PURE__ */ e.jsxs(O, { defaultValue: "layers", className: "flex h-full w-full flex-col py-1", children: [
300
- /* @__PURE__ */ e.jsxs(Y, { className: "mx-1 h-10 grid grid-cols-2", children: [
301
- /* @__PURE__ */ e.jsxs(A, { value: "layers", children: [
302
- /* @__PURE__ */ e.jsx(S, { className: "h-3 mr-2" }),
317
+ children: /* @__PURE__ */ e.jsxs(me, { defaultValue: "layers", className: "flex h-full w-full flex-col py-1", children: [
318
+ /* @__PURE__ */ e.jsxs(xe, { className: "mx-1 h-10 grid grid-cols-2", children: [
319
+ /* @__PURE__ */ e.jsxs(P, { value: "layers", children: [
320
+ /* @__PURE__ */ e.jsx(T, { className: "h-3 mr-2" }),
303
321
  " Layers"
304
322
  ] }),
305
- /* @__PURE__ */ e.jsxs(A, { value: "data-provider", children: [
306
- /* @__PURE__ */ e.jsx(Q, { className: "w-3 mr-2" }),
323
+ /* @__PURE__ */ e.jsxs(P, { value: "data-provider", children: [
324
+ /* @__PURE__ */ e.jsx(pe, { className: "w-3 mr-2" }),
307
325
  "Data"
308
326
  ] })
309
327
  ] }),
310
- /* @__PURE__ */ e.jsx(P, { value: "layers", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: h.createElement(z) }),
311
- /* @__PURE__ */ e.jsx(P, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(be, {}) })
328
+ /* @__PURE__ */ e.jsx(S, { value: "layers", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: h.createElement(z) }),
329
+ /* @__PURE__ */ e.jsx(S, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(be, {}) })
312
330
  ] })
313
331
  }
314
332
  ) })
315
333
  ] });
316
334
  };
317
335
  export {
318
- os as default
336
+ Cs as default
319
337
  };
@@ -1,39 +1,41 @@
1
- import { j as e } from "./jsx-runtime-Sp0orL4X.js";
1
+ import { j as e } from "./jsx-runtime-qAwJ85SY.js";
2
2
  import o, { useMemo as m, Suspense as c } from "react";
3
3
  import { FontFamilyIcon as x } from "@radix-ui/react-icons";
4
- import { S as d, c as h, b as u, d as g, a as j, e as f, f as r } from "./select-POGdEDHT.js";
5
- import { u as a, T as v, a as S, c as b, S as p } from "./skeleton-CU_FIbg3.js";
6
- import { S as N } from "./separator-SctTn0Qi.js";
7
- import { T as C } from "./toggle-ASJRAaGP.js";
8
- import { p as w } from "./ChaiBuilderEditor-hEuUONQ3.js";
9
- import { useTranslation as y } from "react-i18next";
10
- import "@radix-ui/react-select";
11
- import "./utils-dze1SGvB.js";
4
+ import { i as r, au as d, av as h, aw as u, ax as g, aF as j, aG as v, ay as a, ag as f, aH as S, aI as b, aJ as N, aK as w, S as p, aL as y } from "./index-2EHcmZqL.js";
5
+ import { useTranslation as C } from "react-i18next";
6
+ import "./Class-nQk08vqd.js";
12
7
  import "clsx";
13
8
  import "tailwind-merge";
14
- import "jotai";
15
9
  import "lodash";
16
- import "@radix-ui/react-slot";
10
+ import "@radix-ui/react-toggle";
17
11
  import "class-variance-authority";
12
+ import "@radix-ui/react-switch";
13
+ import "@radix-ui/react-slot";
14
+ import "@radix-ui/react-accordion";
15
+ import "@radix-ui/react-alert-dialog";
16
+ import "@radix-ui/react-dialog";
17
+ import "@radix-ui/react-label";
18
+ import "@radix-ui/react-scroll-area";
19
+ import "@radix-ui/react-tabs";
18
20
  import "@radix-ui/react-tooltip";
19
- import "@radix-ui/react-toast";
21
+ import "@radix-ui/react-popover";
22
+ import "@radix-ui/react-menubar";
23
+ import "@radix-ui/react-hover-card";
24
+ import "@radix-ui/react-select";
25
+ import "@radix-ui/react-dropdown-menu";
20
26
  import "@radix-ui/react-separator";
21
- import "@radix-ui/react-toggle";
22
- import "./MODIFIERS-DsEzQ3aH.js";
23
- import "@radix-ui/react-scroll-area";
27
+ import "@radix-ui/react-toast";
28
+ import "cmdk";
29
+ import "@radix-ui/react-context-menu";
30
+ import "react-icons-picker";
24
31
  import "react-dom";
25
- import "@floating-ui/react-dom";
26
- import "i18next";
27
- import "flagged";
28
- import "react-dnd";
29
- import "@minoru/react-dnd-treeview";
30
- import "react-hotkeys-hook";
32
+ import "react-quill";
33
+ import "jotai";
31
34
  import "flat-to-nested";
32
- import "./functions-pcUZhFJM.js";
33
35
  import "redux-undo";
36
+ import "./index-gmZcUXyn.js";
34
37
  import "@react-hookz/web";
35
- import "./index-ehKdBRUK.js";
36
- const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(d, { children: [
38
+ const A = () => r("languages", ["en"]), B = () => A().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(d, { children: [
37
39
  /* @__PURE__ */ e.jsx(h, { className: "w-[150px] border-0", children: /* @__PURE__ */ e.jsx(
38
40
  u,
39
41
  {
@@ -44,15 +46,15 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
44
46
  }
45
47
  ) }),
46
48
  /* @__PURE__ */ e.jsx(g, { children: /* @__PURE__ */ e.jsxs(j, { children: [
47
- /* @__PURE__ */ e.jsx(f, { children: "Fruits" }),
48
- /* @__PURE__ */ e.jsx(r, { value: "apple", children: "Apple" }),
49
- /* @__PURE__ */ e.jsx(r, { value: "banana", children: "Banana" }),
50
- /* @__PURE__ */ e.jsx(r, { value: "blueberry", children: "Blueberry" }),
51
- /* @__PURE__ */ e.jsx(r, { value: "grapes", children: "Grapes" }),
52
- /* @__PURE__ */ e.jsx(r, { value: "pineapple", children: "Pineapple" })
49
+ /* @__PURE__ */ e.jsx(v, { children: "Fruits" }),
50
+ /* @__PURE__ */ e.jsx(a, { value: "apple", children: "Apple" }),
51
+ /* @__PURE__ */ e.jsx(a, { value: "banana", children: "Banana" }),
52
+ /* @__PURE__ */ e.jsx(a, { value: "blueberry", children: "Blueberry" }),
53
+ /* @__PURE__ */ e.jsx(a, { value: "grapes", children: "Grapes" }),
54
+ /* @__PURE__ */ e.jsx(a, { value: "pineapple", children: "Pineapple" })
53
55
  ] }) })
54
- ] }) }), B = () => {
55
- const { savePage: l, syncState: s } = w(), { t: n } = y(), i = m(() => {
56
+ ] }) }), T = () => {
57
+ const { savePage: l, syncState: s } = f(), { t: i } = C(), n = m(() => {
56
58
  switch (s) {
57
59
  case "SAVING":
58
60
  return "animate-pulse bg-gray-500 text-gray-900";
@@ -62,14 +64,14 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
62
64
  return "bg-gray-200 text-gray-500 hover:bg-gray-100";
63
65
  }
64
66
  }, [s]);
65
- return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(v, { children: [
66
- /* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
67
- C,
67
+ return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(S, { children: [
68
+ /* @__PURE__ */ e.jsx(b, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
69
+ N,
68
70
  {
69
71
  onClick: (t) => {
70
72
  t.preventDefault(), l();
71
73
  },
72
- className: `flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${i}`,
74
+ className: `flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${n}`,
73
75
  size: "sm",
74
76
  variant: "outline",
75
77
  children: [
@@ -80,14 +82,14 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
80
82
  d: "M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"
81
83
  }
82
84
  ) }),
83
- s === "SAVING" ? "Saving..." : s === "SAVED" ? n("Saved") : "Save"
85
+ s === "SAVING" ? "Saving..." : s === "SAVED" ? i("Saved") : "Save"
84
86
  ]
85
87
  }
86
88
  ) }),
87
- /* @__PURE__ */ e.jsx(b, { children: /* @__PURE__ */ e.jsx("p", { children: s === "SAVING" ? "Saving..." : s === "SAVED" ? "Saved" : "Save changes" }) })
89
+ /* @__PURE__ */ e.jsx(w, { children: /* @__PURE__ */ e.jsx("p", { children: s === "SAVING" ? "Saving..." : s === "SAVED" ? "Saved" : "Save changes" }) })
88
90
  ] }) });
89
- }, pe = () => {
90
- const l = a("topBarComponents.left", []), s = a("topBarComponents.center", []), n = a("topBarComponents.right", []), i = a("editable", !0);
91
+ }, xe = () => {
92
+ const l = r("topBarComponents.left", []), s = r("topBarComponents.center", []), i = r("topBarComponents.right", []), n = r("editable", !0);
91
93
  return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
92
94
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 font-bold", children: o.Children.toArray(
93
95
  l.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
@@ -96,15 +98,15 @@ const A = () => a("languages", ["en"]), T = () => A().length === 1 ? null : /* @
96
98
  s.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
97
99
  ) }),
98
100
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
99
- /* @__PURE__ */ e.jsx(T, {}),
100
- /* @__PURE__ */ e.jsx(N, { orientation: "vertical" }),
101
- i ? /* @__PURE__ */ e.jsx(B, {}) : null,
101
+ /* @__PURE__ */ e.jsx(B, {}),
102
+ /* @__PURE__ */ e.jsx(y, { orientation: "vertical" }),
103
+ n ? /* @__PURE__ */ e.jsx(T, {}) : null,
102
104
  o.Children.toArray(
103
- n.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
105
+ i.map((t) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
104
106
  )
105
107
  ] })
106
108
  ] });
107
109
  };
108
110
  export {
109
- pe as default
111
+ xe as default
110
112
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),n=require("react"),l=require("@radix-ui/react-icons"),r=require("./index-c8zW_D2V.cjs"),a=require("react-i18next");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");require("lodash");require("@radix-ui/react-toggle");require("class-variance-authority");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("./index-fwo4wa7u.cjs");require("@react-hookz/web");const o=()=>r.useBuilderProp("languages",["en"]),c=()=>o().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Select,{children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(l.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(r.SelectContent,{children:e.jsxRuntimeExports.jsxs(r.SelectGroup,{children:[e.jsxRuntimeExports.jsx(r.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),p=()=>{const{savePage:i,syncState:s}=r.useSavePage(),{t:x}=a.useTranslation(),u=n.useMemo(()=>{switch(s){case"SAVING":return"animate-pulse bg-gray-500 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[s]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(r.Toggle,{onClick:t=>{t.preventDefault(),i()},className:`flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${u}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx("svg",{fill:"currentColor",width:"16",height:"16",viewBox:"0 0 0.32 0.32",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"})}),s==="SAVING"?"Saving...":s==="SAVED"?x("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:s==="SAVING"?"Saving...":s==="SAVED"?"Saved":"Save changes"})})]})})},m=()=>{const i=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),x=r.useBuilderProp("topBarComponents.right",[]),u=r.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:n.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:n.Children.toArray(s.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(c,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),u?e.jsxRuntimeExports.jsx(p,{}):null,n.Children.toArray(x.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=m;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WKRPbKtm.cjs"),a=require("react"),o=require("lodash"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./index-c8zW_D2V.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./Class-RZuPYbUS.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-toggle");require("class-variance-authority");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("./index-fwo4wa7u.cjs");require("react-i18next");const g=async(d,E)=>new Promise((l,i)=>{k.createApi({accessKey:E}).search.getPhotos(d).then(c=>{l(c)}).catch(c=>i(c))}),z=({isModalView:d,onSelect:E})=>{const l=t.useBuilderProp("unsplashAccessKey"),[i,f]=a.useState([]),[c,q]=a.useState(0),[u,S]=a.useState(),[x,b]=a.useState(),[I,R]=a.useState(0),[j,w]=A.useDebouncedState("",1e3),[h,m]=a.useState(!1),P=async s=>{if(o.isEmpty(j))return;let n=c+1;s&&(s.preventDefault(),n=1),m(!0),q(n);const p={query:j,page:n};u&&(p.orientation=u),x&&(p.color=x),g(p,l).then(r=>{var y,v,N;f(n===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...i,...((v=r==null?void 0:r.response)==null?void 0:v.results)||[]]),R((N=r==null?void 0:r.response)==null?void 0:N.total_pages),m(!1)}).catch(()=>{m(!1)})};return a.useEffect(()=>{if(!o.isEmpty(j)){m(!0);const s={query:j,page:1};u&&(s.orientation=u),x&&(s.color=x),q(1),g(s,l).then(n=>{var p,r;f(((p=n==null?void 0:n.response)==null?void 0:p.results)||[]),R((r=n==null?void 0:n.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[u,x,j,l]),o.isEmpty(l)?e.jsxRuntimeExports.jsx("div",{className:"h-full flex flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"underline px-1 hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center rounded-md border bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsx(t.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>w(s.target.value)}),e.jsxRuntimeExports.jsxs(t.Popover,{children:[e.jsxRuntimeExports.jsx(t.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(C.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(t.PopoverContent,{side:d?"bottom":"right",className:"z-[9999] flex w-max items-center justify-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"py-1 text-sm font-medium",children:"Orientation"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:u,onValueChange:s=>S(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:x,onValueChange:s=>b(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:s,children:o.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(t.ScrollArea,{className:`h-full ${d&&!o.isEmpty(i)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[o.isEmpty(i)&&!h&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),d?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:i.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>E(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):i.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),h&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(T.Loader,{className:"animate-spin w-6 h-6"}),"  Loading..."]}),!o.isEmpty(i)&&c<I&&!h&&e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>P(void 0),disabled:h,children:h?"":"Load More"})]})]})};exports.default=z;exports.fetchImage=g;