@blocklet/pages-kit-inner-components 0.4.159 → 0.5.0

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.
@@ -1,47 +1,47 @@
1
1
  import { jsx as e, jsxs as D } from "react/jsx-runtime";
2
- import { d as q, e as pe, g as me, u as de, c as ge } from "./state-C_CbKF7g.js";
3
- import { useLocaleContext as K } from "@arcblock/ux/lib/Locale/context";
4
- import Q from "@arcblock/ux/lib/Result";
5
- import { useHeaderState as fe } from "@blocklet/pages-kit/builtin/page/header";
6
- import { useColorConvert as he } from "@blocklet/pages-kit/contexts/color";
7
- import { setPageDataSource as X } from "@blocklet/pages-kit/utils/data-source";
8
- import { generateParamCombinations as be } from "@blocklet/pages-kit/utils/route";
2
+ import { d as K, e as me, g as de, u as ge, c as fe } from "./state-C_CbKF7g.js";
3
+ import { useLocaleContext as Q } from "@arcblock/ux/lib/Locale/context";
4
+ import X from "@arcblock/ux/lib/Result";
5
+ import { useHeaderState as he } from "@blocklet/pages-kit/builtin/page/header";
6
+ import { useColorConvert as be } from "@blocklet/pages-kit/contexts/color";
7
+ import { setPageDataSource as Y } from "@blocklet/pages-kit/utils/data-source";
8
+ import { generateParamCombinations as ve } from "@blocklet/pages-kit/utils/route";
9
9
  import ye from "@blocklet/ui-react/lib/Header";
10
- import { cx as Y } from "@emotion/css";
11
- import { Global as J, css as Z } from "@emotion/react";
12
- import ee from "@emotion/styled";
13
- import { Box as L, CircularProgress as ve, useTheme as te, Button as we, Stack as Se, alpha as G, useMediaQuery as xe } from "@mui/material";
14
- import { useReactive as oe, useScroll as ke } from "ahooks";
15
- import Pe from "isomorphic-dompurify";
10
+ import { cx as J } from "@emotion/css";
11
+ import { Global as Z, css as ee } from "@emotion/react";
12
+ import te from "@emotion/styled";
13
+ import { Box as L, CircularProgress as we, useTheme as oe, Button as xe, Stack as Se, alpha as W, useMediaQuery as Pe } from "@mui/material";
14
+ import { useReactive as ne, useScroll as ke } from "ahooks";
15
+ import Ce from "isomorphic-dompurify";
16
16
  import N from "lodash/cloneDeep";
17
- import Ce from "lodash/isEmpty";
18
- import ne from "lodash/isEqual";
19
- import { useEffect as O, useContext as Ie, lazy as re, useMemo as j, useRef as ae, Suspense as Re, useState as je } from "react";
20
- import { Helmet as Ee } from "react-helmet";
21
- import { useSearchParams as se, Routes as Me, Route as I, Navigate as Te, ScrollRestoration as Be } from "react-router-dom";
22
- import { useAsync as ie } from "react-use";
17
+ import Ie from "lodash/isEmpty";
18
+ import re from "lodash/isEqual";
19
+ import { useEffect as F, useContext as Re, lazy as ae, useMemo as j, useRef as se, Suspense as je, useState as Ee } from "react";
20
+ import { Helmet as Me } from "react-helmet";
21
+ import { useSearchParams as ie, Routes as Te, Route as I, Navigate as Be, ScrollRestoration as Oe } from "react-router-dom";
22
+ import { useAsync as le } from "react-use";
23
23
  import { joinURL as R } from "ufo";
24
- import { S as Fe, n as Oe, P as Le, a as _e, B as Ae, g as De } from "./array-BAy40Bak.js";
25
- import { styled as le, useTheme as Ne } from "@arcblock/ux/lib/Theme";
26
- import $e from "@blocklet/ui-react/lib/Footer";
24
+ import { S as Fe, n as Le, P as _e, a as Ae, B as De, g as Ne } from "./array-D52_0LRy.js";
25
+ import { styled as ce, useTheme as $e } from "@arcblock/ux/lib/Theme";
26
+ import He from "@blocklet/ui-react/lib/Footer";
27
27
  import "webfontloader";
