webim-adapter 1.1.3 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/README.md +24 -0
- package/build/webim-adapter.js +1305 -608
- package/build/webim-embed.js +13 -7
- package/build/webim-ssr.js +1417 -720
- package/package.json +10 -3
package/build/webim-adapter.js
CHANGED
|
@@ -258,17 +258,17 @@ function A(e) {
|
|
|
258
258
|
delete t.textStrokeWidth, delete t.textStrokeColor, (W !== void 0 || te !== void 0) && (t.WebkitTextStroke = `${O(W ?? 1)} ${te || "currentColor"}`);
|
|
259
259
|
let { clipText: ne } = t;
|
|
260
260
|
delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
261
|
-
let { transitions:
|
|
261
|
+
let { transitions: re, transitionDuration: G, transitionEasing: K, transitionProperty: q } = t, ie = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
262
262
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
263
|
-
let
|
|
264
|
-
if (
|
|
263
|
+
let J = (Array.isArray(re) ? re : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ie(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
264
|
+
if (G !== void 0 && J.push(`${q || "all"} ${ie(G)} ${K || "ease"}`), J.length && (t.transition = J.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
265
265
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
266
266
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
267
267
|
}
|
|
268
268
|
delete t.backgroundVideo;
|
|
269
|
-
let { overlayColor:
|
|
270
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
271
|
-
let e = `color-mix(in srgb, ${
|
|
269
|
+
let { overlayColor: ae, overlayOpacity: oe } = t;
|
|
270
|
+
if (delete t.overlayColor, delete t.overlayOpacity, ae) {
|
|
271
|
+
let e = `color-mix(in srgb, ${ae} ${oe ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
272
272
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
273
273
|
}
|
|
274
274
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
@@ -397,7 +397,7 @@ function ne(e, t) {
|
|
|
397
397
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
398
398
|
}).filter(Boolean).join("\n");
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function re(e, t) {
|
|
401
401
|
let n = [], r = (e) => {
|
|
402
402
|
for (let [t, r] of Object.entries(e || {})) {
|
|
403
403
|
let e = ne(t, r.props);
|
|
@@ -408,7 +408,7 @@ function G(e, t) {
|
|
|
408
408
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
409
409
|
return n.join("\n");
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function G(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
414
|
let e = ee(t, r.props);
|
|
@@ -419,8 +419,8 @@ function K(e, t) {
|
|
|
419
419
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
420
420
|
return n.join("\n");
|
|
421
421
|
}
|
|
422
|
-
var
|
|
423
|
-
fontFamily:
|
|
422
|
+
var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", q = {
|
|
423
|
+
fontFamily: K,
|
|
424
424
|
fontStyle: "normal",
|
|
425
425
|
fontWeight: 400,
|
|
426
426
|
letterSpacing: "normal",
|
|
@@ -468,23 +468,32 @@ var q = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
468
468
|
contrastText: "#052e2b"
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
+
}, J = {
|
|
472
|
+
h1: 40,
|
|
473
|
+
h2: 32,
|
|
474
|
+
h3: 26,
|
|
475
|
+
h4: 22,
|
|
476
|
+
h5: 19,
|
|
477
|
+
h6: 16
|
|
471
478
|
}, ae = {
|
|
472
479
|
font: "system",
|
|
473
480
|
headingFont: "inherit",
|
|
481
|
+
headings: J,
|
|
482
|
+
bodySize: 16,
|
|
474
483
|
light: ie.light,
|
|
475
484
|
dark: ie.dark
|
|
476
|
-
},
|
|
485
|
+
}, oe = {
|
|
477
486
|
system: {
|
|
478
487
|
label: "System",
|
|
479
|
-
value:
|
|
488
|
+
value: K
|
|
480
489
|
},
|
|
481
490
|
inter: {
|
|
482
491
|
label: "Inter",
|
|
483
|
-
value: `"Inter", ${
|
|
492
|
+
value: `"Inter", ${K}`
|
|
484
493
|
},
|
|
485
494
|
outfit: {
|
|
486
495
|
label: "Outfit",
|
|
487
|
-
value: `"Outfit", ${
|
|
496
|
+
value: `"Outfit", ${K}`
|
|
488
497
|
},
|
|
489
498
|
serif: {
|
|
490
499
|
label: "Serif",
|
|
@@ -494,7 +503,7 @@ var q = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
494
503
|
label: "Mono",
|
|
495
504
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
496
505
|
}
|
|
497
|
-
},
|
|
506
|
+
}, se = (e, t) => oe[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), ce = (e, ...t) => {
|
|
498
507
|
let n = Object.assign({}, e, ...t);
|
|
499
508
|
return n.primary = {
|
|
500
509
|
...e.primary,
|
|
@@ -510,16 +519,21 @@ var q = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
510
519
|
}), {})
|
|
511
520
|
}, n;
|
|
512
521
|
};
|
|
513
|
-
function
|
|
514
|
-
let { light: t, dark: n, font: r, headingFont: i,
|
|
522
|
+
function le(e) {
|
|
523
|
+
let { light: t, dark: n, font: r, headingFont: i, headings: a, bodySize: o, ...s } = e ?? {};
|
|
515
524
|
return {
|
|
516
525
|
font: r ?? ae.font,
|
|
517
526
|
headingFont: i ?? ae.headingFont,
|
|
518
|
-
|
|
519
|
-
|
|
527
|
+
headings: {
|
|
528
|
+
...J,
|
|
529
|
+
...a ?? {}
|
|
530
|
+
},
|
|
531
|
+
bodySize: o ?? 16,
|
|
532
|
+
light: ce(ie.light, s, t),
|
|
533
|
+
dark: ce(ie.dark, n)
|
|
520
534
|
};
|
|
521
535
|
}
|
|
522
|
-
function
|
|
536
|
+
function ue(e) {
|
|
523
537
|
return {
|
|
524
538
|
"--page-bg": e.background,
|
|
525
539
|
"--page-surface": e.surface ?? e.background,
|
|
@@ -537,31 +551,44 @@ function le(e) {
|
|
|
537
551
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
538
552
|
};
|
|
539
553
|
}
|
|
540
|
-
function
|
|
541
|
-
let t =
|
|
554
|
+
function de(e) {
|
|
555
|
+
let t = le(e);
|
|
542
556
|
return {
|
|
543
557
|
backgroundColor: "var(--page-bg)",
|
|
544
558
|
color: "var(--page-text)",
|
|
545
|
-
fontFamily:
|
|
546
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
559
|
+
fontFamily: se(t.font, K),
|
|
560
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : se(t.headingFont, "inherit"),
|
|
561
|
+
...pe(t.headings),
|
|
562
|
+
"--page-body-size": fe(t.bodySize, 16)
|
|
547
563
|
};
|
|
548
564
|
}
|
|
549
|
-
function
|
|
550
|
-
|
|
565
|
+
function fe(e, t) {
|
|
566
|
+
return e === "" || e == null ? `${t}px` : isNaN(Number(e)) ? String(e) : `${Number(e)}px`;
|
|
567
|
+
}
|
|
568
|
+
function pe(e) {
|
|
569
|
+
let t = {};
|
|
570
|
+
for (let n of Object.keys(J)) {
|
|
571
|
+
let r = e?.[n] ?? J[n];
|
|
572
|
+
t[`--page-${n}`] = fe(r, J[n]);
|
|
573
|
+
}
|
|
574
|
+
return t;
|
|
575
|
+
}
|
|
576
|
+
function me(e, t = "light") {
|
|
577
|
+
let n = le(e);
|
|
551
578
|
return {
|
|
552
|
-
...
|
|
553
|
-
...
|
|
579
|
+
...de(e),
|
|
580
|
+
...ue(n[t] ?? n.light)
|
|
554
581
|
};
|
|
555
582
|
}
|
|
556
|
-
function
|
|
583
|
+
function he(e, t) {
|
|
557
584
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
558
585
|
}
|
|
559
|
-
function
|
|
586
|
+
function ge(e, t) {
|
|
560
587
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
561
588
|
}
|
|
562
589
|
//#endregion
|
|
563
590
|
//#region src/bundle.js
|
|
564
|
-
function
|
|
591
|
+
function _e({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
565
592
|
let a = {
|
|
566
593
|
...t?.global ?? {},
|
|
567
594
|
...t?.tenant ?? {}
|
|
@@ -571,7 +598,7 @@ function me({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
571
598
|
title: e.title,
|
|
572
599
|
slug: e.slug,
|
|
573
600
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
574
|
-
theme:
|
|
601
|
+
theme: he(o, a.builder_themes?.themes),
|
|
575
602
|
components: a.builder_components?.components ?? {},
|
|
576
603
|
custom: o.custom,
|
|
577
604
|
animations: o.animations,
|
|
@@ -587,18 +614,18 @@ function me({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
587
614
|
}
|
|
588
615
|
//#endregion
|
|
589
616
|
//#region src/fetchPage.js
|
|
590
|
-
var
|
|
617
|
+
var ve = async (e) => {
|
|
591
618
|
let t = await e.json().catch(() => null);
|
|
592
619
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
593
620
|
return t?.payload ?? t;
|
|
594
621
|
};
|
|
595
|
-
async function
|
|
622
|
+
async function ye({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
596
623
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
597
624
|
if (!n) throw Error("fetchPage: slug is required");
|
|
598
625
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
599
626
|
...t ? { "x-tenant": t } : {},
|
|
600
627
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
601
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
628
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(ve), c(`${l}/settings/public`, { headers: u }).then(ve)]), p = _e({
|
|
602
629
|
page: d,
|
|
603
630
|
settings: f,
|
|
604
631
|
tenant: t,
|
|
@@ -613,7 +640,7 @@ async function ge({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
613
640
|
"LogoCarousel"
|
|
614
641
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
615
642
|
if (m.length) {
|
|
616
|
-
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(
|
|
643
|
+
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(ve).then((e) => {
|
|
617
644
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
618
645
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
619
646
|
}).catch(() => [[t, []]])));
|
|
@@ -627,7 +654,7 @@ async function ge({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
627
654
|
}
|
|
628
655
|
//#endregion
|
|
629
656
|
//#region ../ui/src/components/builder/locale.js
|
|
630
|
-
var
|
|
657
|
+
var be = /* @__PURE__ */ new Set([
|
|
631
658
|
"ar",
|
|
632
659
|
"he",
|
|
633
660
|
"fa",
|
|
@@ -638,34 +665,34 @@ var _e = /* @__PURE__ */ new Set([
|
|
|
638
665
|
"yi",
|
|
639
666
|
"dv",
|
|
640
667
|
"ckb"
|
|
641
|
-
]),
|
|
668
|
+
]), Y = (e) => be.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", X = (e, t) => e === "ltr" || e === "rtl" ? e : t ? Y(t) : void 0, Z = t({
|
|
642
669
|
tenant: "",
|
|
643
670
|
apiUrl: "/api",
|
|
644
671
|
locale: "",
|
|
645
672
|
settings: null
|
|
646
|
-
}),
|
|
673
|
+
}), xe = t(null), Se = (e) => {
|
|
647
674
|
let t = Number(e?.__page);
|
|
648
675
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
649
676
|
if (typeof window > "u") return 1;
|
|
650
677
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
651
678
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
652
|
-
},
|
|
679
|
+
}, Q = () => {
|
|
653
680
|
if (typeof window > "u") return {};
|
|
654
681
|
let e = {};
|
|
655
682
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
656
683
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
657
684
|
}), e;
|
|
658
|
-
},
|
|
685
|
+
}, Ce = (e) => {
|
|
659
686
|
let t = {
|
|
660
687
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
661
|
-
...
|
|
688
|
+
...Q()
|
|
662
689
|
};
|
|
663
690
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
664
|
-
},
|
|
665
|
-
function
|
|
691
|
+
}, we = t(null), Te = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
692
|
+
function Ee(e, t) {
|
|
666
693
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
667
694
|
}
|
|
668
|
-
var
|
|
695
|
+
var De = (e) => {
|
|
669
696
|
let t = [];
|
|
670
697
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
671
698
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -675,36 +702,39 @@ var we = (e) => {
|
|
|
675
702
|
}
|
|
676
703
|
return t;
|
|
677
704
|
};
|
|
678
|
-
function
|
|
705
|
+
function Oe(e) {
|
|
679
706
|
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
|
|
680
707
|
}
|
|
681
|
-
function
|
|
682
|
-
let n = t?.data ?? {}, r =
|
|
708
|
+
function ke(e, t) {
|
|
709
|
+
let n = t?.data ?? {}, r = De(n);
|
|
683
710
|
if (!r.length) return e;
|
|
684
|
-
let i = RegExp(`:(${r.map(
|
|
711
|
+
let i = RegExp(`:(${r.map(Te).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Oe(Ee(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
685
712
|
return a(e);
|
|
686
713
|
}
|
|
687
|
-
var
|
|
714
|
+
var Ae = {
|
|
688
715
|
margin: 0,
|
|
689
716
|
fontWeight: 700,
|
|
690
717
|
lineHeight: 1.2,
|
|
691
718
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
692
|
-
},
|
|
719
|
+
}, je = J, Me = (e) => `var(--page-${e}, ${J[e] ?? J.h2}px)`, Ne = {
|
|
720
|
+
margin: 0,
|
|
721
|
+
fontSize: "var(--page-body-size, 16px)"
|
|
722
|
+
}, Pe = {
|
|
693
723
|
display: "inline-block",
|
|
694
724
|
textDecoration: "none",
|
|
695
725
|
cursor: "pointer",
|
|
696
726
|
backgroundColor: "var(--page-accent, #111827)",
|
|
697
727
|
color: "var(--page-accent-text, #ffffff)"
|
|
698
|
-
},
|
|
728
|
+
}, Fe = {
|
|
699
729
|
flexGrow: 1,
|
|
700
730
|
display: "flex",
|
|
701
731
|
flexDirection: "column",
|
|
702
732
|
position: "relative"
|
|
703
|
-
},
|
|
733
|
+
}, Ie = {
|
|
704
734
|
display: "flex",
|
|
705
735
|
flexDirection: "column"
|
|
706
736
|
};
|
|
707
|
-
function
|
|
737
|
+
function Le({ style: e }) {
|
|
708
738
|
let t = e?.backgroundVideo;
|
|
709
739
|
if (!t) return null;
|
|
710
740
|
let n = {
|
|
@@ -730,7 +760,7 @@ function Me({ style: e }) {
|
|
|
730
760
|
background: r
|
|
731
761
|
} })] });
|
|
732
762
|
}
|
|
733
|
-
var
|
|
763
|
+
var Re = (e, t) => e?.backgroundVideo ? {
|
|
734
764
|
position: "relative",
|
|
735
765
|
...t,
|
|
736
766
|
...A(e)
|
|
@@ -738,24 +768,24 @@ var Ne = (e, t) => e?.backgroundVideo ? {
|
|
|
738
768
|
...t,
|
|
739
769
|
...A(e)
|
|
740
770
|
};
|
|
741
|
-
function
|
|
771
|
+
function ze({ style: e, nodeRef: t, children: n }) {
|
|
742
772
|
return /* @__PURE__ */ d("div", {
|
|
743
773
|
ref: t,
|
|
744
774
|
style: {
|
|
745
|
-
...
|
|
775
|
+
...Fe,
|
|
746
776
|
...A(e)
|
|
747
777
|
},
|
|
748
|
-
children: [/* @__PURE__ */ u(
|
|
778
|
+
children: [/* @__PURE__ */ u(Le, { style: e }), n]
|
|
749
779
|
});
|
|
750
780
|
}
|
|
751
|
-
function
|
|
781
|
+
function Be({ style: e, nodeRef: t, children: n }) {
|
|
752
782
|
return /* @__PURE__ */ d("section", {
|
|
753
783
|
ref: t,
|
|
754
|
-
style:
|
|
755
|
-
children: [/* @__PURE__ */ u(
|
|
784
|
+
style: Re(e, Ie),
|
|
785
|
+
children: [/* @__PURE__ */ u(Le, { style: e }), n]
|
|
756
786
|
});
|
|
757
787
|
}
|
|
758
|
-
function
|
|
788
|
+
function Ve({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
759
789
|
let i = t ? {
|
|
760
790
|
position: "relative",
|
|
761
791
|
minHeight: 240
|
|
@@ -764,32 +794,33 @@ function Ie({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
764
794
|
ref: n,
|
|
765
795
|
style: i ? {
|
|
766
796
|
...i,
|
|
767
|
-
...
|
|
768
|
-
} :
|
|
769
|
-
children: [/* @__PURE__ */ u(
|
|
797
|
+
...Re(e)
|
|
798
|
+
} : Re(e),
|
|
799
|
+
children: [/* @__PURE__ */ u(Le, { style: e }), r]
|
|
770
800
|
});
|
|
771
801
|
}
|
|
772
|
-
function
|
|
802
|
+
function He({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
773
803
|
return /* @__PURE__ */ u(n, {
|
|
774
804
|
ref: a,
|
|
775
805
|
style: {
|
|
776
|
-
...
|
|
806
|
+
...Ae,
|
|
807
|
+
fontSize: Me(n),
|
|
777
808
|
...A(r)
|
|
778
809
|
},
|
|
779
|
-
children:
|
|
810
|
+
children: Ge(t, e, i)
|
|
780
811
|
});
|
|
781
812
|
}
|
|
782
|
-
var
|
|
783
|
-
fontFamily:
|
|
813
|
+
var Ue = {
|
|
814
|
+
fontFamily: oe.mono.value,
|
|
784
815
|
background: "rgba(148, 163, 184, 0.18)",
|
|
785
816
|
padding: "1px 5px",
|
|
786
817
|
borderRadius: 4,
|
|
787
818
|
fontSize: "0.9em"
|
|
788
819
|
};
|
|
789
|
-
function
|
|
820
|
+
function We(e, t = [], n, r) {
|
|
790
821
|
let i = e;
|
|
791
822
|
return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
|
|
792
|
-
style:
|
|
823
|
+
style: Ue,
|
|
793
824
|
children: i
|
|
794
825
|
})), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n ? i = /* @__PURE__ */ u("a", {
|
|
795
826
|
href: n,
|
|
@@ -805,13 +836,13 @@ function ze(e, t = [], n, r) {
|
|
|
805
836
|
children: i
|
|
806
837
|
})), i;
|
|
807
838
|
}
|
|
808
|
-
function
|
|
839
|
+
function Ge(t, n, r) {
|
|
809
840
|
return t?.length ? t.map((t, n) => {
|
|
810
841
|
if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
|
|
811
|
-
if (t.parts) return /* @__PURE__ */ u(e, { children:
|
|
842
|
+
if (t.parts) return /* @__PURE__ */ u(e, { children: Ge(t.parts, "", r) }, n);
|
|
812
843
|
let i = t.text;
|
|
813
844
|
return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
|
|
814
|
-
style:
|
|
845
|
+
style: Ue,
|
|
815
846
|
children: i
|
|
816
847
|
})), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
|
|
817
848
|
style: {
|
|
@@ -834,42 +865,35 @@ function Be(t, n, r) {
|
|
|
834
865
|
})), /* @__PURE__ */ u(e, { children: i }, n);
|
|
835
866
|
}) : n;
|
|
836
867
|
}
|
|
837
|
-
function
|
|
868
|
+
function Ke({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
838
869
|
return /* @__PURE__ */ u("span", {
|
|
839
870
|
style: A(a),
|
|
840
|
-
children: e?.length ?
|
|
871
|
+
children: e?.length ? Ge(e, t) : We(t, n, r, i)
|
|
841
872
|
});
|
|
842
873
|
}
|
|
843
|
-
var
|
|
844
|
-
h1: 40,
|
|
845
|
-
h2: 32,
|
|
846
|
-
h3: 26,
|
|
847
|
-
h4: 22,
|
|
848
|
-
h5: 19,
|
|
849
|
-
h6: 16
|
|
850
|
-
}, Ue = [
|
|
874
|
+
var qe = [
|
|
851
875
|
"left",
|
|
852
876
|
"center",
|
|
853
877
|
"right",
|
|
854
878
|
"justify"
|
|
855
879
|
];
|
|
856
|
-
function
|
|
880
|
+
function Je(e, t, n) {
|
|
857
881
|
let r = e && e.cellStyles;
|
|
858
882
|
if (!r || typeof r != "object" || Array.isArray(r)) return {};
|
|
859
883
|
let i = r[`${t}:${n}`];
|
|
860
884
|
return i && typeof i == "object" && !Array.isArray(i) ? i : {};
|
|
861
885
|
}
|
|
862
|
-
function
|
|
886
|
+
function Ye(e, t) {
|
|
863
887
|
let n = e || {}, r = typeof n.bold == "boolean" ? n.bold : !!t;
|
|
864
888
|
return {
|
|
865
|
-
textAlign:
|
|
889
|
+
textAlign: qe.includes(n.align) ? n.align : "left",
|
|
866
890
|
fontWeight: r ? 700 : 400,
|
|
867
891
|
fontStyle: n.italic ? "italic" : void 0,
|
|
868
892
|
color: typeof n.color == "string" && n.color ? n.color : void 0,
|
|
869
893
|
backgroundColor: typeof n.bg == "string" && n.bg ? n.bg : void 0
|
|
870
894
|
};
|
|
871
895
|
}
|
|
872
|
-
function
|
|
896
|
+
function Xe({ align: e = "center", width: t, wrap: n } = {}) {
|
|
873
897
|
let r = t ? `${t}%` : void 0;
|
|
874
898
|
if (e === "full") return { width: "100%" };
|
|
875
899
|
let i = e === "left" || e === "right";
|
|
@@ -903,8 +927,8 @@ function Ke({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
903
927
|
marginRight: "auto"
|
|
904
928
|
};
|
|
905
929
|
}
|
|
906
|
-
function
|
|
907
|
-
let r = n ?? ((e, n) =>
|
|
930
|
+
function Ze(e = [], t, n) {
|
|
931
|
+
let r = n ?? ((e, n) => Ge(e, n, t));
|
|
908
932
|
return e.map((t, n) => {
|
|
909
933
|
let i = {
|
|
910
934
|
marginTop: 0,
|
|
@@ -926,7 +950,7 @@ function qe(e = [], t, n) {
|
|
|
926
950
|
marginLeft: 0,
|
|
927
951
|
marginRight: 0,
|
|
928
952
|
...i,
|
|
929
|
-
...
|
|
953
|
+
...Xe(t)
|
|
930
954
|
},
|
|
931
955
|
children: [t.href ? /* @__PURE__ */ u("a", {
|
|
932
956
|
href: t.href,
|
|
@@ -945,16 +969,16 @@ function qe(e = [], t, n) {
|
|
|
945
969
|
})]
|
|
946
970
|
}, n);
|
|
947
971
|
}
|
|
948
|
-
if (t.type === "video") return
|
|
972
|
+
if (t.type === "video") return ct(t.url) ? /* @__PURE__ */ u("div", {
|
|
949
973
|
style: {
|
|
950
974
|
...i,
|
|
951
|
-
...
|
|
975
|
+
...Xe({
|
|
952
976
|
align: t.align,
|
|
953
977
|
wrap: t.wrap,
|
|
954
978
|
width: t.width ?? 100
|
|
955
979
|
})
|
|
956
980
|
},
|
|
957
|
-
children: /* @__PURE__ */ u(
|
|
981
|
+
children: /* @__PURE__ */ u(lt, {
|
|
958
982
|
url: t.url,
|
|
959
983
|
autoplay: t.autoplay,
|
|
960
984
|
muted: t.muted,
|
|
@@ -1018,7 +1042,7 @@ function qe(e = [], t, n) {
|
|
|
1018
1042
|
verticalAlign: "top"
|
|
1019
1043
|
}, o = r ? e.slice(1) : e, s = Array.isArray(t.widths) ? t.widths : null, c = (e, n, r) => ({
|
|
1020
1044
|
...a,
|
|
1021
|
-
...
|
|
1045
|
+
...Ye(Je(t, e, n), r)
|
|
1022
1046
|
});
|
|
1023
1047
|
return /* @__PURE__ */ d("table", {
|
|
1024
1048
|
style: {
|
|
@@ -1056,17 +1080,17 @@ function qe(e = [], t, n) {
|
|
|
1056
1080
|
}
|
|
1057
1081
|
if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
|
|
1058
1082
|
style: {
|
|
1059
|
-
|
|
1083
|
+
...$e,
|
|
1060
1084
|
...i
|
|
1061
1085
|
},
|
|
1062
1086
|
children: r(t.parts, t.text)
|
|
1063
1087
|
}, n);
|
|
1064
|
-
if (
|
|
1088
|
+
if (je[t.type]) {
|
|
1065
1089
|
let e = t.type;
|
|
1066
1090
|
return /* @__PURE__ */ u(e, {
|
|
1067
1091
|
style: {
|
|
1068
|
-
...
|
|
1069
|
-
fontSize:
|
|
1092
|
+
...Ae,
|
|
1093
|
+
fontSize: Me(t.type),
|
|
1070
1094
|
...i
|
|
1071
1095
|
},
|
|
1072
1096
|
children: r(t.parts, t.text)
|
|
@@ -1074,39 +1098,39 @@ function qe(e = [], t, n) {
|
|
|
1074
1098
|
}
|
|
1075
1099
|
return /* @__PURE__ */ u("p", {
|
|
1076
1100
|
style: {
|
|
1077
|
-
...
|
|
1101
|
+
...Ne,
|
|
1078
1102
|
...i
|
|
1079
1103
|
},
|
|
1080
1104
|
children: r(t.parts, t.text)
|
|
1081
1105
|
}, n);
|
|
1082
1106
|
});
|
|
1083
1107
|
}
|
|
1084
|
-
function
|
|
1108
|
+
function Qe({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
1085
1109
|
return /* @__PURE__ */ u("div", {
|
|
1086
1110
|
ref: r,
|
|
1087
1111
|
style: {
|
|
1088
1112
|
display: "flow-root",
|
|
1089
1113
|
...A(t)
|
|
1090
1114
|
},
|
|
1091
|
-
children:
|
|
1115
|
+
children: Ze(e, n)
|
|
1092
1116
|
});
|
|
1093
1117
|
}
|
|
1094
|
-
var
|
|
1118
|
+
var $e = {
|
|
1095
1119
|
margin: 0,
|
|
1096
1120
|
padding: "8px 0 8px 20px",
|
|
1097
1121
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
1098
1122
|
};
|
|
1099
|
-
function
|
|
1123
|
+
function et({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1100
1124
|
return /* @__PURE__ */ u("blockquote", {
|
|
1101
1125
|
ref: i,
|
|
1102
1126
|
style: {
|
|
1103
|
-
|
|
1127
|
+
...$e,
|
|
1104
1128
|
...A(n)
|
|
1105
1129
|
},
|
|
1106
|
-
children:
|
|
1130
|
+
children: Ge(t, e, r)
|
|
1107
1131
|
});
|
|
1108
1132
|
}
|
|
1109
|
-
function
|
|
1133
|
+
function tt({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
1110
1134
|
return /* @__PURE__ */ u(e ? "ol" : "ul", {
|
|
1111
1135
|
ref: r,
|
|
1112
1136
|
style: {
|
|
@@ -1116,53 +1140,53 @@ function Ze({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
1116
1140
|
},
|
|
1117
1141
|
children: t.map((e, t) => /* @__PURE__ */ u("li", {
|
|
1118
1142
|
style: { marginBottom: 4 },
|
|
1119
|
-
children:
|
|
1143
|
+
children: Ge(e.parts, e.text)
|
|
1120
1144
|
}, t))
|
|
1121
1145
|
});
|
|
1122
1146
|
}
|
|
1123
|
-
function
|
|
1147
|
+
function nt({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1124
1148
|
return /* @__PURE__ */ u("p", {
|
|
1125
1149
|
ref: i,
|
|
1126
1150
|
style: {
|
|
1127
|
-
...
|
|
1151
|
+
...Ne,
|
|
1128
1152
|
...A(n)
|
|
1129
1153
|
},
|
|
1130
|
-
children:
|
|
1154
|
+
children: Ge(t, e, r)
|
|
1131
1155
|
});
|
|
1132
1156
|
}
|
|
1133
|
-
var
|
|
1157
|
+
var rt = {
|
|
1134
1158
|
color: "var(--page-accent, inherit)",
|
|
1135
1159
|
textDecoration: "underline",
|
|
1136
1160
|
textUnderlineOffset: 3,
|
|
1137
1161
|
cursor: "pointer"
|
|
1138
1162
|
};
|
|
1139
|
-
function
|
|
1163
|
+
function it({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1140
1164
|
return /* @__PURE__ */ u("a", {
|
|
1141
1165
|
ref: o,
|
|
1142
1166
|
href: n || "#",
|
|
1143
1167
|
target: r || void 0,
|
|
1144
1168
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1145
1169
|
style: {
|
|
1146
|
-
|
|
1170
|
+
...rt,
|
|
1147
1171
|
...A(i)
|
|
1148
1172
|
},
|
|
1149
|
-
children:
|
|
1173
|
+
children: Ge(t, e, a)
|
|
1150
1174
|
});
|
|
1151
1175
|
}
|
|
1152
|
-
function
|
|
1176
|
+
function at({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1153
1177
|
return /* @__PURE__ */ u("a", {
|
|
1154
1178
|
ref: o,
|
|
1155
1179
|
href: n || "#",
|
|
1156
1180
|
target: r || void 0,
|
|
1157
1181
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1158
1182
|
style: {
|
|
1159
|
-
...
|
|
1183
|
+
...Pe,
|
|
1160
1184
|
...A(i)
|
|
1161
1185
|
},
|
|
1162
|
-
children:
|
|
1186
|
+
children: Ge(t, e, a)
|
|
1163
1187
|
});
|
|
1164
1188
|
}
|
|
1165
|
-
function
|
|
1189
|
+
function ot({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
1166
1190
|
return e ? /* @__PURE__ */ u("img", {
|
|
1167
1191
|
ref: r,
|
|
1168
1192
|
src: e,
|
|
@@ -1174,7 +1198,7 @@ function nt({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
1174
1198
|
}
|
|
1175
1199
|
}) : null;
|
|
1176
1200
|
}
|
|
1177
|
-
function
|
|
1201
|
+
function st({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
1178
1202
|
return e ? /* @__PURE__ */ u("video", {
|
|
1179
1203
|
ref: s,
|
|
1180
1204
|
src: e,
|
|
@@ -1192,9 +1216,9 @@ function rt({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
1192
1216
|
}
|
|
1193
1217
|
}) : null;
|
|
1194
1218
|
}
|
|
1195
|
-
var
|
|
1196
|
-
function
|
|
1197
|
-
let c =
|
|
1219
|
+
var ct = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
1220
|
+
function lt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
1221
|
+
let c = ct(e);
|
|
1198
1222
|
if (!c) return null;
|
|
1199
1223
|
let l = new URLSearchParams({ rel: "0" });
|
|
1200
1224
|
return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ u("div", {
|
|
@@ -1220,7 +1244,7 @@ function at({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
1220
1244
|
})
|
|
1221
1245
|
});
|
|
1222
1246
|
}
|
|
1223
|
-
function
|
|
1247
|
+
function ut({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
1224
1248
|
return e ? /* @__PURE__ */ u("iframe", {
|
|
1225
1249
|
ref: i,
|
|
1226
1250
|
src: e,
|
|
@@ -1236,7 +1260,7 @@ function ot({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
1236
1260
|
}
|
|
1237
1261
|
}) : null;
|
|
1238
1262
|
}
|
|
1239
|
-
function
|
|
1263
|
+
function dt({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
1240
1264
|
let [a, o] = c(null);
|
|
1241
1265
|
return i(() => {
|
|
1242
1266
|
a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
|
|
@@ -1255,17 +1279,18 @@ function st({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
1255
1279
|
style: A(n)
|
|
1256
1280
|
});
|
|
1257
1281
|
}
|
|
1258
|
-
function
|
|
1282
|
+
function ft({ height: e, style: t, nodeRef: n }) {
|
|
1259
1283
|
return /* @__PURE__ */ u("div", {
|
|
1260
|
-
ref:
|
|
1284
|
+
ref: n,
|
|
1261
1285
|
style: {
|
|
1262
1286
|
height: e || 32,
|
|
1263
1287
|
flexShrink: 0,
|
|
1264
|
-
alignSelf: "stretch"
|
|
1288
|
+
alignSelf: "stretch",
|
|
1289
|
+
...A(t)
|
|
1265
1290
|
}
|
|
1266
1291
|
});
|
|
1267
1292
|
}
|
|
1268
|
-
function
|
|
1293
|
+
function pt({ style: e, nodeRef: t }) {
|
|
1269
1294
|
return /* @__PURE__ */ u("div", {
|
|
1270
1295
|
ref: t,
|
|
1271
1296
|
style: {
|
|
@@ -1276,7 +1301,16 @@ function lt({ style: e, nodeRef: t }) {
|
|
|
1276
1301
|
}
|
|
1277
1302
|
});
|
|
1278
1303
|
}
|
|
1279
|
-
|
|
1304
|
+
function mt({ style: e, nodeRef: t }) {
|
|
1305
|
+
return /* @__PURE__ */ u("div", {
|
|
1306
|
+
ref: t,
|
|
1307
|
+
style: {
|
|
1308
|
+
flexShrink: 0,
|
|
1309
|
+
...A(e)
|
|
1310
|
+
}
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
var ht = {
|
|
1280
1314
|
position: "absolute",
|
|
1281
1315
|
top: "50%",
|
|
1282
1316
|
transform: "translateY(-50%)",
|
|
@@ -1293,7 +1327,7 @@ var ut = {
|
|
|
1293
1327
|
alignItems: "center",
|
|
1294
1328
|
justifyContent: "center",
|
|
1295
1329
|
padding: 0
|
|
1296
|
-
},
|
|
1330
|
+
}, gt = {
|
|
1297
1331
|
bottom: {
|
|
1298
1332
|
inset: "auto 0 0 0",
|
|
1299
1333
|
padding: "40px 24px 20px",
|
|
@@ -1312,8 +1346,8 @@ var ut = {
|
|
|
1312
1346
|
padding: 24,
|
|
1313
1347
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1314
1348
|
}
|
|
1315
|
-
},
|
|
1316
|
-
function
|
|
1349
|
+
}, _t = 48;
|
|
1350
|
+
function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
|
|
1317
1351
|
let [p, m] = c(0), [h, g] = c(!1), [_, v] = c(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1318
1352
|
if (i(() => {
|
|
1319
1353
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1329,7 +1363,7 @@ function pt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1329
1363
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1330
1364
|
if (!_) return;
|
|
1331
1365
|
let { dx: e } = _;
|
|
1332
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1366
|
+
v(null), e < -48 ? b(y + 1) : e > _t && b(y - 1);
|
|
1333
1367
|
};
|
|
1334
1368
|
return /* @__PURE__ */ d("div", {
|
|
1335
1369
|
ref: f,
|
|
@@ -1351,6 +1385,7 @@ function pt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1351
1385
|
position: "relative",
|
|
1352
1386
|
overflow: "hidden",
|
|
1353
1387
|
width: "100%",
|
|
1388
|
+
height: a,
|
|
1354
1389
|
touchAction: "pan-y",
|
|
1355
1390
|
userSelect: _ ? "none" : void 0,
|
|
1356
1391
|
cursor: _ ? "grabbing" : void 0,
|
|
@@ -1359,7 +1394,7 @@ function pt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1359
1394
|
children: [/* @__PURE__ */ u("div", {
|
|
1360
1395
|
style: {
|
|
1361
1396
|
display: "flex",
|
|
1362
|
-
height:
|
|
1397
|
+
height: "100%",
|
|
1363
1398
|
transform: `translateX(calc(${-y * 100}% + ${_?.dx ?? 0}px))`,
|
|
1364
1399
|
transition: _ ? "none" : "transform 450ms ease"
|
|
1365
1400
|
},
|
|
@@ -1377,7 +1412,7 @@ function pt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1377
1412
|
type: "button",
|
|
1378
1413
|
"aria-label": "Previous slide",
|
|
1379
1414
|
style: {
|
|
1380
|
-
...
|
|
1415
|
+
...ht,
|
|
1381
1416
|
left: 12
|
|
1382
1417
|
},
|
|
1383
1418
|
onClick: () => b(y - 1),
|
|
@@ -1387,7 +1422,7 @@ function pt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1387
1422
|
type: "button",
|
|
1388
1423
|
"aria-label": "Next slide",
|
|
1389
1424
|
style: {
|
|
1390
|
-
...
|
|
1425
|
+
...ht,
|
|
1391
1426
|
right: 12
|
|
1392
1427
|
},
|
|
1393
1428
|
onClick: () => b(y + 1),
|
|
@@ -1421,7 +1456,7 @@ function pt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1421
1456
|
] })]
|
|
1422
1457
|
});
|
|
1423
1458
|
}
|
|
1424
|
-
var
|
|
1459
|
+
var yt = (e, t) => ({
|
|
1425
1460
|
position: "absolute",
|
|
1426
1461
|
inset: 0,
|
|
1427
1462
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1429,18 +1464,18 @@ var mt = (e, t) => ({
|
|
|
1429
1464
|
backgroundSize: "cover",
|
|
1430
1465
|
backgroundPosition: "center"
|
|
1431
1466
|
});
|
|
1432
|
-
function
|
|
1433
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1467
|
+
function bt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1468
|
+
return e.length ? /* @__PURE__ */ u(vt, {
|
|
1434
1469
|
...r,
|
|
1435
1470
|
count: e.length,
|
|
1436
1471
|
renderSlide: (r) => {
|
|
1437
1472
|
let i = e[r];
|
|
1438
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1473
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: yt(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
|
|
1439
1474
|
style: {
|
|
1440
1475
|
position: "absolute",
|
|
1441
1476
|
color: "#fff",
|
|
1442
1477
|
textAlign: n,
|
|
1443
|
-
...
|
|
1478
|
+
...gt[t] ?? gt.bottom
|
|
1444
1479
|
},
|
|
1445
1480
|
children: [i.title && /* @__PURE__ */ u("div", {
|
|
1446
1481
|
style: {
|
|
@@ -1460,13 +1495,13 @@ function ht({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1460
1495
|
}
|
|
1461
1496
|
}) : null;
|
|
1462
1497
|
}
|
|
1463
|
-
function
|
|
1464
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1498
|
+
function xt({ slides: e = [], linked: t, ...n }) {
|
|
1499
|
+
return e.length ? /* @__PURE__ */ u(vt, {
|
|
1465
1500
|
...n,
|
|
1466
1501
|
count: e.length,
|
|
1467
1502
|
renderSlide: (n) => {
|
|
1468
1503
|
let r = e[n];
|
|
1469
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1504
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: yt(r.image, r.color) }), /* @__PURE__ */ u("div", {
|
|
1470
1505
|
style: {
|
|
1471
1506
|
position: "absolute",
|
|
1472
1507
|
inset: 0,
|
|
@@ -1478,23 +1513,23 @@ function gt({ slides: e = [], linked: t, ...n }) {
|
|
|
1478
1513
|
}
|
|
1479
1514
|
}) : null;
|
|
1480
1515
|
}
|
|
1481
|
-
var
|
|
1482
|
-
let r =
|
|
1516
|
+
var St = 256, Ct = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), wt = (e, t, n) => {
|
|
1517
|
+
let r = St * 2 ** n;
|
|
1483
1518
|
return {
|
|
1484
1519
|
x: (Number(t) + 180) / 360 * r,
|
|
1485
|
-
y: (.5 -
|
|
1520
|
+
y: (.5 - Ct(Number(e)) / (2 * Math.PI)) * r
|
|
1486
1521
|
};
|
|
1487
1522
|
}, $ = (e, t) => {
|
|
1488
1523
|
if (e === "" || e == null) return null;
|
|
1489
1524
|
let n = Number(e);
|
|
1490
1525
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1491
|
-
},
|
|
1492
|
-
function
|
|
1526
|
+
}, Tt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1527
|
+
function Et(e, t, n = "directions", r = "") {
|
|
1493
1528
|
let i = `${e},${t}`;
|
|
1494
1529
|
return n === "place" ? `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r ? "&query_place_id=" : ""}` : `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`;
|
|
1495
1530
|
}
|
|
1496
|
-
var
|
|
1497
|
-
function
|
|
1531
|
+
var Dt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1532
|
+
function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize: o = 22, pinLink: l = "directions", link: f = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
|
|
1498
1533
|
let _ = s(null), [v, y] = c(1200);
|
|
1499
1534
|
i(() => {
|
|
1500
1535
|
let e = _.current;
|
|
@@ -1504,7 +1539,7 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1504
1539
|
let n = new ResizeObserver(t);
|
|
1505
1540
|
return n.observe(e), () => n.disconnect();
|
|
1506
1541
|
}, []);
|
|
1507
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1542
|
+
let b = (Array.isArray(e) ? e : []).filter(Tt), x = Tt({
|
|
1508
1543
|
lat: t,
|
|
1509
1544
|
lng: n
|
|
1510
1545
|
}) ? {
|
|
@@ -1516,7 +1551,7 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1516
1551
|
} : null, S = Math.max(80, Number(a) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1517
1552
|
if (b.length < 2) return 13;
|
|
1518
1553
|
for (let e = 19; e >= 1; e--) {
|
|
1519
|
-
let t = b.map((t) =>
|
|
1554
|
+
let t = b.map((t) => wt($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
|
|
1520
1555
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1521
1556
|
}
|
|
1522
1557
|
return 1;
|
|
@@ -1540,12 +1575,12 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1540
1575
|
},
|
|
1541
1576
|
children: "Set the coordinates in Settings"
|
|
1542
1577
|
});
|
|
1543
|
-
let T =
|
|
1578
|
+
let T = wt(x.lat, x.lng, C), E = {
|
|
1544
1579
|
x: T.x - v / 2,
|
|
1545
1580
|
y: T.y - S / 2
|
|
1546
1581
|
}, D = [], O = [];
|
|
1547
|
-
for (let e = Math.floor(E.x /
|
|
1548
|
-
for (let e = Math.floor(E.y /
|
|
1582
|
+
for (let e = Math.floor(E.x / St); e <= Math.floor((E.x + v) / St); e++) D.push(e);
|
|
1583
|
+
for (let e = Math.floor(E.y / St); e <= Math.floor((E.y + S) / St); e++) O.push(e);
|
|
1549
1584
|
let k = 2 ** C;
|
|
1550
1585
|
return /* @__PURE__ */ d("div", {
|
|
1551
1586
|
ref: (e) => {
|
|
@@ -1568,22 +1603,22 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1568
1603
|
return e < 0 || e >= k ? null : /* @__PURE__ */ u("img", {
|
|
1569
1604
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1570
1605
|
alt: "",
|
|
1571
|
-
width:
|
|
1572
|
-
height:
|
|
1606
|
+
width: St,
|
|
1607
|
+
height: St,
|
|
1573
1608
|
loading: "lazy",
|
|
1574
1609
|
style: {
|
|
1575
1610
|
position: "absolute",
|
|
1576
|
-
left: Math.round(t *
|
|
1577
|
-
top: Math.round(e *
|
|
1578
|
-
width:
|
|
1579
|
-
height:
|
|
1611
|
+
left: Math.round(t * St - E.x),
|
|
1612
|
+
top: Math.round(e * St - E.y),
|
|
1613
|
+
width: St,
|
|
1614
|
+
height: St,
|
|
1580
1615
|
userSelect: "none",
|
|
1581
1616
|
pointerEvents: "none"
|
|
1582
1617
|
}
|
|
1583
1618
|
}, `${t}-${e}`);
|
|
1584
1619
|
})),
|
|
1585
1620
|
b.map((e, t) => {
|
|
1586
|
-
let n =
|
|
1621
|
+
let n = wt($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", s = l === "none" || g ? null : Et($(e.lat, 90), $(e.lng, 180), l, e.title);
|
|
1587
1622
|
return /* @__PURE__ */ d(s ? "a" : "span", {
|
|
1588
1623
|
href: s || void 0,
|
|
1589
1624
|
target: s ? "_blank" : void 0,
|
|
@@ -1622,8 +1657,8 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1622
1657
|
viewBox: "0 0 24 24",
|
|
1623
1658
|
fill: a,
|
|
1624
1659
|
style: { display: "block" },
|
|
1625
|
-
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
1626
|
-
d:
|
|
1660
|
+
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), kt[e.icon] ? /* @__PURE__ */ u("path", {
|
|
1661
|
+
d: kt[e.icon],
|
|
1627
1662
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1628
1663
|
fill: "none",
|
|
1629
1664
|
stroke: "#fff",
|
|
@@ -1659,7 +1694,7 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1659
1694
|
})
|
|
1660
1695
|
]
|
|
1661
1696
|
}), f ? /* @__PURE__ */ u("a", {
|
|
1662
|
-
href:
|
|
1697
|
+
href: Dt(x.lat, x.lng, C),
|
|
1663
1698
|
target: "_blank",
|
|
1664
1699
|
rel: "noopener noreferrer",
|
|
1665
1700
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1673,7 +1708,7 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1673
1708
|
}) : null]
|
|
1674
1709
|
});
|
|
1675
1710
|
}
|
|
1676
|
-
var
|
|
1711
|
+
var kt = {
|
|
1677
1712
|
check: "M4 12l5 5L20 6",
|
|
1678
1713
|
close: "M6 6l12 12M18 6L6 18",
|
|
1679
1714
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1770,8 +1805,8 @@ var wt = {
|
|
|
1770
1805
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1771
1806
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1772
1807
|
};
|
|
1773
|
-
function
|
|
1774
|
-
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [
|
|
1808
|
+
function At({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: d, inert: f }) {
|
|
1809
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [kt[e] ?? kt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
|
|
1775
1810
|
viewBox: "0 0 24 24",
|
|
1776
1811
|
width: g,
|
|
1777
1812
|
height: g,
|
|
@@ -1807,10 +1842,10 @@ function Tt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1807
1842
|
children: v
|
|
1808
1843
|
});
|
|
1809
1844
|
}
|
|
1810
|
-
function
|
|
1811
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
1845
|
+
function jt(e, t = {}, n = 0) {
|
|
1846
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Oe(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1812
1847
|
for (let e of r) {
|
|
1813
|
-
let n = e.data ?? e, r =
|
|
1848
|
+
let n = e.data ?? e, r = Ee(n, t.imageField), s = (Array.isArray(r) ? r : [r]).map((e) => e && typeof e == "object" ? e.url ?? e.src ?? "" : e).filter((e) => typeof e == "string" && e.trim()), c = t.nameField ? i(Ee(n, t.nameField)) : i(n.name), l = t.hrefField ? i(Ee(n, t.hrefField)) : "";
|
|
1814
1849
|
for (let e of s) if (o.push({
|
|
1815
1850
|
src: e,
|
|
1816
1851
|
name: c,
|
|
@@ -1820,8 +1855,8 @@ function Et(e, t = {}, n = 0) {
|
|
|
1820
1855
|
}
|
|
1821
1856
|
return o;
|
|
1822
1857
|
}
|
|
1823
|
-
function
|
|
1824
|
-
let { tenant: x, apiUrl: S } = r(
|
|
1858
|
+
function Mt({ images: e = [], source: t = "", entry: n = "", imageField: a = "", nameField: o = "", hrefField: s = "", limit: f = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
|
|
1859
|
+
let { tenant: x, apiUrl: S } = r(Z), C = r(xe)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
|
|
1825
1860
|
i(() => {
|
|
1826
1861
|
if (!t || C) return;
|
|
1827
1862
|
let e = !0;
|
|
@@ -1838,7 +1873,7 @@ function Dt({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
1838
1873
|
C
|
|
1839
1874
|
]);
|
|
1840
1875
|
let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, j = Math.max(0, Number(f) || 0), M = t ? (() => {
|
|
1841
|
-
let e =
|
|
1876
|
+
let e = jt(k, {
|
|
1842
1877
|
imageField: a,
|
|
1843
1878
|
nameField: o,
|
|
1844
1879
|
hrefField: s
|
|
@@ -2043,20 +2078,20 @@ function Dt({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
2043
2078
|
]
|
|
2044
2079
|
});
|
|
2045
2080
|
}
|
|
2046
|
-
var
|
|
2081
|
+
var Nt = {
|
|
2047
2082
|
color: "inherit",
|
|
2048
2083
|
textDecoration: "none",
|
|
2049
2084
|
fontSize: 14,
|
|
2050
2085
|
opacity: .85
|
|
2051
|
-
},
|
|
2086
|
+
}, Pt = {
|
|
2052
2087
|
background: "var(--page-surface, #f2f2f2)",
|
|
2053
2088
|
color: "var(--page-text, #111827)",
|
|
2054
2089
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
2055
2090
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
2056
2091
|
zIndex: 60
|
|
2057
2092
|
};
|
|
2058
|
-
function
|
|
2059
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" :
|
|
2093
|
+
function Ft(e, t = {}, n = "dropdown") {
|
|
2094
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" : Oe(e), o = r.map((e) => {
|
|
2060
2095
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
2061
2096
|
return {
|
|
2062
2097
|
key: e.id,
|
|
@@ -2097,8 +2132,8 @@ function At(e, t = {}, n = "dropdown") {
|
|
|
2097
2132
|
type: e.children.length ? n : "link"
|
|
2098
2133
|
}));
|
|
2099
2134
|
}
|
|
2100
|
-
function
|
|
2101
|
-
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(
|
|
2135
|
+
function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], style: f, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
|
|
2136
|
+
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(Z), P = r(xe)?.[g], [F, I] = c(null);
|
|
2102
2137
|
i(() => {
|
|
2103
2138
|
if (!g || P) return;
|
|
2104
2139
|
let e = !0;
|
|
@@ -2118,7 +2153,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2118
2153
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2119
2154
|
return e.observe(C), () => e.disconnect();
|
|
2120
2155
|
}, [C, h]);
|
|
2121
|
-
let L = g ?
|
|
2156
|
+
let L = g ? Ft(P ?? F ?? [], {
|
|
2122
2157
|
labelField: _,
|
|
2123
2158
|
hrefField: v,
|
|
2124
2159
|
imageField: y,
|
|
@@ -2147,7 +2182,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2147
2182
|
return /* @__PURE__ */ d("a", {
|
|
2148
2183
|
href: e.href || "#",
|
|
2149
2184
|
style: {
|
|
2150
|
-
...
|
|
2185
|
+
...Nt,
|
|
2151
2186
|
display: n ? "block" : "flex",
|
|
2152
2187
|
alignItems: n ? void 0 : "center",
|
|
2153
2188
|
gap: n ? void 0 : 10,
|
|
@@ -2244,7 +2279,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2244
2279
|
let t = e.children ?? [];
|
|
2245
2280
|
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
2246
2281
|
href: e.href || "#",
|
|
2247
|
-
style:
|
|
2282
|
+
style: Nt,
|
|
2248
2283
|
children: e.label
|
|
2249
2284
|
}, e.key);
|
|
2250
2285
|
let n = e.type === "mega";
|
|
@@ -2258,7 +2293,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2258
2293
|
children: [/* @__PURE__ */ d("a", {
|
|
2259
2294
|
href: e.href || "#",
|
|
2260
2295
|
style: {
|
|
2261
|
-
...
|
|
2296
|
+
...Nt,
|
|
2262
2297
|
cursor: "pointer"
|
|
2263
2298
|
},
|
|
2264
2299
|
children: [
|
|
@@ -2274,7 +2309,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2274
2309
|
]
|
|
2275
2310
|
}), k === e.key && (n ? /* @__PURE__ */ u("div", {
|
|
2276
2311
|
style: {
|
|
2277
|
-
...
|
|
2312
|
+
...Pt,
|
|
2278
2313
|
position: "absolute",
|
|
2279
2314
|
left: 0,
|
|
2280
2315
|
right: 0,
|
|
@@ -2290,7 +2325,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2290
2325
|
}, !0))
|
|
2291
2326
|
}) : /* @__PURE__ */ u("div", {
|
|
2292
2327
|
style: {
|
|
2293
|
-
...
|
|
2328
|
+
...Pt,
|
|
2294
2329
|
position: "absolute",
|
|
2295
2330
|
top: "100%",
|
|
2296
2331
|
left: 0,
|
|
@@ -2319,7 +2354,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2319
2354
|
children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
2320
2355
|
href: t.href || "#",
|
|
2321
2356
|
style: {
|
|
2322
|
-
...
|
|
2357
|
+
...Nt,
|
|
2323
2358
|
padding: "10px 4px",
|
|
2324
2359
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
2325
2360
|
opacity: 1
|
|
@@ -2330,7 +2365,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2330
2365
|
]
|
|
2331
2366
|
});
|
|
2332
2367
|
}
|
|
2333
|
-
function
|
|
2368
|
+
function Lt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2334
2369
|
let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2335
2370
|
return e.length ? /* @__PURE__ */ d("div", {
|
|
2336
2371
|
ref: r,
|
|
@@ -2370,13 +2405,13 @@ function Mt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2370
2405
|
}, e.key))]
|
|
2371
2406
|
}) : null;
|
|
2372
2407
|
}
|
|
2373
|
-
function
|
|
2408
|
+
function Rt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: l, openColor: f, borderColor: p, style: m, nodeRef: h }) {
|
|
2374
2409
|
let [g, _] = c(() => new Set(e.length ? [e[0].key] : []));
|
|
2375
2410
|
if (!e.length) return null;
|
|
2376
2411
|
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2377
2412
|
let n = Number(e);
|
|
2378
2413
|
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2379
|
-
}, b =
|
|
2414
|
+
}, b = kt[r], x = (e) => _((t) => {
|
|
2380
2415
|
let r = new Set(n ? t : []);
|
|
2381
2416
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2382
2417
|
});
|
|
@@ -2451,15 +2486,15 @@ function Nt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
|
|
|
2451
2486
|
})
|
|
2452
2487
|
});
|
|
2453
2488
|
}
|
|
2454
|
-
var
|
|
2489
|
+
var zt = {
|
|
2455
2490
|
display: "flex",
|
|
2456
2491
|
flexDirection: "column",
|
|
2457
2492
|
gap: "12px"
|
|
2458
|
-
},
|
|
2493
|
+
}, Bt = {
|
|
2459
2494
|
fontSize: "14px",
|
|
2460
2495
|
fontWeight: 500,
|
|
2461
2496
|
color: "var(--page-text, #111827)"
|
|
2462
|
-
},
|
|
2497
|
+
}, Vt = {
|
|
2463
2498
|
padding: "10px 12px",
|
|
2464
2499
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2465
2500
|
borderRadius: "6px",
|
|
@@ -2469,18 +2504,18 @@ var Pt = {
|
|
|
2469
2504
|
boxSizing: "border-box",
|
|
2470
2505
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2471
2506
|
color: "var(--page-text, #111827)"
|
|
2472
|
-
},
|
|
2507
|
+
}, Ht = {
|
|
2473
2508
|
display: "flex",
|
|
2474
2509
|
alignItems: "center",
|
|
2475
2510
|
gap: "8px",
|
|
2476
2511
|
fontSize: "14px",
|
|
2477
2512
|
color: "var(--page-text, #111827)"
|
|
2478
|
-
},
|
|
2513
|
+
}, Ut = (e) => e ? {
|
|
2479
2514
|
readOnly: !0,
|
|
2480
2515
|
tabIndex: -1,
|
|
2481
2516
|
onMouseDown: (e) => e.preventDefault()
|
|
2482
2517
|
} : {};
|
|
2483
|
-
function
|
|
2518
|
+
function Wt(e, t) {
|
|
2484
2519
|
if (!e) return !0;
|
|
2485
2520
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2486
2521
|
switch (e.op) {
|
|
@@ -2494,11 +2529,11 @@ function zt(e, t) {
|
|
|
2494
2529
|
default: return !1;
|
|
2495
2530
|
}
|
|
2496
2531
|
}
|
|
2497
|
-
var
|
|
2532
|
+
var Gt = {
|
|
2498
2533
|
display: "flex",
|
|
2499
2534
|
flexDirection: "column",
|
|
2500
2535
|
gap: 6
|
|
2501
|
-
},
|
|
2536
|
+
}, Kt = {
|
|
2502
2537
|
font: "inherit",
|
|
2503
2538
|
fontSize: 15,
|
|
2504
2539
|
padding: "10px 12px",
|
|
@@ -2509,17 +2544,17 @@ var Bt = {
|
|
|
2509
2544
|
width: "100%",
|
|
2510
2545
|
boxSizing: "border-box"
|
|
2511
2546
|
};
|
|
2512
|
-
function
|
|
2547
|
+
function qt(e, t) {
|
|
2513
2548
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2514
2549
|
if (!e?.parentField) return n;
|
|
2515
2550
|
let r = t?.[e.parentField];
|
|
2516
2551
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2517
2552
|
}
|
|
2518
|
-
var
|
|
2519
|
-
function
|
|
2553
|
+
var Jt = "g-recaptcha-response", Yt = (e) => e?.type === "recaptcha" ? Jt : e?.name;
|
|
2554
|
+
function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2520
2555
|
let a = /* @__PURE__ */ d("span", {
|
|
2521
2556
|
style: {
|
|
2522
|
-
...
|
|
2557
|
+
...Bt,
|
|
2523
2558
|
fontSize: 14
|
|
2524
2559
|
},
|
|
2525
2560
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2528,7 +2563,7 @@ function Gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2528
2563
|
required: e.required || void 0,
|
|
2529
2564
|
placeholder: e.placeholder || void 0,
|
|
2530
2565
|
disabled: r || void 0,
|
|
2531
|
-
style:
|
|
2566
|
+
style: Kt,
|
|
2532
2567
|
value: t ?? "",
|
|
2533
2568
|
onChange: (t) => n(e.name, t.target.value)
|
|
2534
2569
|
};
|
|
@@ -2557,12 +2592,12 @@ function Gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2557
2592
|
borderRadius: 8,
|
|
2558
2593
|
display: "block"
|
|
2559
2594
|
}
|
|
2560
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(
|
|
2595
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(tn, {
|
|
2561
2596
|
theme: e.captchaTheme,
|
|
2562
2597
|
size: e.captchaSize,
|
|
2563
2598
|
inert: r,
|
|
2564
|
-
onChange: (e) => n(
|
|
2565
|
-
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(
|
|
2599
|
+
onChange: (e) => n(Jt, e)
|
|
2600
|
+
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(lt, {
|
|
2566
2601
|
url: e.src,
|
|
2567
2602
|
style: { width: "100%" }
|
|
2568
2603
|
}) : /* @__PURE__ */ u("video", {
|
|
@@ -2574,14 +2609,14 @@ function Gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2574
2609
|
display: "block"
|
|
2575
2610
|
}
|
|
2576
2611
|
}) : null : /* @__PURE__ */ d("label", {
|
|
2577
|
-
style:
|
|
2612
|
+
style: Gt,
|
|
2578
2613
|
children: [
|
|
2579
2614
|
a,
|
|
2580
2615
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
|
|
2581
2616
|
...o,
|
|
2582
2617
|
rows: 4,
|
|
2583
2618
|
style: {
|
|
2584
|
-
...
|
|
2619
|
+
...Kt,
|
|
2585
2620
|
resize: "vertical"
|
|
2586
2621
|
}
|
|
2587
2622
|
}) : e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
@@ -2590,7 +2625,7 @@ function Gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2590
2625
|
children: [/* @__PURE__ */ u("option", {
|
|
2591
2626
|
value: "",
|
|
2592
2627
|
children: e.placeholder || "—"
|
|
2593
|
-
}),
|
|
2628
|
+
}), qt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
|
|
2594
2629
|
value: typeof e == "string" ? e : e.value,
|
|
2595
2630
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2596
2631
|
}, t))]
|
|
@@ -2637,8 +2672,8 @@ function Gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2637
2672
|
]
|
|
2638
2673
|
});
|
|
2639
2674
|
}
|
|
2640
|
-
function
|
|
2641
|
-
let { tenant: y, apiUrl: b } = r(
|
|
2675
|
+
function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
2676
|
+
let { tenant: y, apiUrl: b } = r(Z), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
|
|
2642
2677
|
i(() => {
|
|
2643
2678
|
if (!f || !s) return;
|
|
2644
2679
|
let e = !0;
|
|
@@ -2659,11 +2694,11 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2659
2694
|
section: e,
|
|
2660
2695
|
fields: []
|
|
2661
2696
|
}) : j[j.length - 1].fields.push(e);
|
|
2662
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
2697
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Wt(e.section.condition, T)).map((e) => ({
|
|
2663
2698
|
...e,
|
|
2664
|
-
fields: e.fields.filter((e) =>
|
|
2699
|
+
fields: e.fields.filter((e) => Wt(e.condition, T))
|
|
2665
2700
|
})), P = M.length > 1, F = Math.min(D, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
2666
|
-
let t = T[
|
|
2701
|
+
let t = T[Yt(e)];
|
|
2667
2702
|
return e.required && (t == null || t === "" || t === !1);
|
|
2668
2703
|
}), R = F >= N.length - 1, z = (e, t) => E((n) => {
|
|
2669
2704
|
let r = {
|
|
@@ -2719,11 +2754,11 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2719
2754
|
}
|
|
2720
2755
|
},
|
|
2721
2756
|
style: {
|
|
2722
|
-
...
|
|
2757
|
+
...zt,
|
|
2723
2758
|
display: k === "success" ? "none" : "flex"
|
|
2724
2759
|
},
|
|
2725
2760
|
children: f && s ? /* @__PURE__ */ d(l, { children: [
|
|
2726
|
-
P && /* @__PURE__ */ u(
|
|
2761
|
+
P && /* @__PURE__ */ u(En, {
|
|
2727
2762
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2728
2763
|
active: F + 1,
|
|
2729
2764
|
style: { marginBottom: 8 }
|
|
@@ -2736,9 +2771,9 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2736
2771
|
},
|
|
2737
2772
|
children: N[F].section.help
|
|
2738
2773
|
}),
|
|
2739
|
-
I.map((e) => /* @__PURE__ */ u(
|
|
2774
|
+
I.map((e) => /* @__PURE__ */ u(Xt, {
|
|
2740
2775
|
field: e,
|
|
2741
|
-
value: T[
|
|
2776
|
+
value: T[Yt(e)],
|
|
2742
2777
|
values: T,
|
|
2743
2778
|
onChange: z,
|
|
2744
2779
|
inert: h
|
|
@@ -2755,7 +2790,7 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2755
2790
|
disabled: h || void 0,
|
|
2756
2791
|
onClick: () => O(F - 1),
|
|
2757
2792
|
style: {
|
|
2758
|
-
...
|
|
2793
|
+
...Pe,
|
|
2759
2794
|
background: "transparent",
|
|
2760
2795
|
color: "inherit",
|
|
2761
2796
|
border: 0,
|
|
@@ -2768,7 +2803,7 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2768
2803
|
disabled: h || L.length > 0,
|
|
2769
2804
|
onClick: () => O(F + 1),
|
|
2770
2805
|
style: {
|
|
2771
|
-
...
|
|
2806
|
+
...Pe,
|
|
2772
2807
|
border: 0,
|
|
2773
2808
|
padding: "10px 22px",
|
|
2774
2809
|
borderRadius: 8,
|
|
@@ -2782,7 +2817,7 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2782
2817
|
type: "submit",
|
|
2783
2818
|
disabled: h || void 0,
|
|
2784
2819
|
style: {
|
|
2785
|
-
...
|
|
2820
|
+
...Pe,
|
|
2786
2821
|
border: 0,
|
|
2787
2822
|
padding: "10px 22px",
|
|
2788
2823
|
borderRadius: 8,
|
|
@@ -2809,10 +2844,10 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2809
2844
|
]
|
|
2810
2845
|
});
|
|
2811
2846
|
}
|
|
2812
|
-
var
|
|
2847
|
+
var Qt = null, $t = null, en = (e) => {
|
|
2813
2848
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2814
|
-
if (
|
|
2815
|
-
if (
|
|
2849
|
+
if (Qt && $t === t) return Qt;
|
|
2850
|
+
if (Qt && typeof window < "u") {
|
|
2816
2851
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2817
2852
|
delete window[e];
|
|
2818
2853
|
} catch {
|
|
@@ -2820,22 +2855,22 @@ var qt = null, Jt = null, Yt = (e) => {
|
|
|
2820
2855
|
}
|
|
2821
2856
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2822
2857
|
}
|
|
2823
|
-
return
|
|
2858
|
+
return $t = t, Qt = new Promise((e) => {
|
|
2824
2859
|
if (typeof window > "u") return;
|
|
2825
2860
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2826
2861
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2827
2862
|
let n = document.createElement("script");
|
|
2828
2863
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2829
|
-
}),
|
|
2864
|
+
}), Qt;
|
|
2830
2865
|
};
|
|
2831
|
-
function
|
|
2832
|
-
let p = r(
|
|
2866
|
+
function tn({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
|
|
2867
|
+
let p = r(Z), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
|
|
2833
2868
|
if (_.current = f, i(() => {
|
|
2834
2869
|
if (l || !h || !g.current) return;
|
|
2835
2870
|
let e = !0, r = (t) => {
|
|
2836
2871
|
e && typeof _.current == "function" && _.current(t);
|
|
2837
2872
|
};
|
|
2838
|
-
return
|
|
2873
|
+
return en(a).then((i) => {
|
|
2839
2874
|
if (!(!e || !g.current || !i?.render)) {
|
|
2840
2875
|
g.current.innerHTML = "", r("");
|
|
2841
2876
|
try {
|
|
@@ -2917,17 +2952,17 @@ function Xt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2917
2952
|
children: /* @__PURE__ */ u("div", { ref: g })
|
|
2918
2953
|
}) : null;
|
|
2919
2954
|
}
|
|
2920
|
-
function
|
|
2955
|
+
function nn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2921
2956
|
return /* @__PURE__ */ u("label", {
|
|
2922
2957
|
ref: r,
|
|
2923
2958
|
style: {
|
|
2924
|
-
...
|
|
2959
|
+
...Bt,
|
|
2925
2960
|
...A(n)
|
|
2926
2961
|
},
|
|
2927
|
-
children:
|
|
2962
|
+
children: Ge(t, e, i)
|
|
2928
2963
|
});
|
|
2929
2964
|
}
|
|
2930
|
-
function
|
|
2965
|
+
function rn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2931
2966
|
return /* @__PURE__ */ u("input", {
|
|
2932
2967
|
ref: a,
|
|
2933
2968
|
type: e,
|
|
@@ -2935,13 +2970,13 @@ function Qt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2935
2970
|
placeholder: n,
|
|
2936
2971
|
required: !o && !!r,
|
|
2937
2972
|
style: {
|
|
2938
|
-
...
|
|
2973
|
+
...Vt,
|
|
2939
2974
|
...A(i)
|
|
2940
2975
|
},
|
|
2941
|
-
...
|
|
2976
|
+
...Ut(o)
|
|
2942
2977
|
});
|
|
2943
2978
|
}
|
|
2944
|
-
function
|
|
2979
|
+
function an({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2945
2980
|
return /* @__PURE__ */ u("textarea", {
|
|
2946
2981
|
ref: a,
|
|
2947
2982
|
name: e || void 0,
|
|
@@ -2949,18 +2984,18 @@ function $t({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2949
2984
|
rows: n,
|
|
2950
2985
|
required: !o && !!r,
|
|
2951
2986
|
style: {
|
|
2952
|
-
...
|
|
2987
|
+
...Vt,
|
|
2953
2988
|
resize: "vertical",
|
|
2954
2989
|
...A(i)
|
|
2955
2990
|
},
|
|
2956
|
-
...
|
|
2991
|
+
...Ut(o)
|
|
2957
2992
|
});
|
|
2958
2993
|
}
|
|
2959
|
-
function
|
|
2994
|
+
function on({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2960
2995
|
return /* @__PURE__ */ d("label", {
|
|
2961
2996
|
ref: o,
|
|
2962
2997
|
style: {
|
|
2963
|
-
...
|
|
2998
|
+
...Ht,
|
|
2964
2999
|
...A(a)
|
|
2965
3000
|
},
|
|
2966
3001
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -2977,7 +3012,7 @@ function en({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2977
3012
|
}), t]
|
|
2978
3013
|
});
|
|
2979
3014
|
}
|
|
2980
|
-
function
|
|
3015
|
+
function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2981
3016
|
return /* @__PURE__ */ d("select", {
|
|
2982
3017
|
ref: a,
|
|
2983
3018
|
name: e || void 0,
|
|
@@ -2986,7 +3021,7 @@ function tn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2986
3021
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2987
3022
|
tabIndex: o ? -1 : void 0,
|
|
2988
3023
|
style: {
|
|
2989
|
-
...
|
|
3024
|
+
...Vt,
|
|
2990
3025
|
appearance: "auto",
|
|
2991
3026
|
...A(i)
|
|
2992
3027
|
},
|
|
@@ -3000,12 +3035,12 @@ function tn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
3000
3035
|
}, t))]
|
|
3001
3036
|
});
|
|
3002
3037
|
}
|
|
3003
|
-
function
|
|
3038
|
+
function cn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
3004
3039
|
let [s, l] = c(null);
|
|
3005
3040
|
return /* @__PURE__ */ d("label", {
|
|
3006
3041
|
ref: a,
|
|
3007
3042
|
style: {
|
|
3008
|
-
...
|
|
3043
|
+
...Vt,
|
|
3009
3044
|
display: "flex",
|
|
3010
3045
|
alignItems: "center",
|
|
3011
3046
|
gap: "8px",
|
|
@@ -3032,12 +3067,12 @@ function nn({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
3032
3067
|
]
|
|
3033
3068
|
});
|
|
3034
3069
|
}
|
|
3035
|
-
function
|
|
3070
|
+
function ln({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
3036
3071
|
return /* @__PURE__ */ u("button", {
|
|
3037
3072
|
ref: n,
|
|
3038
3073
|
type: r ? "button" : "submit",
|
|
3039
3074
|
style: {
|
|
3040
|
-
...
|
|
3075
|
+
...Pe,
|
|
3041
3076
|
border: 0,
|
|
3042
3077
|
cursor: "pointer",
|
|
3043
3078
|
alignSelf: "flex-start",
|
|
@@ -3052,7 +3087,7 @@ function rn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
3052
3087
|
children: e
|
|
3053
3088
|
});
|
|
3054
3089
|
}
|
|
3055
|
-
function
|
|
3090
|
+
function un({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
3056
3091
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
3057
3092
|
return /* @__PURE__ */ u("div", {
|
|
3058
3093
|
ref: r,
|
|
@@ -3069,8 +3104,8 @@ function an({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
3069
3104
|
}, t))
|
|
3070
3105
|
});
|
|
3071
3106
|
}
|
|
3072
|
-
function
|
|
3073
|
-
let { tenant: v, apiUrl: y, locale: b } = r(
|
|
3107
|
+
function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
|
|
3108
|
+
let { tenant: v, apiUrl: y, locale: b } = r(Z), x = r(we), S = r(xe), [, C] = c(0);
|
|
3074
3109
|
i(() => {
|
|
3075
3110
|
if (typeof window > "u") return;
|
|
3076
3111
|
let e = () => C((e) => e + 1);
|
|
@@ -3078,7 +3113,7 @@ function on({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3078
3113
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
3079
3114
|
};
|
|
3080
3115
|
}, []);
|
|
3081
|
-
let w =
|
|
3116
|
+
let w = Ce(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? Se(S) : 1, [k, j] = c(null);
|
|
3082
3117
|
if (i(() => {
|
|
3083
3118
|
if (!e || D) return;
|
|
3084
3119
|
let n = !0, r = new URLSearchParams();
|
|
@@ -3123,7 +3158,7 @@ function on({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3123
3158
|
},
|
|
3124
3159
|
children: N.map((e) => /* @__PURE__ */ u("div", {
|
|
3125
3160
|
style: { minWidth: 0 },
|
|
3126
|
-
children: x.render(p, (t) =>
|
|
3161
|
+
children: x.render(p, (t) => ke(t, e))
|
|
3127
3162
|
}, e.id ?? e?.data?.slug))
|
|
3128
3163
|
}) : /* @__PURE__ */ u("div", {
|
|
3129
3164
|
ref: _,
|
|
@@ -3133,7 +3168,7 @@ function on({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3133
3168
|
...A(g)
|
|
3134
3169
|
},
|
|
3135
3170
|
children: N.map((e) => {
|
|
3136
|
-
let t = o ?
|
|
3171
|
+
let t = o ? Ee(e?.data, o) : null, r = s ? Oe(Ee(e?.data, s)) : null, i = l ? Ee(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : Oe(i), f = n === "list";
|
|
3137
3172
|
return /* @__PURE__ */ d("div", {
|
|
3138
3173
|
style: {
|
|
3139
3174
|
display: "flex",
|
|
@@ -3180,7 +3215,7 @@ function on({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3180
3215
|
lineHeight: 1.55,
|
|
3181
3216
|
opacity: .85
|
|
3182
3217
|
},
|
|
3183
|
-
children:
|
|
3218
|
+
children: Ze(a)
|
|
3184
3219
|
})
|
|
3185
3220
|
]
|
|
3186
3221
|
})]
|
|
@@ -3188,8 +3223,8 @@ function on({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3188
3223
|
})
|
|
3189
3224
|
});
|
|
3190
3225
|
}
|
|
3191
|
-
function
|
|
3192
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3226
|
+
function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3227
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Q(), s = {
|
|
3193
3228
|
height: 34,
|
|
3194
3229
|
padding: "0 12px",
|
|
3195
3230
|
borderRadius: 8,
|
|
@@ -3237,7 +3272,7 @@ function sn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3237
3272
|
name: `f_${e.name}`,
|
|
3238
3273
|
defaultValue: o[e.name] ?? "",
|
|
3239
3274
|
style: s,
|
|
3240
|
-
...
|
|
3275
|
+
...Ut(i),
|
|
3241
3276
|
children: [/* @__PURE__ */ u("option", {
|
|
3242
3277
|
value: "",
|
|
3243
3278
|
children: e.label || e.name
|
|
@@ -3252,7 +3287,7 @@ function sn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3252
3287
|
name: `f_${e.name}`,
|
|
3253
3288
|
defaultValue: o[e.name] ?? "",
|
|
3254
3289
|
style: s,
|
|
3255
|
-
...
|
|
3290
|
+
...Ut(i),
|
|
3256
3291
|
children: [
|
|
3257
3292
|
/* @__PURE__ */ u("option", {
|
|
3258
3293
|
value: "",
|
|
@@ -3273,7 +3308,7 @@ function sn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3273
3308
|
defaultValue: o[e.name] ?? "",
|
|
3274
3309
|
placeholder: e.label || e.name,
|
|
3275
3310
|
style: s,
|
|
3276
|
-
...
|
|
3311
|
+
...Ut(i)
|
|
3277
3312
|
}, e.name)), /* @__PURE__ */ u("button", {
|
|
3278
3313
|
type: "submit",
|
|
3279
3314
|
style: {
|
|
@@ -3286,12 +3321,12 @@ function sn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3286
3321
|
fontWeight: 600,
|
|
3287
3322
|
cursor: i ? "default" : "pointer"
|
|
3288
3323
|
},
|
|
3289
|
-
...
|
|
3324
|
+
...Ut(i),
|
|
3290
3325
|
children: t
|
|
3291
3326
|
})]
|
|
3292
3327
|
});
|
|
3293
3328
|
}
|
|
3294
|
-
function
|
|
3329
|
+
function pn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3295
3330
|
return e.length ? /* @__PURE__ */ u("nav", {
|
|
3296
3331
|
ref: r,
|
|
3297
3332
|
"aria-label": "Breadcrumb",
|
|
@@ -3341,8 +3376,8 @@ function cn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3341
3376
|
})
|
|
3342
3377
|
}) : null;
|
|
3343
3378
|
}
|
|
3344
|
-
function
|
|
3345
|
-
let { tenant: g, apiUrl: _ } = r(
|
|
3379
|
+
function mn({ 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: h }) {
|
|
3380
|
+
let { tenant: g, apiUrl: _ } = r(Z), v = r(xe), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3346
3381
|
i(() => {
|
|
3347
3382
|
if (!o || Number.isFinite(x)) return;
|
|
3348
3383
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3361,7 +3396,7 @@ function ln({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3361
3396
|
]);
|
|
3362
3397
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
3363
3398
|
if (o && C === null || o && f && !(C > 0)) return null;
|
|
3364
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3399
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? Se(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
3365
3400
|
if (o) {
|
|
3366
3401
|
if (typeof window < "u") {
|
|
3367
3402
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -3426,15 +3461,15 @@ function ln({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3426
3461
|
]
|
|
3427
3462
|
});
|
|
3428
3463
|
}
|
|
3429
|
-
var
|
|
3464
|
+
var hn = "webim.page_mode", gn = () => {
|
|
3430
3465
|
if (typeof window > "u") return "auto";
|
|
3431
3466
|
try {
|
|
3432
|
-
let e = window.localStorage.getItem(
|
|
3467
|
+
let e = window.localStorage.getItem(hn);
|
|
3433
3468
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3434
3469
|
} catch {
|
|
3435
3470
|
return "auto";
|
|
3436
3471
|
}
|
|
3437
|
-
},
|
|
3472
|
+
}, _n = (e) => {
|
|
3438
3473
|
let t = {
|
|
3439
3474
|
width: 16,
|
|
3440
3475
|
height: 16,
|
|
@@ -3466,13 +3501,13 @@ var un = "webim.page_mode", dn = () => {
|
|
|
3466
3501
|
rx: "2"
|
|
3467
3502
|
}), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
|
|
3468
3503
|
});
|
|
3469
|
-
},
|
|
3504
|
+
}, vn = {
|
|
3470
3505
|
light: "Light theme",
|
|
3471
3506
|
dark: "Dark theme",
|
|
3472
3507
|
auto: "Follow the device theme"
|
|
3473
3508
|
};
|
|
3474
|
-
function
|
|
3475
|
-
let [o, l] = c(a ? "auto" :
|
|
3509
|
+
function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
3510
|
+
let [o, l] = c(a ? "auto" : gn), d = s(null), f = (e) => {
|
|
3476
3511
|
d.current = e, typeof r == "function" && r(e);
|
|
3477
3512
|
};
|
|
3478
3513
|
i(() => {
|
|
@@ -3480,7 +3515,7 @@ function mn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3480
3515
|
let e = d.current?.closest?.(".webim-page");
|
|
3481
3516
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3482
3517
|
try {
|
|
3483
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3518
|
+
o === "auto" ? window.localStorage.removeItem(hn) : window.localStorage.setItem(hn, o);
|
|
3484
3519
|
} catch {}
|
|
3485
3520
|
}, [o, a]);
|
|
3486
3521
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3515,8 +3550,8 @@ function mn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3515
3550
|
},
|
|
3516
3551
|
children: p.map((e) => /* @__PURE__ */ u("button", {
|
|
3517
3552
|
type: "button",
|
|
3518
|
-
title:
|
|
3519
|
-
"aria-label":
|
|
3553
|
+
title: vn[e],
|
|
3554
|
+
"aria-label": vn[e],
|
|
3520
3555
|
"aria-pressed": e === m,
|
|
3521
3556
|
onClick: a ? void 0 : () => l(e),
|
|
3522
3557
|
style: {
|
|
@@ -3527,15 +3562,15 @@ function mn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3527
3562
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3528
3563
|
opacity: e === m ? 1 : .7
|
|
3529
3564
|
},
|
|
3530
|
-
children:
|
|
3565
|
+
children: _n(e)
|
|
3531
3566
|
}, e))
|
|
3532
3567
|
});
|
|
3533
3568
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3534
3569
|
return /* @__PURE__ */ u("button", {
|
|
3535
3570
|
ref: f,
|
|
3536
3571
|
type: "button",
|
|
3537
|
-
title:
|
|
3538
|
-
"aria-label": `Theme: ${
|
|
3572
|
+
title: vn[m],
|
|
3573
|
+
"aria-label": `Theme: ${vn[m]} — switch to ${vn[g]}`,
|
|
3539
3574
|
onClick: a ? void 0 : () => l(g),
|
|
3540
3575
|
style: {
|
|
3541
3576
|
...h,
|
|
@@ -3544,10 +3579,10 @@ function mn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3544
3579
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3545
3580
|
...A(n)
|
|
3546
3581
|
},
|
|
3547
|
-
children:
|
|
3582
|
+
children: _n(m)
|
|
3548
3583
|
});
|
|
3549
3584
|
}
|
|
3550
|
-
function
|
|
3585
|
+
function bn(e) {
|
|
3551
3586
|
let t = e?.parentElement;
|
|
3552
3587
|
for (; t && t !== document.body;) {
|
|
3553
3588
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3556,7 +3591,7 @@ function hn(e) {
|
|
|
3556
3591
|
}
|
|
3557
3592
|
return window;
|
|
3558
3593
|
}
|
|
3559
|
-
var
|
|
3594
|
+
var xn = (e) => e === window ? window.scrollY : e.scrollTop, Sn = {
|
|
3560
3595
|
"bottom-right": (e) => ({
|
|
3561
3596
|
right: e,
|
|
3562
3597
|
bottom: e
|
|
@@ -3571,7 +3606,7 @@ var gn = (e) => e === window ? window.scrollY : e.scrollTop, _n = {
|
|
|
3571
3606
|
transform: "translateX(-50%)"
|
|
3572
3607
|
})
|
|
3573
3608
|
};
|
|
3574
|
-
function
|
|
3609
|
+
function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
|
|
3575
3610
|
let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
|
|
3576
3611
|
b(e), typeof p == "function" && p(e);
|
|
3577
3612
|
};
|
|
@@ -3582,8 +3617,8 @@ function vn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3582
3617
|
}
|
|
3583
3618
|
if (!y) return;
|
|
3584
3619
|
let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
|
|
3585
|
-
let t =
|
|
3586
|
-
v(n ||
|
|
3620
|
+
let t = bn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
3621
|
+
v(n || xn(t) > e);
|
|
3587
3622
|
};
|
|
3588
3623
|
return t(), document.addEventListener("scroll", t, {
|
|
3589
3624
|
capture: !0,
|
|
@@ -3597,7 +3632,7 @@ function vn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3597
3632
|
]);
|
|
3598
3633
|
let S = () => {
|
|
3599
3634
|
if (m) return;
|
|
3600
|
-
let e =
|
|
3635
|
+
let e = bn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3601
3636
|
e === window ? window.scrollTo({
|
|
3602
3637
|
top: 0,
|
|
3603
3638
|
behavior: n
|
|
@@ -3605,7 +3640,7 @@ function vn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3605
3640
|
top: 0,
|
|
3606
3641
|
behavior: n
|
|
3607
3642
|
});
|
|
3608
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
3643
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = Sn[n] ? n : "bottom-right", D = h ? {
|
|
3609
3644
|
position: "fixed",
|
|
3610
3645
|
zIndex: 5,
|
|
3611
3646
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3618,7 +3653,7 @@ function vn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3618
3653
|
} : {
|
|
3619
3654
|
position: "fixed",
|
|
3620
3655
|
zIndex: 2147482e3,
|
|
3621
|
-
...
|
|
3656
|
+
...Sn[E](C)
|
|
3622
3657
|
};
|
|
3623
3658
|
return /* @__PURE__ */ d("button", {
|
|
3624
3659
|
ref: x,
|
|
@@ -3669,7 +3704,7 @@ function vn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3669
3704
|
}), w ? /* @__PURE__ */ u("span", { children: T }) : null]
|
|
3670
3705
|
});
|
|
3671
3706
|
}
|
|
3672
|
-
var
|
|
3707
|
+
var wn = {
|
|
3673
3708
|
facebook: {
|
|
3674
3709
|
label: "Facebook",
|
|
3675
3710
|
color: "#1877f2",
|
|
@@ -3736,8 +3771,8 @@ var yn = {
|
|
|
3736
3771
|
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"
|
|
3737
3772
|
}
|
|
3738
3773
|
};
|
|
3739
|
-
function
|
|
3740
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
3774
|
+
function Tn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
3775
|
+
let l = Array.isArray(e) ? e.filter((e) => e && wn[e.network]) : [];
|
|
3741
3776
|
if (!l.length) return null;
|
|
3742
3777
|
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, h = c ? (e) => e.preventDefault() : void 0;
|
|
3743
3778
|
return /* @__PURE__ */ u("div", {
|
|
@@ -3750,7 +3785,7 @@ function bn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3750
3785
|
...A(o)
|
|
3751
3786
|
},
|
|
3752
3787
|
children: l.map((e, r) => {
|
|
3753
|
-
let i =
|
|
3788
|
+
let i = wn[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);
|
|
3754
3789
|
return /* @__PURE__ */ u("a", {
|
|
3755
3790
|
href: e.url || "#",
|
|
3756
3791
|
onClick: h,
|
|
@@ -3784,7 +3819,7 @@ function bn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3784
3819
|
})
|
|
3785
3820
|
});
|
|
3786
3821
|
}
|
|
3787
|
-
function
|
|
3822
|
+
function En({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3788
3823
|
if (!t.length) return null;
|
|
3789
3824
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
3790
3825
|
width: 32,
|
|
@@ -3862,7 +3897,7 @@ function xn({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3862
3897
|
})
|
|
3863
3898
|
});
|
|
3864
3899
|
}
|
|
3865
|
-
var
|
|
3900
|
+
var Dn = {
|
|
3866
3901
|
small: {
|
|
3867
3902
|
w: 132,
|
|
3868
3903
|
h: 46,
|
|
@@ -3884,21 +3919,21 @@ var Sn = {
|
|
|
3884
3919
|
title: 12.5,
|
|
3885
3920
|
avatar: 46
|
|
3886
3921
|
}
|
|
3887
|
-
},
|
|
3888
|
-
|
|
3889
|
-
var
|
|
3922
|
+
}, On = (e) => Dn[e] ?? Dn.medium;
|
|
3923
|
+
Dn.medium.w, Dn.medium.h;
|
|
3924
|
+
var kn = (e) => String(e?.group ?? "").trim(), An = (e) => {
|
|
3890
3925
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
3891
3926
|
return e.forEach((e, r) => {
|
|
3892
|
-
let i =
|
|
3927
|
+
let i = kn(e) || `#${r}`;
|
|
3893
3928
|
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
3894
3929
|
}), t.flatMap((e) => n.get(e));
|
|
3895
3930
|
};
|
|
3896
|
-
function
|
|
3897
|
-
let i =
|
|
3931
|
+
function jn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
3932
|
+
let i = On(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
|
|
3898
3933
|
for (let e of c) e.parent && l.has(e.parent) && e.parent !== e.id ? (u.has(e.parent) || u.set(e.parent, []), u.get(e.parent).push(e)) : d.push(e);
|
|
3899
|
-
d =
|
|
3900
|
-
for (let [e, t] of u) u.set(e,
|
|
3901
|
-
let f = (e, t) => o + (
|
|
3934
|
+
d = An(d);
|
|
3935
|
+
for (let [e, t] of u) u.set(e, An(t));
|
|
3936
|
+
let f = (e, t) => o + (kn(e) !== kn(t) && (kn(e) || kn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
3902
3937
|
if (t.has(e.id)) return 0;
|
|
3903
3938
|
t.add(e.id);
|
|
3904
3939
|
let n = u.get(e.id) ?? [], r = n.reduce((e, r, i) => e + m(r, t) + (i ? f(n[i - 1], r) : 0), 0), i = Math.max(a, r);
|
|
@@ -3914,7 +3949,7 @@ function En(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
3914
3949
|
x: m,
|
|
3915
3950
|
y: b
|
|
3916
3951
|
});
|
|
3917
|
-
let x =
|
|
3952
|
+
let x = kn(e);
|
|
3918
3953
|
if (x) {
|
|
3919
3954
|
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
3920
3955
|
_.has(t) || _.set(t, {
|
|
@@ -3988,19 +4023,19 @@ function En(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
3988
4023
|
horizontal: n
|
|
3989
4024
|
};
|
|
3990
4025
|
}
|
|
3991
|
-
var
|
|
4026
|
+
var Mn = (e, t) => {
|
|
3992
4027
|
let n = String(e ?? "");
|
|
3993
4028
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3994
|
-
},
|
|
4029
|
+
}, Nn = (e) => {
|
|
3995
4030
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3996
4031
|
if (!t) return "#ffffff";
|
|
3997
4032
|
let n = t[1];
|
|
3998
4033
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3999
4034
|
let r = parseInt(n, 16);
|
|
4000
4035
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
4001
|
-
},
|
|
4002
|
-
function
|
|
4003
|
-
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 ? "" :
|
|
4036
|
+
}, Pn = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
4037
|
+
function Fn(e, t = {}) {
|
|
4038
|
+
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 ? "" : Oe(e);
|
|
4004
4039
|
return n.map((e) => {
|
|
4005
4040
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
4006
4041
|
return {
|
|
@@ -4015,11 +4050,11 @@ function An(e, t = {}) {
|
|
|
4015
4050
|
};
|
|
4016
4051
|
});
|
|
4017
4052
|
}
|
|
4018
|
-
var
|
|
4053
|
+
var In = {
|
|
4019
4054
|
size: 36,
|
|
4020
4055
|
pad: 10
|
|
4021
4056
|
};
|
|
4022
|
-
function
|
|
4057
|
+
function Ln({ node: e, onClose: t }) {
|
|
4023
4058
|
return i(() => {
|
|
4024
4059
|
let e = (e) => e.key === "Escape" && t();
|
|
4025
4060
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -4140,8 +4175,8 @@ function Mn({ node: e, onClose: t }) {
|
|
|
4140
4175
|
})
|
|
4141
4176
|
});
|
|
4142
4177
|
}
|
|
4143
|
-
function
|
|
4144
|
-
let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(
|
|
4178
|
+
function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
|
|
4179
|
+
let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(Z), O = r(xe)?.[t], [k, j] = c(null);
|
|
4145
4180
|
i(() => {
|
|
4146
4181
|
if (!t || O) return;
|
|
4147
4182
|
let e = !0;
|
|
@@ -4157,7 +4192,7 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4157
4192
|
D,
|
|
4158
4193
|
O
|
|
4159
4194
|
]);
|
|
4160
|
-
let M = t ?
|
|
4195
|
+
let M = t ? Fn(O ?? k ?? [], {
|
|
4161
4196
|
nameField: n,
|
|
4162
4197
|
titleField: o,
|
|
4163
4198
|
photoField: s,
|
|
@@ -4165,7 +4200,7 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4165
4200
|
cvField: p,
|
|
4166
4201
|
hrefField: m,
|
|
4167
4202
|
groupField: h
|
|
4168
|
-
}) : e, N =
|
|
4203
|
+
}) : e, N = On(v), { boxes: P, links: F, groups: I, width: L, height: R } = jn(M, {
|
|
4169
4204
|
size: v,
|
|
4170
4205
|
horizontal: y,
|
|
4171
4206
|
groupTitles: g
|
|
@@ -4223,8 +4258,8 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4223
4258
|
fontSize: N.title + 1,
|
|
4224
4259
|
fontWeight: "600",
|
|
4225
4260
|
opacity: "0.55",
|
|
4226
|
-
fill: r ?
|
|
4227
|
-
children:
|
|
4261
|
+
fill: r ? Nn(e.color || _) : "var(--page-text, #111827)",
|
|
4262
|
+
children: Mn(e.title, Math.floor(e.width / 7))
|
|
4228
4263
|
})] }, `group-${t}`);
|
|
4229
4264
|
}),
|
|
4230
4265
|
F.map((e, t) => /* @__PURE__ */ u("path", {
|
|
@@ -4234,7 +4269,7 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4234
4269
|
strokeWidth: "1.5"
|
|
4235
4270
|
}, t)),
|
|
4236
4271
|
P.map(({ node: e, x: t, y: n }) => {
|
|
4237
|
-
let r = z.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 ?
|
|
4272
|
+
let r = z.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 ? Nn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Nn(e.color2) : s, f = S && (Pn(e) || e.href), p = () => Pn(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + In.pad + N.avatar + 8 : t + N.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((N.w - N.avatar - 26) / 7) : Math.floor(N.w / 7.6), _ = N.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
4238
4273
|
return /* @__PURE__ */ d("g", {
|
|
4239
4274
|
onClick: f ? p : void 0,
|
|
4240
4275
|
style: f ? { cursor: "pointer" } : void 0,
|
|
@@ -4298,13 +4333,13 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4298
4333
|
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
4299
4334
|
id: `${C}-${e.id}`,
|
|
4300
4335
|
children: /* @__PURE__ */ u("circle", {
|
|
4301
|
-
cx: t +
|
|
4336
|
+
cx: t + In.pad + N.avatar / 2,
|
|
4302
4337
|
cy: n + N.h / 2,
|
|
4303
4338
|
r: N.avatar / 2
|
|
4304
4339
|
})
|
|
4305
4340
|
}), /* @__PURE__ */ u("image", {
|
|
4306
4341
|
href: e.photo,
|
|
4307
|
-
x: t +
|
|
4342
|
+
x: t + In.pad,
|
|
4308
4343
|
y: n + (N.h - N.avatar) / 2,
|
|
4309
4344
|
width: N.avatar,
|
|
4310
4345
|
height: N.avatar,
|
|
@@ -4318,7 +4353,7 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4318
4353
|
fontSize: N.title,
|
|
4319
4354
|
fontWeight: "600",
|
|
4320
4355
|
fill: s,
|
|
4321
|
-
children:
|
|
4356
|
+
children: Mn(e.title, g + 4)
|
|
4322
4357
|
}), e.name && /* @__PURE__ */ u("text", {
|
|
4323
4358
|
x: m,
|
|
4324
4359
|
y: n + _ + _ / 2 + N.name * .35,
|
|
@@ -4326,7 +4361,7 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4326
4361
|
fontSize: N.name,
|
|
4327
4362
|
fontWeight: "600",
|
|
4328
4363
|
fill: c,
|
|
4329
|
-
children:
|
|
4364
|
+
children: Mn(e.name, g)
|
|
4330
4365
|
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
4331
4366
|
x: m,
|
|
4332
4367
|
y: n + (v[1] ? N.h * .43 : N.h * .57),
|
|
@@ -4334,7 +4369,7 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4334
4369
|
fontSize: N.name,
|
|
4335
4370
|
fontWeight: "600",
|
|
4336
4371
|
fill: s,
|
|
4337
|
-
children:
|
|
4372
|
+
children: Mn(v[0], g)
|
|
4338
4373
|
}), v[1] && /* @__PURE__ */ u("text", {
|
|
4339
4374
|
x: m,
|
|
4340
4375
|
y: n + N.h * .73,
|
|
@@ -4342,19 +4377,19 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4342
4377
|
fontSize: N.title,
|
|
4343
4378
|
opacity: "0.7",
|
|
4344
4379
|
fill: s,
|
|
4345
|
-
children:
|
|
4380
|
+
children: Mn(v[1], g + 4)
|
|
4346
4381
|
})] })
|
|
4347
4382
|
]
|
|
4348
4383
|
}, e.id);
|
|
4349
4384
|
})
|
|
4350
4385
|
]
|
|
4351
|
-
}), w && /* @__PURE__ */ u(
|
|
4386
|
+
}), w && /* @__PURE__ */ u(Ln, {
|
|
4352
4387
|
node: w,
|
|
4353
4388
|
onClose: () => T(null)
|
|
4354
4389
|
})]
|
|
4355
4390
|
});
|
|
4356
4391
|
}
|
|
4357
|
-
function
|
|
4392
|
+
function zn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4358
4393
|
let [a, o] = c(!1), l = s(null);
|
|
4359
4394
|
return i(() => {
|
|
4360
4395
|
if (!a || !l.current) return;
|
|
@@ -4384,7 +4419,7 @@ function Pn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4384
4419
|
children: e ?? ""
|
|
4385
4420
|
});
|
|
4386
4421
|
}
|
|
4387
|
-
var
|
|
4422
|
+
var Bn = 360, Vn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", Hn = (e, t) => e && t ? `cell-${e}-${t}` : "", Un = (e) => {
|
|
4388
4423
|
if (!e || typeof e != "object") return e ?? "";
|
|
4389
4424
|
let t = String(e.text ?? "");
|
|
4390
4425
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ u("a", {
|
|
@@ -4395,7 +4430,7 @@ var Fn = 360, In = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4395
4430
|
children: t
|
|
4396
4431
|
}) : t;
|
|
4397
4432
|
};
|
|
4398
|
-
function
|
|
4433
|
+
function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], colKeys: o = [], heights: f = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: j, style: M, nodeRef: N, edit: P }) {
|
|
4399
4434
|
let F = s(null), I = s(null), [L, R] = c(null), [z, B] = c(null), V = (e, t) => () => R({
|
|
4400
4435
|
r: e,
|
|
4401
4436
|
c: t
|
|
@@ -4409,7 +4444,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4409
4444
|
}
|
|
4410
4445
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4411
4446
|
top: r.bottom - n.top + 4,
|
|
4412
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
4447
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - Bn))
|
|
4413
4448
|
};
|
|
4414
4449
|
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4415
4450
|
}), i(() => {
|
|
@@ -4419,14 +4454,14 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4419
4454
|
};
|
|
4420
4455
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4421
4456
|
}, [P, L]);
|
|
4422
|
-
let { tenant: H, apiUrl: U } = r(
|
|
4457
|
+
let { tenant: H, apiUrl: U } = r(Z), ee = r(xe), W = ee?.[h], te = C ? Se(ee) : 1, [ne, re] = c(null);
|
|
4423
4458
|
if (i(() => {
|
|
4424
4459
|
if (!h || W) return;
|
|
4425
4460
|
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(te - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4426
4461
|
return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
|
|
4427
4462
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4428
|
-
return e &&
|
|
4429
|
-
}).catch(() => e &&
|
|
4463
|
+
return e && re(n);
|
|
4464
|
+
}).catch(() => e && re([])), () => {
|
|
4430
4465
|
e = !1;
|
|
4431
4466
|
};
|
|
4432
4467
|
}, [
|
|
@@ -4438,13 +4473,13 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4438
4473
|
te,
|
|
4439
4474
|
g
|
|
4440
4475
|
]), !e.length) return null;
|
|
4441
|
-
let
|
|
4476
|
+
let G = Math.max(1, Number(g) || 10), K = h ? C ? W || h.startsWith("api:") ? (W ?? ne ?? []).slice((te - 1) * G, te * G) : (ne ?? []).slice(0, G) : (W ?? ne ?? []).slice(0, G) : null, q = K ? K.map((t) => e.map((e) => Oe(Ee(t?.data, e.field)))) : t, ie = !!h && !(h && !W && ne === null) && q.length === 0, J = b ? {
|
|
4442
4477
|
y: 6,
|
|
4443
4478
|
x: 10
|
|
4444
4479
|
} : {
|
|
4445
4480
|
y: 10,
|
|
4446
4481
|
x: 14
|
|
4447
|
-
},
|
|
4482
|
+
}, ae = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : J.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : J.x}px`, oe = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, se = y ? { border: oe } : { borderBottom: oe }, ce = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), le = [
|
|
4448
4483
|
"left",
|
|
4449
4484
|
"center",
|
|
4450
4485
|
"right"
|
|
@@ -4464,13 +4499,13 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4464
4499
|
};
|
|
4465
4500
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4466
4501
|
}, ye = /* @__PURE__ */ new Set();
|
|
4467
|
-
p &&
|
|
4468
|
-
let r = p[
|
|
4502
|
+
p && q.forEach((t, n) => e.forEach((e, t) => {
|
|
4503
|
+
let r = p[Hn(a[n], o[t])];
|
|
4469
4504
|
if (!r) return;
|
|
4470
4505
|
let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
|
|
4471
4506
|
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && ye.add(`${n + e},${t + r}`);
|
|
4472
4507
|
}));
|
|
4473
|
-
let
|
|
4508
|
+
let be = (e) => (t) => {
|
|
4474
4509
|
if (!P?.resizeRow) return;
|
|
4475
4510
|
t.preventDefault(), t.stopPropagation();
|
|
4476
4511
|
let n = t.currentTarget.closest("tr");
|
|
@@ -4479,7 +4514,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4479
4514
|
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4480
4515
|
};
|
|
4481
4516
|
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4482
|
-
},
|
|
4517
|
+
}, Y = (e, t, n, r) => r ? null : /* @__PURE__ */ u("span", {
|
|
4483
4518
|
className: "wb-tedit-btn",
|
|
4484
4519
|
role: "button",
|
|
4485
4520
|
"data-hint": t,
|
|
@@ -4488,7 +4523,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4488
4523
|
},
|
|
4489
4524
|
onClick: n,
|
|
4490
4525
|
children: e
|
|
4491
|
-
}, t),
|
|
4526
|
+
}, t), X = L && L.r < q.length && L.c < e.length ? L : null, Q = (e, t) => P?.labels?.[e] ?? t, Ce = X ? p?.[Hn(a[X.r], o[X.c])] : null, we = Math.max(1, Number(Ce?.c) || 1), Te = Math.max(1, Number(Ce?.r) || 1);
|
|
4492
4527
|
return /* @__PURE__ */ d("div", {
|
|
4493
4528
|
ref: (e) => {
|
|
4494
4529
|
I.current = e, typeof N == "function" && N(e);
|
|
@@ -4499,8 +4534,8 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4499
4534
|
...ge
|
|
4500
4535
|
},
|
|
4501
4536
|
children: [
|
|
4502
|
-
P && /* @__PURE__ */ u("style", { children:
|
|
4503
|
-
P &&
|
|
4537
|
+
P && /* @__PURE__ */ u("style", { children: Vn }),
|
|
4538
|
+
P && X && z && /* @__PURE__ */ d("div", {
|
|
4504
4539
|
className: "wb-tedit-bar",
|
|
4505
4540
|
style: {
|
|
4506
4541
|
top: z.top,
|
|
@@ -4510,23 +4545,23 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4510
4545
|
children: [
|
|
4511
4546
|
/* @__PURE__ */ u("span", {
|
|
4512
4547
|
className: "wb-tedit-at",
|
|
4513
|
-
children: `R${
|
|
4548
|
+
children: `R${X.r + 1}·C${X.c + 1}`
|
|
4514
4549
|
}),
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4550
|
+
Y("+↑", Q("rowAbove", "Insert row above"), () => P.addRow(X.r - 1)),
|
|
4551
|
+
Y("+↓", Q("rowBelow", "Insert row below"), () => P.addRow(X.r)),
|
|
4552
|
+
Y("↑", Q("rowUp", "Move row up"), () => P.moveRow(X.r, -1), X.r === 0),
|
|
4553
|
+
Y("↓", Q("rowDown", "Move row down"), () => P.moveRow(X.r, 1), X.r >= q.length - 1),
|
|
4554
|
+
Y("✕ row", Q("rowDelete", "Delete row"), () => P.dropRow(X.r), q.length <= 1),
|
|
4520
4555
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4556
|
+
Y("+←", Q("colLeft", "Insert column left"), () => P.addColumn(X.c - 1)),
|
|
4557
|
+
Y("+→", Q("colRight", "Insert column right"), () => P.addColumn(X.c)),
|
|
4558
|
+
Y("←", Q("colMoveLeft", "Move column left"), () => P.moveColumn(X.c, -1), X.c === 0),
|
|
4559
|
+
Y("→", Q("colMoveRight", "Move column right"), () => P.moveColumn(X.c, 1), X.c >= e.length - 1),
|
|
4560
|
+
Y("✕ col", Q("colDelete", "Delete column"), () => P.dropColumn(X.c), e.length <= 1),
|
|
4526
4561
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4562
|
+
Y("↔", Q("mergeRight", "Merge with the cell on the right"), () => P.merge(X.r, X.c, "right"), X.c + we >= e.length),
|
|
4563
|
+
Y("↕", Q("mergeDown", "Merge with the cell below"), () => P.merge(X.r, X.c, "down"), X.r + Te >= q.length),
|
|
4564
|
+
Y("⤫", Q("split", "Split this cell"), () => P.split(X.r, X.c), we === 1 && Te === 1)
|
|
4530
4565
|
]
|
|
4531
4566
|
}),
|
|
4532
4567
|
/* @__PURE__ */ u("div", {
|
|
@@ -4555,7 +4590,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4555
4590
|
style: {
|
|
4556
4591
|
textAlign: de(n),
|
|
4557
4592
|
fontWeight: 600,
|
|
4558
|
-
padding:
|
|
4593
|
+
padding: ae,
|
|
4559
4594
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4560
4595
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4561
4596
|
...T ? {
|
|
@@ -4565,7 +4600,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4565
4600
|
} : P ? { position: "relative" } : null,
|
|
4566
4601
|
...se
|
|
4567
4602
|
},
|
|
4568
|
-
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
4603
|
+
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(zn, {
|
|
4569
4604
|
value: t.label ?? t,
|
|
4570
4605
|
onCommit: (e) => P.header(n, e),
|
|
4571
4606
|
hint: Q("editCell", "Double-click to edit"),
|
|
@@ -4579,13 +4614,13 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4579
4614
|
/* @__PURE__ */ d("tbody", { children: [ie && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
4580
4615
|
colSpan: e.length,
|
|
4581
4616
|
style: {
|
|
4582
|
-
padding:
|
|
4617
|
+
padding: ae,
|
|
4583
4618
|
textAlign: "center",
|
|
4584
4619
|
opacity: .6,
|
|
4585
4620
|
...se
|
|
4586
4621
|
},
|
|
4587
4622
|
children: w || "No data yet"
|
|
4588
|
-
}) }),
|
|
4623
|
+
}) }), q.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
4589
4624
|
className: P ? "wb-tedit-row" : void 0,
|
|
4590
4625
|
style: {
|
|
4591
4626
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
@@ -4593,7 +4628,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4593
4628
|
},
|
|
4594
4629
|
children: e.map((e, r) => {
|
|
4595
4630
|
if (ye.has(`${n},${r}`)) return null;
|
|
4596
|
-
let i =
|
|
4631
|
+
let i = Hn(a[n], o[r]), s = m?.[i], c = p?.[i], l = Math.max(1, Number(c?.c) || 1), f = Math.max(1, Number(c?.r) || 1);
|
|
4597
4632
|
return /* @__PURE__ */ d("td", {
|
|
4598
4633
|
className: P ? `wb-tedit-cell${L?.r === n && L?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4599
4634
|
onMouseDownCapture: _e ? V(n, r) : void 0,
|
|
@@ -4601,15 +4636,15 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4601
4636
|
colSpan: l > 1 ? l : void 0,
|
|
4602
4637
|
rowSpan: f > 1 ? f : void 0,
|
|
4603
4638
|
style: {
|
|
4604
|
-
padding:
|
|
4639
|
+
padding: ae,
|
|
4605
4640
|
...ue(r) ? { textAlign: ue(r) } : null,
|
|
4606
4641
|
...P ? { position: "relative" } : null,
|
|
4607
4642
|
...se
|
|
4608
4643
|
},
|
|
4609
|
-
children: [s ??
|
|
4644
|
+
children: [s ?? Un(t?.[r]), P && _e && /* @__PURE__ */ u("span", {
|
|
4610
4645
|
className: "wb-tedit-rowgrip",
|
|
4611
4646
|
title: Q("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4612
|
-
onPointerDown:
|
|
4647
|
+
onPointerDown: be(n),
|
|
4613
4648
|
onDoubleClick: () => P.resizeRow(n, 0)
|
|
4614
4649
|
})]
|
|
4615
4650
|
}, r);
|
|
@@ -4621,7 +4656,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4621
4656
|
]
|
|
4622
4657
|
});
|
|
4623
4658
|
}
|
|
4624
|
-
var
|
|
4659
|
+
var Gn = {
|
|
4625
4660
|
small: {
|
|
4626
4661
|
cell: 62,
|
|
4627
4662
|
font: 10.5,
|
|
@@ -4646,9 +4681,9 @@ var Bn = {
|
|
|
4646
4681
|
pad: 8,
|
|
4647
4682
|
gap: 4
|
|
4648
4683
|
}
|
|
4649
|
-
},
|
|
4650
|
-
function
|
|
4651
|
-
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 ? "" :
|
|
4684
|
+
}, Kn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, qn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Jn = 366;
|
|
4685
|
+
function Yn(e, t = {}) {
|
|
4686
|
+
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 ? "" : Oe(e), a = (e) => {
|
|
4652
4687
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4653
4688
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4654
4689
|
};
|
|
@@ -4664,7 +4699,7 @@ function Wn(e, t = {}) {
|
|
|
4664
4699
|
} : null;
|
|
4665
4700
|
}).filter(Boolean);
|
|
4666
4701
|
}
|
|
4667
|
-
function
|
|
4702
|
+
function Xn(e) {
|
|
4668
4703
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4669
4704
|
let n = e?.start ? new Date(e.start) : null;
|
|
4670
4705
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4679,20 +4714,20 @@ function Gn(e) {
|
|
|
4679
4714
|
};
|
|
4680
4715
|
}).filter(Boolean);
|
|
4681
4716
|
}
|
|
4682
|
-
function
|
|
4717
|
+
function Zn(e) {
|
|
4683
4718
|
let t = /* @__PURE__ */ new Map();
|
|
4684
4719
|
for (let n of e) {
|
|
4685
|
-
let e =
|
|
4720
|
+
let e = qn(n.start), r = n.end ? qn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Jn);
|
|
4686
4721
|
for (let r = 0; r <= i; r += 1) {
|
|
4687
|
-
let i =
|
|
4722
|
+
let i = Kn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4688
4723
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4689
4724
|
}
|
|
4690
4725
|
}
|
|
4691
4726
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4692
4727
|
return t;
|
|
4693
4728
|
}
|
|
4694
|
-
function
|
|
4695
|
-
let { tenant: T, apiUrl: E, locale: D } = r(
|
|
4729
|
+
function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a = "", endField: o = "", hrefField: s = "", colorField: f = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
|
|
4730
|
+
let { tenant: T, apiUrl: E, locale: D } = r(Z), O = r(xe)?.[t], [k, j] = c(null), [M, N] = c(() => {
|
|
4696
4731
|
let e = /* @__PURE__ */ new Date();
|
|
4697
4732
|
return {
|
|
4698
4733
|
year: e.getFullYear(),
|
|
@@ -4714,13 +4749,13 @@ function qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4714
4749
|
E,
|
|
4715
4750
|
O
|
|
4716
4751
|
]);
|
|
4717
|
-
let P =
|
|
4752
|
+
let P = Gn[m] ?? Gn.medium, F = h || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = g || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? Yn(O ?? k ?? [], {
|
|
4718
4753
|
titleField: n,
|
|
4719
4754
|
startField: a,
|
|
4720
4755
|
endField: o,
|
|
4721
4756
|
hrefField: s,
|
|
4722
4757
|
colorField: f
|
|
4723
|
-
}) :
|
|
4758
|
+
}) : Xn(e), B = Zn(z), V = D || void 0, H = (e, t) => {
|
|
4724
4759
|
let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
|
|
4725
4760
|
width: 6,
|
|
4726
4761
|
height: 6,
|
|
@@ -4852,10 +4887,10 @@ function qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4852
4887
|
})]
|
|
4853
4888
|
});
|
|
4854
4889
|
}
|
|
4855
|
-
let ne = new Date(M.year, M.month, 1),
|
|
4856
|
-
for (let e = 0; e <
|
|
4857
|
-
let t = e -
|
|
4858
|
-
|
|
4890
|
+
let ne = new Date(M.year, M.month, 1), re = y === "sunday" ? 0 : 1, G = (ne.getDay() - re + 7) % 7, K = new Date(M.year, M.month + 1, 0).getDate(), q = Math.ceil((G + K) / 7), ie = Kn(/* @__PURE__ */ new Date()), J = new Intl.DateTimeFormat(V, { weekday: "short" }), ae = [];
|
|
4891
|
+
for (let e = 0; e < q * 7; e += 1) {
|
|
4892
|
+
let t = e - G + 1, n = t >= 1 && t <= K, r = Kn(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
|
|
4893
|
+
ae.push(/* @__PURE__ */ d("div", {
|
|
4859
4894
|
style: {
|
|
4860
4895
|
minHeight: P.cell,
|
|
4861
4896
|
borderTop: `1px solid ${I}`,
|
|
@@ -4912,31 +4947,31 @@ function qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4912
4947
|
textAlign: "center",
|
|
4913
4948
|
padding: `0 0 ${P.pad}px`
|
|
4914
4949
|
},
|
|
4915
|
-
children:
|
|
4916
|
-
}, `head-${t}`)),
|
|
4950
|
+
children: J.format(new Date(2024, 0, 7 + re + t))
|
|
4951
|
+
}, `head-${t}`)), ae]
|
|
4917
4952
|
}),
|
|
4918
4953
|
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4919
4954
|
]
|
|
4920
4955
|
});
|
|
4921
4956
|
}
|
|
4922
|
-
var
|
|
4957
|
+
var $n = {
|
|
4923
4958
|
small: 36,
|
|
4924
4959
|
medium: 56,
|
|
4925
4960
|
large: 88
|
|
4926
4961
|
};
|
|
4927
|
-
function
|
|
4928
|
-
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" :
|
|
4962
|
+
function er(e, t = {}) {
|
|
4963
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : Oe(e);
|
|
4929
4964
|
return n.map((e) => {
|
|
4930
|
-
let n = e.data ?? e, i =
|
|
4965
|
+
let n = e.data ?? e, i = Ee(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(Ee(n, t.nameField)) : r(n.name);
|
|
4931
4966
|
return {
|
|
4932
4967
|
src: typeof o == "string" ? o.trim() : "",
|
|
4933
4968
|
alt: s,
|
|
4934
|
-
href: t.hrefField ? r(
|
|
4969
|
+
href: t.hrefField ? r(Ee(n, t.hrefField)) : ""
|
|
4935
4970
|
};
|
|
4936
4971
|
}).filter((e) => e.src);
|
|
4937
4972
|
}
|
|
4938
|
-
function
|
|
4939
|
-
let { tenant: D, apiUrl: O } = r(
|
|
4973
|
+
function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a = "", hrefField: o = "", variant: f = "step", size: p = "medium", perView: m = 5, gap: h = 48, hold: g = 3, slideMs: _ = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
|
|
4974
|
+
let { tenant: D, apiUrl: O } = r(Z), k = r(xe)?.[t], [j, M] = c(null), N = s(null), P = s(null), [F, I] = c(0), [L, R] = c(0), [z, B] = c(0), [V, H] = c(!0), [U, ee] = c(!1), [W, te] = c(!1);
|
|
4940
4975
|
i(() => {
|
|
4941
4976
|
if (!t || k) return;
|
|
4942
4977
|
let e = !0;
|
|
@@ -4966,7 +5001,7 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
4966
5001
|
let e = N.current;
|
|
4967
5002
|
if (!e) return;
|
|
4968
5003
|
let t = !0, n = () => {
|
|
4969
|
-
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight *
|
|
5004
|
+
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * G);
|
|
4970
5005
|
t && n.length && R(Math.ceil(Math.max(...n)));
|
|
4971
5006
|
};
|
|
4972
5007
|
n();
|
|
@@ -4975,12 +5010,12 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
4975
5010
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
4976
5011
|
};
|
|
4977
5012
|
});
|
|
4978
|
-
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [],
|
|
5013
|
+
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], re = t ? er(k ?? j ?? [], {
|
|
4979
5014
|
imageField: n,
|
|
4980
5015
|
nameField: a,
|
|
4981
5016
|
hrefField: o
|
|
4982
|
-
}) : ne,
|
|
4983
|
-
if (!
|
|
5017
|
+
}) : ne, G = $n[p] ?? $n.medium, K = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ie = f === "marquee" ? "step" : f, J = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), ae = Math.min(3e3, Math.max(100, Number(_) || 500)), oe = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || G * 3) + K, ce = F ? Math.max(1, Math.floor(F / se)) : oe, le = Math.min(oe, ce), ue = F ? Math.min(se, F / le) : se;
|
|
5018
|
+
if (!re.length) return /* @__PURE__ */ u("div", {
|
|
4984
5019
|
ref: T,
|
|
4985
5020
|
style: {
|
|
4986
5021
|
width: "100%",
|
|
@@ -4992,7 +5027,7 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
4992
5027
|
alignItems: "center",
|
|
4993
5028
|
justifyContent: "center",
|
|
4994
5029
|
flexWrap: "wrap",
|
|
4995
|
-
gap:
|
|
5030
|
+
gap: K
|
|
4996
5031
|
},
|
|
4997
5032
|
children: [
|
|
4998
5033
|
0,
|
|
@@ -5002,16 +5037,16 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5002
5037
|
4
|
|
5003
5038
|
].map((e) => /* @__PURE__ */ u("div", {
|
|
5004
5039
|
style: {
|
|
5005
|
-
height:
|
|
5006
|
-
width:
|
|
5040
|
+
height: G,
|
|
5041
|
+
width: G * 3,
|
|
5007
5042
|
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
5008
5043
|
borderRadius: 6,
|
|
5009
5044
|
display: "flex",
|
|
5010
5045
|
alignItems: "center",
|
|
5011
5046
|
justifyContent: "center",
|
|
5012
|
-
fontSize: Math.max(10, Math.round(
|
|
5047
|
+
fontSize: Math.max(10, Math.round(G / 4)),
|
|
5013
5048
|
opacity: .45,
|
|
5014
|
-
...
|
|
5049
|
+
...q
|
|
5015
5050
|
},
|
|
5016
5051
|
children: "LOGO"
|
|
5017
5052
|
}, e))
|
|
@@ -5025,12 +5060,12 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5025
5060
|
children: C
|
|
5026
5061
|
}) : null
|
|
5027
5062
|
});
|
|
5028
|
-
let de =
|
|
5063
|
+
let de = re.length, fe = ie === "step" && de > le, pe = ie === "slider", me = fe && !E && !U && !W, he = v === "right", ge = he ? de : 0, _e = fe ? [...re, ...re] : re, ve = fe ? z * ue : 0, ye = (e, t, n) => {
|
|
5029
5064
|
let r = /* @__PURE__ */ u("img", {
|
|
5030
5065
|
src: e.src,
|
|
5031
5066
|
alt: e.alt ?? "",
|
|
5032
5067
|
style: {
|
|
5033
|
-
height:
|
|
5068
|
+
height: G,
|
|
5034
5069
|
width: "auto",
|
|
5035
5070
|
maxWidth: "100%",
|
|
5036
5071
|
objectFit: "contain",
|
|
@@ -5039,7 +5074,7 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5039
5074
|
}), i = fe ? {
|
|
5040
5075
|
width: ue,
|
|
5041
5076
|
flex: "0 0 auto",
|
|
5042
|
-
padding: `0 ${
|
|
5077
|
+
padding: `0 ${K / 2}px`,
|
|
5043
5078
|
justifyContent: "center"
|
|
5044
5079
|
} : {};
|
|
5045
5080
|
return e.href && !E ? /* @__PURE__ */ u("a", {
|
|
@@ -5062,7 +5097,7 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5062
5097
|
...n ? { "aria-hidden": "true" } : {},
|
|
5063
5098
|
children: r
|
|
5064
5099
|
}, `${n ? "c" : "o"}-${t}`);
|
|
5065
|
-
},
|
|
5100
|
+
}, be = /* @__PURE__ */ u("div", {
|
|
5066
5101
|
ref: N,
|
|
5067
5102
|
className: "wb-logos-track",
|
|
5068
5103
|
style: {
|
|
@@ -5071,20 +5106,20 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5071
5106
|
...fe ? {
|
|
5072
5107
|
width: _e.length * ue,
|
|
5073
5108
|
transform: `translateX(-${ve}px)`,
|
|
5074
|
-
transition: V ? `transform ${
|
|
5109
|
+
transition: V ? `transform ${ae}ms ease` : "none"
|
|
5075
5110
|
} : pe ? {
|
|
5076
|
-
gap:
|
|
5111
|
+
gap: K,
|
|
5077
5112
|
overflowX: "auto",
|
|
5078
5113
|
scrollBehavior: "smooth",
|
|
5079
5114
|
scrollSnapType: "x proximity"
|
|
5080
5115
|
} : {
|
|
5081
|
-
gap:
|
|
5116
|
+
gap: K,
|
|
5082
5117
|
flexWrap: "wrap",
|
|
5083
5118
|
justifyContent: "center"
|
|
5084
5119
|
}
|
|
5085
5120
|
},
|
|
5086
5121
|
children: _e.map((e, t) => ye(e, t, fe && t >= de))
|
|
5087
|
-
}),
|
|
5122
|
+
}), Y = (e) => {
|
|
5088
5123
|
if (pe) {
|
|
5089
5124
|
let t = N.current;
|
|
5090
5125
|
t && t.scrollBy({
|
|
@@ -5102,10 +5137,10 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5102
5137
|
H(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
5103
5138
|
H(!0), B(n + e);
|
|
5104
5139
|
}));
|
|
5105
|
-
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show",
|
|
5140
|
+
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Se = X !== "off" && (pe ? F > 0 : fe), Q = (e) => /* @__PURE__ */ u("button", {
|
|
5106
5141
|
type: "button",
|
|
5107
5142
|
"aria-label": e < 0 ? "Previous logos" : "Next logos",
|
|
5108
|
-
onClick: () =>
|
|
5143
|
+
onClick: () => Y(e),
|
|
5109
5144
|
className: `wb-logos-arrow${X === "hover" ? " wb-logos-arrow-shy" : ""}`,
|
|
5110
5145
|
style: { [e < 0 ? "left" : "right"]: 0 },
|
|
5111
5146
|
children: e < 0 ? "‹" : "›"
|
|
@@ -5152,22 +5187,22 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5152
5187
|
margin: "0 auto"
|
|
5153
5188
|
},
|
|
5154
5189
|
children: [
|
|
5155
|
-
|
|
5190
|
+
Se ? Q(-1) : null,
|
|
5156
5191
|
/* @__PURE__ */ u("div", {
|
|
5157
5192
|
style: { overflow: "hidden" },
|
|
5158
|
-
children:
|
|
5193
|
+
children: be
|
|
5159
5194
|
}),
|
|
5160
|
-
|
|
5195
|
+
Se ? Q(1) : null
|
|
5161
5196
|
]
|
|
5162
5197
|
}) : /* @__PURE__ */ d(l, { children: [
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5198
|
+
Se ? Q(-1) : null,
|
|
5199
|
+
be,
|
|
5200
|
+
Se ? Q(1) : null
|
|
5166
5201
|
] }),
|
|
5167
|
-
/* @__PURE__ */ u(
|
|
5202
|
+
/* @__PURE__ */ u(nr, {
|
|
5168
5203
|
running: me,
|
|
5169
|
-
every:
|
|
5170
|
-
slide:
|
|
5204
|
+
every: J + ae,
|
|
5205
|
+
slide: ae,
|
|
5171
5206
|
step: he ? -1 : 1,
|
|
5172
5207
|
index: z,
|
|
5173
5208
|
total: de,
|
|
@@ -5178,7 +5213,7 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5178
5213
|
]
|
|
5179
5214
|
});
|
|
5180
5215
|
}
|
|
5181
|
-
function
|
|
5216
|
+
function nr({ running: e, every: t, slide: n, step: r, index: a, total: o, home: s, setIndex: c, setAnimate: l }) {
|
|
5182
5217
|
i(() => {
|
|
5183
5218
|
if (!e) return;
|
|
5184
5219
|
let n = setInterval(() => {
|
|
@@ -5214,13 +5249,13 @@ function Zn({ running: e, every: t, slide: n, step: r, index: a, total: o, home:
|
|
|
5214
5249
|
l
|
|
5215
5250
|
]), null;
|
|
5216
5251
|
}
|
|
5217
|
-
var
|
|
5252
|
+
var rr = {
|
|
5218
5253
|
small: 380,
|
|
5219
5254
|
medium: 560,
|
|
5220
5255
|
large: 820,
|
|
5221
5256
|
full: "100%"
|
|
5222
5257
|
};
|
|
5223
|
-
function
|
|
5258
|
+
function ir({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: a = 0, size: o = "medium", title: l = "", showClose: f = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
|
|
5224
5259
|
let [C, w] = c(!1), T = s(null);
|
|
5225
5260
|
i(() => {
|
|
5226
5261
|
if (S || !e) return;
|
|
@@ -5245,7 +5280,7 @@ function $n({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5245
5280
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
5246
5281
|
};
|
|
5247
5282
|
}, [S, C]);
|
|
5248
|
-
let E =
|
|
5283
|
+
let E = rr[o] ?? rr.medium, D = (e) => {
|
|
5249
5284
|
let t = {
|
|
5250
5285
|
padding: "9px 16px",
|
|
5251
5286
|
borderRadius: 6,
|
|
@@ -5414,97 +5449,98 @@ function $n({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5414
5449
|
})]
|
|
5415
5450
|
});
|
|
5416
5451
|
}
|
|
5417
|
-
var
|
|
5418
|
-
PageRoot:
|
|
5419
|
-
CalendarBlock:
|
|
5420
|
-
LogoCarousel:
|
|
5421
|
-
DialogBlock:
|
|
5422
|
-
Section:
|
|
5423
|
-
Container:
|
|
5424
|
-
Heading:
|
|
5425
|
-
TextBlock:
|
|
5426
|
-
ButtonBlock:
|
|
5427
|
-
ImageBlock:
|
|
5428
|
-
Spacer:
|
|
5429
|
-
Divider:
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5452
|
+
var ar = {
|
|
5453
|
+
PageRoot: ze,
|
|
5454
|
+
CalendarBlock: Qn,
|
|
5455
|
+
LogoCarousel: tr,
|
|
5456
|
+
DialogBlock: ir,
|
|
5457
|
+
Section: Be,
|
|
5458
|
+
Container: Ve,
|
|
5459
|
+
Heading: He,
|
|
5460
|
+
TextBlock: nt,
|
|
5461
|
+
ButtonBlock: at,
|
|
5462
|
+
ImageBlock: ot,
|
|
5463
|
+
Spacer: ft,
|
|
5464
|
+
Divider: pt,
|
|
5465
|
+
BoxBlock: mt,
|
|
5466
|
+
SliderBlock: bt,
|
|
5467
|
+
CanvasSlider: xt,
|
|
5468
|
+
TabsBlock: Lt,
|
|
5469
|
+
QuickStack: un,
|
|
5470
|
+
CollectionList: dn,
|
|
5471
|
+
CollectionSearch: fn,
|
|
5472
|
+
BreadcrumbsBlock: pn,
|
|
5473
|
+
PaginationBlock: mn,
|
|
5474
|
+
StepperBlock: En,
|
|
5475
|
+
SocialLinksBlock: Tn,
|
|
5476
|
+
ThemeModeBlock: yn,
|
|
5477
|
+
ScrollTopBlock: Cn,
|
|
5478
|
+
OrgChartBlock: Rn,
|
|
5479
|
+
TableBlock: Wn,
|
|
5480
|
+
IconBlock: At,
|
|
5481
|
+
MapBlock: Ot,
|
|
5482
|
+
MasonryBlock: Mt,
|
|
5483
|
+
AccordionBlock: Rt,
|
|
5484
|
+
NavbarBlock: It,
|
|
5485
|
+
ListBlock: tt,
|
|
5486
|
+
TextSpan: Ke,
|
|
5487
|
+
QuoteBlock: et,
|
|
5488
|
+
TextLink: it,
|
|
5489
|
+
RichTextBlock: Qe,
|
|
5490
|
+
RichContentBlock: Qe,
|
|
5491
|
+
VideoBlock: st,
|
|
5492
|
+
YouTubeBlock: lt,
|
|
5493
|
+
IframeBlock: ut,
|
|
5494
|
+
EmbedBlock: dt,
|
|
5495
|
+
FormBlock: Zt,
|
|
5496
|
+
FormLabel: nn,
|
|
5497
|
+
FormInput: rn,
|
|
5498
|
+
FormTextarea: an,
|
|
5499
|
+
FormCheckbox: (e) => /* @__PURE__ */ u(on, {
|
|
5464
5500
|
kind: "checkbox",
|
|
5465
5501
|
...e
|
|
5466
5502
|
}),
|
|
5467
|
-
FormRadio: (e) => /* @__PURE__ */ u(
|
|
5503
|
+
FormRadio: (e) => /* @__PURE__ */ u(on, {
|
|
5468
5504
|
kind: "radio",
|
|
5469
5505
|
...e
|
|
5470
5506
|
}),
|
|
5471
|
-
FormSelect:
|
|
5472
|
-
FormFile:
|
|
5473
|
-
FormRecaptcha:
|
|
5474
|
-
FormSubmit:
|
|
5475
|
-
},
|
|
5507
|
+
FormSelect: sn,
|
|
5508
|
+
FormFile: cn,
|
|
5509
|
+
FormRecaptcha: tn,
|
|
5510
|
+
FormSubmit: ln
|
|
5511
|
+
}, or = {
|
|
5476
5512
|
id: "auth",
|
|
5477
5513
|
label: "Accounts",
|
|
5478
5514
|
category: "Apps",
|
|
5479
5515
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5480
5516
|
ssr: "shell",
|
|
5481
5517
|
settings: ["site.authRedirect"]
|
|
5482
|
-
},
|
|
5518
|
+
}, sr = t({
|
|
5483
5519
|
user: null,
|
|
5484
5520
|
status: "idle",
|
|
5485
5521
|
ensure: () => {},
|
|
5486
5522
|
refresh: () => {},
|
|
5487
5523
|
signOut: () => {}
|
|
5488
5524
|
});
|
|
5489
|
-
function
|
|
5525
|
+
function cr(e, t) {
|
|
5490
5526
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5491
5527
|
}
|
|
5492
|
-
function
|
|
5528
|
+
function lr(e) {
|
|
5493
5529
|
let t = e && typeof e == "object" ? e["site.session"] : null, n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (e) => typeof e == "string" ? e.trim() : "", i = r(n.url), a = r(n.mePath), o = r(n.logoutPath);
|
|
5494
5530
|
return {
|
|
5495
5531
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5496
5532
|
url: i,
|
|
5497
5533
|
mePath: a,
|
|
5498
5534
|
logoutPath: o,
|
|
5499
|
-
meUrl:
|
|
5500
|
-
logoutUrl:
|
|
5535
|
+
meUrl: cr(i, a),
|
|
5536
|
+
logoutUrl: cr(i, o),
|
|
5501
5537
|
loginPage: r(n.loginPage),
|
|
5502
5538
|
userPath: r(n.userPath),
|
|
5503
5539
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5504
5540
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5505
5541
|
};
|
|
5506
5542
|
}
|
|
5507
|
-
function
|
|
5543
|
+
function ur(e, t) {
|
|
5508
5544
|
if (!t) return e ?? null;
|
|
5509
5545
|
let n = e;
|
|
5510
5546
|
for (let e of t.split(".")) {
|
|
@@ -5513,26 +5549,26 @@ function ar(e, t) {
|
|
|
5513
5549
|
}
|
|
5514
5550
|
return n ?? null;
|
|
5515
5551
|
}
|
|
5516
|
-
function
|
|
5552
|
+
function dr(e) {
|
|
5517
5553
|
try {
|
|
5518
5554
|
return window.localStorage.getItem(e) || "";
|
|
5519
5555
|
} catch {
|
|
5520
5556
|
return "";
|
|
5521
5557
|
}
|
|
5522
5558
|
}
|
|
5523
|
-
function
|
|
5559
|
+
function fr(e) {
|
|
5524
5560
|
try {
|
|
5525
5561
|
window.localStorage.removeItem(e);
|
|
5526
5562
|
} catch {}
|
|
5527
5563
|
}
|
|
5528
|
-
var
|
|
5529
|
-
let e = r(
|
|
5564
|
+
var pr = () => {
|
|
5565
|
+
let e = r(sr);
|
|
5530
5566
|
return i(() => {
|
|
5531
5567
|
e.ensure();
|
|
5532
5568
|
}, [e]), e;
|
|
5533
5569
|
};
|
|
5534
|
-
function
|
|
5535
|
-
let f = r(
|
|
5570
|
+
function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
|
|
5571
|
+
let f = r(Z), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => lr(f?.settings), [f?.settings]), [g, _] = c(t ?? null), [v, y] = c(t ? "user" : a ? "guest" : "idle"), b = s(!1), x = n((e, t) => fetch(`${p}${e}`, {
|
|
5536
5572
|
...t,
|
|
5537
5573
|
credentials: "include",
|
|
5538
5574
|
headers: {
|
|
@@ -5544,9 +5580,9 @@ function lr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5544
5580
|
if (a) return Promise.resolve(null);
|
|
5545
5581
|
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5546
5582
|
if (h.mode === "custom") {
|
|
5547
|
-
let e = h.auth === "bearer" ?
|
|
5583
|
+
let e = h.auth === "bearer" ? dr(h.tokenKey) : "";
|
|
5548
5584
|
return !h.meUrl || h.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(h.meUrl, { ...h.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
|
|
5549
|
-
let t =
|
|
5585
|
+
let t = ur(e, h.userPath);
|
|
5550
5586
|
return S(t && typeof t == "object" ? t : null);
|
|
5551
5587
|
}).catch(() => S(null));
|
|
5552
5588
|
}
|
|
@@ -5559,12 +5595,12 @@ function lr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5559
5595
|
]), w = n(() => {
|
|
5560
5596
|
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5561
5597
|
if (h.mode === "custom") {
|
|
5562
|
-
let e = h.auth === "bearer" ?
|
|
5598
|
+
let e = h.auth === "bearer" ? dr(h.tokenKey) : "";
|
|
5563
5599
|
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5564
5600
|
method: "post",
|
|
5565
5601
|
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5566
5602
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5567
|
-
h.auth === "bearer" &&
|
|
5603
|
+
h.auth === "bearer" && fr(h.tokenKey), S(null);
|
|
5568
5604
|
});
|
|
5569
5605
|
}
|
|
5570
5606
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -5614,19 +5650,19 @@ function lr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5614
5650
|
h.loginPage,
|
|
5615
5651
|
C,
|
|
5616
5652
|
w
|
|
5617
|
-
]), /* @__PURE__ */ u(
|
|
5653
|
+
]), /* @__PURE__ */ u(sr.Provider, {
|
|
5618
5654
|
value: E,
|
|
5619
5655
|
children: e
|
|
5620
5656
|
});
|
|
5621
5657
|
}
|
|
5622
|
-
function
|
|
5623
|
-
let { status: n } =
|
|
5658
|
+
function hr({ when: e, children: t }) {
|
|
5659
|
+
let { status: n } = pr();
|
|
5624
5660
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5625
5661
|
}
|
|
5626
5662
|
//#endregion
|
|
5627
5663
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5628
|
-
function
|
|
5629
|
-
let { tenant: h, apiUrl: g, settings: _ } = r(
|
|
5664
|
+
function gr({ 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 }) {
|
|
5665
|
+
let { tenant: h, apiUrl: g, settings: _ } = r(Z), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
5630
5666
|
if (e.preventDefault(), f) return;
|
|
5631
5667
|
let n = new FormData(e.currentTarget);
|
|
5632
5668
|
C(!0), x("");
|
|
@@ -5674,20 +5710,20 @@ function dr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5674
5710
|
children: [
|
|
5675
5711
|
w ? /* @__PURE__ */ d("label", {
|
|
5676
5712
|
style: {
|
|
5677
|
-
...
|
|
5713
|
+
...Bt,
|
|
5678
5714
|
display: "grid",
|
|
5679
5715
|
gap: 6
|
|
5680
5716
|
},
|
|
5681
5717
|
children: [a, /* @__PURE__ */ u("input", {
|
|
5682
5718
|
name: "name",
|
|
5683
5719
|
type: "text",
|
|
5684
|
-
style:
|
|
5685
|
-
...
|
|
5720
|
+
style: Vt,
|
|
5721
|
+
...Ut(f)
|
|
5686
5722
|
})]
|
|
5687
5723
|
}) : null,
|
|
5688
5724
|
/* @__PURE__ */ d("label", {
|
|
5689
5725
|
style: {
|
|
5690
|
-
...
|
|
5726
|
+
...Bt,
|
|
5691
5727
|
display: "grid",
|
|
5692
5728
|
gap: 6
|
|
5693
5729
|
},
|
|
@@ -5695,13 +5731,13 @@ function dr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5695
5731
|
name: "email",
|
|
5696
5732
|
type: "email",
|
|
5697
5733
|
required: !f,
|
|
5698
|
-
style:
|
|
5699
|
-
...
|
|
5734
|
+
style: Vt,
|
|
5735
|
+
...Ut(f)
|
|
5700
5736
|
})]
|
|
5701
5737
|
}),
|
|
5702
5738
|
/* @__PURE__ */ d("label", {
|
|
5703
5739
|
style: {
|
|
5704
|
-
...
|
|
5740
|
+
...Bt,
|
|
5705
5741
|
display: "grid",
|
|
5706
5742
|
gap: 6
|
|
5707
5743
|
},
|
|
@@ -5709,15 +5745,15 @@ function dr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5709
5745
|
name: "password",
|
|
5710
5746
|
type: "password",
|
|
5711
5747
|
required: !f,
|
|
5712
|
-
style:
|
|
5713
|
-
...
|
|
5748
|
+
style: Vt,
|
|
5749
|
+
...Ut(f)
|
|
5714
5750
|
})]
|
|
5715
5751
|
}),
|
|
5716
5752
|
/* @__PURE__ */ u("button", {
|
|
5717
5753
|
type: f ? "button" : "submit",
|
|
5718
5754
|
disabled: S || void 0,
|
|
5719
5755
|
style: {
|
|
5720
|
-
...
|
|
5756
|
+
...Pe,
|
|
5721
5757
|
border: 0,
|
|
5722
5758
|
padding: "10px 22px",
|
|
5723
5759
|
borderRadius: 8,
|
|
@@ -5749,8 +5785,8 @@ function dr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5749
5785
|
]
|
|
5750
5786
|
});
|
|
5751
5787
|
}
|
|
5752
|
-
function
|
|
5753
|
-
let { user: c, status: l, signOut: f } =
|
|
5788
|
+
function _r({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
5789
|
+
let { user: c, status: l, signOut: f } = pr(), p = a ? s || "user" : l, m = a ? {
|
|
5754
5790
|
name: "Ada Lovelace",
|
|
5755
5791
|
email: "ada@example.com"
|
|
5756
5792
|
} : c;
|
|
@@ -5771,7 +5807,7 @@ function fr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5771
5807
|
children: [
|
|
5772
5808
|
/* @__PURE__ */ d("span", {
|
|
5773
5809
|
style: {
|
|
5774
|
-
...
|
|
5810
|
+
...Bt,
|
|
5775
5811
|
fontWeight: 600
|
|
5776
5812
|
},
|
|
5777
5813
|
children: [
|
|
@@ -5782,7 +5818,7 @@ function fr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5782
5818
|
}),
|
|
5783
5819
|
n && m?.email ? /* @__PURE__ */ u("span", {
|
|
5784
5820
|
style: {
|
|
5785
|
-
...
|
|
5821
|
+
...Bt,
|
|
5786
5822
|
opacity: .7
|
|
5787
5823
|
},
|
|
5788
5824
|
children: m.email
|
|
@@ -5791,14 +5827,14 @@ function fr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5791
5827
|
type: "button",
|
|
5792
5828
|
onClick: a ? void 0 : f,
|
|
5793
5829
|
style: {
|
|
5794
|
-
...
|
|
5830
|
+
...Pe,
|
|
5795
5831
|
border: 0,
|
|
5796
5832
|
padding: "8px 16px",
|
|
5797
5833
|
borderRadius: 8,
|
|
5798
5834
|
fontSize: 14,
|
|
5799
5835
|
cursor: a ? "default" : "pointer"
|
|
5800
5836
|
},
|
|
5801
|
-
...
|
|
5837
|
+
...Ut(a),
|
|
5802
5838
|
children: t
|
|
5803
5839
|
})
|
|
5804
5840
|
]
|
|
@@ -5815,40 +5851,40 @@ function fr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5815
5851
|
}
|
|
5816
5852
|
//#endregion
|
|
5817
5853
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5818
|
-
var
|
|
5854
|
+
var vr = {
|
|
5819
5855
|
id: "consent",
|
|
5820
5856
|
label: "Cookie consent",
|
|
5821
5857
|
category: "Apps",
|
|
5822
5858
|
keys: ["CookieConsent"],
|
|
5823
5859
|
ssr: "shell",
|
|
5824
5860
|
settings: []
|
|
5825
|
-
},
|
|
5826
|
-
function
|
|
5861
|
+
}, yr = "webim.cookie_consent";
|
|
5862
|
+
function br() {
|
|
5827
5863
|
try {
|
|
5828
|
-
let e = window.localStorage.getItem(
|
|
5864
|
+
let e = window.localStorage.getItem(yr), t = e ? JSON.parse(e) : null;
|
|
5829
5865
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5830
5866
|
} catch {
|
|
5831
5867
|
return "";
|
|
5832
5868
|
}
|
|
5833
5869
|
}
|
|
5834
|
-
function
|
|
5870
|
+
function xr(e) {
|
|
5835
5871
|
try {
|
|
5836
5872
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5837
5873
|
} catch {}
|
|
5838
5874
|
}
|
|
5839
|
-
function
|
|
5875
|
+
function Sr(e) {
|
|
5840
5876
|
try {
|
|
5841
|
-
window.localStorage.setItem(
|
|
5877
|
+
window.localStorage.setItem(yr, JSON.stringify({
|
|
5842
5878
|
choice: e,
|
|
5843
5879
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5844
5880
|
}));
|
|
5845
5881
|
} catch {}
|
|
5846
|
-
|
|
5882
|
+
xr(e);
|
|
5847
5883
|
try {
|
|
5848
5884
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5849
5885
|
} catch {}
|
|
5850
5886
|
}
|
|
5851
|
-
var
|
|
5887
|
+
var Cr = {
|
|
5852
5888
|
bottom: {
|
|
5853
5889
|
left: 0,
|
|
5854
5890
|
right: 0,
|
|
@@ -5870,18 +5906,18 @@ var vr = {
|
|
|
5870
5906
|
maxWidth: 400
|
|
5871
5907
|
}
|
|
5872
5908
|
};
|
|
5873
|
-
function
|
|
5909
|
+
function wr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
|
|
5874
5910
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
5875
5911
|
y(e), typeof m == "function" && m(e);
|
|
5876
5912
|
};
|
|
5877
5913
|
if (i(() => {
|
|
5878
5914
|
if (h) return;
|
|
5879
|
-
let e =
|
|
5880
|
-
e ?
|
|
5915
|
+
let e = br();
|
|
5916
|
+
e ? xr(e) : _(!0);
|
|
5881
5917
|
}, [h, v]), !g) return null;
|
|
5882
5918
|
let x = (e) => () => {
|
|
5883
|
-
h || (
|
|
5884
|
-
}, S =
|
|
5919
|
+
h || (Sr(e), _(!1));
|
|
5920
|
+
}, S = Cr[s] ?? Cr.bottom, C = {
|
|
5885
5921
|
appearance: "none",
|
|
5886
5922
|
font: "inherit",
|
|
5887
5923
|
fontSize: 14,
|
|
@@ -5961,37 +5997,37 @@ function yr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
5961
5997
|
}
|
|
5962
5998
|
//#endregion
|
|
5963
5999
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
5964
|
-
var
|
|
6000
|
+
var Tr = {
|
|
5965
6001
|
id: "language",
|
|
5966
6002
|
label: "Language",
|
|
5967
6003
|
category: "Apps",
|
|
5968
6004
|
keys: ["SiteLanguagePicker"],
|
|
5969
6005
|
ssr: "prefetch",
|
|
5970
6006
|
settings: ["locales"]
|
|
5971
|
-
},
|
|
6007
|
+
}, Er = {
|
|
5972
6008
|
id: "search",
|
|
5973
6009
|
label: "Search",
|
|
5974
6010
|
category: "Apps",
|
|
5975
6011
|
keys: ["SiteSearch"],
|
|
5976
6012
|
ssr: "prefetch",
|
|
5977
6013
|
settings: []
|
|
5978
|
-
},
|
|
5979
|
-
function
|
|
6014
|
+
}, Dr = 50, Or = 2e3;
|
|
6015
|
+
function kr() {
|
|
5980
6016
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
5981
6017
|
}
|
|
5982
|
-
function
|
|
6018
|
+
function Ar(e, t) {
|
|
5983
6019
|
let n = e?.data ?? {}, r = [];
|
|
5984
6020
|
for (let e of Object.values(n)) {
|
|
5985
|
-
let t = e == null ? "" :
|
|
5986
|
-
if (t && r.push(t), r.join(" ").length >
|
|
6021
|
+
let t = e == null ? "" : Oe(e);
|
|
6022
|
+
if (t && r.push(t), r.join(" ").length > Or) break;
|
|
5987
6023
|
}
|
|
5988
|
-
return r.join(" ").slice(0,
|
|
6024
|
+
return r.join(" ").slice(0, Or).toLocaleLowerCase(t || void 0);
|
|
5989
6025
|
}
|
|
5990
|
-
function
|
|
5991
|
-
let { tenant: b, apiUrl: x, locale: S } = r(
|
|
6026
|
+
function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
|
|
6027
|
+
let { tenant: b, apiUrl: x, locale: S } = r(Z), [C, w] = c(() => kr()), [T, E] = c(() => kr()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
|
|
5992
6028
|
i(() => {
|
|
5993
6029
|
let e = () => {
|
|
5994
|
-
let e =
|
|
6030
|
+
let e = kr();
|
|
5995
6031
|
w(e), E(e);
|
|
5996
6032
|
};
|
|
5997
6033
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -6042,8 +6078,8 @@ function Er({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6042
6078
|
});
|
|
6043
6079
|
}
|
|
6044
6080
|
else for (let t of e.rows) {
|
|
6045
|
-
if (!
|
|
6046
|
-
let n = t?.data ?? {}, r =
|
|
6081
|
+
if (!Ar(t, S).includes(P)) continue;
|
|
6082
|
+
let n = t?.data ?? {}, r = Oe(n.name) || "Untitled", i = Oe(n.slug);
|
|
6047
6083
|
F.push({
|
|
6048
6084
|
key: `entry:${t.id}`,
|
|
6049
6085
|
title: r,
|
|
@@ -6051,7 +6087,7 @@ function Er({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6051
6087
|
kind: "entry"
|
|
6052
6088
|
});
|
|
6053
6089
|
}
|
|
6054
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
6090
|
+
let I = F.slice(0, Math.min(Math.max(1, p), Dr)), L = (e) => {
|
|
6055
6091
|
if (v) {
|
|
6056
6092
|
e.preventDefault(), w(T), j(!0);
|
|
6057
6093
|
return;
|
|
@@ -6133,7 +6169,7 @@ function Er({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6133
6169
|
onChange: (e) => E(e.target.value),
|
|
6134
6170
|
onFocus: () => P && j(!0),
|
|
6135
6171
|
style: {
|
|
6136
|
-
...
|
|
6172
|
+
...Vt,
|
|
6137
6173
|
flexGrow: 1,
|
|
6138
6174
|
minWidth: 0
|
|
6139
6175
|
}
|
|
@@ -6191,21 +6227,21 @@ function Er({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6191
6227
|
}
|
|
6192
6228
|
//#endregion
|
|
6193
6229
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
6194
|
-
function
|
|
6230
|
+
function Mr(e) {
|
|
6195
6231
|
let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
|
|
6196
6232
|
return [...new Set(n.map((e) => e.trim()))];
|
|
6197
6233
|
}
|
|
6198
|
-
var
|
|
6199
|
-
function
|
|
6234
|
+
var Nr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6235
|
+
function Pr(e, t) {
|
|
6200
6236
|
let n = String(e ?? "").toUpperCase();
|
|
6201
6237
|
if (t === "code") return n;
|
|
6202
6238
|
let r = "";
|
|
6203
6239
|
try {
|
|
6204
|
-
r =
|
|
6240
|
+
r = Nr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
6205
6241
|
} catch {}
|
|
6206
6242
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
6207
6243
|
}
|
|
6208
|
-
function
|
|
6244
|
+
function Fr(e, t) {
|
|
6209
6245
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
6210
6246
|
if (typeof window > "u") return n || "?";
|
|
6211
6247
|
try {
|
|
@@ -6215,8 +6251,8 @@ function Ar(e, t) {
|
|
|
6215
6251
|
return n || "/";
|
|
6216
6252
|
}
|
|
6217
6253
|
}
|
|
6218
|
-
function
|
|
6219
|
-
let c = r(
|
|
6254
|
+
function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
|
|
6255
|
+
let c = r(Z), l = Mr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
|
|
6220
6256
|
display: "inline-flex",
|
|
6221
6257
|
alignItems: "center",
|
|
6222
6258
|
gap: 8,
|
|
@@ -6251,7 +6287,7 @@ function jr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6251
6287
|
style: { opacity: .4 },
|
|
6252
6288
|
children: n ?? "·"
|
|
6253
6289
|
}), /* @__PURE__ */ u("a", {
|
|
6254
|
-
href:
|
|
6290
|
+
href: Fr(e, e === f),
|
|
6255
6291
|
hrefLang: e,
|
|
6256
6292
|
"aria-current": e === p ? "true" : void 0,
|
|
6257
6293
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -6261,7 +6297,7 @@ function jr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6261
6297
|
textDecoration: "none",
|
|
6262
6298
|
cursor: s ? "default" : "pointer"
|
|
6263
6299
|
},
|
|
6264
|
-
children:
|
|
6300
|
+
children: Pr(e, t)
|
|
6265
6301
|
})]
|
|
6266
6302
|
}, e))]
|
|
6267
6303
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -6272,7 +6308,7 @@ function jr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6272
6308
|
value: p,
|
|
6273
6309
|
onChange: s ? void 0 : (e) => {
|
|
6274
6310
|
let t = e.target.value;
|
|
6275
|
-
window.location.assign(
|
|
6311
|
+
window.location.assign(Fr(t, t === f));
|
|
6276
6312
|
},
|
|
6277
6313
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
6278
6314
|
style: {
|
|
@@ -6286,57 +6322,717 @@ function jr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6286
6322
|
},
|
|
6287
6323
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
6288
6324
|
value: e,
|
|
6289
|
-
children:
|
|
6325
|
+
children: Pr(e, t)
|
|
6290
6326
|
}, e))
|
|
6291
6327
|
})]
|
|
6292
6328
|
});
|
|
6293
6329
|
}
|
|
6294
6330
|
//#endregion
|
|
6295
6331
|
//#region ../ui/src/components/builder/apps/index.js
|
|
6296
|
-
var
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
],
|
|
6302
|
-
SiteLoginForm:
|
|
6303
|
-
SiteAccountMenu:
|
|
6304
|
-
SiteLanguagePicker:
|
|
6305
|
-
CookieConsent:
|
|
6306
|
-
SiteSearch:
|
|
6332
|
+
var Lr = [
|
|
6333
|
+
or,
|
|
6334
|
+
Tr,
|
|
6335
|
+
vr,
|
|
6336
|
+
Er
|
|
6337
|
+
], Rr = {
|
|
6338
|
+
SiteLoginForm: gr,
|
|
6339
|
+
SiteAccountMenu: _r,
|
|
6340
|
+
SiteLanguagePicker: Ir,
|
|
6341
|
+
CookieConsent: wr,
|
|
6342
|
+
SiteSearch: jr
|
|
6307
6343
|
};
|
|
6308
|
-
new Set(
|
|
6344
|
+
new Set(Lr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
6309
6345
|
//#endregion
|
|
6310
|
-
//#region ../ui/src/components/builder/
|
|
6311
|
-
var
|
|
6312
|
-
|
|
6313
|
-
|
|
6346
|
+
//#region ../ui/src/components/builder/three/runtime.js
|
|
6347
|
+
var zr = "0.185.1", Br = "4.2.0", Vr = "https://cdn.jsdelivr.net/npm", Hr = `${Vr}/three@${zr}/+esm`, Ur = `${Vr}/@google/model-viewer@${Br}/dist/model-viewer.min.js`, Wr = (e) => import(
|
|
6348
|
+
/* @vite-ignore */
|
|
6349
|
+
/* webpackIgnore: true */
|
|
6350
|
+
e
|
|
6351
|
+
), Gr = /* @__PURE__ */ new Map();
|
|
6352
|
+
function Kr(e) {
|
|
6353
|
+
if (Gr.has(e)) return Gr.get(e);
|
|
6354
|
+
if (typeof window > "u") return new Promise(() => {});
|
|
6355
|
+
let t = Wr(e).catch((t) => {
|
|
6356
|
+
throw Gr.delete(e), t;
|
|
6357
|
+
});
|
|
6358
|
+
return Gr.set(e, t), t;
|
|
6359
|
+
}
|
|
6360
|
+
var qr = () => Kr(Hr), Jr = (e) => Kr(`${Vr}/three@${zr}/examples/jsm/${e}/+esm`);
|
|
6361
|
+
function Yr() {
|
|
6362
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Kr(Ur);
|
|
6363
|
+
}
|
|
6364
|
+
var Xr = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Zr = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
6365
|
+
function Qr(e, t) {
|
|
6366
|
+
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
6367
|
+
n = requestAnimationFrame(o), i ||= e;
|
|
6368
|
+
let a = r ? (e - r) / 1e3 : 0;
|
|
6369
|
+
r = e, t(a, (e - i) / 1e3);
|
|
6370
|
+
}, s = () => {
|
|
6371
|
+
n && cancelAnimationFrame(n), n = 0, r = 0;
|
|
6372
|
+
}, c = () => {
|
|
6373
|
+
let e = a && document.visibilityState !== "hidden";
|
|
6374
|
+
e && !n ? n = requestAnimationFrame(o) : !e && n && s();
|
|
6375
|
+
};
|
|
6376
|
+
t(0, 0);
|
|
6377
|
+
let l = typeof IntersectionObserver > "u" ? null : new IntersectionObserver((e) => {
|
|
6378
|
+
a = e.some((e) => e.isIntersecting), c();
|
|
6379
|
+
}, { rootMargin: "120px" });
|
|
6380
|
+
return l && e && l.observe(e), document.addEventListener("visibilitychange", c), c(), () => {
|
|
6381
|
+
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
6382
|
+
};
|
|
6383
|
+
}
|
|
6384
|
+
function $r(e, t, n = {}) {
|
|
6385
|
+
let r = {
|
|
6386
|
+
radius: n.distance ?? 4,
|
|
6387
|
+
polar: n.polar ?? Math.PI / 2.4,
|
|
6388
|
+
azimuth: n.azimuth ?? .6,
|
|
6389
|
+
target: n.target ?? {
|
|
6390
|
+
x: 0,
|
|
6391
|
+
y: 0,
|
|
6392
|
+
z: 0
|
|
6393
|
+
}
|
|
6394
|
+
}, i = { ...r }, a = n.minDistance ?? .4, o = n.maxDistance ?? 200, s = n.damping ?? .12, c = .05, l = null, u = (e) => {
|
|
6395
|
+
e.button !== void 0 && e.button !== 0 || (l = {
|
|
6396
|
+
x: e.clientX,
|
|
6397
|
+
y: e.clientY,
|
|
6398
|
+
id: e.pointerId
|
|
6399
|
+
}, t.setPointerCapture?.(e.pointerId));
|
|
6400
|
+
}, d = (e) => {
|
|
6401
|
+
if (!l || e.pointerId !== l.id) return;
|
|
6402
|
+
let t = e.clientX - l.x, n = e.clientY - l.y;
|
|
6403
|
+
l = {
|
|
6404
|
+
...l,
|
|
6405
|
+
x: e.clientX,
|
|
6406
|
+
y: e.clientY
|
|
6407
|
+
}, i.azimuth -= t * .006, i.polar = Math.max(c, Math.min(Math.PI - c, i.polar - n * .006)), e.preventDefault();
|
|
6408
|
+
}, f = (e) => {
|
|
6409
|
+
l && e.pointerId === l.id && t.releasePointerCapture?.(e.pointerId), l = null;
|
|
6410
|
+
}, p = (e) => {
|
|
6411
|
+
n.enableZoom !== !1 && (e.preventDefault(), i.radius = Math.max(a, Math.min(o, i.radius * (1 + Math.sign(e.deltaY) * .12))));
|
|
6412
|
+
};
|
|
6413
|
+
return t.addEventListener("pointerdown", u), t.addEventListener("pointermove", d), t.addEventListener("pointerup", f), t.addEventListener("pointercancel", f), t.addEventListener("wheel", p, { passive: !1 }), {
|
|
6414
|
+
update: () => {
|
|
6415
|
+
r.radius += (i.radius - r.radius) * s, r.polar += (i.polar - r.polar) * s, r.azimuth += (i.azimuth - r.azimuth) * s;
|
|
6416
|
+
let t = Math.sin(r.polar);
|
|
6417
|
+
e.position.set(r.target.x + r.radius * t * Math.sin(r.azimuth), r.target.y + r.radius * Math.cos(r.polar), r.target.z + r.radius * t * Math.cos(r.azimuth)), e.lookAt(r.target.x, r.target.y, r.target.z);
|
|
6418
|
+
},
|
|
6419
|
+
dragging: () => !!l,
|
|
6420
|
+
autoSpin: (e, t) => {
|
|
6421
|
+
!l && e && (i.azimuth += e * t);
|
|
6422
|
+
},
|
|
6423
|
+
frame: (e, t) => {
|
|
6424
|
+
i.radius = Math.max(a, Math.min(o, e)), r.radius = i.radius, t && (r.target = { ...t }, i.target = { ...t });
|
|
6425
|
+
},
|
|
6426
|
+
dispose: () => {
|
|
6427
|
+
t.removeEventListener("pointerdown", u), t.removeEventListener("pointermove", d), t.removeEventListener("pointerup", f), t.removeEventListener("pointercancel", f), t.removeEventListener("wheel", p);
|
|
6428
|
+
}
|
|
6429
|
+
};
|
|
6430
|
+
}
|
|
6431
|
+
//#endregion
|
|
6432
|
+
//#region ../ui/src/components/builder/three/views.jsx
|
|
6433
|
+
var ei = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ti = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, ni = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, ri = (e) => typeof e == "string" && !!e.trim();
|
|
6434
|
+
function ii({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
6435
|
+
return /* @__PURE__ */ d("div", {
|
|
6436
|
+
ref: r,
|
|
6437
|
+
style: {
|
|
6438
|
+
...A(i),
|
|
6439
|
+
minHeight: ei(n, 320),
|
|
6440
|
+
display: "flex",
|
|
6441
|
+
flexDirection: "column",
|
|
6442
|
+
alignItems: "center",
|
|
6443
|
+
justifyContent: "center",
|
|
6444
|
+
gap: 6,
|
|
6445
|
+
border: "1px dashed rgba(148,163,184,.55)",
|
|
6446
|
+
borderRadius: 10,
|
|
6447
|
+
background: "rgba(148,163,184,.08)",
|
|
6448
|
+
...q,
|
|
6449
|
+
color: "rgba(100,116,139,.95)",
|
|
6450
|
+
fontSize: 13,
|
|
6451
|
+
textAlign: "center",
|
|
6452
|
+
padding: 16
|
|
6453
|
+
},
|
|
6454
|
+
children: [/* @__PURE__ */ u("div", {
|
|
6455
|
+
style: { fontWeight: 600 },
|
|
6456
|
+
children: e
|
|
6457
|
+
}), t ? /* @__PURE__ */ u("div", {
|
|
6458
|
+
style: {
|
|
6459
|
+
fontSize: 11,
|
|
6460
|
+
opacity: .8,
|
|
6461
|
+
maxWidth: 320
|
|
6462
|
+
},
|
|
6463
|
+
children: t
|
|
6464
|
+
}) : null]
|
|
6465
|
+
});
|
|
6466
|
+
}
|
|
6467
|
+
function ai({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotateDelay: s, cameraControls: l, ar: d, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
|
|
6468
|
+
let [y, b] = c(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = c(!1);
|
|
6469
|
+
i(() => {
|
|
6470
|
+
if (y || !e) return;
|
|
6471
|
+
let t = !0;
|
|
6472
|
+
return Yr().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
6473
|
+
t = !1;
|
|
6474
|
+
};
|
|
6475
|
+
}, [y, e]);
|
|
6476
|
+
let C = {
|
|
6477
|
+
display: "block",
|
|
6478
|
+
width: "100%",
|
|
6479
|
+
minHeight: ei(r, 360),
|
|
6480
|
+
height: ei(r, 360),
|
|
6481
|
+
backgroundColor: a || "transparent",
|
|
6482
|
+
...A(g)
|
|
6483
|
+
};
|
|
6484
|
+
if (!e) return v ? /* @__PURE__ */ u(ii, {
|
|
6485
|
+
nodeRef: _,
|
|
6486
|
+
style: g,
|
|
6487
|
+
height: r,
|
|
6488
|
+
label: "3D Model",
|
|
6489
|
+
note: "Pick a .glb or .gltf file in the Settings panel."
|
|
6490
|
+
}) : /* @__PURE__ */ u("div", {
|
|
6491
|
+
ref: _,
|
|
6492
|
+
style: C
|
|
6493
|
+
});
|
|
6494
|
+
if (x) return /* @__PURE__ */ u("div", {
|
|
6495
|
+
ref: _,
|
|
6496
|
+
style: {
|
|
6497
|
+
...C,
|
|
6498
|
+
display: "flex",
|
|
6499
|
+
alignItems: "center",
|
|
6500
|
+
justifyContent: "center"
|
|
6501
|
+
},
|
|
6502
|
+
children: t ? /* @__PURE__ */ u("img", {
|
|
6503
|
+
src: t,
|
|
6504
|
+
alt: n || "",
|
|
6505
|
+
style: {
|
|
6506
|
+
maxWidth: "100%",
|
|
6507
|
+
maxHeight: "100%"
|
|
6508
|
+
}
|
|
6509
|
+
}) : null
|
|
6510
|
+
});
|
|
6511
|
+
let w = (e) => e ? "" : void 0, T = o !== !1;
|
|
6512
|
+
return /* @__PURE__ */ u("model-viewer", {
|
|
6513
|
+
ref: _,
|
|
6514
|
+
src: e,
|
|
6515
|
+
alt: n || "A 3D model",
|
|
6516
|
+
poster: t || void 0,
|
|
6517
|
+
style: C,
|
|
6518
|
+
"camera-controls": w(!v && l !== !1),
|
|
6519
|
+
"auto-rotate": w(T && !Xr()),
|
|
6520
|
+
"auto-rotate-delay": T ? String(ei(s, 0)) : void 0,
|
|
6521
|
+
"rotation-per-second": "18deg",
|
|
6522
|
+
ar: w(!v && d === !0),
|
|
6523
|
+
"ar-modes": "webxr scene-viewer quick-look",
|
|
6524
|
+
"shadow-intensity": String(ti(p, 100)),
|
|
6525
|
+
exposure: String(ti(f, 100)),
|
|
6526
|
+
"field-of-view": m ? `${Number(m)}deg` : void 0,
|
|
6527
|
+
"environment-image": h && h !== "neutral" ? h : "neutral",
|
|
6528
|
+
"interaction-prompt": v ? "none" : void 0,
|
|
6529
|
+
loading: "lazy",
|
|
6530
|
+
"touch-action": "pan-y",
|
|
6531
|
+
children: t ? /* @__PURE__ */ u("img", {
|
|
6532
|
+
slot: "poster",
|
|
6533
|
+
src: t,
|
|
6534
|
+
alt: n || "",
|
|
6535
|
+
style: {
|
|
6536
|
+
width: "100%",
|
|
6537
|
+
height: "100%",
|
|
6538
|
+
objectFit: "contain"
|
|
6539
|
+
}
|
|
6540
|
+
}) : null
|
|
6541
|
+
});
|
|
6542
|
+
}
|
|
6543
|
+
var oi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), si = [
|
|
6544
|
+
"precision highp float;",
|
|
6545
|
+
"uniform vec2 u_res;",
|
|
6546
|
+
"uniform float u_time;",
|
|
6547
|
+
"uniform vec2 u_mouse;",
|
|
6548
|
+
"uniform vec3 u_a;",
|
|
6549
|
+
"uniform vec3 u_b;",
|
|
6550
|
+
"uniform vec3 u_c;",
|
|
6551
|
+
"uniform float u_scale;",
|
|
6552
|
+
"",
|
|
6553
|
+
"float hash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); }",
|
|
6554
|
+
"float noise(vec2 p){",
|
|
6555
|
+
" vec2 i = floor(p); vec2 f = fract(p);",
|
|
6556
|
+
" vec2 u = f * f * (3.0 - 2.0 * f);",
|
|
6557
|
+
" return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x),",
|
|
6558
|
+
" mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x), u.y);",
|
|
6559
|
+
"}",
|
|
6560
|
+
"float fbm(vec2 p){",
|
|
6561
|
+
" float v = 0.0; float a = 0.5;",
|
|
6562
|
+
" for (int i = 0; i < 5; i++) { v += a * noise(p); p *= 2.02; a *= 0.5; }",
|
|
6563
|
+
" return v;",
|
|
6564
|
+
"}",
|
|
6565
|
+
""
|
|
6566
|
+
].join("\n"), ci = {
|
|
6567
|
+
gradient: [
|
|
6568
|
+
"void main(){",
|
|
6569
|
+
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
6570
|
+
" vec2 sp = (gl_FragCoord.xy - 0.5 * u_res) / min(u_res.x, u_res.y);",
|
|
6571
|
+
" float t = u_time * 0.25;",
|
|
6572
|
+
" float d1 = length(sp - vec2(sin(t) * 0.4, cos(t * 0.8) * 0.3) - u_mouse * 0.25);",
|
|
6573
|
+
" float d2 = length(sp + vec2(cos(t * 1.1) * 0.45, sin(t * 0.7) * 0.35));",
|
|
6574
|
+
" vec3 col = mix(u_a, u_b, smoothstep(0.0, 1.0, d1 * u_scale));",
|
|
6575
|
+
" col = mix(col, u_c, smoothstep(0.0, 1.2, d2 * u_scale) * 0.65);",
|
|
6576
|
+
" gl_FragColor = vec4(col, 1.0);",
|
|
6577
|
+
"}"
|
|
6578
|
+
].join("\n"),
|
|
6579
|
+
waves: [
|
|
6580
|
+
"void main(){",
|
|
6581
|
+
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
6582
|
+
" float t = u_time * 0.5;",
|
|
6583
|
+
" float y = uv.y * u_scale;",
|
|
6584
|
+
" float w = sin((uv.x * 6.0) + t) * 0.08 + sin((uv.x * 11.0) - (t * 1.3)) * 0.05;",
|
|
6585
|
+
" float band = smoothstep(0.0, 1.0, y + w + (u_mouse.y * 0.1));",
|
|
6586
|
+
" vec3 col = mix(u_a, u_b, band);",
|
|
6587
|
+
" col += u_c * (0.12 * smoothstep(0.02, 0.0, abs(y + w - 0.5)));",
|
|
6588
|
+
" gl_FragColor = vec4(col, 1.0);",
|
|
6589
|
+
"}"
|
|
6590
|
+
].join("\n"),
|
|
6591
|
+
plasma: [
|
|
6592
|
+
"void main(){",
|
|
6593
|
+
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
6594
|
+
" vec2 p = (uv - 0.5) * u_scale * 3.0 + u_mouse * 0.3;",
|
|
6595
|
+
" float t = u_time * 0.2;",
|
|
6596
|
+
" float n = fbm(p + vec2(fbm(p + t), fbm(p - t)));",
|
|
6597
|
+
" vec3 col = mix(u_a, u_b, smoothstep(0.25, 0.75, n));",
|
|
6598
|
+
" col = mix(col, u_c, smoothstep(0.6, 0.95, n));",
|
|
6599
|
+
" gl_FragColor = vec4(col, 1.0);",
|
|
6600
|
+
"}"
|
|
6601
|
+
].join("\n"),
|
|
6602
|
+
grid: [
|
|
6603
|
+
"void main(){",
|
|
6604
|
+
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
6605
|
+
" vec2 sp = (gl_FragCoord.xy - 0.5 * u_res) / min(u_res.x, u_res.y);",
|
|
6606
|
+
" float t = u_time * 0.15;",
|
|
6607
|
+
" vec2 g = sp * (8.0 * u_scale);",
|
|
6608
|
+
" g.y += t;",
|
|
6609
|
+
" vec2 f = abs(fract(g) - 0.5);",
|
|
6610
|
+
" float line = smoothstep(0.48, 0.5, max(f.x, f.y));",
|
|
6611
|
+
" float glow = 1.0 - smoothstep(0.0, 0.9, length(sp - u_mouse * 0.4));",
|
|
6612
|
+
" vec3 col = mix(u_a, u_b, line);",
|
|
6613
|
+
" col += u_c * glow * 0.35;",
|
|
6614
|
+
" gl_FragColor = vec4(col, 1.0);",
|
|
6615
|
+
"}"
|
|
6616
|
+
].join("\n")
|
|
6617
|
+
};
|
|
6618
|
+
function li(e, t) {
|
|
6619
|
+
let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
|
|
6620
|
+
if (!n) return t;
|
|
6621
|
+
let r = parseInt(n[1], 16);
|
|
6622
|
+
return [
|
|
6623
|
+
(r >> 16 & 255) / 255,
|
|
6624
|
+
(r >> 8 & 255) / 255,
|
|
6625
|
+
(r & 255) / 255
|
|
6626
|
+
];
|
|
6627
|
+
}
|
|
6628
|
+
function ui(e, t, n) {
|
|
6629
|
+
let r = e.createShader(t);
|
|
6630
|
+
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
6631
|
+
let t = e.getShaderInfoLog(r);
|
|
6632
|
+
throw e.deleteShader(r), Error(t || "Shader failed to compile");
|
|
6633
|
+
}
|
|
6634
|
+
return r;
|
|
6635
|
+
}
|
|
6636
|
+
function di({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, scale: l, height: f, interactive: p, style: m, nodeRef: h, inert: g }) {
|
|
6637
|
+
let _ = s(null), v = s(null), y = s(null), [b, x] = c("");
|
|
6638
|
+
i(() => () => {
|
|
6639
|
+
let e = y.current;
|
|
6640
|
+
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
6641
|
+
}, []);
|
|
6642
|
+
let S = typeof t == "string" && t.trim() ? t : ci[e] ?? ci.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(a ?? ""), E = ti(o, 100), D = Math.max(.05, ti(l, 100));
|
|
6643
|
+
return i(() => {
|
|
6644
|
+
let e = _.current, t = v.current;
|
|
6645
|
+
if (!e || !t) return;
|
|
6646
|
+
let n = y.current ??= e.getContext("webgl", {
|
|
6647
|
+
antialias: !0,
|
|
6648
|
+
alpha: !0,
|
|
6649
|
+
premultipliedAlpha: !1
|
|
6650
|
+
});
|
|
6651
|
+
if (!n) {
|
|
6652
|
+
x("WebGL is not available in this browser");
|
|
6653
|
+
return;
|
|
6654
|
+
}
|
|
6655
|
+
let r = null;
|
|
6656
|
+
try {
|
|
6657
|
+
let e = ui(n, n.VERTEX_SHADER, oi), t = ui(n, n.FRAGMENT_SHADER, si + S);
|
|
6658
|
+
if (r = n.createProgram(), n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) throw Error(n.getProgramInfoLog(r) || "Link failed");
|
|
6659
|
+
x("");
|
|
6660
|
+
} catch (e) {
|
|
6661
|
+
x(e?.message || "Shader failed to compile");
|
|
6662
|
+
return;
|
|
6663
|
+
}
|
|
6664
|
+
n.useProgram(r);
|
|
6665
|
+
let i = n.createBuffer();
|
|
6666
|
+
n.bindBuffer(n.ARRAY_BUFFER, i), n.bufferData(n.ARRAY_BUFFER, new Float32Array([
|
|
6667
|
+
-1,
|
|
6668
|
+
-1,
|
|
6669
|
+
3,
|
|
6670
|
+
-1,
|
|
6671
|
+
-1,
|
|
6672
|
+
3
|
|
6673
|
+
]), n.STATIC_DRAW);
|
|
6674
|
+
let a = n.getAttribLocation(r, "p");
|
|
6675
|
+
n.enableVertexAttribArray(a), n.vertexAttribPointer(a, 2, n.FLOAT, !1, 0, 0);
|
|
6676
|
+
let o = (e) => n.getUniformLocation(r, e), s = {
|
|
6677
|
+
res: o("u_res"),
|
|
6678
|
+
time: o("u_time"),
|
|
6679
|
+
mouse: o("u_mouse"),
|
|
6680
|
+
a: o("u_a"),
|
|
6681
|
+
b: o("u_b"),
|
|
6682
|
+
c: o("u_c"),
|
|
6683
|
+
scale: o("u_scale")
|
|
6684
|
+
}, c = {
|
|
6685
|
+
x: 0,
|
|
6686
|
+
y: 0
|
|
6687
|
+
}, l = (t) => {
|
|
6688
|
+
let n = e.getBoundingClientRect();
|
|
6689
|
+
!n.width || !n.height || (c.x = ((t.clientX - n.left) / n.width - .5) * 2, c.y = (.5 - (t.clientY - n.top) / n.height) * 2);
|
|
6690
|
+
};
|
|
6691
|
+
p !== !1 && t.addEventListener("pointermove", l);
|
|
6692
|
+
let u = () => {
|
|
6693
|
+
let r = Zr(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
6694
|
+
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
6695
|
+
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6696
|
+
d?.observe(t), u();
|
|
6697
|
+
let f = Xr(), m = {
|
|
6698
|
+
a: li(C, [
|
|
6699
|
+
.35,
|
|
6700
|
+
.4,
|
|
6701
|
+
.95
|
|
6702
|
+
]),
|
|
6703
|
+
b: li(w, [
|
|
6704
|
+
.05,
|
|
6705
|
+
.06,
|
|
6706
|
+
.16
|
|
6707
|
+
]),
|
|
6708
|
+
c: li(T, [
|
|
6709
|
+
.95,
|
|
6710
|
+
.35,
|
|
6711
|
+
.6
|
|
6712
|
+
])
|
|
6713
|
+
}, h = {};
|
|
6714
|
+
return h.stop = Qr(t, (t, r) => {
|
|
6715
|
+
u(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (f ? 0 : r) * E), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, D), n.drawArrays(n.TRIANGLES, 0, 3), f && h.stop?.();
|
|
6716
|
+
}), () => {
|
|
6717
|
+
h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
|
|
6718
|
+
};
|
|
6719
|
+
}, [
|
|
6720
|
+
S,
|
|
6721
|
+
C,
|
|
6722
|
+
w,
|
|
6723
|
+
T,
|
|
6724
|
+
E,
|
|
6725
|
+
D,
|
|
6726
|
+
p
|
|
6727
|
+
]), /* @__PURE__ */ d("div", {
|
|
6728
|
+
ref: (e) => {
|
|
6729
|
+
v.current = e, typeof h == "function" && h(e);
|
|
6730
|
+
},
|
|
6731
|
+
style: {
|
|
6732
|
+
position: "relative",
|
|
6733
|
+
minHeight: ei(f, 320),
|
|
6734
|
+
overflow: "hidden",
|
|
6735
|
+
...A(m)
|
|
6736
|
+
},
|
|
6737
|
+
children: [/* @__PURE__ */ u("canvas", {
|
|
6738
|
+
ref: _,
|
|
6739
|
+
style: {
|
|
6740
|
+
display: "block",
|
|
6741
|
+
width: "100%",
|
|
6742
|
+
height: "100%",
|
|
6743
|
+
position: "absolute",
|
|
6744
|
+
inset: 0
|
|
6745
|
+
}
|
|
6746
|
+
}), b && g ? /* @__PURE__ */ u("div", {
|
|
6747
|
+
style: {
|
|
6748
|
+
position: "absolute",
|
|
6749
|
+
inset: 0,
|
|
6750
|
+
display: "flex",
|
|
6751
|
+
alignItems: "center",
|
|
6752
|
+
justifyContent: "center",
|
|
6753
|
+
padding: 12,
|
|
6754
|
+
background: "rgba(15,23,42,.75)",
|
|
6755
|
+
...q,
|
|
6756
|
+
color: "#fecaca",
|
|
6757
|
+
fontSize: 11,
|
|
6758
|
+
whiteSpace: "pre-wrap",
|
|
6759
|
+
overflow: "auto"
|
|
6760
|
+
},
|
|
6761
|
+
children: b
|
|
6762
|
+
}) : null]
|
|
6763
|
+
});
|
|
6764
|
+
}
|
|
6765
|
+
function fi(e, t) {
|
|
6766
|
+
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
6767
|
+
r.deleteAttribute("uv");
|
|
6768
|
+
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
6769
|
+
side: e.BackSide,
|
|
6770
|
+
color: 6710886
|
|
6771
|
+
}));
|
|
6772
|
+
i.scale.setScalar(12), n.add(i);
|
|
6773
|
+
let a = (t, i, a, o, s, c, l, u) => {
|
|
6774
|
+
let d = new e.Mesh(r, new e.MeshBasicMaterial());
|
|
6775
|
+
d.material.color.setHex(t), d.material.color.multiplyScalar(i), d.position.set(a, o, s), d.scale.set(c, l, u), n.add(d);
|
|
6776
|
+
};
|
|
6777
|
+
a(16777215, 4, 0, 6, 0, 10, .5, 10), a(16777215, 1.4, -6, 1, 2, .4, 6, 6), a(16777215, 1, 6, 1, -2, .4, 6, 6);
|
|
6778
|
+
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
6779
|
+
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
6780
|
+
}
|
|
6781
|
+
var pi = /* @__PURE__ */ new Map();
|
|
6782
|
+
function mi(e) {
|
|
6783
|
+
if (pi.has(e)) return pi.get(e);
|
|
6784
|
+
let t = Jr("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
|
|
6785
|
+
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
6786
|
+
})).catch((t) => {
|
|
6787
|
+
throw pi.delete(e), t;
|
|
6788
|
+
});
|
|
6789
|
+
return pi.set(e, t), t;
|
|
6790
|
+
}
|
|
6791
|
+
function hi(e, t) {
|
|
6792
|
+
let n = new e.Box3().setFromObject(t);
|
|
6793
|
+
if (n.isEmpty()) return t;
|
|
6794
|
+
let r = n.getSize(new e.Vector3()), i = n.getCenter(new e.Vector3()), a = Math.max(r.x, r.y, r.z) || 1, o = new e.Group();
|
|
6795
|
+
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
6796
|
+
}
|
|
6797
|
+
var gi = {
|
|
6798
|
+
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
6799
|
+
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
6800
|
+
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
6801
|
+
knot: (e) => new e.TorusKnotGeometry(.44, .15, 128, 24),
|
|
6802
|
+
cone: (e) => new e.ConeGeometry(.55, 1.1, 48),
|
|
6803
|
+
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
6804
|
+
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
6805
|
+
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
6806
|
+
}, _i = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
6807
|
+
function vi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: a, spinSpeed: o, controls: l, ground: d, height: f, style: p, nodeRef: m, inert: h }) {
|
|
6808
|
+
let g = s(null), [_, v] = c(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = a !== !1 && !Xr(), S = l !== !1 && !h;
|
|
6809
|
+
return i(() => {
|
|
6810
|
+
let e = g.current;
|
|
6811
|
+
if (!e) return;
|
|
6812
|
+
let i = !0, a = null;
|
|
6813
|
+
return qr().then((s) => {
|
|
6814
|
+
if (!i || !e) return;
|
|
6815
|
+
let c = new s.WebGLRenderer({
|
|
6816
|
+
antialias: !0,
|
|
6817
|
+
alpha: !t
|
|
6818
|
+
});
|
|
6819
|
+
c.setPixelRatio(Zr()), c.shadowMap.enabled = d !== !1, c.shadowMap.type = s.PCFSoftShadowMap, c.outputColorSpace = s.SRGBColorSpace, c.toneMapping = s.ACESFilmicToneMapping, c.domElement.style.display = "block", c.domElement.style.width = "100%", c.domElement.style.height = "100%", e.appendChild(c.domElement);
|
|
6820
|
+
let l = new s.Scene();
|
|
6821
|
+
t && (l.background = new s.Color(t)), l.environment = fi(s, c);
|
|
6822
|
+
let u = new s.PerspectiveCamera(_i(r, 45), 1, .1, 400), f = $r(u, c.domElement, {
|
|
6823
|
+
distance: _i(n, 5),
|
|
6824
|
+
enableZoom: S
|
|
6825
|
+
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
6826
|
+
p.position.set(4, 7, 5), p.castShadow = d !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, l.add(p, new s.AmbientLight(16777215, .35));
|
|
6827
|
+
let m = [], h = new s.Group(), g = (e, t) => {
|
|
6828
|
+
let n = _i(t.scale, 1);
|
|
6829
|
+
e.position.set(_i(t.x, 0), _i(t.y, 0), _i(t.z, 0)), e.rotation.set(ni(t.rx), ni(t.ry), ni(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = ni(t.spin);
|
|
6830
|
+
};
|
|
6831
|
+
for (let e of y) {
|
|
6832
|
+
if (e.shape === "model") {
|
|
6833
|
+
if (!ri(e.src)) continue;
|
|
6834
|
+
let t = new s.Group();
|
|
6835
|
+
g(t, e), h.add(t), mi(e.src).then((e) => {
|
|
6836
|
+
if (!i) return;
|
|
6837
|
+
let n = hi(s, e.clone(!0));
|
|
6838
|
+
n.traverse((e) => {
|
|
6839
|
+
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
6840
|
+
}), t.add(n);
|
|
6841
|
+
}, () => {});
|
|
6842
|
+
continue;
|
|
6843
|
+
}
|
|
6844
|
+
let t = (gi[e.shape] ?? gi.box)(s), n = new s.MeshStandardMaterial({
|
|
6845
|
+
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
6846
|
+
metalness: Math.min(1, Math.max(0, ti(e.metalness, 10))),
|
|
6847
|
+
roughness: Math.min(1, Math.max(0, ti(e.roughness, 35))),
|
|
6848
|
+
transparent: ti(e.opacity, 100) < 1,
|
|
6849
|
+
opacity: Math.min(1, Math.max(0, ti(e.opacity, 100))),
|
|
6850
|
+
flatShading: e.flat === !0,
|
|
6851
|
+
wireframe: e.wireframe === !0,
|
|
6852
|
+
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
6853
|
+
}), r = new s.Mesh(t, n);
|
|
6854
|
+
g(r, e), r.castShadow = !0, r.receiveShadow = !0, h.add(r), m.push(t, n);
|
|
6855
|
+
}
|
|
6856
|
+
l.add(h);
|
|
6857
|
+
let _ = null;
|
|
6858
|
+
if (d !== !1) {
|
|
6859
|
+
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
6860
|
+
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = _i(d === !0 ? 0 : d, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
|
|
6861
|
+
}
|
|
6862
|
+
let v = () => {
|
|
6863
|
+
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
6864
|
+
c.setSize(t, n, !1), u.aspect = t / n, u.updateProjectionMatrix();
|
|
6865
|
+
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
6866
|
+
b?.observe(e), v();
|
|
6867
|
+
let C = ni(Number.isFinite(Number(o)) ? o : 20), w = Qr(e, (e) => {
|
|
6868
|
+
f.autoSpin(x ? C : 0, e), f.update();
|
|
6869
|
+
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
6870
|
+
c.render(l, u);
|
|
6871
|
+
});
|
|
6872
|
+
a = () => {
|
|
6873
|
+
w(), b?.disconnect(), f.dispose();
|
|
6874
|
+
for (let e of m) e.dispose?.();
|
|
6875
|
+
l.environment?.dispose?.(), c.dispose(), c.domElement.remove();
|
|
6876
|
+
};
|
|
6877
|
+
}, () => {
|
|
6878
|
+
i && v(!0);
|
|
6879
|
+
}), () => {
|
|
6880
|
+
i = !1, a?.();
|
|
6881
|
+
};
|
|
6882
|
+
}, [
|
|
6883
|
+
b,
|
|
6884
|
+
t,
|
|
6885
|
+
n,
|
|
6886
|
+
r,
|
|
6887
|
+
x,
|
|
6888
|
+
o,
|
|
6889
|
+
S,
|
|
6890
|
+
d
|
|
6891
|
+
]), _ && h ? /* @__PURE__ */ u(ii, {
|
|
6892
|
+
nodeRef: m,
|
|
6893
|
+
style: p,
|
|
6894
|
+
height: f,
|
|
6895
|
+
label: "3D Scene",
|
|
6896
|
+
note: "The 3D engine could not be loaded. Check the connection and try again."
|
|
6897
|
+
}) : /* @__PURE__ */ u("div", {
|
|
6898
|
+
ref: (e) => {
|
|
6899
|
+
g.current = e, typeof m == "function" && m(e);
|
|
6900
|
+
},
|
|
6901
|
+
style: {
|
|
6902
|
+
minHeight: ei(f, 380),
|
|
6903
|
+
height: ei(f, 380),
|
|
6904
|
+
overflow: "hidden",
|
|
6905
|
+
touchAction: S ? "pan-y" : void 0,
|
|
6906
|
+
...A(p)
|
|
6907
|
+
}
|
|
6908
|
+
});
|
|
6909
|
+
}
|
|
6910
|
+
function yi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o }) {
|
|
6911
|
+
let l = s(null), [d, f] = c("");
|
|
6912
|
+
return i(() => {
|
|
6913
|
+
let t = l.current;
|
|
6914
|
+
if (o || !t || typeof e != "string" || !e.trim()) return;
|
|
6915
|
+
let r = !0, i = null;
|
|
6916
|
+
return qr().then((a) => {
|
|
6917
|
+
if (!r || !t) return;
|
|
6918
|
+
let o = new a.WebGLRenderer({
|
|
6919
|
+
antialias: !0,
|
|
6920
|
+
alpha: !n
|
|
6921
|
+
});
|
|
6922
|
+
o.setPixelRatio(Zr()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
6923
|
+
let s = new a.Scene();
|
|
6924
|
+
n && (s.background = new a.Color(n));
|
|
6925
|
+
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
6926
|
+
c.position.set(0, 1.2, 4);
|
|
6927
|
+
let l = null;
|
|
6928
|
+
try {
|
|
6929
|
+
l = Function("ctx", `"use strict";\n${e}`)({
|
|
6930
|
+
THREE: a,
|
|
6931
|
+
scene: s,
|
|
6932
|
+
camera: c,
|
|
6933
|
+
renderer: o,
|
|
6934
|
+
canvas: o.domElement,
|
|
6935
|
+
host: t
|
|
6936
|
+
});
|
|
6937
|
+
} catch (e) {
|
|
6938
|
+
f(e?.message || String(e));
|
|
6939
|
+
}
|
|
6940
|
+
let u = () => {
|
|
6941
|
+
let e = Math.max(1, t.clientWidth), n = Math.max(1, t.clientHeight);
|
|
6942
|
+
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
6943
|
+
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6944
|
+
d?.observe(t), u();
|
|
6945
|
+
let p = !1, m = Qr(t, (e, t) => {
|
|
6946
|
+
if (!p && typeof l?.frame == "function") try {
|
|
6947
|
+
l.frame(e, t);
|
|
6948
|
+
} catch (e) {
|
|
6949
|
+
p = !0, f(e?.message || String(e));
|
|
6950
|
+
}
|
|
6951
|
+
o.render(s, c);
|
|
6952
|
+
});
|
|
6953
|
+
i = () => {
|
|
6954
|
+
m(), d?.disconnect();
|
|
6955
|
+
try {
|
|
6956
|
+
l?.dispose?.();
|
|
6957
|
+
} catch {}
|
|
6958
|
+
o.dispose(), o.domElement.remove();
|
|
6959
|
+
};
|
|
6960
|
+
}), () => {
|
|
6961
|
+
r = !1, i?.();
|
|
6962
|
+
};
|
|
6963
|
+
}, [
|
|
6964
|
+
e,
|
|
6965
|
+
o,
|
|
6966
|
+
n
|
|
6967
|
+
]), o ? /* @__PURE__ */ u(ii, {
|
|
6968
|
+
nodeRef: a,
|
|
6969
|
+
style: r,
|
|
6970
|
+
height: t,
|
|
6971
|
+
label: "three.js",
|
|
6972
|
+
note: typeof e == "string" && e.trim() ? "Custom scene code runs in Preview and on the published page." : "Open the code editor in the Settings panel to write your scene."
|
|
6973
|
+
}) : /* @__PURE__ */ u("div", {
|
|
6974
|
+
ref: (e) => {
|
|
6975
|
+
l.current = e, typeof a == "function" && a(e);
|
|
6976
|
+
},
|
|
6977
|
+
style: {
|
|
6978
|
+
minHeight: ei(t, 380),
|
|
6979
|
+
height: ei(t, 380),
|
|
6980
|
+
overflow: "hidden",
|
|
6981
|
+
position: "relative",
|
|
6982
|
+
touchAction: "pan-y",
|
|
6983
|
+
...A(r)
|
|
6984
|
+
},
|
|
6985
|
+
children: d ? /* @__PURE__ */ u("div", {
|
|
6986
|
+
style: {
|
|
6987
|
+
position: "absolute",
|
|
6988
|
+
left: 8,
|
|
6989
|
+
top: 8,
|
|
6990
|
+
right: 8,
|
|
6991
|
+
padding: "6px 8px",
|
|
6992
|
+
borderRadius: 6,
|
|
6993
|
+
background: "rgba(127,29,29,.85)",
|
|
6994
|
+
...q,
|
|
6995
|
+
color: "#fee2e2",
|
|
6996
|
+
fontSize: 11
|
|
6997
|
+
},
|
|
6998
|
+
children: d
|
|
6999
|
+
}) : null
|
|
7000
|
+
});
|
|
7001
|
+
}
|
|
7002
|
+
var bi = {
|
|
7003
|
+
ModelViewerBlock: ai,
|
|
7004
|
+
ShaderBlock: di,
|
|
7005
|
+
SceneBlock: vi,
|
|
7006
|
+
ThreeCanvasBlock: yi
|
|
7007
|
+
}, xi = /* @__PURE__ */ new Map();
|
|
7008
|
+
function Si(e) {
|
|
7009
|
+
if (xi.has(e)) return xi.get(e);
|
|
6314
7010
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
6315
7011
|
/* @vite-ignore */
|
|
6316
7012
|
/* webpackIgnore: true */
|
|
6317
7013
|
t
|
|
6318
7014
|
).finally(() => URL.revokeObjectURL(t));
|
|
6319
|
-
return
|
|
7015
|
+
return xi.set(e, n), n;
|
|
6320
7016
|
}
|
|
6321
|
-
function
|
|
7017
|
+
function Ci(e) {
|
|
6322
7018
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
6323
7019
|
return n && typeof n == "object" ? n : {};
|
|
6324
7020
|
}
|
|
6325
7021
|
//#endregion
|
|
6326
7022
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
6327
|
-
async function
|
|
6328
|
-
let n = await
|
|
7023
|
+
async function wi(e, t) {
|
|
7024
|
+
let n = await Si(e);
|
|
6329
7025
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
6330
7026
|
}
|
|
6331
|
-
var
|
|
7027
|
+
var Ti = {
|
|
6332
7028
|
padding: "10px 12px",
|
|
6333
7029
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
6334
7030
|
borderRadius: 8,
|
|
6335
7031
|
fontSize: 12,
|
|
6336
7032
|
opacity: .6
|
|
6337
7033
|
};
|
|
6338
|
-
function
|
|
6339
|
-
let c = r(
|
|
7034
|
+
function Ei({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
7035
|
+
let c = r(Z), l = Ci(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
6340
7036
|
tenant: c?.tenant ?? "",
|
|
6341
7037
|
apiUrl: c?.apiUrl ?? "/api",
|
|
6342
7038
|
locale: c?.locale ?? "",
|
|
@@ -6348,7 +7044,7 @@ function zr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
6348
7044
|
let e = f.current;
|
|
6349
7045
|
if (!l?.code || !e) return;
|
|
6350
7046
|
let n = !0;
|
|
6351
|
-
return
|
|
7047
|
+
return wi(l.code, t).then((e) => {
|
|
6352
7048
|
if (!(!n || !e || !f.current)) {
|
|
6353
7049
|
p.current = e;
|
|
6354
7050
|
try {
|
|
@@ -6378,7 +7074,7 @@ function zr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
6378
7074
|
}) : /* @__PURE__ */ d("div", {
|
|
6379
7075
|
ref: o,
|
|
6380
7076
|
style: {
|
|
6381
|
-
...
|
|
7077
|
+
...Ti,
|
|
6382
7078
|
...A(a)
|
|
6383
7079
|
},
|
|
6384
7080
|
children: [
|
|
@@ -6390,12 +7086,13 @@ function zr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
6390
7086
|
}
|
|
6391
7087
|
//#endregion
|
|
6392
7088
|
//#region ../ui/src/components/builder/render.jsx
|
|
6393
|
-
var
|
|
6394
|
-
...
|
|
6395
|
-
...
|
|
6396
|
-
|
|
7089
|
+
var Di = {
|
|
7090
|
+
...ar,
|
|
7091
|
+
...Rr,
|
|
7092
|
+
...bi,
|
|
7093
|
+
PluginBlock: Ei
|
|
6397
7094
|
};
|
|
6398
|
-
function
|
|
7095
|
+
function Oi(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
6399
7096
|
let o = n[t];
|
|
6400
7097
|
if (!o || o.hidden) return null;
|
|
6401
7098
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -6403,11 +7100,11 @@ function Vr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
6403
7100
|
let n = o.props?.componentId, s = r?.[n];
|
|
6404
7101
|
if (!s?.template || i.has(n)) return null;
|
|
6405
7102
|
let c = new Set(i).add(n);
|
|
6406
|
-
return /* @__PURE__ */ u(e, { children:
|
|
7103
|
+
return /* @__PURE__ */ u(e, { children: Oi(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
6407
7104
|
}
|
|
6408
|
-
let l =
|
|
7105
|
+
let l = Di[s];
|
|
6409
7106
|
if (!l) return null;
|
|
6410
|
-
let d = (o.nodes ?? []).map((e) =>
|
|
7107
|
+
let d = (o.nodes ?? []).map((e) => Oi(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Oi(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
6411
7108
|
...c,
|
|
6412
7109
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
6413
7110
|
linked: p,
|
|
@@ -6416,16 +7113,16 @@ function Vr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
6416
7113
|
},
|
|
6417
7114
|
children: d.length ? d : void 0
|
|
6418
7115
|
}, t);
|
|
6419
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
7116
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(hr, {
|
|
6420
7117
|
when: c.when,
|
|
6421
7118
|
children: m
|
|
6422
7119
|
}, t) : m;
|
|
6423
7120
|
}
|
|
6424
7121
|
//#endregion
|
|
6425
7122
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
6426
|
-
var
|
|
6427
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
6428
|
-
function
|
|
7123
|
+
var ki = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ai = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ue(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
7124
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(ue(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
7125
|
+
function ji({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, animations: c, tenant: l, apiUrl: f, datasets: p, locale: m, direction: h, settings: _, siteUser: v }) {
|
|
6429
7126
|
let b = s?.js?.trim();
|
|
6430
7127
|
if (i(() => {
|
|
6431
7128
|
if (!b) return;
|
|
@@ -6434,40 +7131,40 @@ function Wr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
6434
7131
|
}, [b]), !e?.ROOT) return null;
|
|
6435
7132
|
let x = {
|
|
6436
7133
|
lang: m || void 0,
|
|
6437
|
-
dir:
|
|
7134
|
+
dir: X(h, m)
|
|
6438
7135
|
}, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
|
|
6439
7136
|
minHeight: "100%",
|
|
6440
7137
|
display: "flex",
|
|
6441
7138
|
flexDirection: "column"
|
|
6442
|
-
}, w =
|
|
7139
|
+
}, w = Oi("ROOT", e, n), T = o(() => ({ render: (t, r) => Oi(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = G(e, n), O = re(e, n), k = s?.css?.trim(), A = E(c), j = le(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !oe[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
|
|
6443
7140
|
rel: "stylesheet",
|
|
6444
7141
|
precedence: "default",
|
|
6445
7142
|
href: g(e)
|
|
6446
|
-
}, e)), P =
|
|
6447
|
-
return r === "auto" ? /* @__PURE__ */ u(
|
|
7143
|
+
}, e)), P = Ai(j);
|
|
7144
|
+
return r === "auto" ? /* @__PURE__ */ u(Z.Provider, {
|
|
6448
7145
|
value: {
|
|
6449
7146
|
tenant: l || "",
|
|
6450
7147
|
apiUrl: f || "/api",
|
|
6451
7148
|
locale: m || "",
|
|
6452
7149
|
settings: _ ?? null
|
|
6453
7150
|
},
|
|
6454
|
-
children: /* @__PURE__ */ u(
|
|
7151
|
+
children: /* @__PURE__ */ u(mr, {
|
|
6455
7152
|
initialUser: v,
|
|
6456
|
-
children: /* @__PURE__ */ u(
|
|
7153
|
+
children: /* @__PURE__ */ u(xe.Provider, {
|
|
6457
7154
|
value: p ?? null,
|
|
6458
|
-
children: /* @__PURE__ */ u(
|
|
7155
|
+
children: /* @__PURE__ */ u(we.Provider, {
|
|
6459
7156
|
value: T,
|
|
6460
7157
|
children: /* @__PURE__ */ d("div", {
|
|
6461
7158
|
...x,
|
|
6462
7159
|
className: "webim-page",
|
|
6463
7160
|
style: {
|
|
6464
7161
|
...C,
|
|
6465
|
-
...
|
|
7162
|
+
...de(t),
|
|
6466
7163
|
...a
|
|
6467
7164
|
},
|
|
6468
7165
|
children: [
|
|
6469
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
6470
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
7166
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${ki(ue(j.light))} }
|
|
7167
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${ki(ue(j.dark))} } }` }),
|
|
6471
7168
|
/* @__PURE__ */ u("style", { children: P }),
|
|
6472
7169
|
N,
|
|
6473
7170
|
/* @__PURE__ */ u("style", { children: S }),
|
|
@@ -6480,25 +7177,25 @@ function Wr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
6480
7177
|
})
|
|
6481
7178
|
})
|
|
6482
7179
|
})
|
|
6483
|
-
}) : /* @__PURE__ */ u(
|
|
7180
|
+
}) : /* @__PURE__ */ u(Z.Provider, {
|
|
6484
7181
|
value: {
|
|
6485
7182
|
tenant: l || "",
|
|
6486
7183
|
apiUrl: f || "/api",
|
|
6487
7184
|
locale: m || "",
|
|
6488
7185
|
settings: _ ?? null
|
|
6489
7186
|
},
|
|
6490
|
-
children: /* @__PURE__ */ u(
|
|
7187
|
+
children: /* @__PURE__ */ u(mr, {
|
|
6491
7188
|
initialUser: v,
|
|
6492
|
-
children: /* @__PURE__ */ u(
|
|
7189
|
+
children: /* @__PURE__ */ u(xe.Provider, {
|
|
6493
7190
|
value: p ?? null,
|
|
6494
|
-
children: /* @__PURE__ */ u(
|
|
7191
|
+
children: /* @__PURE__ */ u(we.Provider, {
|
|
6495
7192
|
value: T,
|
|
6496
7193
|
children: /* @__PURE__ */ d("div", {
|
|
6497
7194
|
...x,
|
|
6498
7195
|
className: "webim-page",
|
|
6499
7196
|
style: {
|
|
6500
7197
|
...C,
|
|
6501
|
-
...
|
|
7198
|
+
...me(t, r),
|
|
6502
7199
|
...a
|
|
6503
7200
|
},
|
|
6504
7201
|
children: [
|
|
@@ -6520,8 +7217,8 @@ function Wr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
6520
7217
|
}
|
|
6521
7218
|
//#endregion
|
|
6522
7219
|
//#region src/WebimContent.jsx
|
|
6523
|
-
function
|
|
6524
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
7220
|
+
function Mi({ bundle: e, mode: t = "auto", style: n }) {
|
|
7221
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(ji, {
|
|
6525
7222
|
blocks: e.blocks,
|
|
6526
7223
|
theme: e.theme,
|
|
6527
7224
|
components: e.components,
|
|
@@ -6533,13 +7230,13 @@ function Gr({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
6533
7230
|
locale: e.locale,
|
|
6534
7231
|
direction: e.direction,
|
|
6535
7232
|
settings: e.settings,
|
|
6536
|
-
mode:
|
|
7233
|
+
mode: ge(t, e.scheme),
|
|
6537
7234
|
style: n
|
|
6538
7235
|
}) : null;
|
|
6539
7236
|
}
|
|
6540
7237
|
//#endregion
|
|
6541
7238
|
//#region src/WebimPage.jsx
|
|
6542
|
-
function
|
|
7239
|
+
function Ni({ 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 }) {
|
|
6543
7240
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
6544
7241
|
onLoad: m,
|
|
6545
7242
|
onError: h
|
|
@@ -6549,7 +7246,7 @@ function Kr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
6549
7246
|
onError: h
|
|
6550
7247
|
}, i(() => {
|
|
6551
7248
|
let i = !0;
|
|
6552
|
-
return _({ status: "loading" }),
|
|
7249
|
+
return _({ status: "loading" }), ye({
|
|
6553
7250
|
apiUrl: e,
|
|
6554
7251
|
tenant: t,
|
|
6555
7252
|
slug: n,
|
|
@@ -6576,11 +7273,11 @@ function Kr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
6576
7273
|
r,
|
|
6577
7274
|
a,
|
|
6578
7275
|
o
|
|
6579
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
7276
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Mi, {
|
|
6580
7277
|
bundle: g.bundle,
|
|
6581
7278
|
mode: l,
|
|
6582
7279
|
style: d
|
|
6583
7280
|
});
|
|
6584
7281
|
}
|
|
6585
7282
|
//#endregion
|
|
6586
|
-
export {
|
|
7283
|
+
export { ji as PageRenderer, Mi as WebimContent, Ni as WebimPage, ye as fetchPage, Ze as renderRichContent, he as resolveTheme };
|