@blocklet/list 0.16.60 → 0.17.1

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 (3) hide show
  1. package/lib/index.d.ts +32 -0
  2. package/lib/index.es.js +1039 -736
  3. package/package.json +21 -21
package/lib/index.es.js CHANGED
@@ -1,26 +1,24 @@
1
- import { jsx as t, jsxs as u, Fragment as F } from "react/jsx-runtime";
2
- import { styled as Q, useTheme as we } from "@arcblock/ux/lib/Theme";
3
- import tt from "@mui/material/styles/createTheme";
4
- import rt from "@mui/material/styles/ThemeProvider";
5
- import { pick as ot, omitBy as se, orderBy as nt, isEmpty as it, merge as lt } from "lodash-es";
6
- import { ErrorFallback as be } from "@arcblock/ux/lib/ErrorBoundary";
7
- import w from "@mui/material/Box";
8
- import O from "@mui/material/Stack";
9
- import { createContext as _e, useState as E, useMemo as G, useContext as Me, useCallback as ge, useEffect as q, forwardRef as at, useRef as re, memo as st } from "react";
10
- import { ErrorBoundary as ct } from "react-error-boundary";
11
- import dt from "@iconify-icons/tabler/compass";
1
+ import { jsx as t, jsxs as p, Fragment as _ } from "react/jsx-runtime";
2
+ import { styled as K, useTheme as ye } from "@arcblock/ux/lib/Theme";
3
+ import { useTheme as Le, Box as ee, Card as rt, Skeleton as O, createTheme as ot, ThemeProvider as nt } from "@mui/material";
4
+ import { pick as it, omitBy as ae, orderBy as lt, isEmpty as at, merge as st } from "lodash-es";
5
+ import { ErrorFallback as we } from "@arcblock/ux/lib/ErrorBoundary";
6
+ import g from "@mui/material/Box";
7
+ import A from "@mui/material/Stack";
8
+ import { createContext as Me, useState as T, useMemo as H, useContext as ze, useCallback as fe, useEffect as U, useRef as te, memo as ct } from "react";
9
+ import { ErrorBoundary as dt } from "react-error-boundary";
10
+ import ut from "@iconify-icons/tabler/compass";
12
11
  import { Icon as M } from "@iconify/react";
13
- import ze from "@mui/icons-material/Close";
14
- import v from "@mui/material/Typography";
12
+ import _e from "@mui/icons-material/Close";
13
+ import k from "@mui/material/Typography";
15
14
  import { createAxios as Fe } from "@blocklet/js-sdk";
16
- import { useRequest as ne, useDebounceFn as Ne, useInfiniteScroll as ht, useReactive as ut } from "ahooks";
15
+ import { useRequest as oe, useDebounceFn as Ne, useInfiniteScroll as ht, useReactive as pt } from "ahooks";
17
16
  import "color";
18
- import { parseURL as pt, parseQuery as mt, parseFilename as ft, stringifyParsedURL as gt, withQuery as ke, joinURL as Ie } from "ufo";
19
- import Be from "flat";
20
- import ie from "@mui/material/Button";
21
- import yt from "@mui/material/styles/useTheme";
22
- import V from "@mui/material/useMediaQuery";
23
- import xt from "@mui/material/Drawer";
17
+ import { parseURL as mt, parseQuery as ft, parseFilename as gt, stringifyParsedURL as xt, withQuery as be, joinURL as Se } from "ufo";
18
+ import Ie from "flat";
19
+ import ne from "@mui/material/Button";
20
+ import j from "@mui/material/useMediaQuery";
21
+ import yt from "@mui/material/Drawer";
24
22
  import De from "@mui/material/Checkbox";
25
23
  import We from "@mui/material/FormControlLabel";
26
24
  import wt from "@mui/icons-material/Check";
@@ -32,48 +30,46 @@ import je from "@mui/material/MenuList";
32
30
  import Ct from "@mui/material/Paper";
33
31
  import St from "@mui/material/Popper";
34
32
  import It from "@mui/material/SvgIcon";
35
- import le from "@mui/material/CircularProgress";
33
+ import ie from "@mui/material/CircularProgress";
36
34
  import He from "@arcblock/ux/lib/Avatar";
37
35
  import Bt from "@iconify-icons/tabler/cloud-download";
38
36
  import Rt from "@mui/icons-material/ChevronLeft";
39
- import Tt from "@mui/icons-material/ChevronRight";
40
- import _ from "@mui/material/Skeleton";
41
- import Pt from "react-image-gallery";
37
+ import Pt from "@mui/icons-material/ChevronRight";
38
+ import L from "@mui/material/Skeleton";
39
+ import Tt from "react-image-gallery";
42
40
  import "react-image-gallery/styles/css/image-gallery.css";
43
- import Re from "@mui/material/Grid";
41
+ import Be from "@mui/material/Grid";
44
42
  import At from "react-infinite-scroll-hook";
45
43
  import Et from "@iconify-icons/tabler/square";
46
44
  import Ot from "@iconify-icons/tabler/square-check-filled";
47
- import Te from "@mui/material/Chip";
48
- import { useTheme as Lt } from "@mui/material/styles";
49
- import ce from "@iconify-icons/tabler/search";
50
- import _t from "@iconify-icons/tabler/x";
45
+ import Re from "@mui/material/Chip";
46
+ import se from "@iconify-icons/tabler/search";
47
+ import Lt from "@iconify-icons/tabler/x";
51
48
  import Mt from "@mui/material/Autocomplete";
52
49
  import zt from "@mui/material/Dialog";
53
50
  import Ue from "@mui/material/OutlinedInput";
54
- import Ft from "@mui/material/TextField";
55
- import { useHotkeys as Nt } from "react-hotkeys-hook";
56
- import Dt from "@mui/icons-material/Search";
51
+ import _t from "@mui/material/TextField";
52
+ import { useHotkeys as Ft } from "react-hotkeys-hook";
53
+ import Nt from "@mui/icons-material/Search";
57
54
  import Pe from "@mui/material/InputAdornment";
