@chaibuilder/sdk 1.2.65 → 1.2.66

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 (125) hide show
  1. package/dist/AddBlocks-Mm5byzEC.js +124 -0
  2. package/dist/AddBlocks-jaxiAG4L.cjs +1 -0
  3. package/dist/CanvasArea-8NXGRRYC.js +137 -0
  4. package/dist/CanvasArea-SkeoJz9W.cjs +1 -0
  5. package/dist/{CodeEditor-Qff4q7sx.js → CodeEditor-3l-mFvg4.js} +61 -46
  6. package/dist/CodeEditor-o-CkvDnY.cjs +1 -0
  7. package/dist/STRINGS--j49GZJP.js +7 -0
  8. package/dist/STRINGS-gPz7CUOk.cjs +1 -0
  9. package/dist/SettingsPanel-2uYGx-MQ.cjs +1 -0
  10. package/dist/SettingsPanel-Q3xQQm81.js +82 -0
  11. package/dist/{SidePanels-ijaUKSek.js → SidePanels-JyziIpDA.js} +87 -92
  12. package/dist/SidePanels-d04PONzN.cjs +1 -0
  13. package/dist/{Topbar-vHlnfxPs.js → Topbar-Xgd6YI66.js} +47 -51
  14. package/dist/Topbar-eIenyfZu.cjs +1 -0
  15. package/dist/UILibrariesPanel-ADjJse3_.cjs +1 -0
  16. package/dist/{UILibrariesPanel-NVUMUPUj.js → UILibrariesPanel-a7TrMuAU.js} +82 -90
  17. package/dist/{UnsplashImages-UkHihhA5.js → UnsplashImages-6Bj8nQ8n.js} +73 -57
  18. package/dist/UnsplashImages-hLdMtY12.cjs +1 -0
  19. package/dist/{UploadImages-HtuJZJlo.js → UploadImages-4PxhlZMB.js} +58 -44
  20. package/dist/UploadImages-uL2R7fju.cjs +1 -0
  21. package/dist/badge-7BVT3zxN.cjs +1 -0
  22. package/dist/badge-pJqQSA13.js +23 -0
  23. package/dist/context-menu-_8TFbFEJ.cjs +1 -0
  24. package/dist/context-menu-sks9vdzC.js +906 -0
  25. package/dist/core.cjs +1 -1
  26. package/dist/core.d.ts +45 -20
  27. package/dist/core.js +85 -86
  28. package/dist/iconBase-vJD0OXxU.cjs +1 -0
  29. package/dist/iconBase-zweRWSz0.js +323 -0
  30. package/dist/index-Dgo2PNEV.js +33210 -0
  31. package/dist/index-jhNzBWrV.cjs +223 -0
  32. package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
  33. package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
  34. package/dist/plugin-P0tpo_XZ.cjs +1 -0
  35. package/dist/plugin-_F-KZp1i.cjs +1 -0
  36. package/dist/plugin-f5uJtdXY.js +43 -0
  37. package/dist/plugin-sJ3Hzvpv.js +57 -0
  38. package/dist/render.cjs +3 -1
  39. package/dist/render.d.ts +19 -52
  40. package/dist/render.js +136 -183
  41. package/dist/select-JW3OMYm-.js +75 -0
  42. package/dist/select-fXj5tdMX.cjs +1 -0
  43. package/dist/separator-hT24N-xp.cjs +1 -0
  44. package/dist/separator-sgwOa1FE.js +18 -0
  45. package/dist/style.css +1 -1
  46. package/dist/tailwind.cjs +1 -1
  47. package/dist/tailwind.d.ts +41 -1
  48. package/dist/tailwind.js +16 -8
  49. package/dist/ui.cjs +1 -1
  50. package/dist/ui.d.ts +0 -10
  51. package/dist/ui.js +345 -163
  52. package/dist/web-blocks.cjs +1 -1
  53. package/dist/web-blocks.d.ts +1 -1
  54. package/dist/web-blocks.js +489 -724
  55. package/package.json +15 -45
  56. package/dist/CanvasArea-fSdH_RiN.cjs +0 -1
  57. package/dist/CanvasArea-ut5yknzX.js +0 -168
  58. package/dist/CodeEditor-ypUx3RAV.cjs +0 -1
  59. package/dist/CurrentPage-jHSVy3hq.js +0 -120
  60. package/dist/CurrentPage-p_AM4lrF.cjs +0 -1
  61. package/dist/Functions-7jnEwJyw.js +0 -15
  62. package/dist/Functions-N3yhPYKY.cjs +0 -1
  63. package/dist/MODIFIERS-fd5XOmum.js +0 -60
  64. package/dist/MODIFIERS-mVmfEGgo.cjs +0 -1
  65. package/dist/PagesPanel-U3InJ9Db.js +0 -78
  66. package/dist/PagesPanel-wqDb4D-x.cjs +0 -1
  67. package/dist/ProjectPanel-XODJTO4J.js +0 -99
  68. package/dist/ProjectPanel-fWESzHr6.cjs +0 -1
  69. package/dist/SidePanels-lrMQqc0h.cjs +0 -1
  70. package/dist/Topbar-RrCDxd0i.cjs +0 -1
  71. package/dist/UILibrariesPanel-7btHgBD0.cjs +0 -1
  72. package/dist/UnsplashImages-6UjgojvF.cjs +0 -1
  73. package/dist/UploadImages-3h0cRsvr.cjs +0 -1
  74. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  75. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  76. package/dist/add-page-modal-RwIj1FxH.cjs +0 -1
  77. package/dist/add-page-modal-TOfMfmPA.js +0 -115
  78. package/dist/confirm-alert-eIp2cAkc.js +0 -60
  79. package/dist/confirm-alert-v1lG8ex4.cjs +0 -1
  80. package/dist/controls-rRZhz0vu.cjs +0 -1
  81. package/dist/controls-yjgoZzB6.js +0 -199
  82. package/dist/delete-page-modal-4bxjpVBD.js +0 -97
  83. package/dist/delete-page-modal-qYDZmpgT.cjs +0 -1
  84. package/dist/email-blocks.cjs +0 -1
  85. package/dist/email-blocks.d.ts +0 -3
  86. package/dist/email-blocks.js +0 -294
  87. package/dist/email.cjs +0 -1
  88. package/dist/email.d.ts +0 -171
  89. package/dist/email.js +0 -90
  90. package/dist/empty-slot-Lsxjts7Q.js +0 -6
  91. package/dist/empty-slot-Sy930lX6.cjs +0 -1
  92. package/dist/form-4jTocVbZ.cjs +0 -1
  93. package/dist/form-NAzFjGs0.js +0 -125
  94. package/dist/functions--tdNWQDW.js +0 -30
  95. package/dist/functions-EVUeSwX1.cjs +0 -1
  96. package/dist/html-to-json-NqRjgFqp.cjs +0 -1
  97. package/dist/html-to-json-l_mw5y-e.js +0 -243
  98. package/dist/index--k2M8kzI.cjs +0 -1
  99. package/dist/index--mLLy7QQ.cjs +0 -1
  100. package/dist/index-5XyNUAjc.cjs +0 -290
  101. package/dist/index-C7mB4XFm.js +0 -3141
  102. package/dist/index-VBXQixVm.js +0 -117
  103. package/dist/index-YZhtVcj_.js +0 -2201
  104. package/dist/index-aeDphKpP.cjs +0 -1
  105. package/dist/index-lFgDm1oa.js +0 -83780
  106. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  107. package/dist/lib.cjs +0 -3
  108. package/dist/lib.d.ts +0 -80
  109. package/dist/lib.js +0 -1350
  110. package/dist/page-viewer-4wrnWnK0.js +0 -124
  111. package/dist/page-viewer-ra0GLx1p.cjs +0 -1
  112. package/dist/project-general-setting-IwZUkYF3.js +0 -90
  113. package/dist/project-general-setting-lFjTUhHD.cjs +0 -1
  114. package/dist/project-seo-setting-e1fTqVsd.js +0 -83
  115. package/dist/project-seo-setting-o0V9acCV.cjs +0 -1
  116. package/dist/server.cjs +0 -1
  117. package/dist/server.d.ts +0 -299
  118. package/dist/server.js +0 -216
  119. package/dist/single-page-detail-ZNWFKqLW.js +0 -229
  120. package/dist/single-page-detail-g55Anu7R.cjs +0 -1
  121. package/dist/studio.cjs +0 -1
  122. package/dist/studio.d.ts +0 -176
  123. package/dist/studio.js +0 -67
  124. package/dist/utils-D_vtk3zK.cjs +0 -1
  125. package/dist/utils-VpVqnC9m.js +0 -1075
