@blocklet/list 0.14.10 → 0.14.11

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 (2) hide show
  1. package/lib/index.es.js +417 -405
  2. package/package.json +3 -3
package/lib/index.es.js CHANGED
@@ -1,77 +1,77 @@
1
- import { jsx as t, jsxs as f, Fragment as N } from "react/jsx-runtime";
2
- import { styled as q, useTheme as de } from "@arcblock/ux/lib/Theme";
3
- import Ge from "@mui/material/styles/createTheme";
4
- import Ke from "@mui/material/styles/ThemeProvider";
5
- import Xe from "lodash/merge";
6
- import { ErrorFallback as ue } from "@arcblock/ux/lib/ErrorBoundary";
7
- import w from "@mui/material/Box";
1
+ import { jsx as t, jsxs as m, Fragment as D } from "react/jsx-runtime";
2
+ import { styled as q, useTheme as he } from "@arcblock/ux/lib/Theme";
3
+ import Ke from "@mui/material/styles/createTheme";
4
+ import Xe from "@mui/material/styles/ThemeProvider";
5
+ import Qe from "lodash/merge";
6
+ import { ErrorFallback as pe } from "@arcblock/ux/lib/ErrorBoundary";
7
+ import x from "@mui/material/Box";
8
8
  import T from "@mui/material/Stack";
9
- import { ErrorBoundary as Qe } from "react-error-boundary";
10
- import Ye from "@iconify-icons/tabler/compass";
11
- import { Icon as Be } from "@iconify/react";
12
- import he from "@mui/icons-material/Close";
13
- import x from "@mui/material/Typography";
14
- import { createContext as Re, useState as L, useMemo as $, useContext as Pe, useCallback as ae, useEffect as j, forwardRef as Ze, useRef as ce, memo as Je } from "react";
15
- import { createAxios as Te } from "@blocklet/js-sdk";
16
- import et from "lodash/orderBy";
17
- import { useRequest as Z, useDebounceFn as Ae, useInfiniteScroll as tt, useReactive as rt } from "ahooks";
18
- import re from "lodash/omitBy";
9
+ import { ErrorBoundary as Ye } from "react-error-boundary";
10
+ import Ze from "@iconify-icons/tabler/compass";
11
+ import { Icon as Re } from "@iconify/react";
12
+ import me from "@mui/icons-material/Close";
13
+ import w from "@mui/material/Typography";
14
+ import { createContext as Pe, useState as L, useMemo as j, useContext as Te, useCallback as de, useEffect as H, forwardRef as Je, useRef as ue, memo as et } from "react";
15
+ import { createAxios as Ae } from "@blocklet/js-sdk";
16
+ import tt from "lodash/orderBy";
17
+ import { useRequest as J, useDebounceFn as Fe, useInfiniteScroll as rt, useReactive as ot } from "ahooks";
18
+ import oe from "lodash/omitBy";
19
19
  import "color";
20
20
  import "lodash/cloneDeep";
21
- import { parseURL as ot, parseQuery as nt, parseFilename as lt, stringifyParsedURL as it, withQuery as pe, joinURL as ye } from "ufo";
22
- import xe from "flat";
23
- import J from "@mui/material/Button";
21
+ import { parseURL as nt, parseQuery as lt, parseFilename as it, stringifyParsedURL as at, withQuery as fe, joinURL as we } from "ufo";
22
+ import be from "flat";
23
+ import ee from "@mui/material/Button";
24
24
  import st from "@mui/material/styles/useTheme";
25
- import W from "@mui/material/useMediaQuery";
26
- import at from "@mui/material/Drawer";
27
- import Fe from "@mui/material/Checkbox";
28
- import Le from "@mui/material/FormControlLabel";
29
- import ct from "@mui/icons-material/Check";
30
- import dt from "@mui/icons-material/KeyboardArrowDown";
31
- import ut from "@mui/material/ClickAwayListener";
32
- import ht from "@mui/material/Grow";
33
- import Oe from "@mui/material/MenuItem";
34
- import ze from "@mui/material/MenuList";
35
- import pt from "@mui/material/Paper";
36
- import mt from "@mui/material/Popper";
37
- import ft from "@mui/material/SvgIcon";
38
- import gt from "lodash/isEmpty";
39
- import ee from "@mui/material/CircularProgress";
40
- import _e from "@arcblock/ux/lib/Avatar";
41
- import yt from "@iconify-icons/tabler/cloud-download";
42
- import xt from "@mui/icons-material/ChevronLeft";
43
- import wt from "@mui/icons-material/ChevronRight";
44
- import bt from "react-image-gallery";
45
- import kt from "@arcblock/ux/lib/Img";
46
- import vt from "@mui/material/Skeleton";
25
+ import $ from "@mui/material/useMediaQuery";
26
+ import ct from "@mui/material/Drawer";
27
+ import Le from "@mui/material/Checkbox";
28
+ import Oe from "@mui/material/FormControlLabel";
29
+ import dt from "@mui/icons-material/Check";
30
+ import ut from "@mui/icons-material/KeyboardArrowDown";
31
+ import ht from "@mui/material/ClickAwayListener";
32
+ import pt from "@mui/material/Grow";
33
+ import _e from "@mui/material/MenuItem";
34
+ import Ee from "@mui/material/MenuList";
35
+ import mt from "@mui/material/Paper";
36
+ import ft from "@mui/material/Popper";
37
+ import gt from "@mui/material/SvgIcon";
38
+ import yt from "lodash/isEmpty";
39
+ import te from "@mui/material/CircularProgress";
40
+ import ze from "@arcblock/ux/lib/Avatar";
41
+ import xt from "@iconify-icons/tabler/cloud-download";
42
+ import wt from "@mui/icons-material/ChevronLeft";
43
+ import bt from "@mui/icons-material/ChevronRight";
44
+ import E from "@mui/material/Skeleton";
45
+ import kt from "react-image-gallery";
46
+ import vt from "@arcblock/ux/lib/Img";
47
47
  import "react-image-gallery/styles/css/image-gallery.css";
48
- import we from "@mui/material/Grid";
48
+ import ke from "@mui/material/Grid";
49
49
  import Ct from "react-infinite-scroll-hook";
50
50
  import St from "@mui/material/Chip";
51
- import Y from "@mui/icons-material/Search";
51
+ import Z from "@mui/icons-material/Search";
52
52
  import It from "@mui/icons-material/Verified";
53
53
  import Bt from "@mui/material/Autocomplete";
54
54
  import Rt from "@mui/material/Dialog";
55
- import Ee from "@mui/material/OutlinedInput";
55
+ import Me from "@mui/material/OutlinedInput";
56
56
  import Pt from "@mui/material/TextField";
57
57
  import { useHotkeys as Tt } from "react-hotkeys-hook";
58
- import be from "@mui/material/InputAdornment";
58
+ import ve from "@mui/material/InputAdornment";
59
59
  import At from "@arcblock/ux/lib/Empty";
60
60
  import Ft from "json-stable-stringify";
61
61
  import Lt from "@mui/icons-material/Menu";