58
- import Wt from "@arcblock/ux/lib/Empty";
59
- import $t from "json-stable-stringify";
60
- import jt from "@mui/icons-material/Menu";
61
- import { Box as te, Card as Ht, Skeleton as L } from "@mui/material";
62
- import Ut from "@arcblock/react-hooks/lib/useBrowser";
63
- import Vt from "@arcblock/ux/lib/Img";
64
- const Ve = _e({
55
+ import Dt from "@arcblock/ux/lib/Empty";
56
+ import Wt from "json-stable-stringify";
57
+ import $t from "@mui/icons-material/Menu";
58
+ import jt from "@arcblock/react-hooks/lib/useBrowser";
59
+ import Ht from "@arcblock/ux/lib/Img";
60
+ const Ve = Me({
65
61
  open: !1,
66
62
  toggleOpen: (e) => {
67
63
  }
68
64
  });
69
- function Gt({ children: e }) {
70
- const [r, o] = E(!1), n = (a) => {
65
+ function Ut({ children: e }) {
66
+ const [r, o] = T(!1), n = (a) => {
71
67
  o(a ?? !a);
72
- }, i = G(() => ({ open: r, toggleOpen: n }), [r]);
68
+ }, i = H(() => ({ open: r, toggleOpen: n }), [r]);
73
69
  return /* @__PURE__ */ t(Ve.Provider, { value: i, children: e });
74
70
  }
75
- function ve() {
76
- return Me(Ve);
71
+ function ke() {
72
+ return ze(Ve);
77
73
  }
78
74
  const P = {
79
75
  nameAsc: "title",
@@ -89,19 +85,19 @@ const P = {
89
85
  explorePath: "/api/blocklets/explore",
90
86
  exploreDidsPath: "/api/blocklets/dids",
91
87
  cacheSize: 100
92
- }, qt = (e) => ne(
88
+ }, Vt = (e) => oe(
93
89
  async () => {
94
90
  const { data: r } = await e.get(P.categoriesPath);
95
91
  return Array.isArray(r) ? r : [];
96
92
  },
97
93
  { manual: !0 }
98
94
  );
99
- function Kt(e, r) {
95
+ function Gt(e, r) {
100
96
  const o = e.menu ? {
101
97
  sortBy: "popularity",
102
98
  sortDirection: "desc",
103
99
  showResources: "true",
104
- ...ot(e, ["sortBy", "sortDirection", "showResources"])
100
+ ...it(e, ["sortBy", "sortDirection", "showResources"])
105
101
  } : {
106
102
  sortBy: "popularity",
107
103
  sortDirection: "desc",
@@ -118,13 +114,13 @@ function Kt(e, r) {
118
114
  !o.category && !a && (o.category = "All");
119
115
  const s = (l) => {
120
116
  const m = { ...o, ...l };
121
- n(se(m, (c) => c === "" || c === void 0));
117
+ n(ae(m, (h) => h === "" || h === void 0));
122
118
  };
123
119
  return {
124
120
  filters: e,
125
121
  cleanFilter: (l) => {
126
- const m = l ? se(o, (c, f) => l.includes(f)) : {};
127
- n(se(m, (c) => c === "" || c === void 0));
122
+ const m = l ? ae(o, (h, f) => l.includes(f)) : {};
123
+ n(ae(m, (h) => h === "" || h === void 0));
128
124
  },
129
125
  handleActiveMenu: (l) => {
130
126
  l !== e.menu && n({ menu: l });
@@ -155,7 +151,7 @@ function Kt(e, r) {
155
151
  }
156
152
  };
157
153
  }
158
- const Xt = (e, r, o) => e && r || !o, Ge = (e) => [
154
+ const qt = (e, r, o) => e && r || !o, Ge = (e) => [
159
155
  {
160
156
  name: e("sort.popularity"),
161
157
  value: "popularity"
@@ -169,28 +165,24 @@ const Xt = (e, r, o) => e && r || !o, Ge = (e) => [
169
165
  // value: 'rating',
170
166
  // },
171
167
  ], qe = (e, r, o) => {
172
- var c, f;
173
- const n = pt(e), i = mt(n.search);
174
- if ((c = ft(e, { strict: !0 })) == null ? void 0 : c.endsWith(".gif"))
175
- return i.imageFilter ? gt({ ...n, search: "" }) : e;
168
+ const n = mt(e), i = ft(n.search);
169
+ if (gt(e, { strict: !0 })?.endsWith(".gif"))
170
+ return i.imageFilter ? xt({ ...n, search: "" }) : e;
176
171
  if (i.imageFilter)
177
172
  return e;
178
- const s = o || ((f = window.blocklet) == null ? void 0 : f.version), { w: l, h: m } = typeof r == "object" ? { w: r.w, h: r.h } : { w: r, h: r };
179
- return ke(e, {
173
+ const s = o || window.blocklet?.version, { w: l, h: m } = typeof r == "object" ? { w: r.w, h: r.h } : { w: r, h: r };
174
+ return be(e, {
180
175
  ...l || m ? { imageFilter: "resize", w: l, h: m } : {},
181
176
  v: s
182
177
  });
183
- }, Qt = (e) => [
178
+ }, Kt = (e) => [
184
179
  { name: e("blocklet.free"), value: "free" },
185
180
  { name: e("blocklet.payment"), value: "payment" }
186
- ], Yt = (e = [], r = "en") => e.map((o) => ({ name: o.locales[r] || o.locales.en, value: o._id })), Zt = (e) => {
187
- var r, o;
188
- return Array.isArray(e) ? e.map((n) => n.message).join(`
189
- `) : (o = (r = e.response) == null ? void 0 : r.data) != null && o.error ? e.response.data.error.message || e.response.data.error : e.message || e;
190
- }, Jt = (e, r) => (
181
+ ], Xt = (e = [], r = "en") => e.map((o) => ({ name: o.locales[r] || o.locales.en, value: o._id })), Qt = (e) => Array.isArray(e) ? e.map((r) => r.message).join(`
182
+ `) : e.response?.data?.error ? e.response.data.error.message || e.response.data.error : e.message || e, Yt = (e, r) => (
191
183
  // eslint-disable-next-line no-prototype-builtins
192
- e == null ? void 0 : e.replace(/{(\w*)}/g, (o, n) => r.hasOwnProperty(n) ? r[n] : "")
193
- ), er = () => window.innerWidth <= 600, tr = {
184
+ e?.replace(/{(\w*)}/g, (o, n) => r.hasOwnProperty(n) ? r[n] : "")
185
+ ), Zt = () => window.innerWidth <= 600, Jt = {
194
186
  common: {
195
187
  title: "Blocklet Store",
196
188
  searchStore: "Search Blocklet",
@@ -242,7 +234,7 @@ const Xt = (e, r, o) => e && r || !o, Ge = (e) => [
242
234
  autocomplete: {
243
235
  expandResult: 'View all search results for "{name}"'
244
236
  }
245
- }, rr = {
237
+ }, er = {
246
238
  common: {
247
239
  title: "Blocklet 商店",
248
240
  searchStore: "搜索 Blocklet",
@@ -294,15 +286,15 @@ const Xt = (e, r, o) => e && r || !o, Ge = (e) => [
294
286
  autocomplete: {
295
287
  expandResult: "查看 “{name}” 的所有搜索结果"
296
288
  }
297
- }, de = {
298
- en: Be(tr),
299
- zh: Be(rr)
289
+ }, ce = {
290
+ en: Ie(Jt),
291
+ zh: Ie(er)
300
292
  }, Ke = (e, r) => {
301
293
  const o = {};
302
294
  return e && (o["x-blocklet-server-version"] = e), r && (o["x-blocklet-store-version"] = r), o;
303
- }, or = (e) => (r, o) => {
304
- const n = de[e] ? de[e][r] : de.en[r];
305
- return Jt(n, o) || r;
295
+ }, tr = (e) => (r, o) => {
296
+ const n = ce[e] ? ce[e][r] : ce.en[r];
297
+ return Yt(n, o) || r;
306
298
  }, Xe = {
307
299
  errors: {
308
300
  fetchCategoriesError: null
@@ -358,8 +350,8 @@ const Xt = (e, r, o) => e && r || !o, Ge = (e) => [
358
350
  handlePage: () => {
359
351
  }
360
352
  }
361
- }, Qe = _e(Xe), { Provider: nr, Consumer: Do } = Qe;
362
- function ir(e) {
353
+ }, Qe = Me(Xe), { Provider: rr, Consumer: Lo } = Qe;
354
+ function or(e) {
363
355
  const {
364
356
  locale: r = "zh",
365
357
  filters: o = {},
@@ -369,37 +361,37 @@ function ir(e) {
369
361
  minItemWidth: a = 350,
370
362
  queryFilter: s = !0,
371
363
  layout: l = {},
372
- wrapChildren: m = (T) => T,
373
- extraFilter: c = (T) => T,
364
+ wrapChildren: m = (R) => R,
365
+ extraFilter: h = (R) => R,
374
366
  baseSearch: f = !1,
375
367
  fetchCategoryDelay: d = 0,
376
- showResourcesSwitch: g = !1,
368
+ showResourcesSwitch: w = !1,
377
369
  showCategory: y = !0,
378
- tagFilters: I = [],
379
- children: x,
380
- storeVersion: B,
381
- onSearchSelect: p = () => {
370
+ tagFilters: S = [],
371
+ children: u,
372
+ storeVersion: x,
373
+ onSearchSelect: b = () => {
382
374
  },
383
- endpoint: C,
384
- blockletRender: b,
385
- compact: k = !1
386
- } = e, A = Ke(n, B), N = G(() => Fe({ baseURL: C, headers: A }), [C]), j = Kt(o, { onFilterChange: i, emptyCategory: !l.showExplore, onSearchSelect: p }), [D, K] = E(""), {
387
- data: H = [],
388
- error: ae,
389
- loading: Y,
390
- run: Z
391
- } = qt(N), U = G(() => {
392
- const T = nt(H, [($) => $.name], ["asc"]), z = T.findIndex(($) => $.name === "All" || $.locales.en === "All");
393
- return z > -1 ? [{ ...T[z], _id: "All" }, ...T.slice(0, z), ...T.slice(z + 1)] : T;
394
- }, [H]), X = ge(or(r), [r]), h = G(() => Yt(U, r), [U, r]), S = Qt(X), W = {
395
- search: j,
396
- compact: k,
397
- errors: { fetchCategoriesError: ae },
375
+ endpoint: v,
376
+ blockletRender: C,
377
+ compact: E = !1
378
+ } = e, V = Ke(n, x), X = H(() => Fe({ baseURL: v, headers: V }), [v]), D = Gt(o, { onFilterChange: i, emptyCategory: !l.showExplore, onSearchSelect: b }), [F, G] = T(""), {
379
+ data: W = [],
380
+ error: le,
381
+ loading: Q,
382
+ run: Y
383
+ } = Vt(X), $ = H(() => {
384
+ const R = lt(W, [(N) => N.name], ["asc"]), z = R.findIndex((N) => N.name === "All" || N.locales.en === "All");
385
+ return z > -1 ? [{ ...R[z], _id: "All" }, ...R.slice(0, z), ...R.slice(z + 1)] : R;
386
+ }, [W]), q = fe(tr(r), [r]), c = H(() => Xt($, r), [$, r]), B = Kt(q), tt = {
387
+ search: D,
388
+ compact: E,
389
+ errors: { fetchCategoriesError: le },
398
390
  loadings: {
399
- fetchCategoriesLoading: Y
391
+ fetchCategoriesLoading: Q
400
392
  },
401
- extraFilter: c,
402
- endpoint: C,
393
+ extraFilter: h,
394
+ endpoint: v,
403
395
  queryFilter: s,
404
396
  layout: {
405
397
  showExplore: l.showExplore ?? !1,
@@ -409,37 +401,37 @@ function ir(e) {
409
401
  },
410
402
  minItemWidth: a,
411
403
  wrapChildren: m,
412
- t: X,
413
- storeVersion: B,
404
+ t: q,
405
+ storeVersion: x,
414
406
  serverVersion: n,
415
- selectedCategory: j.filters.category || (l.showExplore ? "" : "All"),
416
- categoryList: U,
417
- blockletRender: b,
407
+ selectedCategory: D.filters.category || (l.showExplore ? "" : "All"),
408
+ categoryList: $,
409
+ blockletRender: C,
418
410
  locale: r,
419
- categoryOptions: h,
420
- priceOptions: S,
421
- storeApi: N,
411
+ categoryOptions: c,
412
+ priceOptions: B,
413
+ storeApi: X,
422
414
  baseSearch: f,
423
- showResourcesSwitch: g,
415
+ showResourcesSwitch: w,
424
416
  showCategory: y,
425
- tagFilters: I,
417
+ tagFilters: S,
426
418
  onFilterChange: i,
427
- getCategoryLocale: (T) => {
428
- if (!T) return null;
429
- const z = H.find(($) => $._id === T || $.locales.en === "All");
419
+ getCategoryLocale: (R) => {
420
+ if (!R) return null;
421
+ const z = W.find((N) => N._id === R || N.locales.en === "All");
430
422
  return z ? z.locales[r] || z.locales.en : null;
431
423
  },
432
424
  get developerName() {
433
- return D;
425
+ return F;
434
426
  },
435
- updateDeveloperName: K
427
+ updateDeveloperName: G
436
428
  };
437
- return q(() => {
438
- setTimeout(Z, d || 0);
439
- }, [C, Z, d]), /* @__PURE__ */ t(nr, { value: W, children: x });
429
+ return U(() => {
430
+ setTimeout(Y, d || 0);
431
+ }, [v, Y, d]), /* @__PURE__ */ t(rr, { value: tt, children: u });
440
432
  }
441
- function R() {
442
- const e = Me(Qe);
433
+ function I() {
434
+ const e = ze(Qe);
443
435
  return e || Xe;
444
436
  }
445
437
  function Ye({
@@ -449,7 +441,7 @@ function Ye({
449
441
  ...n
450
442
  }) {
451
443
  return /* @__PURE__ */ t(
452
- ie,
444
+ ne,
453
445
  {
454
446
  ...n,
455
447
  onClick: r,
@@ -472,97 +464,97 @@ function Ye({
472
464
  }
473
465
  );
474
466
  }
475
- function J(e, r) {
467
+ function Z(e, r) {
476
468
  return e === void 0 ? r : e;
477
469
  }
478
- function Ce({
479
- xs: e,
480
- sm: r,
481
- md: o,
482
- lg: n,
483
- xl: i,
484
- exact: a
470
+ function ve({
471
+ xs: e = void 0,
472
+ sm: r = void 0,
473
+ md: o = void 0,
474
+ lg: n = void 0,
475
+ xl: i = void 0,
476
+ exact: a = !1
485
477
  }) {
486
- const s = yt(), l = V(s.breakpoints.down("sm")), m = V(s.breakpoints.between("sm", "md")), c = V(s.breakpoints.between("md", "lg")), f = V(s.breakpoints.between("lg", "xl"));
478
+ const s = Le(), l = j(s.breakpoints.down("sm")), m = j(s.breakpoints.between("sm", "md")), h = j(s.breakpoints.between("md", "lg")), f = j(s.breakpoints.between("lg", "xl"));
487
479
  if (a)
488
- return l ? e || null : m ? r || null : c ? o || null : f ? n || null : i || null;
480
+ return l ? e || null : m ? r || null : h ? o || null : f ? n || null : i || null;
489
481
  let d = e;
490
- return l || (d = J(r, d), m) || (d = J(o, d), c) || (d = J(n, d), f) ? d : J(i, d);
482
+ return l || (d = Z(r, d), m) || (d = Z(o, d), h) || (d = Z(n, d), f) ? d : Z(i, d);
491
483
  }
492
- function lr({ children: e }) {
493
- const { open: r, toggleOpen: o } = ve();
484
+ function nr({ children: e }) {
485
+ const { open: r, toggleOpen: o } = ke();
494
486
  return /* @__PURE__ */ t(
495
- Ce,
487
+ ve,
496
488
  {
497
- xs: /* @__PURE__ */ t(xt, { open: r, onClose: () => o(!1), children: e }),
498
- md: /* @__PURE__ */ t(w, { children: e })
489
+ xs: /* @__PURE__ */ t(yt, { open: r, onClose: () => o(!1), children: e }),
490
+ md: /* @__PURE__ */ t(g, { children: e })
499
491
  }
500
492
  );
501
493
  }
502
- const ar = at(({ loading: e, disabled: r, ...o }, n) => /* @__PURE__ */ t(
503
- ie,
504
- {
505
- ref: n,
506
- disableElevation: !0,
507
- disabled: r || e,
508
- ...o,
509
- sx: [{ borderRadius: "4px" }, ...Array.isArray(o.sx) ? o.sx : [o.sx]],
510
- startIcon: e && /* @__PURE__ */ t(le, { size: "1em" })
511
- }
512
- ));
513
- function ye({ value: e, options: r, onChange: o, placeholder: n, ...i }) {
514
- var B;
515
- const a = re(null), s = we(), [l, m] = E(!1), [c, f] = E(e !== null ? e : ""), d = V(s.breakpoints.down("sm"));
516
- q(() => {
494
+ function ir({ loading: e = !1, disabled: r, ...o }) {
495
+ return /* @__PURE__ */ t(
496
+ ne,
497
+ {
498
+ disableElevation: !0,
499
+ disabled: r || e === !0,
500
+ ...o,
501
+ sx: [{ borderRadius: "4px" }, ...Array.isArray(o.sx) ? o.sx : [o.sx]],
502
+ startIcon: e && /* @__PURE__ */ t(ie, { size: "1em" })
503
+ }
504
+ );
505
+ }
506
+ function ge({ value: e, options: r, onChange: o, placeholder: n = "", ...i }) {
507
+ const a = te(null), s = ye(), [l, m] = T(!1), [h, f] = T(e !== null ? e : ""), d = j(s.breakpoints.down("sm"));
508
+ U(() => {
517
509
  f(e !== null ? e : "");
518
510
  }, [e]);
519
- const g = ge(() => {
511
+ const w = fe(() => {
520
512
  m(!1);
521
- }, []), y = ge(() => {
513
+ }, []), y = fe(() => {
522
514
  m(!0);
523
515
  }, []);
524
- function I(p) {
525
- f(p.value), o(p.value), d && g();
516
+ function S(x) {
517
+ f(x.value), o(x.value), d && w();
526
518
  }
527
- function x(p) {
528
- return p === c;
519
+ function u(x) {
520
+ return x === h;
529
521
  }
530
- return /* @__PURE__ */ u(F, { children: [
531
- /* @__PURE__ */ u(
532
- sr,
522
+ return /* @__PURE__ */ p(_, { children: [
523
+ /* @__PURE__ */ p(
524
+ lr,
533
525
  {
534
526
  ref: a,
535
527
  onClick: y,
536
528
  variant: "outlined",
537
529
  size: "medium",
538
- className: ["my-select__selector", it(c) ? "" : "my-select__selector--active"].join(" "),
530
+ className: ["my-select__selector", at(h) ? "" : "my-select__selector--active"].join(" "),
539
531
  sx: { minWidth: { xs: "100px", md: "auto" }, color: "text.primary", borderRadius: "8px" },
540
532
  ...i,
541
533
  children: [
542
- ((B = r.find((p) => p.value === c)) == null ? void 0 : B.name) || n,
534
+ r.find((x) => x.value === h)?.name || n,
543
535
  /* @__PURE__ */ t(It, { className: "my-select__arrowdown", component: bt, sx: { width: 18, height: 18 } })
544
536
  ]
545
537
  }
546
538
  ),
547
- /* @__PURE__ */ t(St, { open: l, anchorEl: a.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: p, placement: C }) => /* @__PURE__ */ t(
539
+ /* @__PURE__ */ t(St, { open: l, anchorEl: a.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: x, placement: b }) => /* @__PURE__ */ t(
548
540
  vt,
549
541
  {
550
- ...p,
551
- style: { transformOrigin: C === "bottom" ? "center top" : "center bottom" },
552
- children: /* @__PURE__ */ t(Ct, { children: /* @__PURE__ */ t(kt, { onClickAway: g, children: /* @__PURE__ */ t(cr, { autoFocusItem: l, onMouseEnter: y, onMouseLeave: g, children: r.map((b) => /* @__PURE__ */ u($e, { onClick: () => I(b), sx: { fontSize: 14 }, children: [
542
+ ...x,
543
+ style: { transformOrigin: b === "bottom" ? "center top" : "center bottom" },
544
+ children: /* @__PURE__ */ t(Ct, { children: /* @__PURE__ */ t(kt, { onClickAway: w, children: /* @__PURE__ */ t(ar, { autoFocusItem: l, onMouseEnter: y, onMouseLeave: w, children: r.map((v) => /* @__PURE__ */ p($e, { onClick: () => S(v), sx: { fontSize: 14 }, children: [
553
545
  /* @__PURE__ */ t(
554
546
  wt,
555
547
  {
556
- sx: { mr: 1, fontSize: 16, visibility: x(b.value) ? "visible" : "hidden" }
548
+ sx: { mr: 1, fontSize: 16, visibility: u(v.value) ? "visible" : "hidden" }
557
549
  }
558
550
  ),
559
- b.name
560
- ] }, b.value)) }) }) })
551
+ v.name
552
+ ] }, v.value)) }) }) })
561
553
  }
562
554
  ) })
563
555
  ] });
564
556
  }
565
- const sr = Q(ar)`
557
+ const lr = K(ir)`
566
558
  border: 1px solid ${(e) => e.theme.palette.divider};
567
559
  padding: 6px 8px 6px 12px;
568
560
  font-weight: ${(e) => e.theme.typography.fontWeightRegular};
@@ -573,10 +565,6 @@ const sr = Q(ar)`
573
565
  & + & {
574
566
  margin-left: 10px;
575
567
  }
576
- &.my-select__selector--active {
577
- &,
578
- .my-select__arrowdown,
579
- }
580
568
  .my-select__arrowdown {
581
569
  color: ${(e) => e.theme.palette.grey[400]};
582
570
  font-size: 14px;
@@ -590,7 +578,7 @@ const sr = Q(ar)`
590
578
  margin-right: 3px;
591
579
  }
592
580
  }
593
- `, cr = Q(je)`
581
+ `, ar = K(je)`
594
582
  .my-select__option__icon {
595
583
  color: transparent;
596
584
  font-size: 14px;
@@ -608,15 +596,17 @@ const sr = Q(ar)`
608
596
  }
609
597
  `;
610
598
  function Ze() {
611
- const { search: e, t: r } = R(), { filters: o, handleSort: n, handlePrice: i } = e, a = Ge(r);
612
- return /* @__PURE__ */ u(
613
- O,
599
+ const { search: e, t: r } = I(), { filters: o, handleSort: n, handlePrice: i } = e, a = Ge(r);
600
+ return /* @__PURE__ */ p(
601
+ A,
614
602
  {
615
603
  direction: { xs: "row", md: "column" },
616
- alignItems: { xs: "center", md: "flex-start" },
617
- gap: { xs: 1, md: 2 },
618
- width: { xs: "100%", md: "auto" },
619
- justifyContent: "space-between",
604
+ sx: {
605
+ alignItems: { xs: "center", md: "flex-start" },
606
+ gap: { xs: 1, md: 2 },
607
+ width: { xs: "100%", md: "auto" },
608
+ justifyContent: "space-between"
609
+ },
620
610
  children: [
621
611
  /* @__PURE__ */ t(
622
612
  We,
@@ -634,7 +624,7 @@ function Ze() {
634
624
  }
635
625
  ),
636
626
  /* @__PURE__ */ t(
637
- ye,
627
+ ge,
638
628
  {
639
629
  value: o.sortBy || a[0].value,
640
630
  options: a,
@@ -646,18 +636,18 @@ function Ze() {
646
636
  }
647
637
  );
648
638
  }
649
- function dr({ menus: e }) {
650
- const { selectedCategory: r, search: o, t: n, categoryOptions: i, loadings: a, layout: s, baseSearch: l, compact: m } = R(), { filters: c, handleActiveMenu: f, handleCategory: d, cleanFilter: g } = o, { toggleOpen: y } = ve();
651
- q(() => {
639
+ function sr({ menus: e = [] }) {
640
+ const { selectedCategory: r, search: o, t: n, categoryOptions: i, loadings: a, layout: s, baseSearch: l, compact: m } = I(), { filters: h, handleActiveMenu: f, handleCategory: d, cleanFilter: w } = o, { toggleOpen: y } = ke();
641
+ U(() => {
652
642
  y(!1);
653
- }, [Object.values(c).join("")]);
654
- const I = Xt(l, s.showSearch, c.keyword);
655
- return s.showCategory && !m ? /* @__PURE__ */ u(lr, { children: [
643
+ }, [Object.values(h).join("")]);
644
+ const S = qt(l, s.showSearch, h.keyword);
645
+ return s.showCategory && !m ? /* @__PURE__ */ p(nr, { children: [
656
646
  /* @__PURE__ */ t(
657
- Ce,
647
+ ve,
658
648
  {
659
- xs: /* @__PURE__ */ u(
660
- O,
649
+ xs: /* @__PURE__ */ p(
650
+ A,
661
651
  {
662
652
  direction: "row",
663
653
  justifyContent: "space-between",
@@ -668,8 +658,8 @@ function dr({ menus: e }) {
668
658
  borderBottom: 1,
669
659
  borderColor: "divider",
670
660
  children: [
671
- /* @__PURE__ */ t(Ye, { onClick: () => y(!1), children: /* @__PURE__ */ t(ze, {}) }),
672
- /* @__PURE__ */ t(v, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: n("common.category") })
661
+ /* @__PURE__ */ t(Ye, { onClick: () => y(!1), children: /* @__PURE__ */ t(_e, {}) }),
662
+ /* @__PURE__ */ t(k, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: n("common.category") })
673
663
  ]
674
664
  }
675
665
  ),
@@ -677,72 +667,71 @@ function dr({ menus: e }) {
677
667
  }
678
668
  ),
679
669
  /* @__PURE__ */ t(
680
- O,
670
+ A,
681
671
  {
682
672
  visibility: a.fetchCategoriesLoading ? "hidden" : "visible",
683
673
  width: { xs: 268, md: 200 },
684
674
  boxSizing: "content-box",
685
675
  p: { xs: 2, md: 0 },
686
676
  pr: { md: 6 },
687
- children: I ? /* @__PURE__ */ u(F, { children: [
688
- s.showExplore && /* @__PURE__ */ u(w, { mb: 3, pb: 3, borderBottom: 1, borderColor: "divider", children: [
689
- /* @__PURE__ */ u(w, { display: "flex", alignItems: "center", gap: 1, children: [
690
- /* @__PURE__ */ t(M, { icon: dt, width: 20, height: 20 }),
677
+ children: S ? /* @__PURE__ */ p(_, { children: [
678
+ s.showExplore && /* @__PURE__ */ p(g, { mb: 3, pb: 3, borderBottom: 1, borderColor: "divider", children: [
679
+ /* @__PURE__ */ p(g, { display: "flex", alignItems: "center", gap: 1, children: [
680
+ /* @__PURE__ */ t(M, { icon: ut, width: 20, height: 20 }),
691
681
  /* @__PURE__ */ t(
692
- v,
682
+ k,
693
683
  {
694
684
  variant: "body1",
695
- color: !r && !c.menu ? "text.primary" : "grey.400",
696
- fontWeight: !r && !c.menu ? "fontWeightMedium" : void 0,
685
+ color: !r && !h.menu ? "text.primary" : "grey.400",
686
+ fontWeight: !r && !h.menu ? "fontWeightMedium" : void 0,
697
687
  sx: { cursor: "pointer" },
698
688
  onClick: () => {
699
- y(!1), g();
689
+ y(!1), w();
700
690
  },
701
691
  children: n("explore.title")
702
692
  }
703
693
  )
704
694
  ] }),
705
- e == null ? void 0 : e.map((x) => /* @__PURE__ */ u(w, { display: "flex", alignItems: "center", mt: 2, gap: 1, children: [
706
- typeof x.icon == "string" ? /* @__PURE__ */ t(M, { icon: x.icon, width: 20, height: 20 }) : x.icon,
695
+ e.map((u) => /* @__PURE__ */ p(g, { display: "flex", alignItems: "center", mt: 2, gap: 1, children: [
696
+ typeof u.icon == "string" ? /* @__PURE__ */ t(M, { icon: u.icon, width: 20, height: 20 }) : u.icon,
707
697
  /* @__PURE__ */ t(
708
- v,
698
+ k,
709
699
  {
710
700
  variant: "body1",
711
- color: c.menu === x.key ? "text.primary" : "grey.400",
712
- fontWeight: c.menu === x.key ? "fontWeightMedium" : void 0,
701
+ color: h.menu === u.key ? "text.primary" : "grey.400",
702
+ fontWeight: h.menu === u.key ? "fontWeightMedium" : void 0,
713
703
  sx: { cursor: "pointer" },
714
704
  onClick: () => {
715
- var B;
716
- y(!1), f(x.key), (B = x.onClick) == null || B.call(x);
705
+ y(!1), f(u.key), u.onClick?.();
717
706
  },
718
- children: x.title
707
+ children: u.title
719
708
  }
720
709
  )
721
- ] }, x.key))
710
+ ] }, u.key))
722
711
  ] }),
723
- !!i.length && /* @__PURE__ */ t(O, { gap: 2, children: i.map((x) => /* @__PURE__ */ t(
724
- v,
712
+ !!i.length && /* @__PURE__ */ t(A, { gap: 2, children: i.map((u) => /* @__PURE__ */ t(
713
+ k,
725
714
  {
726
715
  variant: "body1",
727
- title: x.name,
716
+ title: u.name,
728
717
  sx: { cursor: "pointer" },
729
718
  "data-cy": "filter",
730
- color: r === x.value ? "text.primary" : "grey.400",
719
+ color: r === u.value ? "text.primary" : "grey.400",
731
720
  textTransform: "capitalize",
732
721
  onClick: () => {
733
- r === x.value ? g() : d(x.value), y(!1);
722
+ r === u.value ? w() : d(u.value), y(!1);
734
723
  },
735
- children: x.name
724
+ children: u.name
736
725
  },
737
- x.value
726
+ u.value
738
727
  )) })
739
728
  ] }) : /* @__PURE__ */ t(Ze, {})
740
729
  }
741
730
  )
742
731
  ] }) : null;
743
732
  }
744
- function Se() {
745
- const { endpoint: e, serverVersion: r, storeVersion: o } = R(), n = Ke(r, o), i = G(() => Fe({
733
+ function Ce() {
734
+ const { endpoint: e, serverVersion: r, storeVersion: o } = I(), n = Ke(r, o), i = H(() => Fe({
746
735
  baseURL: e,
747
736
  headers: n
748
737
  }), [e]);
@@ -757,44 +746,74 @@ function Se() {
757
746
  }
758
747
  };
759
748
  }
760
- const Je = st(function(r) {
761
- return /* @__PURE__ */ t(w, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...r, children: /* @__PURE__ */ t(le, {}) });
749
+ const Je = ct(function(r) {
750
+ return /* @__PURE__ */ t(
751
+ g,
752
+ {
753
+ ...r,
754
+ sx: [
755
+ {
756
+ height: 60,
757
+ display: "flex",
758
+ alignItems: "center",
759
+ justifyContent: "center"
760
+ },
761
+ ...Array.isArray(r.sx) ? r.sx : [r.sx]
762
+ ],
763
+ children: /* @__PURE__ */ t(ie, {})
764
+ }
765
+ );
762
766
  });
763
- function Ae({
764
- icon: e,
765
- children: r,
767
+ function Te({
768
+ icon: e = null,
769
+ children: r = null,
766
770
  maxWidth: o = 100,
767
- title: n
771
+ title: n = ""
768
772
  }) {
769
- return (r === 0 || r) && /* @__PURE__ */ u(O, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: o, overflow: "hidden" }, children: [
770
- e,
771
- /* @__PURE__ */ t(
772
- v,
773
- {
774
- flex: 1,
775
- variant: "body2",
776
- sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
777
- title: n || (typeof r == "string" ? r : void 0),
778
- children: r
779
- }
780
- )
781
- ] });
773
+ return (r === 0 || r) && /* @__PURE__ */ p(
774
+ A,
775
+ {
776
+ direction: "row",
777
+ sx: {
778
+ alignItems: "center",
779
+ gap: 1,
780
+ maxWidth: o,
781
+ overflow: "hidden"
782
+ },
783
+ children: [
784
+ e,
785
+ /* @__PURE__ */ t(
786
+ k,
787
+ {
788
+ variant: "body2",
789
+ title: n || (typeof r == "string" ? r : void 0),
790
+ sx: {
791
+ flex: 1,
792
+ overflow: "hidden",
793
+ textOverflow: "ellipsis",
794
+ whiteSpace: "nowrap"
795
+ },
796
+ children: r
797
+ }
798
+ )
799
+ ]
800
+ }
801
+ );
782
802
  }
783
- const hr = 16 / 9, he = 292, xe = 189, oe = 336;
784
- function ur() {
785
- var x, B;
786
- const { t: e, search: r } = R(), { get: o } = Se(), n = we(), i = V(n.breakpoints.down("md")), a = ((B = (x = window.blocklet) == null ? void 0 : x.preferences) == null ? void 0 : B.homeBanner) || [], {
803
+ const cr = 16 / 9, de = 292, xe = 189, re = 336;
804
+ function dr() {
805
+ const { t: e, search: r } = I(), { get: o } = Ce(), n = ye(), i = j(n.breakpoints.down("md")), a = window.blocklet?.preferences?.homeBanner || [], {
787
806
  data: s = [],
788
807
  error: l,
789
808
  loading: m
790
- } = ne(async () => {
791
- const p = await o(
792
- ke(P.blockletsPath, { didList: a.map((C) => C.did).join(",") })
809
+ } = oe(async () => {
810
+ const u = await o(
811
+ be(P.blockletsPath, { didList: a.map((x) => x.did).join(",") })
793
812
  );
794
- return p != null && p.dataList ? a.map((C) => p.dataList.find((b) => b.did === C.did)) : [];
813
+ return u?.dataList ? a.map((x) => u.dataList.find((b) => b.did === x.did)) : [];
795
814
  });
796
815
  l && console.error("Get Banner Blocklets error:", l);
797
- const c = {
816
+ const h = {
798
817
  position: "absolute",
799
818
  top: "50%",
800
819
  transform: "translateY(-50%)",
@@ -802,32 +821,76 @@ function ur() {
802
821
  cursor: "pointer",
803
822
  color: "text.hint"
804
823
  };
805
- return !l && a.length > 0 ? /* @__PURE__ */ u(F, { children: [
806
- /* @__PURE__ */ t(v, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
824
+ return !l && a.length > 0 ? /* @__PURE__ */ p(_, { children: [
807
825
  /* @__PURE__ */ t(
808
- w,
826
+ k,
809
827
  {
810
- height: { xs: "auto", md: he },
811
- minHeight: he,
812
- position: "relative",
813
- border: 1,
814
- borderColor: "divider",
815
- borderRadius: 3,
816
- overflow: "hidden",
817
- children: m ? /* @__PURE__ */ u(w, { p: 5, display: { md: "flex" }, gap: 5, alignItems: "center", justifyContent: "center", children: [
818
- /* @__PURE__ */ t(_, { variant: "rounded", height: xe, width: oe }),
819
- /* @__PURE__ */ u(w, { flex: 1, height: "100%", children: [
820
- /* @__PURE__ */ t(_, { variant: "text", height: 50, width: 100 }),
821
- /* @__PURE__ */ t(_, { variant: "text", height: 40, width: "100%" }),
822
- /* @__PURE__ */ t(_, { variant: "text", height: 40, width: 300 }),
823
- /* @__PURE__ */ u(w, { display: "flex", gap: 1, my: 2, children: [
824
- /* @__PURE__ */ t(_, { variant: "circular", height: 20, width: 20 }),
825
- /* @__PURE__ */ t(_, { variant: "text", height: 20, width: 50 })
826
- ] }),
827
- /* @__PURE__ */ t(_, { variant: "rounded", height: 30, width: 100 })
828
- ] })
829
- ] }) : /* @__PURE__ */ t(
830
- Pt,
828
+ component: "h2",
829
+ variant: "h2",
830
+ sx: {
831
+ mt: { xs: 2, md: 0 },
832
+ mb: 3
833
+ },
834
+ children: e("explore.title")
835
+ }
836
+ ),
837
+ /* @__PURE__ */ t(
838
+ g,
839
+ {
840
+ sx: {
841
+ height: { xs: "auto", md: de },
842
+ minHeight: de,
843
+ position: "relative",
844
+ border: 1,
845
+ borderColor: "divider",
846
+ borderRadius: 3,
847
+ overflow: "hidden"
848
+ },
849
+ children: m ? /* @__PURE__ */ p(
850
+ g,
851
+ {
852
+ sx: {
853
+ p: 5,
854
+ display: { md: "flex" },
855
+ gap: 5,
856
+ alignItems: "center",
857
+ justifyContent: "center"
858
+ },
859
+ children: [
860
+ /* @__PURE__ */ t(L, { variant: "rounded", height: xe, width: re }),
861
+ /* @__PURE__ */ p(
862
+ g,
863
+ {
864
+ sx: {
865
+ flex: 1,
866
+ height: "100%"
867
+ },
868
+ children: [
869
+ /* @__PURE__ */ t(L, { variant: "text", height: 50, width: 100 }),
870
+ /* @__PURE__ */ t(L, { variant: "text", height: 40, width: "100%" }),
871
+ /* @__PURE__ */ t(L, { variant: "text", height: 40, width: 300 }),
872
+ /* @__PURE__ */ p(
873
+ g,
874
+ {
875
+ sx: {
876
+ display: "flex",
877
+ gap: 1,
878
+ my: 2
879
+ },
880
+ children: [
881
+ /* @__PURE__ */ t(L, { variant: "circular", height: 20, width: 20 }),
882
+ /* @__PURE__ */ t(L, { variant: "text", height: 20, width: 50 })
883
+ ]
884
+ }
885
+ ),
886
+ /* @__PURE__ */ t(L, { variant: "rounded", height: 30, width: 100 })
887
+ ]
888
+ }
889
+ )
890
+ ]
891
+ }
892
+ ) : /* @__PURE__ */ t(
893
+ Tt,
831
894
  {
832
895
  showNav: !0,
833
896
  autoPlay: !0,
@@ -838,18 +901,24 @@ function ur() {
838
901
  showBullets: !1,
839
902
  showThumbnails: !1,
840
903
  showFullscreenButton: !1,
841
- renderLeftNav: (p) => /* @__PURE__ */ t(w, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Rt, { sx: { ...c, left: 5 } }) }),
842
- renderRightNav: (p) => /* @__PURE__ */ t(w, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Tt, { sx: { ...c, right: 5 } }) }),
843
- items: a.map((p, C) => ({
844
- original: p.did,
904
+ renderLeftNav: (u) => /* @__PURE__ */ t(g, { onClick: u, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Rt, { sx: { ...h, left: 5 } }) }),
905
+ renderRightNav: (u) => /* @__PURE__ */ t(g, { onClick: u, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Pt, { sx: { ...h, right: 5 } }) }),
906
+ items: a.map((u, x) => ({
907
+ original: u.did,
845
908
  renderItem: () => {
846
- var N;
847
- const b = s[C] || {}, k = p.cover || mr(p.did, (N = b.screenshots) == null ? void 0 : N[0]), A = qe(k, n.breakpoints.values.md * 2);
848
- return /* @__PURE__ */ u(
849
- O,
909
+ const b = s[x] || {}, v = u.cover || hr(u.did, b.screenshots?.[0]), C = qe(v, n.breakpoints.values.md * 2);
910
+ return /* @__PURE__ */ p(
911
+ A,
850
912
  {
851
- height: { xs: "auto", md: he },
913
+ direction: { xs: "column", md: "row" },
914
+ onClick: () => r.handleSearchSelect(b),
852
915
  sx: {
916
+ height: { xs: "auto", md: de },
917
+ display: "flex",
918
+ justifyContent: "center",
919
+ alignItems: { xs: "flex-start", md: "center" },
920
+ p: { xs: 2, md: 5 },
921
+ gap: { xs: 2, md: 5 },
853
922
  cursor: "pointer",
854
923
  "&::before": {
855
924
  content: '""',
@@ -858,30 +927,41 @@ function ur() {
858
927
  left: 0,
859
928
  right: 0,
860
929
  bottom: 0,
861
- backgroundImage: `url("${A}")`,
930
+ backgroundImage: `url("${C}")`,
862
931
  backgroundSize: "cover",
863
932
  filter: "blur(50px)",
864
933
  opacity: 0.15,
865
934
  zIndex: 0
866
935
  }
867
936
  },
868
- display: "flex",
869
- direction: { xs: "column", md: "row" },
870
- justifyContent: "center",
871
- alignItems: { xs: "flex-start", md: "center" },
872
- p: { xs: 2, md: 5 },
873
- onClick: () => r.handleSearchSelect(b),
874
- gap: { xs: 2, md: 5 },
875
937
  children: [
876
- f(A),
877
- /* @__PURE__ */ u(O, { flex: 1, height: "100%", gap: 3, children: [
878
- /* @__PURE__ */ u(w, { flex: 1, children: [
879
- d(p.name || b.title || p.name),
880
- g(p.desc || b.description)
881
- ] }),
882
- b.did && y(b, p.baseNum),
883
- I(b)
884
- ] })
938
+ f(C),
939
+ /* @__PURE__ */ p(
940
+ A,
941
+ {
942
+ sx: {
943
+ flex: 1,
944
+ height: "100%",
945
+ gap: 3
946
+ },
947
+ children: [
948
+ /* @__PURE__ */ p(
949
+ g,
950
+ {
951
+ sx: {
952
+ flex: 1
953
+ },
954
+ children: [
955
+ d(u.name || b.title || u.name),
956
+ w(u.desc || b.description)
957
+ ]
958
+ }
959
+ ),
960
+ b.did && y(b, u.baseNum),
961
+ S(b)
962
+ ]
963
+ }
964
+ )
885
965
  ]
886
966
  }
887
967
  );
@@ -892,50 +972,80 @@ function ur() {
892
972
  }
893
973
  )
894
974
  ] }) : null;
895
- function f(p) {
896
- return /* @__PURE__ */ t(w, { borderRadius: 2, overflow: "hidden", position: "relative", width: { xs: "100%", md: oe }, children: /* @__PURE__ */ t(fr, { url: p }) });
975
+ function f(u) {
976
+ return /* @__PURE__ */ t(
977
+ g,
978
+ {
979
+ sx: {
980
+ borderRadius: 2,
981
+ overflow: "hidden",
982
+ position: "relative",
983
+ width: { xs: "100%", md: re }
984
+ },
985
+ children: /* @__PURE__ */ t(pr, { url: u })
986
+ }
987
+ );
897
988
  }
898
- function d(p) {
899
- return /* @__PURE__ */ t(v, { variant: "h2", width: "100%", children: p });
989
+ function d(u) {
990
+ return /* @__PURE__ */ t(
991
+ k,
992
+ {
993
+ variant: "h2",
994
+ sx: {
995
+ width: "100%"
996
+ },
997
+ children: u
998
+ }
999
+ );
900
1000
  }
901
- function g(p) {
1001
+ function w(u) {
902
1002
  return /* @__PURE__ */ t(
903
- v,
1003
+ k,
904
1004
  {
905
1005
  variant: "body2",
906
- color: "text.secondary",
907
- textAlign: "left",
908
- width: "100%",
909
- minHeight: 70,
910
- maxHeight: 70,
911
- pt: 1,
912
1006
  sx: {
1007
+ color: "text.secondary",
1008
+ textAlign: "left",
1009
+ width: "100%",
1010
+ minHeight: 70,
1011
+ maxHeight: 71,
1012
+ pt: 1,
913
1013
  display: "-webkit-box",
914
1014
  lineClamp: 3,
915
1015
  WebkitLineClamp: 3,
916
- maxHeight: 71,
917
1016
  textWrap: "wrap",
918
1017
  overflow: "hidden",
919
1018
  WebkitBoxOrient: "vertical"
920
1019
  },
921
- children: p
1020
+ children: u
922
1021
  }
923
1022
  );
924
1023
  }
925
- function y(p, C = 0) {
926
- const { did: b, owner: k, stats: A } = p;
927
- return /* @__PURE__ */ u(w, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
928
- /* @__PURE__ */ t(Ae, { icon: /* @__PURE__ */ t(He, { src: k.avatar, did: b, size: 20, variant: "circle" }), children: k.fullName }),
929
- /* @__PURE__ */ t(Ae, { icon: /* @__PURE__ */ t(M, { icon: Bt }), title: `${A.downloads + C}`, children: pr(A.downloads + C) })
930
- ] });
1024
+ function y(u, x = 0) {
1025
+ const { did: b, owner: v, stats: C } = u;
1026
+ return /* @__PURE__ */ p(
1027
+ g,
1028
+ {
1029
+ sx: {
1030
+ display: "flex",
1031
+ alignItems: "center",
1032
+ gap: 2,
1033
+ color: "text.secondary"
1034
+ },
1035
+ children: [
1036
+ /* @__PURE__ */ t(Te, { icon: /* @__PURE__ */ t(He, { src: v.avatar, did: b, size: 20, variant: "circle" }), children: v.fullName }),
1037
+ /* @__PURE__ */ t(Te, { icon: /* @__PURE__ */ t(M, { icon: Bt }), title: `${C.downloads + x}`, children: ur(C.downloads + x) })
1038
+ ]
1039
+ }
1040
+ );
931
1041
  }
932
- function I(p) {
1042
+ function S(u) {
933
1043
  return /* @__PURE__ */ t(
934
- ie,
1044
+ ne,
935
1045
  {
936
1046
  variant: "outlined",
937
1047
  size: "small",
938
- onClick: () => r.handleSearchSelect(p),
1048
+ onClick: () => r.handleSearchSelect(u),
939
1049
  sx: {
940
1050
  width: "fit-content",
941
1051
  textTransform: "none",
@@ -948,66 +1058,108 @@ function ur() {
948
1058
  );
949
1059
  }
950
1060
  }
951
- const pr = (e) => Number.isNaN(e) ? 0 : e < 1e3 ? e : e < 1e6 ? `${(e / 1e3).toFixed(1)}k` : e < 1e9 ? `${(e / 1e6).toFixed(1)}m` : `${(e / 1e9).toFixed(1)}b`, mr = (e, r) => e && r ? `/assets/${e}/screenshots/${r}` : "";
952
- function fr({ url: e }) {
953
- const [r, o] = E(!0);
954
- return /* @__PURE__ */ u(F, { children: [
1061
+ const ur = (e) => Number.isNaN(e) ? 0 : e < 1e3 ? e : e < 1e6 ? `${(e / 1e3).toFixed(1)}k` : e < 1e9 ? `${(e / 1e6).toFixed(1)}m` : `${(e / 1e9).toFixed(1)}b`, hr = (e, r) => e && r ? `/assets/${e}/screenshots/${r}` : "";
1062
+ function pr({ url: e }) {
1063
+ const [r, o] = T(!0);
1064
+ return /* @__PURE__ */ p(_, { children: [
955
1065
  r && /* @__PURE__ */ t(
956
- _,
1066
+ L,
957
1067
  {
958
1068
  variant: "rectangular",
959
1069
  sx: {
960
- width: { xs: "100%", md: oe },
1070
+ width: { xs: "100%", md: re },
961
1071
  height: { xs: "auto", md: xe }
962
1072
  }
963
1073
  }
964
1074
  ),
965
1075
  /* @__PURE__ */ t(
966
- w,
1076
+ g,
967
1077
  {
968
- display: r ? "none" : "block",
969
1078
  component: "img",
970
1079
  src: e,
971
1080
  alt: "",
972
- width: { xs: "100%", md: oe },
973
- height: { xs: "auto", md: xe },
974
- borderRadius: 2,
975
- border: 1,
976
- borderColor: "divider",
977
- sx: { objectFit: "container", cursor: "pointer", aspectRatio: hr },
978
1081
  onLoad: () => o(!1),
979
- onError: () => o(!1)
1082
+ onError: () => o(!1),
1083
+ sx: {
1084
+ display: r ? "none" : "block",
1085
+ width: { xs: "100%", md: re },
1086
+ height: { xs: "auto", md: xe },
1087
+ borderRadius: 2,
1088
+ border: 1,
1089
+ borderColor: "divider",
1090
+ objectFit: "container",
1091
+ cursor: "pointer",
1092
+ aspectRatio: cr
1093
+ }
980
1094
  }
981
1095
  )
982
1096
  ] });
983
1097
  }
984
- function gr({ title: e, blocklets: r }) {
985
- const { blockletRender: o, serverVersion: n } = R();
986
- return /* @__PURE__ */ u(w, { mt: 3, children: [
987
- /* @__PURE__ */ t(v, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
988
- /* @__PURE__ */ t(Re, { container: !0, spacing: 2, boxSizing: "border-box", maxWidth: "calc(100vw - 16px)", children: r.map((i) => /* @__PURE__ */ t(Re, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": i.did, children: /* @__PURE__ */ t(w, { padding: "1px", children: o({ blocklet: i, blocklets: r, serverVersion: n }) }) }, i.did)) })
989
- ] });
1098
+ function mr({ title: e, blocklets: r }) {
1099
+ const { blockletRender: o, serverVersion: n } = I();
1100
+ return /* @__PURE__ */ p(
1101
+ g,
1102
+ {
1103
+ sx: {
1104
+ mt: 3
1105
+ },
1106
+ children: [
1107
+ /* @__PURE__ */ t(k, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
1108
+ /* @__PURE__ */ t(
1109
+ Be,
1110
+ {
1111
+ container: !0,
1112
+ spacing: 2,
1113
+ sx: {
1114
+ boxSizing: "border-box",
1115
+ maxWidth: "calc(100vw - 16px)"
1116
+ },
1117
+ children: r.map((i) => /* @__PURE__ */ t(
1118
+ Be,
1119
+ {
1120
+ "data-blocklet-did": i.did,
1121
+ sx: {
1122
+ p: "2px"
1123
+ },
1124
+ size: {
1125
+ xs: 12,
1126
+ md: 6
1127
+ },
1128
+ children: /* @__PURE__ */ t(
1129
+ g,
1130
+ {
1131
+ sx: {
1132
+ padding: "1px"
1133
+ },
1134
+ children: o({ blocklet: i, blocklets: r, serverVersion: n })
1135
+ }
1136
+ )
1137
+ },
1138
+ i.did
1139
+ ))
1140
+ }
1141
+ )
1142
+ ]
1143
+ }
1144
+ );
990
1145
  }
991
- function yr() {
992
- const { get: e } = Se(), { t: r } = R(), {
1146
+ function fr() {
1147
+ const { get: e } = Ce(), { t: r } = I(), {
993
1148
  data: o = [],
994
1149
  error: n,
995
1150
  loading: i
996
- } = ne(async () => {
1151
+ } = oe(async () => {
997
1152
  const a = await e(P.explorePath);
998
1153
  return Array.isArray(a) ? a : [];
999
1154
  });
1000
- return n ? /* @__PURE__ */ t(be, { error: new Error(`Failed to fetch blocklets from ${P.explorePath}`) }) : i ? /* @__PURE__ */ t(Je, { mt: 15 }) : /* @__PURE__ */ u(F, { children: [
1001
- /* @__PURE__ */ t(ur, {}),
1155
+ return n ? /* @__PURE__ */ t(we, { error: new Error(`Failed to fetch blocklets from ${P.explorePath}`) }) : i ? /* @__PURE__ */ t(Je, { mt: 15 }) : /* @__PURE__ */ p(_, { children: [
1156
+ /* @__PURE__ */ t(dr, {}),
1002
1157
  o.map(
1003
- (a) => {
1004
- var s;
1005
- return ((s = a.blocklets) == null ? void 0 : s.length) > 0 ? /* @__PURE__ */ t(gr, { title: r(`explore.${a.type}`), blocklets: a.blocklets }, a.type) : null;
1006
- }
1158
+ (a) => a.blocklets?.length > 0 ? /* @__PURE__ */ t(mr, { title: r(`explore.${a.type}`), blocklets: a.blocklets }, a.type) : null
1007
1159
  )
1008
1160
  ] });
1009
1161
  }
1010
- const ue = "__FREE_TEXT__", Ee = "__NO_RESULT__", pe = 40;
1162
+ const ue = "__FREE_TEXT__", Ae = "__NO_RESULT__", he = 40;
1011
1163
  function et({
1012
1164
  endpoint: e,
1013
1165
  t: r,
@@ -1017,97 +1169,106 @@ function et({
1017
1169
  handleSearchSelect: a,
1018
1170
  ...s
1019
1171
  }) {
1020
- const l = re(null), m = re(!1), [c, f] = E(!1), [d, g] = E(""), [y, I] = E(!1), x = Se(), [B, p] = E(!1), C = (s == null ? void 0 : s.placeholder) || r("common.searchStore"), b = async (h) => {
1021
- p(!0);
1022
- const S = await x.get(Ie(e, ke(P.blockletsPath, h)));
1023
- return p(!1), S.dataList || [];
1024
- }, { data: k, run: A } = ne(
1025
- (h) => h ? b({
1172
+ const l = te(null), m = te(!1), [h, f] = T(!1), [d, w] = T(""), [y, S] = T(!1), u = Ce(), [x, b] = T(!1), v = s?.placeholder || r("common.searchStore"), C = async (c) => {
1173
+ b(!0);
1174
+ const B = await u.get(Se(e, be(P.blockletsPath, c)));
1175
+ return b(!1), B.dataList || [];
1176
+ }, { data: E, run: V } = oe(
1177
+ (c) => c ? C({
1026
1178
  sortBy: P.nameDesc,
1027
1179
  page: 1,
1028
1180
  pageSize: 10,
1029
- keyword: h,
1181
+ keyword: c,
1030
1182
  showResources: "true"
1031
1183
  }) : Promise.resolve([]),
1032
1184
  {
1033
1185
  manual: !0
1034
1186
  }
1035
1187
  );
1036
- q(() => {
1037
- p(!0), A(n.keyword), g(n.keyword || "");
1038
- }, [n.keyword, A]), Nt(
1188
+ U(() => {
1189
+ b(!0), V(n.keyword), w(n.keyword || "");
1190
+ }, [n.keyword, V]), Ft(
1039
1191
  "ctrl + k, command + k",
1040
- (h) => {
1041
- var S, W;
1042
- return h.stopPropagation(), h.preventDefault(), (W = (S = l.current) == null ? void 0 : S.querySelector("input")) == null || W.focus(), !1;
1043
- },
1192
+ (c) => (c.stopPropagation(), c.preventDefault(), l.current?.querySelector("input")?.focus(), !1),
1044
1193
  { enableOnTags: ["INPUT"] }
1045
1194
  );
1046
- const N = Ne((h) => A(h), { wait: 300 }), j = { name: ue, title: d, did: "" };
1047
- let D = [];
1048
- return d && (B ? D = [j] : k != null && k.length ? D = [j, ...k] : D = [{ name: Ee, title: r("blocklet.noResults"), did: "" }]), /* @__PURE__ */ u(F, { children: [
1049
- /* @__PURE__ */ u(zt, { fullScreen: !0, open: y, sx: { display: { md: "none" } }, children: [
1050
- /* @__PURE__ */ u(w, { p: 2, pb: 0, display: "flex", alignItems: "center", gap: 2, children: [
1051
- /* @__PURE__ */ t(
1052
- Ue,
1053
- {
1054
- fullWidth: !0,
1055
- sx: {
1056
- bgcolor: "grey.50",
1057
- px: 1,
1058
- py: 0.5,
1059
- ".MuiInputBase-input": { p: 1 },
1060
- ".MuiOutlinedInput-notchedOutline": {
1061
- borderRadius: "8px",
1062
- borderColor: "transparent"
1063
- },
1064
- "&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline": {
1065
- borderColor: "divider",
1066
- borderWidth: "1px"
1195
+ const X = Ne((c) => V(c), { wait: 300 }), D = { name: ue, title: d, did: "" };
1196
+ let F = [];
1197
+ return d && (x ? F = [D] : E?.length ? F = [D, ...E] : F = [{ name: Ae, title: r("blocklet.noResults"), did: "" }]), /* @__PURE__ */ p(_, { children: [
1198
+ /* @__PURE__ */ p(zt, { fullScreen: !0, open: y, sx: { display: { md: "none" } }, children: [
1199
+ /* @__PURE__ */ p(
1200
+ g,
1201
+ {
1202
+ sx: {
1203
+ p: 2,
1204
+ pb: 0,
1205
+ display: "flex",
1206
+ alignItems: "center",
1207
+ gap: 2
1208
+ },
1209
+ children: [
1210
+ /* @__PURE__ */ t(
1211
+ Ue,
1212
+ {
1213
+ fullWidth: !0,
1214
+ sx: {
1215
+ bgcolor: "grey.50",
1216
+ px: 1,
1217
+ py: 0.5,
1218
+ ".MuiInputBase-input": { p: 1 },
1219
+ ".MuiOutlinedInput-notchedOutline": {
1220
+ borderRadius: "8px",
1221
+ borderColor: "transparent"
1222
+ },
1223
+ "&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline": {
1224
+ borderColor: "divider",
1225
+ borderWidth: "1px"
1226
+ }
1227
+ },
1228
+ autoFocus: !0,
1229
+ placeholder: v,
1230
+ className: "bl-autocomplete-input",
1231
+ value: d,
1232
+ onChange: (c) => G(c.target.value),
1233
+ startAdornment: $(y),
1234
+ endAdornment: q()
1067
1235
  }
1068
- },
1069
- autoFocus: !0,
1070
- placeholder: C,
1071
- className: "bl-autocomplete-input",
1072
- value: d,
1073
- onChange: (h) => K(h.target.value),
1074
- startAdornment: U(y),
1075
- endAdornment: X()
1076
- }
1077
- ),
1078
- /* @__PURE__ */ t(
1079
- ie,
1080
- {
1081
- variant: "outlined",
1082
- onClick: () => {
1083
- I(!1), g(n.keyword || "");
1084
- },
1085
- children: r("common.cancel")
1086
- }
1087
- )
1088
- ] }),
1089
- /* @__PURE__ */ t(je, { sx: { p: 0.5 }, children: D.map((h) => Y(h)) })
1236
+ ),
1237
+ /* @__PURE__ */ t(
1238
+ ne,
1239
+ {
1240
+ variant: "outlined",
1241
+ onClick: () => {
1242
+ S(!1), w(n.keyword || "");
1243
+ },
1244
+ children: r("common.cancel")
1245
+ }
1246
+ )
1247
+ ]
1248
+ }
1249
+ ),
1250
+ /* @__PURE__ */ t(je, { sx: { p: 0.5 }, children: F.map((c) => Q(c)) })
1090
1251
  ] }),
1091
- /* @__PURE__ */ t(w, { sx: { display: { sx: "block", md: "none" }, paddingTop: 1, opacity: 0.5 }, children: /* @__PURE__ */ t(M, { icon: ce, style: { fontSize: 22, color: "inherit" }, onClick: () => I(!0) }) }),
1252
+ /* @__PURE__ */ t(g, { sx: { display: { sx: "block", md: "none" }, paddingTop: 1, opacity: 0.5 }, children: /* @__PURE__ */ t(M, { icon: se, style: { fontSize: 22, color: "inherit" }, onClick: () => S(!0) }) }),
1092
1253
  /* @__PURE__ */ t(
1093
1254
  Mt,
1094
1255
  {
1095
1256
  ref: l,
1096
- open: !!d && c,
1257
+ open: !!d && h,
1097
1258
  size: "small",
1098
1259
  onOpen: () => f(!0),
1099
- onClose: (h, S) => {
1100
- f(!1), S === "selectOption" && !m.current && i(d);
1260
+ onClose: (c, B) => {
1261
+ f(!1), B === "selectOption" && !m.current && i(d);
1101
1262
  },
1102
- onKeyDown: (h) => {
1103
- h.key === "Enter" && !d && H();
1263
+ onKeyDown: (c) => {
1264
+ c.key === "Enter" && !d && W();
1104
1265
  },
1105
1266
  disableClearable: !0,
1106
1267
  inputValue: d,
1107
- onInputChange: (h, S) => K(S),
1108
- isOptionEqualToValue: (h, S) => h.name === S.name,
1109
- getOptionLabel: (h) => h.title,
1110
- getOptionKey: (h) => h.name,
1268
+ onInputChange: (c, B) => G(B),
1269
+ isOptionEqualToValue: (c, B) => c.name === B.name,
1270
+ getOptionLabel: (c) => c.title,
1271
+ getOptionKey: (c) => c.name,
1111
1272
  noOptionsText: r("blocklet.noResults"),
1112
1273
  autoHighlight: !0,
1113
1274
  forcePopupIcon: !1,
@@ -1121,26 +1282,26 @@ function et({
1121
1282
  }
1122
1283
  }
1123
1284
  },
1124
- renderInput: (h) => /* @__PURE__ */ t(
1125
- Ft,
1285
+ renderInput: (c) => /* @__PURE__ */ t(
1286
+ _t,
1126
1287
  {
1127
- ...h,
1288
+ ...c,
1128
1289
  InputProps: {
1129
- ...h.InputProps,
1290
+ ...c.InputProps,
1130
1291
  autoFocus: !0,
1131
- placeholder: C,
1292
+ placeholder: v,
1132
1293
  className: "bl-autocomplete-input",
1133
1294
  value: d,
1134
- startAdornment: U(c),
1135
- endAdornment: X()
1295
+ startAdornment: $(h),
1296
+ endAdornment: q()
1136
1297
  }
1137
1298
  }
1138
1299
  ),
1139
- filterOptions: (h) => h,
1300
+ filterOptions: (c) => c,
1140
1301
  ...s,
1141
- options: D,
1142
- renderOption: (h, S) => Y(S),
1143
- value: j,
1302
+ options: F,
1303
+ renderOption: (c, B) => Q(B),
1304
+ value: D,
1144
1305
  sx: [
1145
1306
  {
1146
1307
  bgcolor: "grey.50",
@@ -1160,95 +1321,116 @@ function et({
1160
1321
  }
1161
1322
  )
1162
1323
  ] });
1163
- function K(h) {
1164
- p(!0), g(h), m.current = !1, N.run(h);
1324
+ function G(c) {
1325
+ b(!0), w(c), m.current = !1, X.run(c);
1165
1326
  }
1166
- function H() {
1167
- I(!1), g(""), K(""), i("");
1327
+ function W() {
1328
+ S(!1), w(""), G(""), i("");
1168
1329
  }
1169
- function ae(h) {
1170
- h != null && h.did ? (I(!1), m.current = !0, g(""), a(h)) : h.name === ue && (I(!1), i(d));
1330
+ function le(c) {
1331
+ c?.did ? (S(!1), m.current = !0, w(""), a(c)) : c.name === ue && (S(!1), i(d));
1171
1332
  }
1172
- function Y(h) {
1173
- var S, W;
1174
- return /* @__PURE__ */ u(
1333
+ function Q(c) {
1334
+ return /* @__PURE__ */ p(
1175
1335
  $e,
1176
1336
  {
1177
1337
  sx: { display: "flex", alignItems: "center", gap: 1, p: 1.5, borderRadius: "8px" },
1178
- onClick: () => ae(h),
1338
+ onClick: () => le(c),
1179
1339
  children: [
1180
- Z(h),
1181
- /* @__PURE__ */ u(v, { variant: "body1", children: [
1182
- /* @__PURE__ */ t(v, { fontWeight: "fontWeightMedium", display: "flex", alignItems: "center", gap: 1, children: h.title }),
1183
- /* @__PURE__ */ t(v, { sx: { color: "text.hint" }, fontSize: "13px", children: ((W = (S = h.category) == null ? void 0 : S.locales) == null ? void 0 : W[o || "en"]) || "" })
1340
+ Y(c),
1341
+ /* @__PURE__ */ p(k, { variant: "body1", children: [
1342
+ /* @__PURE__ */ t(
1343
+ k,
1344
+ {
1345
+ sx: {
1346
+ fontWeight: "fontWeightMedium",
1347
+ display: "flex",
1348
+ alignItems: "center",
1349
+ gap: 1
1350
+ },
1351
+ children: c.title
1352
+ }
1353
+ ),
1354
+ /* @__PURE__ */ t(
1355
+ k,
1356
+ {
1357
+ sx: {
1358
+ fontSize: "13px",
1359
+ color: "text.hint"
1360
+ },
1361
+ children: c.category?.locales?.[o || "en"] || ""
1362
+ }
1363
+ )
1184
1364
  ] })
1185
1365
  ]
1186
1366
  },
1187
- h.did
1367
+ c.did
1188
1368
  );
1189
1369
  }
1190
- function Z(h) {
1191
- if ([ue, Ee].includes(h.name))
1370
+ function Y(c) {
1371
+ if ([ue, Ae].includes(c.name))
1192
1372
  return /* @__PURE__ */ t(
1193
- w,
1373
+ g,
1194
1374
  {
1195
- width: pe,
1196
- p: "6px",
1197
- display: "flex",
1198
- justifyContent: "center",
1199
- alignItems: "center",
1200
- color: "text.hint",
1201
- bgcolor: "grey.100",
1202
- borderRadius: "8px",
1203
- children: /* @__PURE__ */ t(M, { icon: ce, style: { fontSize: 28 } })
1375
+ sx: {
1376
+ width: he,
1377
+ p: "6px",
1378
+ display: "flex",
1379
+ justifyContent: "center",
1380
+ alignItems: "center",
1381
+ color: "text.hint",
1382
+ bgcolor: "grey.100",
1383
+ borderRadius: "8px"
1384
+ },
1385
+ children: /* @__PURE__ */ t(M, { icon: se, style: { fontSize: 28 } })
1204
1386
  }
1205
1387
  );
1206
- let S = "";
1207
- return h.logo && (S = Ie(e, "assets", h.did, qe(h.logo, pe, h.version))), /* @__PURE__ */ t(He, { src: S, size: pe, style: { borderRadius: "8px", overflow: "hidden" } });
1388
+ let B = "";
1389
+ return c.logo && (B = Se(e, "assets", c.did, qe(c.logo, he, c.version))), /* @__PURE__ */ t(He, { src: B, size: he, style: { borderRadius: "8px", overflow: "hidden" } });
1208
1390
  }
1209
- function U(h = !0) {
1210
- return /* @__PURE__ */ t(w, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.hint" }, children: h && d && B ? /* @__PURE__ */ t(le, { color: "inherit", size: 16 }) : /* @__PURE__ */ t(M, { icon: ce, style: { fontSize: 16, cursor: "default" } }) });
1391
+ function $(c = !0) {
1392
+ return /* @__PURE__ */ t(g, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.hint" }, children: c && d && x ? /* @__PURE__ */ t(ie, { color: "inherit", size: 16 }) : /* @__PURE__ */ t(M, { icon: se, style: { fontSize: 16, cursor: "default" } }) });
1211
1393
  }
1212
- function X() {
1213
- return d ? /* @__PURE__ */ t(w, { sx: { display: "flex", alignItems: "center", color: "text.hint" }, children: /* @__PURE__ */ t(
1394
+ function q() {
1395
+ return d ? /* @__PURE__ */ t(g, { sx: { display: "flex", alignItems: "center", color: "text.hint" }, children: /* @__PURE__ */ t(
1214
1396
  M,
1215
1397
  {
1216
- icon: _t,
1398
+ icon: Lt,
1217
1399
  style: { fontSize: 20, cursor: "pointer", color: "inherit" },
1218
- onClick: () => H()
1400
+ onClick: () => W()
1219
1401
  }
1220
1402
  ) }) : null;
1221
1403
  }
1222
1404
  }
1223
- function xr({ placeholder: e, ...r }) {
1224
- const { search: o, t: n } = R(), { filters: i, handleKeyword: a } = o, [s, l] = E(i.keyword || ""), m = Ne(a, { wait: 300 }), c = (g) => {
1225
- const { value: y } = g.target;
1405
+ function gr({ placeholder: e, ...r }) {
1406
+ const { search: o, t: n } = I(), { filters: i, handleKeyword: a } = o, [s, l] = T(i.keyword || ""), m = Ne(a, { wait: 300 }), h = (w) => {
1407
+ const { value: y } = w.target;
1226
1408
  l(y), m.run(y);
1227
1409
  }, f = () => {
1228
1410
  l(""), a("");
1229
1411
  };
1230
- q(() => {
1412
+ U(() => {
1231
1413
  l(i.keyword || "");
1232
1414
  }, [i.keyword]);
1233
1415
  const d = e || n("common.searchPlaceholder");
1234
1416
  return /* @__PURE__ */ t(
1235
- wr,
1417
+ xr,
1236
1418
  {
1237
1419
  inputProps: {
1238
1420
  "data-cy": "search-blocklet"
1239
1421
  },
1240
- startAdornment: /* @__PURE__ */ t(Pe, { position: "start", children: /* @__PURE__ */ t(br, { sx: { fontSize: 18, ml: -0.5 } }) }),
1241
- onChange: c,
1422
+ startAdornment: /* @__PURE__ */ t(Pe, { position: "start", children: /* @__PURE__ */ t(yr, { sx: { fontSize: 18, ml: -0.5 } }) }),
1423
+ onChange: h,
1242
1424
  placeholder: d,
1243
1425
  value: s,
1244
1426
  title: d,
1245
1427
  "data-cy": "search",
1246
- endAdornment: s && /* @__PURE__ */ t(Pe, { position: "end", children: /* @__PURE__ */ t(kr, { "data-cy": "search-delete", onClick: f }) }),
1428
+ endAdornment: s && /* @__PURE__ */ t(Pe, { position: "end", children: /* @__PURE__ */ t(wr, { "data-cy": "search-delete", onClick: f }) }),
1247
1429
  ...r
1248
1430
  }
1249
1431
  );
1250
1432
  }
1251
- const wr = Q(Ue)`
1433
+ const xr = K(Ue)`
1252
1434
  background-color: ${(e) => e.theme.palette.grey[50]};
1253
1435
  font-size: 14px;
1254
1436
  border-radius: 6px;
@@ -1265,15 +1447,14 @@ const wr = Q(Ue)`
1265
1447
  color: transparent;
1266
1448
  }
1267
1449
  }
1268
- `, br = Q(Dt)`
1450
+ `, yr = K(Nt)`
1269
1451
  color: ${(e) => e.theme.palette.grey[500]};
1270
- `, kr = Q(ze)`
1452
+ `, wr = K(_e)`
1271
1453
  color: ${(e) => e.theme.palette.grey[500]};
1272
1454
  font-size: 16px;
1273
1455
  cursor: pointer;
1274
1456
  `;
1275
- function vr() {
1276
- var b;
1457
+ function br() {
1277
1458
  const {
1278
1459
  search: e,
1279
1460
  t: r,
@@ -1284,103 +1465,125 @@ function vr() {
1284
1465
  showResourcesSwitch: s,
1285
1466
  layout: l,
1286
1467
  baseSearch: m,
1287
- categoryOptions: c,
1468
+ categoryOptions: h,
1288
1469
  compact: f
1289
- } = R(), { filters: d, handleSort: g, handlePrice: y, handleDeveloper: I, handleSwitchShowResources: x, cleanFilter: B, handleCategory: p } = e, C = Ge(r);
1290
- return /* @__PURE__ */ u(
1291
- O,
1470
+ } = I(), { filters: d, handleSort: w, handlePrice: y, handleDeveloper: S, handleSwitchShowResources: u, cleanFilter: x, handleCategory: b } = e, v = Ge(r);
1471
+ return /* @__PURE__ */ p(
1472
+ A,
1292
1473
  {
1293
- position: "sticky",
1294
- top: 0,
1295
- zIndex: 1e3,
1296
1474
  className: "filter-bar",
1297
1475
  direction: { xs: "column", md: "row" },
1298
- alignItems: { xs: "flex-start", md: "center" },
1299
- justifyContent: "space-between",
1300
- gap: 2,
1301
1476
  spacing: { xs: 1, md: 0 },
1302
- pt: { xs: 2, md: 0 },
1303
- px: 0,
1304
- pb: f ? 2 : 3,
1305
- sx: { backgroundColor: "background.default" },
1477
+ sx: {
1478
+ position: "sticky",
1479
+ top: 0,
1480
+ zIndex: 1e3,
1481
+ alignItems: { xs: "flex-start", md: "center" },
1482
+ justifyContent: "space-between",
1483
+ gap: 2,
1484
+ pt: { xs: 2, md: 0 },
1485
+ px: 0,
1486
+ pb: f ? 2 : 3,
1487
+ backgroundColor: "background.default"
1488
+ },
1306
1489
  children: [
1307
- !f && /* @__PURE__ */ t(v, { variant: "h2", textTransform: "capitalize", children: i(d.category) }),
1308
- /* @__PURE__ */ u(
1309
- O,
1490
+ !f && /* @__PURE__ */ t(
1491
+ k,
1492
+ {
1493
+ variant: "h2",
1494
+ sx: {
1495
+ textTransform: "capitalize"
1496
+ },
1497
+ children: i(d.category)
1498
+ }
1499
+ ),
1500
+ /* @__PURE__ */ p(
1501
+ A,
1310
1502
  {
1311
- flex: 1,
1312
1503
  direction: "row",
1313
- alignItems: "center",
1314
- flexWrap: { xs: "wrap", md: "nowrap" },
1315
- width: "100%",
1316
- justifyContent: { xs: "flex-start", md: "flex-end" },
1317
- gap: 2,
1504
+ sx: {
1505
+ flex: 1,
1506
+ alignItems: "center",
1507
+ flexWrap: { xs: "wrap", md: "nowrap" },
1508
+ width: "100%",
1509
+ justifyContent: { xs: "flex-start", md: "flex-end" },
1510
+ gap: 2
1511
+ },
1318
1512
  children: [
1319
- l.showSearch ? /* @__PURE__ */ t(w, { flex: 1, flexBasis: { xs: "100%", md: "auto" }, children: m ? /* @__PURE__ */ t(xr, {}) : /* @__PURE__ */ t(
1320
- et,
1513
+ l.showSearch ? /* @__PURE__ */ t(
1514
+ g,
1321
1515
  {
1322
- locale: n,
1323
- endpoint: o,
1324
1516
  sx: {
1325
- display: { md: "block", xs: "none" },
1326
1517
  flex: 1,
1327
- mr: 1,
1328
- width: "350px"
1518
+ flexBasis: { xs: "100%", md: "auto" }
1329
1519
  },
1330
- t: r,
1331
- filters: e.filters,
1332
- handleKeyword: e.handleKeyword,
1333
- handleSearchSelect: e.handleSearchSelect
1520
+ children: m ? /* @__PURE__ */ t(gr, {}) : /* @__PURE__ */ t(
1521
+ et,
1522
+ {
1523
+ locale: n,
1524
+ endpoint: o,
1525
+ sx: {
1526
+ display: { md: "block", xs: "none" },
1527
+ flex: 1,
1528
+ mr: 1,
1529
+ width: "350px"
1530
+ },
1531
+ t: r,
1532
+ filters: e.filters,
1533
+ handleKeyword: e.handleKeyword,
1534
+ handleSearchSelect: e.handleSearchSelect
1535
+ }
1536
+ )
1334
1537
  }
1335
- ) }) : null,
1538
+ ) : null,
1336
1539
  d.owner && a && /* @__PURE__ */ t(
1337
- Te,
1540
+ Re,
1338
1541
  {
1339
1542
  label: r("blocklet.authorTag", { name: a }),
1340
1543
  size: "small",
1341
- onDelete: () => I("")
1544
+ onDelete: () => S("")
1342
1545
  }
1343
1546
  ),
1344
1547
  d.resourceDid && d.resourceBlocklet && /* @__PURE__ */ t(
1345
- Te,
1548
+ Re,
1346
1549
  {
1347
1550
  label: r("blocklet.resourceTag", { name: d.resourceBlocklet }),
1348
1551
  size: "small",
1349
- onDelete: () => B(["resourceDid", "resourceBlocklet", "showResources"])
1552
+ onDelete: () => x(["resourceDid", "resourceBlocklet", "showResources"])
1350
1553
  }
1351
1554
  ),
1352
1555
  s ? /* @__PURE__ */ t(
1353
- Oe,
1556
+ Ee,
1354
1557
  {
1355
1558
  checked: d.showResources !== "false",
1356
- onChange: (k) => x(k ? "true" : "false"),
1559
+ onChange: (C) => u(C ? "true" : "false"),
1357
1560
  label: r("common.showResources")
1358
1561
  }
1359
1562
  ) : null,
1360
1563
  /* @__PURE__ */ t(
1361
- Oe,
1564
+ Ee,
1362
1565
  {
1363
1566
  checked: d.price === "free",
1364
- onChange: (k) => y(k ? "free" : ""),
1567
+ onChange: (C) => y(C ? "free" : ""),
1365
1568
  label: r("blocklet.free")
1366
1569
  }
1367
1570
  ),
1368
- f && /* @__PURE__ */ t(w, { children: /* @__PURE__ */ t(
1369
- ye,
1571
+ f && /* @__PURE__ */ t(g, { children: /* @__PURE__ */ t(
1572
+ ge,
1370
1573
  {
1371
- value: d.category || ((b = c[0]) == null ? void 0 : b.value),
1372
- options: c,
1574
+ value: d.category || h[0]?.value,
1575
+ options: h,
1373
1576
  placeholder: r("common.category"),
1374
- onChange: (k) => p(k)
1577
+ onChange: (C) => b(C)
1375
1578
  }
1376
1579
  ) }),
1377
1580
  /* @__PURE__ */ t(
1378
- ye,
1581
+ ge,
1379
1582
  {
1380
- value: d.sortBy || C[0].value,
1381
- options: C,
1583
+ value: d.sortBy || v[0].value,
1584
+ options: v,
1382
1585
  placeholder: r("sort.sort"),
1383
- onChange: (k) => g(k)
1586
+ onChange: (C) => w(C)
1384
1587
  }
1385
1588
  )
1386
1589
  ]
@@ -1390,12 +1593,12 @@ function vr() {
1390
1593
  }
1391
1594
  );
1392
1595
  }
1393
- function Oe({
1596
+ function Ee({
1394
1597
  checked: e,
1395
1598
  onChange: r,
1396
1599
  label: o
1397
1600
  }) {
1398
- const n = Lt();
1601
+ const n = Le();
1399
1602
  return /* @__PURE__ */ t(
1400
1603
  We,
1401
1604
  {
@@ -1416,90 +1619,123 @@ function Oe({
1416
1619
  }
1417
1620
  );
1418
1621
  }
1419
- function ee({ children: e }) {
1420
- return /* @__PURE__ */ u(w, { display: "flex", mt: 2, flexDirection: "column", alignItems: "center", justifyContent: "center", color: "text.hint", children: [
1421
- /* @__PURE__ */ t(Wt, {}),
1422
- e
1423
- ] });
1622
+ function J({ children: e }) {
1623
+ return /* @__PURE__ */ p(
1624
+ g,
1625
+ {
1626
+ sx: {
1627
+ display: "flex",
1628
+ mt: 2,
1629
+ flexDirection: "column",
1630
+ alignItems: "center",
1631
+ justifyContent: "center",
1632
+ color: "text.hint"
1633
+ },
1634
+ children: [
1635
+ /* @__PURE__ */ t(Dt, {}),
1636
+ e
1637
+ ]
1638
+ }
1639
+ );
1424
1640
  }
1425
- function Le() {
1426
- const { t: e } = R();
1427
- return /* @__PURE__ */ t(v, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
1641
+ function Oe() {
1642
+ const { t: e } = I();
1643
+ return /* @__PURE__ */ t(k, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
1428
1644
  }
1429
- function me({ filterTip: e, keywordTip: r }) {
1430
- const { t: o, locale: n } = R(), i = () => n === "zh" ? "、" : " , ";
1431
- return /* @__PURE__ */ u(w, { mt: 1, display: "flex", children: [
1432
- /* @__PURE__ */ t(v, { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
1433
- e && /* @__PURE__ */ t(v, { children: o("blocklet.filterTip") }),
1434
- e && r && i(),
1435
- r && /* @__PURE__ */ t(v, { children: o("blocklet.keywordTip") })
1436
- ] });
1645
+ function pe({ filterTip: e = !1, keywordTip: r = !1 }) {
1646
+ const { t: o, locale: n } = I(), i = () => n === "zh" ? "、" : " , ";
1647
+ return /* @__PURE__ */ p(
1648
+ g,
1649
+ {
1650
+ sx: {
1651
+ mt: 1,
1652
+ display: "flex"
1653
+ },
1654
+ children: [
1655
+ /* @__PURE__ */ t(k, { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
1656
+ e && /* @__PURE__ */ t(k, { children: o("blocklet.filterTip") }),
1657
+ e && r && i(),
1658
+ r && /* @__PURE__ */ t(k, { children: o("blocklet.keywordTip") })
1659
+ ]
1660
+ }
1661
+ );
1437
1662
  }
1438
- function fe({
1663
+ function me({
1439
1664
  primaryStart: e,
1440
1665
  primaryEnd: r,
1441
1666
  filter: o
1442
1667
  }) {
1443
- return /* @__PURE__ */ u(v, { variant: "subtitle2", display: "flex", gap: 0.5, mx: 0.5, children: [
1444
- /* @__PURE__ */ t(v, { children: e }),
1445
- /* @__PURE__ */ t(
1446
- v,
1447
- {
1448
- title: o,
1449
- color: "primary",
1450
- sx: { maxWidth: "30vw", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
1451
- children: o
1452
- }
1453
- ),
1454
- /* @__PURE__ */ u(v, { children: [
1455
- r,
1456
- " "
1457
- ] })
1458
- ] });
1668
+ return /* @__PURE__ */ p(
1669
+ k,
1670
+ {
1671
+ variant: "subtitle2",
1672
+ sx: {
1673
+ display: "flex",
1674
+ gap: 0.5,
1675
+ mx: 0.5
1676
+ },
1677
+ children: [
1678
+ /* @__PURE__ */ t(k, { children: e }),
1679
+ /* @__PURE__ */ t(
1680
+ k,
1681
+ {
1682
+ title: o,
1683
+ color: "primary",
1684
+ sx: { maxWidth: "30vw", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
1685
+ children: o
1686
+ }
1687
+ ),
1688
+ /* @__PURE__ */ p(k, { children: [
1689
+ r,
1690
+ " "
1691
+ ] })
1692
+ ]
1693
+ }
1694
+ );
1459
1695
  }
1460
- function Cr() {
1461
- const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } = R(), { filters: i } = r, a = !!n || !!i.price;
1696
+ function kr() {
1697
+ const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } = I(), { filters: i } = r, a = !!n || !!i.price;
1462
1698
  if (i.keyword && a)
1463
- return /* @__PURE__ */ u(ee, { children: [
1699
+ return /* @__PURE__ */ p(J, { children: [
1464
1700
  /* @__PURE__ */ t(
1465
- fe,
1701
+ me,
1466
1702
  {
1467
1703
  primaryStart: e("blocklet.noBlockletPart1"),
1468
1704
  primaryEnd: e("blocklet.noBlockletPart2"),
1469
1705
  filter: i.keyword
1470
1706
  }
1471
1707
  ),
1472
- /* @__PURE__ */ t(me, { keywordTip: !0, filterTip: !0 })
1708
+ /* @__PURE__ */ t(pe, { keywordTip: !0, filterTip: !0 })
1473
1709
  ] });
1474
1710
  if (i.keyword)
1475
- return /* @__PURE__ */ u(ee, { children: [
1711
+ return /* @__PURE__ */ p(J, { children: [
1476
1712
  /* @__PURE__ */ t(
1477
- fe,
1713
+ me,
1478
1714
  {
1479
1715
  primaryStart: e("blocklet.noBlockletPart1"),
1480
1716
  primaryEnd: e("blocklet.noBlockletPart2"),
1481
1717
  filter: i.keyword
1482
1718
  }
1483
1719
  ),
1484
- /* @__PURE__ */ t(me, { keywordTip: !0 })
1720
+ /* @__PURE__ */ t(pe, { keywordTip: !0 })
1485
1721
  ] });
1486
1722
  if (a) {
1487
1723
  const s = o(n);
1488
- return /* @__PURE__ */ u(ee, { children: [
1724
+ return /* @__PURE__ */ p(J, { children: [
1489
1725
  s ? /* @__PURE__ */ t(
1490
- fe,
1726
+ me,
1491
1727
  {
1492
1728
  primaryStart: e("blocklet.noCategoryResults1"),
1493
1729
  primaryEnd: e("blocklet.noCategoryResults2"),
1494
1730
  filter: s
1495
1731
  }
1496
- ) : /* @__PURE__ */ t(Le, {}),
1497
- /* @__PURE__ */ t(me, { filterTip: !0 })
1732
+ ) : /* @__PURE__ */ t(Oe, {}),
1733
+ /* @__PURE__ */ t(pe, { filterTip: !0 })
1498
1734
  ] });
1499
1735
  }
1500
- return /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(Le, {}) });
1736
+ return /* @__PURE__ */ t(J, { children: /* @__PURE__ */ t(Oe, {}) });
1501
1737
  }
1502
- const Sr = (e, r, o, n) => ht(
1738
+ const vr = (e, r, o, n) => ht(
1503
1739
  async (i) => {
1504
1740
  i || (o.currentPage = o.defaultCurrentPage);
1505
1741
  const { currentPage: a, pageSize: s } = o, l = {
@@ -1511,39 +1747,35 @@ const Sr = (e, r, o, n) => ht(
1511
1747
  };
1512
1748
  n(null);
1513
1749
  const { data: m = {} } = await e.get(P.blockletsPath, { params: l });
1514
- return o.currentPage++, { page: a, pageSize: s, list: (m == null ? void 0 : m.dataList) || [], total: (m == null ? void 0 : m.total) || 0 };
1750
+ return o.currentPage++, { page: a, pageSize: s, list: m?.dataList || [], total: m?.total || 0 };
1515
1751
  },
1516
1752
  {
1517
1753
  isNoMore: (i) => i ? i.page * i.pageSize >= i.total : !1,
1518
- reloadDeps: [e, $t(r)],
1754
+ reloadDeps: [e, Wt(r)],
1519
1755
  onError: n
1520
1756
  }
1521
1757
  );
1522
- function Ir() {
1523
- var d;
1524
- const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: i } = R(), { filters: a } = r, s = ut({
1758
+ function Cr() {
1759
+ const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: i } = I(), { filters: a } = r, s = pt({
1525
1760
  currentPage: P.currentPage,
1526
- pageSize: er() ? P.mobilePageSize : P.pageSize,
1761
+ pageSize: Zt() ? P.mobilePageSize : P.pageSize,
1527
1762
  defaultCurrentPage: P.defaultCurrentPage
1528
- }), [l, m] = E(null), c = Sr(e, a, s, m), f = G(
1529
- () => {
1530
- var g, y;
1531
- return o ? o(((g = c.data) == null ? void 0 : g.list) || []) : ((y = c.data) == null ? void 0 : y.list) || [];
1532
- },
1533
- [c.data, o]
1763
+ }), [l, m] = T(null), h = vr(e, a, s, m), f = H(
1764
+ () => o ? o(h.data?.list || []) : h.data?.list || [],
1765
+ [h.data, o]
1534
1766
  );
1535
- return q(() => {
1536
- const g = f.find((y) => y.owner.did === a.owner);
1537
- i((g == null ? void 0 : g.owner.fullName) || (g == null ? void 0 : g.author.name) || "");
1767
+ return U(() => {
1768
+ const d = f.find((w) => w.owner.did === a.owner);
1769
+ i(d?.owner.fullName || d?.author.name || "");
1538
1770
  }, [a.owner, f, i]), {
1539
1771
  blocklets: f,
1540
1772
  fetchBlockletsError: l,
1541
- loadMore: c.loadMore,
1542
- hasNextPage: !c.noMore,
1543
- total: ((d = c.data) == null ? void 0 : d.total) || 0,
1773
+ loadMore: h.loadMore,
1774
+ hasNextPage: !h.noMore,
1775
+ total: h.data?.total || 0,
1544
1776
  loadings: {
1545
- fetchBlockletsLoading: c.loading,
1546
- loadingMore: c.loadingMore
1777
+ fetchBlockletsLoading: h.loading,
1778
+ loadingMore: h.loadingMore
1547
1779
  },
1548
1780
  errors: {
1549
1781
  ...n,
@@ -1551,156 +1783,194 @@ function Ir() {
1551
1783
  }
1552
1784
  };
1553
1785
  }
1554
- function Br() {
1555
- const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: i, minItemWidth: a, layout: s, baseSearch: l, compact: m } = R(), { filters: c } = r, { blocklets: f, errors: d, loadMore: g, loadings: y, hasNextPage: I, total: x } = Ir(), [B] = At({
1786
+ function Sr() {
1787
+ const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: i, minItemWidth: a, layout: s, baseSearch: l, compact: m } = I(), { filters: h } = r, { blocklets: f, errors: d, loadMore: w, loadings: y, hasNextPage: S, total: u } = Cr(), [x] = At({
1556
1788
  loading: y.fetchBlockletsLoading || y.loadingMore,
1557
- hasNextPage: I,
1558
- onLoadMore: g
1789
+ hasNextPage: S,
1790
+ onLoadMore: w
1559
1791
  });
1560
1792
  if (d.fetchBlockletsError) {
1561
- const k = new Error(`Failed to fetch blocklets from ${o}: ${Zt(d.fetchBlockletsError)}`);
1562
- return /* @__PURE__ */ t(be, { error: k });
1793
+ const E = new Error(`Failed to fetch blocklets from ${o}: ${Qt(d.fetchBlockletsError)}`);
1794
+ return /* @__PURE__ */ t(we, { error: E });
1563
1795
  }
1564
- const p = l && s.showSearch || !c.keyword;
1565
- return /* @__PURE__ */ u(F, { children: [
1566
- p ? /* @__PURE__ */ t(vr, {}) : /* @__PURE__ */ u(F, { children: [
1567
- /* @__PURE__ */ t(Ce, { xs: /* @__PURE__ */ t(Ze, {}), md: null }),
1568
- b()
1796
+ const b = l && s.showSearch || !h.keyword;
1797
+ return /* @__PURE__ */ p(_, { children: [
1798
+ b ? /* @__PURE__ */ t(br, {}) : /* @__PURE__ */ p(_, { children: [
1799
+ /* @__PURE__ */ t(ve, { xs: /* @__PURE__ */ t(Ze, {}), md: null }),
1800
+ C()
1569
1801
  ] }),
1570
- C(),
1571
- !y.fetchBlockletsLoading && I && /* @__PURE__ */ t(
1572
- w,
1802
+ v(),
1803
+ !y.fetchBlockletsLoading && S && /* @__PURE__ */ t(
1804
+ g,
1573
1805
  {
1574
- height: 70,
1575
- minHeight: 70,
1576
- display: "flex",
1577
- justifyContent: "center",
1578
- py: 2,
1579
- overflow: "hidden",
1580
- ref: B,
1581
- children: y.loadingMore ? /* @__PURE__ */ t(le, {}) : null
1806
+ ref: x,
1807
+ sx: {
1808
+ height: 70,
1809
+ minHeight: 70,
1810
+ display: "flex",
1811
+ justifyContent: "center",
1812
+ py: 2,
1813
+ overflow: "hidden"
1814
+ },
1815
+ children: y.loadingMore ? /* @__PURE__ */ t(ie, {}) : null
1582
1816
  }
1583
1817
  )
1584
1818
  ] });
1585
- function C() {
1819
+ function v() {
1586
1820
  return y.fetchBlockletsLoading ? /* @__PURE__ */ t(Je, { mt: 15 }) : f.length ? /* @__PURE__ */ t(
1587
- w,
1821
+ g,
1588
1822
  {
1589
1823
  className: "blocklet-list",
1590
- display: "grid",
1591
- gridTemplateColumns: {
1592
- xs: "1fr",
1593
- sm: `repeat(auto-fill, minmax(${a}px, 1fr))`
1824
+ sx: {
1825
+ display: "grid",
1826
+ gridTemplateColumns: {
1827
+ xs: "1fr",
1828
+ sm: `repeat(auto-fill, minmax(${a}px, 1fr))`
1829
+ },
1830
+ p: "2px",
1831
+ rowGap: 2,
1832
+ columnGap: m ? 0 : 2
1594
1833
  },
1595
- p: "2px",
1596
- rowGap: 2,
1597
- columnGap: m ? 0 : 2,
1598
- children: f.map((k) => /* @__PURE__ */ t(
1599
- w,
1834
+ children: f.map((E) => /* @__PURE__ */ t(
1835
+ g,
1600
1836
  {
1601
- "data-blocklet-did": k.did,
1602
- minWidth: {
1603
- xs: "100%",
1604
- sm: a
1837
+ "data-blocklet-did": E.did,
1838
+ sx: {
1839
+ minWidth: {
1840
+ xs: "100%",
1841
+ sm: a
1842
+ },
1843
+ maxWidth: "calc(100vw - 32px)"
1605
1844
  },
1606
- maxWidth: "calc(100vw - 32px)",
1607
- children: n({ blocklet: k, blocklets: f, serverVersion: i })
1845
+ children: n({ blocklet: E, blocklets: f, serverVersion: i })
1608
1846
  },
1609
- k.did
1847
+ E.did
1610
1848
  ))
1611
1849
  }
1612
- ) : /* @__PURE__ */ t(Cr, {});
1850
+ ) : /* @__PURE__ */ t(kr, {});
1613
1851
  }
1614
- function b() {
1615
- return /* @__PURE__ */ u(
1616
- O,
1852
+ function C() {
1853
+ return /* @__PURE__ */ p(
1854
+ A,
1617
1855
  {
1618
1856
  direction: "row",
1619
1857
  className: "search-result-title",
1620
- alignItems: "center",
1621
- justifyContent: "space-between",
1622
- mb: 2,
1623
- mt: { xs: 2, md: 0 },
1858
+ sx: {
1859
+ alignItems: "center",
1860
+ justifyContent: "space-between",
1861
+ mb: 2,
1862
+ mt: { xs: 2, md: 0 }
1863
+ },
1624
1864
  children: [
1625
1865
  /* @__PURE__ */ t(
1626
- v,
1866
+ k,
1627
1867
  {
1628
1868
  variant: "h3",
1629
- title: c.keyword,
1630
- maxWidth: "50vw",
1631
- sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
1632
- children: e("blocklet.search", { keyword: c.keyword })
1869
+ title: h.keyword,
1870
+ sx: {
1871
+ maxWidth: "50vw",
1872
+ overflow: "hidden",
1873
+ textOverflow: "ellipsis",
1874
+ whiteSpace: "nowrap"
1875
+ },
1876
+ children: e("blocklet.search", { keyword: h.keyword })
1633
1877
  }
1634
1878
  ),
1635
- /* @__PURE__ */ t(v, { variant: "body1", color: "text.hint", fontSize: 13, children: e("blocklet.resultCount", { count: x }) })
1879
+ /* @__PURE__ */ t(
1880
+ k,
1881
+ {
1882
+ variant: "body1",
1883
+ sx: {
1884
+ color: "text.hint",
1885
+ fontSize: 13
1886
+ },
1887
+ children: e("blocklet.resultCount", { count: u })
1888
+ }
1889
+ )
1636
1890
  ]
1637
1891
  }
1638
1892
  );
1639
1893
  }
1640
1894
  }
1641
- function Rr() {
1642
- var c, f, d;
1643
- const { t: e, selectedCategory: r, getCategoryLocale: o, locale: n, search: i } = R(), { toggleOpen: a } = ve(), l = Ut().arcSphere, m = !!((f = (c = window.blocklet) == null ? void 0 : c.navigation) != null && f.some((g) => g.section === "bottomNavigation"));
1644
- return /* @__PURE__ */ u(te, { display: "flex", alignItems: "center", justifyContent: "space-between", children: [
1645
- /* @__PURE__ */ u(
1646
- v,
1647
- {
1648
- variant: "body1",
1649
- display: { xs: "flex", md: "none" },
1895
+ function Ir() {
1896
+ const { t: e, selectedCategory: r, getCategoryLocale: o, locale: n, search: i } = I(), { toggleOpen: a } = ke(), l = jt().arcSphere, m = !!window.blocklet?.navigation?.some((h) => h.section === "bottomNavigation");
1897
+ return /* @__PURE__ */ p(
1898
+ ee,
1899
+ {
1900
+ sx: {
1901
+ display: "flex",
1650
1902
  alignItems: "center",
1651
- gap: 1,
1652
- py: 2,
1653
- fontWeight: "fontWeightMedium",
1654
- children: [
1655
- /* @__PURE__ */ t(Ye, { onClick: () => a(!0), children: /* @__PURE__ */ t(jt, {}) }),
1656
- o(r) || e("common.category")
1657
- ]
1658
- }
1659
- ),
1660
- l && m && /* @__PURE__ */ t(
1661
- et,
1662
- {
1663
- locale: n,
1664
- endpoint: ((d = window.blocklet) == null ? void 0 : d.prefix) || "/",
1665
- sx: { display: { md: "block", xs: "none" }, mr: 1, width: "350px" },
1666
- t: e,
1667
- filters: i.filters,
1668
- handleKeyword: i.handleKeyword,
1669
- handleSearchSelect: i.handleSearchSelect
1670
- }
1671
- )
1672
- ] });
1903
+ justifyContent: "space-between"
1904
+ },
1905
+ children: [
1906
+ /* @__PURE__ */ p(
1907
+ k,
1908
+ {
1909
+ variant: "body1",
1910
+ sx: {
1911
+ display: { xs: "flex", md: "none" },
1912
+ alignItems: "center",
1913
+ gap: 1,
1914
+ py: 2,
1915
+ fontWeight: "fontWeightMedium"
1916
+ },
1917
+ children: [
1918
+ /* @__PURE__ */ t(Ye, { onClick: () => a(!0), children: /* @__PURE__ */ t($t, {}) }),
1919
+ o(r) || e("common.category")
1920
+ ]
1921
+ }
1922
+ ),
1923
+ l && m && /* @__PURE__ */ t(
1924
+ et,
1925
+ {
1926
+ locale: n,
1927
+ endpoint: window.blocklet?.prefix || "/",
1928
+ sx: { display: { md: "block", xs: "none" }, mr: 1, width: "350px" },
1929
+ t: e,
1930
+ filters: i.filters,
1931
+ handleKeyword: i.handleKeyword,
1932
+ handleSearchSelect: i.handleSearchSelect
1933
+ }
1934
+ )
1935
+ ]
1936
+ }
1937
+ );
1673
1938
  }
1674
- function Tr({ menus: e, children: r }) {
1675
- var c;
1676
- const { search: o, layout: n, compact: i } = R(), { filters: a } = o, s = re(null), l = a.category || a.keyword || a.price, m = (c = e == null ? void 0 : e.find((f) => f.key === a.menu)) == null ? void 0 : c.key;
1677
- return /* @__PURE__ */ t(Gt, { children: /* @__PURE__ */ u(ct, { FallbackComponent: be, children: [
1678
- !i && /* @__PURE__ */ t(Rr, {}),
1679
- /* @__PURE__ */ u(
1680
- w,
1939
+ function Br({ menus: e = [], children: r = void 0 }) {
1940
+ const { search: o, layout: n, compact: i } = I(), { filters: a } = o, s = te(null), l = a.category || a.keyword || a.price, m = e.find((h) => h.key === a.menu)?.key;
1941
+ return /* @__PURE__ */ t(Ut, { children: /* @__PURE__ */ p(dt, { FallbackComponent: we, children: [
1942
+ !i && /* @__PURE__ */ t(Ir, {}),
1943
+ /* @__PURE__ */ p(
1944
+ g,
1681
1945
  {
1682
1946
  ref: s,
1683
- display: "flex",
1684
- height: "100%",
1685
1947
  className: "list-container",
1686
- pt: { xs: 0, md: i ? 0 : 5 },
1948
+ sx: {
1949
+ display: "flex",
1950
+ height: "100%",
1951
+ pt: { xs: 0, md: i ? 0 : 5 }
1952
+ },
1687
1953
  children: [
1688
- /* @__PURE__ */ t(dr, { menus: e }),
1689
- /* @__PURE__ */ u(
1690
- O,
1954
+ /* @__PURE__ */ t(sr, { menus: e }),
1955
+ /* @__PURE__ */ p(
1956
+ A,
1691
1957
  {
1692
- height: "100%",
1693
- position: "relative",
1694
- flex: 1,
1695
- sx: i ? {
1696
- overflowY: "auto",
1697
- ml: -2,
1698
- pr: 1,
1699
- pb: 2
1700
- } : { overflow: "visible" },
1958
+ sx: [
1959
+ {
1960
+ height: "100%",
1961
+ position: "relative",
1962
+ flex: 1
1963
+ },
1964
+ i ? {
1965
+ overflowY: "auto",
1966
+ ml: -2,
1967
+ pr: 1,
1968
+ pb: 2
1969
+ } : { overflow: "visible" }
1970
+ ],
1701
1971
  children: [
1702
- m && (r == null ? void 0 : r(m)),
1703
- !m && (n.showExplore && !l ? /* @__PURE__ */ t(yr, {}) : /* @__PURE__ */ t(Br, {}))
1972
+ m && r?.(m),
1973
+ !m && (n.showExplore && !l ? /* @__PURE__ */ t(fr, {}) : /* @__PURE__ */ t(Sr, {}))
1704
1974
  ]
1705
1975
  }
1706
1976
  )
@@ -1709,31 +1979,64 @@ function Tr({ menus: e, children: r }) {
1709
1979
  )
1710
1980
  ] }) });
1711
1981
  }
1712
- function Wo(e) {
1713
- return /* @__PURE__ */ u(Ht, { variant: "outlined", ...e, sx: { maxWidth: 400, borderRadius: "8px", p: { xs: 2, md: 3 }, ...e.sx }, children: [
1714
- /* @__PURE__ */ u(te, { display: "flex", alignItems: "center", gap: 2, pb: 1, children: [
1715
- /* @__PURE__ */ u(te, { display: "flex", alignItems: "center", gap: 2, flex: 1, children: [
1716
- /* @__PURE__ */ t(L, { variant: "rounded", width: 48, height: 48 }),
1717
- /* @__PURE__ */ t(L, { variant: "text", width: 60, height: 28 })
1718
- ] }),
1719
- /* @__PURE__ */ t(L, { variant: "text", width: 70, height: 40 })
1720
- ] }),
1721
- /* @__PURE__ */ t(L, { variant: "text", width: "100%", height: 24 }),
1722
- /* @__PURE__ */ t(L, { variant: "text", width: "90%", height: 24 }),
1723
- /* @__PURE__ */ u(te, { display: "flex", alignItems: "center", gap: 1, pt: 1.5, children: [
1724
- /* @__PURE__ */ t(L, { variant: "rounded", width: 24, height: 24 }),
1725
- /* @__PURE__ */ t(L, { variant: "text", width: "15%", height: 20 }),
1726
- /* @__PURE__ */ t(L, { variant: "rounded", width: 24, height: 24, sx: { ml: 1 } }),
1727
- /* @__PURE__ */ t(L, { variant: "text", width: "15%", height: 20 })
1728
- ] })
1982
+ function Mo(e) {
1983
+ return /* @__PURE__ */ p(rt, { variant: "outlined", ...e, sx: { maxWidth: 400, borderRadius: "8px", p: { xs: 2, md: 3 }, ...e.sx }, children: [
1984
+ /* @__PURE__ */ p(
1985
+ ee,
1986
+ {
1987
+ sx: {
1988
+ display: "flex",
1989
+ alignItems: "center",
1990
+ gap: 2,
1991
+ pb: 1
1992
+ },
1993
+ children: [
1994
+ /* @__PURE__ */ p(
1995
+ ee,
1996
+ {
1997
+ sx: {
1998
+ display: "flex",
1999
+ alignItems: "center",
2000
+ gap: 2,
2001
+ flex: 1
2002
+ },
2003
+ children: [
2004
+ /* @__PURE__ */ t(O, { variant: "rounded", width: 48, height: 48 }),
2005
+ /* @__PURE__ */ t(O, { variant: "text", width: 60, height: 28 })
2006
+ ]
2007
+ }
2008
+ ),
2009
+ /* @__PURE__ */ t(O, { variant: "text", width: 70, height: 40 })
2010
+ ]
2011
+ }
2012
+ ),
2013
+ /* @__PURE__ */ t(O, { variant: "text", width: "100%", height: 24 }),
2014
+ /* @__PURE__ */ t(O, { variant: "text", width: "90%", height: 24 }),
2015
+ /* @__PURE__ */ p(
2016
+ ee,
2017
+ {
2018
+ sx: {
2019
+ display: "flex",
2020
+ alignItems: "center",
2021
+ gap: 1,
2022
+ pt: 1.5
2023
+ },
2024
+ children: [
2025
+ /* @__PURE__ */ t(O, { variant: "rounded", width: 24, height: 24 }),
2026
+ /* @__PURE__ */ t(O, { variant: "text", width: "15%", height: 20 }),
2027
+ /* @__PURE__ */ t(O, { variant: "rounded", width: 24, height: 24, sx: { ml: 1 } }),
2028
+ /* @__PURE__ */ t(O, { variant: "text", width: "15%", height: 20 })
2029
+ ]
2030
+ }
2031
+ )
1729
2032
  ] });
1730
2033
  }
1731
- function $o({ showSkeleton: e, ...r }) {
1732
- return e ? /* @__PURE__ */ t(_, { variant: "rectangular", width: r.width, height: r.height }) : /* @__PURE__ */ t(Vt, { ...r });
2034
+ function zo({ showSkeleton: e = !1, ...r }) {
2035
+ return e ? /* @__PURE__ */ t(L, { variant: "rectangular", width: r.width, height: r.height }) : /* @__PURE__ */ t(Ht, { ...r });
1733
2036
  }
1734
- function jo(e) {
1735
- const { menus: r, children: o, ...n } = e, i = we(), a = tt(
1736
- lt({}, i, {
2037
+ function _o(e) {
2038
+ const { menus: r, children: o, ...n } = e, i = ye(), a = ot(
2039
+ st({}, i, {
1737
2040
  typography: {
1738
2041
  h1: {
1739
2042
  fontSize: 32,
@@ -1760,12 +2063,12 @@ function jo(e) {
1760
2063
  }
1761
2064
  })
1762
2065
  );
1763
- return /* @__PURE__ */ t(rt, { theme: a, children: /* @__PURE__ */ t(ir, { ...n, children: /* @__PURE__ */ t(Tr, { menus: r, children: o }) }) });
2066
+ return /* @__PURE__ */ t(nt, { theme: a, children: /* @__PURE__ */ t(or, { ...n, children: /* @__PURE__ */ t(Br, { menus: r, children: o }) }) });
1764
2067
  }
1765
2068
  export {
1766
2069
  et as Autocomplete,
1767
- Wo as CardSkeleton,
1768
- $o as Image,
1769
- jo as default,
1770
- Kt as useSearch
2070
+ Mo as CardSkeleton,
2071
+ zo as Image,
2072
+ _o as default,
2073
+ Gt as useSearch
1771
2074
  };