webim-adapter 1.1.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +1268 -607
- package/build/webim-embed.js +13 -7
- package/build/webim-ssr.js +1380 -719
- package/package.json +1 -1
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,
|
|
@@ -1377,7 +1411,7 @@ function pt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1377
1411
|
type: "button",
|
|
1378
1412
|
"aria-label": "Previous slide",
|
|
1379
1413
|
style: {
|
|
1380
|
-
...
|
|
1414
|
+
...ht,
|
|
1381
1415
|
left: 12
|
|
1382
1416
|
},
|
|
1383
1417
|
onClick: () => b(y - 1),
|
|
@@ -1387,7 +1421,7 @@ function pt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1387
1421
|
type: "button",
|
|
1388
1422
|
"aria-label": "Next slide",
|
|
1389
1423
|
style: {
|
|
1390
|
-
...
|
|
1424
|
+
...ht,
|
|
1391
1425
|
right: 12
|
|
1392
1426
|
},
|
|
1393
1427
|
onClick: () => b(y + 1),
|
|
@@ -1421,7 +1455,7 @@ function pt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1421
1455
|
] })]
|
|
1422
1456
|
});
|
|
1423
1457
|
}
|
|
1424
|
-
var
|
|
1458
|
+
var yt = (e, t) => ({
|
|
1425
1459
|
position: "absolute",
|
|
1426
1460
|
inset: 0,
|
|
1427
1461
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1429,18 +1463,18 @@ var mt = (e, t) => ({
|
|
|
1429
1463
|
backgroundSize: "cover",
|
|
1430
1464
|
backgroundPosition: "center"
|
|
1431
1465
|
});
|
|
1432
|
-
function
|
|
1433
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1466
|
+
function bt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1467
|
+
return e.length ? /* @__PURE__ */ u(vt, {
|
|
1434
1468
|
...r,
|
|
1435
1469
|
count: e.length,
|
|
1436
1470
|
renderSlide: (r) => {
|
|
1437
1471
|
let i = e[r];
|
|
1438
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1472
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: yt(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
|
|
1439
1473
|
style: {
|
|
1440
1474
|
position: "absolute",
|
|
1441
1475
|
color: "#fff",
|
|
1442
1476
|
textAlign: n,
|
|
1443
|
-
...
|
|
1477
|
+
...gt[t] ?? gt.bottom
|
|
1444
1478
|
},
|
|
1445
1479
|
children: [i.title && /* @__PURE__ */ u("div", {
|
|
1446
1480
|
style: {
|
|
@@ -1460,13 +1494,13 @@ function ht({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1460
1494
|
}
|
|
1461
1495
|
}) : null;
|
|
1462
1496
|
}
|
|
1463
|
-
function
|
|
1464
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1497
|
+
function xt({ slides: e = [], linked: t, ...n }) {
|
|
1498
|
+
return e.length ? /* @__PURE__ */ u(vt, {
|
|
1465
1499
|
...n,
|
|
1466
1500
|
count: e.length,
|
|
1467
1501
|
renderSlide: (n) => {
|
|
1468
1502
|
let r = e[n];
|
|
1469
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1503
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: yt(r.image, r.color) }), /* @__PURE__ */ u("div", {
|
|
1470
1504
|
style: {
|
|
1471
1505
|
position: "absolute",
|
|
1472
1506
|
inset: 0,
|
|
@@ -1478,23 +1512,23 @@ function gt({ slides: e = [], linked: t, ...n }) {
|
|
|
1478
1512
|
}
|
|
1479
1513
|
}) : null;
|
|
1480
1514
|
}
|
|
1481
|
-
var
|
|
1482
|
-
let r =
|
|
1515
|
+
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) => {
|
|
1516
|
+
let r = St * 2 ** n;
|
|
1483
1517
|
return {
|
|
1484
1518
|
x: (Number(t) + 180) / 360 * r,
|
|
1485
|
-
y: (.5 -
|
|
1519
|
+
y: (.5 - Ct(Number(e)) / (2 * Math.PI)) * r
|
|
1486
1520
|
};
|
|
1487
1521
|
}, $ = (e, t) => {
|
|
1488
1522
|
if (e === "" || e == null) return null;
|
|
1489
1523
|
let n = Number(e);
|
|
1490
1524
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1491
|
-
},
|
|
1492
|
-
function
|
|
1525
|
+
}, Tt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1526
|
+
function Et(e, t, n = "directions", r = "") {
|
|
1493
1527
|
let i = `${e},${t}`;
|
|
1494
1528
|
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
1529
|
}
|
|
1496
|
-
var
|
|
1497
|
-
function
|
|
1530
|
+
var Dt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1531
|
+
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
1532
|
let _ = s(null), [v, y] = c(1200);
|
|
1499
1533
|
i(() => {
|
|
1500
1534
|
let e = _.current;
|
|
@@ -1504,7 +1538,7 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1504
1538
|
let n = new ResizeObserver(t);
|
|
1505
1539
|
return n.observe(e), () => n.disconnect();
|
|
1506
1540
|
}, []);
|
|
1507
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1541
|
+
let b = (Array.isArray(e) ? e : []).filter(Tt), x = Tt({
|
|
1508
1542
|
lat: t,
|
|
1509
1543
|
lng: n
|
|
1510
1544
|
}) ? {
|
|
@@ -1516,7 +1550,7 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1516
1550
|
} : null, S = Math.max(80, Number(a) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1517
1551
|
if (b.length < 2) return 13;
|
|
1518
1552
|
for (let e = 19; e >= 1; e--) {
|
|
1519
|
-
let t = b.map((t) =>
|
|
1553
|
+
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
1554
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1521
1555
|
}
|
|
1522
1556
|
return 1;
|
|
@@ -1540,12 +1574,12 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1540
1574
|
},
|
|
1541
1575
|
children: "Set the coordinates in Settings"
|
|
1542
1576
|
});
|
|
1543
|
-
let T =
|
|
1577
|
+
let T = wt(x.lat, x.lng, C), E = {
|
|
1544
1578
|
x: T.x - v / 2,
|
|
1545
1579
|
y: T.y - S / 2
|
|
1546
1580
|
}, D = [], O = [];
|
|
1547
|
-
for (let e = Math.floor(E.x /
|
|
1548
|
-
for (let e = Math.floor(E.y /
|
|
1581
|
+
for (let e = Math.floor(E.x / St); e <= Math.floor((E.x + v) / St); e++) D.push(e);
|
|
1582
|
+
for (let e = Math.floor(E.y / St); e <= Math.floor((E.y + S) / St); e++) O.push(e);
|
|
1549
1583
|
let k = 2 ** C;
|
|
1550
1584
|
return /* @__PURE__ */ d("div", {
|
|
1551
1585
|
ref: (e) => {
|
|
@@ -1568,22 +1602,22 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1568
1602
|
return e < 0 || e >= k ? null : /* @__PURE__ */ u("img", {
|
|
1569
1603
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1570
1604
|
alt: "",
|
|
1571
|
-
width:
|
|
1572
|
-
height:
|
|
1605
|
+
width: St,
|
|
1606
|
+
height: St,
|
|
1573
1607
|
loading: "lazy",
|
|
1574
1608
|
style: {
|
|
1575
1609
|
position: "absolute",
|
|
1576
|
-
left: Math.round(t *
|
|
1577
|
-
top: Math.round(e *
|
|
1578
|
-
width:
|
|
1579
|
-
height:
|
|
1610
|
+
left: Math.round(t * St - E.x),
|
|
1611
|
+
top: Math.round(e * St - E.y),
|
|
1612
|
+
width: St,
|
|
1613
|
+
height: St,
|
|
1580
1614
|
userSelect: "none",
|
|
1581
1615
|
pointerEvents: "none"
|
|
1582
1616
|
}
|
|
1583
1617
|
}, `${t}-${e}`);
|
|
1584
1618
|
})),
|
|
1585
1619
|
b.map((e, t) => {
|
|
1586
|
-
let n =
|
|
1620
|
+
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
1621
|
return /* @__PURE__ */ d(s ? "a" : "span", {
|
|
1588
1622
|
href: s || void 0,
|
|
1589
1623
|
target: s ? "_blank" : void 0,
|
|
@@ -1622,8 +1656,8 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1622
1656
|
viewBox: "0 0 24 24",
|
|
1623
1657
|
fill: a,
|
|
1624
1658
|
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:
|
|
1659
|
+
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", {
|
|
1660
|
+
d: kt[e.icon],
|
|
1627
1661
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1628
1662
|
fill: "none",
|
|
1629
1663
|
stroke: "#fff",
|
|
@@ -1659,7 +1693,7 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1659
1693
|
})
|
|
1660
1694
|
]
|
|
1661
1695
|
}), f ? /* @__PURE__ */ u("a", {
|
|
1662
|
-
href:
|
|
1696
|
+
href: Dt(x.lat, x.lng, C),
|
|
1663
1697
|
target: "_blank",
|
|
1664
1698
|
rel: "noopener noreferrer",
|
|
1665
1699
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1673,7 +1707,7 @@ function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1673
1707
|
}) : null]
|
|
1674
1708
|
});
|
|
1675
1709
|
}
|
|
1676
|
-
var
|
|
1710
|
+
var kt = {
|
|
1677
1711
|
check: "M4 12l5 5L20 6",
|
|
1678
1712
|
close: "M6 6l12 12M18 6L6 18",
|
|
1679
1713
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1770,8 +1804,8 @@ var wt = {
|
|
|
1770
1804
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1771
1805
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1772
1806
|
};
|
|
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 : [
|
|
1807
|
+
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 }) {
|
|
1808
|
+
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
1809
|
viewBox: "0 0 24 24",
|
|
1776
1810
|
width: g,
|
|
1777
1811
|
height: g,
|
|
@@ -1807,10 +1841,10 @@ function Tt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1807
1841
|
children: v
|
|
1808
1842
|
});
|
|
1809
1843
|
}
|
|
1810
|
-
function
|
|
1811
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
1844
|
+
function jt(e, t = {}, n = 0) {
|
|
1845
|
+
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
1846
|
for (let e of r) {
|
|
1813
|
-
let n = e.data ?? e, r =
|
|
1847
|
+
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
1848
|
for (let e of s) if (o.push({
|
|
1815
1849
|
src: e,
|
|
1816
1850
|
name: c,
|
|
@@ -1820,8 +1854,8 @@ function Et(e, t = {}, n = 0) {
|
|
|
1820
1854
|
}
|
|
1821
1855
|
return o;
|
|
1822
1856
|
}
|
|
1823
|
-
function
|
|
1824
|
-
let { tenant: x, apiUrl: S } = r(
|
|
1857
|
+
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 }) {
|
|
1858
|
+
let { tenant: x, apiUrl: S } = r(Z), C = r(xe)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
|
|
1825
1859
|
i(() => {
|
|
1826
1860
|
if (!t || C) return;
|
|
1827
1861
|
let e = !0;
|
|
@@ -1838,7 +1872,7 @@ function Dt({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
1838
1872
|
C
|
|
1839
1873
|
]);
|
|
1840
1874
|
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 =
|
|
1875
|
+
let e = jt(k, {
|
|
1842
1876
|
imageField: a,
|
|
1843
1877
|
nameField: o,
|
|
1844
1878
|
hrefField: s
|
|
@@ -2043,20 +2077,20 @@ function Dt({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
2043
2077
|
]
|
|
2044
2078
|
});
|
|
2045
2079
|
}
|
|
2046
|
-
var
|
|
2080
|
+
var Nt = {
|
|
2047
2081
|
color: "inherit",
|
|
2048
2082
|
textDecoration: "none",
|
|
2049
2083
|
fontSize: 14,
|
|
2050
2084
|
opacity: .85
|
|
2051
|
-
},
|
|
2085
|
+
}, Pt = {
|
|
2052
2086
|
background: "var(--page-surface, #f2f2f2)",
|
|
2053
2087
|
color: "var(--page-text, #111827)",
|
|
2054
2088
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
2055
2089
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
2056
2090
|
zIndex: 60
|
|
2057
2091
|
};
|
|
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 ? "" :
|
|
2092
|
+
function Ft(e, t = {}, n = "dropdown") {
|
|
2093
|
+
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
2094
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
2061
2095
|
return {
|
|
2062
2096
|
key: e.id,
|
|
@@ -2097,8 +2131,8 @@ function At(e, t = {}, n = "dropdown") {
|
|
|
2097
2131
|
type: e.children.length ? n : "link"
|
|
2098
2132
|
}));
|
|
2099
2133
|
}
|
|
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(
|
|
2134
|
+
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" }) {
|
|
2135
|
+
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
2136
|
i(() => {
|
|
2103
2137
|
if (!g || P) return;
|
|
2104
2138
|
let e = !0;
|
|
@@ -2118,7 +2152,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2118
2152
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2119
2153
|
return e.observe(C), () => e.disconnect();
|
|
2120
2154
|
}, [C, h]);
|
|
2121
|
-
let L = g ?
|
|
2155
|
+
let L = g ? Ft(P ?? F ?? [], {
|
|
2122
2156
|
labelField: _,
|
|
2123
2157
|
hrefField: v,
|
|
2124
2158
|
imageField: y,
|
|
@@ -2147,7 +2181,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2147
2181
|
return /* @__PURE__ */ d("a", {
|
|
2148
2182
|
href: e.href || "#",
|
|
2149
2183
|
style: {
|
|
2150
|
-
...
|
|
2184
|
+
...Nt,
|
|
2151
2185
|
display: n ? "block" : "flex",
|
|
2152
2186
|
alignItems: n ? void 0 : "center",
|
|
2153
2187
|
gap: n ? void 0 : 10,
|
|
@@ -2244,7 +2278,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2244
2278
|
let t = e.children ?? [];
|
|
2245
2279
|
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
2246
2280
|
href: e.href || "#",
|
|
2247
|
-
style:
|
|
2281
|
+
style: Nt,
|
|
2248
2282
|
children: e.label
|
|
2249
2283
|
}, e.key);
|
|
2250
2284
|
let n = e.type === "mega";
|
|
@@ -2258,7 +2292,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2258
2292
|
children: [/* @__PURE__ */ d("a", {
|
|
2259
2293
|
href: e.href || "#",
|
|
2260
2294
|
style: {
|
|
2261
|
-
...
|
|
2295
|
+
...Nt,
|
|
2262
2296
|
cursor: "pointer"
|
|
2263
2297
|
},
|
|
2264
2298
|
children: [
|
|
@@ -2274,7 +2308,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2274
2308
|
]
|
|
2275
2309
|
}), k === e.key && (n ? /* @__PURE__ */ u("div", {
|
|
2276
2310
|
style: {
|
|
2277
|
-
...
|
|
2311
|
+
...Pt,
|
|
2278
2312
|
position: "absolute",
|
|
2279
2313
|
left: 0,
|
|
2280
2314
|
right: 0,
|
|
@@ -2290,7 +2324,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2290
2324
|
}, !0))
|
|
2291
2325
|
}) : /* @__PURE__ */ u("div", {
|
|
2292
2326
|
style: {
|
|
2293
|
-
...
|
|
2327
|
+
...Pt,
|
|
2294
2328
|
position: "absolute",
|
|
2295
2329
|
top: "100%",
|
|
2296
2330
|
left: 0,
|
|
@@ -2319,7 +2353,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2319
2353
|
children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
2320
2354
|
href: t.href || "#",
|
|
2321
2355
|
style: {
|
|
2322
|
-
...
|
|
2356
|
+
...Nt,
|
|
2323
2357
|
padding: "10px 4px",
|
|
2324
2358
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
2325
2359
|
opacity: 1
|
|
@@ -2330,7 +2364,7 @@ function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2330
2364
|
]
|
|
2331
2365
|
});
|
|
2332
2366
|
}
|
|
2333
|
-
function
|
|
2367
|
+
function Lt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2334
2368
|
let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2335
2369
|
return e.length ? /* @__PURE__ */ d("div", {
|
|
2336
2370
|
ref: r,
|
|
@@ -2370,13 +2404,13 @@ function Mt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2370
2404
|
}, e.key))]
|
|
2371
2405
|
}) : null;
|
|
2372
2406
|
}
|
|
2373
|
-
function
|
|
2407
|
+
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
2408
|
let [g, _] = c(() => new Set(e.length ? [e[0].key] : []));
|
|
2375
2409
|
if (!e.length) return null;
|
|
2376
2410
|
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2377
2411
|
let n = Number(e);
|
|
2378
2412
|
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2379
|
-
}, b =
|
|
2413
|
+
}, b = kt[r], x = (e) => _((t) => {
|
|
2380
2414
|
let r = new Set(n ? t : []);
|
|
2381
2415
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2382
2416
|
});
|
|
@@ -2451,15 +2485,15 @@ function Nt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
|
|
|
2451
2485
|
})
|
|
2452
2486
|
});
|
|
2453
2487
|
}
|
|
2454
|
-
var
|
|
2488
|
+
var zt = {
|
|
2455
2489
|
display: "flex",
|
|
2456
2490
|
flexDirection: "column",
|
|
2457
2491
|
gap: "12px"
|
|
2458
|
-
},
|
|
2492
|
+
}, Bt = {
|
|
2459
2493
|
fontSize: "14px",
|
|
2460
2494
|
fontWeight: 500,
|
|
2461
2495
|
color: "var(--page-text, #111827)"
|
|
2462
|
-
},
|
|
2496
|
+
}, Vt = {
|
|
2463
2497
|
padding: "10px 12px",
|
|
2464
2498
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2465
2499
|
borderRadius: "6px",
|
|
@@ -2469,18 +2503,18 @@ var Pt = {
|
|
|
2469
2503
|
boxSizing: "border-box",
|
|
2470
2504
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2471
2505
|
color: "var(--page-text, #111827)"
|
|
2472
|
-
},
|
|
2506
|
+
}, Ht = {
|
|
2473
2507
|
display: "flex",
|
|
2474
2508
|
alignItems: "center",
|
|
2475
2509
|
gap: "8px",
|
|
2476
2510
|
fontSize: "14px",
|
|
2477
2511
|
color: "var(--page-text, #111827)"
|
|
2478
|
-
},
|
|
2512
|
+
}, Ut = (e) => e ? {
|
|
2479
2513
|
readOnly: !0,
|
|
2480
2514
|
tabIndex: -1,
|
|
2481
2515
|
onMouseDown: (e) => e.preventDefault()
|
|
2482
2516
|
} : {};
|
|
2483
|
-
function
|
|
2517
|
+
function Wt(e, t) {
|
|
2484
2518
|
if (!e) return !0;
|
|
2485
2519
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2486
2520
|
switch (e.op) {
|
|
@@ -2494,11 +2528,11 @@ function zt(e, t) {
|
|
|
2494
2528
|
default: return !1;
|
|
2495
2529
|
}
|
|
2496
2530
|
}
|
|
2497
|
-
var
|
|
2531
|
+
var Gt = {
|
|
2498
2532
|
display: "flex",
|
|
2499
2533
|
flexDirection: "column",
|
|
2500
2534
|
gap: 6
|
|
2501
|
-
},
|
|
2535
|
+
}, Kt = {
|
|
2502
2536
|
font: "inherit",
|
|
2503
2537
|
fontSize: 15,
|
|
2504
2538
|
padding: "10px 12px",
|
|
@@ -2509,17 +2543,17 @@ var Bt = {
|
|
|
2509
2543
|
width: "100%",
|
|
2510
2544
|
boxSizing: "border-box"
|
|
2511
2545
|
};
|
|
2512
|
-
function
|
|
2546
|
+
function qt(e, t) {
|
|
2513
2547
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2514
2548
|
if (!e?.parentField) return n;
|
|
2515
2549
|
let r = t?.[e.parentField];
|
|
2516
2550
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2517
2551
|
}
|
|
2518
|
-
var
|
|
2519
|
-
function
|
|
2552
|
+
var Jt = "g-recaptcha-response", Yt = (e) => e?.type === "recaptcha" ? Jt : e?.name;
|
|
2553
|
+
function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2520
2554
|
let a = /* @__PURE__ */ d("span", {
|
|
2521
2555
|
style: {
|
|
2522
|
-
...
|
|
2556
|
+
...Bt,
|
|
2523
2557
|
fontSize: 14
|
|
2524
2558
|
},
|
|
2525
2559
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2528,7 +2562,7 @@ function Gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2528
2562
|
required: e.required || void 0,
|
|
2529
2563
|
placeholder: e.placeholder || void 0,
|
|
2530
2564
|
disabled: r || void 0,
|
|
2531
|
-
style:
|
|
2565
|
+
style: Kt,
|
|
2532
2566
|
value: t ?? "",
|
|
2533
2567
|
onChange: (t) => n(e.name, t.target.value)
|
|
2534
2568
|
};
|
|
@@ -2557,12 +2591,12 @@ function Gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2557
2591
|
borderRadius: 8,
|
|
2558
2592
|
display: "block"
|
|
2559
2593
|
}
|
|
2560
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(
|
|
2594
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(tn, {
|
|
2561
2595
|
theme: e.captchaTheme,
|
|
2562
2596
|
size: e.captchaSize,
|
|
2563
2597
|
inert: r,
|
|
2564
|
-
onChange: (e) => n(
|
|
2565
|
-
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(
|
|
2598
|
+
onChange: (e) => n(Jt, e)
|
|
2599
|
+
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(lt, {
|
|
2566
2600
|
url: e.src,
|
|
2567
2601
|
style: { width: "100%" }
|
|
2568
2602
|
}) : /* @__PURE__ */ u("video", {
|
|
@@ -2574,14 +2608,14 @@ function Gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2574
2608
|
display: "block"
|
|
2575
2609
|
}
|
|
2576
2610
|
}) : null : /* @__PURE__ */ d("label", {
|
|
2577
|
-
style:
|
|
2611
|
+
style: Gt,
|
|
2578
2612
|
children: [
|
|
2579
2613
|
a,
|
|
2580
2614
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
|
|
2581
2615
|
...o,
|
|
2582
2616
|
rows: 4,
|
|
2583
2617
|
style: {
|
|
2584
|
-
...
|
|
2618
|
+
...Kt,
|
|
2585
2619
|
resize: "vertical"
|
|
2586
2620
|
}
|
|
2587
2621
|
}) : e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
@@ -2590,7 +2624,7 @@ function Gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2590
2624
|
children: [/* @__PURE__ */ u("option", {
|
|
2591
2625
|
value: "",
|
|
2592
2626
|
children: e.placeholder || "—"
|
|
2593
|
-
}),
|
|
2627
|
+
}), qt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
|
|
2594
2628
|
value: typeof e == "string" ? e : e.value,
|
|
2595
2629
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2596
2630
|
}, t))]
|
|
@@ -2637,8 +2671,8 @@ function Gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2637
2671
|
]
|
|
2638
2672
|
});
|
|
2639
2673
|
}
|
|
2640
|
-
function
|
|
2641
|
-
let { tenant: y, apiUrl: b } = r(
|
|
2674
|
+
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 }) {
|
|
2675
|
+
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
2676
|
i(() => {
|
|
2643
2677
|
if (!f || !s) return;
|
|
2644
2678
|
let e = !0;
|
|
@@ -2659,11 +2693,11 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2659
2693
|
section: e,
|
|
2660
2694
|
fields: []
|
|
2661
2695
|
}) : j[j.length - 1].fields.push(e);
|
|
2662
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
2696
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Wt(e.section.condition, T)).map((e) => ({
|
|
2663
2697
|
...e,
|
|
2664
|
-
fields: e.fields.filter((e) =>
|
|
2698
|
+
fields: e.fields.filter((e) => Wt(e.condition, T))
|
|
2665
2699
|
})), 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[
|
|
2700
|
+
let t = T[Yt(e)];
|
|
2667
2701
|
return e.required && (t == null || t === "" || t === !1);
|
|
2668
2702
|
}), R = F >= N.length - 1, z = (e, t) => E((n) => {
|
|
2669
2703
|
let r = {
|
|
@@ -2719,11 +2753,11 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2719
2753
|
}
|
|
2720
2754
|
},
|
|
2721
2755
|
style: {
|
|
2722
|
-
...
|
|
2756
|
+
...zt,
|
|
2723
2757
|
display: k === "success" ? "none" : "flex"
|
|
2724
2758
|
},
|
|
2725
2759
|
children: f && s ? /* @__PURE__ */ d(l, { children: [
|
|
2726
|
-
P && /* @__PURE__ */ u(
|
|
2760
|
+
P && /* @__PURE__ */ u(En, {
|
|
2727
2761
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2728
2762
|
active: F + 1,
|
|
2729
2763
|
style: { marginBottom: 8 }
|
|
@@ -2736,9 +2770,9 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2736
2770
|
},
|
|
2737
2771
|
children: N[F].section.help
|
|
2738
2772
|
}),
|
|
2739
|
-
I.map((e) => /* @__PURE__ */ u(
|
|
2773
|
+
I.map((e) => /* @__PURE__ */ u(Xt, {
|
|
2740
2774
|
field: e,
|
|
2741
|
-
value: T[
|
|
2775
|
+
value: T[Yt(e)],
|
|
2742
2776
|
values: T,
|
|
2743
2777
|
onChange: z,
|
|
2744
2778
|
inert: h
|
|
@@ -2755,7 +2789,7 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2755
2789
|
disabled: h || void 0,
|
|
2756
2790
|
onClick: () => O(F - 1),
|
|
2757
2791
|
style: {
|
|
2758
|
-
...
|
|
2792
|
+
...Pe,
|
|
2759
2793
|
background: "transparent",
|
|
2760
2794
|
color: "inherit",
|
|
2761
2795
|
border: 0,
|
|
@@ -2768,7 +2802,7 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2768
2802
|
disabled: h || L.length > 0,
|
|
2769
2803
|
onClick: () => O(F + 1),
|
|
2770
2804
|
style: {
|
|
2771
|
-
...
|
|
2805
|
+
...Pe,
|
|
2772
2806
|
border: 0,
|
|
2773
2807
|
padding: "10px 22px",
|
|
2774
2808
|
borderRadius: 8,
|
|
@@ -2782,7 +2816,7 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2782
2816
|
type: "submit",
|
|
2783
2817
|
disabled: h || void 0,
|
|
2784
2818
|
style: {
|
|
2785
|
-
...
|
|
2819
|
+
...Pe,
|
|
2786
2820
|
border: 0,
|
|
2787
2821
|
padding: "10px 22px",
|
|
2788
2822
|
borderRadius: 8,
|
|
@@ -2809,10 +2843,10 @@ function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2809
2843
|
]
|
|
2810
2844
|
});
|
|
2811
2845
|
}
|
|
2812
|
-
var
|
|
2846
|
+
var Qt = null, $t = null, en = (e) => {
|
|
2813
2847
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2814
|
-
if (
|
|
2815
|
-
if (
|
|
2848
|
+
if (Qt && $t === t) return Qt;
|
|
2849
|
+
if (Qt && typeof window < "u") {
|
|
2816
2850
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2817
2851
|
delete window[e];
|
|
2818
2852
|
} catch {
|
|
@@ -2820,22 +2854,22 @@ var qt = null, Jt = null, Yt = (e) => {
|
|
|
2820
2854
|
}
|
|
2821
2855
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2822
2856
|
}
|
|
2823
|
-
return
|
|
2857
|
+
return $t = t, Qt = new Promise((e) => {
|
|
2824
2858
|
if (typeof window > "u") return;
|
|
2825
2859
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2826
2860
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2827
2861
|
let n = document.createElement("script");
|
|
2828
2862
|
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
|
-
}),
|
|
2863
|
+
}), Qt;
|
|
2830
2864
|
};
|
|
2831
|
-
function
|
|
2832
|
-
let p = r(
|
|
2865
|
+
function tn({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
|
|
2866
|
+
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
2867
|
if (_.current = f, i(() => {
|
|
2834
2868
|
if (l || !h || !g.current) return;
|
|
2835
2869
|
let e = !0, r = (t) => {
|
|
2836
2870
|
e && typeof _.current == "function" && _.current(t);
|
|
2837
2871
|
};
|
|
2838
|
-
return
|
|
2872
|
+
return en(a).then((i) => {
|
|
2839
2873
|
if (!(!e || !g.current || !i?.render)) {
|
|
2840
2874
|
g.current.innerHTML = "", r("");
|
|
2841
2875
|
try {
|
|
@@ -2917,17 +2951,17 @@ function Xt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2917
2951
|
children: /* @__PURE__ */ u("div", { ref: g })
|
|
2918
2952
|
}) : null;
|
|
2919
2953
|
}
|
|
2920
|
-
function
|
|
2954
|
+
function nn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2921
2955
|
return /* @__PURE__ */ u("label", {
|
|
2922
2956
|
ref: r,
|
|
2923
2957
|
style: {
|
|
2924
|
-
...
|
|
2958
|
+
...Bt,
|
|
2925
2959
|
...A(n)
|
|
2926
2960
|
},
|
|
2927
|
-
children:
|
|
2961
|
+
children: Ge(t, e, i)
|
|
2928
2962
|
});
|
|
2929
2963
|
}
|
|
2930
|
-
function
|
|
2964
|
+
function rn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2931
2965
|
return /* @__PURE__ */ u("input", {
|
|
2932
2966
|
ref: a,
|
|
2933
2967
|
type: e,
|
|
@@ -2935,13 +2969,13 @@ function Qt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2935
2969
|
placeholder: n,
|
|
2936
2970
|
required: !o && !!r,
|
|
2937
2971
|
style: {
|
|
2938
|
-
...
|
|
2972
|
+
...Vt,
|
|
2939
2973
|
...A(i)
|
|
2940
2974
|
},
|
|
2941
|
-
...
|
|
2975
|
+
...Ut(o)
|
|
2942
2976
|
});
|
|
2943
2977
|
}
|
|
2944
|
-
function
|
|
2978
|
+
function an({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2945
2979
|
return /* @__PURE__ */ u("textarea", {
|
|
2946
2980
|
ref: a,
|
|
2947
2981
|
name: e || void 0,
|
|
@@ -2949,18 +2983,18 @@ function $t({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2949
2983
|
rows: n,
|
|
2950
2984
|
required: !o && !!r,
|
|
2951
2985
|
style: {
|
|
2952
|
-
...
|
|
2986
|
+
...Vt,
|
|
2953
2987
|
resize: "vertical",
|
|
2954
2988
|
...A(i)
|
|
2955
2989
|
},
|
|
2956
|
-
...
|
|
2990
|
+
...Ut(o)
|
|
2957
2991
|
});
|
|
2958
2992
|
}
|
|
2959
|
-
function
|
|
2993
|
+
function on({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2960
2994
|
return /* @__PURE__ */ d("label", {
|
|
2961
2995
|
ref: o,
|
|
2962
2996
|
style: {
|
|
2963
|
-
...
|
|
2997
|
+
...Ht,
|
|
2964
2998
|
...A(a)
|
|
2965
2999
|
},
|
|
2966
3000
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -2977,7 +3011,7 @@ function en({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2977
3011
|
}), t]
|
|
2978
3012
|
});
|
|
2979
3013
|
}
|
|
2980
|
-
function
|
|
3014
|
+
function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2981
3015
|
return /* @__PURE__ */ d("select", {
|
|
2982
3016
|
ref: a,
|
|
2983
3017
|
name: e || void 0,
|
|
@@ -2986,7 +3020,7 @@ function tn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2986
3020
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2987
3021
|
tabIndex: o ? -1 : void 0,
|
|
2988
3022
|
style: {
|
|
2989
|
-
...
|
|
3023
|
+
...Vt,
|
|
2990
3024
|
appearance: "auto",
|
|
2991
3025
|
...A(i)
|
|
2992
3026
|
},
|
|
@@ -3000,12 +3034,12 @@ function tn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
3000
3034
|
}, t))]
|
|
3001
3035
|
});
|
|
3002
3036
|
}
|
|
3003
|
-
function
|
|
3037
|
+
function cn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
3004
3038
|
let [s, l] = c(null);
|
|
3005
3039
|
return /* @__PURE__ */ d("label", {
|
|
3006
3040
|
ref: a,
|
|
3007
3041
|
style: {
|
|
3008
|
-
...
|
|
3042
|
+
...Vt,
|
|
3009
3043
|
display: "flex",
|
|
3010
3044
|
alignItems: "center",
|
|
3011
3045
|
gap: "8px",
|
|
@@ -3032,12 +3066,12 @@ function nn({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
3032
3066
|
]
|
|
3033
3067
|
});
|
|
3034
3068
|
}
|
|
3035
|
-
function
|
|
3069
|
+
function ln({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
3036
3070
|
return /* @__PURE__ */ u("button", {
|
|
3037
3071
|
ref: n,
|
|
3038
3072
|
type: r ? "button" : "submit",
|
|
3039
3073
|
style: {
|
|
3040
|
-
...
|
|
3074
|
+
...Pe,
|
|
3041
3075
|
border: 0,
|
|
3042
3076
|
cursor: "pointer",
|
|
3043
3077
|
alignSelf: "flex-start",
|
|
@@ -3052,7 +3086,7 @@ function rn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
3052
3086
|
children: e
|
|
3053
3087
|
});
|
|
3054
3088
|
}
|
|
3055
|
-
function
|
|
3089
|
+
function un({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
3056
3090
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
3057
3091
|
return /* @__PURE__ */ u("div", {
|
|
3058
3092
|
ref: r,
|
|
@@ -3069,8 +3103,8 @@ function an({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
3069
3103
|
}, t))
|
|
3070
3104
|
});
|
|
3071
3105
|
}
|
|
3072
|
-
function
|
|
3073
|
-
let { tenant: v, apiUrl: y, locale: b } = r(
|
|
3106
|
+
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: _ }) {
|
|
3107
|
+
let { tenant: v, apiUrl: y, locale: b } = r(Z), x = r(we), S = r(xe), [, C] = c(0);
|
|
3074
3108
|
i(() => {
|
|
3075
3109
|
if (typeof window > "u") return;
|
|
3076
3110
|
let e = () => C((e) => e + 1);
|
|
@@ -3078,7 +3112,7 @@ function on({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3078
3112
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
3079
3113
|
};
|
|
3080
3114
|
}, []);
|
|
3081
|
-
let w =
|
|
3115
|
+
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
3116
|
if (i(() => {
|
|
3083
3117
|
if (!e || D) return;
|
|
3084
3118
|
let n = !0, r = new URLSearchParams();
|
|
@@ -3123,7 +3157,7 @@ function on({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3123
3157
|
},
|
|
3124
3158
|
children: N.map((e) => /* @__PURE__ */ u("div", {
|
|
3125
3159
|
style: { minWidth: 0 },
|
|
3126
|
-
children: x.render(p, (t) =>
|
|
3160
|
+
children: x.render(p, (t) => ke(t, e))
|
|
3127
3161
|
}, e.id ?? e?.data?.slug))
|
|
3128
3162
|
}) : /* @__PURE__ */ u("div", {
|
|
3129
3163
|
ref: _,
|
|
@@ -3133,7 +3167,7 @@ function on({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3133
3167
|
...A(g)
|
|
3134
3168
|
},
|
|
3135
3169
|
children: N.map((e) => {
|
|
3136
|
-
let t = o ?
|
|
3170
|
+
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
3171
|
return /* @__PURE__ */ d("div", {
|
|
3138
3172
|
style: {
|
|
3139
3173
|
display: "flex",
|
|
@@ -3180,7 +3214,7 @@ function on({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3180
3214
|
lineHeight: 1.55,
|
|
3181
3215
|
opacity: .85
|
|
3182
3216
|
},
|
|
3183
|
-
children:
|
|
3217
|
+
children: Ze(a)
|
|
3184
3218
|
})
|
|
3185
3219
|
]
|
|
3186
3220
|
})]
|
|
@@ -3188,8 +3222,8 @@ function on({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3188
3222
|
})
|
|
3189
3223
|
});
|
|
3190
3224
|
}
|
|
3191
|
-
function
|
|
3192
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3225
|
+
function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3226
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Q(), s = {
|
|
3193
3227
|
height: 34,
|
|
3194
3228
|
padding: "0 12px",
|
|
3195
3229
|
borderRadius: 8,
|
|
@@ -3237,7 +3271,7 @@ function sn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3237
3271
|
name: `f_${e.name}`,
|
|
3238
3272
|
defaultValue: o[e.name] ?? "",
|
|
3239
3273
|
style: s,
|
|
3240
|
-
...
|
|
3274
|
+
...Ut(i),
|
|
3241
3275
|
children: [/* @__PURE__ */ u("option", {
|
|
3242
3276
|
value: "",
|
|
3243
3277
|
children: e.label || e.name
|
|
@@ -3252,7 +3286,7 @@ function sn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3252
3286
|
name: `f_${e.name}`,
|
|
3253
3287
|
defaultValue: o[e.name] ?? "",
|
|
3254
3288
|
style: s,
|
|
3255
|
-
...
|
|
3289
|
+
...Ut(i),
|
|
3256
3290
|
children: [
|
|
3257
3291
|
/* @__PURE__ */ u("option", {
|
|
3258
3292
|
value: "",
|
|
@@ -3273,7 +3307,7 @@ function sn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3273
3307
|
defaultValue: o[e.name] ?? "",
|
|
3274
3308
|
placeholder: e.label || e.name,
|
|
3275
3309
|
style: s,
|
|
3276
|
-
...
|
|
3310
|
+
...Ut(i)
|
|
3277
3311
|
}, e.name)), /* @__PURE__ */ u("button", {
|
|
3278
3312
|
type: "submit",
|
|
3279
3313
|
style: {
|
|
@@ -3286,12 +3320,12 @@ function sn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3286
3320
|
fontWeight: 600,
|
|
3287
3321
|
cursor: i ? "default" : "pointer"
|
|
3288
3322
|
},
|
|
3289
|
-
...
|
|
3323
|
+
...Ut(i),
|
|
3290
3324
|
children: t
|
|
3291
3325
|
})]
|
|
3292
3326
|
});
|
|
3293
3327
|
}
|
|
3294
|
-
function
|
|
3328
|
+
function pn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3295
3329
|
return e.length ? /* @__PURE__ */ u("nav", {
|
|
3296
3330
|
ref: r,
|
|
3297
3331
|
"aria-label": "Breadcrumb",
|
|
@@ -3341,8 +3375,8 @@ function cn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3341
3375
|
})
|
|
3342
3376
|
}) : null;
|
|
3343
3377
|
}
|
|
3344
|
-
function
|
|
3345
|
-
let { tenant: g, apiUrl: _ } = r(
|
|
3378
|
+
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 }) {
|
|
3379
|
+
let { tenant: g, apiUrl: _ } = r(Z), v = r(xe), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3346
3380
|
i(() => {
|
|
3347
3381
|
if (!o || Number.isFinite(x)) return;
|
|
3348
3382
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3361,7 +3395,7 @@ function ln({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3361
3395
|
]);
|
|
3362
3396
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
3363
3397
|
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 ?
|
|
3398
|
+
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
3399
|
if (o) {
|
|
3366
3400
|
if (typeof window < "u") {
|
|
3367
3401
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -3426,15 +3460,15 @@ function ln({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3426
3460
|
]
|
|
3427
3461
|
});
|
|
3428
3462
|
}
|
|
3429
|
-
var
|
|
3463
|
+
var hn = "webim.page_mode", gn = () => {
|
|
3430
3464
|
if (typeof window > "u") return "auto";
|
|
3431
3465
|
try {
|
|
3432
|
-
let e = window.localStorage.getItem(
|
|
3466
|
+
let e = window.localStorage.getItem(hn);
|
|
3433
3467
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3434
3468
|
} catch {
|
|
3435
3469
|
return "auto";
|
|
3436
3470
|
}
|
|
3437
|
-
},
|
|
3471
|
+
}, _n = (e) => {
|
|
3438
3472
|
let t = {
|
|
3439
3473
|
width: 16,
|
|
3440
3474
|
height: 16,
|
|
@@ -3466,13 +3500,13 @@ var un = "webim.page_mode", dn = () => {
|
|
|
3466
3500
|
rx: "2"
|
|
3467
3501
|
}), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
|
|
3468
3502
|
});
|
|
3469
|
-
},
|
|
3503
|
+
}, vn = {
|
|
3470
3504
|
light: "Light theme",
|
|
3471
3505
|
dark: "Dark theme",
|
|
3472
3506
|
auto: "Follow the device theme"
|
|
3473
3507
|
};
|
|
3474
|
-
function
|
|
3475
|
-
let [o, l] = c(a ? "auto" :
|
|
3508
|
+
function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
3509
|
+
let [o, l] = c(a ? "auto" : gn), d = s(null), f = (e) => {
|
|
3476
3510
|
d.current = e, typeof r == "function" && r(e);
|
|
3477
3511
|
};
|
|
3478
3512
|
i(() => {
|
|
@@ -3480,7 +3514,7 @@ function mn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3480
3514
|
let e = d.current?.closest?.(".webim-page");
|
|
3481
3515
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3482
3516
|
try {
|
|
3483
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3517
|
+
o === "auto" ? window.localStorage.removeItem(hn) : window.localStorage.setItem(hn, o);
|
|
3484
3518
|
} catch {}
|
|
3485
3519
|
}, [o, a]);
|
|
3486
3520
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3515,8 +3549,8 @@ function mn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3515
3549
|
},
|
|
3516
3550
|
children: p.map((e) => /* @__PURE__ */ u("button", {
|
|
3517
3551
|
type: "button",
|
|
3518
|
-
title:
|
|
3519
|
-
"aria-label":
|
|
3552
|
+
title: vn[e],
|
|
3553
|
+
"aria-label": vn[e],
|
|
3520
3554
|
"aria-pressed": e === m,
|
|
3521
3555
|
onClick: a ? void 0 : () => l(e),
|
|
3522
3556
|
style: {
|
|
@@ -3527,15 +3561,15 @@ function mn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3527
3561
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3528
3562
|
opacity: e === m ? 1 : .7
|
|
3529
3563
|
},
|
|
3530
|
-
children:
|
|
3564
|
+
children: _n(e)
|
|
3531
3565
|
}, e))
|
|
3532
3566
|
});
|
|
3533
3567
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3534
3568
|
return /* @__PURE__ */ u("button", {
|
|
3535
3569
|
ref: f,
|
|
3536
3570
|
type: "button",
|
|
3537
|
-
title:
|
|
3538
|
-
"aria-label": `Theme: ${
|
|
3571
|
+
title: vn[m],
|
|
3572
|
+
"aria-label": `Theme: ${vn[m]} — switch to ${vn[g]}`,
|
|
3539
3573
|
onClick: a ? void 0 : () => l(g),
|
|
3540
3574
|
style: {
|
|
3541
3575
|
...h,
|
|
@@ -3544,10 +3578,10 @@ function mn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3544
3578
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3545
3579
|
...A(n)
|
|
3546
3580
|
},
|
|
3547
|
-
children:
|
|
3581
|
+
children: _n(m)
|
|
3548
3582
|
});
|
|
3549
3583
|
}
|
|
3550
|
-
function
|
|
3584
|
+
function bn(e) {
|
|
3551
3585
|
let t = e?.parentElement;
|
|
3552
3586
|
for (; t && t !== document.body;) {
|
|
3553
3587
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3556,7 +3590,7 @@ function hn(e) {
|
|
|
3556
3590
|
}
|
|
3557
3591
|
return window;
|
|
3558
3592
|
}
|
|
3559
|
-
var
|
|
3593
|
+
var xn = (e) => e === window ? window.scrollY : e.scrollTop, Sn = {
|
|
3560
3594
|
"bottom-right": (e) => ({
|
|
3561
3595
|
right: e,
|
|
3562
3596
|
bottom: e
|
|
@@ -3571,7 +3605,7 @@ var gn = (e) => e === window ? window.scrollY : e.scrollTop, _n = {
|
|
|
3571
3605
|
transform: "translateX(-50%)"
|
|
3572
3606
|
})
|
|
3573
3607
|
};
|
|
3574
|
-
function
|
|
3608
|
+
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
3609
|
let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
|
|
3576
3610
|
b(e), typeof p == "function" && p(e);
|
|
3577
3611
|
};
|
|
@@ -3582,8 +3616,8 @@ function vn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3582
3616
|
}
|
|
3583
3617
|
if (!y) return;
|
|
3584
3618
|
let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
|
|
3585
|
-
let t =
|
|
3586
|
-
v(n ||
|
|
3619
|
+
let t = bn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
3620
|
+
v(n || xn(t) > e);
|
|
3587
3621
|
};
|
|
3588
3622
|
return t(), document.addEventListener("scroll", t, {
|
|
3589
3623
|
capture: !0,
|
|
@@ -3597,7 +3631,7 @@ function vn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3597
3631
|
]);
|
|
3598
3632
|
let S = () => {
|
|
3599
3633
|
if (m) return;
|
|
3600
|
-
let e =
|
|
3634
|
+
let e = bn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3601
3635
|
e === window ? window.scrollTo({
|
|
3602
3636
|
top: 0,
|
|
3603
3637
|
behavior: n
|
|
@@ -3605,7 +3639,7 @@ function vn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3605
3639
|
top: 0,
|
|
3606
3640
|
behavior: n
|
|
3607
3641
|
});
|
|
3608
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
3642
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = Sn[n] ? n : "bottom-right", D = h ? {
|
|
3609
3643
|
position: "fixed",
|
|
3610
3644
|
zIndex: 5,
|
|
3611
3645
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3618,7 +3652,7 @@ function vn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3618
3652
|
} : {
|
|
3619
3653
|
position: "fixed",
|
|
3620
3654
|
zIndex: 2147482e3,
|
|
3621
|
-
...
|
|
3655
|
+
...Sn[E](C)
|
|
3622
3656
|
};
|
|
3623
3657
|
return /* @__PURE__ */ d("button", {
|
|
3624
3658
|
ref: x,
|
|
@@ -3669,7 +3703,7 @@ function vn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3669
3703
|
}), w ? /* @__PURE__ */ u("span", { children: T }) : null]
|
|
3670
3704
|
});
|
|
3671
3705
|
}
|
|
3672
|
-
var
|
|
3706
|
+
var wn = {
|
|
3673
3707
|
facebook: {
|
|
3674
3708
|
label: "Facebook",
|
|
3675
3709
|
color: "#1877f2",
|
|
@@ -3736,8 +3770,8 @@ var yn = {
|
|
|
3736
3770
|
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
3771
|
}
|
|
3738
3772
|
};
|
|
3739
|
-
function
|
|
3740
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
3773
|
+
function Tn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
3774
|
+
let l = Array.isArray(e) ? e.filter((e) => e && wn[e.network]) : [];
|
|
3741
3775
|
if (!l.length) return null;
|
|
3742
3776
|
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
3777
|
return /* @__PURE__ */ u("div", {
|
|
@@ -3750,7 +3784,7 @@ function bn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3750
3784
|
...A(o)
|
|
3751
3785
|
},
|
|
3752
3786
|
children: l.map((e, r) => {
|
|
3753
|
-
let i =
|
|
3787
|
+
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
3788
|
return /* @__PURE__ */ u("a", {
|
|
3755
3789
|
href: e.url || "#",
|
|
3756
3790
|
onClick: h,
|
|
@@ -3784,7 +3818,7 @@ function bn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3784
3818
|
})
|
|
3785
3819
|
});
|
|
3786
3820
|
}
|
|
3787
|
-
function
|
|
3821
|
+
function En({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3788
3822
|
if (!t.length) return null;
|
|
3789
3823
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
3790
3824
|
width: 32,
|
|
@@ -3862,7 +3896,7 @@ function xn({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3862
3896
|
})
|
|
3863
3897
|
});
|
|
3864
3898
|
}
|
|
3865
|
-
var
|
|
3899
|
+
var Dn = {
|
|
3866
3900
|
small: {
|
|
3867
3901
|
w: 132,
|
|
3868
3902
|
h: 46,
|
|
@@ -3884,21 +3918,21 @@ var Sn = {
|
|
|
3884
3918
|
title: 12.5,
|
|
3885
3919
|
avatar: 46
|
|
3886
3920
|
}
|
|
3887
|
-
},
|
|
3888
|
-
|
|
3889
|
-
var
|
|
3921
|
+
}, On = (e) => Dn[e] ?? Dn.medium;
|
|
3922
|
+
Dn.medium.w, Dn.medium.h;
|
|
3923
|
+
var kn = (e) => String(e?.group ?? "").trim(), An = (e) => {
|
|
3890
3924
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
3891
3925
|
return e.forEach((e, r) => {
|
|
3892
|
-
let i =
|
|
3926
|
+
let i = kn(e) || `#${r}`;
|
|
3893
3927
|
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
3894
3928
|
}), t.flatMap((e) => n.get(e));
|
|
3895
3929
|
};
|
|
3896
|
-
function
|
|
3897
|
-
let i =
|
|
3930
|
+
function jn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
3931
|
+
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
3932
|
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 + (
|
|
3933
|
+
d = An(d);
|
|
3934
|
+
for (let [e, t] of u) u.set(e, An(t));
|
|
3935
|
+
let f = (e, t) => o + (kn(e) !== kn(t) && (kn(e) || kn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
3902
3936
|
if (t.has(e.id)) return 0;
|
|
3903
3937
|
t.add(e.id);
|
|
3904
3938
|
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 +3948,7 @@ function En(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
3914
3948
|
x: m,
|
|
3915
3949
|
y: b
|
|
3916
3950
|
});
|
|
3917
|
-
let x =
|
|
3951
|
+
let x = kn(e);
|
|
3918
3952
|
if (x) {
|
|
3919
3953
|
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
3920
3954
|
_.has(t) || _.set(t, {
|
|
@@ -3988,19 +4022,19 @@ function En(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
3988
4022
|
horizontal: n
|
|
3989
4023
|
};
|
|
3990
4024
|
}
|
|
3991
|
-
var
|
|
4025
|
+
var Mn = (e, t) => {
|
|
3992
4026
|
let n = String(e ?? "");
|
|
3993
4027
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3994
|
-
},
|
|
4028
|
+
}, Nn = (e) => {
|
|
3995
4029
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3996
4030
|
if (!t) return "#ffffff";
|
|
3997
4031
|
let n = t[1];
|
|
3998
4032
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3999
4033
|
let r = parseInt(n, 16);
|
|
4000
4034
|
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 ? "" :
|
|
4035
|
+
}, Pn = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
4036
|
+
function Fn(e, t = {}) {
|
|
4037
|
+
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
4038
|
return n.map((e) => {
|
|
4005
4039
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
4006
4040
|
return {
|
|
@@ -4015,11 +4049,11 @@ function An(e, t = {}) {
|
|
|
4015
4049
|
};
|
|
4016
4050
|
});
|
|
4017
4051
|
}
|
|
4018
|
-
var
|
|
4052
|
+
var In = {
|
|
4019
4053
|
size: 36,
|
|
4020
4054
|
pad: 10
|
|
4021
4055
|
};
|
|
4022
|
-
function
|
|
4056
|
+
function Ln({ node: e, onClose: t }) {
|
|
4023
4057
|
return i(() => {
|
|
4024
4058
|
let e = (e) => e.key === "Escape" && t();
|
|
4025
4059
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -4140,8 +4174,8 @@ function Mn({ node: e, onClose: t }) {
|
|
|
4140
4174
|
})
|
|
4141
4175
|
});
|
|
4142
4176
|
}
|
|
4143
|
-
function
|
|
4144
|
-
let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(
|
|
4177
|
+
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 }) {
|
|
4178
|
+
let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(Z), O = r(xe)?.[t], [k, j] = c(null);
|
|
4145
4179
|
i(() => {
|
|
4146
4180
|
if (!t || O) return;
|
|
4147
4181
|
let e = !0;
|
|
@@ -4157,7 +4191,7 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4157
4191
|
D,
|
|
4158
4192
|
O
|
|
4159
4193
|
]);
|
|
4160
|
-
let M = t ?
|
|
4194
|
+
let M = t ? Fn(O ?? k ?? [], {
|
|
4161
4195
|
nameField: n,
|
|
4162
4196
|
titleField: o,
|
|
4163
4197
|
photoField: s,
|
|
@@ -4165,7 +4199,7 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4165
4199
|
cvField: p,
|
|
4166
4200
|
hrefField: m,
|
|
4167
4201
|
groupField: h
|
|
4168
|
-
}) : e, N =
|
|
4202
|
+
}) : e, N = On(v), { boxes: P, links: F, groups: I, width: L, height: R } = jn(M, {
|
|
4169
4203
|
size: v,
|
|
4170
4204
|
horizontal: y,
|
|
4171
4205
|
groupTitles: g
|
|
@@ -4223,8 +4257,8 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4223
4257
|
fontSize: N.title + 1,
|
|
4224
4258
|
fontWeight: "600",
|
|
4225
4259
|
opacity: "0.55",
|
|
4226
|
-
fill: r ?
|
|
4227
|
-
children:
|
|
4260
|
+
fill: r ? Nn(e.color || _) : "var(--page-text, #111827)",
|
|
4261
|
+
children: Mn(e.title, Math.floor(e.width / 7))
|
|
4228
4262
|
})] }, `group-${t}`);
|
|
4229
4263
|
}),
|
|
4230
4264
|
F.map((e, t) => /* @__PURE__ */ u("path", {
|
|
@@ -4234,7 +4268,7 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4234
4268
|
strokeWidth: "1.5"
|
|
4235
4269
|
}, t)),
|
|
4236
4270
|
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 ?
|
|
4271
|
+
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
4272
|
return /* @__PURE__ */ d("g", {
|
|
4239
4273
|
onClick: f ? p : void 0,
|
|
4240
4274
|
style: f ? { cursor: "pointer" } : void 0,
|
|
@@ -4298,13 +4332,13 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4298
4332
|
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
4299
4333
|
id: `${C}-${e.id}`,
|
|
4300
4334
|
children: /* @__PURE__ */ u("circle", {
|
|
4301
|
-
cx: t +
|
|
4335
|
+
cx: t + In.pad + N.avatar / 2,
|
|
4302
4336
|
cy: n + N.h / 2,
|
|
4303
4337
|
r: N.avatar / 2
|
|
4304
4338
|
})
|
|
4305
4339
|
}), /* @__PURE__ */ u("image", {
|
|
4306
4340
|
href: e.photo,
|
|
4307
|
-
x: t +
|
|
4341
|
+
x: t + In.pad,
|
|
4308
4342
|
y: n + (N.h - N.avatar) / 2,
|
|
4309
4343
|
width: N.avatar,
|
|
4310
4344
|
height: N.avatar,
|
|
@@ -4318,7 +4352,7 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4318
4352
|
fontSize: N.title,
|
|
4319
4353
|
fontWeight: "600",
|
|
4320
4354
|
fill: s,
|
|
4321
|
-
children:
|
|
4355
|
+
children: Mn(e.title, g + 4)
|
|
4322
4356
|
}), e.name && /* @__PURE__ */ u("text", {
|
|
4323
4357
|
x: m,
|
|
4324
4358
|
y: n + _ + _ / 2 + N.name * .35,
|
|
@@ -4326,7 +4360,7 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4326
4360
|
fontSize: N.name,
|
|
4327
4361
|
fontWeight: "600",
|
|
4328
4362
|
fill: c,
|
|
4329
|
-
children:
|
|
4363
|
+
children: Mn(e.name, g)
|
|
4330
4364
|
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
4331
4365
|
x: m,
|
|
4332
4366
|
y: n + (v[1] ? N.h * .43 : N.h * .57),
|
|
@@ -4334,7 +4368,7 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4334
4368
|
fontSize: N.name,
|
|
4335
4369
|
fontWeight: "600",
|
|
4336
4370
|
fill: s,
|
|
4337
|
-
children:
|
|
4371
|
+
children: Mn(v[0], g)
|
|
4338
4372
|
}), v[1] && /* @__PURE__ */ u("text", {
|
|
4339
4373
|
x: m,
|
|
4340
4374
|
y: n + N.h * .73,
|
|
@@ -4342,19 +4376,19 @@ function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4342
4376
|
fontSize: N.title,
|
|
4343
4377
|
opacity: "0.7",
|
|
4344
4378
|
fill: s,
|
|
4345
|
-
children:
|
|
4379
|
+
children: Mn(v[1], g + 4)
|
|
4346
4380
|
})] })
|
|
4347
4381
|
]
|
|
4348
4382
|
}, e.id);
|
|
4349
4383
|
})
|
|
4350
4384
|
]
|
|
4351
|
-
}), w && /* @__PURE__ */ u(
|
|
4385
|
+
}), w && /* @__PURE__ */ u(Ln, {
|
|
4352
4386
|
node: w,
|
|
4353
4387
|
onClose: () => T(null)
|
|
4354
4388
|
})]
|
|
4355
4389
|
});
|
|
4356
4390
|
}
|
|
4357
|
-
function
|
|
4391
|
+
function zn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4358
4392
|
let [a, o] = c(!1), l = s(null);
|
|
4359
4393
|
return i(() => {
|
|
4360
4394
|
if (!a || !l.current) return;
|
|
@@ -4384,7 +4418,7 @@ function Pn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4384
4418
|
children: e ?? ""
|
|
4385
4419
|
});
|
|
4386
4420
|
}
|
|
4387
|
-
var
|
|
4421
|
+
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
4422
|
if (!e || typeof e != "object") return e ?? "";
|
|
4389
4423
|
let t = String(e.text ?? "");
|
|
4390
4424
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ u("a", {
|
|
@@ -4395,7 +4429,7 @@ var Fn = 360, In = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4395
4429
|
children: t
|
|
4396
4430
|
}) : t;
|
|
4397
4431
|
};
|
|
4398
|
-
function
|
|
4432
|
+
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
4433
|
let F = s(null), I = s(null), [L, R] = c(null), [z, B] = c(null), V = (e, t) => () => R({
|
|
4400
4434
|
r: e,
|
|
4401
4435
|
c: t
|
|
@@ -4409,7 +4443,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4409
4443
|
}
|
|
4410
4444
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4411
4445
|
top: r.bottom - n.top + 4,
|
|
4412
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
4446
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - Bn))
|
|
4413
4447
|
};
|
|
4414
4448
|
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4415
4449
|
}), i(() => {
|
|
@@ -4419,14 +4453,14 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4419
4453
|
};
|
|
4420
4454
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4421
4455
|
}, [P, L]);
|
|
4422
|
-
let { tenant: H, apiUrl: U } = r(
|
|
4456
|
+
let { tenant: H, apiUrl: U } = r(Z), ee = r(xe), W = ee?.[h], te = C ? Se(ee) : 1, [ne, re] = c(null);
|
|
4423
4457
|
if (i(() => {
|
|
4424
4458
|
if (!h || W) return;
|
|
4425
4459
|
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
4460
|
return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
|
|
4427
4461
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4428
|
-
return e &&
|
|
4429
|
-
}).catch(() => e &&
|
|
4462
|
+
return e && re(n);
|
|
4463
|
+
}).catch(() => e && re([])), () => {
|
|
4430
4464
|
e = !1;
|
|
4431
4465
|
};
|
|
4432
4466
|
}, [
|
|
@@ -4438,13 +4472,13 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4438
4472
|
te,
|
|
4439
4473
|
g
|
|
4440
4474
|
]), !e.length) return null;
|
|
4441
|
-
let
|
|
4475
|
+
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
4476
|
y: 6,
|
|
4443
4477
|
x: 10
|
|
4444
4478
|
} : {
|
|
4445
4479
|
y: 10,
|
|
4446
4480
|
x: 14
|
|
4447
|
-
},
|
|
4481
|
+
}, 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
4482
|
"left",
|
|
4449
4483
|
"center",
|
|
4450
4484
|
"right"
|
|
@@ -4464,13 +4498,13 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4464
4498
|
};
|
|
4465
4499
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4466
4500
|
}, ye = /* @__PURE__ */ new Set();
|
|
4467
|
-
p &&
|
|
4468
|
-
let r = p[
|
|
4501
|
+
p && q.forEach((t, n) => e.forEach((e, t) => {
|
|
4502
|
+
let r = p[Hn(a[n], o[t])];
|
|
4469
4503
|
if (!r) return;
|
|
4470
4504
|
let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
|
|
4471
4505
|
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && ye.add(`${n + e},${t + r}`);
|
|
4472
4506
|
}));
|
|
4473
|
-
let
|
|
4507
|
+
let be = (e) => (t) => {
|
|
4474
4508
|
if (!P?.resizeRow) return;
|
|
4475
4509
|
t.preventDefault(), t.stopPropagation();
|
|
4476
4510
|
let n = t.currentTarget.closest("tr");
|
|
@@ -4479,7 +4513,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4479
4513
|
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4480
4514
|
};
|
|
4481
4515
|
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4482
|
-
},
|
|
4516
|
+
}, Y = (e, t, n, r) => r ? null : /* @__PURE__ */ u("span", {
|
|
4483
4517
|
className: "wb-tedit-btn",
|
|
4484
4518
|
role: "button",
|
|
4485
4519
|
"data-hint": t,
|
|
@@ -4488,7 +4522,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4488
4522
|
},
|
|
4489
4523
|
onClick: n,
|
|
4490
4524
|
children: e
|
|
4491
|
-
}, t),
|
|
4525
|
+
}, 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
4526
|
return /* @__PURE__ */ d("div", {
|
|
4493
4527
|
ref: (e) => {
|
|
4494
4528
|
I.current = e, typeof N == "function" && N(e);
|
|
@@ -4499,8 +4533,8 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4499
4533
|
...ge
|
|
4500
4534
|
},
|
|
4501
4535
|
children: [
|
|
4502
|
-
P && /* @__PURE__ */ u("style", { children:
|
|
4503
|
-
P &&
|
|
4536
|
+
P && /* @__PURE__ */ u("style", { children: Vn }),
|
|
4537
|
+
P && X && z && /* @__PURE__ */ d("div", {
|
|
4504
4538
|
className: "wb-tedit-bar",
|
|
4505
4539
|
style: {
|
|
4506
4540
|
top: z.top,
|
|
@@ -4510,23 +4544,23 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4510
4544
|
children: [
|
|
4511
4545
|
/* @__PURE__ */ u("span", {
|
|
4512
4546
|
className: "wb-tedit-at",
|
|
4513
|
-
children: `R${
|
|
4547
|
+
children: `R${X.r + 1}·C${X.c + 1}`
|
|
4514
4548
|
}),
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4549
|
+
Y("+↑", Q("rowAbove", "Insert row above"), () => P.addRow(X.r - 1)),
|
|
4550
|
+
Y("+↓", Q("rowBelow", "Insert row below"), () => P.addRow(X.r)),
|
|
4551
|
+
Y("↑", Q("rowUp", "Move row up"), () => P.moveRow(X.r, -1), X.r === 0),
|
|
4552
|
+
Y("↓", Q("rowDown", "Move row down"), () => P.moveRow(X.r, 1), X.r >= q.length - 1),
|
|
4553
|
+
Y("✕ row", Q("rowDelete", "Delete row"), () => P.dropRow(X.r), q.length <= 1),
|
|
4520
4554
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4555
|
+
Y("+←", Q("colLeft", "Insert column left"), () => P.addColumn(X.c - 1)),
|
|
4556
|
+
Y("+→", Q("colRight", "Insert column right"), () => P.addColumn(X.c)),
|
|
4557
|
+
Y("←", Q("colMoveLeft", "Move column left"), () => P.moveColumn(X.c, -1), X.c === 0),
|
|
4558
|
+
Y("→", Q("colMoveRight", "Move column right"), () => P.moveColumn(X.c, 1), X.c >= e.length - 1),
|
|
4559
|
+
Y("✕ col", Q("colDelete", "Delete column"), () => P.dropColumn(X.c), e.length <= 1),
|
|
4526
4560
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4561
|
+
Y("↔", Q("mergeRight", "Merge with the cell on the right"), () => P.merge(X.r, X.c, "right"), X.c + we >= e.length),
|
|
4562
|
+
Y("↕", Q("mergeDown", "Merge with the cell below"), () => P.merge(X.r, X.c, "down"), X.r + Te >= q.length),
|
|
4563
|
+
Y("⤫", Q("split", "Split this cell"), () => P.split(X.r, X.c), we === 1 && Te === 1)
|
|
4530
4564
|
]
|
|
4531
4565
|
}),
|
|
4532
4566
|
/* @__PURE__ */ u("div", {
|
|
@@ -4555,7 +4589,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4555
4589
|
style: {
|
|
4556
4590
|
textAlign: de(n),
|
|
4557
4591
|
fontWeight: 600,
|
|
4558
|
-
padding:
|
|
4592
|
+
padding: ae,
|
|
4559
4593
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4560
4594
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4561
4595
|
...T ? {
|
|
@@ -4565,7 +4599,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4565
4599
|
} : P ? { position: "relative" } : null,
|
|
4566
4600
|
...se
|
|
4567
4601
|
},
|
|
4568
|
-
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
4602
|
+
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(zn, {
|
|
4569
4603
|
value: t.label ?? t,
|
|
4570
4604
|
onCommit: (e) => P.header(n, e),
|
|
4571
4605
|
hint: Q("editCell", "Double-click to edit"),
|
|
@@ -4579,13 +4613,13 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4579
4613
|
/* @__PURE__ */ d("tbody", { children: [ie && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
4580
4614
|
colSpan: e.length,
|
|
4581
4615
|
style: {
|
|
4582
|
-
padding:
|
|
4616
|
+
padding: ae,
|
|
4583
4617
|
textAlign: "center",
|
|
4584
4618
|
opacity: .6,
|
|
4585
4619
|
...se
|
|
4586
4620
|
},
|
|
4587
4621
|
children: w || "No data yet"
|
|
4588
|
-
}) }),
|
|
4622
|
+
}) }), q.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
4589
4623
|
className: P ? "wb-tedit-row" : void 0,
|
|
4590
4624
|
style: {
|
|
4591
4625
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
@@ -4593,7 +4627,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4593
4627
|
},
|
|
4594
4628
|
children: e.map((e, r) => {
|
|
4595
4629
|
if (ye.has(`${n},${r}`)) return null;
|
|
4596
|
-
let i =
|
|
4630
|
+
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
4631
|
return /* @__PURE__ */ d("td", {
|
|
4598
4632
|
className: P ? `wb-tedit-cell${L?.r === n && L?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4599
4633
|
onMouseDownCapture: _e ? V(n, r) : void 0,
|
|
@@ -4601,15 +4635,15 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4601
4635
|
colSpan: l > 1 ? l : void 0,
|
|
4602
4636
|
rowSpan: f > 1 ? f : void 0,
|
|
4603
4637
|
style: {
|
|
4604
|
-
padding:
|
|
4638
|
+
padding: ae,
|
|
4605
4639
|
...ue(r) ? { textAlign: ue(r) } : null,
|
|
4606
4640
|
...P ? { position: "relative" } : null,
|
|
4607
4641
|
...se
|
|
4608
4642
|
},
|
|
4609
|
-
children: [s ??
|
|
4643
|
+
children: [s ?? Un(t?.[r]), P && _e && /* @__PURE__ */ u("span", {
|
|
4610
4644
|
className: "wb-tedit-rowgrip",
|
|
4611
4645
|
title: Q("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4612
|
-
onPointerDown:
|
|
4646
|
+
onPointerDown: be(n),
|
|
4613
4647
|
onDoubleClick: () => P.resizeRow(n, 0)
|
|
4614
4648
|
})]
|
|
4615
4649
|
}, r);
|
|
@@ -4621,7 +4655,7 @@ function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4621
4655
|
]
|
|
4622
4656
|
});
|
|
4623
4657
|
}
|
|
4624
|
-
var
|
|
4658
|
+
var Gn = {
|
|
4625
4659
|
small: {
|
|
4626
4660
|
cell: 62,
|
|
4627
4661
|
font: 10.5,
|
|
@@ -4646,9 +4680,9 @@ var Bn = {
|
|
|
4646
4680
|
pad: 8,
|
|
4647
4681
|
gap: 4
|
|
4648
4682
|
}
|
|
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 ? "" :
|
|
4683
|
+
}, 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;
|
|
4684
|
+
function Yn(e, t = {}) {
|
|
4685
|
+
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
4686
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4653
4687
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4654
4688
|
};
|
|
@@ -4664,7 +4698,7 @@ function Wn(e, t = {}) {
|
|
|
4664
4698
|
} : null;
|
|
4665
4699
|
}).filter(Boolean);
|
|
4666
4700
|
}
|
|
4667
|
-
function
|
|
4701
|
+
function Xn(e) {
|
|
4668
4702
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4669
4703
|
let n = e?.start ? new Date(e.start) : null;
|
|
4670
4704
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4679,20 +4713,20 @@ function Gn(e) {
|
|
|
4679
4713
|
};
|
|
4680
4714
|
}).filter(Boolean);
|
|
4681
4715
|
}
|
|
4682
|
-
function
|
|
4716
|
+
function Zn(e) {
|
|
4683
4717
|
let t = /* @__PURE__ */ new Map();
|
|
4684
4718
|
for (let n of e) {
|
|
4685
|
-
let e =
|
|
4719
|
+
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
4720
|
for (let r = 0; r <= i; r += 1) {
|
|
4687
|
-
let i =
|
|
4721
|
+
let i = Kn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4688
4722
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4689
4723
|
}
|
|
4690
4724
|
}
|
|
4691
4725
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4692
4726
|
return t;
|
|
4693
4727
|
}
|
|
4694
|
-
function
|
|
4695
|
-
let { tenant: T, apiUrl: E, locale: D } = r(
|
|
4728
|
+
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 }) {
|
|
4729
|
+
let { tenant: T, apiUrl: E, locale: D } = r(Z), O = r(xe)?.[t], [k, j] = c(null), [M, N] = c(() => {
|
|
4696
4730
|
let e = /* @__PURE__ */ new Date();
|
|
4697
4731
|
return {
|
|
4698
4732
|
year: e.getFullYear(),
|
|
@@ -4714,13 +4748,13 @@ function qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4714
4748
|
E,
|
|
4715
4749
|
O
|
|
4716
4750
|
]);
|
|
4717
|
-
let P =
|
|
4751
|
+
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
4752
|
titleField: n,
|
|
4719
4753
|
startField: a,
|
|
4720
4754
|
endField: o,
|
|
4721
4755
|
hrefField: s,
|
|
4722
4756
|
colorField: f
|
|
4723
|
-
}) :
|
|
4757
|
+
}) : Xn(e), B = Zn(z), V = D || void 0, H = (e, t) => {
|
|
4724
4758
|
let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
|
|
4725
4759
|
width: 6,
|
|
4726
4760
|
height: 6,
|
|
@@ -4852,10 +4886,10 @@ function qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4852
4886
|
})]
|
|
4853
4887
|
});
|
|
4854
4888
|
}
|
|
4855
|
-
let ne = new Date(M.year, M.month, 1),
|
|
4856
|
-
for (let e = 0; e <
|
|
4857
|
-
let t = e -
|
|
4858
|
-
|
|
4889
|
+
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 = [];
|
|
4890
|
+
for (let e = 0; e < q * 7; e += 1) {
|
|
4891
|
+
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;
|
|
4892
|
+
ae.push(/* @__PURE__ */ d("div", {
|
|
4859
4893
|
style: {
|
|
4860
4894
|
minHeight: P.cell,
|
|
4861
4895
|
borderTop: `1px solid ${I}`,
|
|
@@ -4912,31 +4946,31 @@ function qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4912
4946
|
textAlign: "center",
|
|
4913
4947
|
padding: `0 0 ${P.pad}px`
|
|
4914
4948
|
},
|
|
4915
|
-
children:
|
|
4916
|
-
}, `head-${t}`)),
|
|
4949
|
+
children: J.format(new Date(2024, 0, 7 + re + t))
|
|
4950
|
+
}, `head-${t}`)), ae]
|
|
4917
4951
|
}),
|
|
4918
4952
|
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4919
4953
|
]
|
|
4920
4954
|
});
|
|
4921
4955
|
}
|
|
4922
|
-
var
|
|
4956
|
+
var $n = {
|
|
4923
4957
|
small: 36,
|
|
4924
4958
|
medium: 56,
|
|
4925
4959
|
large: 88
|
|
4926
4960
|
};
|
|
4927
|
-
function
|
|
4928
|
-
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" :
|
|
4961
|
+
function er(e, t = {}) {
|
|
4962
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : Oe(e);
|
|
4929
4963
|
return n.map((e) => {
|
|
4930
|
-
let n = e.data ?? e, i =
|
|
4964
|
+
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
4965
|
return {
|
|
4932
4966
|
src: typeof o == "string" ? o.trim() : "",
|
|
4933
4967
|
alt: s,
|
|
4934
|
-
href: t.hrefField ? r(
|
|
4968
|
+
href: t.hrefField ? r(Ee(n, t.hrefField)) : ""
|
|
4935
4969
|
};
|
|
4936
4970
|
}).filter((e) => e.src);
|
|
4937
4971
|
}
|
|
4938
|
-
function
|
|
4939
|
-
let { tenant: D, apiUrl: O } = r(
|
|
4972
|
+
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 }) {
|
|
4973
|
+
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
4974
|
i(() => {
|
|
4941
4975
|
if (!t || k) return;
|
|
4942
4976
|
let e = !0;
|
|
@@ -4966,7 +5000,7 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
4966
5000
|
let e = N.current;
|
|
4967
5001
|
if (!e) return;
|
|
4968
5002
|
let t = !0, n = () => {
|
|
4969
|
-
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight *
|
|
5003
|
+
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * G);
|
|
4970
5004
|
t && n.length && R(Math.ceil(Math.max(...n)));
|
|
4971
5005
|
};
|
|
4972
5006
|
n();
|
|
@@ -4975,12 +5009,12 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
4975
5009
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
4976
5010
|
};
|
|
4977
5011
|
});
|
|
4978
|
-
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [],
|
|
5012
|
+
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], re = t ? er(k ?? j ?? [], {
|
|
4979
5013
|
imageField: n,
|
|
4980
5014
|
nameField: a,
|
|
4981
5015
|
hrefField: o
|
|
4982
|
-
}) : ne,
|
|
4983
|
-
if (!
|
|
5016
|
+
}) : 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;
|
|
5017
|
+
if (!re.length) return /* @__PURE__ */ u("div", {
|
|
4984
5018
|
ref: T,
|
|
4985
5019
|
style: {
|
|
4986
5020
|
width: "100%",
|
|
@@ -4992,7 +5026,7 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
4992
5026
|
alignItems: "center",
|
|
4993
5027
|
justifyContent: "center",
|
|
4994
5028
|
flexWrap: "wrap",
|
|
4995
|
-
gap:
|
|
5029
|
+
gap: K
|
|
4996
5030
|
},
|
|
4997
5031
|
children: [
|
|
4998
5032
|
0,
|
|
@@ -5002,16 +5036,16 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5002
5036
|
4
|
|
5003
5037
|
].map((e) => /* @__PURE__ */ u("div", {
|
|
5004
5038
|
style: {
|
|
5005
|
-
height:
|
|
5006
|
-
width:
|
|
5039
|
+
height: G,
|
|
5040
|
+
width: G * 3,
|
|
5007
5041
|
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
5008
5042
|
borderRadius: 6,
|
|
5009
5043
|
display: "flex",
|
|
5010
5044
|
alignItems: "center",
|
|
5011
5045
|
justifyContent: "center",
|
|
5012
|
-
fontSize: Math.max(10, Math.round(
|
|
5046
|
+
fontSize: Math.max(10, Math.round(G / 4)),
|
|
5013
5047
|
opacity: .45,
|
|
5014
|
-
...
|
|
5048
|
+
...q
|
|
5015
5049
|
},
|
|
5016
5050
|
children: "LOGO"
|
|
5017
5051
|
}, e))
|
|
@@ -5025,12 +5059,12 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5025
5059
|
children: C
|
|
5026
5060
|
}) : null
|
|
5027
5061
|
});
|
|
5028
|
-
let de =
|
|
5062
|
+
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
5063
|
let r = /* @__PURE__ */ u("img", {
|
|
5030
5064
|
src: e.src,
|
|
5031
5065
|
alt: e.alt ?? "",
|
|
5032
5066
|
style: {
|
|
5033
|
-
height:
|
|
5067
|
+
height: G,
|
|
5034
5068
|
width: "auto",
|
|
5035
5069
|
maxWidth: "100%",
|
|
5036
5070
|
objectFit: "contain",
|
|
@@ -5039,7 +5073,7 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5039
5073
|
}), i = fe ? {
|
|
5040
5074
|
width: ue,
|
|
5041
5075
|
flex: "0 0 auto",
|
|
5042
|
-
padding: `0 ${
|
|
5076
|
+
padding: `0 ${K / 2}px`,
|
|
5043
5077
|
justifyContent: "center"
|
|
5044
5078
|
} : {};
|
|
5045
5079
|
return e.href && !E ? /* @__PURE__ */ u("a", {
|
|
@@ -5062,7 +5096,7 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5062
5096
|
...n ? { "aria-hidden": "true" } : {},
|
|
5063
5097
|
children: r
|
|
5064
5098
|
}, `${n ? "c" : "o"}-${t}`);
|
|
5065
|
-
},
|
|
5099
|
+
}, be = /* @__PURE__ */ u("div", {
|
|
5066
5100
|
ref: N,
|
|
5067
5101
|
className: "wb-logos-track",
|
|
5068
5102
|
style: {
|
|
@@ -5071,20 +5105,20 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5071
5105
|
...fe ? {
|
|
5072
5106
|
width: _e.length * ue,
|
|
5073
5107
|
transform: `translateX(-${ve}px)`,
|
|
5074
|
-
transition: V ? `transform ${
|
|
5108
|
+
transition: V ? `transform ${ae}ms ease` : "none"
|
|
5075
5109
|
} : pe ? {
|
|
5076
|
-
gap:
|
|
5110
|
+
gap: K,
|
|
5077
5111
|
overflowX: "auto",
|
|
5078
5112
|
scrollBehavior: "smooth",
|
|
5079
5113
|
scrollSnapType: "x proximity"
|
|
5080
5114
|
} : {
|
|
5081
|
-
gap:
|
|
5115
|
+
gap: K,
|
|
5082
5116
|
flexWrap: "wrap",
|
|
5083
5117
|
justifyContent: "center"
|
|
5084
5118
|
}
|
|
5085
5119
|
},
|
|
5086
5120
|
children: _e.map((e, t) => ye(e, t, fe && t >= de))
|
|
5087
|
-
}),
|
|
5121
|
+
}), Y = (e) => {
|
|
5088
5122
|
if (pe) {
|
|
5089
5123
|
let t = N.current;
|
|
5090
5124
|
t && t.scrollBy({
|
|
@@ -5102,10 +5136,10 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5102
5136
|
H(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
5103
5137
|
H(!0), B(n + e);
|
|
5104
5138
|
}));
|
|
5105
|
-
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show",
|
|
5139
|
+
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Se = X !== "off" && (pe ? F > 0 : fe), Q = (e) => /* @__PURE__ */ u("button", {
|
|
5106
5140
|
type: "button",
|
|
5107
5141
|
"aria-label": e < 0 ? "Previous logos" : "Next logos",
|
|
5108
|
-
onClick: () =>
|
|
5142
|
+
onClick: () => Y(e),
|
|
5109
5143
|
className: `wb-logos-arrow${X === "hover" ? " wb-logos-arrow-shy" : ""}`,
|
|
5110
5144
|
style: { [e < 0 ? "left" : "right"]: 0 },
|
|
5111
5145
|
children: e < 0 ? "‹" : "›"
|
|
@@ -5152,22 +5186,22 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5152
5186
|
margin: "0 auto"
|
|
5153
5187
|
},
|
|
5154
5188
|
children: [
|
|
5155
|
-
|
|
5189
|
+
Se ? Q(-1) : null,
|
|
5156
5190
|
/* @__PURE__ */ u("div", {
|
|
5157
5191
|
style: { overflow: "hidden" },
|
|
5158
|
-
children:
|
|
5192
|
+
children: be
|
|
5159
5193
|
}),
|
|
5160
|
-
|
|
5194
|
+
Se ? Q(1) : null
|
|
5161
5195
|
]
|
|
5162
5196
|
}) : /* @__PURE__ */ d(l, { children: [
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5197
|
+
Se ? Q(-1) : null,
|
|
5198
|
+
be,
|
|
5199
|
+
Se ? Q(1) : null
|
|
5166
5200
|
] }),
|
|
5167
|
-
/* @__PURE__ */ u(
|
|
5201
|
+
/* @__PURE__ */ u(nr, {
|
|
5168
5202
|
running: me,
|
|
5169
|
-
every:
|
|
5170
|
-
slide:
|
|
5203
|
+
every: J + ae,
|
|
5204
|
+
slide: ae,
|
|
5171
5205
|
step: he ? -1 : 1,
|
|
5172
5206
|
index: z,
|
|
5173
5207
|
total: de,
|
|
@@ -5178,7 +5212,7 @@ function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5178
5212
|
]
|
|
5179
5213
|
});
|
|
5180
5214
|
}
|
|
5181
|
-
function
|
|
5215
|
+
function nr({ running: e, every: t, slide: n, step: r, index: a, total: o, home: s, setIndex: c, setAnimate: l }) {
|
|
5182
5216
|
i(() => {
|
|
5183
5217
|
if (!e) return;
|
|
5184
5218
|
let n = setInterval(() => {
|
|
@@ -5214,13 +5248,13 @@ function Zn({ running: e, every: t, slide: n, step: r, index: a, total: o, home:
|
|
|
5214
5248
|
l
|
|
5215
5249
|
]), null;
|
|
5216
5250
|
}
|
|
5217
|
-
var
|
|
5251
|
+
var rr = {
|
|
5218
5252
|
small: 380,
|
|
5219
5253
|
medium: 560,
|
|
5220
5254
|
large: 820,
|
|
5221
5255
|
full: "100%"
|
|
5222
5256
|
};
|
|
5223
|
-
function
|
|
5257
|
+
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
5258
|
let [C, w] = c(!1), T = s(null);
|
|
5225
5259
|
i(() => {
|
|
5226
5260
|
if (S || !e) return;
|
|
@@ -5245,7 +5279,7 @@ function $n({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5245
5279
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
5246
5280
|
};
|
|
5247
5281
|
}, [S, C]);
|
|
5248
|
-
let E =
|
|
5282
|
+
let E = rr[o] ?? rr.medium, D = (e) => {
|
|
5249
5283
|
let t = {
|
|
5250
5284
|
padding: "9px 16px",
|
|
5251
5285
|
borderRadius: 6,
|
|
@@ -5414,97 +5448,98 @@ function $n({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5414
5448
|
})]
|
|
5415
5449
|
});
|
|
5416
5450
|
}
|
|
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
|
-
|
|
5451
|
+
var ar = {
|
|
5452
|
+
PageRoot: ze,
|
|
5453
|
+
CalendarBlock: Qn,
|
|
5454
|
+
LogoCarousel: tr,
|
|
5455
|
+
DialogBlock: ir,
|
|
5456
|
+
Section: Be,
|
|
5457
|
+
Container: Ve,
|
|
5458
|
+
Heading: He,
|
|
5459
|
+
TextBlock: nt,
|
|
5460
|
+
ButtonBlock: at,
|
|
5461
|
+
ImageBlock: ot,
|
|
5462
|
+
Spacer: ft,
|
|
5463
|
+
Divider: pt,
|
|
5464
|
+
BoxBlock: mt,
|
|
5465
|
+
SliderBlock: bt,
|
|
5466
|
+
CanvasSlider: xt,
|
|
5467
|
+
TabsBlock: Lt,
|
|
5468
|
+
QuickStack: un,
|
|
5469
|
+
CollectionList: dn,
|
|
5470
|
+
CollectionSearch: fn,
|
|
5471
|
+
BreadcrumbsBlock: pn,
|
|
5472
|
+
PaginationBlock: mn,
|
|
5473
|
+
StepperBlock: En,
|
|
5474
|
+
SocialLinksBlock: Tn,
|
|
5475
|
+
ThemeModeBlock: yn,
|
|
5476
|
+
ScrollTopBlock: Cn,
|
|
5477
|
+
OrgChartBlock: Rn,
|
|
5478
|
+
TableBlock: Wn,
|
|
5479
|
+
IconBlock: At,
|
|
5480
|
+
MapBlock: Ot,
|
|
5481
|
+
MasonryBlock: Mt,
|
|
5482
|
+
AccordionBlock: Rt,
|
|
5483
|
+
NavbarBlock: It,
|
|
5484
|
+
ListBlock: tt,
|
|
5485
|
+
TextSpan: Ke,
|
|
5486
|
+
QuoteBlock: et,
|
|
5487
|
+
TextLink: it,
|
|
5488
|
+
RichTextBlock: Qe,
|
|
5489
|
+
RichContentBlock: Qe,
|
|
5490
|
+
VideoBlock: st,
|
|
5491
|
+
YouTubeBlock: lt,
|
|
5492
|
+
IframeBlock: ut,
|
|
5493
|
+
EmbedBlock: dt,
|
|
5494
|
+
FormBlock: Zt,
|
|
5495
|
+
FormLabel: nn,
|
|
5496
|
+
FormInput: rn,
|
|
5497
|
+
FormTextarea: an,
|
|
5498
|
+
FormCheckbox: (e) => /* @__PURE__ */ u(on, {
|
|
5464
5499
|
kind: "checkbox",
|
|
5465
5500
|
...e
|
|
5466
5501
|
}),
|
|
5467
|
-
FormRadio: (e) => /* @__PURE__ */ u(
|
|
5502
|
+
FormRadio: (e) => /* @__PURE__ */ u(on, {
|
|
5468
5503
|
kind: "radio",
|
|
5469
5504
|
...e
|
|
5470
5505
|
}),
|
|
5471
|
-
FormSelect:
|
|
5472
|
-
FormFile:
|
|
5473
|
-
FormRecaptcha:
|
|
5474
|
-
FormSubmit:
|
|
5475
|
-
},
|
|
5506
|
+
FormSelect: sn,
|
|
5507
|
+
FormFile: cn,
|
|
5508
|
+
FormRecaptcha: tn,
|
|
5509
|
+
FormSubmit: ln
|
|
5510
|
+
}, or = {
|
|
5476
5511
|
id: "auth",
|
|
5477
5512
|
label: "Accounts",
|
|
5478
5513
|
category: "Apps",
|
|
5479
5514
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5480
5515
|
ssr: "shell",
|
|
5481
5516
|
settings: ["site.authRedirect"]
|
|
5482
|
-
},
|
|
5517
|
+
}, sr = t({
|
|
5483
5518
|
user: null,
|
|
5484
5519
|
status: "idle",
|
|
5485
5520
|
ensure: () => {},
|
|
5486
5521
|
refresh: () => {},
|
|
5487
5522
|
signOut: () => {}
|
|
5488
5523
|
});
|
|
5489
|
-
function
|
|
5524
|
+
function cr(e, t) {
|
|
5490
5525
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5491
5526
|
}
|
|
5492
|
-
function
|
|
5527
|
+
function lr(e) {
|
|
5493
5528
|
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
5529
|
return {
|
|
5495
5530
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5496
5531
|
url: i,
|
|
5497
5532
|
mePath: a,
|
|
5498
5533
|
logoutPath: o,
|
|
5499
|
-
meUrl:
|
|
5500
|
-
logoutUrl:
|
|
5534
|
+
meUrl: cr(i, a),
|
|
5535
|
+
logoutUrl: cr(i, o),
|
|
5501
5536
|
loginPage: r(n.loginPage),
|
|
5502
5537
|
userPath: r(n.userPath),
|
|
5503
5538
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5504
5539
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5505
5540
|
};
|
|
5506
5541
|
}
|
|
5507
|
-
function
|
|
5542
|
+
function ur(e, t) {
|
|
5508
5543
|
if (!t) return e ?? null;
|
|
5509
5544
|
let n = e;
|
|
5510
5545
|
for (let e of t.split(".")) {
|
|
@@ -5513,26 +5548,26 @@ function ar(e, t) {
|
|
|
5513
5548
|
}
|
|
5514
5549
|
return n ?? null;
|
|
5515
5550
|
}
|
|
5516
|
-
function
|
|
5551
|
+
function dr(e) {
|
|
5517
5552
|
try {
|
|
5518
5553
|
return window.localStorage.getItem(e) || "";
|
|
5519
5554
|
} catch {
|
|
5520
5555
|
return "";
|
|
5521
5556
|
}
|
|
5522
5557
|
}
|
|
5523
|
-
function
|
|
5558
|
+
function fr(e) {
|
|
5524
5559
|
try {
|
|
5525
5560
|
window.localStorage.removeItem(e);
|
|
5526
5561
|
} catch {}
|
|
5527
5562
|
}
|
|
5528
|
-
var
|
|
5529
|
-
let e = r(
|
|
5563
|
+
var pr = () => {
|
|
5564
|
+
let e = r(sr);
|
|
5530
5565
|
return i(() => {
|
|
5531
5566
|
e.ensure();
|
|
5532
5567
|
}, [e]), e;
|
|
5533
5568
|
};
|
|
5534
|
-
function
|
|
5535
|
-
let f = r(
|
|
5569
|
+
function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
|
|
5570
|
+
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
5571
|
...t,
|
|
5537
5572
|
credentials: "include",
|
|
5538
5573
|
headers: {
|
|
@@ -5544,9 +5579,9 @@ function lr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5544
5579
|
if (a) return Promise.resolve(null);
|
|
5545
5580
|
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5546
5581
|
if (h.mode === "custom") {
|
|
5547
|
-
let e = h.auth === "bearer" ?
|
|
5582
|
+
let e = h.auth === "bearer" ? dr(h.tokenKey) : "";
|
|
5548
5583
|
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 =
|
|
5584
|
+
let t = ur(e, h.userPath);
|
|
5550
5585
|
return S(t && typeof t == "object" ? t : null);
|
|
5551
5586
|
}).catch(() => S(null));
|
|
5552
5587
|
}
|
|
@@ -5559,12 +5594,12 @@ function lr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5559
5594
|
]), w = n(() => {
|
|
5560
5595
|
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5561
5596
|
if (h.mode === "custom") {
|
|
5562
|
-
let e = h.auth === "bearer" ?
|
|
5597
|
+
let e = h.auth === "bearer" ? dr(h.tokenKey) : "";
|
|
5563
5598
|
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5564
5599
|
method: "post",
|
|
5565
5600
|
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5566
5601
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5567
|
-
h.auth === "bearer" &&
|
|
5602
|
+
h.auth === "bearer" && fr(h.tokenKey), S(null);
|
|
5568
5603
|
});
|
|
5569
5604
|
}
|
|
5570
5605
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -5614,19 +5649,19 @@ function lr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5614
5649
|
h.loginPage,
|
|
5615
5650
|
C,
|
|
5616
5651
|
w
|
|
5617
|
-
]), /* @__PURE__ */ u(
|
|
5652
|
+
]), /* @__PURE__ */ u(sr.Provider, {
|
|
5618
5653
|
value: E,
|
|
5619
5654
|
children: e
|
|
5620
5655
|
});
|
|
5621
5656
|
}
|
|
5622
|
-
function
|
|
5623
|
-
let { status: n } =
|
|
5657
|
+
function hr({ when: e, children: t }) {
|
|
5658
|
+
let { status: n } = pr();
|
|
5624
5659
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5625
5660
|
}
|
|
5626
5661
|
//#endregion
|
|
5627
5662
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5628
|
-
function
|
|
5629
|
-
let { tenant: h, apiUrl: g, settings: _ } = r(
|
|
5663
|
+
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 }) {
|
|
5664
|
+
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
5665
|
if (e.preventDefault(), f) return;
|
|
5631
5666
|
let n = new FormData(e.currentTarget);
|
|
5632
5667
|
C(!0), x("");
|
|
@@ -5674,20 +5709,20 @@ function dr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5674
5709
|
children: [
|
|
5675
5710
|
w ? /* @__PURE__ */ d("label", {
|
|
5676
5711
|
style: {
|
|
5677
|
-
...
|
|
5712
|
+
...Bt,
|
|
5678
5713
|
display: "grid",
|
|
5679
5714
|
gap: 6
|
|
5680
5715
|
},
|
|
5681
5716
|
children: [a, /* @__PURE__ */ u("input", {
|
|
5682
5717
|
name: "name",
|
|
5683
5718
|
type: "text",
|
|
5684
|
-
style:
|
|
5685
|
-
...
|
|
5719
|
+
style: Vt,
|
|
5720
|
+
...Ut(f)
|
|
5686
5721
|
})]
|
|
5687
5722
|
}) : null,
|
|
5688
5723
|
/* @__PURE__ */ d("label", {
|
|
5689
5724
|
style: {
|
|
5690
|
-
...
|
|
5725
|
+
...Bt,
|
|
5691
5726
|
display: "grid",
|
|
5692
5727
|
gap: 6
|
|
5693
5728
|
},
|
|
@@ -5695,13 +5730,13 @@ function dr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5695
5730
|
name: "email",
|
|
5696
5731
|
type: "email",
|
|
5697
5732
|
required: !f,
|
|
5698
|
-
style:
|
|
5699
|
-
...
|
|
5733
|
+
style: Vt,
|
|
5734
|
+
...Ut(f)
|
|
5700
5735
|
})]
|
|
5701
5736
|
}),
|
|
5702
5737
|
/* @__PURE__ */ d("label", {
|
|
5703
5738
|
style: {
|
|
5704
|
-
...
|
|
5739
|
+
...Bt,
|
|
5705
5740
|
display: "grid",
|
|
5706
5741
|
gap: 6
|
|
5707
5742
|
},
|
|
@@ -5709,15 +5744,15 @@ function dr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5709
5744
|
name: "password",
|
|
5710
5745
|
type: "password",
|
|
5711
5746
|
required: !f,
|
|
5712
|
-
style:
|
|
5713
|
-
...
|
|
5747
|
+
style: Vt,
|
|
5748
|
+
...Ut(f)
|
|
5714
5749
|
})]
|
|
5715
5750
|
}),
|
|
5716
5751
|
/* @__PURE__ */ u("button", {
|
|
5717
5752
|
type: f ? "button" : "submit",
|
|
5718
5753
|
disabled: S || void 0,
|
|
5719
5754
|
style: {
|
|
5720
|
-
...
|
|
5755
|
+
...Pe,
|
|
5721
5756
|
border: 0,
|
|
5722
5757
|
padding: "10px 22px",
|
|
5723
5758
|
borderRadius: 8,
|
|
@@ -5749,8 +5784,8 @@ function dr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5749
5784
|
]
|
|
5750
5785
|
});
|
|
5751
5786
|
}
|
|
5752
|
-
function
|
|
5753
|
-
let { user: c, status: l, signOut: f } =
|
|
5787
|
+
function _r({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
5788
|
+
let { user: c, status: l, signOut: f } = pr(), p = a ? s || "user" : l, m = a ? {
|
|
5754
5789
|
name: "Ada Lovelace",
|
|
5755
5790
|
email: "ada@example.com"
|
|
5756
5791
|
} : c;
|
|
@@ -5771,7 +5806,7 @@ function fr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5771
5806
|
children: [
|
|
5772
5807
|
/* @__PURE__ */ d("span", {
|
|
5773
5808
|
style: {
|
|
5774
|
-
...
|
|
5809
|
+
...Bt,
|
|
5775
5810
|
fontWeight: 600
|
|
5776
5811
|
},
|
|
5777
5812
|
children: [
|
|
@@ -5782,7 +5817,7 @@ function fr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5782
5817
|
}),
|
|
5783
5818
|
n && m?.email ? /* @__PURE__ */ u("span", {
|
|
5784
5819
|
style: {
|
|
5785
|
-
...
|
|
5820
|
+
...Bt,
|
|
5786
5821
|
opacity: .7
|
|
5787
5822
|
},
|
|
5788
5823
|
children: m.email
|
|
@@ -5791,14 +5826,14 @@ function fr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5791
5826
|
type: "button",
|
|
5792
5827
|
onClick: a ? void 0 : f,
|
|
5793
5828
|
style: {
|
|
5794
|
-
...
|
|
5829
|
+
...Pe,
|
|
5795
5830
|
border: 0,
|
|
5796
5831
|
padding: "8px 16px",
|
|
5797
5832
|
borderRadius: 8,
|
|
5798
5833
|
fontSize: 14,
|
|
5799
5834
|
cursor: a ? "default" : "pointer"
|
|
5800
5835
|
},
|
|
5801
|
-
...
|
|
5836
|
+
...Ut(a),
|
|
5802
5837
|
children: t
|
|
5803
5838
|
})
|
|
5804
5839
|
]
|
|
@@ -5815,40 +5850,40 @@ function fr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5815
5850
|
}
|
|
5816
5851
|
//#endregion
|
|
5817
5852
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5818
|
-
var
|
|
5853
|
+
var vr = {
|
|
5819
5854
|
id: "consent",
|
|
5820
5855
|
label: "Cookie consent",
|
|
5821
5856
|
category: "Apps",
|
|
5822
5857
|
keys: ["CookieConsent"],
|
|
5823
5858
|
ssr: "shell",
|
|
5824
5859
|
settings: []
|
|
5825
|
-
},
|
|
5826
|
-
function
|
|
5860
|
+
}, yr = "webim.cookie_consent";
|
|
5861
|
+
function br() {
|
|
5827
5862
|
try {
|
|
5828
|
-
let e = window.localStorage.getItem(
|
|
5863
|
+
let e = window.localStorage.getItem(yr), t = e ? JSON.parse(e) : null;
|
|
5829
5864
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5830
5865
|
} catch {
|
|
5831
5866
|
return "";
|
|
5832
5867
|
}
|
|
5833
5868
|
}
|
|
5834
|
-
function
|
|
5869
|
+
function xr(e) {
|
|
5835
5870
|
try {
|
|
5836
5871
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5837
5872
|
} catch {}
|
|
5838
5873
|
}
|
|
5839
|
-
function
|
|
5874
|
+
function Sr(e) {
|
|
5840
5875
|
try {
|
|
5841
|
-
window.localStorage.setItem(
|
|
5876
|
+
window.localStorage.setItem(yr, JSON.stringify({
|
|
5842
5877
|
choice: e,
|
|
5843
5878
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5844
5879
|
}));
|
|
5845
5880
|
} catch {}
|
|
5846
|
-
|
|
5881
|
+
xr(e);
|
|
5847
5882
|
try {
|
|
5848
5883
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5849
5884
|
} catch {}
|
|
5850
5885
|
}
|
|
5851
|
-
var
|
|
5886
|
+
var Cr = {
|
|
5852
5887
|
bottom: {
|
|
5853
5888
|
left: 0,
|
|
5854
5889
|
right: 0,
|
|
@@ -5870,18 +5905,18 @@ var vr = {
|
|
|
5870
5905
|
maxWidth: 400
|
|
5871
5906
|
}
|
|
5872
5907
|
};
|
|
5873
|
-
function
|
|
5908
|
+
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
5909
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
5875
5910
|
y(e), typeof m == "function" && m(e);
|
|
5876
5911
|
};
|
|
5877
5912
|
if (i(() => {
|
|
5878
5913
|
if (h) return;
|
|
5879
|
-
let e =
|
|
5880
|
-
e ?
|
|
5914
|
+
let e = br();
|
|
5915
|
+
e ? xr(e) : _(!0);
|
|
5881
5916
|
}, [h, v]), !g) return null;
|
|
5882
5917
|
let x = (e) => () => {
|
|
5883
|
-
h || (
|
|
5884
|
-
}, S =
|
|
5918
|
+
h || (Sr(e), _(!1));
|
|
5919
|
+
}, S = Cr[s] ?? Cr.bottom, C = {
|
|
5885
5920
|
appearance: "none",
|
|
5886
5921
|
font: "inherit",
|
|
5887
5922
|
fontSize: 14,
|
|
@@ -5961,37 +5996,37 @@ function yr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
5961
5996
|
}
|
|
5962
5997
|
//#endregion
|
|
5963
5998
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
5964
|
-
var
|
|
5999
|
+
var Tr = {
|
|
5965
6000
|
id: "language",
|
|
5966
6001
|
label: "Language",
|
|
5967
6002
|
category: "Apps",
|
|
5968
6003
|
keys: ["SiteLanguagePicker"],
|
|
5969
6004
|
ssr: "prefetch",
|
|
5970
6005
|
settings: ["locales"]
|
|
5971
|
-
},
|
|
6006
|
+
}, Er = {
|
|
5972
6007
|
id: "search",
|
|
5973
6008
|
label: "Search",
|
|
5974
6009
|
category: "Apps",
|
|
5975
6010
|
keys: ["SiteSearch"],
|
|
5976
6011
|
ssr: "prefetch",
|
|
5977
6012
|
settings: []
|
|
5978
|
-
},
|
|
5979
|
-
function
|
|
6013
|
+
}, Dr = 50, Or = 2e3;
|
|
6014
|
+
function kr() {
|
|
5980
6015
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
5981
6016
|
}
|
|
5982
|
-
function
|
|
6017
|
+
function Ar(e, t) {
|
|
5983
6018
|
let n = e?.data ?? {}, r = [];
|
|
5984
6019
|
for (let e of Object.values(n)) {
|
|
5985
|
-
let t = e == null ? "" :
|
|
5986
|
-
if (t && r.push(t), r.join(" ").length >
|
|
6020
|
+
let t = e == null ? "" : Oe(e);
|
|
6021
|
+
if (t && r.push(t), r.join(" ").length > Or) break;
|
|
5987
6022
|
}
|
|
5988
|
-
return r.join(" ").slice(0,
|
|
6023
|
+
return r.join(" ").slice(0, Or).toLocaleLowerCase(t || void 0);
|
|
5989
6024
|
}
|
|
5990
|
-
function
|
|
5991
|
-
let { tenant: b, apiUrl: x, locale: S } = r(
|
|
6025
|
+
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 }) {
|
|
6026
|
+
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
6027
|
i(() => {
|
|
5993
6028
|
let e = () => {
|
|
5994
|
-
let e =
|
|
6029
|
+
let e = kr();
|
|
5995
6030
|
w(e), E(e);
|
|
5996
6031
|
};
|
|
5997
6032
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -6042,8 +6077,8 @@ function Er({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6042
6077
|
});
|
|
6043
6078
|
}
|
|
6044
6079
|
else for (let t of e.rows) {
|
|
6045
|
-
if (!
|
|
6046
|
-
let n = t?.data ?? {}, r =
|
|
6080
|
+
if (!Ar(t, S).includes(P)) continue;
|
|
6081
|
+
let n = t?.data ?? {}, r = Oe(n.name) || "Untitled", i = Oe(n.slug);
|
|
6047
6082
|
F.push({
|
|
6048
6083
|
key: `entry:${t.id}`,
|
|
6049
6084
|
title: r,
|
|
@@ -6051,7 +6086,7 @@ function Er({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6051
6086
|
kind: "entry"
|
|
6052
6087
|
});
|
|
6053
6088
|
}
|
|
6054
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
6089
|
+
let I = F.slice(0, Math.min(Math.max(1, p), Dr)), L = (e) => {
|
|
6055
6090
|
if (v) {
|
|
6056
6091
|
e.preventDefault(), w(T), j(!0);
|
|
6057
6092
|
return;
|
|
@@ -6133,7 +6168,7 @@ function Er({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6133
6168
|
onChange: (e) => E(e.target.value),
|
|
6134
6169
|
onFocus: () => P && j(!0),
|
|
6135
6170
|
style: {
|
|
6136
|
-
...
|
|
6171
|
+
...Vt,
|
|
6137
6172
|
flexGrow: 1,
|
|
6138
6173
|
minWidth: 0
|
|
6139
6174
|
}
|
|
@@ -6191,21 +6226,21 @@ function Er({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6191
6226
|
}
|
|
6192
6227
|
//#endregion
|
|
6193
6228
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
6194
|
-
function
|
|
6229
|
+
function Mr(e) {
|
|
6195
6230
|
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
6231
|
return [...new Set(n.map((e) => e.trim()))];
|
|
6197
6232
|
}
|
|
6198
|
-
var
|
|
6199
|
-
function
|
|
6233
|
+
var Nr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6234
|
+
function Pr(e, t) {
|
|
6200
6235
|
let n = String(e ?? "").toUpperCase();
|
|
6201
6236
|
if (t === "code") return n;
|
|
6202
6237
|
let r = "";
|
|
6203
6238
|
try {
|
|
6204
|
-
r =
|
|
6239
|
+
r = Nr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
6205
6240
|
} catch {}
|
|
6206
6241
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
6207
6242
|
}
|
|
6208
|
-
function
|
|
6243
|
+
function Fr(e, t) {
|
|
6209
6244
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
6210
6245
|
if (typeof window > "u") return n || "?";
|
|
6211
6246
|
try {
|
|
@@ -6215,8 +6250,8 @@ function Ar(e, t) {
|
|
|
6215
6250
|
return n || "/";
|
|
6216
6251
|
}
|
|
6217
6252
|
}
|
|
6218
|
-
function
|
|
6219
|
-
let c = r(
|
|
6253
|
+
function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
|
|
6254
|
+
let c = r(Z), l = Mr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
|
|
6220
6255
|
display: "inline-flex",
|
|
6221
6256
|
alignItems: "center",
|
|
6222
6257
|
gap: 8,
|
|
@@ -6251,7 +6286,7 @@ function jr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6251
6286
|
style: { opacity: .4 },
|
|
6252
6287
|
children: n ?? "·"
|
|
6253
6288
|
}), /* @__PURE__ */ u("a", {
|
|
6254
|
-
href:
|
|
6289
|
+
href: Fr(e, e === f),
|
|
6255
6290
|
hrefLang: e,
|
|
6256
6291
|
"aria-current": e === p ? "true" : void 0,
|
|
6257
6292
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -6261,7 +6296,7 @@ function jr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6261
6296
|
textDecoration: "none",
|
|
6262
6297
|
cursor: s ? "default" : "pointer"
|
|
6263
6298
|
},
|
|
6264
|
-
children:
|
|
6299
|
+
children: Pr(e, t)
|
|
6265
6300
|
})]
|
|
6266
6301
|
}, e))]
|
|
6267
6302
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -6272,7 +6307,7 @@ function jr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6272
6307
|
value: p,
|
|
6273
6308
|
onChange: s ? void 0 : (e) => {
|
|
6274
6309
|
let t = e.target.value;
|
|
6275
|
-
window.location.assign(
|
|
6310
|
+
window.location.assign(Fr(t, t === f));
|
|
6276
6311
|
},
|
|
6277
6312
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
6278
6313
|
style: {
|
|
@@ -6286,57 +6321,682 @@ function jr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6286
6321
|
},
|
|
6287
6322
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
6288
6323
|
value: e,
|
|
6289
|
-
children:
|
|
6324
|
+
children: Pr(e, t)
|
|
6290
6325
|
}, e))
|
|
6291
6326
|
})]
|
|
6292
6327
|
});
|
|
6293
6328
|
}
|
|
6294
6329
|
//#endregion
|
|
6295
6330
|
//#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:
|
|
6331
|
+
var Lr = [
|
|
6332
|
+
or,
|
|
6333
|
+
Tr,
|
|
6334
|
+
vr,
|
|
6335
|
+
Er
|
|
6336
|
+
], Rr = {
|
|
6337
|
+
SiteLoginForm: gr,
|
|
6338
|
+
SiteAccountMenu: _r,
|
|
6339
|
+
SiteLanguagePicker: Ir,
|
|
6340
|
+
CookieConsent: wr,
|
|
6341
|
+
SiteSearch: jr
|
|
6307
6342
|
};
|
|
6308
|
-
new Set(
|
|
6343
|
+
new Set(Lr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
6309
6344
|
//#endregion
|
|
6310
|
-
//#region ../ui/src/components/builder/
|
|
6311
|
-
var
|
|
6312
|
-
|
|
6313
|
-
|
|
6345
|
+
//#region ../ui/src/components/builder/three/runtime.js
|
|
6346
|
+
var zr = "0.185.1", Br = "4.3.1", Vr = "https://cdn.jsdelivr.net/npm", Hr = `${Vr}/three@${zr}/build/three.module.js`, Ur = `${Vr}/@google/model-viewer@${Br}/dist/model-viewer.min.js`, Wr = (e) => import(
|
|
6347
|
+
/* @vite-ignore */
|
|
6348
|
+
/* webpackIgnore: true */
|
|
6349
|
+
e
|
|
6350
|
+
), Gr = /* @__PURE__ */ new Map();
|
|
6351
|
+
function Kr(e) {
|
|
6352
|
+
if (Gr.has(e)) return Gr.get(e);
|
|
6353
|
+
if (typeof window > "u") return new Promise(() => {});
|
|
6354
|
+
let t = Wr(e).catch((t) => {
|
|
6355
|
+
throw Gr.delete(e), t;
|
|
6356
|
+
});
|
|
6357
|
+
return Gr.set(e, t), t;
|
|
6358
|
+
}
|
|
6359
|
+
var qr = () => Kr(Hr);
|
|
6360
|
+
function Jr() {
|
|
6361
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Kr(Ur);
|
|
6362
|
+
}
|
|
6363
|
+
var Yr = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Xr = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
6364
|
+
function Zr(e, t) {
|
|
6365
|
+
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
6366
|
+
n = requestAnimationFrame(o), i ||= e;
|
|
6367
|
+
let a = r ? (e - r) / 1e3 : 0;
|
|
6368
|
+
r = e, t(a, (e - i) / 1e3);
|
|
6369
|
+
}, s = () => {
|
|
6370
|
+
n && cancelAnimationFrame(n), n = 0, r = 0;
|
|
6371
|
+
}, c = () => {
|
|
6372
|
+
let e = a && document.visibilityState !== "hidden";
|
|
6373
|
+
e && !n ? n = requestAnimationFrame(o) : !e && n && s();
|
|
6374
|
+
};
|
|
6375
|
+
t(0, 0);
|
|
6376
|
+
let l = typeof IntersectionObserver > "u" ? null : new IntersectionObserver((e) => {
|
|
6377
|
+
a = e.some((e) => e.isIntersecting), c();
|
|
6378
|
+
}, { rootMargin: "120px" });
|
|
6379
|
+
return l && e && l.observe(e), document.addEventListener("visibilitychange", c), c(), () => {
|
|
6380
|
+
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
6381
|
+
};
|
|
6382
|
+
}
|
|
6383
|
+
function Qr(e, t, n = {}) {
|
|
6384
|
+
let r = {
|
|
6385
|
+
radius: n.distance ?? 4,
|
|
6386
|
+
polar: n.polar ?? Math.PI / 2.4,
|
|
6387
|
+
azimuth: n.azimuth ?? .6,
|
|
6388
|
+
target: n.target ?? {
|
|
6389
|
+
x: 0,
|
|
6390
|
+
y: 0,
|
|
6391
|
+
z: 0
|
|
6392
|
+
}
|
|
6393
|
+
}, i = { ...r }, a = n.minDistance ?? .4, o = n.maxDistance ?? 200, s = n.damping ?? .12, c = .05, l = null, u = (e) => {
|
|
6394
|
+
e.button !== void 0 && e.button !== 0 || (l = {
|
|
6395
|
+
x: e.clientX,
|
|
6396
|
+
y: e.clientY,
|
|
6397
|
+
id: e.pointerId
|
|
6398
|
+
}, t.setPointerCapture?.(e.pointerId));
|
|
6399
|
+
}, d = (e) => {
|
|
6400
|
+
if (!l || e.pointerId !== l.id) return;
|
|
6401
|
+
let t = e.clientX - l.x, n = e.clientY - l.y;
|
|
6402
|
+
l = {
|
|
6403
|
+
...l,
|
|
6404
|
+
x: e.clientX,
|
|
6405
|
+
y: e.clientY
|
|
6406
|
+
}, i.azimuth -= t * .006, i.polar = Math.max(c, Math.min(Math.PI - c, i.polar - n * .006)), e.preventDefault();
|
|
6407
|
+
}, f = (e) => {
|
|
6408
|
+
l && e.pointerId === l.id && t.releasePointerCapture?.(e.pointerId), l = null;
|
|
6409
|
+
}, p = (e) => {
|
|
6410
|
+
n.enableZoom !== !1 && (e.preventDefault(), i.radius = Math.max(a, Math.min(o, i.radius * (1 + Math.sign(e.deltaY) * .12))));
|
|
6411
|
+
};
|
|
6412
|
+
return t.addEventListener("pointerdown", u), t.addEventListener("pointermove", d), t.addEventListener("pointerup", f), t.addEventListener("pointercancel", f), t.addEventListener("wheel", p, { passive: !1 }), {
|
|
6413
|
+
update: () => {
|
|
6414
|
+
r.radius += (i.radius - r.radius) * s, r.polar += (i.polar - r.polar) * s, r.azimuth += (i.azimuth - r.azimuth) * s;
|
|
6415
|
+
let t = Math.sin(r.polar);
|
|
6416
|
+
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);
|
|
6417
|
+
},
|
|
6418
|
+
dragging: () => !!l,
|
|
6419
|
+
autoSpin: (e, t) => {
|
|
6420
|
+
!l && e && (i.azimuth += e * t);
|
|
6421
|
+
},
|
|
6422
|
+
frame: (e, t) => {
|
|
6423
|
+
i.radius = Math.max(a, Math.min(o, e)), r.radius = i.radius, t && (r.target = { ...t }, i.target = { ...t });
|
|
6424
|
+
},
|
|
6425
|
+
dispose: () => {
|
|
6426
|
+
t.removeEventListener("pointerdown", u), t.removeEventListener("pointermove", d), t.removeEventListener("pointerup", f), t.removeEventListener("pointercancel", f), t.removeEventListener("wheel", p);
|
|
6427
|
+
}
|
|
6428
|
+
};
|
|
6429
|
+
}
|
|
6430
|
+
//#endregion
|
|
6431
|
+
//#region ../ui/src/components/builder/three/views.jsx
|
|
6432
|
+
var $r = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ei = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, ti = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180;
|
|
6433
|
+
function ni({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
6434
|
+
return /* @__PURE__ */ d("div", {
|
|
6435
|
+
ref: r,
|
|
6436
|
+
style: {
|
|
6437
|
+
...A(i),
|
|
6438
|
+
minHeight: $r(n, 320),
|
|
6439
|
+
display: "flex",
|
|
6440
|
+
flexDirection: "column",
|
|
6441
|
+
alignItems: "center",
|
|
6442
|
+
justifyContent: "center",
|
|
6443
|
+
gap: 6,
|
|
6444
|
+
border: "1px dashed rgba(148,163,184,.55)",
|
|
6445
|
+
borderRadius: 10,
|
|
6446
|
+
background: "rgba(148,163,184,.08)",
|
|
6447
|
+
...q,
|
|
6448
|
+
color: "rgba(100,116,139,.95)",
|
|
6449
|
+
fontSize: 13,
|
|
6450
|
+
textAlign: "center",
|
|
6451
|
+
padding: 16
|
|
6452
|
+
},
|
|
6453
|
+
children: [/* @__PURE__ */ u("div", {
|
|
6454
|
+
style: { fontWeight: 600 },
|
|
6455
|
+
children: e
|
|
6456
|
+
}), t ? /* @__PURE__ */ u("div", {
|
|
6457
|
+
style: {
|
|
6458
|
+
fontSize: 11,
|
|
6459
|
+
opacity: .8,
|
|
6460
|
+
maxWidth: 320
|
|
6461
|
+
},
|
|
6462
|
+
children: t
|
|
6463
|
+
}) : null]
|
|
6464
|
+
});
|
|
6465
|
+
}
|
|
6466
|
+
function ri({ 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 }) {
|
|
6467
|
+
let [y, b] = c(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = c(!1);
|
|
6468
|
+
i(() => {
|
|
6469
|
+
if (y || !e) return;
|
|
6470
|
+
let t = !0;
|
|
6471
|
+
return Jr().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
6472
|
+
t = !1;
|
|
6473
|
+
};
|
|
6474
|
+
}, [y, e]);
|
|
6475
|
+
let C = {
|
|
6476
|
+
...A(g),
|
|
6477
|
+
display: "block",
|
|
6478
|
+
width: "100%",
|
|
6479
|
+
minHeight: $r(r, 360),
|
|
6480
|
+
height: $r(r, 360),
|
|
6481
|
+
backgroundColor: a || "transparent",
|
|
6482
|
+
borderRadius: A(g).borderRadius ?? void 0
|
|
6483
|
+
};
|
|
6484
|
+
if (!e) return v ? /* @__PURE__ */ u(ni, {
|
|
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 && !Yr()),
|
|
6520
|
+
"auto-rotate-delay": T ? String($r(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(ei(p, 100)),
|
|
6525
|
+
exposure: String(ei(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 ii = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), ai = [
|
|
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"), oi = {
|
|
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 si(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 ci(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 li({ 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, b] = c(""), x = typeof t == "string" && t.trim() ? t : oi[e] ?? oi.gradient, S = String(n ?? ""), C = String(r ?? ""), w = String(a ?? ""), T = ei(o, 100), E = Math.max(.05, ei(l, 100));
|
|
6638
|
+
return i(() => {
|
|
6639
|
+
let e = _.current, t = v.current;
|
|
6640
|
+
if (!e || !t) return;
|
|
6641
|
+
let n = e.getContext("webgl", {
|
|
6642
|
+
antialias: !0,
|
|
6643
|
+
alpha: !0,
|
|
6644
|
+
premultipliedAlpha: !1
|
|
6645
|
+
});
|
|
6646
|
+
if (!n) {
|
|
6647
|
+
b("WebGL is not available in this browser");
|
|
6648
|
+
return;
|
|
6649
|
+
}
|
|
6650
|
+
let r = null;
|
|
6651
|
+
try {
|
|
6652
|
+
let e = ci(n, n.VERTEX_SHADER, ii), t = ci(n, n.FRAGMENT_SHADER, ai + x);
|
|
6653
|
+
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");
|
|
6654
|
+
b("");
|
|
6655
|
+
} catch (e) {
|
|
6656
|
+
b(e?.message || "Shader failed to compile");
|
|
6657
|
+
return;
|
|
6658
|
+
}
|
|
6659
|
+
n.useProgram(r);
|
|
6660
|
+
let i = n.createBuffer();
|
|
6661
|
+
n.bindBuffer(n.ARRAY_BUFFER, i), n.bufferData(n.ARRAY_BUFFER, new Float32Array([
|
|
6662
|
+
-1,
|
|
6663
|
+
-1,
|
|
6664
|
+
3,
|
|
6665
|
+
-1,
|
|
6666
|
+
-1,
|
|
6667
|
+
3
|
|
6668
|
+
]), n.STATIC_DRAW);
|
|
6669
|
+
let a = n.getAttribLocation(r, "p");
|
|
6670
|
+
n.enableVertexAttribArray(a), n.vertexAttribPointer(a, 2, n.FLOAT, !1, 0, 0);
|
|
6671
|
+
let o = (e) => n.getUniformLocation(r, e), s = {
|
|
6672
|
+
res: o("u_res"),
|
|
6673
|
+
time: o("u_time"),
|
|
6674
|
+
mouse: o("u_mouse"),
|
|
6675
|
+
a: o("u_a"),
|
|
6676
|
+
b: o("u_b"),
|
|
6677
|
+
c: o("u_c"),
|
|
6678
|
+
scale: o("u_scale")
|
|
6679
|
+
}, c = {
|
|
6680
|
+
x: 0,
|
|
6681
|
+
y: 0
|
|
6682
|
+
}, l = (t) => {
|
|
6683
|
+
let n = e.getBoundingClientRect();
|
|
6684
|
+
!n.width || !n.height || (c.x = ((t.clientX - n.left) / n.width - .5) * 2, c.y = (.5 - (t.clientY - n.top) / n.height) * 2);
|
|
6685
|
+
};
|
|
6686
|
+
p !== !1 && t.addEventListener("pointermove", l);
|
|
6687
|
+
let u = () => {
|
|
6688
|
+
let r = Xr(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
6689
|
+
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
6690
|
+
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6691
|
+
d?.observe(t), u();
|
|
6692
|
+
let f = Yr(), m = {
|
|
6693
|
+
a: si(S, [
|
|
6694
|
+
.35,
|
|
6695
|
+
.4,
|
|
6696
|
+
.95
|
|
6697
|
+
]),
|
|
6698
|
+
b: si(C, [
|
|
6699
|
+
.05,
|
|
6700
|
+
.06,
|
|
6701
|
+
.16
|
|
6702
|
+
]),
|
|
6703
|
+
c: si(w, [
|
|
6704
|
+
.95,
|
|
6705
|
+
.35,
|
|
6706
|
+
.6
|
|
6707
|
+
])
|
|
6708
|
+
}, h = {};
|
|
6709
|
+
return h.stop = Zr(t, (t, r) => {
|
|
6710
|
+
u(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (f ? 0 : r) * T), 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, E), n.drawArrays(n.TRIANGLES, 0, 3), f && h.stop?.();
|
|
6711
|
+
}), () => {
|
|
6712
|
+
h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i), n.getExtension("WEBGL_lose_context")?.loseContext();
|
|
6713
|
+
};
|
|
6714
|
+
}, [
|
|
6715
|
+
x,
|
|
6716
|
+
S,
|
|
6717
|
+
C,
|
|
6718
|
+
w,
|
|
6719
|
+
T,
|
|
6720
|
+
E,
|
|
6721
|
+
p
|
|
6722
|
+
]), /* @__PURE__ */ d("div", {
|
|
6723
|
+
ref: (e) => {
|
|
6724
|
+
v.current = e, typeof h == "function" && h(e);
|
|
6725
|
+
},
|
|
6726
|
+
style: {
|
|
6727
|
+
...A(m),
|
|
6728
|
+
position: A(m).position ?? "relative",
|
|
6729
|
+
minHeight: $r(f, 320),
|
|
6730
|
+
overflow: "hidden"
|
|
6731
|
+
},
|
|
6732
|
+
children: [/* @__PURE__ */ u("canvas", {
|
|
6733
|
+
ref: _,
|
|
6734
|
+
style: {
|
|
6735
|
+
display: "block",
|
|
6736
|
+
width: "100%",
|
|
6737
|
+
height: "100%",
|
|
6738
|
+
position: "absolute",
|
|
6739
|
+
inset: 0
|
|
6740
|
+
}
|
|
6741
|
+
}), y && g ? /* @__PURE__ */ u("div", {
|
|
6742
|
+
style: {
|
|
6743
|
+
position: "absolute",
|
|
6744
|
+
inset: 0,
|
|
6745
|
+
display: "flex",
|
|
6746
|
+
alignItems: "center",
|
|
6747
|
+
justifyContent: "center",
|
|
6748
|
+
padding: 12,
|
|
6749
|
+
background: "rgba(15,23,42,.75)",
|
|
6750
|
+
...q,
|
|
6751
|
+
color: "#fecaca",
|
|
6752
|
+
fontSize: 11,
|
|
6753
|
+
whiteSpace: "pre-wrap",
|
|
6754
|
+
overflow: "auto"
|
|
6755
|
+
},
|
|
6756
|
+
children: y
|
|
6757
|
+
}) : null]
|
|
6758
|
+
});
|
|
6759
|
+
}
|
|
6760
|
+
function ui(e, t) {
|
|
6761
|
+
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
6762
|
+
r.deleteAttribute("uv");
|
|
6763
|
+
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
6764
|
+
side: e.BackSide,
|
|
6765
|
+
color: 6710886
|
|
6766
|
+
}));
|
|
6767
|
+
i.scale.setScalar(12), n.add(i);
|
|
6768
|
+
let a = (t, i, a, o, s, c, l, u) => {
|
|
6769
|
+
let d = new e.Mesh(r, new e.MeshBasicMaterial());
|
|
6770
|
+
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);
|
|
6771
|
+
};
|
|
6772
|
+
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);
|
|
6773
|
+
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
6774
|
+
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
6775
|
+
}
|
|
6776
|
+
var di = {
|
|
6777
|
+
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
6778
|
+
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
6779
|
+
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
6780
|
+
knot: (e) => new e.TorusKnotGeometry(.44, .15, 128, 24),
|
|
6781
|
+
cone: (e) => new e.ConeGeometry(.55, 1.1, 48),
|
|
6782
|
+
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
6783
|
+
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
6784
|
+
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
6785
|
+
}, fi = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
6786
|
+
function pi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: a, spinSpeed: o, controls: l, ground: d, height: f, style: p, nodeRef: m, inert: h }) {
|
|
6787
|
+
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 && !Yr(), S = l !== !1 && !h;
|
|
6788
|
+
return i(() => {
|
|
6789
|
+
let e = g.current;
|
|
6790
|
+
if (!e) return;
|
|
6791
|
+
let i = !0, a = null;
|
|
6792
|
+
return qr().then((s) => {
|
|
6793
|
+
if (!i || !e) return;
|
|
6794
|
+
let c = new s.WebGLRenderer({
|
|
6795
|
+
antialias: !0,
|
|
6796
|
+
alpha: !t
|
|
6797
|
+
});
|
|
6798
|
+
c.setPixelRatio(Xr()), 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);
|
|
6799
|
+
let l = new s.Scene();
|
|
6800
|
+
t && (l.background = new s.Color(t)), l.environment = ui(s, c);
|
|
6801
|
+
let u = new s.PerspectiveCamera(fi(r, 45), 1, .1, 400), f = Qr(u, c.domElement, {
|
|
6802
|
+
distance: fi(n, 5),
|
|
6803
|
+
enableZoom: S
|
|
6804
|
+
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
6805
|
+
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));
|
|
6806
|
+
let m = [], h = new s.Group();
|
|
6807
|
+
for (let e of y) {
|
|
6808
|
+
let t = (di[e.shape] ?? di.box)(s), n = new s.MeshStandardMaterial({
|
|
6809
|
+
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
6810
|
+
metalness: Math.min(1, Math.max(0, ei(e.metalness, 10))),
|
|
6811
|
+
roughness: Math.min(1, Math.max(0, ei(e.roughness, 35))),
|
|
6812
|
+
transparent: ei(e.opacity, 100) < 1,
|
|
6813
|
+
opacity: Math.min(1, Math.max(0, ei(e.opacity, 100))),
|
|
6814
|
+
flatShading: e.flat === !0,
|
|
6815
|
+
wireframe: e.wireframe === !0,
|
|
6816
|
+
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
6817
|
+
}), r = new s.Mesh(t, n), i = fi(e.scale, 1);
|
|
6818
|
+
r.position.set(fi(e.x, 0), fi(e.y, 0), fi(e.z, 0)), r.rotation.set(fi(e.rx, 0) * Math.PI / 180, fi(e.ry, 0) * Math.PI / 180, fi(e.rz, 0) * Math.PI / 180), r.scale.setScalar(i > 0 ? i : 1), r.castShadow = !0, r.receiveShadow = !0, r.userData.spin = ti(e.spin), h.add(r), m.push(t, n);
|
|
6819
|
+
}
|
|
6820
|
+
l.add(h);
|
|
6821
|
+
let g = null;
|
|
6822
|
+
if (d !== !1) {
|
|
6823
|
+
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
6824
|
+
g = new s.Mesh(t, e), g.rotation.x = -Math.PI / 2, g.position.y = fi(d === !0 ? 0 : d, -.85), g.receiveShadow = !0, l.add(g), m.push(t, e);
|
|
6825
|
+
}
|
|
6826
|
+
let _ = () => {
|
|
6827
|
+
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
6828
|
+
c.setSize(t, n, !1), u.aspect = t / n, u.updateProjectionMatrix();
|
|
6829
|
+
}, v = typeof ResizeObserver > "u" ? null : new ResizeObserver(_);
|
|
6830
|
+
v?.observe(e), _();
|
|
6831
|
+
let b = ti(Number.isFinite(Number(o)) ? o : 20), C = Zr(e, (e) => {
|
|
6832
|
+
f.autoSpin(x ? b : 0, e), f.update();
|
|
6833
|
+
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
6834
|
+
c.render(l, u);
|
|
6835
|
+
});
|
|
6836
|
+
a = () => {
|
|
6837
|
+
C(), v?.disconnect(), f.dispose();
|
|
6838
|
+
for (let e of m) e.dispose?.();
|
|
6839
|
+
l.environment?.dispose?.(), c.dispose(), c.domElement.remove();
|
|
6840
|
+
};
|
|
6841
|
+
}, () => {
|
|
6842
|
+
i && v(!0);
|
|
6843
|
+
}), () => {
|
|
6844
|
+
i = !1, a?.();
|
|
6845
|
+
};
|
|
6846
|
+
}, [
|
|
6847
|
+
b,
|
|
6848
|
+
t,
|
|
6849
|
+
n,
|
|
6850
|
+
r,
|
|
6851
|
+
x,
|
|
6852
|
+
o,
|
|
6853
|
+
S,
|
|
6854
|
+
d
|
|
6855
|
+
]), _ && h ? /* @__PURE__ */ u(ni, {
|
|
6856
|
+
nodeRef: m,
|
|
6857
|
+
style: p,
|
|
6858
|
+
height: f,
|
|
6859
|
+
label: "3D Scene",
|
|
6860
|
+
note: "The 3D engine could not be loaded. Check the connection and try again."
|
|
6861
|
+
}) : /* @__PURE__ */ u("div", {
|
|
6862
|
+
ref: (e) => {
|
|
6863
|
+
g.current = e, typeof m == "function" && m(e);
|
|
6864
|
+
},
|
|
6865
|
+
style: {
|
|
6866
|
+
...A(p),
|
|
6867
|
+
minHeight: $r(f, 380),
|
|
6868
|
+
height: $r(f, 380),
|
|
6869
|
+
overflow: "hidden",
|
|
6870
|
+
touchAction: S ? "pan-y" : void 0
|
|
6871
|
+
}
|
|
6872
|
+
});
|
|
6873
|
+
}
|
|
6874
|
+
function mi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o }) {
|
|
6875
|
+
let l = s(null), [d, f] = c("");
|
|
6876
|
+
return i(() => {
|
|
6877
|
+
let t = l.current;
|
|
6878
|
+
if (o || !t || typeof e != "string" || !e.trim()) return;
|
|
6879
|
+
let r = !0, i = null;
|
|
6880
|
+
return qr().then((a) => {
|
|
6881
|
+
if (!r || !t) return;
|
|
6882
|
+
let o = new a.WebGLRenderer({
|
|
6883
|
+
antialias: !0,
|
|
6884
|
+
alpha: !n
|
|
6885
|
+
});
|
|
6886
|
+
o.setPixelRatio(Xr()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
6887
|
+
let s = new a.Scene();
|
|
6888
|
+
n && (s.background = new a.Color(n));
|
|
6889
|
+
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
6890
|
+
c.position.set(0, 1.2, 4);
|
|
6891
|
+
let l = null;
|
|
6892
|
+
try {
|
|
6893
|
+
l = Function("ctx", `"use strict";\n${e}`)({
|
|
6894
|
+
THREE: a,
|
|
6895
|
+
scene: s,
|
|
6896
|
+
camera: c,
|
|
6897
|
+
renderer: o,
|
|
6898
|
+
canvas: o.domElement,
|
|
6899
|
+
host: t
|
|
6900
|
+
});
|
|
6901
|
+
} catch (e) {
|
|
6902
|
+
f(e?.message || String(e));
|
|
6903
|
+
}
|
|
6904
|
+
let u = () => {
|
|
6905
|
+
let e = Math.max(1, t.clientWidth), n = Math.max(1, t.clientHeight);
|
|
6906
|
+
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
6907
|
+
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6908
|
+
d?.observe(t), u();
|
|
6909
|
+
let p = !1, m = Zr(t, (e, t) => {
|
|
6910
|
+
if (!p && typeof l?.frame == "function") try {
|
|
6911
|
+
l.frame(e, t);
|
|
6912
|
+
} catch (e) {
|
|
6913
|
+
p = !0, f(e?.message || String(e));
|
|
6914
|
+
}
|
|
6915
|
+
o.render(s, c);
|
|
6916
|
+
});
|
|
6917
|
+
i = () => {
|
|
6918
|
+
m(), d?.disconnect();
|
|
6919
|
+
try {
|
|
6920
|
+
l?.dispose?.();
|
|
6921
|
+
} catch {}
|
|
6922
|
+
o.dispose(), o.domElement.remove();
|
|
6923
|
+
};
|
|
6924
|
+
}), () => {
|
|
6925
|
+
r = !1, i?.();
|
|
6926
|
+
};
|
|
6927
|
+
}, [
|
|
6928
|
+
e,
|
|
6929
|
+
o,
|
|
6930
|
+
n
|
|
6931
|
+
]), o ? /* @__PURE__ */ u(ni, {
|
|
6932
|
+
nodeRef: a,
|
|
6933
|
+
style: r,
|
|
6934
|
+
height: t,
|
|
6935
|
+
label: "three.js",
|
|
6936
|
+
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."
|
|
6937
|
+
}) : /* @__PURE__ */ u("div", {
|
|
6938
|
+
ref: (e) => {
|
|
6939
|
+
l.current = e, typeof a == "function" && a(e);
|
|
6940
|
+
},
|
|
6941
|
+
style: {
|
|
6942
|
+
...A(r),
|
|
6943
|
+
minHeight: $r(t, 380),
|
|
6944
|
+
height: $r(t, 380),
|
|
6945
|
+
overflow: "hidden",
|
|
6946
|
+
position: "relative",
|
|
6947
|
+
touchAction: "pan-y"
|
|
6948
|
+
},
|
|
6949
|
+
children: d ? /* @__PURE__ */ u("div", {
|
|
6950
|
+
style: {
|
|
6951
|
+
position: "absolute",
|
|
6952
|
+
left: 8,
|
|
6953
|
+
top: 8,
|
|
6954
|
+
right: 8,
|
|
6955
|
+
padding: "6px 8px",
|
|
6956
|
+
borderRadius: 6,
|
|
6957
|
+
background: "rgba(127,29,29,.85)",
|
|
6958
|
+
...q,
|
|
6959
|
+
color: "#fee2e2",
|
|
6960
|
+
fontSize: 11
|
|
6961
|
+
},
|
|
6962
|
+
children: d
|
|
6963
|
+
}) : null
|
|
6964
|
+
});
|
|
6965
|
+
}
|
|
6966
|
+
var hi = {
|
|
6967
|
+
ModelViewerBlock: ri,
|
|
6968
|
+
ShaderBlock: li,
|
|
6969
|
+
SceneBlock: pi,
|
|
6970
|
+
ThreeCanvasBlock: mi
|
|
6971
|
+
}, gi = /* @__PURE__ */ new Map();
|
|
6972
|
+
function _i(e) {
|
|
6973
|
+
if (gi.has(e)) return gi.get(e);
|
|
6314
6974
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
6315
6975
|
/* @vite-ignore */
|
|
6316
6976
|
/* webpackIgnore: true */
|
|
6317
6977
|
t
|
|
6318
6978
|
).finally(() => URL.revokeObjectURL(t));
|
|
6319
|
-
return
|
|
6979
|
+
return gi.set(e, n), n;
|
|
6320
6980
|
}
|
|
6321
|
-
function
|
|
6981
|
+
function vi(e) {
|
|
6322
6982
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
6323
6983
|
return n && typeof n == "object" ? n : {};
|
|
6324
6984
|
}
|
|
6325
6985
|
//#endregion
|
|
6326
6986
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
6327
|
-
async function
|
|
6328
|
-
let n = await
|
|
6987
|
+
async function yi(e, t) {
|
|
6988
|
+
let n = await _i(e);
|
|
6329
6989
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
6330
6990
|
}
|
|
6331
|
-
var
|
|
6991
|
+
var bi = {
|
|
6332
6992
|
padding: "10px 12px",
|
|
6333
6993
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
6334
6994
|
borderRadius: 8,
|
|
6335
6995
|
fontSize: 12,
|
|
6336
6996
|
opacity: .6
|
|
6337
6997
|
};
|
|
6338
|
-
function
|
|
6339
|
-
let c = r(
|
|
6998
|
+
function xi({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
6999
|
+
let c = r(Z), l = vi(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
6340
7000
|
tenant: c?.tenant ?? "",
|
|
6341
7001
|
apiUrl: c?.apiUrl ?? "/api",
|
|
6342
7002
|
locale: c?.locale ?? "",
|
|
@@ -6348,7 +7008,7 @@ function zr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
6348
7008
|
let e = f.current;
|
|
6349
7009
|
if (!l?.code || !e) return;
|
|
6350
7010
|
let n = !0;
|
|
6351
|
-
return
|
|
7011
|
+
return yi(l.code, t).then((e) => {
|
|
6352
7012
|
if (!(!n || !e || !f.current)) {
|
|
6353
7013
|
p.current = e;
|
|
6354
7014
|
try {
|
|
@@ -6378,7 +7038,7 @@ function zr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
6378
7038
|
}) : /* @__PURE__ */ d("div", {
|
|
6379
7039
|
ref: o,
|
|
6380
7040
|
style: {
|
|
6381
|
-
...
|
|
7041
|
+
...bi,
|
|
6382
7042
|
...A(a)
|
|
6383
7043
|
},
|
|
6384
7044
|
children: [
|
|
@@ -6390,12 +7050,13 @@ function zr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
6390
7050
|
}
|
|
6391
7051
|
//#endregion
|
|
6392
7052
|
//#region ../ui/src/components/builder/render.jsx
|
|
6393
|
-
var
|
|
6394
|
-
...
|
|
6395
|
-
...
|
|
6396
|
-
|
|
7053
|
+
var Si = {
|
|
7054
|
+
...ar,
|
|
7055
|
+
...Rr,
|
|
7056
|
+
...hi,
|
|
7057
|
+
PluginBlock: xi
|
|
6397
7058
|
};
|
|
6398
|
-
function
|
|
7059
|
+
function Ci(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
6399
7060
|
let o = n[t];
|
|
6400
7061
|
if (!o || o.hidden) return null;
|
|
6401
7062
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -6403,11 +7064,11 @@ function Vr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
6403
7064
|
let n = o.props?.componentId, s = r?.[n];
|
|
6404
7065
|
if (!s?.template || i.has(n)) return null;
|
|
6405
7066
|
let c = new Set(i).add(n);
|
|
6406
|
-
return /* @__PURE__ */ u(e, { children:
|
|
7067
|
+
return /* @__PURE__ */ u(e, { children: Ci(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
6407
7068
|
}
|
|
6408
|
-
let l =
|
|
7069
|
+
let l = Si[s];
|
|
6409
7070
|
if (!l) return null;
|
|
6410
|
-
let d = (o.nodes ?? []).map((e) =>
|
|
7071
|
+
let d = (o.nodes ?? []).map((e) => Ci(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Ci(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
6411
7072
|
...c,
|
|
6412
7073
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
6413
7074
|
linked: p,
|
|
@@ -6416,16 +7077,16 @@ function Vr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
6416
7077
|
},
|
|
6417
7078
|
children: d.length ? d : void 0
|
|
6418
7079
|
}, t);
|
|
6419
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
7080
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(hr, {
|
|
6420
7081
|
when: c.when,
|
|
6421
7082
|
children: m
|
|
6422
7083
|
}, t) : m;
|
|
6423
7084
|
}
|
|
6424
7085
|
//#endregion
|
|
6425
7086
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
6426
|
-
var
|
|
6427
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
6428
|
-
function
|
|
7087
|
+
var wi = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ti = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ue(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
7088
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(ue(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
7089
|
+
function Ei({ 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
7090
|
let b = s?.js?.trim();
|
|
6430
7091
|
if (i(() => {
|
|
6431
7092
|
if (!b) return;
|
|
@@ -6434,40 +7095,40 @@ function Wr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
6434
7095
|
}, [b]), !e?.ROOT) return null;
|
|
6435
7096
|
let x = {
|
|
6436
7097
|
lang: m || void 0,
|
|
6437
|
-
dir:
|
|
7098
|
+
dir: X(h, m)
|
|
6438
7099
|
}, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
|
|
6439
7100
|
minHeight: "100%",
|
|
6440
7101
|
display: "flex",
|
|
6441
7102
|
flexDirection: "column"
|
|
6442
|
-
}, w =
|
|
7103
|
+
}, w = Ci("ROOT", e, n), T = o(() => ({ render: (t, r) => Ci(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
7104
|
rel: "stylesheet",
|
|
6444
7105
|
precedence: "default",
|
|
6445
7106
|
href: g(e)
|
|
6446
|
-
}, e)), P =
|
|
6447
|
-
return r === "auto" ? /* @__PURE__ */ u(
|
|
7107
|
+
}, e)), P = Ti(j);
|
|
7108
|
+
return r === "auto" ? /* @__PURE__ */ u(Z.Provider, {
|
|
6448
7109
|
value: {
|
|
6449
7110
|
tenant: l || "",
|
|
6450
7111
|
apiUrl: f || "/api",
|
|
6451
7112
|
locale: m || "",
|
|
6452
7113
|
settings: _ ?? null
|
|
6453
7114
|
},
|
|
6454
|
-
children: /* @__PURE__ */ u(
|
|
7115
|
+
children: /* @__PURE__ */ u(mr, {
|
|
6455
7116
|
initialUser: v,
|
|
6456
|
-
children: /* @__PURE__ */ u(
|
|
7117
|
+
children: /* @__PURE__ */ u(xe.Provider, {
|
|
6457
7118
|
value: p ?? null,
|
|
6458
|
-
children: /* @__PURE__ */ u(
|
|
7119
|
+
children: /* @__PURE__ */ u(we.Provider, {
|
|
6459
7120
|
value: T,
|
|
6460
7121
|
children: /* @__PURE__ */ d("div", {
|
|
6461
7122
|
...x,
|
|
6462
7123
|
className: "webim-page",
|
|
6463
7124
|
style: {
|
|
6464
7125
|
...C,
|
|
6465
|
-
...
|
|
7126
|
+
...de(t),
|
|
6466
7127
|
...a
|
|
6467
7128
|
},
|
|
6468
7129
|
children: [
|
|
6469
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
6470
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
7130
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${wi(ue(j.light))} }
|
|
7131
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${wi(ue(j.dark))} } }` }),
|
|
6471
7132
|
/* @__PURE__ */ u("style", { children: P }),
|
|
6472
7133
|
N,
|
|
6473
7134
|
/* @__PURE__ */ u("style", { children: S }),
|
|
@@ -6480,25 +7141,25 @@ function Wr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
6480
7141
|
})
|
|
6481
7142
|
})
|
|
6482
7143
|
})
|
|
6483
|
-
}) : /* @__PURE__ */ u(
|
|
7144
|
+
}) : /* @__PURE__ */ u(Z.Provider, {
|
|
6484
7145
|
value: {
|
|
6485
7146
|
tenant: l || "",
|
|
6486
7147
|
apiUrl: f || "/api",
|
|
6487
7148
|
locale: m || "",
|
|
6488
7149
|
settings: _ ?? null
|
|
6489
7150
|
},
|
|
6490
|
-
children: /* @__PURE__ */ u(
|
|
7151
|
+
children: /* @__PURE__ */ u(mr, {
|
|
6491
7152
|
initialUser: v,
|
|
6492
|
-
children: /* @__PURE__ */ u(
|
|
7153
|
+
children: /* @__PURE__ */ u(xe.Provider, {
|
|
6493
7154
|
value: p ?? null,
|
|
6494
|
-
children: /* @__PURE__ */ u(
|
|
7155
|
+
children: /* @__PURE__ */ u(we.Provider, {
|
|
6495
7156
|
value: T,
|
|
6496
7157
|
children: /* @__PURE__ */ d("div", {
|
|
6497
7158
|
...x,
|
|
6498
7159
|
className: "webim-page",
|
|
6499
7160
|
style: {
|
|
6500
7161
|
...C,
|
|
6501
|
-
...
|
|
7162
|
+
...me(t, r),
|
|
6502
7163
|
...a
|
|
6503
7164
|
},
|
|
6504
7165
|
children: [
|
|
@@ -6520,8 +7181,8 @@ function Wr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
6520
7181
|
}
|
|
6521
7182
|
//#endregion
|
|
6522
7183
|
//#region src/WebimContent.jsx
|
|
6523
|
-
function
|
|
6524
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
7184
|
+
function Di({ bundle: e, mode: t = "auto", style: n }) {
|
|
7185
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(Ei, {
|
|
6525
7186
|
blocks: e.blocks,
|
|
6526
7187
|
theme: e.theme,
|
|
6527
7188
|
components: e.components,
|
|
@@ -6533,13 +7194,13 @@ function Gr({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
6533
7194
|
locale: e.locale,
|
|
6534
7195
|
direction: e.direction,
|
|
6535
7196
|
settings: e.settings,
|
|
6536
|
-
mode:
|
|
7197
|
+
mode: ge(t, e.scheme),
|
|
6537
7198
|
style: n
|
|
6538
7199
|
}) : null;
|
|
6539
7200
|
}
|
|
6540
7201
|
//#endregion
|
|
6541
7202
|
//#region src/WebimPage.jsx
|
|
6542
|
-
function
|
|
7203
|
+
function Oi({ 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
7204
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
6544
7205
|
onLoad: m,
|
|
6545
7206
|
onError: h
|
|
@@ -6549,7 +7210,7 @@ function Kr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
6549
7210
|
onError: h
|
|
6550
7211
|
}, i(() => {
|
|
6551
7212
|
let i = !0;
|
|
6552
|
-
return _({ status: "loading" }),
|
|
7213
|
+
return _({ status: "loading" }), ye({
|
|
6553
7214
|
apiUrl: e,
|
|
6554
7215
|
tenant: t,
|
|
6555
7216
|
slug: n,
|
|
@@ -6576,11 +7237,11 @@ function Kr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
6576
7237
|
r,
|
|
6577
7238
|
a,
|
|
6578
7239
|
o
|
|
6579
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
7240
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Di, {
|
|
6580
7241
|
bundle: g.bundle,
|
|
6581
7242
|
mode: l,
|
|
6582
7243
|
style: d
|
|
6583
7244
|
});
|
|
6584
7245
|
}
|
|
6585
7246
|
//#endregion
|
|
6586
|
-
export {
|
|
7247
|
+
export { Ei as PageRenderer, Di as WebimContent, Oi as WebimPage, ye as fetchPage, Ze as renderRichContent, he as resolveTheme };
|