@@ -1,50 +1,22 @@
1
- import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { noop as T, get as g, has as I, first as x, isEmpty as L, values as U, groupBy as D, map as _, capitalize as O } from "lodash-es";
1
+ import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
+ import { values as D, first as x, groupBy as U, get as g, map as _, capitalize as z, noop as T, has as I, isEmpty as L } from "lodash-es";
3
3
  import * as R from "react";
4
- import S, { useState as A, useCallback as z, useEffect as G, useRef as M } from "react";
5
- import { a4 as H, a5 as F, B as J, a6 as W, a7 as $, a8 as K, a9 as V, aa as Y, ab as q, ac as Q, h as C, U as X, j as Z, V as ee, T as te, v as se, w as oe, b5 as re, aO as ae, a3 as ie, aJ as ne } from "./index-C7mB4XFm.js";
6
- import { syncBlocksWithDefaults as le, useChaiBlocks as ce } from "@chaibuilder/runtime";
7
- import { Loader as me } from "lucide-react";
8
- import { useAtom as w, atom as de } from "jotai";
9
- import { c as E } from "./Functions-7jnEwJyw.js";
10
- import { CaretSortIcon as pe, CheckIcon as ue, CaretRightIcon as xe } from "@radix-ui/react-icons";
11
- import { O as fe } from "./MODIFIERS-fd5XOmum.js";
4
+ import S, { useState as A, useRef as O, useCallback as G, useEffect as M } from "react";
5
+ import { w as H, c as C, e as F, s as W, i as $, t as J, r as K } from "./index-Dgo2PNEV.js";
12
6
  import { useTranslation as P } from "react-i18next";
