webim-adapter 0.10.0 → 0.13.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 +553 -377
- package/build/webim-embed.js +9 -9
- package/build/webim-ssr.js +519 -343
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -202,26 +202,26 @@ function C(e) {
|
|
|
202
202
|
delete t.textStrokeWidth, delete t.textStrokeColor, (re !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${x(re ?? 1)} ${ie || "currentColor"}`);
|
|
203
203
|
let { clipText: H } = t;
|
|
204
204
|
delete t.clipText, H && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
205
|
-
let { transitions: U, transitionDuration: W, transitionEasing: ae, transitionProperty:
|
|
205
|
+
let { transitions: U, transitionDuration: W, transitionEasing: ae, transitionProperty: oe } = t, G = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
206
206
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
207
|
-
let
|
|
208
|
-
if (W !== void 0 &&
|
|
207
|
+
let se = (Array.isArray(U) ? U : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${G(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
208
|
+
if (W !== void 0 && se.push(`${oe || "all"} ${G(W)} ${ae || "ease"}`), se.length && (t.transition = se.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
209
209
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
210
210
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
211
211
|
}
|
|
212
212
|
delete t.backgroundVideo;
|
|
213
|
-
let { overlayColor:
|
|
214
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
215
|
-
let e = `color-mix(in srgb, ${
|
|
213
|
+
let { overlayColor: K, overlayOpacity: ce } = t;
|
|
214
|
+
if (delete t.overlayColor, delete t.overlayOpacity, K) {
|
|
215
|
+
let e = `color-mix(in srgb, ${K} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
216
216
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
217
217
|
}
|
|
218
218
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
219
219
|
let { backgroundLayers: le } = t;
|
|
220
220
|
delete t.backgroundLayers;
|
|
221
|
-
let
|
|
222
|
-
if (
|
|
221
|
+
let ue = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
|
|
222
|
+
if (ue.length) {
|
|
223
223
|
let e = [], n = [], r = [], i = [], a = [];
|
|
224
|
-
for (let t of
|
|
224
|
+
for (let t of ue) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
225
225
|
else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
226
226
|
else {
|
|
227
227
|
if (!t.src) continue;
|
|
@@ -433,11 +433,17 @@ var H = n({
|
|
|
433
433
|
apiUrl: "/api",
|
|
434
434
|
locale: "",
|
|
435
435
|
settings: null
|
|
436
|
-
}), U = n(null), W =
|
|
436
|
+
}), U = n(null), W = (e) => {
|
|
437
|
+
let t = Number(e?.__page);
|
|
438
|
+
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
439
|
+
if (typeof window > "u") return 1;
|
|
440
|
+
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
441
|
+
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
442
|
+
}, ae = n(null), oe = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
437
443
|
function G(e, t) {
|
|
438
444
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
439
445
|
}
|
|
440
|
-
var
|
|
446
|
+
var se = (e) => {
|
|
441
447
|
let t = [];
|
|
442
448
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
443
449
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -450,33 +456,33 @@ var oe = (e) => {
|
|
|
450
456
|
function K(e) {
|
|
451
457
|
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 ?? "") : 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(" ") : "";
|
|
452
458
|
}
|
|
453
|
-
function
|
|
454
|
-
let n = t?.data ?? {}, r =
|
|
459
|
+
function ce(e, t) {
|
|
460
|
+
let n = t?.data ?? {}, r = se(n);
|
|
455
461
|
if (!r.length) return e;
|
|
456
|
-
let i = RegExp(`:(${r.map(
|
|
462
|
+
let i = RegExp(`:(${r.map(oe).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(G(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
457
463
|
return a(e);
|
|
458
464
|
}
|
|
459
|
-
var
|
|
465
|
+
var le = {
|
|
460
466
|
margin: 0,
|
|
461
467
|
fontWeight: 700,
|
|
462
468
|
lineHeight: 1.2,
|
|
463
469
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
464
|
-
},
|
|
470
|
+
}, ue = { margin: 0 }, q = {
|
|
465
471
|
display: "inline-block",
|
|
466
472
|
textDecoration: "none",
|
|
467
473
|
cursor: "pointer",
|
|
468
474
|
backgroundColor: "var(--page-accent, #111827)",
|
|
469
475
|
color: "var(--page-accent-text, #ffffff)"
|
|
470
|
-
},
|
|
476
|
+
}, de = {
|
|
471
477
|
flexGrow: 1,
|
|
472
478
|
display: "flex",
|
|
473
479
|
flexDirection: "column",
|
|
474
480
|
position: "relative"
|
|
475
|
-
},
|
|
481
|
+
}, fe = {
|
|
476
482
|
display: "flex",
|
|
477
483
|
flexDirection: "column"
|
|
478
484
|
};
|
|
479
|
-
function
|
|
485
|
+
function pe({ style: e }) {
|
|
480
486
|
let t = e?.backgroundVideo;
|
|
481
487
|
if (!t) return null;
|
|
482
488
|
let n = {
|
|
@@ -502,7 +508,7 @@ function fe({ style: e }) {
|
|
|
502
508
|
background: r
|
|
503
509
|
} })] });
|
|
504
510
|
}
|
|
505
|
-
var
|
|
511
|
+
var me = (e, t) => e?.backgroundVideo ? {
|
|
506
512
|
position: "relative",
|
|
507
513
|
...t,
|
|
508
514
|
...C(e)
|
|
@@ -510,24 +516,24 @@ var pe = (e, t) => e?.backgroundVideo ? {
|
|
|
510
516
|
...t,
|
|
511
517
|
...C(e)
|
|
512
518
|
};
|
|
513
|
-
function
|
|
519
|
+
function he({ style: e, nodeRef: t, children: n }) {
|
|
514
520
|
return /* @__PURE__ */ f("div", {
|
|
515
521
|
ref: t,
|
|
516
522
|
style: {
|
|
517
|
-
...
|
|
523
|
+
...de,
|
|
518
524
|
...C(e)
|
|
519
525
|
},
|
|
520
|
-
children: [/* @__PURE__ */ d(
|
|
526
|
+
children: [/* @__PURE__ */ d(pe, { style: e }), n]
|
|
521
527
|
});
|
|
522
528
|
}
|
|
523
|
-
function
|
|
529
|
+
function ge({ style: e, nodeRef: t, children: n }) {
|
|
524
530
|
return /* @__PURE__ */ f("section", {
|
|
525
531
|
ref: t,
|
|
526
|
-
style:
|
|
527
|
-
children: [/* @__PURE__ */ d(
|
|
532
|
+
style: me(e, fe),
|
|
533
|
+
children: [/* @__PURE__ */ d(pe, { style: e }), n]
|
|
528
534
|
});
|
|
529
535
|
}
|
|
530
|
-
function
|
|
536
|
+
function _e({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
531
537
|
let i = t ? {
|
|
532
538
|
position: "relative",
|
|
533
539
|
minHeight: 240
|
|
@@ -536,32 +542,32 @@ function ge({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
536
542
|
ref: n,
|
|
537
543
|
style: i ? {
|
|
538
544
|
...i,
|
|
539
|
-
...
|
|
540
|
-
} :
|
|
541
|
-
children: [/* @__PURE__ */ d(
|
|
545
|
+
...me(e)
|
|
546
|
+
} : me(e),
|
|
547
|
+
children: [/* @__PURE__ */ d(pe, { style: e }), r]
|
|
542
548
|
});
|
|
543
549
|
}
|
|
544
|
-
function
|
|
550
|
+
function ve({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
545
551
|
return /* @__PURE__ */ d(n, {
|
|
546
552
|
ref: a,
|
|
547
553
|
style: {
|
|
548
|
-
...
|
|
554
|
+
...le,
|
|
549
555
|
...C(r)
|
|
550
556
|
},
|
|
551
557
|
children: J(t, e, i)
|
|
552
558
|
});
|
|
553
559
|
}
|
|
554
|
-
var
|
|
560
|
+
var ye = {
|
|
555
561
|
fontFamily: z.mono.value,
|
|
556
562
|
background: "rgba(148, 163, 184, 0.18)",
|
|
557
563
|
padding: "1px 5px",
|
|
558
564
|
borderRadius: 4,
|
|
559
565
|
fontSize: "0.9em"
|
|
560
566
|
};
|
|
561
|
-
function
|
|
567
|
+
function be(e, t = [], n, r) {
|
|
562
568
|
let i = e;
|
|
563
569
|
return t.includes("sup") ? i = /* @__PURE__ */ d("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ d("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ d("code", {
|
|
564
|
-
style:
|
|
570
|
+
style: ye,
|
|
565
571
|
children: i
|
|
566
572
|
})), t.includes("strike") && (i = /* @__PURE__ */ d("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ d("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ d("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ d("strong", { children: i })), n && (i = /* @__PURE__ */ d("a", {
|
|
567
573
|
href: n,
|
|
@@ -577,7 +583,7 @@ function J(e, n, r) {
|
|
|
577
583
|
if (e.parts) return /* @__PURE__ */ d(t, { children: J(e.parts, "", r) }, n);
|
|
578
584
|
let i = e.text;
|
|
579
585
|
return e.sup ? i = /* @__PURE__ */ d("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ d("sub", { children: i })), e.code && (i = /* @__PURE__ */ d("code", {
|
|
580
|
-
style:
|
|
586
|
+
style: ye,
|
|
581
587
|
children: i
|
|
582
588
|
})), e.strike && (i = /* @__PURE__ */ d("s", { children: i })), e.underline && (i = /* @__PURE__ */ d("u", { children: i })), e.italic && (i = /* @__PURE__ */ d("em", { children: i })), e.bold && (i = /* @__PURE__ */ d("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ d("span", {
|
|
583
589
|
style: {
|
|
@@ -594,13 +600,13 @@ function J(e, n, r) {
|
|
|
594
600
|
})), /* @__PURE__ */ d(t, { children: i }, n);
|
|
595
601
|
}) : n;
|
|
596
602
|
}
|
|
597
|
-
function
|
|
603
|
+
function xe({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
598
604
|
return /* @__PURE__ */ d("span", {
|
|
599
605
|
style: C(a),
|
|
600
|
-
children: e?.length ? J(e, t) :
|
|
606
|
+
children: e?.length ? J(e, t) : be(t, n, r, i)
|
|
601
607
|
});
|
|
602
608
|
}
|
|
603
|
-
var
|
|
609
|
+
var Se = {
|
|
604
610
|
h1: 40,
|
|
605
611
|
h2: 32,
|
|
606
612
|
h3: 26,
|
|
@@ -608,7 +614,7 @@ var xe = {
|
|
|
608
614
|
h5: 19,
|
|
609
615
|
h6: 16
|
|
610
616
|
};
|
|
611
|
-
function
|
|
617
|
+
function Ce({ align: e = "center", width: t, wrap: n } = {}) {
|
|
612
618
|
let r = t ? `${t}%` : void 0;
|
|
613
619
|
if (e === "full") return { width: "100%" };
|
|
614
620
|
let i = e === "left" || e === "right";
|
|
@@ -642,7 +648,7 @@ function Se({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
642
648
|
marginRight: "auto"
|
|
643
649
|
};
|
|
644
650
|
}
|
|
645
|
-
function
|
|
651
|
+
function we(e = [], t, n) {
|
|
646
652
|
let r = n ?? ((e, n) => J(e, n, t));
|
|
647
653
|
return e.map((t, n) => {
|
|
648
654
|
let i = {
|
|
@@ -665,7 +671,7 @@ function Ce(e = [], t, n) {
|
|
|
665
671
|
marginLeft: 0,
|
|
666
672
|
marginRight: 0,
|
|
667
673
|
...i,
|
|
668
|
-
...
|
|
674
|
+
...Ce(t)
|
|
669
675
|
},
|
|
670
676
|
children: [t.href ? /* @__PURE__ */ d("a", {
|
|
671
677
|
href: t.href,
|
|
@@ -684,16 +690,16 @@ function Ce(e = [], t, n) {
|
|
|
684
690
|
})]
|
|
685
691
|
}, n);
|
|
686
692
|
}
|
|
687
|
-
if (t.type === "video") return
|
|
693
|
+
if (t.type === "video") return Fe(t.url) ? /* @__PURE__ */ d("div", {
|
|
688
694
|
style: {
|
|
689
695
|
...i,
|
|
690
|
-
...
|
|
696
|
+
...Ce({
|
|
691
697
|
align: t.align,
|
|
692
698
|
wrap: t.wrap,
|
|
693
699
|
width: t.width ?? 100
|
|
694
700
|
})
|
|
695
701
|
},
|
|
696
|
-
children: /* @__PURE__ */ d(
|
|
702
|
+
children: /* @__PURE__ */ d(Ie, {
|
|
697
703
|
url: t.url,
|
|
698
704
|
autoplay: t.autoplay,
|
|
699
705
|
muted: t.muted,
|
|
@@ -722,17 +728,17 @@ function Ce(e = [], t, n) {
|
|
|
722
728
|
}
|
|
723
729
|
if (t.type === "quote") return /* @__PURE__ */ d("blockquote", {
|
|
724
730
|
style: {
|
|
725
|
-
...
|
|
731
|
+
...Ee,
|
|
726
732
|
...i
|
|
727
733
|
},
|
|
728
734
|
children: r(t.parts, t.text)
|
|
729
735
|
}, n);
|
|
730
|
-
if (
|
|
736
|
+
if (Se[t.type]) {
|
|
731
737
|
let e = t.type;
|
|
732
738
|
return /* @__PURE__ */ d(e, {
|
|
733
739
|
style: {
|
|
734
|
-
...
|
|
735
|
-
fontSize:
|
|
740
|
+
...le,
|
|
741
|
+
fontSize: Se[t.type],
|
|
736
742
|
...i
|
|
737
743
|
},
|
|
738
744
|
children: r(t.parts, t.text)
|
|
@@ -740,39 +746,39 @@ function Ce(e = [], t, n) {
|
|
|
740
746
|
}
|
|
741
747
|
return /* @__PURE__ */ d("p", {
|
|
742
748
|
style: {
|
|
743
|
-
...
|
|
749
|
+
...ue,
|
|
744
750
|
...i
|
|
745
751
|
},
|
|
746
752
|
children: r(t.parts, t.text)
|
|
747
753
|
}, n);
|
|
748
754
|
});
|
|
749
755
|
}
|
|
750
|
-
function
|
|
756
|
+
function Te({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
751
757
|
return /* @__PURE__ */ d("div", {
|
|
752
758
|
ref: r,
|
|
753
759
|
style: {
|
|
754
760
|
display: "flow-root",
|
|
755
761
|
...C(t)
|
|
756
762
|
},
|
|
757
|
-
children:
|
|
763
|
+
children: we(e, n)
|
|
758
764
|
});
|
|
759
765
|
}
|
|
760
|
-
var
|
|
766
|
+
var Ee = {
|
|
761
767
|
margin: 0,
|
|
762
768
|
padding: "8px 0 8px 20px",
|
|
763
769
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
764
770
|
};
|
|
765
|
-
function
|
|
771
|
+
function De({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
766
772
|
return /* @__PURE__ */ d("blockquote", {
|
|
767
773
|
ref: i,
|
|
768
774
|
style: {
|
|
769
|
-
...
|
|
775
|
+
...Ee,
|
|
770
776
|
...C(n)
|
|
771
777
|
},
|
|
772
778
|
children: J(t, e, r)
|
|
773
779
|
});
|
|
774
780
|
}
|
|
775
|
-
function
|
|
781
|
+
function Oe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
776
782
|
return /* @__PURE__ */ d(e ? "ol" : "ul", {
|
|
777
783
|
ref: r,
|
|
778
784
|
style: {
|
|
@@ -786,36 +792,36 @@ function De({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
786
792
|
}, t))
|
|
787
793
|
});
|
|
788
794
|
}
|
|
789
|
-
function
|
|
795
|
+
function ke({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
790
796
|
return /* @__PURE__ */ d("p", {
|
|
791
797
|
ref: i,
|
|
792
798
|
style: {
|
|
793
|
-
...
|
|
799
|
+
...ue,
|
|
794
800
|
...C(n)
|
|
795
801
|
},
|
|
796
802
|
children: J(t, e, r)
|
|
797
803
|
});
|
|
798
804
|
}
|
|
799
|
-
var
|
|
805
|
+
var Ae = {
|
|
800
806
|
color: "var(--page-accent, inherit)",
|
|
801
807
|
textDecoration: "underline",
|
|
802
808
|
textUnderlineOffset: 3,
|
|
803
809
|
cursor: "pointer"
|
|
804
810
|
};
|
|
805
|
-
function
|
|
811
|
+
function je({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
806
812
|
return /* @__PURE__ */ d("a", {
|
|
807
813
|
ref: o,
|
|
808
814
|
href: n || "#",
|
|
809
815
|
target: r || void 0,
|
|
810
816
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
811
817
|
style: {
|
|
812
|
-
...
|
|
818
|
+
...Ae,
|
|
813
819
|
...C(i)
|
|
814
820
|
},
|
|
815
821
|
children: J(t, e, a)
|
|
816
822
|
});
|
|
817
823
|
}
|
|
818
|
-
function
|
|
824
|
+
function Me({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
819
825
|
return /* @__PURE__ */ d("a", {
|
|
820
826
|
ref: o,
|
|
821
827
|
href: n || "#",
|
|
@@ -828,7 +834,7 @@ function je({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRe
|
|
|
828
834
|
children: J(t, e, a)
|
|
829
835
|
});
|
|
830
836
|
}
|
|
831
|
-
function
|
|
837
|
+
function Ne({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
832
838
|
return e ? /* @__PURE__ */ d("img", {
|
|
833
839
|
ref: r,
|
|
834
840
|
src: e,
|
|
@@ -840,7 +846,7 @@ function Me({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
840
846
|
}
|
|
841
847
|
}) : null;
|
|
842
848
|
}
|
|
843
|
-
function
|
|
849
|
+
function Pe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
844
850
|
return e ? /* @__PURE__ */ d("video", {
|
|
845
851
|
ref: s,
|
|
846
852
|
src: e,
|
|
@@ -858,9 +864,9 @@ function Ne({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
858
864
|
}
|
|
859
865
|
}) : null;
|
|
860
866
|
}
|
|
861
|
-
var
|
|
862
|
-
function
|
|
863
|
-
let c =
|
|
867
|
+
var Fe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
868
|
+
function Ie({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
869
|
+
let c = Fe(e);
|
|
864
870
|
if (!c) return null;
|
|
865
871
|
let l = new URLSearchParams({ rel: "0" });
|
|
866
872
|
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__ */ d("div", {
|
|
@@ -886,7 +892,7 @@ function Fe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
886
892
|
})
|
|
887
893
|
});
|
|
888
894
|
}
|
|
889
|
-
function
|
|
895
|
+
function Le({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
890
896
|
return e ? /* @__PURE__ */ d("iframe", {
|
|
891
897
|
ref: i,
|
|
892
898
|
src: e,
|
|
@@ -902,7 +908,7 @@ function Ie({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
902
908
|
}
|
|
903
909
|
}) : null;
|
|
904
910
|
}
|
|
905
|
-
function
|
|
911
|
+
function Re({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
906
912
|
let [i, o] = l(null);
|
|
907
913
|
return a(() => {
|
|
908
914
|
i && (i.innerHTML = e || "", t && i.querySelectorAll("script").forEach((e) => {
|
|
@@ -921,7 +927,7 @@ function Le({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
921
927
|
style: C(n)
|
|
922
928
|
});
|
|
923
929
|
}
|
|
924
|
-
function
|
|
930
|
+
function ze({ height: e, nodeRef: t }) {
|
|
925
931
|
return /* @__PURE__ */ d("div", {
|
|
926
932
|
ref: t,
|
|
927
933
|
style: {
|
|
@@ -931,7 +937,7 @@ function Re({ height: e, nodeRef: t }) {
|
|
|
931
937
|
}
|
|
932
938
|
});
|
|
933
939
|
}
|
|
934
|
-
function
|
|
940
|
+
function Be({ style: e, nodeRef: t }) {
|
|
935
941
|
return /* @__PURE__ */ d("div", {
|
|
936
942
|
ref: t,
|
|
937
943
|
style: {
|
|
@@ -942,7 +948,7 @@ function ze({ style: e, nodeRef: t }) {
|
|
|
942
948
|
}
|
|
943
949
|
});
|
|
944
950
|
}
|
|
945
|
-
var
|
|
951
|
+
var Ve = {
|
|
946
952
|
position: "absolute",
|
|
947
953
|
top: "50%",
|
|
948
954
|
transform: "translateY(-50%)",
|
|
@@ -959,7 +965,7 @@ var Be = {
|
|
|
959
965
|
alignItems: "center",
|
|
960
966
|
justifyContent: "center",
|
|
961
967
|
padding: 0
|
|
962
|
-
},
|
|
968
|
+
}, He = {
|
|
963
969
|
bottom: {
|
|
964
970
|
inset: "auto 0 0 0",
|
|
965
971
|
padding: "40px 24px 20px",
|
|
@@ -978,8 +984,8 @@ var Be = {
|
|
|
978
984
|
padding: 24,
|
|
979
985
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
980
986
|
}
|
|
981
|
-
},
|
|
982
|
-
function
|
|
987
|
+
}, Ue = 48;
|
|
988
|
+
function We({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
|
|
983
989
|
let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
|
|
984
990
|
if (a(() => {
|
|
985
991
|
if (!n || h || _ || e < 2) return;
|
|
@@ -995,7 +1001,7 @@ function Ue({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
995
1001
|
let b = (t) => m((t + e) % e), x = () => {
|
|
996
1002
|
if (!_) return;
|
|
997
1003
|
let { dx: e } = _;
|
|
998
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1004
|
+
v(null), e < -48 ? b(y + 1) : e > Ue && b(y - 1);
|
|
999
1005
|
};
|
|
1000
1006
|
return /* @__PURE__ */ f("div", {
|
|
1001
1007
|
ref: c,
|
|
@@ -1043,7 +1049,7 @@ function Ue({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1043
1049
|
type: "button",
|
|
1044
1050
|
"aria-label": "Previous slide",
|
|
1045
1051
|
style: {
|
|
1046
|
-
...
|
|
1052
|
+
...Ve,
|
|
1047
1053
|
left: 12
|
|
1048
1054
|
},
|
|
1049
1055
|
onClick: () => b(y - 1),
|
|
@@ -1053,7 +1059,7 @@ function Ue({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1053
1059
|
type: "button",
|
|
1054
1060
|
"aria-label": "Next slide",
|
|
1055
1061
|
style: {
|
|
1056
|
-
...
|
|
1062
|
+
...Ve,
|
|
1057
1063
|
right: 12
|
|
1058
1064
|
},
|
|
1059
1065
|
onClick: () => b(y + 1),
|
|
@@ -1087,7 +1093,7 @@ function Ue({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1087
1093
|
] })]
|
|
1088
1094
|
});
|
|
1089
1095
|
}
|
|
1090
|
-
var
|
|
1096
|
+
var Ge = (e, t) => ({
|
|
1091
1097
|
position: "absolute",
|
|
1092
1098
|
inset: 0,
|
|
1093
1099
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1095,18 +1101,18 @@ var We = (e, t) => ({
|
|
|
1095
1101
|
backgroundSize: "cover",
|
|
1096
1102
|
backgroundPosition: "center"
|
|
1097
1103
|
});
|
|
1098
|
-
function
|
|
1099
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1104
|
+
function Ke({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1105
|
+
return e.length ? /* @__PURE__ */ d(We, {
|
|
1100
1106
|
...r,
|
|
1101
1107
|
count: e.length,
|
|
1102
1108
|
renderSlide: (r) => {
|
|
1103
1109
|
let i = e[r];
|
|
1104
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1110
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: Ge(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
|
|
1105
1111
|
style: {
|
|
1106
1112
|
position: "absolute",
|
|
1107
1113
|
color: "#fff",
|
|
1108
1114
|
textAlign: n,
|
|
1109
|
-
...
|
|
1115
|
+
...He[t] ?? He.bottom
|
|
1110
1116
|
},
|
|
1111
1117
|
children: [i.title && /* @__PURE__ */ d("div", {
|
|
1112
1118
|
style: {
|
|
@@ -1126,13 +1132,13 @@ function Ge({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1126
1132
|
}
|
|
1127
1133
|
}) : null;
|
|
1128
1134
|
}
|
|
1129
|
-
function
|
|
1130
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1135
|
+
function qe({ slides: e = [], linked: t, ...n }) {
|
|
1136
|
+
return e.length ? /* @__PURE__ */ d(We, {
|
|
1131
1137
|
...n,
|
|
1132
1138
|
count: e.length,
|
|
1133
1139
|
renderSlide: (n) => {
|
|
1134
1140
|
let r = e[n];
|
|
1135
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1141
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: Ge(r.image, r.color) }), /* @__PURE__ */ d("div", {
|
|
1136
1142
|
style: {
|
|
1137
1143
|
position: "absolute",
|
|
1138
1144
|
inset: 0,
|
|
@@ -1144,29 +1150,29 @@ function Ke({ slides: e = [], linked: t, ...n }) {
|
|
|
1144
1150
|
}
|
|
1145
1151
|
}) : null;
|
|
1146
1152
|
}
|
|
1147
|
-
var
|
|
1153
|
+
var Je = {
|
|
1148
1154
|
color: "inherit",
|
|
1149
1155
|
textDecoration: "none",
|
|
1150
1156
|
fontSize: 14,
|
|
1151
1157
|
opacity: .85
|
|
1152
|
-
},
|
|
1158
|
+
}, Ye = {
|
|
1153
1159
|
background: "var(--page-bg, #ffffff)",
|
|
1154
1160
|
color: "var(--page-text, #111827)",
|
|
1155
1161
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1156
1162
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1157
1163
|
zIndex: 60
|
|
1158
1164
|
};
|
|
1159
|
-
function
|
|
1160
|
-
let [
|
|
1165
|
+
function Xe({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], style: s, nodeRef: c, menu: p = "auto", breakpoint: m = 768 }) {
|
|
1166
|
+
let [h, g] = l(null), [_, v] = l(!1), [y, b] = l(!1), [x, S] = l(null);
|
|
1161
1167
|
a(() => {
|
|
1162
|
-
if (!
|
|
1163
|
-
let e = new ResizeObserver(() => h
|
|
1164
|
-
return e.observe(
|
|
1165
|
-
}, [
|
|
1166
|
-
let
|
|
1168
|
+
if (!h) return;
|
|
1169
|
+
let e = new ResizeObserver(() => v(h.offsetWidth < m));
|
|
1170
|
+
return e.observe(h), () => e.disconnect();
|
|
1171
|
+
}, [h, m]);
|
|
1172
|
+
let w = p === "hamburger" || p === "auto" && _, T = (e, t) => /* @__PURE__ */ f("a", {
|
|
1167
1173
|
href: e.href || "#",
|
|
1168
1174
|
style: {
|
|
1169
|
-
...
|
|
1175
|
+
...Je,
|
|
1170
1176
|
display: "block",
|
|
1171
1177
|
...t
|
|
1172
1178
|
},
|
|
@@ -1182,7 +1188,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1182
1188
|
}, e.key);
|
|
1183
1189
|
return /* @__PURE__ */ f("nav", {
|
|
1184
1190
|
ref: (e) => {
|
|
1185
|
-
|
|
1191
|
+
g(e), c && c(e);
|
|
1186
1192
|
},
|
|
1187
1193
|
style: {
|
|
1188
1194
|
display: "flex",
|
|
@@ -1192,30 +1198,47 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1192
1198
|
padding: "14px 24px",
|
|
1193
1199
|
width: "100%",
|
|
1194
1200
|
position: "relative",
|
|
1195
|
-
...C(
|
|
1201
|
+
...C(s)
|
|
1196
1202
|
},
|
|
1197
1203
|
children: [
|
|
1198
|
-
n
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1204
|
+
(n || e) && (() => {
|
|
1205
|
+
let t = /* @__PURE__ */ f(u, { children: [n && /* @__PURE__ */ d("img", {
|
|
1206
|
+
src: n,
|
|
1207
|
+
alt: e || "Logo",
|
|
1208
|
+
style: {
|
|
1209
|
+
height: 28,
|
|
1210
|
+
display: "block"
|
|
1211
|
+
}
|
|
1212
|
+
}), e && /* @__PURE__ */ d("span", {
|
|
1213
|
+
style: {
|
|
1214
|
+
fontWeight: 700,
|
|
1215
|
+
fontSize: 18,
|
|
1216
|
+
fontFamily: "var(--page-heading-font, inherit)"
|
|
1217
|
+
},
|
|
1218
|
+
children: e
|
|
1219
|
+
})] }), a = {
|
|
1220
|
+
display: "flex",
|
|
1221
|
+
alignItems: "center",
|
|
1222
|
+
gap: 10,
|
|
1223
|
+
color: "inherit",
|
|
1224
|
+
textDecoration: "none"
|
|
1225
|
+
};
|
|
1226
|
+
return r ? /* @__PURE__ */ d("a", {
|
|
1227
|
+
href: r,
|
|
1228
|
+
target: i || void 0,
|
|
1229
|
+
rel: i === "_blank" ? "noopener noreferrer" : void 0,
|
|
1230
|
+
style: a,
|
|
1231
|
+
children: t
|
|
1232
|
+
}) : /* @__PURE__ */ d("div", {
|
|
1233
|
+
style: a,
|
|
1234
|
+
children: t
|
|
1235
|
+
});
|
|
1236
|
+
})(),
|
|
1214
1237
|
/* @__PURE__ */ d("div", { style: { flexGrow: 1 } }),
|
|
1215
|
-
|
|
1238
|
+
w ? /* @__PURE__ */ d("button", {
|
|
1216
1239
|
type: "button",
|
|
1217
|
-
"aria-label":
|
|
1218
|
-
onClick: () =>
|
|
1240
|
+
"aria-label": y ? "Close menu" : "Open menu",
|
|
1241
|
+
onClick: () => b(!y),
|
|
1219
1242
|
style: {
|
|
1220
1243
|
background: "transparent",
|
|
1221
1244
|
border: 0,
|
|
@@ -1225,7 +1248,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1225
1248
|
lineHeight: 1,
|
|
1226
1249
|
padding: 4
|
|
1227
1250
|
},
|
|
1228
|
-
children:
|
|
1251
|
+
children: y ? "✕" : "☰"
|
|
1229
1252
|
}) : /* @__PURE__ */ d("div", {
|
|
1230
1253
|
style: {
|
|
1231
1254
|
display: "flex",
|
|
@@ -1233,11 +1256,11 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1233
1256
|
alignItems: "center",
|
|
1234
1257
|
flexWrap: "wrap"
|
|
1235
1258
|
},
|
|
1236
|
-
children:
|
|
1259
|
+
children: o.map((e) => {
|
|
1237
1260
|
let t = e.children ?? [];
|
|
1238
1261
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
1239
1262
|
href: e.href || "#",
|
|
1240
|
-
style:
|
|
1263
|
+
style: Je,
|
|
1241
1264
|
children: e.label
|
|
1242
1265
|
}, e.key);
|
|
1243
1266
|
let n = e.type === "mega";
|
|
@@ -1246,12 +1269,12 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1246
1269
|
position: n ? "static" : "relative",
|
|
1247
1270
|
display: "inline-flex"
|
|
1248
1271
|
},
|
|
1249
|
-
onMouseEnter: () =>
|
|
1250
|
-
onMouseLeave: () =>
|
|
1272
|
+
onMouseEnter: () => S(e.key),
|
|
1273
|
+
onMouseLeave: () => S(null),
|
|
1251
1274
|
children: [/* @__PURE__ */ f("a", {
|
|
1252
1275
|
href: e.href || "#",
|
|
1253
1276
|
style: {
|
|
1254
|
-
...
|
|
1277
|
+
...Je,
|
|
1255
1278
|
cursor: "pointer"
|
|
1256
1279
|
},
|
|
1257
1280
|
children: [
|
|
@@ -1265,9 +1288,9 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1265
1288
|
children: "▼"
|
|
1266
1289
|
})
|
|
1267
1290
|
]
|
|
1268
|
-
}),
|
|
1291
|
+
}), x === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
1269
1292
|
style: {
|
|
1270
|
-
...
|
|
1293
|
+
...Ye,
|
|
1271
1294
|
position: "absolute",
|
|
1272
1295
|
left: 0,
|
|
1273
1296
|
right: 0,
|
|
@@ -1277,13 +1300,13 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1277
1300
|
gridTemplateColumns: "repeat(auto-fit, minmax(170px, 1fr))",
|
|
1278
1301
|
gap: 16
|
|
1279
1302
|
},
|
|
1280
|
-
children: t.map((e) =>
|
|
1303
|
+
children: t.map((e) => T(e, {
|
|
1281
1304
|
padding: "6px 8px",
|
|
1282
1305
|
borderRadius: 6
|
|
1283
1306
|
}))
|
|
1284
1307
|
}) : /* @__PURE__ */ d("div", {
|
|
1285
1308
|
style: {
|
|
1286
|
-
...
|
|
1309
|
+
...Ye,
|
|
1287
1310
|
position: "absolute",
|
|
1288
1311
|
top: "100%",
|
|
1289
1312
|
left: 0,
|
|
@@ -1293,7 +1316,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1293
1316
|
display: "flex",
|
|
1294
1317
|
flexDirection: "column"
|
|
1295
1318
|
},
|
|
1296
|
-
children: t.map((e) =>
|
|
1319
|
+
children: t.map((e) => T(e, {
|
|
1297
1320
|
padding: "8px 12px",
|
|
1298
1321
|
borderRadius: 6
|
|
1299
1322
|
}))
|
|
@@ -1301,7 +1324,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1301
1324
|
}, e.key);
|
|
1302
1325
|
})
|
|
1303
1326
|
}),
|
|
1304
|
-
|
|
1327
|
+
w && y && /* @__PURE__ */ d("div", {
|
|
1305
1328
|
style: {
|
|
1306
1329
|
flexBasis: "100%",
|
|
1307
1330
|
width: "100%",
|
|
@@ -1309,21 +1332,21 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1309
1332
|
flexDirection: "column",
|
|
1310
1333
|
paddingTop: 10
|
|
1311
1334
|
},
|
|
1312
|
-
children:
|
|
1335
|
+
children: o.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
1313
1336
|
href: e.href || "#",
|
|
1314
1337
|
style: {
|
|
1315
|
-
...
|
|
1338
|
+
...Je,
|
|
1316
1339
|
padding: "10px 4px",
|
|
1317
1340
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
1318
1341
|
opacity: 1
|
|
1319
1342
|
},
|
|
1320
1343
|
children: e.label
|
|
1321
|
-
}), (e.children ?? []).map((e) =>
|
|
1344
|
+
}), (e.children ?? []).map((e) => T(e, { padding: "8px 4px 8px 22px" }))] }, e.key))
|
|
1322
1345
|
})
|
|
1323
1346
|
]
|
|
1324
1347
|
});
|
|
1325
1348
|
}
|
|
1326
|
-
function
|
|
1349
|
+
function Ze({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1327
1350
|
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1328
1351
|
return e.length ? /* @__PURE__ */ f("div", {
|
|
1329
1352
|
ref: r,
|
|
@@ -1363,7 +1386,7 @@ function Xe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1363
1386
|
}, e.key))]
|
|
1364
1387
|
}) : null;
|
|
1365
1388
|
}
|
|
1366
|
-
function
|
|
1389
|
+
function Qe({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1367
1390
|
let [a, o] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
1368
1391
|
if (!e.length) return null;
|
|
1369
1392
|
let s = (e) => o((t) => {
|
|
@@ -1420,7 +1443,7 @@ function Ze({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1420
1443
|
})
|
|
1421
1444
|
});
|
|
1422
1445
|
}
|
|
1423
|
-
var
|
|
1446
|
+
var $e = {
|
|
1424
1447
|
display: "flex",
|
|
1425
1448
|
flexDirection: "column",
|
|
1426
1449
|
gap: "12px"
|
|
@@ -1438,7 +1461,7 @@ var Qe = {
|
|
|
1438
1461
|
boxSizing: "border-box",
|
|
1439
1462
|
backgroundColor: "#ffffff",
|
|
1440
1463
|
color: "#111827"
|
|
1441
|
-
},
|
|
1464
|
+
}, et = {
|
|
1442
1465
|
display: "flex",
|
|
1443
1466
|
alignItems: "center",
|
|
1444
1467
|
gap: "8px",
|
|
@@ -1449,7 +1472,7 @@ var Qe = {
|
|
|
1449
1472
|
tabIndex: -1,
|
|
1450
1473
|
onMouseDown: (e) => e.preventDefault()
|
|
1451
1474
|
} : {};
|
|
1452
|
-
function
|
|
1475
|
+
function tt(e, t) {
|
|
1453
1476
|
if (!e) return !0;
|
|
1454
1477
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
1455
1478
|
switch (e.op) {
|
|
@@ -1463,11 +1486,11 @@ function et(e, t) {
|
|
|
1463
1486
|
default: return !1;
|
|
1464
1487
|
}
|
|
1465
1488
|
}
|
|
1466
|
-
var
|
|
1489
|
+
var nt = {
|
|
1467
1490
|
display: "flex",
|
|
1468
1491
|
flexDirection: "column",
|
|
1469
1492
|
gap: 6
|
|
1470
|
-
},
|
|
1493
|
+
}, rt = {
|
|
1471
1494
|
font: "inherit",
|
|
1472
1495
|
fontSize: 15,
|
|
1473
1496
|
padding: "10px 12px",
|
|
@@ -1478,13 +1501,13 @@ var tt = {
|
|
|
1478
1501
|
width: "100%",
|
|
1479
1502
|
boxSizing: "border-box"
|
|
1480
1503
|
};
|
|
1481
|
-
function
|
|
1504
|
+
function it(e, t) {
|
|
1482
1505
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
1483
1506
|
if (!e?.parentField) return n;
|
|
1484
1507
|
let r = t?.[e.parentField];
|
|
1485
1508
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
1486
1509
|
}
|
|
1487
|
-
function
|
|
1510
|
+
function at({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
1488
1511
|
let a = /* @__PURE__ */ f("span", {
|
|
1489
1512
|
style: {
|
|
1490
1513
|
...Y,
|
|
@@ -1496,7 +1519,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1496
1519
|
required: e.required || void 0,
|
|
1497
1520
|
placeholder: e.placeholder || void 0,
|
|
1498
1521
|
disabled: r || void 0,
|
|
1499
|
-
style:
|
|
1522
|
+
style: rt,
|
|
1500
1523
|
value: t ?? "",
|
|
1501
1524
|
onChange: (t) => n(e.name, t.target.value)
|
|
1502
1525
|
};
|
|
@@ -1525,7 +1548,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1525
1548
|
borderRadius: 8,
|
|
1526
1549
|
display: "block"
|
|
1527
1550
|
}
|
|
1528
|
-
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(
|
|
1551
|
+
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(Ie, {
|
|
1529
1552
|
url: e.src,
|
|
1530
1553
|
style: { width: "100%" }
|
|
1531
1554
|
}) : /* @__PURE__ */ d("video", {
|
|
@@ -1537,14 +1560,14 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1537
1560
|
display: "block"
|
|
1538
1561
|
}
|
|
1539
1562
|
}) : null : /* @__PURE__ */ f("label", {
|
|
1540
|
-
style:
|
|
1563
|
+
style: nt,
|
|
1541
1564
|
children: [
|
|
1542
1565
|
a,
|
|
1543
1566
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
|
|
1544
1567
|
...o,
|
|
1545
1568
|
rows: 4,
|
|
1546
1569
|
style: {
|
|
1547
|
-
...
|
|
1570
|
+
...rt,
|
|
1548
1571
|
resize: "vertical"
|
|
1549
1572
|
}
|
|
1550
1573
|
}) : e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
@@ -1553,7 +1576,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1553
1576
|
children: [/* @__PURE__ */ d("option", {
|
|
1554
1577
|
value: "",
|
|
1555
1578
|
children: e.placeholder || "—"
|
|
1556
|
-
}),
|
|
1579
|
+
}), it(e, i).map((e, t) => /* @__PURE__ */ d("option", {
|
|
1557
1580
|
value: typeof e == "string" ? e : e.value,
|
|
1558
1581
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
1559
1582
|
}, t))]
|
|
@@ -1600,7 +1623,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1600
1623
|
]
|
|
1601
1624
|
});
|
|
1602
1625
|
}
|
|
1603
|
-
function
|
|
1626
|
+
function ot({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
1604
1627
|
let { tenant: y, apiUrl: b } = i(H), [x, S] = l("form"), [w, T] = l(null), [E, D] = l({}), [O, k] = l(0), A = h ? v || "form" : x;
|
|
1605
1628
|
a(() => {
|
|
1606
1629
|
if (!c || !s) return;
|
|
@@ -1622,9 +1645,9 @@ function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1622
1645
|
section: e,
|
|
1623
1646
|
fields: []
|
|
1624
1647
|
}) : j[j.length - 1].fields.push(e);
|
|
1625
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
1648
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || tt(e.section.condition, E)).map((e) => ({
|
|
1626
1649
|
...e,
|
|
1627
|
-
fields: e.fields.filter((e) =>
|
|
1650
|
+
fields: e.fields.filter((e) => tt(e.condition, E))
|
|
1628
1651
|
})), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
1629
1652
|
let t = E[e.name];
|
|
1630
1653
|
return e.required && (t == null || t === "" || t === !1);
|
|
@@ -1682,11 +1705,11 @@ function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1682
1705
|
}
|
|
1683
1706
|
},
|
|
1684
1707
|
style: {
|
|
1685
|
-
|
|
1708
|
+
...$e,
|
|
1686
1709
|
display: A === "success" ? "none" : "flex"
|
|
1687
1710
|
},
|
|
1688
1711
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
1689
|
-
P && /* @__PURE__ */ d(
|
|
1712
|
+
P && /* @__PURE__ */ d(xt, {
|
|
1690
1713
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
1691
1714
|
active: F + 1,
|
|
1692
1715
|
style: { marginBottom: 8 }
|
|
@@ -1699,7 +1722,7 @@ function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1699
1722
|
},
|
|
1700
1723
|
children: N[F].section.help
|
|
1701
1724
|
}),
|
|
1702
|
-
I.map((e) => /* @__PURE__ */ d(
|
|
1725
|
+
I.map((e) => /* @__PURE__ */ d(at, {
|
|
1703
1726
|
field: e,
|
|
1704
1727
|
value: E[e.name],
|
|
1705
1728
|
values: E,
|
|
@@ -1772,7 +1795,97 @@ function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1772
1795
|
]
|
|
1773
1796
|
});
|
|
1774
1797
|
}
|
|
1775
|
-
|
|
1798
|
+
var st = null, ct = () => st || (st = new Promise((e) => {
|
|
1799
|
+
if (typeof window > "u") return;
|
|
1800
|
+
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
1801
|
+
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
1802
|
+
let t = document.createElement("script");
|
|
1803
|
+
t.src = "https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit", t.async = !0, document.head.appendChild(t);
|
|
1804
|
+
}), st);
|
|
1805
|
+
function lt({ siteKey: e, theme: t, size: n, style: r, nodeRef: o, inert: s }) {
|
|
1806
|
+
let l = i(H), u = l?.settings && typeof l.settings == "object" ? l.settings["google.recaptchaKey"] : "", p = typeof e == "string" && e.trim() || (typeof u == "string" ? u.trim() : ""), m = c(null), h = c(!1);
|
|
1807
|
+
if (a(() => {
|
|
1808
|
+
if (s || !p || h.current || !m.current) return;
|
|
1809
|
+
let e = !0;
|
|
1810
|
+
return ct().then((r) => {
|
|
1811
|
+
if (!(!e || h.current || !m.current || !r?.render)) {
|
|
1812
|
+
h.current = !0;
|
|
1813
|
+
try {
|
|
1814
|
+
r.render(m.current, {
|
|
1815
|
+
sitekey: p,
|
|
1816
|
+
theme: t === "dark" ? "dark" : "light",
|
|
1817
|
+
size: n === "compact" ? "compact" : "normal"
|
|
1818
|
+
});
|
|
1819
|
+
} catch {}
|
|
1820
|
+
}
|
|
1821
|
+
}), () => {
|
|
1822
|
+
e = !1;
|
|
1823
|
+
};
|
|
1824
|
+
}, [
|
|
1825
|
+
s,
|
|
1826
|
+
p,
|
|
1827
|
+
t,
|
|
1828
|
+
n
|
|
1829
|
+
]), s) {
|
|
1830
|
+
let e = t === "dark";
|
|
1831
|
+
return /* @__PURE__ */ f("div", {
|
|
1832
|
+
ref: o,
|
|
1833
|
+
style: C(r),
|
|
1834
|
+
children: [/* @__PURE__ */ f("div", {
|
|
1835
|
+
style: {
|
|
1836
|
+
width: n === "compact" ? 164 : 302,
|
|
1837
|
+
boxSizing: "border-box",
|
|
1838
|
+
padding: "12px 14px",
|
|
1839
|
+
display: "flex",
|
|
1840
|
+
alignItems: "center",
|
|
1841
|
+
gap: 12,
|
|
1842
|
+
borderRadius: 4,
|
|
1843
|
+
border: `1px solid ${e ? "#52565b" : "#d3d3d3"}`,
|
|
1844
|
+
background: e ? "#222528" : "#f9f9f9",
|
|
1845
|
+
color: e ? "#f1f1f1" : "#282828",
|
|
1846
|
+
fontSize: 14,
|
|
1847
|
+
fontFamily: "Roboto, Arial, sans-serif"
|
|
1848
|
+
},
|
|
1849
|
+
children: [
|
|
1850
|
+
/* @__PURE__ */ d("span", { style: {
|
|
1851
|
+
width: 24,
|
|
1852
|
+
height: 24,
|
|
1853
|
+
flexShrink: 0,
|
|
1854
|
+
borderRadius: 3,
|
|
1855
|
+
border: `2px solid ${e ? "#8a8f94" : "#c1c1c1"}`,
|
|
1856
|
+
background: e ? "#2f3337" : "#fff"
|
|
1857
|
+
} }),
|
|
1858
|
+
/* @__PURE__ */ d("span", {
|
|
1859
|
+
style: { flexGrow: 1 },
|
|
1860
|
+
children: "I'm not a robot"
|
|
1861
|
+
}),
|
|
1862
|
+
/* @__PURE__ */ d("span", {
|
|
1863
|
+
style: {
|
|
1864
|
+
fontSize: 9,
|
|
1865
|
+
opacity: .6,
|
|
1866
|
+
textAlign: "center",
|
|
1867
|
+
lineHeight: 1.3
|
|
1868
|
+
},
|
|
1869
|
+
children: "reCAPTCHA"
|
|
1870
|
+
})
|
|
1871
|
+
]
|
|
1872
|
+
}), !p && /* @__PURE__ */ d("div", {
|
|
1873
|
+
style: {
|
|
1874
|
+
marginTop: 6,
|
|
1875
|
+
fontSize: 11,
|
|
1876
|
+
color: "#b45309"
|
|
1877
|
+
},
|
|
1878
|
+
children: "Set the google.recaptchaKey tenant setting (or a site key in Settings) to activate it."
|
|
1879
|
+
})]
|
|
1880
|
+
});
|
|
1881
|
+
}
|
|
1882
|
+
return p ? /* @__PURE__ */ d("div", {
|
|
1883
|
+
ref: o,
|
|
1884
|
+
style: C(r),
|
|
1885
|
+
children: /* @__PURE__ */ d("div", { ref: m })
|
|
1886
|
+
}) : null;
|
|
1887
|
+
}
|
|
1888
|
+
function ut({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
1776
1889
|
return /* @__PURE__ */ d("label", {
|
|
1777
1890
|
ref: r,
|
|
1778
1891
|
style: {
|
|
@@ -1782,7 +1895,7 @@ function ot({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
|
1782
1895
|
children: J(t, e, i)
|
|
1783
1896
|
});
|
|
1784
1897
|
}
|
|
1785
|
-
function
|
|
1898
|
+
function dt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1786
1899
|
return /* @__PURE__ */ d("input", {
|
|
1787
1900
|
ref: a,
|
|
1788
1901
|
type: e,
|
|
@@ -1796,7 +1909,7 @@ function st({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
1796
1909
|
...Z(o)
|
|
1797
1910
|
});
|
|
1798
1911
|
}
|
|
1799
|
-
function
|
|
1912
|
+
function ft({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1800
1913
|
return /* @__PURE__ */ d("textarea", {
|
|
1801
1914
|
ref: a,
|
|
1802
1915
|
name: e || void 0,
|
|
@@ -1811,11 +1924,11 @@ function ct({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
1811
1924
|
...Z(o)
|
|
1812
1925
|
});
|
|
1813
1926
|
}
|
|
1814
|
-
function
|
|
1927
|
+
function pt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
1815
1928
|
return /* @__PURE__ */ f("label", {
|
|
1816
1929
|
ref: o,
|
|
1817
1930
|
style: {
|
|
1818
|
-
|
|
1931
|
+
...et,
|
|
1819
1932
|
...C(a)
|
|
1820
1933
|
},
|
|
1821
1934
|
children: [/* @__PURE__ */ d("input", {
|
|
@@ -1832,7 +1945,7 @@ function lt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
1832
1945
|
}), t]
|
|
1833
1946
|
});
|
|
1834
1947
|
}
|
|
1835
|
-
function
|
|
1948
|
+
function mt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
1836
1949
|
return /* @__PURE__ */ f("select", {
|
|
1837
1950
|
ref: a,
|
|
1838
1951
|
name: e || void 0,
|
|
@@ -1855,7 +1968,7 @@ function ut({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
1855
1968
|
}, t))]
|
|
1856
1969
|
});
|
|
1857
1970
|
}
|
|
1858
|
-
function
|
|
1971
|
+
function ht({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
1859
1972
|
let [s, c] = l(null);
|
|
1860
1973
|
return /* @__PURE__ */ f("label", {
|
|
1861
1974
|
ref: a,
|
|
@@ -1887,7 +2000,7 @@ function dt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
1887
2000
|
]
|
|
1888
2001
|
});
|
|
1889
2002
|
}
|
|
1890
|
-
function
|
|
2003
|
+
function gt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
1891
2004
|
return /* @__PURE__ */ d("button", {
|
|
1892
2005
|
ref: n,
|
|
1893
2006
|
type: r ? "button" : "submit",
|
|
@@ -1907,7 +2020,7 @@ function ft({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
1907
2020
|
children: e
|
|
1908
2021
|
});
|
|
1909
2022
|
}
|
|
1910
|
-
function
|
|
2023
|
+
function _t({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
1911
2024
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
1912
2025
|
return /* @__PURE__ */ d("div", {
|
|
1913
2026
|
ref: r,
|
|
@@ -1924,52 +2037,60 @@ function pt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
1924
2037
|
}, t))
|
|
1925
2038
|
});
|
|
1926
2039
|
}
|
|
1927
|
-
function
|
|
1928
|
-
let { tenant:
|
|
2040
|
+
function vt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, style: h, nodeRef: g }) {
|
|
2041
|
+
let { tenant: _, apiUrl: v, locale: y } = i(H), b = i(ae), x = i(U), S = x?.[e], w = m ? W(x) : 1, [T, E] = l(null);
|
|
1929
2042
|
if (a(() => {
|
|
1930
|
-
if (!e ||
|
|
1931
|
-
let
|
|
1932
|
-
|
|
1933
|
-
let
|
|
1934
|
-
|
|
1935
|
-
}
|
|
1936
|
-
|
|
2043
|
+
if (!e || S) return;
|
|
2044
|
+
let n = !0, r = new URLSearchParams();
|
|
2045
|
+
if (y && r.set("locale", y), m && !e.startsWith("api:")) {
|
|
2046
|
+
let e = Math.max(1, Number(t) || 6);
|
|
2047
|
+
r.set("offset", String((w - 1) * e)), r.set("limit", String(e));
|
|
2048
|
+
}
|
|
2049
|
+
let i = r.toString(), a = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
|
|
2050
|
+
return fetch(a, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => {
|
|
2051
|
+
let t = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
|
|
2052
|
+
return n && E(t.filter((e) => e && typeof e == "object"));
|
|
2053
|
+
}).catch(() => n && E([])), () => {
|
|
2054
|
+
n = !1;
|
|
1937
2055
|
};
|
|
1938
2056
|
}, [
|
|
1939
2057
|
e,
|
|
1940
|
-
g,
|
|
1941
2058
|
_,
|
|
1942
2059
|
v,
|
|
1943
|
-
|
|
2060
|
+
y,
|
|
2061
|
+
S,
|
|
2062
|
+
m,
|
|
2063
|
+
w,
|
|
2064
|
+
t
|
|
1944
2065
|
]), !e) return null;
|
|
1945
|
-
let
|
|
2066
|
+
let D = Math.max(1, Number(t) || 6), O = m ? S || e.startsWith("api:") ? (S ?? T ?? []).slice((w - 1) * D, w * D) : (T ?? []).slice(0, D) : (S ?? T ?? []).slice(0, D), k = Math.min(Math.max(Number(r) || 3, 1), 6), A = n === "list" ? {
|
|
1946
2067
|
display: "flex",
|
|
1947
2068
|
flexDirection: "column",
|
|
1948
2069
|
gap: 20
|
|
1949
2070
|
} : {
|
|
1950
2071
|
display: "grid",
|
|
1951
|
-
gridTemplateColumns: `repeat(${
|
|
2072
|
+
gridTemplateColumns: `repeat(${k}, minmax(0, 1fr))`,
|
|
1952
2073
|
gap: 24
|
|
1953
2074
|
};
|
|
1954
|
-
return u && p &&
|
|
1955
|
-
ref:
|
|
2075
|
+
return u && p && b?.render ? /* @__PURE__ */ d("div", {
|
|
2076
|
+
ref: g,
|
|
1956
2077
|
style: {
|
|
1957
2078
|
width: "100%",
|
|
1958
|
-
...
|
|
1959
|
-
...C(
|
|
2079
|
+
...A,
|
|
2080
|
+
...C(h)
|
|
1960
2081
|
},
|
|
1961
|
-
children:
|
|
2082
|
+
children: O.map((e) => /* @__PURE__ */ d("div", {
|
|
1962
2083
|
style: { minWidth: 0 },
|
|
1963
|
-
children:
|
|
2084
|
+
children: b.render(p, (t) => ce(t, e))
|
|
1964
2085
|
}, e.id ?? e?.data?.slug))
|
|
1965
2086
|
}) : /* @__PURE__ */ d("div", {
|
|
1966
|
-
ref:
|
|
2087
|
+
ref: g,
|
|
1967
2088
|
style: {
|
|
1968
2089
|
width: "100%",
|
|
1969
|
-
...
|
|
1970
|
-
...C(
|
|
2090
|
+
...A,
|
|
2091
|
+
...C(h)
|
|
1971
2092
|
},
|
|
1972
|
-
children:
|
|
2093
|
+
children: O.map((e) => {
|
|
1973
2094
|
let t = o ? G(e?.data, o) : null, r = s ? K(G(e?.data, s)) : null, i = c ? G(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : K(i), u = n === "list";
|
|
1974
2095
|
return /* @__PURE__ */ f("div", {
|
|
1975
2096
|
style: {
|
|
@@ -2017,7 +2138,7 @@ function mt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2017
2138
|
lineHeight: 1.55,
|
|
2018
2139
|
opacity: .85
|
|
2019
2140
|
},
|
|
2020
|
-
children:
|
|
2141
|
+
children: we(a)
|
|
2021
2142
|
})
|
|
2022
2143
|
]
|
|
2023
2144
|
})]
|
|
@@ -2025,7 +2146,7 @@ function mt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2025
2146
|
})
|
|
2026
2147
|
});
|
|
2027
2148
|
}
|
|
2028
|
-
function
|
|
2149
|
+
function yt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
2029
2150
|
return e.length ? /* @__PURE__ */ d("nav", {
|
|
2030
2151
|
ref: r,
|
|
2031
2152
|
"aria-label": "Breadcrumb",
|
|
@@ -2075,8 +2196,36 @@ function ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2075
2196
|
})
|
|
2076
2197
|
}) : null;
|
|
2077
2198
|
}
|
|
2078
|
-
function
|
|
2079
|
-
let
|
|
2199
|
+
function bt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, style: u, nodeRef: p }) {
|
|
2200
|
+
let { tenant: m, apiUrl: h } = i(H), g = i(U), [_, v] = l(null), y = o ? Number(g?.[`${o}:total`]) : NaN;
|
|
2201
|
+
a(() => {
|
|
2202
|
+
if (!o || Number.isFinite(y)) return;
|
|
2203
|
+
let e = !0, t = o.startsWith("api:") ? `${h}/data/${encodeURIComponent(o.slice(4))}` : `${h}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
2204
|
+
return fetch(t, { headers: m ? { "x-tenant": m } : {} }).then((e) => e.json()).then((t) => {
|
|
2205
|
+
if (!e) return;
|
|
2206
|
+
let n = t?.payload, r = Array.isArray(n) ? n.length : Number(n?.total?.filtered ?? n?.total?.all ?? (Array.isArray(n?.data) ? n.data.length : 0));
|
|
2207
|
+
v(Number.isFinite(r) ? r : 0);
|
|
2208
|
+
}).catch(() => e && v(0)), () => {
|
|
2209
|
+
e = !1;
|
|
2210
|
+
};
|
|
2211
|
+
}, [
|
|
2212
|
+
o,
|
|
2213
|
+
m,
|
|
2214
|
+
h,
|
|
2215
|
+
y
|
|
2216
|
+
]);
|
|
2217
|
+
let b = Math.max(1, Number(s) || 6), x = Number.isFinite(y) ? y : _;
|
|
2218
|
+
if (o && x === null) return null;
|
|
2219
|
+
let S = Math.min(Math.max(o ? Math.ceil(x / b) : Number(e) || 1, 1), 50), w = Math.min(Math.max(o ? W(g) : Number(t) || 1, 1), S), T = (e) => {
|
|
2220
|
+
if (o) {
|
|
2221
|
+
if (typeof window < "u") {
|
|
2222
|
+
let t = new URLSearchParams(window.location.search);
|
|
2223
|
+
return t.set("page", String(e)), `?${t.toString()}`;
|
|
2224
|
+
}
|
|
2225
|
+
return `?page=${e}`;
|
|
2226
|
+
}
|
|
2227
|
+
return r && r !== "#" ? r.replace("{page}", String(e)) : "#";
|
|
2228
|
+
}, E = c === "center" ? "center" : c === "right" ? "flex-end" : "flex-start", D = (e) => ({
|
|
2080
2229
|
display: "inline-flex",
|
|
2081
2230
|
alignItems: "center",
|
|
2082
2231
|
justifyContent: "center",
|
|
@@ -2091,44 +2240,45 @@ function gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2091
2240
|
border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
|
|
2092
2241
|
});
|
|
2093
2242
|
return /* @__PURE__ */ f("nav", {
|
|
2094
|
-
ref:
|
|
2243
|
+
ref: p,
|
|
2095
2244
|
"aria-label": "Pagination",
|
|
2096
2245
|
style: {
|
|
2097
2246
|
display: "flex",
|
|
2098
2247
|
flexWrap: "wrap",
|
|
2099
2248
|
gap: 8,
|
|
2100
2249
|
alignItems: "center",
|
|
2101
|
-
|
|
2250
|
+
justifyContent: E,
|
|
2251
|
+
...C(u)
|
|
2102
2252
|
},
|
|
2103
2253
|
children: [
|
|
2104
2254
|
n && /* @__PURE__ */ d("a", {
|
|
2105
|
-
href:
|
|
2255
|
+
href: w > 1 ? T(w - 1) : "#",
|
|
2106
2256
|
"aria-label": "Previous",
|
|
2107
2257
|
style: {
|
|
2108
|
-
...
|
|
2109
|
-
opacity:
|
|
2258
|
+
...D(!1),
|
|
2259
|
+
opacity: w > 1 ? 1 : .4
|
|
2110
2260
|
},
|
|
2111
2261
|
children: "‹"
|
|
2112
2262
|
}),
|
|
2113
|
-
Array.from({ length:
|
|
2114
|
-
href:
|
|
2115
|
-
"aria-current": e ===
|
|
2116
|
-
style:
|
|
2263
|
+
Array.from({ length: S }, (e, t) => t + 1).map((e) => /* @__PURE__ */ d("a", {
|
|
2264
|
+
href: T(e),
|
|
2265
|
+
"aria-current": e === w ? "page" : void 0,
|
|
2266
|
+
style: D(e === w),
|
|
2117
2267
|
children: e
|
|
2118
2268
|
}, e)),
|
|
2119
2269
|
n && /* @__PURE__ */ d("a", {
|
|
2120
|
-
href:
|
|
2270
|
+
href: w < S ? T(w + 1) : "#",
|
|
2121
2271
|
"aria-label": "Next",
|
|
2122
2272
|
style: {
|
|
2123
|
-
...
|
|
2124
|
-
opacity:
|
|
2273
|
+
...D(!1),
|
|
2274
|
+
opacity: w < S ? 1 : .4
|
|
2125
2275
|
},
|
|
2126
2276
|
children: "›"
|
|
2127
2277
|
})
|
|
2128
2278
|
]
|
|
2129
2279
|
});
|
|
2130
2280
|
}
|
|
2131
|
-
function
|
|
2281
|
+
function xt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
2132
2282
|
if (!e.length) return null;
|
|
2133
2283
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
2134
2284
|
width: 32,
|
|
@@ -2206,7 +2356,7 @@ function _t({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2206
2356
|
})
|
|
2207
2357
|
});
|
|
2208
2358
|
}
|
|
2209
|
-
var
|
|
2359
|
+
var St = {
|
|
2210
2360
|
small: {
|
|
2211
2361
|
w: 132,
|
|
2212
2362
|
h: 46,
|
|
@@ -2228,10 +2378,10 @@ var vt = {
|
|
|
2228
2378
|
title: 12.5,
|
|
2229
2379
|
avatar: 46
|
|
2230
2380
|
}
|
|
2231
|
-
},
|
|
2232
|
-
|
|
2233
|
-
function
|
|
2234
|
-
let r =
|
|
2381
|
+
}, Ct = (e) => St[e] ?? St.medium;
|
|
2382
|
+
St.medium.w, St.medium.h;
|
|
2383
|
+
function wt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
2384
|
+
let r = Ct(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
|
|
2235
2385
|
for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
|
|
2236
2386
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
2237
2387
|
if (t.has(e.id)) return 0;
|
|
@@ -2283,18 +2433,18 @@ function bt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
2283
2433
|
horizontal: n
|
|
2284
2434
|
};
|
|
2285
2435
|
}
|
|
2286
|
-
var
|
|
2436
|
+
var Tt = (e, t) => {
|
|
2287
2437
|
let n = String(e ?? "");
|
|
2288
2438
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
2289
|
-
},
|
|
2439
|
+
}, Et = (e) => {
|
|
2290
2440
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
2291
2441
|
if (!t) return "#ffffff";
|
|
2292
2442
|
let n = t[1];
|
|
2293
2443
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
2294
2444
|
let r = parseInt(n, 16);
|
|
2295
2445
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
2296
|
-
},
|
|
2297
|
-
function
|
|
2446
|
+
}, Dt = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
2447
|
+
function Ot(e, t = {}) {
|
|
2298
2448
|
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 ? "" : K(e);
|
|
2299
2449
|
return n.map((e) => {
|
|
2300
2450
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
@@ -2309,11 +2459,11 @@ function wt(e, t = {}) {
|
|
|
2309
2459
|
};
|
|
2310
2460
|
});
|
|
2311
2461
|
}
|
|
2312
|
-
var
|
|
2462
|
+
var kt = {
|
|
2313
2463
|
size: 36,
|
|
2314
2464
|
pad: 10
|
|
2315
2465
|
};
|
|
2316
|
-
function
|
|
2466
|
+
function At({ node: e, onClose: t }) {
|
|
2317
2467
|
return a(() => {
|
|
2318
2468
|
let e = (e) => e.key === "Escape" && t();
|
|
2319
2469
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -2431,7 +2581,7 @@ function Et({ node: e, onClose: t }) {
|
|
|
2431
2581
|
})
|
|
2432
2582
|
});
|
|
2433
2583
|
}
|
|
2434
|
-
function
|
|
2584
|
+
function jt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
|
|
2435
2585
|
let b = o(), [x, S] = l(null), { tenant: w, apiUrl: T } = i(H), E = i(U)?.[t], [D, O] = l(null);
|
|
2436
2586
|
a(() => {
|
|
2437
2587
|
if (!t || E) return;
|
|
@@ -2448,14 +2598,14 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2448
2598
|
T,
|
|
2449
2599
|
E
|
|
2450
2600
|
]);
|
|
2451
|
-
let k = t ?
|
|
2601
|
+
let k = t ? Ot(E ?? D ?? [], {
|
|
2452
2602
|
nameField: n,
|
|
2453
2603
|
titleField: r,
|
|
2454
2604
|
photoField: s,
|
|
2455
2605
|
parentField: c,
|
|
2456
2606
|
cvField: p,
|
|
2457
2607
|
hrefField: m
|
|
2458
|
-
}) : e, A =
|
|
2608
|
+
}) : e, A = Ct(h), { boxes: j, links: M, width: N, height: P } = wt(k, {
|
|
2459
2609
|
size: h,
|
|
2460
2610
|
horizontal: g
|
|
2461
2611
|
});
|
|
@@ -2501,7 +2651,7 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2501
2651
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
2502
2652
|
strokeWidth: "1.5"
|
|
2503
2653
|
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
2504
|
-
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ?
|
|
2654
|
+
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Et(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Et(e.color2) : s, l = y && (Dt(e) || e.href), p = () => Dt(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + kt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
2505
2655
|
return /* @__PURE__ */ f("g", {
|
|
2506
2656
|
onClick: l ? p : void 0,
|
|
2507
2657
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -2565,13 +2715,13 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2565
2715
|
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
2566
2716
|
id: `${b}-${e.id}`,
|
|
2567
2717
|
children: /* @__PURE__ */ d("circle", {
|
|
2568
|
-
cx: t +
|
|
2718
|
+
cx: t + kt.pad + A.avatar / 2,
|
|
2569
2719
|
cy: n + A.h / 2,
|
|
2570
2720
|
r: A.avatar / 2
|
|
2571
2721
|
})
|
|
2572
2722
|
}), /* @__PURE__ */ d("image", {
|
|
2573
2723
|
href: e.photo,
|
|
2574
|
-
x: t +
|
|
2724
|
+
x: t + kt.pad,
|
|
2575
2725
|
y: n + (A.h - A.avatar) / 2,
|
|
2576
2726
|
width: A.avatar,
|
|
2577
2727
|
height: A.avatar,
|
|
@@ -2585,7 +2735,7 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2585
2735
|
fontSize: A.title,
|
|
2586
2736
|
fontWeight: "600",
|
|
2587
2737
|
fill: s,
|
|
2588
|
-
children:
|
|
2738
|
+
children: Tt(e.title, g + 4)
|
|
2589
2739
|
}), e.name && /* @__PURE__ */ d("text", {
|
|
2590
2740
|
x: m,
|
|
2591
2741
|
y: n + _ + _ / 2 + A.name * .35,
|
|
@@ -2593,7 +2743,7 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2593
2743
|
fontSize: A.name,
|
|
2594
2744
|
fontWeight: "600",
|
|
2595
2745
|
fill: c,
|
|
2596
|
-
children:
|
|
2746
|
+
children: Tt(e.name, g)
|
|
2597
2747
|
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
2598
2748
|
x: m,
|
|
2599
2749
|
y: n + (v[1] ? A.h * .43 : A.h * .57),
|
|
@@ -2601,7 +2751,7 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2601
2751
|
fontSize: A.name,
|
|
2602
2752
|
fontWeight: "600",
|
|
2603
2753
|
fill: s,
|
|
2604
|
-
children:
|
|
2754
|
+
children: Tt(v[0], g)
|
|
2605
2755
|
}), v[1] && /* @__PURE__ */ d("text", {
|
|
2606
2756
|
x: m,
|
|
2607
2757
|
y: n + A.h * .73,
|
|
@@ -2609,135 +2759,151 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2609
2759
|
fontSize: A.title,
|
|
2610
2760
|
opacity: "0.7",
|
|
2611
2761
|
fill: s,
|
|
2612
|
-
children:
|
|
2762
|
+
children: Tt(v[1], g + 4)
|
|
2613
2763
|
})] })
|
|
2614
2764
|
]
|
|
2615
2765
|
}, e.id);
|
|
2616
2766
|
})]
|
|
2617
|
-
}), x && /* @__PURE__ */ d(
|
|
2767
|
+
}), x && /* @__PURE__ */ d(At, {
|
|
2618
2768
|
node: x,
|
|
2619
2769
|
onClose: () => S(null)
|
|
2620
2770
|
})]
|
|
2621
2771
|
});
|
|
2622
2772
|
}
|
|
2623
|
-
function
|
|
2624
|
-
let { tenant:
|
|
2773
|
+
function Mt({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: c = !1, paged: u, emptyText: p, style: m, nodeRef: h }) {
|
|
2774
|
+
let { tenant: g, apiUrl: _ } = i(H), v = i(U), y = v?.[n], b = u ? W(v) : 1, [x, S] = l(null);
|
|
2625
2775
|
if (a(() => {
|
|
2626
|
-
if (!n ||
|
|
2627
|
-
let e = !0, t = n.startsWith("api:") ? `${
|
|
2628
|
-
return fetch(
|
|
2776
|
+
if (!n || y) return;
|
|
2777
|
+
let e = !0, t = Math.max(1, Number(r) || 10), i = u && !n.startsWith("api:") ? `?offset=${(b - 1) * t}&limit=${t}` : "", a = n.startsWith("api:") ? `${_}/data/${encodeURIComponent(n.slice(4))}` : `${_}/dynamic/${encodeURIComponent(n)}${i}`;
|
|
2778
|
+
return fetch(a, { headers: g ? { "x-tenant": g } : {} }).then((e) => e.json()).then((t) => {
|
|
2779
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
2780
|
+
return e && S(n);
|
|
2781
|
+
}).catch(() => e && S([])), () => {
|
|
2629
2782
|
e = !1;
|
|
2630
2783
|
};
|
|
2631
2784
|
}, [
|
|
2632
2785
|
n,
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2786
|
+
g,
|
|
2787
|
+
_,
|
|
2788
|
+
y,
|
|
2789
|
+
u,
|
|
2790
|
+
b,
|
|
2791
|
+
r
|
|
2636
2792
|
]), !e.length) return null;
|
|
2637
|
-
let
|
|
2793
|
+
let w = Math.max(1, Number(r) || 10), T = n ? u ? y || n.startsWith("api:") ? (y ?? x ?? []).slice((b - 1) * w, b * w) : (x ?? []).slice(0, w) : (y ?? x ?? []).slice(0, w) : null, E = T ? T.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, D = !!n && !(n && !y && x === null) && E.length === 0, O = c ? "6px 10px" : "10px 14px", k = "1px solid rgba(148, 163, 184, 0.35)", A = s ? { border: k } : { borderBottom: k };
|
|
2638
2794
|
return /* @__PURE__ */ d("div", {
|
|
2639
|
-
ref:
|
|
2795
|
+
ref: h,
|
|
2640
2796
|
style: {
|
|
2641
2797
|
width: "100%",
|
|
2642
2798
|
overflowX: "auto",
|
|
2643
|
-
...C(
|
|
2799
|
+
...C(m)
|
|
2644
2800
|
},
|
|
2645
2801
|
children: /* @__PURE__ */ f("table", {
|
|
2646
2802
|
style: {
|
|
2647
2803
|
width: "100%",
|
|
2648
2804
|
borderCollapse: "collapse",
|
|
2649
2805
|
fontSize: 14,
|
|
2650
|
-
...s ? { border:
|
|
2806
|
+
...s ? { border: k } : {}
|
|
2651
2807
|
},
|
|
2652
2808
|
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((e, t) => /* @__PURE__ */ d("th", {
|
|
2653
2809
|
style: {
|
|
2654
2810
|
textAlign: "left",
|
|
2655
2811
|
fontWeight: 600,
|
|
2656
|
-
padding:
|
|
2812
|
+
padding: O,
|
|
2657
2813
|
background: "rgba(148, 163, 184, 0.12)",
|
|
2658
|
-
...
|
|
2814
|
+
...A
|
|
2659
2815
|
},
|
|
2660
2816
|
children: e.label ?? e
|
|
2661
|
-
}, t)) }) }), /* @__PURE__ */
|
|
2817
|
+
}, t)) }) }), /* @__PURE__ */ f("tbody", { children: [D && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
2818
|
+
colSpan: e.length,
|
|
2819
|
+
style: {
|
|
2820
|
+
padding: O,
|
|
2821
|
+
textAlign: "center",
|
|
2822
|
+
opacity: .6,
|
|
2823
|
+
...A
|
|
2824
|
+
},
|
|
2825
|
+
children: p || "No data yet"
|
|
2826
|
+
}) }), E.map((t, n) => /* @__PURE__ */ d("tr", {
|
|
2662
2827
|
style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
2663
2828
|
children: e.map((e, n) => /* @__PURE__ */ d("td", {
|
|
2664
2829
|
style: {
|
|
2665
|
-
padding:
|
|
2666
|
-
...
|
|
2830
|
+
padding: O,
|
|
2831
|
+
...A
|
|
2667
2832
|
},
|
|
2668
2833
|
children: t?.[n] ?? ""
|
|
2669
2834
|
}, n))
|
|
2670
|
-
}, n)) })]
|
|
2835
|
+
}, n))] })]
|
|
2671
2836
|
})
|
|
2672
2837
|
});
|
|
2673
2838
|
}
|
|
2674
|
-
var
|
|
2675
|
-
PageRoot:
|
|
2676
|
-
Section:
|
|
2677
|
-
Container:
|
|
2678
|
-
Heading:
|
|
2679
|
-
TextBlock:
|
|
2680
|
-
ButtonBlock:
|
|
2681
|
-
ImageBlock:
|
|
2682
|
-
Spacer:
|
|
2683
|
-
Divider:
|
|
2684
|
-
SliderBlock:
|
|
2685
|
-
CanvasSlider:
|
|
2686
|
-
TabsBlock:
|
|
2687
|
-
QuickStack:
|
|
2688
|
-
CollectionList:
|
|
2689
|
-
BreadcrumbsBlock:
|
|
2690
|
-
PaginationBlock:
|
|
2691
|
-
StepperBlock:
|
|
2692
|
-
OrgChartBlock:
|
|
2693
|
-
TableBlock:
|
|
2694
|
-
AccordionBlock:
|
|
2695
|
-
NavbarBlock:
|
|
2696
|
-
ListBlock:
|
|
2697
|
-
TextSpan:
|
|
2698
|
-
QuoteBlock:
|
|
2699
|
-
TextLink:
|
|
2700
|
-
RichTextBlock:
|
|
2701
|
-
RichContentBlock:
|
|
2702
|
-
VideoBlock:
|
|
2703
|
-
YouTubeBlock:
|
|
2704
|
-
IframeBlock:
|
|
2705
|
-
EmbedBlock:
|
|
2706
|
-
FormBlock:
|
|
2707
|
-
FormLabel:
|
|
2708
|
-
FormInput:
|
|
2709
|
-
FormTextarea:
|
|
2710
|
-
FormCheckbox: (e) => /* @__PURE__ */ d(
|
|
2839
|
+
var Nt = {
|
|
2840
|
+
PageRoot: he,
|
|
2841
|
+
Section: ge,
|
|
2842
|
+
Container: _e,
|
|
2843
|
+
Heading: ve,
|
|
2844
|
+
TextBlock: ke,
|
|
2845
|
+
ButtonBlock: Me,
|
|
2846
|
+
ImageBlock: Ne,
|
|
2847
|
+
Spacer: ze,
|
|
2848
|
+
Divider: Be,
|
|
2849
|
+
SliderBlock: Ke,
|
|
2850
|
+
CanvasSlider: qe,
|
|
2851
|
+
TabsBlock: Ze,
|
|
2852
|
+
QuickStack: _t,
|
|
2853
|
+
CollectionList: vt,
|
|
2854
|
+
BreadcrumbsBlock: yt,
|
|
2855
|
+
PaginationBlock: bt,
|
|
2856
|
+
StepperBlock: xt,
|
|
2857
|
+
OrgChartBlock: jt,
|
|
2858
|
+
TableBlock: Mt,
|
|
2859
|
+
AccordionBlock: Qe,
|
|
2860
|
+
NavbarBlock: Xe,
|
|
2861
|
+
ListBlock: Oe,
|
|
2862
|
+
TextSpan: xe,
|
|
2863
|
+
QuoteBlock: De,
|
|
2864
|
+
TextLink: je,
|
|
2865
|
+
RichTextBlock: Te,
|
|
2866
|
+
RichContentBlock: Te,
|
|
2867
|
+
VideoBlock: Pe,
|
|
2868
|
+
YouTubeBlock: Ie,
|
|
2869
|
+
IframeBlock: Le,
|
|
2870
|
+
EmbedBlock: Re,
|
|
2871
|
+
FormBlock: ot,
|
|
2872
|
+
FormLabel: ut,
|
|
2873
|
+
FormInput: dt,
|
|
2874
|
+
FormTextarea: ft,
|
|
2875
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(pt, {
|
|
2711
2876
|
kind: "checkbox",
|
|
2712
2877
|
...e
|
|
2713
2878
|
}),
|
|
2714
|
-
FormRadio: (e) => /* @__PURE__ */ d(
|
|
2879
|
+
FormRadio: (e) => /* @__PURE__ */ d(pt, {
|
|
2715
2880
|
kind: "radio",
|
|
2716
2881
|
...e
|
|
2717
2882
|
}),
|
|
2718
|
-
FormSelect:
|
|
2719
|
-
FormFile:
|
|
2720
|
-
|
|
2721
|
-
|
|
2883
|
+
FormSelect: mt,
|
|
2884
|
+
FormFile: ht,
|
|
2885
|
+
FormRecaptcha: lt,
|
|
2886
|
+
FormSubmit: gt
|
|
2887
|
+
}, Pt = {
|
|
2722
2888
|
id: "auth",
|
|
2723
2889
|
label: "Accounts",
|
|
2724
2890
|
category: "Apps",
|
|
2725
2891
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
2726
2892
|
ssr: "shell",
|
|
2727
2893
|
settings: ["apps.auth.redirect"]
|
|
2728
|
-
},
|
|
2894
|
+
}, Ft = n({
|
|
2729
2895
|
user: null,
|
|
2730
2896
|
status: "idle",
|
|
2731
2897
|
ensure: () => {},
|
|
2732
2898
|
refresh: () => {},
|
|
2733
2899
|
signOut: () => {}
|
|
2734
|
-
}),
|
|
2735
|
-
let e = i(
|
|
2900
|
+
}), It = () => {
|
|
2901
|
+
let e = i(Ft);
|
|
2736
2902
|
return a(() => {
|
|
2737
2903
|
e.ensure();
|
|
2738
2904
|
}, [e]), e;
|
|
2739
2905
|
};
|
|
2740
|
-
function
|
|
2906
|
+
function Lt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o }) {
|
|
2741
2907
|
let u = i(H), f = a || u?.apiUrl || "/api", p = o || u?.tenant || "", [m, h] = l(t ?? null), [g, _] = l(t ? "user" : n ? "guest" : "idle"), v = c(!1), y = r((e, t) => fetch(`${f}${e}`, {
|
|
2742
2908
|
...t,
|
|
2743
2909
|
credentials: "include",
|
|
@@ -2770,18 +2936,18 @@ function Nt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o })
|
|
|
2770
2936
|
b,
|
|
2771
2937
|
x
|
|
2772
2938
|
]);
|
|
2773
|
-
return /* @__PURE__ */ d(
|
|
2939
|
+
return /* @__PURE__ */ d(Ft.Provider, {
|
|
2774
2940
|
value: C,
|
|
2775
2941
|
children: e
|
|
2776
2942
|
});
|
|
2777
2943
|
}
|
|
2778
|
-
function
|
|
2779
|
-
let { status: n } =
|
|
2944
|
+
function Rt({ when: e, children: t }) {
|
|
2945
|
+
let { status: n } = It();
|
|
2780
2946
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
2781
2947
|
}
|
|
2782
2948
|
//#endregion
|
|
2783
2949
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
2784
|
-
function
|
|
2950
|
+
function zt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
|
|
2785
2951
|
let { tenant: h, apiUrl: g, settings: _ } = i(H), [v, y] = l("form"), [b, x] = l(""), [S, w] = l(!1), T = e === "register", E = u ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
|
|
2786
2952
|
if (e.preventDefault(), u) return;
|
|
2787
2953
|
let n = new FormData(e.currentTarget);
|
|
@@ -2905,8 +3071,8 @@ function Ft({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
2905
3071
|
]
|
|
2906
3072
|
});
|
|
2907
3073
|
}
|
|
2908
|
-
function
|
|
2909
|
-
let { user: c, status: l, signOut: u } =
|
|
3074
|
+
function Bt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
3075
|
+
let { user: c, status: l, signOut: u } = It(), p = a ? s || "user" : l, m = a ? {
|
|
2910
3076
|
name: "Ada Lovelace",
|
|
2911
3077
|
email: "ada@example.com"
|
|
2912
3078
|
} : c;
|
|
@@ -2971,16 +3137,16 @@ function It({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
2971
3137
|
}
|
|
2972
3138
|
//#endregion
|
|
2973
3139
|
//#region ../ui/src/components/builder/apps/index.js
|
|
2974
|
-
var
|
|
2975
|
-
SiteLoginForm:
|
|
2976
|
-
SiteAccountMenu:
|
|
3140
|
+
var Vt = [Pt], Ht = {
|
|
3141
|
+
SiteLoginForm: zt,
|
|
3142
|
+
SiteAccountMenu: Bt
|
|
2977
3143
|
};
|
|
2978
|
-
new Set(
|
|
3144
|
+
new Set(Vt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
2979
3145
|
//#endregion
|
|
2980
3146
|
//#region ../ui/src/components/builder/render.jsx
|
|
2981
|
-
var
|
|
2982
|
-
...
|
|
2983
|
-
...
|
|
3147
|
+
var Ut = {
|
|
3148
|
+
...Nt,
|
|
3149
|
+
...Ht
|
|
2984
3150
|
};
|
|
2985
3151
|
function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
2986
3152
|
let o = n[e];
|
|
@@ -2992,7 +3158,7 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
2992
3158
|
let c = new Set(i).add(n);
|
|
2993
3159
|
return /* @__PURE__ */ d(t, { children: Q(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
2994
3160
|
}
|
|
2995
|
-
let l =
|
|
3161
|
+
let l = Ut[s];
|
|
2996
3162
|
if (!l) return null;
|
|
2997
3163
|
let u = (o.nodes ?? []).map((e) => Q(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Q(t, n, r, i)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
2998
3164
|
...c,
|
|
@@ -3003,15 +3169,15 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3003
3169
|
},
|
|
3004
3170
|
children: u.length ? u : void 0
|
|
3005
3171
|
}, e);
|
|
3006
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
3172
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(Rt, {
|
|
3007
3173
|
when: c.when,
|
|
3008
3174
|
children: m
|
|
3009
3175
|
}, e) : m;
|
|
3010
3176
|
}
|
|
3011
3177
|
//#endregion
|
|
3012
3178
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
3013
|
-
var
|
|
3014
|
-
function
|
|
3179
|
+
var Wt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
|
|
3180
|
+
function Gt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, tenant: c, apiUrl: l, datasets: u, locale: p, direction: m, settings: g, siteUser: v }) {
|
|
3015
3181
|
let b = o?.js?.trim();
|
|
3016
3182
|
if (a(() => {
|
|
3017
3183
|
if (!b) return;
|
|
@@ -3021,11 +3187,11 @@ function Vt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3021
3187
|
let x = {
|
|
3022
3188
|
lang: p || void 0,
|
|
3023
3189
|
dir: h(m, p)
|
|
3024
|
-
}, S = {
|
|
3190
|
+
}, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
|
|
3025
3191
|
minHeight: "100%",
|
|
3026
3192
|
display: "flex",
|
|
3027
3193
|
flexDirection: "column"
|
|
3028
|
-
},
|
|
3194
|
+
}, w = Q("ROOT", e, n), T = s(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = F(e, n), D = P(e, n), O = o?.css?.trim(), k = y(e, n).map((e) => /* @__PURE__ */ d("link", {
|
|
3029
3195
|
rel: "stylesheet",
|
|
3030
3196
|
precedence: "default",
|
|
3031
3197
|
href: _(e)
|
|
@@ -3037,32 +3203,34 @@ function Vt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3037
3203
|
locale: p || "",
|
|
3038
3204
|
settings: g ?? null
|
|
3039
3205
|
},
|
|
3040
|
-
children: /* @__PURE__ */ d(
|
|
3206
|
+
children: /* @__PURE__ */ d(Lt, {
|
|
3041
3207
|
initialUser: v,
|
|
3042
3208
|
children: /* @__PURE__ */ d(U.Provider, {
|
|
3043
3209
|
value: u ?? null,
|
|
3044
|
-
children: /* @__PURE__ */ d(
|
|
3045
|
-
value:
|
|
3210
|
+
children: /* @__PURE__ */ d(ae.Provider, {
|
|
3211
|
+
value: T,
|
|
3046
3212
|
children: /* @__PURE__ */ f("div", {
|
|
3047
3213
|
...x,
|
|
3214
|
+
className: "webim-page",
|
|
3048
3215
|
style: {
|
|
3049
|
-
...
|
|
3216
|
+
...C,
|
|
3050
3217
|
...re(t, r),
|
|
3051
3218
|
...i
|
|
3052
3219
|
},
|
|
3053
3220
|
children: [
|
|
3054
|
-
|
|
3055
|
-
|
|
3221
|
+
k,
|
|
3222
|
+
/* @__PURE__ */ d("style", { children: S }),
|
|
3056
3223
|
E && /* @__PURE__ */ d("style", { children: E }),
|
|
3057
3224
|
D && /* @__PURE__ */ d("style", { children: D }),
|
|
3058
|
-
|
|
3225
|
+
O && /* @__PURE__ */ d("style", { children: O }),
|
|
3226
|
+
w
|
|
3059
3227
|
]
|
|
3060
3228
|
})
|
|
3061
3229
|
})
|
|
3062
3230
|
})
|
|
3063
3231
|
})
|
|
3064
3232
|
});
|
|
3065
|
-
let
|
|
3233
|
+
let A = B(t);
|
|
3066
3234
|
return /* @__PURE__ */ d(H.Provider, {
|
|
3067
3235
|
value: {
|
|
3068
3236
|
tenant: c || "",
|
|
@@ -3070,28 +3238,29 @@ function Vt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3070
3238
|
locale: p || "",
|
|
3071
3239
|
settings: g ?? null
|
|
3072
3240
|
},
|
|
3073
|
-
children: /* @__PURE__ */ d(
|
|
3241
|
+
children: /* @__PURE__ */ d(Lt, {
|
|
3074
3242
|
initialUser: v,
|
|
3075
3243
|
children: /* @__PURE__ */ d(U.Provider, {
|
|
3076
3244
|
value: u ?? null,
|
|
3077
|
-
children: /* @__PURE__ */ d(
|
|
3078
|
-
value:
|
|
3245
|
+
children: /* @__PURE__ */ d(ae.Provider, {
|
|
3246
|
+
value: T,
|
|
3079
3247
|
children: /* @__PURE__ */ f("div", {
|
|
3080
3248
|
...x,
|
|
3081
3249
|
className: "webim-page",
|
|
3082
3250
|
style: {
|
|
3083
|
-
...
|
|
3251
|
+
...C,
|
|
3084
3252
|
...ne(t),
|
|
3085
3253
|
...i
|
|
3086
3254
|
},
|
|
3087
3255
|
children: [
|
|
3088
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
3089
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
3090
|
-
|
|
3091
|
-
|
|
3256
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${Wt(V(A.light))} }
|
|
3257
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Wt(V(A.dark))} } }` }),
|
|
3258
|
+
k,
|
|
3259
|
+
/* @__PURE__ */ d("style", { children: S }),
|
|
3092
3260
|
E && /* @__PURE__ */ d("style", { children: E }),
|
|
3093
3261
|
D && /* @__PURE__ */ d("style", { children: D }),
|
|
3094
|
-
|
|
3262
|
+
O && /* @__PURE__ */ d("style", { children: O }),
|
|
3263
|
+
w
|
|
3095
3264
|
]
|
|
3096
3265
|
})
|
|
3097
3266
|
})
|
|
@@ -3101,8 +3270,8 @@ function Vt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3101
3270
|
}
|
|
3102
3271
|
//#endregion
|
|
3103
3272
|
//#region src/WebimContent.jsx
|
|
3104
|
-
function
|
|
3105
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
3273
|
+
function Kt({ bundle: e, mode: t = "auto", style: n }) {
|
|
3274
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(Gt, {
|
|
3106
3275
|
blocks: e.blocks,
|
|
3107
3276
|
theme: e.theme,
|
|
3108
3277
|
components: e.components,
|
|
@@ -3119,7 +3288,7 @@ function Ht({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
3119
3288
|
}
|
|
3120
3289
|
//#endregion
|
|
3121
3290
|
//#region src/bundle.js
|
|
3122
|
-
function
|
|
3291
|
+
function qt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
3123
3292
|
let a = {
|
|
3124
3293
|
...t?.global ?? {},
|
|
3125
3294
|
...t?.tenant ?? {}
|
|
@@ -3143,29 +3312,36 @@ function Ut({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
3143
3312
|
}
|
|
3144
3313
|
//#endregion
|
|
3145
3314
|
//#region src/fetchPage.js
|
|
3146
|
-
var
|
|
3315
|
+
var Jt = async (e) => {
|
|
3147
3316
|
let t = await e.json().catch(() => null);
|
|
3148
3317
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
3149
3318
|
return t?.payload ?? t;
|
|
3150
3319
|
};
|
|
3151
|
-
async function
|
|
3320
|
+
async function Yt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
3152
3321
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
3153
3322
|
if (!n) throw Error("fetchPage: slug is required");
|
|
3154
|
-
let
|
|
3323
|
+
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
3155
3324
|
...t ? { "x-tenant": t } : {},
|
|
3156
3325
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
3157
|
-
}, [
|
|
3158
|
-
page:
|
|
3159
|
-
settings:
|
|
3326
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Jt), c(`${l}/settings/public`, { headers: u }).then(Jt)]), p = qt({
|
|
3327
|
+
page: d,
|
|
3328
|
+
settings: f,
|
|
3160
3329
|
tenant: t,
|
|
3161
|
-
apiUrl:
|
|
3330
|
+
apiUrl: l,
|
|
3162
3331
|
locale: r
|
|
3163
|
-
}),
|
|
3164
|
-
if (
|
|
3165
|
-
let e = (e) => e.startsWith("api:") ? `${
|
|
3166
|
-
|
|
3332
|
+
}), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
|
|
3333
|
+
if (m.length) {
|
|
3334
|
+
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(Jt).then((e) => {
|
|
3335
|
+
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
3336
|
+
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
3337
|
+
}).catch(() => [[t, []]])));
|
|
3338
|
+
p.datasets = Object.fromEntries(t.flat());
|
|
3167
3339
|
}
|
|
3168
|
-
|
|
3340
|
+
let h = Number(o);
|
|
3341
|
+
return Number.isFinite(h) && h >= 1 && (p.datasets = {
|
|
3342
|
+
...p.datasets ?? {},
|
|
3343
|
+
__page: Math.floor(h)
|
|
3344
|
+
}), p;
|
|
3169
3345
|
}
|
|
3170
3346
|
//#endregion
|
|
3171
3347
|
//#region src/ssr.jsx
|
|
@@ -3175,14 +3351,14 @@ var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
|
3175
3351
|
">": ">",
|
|
3176
3352
|
"\"": """
|
|
3177
3353
|
})[e]);
|
|
3178
|
-
function
|
|
3179
|
-
return e(/* @__PURE__ */ d(
|
|
3354
|
+
function Xt(t, { mode: n = "auto", style: r } = {}) {
|
|
3355
|
+
return e(/* @__PURE__ */ d(Kt, {
|
|
3180
3356
|
bundle: t,
|
|
3181
3357
|
mode: n,
|
|
3182
3358
|
style: r
|
|
3183
3359
|
}));
|
|
3184
3360
|
}
|
|
3185
|
-
function
|
|
3361
|
+
function Zt(e, { mode: t = "auto", lang: n } = {}) {
|
|
3186
3362
|
let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
|
|
3187
3363
|
"<meta charset=\"utf-8\"/>",
|
|
3188
3364
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
@@ -3199,10 +3375,10 @@ function qt(e, { mode: t = "auto", lang: n } = {}) {
|
|
|
3199
3375
|
${c}
|
|
3200
3376
|
</head>
|
|
3201
3377
|
<body>
|
|
3202
|
-
${
|
|
3378
|
+
${Xt(e, { mode: t })}
|
|
3203
3379
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
3204
3380
|
</body>
|
|
3205
3381
|
</html>`;
|
|
3206
3382
|
}
|
|
3207
3383
|
//#endregion
|
|
3208
|
-
export {
|
|
3384
|
+
export { qt as assembleBundle, Yt as fetchPage, Xt as renderBundleHtml, Zt as renderPageDocument };
|