62
- const Me = Re({
62
+ const Ne = Pe({
63
63
  open: !1,
64
64
  toggleOpen: (e) => {
65
65
  }
66
66
  });
67
67
  function Ot({ children: e }) {
68
- const [r, o] = L(!1), n = (s) => {
69
- o(s ?? !s);
70
- }, i = $(() => ({ open: r, toggleOpen: n }), [r]);
71
- return /* @__PURE__ */ t(Me.Provider, { value: i, children: e });
68
+ const [r, o] = L(!1), n = (a) => {
69
+ o(a ?? !a);
70
+ }, i = j(() => ({ open: r, toggleOpen: n }), [r]);
71
+ return /* @__PURE__ */ t(Ne.Provider, { value: i, children: e });
72
72
  }
73
- function me() {
74
- return Pe(Me);
73
+ function ge() {
74
+ return Te(Ne);
75
75
  }
76
76
  const P = {
77
77
  nameAsc: "title",
@@ -87,34 +87,34 @@ const P = {
87
87
  explorePath: "/api/blocklets/explore",
88
88
  exploreDidsPath: "/api/blocklets/dids",
89
89
  cacheSize: 100
90
- }, zt = (e) => Z(
90
+ }, _t = (e) => J(
91
91
  async () => {
92
92
  const { data: r } = await e.get(P.categoriesPath);
93
93
  return Array.isArray(r) ? r : [];
94
94
  },
95
95
  { manual: !0 }
96
96
  );
97
- function _t(e, r) {
97
+ function Et(e, r) {
98
98
  const o = { sortBy: "popularity", sortDirection: "desc", ...e }, {
99
99
  onFilterChange: n,
100
100
  onSearchSelect: i = (l) => {
101
101
  r.onFilterChange({ ...o, keyword: l.title });
102
102
  },
103
- emptyCategory: s
103
+ emptyCategory: a
104
104
  } = r;
105
- !o.category && !s && (o.category = "All");
105
+ !o.category && !a && (o.category = "All");
106
106
  const c = (l) => {
107
- const p = { ...o, ...l };
108
- n(re(p, (d) => d === "" || d === void 0));
107
+ const h = { ...o, ...l };
108
+ n(oe(h, (d) => d === "" || d === void 0));
109
109
  };
110
110
  return {
111
111
  filters: e,
112
112
  cleanFilter: (l) => {
113
- const p = l ? re(o, (d, g) => l.includes(g)) : {};
114
- n(re(p, (d) => d === "" || d === void 0));
113
+ const h = l ? oe(o, (d, g) => l.includes(g)) : {};
114
+ n(oe(h, (d) => d === "" || d === void 0));
115
115
  },
116
- handleSort: (l, p) => {
117
- c({ sortBy: l, sortDirection: p || l === "nameAsc" ? "asc" : "desc" });
116
+ handleSort: (l, h) => {
117
+ c({ sortBy: l, sortDirection: h || l === "nameAsc" ? "asc" : "desc" });
118
118
  },
119
119
  handleKeyword: (l) => {
120
120
  c({ category: void 0, keyword: l || void 0 });
@@ -139,7 +139,7 @@ function _t(e, r) {
139
139
  }
140
140
  };
141
141
  }
142
- const Et = (e, r, o) => e && r || !o, Ne = (e) => [
142
+ const zt = (e, r, o) => e && r || !o, De = (e) => [
143
143
  {
144
144
  name: e("sort.popularity"),
145
145
  value: "popularity"
@@ -152,16 +152,16 @@ const Et = (e, r, o) => e && r || !o, Ne = (e) => [
152
152
  // name: t('sort.rating'),
153
153
  // value: 'rating',
154
154
  // },
155
- ], De = (e, r, o) => {
155
+ ], We = (e, r, o) => {
156
156
  var d, g;
157
- const n = ot(e), i = nt(n.search);
158
- if ((d = lt(e, { strict: !0 })) == null ? void 0 : d.endsWith(".gif"))
159
- return i.imageFilter ? it({ ...n, search: "" }) : e;
157
+ const n = nt(e), i = lt(n.search);
158
+ if ((d = it(e, { strict: !0 })) == null ? void 0 : d.endsWith(".gif"))
159
+ return i.imageFilter ? at({ ...n, search: "" }) : e;
160
160
  if (i.imageFilter)
161
161
  return e;
162
- const c = o || ((g = window.blocklet) == null ? void 0 : g.version), { w: l, h: p } = typeof r == "object" ? { w: r.w, h: r.h } : { w: r, h: r };
163
- return pe(e, {
164
- ...l || p ? { imageFilter: "resize", w: l, h: p } : {},
162
+ const c = o || ((g = window.blocklet) == null ? void 0 : g.version), { w: l, h } = typeof r == "object" ? { w: r.w, h: r.h } : { w: r, h: r };
163
+ return fe(e, {
164
+ ...l || h ? { imageFilter: "resize", w: l, h } : {},
165
165
  v: c
166
166
  });
167
167
  }, Mt = (e) => [
@@ -203,7 +203,7 @@ const Et = (e, r, o) => e && r || !o, Ne = (e) => [
203
203
  helperText: "Please select a category"
204
204
  },
205
205
  blocklet: {
206
- noResults: "Not found Blocklet",
206
+ noResults: "No blocklet found.",
207
207
  free: "Free",
208
208
  search: 'Results for "{keyword}"',
209
209
  resultCount: "{count} Blocklets",
@@ -268,16 +268,16 @@ const Et = (e, r, o) => e && r || !o, Ne = (e) => [
268
268
  autocomplete: {
269
269
  expandResult: "查看 “{name}” 的所有搜索结果"
270
270
  }
271
- }, oe = {
272
- en: xe($t),
273
- zh: xe(jt)
274
- }, We = (e, r) => {
271
+ }, ne = {
272
+ en: be($t),
273
+ zh: be(jt)
274
+ }, $e = (e, r) => {
275
275
  const o = {};
276
276
  return e && (o["x-blocklet-server-version"] = e), r && (o["x-blocklet-store-version"] = r), o;
277
- }, Ut = (e) => (r, o) => {
278
- const n = oe[e] ? oe[e][r] : oe.en[r];
277
+ }, Ht = (e) => (r, o) => {
278
+ const n = ne[e] ? ne[e][r] : ne.en[r];
279
279
  return Dt(n, o) || r;
280
- }, $e = {
280
+ }, je = {
281
281
  errors: {
282
282
  fetchCategoriesError: null
283
283
  },
@@ -329,22 +329,22 @@ const Et = (e, r, o) => e && r || !o, Ne = (e) => [
329
329
  handlePage: () => {
330
330
  }
331
331
  }
332
- }, je = Re($e), { Provider: Vt, Consumer: Co } = je;
333
- function Ht(e) {
332
+ }, He = Pe(je), { Provider: Ut, Consumer: Io } = He;
333
+ function Vt(e) {
334
334
  const {
335
335
  locale: r = "zh",
336
336
  filters: o = {},
337
337
  serverVersion: n = "",
338
338
  onFilterChange: i = () => {
339
339
  },
340
- minItemWidth: s = 350,
340
+ minItemWidth: a = 350,
341
341
  queryFilter: c = !0,
342
342
  layout: l = {},
343
- wrapChildren: p = (R) => R,
343
+ wrapChildren: h = (R) => R,
344
344
  extraFilter: d = (R) => R,
345
345
  baseSearch: g = !1,
346
- fetchCategoryDelay: h = 0,
347
- showResourcesSwitch: m = !1,
346
+ fetchCategoryDelay: p = 0,
347
+ showResourcesSwitch: f = !1,
348
348
  showCategory: k = !0,
349
349
  tagFilters: C = [],
350
350
  children: S,
@@ -353,19 +353,19 @@ function Ht(e) {
353
353
  },
354
354
  endpoint: v,
355
355
  blockletRender: y
356
- } = e, A = We(n, B), F = $(() => Te({ baseURL: v, headers: A }), [v]), O = _t(o, { onFilterChange: i, emptyCategory: !l.showExplore, onSearchSelect: u }), [_, U] = L(""), {
356
+ } = e, A = $e(n, B), F = j(() => Ae({ baseURL: v, headers: A }), [v]), O = Et(o, { onFilterChange: i, emptyCategory: !l.showExplore, onSearchSelect: u }), [z, U] = L(""), {
357
357
  data: V = [],
358
- error: te,
359
- loading: G,
360
- run: K
361
- } = zt(F), D = $(() => {
362
- const R = et(V, [(M) => M.name], ["asc"]), z = R.findIndex((M) => M.name === "All" || M.locales.en === "All");
363
- return z > -1 ? [{ ...R[z], _id: "All" }, ...R.slice(0, z), ...R.slice(z + 1)] : R;
364
- }, [V]), H = ae(Ut(r), [r]), a = $(() => Nt(D, r), [D, r]), b = Mt(H), E = {
358
+ error: re,
359
+ loading: K,
360
+ run: X
361
+ } = _t(F), W = j(() => {
362
+ const R = tt(V, [(N) => N.name], ["asc"]), _ = R.findIndex((N) => N.name === "All" || N.locales.en === "All");
363
+ return _ > -1 ? [{ ...R[_], _id: "All" }, ...R.slice(0, _), ...R.slice(_ + 1)] : R;
364
+ }, [V]), G = de(Ht(r), [r]), s = j(() => Nt(W, r), [W, r]), b = Mt(G), M = {
365
365
  search: O,
366
- errors: { fetchCategoriesError: te },
366
+ errors: { fetchCategoriesError: re },
367
367
  loadings: {
368
- fetchCategoriesLoading: G
368
+ fetchCategoriesLoading: K
369
369
  },
370
370
  extraFilter: d,
371
371
  endpoint: v,
@@ -376,41 +376,41 @@ function Ht(e) {
376
376
  showTitle: l.showTitle ?? !0,
377
377
  showSearch: l.showSearch ?? !0
378
378
  },
379
- minItemWidth: s,
380
- wrapChildren: p,
381
- t: H,
379
+ minItemWidth: a,
380
+ wrapChildren: h,
381
+ t: G,
382
382
  storeVersion: B,
383
383
  serverVersion: n,
384
384
  selectedCategory: O.filters.category || (l.showExplore ? "" : "All"),
385
- categoryList: D,
385
+ categoryList: W,
386
386
  blockletRender: y,
387
387
  locale: r,
388
- categoryOptions: a,
388
+ categoryOptions: s,
389
389
  priceOptions: b,
390
390
  storeApi: F,
391
391
  baseSearch: g,
392
- showResourcesSwitch: m,
392
+ showResourcesSwitch: f,
393
393
  showCategory: k,
394
394
  tagFilters: C,
395
395
  onFilterChange: i,
396
396
  getCategoryLocale: (R) => {
397
397
  if (!R)
398
398
  return null;
399
- const z = V.find((M) => M._id === R || M.locales.en === "All");
400
- return z ? z.locales[r] || z.locales.en : null;
399
+ const _ = V.find((N) => N._id === R || N.locales.en === "All");
400
+ return _ ? _.locales[r] || _.locales.en : null;
401
401
  },
402
402
  get developerName() {
403
- return _;
403
+ return z;
404
404
  },
405
405
  updateDeveloperName: U
406
406
  };
407
- return j(() => {
408
- setTimeout(K, h || 0);
409
- }, [v, K, h]), /* @__PURE__ */ t(Vt, { value: E, children: S });
407
+ return H(() => {
408
+ setTimeout(X, p || 0);
409
+ }, [v, X, p]), /* @__PURE__ */ t(Ut, { value: M, children: S });
410
410
  }
411
411
  function I() {
412
- const e = Pe(je);
413
- return e || $e;
412
+ const e = Te(He);
413
+ return e || je;
414
414
  }
415
415
  function Ue({
416
416
  children: e,
@@ -419,7 +419,7 @@ function Ue({
419
419
  ...n
420
420
  }) {
421
421
  return /* @__PURE__ */ t(
422
- J,
422
+ ee,
423
423
  {
424
424
  ...n,
425
425
  onClick: r,
@@ -442,86 +442,86 @@ function Ue({
442
442
  }
443
443
  );
444
444
  }
445
- function X(e, r) {
445
+ function Q(e, r) {
446
446
  return e === void 0 ? r : e;
447
447
  }
448
- function fe({
448
+ function ye({
449
449
  xs: e,
450
450
  sm: r,
451
451
  md: o,
452
452
  lg: n,
453
453
  xl: i,
454
- exact: s
454
+ exact: a
455
455
  }) {
456
- const c = st(), l = W(c.breakpoints.down("sm")), p = W(c.breakpoints.between("sm", "md")), d = W(c.breakpoints.between("md", "lg")), g = W(c.breakpoints.between("lg", "xl"));
457
- if (s)
458
- return l ? e || null : p ? r || null : d ? o || null : g ? n || null : i || null;
459
- let h = e;
460
- return l || (h = X(r, h), p) || (h = X(o, h), d) || (h = X(n, h), g) ? h : X(i, h);
456
+ const c = st(), l = $(c.breakpoints.down("sm")), h = $(c.breakpoints.between("sm", "md")), d = $(c.breakpoints.between("md", "lg")), g = $(c.breakpoints.between("lg", "xl"));
457
+ if (a)
458
+ return l ? e || null : h ? r || null : d ? o || null : g ? n || null : i || null;
459
+ let p = e;
460
+ return l || (p = Q(r, p), h) || (p = Q(o, p), d) || (p = Q(n, p), g) ? p : Q(i, p);
461
461
  }
462
- function qt({ children: e }) {
463
- const { open: r, toggleOpen: o } = me();
462
+ function Gt({ children: e }) {
463
+ const { open: r, toggleOpen: o } = ge();
464
464
  return /* @__PURE__ */ t(
465
- fe,
465
+ ye,
466
466
  {
467
- xs: /* @__PURE__ */ t(at, { open: r, onClose: () => o(!1), children: e }),
468
- md: /* @__PURE__ */ t(w, { children: e })
467
+ xs: /* @__PURE__ */ t(ct, { open: r, onClose: () => o(!1), children: e }),
468
+ md: /* @__PURE__ */ t(x, { children: e })
469
469
  }
470
470
  );
471
471
  }
472
- const Gt = Ze(({ loading: e, disabled: r, ...o }, n) => /* @__PURE__ */ t(
473
- J,
472
+ const qt = Je(({ loading: e, disabled: r, ...o }, n) => /* @__PURE__ */ t(
473
+ ee,
474
474
  {
475
475
  ref: n,
476
476
  disableElevation: !0,
477
477
  disabled: r || e,
478
478
  ...o,
479
479
  sx: [{ borderRadius: "4px" }, ...Array.isArray(o.sx) ? o.sx : [o.sx]],
480
- startIcon: e && /* @__PURE__ */ t(ee, { size: "1em" })
480
+ startIcon: e && /* @__PURE__ */ t(te, { size: "1em" })
481
481
  }
482
482
  ));
483
483
  function Ve({ value: e, options: r, onChange: o, placeholder: n, ...i }) {
484
484
  var B;
485
- const s = ce(null), c = de(), [l, p] = L(!1), [d, g] = L(e !== null ? e : ""), h = W(c.breakpoints.down("sm"));
486
- j(() => {
485
+ const a = ue(null), c = he(), [l, h] = L(!1), [d, g] = L(e !== null ? e : ""), p = $(c.breakpoints.down("sm"));
486
+ H(() => {
487
487
  g(e !== null ? e : "");
488
488
  }, [e]);
489
- const m = ae(() => {
490
- p(!1);
491
- }, []), k = ae(() => {
492
- p(!0);
489
+ const f = de(() => {
490
+ h(!1);
491
+ }, []), k = de(() => {
492
+ h(!0);
493
493
  }, []);
494
494
  function C(u) {
495
- g(u.value), o(u.value), h && m();
495
+ g(u.value), o(u.value), p && f();
496
496
  }
497
497
  function S(u) {
498
498
  return u === d;
499
499
  }
500
- return /* @__PURE__ */ f(N, { children: [
501
- /* @__PURE__ */ f(
500
+ return /* @__PURE__ */ m(D, { children: [
501
+ /* @__PURE__ */ m(
502
502
  Kt,
503
503
  {
504
- ref: s,
504
+ ref: a,
505
505
  onClick: k,
506
506
  variant: "outlined",
507
507
  size: "small",
508
- className: ["my-select__selector", gt(d) ? "" : "my-select__selector--active"].join(" "),
508
+ className: ["my-select__selector", yt(d) ? "" : "my-select__selector--active"].join(" "),
509
509
  sx: { minWidth: "auto", color: "text.primary" },
510
510
  ...i,
511
511
  children: [
512
512
  ((B = r.find((u) => u.value === d)) == null ? void 0 : B.name) || n,
513
- /* @__PURE__ */ t(ft, { className: "my-select__arrowdown", component: dt, fontSize: "small" })
513
+ /* @__PURE__ */ t(gt, { className: "my-select__arrowdown", component: ut, fontSize: "small" })
514
514
  ]
515
515
  }
516
516
  ),
517
- /* @__PURE__ */ t(mt, { open: l, anchorEl: s.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: u, placement: v }) => /* @__PURE__ */ t(
518
- ht,
517
+ /* @__PURE__ */ t(ft, { open: l, anchorEl: a.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: u, placement: v }) => /* @__PURE__ */ t(
518
+ pt,
519
519
  {
520
520
  ...u,
521
521
  style: { transformOrigin: v === "bottom" ? "center top" : "center bottom" },
522
- children: /* @__PURE__ */ t(pt, { children: /* @__PURE__ */ t(ut, { onClickAway: m, children: /* @__PURE__ */ t(Xt, { autoFocusItem: l, onMouseEnter: k, onMouseLeave: m, children: r.map((y) => /* @__PURE__ */ f(Oe, { onClick: () => C(y), children: [
522
+ children: /* @__PURE__ */ t(mt, { children: /* @__PURE__ */ t(ht, { onClickAway: f, children: /* @__PURE__ */ t(Xt, { autoFocusItem: l, onMouseEnter: k, onMouseLeave: f, children: r.map((y) => /* @__PURE__ */ m(_e, { onClick: () => C(y), children: [
523
523
  /* @__PURE__ */ t(
524
- ct,
524
+ dt,
525
525
  {
526
526
  sx: { mr: 1, fontSize: 16, visibility: S(y.value) ? "visible" : "hidden" }
527
527
  }
@@ -532,7 +532,7 @@ function Ve({ value: e, options: r, onChange: o, placeholder: n, ...i }) {
532
532
  ) })
533
533
  ] });
534
534
  }
535
- const Kt = q(Gt)`
535
+ const Kt = q(qt)`
536
536
  border: 1px solid #f0f0f0;
537
537
  padding: 6px 8px 6px 12px;
538
538
  font-weight: ${(e) => e.theme.typography.fontWeightRegular};
@@ -560,7 +560,7 @@ const Kt = q(Gt)`
560
560
  margin-right: 3px;
561
561
  }
562
562
  }
563
- `, Xt = q(ze)`
563
+ `, Xt = q(Ee)`
564
564
  .my-select__option__icon {
565
565
  color: transparent;
566
566
  font-size: 14px;
@@ -577,9 +577,9 @@ const Kt = q(Gt)`
577
577
  }
578
578
  }
579
579
  `;
580
- function He() {
581
- const { search: e, t: r } = I(), { filters: o, handleSort: n, handlePrice: i } = e, s = Ne(r);
582
- return /* @__PURE__ */ f(
580
+ function Ge() {
581
+ const { search: e, t: r } = I(), { filters: o, handleSort: n, handlePrice: i } = e, a = De(r);
582
+ return /* @__PURE__ */ m(
583
583
  T,
584
584
  {
585
585
  direction: { xs: "row", md: "column" },
@@ -589,10 +589,10 @@ function He() {
589
589
  justifyContent: "space-between",
590
590
  children: [
591
591
  /* @__PURE__ */ t(
592
- Le,
592
+ Oe,
593
593
  {
594
594
  control: /* @__PURE__ */ t(
595
- Fe,
595
+ Le,
596
596
  {
597
597
  checked: o.price === "free",
598
598
  size: "small",
@@ -606,8 +606,8 @@ function He() {
606
606
  /* @__PURE__ */ t(
607
607
  Ve,
608
608
  {
609
- value: o.sortBy || s[0].value,
610
- options: s,
609
+ value: o.sortBy || a[0].value,
610
+ options: a,
611
611
  onChange: (c) => n(c),
612
612
  placeholder: r("sort.sort")
613
613
  }
@@ -617,16 +617,16 @@ function He() {
617
617
  );
618
618
  }
619
619
  function Qt() {
620
- const { selectedCategory: e, search: r, t: o, categoryOptions: n, loadings: i, layout: s, baseSearch: c } = I(), { filters: l, handleCategory: p, cleanFilter: d } = r, { toggleOpen: g } = me();
621
- j(() => {
620
+ const { selectedCategory: e, search: r, t: o, categoryOptions: n, loadings: i, layout: a, baseSearch: c } = I(), { filters: l, handleCategory: h, cleanFilter: d } = r, { toggleOpen: g } = ge();
621
+ H(() => {
622
622
  g(!1);
623
623
  }, [Object.values(l).join("")]);
624
- const h = Et(c, s.showSearch, l.keyword);
625
- return s.showCategory ? /* @__PURE__ */ f(qt, { children: [
624
+ const p = zt(c, a.showSearch, l.keyword);
625
+ return a.showCategory ? /* @__PURE__ */ m(Gt, { children: [
626
626
  /* @__PURE__ */ t(
627
- fe,
627
+ ye,
628
628
  {
629
- xs: /* @__PURE__ */ f(
629
+ xs: /* @__PURE__ */ m(
630
630
  T,
631
631
  {
632
632
  direction: "row",
@@ -638,8 +638,8 @@ function Qt() {
638
638
  borderBottom: 1,
639
639
  borderColor: "divider",
640
640
  children: [
641
- /* @__PURE__ */ t(Ue, { onClick: () => g(!1), children: /* @__PURE__ */ t(he, {}) }),
642
- /* @__PURE__ */ t(x, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: o("common.category") })
641
+ /* @__PURE__ */ t(Ue, { onClick: () => g(!1), children: /* @__PURE__ */ t(me, {}) }),
642
+ /* @__PURE__ */ t(w, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: o("common.category") })
643
643
  ]
644
644
  }
645
645
  ),
@@ -654,11 +654,11 @@ function Qt() {
654
654
  boxSizing: "content-box",
655
655
  p: { xs: 2, md: 0 },
656
656
  pr: { md: 6 },
657
- children: h ? /* @__PURE__ */ f(N, { children: [
658
- s.showExplore && /* @__PURE__ */ f(w, { display: "flex", alignItems: "center", gap: 1, mb: 3, pb: 3, borderBottom: 1, borderColor: "divider", children: [
659
- /* @__PURE__ */ t(Be, { icon: Ye }),
657
+ children: p ? /* @__PURE__ */ m(D, { children: [
658
+ a.showExplore && /* @__PURE__ */ m(x, { display: "flex", alignItems: "center", gap: 1, mb: 3, pb: 3, borderBottom: 1, borderColor: "divider", children: [
659
+ /* @__PURE__ */ t(Re, { icon: Ze }),
660
660
  /* @__PURE__ */ t(
661
- x,
661
+ w,
662
662
  {
663
663
  variant: "body1",
664
664
  color: e ? "text.lighter" : "text.primary",
@@ -671,59 +671,59 @@ function Qt() {
671
671
  }
672
672
  )
673
673
  ] }),
674
- !!n.length && /* @__PURE__ */ t(T, { gap: 2, children: n.map((m) => /* @__PURE__ */ t(
675
- x,
674
+ !!n.length && /* @__PURE__ */ t(T, { gap: 2, children: n.map((f) => /* @__PURE__ */ t(
675
+ w,
676
676
  {
677
677
  variant: "body1",
678
- title: m.name,
678
+ title: f.name,
679
679
  sx: { cursor: "pointer" },
680
680
  "data-cy": "filter",
681
- color: e === m.value ? "text.primary" : "text.lighter",
681
+ color: e === f.value ? "text.primary" : "text.lighter",
682
682
  textTransform: "capitalize",
683
683
  onClick: () => {
684
- e === m.value ? d() : p(m.value), g(!1);
684
+ e === f.value ? d() : h(f.value), g(!1);
685
685
  },
686
- children: m.name
686
+ children: f.name
687
687
  },
688
- m.value
688
+ f.value
689
689
  )) })
690
- ] }) : /* @__PURE__ */ t(He, {})
690
+ ] }) : /* @__PURE__ */ t(Ge, {})
691
691
  }
692
692
  )
693
693
  ] }) : null;
694
694
  }
695
- function ge() {
696
- const { endpoint: e, serverVersion: r, storeVersion: o } = I(), n = We(r, o), i = $(() => Te({
695
+ function xe() {
696
+ const { endpoint: e, serverVersion: r, storeVersion: o } = I(), n = $e(r, o), i = j(() => Ae({
697
697
  baseURL: e,
698
698
  headers: n
699
699
  }), [e]);
700
700
  return {
701
- get: async (s) => {
702
- const { data: c } = await i.get(s);
701
+ get: async (a) => {
702
+ const { data: c } = await i.get(a);
703
703
  return c;
704
704
  },
705
- post: async (s, c) => {
706
- const { data: l } = await i.post(s, c);
705
+ post: async (a, c) => {
706
+ const { data: l } = await i.post(a, c);
707
707
  return l;
708
708
  }
709
709
  };
710
710
  }
711
- const qe = Je(function(r) {
712
- return /* @__PURE__ */ t(w, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...r, children: /* @__PURE__ */ t(ee, {}) });
711
+ const qe = et(function(r) {
712
+ return /* @__PURE__ */ t(x, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...r, children: /* @__PURE__ */ t(te, {}) });
713
713
  });
714
714
  function Yt({ showSkeleton: e, ...r }) {
715
- return e ? /* @__PURE__ */ t(vt, { variant: "rectangular", width: r.width, height: r.height }) : /* @__PURE__ */ t(kt, { ...r });
715
+ return e ? /* @__PURE__ */ t(E, { variant: "rectangular", width: r.width, height: r.height }) : /* @__PURE__ */ t(vt, { ...r });
716
716
  }
717
- function ke({
717
+ function Ce({
718
718
  icon: e,
719
719
  children: r,
720
720
  maxWidth: o = 100,
721
721
  title: n
722
722
  }) {
723
- return (r === 0 || r) && /* @__PURE__ */ f(T, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: o, overflow: "hidden" }, children: [
723
+ return (r === 0 || r) && /* @__PURE__ */ m(T, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: o, overflow: "hidden" }, children: [
724
724
  e,
725
725
  /* @__PURE__ */ t(
726
- x,
726
+ w,
727
727
  {
728
728
  flex: 1,
729
729
  variant: "body2",
@@ -734,18 +734,18 @@ function ke({
734
734
  )
735
735
  ] });
736
736
  }
737
- const ve = 292;
738
- function Zt() {
737
+ const le = 292, Zt = 210, Jt = 338;
738
+ function er() {
739
739
  var S, B;
740
- const { t: e, search: r } = I(), { get: o } = ge(), n = de(), i = W(n.breakpoints.down("md")), s = ((B = (S = window.blocklet) == null ? void 0 : S.preferences) == null ? void 0 : B.homeBanner) || [], {
740
+ const { t: e, search: r } = I(), { get: o } = xe(), n = he(), i = $(n.breakpoints.down("md")), a = ((B = (S = window.blocklet) == null ? void 0 : S.preferences) == null ? void 0 : B.homeBanner) || [], {
741
741
  data: c = [],
742
742
  error: l,
743
- loading: p
744
- } = Z(async () => {
743
+ loading: h
744
+ } = J(async () => {
745
745
  const u = await o(
746
- pe(P.blockletsPath, { didList: s.map((v) => v.did).join(",") })
746
+ fe(P.blockletsPath, { didList: a.map((v) => v.did).join(",") })
747
747
  );
748
- return u != null && u.dataList ? s.map((v) => u.dataList.find((y) => y.did === v.did)) : [];
748
+ return u != null && u.dataList ? a.map((v) => u.dataList.find((y) => y.did === v.did)) : [];
749
749
  });
750
750
  l && console.error("Get Banner Blocklets error:", l);
751
751
  const d = {
@@ -756,19 +756,31 @@ function Zt() {
756
756
  cursor: "pointer",
757
757
  color: "text.lighter"
758
758
  };
759
- return !l && s.length > 0 ? /* @__PURE__ */ f(N, { children: [
760
- /* @__PURE__ */ t(x, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
759
+ return !l && a.length > 0 ? /* @__PURE__ */ m(D, { children: [
760
+ /* @__PURE__ */ t(w, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
761
761
  /* @__PURE__ */ t(
762
- w,
762
+ x,
763
763
  {
764
- height: { xs: "auto", md: ve },
764
+ height: { xs: "auto", md: le },
765
765
  position: "relative",
766
766
  border: 1,
767
767
  borderColor: "divider",
768
768
  borderRadius: 3,
769
769
  overflow: "hidden",
770
- children: /* @__PURE__ */ t(
771
- bt,
770
+ children: h ? /* @__PURE__ */ m(x, { p: 5, display: "flex", gap: 5, height: le, alignItems: "center", justifyContent: "center", children: [
771
+ /* @__PURE__ */ t(E, { variant: "rounded", height: Zt, width: Jt }),
772
+ /* @__PURE__ */ m(x, { flex: 1, height: "100%", children: [
773
+ /* @__PURE__ */ t(E, { variant: "text", height: 50, width: 100 }),
774
+ /* @__PURE__ */ t(E, { variant: "text", height: 40, width: "100%" }),
775
+ /* @__PURE__ */ t(E, { variant: "text", height: 40, width: 300 }),
776
+ /* @__PURE__ */ m(x, { display: "flex", gap: 1, my: 2, children: [
777
+ /* @__PURE__ */ t(E, { variant: "circular", height: 20, width: 20 }),
778
+ /* @__PURE__ */ t(E, { variant: "text", height: 20, width: 50 })
779
+ ] }),
780
+ /* @__PURE__ */ t(E, { variant: "rounded", height: 30, width: 100 })
781
+ ] })
782
+ ] }) : /* @__PURE__ */ t(
783
+ kt,
772
784
  {
773
785
  showNav: !0,
774
786
  autoPlay: !0,
@@ -779,17 +791,17 @@ function Zt() {
779
791
  showBullets: !1,
780
792
  showThumbnails: !1,
781
793
  showFullscreenButton: !1,
782
- renderLeftNav: (u) => /* @__PURE__ */ t(w, { onClick: u, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(xt, { sx: { ...d, left: 5 } }) }),
783
- renderRightNav: (u) => /* @__PURE__ */ t(w, { onClick: u, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(wt, { sx: { ...d, right: 5 } }) }),
784
- items: s.map((u, v) => ({
794
+ renderLeftNav: (u) => /* @__PURE__ */ t(x, { onClick: u, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(wt, { sx: { ...d, left: 5 } }) }),
795
+ renderRightNav: (u) => /* @__PURE__ */ t(x, { onClick: u, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(bt, { sx: { ...d, right: 5 } }) }),
796
+ items: a.map((u, v) => ({
785
797
  original: u.did,
786
798
  renderItem: () => {
787
799
  var O;
788
- const y = c[v] || {}, A = u.cover || er(u.did, (O = y.screenshots) == null ? void 0 : O[0]), F = De(A, { h: 400, w: 700 });
789
- return /* @__PURE__ */ f(
800
+ const y = c[v] || {}, A = u.cover || rr(u.did, (O = y.screenshots) == null ? void 0 : O[0]), F = We(A, { h: 400, w: 700 });
801
+ return /* @__PURE__ */ m(
790
802
  T,
791
803
  {
792
- height: { xs: "auto", md: ve },
804
+ height: { xs: "auto", md: le },
793
805
  sx: {
794
806
  "&::before": {
795
807
  content: '""',
@@ -815,10 +827,10 @@ function Zt() {
815
827
  gap: { xs: 2, md: 5 },
816
828
  children: [
817
829
  g(F),
818
- /* @__PURE__ */ f(T, { flex: 1, height: "100%", gap: 3, children: [
819
- /* @__PURE__ */ f(w, { flex: 1, children: [
820
- h(u.name || y.title || u.name),
821
- m(u.desc || y.description)
830
+ /* @__PURE__ */ m(T, { flex: 1, height: "100%", gap: 3, children: [
831
+ /* @__PURE__ */ m(x, { flex: 1, children: [
832
+ p(u.name || y.title || u.name),
833
+ f(u.desc || y.description)
822
834
  ] }),
823
835
  y.did && k(y, u.baseNum),
824
836
  C(y)
@@ -834,10 +846,10 @@ function Zt() {
834
846
  )
835
847
  ] }) : null;
836
848
  function g(u) {
837
- return /* @__PURE__ */ t(w, { width: { xs: "100%", md: 338 }, height: 210, borderRadius: 2, overflow: "hidden", position: "relative", children: /* @__PURE__ */ t(
849
+ return /* @__PURE__ */ t(x, { width: { xs: "100%", md: 338 }, height: 210, borderRadius: 2, overflow: "hidden", position: "relative", children: /* @__PURE__ */ t(
838
850
  Yt,
839
851
  {
840
- showSkeleton: p,
852
+ showSkeleton: h,
841
853
  src: u,
842
854
  alt: "",
843
855
  width: i ? void 0 : 338,
@@ -846,12 +858,12 @@ function Zt() {
846
858
  }
847
859
  ) });
848
860
  }
849
- function h(u) {
850
- return /* @__PURE__ */ t(x, { variant: "h2", width: "100%", children: u });
861
+ function p(u) {
862
+ return /* @__PURE__ */ t(w, { variant: "h2", width: "100%", children: u });
851
863
  }
852
- function m(u) {
864
+ function f(u) {
853
865
  return /* @__PURE__ */ t(
854
- x,
866
+ w,
855
867
  {
856
868
  variant: "body2",
857
869
  color: "text.secondary",
@@ -875,14 +887,14 @@ function Zt() {
875
887
  }
876
888
  function k(u, v = 0) {
877
889
  const { did: y, owner: A, stats: F } = u;
878
- return /* @__PURE__ */ f(w, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
879
- /* @__PURE__ */ t(ke, { icon: /* @__PURE__ */ t(_e, { src: A.avatar, did: y, size: 20, variant: "circle" }), children: A.fullName }),
880
- /* @__PURE__ */ t(ke, { icon: /* @__PURE__ */ t(Be, { icon: yt }), title: `${F.downloads + v}`, children: Jt(F.downloads + v) })
890
+ return /* @__PURE__ */ m(x, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
891
+ /* @__PURE__ */ t(Ce, { icon: /* @__PURE__ */ t(ze, { src: A.avatar, did: y, size: 20, variant: "circle" }), children: A.fullName }),
892
+ /* @__PURE__ */ t(Ce, { icon: /* @__PURE__ */ t(Re, { icon: xt }), title: `${F.downloads + v}`, children: tr(F.downloads + v) })
881
893
  ] });
882
894
  }
883
895
  function C(u) {
884
896
  return /* @__PURE__ */ t(
885
- J,
897
+ ee,
886
898
  {
887
899
  variant: "outlined",
888
900
  size: "small",
@@ -900,72 +912,72 @@ function Zt() {
900
912
  );
901
913
  }
902
914
  }
903
- const Jt = (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`, er = (e, r) => e && r ? `/assets/${e}/screenshots/${r}` : "";
904
- function tr({ title: e, blocklets: r }) {
915
+ const tr = (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`, rr = (e, r) => e && r ? `/assets/${e}/screenshots/${r}` : "";
916
+ function or({ title: e, blocklets: r }) {
905
917
  const { blockletRender: o, serverVersion: n } = I();
906
- return /* @__PURE__ */ f(w, { mt: 3, children: [
907
- /* @__PURE__ */ t(x, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
908
- /* @__PURE__ */ t(we, { container: !0, spacing: 2, children: r.map((i) => /* @__PURE__ */ t(we, { 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)) })
918
+ return /* @__PURE__ */ m(x, { mt: 3, children: [
919
+ /* @__PURE__ */ t(w, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
920
+ /* @__PURE__ */ t(ke, { container: !0, spacing: 2, children: r.map((i) => /* @__PURE__ */ t(ke, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": i.did, children: /* @__PURE__ */ t(x, { padding: "1px", children: o({ blocklet: i, blocklets: r, serverVersion: n }) }) }, i.did)) })
909
921
  ] });
910
922
  }
911
- function rr() {
912
- const { get: e } = ge(), { t: r } = I(), {
923
+ function nr() {
924
+ const { get: e } = xe(), { t: r } = I(), {
913
925
  data: o = [],
914
926
  error: n,
915
927
  loading: i
916
- } = Z(async () => {
917
- const s = await e(P.explorePath);
918
- return Array.isArray(s) ? s : [];
928
+ } = J(async () => {
929
+ const a = await e(P.explorePath);
930
+ return Array.isArray(a) ? a : [];
919
931
  });
920
- return n ? /* @__PURE__ */ t(ue, { error: new Error(`Failed to fetch blocklets from ${P.explorePath}`) }) : i ? /* @__PURE__ */ t(qe, { mt: 15 }) : /* @__PURE__ */ f(N, { children: [
921
- /* @__PURE__ */ t(Zt, {}),
932
+ return n ? /* @__PURE__ */ t(pe, { error: new Error(`Failed to fetch blocklets from ${P.explorePath}`) }) : i ? /* @__PURE__ */ t(qe, { mt: 15 }) : /* @__PURE__ */ m(D, { children: [
933
+ /* @__PURE__ */ t(er, {}),
922
934
  o.map(
923
- (s) => s.blocklets.length > 0 ? /* @__PURE__ */ t(tr, { title: r(`explore.${s.type}`), blocklets: s.blocklets }, s.type) : null
935
+ (a) => a.blocklets.length > 0 ? /* @__PURE__ */ t(or, { title: r(`explore.${a.type}`), blocklets: a.blocklets }, a.type) : null
924
936
  )
925
937
  ] });
926
938
  }
927
- const ne = "__FREE_TEXT__", Ce = "__NO_RESULT__", le = 40;
928
- function or({
939
+ const ie = "__FREE_TEXT__", Se = "__NO_RESULT__", ae = 40;
940
+ function lr({
929
941
  endpoint: e,
930
942
  t: r,
931
943
  locale: o,
932
944
  filters: n,
933
945
  handleKeyword: i,
934
- handleSearchSelect: s,
946
+ handleSearchSelect: a,
935
947
  ...c
936
948
  }) {
937
- const l = ce(null), p = ce(!1), [d, g] = L(!1), [h, m] = L(""), [k, C] = L(!1), S = ge(), [B, u] = L(!1), v = async (a) => {
949
+ const l = ue(null), h = ue(!1), [d, g] = L(!1), [p, f] = L(""), [k, C] = L(!1), S = xe(), [B, u] = L(!1), v = async (s) => {
938
950
  u(!0);
939
- const b = await S.get(ye(e, pe(P.blockletsPath, a)));
951
+ const b = await S.get(we(e, fe(P.blockletsPath, s)));
940
952
  return u(!1), b.dataList || [];
941
- }, { data: y, run: A } = Z(
942
- (a) => a ? v({
953
+ }, { data: y, run: A } = J(
954
+ (s) => s ? v({
943
955
  sortBy: P.nameDesc,
944
956
  page: 1,
945
957
  pageSize: 10,
946
- keyword: a
958
+ keyword: s
947
959
  }) : Promise.resolve([]),
948
960
  {
949
961
  manual: !0
950
962
  }
951
963
  );
952
- j(() => {
953
- u(!0), A(n.keyword), m(n.keyword || "");
964
+ H(() => {
965
+ u(!0), A(n.keyword), f(n.keyword || "");
954
966
  }, [n.keyword, A]), Tt(
955
967
  "ctrl + k, command + k",
956
- (a) => {
957
- var b, E;
958
- return a.stopPropagation(), a.preventDefault(), (E = (b = l.current) == null ? void 0 : b.querySelector("input")) == null || E.focus(), !1;
968
+ (s) => {
969
+ var b, M;
970
+ return s.stopPropagation(), s.preventDefault(), (M = (b = l.current) == null ? void 0 : b.querySelector("input")) == null || M.focus(), !1;
959
971
  },
960
972
  { enableOnTags: ["INPUT"] }
961
973
  );
962
- const F = Ae((a) => A(a), { wait: 300 }), O = { name: ne, title: h, did: "" };
963
- let _ = [];
964
- return h && (B ? _ = [O] : y != null && y.length ? _ = [O, ...y] : _ = [{ name: Ce, title: r("blocklet.noResults"), did: "" }]), /* @__PURE__ */ f(N, { children: [
965
- /* @__PURE__ */ f(Rt, { fullScreen: !0, open: k, sx: { display: { md: "none" } }, children: [
966
- /* @__PURE__ */ f(w, { p: 2, pb: 0, display: "flex", alignItems: "center", gap: 2, children: [
974
+ const F = Fe((s) => A(s), { wait: 300 }), O = { name: ie, title: p, did: "" };
975
+ let z = [];
976
+ return p && (B ? z = [O] : y != null && y.length ? z = [O, ...y] : z = [{ name: Se, title: r("blocklet.noResults"), did: "" }]), /* @__PURE__ */ m(D, { children: [
977
+ /* @__PURE__ */ m(Rt, { fullScreen: !0, open: k, sx: { display: { md: "none" } }, children: [
978
+ /* @__PURE__ */ m(x, { p: 2, pb: 0, display: "flex", alignItems: "center", gap: 2, children: [
967
979
  /* @__PURE__ */ t(
968
- Ee,
980
+ Me,
969
981
  {
970
982
  fullWidth: !0,
971
983
  sx: {
@@ -985,27 +997,27 @@ function or({
985
997
  autoFocus: !0,
986
998
  placeholder: r("common.searchStore"),
987
999
  className: "bl-autocomplete-input",
988
- value: h,
989
- onChange: (a) => U(a.target.value),
990
- startAdornment: D(k),
991
- endAdornment: H()
1000
+ value: p,
1001
+ onChange: (s) => U(s.target.value),
1002
+ startAdornment: W(k),
1003
+ endAdornment: G()
992
1004
  }
993
1005
  ),
994
1006
  /* @__PURE__ */ t(
995
- J,
1007
+ ee,
996
1008
  {
997
1009
  variant: "outlined",
998
1010
  onClick: () => {
999
- C(!1), m(n.keyword || "");
1011
+ C(!1), f(n.keyword || "");
1000
1012
  },
1001
1013
  children: r("common.cancel")
1002
1014
  }
1003
1015
  )
1004
1016
  ] }),
1005
- /* @__PURE__ */ t(ze, { sx: { p: 0.5 }, children: _.map((a) => G(a)) })
1017
+ /* @__PURE__ */ t(Ee, { sx: { p: 0.5 }, children: z.map((s) => K(s)) })
1006
1018
  ] }),
1007
1019
  /* @__PURE__ */ t(
1008
- Y,
1020
+ Z,
1009
1021
  {
1010
1022
  sx: { display: { sx: "block", md: "none" }, fontSize: 28, color: "text.lighter" },
1011
1023
  onClick: () => C(!0)
@@ -1015,18 +1027,18 @@ function or({
1015
1027
  Bt,
1016
1028
  {
1017
1029
  ref: l,
1018
- open: !!h && d,
1030
+ open: !!p && d,
1019
1031
  size: "small",
1020
1032
  onOpen: () => g(!0),
1021
- onClose: (a, b) => {
1022
- g(!1), b === "selectOption" && !p.current && i(h);
1033
+ onClose: (s, b) => {
1034
+ g(!1), b === "selectOption" && !h.current && i(p);
1023
1035
  },
1024
1036
  disableClearable: !0,
1025
- inputValue: h,
1026
- onInputChange: (a, b) => U(b),
1027
- isOptionEqualToValue: (a, b) => a.name === b.name,
1028
- getOptionLabel: (a) => a.title,
1029
- getOptionKey: (a) => a.name,
1037
+ inputValue: p,
1038
+ onInputChange: (s, b) => U(b),
1039
+ isOptionEqualToValue: (s, b) => s.name === b.name,
1040
+ getOptionLabel: (s) => s.title,
1041
+ getOptionKey: (s) => s.name,
1030
1042
  noOptionsText: r("blocklet.noResults"),
1031
1043
  autoHighlight: !0,
1032
1044
  forcePopupIcon: !1,
@@ -1040,25 +1052,25 @@ function or({
1040
1052
  }
1041
1053
  }
1042
1054
  },
1043
- renderInput: (a) => /* @__PURE__ */ t(
1055
+ renderInput: (s) => /* @__PURE__ */ t(
1044
1056
  Pt,
1045
1057
  {
1046
- ...a,
1058
+ ...s,
1047
1059
  InputProps: {
1048
- ...a.InputProps,
1060
+ ...s.InputProps,
1049
1061
  autoFocus: !0,
1050
1062
  placeholder: r("common.searchStore"),
1051
1063
  className: "bl-autocomplete-input",
1052
- value: h,
1053
- startAdornment: D(d),
1054
- endAdornment: H()
1064
+ value: p,
1065
+ startAdornment: W(d),
1066
+ endAdornment: G()
1055
1067
  }
1056
1068
  }
1057
1069
  ),
1058
- filterOptions: (a) => a,
1070
+ filterOptions: (s) => s,
1059
1071
  ...c,
1060
- options: _,
1061
- renderOption: (a, b) => G(b),
1072
+ options: z,
1073
+ renderOption: (s, b) => K(b),
1062
1074
  value: O,
1063
1075
  sx: [
1064
1076
  {
@@ -1079,43 +1091,43 @@ function or({
1079
1091
  }
1080
1092
  )
1081
1093
  ] });
1082
- function U(a) {
1083
- u(!0), m(a), p.current = !1, F.run(a);
1094
+ function U(s) {
1095
+ u(!0), f(s), h.current = !1, F.run(s);
1084
1096
  }
1085
1097
  function V() {
1086
- C(!1), m(""), U(""), i("");
1098
+ C(!1), f(""), U(""), i("");
1087
1099
  }
1088
- function te(a) {
1089
- a != null && a.did ? (C(!1), p.current = !0, m(""), s(a)) : a.name === ne && (C(!1), i(h));
1100
+ function re(s) {
1101
+ s != null && s.did ? (C(!1), h.current = !0, f(""), a(s)) : s.name === ie && (C(!1), i(p));
1090
1102
  }
1091
- function G(a) {
1092
- var b, E;
1093
- return /* @__PURE__ */ f(
1094
- Oe,
1103
+ function K(s) {
1104
+ var b, M;
1105
+ return /* @__PURE__ */ m(
1106
+ _e,
1095
1107
  {
1096
1108
  sx: { display: "flex", alignItems: "center", gap: 1, p: 1.5, borderRadius: "8px" },
1097
- onClick: () => te(a),
1109
+ onClick: () => re(s),
1098
1110
  children: [
1099
- K(a),
1100
- /* @__PURE__ */ f(x, { variant: "body1", children: [
1101
- /* @__PURE__ */ f(x, { fontWeight: "fontWeightMedium", display: "flex", alignItems: "center", gap: 1, children: [
1102
- a.title,
1111
+ X(s),
1112
+ /* @__PURE__ */ m(w, { variant: "body1", children: [
1113
+ /* @__PURE__ */ m(w, { fontWeight: "fontWeightMedium", display: "flex", alignItems: "center", gap: 1, children: [
1114
+ s.title,
1103
1115
  " ",
1104
1116
  /* @__PURE__ */ t(It, { sx: { color: "#D97706", fontSize: 16, display: "none" } })
1105
1117
  ] }),
1106
- /* @__PURE__ */ t(x, { sx: { color: "text.lighter" }, fontSize: "13px", children: ((E = (b = a.category) == null ? void 0 : b.locales) == null ? void 0 : E[o || "en"]) || "" })
1118
+ /* @__PURE__ */ t(w, { sx: { color: "text.lighter" }, fontSize: "13px", children: ((M = (b = s.category) == null ? void 0 : b.locales) == null ? void 0 : M[o || "en"]) || "" })
1107
1119
  ] })
1108
1120
  ]
1109
1121
  },
1110
- a.did
1122
+ s.did
1111
1123
  );
1112
1124
  }
1113
- function K(a) {
1114
- if ([ne, Ce].includes(a.name))
1125
+ function X(s) {
1126
+ if ([ie, Se].includes(s.name))
1115
1127
  return /* @__PURE__ */ t(
1116
- w,
1128
+ x,
1117
1129
  {
1118
- width: le,
1130
+ width: ae,
1119
1131
  p: "6px",
1120
1132
  display: "flex",
1121
1133
  justifyContent: "center",
@@ -1123,46 +1135,46 @@ function or({
1123
1135
  color: "text.lighter",
1124
1136
  bgcolor: "#F1F3F5",
1125
1137
  borderRadius: "8px",
1126
- children: /* @__PURE__ */ t(Y, { sx: { fontSize: 28 } })
1138
+ children: /* @__PURE__ */ t(Z, { sx: { fontSize: 28 } })
1127
1139
  }
1128
1140
  );
1129
1141
  let b = "";
1130
- return a.logo && (b = ye(e, "assets", a.did, De(a.logo, le, a.version))), /* @__PURE__ */ t(_e, { src: b, size: le, style: { borderRadius: "8px", overflow: "hidden" } });
1142
+ return s.logo && (b = we(e, "assets", s.did, We(s.logo, ae, s.version))), /* @__PURE__ */ t(ze, { src: b, size: ae, style: { borderRadius: "8px", overflow: "hidden" } });
1131
1143
  }
1132
- function D(a = !0) {
1133
- return /* @__PURE__ */ t(w, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.lighter" }, children: a && h && B ? /* @__PURE__ */ t(ee, { color: "inherit", size: 16 }) : /* @__PURE__ */ t(Y, { sx: { fontSize: 16, cursor: "default" } }) });
1144
+ function W(s = !0) {
1145
+ return /* @__PURE__ */ t(x, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.lighter" }, children: s && p && B ? /* @__PURE__ */ t(te, { color: "inherit", size: 16 }) : /* @__PURE__ */ t(Z, { sx: { fontSize: 16, cursor: "default" } }) });
1134
1146
  }
1135
- function H() {
1136
- return h ? /* @__PURE__ */ t(w, { sx: { display: "flex", alignItems: "center", color: "text.lighter" }, children: /* @__PURE__ */ t(he, { sx: { fontSize: 20, cursor: "pointer" }, onClick: () => V() }) }) : null;
1147
+ function G() {
1148
+ return p ? /* @__PURE__ */ t(x, { sx: { display: "flex", alignItems: "center", color: "text.lighter" }, children: /* @__PURE__ */ t(me, { sx: { fontSize: 20, cursor: "pointer" }, onClick: () => V() }) }) : null;
1137
1149
  }
1138
1150
  }
1139
- function nr({ placeholder: e = "Type to search...", ...r }) {
1140
- const { search: o } = I(), { filters: n, handleKeyword: i } = o, [s, c] = L(n.keyword || ""), l = Ae(i, { wait: 300 }), p = (g) => {
1141
- const { value: h } = g.target;
1142
- c(h), l.run(h);
1151
+ function ir({ placeholder: e = "Type to search...", ...r }) {
1152
+ const { search: o } = I(), { filters: n, handleKeyword: i } = o, [a, c] = L(n.keyword || ""), l = Fe(i, { wait: 300 }), h = (g) => {
1153
+ const { value: p } = g.target;
1154
+ c(p), l.run(p);
1143
1155
  }, d = () => {
1144
1156
  c(""), i("");
1145
1157
  };
1146
- return j(() => {
1158
+ return H(() => {
1147
1159
  c(n.keyword || "");
1148
1160
  }, [n.keyword]), /* @__PURE__ */ t(
1149
- lr,
1161
+ ar,
1150
1162
  {
1151
1163
  inputProps: {
1152
1164
  "data-cy": "search-blocklet"
1153
1165
  },
1154
- startAdornment: /* @__PURE__ */ t(be, { position: "start", children: /* @__PURE__ */ t(ir, {}) }),
1155
- onChange: p,
1166
+ startAdornment: /* @__PURE__ */ t(ve, { position: "start", children: /* @__PURE__ */ t(sr, {}) }),
1167
+ onChange: h,
1156
1168
  placeholder: e,
1157
- value: s,
1169
+ value: a,
1158
1170
  title: e,
1159
1171
  "data-cy": "search",
1160
- endAdornment: s && /* @__PURE__ */ t(be, { position: "end", children: /* @__PURE__ */ t(sr, { "data-cy": "search-delete", onClick: d }) }),
1172
+ endAdornment: a && /* @__PURE__ */ t(ve, { position: "end", children: /* @__PURE__ */ t(cr, { "data-cy": "search-delete", onClick: d }) }),
1161
1173
  ...r
1162
1174
  }
1163
1175
  );
1164
1176
  }
1165
- const lr = q(Ee)`
1177
+ const ar = q(Me)`
1166
1178
  background-color: ${(e) => e.theme.palette.grey[50]};
1167
1179
  font-size: 14px;
1168
1180
  border-radius: 6px;
@@ -1179,20 +1191,20 @@ const lr = q(Ee)`
1179
1191
  color: transparent;
1180
1192
  }
1181
1193
  }
1182
- `, ir = q(Y)`
1194
+ `, sr = q(Z)`
1183
1195
  color: ${(e) => e.theme.palette.grey[500]};
1184
1196
  font-size: 28px;
1185
1197
  @media (max-width: ${(e) => e.theme.breakpoints.values.md}px) {
1186
1198
  font-size: 24px;
1187
1199
  }
1188
- `, sr = q(he)`
1200
+ `, cr = q(me)`
1189
1201
  color: ${(e) => e.theme.palette.grey[500]};
1190
1202
  font-size: 16px;
1191
1203
  cursor: pointer;
1192
1204
  `;
1193
- function ar() {
1194
- const { search: e, t: r, endpoint: o, locale: n, getCategoryLocale: i, developerName: s, showResourcesSwitch: c, layout: l, baseSearch: p } = I(), { filters: d, handleSort: g, handlePrice: h, handleDeveloper: m, handleSwitchShowResources: k } = e, C = Ne(r);
1195
- return /* @__PURE__ */ f(
1205
+ function dr() {
1206
+ const { search: e, t: r, endpoint: o, locale: n, getCategoryLocale: i, developerName: a, showResourcesSwitch: c, layout: l, baseSearch: h } = I(), { filters: d, handleSort: g, handlePrice: p, handleDeveloper: f, handleSwitchShowResources: k } = e, C = De(r);
1207
+ return /* @__PURE__ */ m(
1196
1208
  T,
1197
1209
  {
1198
1210
  className: "filter-bar",
@@ -1205,8 +1217,8 @@ function ar() {
1205
1217
  px: 0,
1206
1218
  pb: 3,
1207
1219
  children: [
1208
- /* @__PURE__ */ t(x, { variant: "h2", textTransform: "capitalize", children: i(d.category) }),
1209
- /* @__PURE__ */ f(
1220
+ /* @__PURE__ */ t(w, { variant: "h2", textTransform: "capitalize", children: i(d.category) }),
1221
+ /* @__PURE__ */ m(
1210
1222
  T,
1211
1223
  {
1212
1224
  flex: 1,
@@ -1216,8 +1228,8 @@ function ar() {
1216
1228
  justifyContent: { xs: "space-between", md: "flex-end" },
1217
1229
  gap: 2,
1218
1230
  children: [
1219
- l.showSearch ? /* @__PURE__ */ t(w, { flex: 1, children: p ? /* @__PURE__ */ t(nr, {}) : /* @__PURE__ */ t(
1220
- or,
1231
+ l.showSearch ? /* @__PURE__ */ t(x, { flex: 1, children: h ? /* @__PURE__ */ t(ir, {}) : /* @__PURE__ */ t(
1232
+ lr,
1221
1233
  {
1222
1234
  locale: n,
1223
1235
  endpoint: o,
@@ -1233,9 +1245,9 @@ function ar() {
1233
1245
  handleSearchSelect: e.handleSearchSelect
1234
1246
  }
1235
1247
  ) }) : null,
1236
- d.owner && s && /* @__PURE__ */ t(St, { label: s, size: "small", onDelete: () => m("") }),
1248
+ d.owner && a && /* @__PURE__ */ t(St, { label: a, size: "small", onDelete: () => f("") }),
1237
1249
  c ? /* @__PURE__ */ t(
1238
- Se,
1250
+ Ie,
1239
1251
  {
1240
1252
  checked: d.showResources === "true",
1241
1253
  onChange: (S) => k(S ? "true" : ""),
@@ -1243,10 +1255,10 @@ function ar() {
1243
1255
  }
1244
1256
  ) : null,
1245
1257
  /* @__PURE__ */ t(
1246
- Se,
1258
+ Ie,
1247
1259
  {
1248
1260
  checked: d.price === "free",
1249
- onChange: (S) => h(S ? "free" : ""),
1261
+ onChange: (S) => p(S ? "free" : ""),
1250
1262
  label: r("blocklet.free")
1251
1263
  }
1252
1264
  ),
@@ -1266,17 +1278,17 @@ function ar() {
1266
1278
  }
1267
1279
  );
1268
1280
  }
1269
- function Se({
1281
+ function Ie({
1270
1282
  checked: e,
1271
1283
  onChange: r,
1272
1284
  label: o
1273
1285
  }) {
1274
1286
  return /* @__PURE__ */ t(
1275
- Le,
1287
+ Oe,
1276
1288
  {
1277
1289
  sx: { m: 0 },
1278
1290
  control: /* @__PURE__ */ t(
1279
- Fe,
1291
+ Le,
1280
1292
  {
1281
1293
  checked: e,
1282
1294
  size: "small",
@@ -1288,94 +1300,94 @@ function Se({
1288
1300
  }
1289
1301
  );
1290
1302
  }
1291
- function Q({ children: e }) {
1292
- return /* @__PURE__ */ f(w, { display: "flex", mt: 2, flexDirection: "column", alignItems: "center", justifyContent: "center", color: "text.lighter", children: [
1303
+ function Y({ children: e }) {
1304
+ return /* @__PURE__ */ m(x, { display: "flex", mt: 2, flexDirection: "column", alignItems: "center", justifyContent: "center", color: "text.lighter", children: [
1293
1305
  /* @__PURE__ */ t(At, {}),
1294
1306
  e
1295
1307
  ] });
1296
1308
  }
1297
- function Ie() {
1309
+ function Be() {
1298
1310
  const { t: e } = I();
1299
- return /* @__PURE__ */ t(x, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
1311
+ return /* @__PURE__ */ t(w, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
1300
1312
  }
1301
- function ie({ filterTip: e, keywordTip: r }) {
1313
+ function se({ filterTip: e, keywordTip: r }) {
1302
1314
  const { t: o, locale: n } = I(), i = () => n === "zh" ? "、" : " , ";
1303
- return /* @__PURE__ */ f(w, { mt: 1, display: "flex", children: [
1304
- /* @__PURE__ */ t(x, { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
1305
- e && /* @__PURE__ */ t(x, { children: o("blocklet.filterTip") }),
1315
+ return /* @__PURE__ */ m(x, { mt: 1, display: "flex", children: [
1316
+ /* @__PURE__ */ t(w, { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
1317
+ e && /* @__PURE__ */ t(w, { children: o("blocklet.filterTip") }),
1306
1318
  e && r && i(),
1307
- r && /* @__PURE__ */ t(x, { children: o("blocklet.keywordTip") })
1319
+ r && /* @__PURE__ */ t(w, { children: o("blocklet.keywordTip") })
1308
1320
  ] });
1309
1321
  }
1310
- function se({
1322
+ function ce({
1311
1323
  primaryStart: e,
1312
1324
  primaryEnd: r,
1313
1325
  filter: o
1314
1326
  }) {
1315
- return /* @__PURE__ */ f(x, { variant: "subtitle2", display: "flex", gap: 0.5, mx: 0.5, children: [
1316
- /* @__PURE__ */ t(x, { children: e }),
1317
- /* @__PURE__ */ t(x, { color: "primary", children: o }),
1318
- /* @__PURE__ */ f(x, { children: [
1327
+ return /* @__PURE__ */ m(w, { variant: "subtitle2", display: "flex", gap: 0.5, mx: 0.5, children: [
1328
+ /* @__PURE__ */ t(w, { children: e }),
1329
+ /* @__PURE__ */ t(w, { color: "primary", children: o }),
1330
+ /* @__PURE__ */ m(w, { children: [
1319
1331
  r,
1320
1332
  " "
1321
1333
  ] })
1322
1334
  ] });
1323
1335
  }
1324
- function cr() {
1325
- const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } = I(), { filters: i } = r, s = !!n || !!i.price;
1326
- if (i.keyword && s)
1327
- return /* @__PURE__ */ f(Q, { children: [
1336
+ function ur() {
1337
+ const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } = I(), { filters: i } = r, a = !!n || !!i.price;
1338
+ if (i.keyword && a)
1339
+ return /* @__PURE__ */ m(Y, { children: [
1328
1340
  /* @__PURE__ */ t(
1329
- se,
1341
+ ce,
1330
1342
  {
1331
1343
  primaryStart: e("blocklet.noBlockletPart1"),
1332
1344
  primaryEnd: e("blocklet.noBlockletPart2"),
1333
1345
  filter: i.keyword
1334
1346
  }
1335
1347
  ),
1336
- /* @__PURE__ */ t(ie, { keywordTip: !0, filterTip: !0 })
1348
+ /* @__PURE__ */ t(se, { keywordTip: !0, filterTip: !0 })
1337
1349
  ] });
1338
1350
  if (i.keyword)
1339
- return /* @__PURE__ */ f(Q, { children: [
1351
+ return /* @__PURE__ */ m(Y, { children: [
1340
1352
  /* @__PURE__ */ t(
1341
- se,
1353
+ ce,
1342
1354
  {
1343
1355
  primaryStart: e("blocklet.noBlockletPart1"),
1344
1356
  primaryEnd: e("blocklet.noBlockletPart2"),
1345
1357
  filter: i.keyword
1346
1358
  }
1347
1359
  ),
1348
- /* @__PURE__ */ t(ie, { keywordTip: !0 })
1360
+ /* @__PURE__ */ t(se, { keywordTip: !0 })
1349
1361
  ] });
1350
- if (s) {
1362
+ if (a) {
1351
1363
  const c = o(n);
1352
- return /* @__PURE__ */ f(Q, { children: [
1364
+ return /* @__PURE__ */ m(Y, { children: [
1353
1365
  c ? /* @__PURE__ */ t(
1354
- se,
1366
+ ce,
1355
1367
  {
1356
1368
  primaryStart: e("blocklet.noCategoryResults1"),
1357
1369
  primaryEnd: e("blocklet.noCategoryResults2"),
1358
1370
  filter: c
1359
1371
  }
1360
- ) : /* @__PURE__ */ t(Ie, {}),
1361
- /* @__PURE__ */ t(ie, { filterTip: !0 })
1372
+ ) : /* @__PURE__ */ t(Be, {}),
1373
+ /* @__PURE__ */ t(se, { filterTip: !0 })
1362
1374
  ] });
1363
1375
  }
1364
- return /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Ie, {}) });
1376
+ return /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(Be, {}) });
1365
1377
  }
1366
- const dr = (e, r, o, n) => tt(
1378
+ const hr = (e, r, o, n) => rt(
1367
1379
  async (i) => {
1368
1380
  i || (o.currentPage = o.defaultCurrentPage);
1369
- const { currentPage: s, pageSize: c } = o, l = {
1381
+ const { currentPage: a, pageSize: c } = o, l = {
1370
1382
  ...r,
1371
1383
  category: r.category === "All" ? "" : r.category,
1372
1384
  sortBy: P[r.sortBy],
1373
- page: s,
1385
+ page: a,
1374
1386
  pageSize: c
1375
1387
  };
1376
1388
  n(null);
1377
- const { data: p = {} } = await e.get(P.blockletsPath, { params: l });
1378
- return o.currentPage++, { page: s, pageSize: c, list: (p == null ? void 0 : p.dataList) || [], total: (p == null ? void 0 : p.total) || 0 };
1389
+ const { data: h = {} } = await e.get(P.blockletsPath, { params: l });
1390
+ return o.currentPage++, { page: a, pageSize: c, list: (h == null ? void 0 : h.dataList) || [], total: (h == null ? void 0 : h.total) || 0 };
1379
1391
  },
1380
1392
  {
1381
1393
  isNoMore: (i) => i ? i.page * i.pageSize >= i.total : !1,
@@ -1383,28 +1395,28 @@ const dr = (e, r, o, n) => tt(
1383
1395
  onError: n
1384
1396
  }
1385
1397
  );
1386
- function ur() {
1387
- var h;
1388
- const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: i } = I(), { filters: s } = r, c = rt({
1398
+ function pr() {
1399
+ var p;
1400
+ const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: i } = I(), { filters: a } = r, c = ot({
1389
1401
  currentPage: P.currentPage,
1390
1402
  pageSize: Wt() ? P.mobilePageSize : P.pageSize,
1391
1403
  defaultCurrentPage: P.defaultCurrentPage
1392
- }), [l, p] = L(null), d = dr(e, s, c, p), g = $(
1404
+ }), [l, h] = L(null), d = hr(e, a, c, h), g = j(
1393
1405
  () => {
1394
- var m, k;
1395
- return o ? o(((m = d.data) == null ? void 0 : m.list) || []) : ((k = d.data) == null ? void 0 : k.list) || [];
1406
+ var f, k;
1407
+ return o ? o(((f = d.data) == null ? void 0 : f.list) || []) : ((k = d.data) == null ? void 0 : k.list) || [];
1396
1408
  },
1397
1409
  [d.data, o]
1398
1410
  );
1399
- return j(() => {
1400
- const m = g.find((k) => k.owner.did === s.owner);
1401
- i((m == null ? void 0 : m.owner.fullName) || (m == null ? void 0 : m.author.name) || "");
1402
- }, [s.owner, g, i]), {
1411
+ return H(() => {
1412
+ const f = g.find((k) => k.owner.did === a.owner);
1413
+ i((f == null ? void 0 : f.owner.fullName) || (f == null ? void 0 : f.author.name) || "");
1414
+ }, [a.owner, g, i]), {
1403
1415
  blocklets: g,
1404
1416
  fetchBlockletsError: l,
1405
1417
  loadMore: d.loadMore,
1406
1418
  hasNextPage: !d.noMore,
1407
- total: (h = d.data) == null ? void 0 : h.total,
1419
+ total: (p = d.data) == null ? void 0 : p.total,
1408
1420
  loadings: {
1409
1421
  fetchBlockletsLoading: d.loading,
1410
1422
  loadingMore: d.loadingMore
@@ -1415,40 +1427,40 @@ function ur() {
1415
1427
  }
1416
1428
  };
1417
1429
  }
1418
- function hr() {
1419
- const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: i, minItemWidth: s, layout: c, baseSearch: l } = I(), { filters: p } = r, { blocklets: d, errors: g, loadMore: h, loadings: m, hasNextPage: k, total: C } = ur(), [S] = Ct({
1420
- loading: m.fetchBlockletsLoading || m.loadingMore,
1430
+ function mr() {
1431
+ const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: i, minItemWidth: a, layout: c, baseSearch: l } = I(), { filters: h } = r, { blocklets: d, errors: g, loadMore: p, loadings: f, hasNextPage: k, total: C } = pr(), [S] = Ct({
1432
+ loading: f.fetchBlockletsLoading || f.loadingMore,
1421
1433
  hasNextPage: k,
1422
- onLoadMore: h
1434
+ onLoadMore: p
1423
1435
  });
1424
1436
  if (g.fetchBlockletsError) {
1425
1437
  const y = new Error(`Failed to fetch blocklets from ${o}: ${g.fetchBlockletsError.message}`);
1426
- return /* @__PURE__ */ t(ue, { error: y });
1438
+ return /* @__PURE__ */ t(pe, { error: y });
1427
1439
  }
1428
- const B = l && c.showSearch || !p.keyword;
1429
- return /* @__PURE__ */ f(N, { children: [
1430
- B ? /* @__PURE__ */ t(ar, {}) : /* @__PURE__ */ f(N, { children: [
1431
- /* @__PURE__ */ t(fe, { xs: /* @__PURE__ */ t(He, {}), md: null }),
1440
+ const B = l && c.showSearch || !h.keyword;
1441
+ return /* @__PURE__ */ m(D, { children: [
1442
+ B ? /* @__PURE__ */ t(dr, {}) : /* @__PURE__ */ m(D, { children: [
1443
+ /* @__PURE__ */ t(ye, { xs: /* @__PURE__ */ t(Ge, {}), md: null }),
1432
1444
  v()
1433
1445
  ] }),
1434
1446
  u(),
1435
- !m.fetchBlockletsLoading && k && /* @__PURE__ */ t(w, { height: 60, display: "flex", justifyContent: "center", py: 2, ref: S, children: /* @__PURE__ */ t(ee, {}) })
1447
+ !f.fetchBlockletsLoading && k && /* @__PURE__ */ t(x, { height: 60, display: "flex", justifyContent: "center", py: 2, ref: S, children: /* @__PURE__ */ t(te, {}) })
1436
1448
  ] });
1437
1449
  function u() {
1438
- return m.fetchBlockletsLoading ? /* @__PURE__ */ t(qe, { mt: 15 }) : d.length ? /* @__PURE__ */ t(
1439
- w,
1450
+ return f.fetchBlockletsLoading ? /* @__PURE__ */ t(qe, { mt: 15 }) : d.length ? /* @__PURE__ */ t(
1451
+ x,
1440
1452
  {
1441
1453
  className: "blocklet-list",
1442
1454
  display: "grid",
1443
- gridTemplateColumns: `repeat(auto-fill, minmax(${s}px, 1fr))`,
1455
+ gridTemplateColumns: `repeat(auto-fill, minmax(${a}px, 1fr))`,
1444
1456
  p: "2px",
1445
1457
  gap: 2,
1446
- children: d.map((y) => /* @__PURE__ */ t(w, { "data-blocklet-did": y.did, sx: { minWidth: s }, children: n({ blocklet: y, blocklets: d, serverVersion: i }) }, y.did))
1458
+ children: d.map((y) => /* @__PURE__ */ t(x, { "data-blocklet-did": y.did, sx: { minWidth: a }, children: n({ blocklet: y, blocklets: d, serverVersion: i }) }, y.did))
1447
1459
  }
1448
- ) : /* @__PURE__ */ t(cr, {});
1460
+ ) : /* @__PURE__ */ t(ur, {});
1449
1461
  }
1450
1462
  function v() {
1451
- return /* @__PURE__ */ f(
1463
+ return /* @__PURE__ */ m(
1452
1464
  T,
1453
1465
  {
1454
1466
  direction: "row",
@@ -1458,17 +1470,17 @@ function hr() {
1458
1470
  mb: 2,
1459
1471
  mt: { xs: 2, md: 0 },
1460
1472
  children: [
1461
- /* @__PURE__ */ t(x, { variant: "h3", children: e("blocklet.search", { keyword: p.keyword }) }),
1462
- /* @__PURE__ */ t(x, { variant: "body1", color: "text.lighter", fontSize: 13, children: e("blocklet.resultCount", { count: C }) })
1473
+ /* @__PURE__ */ t(w, { variant: "h3", children: e("blocklet.search", { keyword: h.keyword }) }),
1474
+ /* @__PURE__ */ t(w, { variant: "body1", color: "text.lighter", fontSize: 13, children: e("blocklet.resultCount", { count: C }) })
1463
1475
  ]
1464
1476
  }
1465
1477
  );
1466
1478
  }
1467
1479
  }
1468
- function pr() {
1469
- const { t: e, selectedCategory: r, getCategoryLocale: o } = I(), { toggleOpen: n } = me();
1470
- return /* @__PURE__ */ f(
1471
- x,
1480
+ function fr() {
1481
+ const { t: e, selectedCategory: r, getCategoryLocale: o } = I(), { toggleOpen: n } = ge();
1482
+ return /* @__PURE__ */ m(
1483
+ w,
1472
1484
  {
1473
1485
  variant: "body1",
1474
1486
  display: { xs: "flex", md: "none" },
@@ -1483,19 +1495,19 @@ function pr() {
1483
1495
  }
1484
1496
  );
1485
1497
  }
1486
- function mr() {
1498
+ function gr() {
1487
1499
  const { search: e, layout: r } = I(), { filters: o } = e, n = o.category || o.keyword || o.price;
1488
- return /* @__PURE__ */ t(Ot, { children: /* @__PURE__ */ f(Qe, { FallbackComponent: ue, children: [
1489
- /* @__PURE__ */ t(pr, {}),
1490
- /* @__PURE__ */ f(w, { display: "flex", height: "100%", className: "list-container", pt: { xs: 0, md: 5 }, children: [
1500
+ return /* @__PURE__ */ t(Ot, { children: /* @__PURE__ */ m(Ye, { FallbackComponent: pe, children: [
1501
+ /* @__PURE__ */ t(fr, {}),
1502
+ /* @__PURE__ */ m(x, { display: "flex", height: "100%", className: "list-container", pt: { xs: 0, md: 5 }, children: [
1491
1503
  /* @__PURE__ */ t(Qt, {}),
1492
- /* @__PURE__ */ t(T, { height: "100%", position: "relative", flex: 1, overflow: "visible", children: r.showExplore && !n ? /* @__PURE__ */ t(rr, {}) : /* @__PURE__ */ t(hr, {}) })
1504
+ /* @__PURE__ */ t(T, { height: "100%", position: "relative", flex: 1, overflow: "visible", children: r.showExplore && !n ? /* @__PURE__ */ t(nr, {}) : /* @__PURE__ */ t(mr, {}) })
1493
1505
  ] })
1494
1506
  ] }) });
1495
1507
  }
1496
- function So(e) {
1497
- const r = de(), o = Ge(
1498
- Xe({
1508
+ function Bo(e) {
1509
+ const r = he(), o = Ke(
1510
+ Qe({
1499
1511
  ...r,
1500
1512
  typography: {
1501
1513
  h1: {
@@ -1523,11 +1535,11 @@ function So(e) {
1523
1535
  }
1524
1536
  })
1525
1537
  );
1526
- return /* @__PURE__ */ t(Ke, { theme: o, children: /* @__PURE__ */ t(Ht, { ...e, children: /* @__PURE__ */ t(mr, {}) }) });
1538
+ return /* @__PURE__ */ t(Xe, { theme: o, children: /* @__PURE__ */ t(Vt, { ...e, children: /* @__PURE__ */ t(gr, {}) }) });
1527
1539
  }
1528
1540
  export {
1529
- or as Autocomplete,
1541
+ lr as Autocomplete,
1530
1542
  Yt as Image,
1531
- So as default,
1532
- _t as useSearch
1543
+ Bo as default,
1544
+ Et as useSearch
1533
1545
  };