webim-adapter 0.19.0 → 0.20.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.
- package/build/webim-adapter.js +364 -125
- package/build/webim-embed.js +3 -2
- package/build/webim-ssr.js +336 -97
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -48,20 +48,20 @@ function h(e) {
|
|
|
48
48
|
color: j,
|
|
49
49
|
inset: M
|
|
50
50
|
})), N.length && (t.boxShadow = N.join(", "));
|
|
51
|
-
let P = (e) => e.type === "blur" ? `blur(${p(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: ee, filterBlur: L, filterGrayscale:
|
|
51
|
+
let P = (e) => e.type === "blur" ? `blur(${p(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: ee, filterBlur: L, filterGrayscale: te, filterBrightness: R, filterContrast: ne, filterSaturate: re } = t;
|
|
52
52
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
53
|
-
let
|
|
54
|
-
L !== void 0 &&
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
let { textStrokeWidth:
|
|
58
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
59
|
-
let { clipText:
|
|
60
|
-
delete t.clipText,
|
|
61
|
-
let { transitions:
|
|
53
|
+
let z = F(I);
|
|
54
|
+
L !== void 0 && z.push(`blur(${p(L)})`), te !== void 0 && z.push(`grayscale(${te}%)`), R !== void 0 && z.push(`brightness(${R}%)`), ne !== void 0 && z.push(`contrast(${ne}%)`), re !== void 0 && z.push(`saturate(${re}%)`), z.length && (t.filter = z.join(" "));
|
|
55
|
+
let ie = F(ee);
|
|
56
|
+
ie.length && (t.backdropFilter = ie.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
57
|
+
let { textStrokeWidth: ae, textStrokeColor: oe } = t;
|
|
58
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (ae !== void 0 || oe !== void 0) && (t.WebkitTextStroke = `${p(ae ?? 1)} ${oe || "currentColor"}`);
|
|
59
|
+
let { clipText: se } = t;
|
|
60
|
+
delete t.clipText, se && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
61
|
+
let { transitions: ce, transitionDuration: B, transitionEasing: V, transitionProperty: le } = t, H = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
62
62
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
63
|
-
let
|
|
64
|
-
if (
|
|
63
|
+
let U = (Array.isArray(ce) ? ce : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${H(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
64
|
+
if (B !== void 0 && U.push(`${le || "all"} ${H(B)} ${V || "ease"}`), U.length && (t.transition = U.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
65
65
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
66
66
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
67
67
|
}
|
|
@@ -284,7 +284,7 @@ function L(e, t) {
|
|
|
284
284
|
}
|
|
285
285
|
//#endregion
|
|
286
286
|
//#region src/bundle.js
|
|
287
|
-
function
|
|
287
|
+
function te({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
288
288
|
let a = {
|
|
289
289
|
...t?.global ?? {},
|
|
290
290
|
...t?.tenant ?? {}
|
|
@@ -308,18 +308,18 @@ function R({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
308
308
|
}
|
|
309
309
|
//#endregion
|
|
310
310
|
//#region src/fetchPage.js
|
|
311
|
-
var
|
|
311
|
+
var R = async (e) => {
|
|
312
312
|
let t = await e.json().catch(() => null);
|
|
313
313
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
314
314
|
return t?.payload ?? t;
|
|
315
315
|
};
|
|
316
|
-
async function
|
|
316
|
+
async function ne({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
317
317
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
318
318
|
if (!n) throw Error("fetchPage: slug is required");
|
|
319
319
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
320
320
|
...t ? { "x-tenant": t } : {},
|
|
321
321
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
322
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
322
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(R), c(`${l}/settings/public`, { headers: u }).then(R)]), p = te({
|
|
323
323
|
page: d,
|
|
324
324
|
settings: f,
|
|
325
325
|
tenant: t,
|
|
@@ -327,7 +327,7 @@ async function te({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
327
327
|
locale: r
|
|
328
328
|
}), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
|
|
329
329
|
if (m.length) {
|
|
330
|
-
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(
|
|
330
|
+
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(R).then((e) => {
|
|
331
331
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
332
332
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
333
333
|
}).catch(() => [[t, []]])));
|
|
@@ -445,14 +445,14 @@ new Map([
|
|
|
445
445
|
fallback: "sans-serif"
|
|
446
446
|
}
|
|
447
447
|
].map((e) => [e.family, e]));
|
|
448
|
-
function
|
|
448
|
+
function re(e) {
|
|
449
449
|
return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
|
|
450
450
|
}
|
|
451
|
-
var
|
|
451
|
+
var z = (e) => re([e]), ie = (e) => {
|
|
452
452
|
let t = typeof e == "string" && e.match(/^"([^"]+)"/);
|
|
453
453
|
return t ? t[1] : null;
|
|
454
454
|
};
|
|
455
|
-
function
|
|
455
|
+
function ae(e, t) {
|
|
456
456
|
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
457
457
|
for (let t of Object.values(e || {})) for (let e of [
|
|
458
458
|
"style",
|
|
@@ -460,7 +460,7 @@ function ie(e, t) {
|
|
|
460
460
|
"pressed",
|
|
461
461
|
"focused"
|
|
462
462
|
]) {
|
|
463
|
-
let r =
|
|
463
|
+
let r = ie(t.props?.[e]?.fontFamily);
|
|
464
464
|
r && n.add(r);
|
|
465
465
|
}
|
|
466
466
|
};
|
|
@@ -470,7 +470,7 @@ function ie(e, t) {
|
|
|
470
470
|
}
|
|
471
471
|
//#endregion
|
|
472
472
|
//#region ../ui/src/components/builder/locale.js
|
|
473
|
-
var
|
|
473
|
+
var oe = /* @__PURE__ */ new Set([
|
|
474
474
|
"ar",
|
|
475
475
|
"he",
|
|
476
476
|
"fa",
|
|
@@ -481,18 +481,18 @@ var ae = /* @__PURE__ */ new Set([
|
|
|
481
481
|
"yi",
|
|
482
482
|
"dv",
|
|
483
483
|
"ckb"
|
|
484
|
-
]),
|
|
484
|
+
]), se = (e) => oe.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", ce = (e, t) => e === "ltr" || e === "rtl" ? e : t ? se(t) : void 0, B = t({
|
|
485
485
|
tenant: "",
|
|
486
486
|
apiUrl: "/api",
|
|
487
487
|
locale: "",
|
|
488
488
|
settings: null
|
|
489
|
-
}),
|
|
489
|
+
}), V = t(null), le = (e) => {
|
|
490
490
|
let t = Number(e?.__page);
|
|
491
491
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
492
492
|
if (typeof window > "u") return 1;
|
|
493
493
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
494
494
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
495
|
-
},
|
|
495
|
+
}, H = t(null), U = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
496
496
|
function W(e, t) {
|
|
497
497
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
498
498
|
}
|
|
@@ -512,7 +512,7 @@ function G(e) {
|
|
|
512
512
|
function de(e, t) {
|
|
513
513
|
let n = t?.data ?? {}, r = ue(n);
|
|
514
514
|
if (!r.length) return e;
|
|
515
|
-
let i = RegExp(`:(${r.map(
|
|
515
|
+
let i = RegExp(`:(${r.map(U).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => G(W(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
516
516
|
return a(e);
|
|
517
517
|
}
|
|
518
518
|
var fe = {
|
|
@@ -1909,7 +1909,7 @@ function lt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1909
1909
|
});
|
|
1910
1910
|
}
|
|
1911
1911
|
function ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: g, children: _, linked: v, show: y }) {
|
|
1912
|
-
let { tenant: b, apiUrl: x } = r(
|
|
1912
|
+
let { tenant: b, apiUrl: x } = r(B), [S, C] = c("form"), [w, T] = c(null), [E, D] = c({}), [O, k] = c(0), A = g ? y || "form" : S;
|
|
1913
1913
|
i(() => {
|
|
1914
1914
|
if (!f || !s) return;
|
|
1915
1915
|
let e = !0;
|
|
@@ -1936,7 +1936,7 @@ function ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1936
1936
|
})), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), ee = I.filter((e) => {
|
|
1937
1937
|
let t = E[e.name];
|
|
1938
1938
|
return e.required && (t == null || t === "" || t === !1);
|
|
1939
|
-
}), L = F >= N.length - 1,
|
|
1939
|
+
}), L = F >= N.length - 1, te = (e, t) => D((n) => {
|
|
1940
1940
|
let r = {
|
|
1941
1941
|
...n,
|
|
1942
1942
|
[e]: t
|
|
@@ -1994,7 +1994,7 @@ function ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1994
1994
|
display: A === "success" ? "none" : "flex"
|
|
1995
1995
|
},
|
|
1996
1996
|
children: f && s ? /* @__PURE__ */ d(l, { children: [
|
|
1997
|
-
P && /* @__PURE__ */ u(
|
|
1997
|
+
P && /* @__PURE__ */ u(jt, {
|
|
1998
1998
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
1999
1999
|
active: F + 1,
|
|
2000
2000
|
style: { marginBottom: 8 }
|
|
@@ -2011,7 +2011,7 @@ function ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2011
2011
|
field: e,
|
|
2012
2012
|
value: E[e.name],
|
|
2013
2013
|
values: E,
|
|
2014
|
-
onChange:
|
|
2014
|
+
onChange: te,
|
|
2015
2015
|
inert: g
|
|
2016
2016
|
}, e.name)),
|
|
2017
2017
|
/* @__PURE__ */ d("div", {
|
|
@@ -2100,7 +2100,7 @@ var Z = null, dt = null, ft = (e) => {
|
|
|
2100
2100
|
}), Z;
|
|
2101
2101
|
};
|
|
2102
2102
|
function pt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l }) {
|
|
2103
|
-
let f = r(
|
|
2103
|
+
let f = r(B), p = f?.settings && typeof f.settings == "object" ? f.settings["google.recaptchaKey"] : "", m = typeof e == "string" && e.trim() || (typeof p == "string" ? p.trim() : ""), g = s(null);
|
|
2104
2104
|
if (i(() => {
|
|
2105
2105
|
if (l || !m || !g.current) return;
|
|
2106
2106
|
let e = !0;
|
|
@@ -2336,7 +2336,7 @@ function xt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2336
2336
|
});
|
|
2337
2337
|
}
|
|
2338
2338
|
function St({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, style: g, nodeRef: _ }) {
|
|
2339
|
-
let { tenant: v, apiUrl: y, locale: b } = r(
|
|
2339
|
+
let { tenant: v, apiUrl: y, locale: b } = r(B), x = r(H), S = r(V), C = S?.[e], w = m ? le(S) : 1, [T, E] = c(null);
|
|
2340
2340
|
if (i(() => {
|
|
2341
2341
|
if (!e || C) return;
|
|
2342
2342
|
let n = !0, r = new URLSearchParams();
|
|
@@ -2495,7 +2495,7 @@ function Ct({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2495
2495
|
}) : null;
|
|
2496
2496
|
}
|
|
2497
2497
|
function wt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: g }) {
|
|
2498
|
-
let { tenant: _, apiUrl: v } = r(
|
|
2498
|
+
let { tenant: _, apiUrl: v } = r(B), y = r(V), [b, x] = c(null), S = o ? Number(y?.[`${o}:total`]) : NaN;
|
|
2499
2499
|
i(() => {
|
|
2500
2500
|
if (!o || Number.isFinite(S)) return;
|
|
2501
2501
|
let e = !0, t = o.startsWith("api:") ? `${v}/data/${encodeURIComponent(o.slice(4))}` : `${v}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -2514,7 +2514,7 @@ function wt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
2514
2514
|
]);
|
|
2515
2515
|
let C = Math.max(1, Number(s) || 6), w = Number.isFinite(S) ? S : b;
|
|
2516
2516
|
if (o && w === null || o && f && !(w > 0)) return null;
|
|
2517
|
-
let T = Math.min(Math.max(o ? Math.ceil(w / C) : Number(e) || 1, 1), 50), E = Math.min(Math.max(o ?
|
|
2517
|
+
let T = Math.min(Math.max(o ? Math.ceil(w / C) : Number(e) || 1, 1), 50), E = Math.min(Math.max(o ? le(y) : Number(t) || 1, 1), T), D = (e) => {
|
|
2518
2518
|
if (o) {
|
|
2519
2519
|
if (typeof window < "u") {
|
|
2520
2520
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -2579,7 +2579,243 @@ function wt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
2579
2579
|
]
|
|
2580
2580
|
});
|
|
2581
2581
|
}
|
|
2582
|
-
|
|
2582
|
+
var Tt = "webim.page_mode", Et = () => {
|
|
2583
|
+
if (typeof window > "u") return "auto";
|
|
2584
|
+
try {
|
|
2585
|
+
let e = window.localStorage.getItem(Tt);
|
|
2586
|
+
return e === "light" || e === "dark" ? e : "auto";
|
|
2587
|
+
} catch {
|
|
2588
|
+
return "auto";
|
|
2589
|
+
}
|
|
2590
|
+
}, Dt = (e) => {
|
|
2591
|
+
let t = {
|
|
2592
|
+
width: 16,
|
|
2593
|
+
height: 16,
|
|
2594
|
+
viewBox: "0 0 24 24",
|
|
2595
|
+
fill: "none",
|
|
2596
|
+
stroke: "currentColor",
|
|
2597
|
+
strokeWidth: 2,
|
|
2598
|
+
strokeLinecap: "round",
|
|
2599
|
+
strokeLinejoin: "round",
|
|
2600
|
+
"aria-hidden": !0
|
|
2601
|
+
};
|
|
2602
|
+
return e === "light" ? /* @__PURE__ */ d("svg", {
|
|
2603
|
+
...t,
|
|
2604
|
+
children: [/* @__PURE__ */ u("circle", {
|
|
2605
|
+
cx: "12",
|
|
2606
|
+
cy: "12",
|
|
2607
|
+
r: "4"
|
|
2608
|
+
}), /* @__PURE__ */ u("path", { d: "M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" })]
|
|
2609
|
+
}) : e === "dark" ? /* @__PURE__ */ u("svg", {
|
|
2610
|
+
...t,
|
|
2611
|
+
children: /* @__PURE__ */ u("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
|
|
2612
|
+
}) : /* @__PURE__ */ d("svg", {
|
|
2613
|
+
...t,
|
|
2614
|
+
children: [/* @__PURE__ */ u("rect", {
|
|
2615
|
+
x: "2",
|
|
2616
|
+
y: "3",
|
|
2617
|
+
width: "20",
|
|
2618
|
+
height: "14",
|
|
2619
|
+
rx: "2"
|
|
2620
|
+
}), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
|
|
2621
|
+
});
|
|
2622
|
+
}, Q = {
|
|
2623
|
+
light: "Light theme",
|
|
2624
|
+
dark: "Dark theme",
|
|
2625
|
+
auto: "Follow the device theme"
|
|
2626
|
+
};
|
|
2627
|
+
function Ot({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
2628
|
+
let [o, l] = c(a ? "auto" : Et), d = s(null), f = (e) => {
|
|
2629
|
+
d.current = e, typeof r == "function" && r(e);
|
|
2630
|
+
};
|
|
2631
|
+
i(() => {
|
|
2632
|
+
if (a) return;
|
|
2633
|
+
let e = d.current?.closest?.(".webim-page");
|
|
2634
|
+
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
2635
|
+
try {
|
|
2636
|
+
o === "auto" ? window.localStorage.removeItem(Tt) : window.localStorage.setItem(Tt, o);
|
|
2637
|
+
} catch {}
|
|
2638
|
+
}, [o, a]);
|
|
2639
|
+
let p = t === !1 ? ["light", "dark"] : [
|
|
2640
|
+
"light",
|
|
2641
|
+
"dark",
|
|
2642
|
+
"auto"
|
|
2643
|
+
], m = p.includes(o) ? o : p[0], g = {
|
|
2644
|
+
appearance: "none",
|
|
2645
|
+
border: 0,
|
|
2646
|
+
margin: 0,
|
|
2647
|
+
display: "inline-flex",
|
|
2648
|
+
alignItems: "center",
|
|
2649
|
+
justifyContent: "center",
|
|
2650
|
+
background: "transparent",
|
|
2651
|
+
color: "inherit",
|
|
2652
|
+
font: "inherit",
|
|
2653
|
+
cursor: a ? "default" : "pointer",
|
|
2654
|
+
borderRadius: 999
|
|
2655
|
+
};
|
|
2656
|
+
if (e === "buttons") return /* @__PURE__ */ u("div", {
|
|
2657
|
+
ref: f,
|
|
2658
|
+
role: "group",
|
|
2659
|
+
"aria-label": "Theme",
|
|
2660
|
+
style: {
|
|
2661
|
+
display: "inline-flex",
|
|
2662
|
+
alignItems: "center",
|
|
2663
|
+
gap: 2,
|
|
2664
|
+
padding: 3,
|
|
2665
|
+
borderRadius: 999,
|
|
2666
|
+
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
2667
|
+
...h(n)
|
|
2668
|
+
},
|
|
2669
|
+
children: p.map((e) => /* @__PURE__ */ u("button", {
|
|
2670
|
+
type: "button",
|
|
2671
|
+
title: Q[e],
|
|
2672
|
+
"aria-label": Q[e],
|
|
2673
|
+
"aria-pressed": e === m,
|
|
2674
|
+
onClick: a ? void 0 : () => l(e),
|
|
2675
|
+
style: {
|
|
2676
|
+
...g,
|
|
2677
|
+
width: 28,
|
|
2678
|
+
height: 28,
|
|
2679
|
+
color: e === m ? "var(--page-accent-text, #ffffff)" : "inherit",
|
|
2680
|
+
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
2681
|
+
opacity: e === m ? 1 : .7
|
|
2682
|
+
},
|
|
2683
|
+
children: Dt(e)
|
|
2684
|
+
}, e))
|
|
2685
|
+
});
|
|
2686
|
+
let _ = p[(p.indexOf(m) + 1) % p.length];
|
|
2687
|
+
return /* @__PURE__ */ u("button", {
|
|
2688
|
+
ref: f,
|
|
2689
|
+
type: "button",
|
|
2690
|
+
title: Q[m],
|
|
2691
|
+
"aria-label": `Theme: ${Q[m]} — switch to ${Q[_]}`,
|
|
2692
|
+
onClick: a ? void 0 : () => l(_),
|
|
2693
|
+
style: {
|
|
2694
|
+
...g,
|
|
2695
|
+
width: 36,
|
|
2696
|
+
height: 36,
|
|
2697
|
+
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
2698
|
+
...h(n)
|
|
2699
|
+
},
|
|
2700
|
+
children: Dt(m)
|
|
2701
|
+
});
|
|
2702
|
+
}
|
|
2703
|
+
var kt = {
|
|
2704
|
+
facebook: {
|
|
2705
|
+
label: "Facebook",
|
|
2706
|
+
color: "#1877f2",
|
|
2707
|
+
d: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"
|
|
2708
|
+
},
|
|
2709
|
+
instagram: {
|
|
2710
|
+
label: "Instagram",
|
|
2711
|
+
color: "#e4405f",
|
|
2712
|
+
d: "M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06zm0 5.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z"
|
|
2713
|
+
},
|
|
2714
|
+
x: {
|
|
2715
|
+
label: "X (Twitter)",
|
|
2716
|
+
color: "#000000",
|
|
2717
|
+
d: "M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"
|
|
2718
|
+
},
|
|
2719
|
+
linkedin: {
|
|
2720
|
+
label: "LinkedIn",
|
|
2721
|
+
color: "#0a66c2",
|
|
2722
|
+
d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"
|
|
2723
|
+
},
|
|
2724
|
+
youtube: {
|
|
2725
|
+
label: "YouTube",
|
|
2726
|
+
color: "#ff0000",
|
|
2727
|
+
d: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"
|
|
2728
|
+
},
|
|
2729
|
+
tiktok: {
|
|
2730
|
+
label: "TikTok",
|
|
2731
|
+
color: "#000000",
|
|
2732
|
+
d: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"
|
|
2733
|
+
},
|
|
2734
|
+
whatsapp: {
|
|
2735
|
+
label: "WhatsApp",
|
|
2736
|
+
color: "#25d366",
|
|
2737
|
+
d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"
|
|
2738
|
+
},
|
|
2739
|
+
telegram: {
|
|
2740
|
+
label: "Telegram",
|
|
2741
|
+
color: "#26a5e4",
|
|
2742
|
+
d: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"
|
|
2743
|
+
},
|
|
2744
|
+
pinterest: {
|
|
2745
|
+
label: "Pinterest",
|
|
2746
|
+
color: "#bd081c",
|
|
2747
|
+
d: "M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.03-.655 2.569-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738a.36.36 0 01.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24 12 24c6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z"
|
|
2748
|
+
},
|
|
2749
|
+
github: {
|
|
2750
|
+
label: "GitHub",
|
|
2751
|
+
color: "#181717",
|
|
2752
|
+
d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
|
|
2753
|
+
},
|
|
2754
|
+
discord: {
|
|
2755
|
+
label: "Discord",
|
|
2756
|
+
color: "#5865f2",
|
|
2757
|
+
d: "M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.058a.082.082 0 00.031.056 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.873-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.009c.12.099.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.331c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"
|
|
2758
|
+
},
|
|
2759
|
+
email: {
|
|
2760
|
+
label: "E-mail",
|
|
2761
|
+
color: "#64748b",
|
|
2762
|
+
d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"
|
|
2763
|
+
},
|
|
2764
|
+
website: {
|
|
2765
|
+
label: "Website",
|
|
2766
|
+
color: "#64748b",
|
|
2767
|
+
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
|
|
2768
|
+
}
|
|
2769
|
+
};
|
|
2770
|
+
function At({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
2771
|
+
let l = Array.isArray(e) ? e.filter((e) => e && kt[e.network]) : [];
|
|
2772
|
+
if (!l.length) return null;
|
|
2773
|
+
let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, g = c ? (e) => e.preventDefault() : void 0;
|
|
2774
|
+
return /* @__PURE__ */ u("div", {
|
|
2775
|
+
ref: s,
|
|
2776
|
+
style: {
|
|
2777
|
+
display: "flex",
|
|
2778
|
+
flexWrap: "wrap",
|
|
2779
|
+
alignItems: "center",
|
|
2780
|
+
gap: p,
|
|
2781
|
+
...h(o)
|
|
2782
|
+
},
|
|
2783
|
+
children: l.map((e, r) => {
|
|
2784
|
+
let i = kt[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
|
|
2785
|
+
return /* @__PURE__ */ u("a", {
|
|
2786
|
+
href: e.url || "#",
|
|
2787
|
+
onClick: g,
|
|
2788
|
+
"aria-label": e.label || i.label,
|
|
2789
|
+
title: e.label || i.label,
|
|
2790
|
+
...a !== !1 && !c ? {
|
|
2791
|
+
target: "_blank",
|
|
2792
|
+
rel: "noopener noreferrer"
|
|
2793
|
+
} : {},
|
|
2794
|
+
style: {
|
|
2795
|
+
display: "inline-flex",
|
|
2796
|
+
alignItems: "center",
|
|
2797
|
+
justifyContent: "center",
|
|
2798
|
+
width: t === "plain" ? d : f,
|
|
2799
|
+
height: t === "plain" ? d : f,
|
|
2800
|
+
borderRadius: "50%",
|
|
2801
|
+
background: o ? m(i) : "transparent",
|
|
2802
|
+
border: t === "outline" ? `1px solid ${m(i)}` : "none",
|
|
2803
|
+
color: "inherit",
|
|
2804
|
+
textDecoration: "none"
|
|
2805
|
+
},
|
|
2806
|
+
children: /* @__PURE__ */ u("svg", {
|
|
2807
|
+
width: d,
|
|
2808
|
+
height: d,
|
|
2809
|
+
viewBox: "0 0 24 24",
|
|
2810
|
+
fill: s,
|
|
2811
|
+
"aria-hidden": !0,
|
|
2812
|
+
children: /* @__PURE__ */ u("path", { d: i.d })
|
|
2813
|
+
})
|
|
2814
|
+
}, `${e.network}-${r}`);
|
|
2815
|
+
})
|
|
2816
|
+
});
|
|
2817
|
+
}
|
|
2818
|
+
function jt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
2583
2819
|
if (!t.length) return null;
|
|
2584
2820
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
2585
2821
|
width: 32,
|
|
@@ -2657,7 +2893,7 @@ function Tt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2657
2893
|
})
|
|
2658
2894
|
});
|
|
2659
2895
|
}
|
|
2660
|
-
var
|
|
2896
|
+
var Mt = {
|
|
2661
2897
|
small: {
|
|
2662
2898
|
w: 132,
|
|
2663
2899
|
h: 46,
|
|
@@ -2679,10 +2915,10 @@ var Et = {
|
|
|
2679
2915
|
title: 12.5,
|
|
2680
2916
|
avatar: 46
|
|
2681
2917
|
}
|
|
2682
|
-
},
|
|
2683
|
-
|
|
2684
|
-
function
|
|
2685
|
-
let r =
|
|
2918
|
+
}, Nt = (e) => Mt[e] ?? Mt.medium;
|
|
2919
|
+
Mt.medium.w, Mt.medium.h;
|
|
2920
|
+
function Pt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
2921
|
+
let r = Nt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
|
|
2686
2922
|
for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
|
|
2687
2923
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
2688
2924
|
if (t.has(e.id)) return 0;
|
|
@@ -2734,18 +2970,18 @@ function Ot(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
2734
2970
|
horizontal: n
|
|
2735
2971
|
};
|
|
2736
2972
|
}
|
|
2737
|
-
var
|
|
2973
|
+
var Ft = (e, t) => {
|
|
2738
2974
|
let n = String(e ?? "");
|
|
2739
2975
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
2740
|
-
},
|
|
2976
|
+
}, It = (e) => {
|
|
2741
2977
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
2742
2978
|
if (!t) return "#ffffff";
|
|
2743
2979
|
let n = t[1];
|
|
2744
2980
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
2745
2981
|
let r = parseInt(n, 16);
|
|
2746
2982
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
2747
|
-
},
|
|
2748
|
-
function
|
|
2983
|
+
}, Lt = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
2984
|
+
function Rt(e, t = {}) {
|
|
2749
2985
|
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : G(e);
|
|
2750
2986
|
return n.map((e) => {
|
|
2751
2987
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
@@ -2760,11 +2996,11 @@ function jt(e, t = {}) {
|
|
|
2760
2996
|
};
|
|
2761
2997
|
});
|
|
2762
2998
|
}
|
|
2763
|
-
var
|
|
2999
|
+
var zt = {
|
|
2764
3000
|
size: 36,
|
|
2765
3001
|
pad: 10
|
|
2766
3002
|
};
|
|
2767
|
-
function
|
|
3003
|
+
function Bt({ node: e, onClose: t }) {
|
|
2768
3004
|
return i(() => {
|
|
2769
3005
|
let e = (e) => e.key === "Escape" && t();
|
|
2770
3006
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -2882,8 +3118,8 @@ function Nt({ node: e, onClose: t }) {
|
|
|
2882
3118
|
})
|
|
2883
3119
|
});
|
|
2884
3120
|
}
|
|
2885
|
-
function
|
|
2886
|
-
let x = a(), [S, C] = c(null), { tenant: w, apiUrl: T } = r(
|
|
3121
|
+
function Vt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
|
|
3122
|
+
let x = a(), [S, C] = c(null), { tenant: w, apiUrl: T } = r(B), E = r(V)?.[t], [D, O] = c(null);
|
|
2887
3123
|
i(() => {
|
|
2888
3124
|
if (!t || E) return;
|
|
2889
3125
|
let e = !0;
|
|
@@ -2899,14 +3135,14 @@ function Pt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
2899
3135
|
T,
|
|
2900
3136
|
E
|
|
2901
3137
|
]);
|
|
2902
|
-
let k = t ?
|
|
3138
|
+
let k = t ? Rt(E ?? D ?? [], {
|
|
2903
3139
|
nameField: n,
|
|
2904
3140
|
titleField: o,
|
|
2905
3141
|
photoField: s,
|
|
2906
3142
|
parentField: f,
|
|
2907
3143
|
cvField: p,
|
|
2908
3144
|
hrefField: m
|
|
2909
|
-
}) : e, A =
|
|
3145
|
+
}) : e, A = Nt(g), { boxes: j, links: M, width: N, height: P } = Pt(k, {
|
|
2910
3146
|
size: g,
|
|
2911
3147
|
horizontal: _
|
|
2912
3148
|
});
|
|
@@ -2952,7 +3188,7 @@ function Pt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
2952
3188
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
2953
3189
|
strokeWidth: "1.5"
|
|
2954
3190
|
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
2955
|
-
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ?
|
|
3191
|
+
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? It(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? It(e.color2) : s, f = b && (Lt(e) || e.href), p = () => Lt(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + zt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
2956
3192
|
return /* @__PURE__ */ d("g", {
|
|
2957
3193
|
onClick: f ? p : void 0,
|
|
2958
3194
|
style: f ? { cursor: "pointer" } : void 0,
|
|
@@ -3016,13 +3252,13 @@ function Pt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3016
3252
|
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
3017
3253
|
id: `${x}-${e.id}`,
|
|
3018
3254
|
children: /* @__PURE__ */ u("circle", {
|
|
3019
|
-
cx: t +
|
|
3255
|
+
cx: t + zt.pad + A.avatar / 2,
|
|
3020
3256
|
cy: n + A.h / 2,
|
|
3021
3257
|
r: A.avatar / 2
|
|
3022
3258
|
})
|
|
3023
3259
|
}), /* @__PURE__ */ u("image", {
|
|
3024
3260
|
href: e.photo,
|
|
3025
|
-
x: t +
|
|
3261
|
+
x: t + zt.pad,
|
|
3026
3262
|
y: n + (A.h - A.avatar) / 2,
|
|
3027
3263
|
width: A.avatar,
|
|
3028
3264
|
height: A.avatar,
|
|
@@ -3036,7 +3272,7 @@ function Pt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3036
3272
|
fontSize: A.title,
|
|
3037
3273
|
fontWeight: "600",
|
|
3038
3274
|
fill: s,
|
|
3039
|
-
children:
|
|
3275
|
+
children: Ft(e.title, g + 4)
|
|
3040
3276
|
}), e.name && /* @__PURE__ */ u("text", {
|
|
3041
3277
|
x: m,
|
|
3042
3278
|
y: n + _ + _ / 2 + A.name * .35,
|
|
@@ -3044,7 +3280,7 @@ function Pt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3044
3280
|
fontSize: A.name,
|
|
3045
3281
|
fontWeight: "600",
|
|
3046
3282
|
fill: c,
|
|
3047
|
-
children:
|
|
3283
|
+
children: Ft(e.name, g)
|
|
3048
3284
|
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
3049
3285
|
x: m,
|
|
3050
3286
|
y: n + (v[1] ? A.h * .43 : A.h * .57),
|
|
@@ -3052,7 +3288,7 @@ function Pt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3052
3288
|
fontSize: A.name,
|
|
3053
3289
|
fontWeight: "600",
|
|
3054
3290
|
fill: s,
|
|
3055
|
-
children:
|
|
3291
|
+
children: Ft(v[0], g)
|
|
3056
3292
|
}), v[1] && /* @__PURE__ */ u("text", {
|
|
3057
3293
|
x: m,
|
|
3058
3294
|
y: n + A.h * .73,
|
|
@@ -3060,19 +3296,19 @@ function Pt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3060
3296
|
fontSize: A.title,
|
|
3061
3297
|
opacity: "0.7",
|
|
3062
3298
|
fill: s,
|
|
3063
|
-
children:
|
|
3299
|
+
children: Ft(v[1], g + 4)
|
|
3064
3300
|
})] })
|
|
3065
3301
|
]
|
|
3066
3302
|
}, e.id);
|
|
3067
3303
|
})]
|
|
3068
|
-
}), S && /* @__PURE__ */ u(
|
|
3304
|
+
}), S && /* @__PURE__ */ u(Bt, {
|
|
3069
3305
|
node: S,
|
|
3070
3306
|
onClose: () => C(null)
|
|
3071
3307
|
})]
|
|
3072
3308
|
});
|
|
3073
3309
|
}
|
|
3074
|
-
function
|
|
3075
|
-
let { tenant: _, apiUrl: v } = r(
|
|
3310
|
+
function Ht({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, paged: f, emptyText: p, style: m, nodeRef: g }) {
|
|
3311
|
+
let { tenant: _, apiUrl: v } = r(B), y = r(V), b = y?.[n], x = f ? le(y) : 1, [S, C] = c(null);
|
|
3076
3312
|
if (i(() => {
|
|
3077
3313
|
if (!n || b) return;
|
|
3078
3314
|
let e = !0, t = Math.max(1, Number(a) || 10), r = f && !n.startsWith("api:") ? `?offset=${(x - 1) * t}&limit=${t}` : "", i = n.startsWith("api:") ? `${v}/data/${encodeURIComponent(n.slice(4))}` : `${v}/dynamic/${encodeURIComponent(n)}${r}`;
|
|
@@ -3137,7 +3373,7 @@ function Ft({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
|
|
|
3137
3373
|
})
|
|
3138
3374
|
});
|
|
3139
3375
|
}
|
|
3140
|
-
var
|
|
3376
|
+
var Ut = {
|
|
3141
3377
|
PageRoot: ve,
|
|
3142
3378
|
Section: ye,
|
|
3143
3379
|
Container: be,
|
|
@@ -3154,9 +3390,11 @@ var It = {
|
|
|
3154
3390
|
CollectionList: St,
|
|
3155
3391
|
BreadcrumbsBlock: Ct,
|
|
3156
3392
|
PaginationBlock: wt,
|
|
3157
|
-
StepperBlock:
|
|
3158
|
-
|
|
3159
|
-
|
|
3393
|
+
StepperBlock: jt,
|
|
3394
|
+
SocialLinksBlock: At,
|
|
3395
|
+
ThemeModeBlock: Ot,
|
|
3396
|
+
OrgChartBlock: Vt,
|
|
3397
|
+
TableBlock: Ht,
|
|
3160
3398
|
MasonryBlock: Ze,
|
|
3161
3399
|
AccordionBlock: nt,
|
|
3162
3400
|
NavbarBlock: et,
|
|
@@ -3186,27 +3424,27 @@ var It = {
|
|
|
3186
3424
|
FormFile: yt,
|
|
3187
3425
|
FormRecaptcha: pt,
|
|
3188
3426
|
FormSubmit: bt
|
|
3189
|
-
},
|
|
3427
|
+
}, Wt = {
|
|
3190
3428
|
id: "auth",
|
|
3191
3429
|
label: "Accounts",
|
|
3192
3430
|
category: "Apps",
|
|
3193
3431
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
3194
3432
|
ssr: "shell",
|
|
3195
3433
|
settings: ["site.authRedirect"]
|
|
3196
|
-
},
|
|
3434
|
+
}, Gt = t({
|
|
3197
3435
|
user: null,
|
|
3198
3436
|
status: "idle",
|
|
3199
3437
|
ensure: () => {},
|
|
3200
3438
|
refresh: () => {},
|
|
3201
3439
|
signOut: () => {}
|
|
3202
|
-
}),
|
|
3203
|
-
let e = r(
|
|
3440
|
+
}), Kt = () => {
|
|
3441
|
+
let e = r(Gt);
|
|
3204
3442
|
return i(() => {
|
|
3205
3443
|
e.ensure();
|
|
3206
3444
|
}, [e]), e;
|
|
3207
3445
|
};
|
|
3208
|
-
function
|
|
3209
|
-
let d = r(
|
|
3446
|
+
function qt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
|
|
3447
|
+
let d = r(B), f = a || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : i ? "guest" : "idle"), v = s(!1), y = n((e, t) => fetch(`${f}${e}`, {
|
|
3210
3448
|
...t,
|
|
3211
3449
|
credentials: "include",
|
|
3212
3450
|
headers: {
|
|
@@ -3238,19 +3476,19 @@ function Bt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l })
|
|
|
3238
3476
|
b,
|
|
3239
3477
|
x
|
|
3240
3478
|
]);
|
|
3241
|
-
return /* @__PURE__ */ u(
|
|
3479
|
+
return /* @__PURE__ */ u(Gt.Provider, {
|
|
3242
3480
|
value: C,
|
|
3243
3481
|
children: e
|
|
3244
3482
|
});
|
|
3245
3483
|
}
|
|
3246
|
-
function
|
|
3247
|
-
let { status: n } =
|
|
3484
|
+
function Jt({ when: e, children: t }) {
|
|
3485
|
+
let { status: n } = Kt();
|
|
3248
3486
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
3249
3487
|
}
|
|
3250
3488
|
//#endregion
|
|
3251
3489
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
3252
|
-
function
|
|
3253
|
-
let { tenant: g, apiUrl: _, settings: v } = r(
|
|
3490
|
+
function Yt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
|
|
3491
|
+
let { tenant: g, apiUrl: _, settings: v } = r(B), [y, b] = c("form"), [x, S] = c(""), [C, w] = c(!1), T = e === "register", E = f ? m || "form" : y, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
|
|
3254
3492
|
if (e.preventDefault(), f) return;
|
|
3255
3493
|
let n = new FormData(e.currentTarget);
|
|
3256
3494
|
w(!0), S("");
|
|
@@ -3373,8 +3611,8 @@ function Ht({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3373
3611
|
]
|
|
3374
3612
|
});
|
|
3375
3613
|
}
|
|
3376
|
-
function
|
|
3377
|
-
let { user: c, status: l, signOut: f } =
|
|
3614
|
+
function Xt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
3615
|
+
let { user: c, status: l, signOut: f } = Kt(), p = a ? s || "user" : l, m = a ? {
|
|
3378
3616
|
name: "Ada Lovelace",
|
|
3379
3617
|
email: "ada@example.com"
|
|
3380
3618
|
} : c;
|
|
@@ -3439,42 +3677,42 @@ function Ut({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3439
3677
|
}
|
|
3440
3678
|
//#endregion
|
|
3441
3679
|
//#region ../ui/src/components/builder/apps/index.js
|
|
3442
|
-
var
|
|
3443
|
-
SiteLoginForm:
|
|
3444
|
-
SiteAccountMenu:
|
|
3680
|
+
var Zt = [Wt], Qt = {
|
|
3681
|
+
SiteLoginForm: Yt,
|
|
3682
|
+
SiteAccountMenu: Xt
|
|
3445
3683
|
};
|
|
3446
|
-
new Set(
|
|
3684
|
+
new Set(Zt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
3447
3685
|
//#endregion
|
|
3448
3686
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
3449
|
-
var
|
|
3450
|
-
function
|
|
3451
|
-
if (
|
|
3687
|
+
var $t = /* @__PURE__ */ new Map();
|
|
3688
|
+
function en(e) {
|
|
3689
|
+
if ($t.has(e)) return $t.get(e);
|
|
3452
3690
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
3453
3691
|
/* @vite-ignore */
|
|
3454
3692
|
/* webpackIgnore: true */
|
|
3455
3693
|
t
|
|
3456
3694
|
).finally(() => URL.revokeObjectURL(t));
|
|
3457
|
-
return
|
|
3695
|
+
return $t.set(e, n), n;
|
|
3458
3696
|
}
|
|
3459
|
-
function
|
|
3697
|
+
function tn(e) {
|
|
3460
3698
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
3461
3699
|
return n && typeof n == "object" ? n : {};
|
|
3462
3700
|
}
|
|
3463
3701
|
//#endregion
|
|
3464
3702
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
3465
|
-
async function
|
|
3466
|
-
let n = await
|
|
3703
|
+
async function nn(e, t) {
|
|
3704
|
+
let n = await en(e);
|
|
3467
3705
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
3468
3706
|
}
|
|
3469
|
-
var
|
|
3707
|
+
var rn = {
|
|
3470
3708
|
padding: "10px 12px",
|
|
3471
3709
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
3472
3710
|
borderRadius: 8,
|
|
3473
3711
|
fontSize: 12,
|
|
3474
3712
|
opacity: .6
|
|
3475
3713
|
};
|
|
3476
|
-
function
|
|
3477
|
-
let c = r(
|
|
3714
|
+
function an({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
3715
|
+
let c = r(B), l = tn(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
3478
3716
|
tenant: c?.tenant ?? "",
|
|
3479
3717
|
apiUrl: c?.apiUrl ?? "/api",
|
|
3480
3718
|
locale: c?.locale ?? "",
|
|
@@ -3486,7 +3724,7 @@ function Zt({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
3486
3724
|
let e = f.current;
|
|
3487
3725
|
if (!l?.code || !e) return;
|
|
3488
3726
|
let n = !0;
|
|
3489
|
-
return
|
|
3727
|
+
return nn(l.code, t).then((e) => {
|
|
3490
3728
|
if (!(!n || !e || !f.current)) {
|
|
3491
3729
|
p.current = e;
|
|
3492
3730
|
try {
|
|
@@ -3516,7 +3754,7 @@ function Zt({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
3516
3754
|
}) : /* @__PURE__ */ d("div", {
|
|
3517
3755
|
ref: o,
|
|
3518
3756
|
style: {
|
|
3519
|
-
...
|
|
3757
|
+
...rn,
|
|
3520
3758
|
...h(a)
|
|
3521
3759
|
},
|
|
3522
3760
|
children: [
|
|
@@ -3528,10 +3766,10 @@ function Zt({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
3528
3766
|
}
|
|
3529
3767
|
//#endregion
|
|
3530
3768
|
//#region ../ui/src/components/builder/render.jsx
|
|
3531
|
-
var
|
|
3532
|
-
...
|
|
3533
|
-
...
|
|
3534
|
-
PluginBlock:
|
|
3769
|
+
var on = {
|
|
3770
|
+
...Ut,
|
|
3771
|
+
...Qt,
|
|
3772
|
+
PluginBlock: an
|
|
3535
3773
|
};
|
|
3536
3774
|
function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
3537
3775
|
let o = n[t];
|
|
@@ -3543,7 +3781,7 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3543
3781
|
let c = new Set(i).add(n);
|
|
3544
3782
|
return /* @__PURE__ */ u(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
3545
3783
|
}
|
|
3546
|
-
let l =
|
|
3784
|
+
let l = on[s];
|
|
3547
3785
|
if (!l) return null;
|
|
3548
3786
|
let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
3549
3787
|
...c,
|
|
@@ -3554,15 +3792,16 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3554
3792
|
},
|
|
3555
3793
|
children: d.length ? d : void 0
|
|
3556
3794
|
}, t);
|
|
3557
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
3795
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(Jt, {
|
|
3558
3796
|
when: c.when,
|
|
3559
3797
|
children: m
|
|
3560
3798
|
}, t) : m;
|
|
3561
3799
|
}
|
|
3562
3800
|
//#endregion
|
|
3563
3801
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
3564
|
-
var $t = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ")
|
|
3565
|
-
|
|
3802
|
+
var sn = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), cn = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(F(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
3803
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(F(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
3804
|
+
function ln({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: g }) {
|
|
3566
3805
|
let _ = s?.js?.trim();
|
|
3567
3806
|
if (i(() => {
|
|
3568
3807
|
if (!_) return;
|
|
@@ -3571,38 +3810,41 @@ function en({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
3571
3810
|
}, [_]), !e?.ROOT) return null;
|
|
3572
3811
|
let v = {
|
|
3573
3812
|
lang: p || void 0,
|
|
3574
|
-
dir:
|
|
3813
|
+
dir: ce(m, p)
|
|
3575
3814
|
}, y = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", b = {
|
|
3576
3815
|
minHeight: "100%",
|
|
3577
3816
|
display: "flex",
|
|
3578
3817
|
flexDirection: "column"
|
|
3579
|
-
}, x = $("ROOT", e, n), S = o(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), C = D(e, n), w = E(e, n), T = s?.css?.trim(), O =
|
|
3818
|
+
}, x = $("ROOT", e, n), S = o(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), C = D(e, n), w = E(e, n), T = s?.css?.trim(), O = ae(e, n).map((e) => /* @__PURE__ */ u("link", {
|
|
3580
3819
|
rel: "stylesheet",
|
|
3581
3820
|
precedence: "default",
|
|
3582
|
-
href:
|
|
3583
|
-
}, e));
|
|
3584
|
-
|
|
3821
|
+
href: z(e)
|
|
3822
|
+
}, e)), k = P(t), A = cn(k);
|
|
3823
|
+
return r === "auto" ? /* @__PURE__ */ u(B.Provider, {
|
|
3585
3824
|
value: {
|
|
3586
3825
|
tenant: c || "",
|
|
3587
3826
|
apiUrl: l || "/api",
|
|
3588
3827
|
locale: p || "",
|
|
3589
3828
|
settings: h ?? null
|
|
3590
3829
|
},
|
|
3591
|
-
children: /* @__PURE__ */ u(
|
|
3830
|
+
children: /* @__PURE__ */ u(qt, {
|
|
3592
3831
|
initialUser: g,
|
|
3593
|
-
children: /* @__PURE__ */ u(
|
|
3832
|
+
children: /* @__PURE__ */ u(V.Provider, {
|
|
3594
3833
|
value: f ?? null,
|
|
3595
|
-
children: /* @__PURE__ */ u(
|
|
3834
|
+
children: /* @__PURE__ */ u(H.Provider, {
|
|
3596
3835
|
value: S,
|
|
3597
3836
|
children: /* @__PURE__ */ d("div", {
|
|
3598
3837
|
...v,
|
|
3599
3838
|
className: "webim-page",
|
|
3600
3839
|
style: {
|
|
3601
3840
|
...b,
|
|
3602
|
-
...
|
|
3841
|
+
...I(t),
|
|
3603
3842
|
...a
|
|
3604
3843
|
},
|
|
3605
3844
|
children: [
|
|
3845
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${sn(F(k.light))} }
|
|
3846
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${sn(F(k.dark))} } }` }),
|
|
3847
|
+
/* @__PURE__ */ u("style", { children: A }),
|
|
3606
3848
|
O,
|
|
3607
3849
|
/* @__PURE__ */ u("style", { children: y }),
|
|
3608
3850
|
C && /* @__PURE__ */ u("style", { children: C }),
|
|
@@ -3614,33 +3856,30 @@ function en({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
3614
3856
|
})
|
|
3615
3857
|
})
|
|
3616
3858
|
})
|
|
3617
|
-
})
|
|
3618
|
-
let k = P(t);
|
|
3619
|
-
return /* @__PURE__ */ u(V.Provider, {
|
|
3859
|
+
}) : /* @__PURE__ */ u(B.Provider, {
|
|
3620
3860
|
value: {
|
|
3621
3861
|
tenant: c || "",
|
|
3622
3862
|
apiUrl: l || "/api",
|
|
3623
3863
|
locale: p || "",
|
|
3624
3864
|
settings: h ?? null
|
|
3625
3865
|
},
|
|
3626
|
-
children: /* @__PURE__ */ u(
|
|
3866
|
+
children: /* @__PURE__ */ u(qt, {
|
|
3627
3867
|
initialUser: g,
|
|
3628
|
-
children: /* @__PURE__ */ u(
|
|
3868
|
+
children: /* @__PURE__ */ u(V.Provider, {
|
|
3629
3869
|
value: f ?? null,
|
|
3630
|
-
children: /* @__PURE__ */ u(
|
|
3870
|
+
children: /* @__PURE__ */ u(H.Provider, {
|
|
3631
3871
|
value: S,
|
|
3632
3872
|
children: /* @__PURE__ */ d("div", {
|
|
3633
3873
|
...v,
|
|
3634
3874
|
className: "webim-page",
|
|
3635
3875
|
style: {
|
|
3636
3876
|
...b,
|
|
3637
|
-
...
|
|
3877
|
+
...ee(t, r),
|
|
3638
3878
|
...a
|
|
3639
3879
|
},
|
|
3640
3880
|
children: [
|
|
3641
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${$t(F(k.light))} }
|
|
3642
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${$t(F(k.dark))} } }` }),
|
|
3643
3881
|
O,
|
|
3882
|
+
/* @__PURE__ */ u("style", { children: A }),
|
|
3644
3883
|
/* @__PURE__ */ u("style", { children: y }),
|
|
3645
3884
|
C && /* @__PURE__ */ u("style", { children: C }),
|
|
3646
3885
|
w && /* @__PURE__ */ u("style", { children: w }),
|
|
@@ -3655,8 +3894,8 @@ function en({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
3655
3894
|
}
|
|
3656
3895
|
//#endregion
|
|
3657
3896
|
//#region src/WebimContent.jsx
|
|
3658
|
-
function
|
|
3659
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
3897
|
+
function un({ bundle: e, mode: t = "auto", style: n }) {
|
|
3898
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(ln, {
|
|
3660
3899
|
blocks: e.blocks,
|
|
3661
3900
|
theme: e.theme,
|
|
3662
3901
|
components: e.components,
|
|
@@ -3673,7 +3912,7 @@ function tn({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
3673
3912
|
}
|
|
3674
3913
|
//#endregion
|
|
3675
3914
|
//#region src/WebimPage.jsx
|
|
3676
|
-
function
|
|
3915
|
+
function dn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
|
|
3677
3916
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
3678
3917
|
onLoad: m,
|
|
3679
3918
|
onError: h
|
|
@@ -3683,7 +3922,7 @@ function nn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
3683
3922
|
onError: h
|
|
3684
3923
|
}, i(() => {
|
|
3685
3924
|
let i = !0;
|
|
3686
|
-
return _({ status: "loading" }),
|
|
3925
|
+
return _({ status: "loading" }), ne({
|
|
3687
3926
|
apiUrl: e,
|
|
3688
3927
|
tenant: t,
|
|
3689
3928
|
slug: n,
|
|
@@ -3710,11 +3949,11 @@ function nn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
3710
3949
|
r,
|
|
3711
3950
|
a,
|
|
3712
3951
|
o
|
|
3713
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
3952
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(un, {
|
|
3714
3953
|
bundle: g.bundle,
|
|
3715
3954
|
mode: l,
|
|
3716
3955
|
style: d
|
|
3717
3956
|
});
|
|
3718
3957
|
}
|
|
3719
3958
|
//#endregion
|
|
3720
|
-
export {
|
|
3959
|
+
export { ln as PageRenderer, un as WebimContent, dn as WebimPage, ne as fetchPage, De as renderRichContent, L as resolveTheme };
|