28
- import { createAuthServiceSessionContext as He } from "@arcblock/did-connect/lib/Session";
29
- const Ue = le($e, { shouldForwardProp: (t) => !!t })`
28
+ import { createAuthServiceSessionContext as Ue } from "@arcblock/did-connect/lib/Session";
29
+ const Ve = ce(He, { shouldForwardProp: (t) => !!t })`
30
30
  & > div > .MuiContainer-root {
31
31
  max-width: unset;
32
32
  }
33
33
  `;
34
- function Ve({ meta: t, ...n }) {
35
- const r = Ne();
36
- return /* @__PURE__ */ e(Ue, { ...n, meta: t, theme: r || {} });
37
- }
38
- function ze(t) {
39
- return /* @__PURE__ */ e(L, { display: "flex", flex: 1, height: "100%", alignItems: "center", justifyContent: "center", ...t, children: /* @__PURE__ */ e(ve, { size: 30 }) });
34
+ function ze({ meta: t, ...n }) {
35
+ const r = $e();
36
+ return /* @__PURE__ */ e(Ve, { ...n, meta: t, theme: r || {} });
40
37
  }
41
38
  function Ge(t) {
42
- return /* @__PURE__ */ e(We, { ...t });
39
+ return /* @__PURE__ */ e(L, { display: "flex", flex: 1, height: "100%", alignItems: "center", justifyContent: "center", ...t, children: /* @__PURE__ */ e(we, { size: 30 }) });
40
+ }
41
+ function We(t) {
42
+ return /* @__PURE__ */ e(qe, { ...t });
43
43
  }
44
- const We = le(L)`
44
+ const qe = ce(L)`
45
45
  position: fixed;
46
46
  left: 0;
47
47
  top: 0;
@@ -52,21 +52,21 @@ const We = le(L)`
52
52
  opacity: 0.7;
53
53
  transform: translateX(-23%) translateY(70%) rotate(-45deg);
54
54
  pointer-events: none;
55
- `, qe = `Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
55
+ `, Ke = `Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
56
56
  sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;