13
- import { c as he } from "./index-lFgDm1oa.js";
7
+ import { useChaiBlocks as X, syncBlocksWithDefaults as Y } from "@chaibuilder/runtime";
8
+ import { Loader as q } from "lucide-react";
9
+ import { atom as Q, useAtom as w } from "jotai";
10
+ import { c as E } from "./iconBase-zweRWSz0.js";
11
+ import { CaretSortIcon as V, CheckIcon as Z, CaretRightIcon as ee } from "@radix-ui/react-icons";
12
+ import { P as te, s as se, B as oe, t as re, u as ae, v as ie, w as ne, x as le, y as ce, z as me, S as de, X as ue, T as pe, d as xe, e as fe } from "./context-menu-sks9vdzC.js";
13
+ import { O as he } from "./STRINGS--j49GZJP.js";
14
14
  import ge from "clsx";
15
15
  import { useFeature as je } from "flagged";
16
- import "./_commonjsHelpers-UyOWmZb0.js";
17
- import "@radix-ui/react-toggle";
18
- import "class-variance-authority";
19
- import "./utils-VpVqnC9m.js";
20
- import "tailwind-merge";
21
- import "@radix-ui/react-switch";
22
- import "@radix-ui/react-slot";
23
- import "@radix-ui/react-accordion";
24
- import "@radix-ui/react-alert-dialog";
25
- import "@radix-ui/react-dialog";
26
- import "@radix-ui/react-label";
27
- import "@radix-ui/react-scroll-area";
28
- import "@radix-ui/react-tabs";
29
- import "@radix-ui/react-tooltip";
30
- import "@radix-ui/react-popover";
31
- import "@radix-ui/react-menubar";
32
- import "@radix-ui/react-hover-card";
33
- import "@radix-ui/react-select";
34
- import "@radix-ui/react-dropdown-menu";
35
- import "@radix-ui/react-separator";
36
- import "@radix-ui/react-toast";
37
- import "cmdk";
38
- import "@radix-ui/react-context-menu";
39
- import "react-icons-picker";
40
- import "react-dom";
41
- import "react-quill";
16
+ import "./plugin-sJ3Hzvpv.js";
42
17
  import "@react-hookz/web";
43
18
  import "tree-model";
44
- import "i18next";
45
- import "react-arborist";
46
- import "./index-VBXQixVm.js";
47
- import "prop-types";
19
+ import "react-quill";
48
20
  import "react-hotkeys-hook";
49
21
  import "@floating-ui/dom";
50
22
  import "@floating-ui/react-dom";
@@ -52,27 +24,47 @@ import "@tailwindcss/typography";
52
24
  import "@tailwindcss/forms";
53
25
  import "@tailwindcss/aspect-ratio";
54
26
  import "tailwindcss-palette-generator";
55
- import "./html-to-json-l_mw5y-e.js";
56
- import "himalaya";
27
+ import "tailwind-merge";
57
28
  import "lodash";
58
29
  import "react-wrap-balancer";
59
- import "@rjsf/core";
30
+ import "react-dom";
31
+ import "prop-types";
60
32
  import "@rjsf/validator-ajv8";
33
+ import "@rjsf/core";
34
+ import "react-arborist";
35
+ import "himalaya";
36
+ import "react-icons-picker";
61
37
  import "react-autosuggest";
62
38
  import "fuse.js";