57
- function Ke({
57
+ function Qe({
58
58
  titleFontFamily: t,
59
59
  descriptionFontFamily: n
60
60
  }) {
61
61
  var o;
62
- const r = te(), a = (o = r == null ? void 0 : r.typography) == null ? void 0 : o.fontFamily;
63
- O(() => {
62
+ const r = oe(), a = (o = r == null ? void 0 : r.typography) == null ? void 0 : o.fontFamily;
63
+ F(() => {
64
64
  }, [t, n]);
65
- const l = `${a}, ${qe}`;
65
+ const l = `${a}, ${Ke}`;
66
66
  return /* @__PURE__ */ e(
67
- J,
67
+ Z,
68
68
  {
69
- styles: Z`
69
+ styles: ee`
70
70
  #app {
71
71
  font-family: ${l};
72
72
 
@@ -82,84 +82,84 @@ function Ke({
82
82
  }
83
83
  );
84
84
  }
85
- const { SessionProvider: Bt, SessionContext: Qe, SessionConsumer: Ft, withSession: Ot } = He();
85
+ const { SessionProvider: Ot, SessionContext: Xe, SessionConsumer: Ft, withSession: Lt } = Ue();
86
86
  function U() {
87
- return Ie(Qe);
87
+ return Re(Xe);
88
88
  }
89
- function Xe(...t) {
89
+ function Ye(...t) {
90
90
  var r;
91
91
  const { session: n } = U();
92
92
  return t.includes((r = n.user) == null ? void 0 : r.role);
93
93
  }
94
- function Ye(...t) {
94
+ function Je(...t) {
95
95
  var a;
96
- const { session: n } = U(), r = Xe(...t);
96
+ const { session: n } = U(), r = Ye(...t);
97
97
  return ((a = window.blocklet) == null ? void 0 : a.tenantMode) === "multiple" ? !!n.user : r;
98
98
  }
99
- function Lt() {
100
- const [t] = se(), { session: n } = U(), r = Ye("owner", "admin", "pagesEditor", "member"), a = j(() => {
99
+ function _t() {
100
+ const [t] = ie(), { session: n } = U(), r = Je("owner", "admin", "pagesEditor", "member"), a = j(() => {
101
101
  const o = t.get("mode");
102
102
  return Fe.includes(o) ? o : "production";
103
103
  }, [t]), l = a === "production" ? a : n.user ? r ? a : "production" : null;
104
- return l ? /* @__PURE__ */ e(Je, { mode: l }) : null;
104
+ return l ? /* @__PURE__ */ e(Ze, { mode: l }) : null;
105
105
  }
106
- function Je({ mode: t }) {
106
+ function Ze({ mode: t }) {
107
107
  if (t !== "draft") {
108
108
  const n = window.__PAGE_STATE__;
109
- return n ? /* @__PURE__ */ e(H, { mode: t, state: n }) : /* @__PURE__ */ e(et, { mode: t, children: ({ state: r }) => /* @__PURE__ */ e(H, { mode: t, state: r }) });
109
+ return n ? /* @__PURE__ */ e(H, { mode: t, state: n }) : /* @__PURE__ */ e(tt, { mode: t, children: ({ state: r }) => /* @__PURE__ */ e(H, { mode: t, state: r }) });
110
110
  }
111
- return /* @__PURE__ */ e(Ze, { children: ({ state: n }) => /* @__PURE__ */ e(H, { mode: t, state: n }) });
111
+ return /* @__PURE__ */ e(et, { children: ({ state: n }) => /* @__PURE__ */ e(H, { mode: t, state: n }) });
112
112
  }
113
- const Ze = re(() => import("./draft-data-B7-JQvuO.js"));
114
- function et({
113
+ const et = ae(() => import("./draft-data-B7-JQvuO.js"));
114
+ function tt({
115
115
  mode: t,
116
116
  children: n
117
117
  }) {
118
- const r = document.querySelector('meta[property="pages:version"]'), a = r == null ? void 0 : r.content, l = de(), o = j(() => {
118
+ const r = document.querySelector('meta[property="pages:version"]'), a = r == null ? void 0 : r.content, l = ge(), o = j(() => {
119
119
  if (a === "{{pagesPublishedAt}}") {
120
- const c = localStorage.getItem(ge(l ?? ""));
120
+ const c = localStorage.getItem(fe(l ?? ""));
121
121
  return Number(c) ? Number(c) : (/* @__PURE__ */ new Date()).getTime();
122
122
  }
123
123
  return Number(a);
124
- }, [a]), { loading: d, value: s } = ie(() => De({ mode: t, version: o }), [t, o]);
125
- return d ? /* @__PURE__ */ e(ze, {}) : s ? n({ state: s }) : null;
124
+ }, [a]), { loading: d, value: s } = le(() => Ne({ mode: t, version: o }), [t, o]);
125
+ return d ? /* @__PURE__ */ e(Ge, {}) : s ? n({ state: s }) : null;
126
126
  }
127
127
  function H({ mode: t, state: n }) {
128
- const { t: r, locale: a } = K(), [l] = se(), o = l.get("hiddenBadge") === "true", d = l.get("showPublish") === "true", {
128
+ const { t: r, locale: a } = Q(), [l] = ie(), o = l.get("hiddenBadge") === "true", d = l.get("showPublish") === "true", {
129
129
  pageIds: s,
130
130
  pages: c,
131
131
  routeIds: g,
132
- routes: u,
133
- supportedLocales: p,
134
- config: { defaultLocale: b },
135
- resources: v
136
- } = n, w = q(n), y = j(
137
- () => p != null && p.some((m) => m.locale === a) ? a : void 0,
138
- [a, p]
139
- ), f = Object.values(u).find((m) => (m == null ? void 0 : m.path) === "/") ? void 0 : Object.values(c)[0], _ = j(
140
- () => s.map((m) => {
141
- const i = c[m];
132
+ routes: p,
133
+ supportedLocales: m,
134
+ config: { defaultLocale: f },
135
+ resources: y
136
+ } = n, w = K(n), b = j(
137
+ () => m != null && m.some((u) => u.locale === a) ? a : void 0,
138
+ [a, m]
139
+ ), E = Object.values(p || {}).find((u) => (u == null ? void 0 : u.path) === "/") || Object.values(c).find((u) => (u == null ? void 0 : u.slug) === "/") ? void 0 : Object.values(c)[0], _ = j(
140
+ () => s.map((u) => {
141
+ const i = c[u];
142
142
  return i && {
143
143
  id: i.id,
144
- path: R("/", y || "", i.slug, t !== "production" ? `?mode=${t}` : "")
144
+ path: R("/", b || "", i.slug, t !== "production" ? `?mode=${t}` : "")
145
145
  };
146
- }).filter(Oe),
147
- [s, c, y, t]
148
- ), k = ([...m]) => (t !== "production" && d && m.unshift(
149
- /* @__PURE__ */ e(Re, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(tt, { mode: "production", state: n }) })
150
- ), m);
151
- return /* @__PURE__ */ D(Le, { value: { pages: _ }, children: [
152
- /* @__PURE__ */ D(Me, { children: [
153
- f && /* @__PURE__ */ e(I, { index: !0, element: /* @__PURE__ */ e(Te, { to: R("/", y || "", f.slug) }) }),
154
- g == null ? void 0 : g.map((m) => {
155
- var E, M, T, S;
156
- const i = u == null ? void 0 : u[m];
146
+ }).filter(Le),
147
+ [s, c, b, t]
148
+ ), P = ([...u]) => (t !== "production" && d && u.unshift(
149
+ /* @__PURE__ */ e(je, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(ot, { mode: "production", state: n }) })
150
+ ), u);
151
+ return /* @__PURE__ */ D(_e, { value: { pages: _ }, children: [
152
+ /* @__PURE__ */ D(Te, { children: [
153
+ E && /* @__PURE__ */ e(I, { index: !0, element: /* @__PURE__ */ e(Be, { to: R("/", b || "", E.slug) }) }),
154
+ g == null ? void 0 : g.map((u) => {
155
+ var M, T, x, h;
156
+ const i = p == null ? void 0 : p[u];
157
157
  if (!i || !i.displayTemplateId) return null;
158
- const P = c[i.displayTemplateId];
159
- if (!P) return null;
158
+ const k = c[i.displayTemplateId];
159
+ if (!k) return null;
160
160
  let C = [];
161
161
  if (i.params && i.params.length > 0) {
162
- const h = be({
162
+ const S = ve({
163
163
  basePath: i.path,
164
164
  params: i.params,
165
165
  routeId: i.id,
@@ -169,28 +169,28 @@ function H({ mode: t, state: n }) {
169
169
  currentOptionIds: [],
170
170
  result: []
171
171
  });
172
- C = h == null ? void 0 : h.map((x) => {
173
- var B, F, V, z;
174
- const A = x.paramOptionIds.join("-");
172
+ C = S == null ? void 0 : S.map((A) => {
173
+ var O, V, z, G;
174
+ const B = A.paramOptionIds.join("-");
175
175
  return /* @__PURE__ */ e(
176
176
  I,
177
177
  {
178
- path: R(":projectIdOrSlug?", x.path),
178
+ path: R(":projectIdOrSlug?", A.path),
179
179
  element: /* @__PURE__ */ e(
180
- W,
180
+ q,
181
181
  {
182
182
  mode: t,
183
183
  components: w,
184
- page: P,
185
- locale: y,
186
- defaultLocale: b,
187
- headerAddons: k,
184
+ page: k,
185
+ locale: b,
186
+ defaultLocale: f,
187
+ headerAddons: P,
188
188
  state: n,
189
- pageData: (z = (V = (F = (B = i.dataSource) == null ? void 0 : B.pathDataMappings) == null ? void 0 : F[A]) == null ? void 0 : V.dataCache) == null ? void 0 : z[y || b || "en"]
189
+ pageData: (G = (z = (V = (O = i.dataSource) == null ? void 0 : O.pathDataMappings) == null ? void 0 : V[B]) == null ? void 0 : z.dataCache) == null ? void 0 : G[b || f || "en"]
190
190
  }
191
191
  )
192
192
  },
193
- A
193
+ B
194
194
  );
195
195
  });
196
196
  }
@@ -200,16 +200,16 @@ function H({ mode: t, state: n }) {
200
200
  {
201
201
  path: R(":projectIdOrSlug?", i.path),
202
202
  element: /* @__PURE__ */ e(
203
- W,
203
+ q,
204
204
  {
205
205
  mode: t,
206
206
  components: w,
207
- page: P,
208
- locale: y,
209
- defaultLocale: b,
210
- headerAddons: k,
207
+ page: k,
208
+ locale: b,
209
+ defaultLocale: f,
210
+ headerAddons: P,
211
211
  state: n,
212
- pageData: (S = (T = (M = (E = i.dataSource) == null ? void 0 : E.pathDataMappings) == null ? void 0 : M[i.id]) == null ? void 0 : T.dataCache) == null ? void 0 : S[y || b || "en"]
212
+ pageData: (h = (x = (T = (M = i.dataSource) == null ? void 0 : M.pathDataMappings) == null ? void 0 : T[i.id]) == null ? void 0 : x.dataCache) == null ? void 0 : h[b || f || "en"]
213
213
  }
214
214
  )
215
215
  },
@@ -217,8 +217,8 @@ function H({ mode: t, state: n }) {
217
217
  )
218
218
  ), C;
219
219
  }),
220
- s.map((m) => {
221
- const i = c[m];
220
+ s.map((u) => {
221
+ const i = c[u];
222
222
  return i ? /* @__PURE__ */ e(
223
223
  I,
224
224
  {
@@ -229,28 +229,28 @@ function H({ mode: t, state: n }) {
229
229
  mode: t,
230
230
  components: w,
231
231
  page: i,
232
- locale: y,
233
- defaultLocale: b,
234
- headerAddons: k
232
+ locale: b,
233
+ defaultLocale: f,
234
+ headerAddons: P
235
235
  }
236
236
  )
237
237
  },
238
238
  i.id
239
239
  ) : null;
240
240
  }),
241
- v.pages && Object.values(v.pages).map(({ blockletId: m, page: i }) => /* @__PURE__ */ e(
241
+ y.pages && Object.values(y.pages).map(({ blockletId: u, page: i }) => /* @__PURE__ */ e(
242
242
  I,
243
243
  {
244
- path: R("/", `@${m}`, i.slug),
244
+ path: R("/", `@${u}`, i.slug),
245
245
  element: /* @__PURE__ */ e(
246
246
  $,
247
247
  {
248
248
  mode: t,
249
249
  components: w,
250
250
  page: i,
251
- locale: y,
252
- defaultLocale: b,
253
- headerAddons: k
251
+ locale: b,
252
+ defaultLocale: f,
253
+ headerAddons: P
254
254
  }
255
255
  )
256
256
  },
@@ -260,15 +260,15 @@ function H({ mode: t, state: n }) {
260
260
  I,
261
261
  {
262
262
  path: "*",
263
- element: /* @__PURE__ */ e(L, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(Q, { status: 404, extra: /* @__PURE__ */ e(ue, { href: "/", children: r("common.back") }) }) })
263
+ element: /* @__PURE__ */ e(L, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(X, { status: 404, extra: /* @__PURE__ */ e(pe, { href: "/", children: r("common.back") }) }) })
264
264
  }
265
265
  )
266
266
  ] }),
267
- t !== "production" && !o && /* @__PURE__ */ e(Ge, { sx: { bgcolor: "info.light" }, children: t }),
268
- /* @__PURE__ */ e(Ke, {})
267
+ t !== "production" && !o && /* @__PURE__ */ e(We, { sx: { bgcolor: "info.light" }, children: t }),
268
+ /* @__PURE__ */ e(Qe, {})
269
269
  ] });
270
270
  }
271
- function W({
271
+ function q({
272
272
  mode: t,
273
273
  pageData: n,
274
274
  components: r,
@@ -278,16 +278,16 @@ function W({
278
278
  headerAddons: d,
279
279
  state: s
280
280
  }) {
281
- const c = oe({
281
+ const c = ne({
282
282
  page: null
283
283
  });
284
- O(() => {
285
- const u = a || null;
286
- u ? c.page = N(u) : c.page = null;
284
+ F(() => {
285
+ const p = a || null;
286
+ p ? c.page = N(p) : c.page = null;
287
287
  }, [a, c]);
288
- const g = ae();
289
- return O(() => {
290
- ne(n, g.current) || n && c.page && (X(c.page, s, l, n), g.current = N(n));
288
+ const g = se();
289
+ return F(() => {
290
+ re(n, g.current) || n && c.page && (Y(c.page, s, l, n), g.current = N(n));
291
291
  }, [c.page, n, l, s]), c.page ? /* @__PURE__ */ e(
292
292
  $,
293
293
  {
@@ -300,40 +300,40 @@ function W({
300
300
  }
301
301
  ) : null;
302
302
  }
303
- function _t({
303
+ function At({
304
304
  mode: t,
305
305
  state: n,
306
306
  path: r,
307
307
  pageData: a
308
308
  }) {
309
- const { t: l, locale: o } = K(), {
309
+ const { t: l, locale: o } = Q(), {
310
310
  pages: d,
311
311
  supportedLocales: s,
312
312
  config: { defaultLocale: c },
313
313
  resources: g
314
- } = n, u = Object.values(d).find((f) => (f == null ? void 0 : f.slug) === r), p = Object.values(g.pages || {}).find((f) => f.page.slug === r), b = j(
315
- () => s != null && s.some((f) => f.locale === o) ? o : void 0,
314
+ } = n, p = Object.values(d).find((v) => (v == null ? void 0 : v.slug) === r), m = Object.values(g.pages || {}).find((v) => v.page.slug === r), f = j(
315
+ () => s != null && s.some((v) => v.locale === o) ? o : void 0,
316
316
  [o, s]
317
- ), v = oe({
317
+ ), y = ne({
318
318
  page: null
319
319
  });
320
- O(() => {
321
- const f = u || (p == null ? void 0 : p.page) || null;
322
- f ? v.page = N(f) : v.page = null;
323
- }, [u, p]);
324
- const w = ae();
325
- if (O(() => {
326
- ne(a, w.current) || a && v.page && (X(v.page, n, b, a), w.current = N(a));
327
- }, [{}]), !u && !(p != null && p.page))
328
- return /* @__PURE__ */ e(L, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(Q, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(ue, { href: "/", children: l("common.back") }) }) });
329
- const y = q(n);
330
- return v.page ? /* @__PURE__ */ e(
320
+ F(() => {
321
+ const v = p || (m == null ? void 0 : m.page) || null;
322
+ v ? y.page = N(v) : y.page = null;
323
+ }, [p, m]);
324
+ const w = se();
325
+ if (F(() => {
326
+ re(a, w.current) || a && y.page && (Y(y.page, n, f, a), w.current = N(a));
327
+ }, [{}]), !p && !(m != null && m.page))
328
+ return /* @__PURE__ */ e(L, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(X, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(pe, { href: "/", children: l("common.back") }) }) });
329
+ const b = K(n);
330
+ return y.page ? /* @__PURE__ */ e(
331
331
  $,
332
332
  {
333
333
  mode: t,
334
- components: y,
335
- page: v.page,
336
- locale: b,
334
+ components: b,
335
+ page: y.page,
336
+ locale: f,
337
337
  defaultLocale: c
338
338
  }
339
339
  ) : null;
@@ -346,20 +346,20 @@ function $({
346
346
  defaultLocale: l,
347
347
  headerAddons: o
348
348
  }) {
349
- var _, k, m, i, P, C, E, M, T;
350
- const d = he(), s = ((_ = r.locales) == null ? void 0 : _[a]) ?? ((k = r.locales) == null ? void 0 : k[l]) ?? {}, c = s.title || ((m = window.blocklet) == null ? void 0 : m.appName), g = s.description || ((i = window.blocklet) == null ? void 0 : i.appDescription), u = pe(me(s.image), 540), { logo: p, brand: b, description: v, ...w } = fe(), y = j(
351
- () => (S) => {
352
- var x;
353
- let h = (o == null ? void 0 : o(S)) ?? S;
354
- return h = ((x = w.addons) == null ? void 0 : x.call(w, h)) ?? h, h;
349
+ var E, _, P, u, i, k, C, M, T;
350
+ const d = be(), s = ((E = r.locales) == null ? void 0 : E[a]) ?? ((_ = r.locales) == null ? void 0 : _[l]) ?? {}, c = s.title || ((P = window.blocklet) == null ? void 0 : P.appName), g = s.description || ((u = window.blocklet) == null ? void 0 : u.appDescription), p = me(de(s.image), 540), { logo: m, brand: f, description: y, ...w } = he(), b = j(
351
+ () => (x) => {
352
+ var S;
353
+ let h = (o == null ? void 0 : o(x)) ?? x;
354
+ return h = ((S = w.addons) == null ? void 0 : S.call(w, h)) ?? h, h;
355
355
  },
356
356
  [w.addons, o]
357
- ), f = (P = s.header) != null && P.translucent ? nt : ce;
358
- return /* @__PURE__ */ D(_e, { page: r, defaultLocale: l, currentLocale: a, children: [
357
+ ), v = (i = s.header) != null && i.translucent ? rt : ue;
358
+ return /* @__PURE__ */ D(Ae, { page: r, defaultLocale: l, currentLocale: a, children: [
359
359
  /* @__PURE__ */ e(
360
- J,
360
+ Z,
361
361
  {
362
- styles: Z`
362
+ styles: ee`
363
363
  body {
364
364
  background-color: ${d(
365
365
  !s.backgroundColor || s.backgroundColor === "transparent" ? "background.default" : s.backgroundColor
@@ -369,26 +369,26 @@ function $({
369
369
  }
370
370
  ),
371
371
  /* @__PURE__ */ e(
372
- f,
372
+ v,
373
373
  {
374
- hideNavMenu: !!((C = s.header) != null && C.hideNavMenus),
375
- translucentTextColor: (E = s.header) == null ? void 0 : E.translucentTextColor,
376
- ...p ? { logo: p } : {},
377
- ...b ? { brand: b } : {},
378
- ...v ? { description: v } : {},
379
- className: Y(((M = s.header) == null ? void 0 : M.sticky) && "sticky", "page-header"),
374
+ hideNavMenu: !!((k = s.header) != null && k.hideNavMenus),
375
+ translucentTextColor: (C = s.header) == null ? void 0 : C.translucentTextColor,
376
+ ...m ? { logo: m } : {},
377
+ ...f ? { brand: f } : {},
378
+ ...y ? { description: y } : {},
379
+ className: J(((M = s.header) == null ? void 0 : M.sticky) && "sticky", "page-header"),
380
380
  maxWidth: !1,
381
- addons: y
381
+ addons: b
382
382
  }
383
383
  ),
384
- /* @__PURE__ */ e(Be, {}),
385
- /* @__PURE__ */ D(Ee, { children: [
384
+ /* @__PURE__ */ e(Oe, {}),
385
+ /* @__PURE__ */ D(Me, { children: [
386
386
  /* @__PURE__ */ e("title", { children: c }),
387
387
  /* @__PURE__ */ e("meta", { name: "og:title", content: c }),
388
388
  /* @__PURE__ */ e("meta", { name: "og:description", content: g }),
389
- /* @__PURE__ */ e("meta", { name: "og:image", content: u }),
390
- /* @__PURE__ */ e("meta", { name: "twitter:image:src", content: u }),
391
- /* @__PURE__ */ e("meta", { name: "twitter:image", content: u }),
389
+ /* @__PURE__ */ e("meta", { name: "og:image", content: p }),
390
+ /* @__PURE__ */ e("meta", { name: "twitter:image:src", content: p }),
391
+ /* @__PURE__ */ e("meta", { name: "twitter:image", content: p }),
392
392
  /* @__PURE__ */ e("meta", { property: "twitter:description", content: g }),
393
393
  /* @__PURE__ */ e("meta", { property: "twitter:title", content: c }),
394
394
  /* @__PURE__ */ e("meta", { name: "description", content: g })
@@ -404,20 +404,20 @@ function $({
404
404
  pt: "0 !important"
405
405
  }
406
406
  },
407
- children: r.sectionIds.map((S) => {
408
- var B, F;
409
- const h = r.sections[S];
407
+ children: r.sectionIds.map((x) => {
408
+ var B, O;
409
+ const h = r.sections[x];
410
410
  if (!h || h.visibility === "hidden") return null;
411
- const x = (B = h.locales) == null ? void 0 : B[a], A = ((F = h.locales) == null ? void 0 : F[l]) ?? {};
411
+ const S = (B = h.locales) == null ? void 0 : B[a], A = ((O = h.locales) == null ? void 0 : O[l]) ?? {};
412
412
  return /* @__PURE__ */ e(
413
- Ae,
413
+ De,
414
414
  {
415
- id: S,
415
+ id: x,
416
416
  type: h.component,
417
417
  mode: t,
418
418
  section: h,
419
419
  config: {
420
- ...Ce(x) ? A : x,
420
+ ...Ie(S) ? A : S,
421
421
  locale: a,
422
422
  dev: t === "draft" ? {
423
423
  mode: t,
@@ -426,22 +426,22 @@ function $({
426
426
  } : { mode: t }
427
427
  }
428
428
  },
429
- S
429
+ x
430
430
  );
431
431
  })
432
432
  }
433
433
  ),
434
- !((T = s.footer) != null && T.hidden) && /* @__PURE__ */ e(Ve, {})
434
+ !((T = s.footer) != null && T.hidden) && /* @__PURE__ */ e(ze, {})
435
435
  ] });
436
436
  }
437
- const tt = re(() => import("./publish-button-CxEaqAku.js")), ce = ee(ye)`
437
+ const ot = ae(() => import("./publish-button-DMmhToxU.js")), ue = te(ye)`
438
438
  &.sticky {
439
439
  position: sticky;
440
440
  top: 0;
441
441
  }
442
442
  `;
443
- function ot({ logo: t }) {
444
- const [n, r] = je(), a = xe((o) => o.breakpoints.down("sm")), { value: l } = ie(() => {
443
+ function nt({ logo: t }) {
444
+ const [n, r] = Ee(), a = Pe((o) => o.breakpoints.down("sm")), { value: l } = le(() => {
445
445
  var s, c;
446
446
  const o = new URL(
447
447
  a ? ((s = window == null ? void 0 : window.blocklet) == null ? void 0 : s.appLogo) || "/.well-known/service/blocklet/logo" : ((c = window == null ? void 0 : window.blocklet) == null ? void 0 : c.appLogoRect) || "/.well-known/service/blocklet/logo-rect",
@@ -450,18 +450,18 @@ function ot({ logo: t }) {
450
450
  o.searchParams.delete("imageFilter"), o.searchParams.delete("f");
451
451
  const d = o.toString();
452
452
  return new Promise((g) => {
453
- fetch(d).then((u) => {
454
- const p = u.headers.get("content-type");
455
- p != null && p.includes("svg") && u.text().then((b) => {
456
- r(b), g(null);
457
- }), g(u.url);
453
+ fetch(d).then((p) => {
454
+ const m = p.headers.get("content-type");
455
+ m != null && m.includes("svg") && p.text().then((f) => {
456
+ r(f), g(null);
457
+ }), g(p.url);
458
458
  });
459
459
  });
460
460
  }, [a]);
461
461
  if (t)
462
462
  return t;
463
463
  if (n)
464
- return /* @__PURE__ */ e(L, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: Pe.sanitize(n) } });
464
+ return /* @__PURE__ */ e(L, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: Ce.sanitize(n) } });
465
465
  if (l) {
466
466
  const o = new URL(l);
467
467
  o.searchParams.set("imageFilter", "convert"), o.searchParams.set("f", "png"), o.searchParams.set("h", "80");
@@ -470,21 +470,21 @@ function ot({ logo: t }) {
470
470
  }
471
471
  return null;
472
472
  }
473
- function nt({
473
+ function rt({
474
474
  logo: t,
475
475
  translucentTextColor: n,
476
476
  ...r
477
477
  }) {
478
- const { top: a = 0 } = ke(() => document.getElementById("app")) || {}, l = te();
478
+ const { top: a = 0 } = ke(() => document.getElementById("app")) || {}, l = oe();
479
479
  let o = Math.min(a / 800, 1), d = "";
480
- return o > 0.1 ? (o = Math.max(o, 0.6), d = G(l.palette.text.primary, o)) : d = n || "#EEEEEE", /* @__PURE__ */ e(
481
- ce,
480
+ return o > 0.1 ? (o = Math.max(o, 0.6), d = W(l.palette.text.primary, o)) : d = n || "#EEEEEE", /* @__PURE__ */ e(
481
+ ue,
482
482
  {
483
- logo: /* @__PURE__ */ e(ot, { logo: t }),
483
+ logo: /* @__PURE__ */ e(nt, { logo: t }),
484
484
  ...r,
485
- className: Y(o <= 0.7 && "reverse-color"),
485
+ className: J(o <= 0.7 && "reverse-color"),
486
486
  style: {
487
- backgroundColor: G(l.palette.background.default, o),
487
+ backgroundColor: W(l.palette.background.default, o),
488
488
  // @ts-ignore
489
489
  "--logo-invert": o <= 0.7 ? 1 - o / 6 : 1 - o
490
490
  },
@@ -514,14 +514,14 @@ function nt({
514
514
  }
515
515
  );
516
516
  }
517
- const ue = ee(we)``;
517
+ const pe = te(xe)``;
518
518
  export {
519
- Lt as H,
520
- ze as L,
519
+ _t as H,
520
+ Ge as L,
521
521
  H as P,
522
- nt as T,
523
- Je as a,
524
- W as b,
525
- _t as c,
522
+ rt as T,
523
+ Ze as a,
524
+ q as b,
525
+ At as c,
526
526
  $ as d
527
527
  };