63
- import "./controls-yjgoZzB6.js";
39
+ import "@radix-ui/react-scroll-area";
40
+ import "i18next";
41
+ import "@radix-ui/react-switch";
42
+ import "@radix-ui/react-accordion";
43
+ import "class-variance-authority";
44
+ import "@radix-ui/react-alert-dialog";
45
+ import "@radix-ui/react-slot";
46
+ import "@radix-ui/react-label";
47
+ import "@radix-ui/react-tabs";
48
+ import "@radix-ui/react-tooltip";
49
+ import "@radix-ui/react-popover";
50
+ import "@radix-ui/react-hover-card";
51
+ import "@radix-ui/react-dropdown-menu";
52
+ import "@radix-ui/react-toast";
53
+ import "cmdk";
54
+ import "@radix-ui/react-dialog";
55
+ import "@radix-ui/react-context-menu";
64
56
  function ke({
65
57
  uiLibraries: t,
66
58
  library: a,
67
59
  setLibrary: i
68
60
  }) {
69
- var p;
61
+ var u;
70
62
  const [m, l] = R.useState(!1), { t: s } = P();
71
- return a ? /* @__PURE__ */ e.jsxs(H, { open: m, onOpenChange: l, children: [
72
- /* @__PURE__ */ e.jsx(F, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
63
+ return a ? /* @__PURE__ */ e.jsxs(te, { open: m, onOpenChange: l, children: [
64
+ /* @__PURE__ */ e.jsx(se, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
73
65
  /* @__PURE__ */ e.jsx("span", { children: s("Choose Library") }),
74
66
  /* @__PURE__ */ e.jsxs(
75
- J,
67
+ oe,
76
68
  {
77
69
  variant: "outline",
78
70
  size: "sm",
@@ -80,27 +72,27 @@ function ke({
80
72
  "aria-expanded": m,
81
73
  className: "w-[200px] justify-between",
82
74
  children: [
83
- a ? (p = t.find((o) => o.uuid === a)) == null ? void 0 : p.name : s("Select library"),
84
- /* @__PURE__ */ e.jsx(pe, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
75
+ a ? (u = t.find((o) => o.uuid === a)) == null ? void 0 : u.name : s("Select library"),
76
+ /* @__PURE__ */ e.jsx(V, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
85
77
  ]
86
78
  }
87
79
  )
88
80
  ] }) }),
89
- /* @__PURE__ */ e.jsx(W, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs($, { children: [
90
- /* @__PURE__ */ e.jsx(K, { placeholder: "Search library...", className: "h-9" }),
91
- /* @__PURE__ */ e.jsxs(V, { children: [
92
- /* @__PURE__ */ e.jsx(Y, { children: "No library found." }),
93
- /* @__PURE__ */ e.jsx(q, { children: t.map((o) => /* @__PURE__ */ e.jsxs(
94
- Q,
81
+ /* @__PURE__ */ e.jsx(re, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(ae, { children: [
82
+ /* @__PURE__ */ e.jsx(ie, { placeholder: "Search library...", className: "h-9" }),
83
+ /* @__PURE__ */ e.jsxs(ne, { children: [
84
+ /* @__PURE__ */ e.jsx(le, { children: "No library found." }),
85
+ /* @__PURE__ */ e.jsx(ce, { children: t.map((o) => /* @__PURE__ */ e.jsxs(
86
+ me,
95
87
  {
96
88
  value: o.uuid,
97
- onSelect: (u) => {
98
- i(u), l(!1);
89
+ onSelect: (p) => {
90
+ i(p), l(!1);
99
91
  },
100
92
  children: [
101
93
  o.name,
102
94
  /* @__PURE__ */ e.jsx(
103
- ue,
95
+ Z,
104
96
  {
105
97
  className: E("ml-auto h-4 w-4", a === o.uuid ? "opacity-100" : "opacity-0")
106
98
  }
@@ -118,24 +110,24 @@ const we = ({
118
110
  closePopover: a,
119
111
  library: i
120
112
  }) => {
121
- const [m, l] = A(!1), s = C("getUILibraryBlock", T), { addCoreBlock: p, addPredefinedBlock: o } = X(), [u, j] = Z(), [, k] = ee(), f = g(t, "name", g(t, "label")), b = je("dnd"), [, v] = w(he), n = (r) => {
113
+ const [m, l] = A(!1), s = C("getUILibraryBlock", T), { addCoreBlock: u, addPredefinedBlock: o } = W(), [p, j] = $(), [, k] = J(), f = g(t, "name", g(t, "label")), v = je("dnd"), [, B] = w(K), n = (r) => {
122
114
  const d = I(r, "styles_attrs.data-page-section");
123
115
  return r._type === "Box" && d;
124
- }, B = z(
116
+ }, b = G(
125
117
  async (r) => {
126
118
  if (r.stopPropagation(), I(t, "component")) {
127
- p(t, x(u)), a();
119
+ u(t, x(p)), a();
128
120
  return;
129
121
  }
130
122
  l(!0);
131
123
  const d = await s(i, t);
132
- let h = x(u);
133
- n(x(d)) && (h = null), L(d) || o(le(d), h), a();
124
+ let h = x(p);
125
+ n(x(d)) && (h = null), L(d) || o(Y(d), h), a();
134
126
  },
135
127
  [t]
136
128
  ), c = async (r) => {
137
129
  const d = await s(i, t);
138
- let h = x(u);
130
+ let h = x(p);
139
131
  if (n(x(d)) && (h = null), !L(d)) {
140
132
  const y = { blocks: d, uiLibrary: !0, parent: h };
141
133
  if (r.dataTransfer.setData("text/plain", JSON.stringify(y)), t.preview) {
@@ -145,58 +137,58 @@ const we = ({
145
137
  };
146
138
  } else
147
139
  r.dataTransfer.setDragImage(new Image(), 0, 0);
148
- v(y), setTimeout(() => {
140
+ B(y), setTimeout(() => {
149
141
  j([]), k(null), a();
150
142
  }, 200);
151
143
  }
152
144
  };
153
- return /* @__PURE__ */ e.jsxs(te, { children: [
154
- /* @__PURE__ */ e.jsx(se, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
145
+ return /* @__PURE__ */ e.jsxs(pe, { children: [
146
+ /* @__PURE__ */ e.jsx(xe, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
155
147
  "div",
156
148
  {
157
149
  onClick: m ? () => {
158
- } : B,
159
- draggable: b ? "true" : "false",
150
+ } : b,
151
+ draggable: v ? "true" : "false",
160
152
  onDragStart: c,
161
153
  className: ge(
162
154
  "relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl"
163
155
  ),
164
156
  children: [
165
157
  m && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black/70", children: [
166
- /* @__PURE__ */ e.jsx(me, { className: "animate-spin", size: 15, color: "white" }),
158
+ /* @__PURE__ */ e.jsx(q, { className: "animate-spin", size: 15, color: "white" }),
167
159
  /* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
168
160
  ] }),
169
161
  t.preview ? /* @__PURE__ */ e.jsx("img", { src: t.preview, className: "min-h-[25px] w-full rounded-md", alt: f }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200", children: /* @__PURE__ */ e.jsx("p", { className: "max-w-xs text-center text-sm text-gray-700", children: f }) })
170
162
  ]
171
163
  }
172
164
  ) }),
173
- /* @__PURE__ */ e.jsx(oe, { children: /* @__PURE__ */ e.jsx("p", { children: f }) })
165
+ /* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsx("p", { children: f }) })
174
166
  ] });
175
- }, be = de({}), ve = (t) => {
176
- const [a, i] = w(be), m = C("getUILibraryBlocks", T), l = g(a, `${t == null ? void 0 : t.uuid}.blocks`, []), s = g(a, `${t == null ? void 0 : t.uuid}.loading`, !1);
177
- return G(() => {
167
+ }, ve = Q({}), Be = (t) => {
168
+ const [a, i] = w(ve), m = C("getUILibraryBlocks", T), l = g(a, `${t == null ? void 0 : t.uuid}.blocks`, []), s = g(a, `${t == null ? void 0 : t.uuid}.loading`, !1);
169
+ return M(() => {
178
170
  (async () => {
179
171
  if (s || l.length > 0 || !t)
180
172
  return;
181
173
  i((o) => ({ ...o, [t == null ? void 0 : t.uuid]: { loading: !0, blocks: [] } }));
182
- const p = await m(t);
183
- i((o) => ({ ...o, [t == null ? void 0 : t.uuid]: { loading: !1, blocks: p || [] } }));
174
+ const u = await m(t);
175
+ i((o) => ({ ...o, [t == null ? void 0 : t.uuid]: { loading: !1, blocks: u || [] } }));
184
176
  })();
185
177
  }, [t, l, s]), { data: l, isLoading: s };
186
- }, Be = re("_selectedLibrary", null), Ne = () => {
187
- const [t, a] = w(Be), i = C("uiLibraries", []), m = ce(), l = U(m).filter((c) => c.category === "custom"), s = i.find((c) => c.uuid === t) || x(i), { data: p, isLoading: o } = ve(s), u = D([...p, ...l], "group"), [j, k] = A("Hero"), [, f] = w(ae), b = g(u, j, []), { t: v } = P(), n = M(null), B = (c) => {
178
+ }, be = H("_selectedLibrary", null), Ne = () => {
179
+ const [t, a] = w(be), i = C("uiLibraries", []), m = X(), l = D(m).filter((c) => c.category === "custom"), s = i.find((c) => c.uuid === t) || x(i), { data: u, isLoading: o } = Be(s), p = U([...u, ...l], "group"), [j, k] = A("Hero"), [, f] = w(F), v = g(p, j, []), { t: B } = P(), n = O(null), b = (c) => {
188
180
  n.current && (clearTimeout(n.current), n.current = null), n.current = setTimeout(() => {
189
181
  n.current && k(c);
190
182
  }, 300);
191
183
  };
192
- return o ? /* @__PURE__ */ e.jsx(ie, { className: "h-full w-full" }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full w-[460px] flex-col overflow-hidden bg-background", children: [
184
+ return o ? /* @__PURE__ */ e.jsx(de, { className: "h-full w-full" }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full w-[460px] flex-col overflow-hidden bg-background", children: [
193
185
  s != null && s.uuid ? /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex h-fit flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: /* @__PURE__ */ e.jsx("h1", { className: "flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col", children: /* @__PURE__ */ e.jsx(ke, { library: s == null ? void 0 : s.uuid, setLibrary: a, uiLibraries: i }) }) }) }) : null,
194
186
  /* @__PURE__ */ e.jsxs("div", { className: "flex h-[95%] border-t border-gray-300 pt-2", children: [
195
187
  /* @__PURE__ */ e.jsx("div", { className: "flex h-full w-40 flex-col gap-1 px-1", children: S.Children.toArray(
196
- _(u, (c, r) => /* @__PURE__ */ e.jsxs(
188
+ _(p, (c, r) => /* @__PURE__ */ e.jsxs(
197
189
  "div",
198
190
  {
199
- onMouseEnter: () => B(r),
191
+ onMouseEnter: () => b(r),
200
192
  onMouseLeave: () => clearTimeout(n.current),
201
193
  onClick: () => k(r),
202
194
  className: E(
@@ -204,22 +196,22 @@ const we = ({
204
196
  r === j ? "bg-blue-500 text-white hover:bg-blue-600" : ""
205
197
  ),
206
198
  children: [
207
- /* @__PURE__ */ e.jsx("span", { children: O(r) }),
208
- /* @__PURE__ */ e.jsx(xe, { className: "ml-2 h-5 w-5" })
199
+ /* @__PURE__ */ e.jsx("span", { children: z(r) }),
200
+ /* @__PURE__ */ e.jsx(ee, { className: "ml-2 h-5 w-5" })
209
201
  ]
210
202
  },
211
203
  r
212
204
  ))
213
205
  ) }),
214
206
  /* @__PURE__ */ e.jsxs(
215
- ne,
207
+ ue,
216
208
  {
217
209
  onMouseEnter: () => n.current ? clearTimeout(n.current) : null,
218
210
  className: "z-10 -mt-2 flex h-full max-h-full w-[300px] flex-col gap-2 border-l border-gray-300 transition-all ease-linear",
219
211
  children: [
220
- /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 z-30 border-b border-gray-300 bg-gray-200 p-2 text-[9px] font-light leading-3 text-gray-500", children: v("Click on a block to add it to the page") }),
212
+ /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 z-30 border-b border-gray-300 bg-gray-200 p-2 text-[9px] font-light leading-3 text-gray-500", children: B("Click on a block to add it to the page") }),
221
213
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2 px-2", children: S.Children.toArray(
222
- b.map((c) => /* @__PURE__ */ e.jsx(we, { block: c, library: s, closePopover: () => f(fe) }))
214
+ v.map((c) => /* @__PURE__ */ e.jsx(we, { block: c, library: s, closePopover: () => f(he) }))
223
215
  ) }),
224
216
  /* @__PURE__ */ e.jsx("br", {}),
225
217
  /* @__PURE__ */ e.jsx("br", {}),
@@ -229,7 +221,7 @@ const we = ({
229
221
  )
230
222
  ] })
231
223
  ] }) });
232
- }, Pt = () => /* @__PURE__ */ e.jsx(Ne, {});
224
+ }, Ct = () => /* @__PURE__ */ e.jsx(Ne, {});
233
225
  export {
234
- Pt as default
226
+ Ct as default
235
227
  };
@@ -1,58 +1,74 @@
1
- import { j as e } from "./jsx-runtime-WbnYoNE9.js";
1
+ import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
2
  import { useState as p, useEffect as D } from "react";
3
3
  import { isEmpty as d, startCase as E } from "lodash-es";
4
- import { MixerHorizontalIcon as F } from "@radix-ui/react-icons";
5
- import { createApi as L } from "unsplash-js";
6
- import { h as B, aF as K, a4 as U, a5 as V, a6 as O, bw as P, bx as C, by as S, bz as A, bA as h, aJ as Q, B as H } from "./index-C7mB4XFm.js";
7
- import { useDebouncedState as J } from "@react-hookz/web";
8
- import { Loader as R } from "lucide-react";
9
- import "./_commonjsHelpers-UyOWmZb0.js";
10
- import "@radix-ui/react-toggle";
11
- import "class-variance-authority";
12
- import "./utils-VpVqnC9m.js";
13
- import "./MODIFIERS-fd5XOmum.js";
14
- import "clsx";
15
- import "tailwind-merge";
4
+ import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
5
+ import { createApi as B } from "unsplash-js";
6
+ import { Q as F, P as K, s as Q, t as U, X as V, B as O } from "./context-menu-sks9vdzC.js";
7
+ import { S as P, c as S, b as C, d as I, f as h } from "./select-JW3OMYm-.js";
8
+ import "react-i18next";
9
+ import { c as H } from "./index-Dgo2PNEV.js";
10
+ import { useDebouncedState as R } from "@react-hookz/web";
11
+ import { Loader as X } from "lucide-react";
16
12
  import "@radix-ui/react-switch";
17
- import "@radix-ui/react-slot";
18
13
  import "@radix-ui/react-accordion";
14
+ import "class-variance-authority";
19
15
  import "@radix-ui/react-alert-dialog";
20
- import "@radix-ui/react-dialog";
16
+ import "@radix-ui/react-slot";
21
17
  import "@radix-ui/react-label";
22
18
  import "@radix-ui/react-scroll-area";
23
19
  import "@radix-ui/react-tabs";
24
20
  import "@radix-ui/react-tooltip";
25
21
  import "@radix-ui/react-popover";
26
- import "@radix-ui/react-menubar";
27
22
  import "@radix-ui/react-hover-card";
28
- import "@radix-ui/react-select";
29
23
  import "@radix-ui/react-dropdown-menu";
30
- import "@radix-ui/react-separator";
31
24
  import "@radix-ui/react-toast";
32
25
  import "cmdk";
26
+ import "@radix-ui/react-dialog";
33
27
  import "@radix-ui/react-context-menu";
34
- import "react-icons-picker";
35
- import "react-dom";
36
- import "react-quill";
37
- import "./Functions-7jnEwJyw.js";
38
- import "@chaibuilder/runtime";
28
+ import "clsx";
29
+ import "tailwind-merge";
30
+ import "@radix-ui/react-select";
39
31
  import "jotai";
32
+ import "./iconBase-zweRWSz0.js";
33
+ import "@chaibuilder/runtime";
34
+ import "./plugin-sJ3Hzvpv.js";
40
35
  import "tree-model";
41
- import "react-i18next";
42
- const I = async (x, g) => new Promise((o, r) => {
43
- L({ accessKey: g }).search.getPhotos(x).then((i) => {
36
+ import "react-quill";
37
+ import "./STRINGS--j49GZJP.js";
38
+ import "react-hotkeys-hook";
39
+ import "@floating-ui/dom";
40
+ import "@floating-ui/react-dom";
41
+ import "flagged";
42
+ import "@tailwindcss/typography";
43
+ import "@tailwindcss/forms";
44
+ import "@tailwindcss/aspect-ratio";
45
+ import "tailwindcss-palette-generator";
46
+ import "lodash";
47
+ import "react-wrap-balancer";
48
+ import "react-dom";
49
+ import "prop-types";
50
+ import "@rjsf/validator-ajv8";
51
+ import "@rjsf/core";
52
+ import "react-arborist";
53
+ import "himalaya";
54
+ import "react-icons-picker";
55
+ import "react-autosuggest";
56
+ import "fuse.js";
57
+ import "i18next";
58
+ const k = async (x, g) => new Promise((o, a) => {
59
+ B({ accessKey: g }).search.getPhotos(x).then((i) => {
44
60
  o(i);
45
- }).catch((i) => r(i));
46
- }), De = ({ isModalView: x, onSelect: g }) => {
47
- const o = B("unsplashAccessKey", ""), [r, j] = p([]), [i, v] = p(0), [l, k] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = J("", 1e3), [f, c] = p(!1), _ = async (s) => {
61
+ }).catch((i) => a(i));
62
+ }), Me = ({ isModalView: x, onSelect: g }) => {
63
+ const o = H("unsplashAccessKey", ""), [a, j] = p([]), [i, v] = p(0), [l, A] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = R("", 1e3), [f, c] = p(!1), _ = async (s) => {
48
64
  if (d(u))
49
65
  return;
50
- let t = i + 1;
51
- s && (s.preventDefault(), t = 1), c(!0), v(t);
52
- const m = { query: u, page: t };
53
- l && (m.orientation = l), n && (m.color = n), I(m, o).then((a) => {
54
- var b, N, w;
55
- j(t === 1 ? ((b = a == null ? void 0 : a.response) == null ? void 0 : b.results) || [] : [...r, ...((N = a == null ? void 0 : a.response) == null ? void 0 : N.results) || []]), y((w = a == null ? void 0 : a.response) == null ? void 0 : w.total_pages), c(!1);
66
+ let r = i + 1;
67
+ s && (s.preventDefault(), r = 1), c(!0), v(r);
68
+ const m = { query: u, page: r };
69
+ l && (m.orientation = l), n && (m.color = n), k(m, o).then((t) => {
70
+ var N, b, w;
71
+ j(r === 1 ? ((N = t == null ? void 0 : t.response) == null ? void 0 : N.results) || [] : [...a, ...((b = t == null ? void 0 : t.response) == null ? void 0 : b.results) || []]), y((w = t == null ? void 0 : t.response) == null ? void 0 : w.total_pages), c(!1);
56
72
  }).catch(() => {
57
73
  c(!1);
58
74
  });
@@ -61,9 +77,9 @@ const I = async (x, g) => new Promise((o, r) => {
61
77
  if (!d(u) && o) {
62
78
  c(!0);
63
79
  const s = { query: u, page: 1 };
64
- l && (s.orientation = l), n && (s.color = n), v(1), I(s, o).then((t) => {
65
- var m, a;
66
- j(((m = t == null ? void 0 : t.response) == null ? void 0 : m.results) || []), y((a = t == null ? void 0 : t.response) == null ? void 0 : a.total_pages), c(!1);
80
+ l && (s.orientation = l), n && (s.color = n), v(1), k(s, o).then((r) => {
81
+ var m, t;
82
+ j(((m = r == null ? void 0 : r.response) == null ? void 0 : m.results) || []), y((t = r == null ? void 0 : r.response) == null ? void 0 : t.total_pages), c(!1);
67
83
  }).catch(() => {
68
84
  c(!1);
69
85
  });
@@ -83,7 +99,7 @@ const I = async (x, g) => new Promise((o, r) => {
83
99
  ] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
84
100
  /* @__PURE__ */ e.jsxs("form", { className: "flex items-center rounded-md border bg-gray-100 p-px", children: [
85
101
  /* @__PURE__ */ e.jsx(
86
- K,
102
+ F,
87
103
  {
88
104
  type: "text",
89
105
  name: "query",
@@ -92,18 +108,18 @@ const I = async (x, g) => new Promise((o, r) => {
92
108
  onChange: (s) => T(s.target.value)
93
109
  }
94
110
  ),
95
- /* @__PURE__ */ e.jsxs(U, { children: [
96
- /* @__PURE__ */ e.jsx(V, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(F, {}) }),
111
+ /* @__PURE__ */ e.jsxs(K, { children: [
112
+ /* @__PURE__ */ e.jsx(Q, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(L, {}) }),
97
113
  /* @__PURE__ */ e.jsx(
98
- O,
114
+ U,
99
115
  {
100
116
  side: x ? "bottom" : "right",
101
117
  className: "z-[9999] flex w-max items-center justify-center",
102
118
  children: /* @__PURE__ */ e.jsxs("div", { children: [
103
119
  /* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
104
- /* @__PURE__ */ e.jsxs(P, { defaultValue: l, onValueChange: (s) => k(s), children: [
105
- /* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
106
- /* @__PURE__ */ e.jsxs(A, { className: "z-[9999]", children: [
120
+ /* @__PURE__ */ e.jsxs(P, { defaultValue: l, onValueChange: (s) => A(s), children: [
121
+ /* @__PURE__ */ e.jsx(S, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(C, { placeholder: "Select" }) }),
122
+ /* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
107
123
  /* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
108
124
  /* @__PURE__ */ e.jsx(h, { value: "landscape", children: "Landscape" }),
109
125
  /* @__PURE__ */ e.jsx(h, { value: "portrait", children: "Portrait" }),
@@ -112,8 +128,8 @@ const I = async (x, g) => new Promise((o, r) => {
112
128
  ] }),
113
129
  /* @__PURE__ */ e.jsx("div", { className: "pb-1 pt-2 text-sm font-medium", children: "Color" }),
114
130
  /* @__PURE__ */ e.jsxs(P, { defaultValue: n, onValueChange: (s) => q(s), children: [
115
- /* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
116
- /* @__PURE__ */ e.jsxs(A, { className: "z-[9999]", children: [
131
+ /* @__PURE__ */ e.jsx(S, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(C, { placeholder: "Select" }) }),
132
+ /* @__PURE__ */ e.jsxs(I, { className: "z-[9999]", children: [
117
133
  /* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
118
134
  [
119
135
  "black_and_white",
@@ -136,15 +152,15 @@ const I = async (x, g) => new Promise((o, r) => {
136
152
  ] })
137
153
  ] }),
138
154
  /* @__PURE__ */ e.jsxs(
139
- Q,
155
+ V,
140
156
  {
141
- className: `h-full ${x && !d(r) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
157
+ className: `h-full ${x && !d(a) ? "-mx-2 flex flex-wrap px-2" : "-mx-2 flex flex-col pb-8 pt-2"}`,
142
158
  children: [
143
- d(r) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
159
+ d(a) && !f && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
144
160
  /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Data" }),
145
161
  /* @__PURE__ */ e.jsx("div", { className: "text-sm text-gray-500", children: "Enter query and press enter" })
146
162
  ] }),
147
- x ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: r.map((s) => /* @__PURE__ */ e.jsx(
163
+ x ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: a.map((s) => /* @__PURE__ */ e.jsx(
148
164
  "div",
149
165
  {
150
166
  role: "button",
@@ -161,7 +177,7 @@ const I = async (x, g) => new Promise((o, r) => {
161
177
  ) })
162
178
  },
163
179
  s.id
164
- )) }) : r.map((s) => (
180
+ )) }) : a.map((s) => (
165
181
  // TODO: Drag and Drop Image to Canvas from Here use `pic.urls.[small, regular, full]` for image quality
166
182
  /* @__PURE__ */ e.jsx("div", { className: "w-full px-2 py-1", children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
167
183
  "img",
@@ -173,11 +189,11 @@ const I = async (x, g) => new Promise((o, r) => {
173
189
  ) }) }, s.id)
174
190
  )),
175
191
  f && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
176
- /* @__PURE__ */ e.jsx(R, { className: "animate-spin w-6 h-6" }),
192
+ /* @__PURE__ */ e.jsx(X, { className: "animate-spin w-6 h-6" }),
177
193
  "  Loading..."
178
194
  ] }),
179
- !d(r) && i < z && !f && /* @__PURE__ */ e.jsx(
180
- H,
195
+ !d(a) && i < z && !f && /* @__PURE__ */ e.jsx(
196
+ O,
181
197
  {
182
198
  size: "sm",
183
199
  variant: "link",
@@ -193,6 +209,6 @@ const I = async (x, g) => new Promise((o, r) => {
193
209
  ] });
194
210
  };
195
211
  export {
196
- De as default,
197
- I as fetchImage
212
+ Me as default,
213
+ k as fetchImage
198
214
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),o=require("react"),l=require("lodash-es"),k=require("@radix-ui/react-icons"),A=require("unsplash-js"),d=require("./context-menu-_8TFbFEJ.cjs"),r=require("./select-fXj5tdMX.cjs");require("react-i18next");const T=require("./index-jhNzBWrV.cjs"),z=require("@react-hookz/web"),_=require("lucide-react");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");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-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("@radix-ui/react-select");require("jotai");require("./iconBase-vJD0OXxU.cjs");require("@chaibuilder/runtime");require("./plugin-_F-KZp1i.cjs");require("tree-model");require("react-quill");require("./STRINGS-gPz7CUOk.cjs");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("lodash");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");const g=async(j,E)=>new Promise((a,n)=>{A.createApi({accessKey:E}).search.getPhotos(j).then(u=>{a(u)}).catch(u=>n(u))}),D=({isModalView:j,onSelect:E})=>{const a=T.useBuilderProp("unsplashAccessKey",""),[n,f]=o.useState([]),[u,R]=o.useState(0),[c,b]=o.useState(),[x,I]=o.useState(),[w,y]=o.useState(0),[h,P]=z.useDebouncedState("",1e3),[q,m]=o.useState(!1),C=async s=>{if(l.isEmpty(h))return;let i=u+1;s&&(s.preventDefault(),i=1),m(!0),R(i);const p={query:h,page:i};c&&(p.orientation=c),x&&(p.color=x),g(p,a).then(t=>{var v,N,S;f(i===1?((v=t==null?void 0:t.response)==null?void 0:v.results)||[]:[...n,...((N=t==null?void 0:t.response)==null?void 0:N.results)||[]]),y((S=t==null?void 0:t.response)==null?void 0:S.total_pages),m(!1)}).catch(()=>{m(!1)})};return o.useEffect(()=>{if(!l.isEmpty(h)&&a){m(!0);const s={query:h,page:1};c&&(s.orientation=c),x&&(s.color=x),R(1),g(s,a).then(i=>{var p,t;f(((p=i==null?void 0:i.response)==null?void 0:p.results)||[]),y((t=i==null?void 0:i.response)==null?void 0:t.total_pages),m(!1)}).catch(()=>{m(!1)})}},[c,x,h,a]),l.isEmpty(a)?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(d.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>P(s.target.value)}),e.jsxRuntimeExports.jsxs(d.Popover,{children:[e.jsxRuntimeExports.jsx(d.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(k.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(d.PopoverContent,{side:j?"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(r.Select,{defaultValue:c,onValueChange:s=>b(s),children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(r.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(r.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(r.Select,{defaultValue:x,onValueChange:s=>I(s),children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(r.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(r.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(r.SelectItem,{value:s,children:l.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(d.ScrollArea,{className:`h-full ${j&&!l.isEmpty(n)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(n)&&!q&&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"})]}),j?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:n.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))}):n.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)),q&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(_.Loader,{className:"animate-spin w-6 h-6"}),"  Loading..."]}),!l.isEmpty(n)&&u<w&&!q&&e.jsxRuntimeExports.jsx(d.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>C(void 0),disabled:q,children:q?"":"Load More"})]})]})};exports.default=D;exports.fetchImage=g;