webim-adapter 2.0.3 → 2.1.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/CHANGELOG.md +5 -0
- package/build/webim-adapter.js +1072 -746
- package/build/webim-embed.js +16 -10
- package/build/webim-ssr.js +1147 -821
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -269,26 +269,26 @@ function P(e) {
|
|
|
269
269
|
delete t.textStrokeWidth, delete t.textStrokeColor, (W !== void 0 || te !== void 0) && (t.WebkitTextStroke = `${M(W ?? 1)} ${te || "currentColor"}`);
|
|
270
270
|
let { clipText: ne } = t;
|
|
271
271
|
delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
272
|
-
let { transitions:
|
|
272
|
+
let { transitions: G, transitionDuration: K, transitionEasing: re, transitionProperty: q } = t, ie = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
273
273
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
274
|
-
let
|
|
275
|
-
if (
|
|
274
|
+
let ae = (Array.isArray(G) ? G : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ie(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
275
|
+
if (K !== void 0 && ae.push(`${q || "all"} ${ie(K)} ${re || "ease"}`), ae.length && (t.transition = ae.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
276
276
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
277
277
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
278
278
|
}
|
|
279
279
|
delete t.backgroundVideo;
|
|
280
|
-
let { overlayColor:
|
|
281
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
282
|
-
let e = `color-mix(in srgb, ${
|
|
280
|
+
let { overlayColor: J, overlayOpacity: oe } = t;
|
|
281
|
+
if (delete t.overlayColor, delete t.overlayOpacity, J) {
|
|
282
|
+
let e = `color-mix(in srgb, ${J} ${oe ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
283
283
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
284
284
|
}
|
|
285
285
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
286
|
-
let { backgroundLayers:
|
|
286
|
+
let { backgroundLayers: se } = t;
|
|
287
287
|
delete t.backgroundLayers;
|
|
288
|
-
let
|
|
289
|
-
if (
|
|
288
|
+
let ce = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1);
|
|
289
|
+
if (ce.length) {
|
|
290
290
|
let e = [], n = [], r = [], i = [], a = [];
|
|
291
|
-
for (let t of
|
|
291
|
+
for (let t of ce) 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");
|
|
292
292
|
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");
|
|
293
293
|
else {
|
|
294
294
|
if (!t.src) continue;
|
|
@@ -385,10 +385,10 @@ function ne(e, t, n, r = !1) {
|
|
|
385
385
|
let i = Object.entries(P(t)).map(([e, t]) => `${te(e)}: ${t} !important;`).join(" ");
|
|
386
386
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function G(e, t, n) {
|
|
389
389
|
return Object.entries(F).map(([r, i]) => ne(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
390
390
|
}
|
|
391
|
-
var
|
|
391
|
+
var K = [
|
|
392
392
|
{
|
|
393
393
|
key: "tablet",
|
|
394
394
|
max: 991
|
|
@@ -401,17 +401,17 @@ var G = [
|
|
|
401
401
|
key: "mobile",
|
|
402
402
|
max: 478
|
|
403
403
|
}
|
|
404
|
-
],
|
|
405
|
-
function
|
|
406
|
-
return
|
|
407
|
-
let i = t?.[n] ?
|
|
404
|
+
], re = (e) => Object.entries(P(e)).map(([e, t]) => `${te(e)}: ${t} !important;`).join(" ");
|
|
405
|
+
function q(e, t) {
|
|
406
|
+
return K.map(({ key: n, max: r }) => {
|
|
407
|
+
let i = t?.[n] ? re(t[n]) : "";
|
|
408
408
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
409
409
|
}).filter(Boolean).join("\n");
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function ie(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
|
-
let e =
|
|
414
|
+
let e = q(t, r.props);
|
|
415
415
|
e && n.push(e);
|
|
416
416
|
}
|
|
417
417
|
};
|
|
@@ -419,10 +419,10 @@ function oe(e, t) {
|
|
|
419
419
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
420
420
|
return n.join("\n");
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function ae(e, t) {
|
|
423
423
|
let n = [], r = (e) => {
|
|
424
424
|
for (let [t, r] of Object.entries(e || {})) {
|
|
425
|
-
let e =
|
|
425
|
+
let e = G(t, r.props);
|
|
426
426
|
e && n.push(e);
|
|
427
427
|
}
|
|
428
428
|
};
|
|
@@ -430,15 +430,282 @@ function se(e, t) {
|
|
|
430
430
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
431
431
|
return n.join("\n");
|
|
432
432
|
}
|
|
433
|
-
var
|
|
434
|
-
fontFamily:
|
|
433
|
+
var J = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", oe = {
|
|
434
|
+
fontFamily: J,
|
|
435
435
|
fontStyle: "normal",
|
|
436
436
|
fontWeight: 400,
|
|
437
437
|
letterSpacing: "normal",
|
|
438
438
|
textTransform: "none",
|
|
439
439
|
lineHeight: 1.4,
|
|
440
440
|
textShadow: "none"
|
|
441
|
-
},
|
|
441
|
+
}, se = /^(https?:|mailto:|tel:)/i, ce = /^[a-z][a-z0-9+.-]*:/i;
|
|
442
|
+
function le(e) {
|
|
443
|
+
let t = String(e ?? "").trim();
|
|
444
|
+
return t ? se.test(t) || t.startsWith("//") ? t : ce.test(t) ? "" : t : "";
|
|
445
|
+
}
|
|
446
|
+
var ue = /^\\([\\`*_{}[\]()#+\-.!~>|])/, de = /^(`+)([\s\S]*?[^`])\1(?!`)/, fe = /^!\[([^\]]*)\]\(\s*<?([^)\s>]*)>?(?:\s+"([^"]*)")?\s*\)/, pe = /^\[((?:[^[\]]|\[[^\]]*\])*)\]\(\s*<?([^)\s>]*)>?(?:\s+"([^"]*)")?\s*\)/, me = /^<((?:https?:\/\/|mailto:)[^>\s]+)>/, he = /^https?:\/\/[^\s<>"'`]+[^\s<>"'`.,;:!?)\]}]/, ge = /^(\*\*|__)(?=\S)([\s\S]*?\S)\1/, _e = /^~~(?=\S)([\s\S]*?\S)~~/, ve = /^(\*|_)(?=\S)([\s\S]*?\S)\1/, ye = /[\\`*_~![<\n]|https?:\/\//, be = (e, t) => e.map((e) => e.br || e.image ? {
|
|
447
|
+
...e,
|
|
448
|
+
...t.href ? {
|
|
449
|
+
href: t.href,
|
|
450
|
+
target: t.target
|
|
451
|
+
} : null
|
|
452
|
+
} : {
|
|
453
|
+
...e,
|
|
454
|
+
...t
|
|
455
|
+
});
|
|
456
|
+
function Y(e, t = {}) {
|
|
457
|
+
let n = String(e ?? ""), r = t.newTab ? "_blank" : void 0, i = [], a = "", o = 0, s = () => {
|
|
458
|
+
a && i.push({ text: a }), a = "";
|
|
459
|
+
}, c = (e) => {
|
|
460
|
+
s(), i.push(...e);
|
|
461
|
+
};
|
|
462
|
+
for (; o < n.length;) {
|
|
463
|
+
let e = n.slice(o), i = o > 0 ? n[o - 1] : "", s = ue.exec(e);
|
|
464
|
+
if (s) {
|
|
465
|
+
a += s[1], o += s[0].length;
|
|
466
|
+
continue;
|
|
467
|
+
}
|
|
468
|
+
if (e[0] === "\n") {
|
|
469
|
+
/ {2,}$/.test(a) ? (a = a.replace(/ +$/, ""), c([{ br: !0 }])) : a.endsWith("\\") ? (a = a.slice(0, -1), c([{ br: !0 }])) : a += " ", o += 1;
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
if (s = de.exec(e), s) {
|
|
473
|
+
c([{
|
|
474
|
+
text: (/^ .* $/.test(s[2]) ? s[2].slice(1, -1) : s[2]).replace(/\n/g, " "),
|
|
475
|
+
code: !0
|
|
476
|
+
}]), o += s[0].length;
|
|
477
|
+
continue;
|
|
478
|
+
}
|
|
479
|
+
if (s = fe.exec(e), s) {
|
|
480
|
+
let e = le(s[2]);
|
|
481
|
+
e ? c([{ image: {
|
|
482
|
+
src: e,
|
|
483
|
+
alt: s[1] || "",
|
|
484
|
+
title: s[3] || ""
|
|
485
|
+
} }]) : a += s[1], o += s[0].length;
|
|
486
|
+
continue;
|
|
487
|
+
}
|
|
488
|
+
if (s = pe.exec(e), s) {
|
|
489
|
+
let e = le(s[2]), n = Y(s[1], t);
|
|
490
|
+
c(e ? be(n, {
|
|
491
|
+
href: e,
|
|
492
|
+
target: r
|
|
493
|
+
}) : n), o += s[0].length;
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
if (s = me.exec(e) ?? (/[\s(<]/.test(i) || o === 0 ? he.exec(e) : null), s) {
|
|
497
|
+
let e = s[1] ?? s[0], t = le(e);
|
|
498
|
+
t ? c([{
|
|
499
|
+
text: e.replace(/^mailto:/i, ""),
|
|
500
|
+
href: t,
|
|
501
|
+
target: r
|
|
502
|
+
}]) : a += e, o += s[0].length;
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
if (s = ge.exec(e), s && (s[1] === "**" || !/\w/.test(i))) {
|
|
506
|
+
c(be(Y(s[2], t), { bold: !0 })), o += s[0].length;
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
509
|
+
if (s = _e.exec(e), s) {
|
|
510
|
+
c(be(Y(s[1], t), { strike: !0 })), o += s[0].length;
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
if (s = ve.exec(e), s && (s[1] === "*" || !/\w/.test(i) && !/\w/.test(n[o + s[0].length] ?? ""))) {
|
|
514
|
+
c(be(Y(s[2], t), { italic: !0 })), o += s[0].length;
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
a += n[o], o += 1;
|
|
518
|
+
let l = n.slice(o).search(ye);
|
|
519
|
+
l > 0 ? (a += n.slice(o, o + l), o += l) : l === -1 && (a += n.slice(o), o = n.length);
|
|
520
|
+
}
|
|
521
|
+
return s(), i;
|
|
522
|
+
}
|
|
523
|
+
var X = /^[ \t]*$/, Z = /^ {0,3}(`{3,}|~{3,})[ \t]*([^`\s]*)[ \t]*$/, xe = /^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/, Se = /^ {0,3}(?:(?:\*[ \t]*){3,}|(?:-[ \t]*){3,}|(?:_[ \t]*){3,})$/, Ce = /^ {0,3}>[ \t]?(.*)$/, we = /^( *)([-*+])[ \t]+(.*)$/, Te = /^( *)(\d{1,9})[.)][ \t]+(.*)$/, Ee = /^ {0,3}(=+|-+)[ \t]*$/, De = /^\[([ xX])\][ \t]+(.*)$/, Oe = /^ {0,3}\|?(?:[ \t]*:?-+:?[ \t]*\|)+[ \t]*:?-*:?[ \t]*\|?[ \t]*$/, ke = (e) => (/^[ \t]*/.exec(e)[0].match(/\t/g) || []).length * 3 + /^[ \t]*/.exec(e)[0].length;
|
|
524
|
+
function Ae(e) {
|
|
525
|
+
let t = we.exec(e);
|
|
526
|
+
if (t) return {
|
|
527
|
+
indent: t[1].length,
|
|
528
|
+
ordered: !1,
|
|
529
|
+
text: t[3]
|
|
530
|
+
};
|
|
531
|
+
let n = Te.exec(e);
|
|
532
|
+
return n ? {
|
|
533
|
+
indent: n[1].length,
|
|
534
|
+
ordered: !0,
|
|
535
|
+
start: Number(n[2]),
|
|
536
|
+
text: n[3]
|
|
537
|
+
} : null;
|
|
538
|
+
}
|
|
539
|
+
function je(e) {
|
|
540
|
+
let t = [], n = "";
|
|
541
|
+
for (let r = 0; r < e.length; r++) e[r] === "\\" && e[r + 1] === "|" ? (n += "|", r += 1) : e[r] === "|" ? (t.push(n), n = "") : n += e[r];
|
|
542
|
+
return t.push(n), t.length && X.test(t[0]) && t.shift(), t.length && X.test(t[t.length - 1]) && t.pop(), t.map((e) => e.trim());
|
|
543
|
+
}
|
|
544
|
+
var Me = (e) => {
|
|
545
|
+
let t = e.trim(), n = t.startsWith(":"), r = t.endsWith(":");
|
|
546
|
+
return n && r ? "center" : r ? "right" : n ? "left" : null;
|
|
547
|
+
};
|
|
548
|
+
function Ne(e) {
|
|
549
|
+
let t = e.filter((e) => !(e.text && !e.text.trim()));
|
|
550
|
+
if (t.length === 1 && t[0].image && !t[0].href) {
|
|
551
|
+
let { src: e, alt: n, title: r } = t[0].image;
|
|
552
|
+
return [{
|
|
553
|
+
type: "image",
|
|
554
|
+
src: e,
|
|
555
|
+
alt: n,
|
|
556
|
+
caption: r || "",
|
|
557
|
+
align: "left",
|
|
558
|
+
wrap: !1
|
|
559
|
+
}];
|
|
560
|
+
}
|
|
561
|
+
return e.length ? [{
|
|
562
|
+
type: "p",
|
|
563
|
+
parts: e
|
|
564
|
+
}] : [];
|
|
565
|
+
}
|
|
566
|
+
function Pe(e) {
|
|
567
|
+
let t = String(e ?? "").replace(/\r\n?/g, "\n").replace(/^/, "").split("\n"), n = null;
|
|
568
|
+
return t.map((e) => {
|
|
569
|
+
let t = Z.exec(e);
|
|
570
|
+
return n ? (t && t[1].startsWith(n[0]) && t[1].length >= n.length && (n = null), e) : t ? (n = t[1], e) : e.replace(/^[ \t]+/, (e) => e.replace(/\t/g, " "));
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
function Fe(e, t) {
|
|
574
|
+
let n = [], r = 0;
|
|
575
|
+
for (; r < e.length;) {
|
|
576
|
+
let i = e[r];
|
|
577
|
+
if (X.test(i)) {
|
|
578
|
+
r += 1;
|
|
579
|
+
continue;
|
|
580
|
+
}
|
|
581
|
+
let a = Z.exec(i);
|
|
582
|
+
if (a) {
|
|
583
|
+
let t = [], i = r + 1;
|
|
584
|
+
for (; i < e.length;) {
|
|
585
|
+
let n = Z.exec(e[i]);
|
|
586
|
+
if (n && n[1][0] === a[1][0] && n[1].length >= a[1].length && !n[2]) break;
|
|
587
|
+
t.push(e[i]), i += 1;
|
|
588
|
+
}
|
|
589
|
+
n.push({
|
|
590
|
+
type: "code",
|
|
591
|
+
lang: a[2] || "",
|
|
592
|
+
text: t.join("\n")
|
|
593
|
+
}), r = i + 1;
|
|
594
|
+
continue;
|
|
595
|
+
}
|
|
596
|
+
let o = xe.exec(i);
|
|
597
|
+
if (o) {
|
|
598
|
+
let e = (o[2] ?? "").replace(/[ \t]+#+[ \t]*$/, "");
|
|
599
|
+
n.push({
|
|
600
|
+
type: `h${o[1].length}`,
|
|
601
|
+
parts: Y(e, t)
|
|
602
|
+
}), r += 1;
|
|
603
|
+
continue;
|
|
604
|
+
}
|
|
605
|
+
if (Se.test(i)) {
|
|
606
|
+
n.push({ type: "divider" }), r += 1;
|
|
607
|
+
continue;
|
|
608
|
+
}
|
|
609
|
+
if (Ce.test(i)) {
|
|
610
|
+
let i = [];
|
|
611
|
+
for (; r < e.length;) {
|
|
612
|
+
let t = Ce.exec(e[r]);
|
|
613
|
+
if (t) i.push(t[1]);
|
|
614
|
+
else if (!X.test(e[r]) && i.length && !X.test(i[i.length - 1])) i.push(e[r]);
|
|
615
|
+
else break;
|
|
616
|
+
r += 1;
|
|
617
|
+
}
|
|
618
|
+
let a = Fe(i, t);
|
|
619
|
+
n.push(a.length === 1 && a[0].type === "p" ? {
|
|
620
|
+
type: "quote",
|
|
621
|
+
parts: a[0].parts
|
|
622
|
+
} : {
|
|
623
|
+
type: "quote",
|
|
624
|
+
blocks: a
|
|
625
|
+
});
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
if (Ae(i)) {
|
|
629
|
+
r = Ie(e, r, n, t);
|
|
630
|
+
continue;
|
|
631
|
+
}
|
|
632
|
+
if (i.includes("|") && r + 1 < e.length && Oe.test(e[r + 1])) {
|
|
633
|
+
let a = je(i), o = je(e[r + 1]).map(Me), s = [a.map((e) => Y(e, t))], c = r + 2;
|
|
634
|
+
for (; c < e.length && !X.test(e[c]) && e[c].includes("|");) {
|
|
635
|
+
let n = je(e[c]);
|
|
636
|
+
s.push(a.map((e, r) => Y(n[r] ?? "", t))), c += 1;
|
|
637
|
+
}
|
|
638
|
+
let l = {};
|
|
639
|
+
o.forEach((e, t) => {
|
|
640
|
+
e && s.forEach((n, r) => l[`${r}:${t}`] = { align: e });
|
|
641
|
+
}), n.push({
|
|
642
|
+
type: "table",
|
|
643
|
+
header: !0,
|
|
644
|
+
rows: s,
|
|
645
|
+
cellStyles: l
|
|
646
|
+
}), r = c;
|
|
647
|
+
continue;
|
|
648
|
+
}
|
|
649
|
+
let s = [i];
|
|
650
|
+
for (r += 1; r < e.length && !X.test(e[r]);) {
|
|
651
|
+
let i = e[r], a = Ee.exec(i);
|
|
652
|
+
if (a) {
|
|
653
|
+
n.push({
|
|
654
|
+
type: a[1][0] === "=" ? "h1" : "h2",
|
|
655
|
+
parts: Y(s.join("\n"), t)
|
|
656
|
+
}), r += 1, s.length = 0;
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
if (Z.test(i) || xe.test(i) || Se.test(i) || Ce.test(i) || Ae(i)) break;
|
|
660
|
+
s.push(i), r += 1;
|
|
661
|
+
}
|
|
662
|
+
s.length && n.push(...Ne(Y(s.join("\n"), t)));
|
|
663
|
+
}
|
|
664
|
+
return n;
|
|
665
|
+
}
|
|
666
|
+
function Ie(e, t, n, r) {
|
|
667
|
+
let i = Ae(e[t]), a = i.indent, o = [], s = null, c = t;
|
|
668
|
+
for (; c < e.length;) {
|
|
669
|
+
let t = e[c], n = Ae(t);
|
|
670
|
+
if (n && n.indent <= a + 1) {
|
|
671
|
+
if (n.ordered !== i.ordered) break;
|
|
672
|
+
s = { lines: [n.text] }, o.push(s), c += 1;
|
|
673
|
+
continue;
|
|
674
|
+
}
|
|
675
|
+
if (X.test(t)) {
|
|
676
|
+
let t = c;
|
|
677
|
+
for (; t < e.length && X.test(e[t]);) t += 1;
|
|
678
|
+
if (!(t < e.length && (ke(e[t]) >= a + 2 || Ae(e[t]) && Ae(e[t]).ordered === i.ordered))) break;
|
|
679
|
+
s?.lines.push(""), c = t;
|
|
680
|
+
continue;
|
|
681
|
+
}
|
|
682
|
+
if (!s) break;
|
|
683
|
+
if (ke(t) >= a + 2) s.lines.push(t.slice(Math.min(t.length - t.trimStart().length, a + 2)));
|
|
684
|
+
else if (!n) s.lines.push(t.trim());
|
|
685
|
+
else break;
|
|
686
|
+
c += 1;
|
|
687
|
+
}
|
|
688
|
+
return n.push({
|
|
689
|
+
type: i.ordered ? "ol" : "ul",
|
|
690
|
+
...i.ordered && i.start !== 1 ? { start: i.start } : null,
|
|
691
|
+
items: o.map((e) => {
|
|
692
|
+
let t = De.exec(e.lines[0] ?? "");
|
|
693
|
+
t && (e.lines[0] = t[2]);
|
|
694
|
+
let n = Fe(e.lines, r), i = n[0]?.type === "p" ? n.shift() : null;
|
|
695
|
+
return {
|
|
696
|
+
parts: i ? i.parts : [],
|
|
697
|
+
...n.length ? { blocks: n } : null,
|
|
698
|
+
...t ? { task: t[1].toLowerCase() === "x" } : null
|
|
699
|
+
};
|
|
700
|
+
})
|
|
701
|
+
}), c;
|
|
702
|
+
}
|
|
703
|
+
function Le(e, t = {}) {
|
|
704
|
+
return String(e ?? "").trim() ? Fe(Pe(e), t) : [];
|
|
705
|
+
}
|
|
706
|
+
//#endregion
|
|
707
|
+
//#region ../ui/src/components/builder/theme.js
|
|
708
|
+
var Re = {
|
|
442
709
|
light: {
|
|
443
710
|
background: "#f2f2f2",
|
|
444
711
|
surface: "#f2f2f2",
|
|
@@ -479,32 +746,32 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
479
746
|
contrastText: "#052e2b"
|
|
480
747
|
}
|
|
481
748
|
}
|
|
482
|
-
},
|
|
749
|
+
}, ze = {
|
|
483
750
|
h1: 40,
|
|
484
751
|
h2: 32,
|
|
485
752
|
h3: 26,
|
|
486
753
|
h4: 22,
|
|
487
754
|
h5: 19,
|
|
488
755
|
h6: 16
|
|
489
|
-
},
|
|
756
|
+
}, Be = {
|
|
490
757
|
font: "system",
|
|
491
758
|
headingFont: "inherit",
|
|
492
|
-
headings:
|
|
759
|
+
headings: ze,
|
|
493
760
|
bodySize: 16,
|
|
494
|
-
light:
|
|
495
|
-
dark:
|
|
496
|
-
},
|
|
761
|
+
light: Re.light,
|
|
762
|
+
dark: Re.dark
|
|
763
|
+
}, Ve = {
|
|
497
764
|
system: {
|
|
498
765
|
label: "System",
|
|
499
|
-
value:
|
|
766
|
+
value: J
|
|
500
767
|
},
|
|
501
768
|
inter: {
|
|
502
769
|
label: "Inter",
|
|
503
|
-
value: `"Inter", ${
|
|
770
|
+
value: `"Inter", ${J}`
|
|
504
771
|
},
|
|
505
772
|
outfit: {
|
|
506
773
|
label: "Outfit",
|
|
507
|
-
value: `"Outfit", ${
|
|
774
|
+
value: `"Outfit", ${J}`
|
|
508
775
|
},
|
|
509
776
|
serif: {
|
|
510
777
|
label: "Serif",
|
|
@@ -514,7 +781,7 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
514
781
|
label: "Mono",
|
|
515
782
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
516
783
|
}
|
|
517
|
-
},
|
|
784
|
+
}, He = (e, t) => Ve[e]?.value ?? k(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), Ue = (e, ...t) => {
|
|
518
785
|
let n = Object.assign({}, e, ...t);
|
|
519
786
|
return n.primary = {
|
|
520
787
|
...e.primary,
|
|
@@ -530,25 +797,25 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
530
797
|
}), {})
|
|
531
798
|
}, n;
|
|
532
799
|
};
|
|
533
|
-
function
|
|
800
|
+
function We(e) {
|
|
534
801
|
let { light: t, dark: n, font: r, headingFont: i, headings: a, bodySize: o, ...s } = e ?? {};
|
|
535
802
|
return {
|
|
536
|
-
font: r ??
|
|
537
|
-
headingFont: i ??
|
|
803
|
+
font: r ?? Be.font,
|
|
804
|
+
headingFont: i ?? Be.headingFont,
|
|
538
805
|
headings: {
|
|
539
|
-
...
|
|
806
|
+
...ze,
|
|
540
807
|
...a ?? {}
|
|
541
808
|
},
|
|
542
809
|
bodySize: o ?? 16,
|
|
543
|
-
light:
|
|
544
|
-
dark:
|
|
810
|
+
light: Ue(Re.light, s, t),
|
|
811
|
+
dark: Ue(Re.dark, n)
|
|
545
812
|
};
|
|
546
813
|
}
|
|
547
|
-
function
|
|
814
|
+
function Ge(e) {
|
|
548
815
|
return {
|
|
549
816
|
"--page-bg": e.background,
|
|
550
817
|
"--page-surface": e.surface ?? e.background,
|
|
551
|
-
"--page-border": e.border ??
|
|
818
|
+
"--page-border": e.border ?? Re.light.border,
|
|
552
819
|
"--page-text": e.text,
|
|
553
820
|
"--page-accent": e.accent,
|
|
554
821
|
"--page-accent-text": e.accentText,
|
|
@@ -562,71 +829,71 @@ function me(e) {
|
|
|
562
829
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
563
830
|
};
|
|
564
831
|
}
|
|
565
|
-
function
|
|
566
|
-
let t =
|
|
832
|
+
function Ke(e) {
|
|
833
|
+
let t = We(e);
|
|
567
834
|
return {
|
|
568
835
|
backgroundColor: "var(--page-bg)",
|
|
569
836
|
color: "var(--page-text)",
|
|
570
|
-
fontFamily:
|
|
571
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
572
|
-
...
|
|
573
|
-
"--page-body-size":
|
|
837
|
+
fontFamily: He(t.font, J),
|
|
838
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : He(t.headingFont, "inherit"),
|
|
839
|
+
...Je(t.headings),
|
|
840
|
+
"--page-body-size": qe(t.bodySize, 16)
|
|
574
841
|
};
|
|
575
842
|
}
|
|
576
|
-
function
|
|
843
|
+
function qe(e, t) {
|
|
577
844
|
return e === "" || e == null ? `${t}px` : isNaN(Number(e)) ? String(e) : `${Number(e)}px`;
|
|
578
845
|
}
|
|
579
|
-
function
|
|
846
|
+
function Je(e) {
|
|
580
847
|
let t = {};
|
|
581
|
-
for (let n of Object.keys(
|
|
582
|
-
let r = e?.[n] ??
|
|
583
|
-
t[`--page-${n}`] =
|
|
848
|
+
for (let n of Object.keys(ze)) {
|
|
849
|
+
let r = e?.[n] ?? ze[n];
|
|
850
|
+
t[`--page-${n}`] = qe(r, ze[n]);
|
|
584
851
|
}
|
|
585
852
|
return t;
|
|
586
853
|
}
|
|
587
|
-
function
|
|
588
|
-
let n =
|
|
854
|
+
function Ye(e, t = "light") {
|
|
855
|
+
let n = We(e);
|
|
589
856
|
return {
|
|
590
|
-
...
|
|
591
|
-
...
|
|
857
|
+
...Ke(e),
|
|
858
|
+
...Ge(n[t] ?? n.light)
|
|
592
859
|
};
|
|
593
860
|
}
|
|
594
|
-
function
|
|
861
|
+
function Xe(e, t) {
|
|
595
862
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
596
863
|
}
|
|
597
|
-
function
|
|
864
|
+
function Ze(e, t) {
|
|
598
865
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
599
866
|
}
|
|
600
867
|
//#endregion
|
|
601
868
|
//#region ../ui/src/components/builder/views.jsx
|
|
602
|
-
var
|
|
869
|
+
var Q = n({
|
|
603
870
|
tenant: "",
|
|
604
871
|
apiUrl: "/api",
|
|
605
872
|
locale: "",
|
|
606
873
|
settings: null
|
|
607
|
-
}),
|
|
874
|
+
}), Qe = n(null), $e = (e) => {
|
|
608
875
|
let t = Number(e?.__page);
|
|
609
876
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
610
877
|
if (typeof window > "u") return 1;
|
|
611
878
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
612
879
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
613
|
-
},
|
|
880
|
+
}, et = () => {
|
|
614
881
|
if (typeof window > "u") return {};
|
|
615
882
|
let e = {};
|
|
616
883
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
617
884
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
618
885
|
}), e;
|
|
619
|
-
},
|
|
886
|
+
}, tt = (e) => {
|
|
620
887
|
let t = {
|
|
621
888
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
622
|
-
...
|
|
889
|
+
...et()
|
|
623
890
|
};
|
|
624
891
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
625
|
-
},
|
|
626
|
-
function
|
|
892
|
+
}, nt = n(null), rt = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
893
|
+
function it(e, t) {
|
|
627
894
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
628
895
|
}
|
|
629
|
-
var
|
|
896
|
+
var at = (e) => {
|
|
630
897
|
let t = [];
|
|
631
898
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
632
899
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -636,39 +903,39 @@ var Te = (e) => {
|
|
|
636
903
|
}
|
|
637
904
|
return t;
|
|
638
905
|
};
|
|
639
|
-
function
|
|
906
|
+
function ot(e) {
|
|
640
907
|
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(" ") : "";
|
|
641
908
|
}
|
|
642
|
-
function
|
|
643
|
-
let n = t?.data ?? {}, r =
|
|
909
|
+
function st(e, t) {
|
|
910
|
+
let n = t?.data ?? {}, r = at(n);
|
|
644
911
|
if (!r.length) return e;
|
|
645
|
-
let i = RegExp(`:(${r.map(
|
|
912
|
+
let i = RegExp(`:(${r.map(rt).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => ot(it(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
646
913
|
return a(e);
|
|
647
914
|
}
|
|
648
|
-
var
|
|
915
|
+
var ct = {
|
|
649
916
|
margin: 0,
|
|
650
917
|
fontWeight: 700,
|
|
651
918
|
lineHeight: 1.2,
|
|
652
919
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
653
|
-
},
|
|
920
|
+
}, lt = ze, ut = (e) => `var(--page-${e}, ${ze[e] ?? ze.h2}px)`, dt = {
|
|
654
921
|
margin: 0,
|
|
655
922
|
fontSize: "var(--page-body-size, 16px)"
|
|
656
|
-
},
|
|
923
|
+
}, ft = {
|
|
657
924
|
display: "inline-block",
|
|
658
925
|
textDecoration: "none",
|
|
659
926
|
cursor: "pointer",
|
|
660
927
|
backgroundColor: "var(--page-accent, #111827)",
|
|
661
928
|
color: "var(--page-accent-text, #ffffff)"
|
|
662
|
-
},
|
|
929
|
+
}, pt = {
|
|
663
930
|
flexGrow: 1,
|
|
664
931
|
display: "flex",
|
|
665
932
|
flexDirection: "column",
|
|
666
933
|
position: "relative"
|
|
667
|
-
},
|
|
934
|
+
}, mt = {
|
|
668
935
|
display: "flex",
|
|
669
936
|
flexDirection: "column"
|
|
670
937
|
};
|
|
671
|
-
function
|
|
938
|
+
function ht({ style: e }) {
|
|
672
939
|
let t = e?.backgroundVideo;
|
|
673
940
|
if (!t) return null;
|
|
674
941
|
let n = {
|
|
@@ -694,7 +961,7 @@ function Fe({ style: e }) {
|
|
|
694
961
|
background: r
|
|
695
962
|
} })] });
|
|
696
963
|
}
|
|
697
|
-
var
|
|
964
|
+
var gt = (e, t) => e?.backgroundVideo ? {
|
|
698
965
|
position: "relative",
|
|
699
966
|
...t,
|
|
700
967
|
...P(e)
|
|
@@ -702,24 +969,24 @@ var Ie = (e, t) => e?.backgroundVideo ? {
|
|
|
702
969
|
...t,
|
|
703
970
|
...P(e)
|
|
704
971
|
};
|
|
705
|
-
function
|
|
972
|
+
function _t({ style: e, nodeRef: t, children: n }) {
|
|
706
973
|
return /* @__PURE__ */ f("div", {
|
|
707
974
|
ref: t,
|
|
708
975
|
style: {
|
|
709
|
-
...
|
|
976
|
+
...pt,
|
|
710
977
|
...P(e)
|
|
711
978
|
},
|
|
712
|
-
children: [/* @__PURE__ */ d(
|
|
979
|
+
children: [/* @__PURE__ */ d(ht, { style: e }), n]
|
|
713
980
|
});
|
|
714
981
|
}
|
|
715
|
-
function
|
|
982
|
+
function vt({ style: e, nodeRef: t, children: n }) {
|
|
716
983
|
return /* @__PURE__ */ f("section", {
|
|
717
984
|
ref: t,
|
|
718
|
-
style:
|
|
719
|
-
children: [/* @__PURE__ */ d(
|
|
985
|
+
style: gt(e, mt),
|
|
986
|
+
children: [/* @__PURE__ */ d(ht, { style: e }), n]
|
|
720
987
|
});
|
|
721
988
|
}
|
|
722
|
-
function
|
|
989
|
+
function yt({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
723
990
|
let i = t ? {
|
|
724
991
|
position: "relative",
|
|
725
992
|
minHeight: 240
|
|
@@ -728,33 +995,43 @@ function ze({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
728
995
|
ref: n,
|
|
729
996
|
style: i ? {
|
|
730
997
|
...i,
|
|
731
|
-
...
|
|
732
|
-
} :
|
|
733
|
-
children: [/* @__PURE__ */ d(
|
|
998
|
+
...gt(e)
|
|
999
|
+
} : gt(e),
|
|
1000
|
+
children: [/* @__PURE__ */ d(ht, { style: e }), r]
|
|
734
1001
|
});
|
|
735
1002
|
}
|
|
736
|
-
function
|
|
1003
|
+
function bt({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
737
1004
|
return /* @__PURE__ */ d(n, {
|
|
738
1005
|
ref: a,
|
|
739
1006
|
style: {
|
|
740
|
-
...
|
|
741
|
-
fontSize:
|
|
1007
|
+
...ct,
|
|
1008
|
+
fontSize: ut(n),
|
|
742
1009
|
...P(r)
|
|
743
1010
|
},
|
|
744
|
-
children:
|
|
1011
|
+
children: wt(t, e, i)
|
|
745
1012
|
});
|
|
746
1013
|
}
|
|
747
|
-
var
|
|
748
|
-
fontFamily:
|
|
1014
|
+
var xt = {
|
|
1015
|
+
fontFamily: Ve.mono.value,
|
|
749
1016
|
background: "rgba(148, 163, 184, 0.18)",
|
|
750
1017
|
padding: "1px 5px",
|
|
751
1018
|
borderRadius: 4,
|
|
752
1019
|
fontSize: "0.9em"
|
|
1020
|
+
}, St = {
|
|
1021
|
+
fontFamily: Ve.mono.value,
|
|
1022
|
+
background: "rgba(148, 163, 184, 0.16)",
|
|
1023
|
+
border: "1px solid rgba(148, 163, 184, 0.3)",
|
|
1024
|
+
borderRadius: 6,
|
|
1025
|
+
padding: "12px 14px",
|
|
1026
|
+
fontSize: "0.875em",
|
|
1027
|
+
lineHeight: 1.55,
|
|
1028
|
+
overflowX: "auto",
|
|
1029
|
+
whiteSpace: "pre"
|
|
753
1030
|
};
|
|
754
|
-
function
|
|
1031
|
+
function Ct(e, t = [], n, r) {
|
|
755
1032
|
let i = e;
|
|
756
1033
|
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", {
|
|
757
|
-
style:
|
|
1034
|
+
style: xt,
|
|
758
1035
|
children: i
|
|
759
1036
|
})), 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", {
|
|
760
1037
|
href: n,
|
|
@@ -770,13 +1047,22 @@ function He(e, t = [], n, r) {
|
|
|
770
1047
|
children: i
|
|
771
1048
|
})), i;
|
|
772
1049
|
}
|
|
773
|
-
function
|
|
1050
|
+
function wt(e, n, r) {
|
|
774
1051
|
return e?.length ? e.map((e, n) => {
|
|
775
1052
|
if (e.slot) return /* @__PURE__ */ d(t, { children: r?.[e.slot] ?? null }, n);
|
|
776
|
-
if (e.parts) return /* @__PURE__ */ d(t, { children:
|
|
1053
|
+
if (e.parts) return /* @__PURE__ */ d(t, { children: wt(e.parts, "", r) }, n);
|
|
1054
|
+
if (e.br) return /* @__PURE__ */ d("br", {}, n);
|
|
777
1055
|
let i = e.text;
|
|
778
|
-
return e.
|
|
779
|
-
|
|
1056
|
+
return e.image && (i = /* @__PURE__ */ d("img", {
|
|
1057
|
+
src: e.image.src,
|
|
1058
|
+
alt: e.image.alt || "",
|
|
1059
|
+
title: e.image.title || void 0,
|
|
1060
|
+
style: {
|
|
1061
|
+
maxWidth: "100%",
|
|
1062
|
+
verticalAlign: "middle"
|
|
1063
|
+
}
|
|
1064
|
+
})), e.sup ? i = /* @__PURE__ */ d("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ d("sub", { children: i })), e.code && (i = /* @__PURE__ */ d("code", {
|
|
1065
|
+
style: xt,
|
|
780
1066
|
children: i
|
|
781
1067
|
})), 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", {
|
|
782
1068
|
style: {
|
|
@@ -799,35 +1085,35 @@ function Ue(e, n, r) {
|
|
|
799
1085
|
})), /* @__PURE__ */ d(t, { children: i }, n);
|
|
800
1086
|
}) : n;
|
|
801
1087
|
}
|
|
802
|
-
function
|
|
1088
|
+
function Tt({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
803
1089
|
return /* @__PURE__ */ d("span", {
|
|
804
1090
|
style: P(a),
|
|
805
|
-
children: e?.length ?
|
|
1091
|
+
children: e?.length ? wt(e, t) : Ct(t, n, r, i)
|
|
806
1092
|
});
|
|
807
1093
|
}
|
|
808
|
-
var
|
|
1094
|
+
var Et = [
|
|
809
1095
|
"left",
|
|
810
1096
|
"center",
|
|
811
1097
|
"right",
|
|
812
1098
|
"justify"
|
|
813
1099
|
];
|
|
814
|
-
function
|
|
1100
|
+
function Dt(e, t, n) {
|
|
815
1101
|
let r = e && e.cellStyles;
|
|
816
1102
|
if (!r || typeof r != "object" || Array.isArray(r)) return {};
|
|
817
1103
|
let i = r[`${t}:${n}`];
|
|
818
1104
|
return i && typeof i == "object" && !Array.isArray(i) ? i : {};
|
|
819
1105
|
}
|
|
820
|
-
function
|
|
1106
|
+
function Ot(e, t) {
|
|
821
1107
|
let n = e || {}, r = typeof n.bold == "boolean" ? n.bold : !!t;
|
|
822
1108
|
return {
|
|
823
|
-
textAlign:
|
|
1109
|
+
textAlign: Et.includes(n.align) ? n.align : "left",
|
|
824
1110
|
fontWeight: r ? 700 : 400,
|
|
825
1111
|
fontStyle: n.italic ? "italic" : void 0,
|
|
826
1112
|
color: typeof n.color == "string" && n.color ? n.color : void 0,
|
|
827
1113
|
backgroundColor: typeof n.bg == "string" && n.bg ? n.bg : void 0
|
|
828
1114
|
};
|
|
829
1115
|
}
|
|
830
|
-
function
|
|
1116
|
+
function kt({ align: e = "center", width: t, wrap: n } = {}) {
|
|
831
1117
|
let r = t ? `${t}%` : void 0;
|
|
832
1118
|
if (e === "full") return { width: "100%" };
|
|
833
1119
|
let i = e === "left" || e === "right";
|
|
@@ -861,18 +1147,18 @@ function Je({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
861
1147
|
marginRight: "auto"
|
|
862
1148
|
};
|
|
863
1149
|
}
|
|
864
|
-
function
|
|
865
|
-
let r = n ?? ((e, n) =>
|
|
866
|
-
return e.map((
|
|
867
|
-
let
|
|
1150
|
+
function At(e = [], t, n) {
|
|
1151
|
+
let r = n ?? ((e, n) => wt(e, n, t));
|
|
1152
|
+
return e.map((n, i) => {
|
|
1153
|
+
let a = {
|
|
868
1154
|
marginTop: 0,
|
|
869
|
-
marginBottom:
|
|
1155
|
+
marginBottom: i === e.length - 1 ? 0 : 14
|
|
870
1156
|
};
|
|
871
|
-
if (
|
|
872
|
-
if (!
|
|
1157
|
+
if (n.type === "image") {
|
|
1158
|
+
if (!n.src) return null;
|
|
873
1159
|
let e = /* @__PURE__ */ d("img", {
|
|
874
|
-
src:
|
|
875
|
-
alt:
|
|
1160
|
+
src: n.src,
|
|
1161
|
+
alt: n.alt || "",
|
|
876
1162
|
style: {
|
|
877
1163
|
width: "100%",
|
|
878
1164
|
display: "block",
|
|
@@ -883,51 +1169,51 @@ function Ye(e = [], t, n) {
|
|
|
883
1169
|
style: {
|
|
884
1170
|
marginLeft: 0,
|
|
885
1171
|
marginRight: 0,
|
|
886
|
-
...
|
|
887
|
-
...
|
|
1172
|
+
...a,
|
|
1173
|
+
...kt(n)
|
|
888
1174
|
},
|
|
889
|
-
children: [
|
|
890
|
-
href:
|
|
891
|
-
target:
|
|
892
|
-
rel:
|
|
1175
|
+
children: [n.href ? /* @__PURE__ */ d("a", {
|
|
1176
|
+
href: n.href,
|
|
1177
|
+
target: n.target || void 0,
|
|
1178
|
+
rel: n.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
893
1179
|
style: { display: "block" },
|
|
894
1180
|
children: e
|
|
895
|
-
}) : e,
|
|
1181
|
+
}) : e, n.caption && /* @__PURE__ */ d("figcaption", {
|
|
896
1182
|
style: {
|
|
897
1183
|
fontSize: 13,
|
|
898
1184
|
opacity: .65,
|
|
899
1185
|
marginTop: 6,
|
|
900
1186
|
textAlign: "center"
|
|
901
1187
|
},
|
|
902
|
-
children:
|
|
1188
|
+
children: n.caption
|
|
903
1189
|
})]
|
|
904
|
-
},
|
|
1190
|
+
}, i);
|
|
905
1191
|
}
|
|
906
|
-
if (
|
|
1192
|
+
if (n.type === "video") return Ht(n.url) ? /* @__PURE__ */ d("div", {
|
|
907
1193
|
style: {
|
|
908
|
-
...
|
|
909
|
-
...
|
|
910
|
-
align:
|
|
911
|
-
wrap:
|
|
912
|
-
width:
|
|
1194
|
+
...a,
|
|
1195
|
+
...kt({
|
|
1196
|
+
align: n.align,
|
|
1197
|
+
wrap: n.wrap,
|
|
1198
|
+
width: n.width ?? 100
|
|
913
1199
|
})
|
|
914
1200
|
},
|
|
915
|
-
children: /* @__PURE__ */ d(
|
|
916
|
-
url:
|
|
917
|
-
autoplay:
|
|
918
|
-
muted:
|
|
919
|
-
loop:
|
|
920
|
-
controls:
|
|
921
|
-
start:
|
|
1201
|
+
children: /* @__PURE__ */ d(Ut, {
|
|
1202
|
+
url: n.url,
|
|
1203
|
+
autoplay: n.autoplay,
|
|
1204
|
+
muted: n.muted,
|
|
1205
|
+
loop: n.loop,
|
|
1206
|
+
controls: n.controls ?? !0,
|
|
1207
|
+
start: n.start
|
|
922
1208
|
})
|
|
923
|
-
},
|
|
924
|
-
if (
|
|
925
|
-
if (!(typeof
|
|
926
|
-
let e = Number.isFinite(Number(
|
|
1209
|
+
}, i) : null;
|
|
1210
|
+
if (n.type === "button") {
|
|
1211
|
+
if (!(typeof n.label == "string" && n.label.trim())) return null;
|
|
1212
|
+
let e = Number.isFinite(Number(n.radius)) ? Number(n.radius) : 8, t = ["center", "right"].includes(n.align) ? n.align : "left";
|
|
927
1213
|
return /* @__PURE__ */ d("div", {
|
|
928
1214
|
style: {
|
|
929
|
-
...
|
|
930
|
-
textAlign:
|
|
1215
|
+
...a,
|
|
1216
|
+
textAlign: t
|
|
931
1217
|
},
|
|
932
1218
|
children: /* @__PURE__ */ d("table", {
|
|
933
1219
|
role: "presentation",
|
|
@@ -939,132 +1225,171 @@ function Ye(e = [], t, n) {
|
|
|
939
1225
|
},
|
|
940
1226
|
children: /* @__PURE__ */ d("tbody", { children: /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
941
1227
|
style: {
|
|
942
|
-
backgroundColor:
|
|
1228
|
+
backgroundColor: n.bg || "var(--page-accent, #4f46e5)",
|
|
943
1229
|
borderRadius: e
|
|
944
1230
|
},
|
|
945
1231
|
children: /* @__PURE__ */ d("a", {
|
|
946
|
-
href:
|
|
947
|
-
target:
|
|
948
|
-
rel:
|
|
1232
|
+
href: n.href || "#",
|
|
1233
|
+
target: n.target || void 0,
|
|
1234
|
+
rel: n.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
949
1235
|
style: {
|
|
950
1236
|
display: "inline-block",
|
|
951
1237
|
padding: "13px 24px",
|
|
952
|
-
color:
|
|
1238
|
+
color: n.color || "#ffffff",
|
|
953
1239
|
fontSize: 15,
|
|
954
1240
|
fontWeight: 600,
|
|
955
1241
|
lineHeight: 1.2,
|
|
956
1242
|
textDecoration: "none",
|
|
957
1243
|
borderRadius: e
|
|
958
1244
|
},
|
|
959
|
-
children:
|
|
1245
|
+
children: n.label
|
|
960
1246
|
})
|
|
961
1247
|
}) }) })
|
|
962
1248
|
})
|
|
963
|
-
},
|
|
1249
|
+
}, i);
|
|
964
1250
|
}
|
|
965
|
-
if (
|
|
966
|
-
...
|
|
1251
|
+
if (n.type === "divider") return /* @__PURE__ */ d("hr", { style: {
|
|
1252
|
+
...a,
|
|
967
1253
|
border: 0,
|
|
968
1254
|
borderTop: "1px solid rgba(148, 163, 184, 0.4)"
|
|
969
|
-
} },
|
|
970
|
-
if (
|
|
971
|
-
let e = Array.isArray(
|
|
1255
|
+
} }, i);
|
|
1256
|
+
if (n.type === "table") {
|
|
1257
|
+
let e = Array.isArray(n.rows) ? n.rows.filter(Array.isArray) : [];
|
|
972
1258
|
if (!e.length) return null;
|
|
973
|
-
let
|
|
974
|
-
border:
|
|
1259
|
+
let t = n.header !== !1, o = {
|
|
1260
|
+
border: n.borders === !1 ? void 0 : "1px solid rgba(148, 163, 184, 0.4)",
|
|
975
1261
|
padding: "6px 10px",
|
|
976
1262
|
verticalAlign: "top"
|
|
977
|
-
},
|
|
978
|
-
...
|
|
979
|
-
...
|
|
1263
|
+
}, s = t ? e.slice(1) : e, c = Array.isArray(n.widths) ? n.widths : null, l = (e, t, r) => ({
|
|
1264
|
+
...o,
|
|
1265
|
+
...Ot(Dt(n, e, t), r)
|
|
980
1266
|
});
|
|
981
1267
|
return /* @__PURE__ */ f("table", {
|
|
982
1268
|
style: {
|
|
983
|
-
...
|
|
1269
|
+
...a,
|
|
984
1270
|
borderCollapse: "collapse",
|
|
985
1271
|
width: "100%",
|
|
986
1272
|
fontSize: "inherit",
|
|
987
|
-
tableLayout:
|
|
1273
|
+
tableLayout: c ? "fixed" : void 0
|
|
988
1274
|
},
|
|
989
1275
|
children: [
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
style:
|
|
993
|
-
children: e
|
|
1276
|
+
c && /* @__PURE__ */ d("colgroup", { children: c.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
|
|
1277
|
+
t && /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e[0].map((e, t) => /* @__PURE__ */ d("th", {
|
|
1278
|
+
style: l(0, t, !0),
|
|
1279
|
+
children: Array.isArray(e) ? r(e) : e
|
|
994
1280
|
}, t)) }) }),
|
|
995
|
-
/* @__PURE__ */ d("tbody", { children:
|
|
996
|
-
style:
|
|
997
|
-
children: e
|
|
998
|
-
},
|
|
1281
|
+
/* @__PURE__ */ d("tbody", { children: s.map((e, n) => /* @__PURE__ */ d("tr", { children: e.map((e, i) => /* @__PURE__ */ d("td", {
|
|
1282
|
+
style: l(t ? n + 1 : n, i, !1),
|
|
1283
|
+
children: Array.isArray(e) ? r(e) : e
|
|
1284
|
+
}, i)) }, n)) })
|
|
999
1285
|
]
|
|
1000
|
-
},
|
|
1286
|
+
}, i);
|
|
1001
1287
|
}
|
|
1002
|
-
if (
|
|
1003
|
-
let e =
|
|
1288
|
+
if (n.type === "ul" || n.type === "ol") {
|
|
1289
|
+
let e = n.type;
|
|
1004
1290
|
return /* @__PURE__ */ d(e, {
|
|
1005
1291
|
style: {
|
|
1006
|
-
...
|
|
1292
|
+
...a,
|
|
1007
1293
|
paddingLeft: 24
|
|
1008
1294
|
},
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1295
|
+
start: n.type === "ol" ? n.start : void 0,
|
|
1296
|
+
children: (n.items ?? []).map((e, n) => {
|
|
1297
|
+
let i = typeof e.task == "boolean";
|
|
1298
|
+
return /* @__PURE__ */ f("li", {
|
|
1299
|
+
style: {
|
|
1300
|
+
marginBottom: 4,
|
|
1301
|
+
...i && {
|
|
1302
|
+
listStyleType: "none",
|
|
1303
|
+
marginLeft: -18
|
|
1304
|
+
}
|
|
1305
|
+
},
|
|
1306
|
+
children: [
|
|
1307
|
+
i && /* @__PURE__ */ d("span", {
|
|
1308
|
+
style: { marginRight: 6 },
|
|
1309
|
+
children: e.task ? "☑" : "☐"
|
|
1310
|
+
}),
|
|
1311
|
+
r(e.parts, e.text),
|
|
1312
|
+
e.blocks?.length ? At(e.blocks, t, r) : null
|
|
1313
|
+
]
|
|
1314
|
+
}, n);
|
|
1315
|
+
})
|
|
1316
|
+
}, i);
|
|
1014
1317
|
}
|
|
1015
|
-
if (
|
|
1318
|
+
if (n.type === "quote") return /* @__PURE__ */ d("blockquote", {
|
|
1016
1319
|
style: {
|
|
1017
|
-
...
|
|
1018
|
-
...
|
|
1320
|
+
...Nt,
|
|
1321
|
+
...a
|
|
1019
1322
|
},
|
|
1020
|
-
children: r(
|
|
1021
|
-
},
|
|
1022
|
-
if (
|
|
1023
|
-
|
|
1323
|
+
children: n.blocks?.length ? At(n.blocks, t, r) : r(n.parts, n.text)
|
|
1324
|
+
}, i);
|
|
1325
|
+
if (n.type === "code") return /* @__PURE__ */ d("pre", {
|
|
1326
|
+
"data-lang": n.lang || void 0,
|
|
1327
|
+
style: {
|
|
1328
|
+
...a,
|
|
1329
|
+
...St
|
|
1330
|
+
},
|
|
1331
|
+
children: /* @__PURE__ */ d("code", {
|
|
1332
|
+
style: { fontFamily: "inherit" },
|
|
1333
|
+
children: n.text
|
|
1334
|
+
})
|
|
1335
|
+
}, i);
|
|
1336
|
+
if (lt[n.type]) {
|
|
1337
|
+
let e = n.type;
|
|
1024
1338
|
return /* @__PURE__ */ d(e, {
|
|
1025
1339
|
style: {
|
|
1026
|
-
...
|
|
1027
|
-
fontSize:
|
|
1028
|
-
...
|
|
1340
|
+
...ct,
|
|
1341
|
+
fontSize: ut(n.type),
|
|
1342
|
+
...a
|
|
1029
1343
|
},
|
|
1030
|
-
children: r(
|
|
1031
|
-
},
|
|
1344
|
+
children: r(n.parts, n.text)
|
|
1345
|
+
}, i);
|
|
1032
1346
|
}
|
|
1033
1347
|
return /* @__PURE__ */ d("p", {
|
|
1034
1348
|
style: {
|
|
1035
|
-
...
|
|
1036
|
-
...
|
|
1349
|
+
...dt,
|
|
1350
|
+
...a
|
|
1037
1351
|
},
|
|
1038
|
-
children: r(
|
|
1039
|
-
},
|
|
1352
|
+
children: r(n.parts, n.text)
|
|
1353
|
+
}, i);
|
|
1040
1354
|
});
|
|
1041
1355
|
}
|
|
1042
|
-
function
|
|
1356
|
+
function jt({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
1043
1357
|
return /* @__PURE__ */ d("div", {
|
|
1044
1358
|
ref: r,
|
|
1045
1359
|
style: {
|
|
1046
1360
|
display: "flow-root",
|
|
1047
1361
|
...P(t)
|
|
1048
1362
|
},
|
|
1049
|
-
children:
|
|
1363
|
+
children: At(e, n)
|
|
1050
1364
|
});
|
|
1051
1365
|
}
|
|
1052
|
-
|
|
1366
|
+
function Mt({ markdown: e, newTab: t, style: n, nodeRef: r }) {
|
|
1367
|
+
let i = s(() => Le(e, { newTab: t }), [e, t]);
|
|
1368
|
+
return /* @__PURE__ */ d("div", {
|
|
1369
|
+
ref: r,
|
|
1370
|
+
style: {
|
|
1371
|
+
display: "flow-root",
|
|
1372
|
+
...P(n)
|
|
1373
|
+
},
|
|
1374
|
+
children: At(i)
|
|
1375
|
+
});
|
|
1376
|
+
}
|
|
1377
|
+
var Nt = {
|
|
1053
1378
|
margin: 0,
|
|
1054
1379
|
padding: "8px 0 8px 20px",
|
|
1055
1380
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
1056
1381
|
};
|
|
1057
|
-
function
|
|
1382
|
+
function Pt({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1058
1383
|
return /* @__PURE__ */ d("blockquote", {
|
|
1059
1384
|
ref: i,
|
|
1060
1385
|
style: {
|
|
1061
|
-
...
|
|
1386
|
+
...Nt,
|
|
1062
1387
|
...P(n)
|
|
1063
1388
|
},
|
|
1064
|
-
children:
|
|
1389
|
+
children: wt(t, e, r)
|
|
1065
1390
|
});
|
|
1066
1391
|
}
|
|
1067
|
-
function
|
|
1392
|
+
function Ft({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
1068
1393
|
return /* @__PURE__ */ d(e ? "ol" : "ul", {
|
|
1069
1394
|
ref: r,
|
|
1070
1395
|
style: {
|
|
@@ -1074,53 +1399,53 @@ function $e({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
1074
1399
|
},
|
|
1075
1400
|
children: t.map((e, t) => /* @__PURE__ */ d("li", {
|
|
1076
1401
|
style: { marginBottom: 4 },
|
|
1077
|
-
children:
|
|
1402
|
+
children: wt(e.parts, e.text)
|
|
1078
1403
|
}, t))
|
|
1079
1404
|
});
|
|
1080
1405
|
}
|
|
1081
|
-
function
|
|
1406
|
+
function It({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1082
1407
|
return /* @__PURE__ */ d("p", {
|
|
1083
1408
|
ref: i,
|
|
1084
1409
|
style: {
|
|
1085
|
-
...
|
|
1410
|
+
...dt,
|
|
1086
1411
|
...P(n)
|
|
1087
1412
|
},
|
|
1088
|
-
children:
|
|
1413
|
+
children: wt(t, e, r)
|
|
1089
1414
|
});
|
|
1090
1415
|
}
|
|
1091
|
-
var
|
|
1416
|
+
var Lt = {
|
|
1092
1417
|
color: "var(--page-accent, inherit)",
|
|
1093
1418
|
textDecoration: "underline",
|
|
1094
1419
|
textUnderlineOffset: 3,
|
|
1095
1420
|
cursor: "pointer"
|
|
1096
1421
|
};
|
|
1097
|
-
function
|
|
1422
|
+
function Rt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1098
1423
|
return /* @__PURE__ */ d("a", {
|
|
1099
1424
|
ref: o,
|
|
1100
1425
|
href: n || "#",
|
|
1101
1426
|
target: r || void 0,
|
|
1102
1427
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1103
1428
|
style: {
|
|
1104
|
-
...
|
|
1429
|
+
...Lt,
|
|
1105
1430
|
...P(i)
|
|
1106
1431
|
},
|
|
1107
|
-
children:
|
|
1432
|
+
children: wt(t, e, a)
|
|
1108
1433
|
});
|
|
1109
1434
|
}
|
|
1110
|
-
function
|
|
1435
|
+
function zt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1111
1436
|
return /* @__PURE__ */ d("a", {
|
|
1112
1437
|
ref: o,
|
|
1113
1438
|
href: n || "#",
|
|
1114
1439
|
target: r || void 0,
|
|
1115
1440
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1116
1441
|
style: {
|
|
1117
|
-
...
|
|
1442
|
+
...ft,
|
|
1118
1443
|
...P(i)
|
|
1119
1444
|
},
|
|
1120
|
-
children:
|
|
1445
|
+
children: wt(t, e, a)
|
|
1121
1446
|
});
|
|
1122
1447
|
}
|
|
1123
|
-
function
|
|
1448
|
+
function Bt({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
1124
1449
|
return e ? /* @__PURE__ */ d("img", {
|
|
1125
1450
|
ref: r,
|
|
1126
1451
|
src: e,
|
|
@@ -1132,7 +1457,7 @@ function it({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
1132
1457
|
}
|
|
1133
1458
|
}) : null;
|
|
1134
1459
|
}
|
|
1135
|
-
function
|
|
1460
|
+
function Vt({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
1136
1461
|
return e ? /* @__PURE__ */ d("video", {
|
|
1137
1462
|
ref: s,
|
|
1138
1463
|
src: e,
|
|
@@ -1150,9 +1475,9 @@ function at({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
1150
1475
|
}
|
|
1151
1476
|
}) : null;
|
|
1152
1477
|
}
|
|
1153
|
-
var
|
|
1154
|
-
function
|
|
1155
|
-
let c =
|
|
1478
|
+
var Ht = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
1479
|
+
function Ut({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
1480
|
+
let c = Ht(e);
|
|
1156
1481
|
if (!c) return null;
|
|
1157
1482
|
let l = new URLSearchParams({ rel: "0" });
|
|
1158
1483
|
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", {
|
|
@@ -1178,7 +1503,7 @@ function st({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
1178
1503
|
})
|
|
1179
1504
|
});
|
|
1180
1505
|
}
|
|
1181
|
-
function
|
|
1506
|
+
function Wt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
1182
1507
|
return e ? /* @__PURE__ */ d("iframe", {
|
|
1183
1508
|
ref: i,
|
|
1184
1509
|
src: e,
|
|
@@ -1194,15 +1519,15 @@ function ct({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
1194
1519
|
}
|
|
1195
1520
|
}) : null;
|
|
1196
1521
|
}
|
|
1197
|
-
var
|
|
1198
|
-
function
|
|
1199
|
-
return `@scope ([data-wb-embed]) {\n${e.replace(
|
|
1522
|
+
var Gt = /(^|[\s,>+~{}])(:root|html|body)(?=$|[\s,{.:#[>+~])/g;
|
|
1523
|
+
function Kt(e) {
|
|
1524
|
+
return `@scope ([data-wb-embed]) {\n${e.replace(Gt, "$1:scope")}\n}`;
|
|
1200
1525
|
}
|
|
1201
|
-
function
|
|
1526
|
+
function qt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRef: i }) {
|
|
1202
1527
|
let [o, s] = l(null);
|
|
1203
1528
|
return a(() => {
|
|
1204
1529
|
o && (o.innerHTML = e || "", n ? (o.setAttribute("data-wb-embed", ""), o.querySelectorAll("style").forEach((e) => {
|
|
1205
|
-
e.textContent =
|
|
1530
|
+
e.textContent = Kt(e.textContent || "");
|
|
1206
1531
|
})) : o.removeAttribute("data-wb-embed"), t && o.querySelectorAll("script").forEach((e) => {
|
|
1207
1532
|
let t = document.createElement("script");
|
|
1208
1533
|
for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
|
|
@@ -1220,7 +1545,7 @@ function dt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRe
|
|
|
1220
1545
|
style: P(r)
|
|
1221
1546
|
});
|
|
1222
1547
|
}
|
|
1223
|
-
function
|
|
1548
|
+
function Jt({ height: e, style: t, nodeRef: n }) {
|
|
1224
1549
|
return /* @__PURE__ */ d("div", {
|
|
1225
1550
|
ref: n,
|
|
1226
1551
|
style: {
|
|
@@ -1231,7 +1556,7 @@ function ft({ height: e, style: t, nodeRef: n }) {
|
|
|
1231
1556
|
}
|
|
1232
1557
|
});
|
|
1233
1558
|
}
|
|
1234
|
-
function
|
|
1559
|
+
function Yt({ style: e, nodeRef: t }) {
|
|
1235
1560
|
return /* @__PURE__ */ d("div", {
|
|
1236
1561
|
ref: t,
|
|
1237
1562
|
style: {
|
|
@@ -1242,7 +1567,7 @@ function pt({ style: e, nodeRef: t }) {
|
|
|
1242
1567
|
}
|
|
1243
1568
|
});
|
|
1244
1569
|
}
|
|
1245
|
-
function
|
|
1570
|
+
function Xt({ style: e, nodeRef: t }) {
|
|
1246
1571
|
return /* @__PURE__ */ d("div", {
|
|
1247
1572
|
ref: t,
|
|
1248
1573
|
style: {
|
|
@@ -1251,7 +1576,7 @@ function mt({ style: e, nodeRef: t }) {
|
|
|
1251
1576
|
}
|
|
1252
1577
|
});
|
|
1253
1578
|
}
|
|
1254
|
-
var
|
|
1579
|
+
var Zt = {
|
|
1255
1580
|
position: "absolute",
|
|
1256
1581
|
top: "50%",
|
|
1257
1582
|
transform: "translateY(-50%)",
|
|
@@ -1268,7 +1593,7 @@ var ht = {
|
|
|
1268
1593
|
alignItems: "center",
|
|
1269
1594
|
justifyContent: "center",
|
|
1270
1595
|
padding: 0
|
|
1271
|
-
},
|
|
1596
|
+
}, Qt = {
|
|
1272
1597
|
bottom: {
|
|
1273
1598
|
inset: "auto 0 0 0",
|
|
1274
1599
|
padding: "40px 24px 20px",
|
|
@@ -1287,8 +1612,8 @@ var ht = {
|
|
|
1287
1612
|
padding: 24,
|
|
1288
1613
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1289
1614
|
}
|
|
1290
|
-
},
|
|
1291
|
-
function
|
|
1615
|
+
}, $t = 48;
|
|
1616
|
+
function en({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
|
|
1292
1617
|
let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1293
1618
|
if (a(() => {
|
|
1294
1619
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1304,7 +1629,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1304
1629
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1305
1630
|
if (!_) return;
|
|
1306
1631
|
let { dx: e } = _;
|
|
1307
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1632
|
+
v(null), e < -48 ? b(y + 1) : e > $t && b(y - 1);
|
|
1308
1633
|
};
|
|
1309
1634
|
return /* @__PURE__ */ f("div", {
|
|
1310
1635
|
ref: c,
|
|
@@ -1353,7 +1678,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1353
1678
|
type: "button",
|
|
1354
1679
|
"aria-label": "Previous slide",
|
|
1355
1680
|
style: {
|
|
1356
|
-
...
|
|
1681
|
+
...Zt,
|
|
1357
1682
|
left: 12
|
|
1358
1683
|
},
|
|
1359
1684
|
onClick: () => b(y - 1),
|
|
@@ -1363,7 +1688,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1363
1688
|
type: "button",
|
|
1364
1689
|
"aria-label": "Next slide",
|
|
1365
1690
|
style: {
|
|
1366
|
-
...
|
|
1691
|
+
...Zt,
|
|
1367
1692
|
right: 12
|
|
1368
1693
|
},
|
|
1369
1694
|
onClick: () => b(y + 1),
|
|
@@ -1397,7 +1722,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1397
1722
|
] })]
|
|
1398
1723
|
});
|
|
1399
1724
|
}
|
|
1400
|
-
var
|
|
1725
|
+
var tn = (e, t) => ({
|
|
1401
1726
|
position: "absolute",
|
|
1402
1727
|
inset: 0,
|
|
1403
1728
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1405,18 +1730,18 @@ var yt = (e, t) => ({
|
|
|
1405
1730
|
backgroundSize: "cover",
|
|
1406
1731
|
backgroundPosition: "center"
|
|
1407
1732
|
});
|
|
1408
|
-
function
|
|
1409
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1733
|
+
function nn({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1734
|
+
return e.length ? /* @__PURE__ */ d(en, {
|
|
1410
1735
|
...r,
|
|
1411
1736
|
count: e.length,
|
|
1412
1737
|
renderSlide: (r) => {
|
|
1413
1738
|
let i = e[r];
|
|
1414
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1739
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: tn(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
|
|
1415
1740
|
style: {
|
|
1416
1741
|
position: "absolute",
|
|
1417
1742
|
color: "#fff",
|
|
1418
1743
|
textAlign: n,
|
|
1419
|
-
...
|
|
1744
|
+
...Qt[t] ?? Qt.bottom
|
|
1420
1745
|
},
|
|
1421
1746
|
children: [i.title && /* @__PURE__ */ d("div", {
|
|
1422
1747
|
style: {
|
|
@@ -1436,13 +1761,13 @@ function bt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1436
1761
|
}
|
|
1437
1762
|
}) : null;
|
|
1438
1763
|
}
|
|
1439
|
-
function
|
|
1440
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1764
|
+
function rn({ slides: e = [], linked: t, ...n }) {
|
|
1765
|
+
return e.length ? /* @__PURE__ */ d(en, {
|
|
1441
1766
|
...n,
|
|
1442
1767
|
count: e.length,
|
|
1443
1768
|
renderSlide: (n) => {
|
|
1444
1769
|
let r = e[n];
|
|
1445
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1770
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: tn(r.image, r.color) }), /* @__PURE__ */ d("div", {
|
|
1446
1771
|
style: {
|
|
1447
1772
|
position: "absolute",
|
|
1448
1773
|
inset: 0,
|
|
@@ -1454,23 +1779,23 @@ function xt({ slides: e = [], linked: t, ...n }) {
|
|
|
1454
1779
|
}
|
|
1455
1780
|
}) : null;
|
|
1456
1781
|
}
|
|
1457
|
-
var
|
|
1458
|
-
let r =
|
|
1782
|
+
var an = 256, on = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), sn = (e, t, n) => {
|
|
1783
|
+
let r = an * 2 ** n;
|
|
1459
1784
|
return {
|
|
1460
1785
|
x: (Number(t) + 180) / 360 * r,
|
|
1461
|
-
y: (.5 -
|
|
1786
|
+
y: (.5 - on(Number(e)) / (2 * Math.PI)) * r
|
|
1462
1787
|
};
|
|
1463
1788
|
}, $ = (e, t) => {
|
|
1464
1789
|
if (e === "" || e == null) return null;
|
|
1465
1790
|
let n = Number(e);
|
|
1466
1791
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1467
|
-
},
|
|
1468
|
-
function
|
|
1792
|
+
}, cn = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1793
|
+
function ln(e, t, n = "directions", r = "") {
|
|
1469
1794
|
let i = `${e},${t}`;
|
|
1470
1795
|
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)}`;
|
|
1471
1796
|
}
|
|
1472
|
-
var
|
|
1473
|
-
function
|
|
1797
|
+
var un = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1798
|
+
function dn({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize: o = 22, pinLink: s = "directions", link: u = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
|
|
1474
1799
|
let _ = c(null), [v, y] = l(1200);
|
|
1475
1800
|
a(() => {
|
|
1476
1801
|
let e = _.current;
|
|
@@ -1480,7 +1805,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1480
1805
|
let n = new ResizeObserver(t);
|
|
1481
1806
|
return n.observe(e), () => n.disconnect();
|
|
1482
1807
|
}, []);
|
|
1483
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1808
|
+
let b = (Array.isArray(e) ? e : []).filter(cn), x = cn({
|
|
1484
1809
|
lat: t,
|
|
1485
1810
|
lng: n
|
|
1486
1811
|
}) ? {
|
|
@@ -1492,7 +1817,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1492
1817
|
} : null, S = Math.max(80, Number(i) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1493
1818
|
if (b.length < 2) return 13;
|
|
1494
1819
|
for (let e = 19; e >= 1; e--) {
|
|
1495
|
-
let t = b.map((t) =>
|
|
1820
|
+
let t = b.map((t) => sn($(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));
|
|
1496
1821
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1497
1822
|
}
|
|
1498
1823
|
return 1;
|
|
@@ -1516,12 +1841,12 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1516
1841
|
},
|
|
1517
1842
|
children: "Set the coordinates in Settings"
|
|
1518
1843
|
});
|
|
1519
|
-
let T =
|
|
1844
|
+
let T = sn(x.lat, x.lng, C), E = {
|
|
1520
1845
|
x: T.x - v / 2,
|
|
1521
1846
|
y: T.y - S / 2
|
|
1522
1847
|
}, D = [], O = [];
|
|
1523
|
-
for (let e = Math.floor(E.x /
|
|
1524
|
-
for (let e = Math.floor(E.y /
|
|
1848
|
+
for (let e = Math.floor(E.x / an); e <= Math.floor((E.x + v) / an); e++) D.push(e);
|
|
1849
|
+
for (let e = Math.floor(E.y / an); e <= Math.floor((E.y + S) / an); e++) O.push(e);
|
|
1525
1850
|
let k = 2 ** C;
|
|
1526
1851
|
return /* @__PURE__ */ f("div", {
|
|
1527
1852
|
ref: (e) => {
|
|
@@ -1544,22 +1869,22 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1544
1869
|
return e < 0 || e >= k ? null : /* @__PURE__ */ d("img", {
|
|
1545
1870
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1546
1871
|
alt: "",
|
|
1547
|
-
width:
|
|
1548
|
-
height:
|
|
1872
|
+
width: an,
|
|
1873
|
+
height: an,
|
|
1549
1874
|
loading: "lazy",
|
|
1550
1875
|
style: {
|
|
1551
1876
|
position: "absolute",
|
|
1552
|
-
left: Math.round(t *
|
|
1553
|
-
top: Math.round(e *
|
|
1554
|
-
width:
|
|
1555
|
-
height:
|
|
1877
|
+
left: Math.round(t * an - E.x),
|
|
1878
|
+
top: Math.round(e * an - E.y),
|
|
1879
|
+
width: an,
|
|
1880
|
+
height: an,
|
|
1556
1881
|
userSelect: "none",
|
|
1557
1882
|
pointerEvents: "none"
|
|
1558
1883
|
}
|
|
1559
1884
|
}, `${t}-${e}`);
|
|
1560
1885
|
})),
|
|
1561
1886
|
b.map((e, t) => {
|
|
1562
|
-
let n =
|
|
1887
|
+
let n = sn($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", c = s === "none" || g ? null : ln($(e.lat, 90), $(e.lng, 180), s, e.title);
|
|
1563
1888
|
return /* @__PURE__ */ f(c ? "a" : "span", {
|
|
1564
1889
|
href: c || void 0,
|
|
1565
1890
|
target: c ? "_blank" : void 0,
|
|
@@ -1598,8 +1923,8 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1598
1923
|
viewBox: "0 0 24 24",
|
|
1599
1924
|
fill: a,
|
|
1600
1925
|
style: { display: "block" },
|
|
1601
|
-
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
1602
|
-
d:
|
|
1926
|
+
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), fn[e.icon] ? /* @__PURE__ */ d("path", {
|
|
1927
|
+
d: fn[e.icon],
|
|
1603
1928
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1604
1929
|
fill: "none",
|
|
1605
1930
|
stroke: "#fff",
|
|
@@ -1635,7 +1960,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1635
1960
|
})
|
|
1636
1961
|
]
|
|
1637
1962
|
}), u ? /* @__PURE__ */ d("a", {
|
|
1638
|
-
href:
|
|
1963
|
+
href: un(x.lat, x.lng, C),
|
|
1639
1964
|
target: "_blank",
|
|
1640
1965
|
rel: "noopener noreferrer",
|
|
1641
1966
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1649,7 +1974,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1649
1974
|
}) : null]
|
|
1650
1975
|
});
|
|
1651
1976
|
}
|
|
1652
|
-
var
|
|
1977
|
+
var fn = {
|
|
1653
1978
|
check: "M4 12l5 5L20 6",
|
|
1654
1979
|
close: "M6 6l12 12M18 6L6 18",
|
|
1655
1980
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1746,8 +2071,8 @@ var kt = {
|
|
|
1746
2071
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1747
2072
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1748
2073
|
};
|
|
1749
|
-
function
|
|
1750
|
-
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [
|
|
2074
|
+
function pn({ 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: u, inert: f }) {
|
|
2075
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [fn[e] ?? fn.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ d("svg", {
|
|
1751
2076
|
viewBox: "0 0 24 24",
|
|
1752
2077
|
width: g,
|
|
1753
2078
|
height: g,
|
|
@@ -1783,10 +2108,10 @@ function At({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1783
2108
|
children: v
|
|
1784
2109
|
});
|
|
1785
2110
|
}
|
|
1786
|
-
function
|
|
1787
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
2111
|
+
function mn(e, t = {}, n = 0) {
|
|
2112
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : ot(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1788
2113
|
for (let e of r) {
|
|
1789
|
-
let n = e.data ?? e, r =
|
|
2114
|
+
let n = e.data ?? e, r = it(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(it(n, t.nameField)) : i(n.name), l = t.hrefField ? i(it(n, t.hrefField)) : "";
|
|
1790
2115
|
for (let e of s) if (o.push({
|
|
1791
2116
|
src: e,
|
|
1792
2117
|
name: c,
|
|
@@ -1796,8 +2121,8 @@ function jt(e, t = {}, n = 0) {
|
|
|
1796
2121
|
}
|
|
1797
2122
|
return o;
|
|
1798
2123
|
}
|
|
1799
|
-
function
|
|
1800
|
-
let { tenant: x, apiUrl: S } = i(
|
|
2124
|
+
function hn({ images: e = [], source: t = "", entry: n = "", imageField: r = "", nameField: o = "", hrefField: s = "", limit: c = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
|
|
2125
|
+
let { tenant: x, apiUrl: S } = i(Q), C = i(Qe)?.[t], [w, T] = l(null), [E, D] = l(() => /* @__PURE__ */ new Set());
|
|
1801
2126
|
a(() => {
|
|
1802
2127
|
if (!t || C) return;
|
|
1803
2128
|
let e = !0;
|
|
@@ -1814,7 +2139,7 @@ function Mt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1814
2139
|
C
|
|
1815
2140
|
]);
|
|
1816
2141
|
let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, A = Math.max(0, Number(c) || 0), j = t ? (() => {
|
|
1817
|
-
let e =
|
|
2142
|
+
let e = mn(k, {
|
|
1818
2143
|
imageField: r,
|
|
1819
2144
|
nameField: o,
|
|
1820
2145
|
hrefField: s
|
|
@@ -2019,20 +2344,20 @@ function Mt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
2019
2344
|
]
|
|
2020
2345
|
});
|
|
2021
2346
|
}
|
|
2022
|
-
var
|
|
2347
|
+
var gn = {
|
|
2023
2348
|
color: "inherit",
|
|
2024
2349
|
textDecoration: "none",
|
|
2025
2350
|
fontSize: 14,
|
|
2026
2351
|
opacity: .85
|
|
2027
|
-
},
|
|
2352
|
+
}, _n = {
|
|
2028
2353
|
background: "var(--page-surface, #f2f2f2)",
|
|
2029
2354
|
color: "var(--page-text, #111827)",
|
|
2030
2355
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
2031
2356
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
2032
2357
|
zIndex: 60
|
|
2033
2358
|
};
|
|
2034
|
-
function
|
|
2035
|
-
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 ? "" :
|
|
2359
|
+
function vn(e, t = {}, n = "dropdown") {
|
|
2360
|
+
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 ? "" : ot(e), o = r.map((e) => {
|
|
2036
2361
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
2037
2362
|
return {
|
|
2038
2363
|
key: e.id,
|
|
@@ -2073,8 +2398,8 @@ function Ft(e, t = {}, n = "dropdown") {
|
|
|
2073
2398
|
type: e.children.length ? n : "link"
|
|
2074
2399
|
}));
|
|
2075
2400
|
}
|
|
2076
|
-
function
|
|
2077
|
-
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(
|
|
2401
|
+
function yn({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], style: c, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
|
|
2402
|
+
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(Q), N = i(Qe)?.[g], [F, I] = l(null);
|
|
2078
2403
|
a(() => {
|
|
2079
2404
|
if (!g || N) return;
|
|
2080
2405
|
let e = !0;
|
|
@@ -2094,7 +2419,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2094
2419
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2095
2420
|
return e.observe(C), () => e.disconnect();
|
|
2096
2421
|
}, [C, h]);
|
|
2097
|
-
let L = g ?
|
|
2422
|
+
let L = g ? vn(N ?? F ?? [], {
|
|
2098
2423
|
labelField: _,
|
|
2099
2424
|
hrefField: v,
|
|
2100
2425
|
imageField: y,
|
|
@@ -2123,7 +2448,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2123
2448
|
return /* @__PURE__ */ f("a", {
|
|
2124
2449
|
href: e.href || "#",
|
|
2125
2450
|
style: {
|
|
2126
|
-
...
|
|
2451
|
+
...gn,
|
|
2127
2452
|
display: n ? "block" : "flex",
|
|
2128
2453
|
alignItems: n ? void 0 : "center",
|
|
2129
2454
|
gap: n ? void 0 : 10,
|
|
@@ -2220,7 +2545,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2220
2545
|
let t = e.children ?? [];
|
|
2221
2546
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
2222
2547
|
href: e.href || "#",
|
|
2223
|
-
style:
|
|
2548
|
+
style: gn,
|
|
2224
2549
|
children: e.label
|
|
2225
2550
|
}, e.key);
|
|
2226
2551
|
let n = e.type === "mega";
|
|
@@ -2234,7 +2559,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2234
2559
|
children: [/* @__PURE__ */ f("a", {
|
|
2235
2560
|
href: e.href || "#",
|
|
2236
2561
|
style: {
|
|
2237
|
-
...
|
|
2562
|
+
...gn,
|
|
2238
2563
|
cursor: "pointer"
|
|
2239
2564
|
},
|
|
2240
2565
|
children: [
|
|
@@ -2250,7 +2575,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2250
2575
|
]
|
|
2251
2576
|
}), k === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
2252
2577
|
style: {
|
|
2253
|
-
...
|
|
2578
|
+
..._n,
|
|
2254
2579
|
position: "absolute",
|
|
2255
2580
|
left: 0,
|
|
2256
2581
|
right: 0,
|
|
@@ -2266,7 +2591,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2266
2591
|
}, !0))
|
|
2267
2592
|
}) : /* @__PURE__ */ d("div", {
|
|
2268
2593
|
style: {
|
|
2269
|
-
...
|
|
2594
|
+
..._n,
|
|
2270
2595
|
position: "absolute",
|
|
2271
2596
|
top: "100%",
|
|
2272
2597
|
left: 0,
|
|
@@ -2295,7 +2620,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2295
2620
|
children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
2296
2621
|
href: e.href || "#",
|
|
2297
2622
|
style: {
|
|
2298
|
-
...
|
|
2623
|
+
...gn,
|
|
2299
2624
|
padding: "10px 4px",
|
|
2300
2625
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
2301
2626
|
opacity: 1
|
|
@@ -2306,7 +2631,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2306
2631
|
]
|
|
2307
2632
|
});
|
|
2308
2633
|
}
|
|
2309
|
-
function
|
|
2634
|
+
function bn({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2310
2635
|
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2311
2636
|
return e.length ? /* @__PURE__ */ f("div", {
|
|
2312
2637
|
ref: r,
|
|
@@ -2346,13 +2671,13 @@ function Lt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2346
2671
|
}, e.key))]
|
|
2347
2672
|
}) : null;
|
|
2348
2673
|
}
|
|
2349
|
-
function
|
|
2674
|
+
function xn({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: c, openColor: u, borderColor: p, style: m, nodeRef: h }) {
|
|
2350
2675
|
let [g, _] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
2351
2676
|
if (!e.length) return null;
|
|
2352
2677
|
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2353
2678
|
let n = Number(e);
|
|
2354
2679
|
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2355
|
-
}, b =
|
|
2680
|
+
}, b = fn[r], x = (e) => _((t) => {
|
|
2356
2681
|
let r = new Set(n ? t : []);
|
|
2357
2682
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2358
2683
|
});
|
|
@@ -2427,15 +2752,15 @@ function Rt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
|
|
|
2427
2752
|
})
|
|
2428
2753
|
});
|
|
2429
2754
|
}
|
|
2430
|
-
var
|
|
2755
|
+
var Sn = {
|
|
2431
2756
|
display: "flex",
|
|
2432
2757
|
flexDirection: "column",
|
|
2433
2758
|
gap: "12px"
|
|
2434
|
-
},
|
|
2759
|
+
}, Cn = {
|
|
2435
2760
|
fontSize: "14px",
|
|
2436
2761
|
fontWeight: 500,
|
|
2437
2762
|
color: "var(--page-text, #111827)"
|
|
2438
|
-
},
|
|
2763
|
+
}, wn = {
|
|
2439
2764
|
padding: "10px 12px",
|
|
2440
2765
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2441
2766
|
borderRadius: "6px",
|
|
@@ -2445,18 +2770,18 @@ var zt = {
|
|
|
2445
2770
|
boxSizing: "border-box",
|
|
2446
2771
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2447
2772
|
color: "var(--page-text, #111827)"
|
|
2448
|
-
},
|
|
2773
|
+
}, Tn = {
|
|
2449
2774
|
display: "flex",
|
|
2450
2775
|
alignItems: "center",
|
|
2451
2776
|
gap: "8px",
|
|
2452
2777
|
fontSize: "14px",
|
|
2453
2778
|
color: "var(--page-text, #111827)"
|
|
2454
|
-
},
|
|
2779
|
+
}, En = (e) => e ? {
|
|
2455
2780
|
readOnly: !0,
|
|
2456
2781
|
tabIndex: -1,
|
|
2457
2782
|
onMouseDown: (e) => e.preventDefault()
|
|
2458
2783
|
} : {};
|
|
2459
|
-
function
|
|
2784
|
+
function Dn(e, t) {
|
|
2460
2785
|
if (!e) return !0;
|
|
2461
2786
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2462
2787
|
switch (e.op) {
|
|
@@ -2470,11 +2795,11 @@ function Wt(e, t) {
|
|
|
2470
2795
|
default: return !1;
|
|
2471
2796
|
}
|
|
2472
2797
|
}
|
|
2473
|
-
var
|
|
2798
|
+
var On = {
|
|
2474
2799
|
display: "flex",
|
|
2475
2800
|
flexDirection: "column",
|
|
2476
2801
|
gap: 6
|
|
2477
|
-
},
|
|
2802
|
+
}, kn = {
|
|
2478
2803
|
font: "inherit",
|
|
2479
2804
|
fontSize: 15,
|
|
2480
2805
|
padding: "10px 12px",
|
|
@@ -2485,17 +2810,17 @@ var Gt = {
|
|
|
2485
2810
|
width: "100%",
|
|
2486
2811
|
boxSizing: "border-box"
|
|
2487
2812
|
};
|
|
2488
|
-
function
|
|
2813
|
+
function An(e, t) {
|
|
2489
2814
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2490
2815
|
if (!e?.parentField) return n;
|
|
2491
2816
|
let r = t?.[e.parentField];
|
|
2492
2817
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2493
2818
|
}
|
|
2494
|
-
var
|
|
2495
|
-
function
|
|
2819
|
+
var jn = "g-recaptcha-response", Mn = (e) => e?.type === "recaptcha" ? jn : e?.name;
|
|
2820
|
+
function Nn({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2496
2821
|
let a = /* @__PURE__ */ f("span", {
|
|
2497
2822
|
style: {
|
|
2498
|
-
...
|
|
2823
|
+
...Cn,
|
|
2499
2824
|
fontSize: 14
|
|
2500
2825
|
},
|
|
2501
2826
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2504,7 +2829,7 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2504
2829
|
required: e.required || void 0,
|
|
2505
2830
|
placeholder: e.placeholder || void 0,
|
|
2506
2831
|
disabled: r || void 0,
|
|
2507
|
-
style:
|
|
2832
|
+
style: kn,
|
|
2508
2833
|
value: t ?? "",
|
|
2509
2834
|
onChange: (t) => n(e.name, t.target.value)
|
|
2510
2835
|
};
|
|
@@ -2533,12 +2858,12 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2533
2858
|
borderRadius: 8,
|
|
2534
2859
|
display: "block"
|
|
2535
2860
|
}
|
|
2536
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(
|
|
2861
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(Rn, {
|
|
2537
2862
|
theme: e.captchaTheme,
|
|
2538
2863
|
size: e.captchaSize,
|
|
2539
2864
|
inert: r,
|
|
2540
|
-
onChange: (e) => n(
|
|
2541
|
-
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(
|
|
2865
|
+
onChange: (e) => n(jn, e)
|
|
2866
|
+
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(Ut, {
|
|
2542
2867
|
url: e.src,
|
|
2543
2868
|
style: { width: "100%" }
|
|
2544
2869
|
}) : /* @__PURE__ */ d("video", {
|
|
@@ -2550,14 +2875,14 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2550
2875
|
display: "block"
|
|
2551
2876
|
}
|
|
2552
2877
|
}) : null : /* @__PURE__ */ f("label", {
|
|
2553
|
-
style:
|
|
2878
|
+
style: On,
|
|
2554
2879
|
children: [
|
|
2555
2880
|
a,
|
|
2556
2881
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
|
|
2557
2882
|
...o,
|
|
2558
2883
|
rows: 4,
|
|
2559
2884
|
style: {
|
|
2560
|
-
...
|
|
2885
|
+
...kn,
|
|
2561
2886
|
resize: "vertical"
|
|
2562
2887
|
}
|
|
2563
2888
|
}) : e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
@@ -2566,7 +2891,7 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2566
2891
|
children: [/* @__PURE__ */ d("option", {
|
|
2567
2892
|
value: "",
|
|
2568
2893
|
children: e.placeholder || "—"
|
|
2569
|
-
}),
|
|
2894
|
+
}), An(e, i).map((e, t) => /* @__PURE__ */ d("option", {
|
|
2570
2895
|
value: typeof e == "string" ? e : e.value,
|
|
2571
2896
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2572
2897
|
}, t))]
|
|
@@ -2613,8 +2938,8 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2613
2938
|
]
|
|
2614
2939
|
});
|
|
2615
2940
|
}
|
|
2616
|
-
function
|
|
2617
|
-
let { tenant: y, apiUrl: b } = i(
|
|
2941
|
+
function Pn({ 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 }) {
|
|
2942
|
+
let { tenant: y, apiUrl: b } = i(Q), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [D, O] = l(0), k = h ? v || "form" : x;
|
|
2618
2943
|
a(() => {
|
|
2619
2944
|
if (!c || !s) return;
|
|
2620
2945
|
let e = !0;
|
|
@@ -2635,11 +2960,11 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2635
2960
|
section: e,
|
|
2636
2961
|
fields: []
|
|
2637
2962
|
}) : A[A.length - 1].fields.push(e);
|
|
2638
|
-
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section ||
|
|
2963
|
+
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Dn(e.section.condition, T)).map((e) => ({
|
|
2639
2964
|
...e,
|
|
2640
|
-
fields: e.fields.filter((e) =>
|
|
2965
|
+
fields: e.fields.filter((e) => Dn(e.condition, T))
|
|
2641
2966
|
})), N = j.length > 1, F = Math.min(D, Math.max(0, M.length - 1)), I = N ? M[F]?.fields ?? [] : M.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
2642
|
-
let t = T[
|
|
2967
|
+
let t = T[Mn(e)];
|
|
2643
2968
|
return e.required && (t == null || t === "" || t === !1);
|
|
2644
2969
|
}), R = F >= M.length - 1, z = (e, t) => E((n) => {
|
|
2645
2970
|
let r = {
|
|
@@ -2695,11 +3020,11 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2695
3020
|
}
|
|
2696
3021
|
},
|
|
2697
3022
|
style: {
|
|
2698
|
-
...
|
|
3023
|
+
...Sn,
|
|
2699
3024
|
display: k === "success" ? "none" : "flex"
|
|
2700
3025
|
},
|
|
2701
3026
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
2702
|
-
N && /* @__PURE__ */ d(
|
|
3027
|
+
N && /* @__PURE__ */ d(pr, {
|
|
2703
3028
|
steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2704
3029
|
active: F + 1,
|
|
2705
3030
|
style: { marginBottom: 8 }
|
|
@@ -2712,9 +3037,9 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2712
3037
|
},
|
|
2713
3038
|
children: M[F].section.help
|
|
2714
3039
|
}),
|
|
2715
|
-
I.map((e) => /* @__PURE__ */ d(
|
|
3040
|
+
I.map((e) => /* @__PURE__ */ d(Nn, {
|
|
2716
3041
|
field: e,
|
|
2717
|
-
value: T[
|
|
3042
|
+
value: T[Mn(e)],
|
|
2718
3043
|
values: T,
|
|
2719
3044
|
onChange: z,
|
|
2720
3045
|
inert: h
|
|
@@ -2731,7 +3056,7 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2731
3056
|
disabled: h || void 0,
|
|
2732
3057
|
onClick: () => O(F - 1),
|
|
2733
3058
|
style: {
|
|
2734
|
-
...
|
|
3059
|
+
...ft,
|
|
2735
3060
|
background: "transparent",
|
|
2736
3061
|
color: "inherit",
|
|
2737
3062
|
border: 0,
|
|
@@ -2744,7 +3069,7 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2744
3069
|
disabled: h || L.length > 0,
|
|
2745
3070
|
onClick: () => O(F + 1),
|
|
2746
3071
|
style: {
|
|
2747
|
-
...
|
|
3072
|
+
...ft,
|
|
2748
3073
|
border: 0,
|
|
2749
3074
|
padding: "10px 22px",
|
|
2750
3075
|
borderRadius: 8,
|
|
@@ -2758,7 +3083,7 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2758
3083
|
type: "submit",
|
|
2759
3084
|
disabled: h || void 0,
|
|
2760
3085
|
style: {
|
|
2761
|
-
...
|
|
3086
|
+
...ft,
|
|
2762
3087
|
border: 0,
|
|
2763
3088
|
padding: "10px 22px",
|
|
2764
3089
|
borderRadius: 8,
|
|
@@ -2785,10 +3110,10 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2785
3110
|
]
|
|
2786
3111
|
});
|
|
2787
3112
|
}
|
|
2788
|
-
var
|
|
3113
|
+
var Fn = null, In = null, Ln = (e) => {
|
|
2789
3114
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2790
|
-
if (
|
|
2791
|
-
if (
|
|
3115
|
+
if (Fn && In === t) return Fn;
|
|
3116
|
+
if (Fn && typeof window < "u") {
|
|
2792
3117
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2793
3118
|
delete window[e];
|
|
2794
3119
|
} catch {
|
|
@@ -2796,22 +3121,22 @@ var Qt = null, $t = null, en = (e) => {
|
|
|
2796
3121
|
}
|
|
2797
3122
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2798
3123
|
}
|
|
2799
|
-
return
|
|
3124
|
+
return In = t, Fn = new Promise((e) => {
|
|
2800
3125
|
if (typeof window > "u") return;
|
|
2801
3126
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2802
3127
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2803
3128
|
let n = document.createElement("script");
|
|
2804
3129
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2805
|
-
}),
|
|
3130
|
+
}), Fn;
|
|
2806
3131
|
};
|
|
2807
|
-
function
|
|
2808
|
-
let p = i(
|
|
3132
|
+
function Rn({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
|
|
3133
|
+
let p = i(Q), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = c(null), _ = c(u);
|
|
2809
3134
|
if (_.current = u, a(() => {
|
|
2810
3135
|
if (l || !h || !g.current) return;
|
|
2811
3136
|
let e = !0, i = (t) => {
|
|
2812
3137
|
e && typeof _.current == "function" && _.current(t);
|
|
2813
3138
|
};
|
|
2814
|
-
return
|
|
3139
|
+
return Ln(r).then((r) => {
|
|
2815
3140
|
if (!(!e || !g.current || !r?.render)) {
|
|
2816
3141
|
g.current.innerHTML = "", i("");
|
|
2817
3142
|
try {
|
|
@@ -2893,17 +3218,17 @@ function tn({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
|
|
|
2893
3218
|
children: /* @__PURE__ */ d("div", { ref: g })
|
|
2894
3219
|
}) : null;
|
|
2895
3220
|
}
|
|
2896
|
-
function
|
|
3221
|
+
function zn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2897
3222
|
return /* @__PURE__ */ d("label", {
|
|
2898
3223
|
ref: r,
|
|
2899
3224
|
style: {
|
|
2900
|
-
...
|
|
3225
|
+
...Cn,
|
|
2901
3226
|
...P(n)
|
|
2902
3227
|
},
|
|
2903
|
-
children:
|
|
3228
|
+
children: wt(t, e, i)
|
|
2904
3229
|
});
|
|
2905
3230
|
}
|
|
2906
|
-
function
|
|
3231
|
+
function Bn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2907
3232
|
return /* @__PURE__ */ d("input", {
|
|
2908
3233
|
ref: a,
|
|
2909
3234
|
type: e,
|
|
@@ -2911,13 +3236,13 @@ function rn({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2911
3236
|
placeholder: n,
|
|
2912
3237
|
required: !o && !!r,
|
|
2913
3238
|
style: {
|
|
2914
|
-
...
|
|
3239
|
+
...wn,
|
|
2915
3240
|
...P(i)
|
|
2916
3241
|
},
|
|
2917
|
-
...
|
|
3242
|
+
...En(o)
|
|
2918
3243
|
});
|
|
2919
3244
|
}
|
|
2920
|
-
function
|
|
3245
|
+
function Vn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2921
3246
|
return /* @__PURE__ */ d("textarea", {
|
|
2922
3247
|
ref: a,
|
|
2923
3248
|
name: e || void 0,
|
|
@@ -2925,18 +3250,18 @@ function an({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2925
3250
|
rows: n,
|
|
2926
3251
|
required: !o && !!r,
|
|
2927
3252
|
style: {
|
|
2928
|
-
...
|
|
3253
|
+
...wn,
|
|
2929
3254
|
resize: "vertical",
|
|
2930
3255
|
...P(i)
|
|
2931
3256
|
},
|
|
2932
|
-
...
|
|
3257
|
+
...En(o)
|
|
2933
3258
|
});
|
|
2934
3259
|
}
|
|
2935
|
-
function
|
|
3260
|
+
function Hn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2936
3261
|
return /* @__PURE__ */ f("label", {
|
|
2937
3262
|
ref: o,
|
|
2938
3263
|
style: {
|
|
2939
|
-
...
|
|
3264
|
+
...Tn,
|
|
2940
3265
|
...P(a)
|
|
2941
3266
|
},
|
|
2942
3267
|
children: [/* @__PURE__ */ d("input", {
|
|
@@ -2953,7 +3278,7 @@ function on({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2953
3278
|
}), t]
|
|
2954
3279
|
});
|
|
2955
3280
|
}
|
|
2956
|
-
function
|
|
3281
|
+
function Un({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2957
3282
|
return /* @__PURE__ */ f("select", {
|
|
2958
3283
|
ref: a,
|
|
2959
3284
|
name: e || void 0,
|
|
@@ -2962,7 +3287,7 @@ function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2962
3287
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2963
3288
|
tabIndex: o ? -1 : void 0,
|
|
2964
3289
|
style: {
|
|
2965
|
-
...
|
|
3290
|
+
...wn,
|
|
2966
3291
|
appearance: "auto",
|
|
2967
3292
|
...P(i)
|
|
2968
3293
|
},
|
|
@@ -2976,12 +3301,12 @@ function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2976
3301
|
}, t))]
|
|
2977
3302
|
});
|
|
2978
3303
|
}
|
|
2979
|
-
function
|
|
3304
|
+
function Wn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2980
3305
|
let [s, c] = l(null);
|
|
2981
3306
|
return /* @__PURE__ */ f("label", {
|
|
2982
3307
|
ref: a,
|
|
2983
3308
|
style: {
|
|
2984
|
-
...
|
|
3309
|
+
...wn,
|
|
2985
3310
|
display: "flex",
|
|
2986
3311
|
alignItems: "center",
|
|
2987
3312
|
gap: "8px",
|
|
@@ -3008,12 +3333,12 @@ function cn({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
3008
3333
|
]
|
|
3009
3334
|
});
|
|
3010
3335
|
}
|
|
3011
|
-
function
|
|
3336
|
+
function Gn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
3012
3337
|
return /* @__PURE__ */ d("button", {
|
|
3013
3338
|
ref: n,
|
|
3014
3339
|
type: r ? "button" : "submit",
|
|
3015
3340
|
style: {
|
|
3016
|
-
...
|
|
3341
|
+
...ft,
|
|
3017
3342
|
border: 0,
|
|
3018
3343
|
cursor: "pointer",
|
|
3019
3344
|
alignSelf: "flex-start",
|
|
@@ -3028,7 +3353,7 @@ function ln({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
3028
3353
|
children: e
|
|
3029
3354
|
});
|
|
3030
3355
|
}
|
|
3031
|
-
function
|
|
3356
|
+
function Kn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
3032
3357
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
3033
3358
|
return /* @__PURE__ */ d("div", {
|
|
3034
3359
|
ref: r,
|
|
@@ -3045,8 +3370,8 @@ function un({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
3045
3370
|
}, t))
|
|
3046
3371
|
});
|
|
3047
3372
|
}
|
|
3048
|
-
function
|
|
3049
|
-
let { tenant: v, apiUrl: y, locale: b } = i(
|
|
3373
|
+
function qn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
|
|
3374
|
+
let { tenant: v, apiUrl: y, locale: b } = i(Q), x = i(nt), S = i(Qe), [, C] = l(0);
|
|
3050
3375
|
a(() => {
|
|
3051
3376
|
if (typeof window > "u") return;
|
|
3052
3377
|
let e = () => C((e) => e + 1);
|
|
@@ -3054,7 +3379,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3054
3379
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
3055
3380
|
};
|
|
3056
3381
|
}, []);
|
|
3057
|
-
let w =
|
|
3382
|
+
let w = tt(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? $e(S) : 1, [k, A] = l(null);
|
|
3058
3383
|
if (a(() => {
|
|
3059
3384
|
if (!e || D) return;
|
|
3060
3385
|
let n = !0, r = new URLSearchParams();
|
|
@@ -3099,7 +3424,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3099
3424
|
},
|
|
3100
3425
|
children: M.map((e) => /* @__PURE__ */ d("div", {
|
|
3101
3426
|
style: { minWidth: 0 },
|
|
3102
|
-
children: x.render(p, (t) =>
|
|
3427
|
+
children: x.render(p, (t) => st(t, e))
|
|
3103
3428
|
}, e.id ?? e?.data?.slug))
|
|
3104
3429
|
}) : /* @__PURE__ */ d("div", {
|
|
3105
3430
|
ref: _,
|
|
@@ -3109,7 +3434,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3109
3434
|
...P(g)
|
|
3110
3435
|
},
|
|
3111
3436
|
children: M.map((e) => {
|
|
3112
|
-
let t = o ?
|
|
3437
|
+
let t = o ? it(e?.data, o) : null, r = s ? ot(it(e?.data, s)) : null, i = c ? it(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : ot(i), u = n === "list";
|
|
3113
3438
|
return /* @__PURE__ */ f("div", {
|
|
3114
3439
|
style: {
|
|
3115
3440
|
display: "flex",
|
|
@@ -3156,7 +3481,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3156
3481
|
lineHeight: 1.55,
|
|
3157
3482
|
opacity: .85
|
|
3158
3483
|
},
|
|
3159
|
-
children:
|
|
3484
|
+
children: At(a)
|
|
3160
3485
|
})
|
|
3161
3486
|
]
|
|
3162
3487
|
})]
|
|
@@ -3164,8 +3489,8 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3164
3489
|
})
|
|
3165
3490
|
});
|
|
3166
3491
|
}
|
|
3167
|
-
function
|
|
3168
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3492
|
+
function Jn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3493
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : et(), s = {
|
|
3169
3494
|
height: 34,
|
|
3170
3495
|
padding: "0 12px",
|
|
3171
3496
|
borderRadius: 8,
|
|
@@ -3213,7 +3538,7 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3213
3538
|
name: `f_${e.name}`,
|
|
3214
3539
|
defaultValue: o[e.name] ?? "",
|
|
3215
3540
|
style: s,
|
|
3216
|
-
...
|
|
3541
|
+
...En(i),
|
|
3217
3542
|
children: [/* @__PURE__ */ d("option", {
|
|
3218
3543
|
value: "",
|
|
3219
3544
|
children: e.label || e.name
|
|
@@ -3228,7 +3553,7 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3228
3553
|
name: `f_${e.name}`,
|
|
3229
3554
|
defaultValue: o[e.name] ?? "",
|
|
3230
3555
|
style: s,
|
|
3231
|
-
...
|
|
3556
|
+
...En(i),
|
|
3232
3557
|
children: [
|
|
3233
3558
|
/* @__PURE__ */ d("option", {
|
|
3234
3559
|
value: "",
|
|
@@ -3249,7 +3574,7 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3249
3574
|
defaultValue: o[e.name] ?? "",
|
|
3250
3575
|
placeholder: e.label || e.name,
|
|
3251
3576
|
style: s,
|
|
3252
|
-
...
|
|
3577
|
+
...En(i)
|
|
3253
3578
|
}, e.name)), /* @__PURE__ */ d("button", {
|
|
3254
3579
|
type: "submit",
|
|
3255
3580
|
style: {
|
|
@@ -3262,12 +3587,12 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3262
3587
|
fontWeight: 600,
|
|
3263
3588
|
cursor: i ? "default" : "pointer"
|
|
3264
3589
|
},
|
|
3265
|
-
...
|
|
3590
|
+
...En(i),
|
|
3266
3591
|
children: t
|
|
3267
3592
|
})]
|
|
3268
3593
|
});
|
|
3269
3594
|
}
|
|
3270
|
-
function
|
|
3595
|
+
function Yn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3271
3596
|
return e.length ? /* @__PURE__ */ d("nav", {
|
|
3272
3597
|
ref: r,
|
|
3273
3598
|
"aria-label": "Breadcrumb",
|
|
@@ -3317,8 +3642,8 @@ function pn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3317
3642
|
})
|
|
3318
3643
|
}) : null;
|
|
3319
3644
|
}
|
|
3320
|
-
function
|
|
3321
|
-
let { tenant: g, apiUrl: _ } = i(
|
|
3645
|
+
function Xn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, hideEmpty: u, inert: p, style: m, nodeRef: h }) {
|
|
3646
|
+
let { tenant: g, apiUrl: _ } = i(Q), v = i(Qe), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3322
3647
|
a(() => {
|
|
3323
3648
|
if (!o || Number.isFinite(x)) return;
|
|
3324
3649
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3337,7 +3662,7 @@ function mn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
3337
3662
|
]);
|
|
3338
3663
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
3339
3664
|
if (o && C === null || o && u && !(C > 0)) return null;
|
|
3340
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3665
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? $e(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
3341
3666
|
if (o) {
|
|
3342
3667
|
if (typeof window < "u") {
|
|
3343
3668
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -3402,15 +3727,15 @@ function mn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
3402
3727
|
]
|
|
3403
3728
|
});
|
|
3404
3729
|
}
|
|
3405
|
-
var
|
|
3730
|
+
var Zn = "webim.page_mode", Qn = () => {
|
|
3406
3731
|
if (typeof window > "u") return "auto";
|
|
3407
3732
|
try {
|
|
3408
|
-
let e = window.localStorage.getItem(
|
|
3733
|
+
let e = window.localStorage.getItem(Zn);
|
|
3409
3734
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3410
3735
|
} catch {
|
|
3411
3736
|
return "auto";
|
|
3412
3737
|
}
|
|
3413
|
-
},
|
|
3738
|
+
}, $n = (e) => {
|
|
3414
3739
|
let t = {
|
|
3415
3740
|
width: 16,
|
|
3416
3741
|
height: 16,
|
|
@@ -3442,13 +3767,13 @@ var hn = "webim.page_mode", gn = () => {
|
|
|
3442
3767
|
rx: "2"
|
|
3443
3768
|
}), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
|
|
3444
3769
|
});
|
|
3445
|
-
},
|
|
3770
|
+
}, er = {
|
|
3446
3771
|
light: "Light theme",
|
|
3447
3772
|
dark: "Dark theme",
|
|
3448
3773
|
auto: "Follow the device theme"
|
|
3449
3774
|
};
|
|
3450
|
-
function
|
|
3451
|
-
let [o, s] = l(i ? "auto" :
|
|
3775
|
+
function tr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
3776
|
+
let [o, s] = l(i ? "auto" : Qn), u = c(null), f = (e) => {
|
|
3452
3777
|
u.current = e, typeof r == "function" && r(e);
|
|
3453
3778
|
};
|
|
3454
3779
|
a(() => {
|
|
@@ -3456,7 +3781,7 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3456
3781
|
let e = u.current?.closest?.(".webim-page");
|
|
3457
3782
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3458
3783
|
try {
|
|
3459
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3784
|
+
o === "auto" ? window.localStorage.removeItem(Zn) : window.localStorage.setItem(Zn, o);
|
|
3460
3785
|
} catch {}
|
|
3461
3786
|
}, [o, i]);
|
|
3462
3787
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3491,8 +3816,8 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3491
3816
|
},
|
|
3492
3817
|
children: p.map((e) => /* @__PURE__ */ d("button", {
|
|
3493
3818
|
type: "button",
|
|
3494
|
-
title:
|
|
3495
|
-
"aria-label":
|
|
3819
|
+
title: er[e],
|
|
3820
|
+
"aria-label": er[e],
|
|
3496
3821
|
"aria-pressed": e === m,
|
|
3497
3822
|
onClick: i ? void 0 : () => s(e),
|
|
3498
3823
|
style: {
|
|
@@ -3503,15 +3828,15 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3503
3828
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3504
3829
|
opacity: e === m ? 1 : .7
|
|
3505
3830
|
},
|
|
3506
|
-
children:
|
|
3831
|
+
children: $n(e)
|
|
3507
3832
|
}, e))
|
|
3508
3833
|
});
|
|
3509
3834
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3510
3835
|
return /* @__PURE__ */ d("button", {
|
|
3511
3836
|
ref: f,
|
|
3512
3837
|
type: "button",
|
|
3513
|
-
title:
|
|
3514
|
-
"aria-label": `Theme: ${
|
|
3838
|
+
title: er[m],
|
|
3839
|
+
"aria-label": `Theme: ${er[m]} — switch to ${er[g]}`,
|
|
3515
3840
|
onClick: i ? void 0 : () => s(g),
|
|
3516
3841
|
style: {
|
|
3517
3842
|
...h,
|
|
@@ -3520,10 +3845,10 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3520
3845
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3521
3846
|
...P(n)
|
|
3522
3847
|
},
|
|
3523
|
-
children:
|
|
3848
|
+
children: $n(m)
|
|
3524
3849
|
});
|
|
3525
3850
|
}
|
|
3526
|
-
function
|
|
3851
|
+
function nr(e) {
|
|
3527
3852
|
let t = e?.parentElement;
|
|
3528
3853
|
for (; t && t !== document.body;) {
|
|
3529
3854
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3532,7 +3857,7 @@ function bn(e) {
|
|
|
3532
3857
|
}
|
|
3533
3858
|
return window;
|
|
3534
3859
|
}
|
|
3535
|
-
var
|
|
3860
|
+
var rr = (e) => e === window ? window.scrollY : e.scrollTop, ir = {
|
|
3536
3861
|
"bottom-right": (e) => ({
|
|
3537
3862
|
right: e,
|
|
3538
3863
|
bottom: e
|
|
@@ -3546,11 +3871,11 @@ var xn = (e) => e === window ? window.scrollY : e.scrollTop, Sn = {
|
|
|
3546
3871
|
bottom: e,
|
|
3547
3872
|
transform: "translateX(-50%)"
|
|
3548
3873
|
})
|
|
3549
|
-
},
|
|
3874
|
+
}, ar = {
|
|
3550
3875
|
linear: (e) => e,
|
|
3551
3876
|
out: (e) => 1 - (1 - e) ** 3,
|
|
3552
3877
|
inout: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2
|
|
3553
|
-
},
|
|
3878
|
+
}, or = (e) => {
|
|
3554
3879
|
let t = e.getBoundingClientRect(), n = e.parentElement;
|
|
3555
3880
|
for (; n && n !== document.body;) {
|
|
3556
3881
|
let e = getComputedStyle(n);
|
|
@@ -3558,12 +3883,12 @@ var xn = (e) => e === window ? window.scrollY : e.scrollTop, Sn = {
|
|
|
3558
3883
|
n = n.parentElement;
|
|
3559
3884
|
}
|
|
3560
3885
|
return !n || n === document.body ? Math.max(document.documentElement.scrollHeight - (t.bottom + window.scrollY), 0) : Math.max(n.scrollHeight - (t.bottom - n.getBoundingClientRect().top + n.scrollTop), 0);
|
|
3561
|
-
},
|
|
3886
|
+
}, sr = (e, t) => {
|
|
3562
3887
|
let n = typeof e == "number" ? e : parseFloat(e);
|
|
3563
3888
|
return Number.isFinite(n) ? n : t;
|
|
3564
3889
|
};
|
|
3565
|
-
function
|
|
3566
|
-
let i = Math.min(Math.max(Math.round(
|
|
3890
|
+
function cr(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
3891
|
+
let i = Math.min(Math.max(Math.round(sr(n, 0)), 0), 6);
|
|
3567
3892
|
try {
|
|
3568
3893
|
return new Intl.NumberFormat(t || void 0, {
|
|
3569
3894
|
minimumFractionDigits: i,
|
|
@@ -3574,8 +3899,8 @@ function En(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
|
3574
3899
|
return e.toFixed(i);
|
|
3575
3900
|
}
|
|
3576
3901
|
}
|
|
3577
|
-
function
|
|
3578
|
-
let { locale: C } = i(
|
|
3902
|
+
function lr({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suffix: u, separator: p, easing: m, trigger: h, offset: g, once: _, label: v, align: y, style: b, nodeRef: x, inert: S }) {
|
|
3903
|
+
let { locale: C } = i(Q), w = Math.max(sr(g, 0), 0), T = sr(e, 0), E = sr(t, 100), [D, O] = l(E), k = c(null), [A, j] = l(!1);
|
|
3579
3904
|
return a(() => {
|
|
3580
3905
|
let e = k.current;
|
|
3581
3906
|
if (S || !A || !e) {
|
|
@@ -3583,7 +3908,7 @@ function Dn({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suf
|
|
|
3583
3908
|
return;
|
|
3584
3909
|
}
|
|
3585
3910
|
O(T);
|
|
3586
|
-
let t = Math.max(
|
|
3911
|
+
let t = Math.max(sr(n, 2e3), 0), i = Math.max(sr(r, 0), 0), a = ar[m] || ar.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, u = () => {
|
|
3587
3912
|
if (cancelAnimationFrame(s), clearTimeout(c), o || t === 0) {
|
|
3588
3913
|
O(E);
|
|
3589
3914
|
return;
|
|
@@ -3603,7 +3928,7 @@ function Dn({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suf
|
|
|
3603
3928
|
let t = e.some((e) => e.isIntersecting);
|
|
3604
3929
|
t && (!l || _ === !1) ? (l = !0, u()) : !t && _ === !1 && (cancelAnimationFrame(s), clearTimeout(c), O(T));
|
|
3605
3930
|
}, {
|
|
3606
|
-
rootMargin: `0px 0px -${Math.min(w, Math.floor(
|
|
3931
|
+
rootMargin: `0px 0px -${Math.min(w, Math.floor(or(e)))}px 0px`,
|
|
3607
3932
|
threshold: w > 0 ? 0 : .3
|
|
3608
3933
|
});
|
|
3609
3934
|
return d.observe(e), () => {
|
|
@@ -3643,7 +3968,7 @@ function Dn({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suf
|
|
|
3643
3968
|
},
|
|
3644
3969
|
children: [
|
|
3645
3970
|
s || "",
|
|
3646
|
-
|
|
3971
|
+
cr(D, {
|
|
3647
3972
|
locale: C,
|
|
3648
3973
|
decimals: o,
|
|
3649
3974
|
separator: p
|
|
@@ -3661,7 +3986,7 @@ function Dn({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suf
|
|
|
3661
3986
|
}) : null]
|
|
3662
3987
|
});
|
|
3663
3988
|
}
|
|
3664
|
-
function
|
|
3989
|
+
function ur({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: o, bg: s, fg: c, style: u, nodeRef: p, inert: m, frame: h, builder: g }) {
|
|
3665
3990
|
let [_, v] = l(!!m), [y, b] = l(null), x = (e) => {
|
|
3666
3991
|
b(e), typeof p == "function" && p(e);
|
|
3667
3992
|
};
|
|
@@ -3672,8 +3997,8 @@ function On({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3672
3997
|
}
|
|
3673
3998
|
if (!y) return;
|
|
3674
3999
|
let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
|
|
3675
|
-
let t =
|
|
3676
|
-
v(n ||
|
|
4000
|
+
let t = nr(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
4001
|
+
v(n || rr(t) > e);
|
|
3677
4002
|
};
|
|
3678
4003
|
return t(), document.addEventListener("scroll", t, {
|
|
3679
4004
|
capture: !0,
|
|
@@ -3687,7 +4012,7 @@ function On({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3687
4012
|
]);
|
|
3688
4013
|
let S = () => {
|
|
3689
4014
|
if (m) return;
|
|
3690
|
-
let e =
|
|
4015
|
+
let e = nr(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3691
4016
|
e === window ? window.scrollTo({
|
|
3692
4017
|
top: 0,
|
|
3693
4018
|
behavior: n
|
|
@@ -3695,7 +4020,7 @@ function On({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3695
4020
|
top: 0,
|
|
3696
4021
|
behavior: n
|
|
3697
4022
|
});
|
|
3698
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
4023
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = ir[n] ? n : "bottom-right", D = h ? {
|
|
3699
4024
|
position: "fixed",
|
|
3700
4025
|
zIndex: 5,
|
|
3701
4026
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3708,7 +4033,7 @@ function On({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3708
4033
|
} : {
|
|
3709
4034
|
position: "fixed",
|
|
3710
4035
|
zIndex: 2147482e3,
|
|
3711
|
-
...
|
|
4036
|
+
...ir[E](C)
|
|
3712
4037
|
};
|
|
3713
4038
|
return /* @__PURE__ */ f("button", {
|
|
3714
4039
|
ref: x,
|
|
@@ -3759,7 +4084,7 @@ function On({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3759
4084
|
}), w ? /* @__PURE__ */ d("span", { children: T }) : null]
|
|
3760
4085
|
});
|
|
3761
4086
|
}
|
|
3762
|
-
var
|
|
4087
|
+
var dr = {
|
|
3763
4088
|
facebook: {
|
|
3764
4089
|
label: "Facebook",
|
|
3765
4090
|
color: "#1877f2",
|
|
@@ -3826,8 +4151,8 @@ var kn = {
|
|
|
3826
4151
|
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"
|
|
3827
4152
|
}
|
|
3828
4153
|
};
|
|
3829
|
-
function
|
|
3830
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
4154
|
+
function fr({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
4155
|
+
let l = Array.isArray(e) ? e.filter((e) => e && dr[e.network]) : [];
|
|
3831
4156
|
if (!l.length) return null;
|
|
3832
4157
|
let u = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(u * 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;
|
|
3833
4158
|
return /* @__PURE__ */ d("div", {
|
|
@@ -3840,7 +4165,7 @@ function An({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3840
4165
|
...P(o)
|
|
3841
4166
|
},
|
|
3842
4167
|
children: l.map((e, r) => {
|
|
3843
|
-
let i =
|
|
4168
|
+
let i = dr[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);
|
|
3844
4169
|
return /* @__PURE__ */ d("a", {
|
|
3845
4170
|
href: e.url || "#",
|
|
3846
4171
|
onClick: h,
|
|
@@ -3874,7 +4199,7 @@ function An({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3874
4199
|
})
|
|
3875
4200
|
});
|
|
3876
4201
|
}
|
|
3877
|
-
function
|
|
4202
|
+
function pr({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3878
4203
|
if (!e.length) return null;
|
|
3879
4204
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
3880
4205
|
width: 32,
|
|
@@ -3952,7 +4277,7 @@ function jn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3952
4277
|
})
|
|
3953
4278
|
});
|
|
3954
4279
|
}
|
|
3955
|
-
var
|
|
4280
|
+
var mr = {
|
|
3956
4281
|
small: {
|
|
3957
4282
|
w: 132,
|
|
3958
4283
|
h: 46,
|
|
@@ -3974,21 +4299,21 @@ var Mn = {
|
|
|
3974
4299
|
title: 12.5,
|
|
3975
4300
|
avatar: 46
|
|
3976
4301
|
}
|
|
3977
|
-
},
|
|
3978
|
-
|
|
3979
|
-
var
|
|
4302
|
+
}, hr = (e) => mr[e] ?? mr.medium;
|
|
4303
|
+
mr.medium.w, mr.medium.h;
|
|
4304
|
+
var gr = (e) => String(e?.group ?? "").trim(), _r = (e) => {
|
|
3980
4305
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
3981
4306
|
return e.forEach((e, r) => {
|
|
3982
|
-
let i =
|
|
4307
|
+
let i = gr(e) || `#${r}`;
|
|
3983
4308
|
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
3984
4309
|
}), t.flatMap((e) => n.get(e));
|
|
3985
4310
|
};
|
|
3986
|
-
function
|
|
3987
|
-
let i =
|
|
4311
|
+
function vr(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
4312
|
+
let i = hr(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 = [];
|
|
3988
4313
|
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);
|
|
3989
|
-
d =
|
|
3990
|
-
for (let [e, t] of u) u.set(e,
|
|
3991
|
-
let f = (e, t) => o + (
|
|
4314
|
+
d = _r(d);
|
|
4315
|
+
for (let [e, t] of u) u.set(e, _r(t));
|
|
4316
|
+
let f = (e, t) => o + (gr(e) !== gr(t) && (gr(e) || gr(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
3992
4317
|
if (t.has(e.id)) return 0;
|
|
3993
4318
|
t.add(e.id);
|
|
3994
4319
|
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);
|
|
@@ -4004,7 +4329,7 @@ function In(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
4004
4329
|
x: m,
|
|
4005
4330
|
y: b
|
|
4006
4331
|
});
|
|
4007
|
-
let x =
|
|
4332
|
+
let x = gr(e);
|
|
4008
4333
|
if (x) {
|
|
4009
4334
|
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
4010
4335
|
_.has(t) || _.set(t, {
|
|
@@ -4078,19 +4403,19 @@ function In(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
4078
4403
|
horizontal: n
|
|
4079
4404
|
};
|
|
4080
4405
|
}
|
|
4081
|
-
var
|
|
4406
|
+
var yr = (e, t) => {
|
|
4082
4407
|
let n = String(e ?? "");
|
|
4083
4408
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
4084
|
-
},
|
|
4409
|
+
}, br = (e) => {
|
|
4085
4410
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
4086
4411
|
if (!t) return "#ffffff";
|
|
4087
4412
|
let n = t[1];
|
|
4088
4413
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
4089
4414
|
let r = parseInt(n, 16);
|
|
4090
4415
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
4091
|
-
},
|
|
4092
|
-
function
|
|
4093
|
-
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 ? "" :
|
|
4416
|
+
}, xr = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
4417
|
+
function Sr(e, t = {}) {
|
|
4418
|
+
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 ? "" : ot(e);
|
|
4094
4419
|
return n.map((e) => {
|
|
4095
4420
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
4096
4421
|
return {
|
|
@@ -4105,11 +4430,11 @@ function Bn(e, t = {}) {
|
|
|
4105
4430
|
};
|
|
4106
4431
|
});
|
|
4107
4432
|
}
|
|
4108
|
-
var
|
|
4433
|
+
var Cr = {
|
|
4109
4434
|
size: 36,
|
|
4110
4435
|
pad: 10
|
|
4111
4436
|
};
|
|
4112
|
-
function
|
|
4437
|
+
function wr({ node: e, onClose: t }) {
|
|
4113
4438
|
return a(() => {
|
|
4114
4439
|
let e = (e) => e.key === "Escape" && t();
|
|
4115
4440
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -4230,8 +4555,8 @@ function Hn({ node: e, onClose: t }) {
|
|
|
4230
4555
|
})
|
|
4231
4556
|
});
|
|
4232
4557
|
}
|
|
4233
|
-
function
|
|
4234
|
-
let C = o(), [w, T] = l(null), { tenant: E, apiUrl: D } = i(
|
|
4558
|
+
function Tr({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
|
|
4559
|
+
let C = o(), [w, T] = l(null), { tenant: E, apiUrl: D } = i(Q), O = i(Qe)?.[t], [k, A] = l(null);
|
|
4235
4560
|
a(() => {
|
|
4236
4561
|
if (!t || O) return;
|
|
4237
4562
|
let e = !0;
|
|
@@ -4247,7 +4572,7 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4247
4572
|
D,
|
|
4248
4573
|
O
|
|
4249
4574
|
]);
|
|
4250
|
-
let j = t ?
|
|
4575
|
+
let j = t ? Sr(O ?? k ?? [], {
|
|
4251
4576
|
nameField: n,
|
|
4252
4577
|
titleField: r,
|
|
4253
4578
|
photoField: s,
|
|
@@ -4255,7 +4580,7 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4255
4580
|
cvField: p,
|
|
4256
4581
|
hrefField: m,
|
|
4257
4582
|
groupField: h
|
|
4258
|
-
}) : e, M =
|
|
4583
|
+
}) : e, M = hr(v), { boxes: N, links: F, groups: I, width: L, height: R } = vr(j, {
|
|
4259
4584
|
size: v,
|
|
4260
4585
|
horizontal: y,
|
|
4261
4586
|
groupTitles: g
|
|
@@ -4313,8 +4638,8 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4313
4638
|
fontSize: M.title + 1,
|
|
4314
4639
|
fontWeight: "600",
|
|
4315
4640
|
opacity: "0.55",
|
|
4316
|
-
fill: r ?
|
|
4317
|
-
children:
|
|
4641
|
+
fill: r ? br(e.color || _) : "var(--page-text, #111827)",
|
|
4642
|
+
children: yr(e.title, Math.floor(e.width / 7))
|
|
4318
4643
|
})] }, `group-${t}`);
|
|
4319
4644
|
}),
|
|
4320
4645
|
F.map((e, t) => /* @__PURE__ */ d("path", {
|
|
@@ -4324,7 +4649,7 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4324
4649
|
strokeWidth: "1.5"
|
|
4325
4650
|
}, t)),
|
|
4326
4651
|
N.map(({ node: e, x: t, y: n }) => {
|
|
4327
|
-
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 ?
|
|
4652
|
+
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 ? br(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? br(e.color2) : s, l = S && (xr(e) || e.href), p = () => xr(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Cr.pad + M.avatar + 8 : t + M.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((M.w - M.avatar - 26) / 7) : Math.floor(M.w / 7.6), _ = M.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
4328
4653
|
return /* @__PURE__ */ f("g", {
|
|
4329
4654
|
onClick: l ? p : void 0,
|
|
4330
4655
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -4388,13 +4713,13 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4388
4713
|
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
4389
4714
|
id: `${C}-${e.id}`,
|
|
4390
4715
|
children: /* @__PURE__ */ d("circle", {
|
|
4391
|
-
cx: t +
|
|
4716
|
+
cx: t + Cr.pad + M.avatar / 2,
|
|
4392
4717
|
cy: n + M.h / 2,
|
|
4393
4718
|
r: M.avatar / 2
|
|
4394
4719
|
})
|
|
4395
4720
|
}), /* @__PURE__ */ d("image", {
|
|
4396
4721
|
href: e.photo,
|
|
4397
|
-
x: t +
|
|
4722
|
+
x: t + Cr.pad,
|
|
4398
4723
|
y: n + (M.h - M.avatar) / 2,
|
|
4399
4724
|
width: M.avatar,
|
|
4400
4725
|
height: M.avatar,
|
|
@@ -4408,7 +4733,7 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4408
4733
|
fontSize: M.title,
|
|
4409
4734
|
fontWeight: "600",
|
|
4410
4735
|
fill: s,
|
|
4411
|
-
children:
|
|
4736
|
+
children: yr(e.title, g + 4)
|
|
4412
4737
|
}), e.name && /* @__PURE__ */ d("text", {
|
|
4413
4738
|
x: m,
|
|
4414
4739
|
y: n + _ + _ / 2 + M.name * .35,
|
|
@@ -4416,7 +4741,7 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4416
4741
|
fontSize: M.name,
|
|
4417
4742
|
fontWeight: "600",
|
|
4418
4743
|
fill: c,
|
|
4419
|
-
children:
|
|
4744
|
+
children: yr(e.name, g)
|
|
4420
4745
|
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
4421
4746
|
x: m,
|
|
4422
4747
|
y: n + (v[1] ? M.h * .43 : M.h * .57),
|
|
@@ -4424,7 +4749,7 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4424
4749
|
fontSize: M.name,
|
|
4425
4750
|
fontWeight: "600",
|
|
4426
4751
|
fill: s,
|
|
4427
|
-
children:
|
|
4752
|
+
children: yr(v[0], g)
|
|
4428
4753
|
}), v[1] && /* @__PURE__ */ d("text", {
|
|
4429
4754
|
x: m,
|
|
4430
4755
|
y: n + M.h * .73,
|
|
@@ -4432,19 +4757,19 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4432
4757
|
fontSize: M.title,
|
|
4433
4758
|
opacity: "0.7",
|
|
4434
4759
|
fill: s,
|
|
4435
|
-
children:
|
|
4760
|
+
children: yr(v[1], g + 4)
|
|
4436
4761
|
})] })
|
|
4437
4762
|
]
|
|
4438
4763
|
}, e.id);
|
|
4439
4764
|
})
|
|
4440
4765
|
]
|
|
4441
|
-
}), w && /* @__PURE__ */ d(
|
|
4766
|
+
}), w && /* @__PURE__ */ d(wr, {
|
|
4442
4767
|
node: w,
|
|
4443
4768
|
onClose: () => T(null)
|
|
4444
4769
|
})]
|
|
4445
4770
|
});
|
|
4446
4771
|
}
|
|
4447
|
-
function
|
|
4772
|
+
function Er({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4448
4773
|
let [i, o] = l(!1), s = c(null);
|
|
4449
4774
|
return a(() => {
|
|
4450
4775
|
if (!i || !s.current) return;
|
|
@@ -4474,7 +4799,7 @@ function Wn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4474
4799
|
children: e ?? ""
|
|
4475
4800
|
});
|
|
4476
4801
|
}
|
|
4477
|
-
var
|
|
4802
|
+
var Dr = 360, Or = "\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", kr = (e, t) => e && t ? `cell-${e}-${t}` : "", Ar = (e) => {
|
|
4478
4803
|
if (!e || typeof e != "object") return e ?? "";
|
|
4479
4804
|
let t = String(e.text ?? "");
|
|
4480
4805
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ d("a", {
|
|
@@ -4485,7 +4810,7 @@ var Gn = 360, Kn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4485
4810
|
children: t
|
|
4486
4811
|
}) : t;
|
|
4487
4812
|
};
|
|
4488
|
-
function
|
|
4813
|
+
function jr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: o = [], heights: s = [], 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: A, style: j, nodeRef: M, edit: N }) {
|
|
4489
4814
|
let F = c(null), I = c(null), [L, R] = l(null), [z, B] = l(null), V = (e, t) => () => R({
|
|
4490
4815
|
r: e,
|
|
4491
4816
|
c: t
|
|
@@ -4499,7 +4824,7 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4499
4824
|
}
|
|
4500
4825
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4501
4826
|
top: r.bottom - n.top + 4,
|
|
4502
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
4827
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - Dr))
|
|
4503
4828
|
};
|
|
4504
4829
|
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4505
4830
|
}), a(() => {
|
|
@@ -4509,14 +4834,14 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4509
4834
|
};
|
|
4510
4835
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4511
4836
|
}, [N, L]);
|
|
4512
|
-
let { tenant: H, apiUrl: U } = i(
|
|
4837
|
+
let { tenant: H, apiUrl: U } = i(Q), ee = i(Qe), W = ee?.[h], te = C ? $e(ee) : 1, [ne, G] = l(null);
|
|
4513
4838
|
if (a(() => {
|
|
4514
4839
|
if (!h || W) return;
|
|
4515
4840
|
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}`;
|
|
4516
4841
|
return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
|
|
4517
4842
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4518
|
-
return e &&
|
|
4519
|
-
}).catch(() => e &&
|
|
4843
|
+
return e && G(n);
|
|
4844
|
+
}).catch(() => e && G([])), () => {
|
|
4520
4845
|
e = !1;
|
|
4521
4846
|
};
|
|
4522
4847
|
}, [
|
|
@@ -4528,13 +4853,13 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4528
4853
|
te,
|
|
4529
4854
|
g
|
|
4530
4855
|
]), !e.length) return null;
|
|
4531
|
-
let
|
|
4856
|
+
let K = Math.max(1, Number(g) || 10), re = h ? C ? W || h.startsWith("api:") ? (W ?? ne ?? []).slice((te - 1) * K, te * K) : (ne ?? []).slice(0, K) : (W ?? ne ?? []).slice(0, K) : null, q = re ? re.map((t) => e.map((e) => ot(it(t?.data, e.field)))) : t, ie = !!h && !(h && !W && ne === null) && q.length === 0, ae = b ? {
|
|
4532
4857
|
y: 6,
|
|
4533
4858
|
x: 10
|
|
4534
4859
|
} : {
|
|
4535
4860
|
y: 10,
|
|
4536
4861
|
x: 14
|
|
4537
|
-
},
|
|
4862
|
+
}, J = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : ae.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : ae.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 = [
|
|
4538
4863
|
"left",
|
|
4539
4864
|
"center",
|
|
4540
4865
|
"right"
|
|
@@ -4546,7 +4871,7 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4546
4871
|
r.preventDefault(), r.stopPropagation();
|
|
4547
4872
|
let i = F.current, a = i ? i.clientWidth : 0;
|
|
4548
4873
|
if (!a) return;
|
|
4549
|
-
let o =
|
|
4874
|
+
let o = ce ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4550
4875
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4551
4876
|
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, N.resize(i);
|
|
4552
4877
|
}, u = () => {
|
|
@@ -4554,8 +4879,8 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4554
4879
|
};
|
|
4555
4880
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4556
4881
|
}, ye = /* @__PURE__ */ new Set();
|
|
4557
|
-
p &&
|
|
4558
|
-
let i = p[
|
|
4882
|
+
p && q.forEach((t, n) => e.forEach((e, t) => {
|
|
4883
|
+
let i = p[kr(r[n], o[t])];
|
|
4559
4884
|
if (!i) return;
|
|
4560
4885
|
let a = Math.max(1, Number(i.c) || 1), s = Math.max(1, Number(i.r) || 1);
|
|
4561
4886
|
for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) && ye.add(`${n + e},${t + r}`);
|
|
@@ -4569,7 +4894,7 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4569
4894
|
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4570
4895
|
};
|
|
4571
4896
|
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4572
|
-
},
|
|
4897
|
+
}, Y = (e, t, n, r) => r ? null : /* @__PURE__ */ d("span", {
|
|
4573
4898
|
className: "wb-tedit-btn",
|
|
4574
4899
|
role: "button",
|
|
4575
4900
|
"data-hint": t,
|
|
@@ -4578,7 +4903,7 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4578
4903
|
},
|
|
4579
4904
|
onClick: n,
|
|
4580
4905
|
children: e
|
|
4581
|
-
}, t),
|
|
4906
|
+
}, t), X = L && L.r < q.length && L.c < e.length ? L : null, Z = (e, t) => N?.labels?.[e] ?? t, xe = X ? p?.[kr(r[X.r], o[X.c])] : null, Se = Math.max(1, Number(xe?.c) || 1), Ce = Math.max(1, Number(xe?.r) || 1);
|
|
4582
4907
|
return /* @__PURE__ */ f("div", {
|
|
4583
4908
|
ref: (e) => {
|
|
4584
4909
|
I.current = e, typeof M == "function" && M(e);
|
|
@@ -4589,8 +4914,8 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4589
4914
|
...ge
|
|
4590
4915
|
},
|
|
4591
4916
|
children: [
|
|
4592
|
-
N && /* @__PURE__ */ d("style", { children:
|
|
4593
|
-
N &&
|
|
4917
|
+
N && /* @__PURE__ */ d("style", { children: Or }),
|
|
4918
|
+
N && X && z && /* @__PURE__ */ f("div", {
|
|
4594
4919
|
className: "wb-tedit-bar",
|
|
4595
4920
|
style: {
|
|
4596
4921
|
top: z.top,
|
|
@@ -4600,23 +4925,23 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4600
4925
|
children: [
|
|
4601
4926
|
/* @__PURE__ */ d("span", {
|
|
4602
4927
|
className: "wb-tedit-at",
|
|
4603
|
-
children: `R${
|
|
4928
|
+
children: `R${X.r + 1}·C${X.c + 1}`
|
|
4604
4929
|
}),
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4930
|
+
Y("+↑", Z("rowAbove", "Insert row above"), () => N.addRow(X.r - 1)),
|
|
4931
|
+
Y("+↓", Z("rowBelow", "Insert row below"), () => N.addRow(X.r)),
|
|
4932
|
+
Y("↑", Z("rowUp", "Move row up"), () => N.moveRow(X.r, -1), X.r === 0),
|
|
4933
|
+
Y("↓", Z("rowDown", "Move row down"), () => N.moveRow(X.r, 1), X.r >= q.length - 1),
|
|
4934
|
+
Y("✕ row", Z("rowDelete", "Delete row"), () => N.dropRow(X.r), q.length <= 1),
|
|
4610
4935
|
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4936
|
+
Y("+←", Z("colLeft", "Insert column left"), () => N.addColumn(X.c - 1)),
|
|
4937
|
+
Y("+→", Z("colRight", "Insert column right"), () => N.addColumn(X.c)),
|
|
4938
|
+
Y("←", Z("colMoveLeft", "Move column left"), () => N.moveColumn(X.c, -1), X.c === 0),
|
|
4939
|
+
Y("→", Z("colMoveRight", "Move column right"), () => N.moveColumn(X.c, 1), X.c >= e.length - 1),
|
|
4940
|
+
Y("✕ col", Z("colDelete", "Delete column"), () => N.dropColumn(X.c), e.length <= 1),
|
|
4616
4941
|
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4942
|
+
Y("↔", Z("mergeRight", "Merge with the cell on the right"), () => N.merge(X.r, X.c, "right"), X.c + Se >= e.length),
|
|
4943
|
+
Y("↕", Z("mergeDown", "Merge with the cell below"), () => N.merge(X.r, X.c, "down"), X.r + Ce >= q.length),
|
|
4944
|
+
Y("⤫", Z("split", "Split this cell"), () => N.split(X.r, X.c), Se === 1 && Ce === 1)
|
|
4620
4945
|
]
|
|
4621
4946
|
}),
|
|
4622
4947
|
/* @__PURE__ */ d("div", {
|
|
@@ -4635,17 +4960,17 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4635
4960
|
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
4636
4961
|
borderSpacing: 0,
|
|
4637
4962
|
fontSize: 14,
|
|
4638
|
-
...
|
|
4639
|
-
...y ? { border:
|
|
4963
|
+
...ce ? { tableLayout: "fixed" } : null,
|
|
4964
|
+
...y ? { border: oe } : {}
|
|
4640
4965
|
},
|
|
4641
4966
|
children: [
|
|
4642
|
-
|
|
4967
|
+
ce && /* @__PURE__ */ d("colgroup", { children: n.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
|
|
4643
4968
|
_ === !1 ? null : /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((t, n) => /* @__PURE__ */ d("th", {
|
|
4644
4969
|
className: N ? "wb-tedit-head" : void 0,
|
|
4645
4970
|
style: {
|
|
4646
4971
|
textAlign: de(n),
|
|
4647
4972
|
fontWeight: 600,
|
|
4648
|
-
padding:
|
|
4973
|
+
padding: J,
|
|
4649
4974
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4650
4975
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4651
4976
|
...T ? {
|
|
@@ -4653,29 +4978,29 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4653
4978
|
top: 0,
|
|
4654
4979
|
zIndex: 2
|
|
4655
4980
|
} : N ? { position: "relative" } : null,
|
|
4656
|
-
...
|
|
4981
|
+
...se
|
|
4657
4982
|
},
|
|
4658
|
-
children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(
|
|
4983
|
+
children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(Er, {
|
|
4659
4984
|
value: t.label ?? t,
|
|
4660
4985
|
onCommit: (e) => N.header(n, e),
|
|
4661
|
-
hint:
|
|
4986
|
+
hint: Z("editCell", "Double-click to edit"),
|
|
4662
4987
|
style: { paddingRight: 6 }
|
|
4663
4988
|
}), n < e.length - 1 && /* @__PURE__ */ d("span", {
|
|
4664
4989
|
className: "wb-tedit-grip",
|
|
4665
|
-
title:
|
|
4990
|
+
title: Z("colWidth", "Drag to resize the column"),
|
|
4666
4991
|
onPointerDown: ve(n)
|
|
4667
4992
|
})] }) : t.label ?? t
|
|
4668
4993
|
}, n)) }) }),
|
|
4669
|
-
/* @__PURE__ */ f("tbody", { children: [
|
|
4994
|
+
/* @__PURE__ */ f("tbody", { children: [ie && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
4670
4995
|
colSpan: e.length,
|
|
4671
4996
|
style: {
|
|
4672
|
-
padding:
|
|
4997
|
+
padding: J,
|
|
4673
4998
|
textAlign: "center",
|
|
4674
4999
|
opacity: .6,
|
|
4675
|
-
...
|
|
5000
|
+
...se
|
|
4676
5001
|
},
|
|
4677
5002
|
children: w || "No data yet"
|
|
4678
|
-
}) }),
|
|
5003
|
+
}) }), q.map((t, n) => /* @__PURE__ */ d("tr", {
|
|
4679
5004
|
className: N ? "wb-tedit-row" : void 0,
|
|
4680
5005
|
style: {
|
|
4681
5006
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
@@ -4683,7 +5008,7 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4683
5008
|
},
|
|
4684
5009
|
children: e.map((e, i) => {
|
|
4685
5010
|
if (ye.has(`${n},${i}`)) return null;
|
|
4686
|
-
let a =
|
|
5011
|
+
let a = kr(r[n], o[i]), s = m?.[a], c = p?.[a], l = Math.max(1, Number(c?.c) || 1), u = Math.max(1, Number(c?.r) || 1);
|
|
4687
5012
|
return /* @__PURE__ */ f("td", {
|
|
4688
5013
|
className: N ? `wb-tedit-cell${L?.r === n && L?.c === i ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4689
5014
|
onMouseDownCapture: _e ? V(n, i) : void 0,
|
|
@@ -4691,14 +5016,14 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4691
5016
|
colSpan: l > 1 ? l : void 0,
|
|
4692
5017
|
rowSpan: u > 1 ? u : void 0,
|
|
4693
5018
|
style: {
|
|
4694
|
-
padding:
|
|
5019
|
+
padding: J,
|
|
4695
5020
|
...ue(i) ? { textAlign: ue(i) } : null,
|
|
4696
5021
|
...N ? { position: "relative" } : null,
|
|
4697
|
-
...
|
|
5022
|
+
...se
|
|
4698
5023
|
},
|
|
4699
|
-
children: [s ??
|
|
5024
|
+
children: [s ?? Ar(t?.[i]), N && _e && /* @__PURE__ */ d("span", {
|
|
4700
5025
|
className: "wb-tedit-rowgrip",
|
|
4701
|
-
title:
|
|
5026
|
+
title: Z("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4702
5027
|
onPointerDown: be(n),
|
|
4703
5028
|
onDoubleClick: () => N.resizeRow(n, 0)
|
|
4704
5029
|
})]
|
|
@@ -4711,7 +5036,7 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4711
5036
|
]
|
|
4712
5037
|
});
|
|
4713
5038
|
}
|
|
4714
|
-
var
|
|
5039
|
+
var Mr = {
|
|
4715
5040
|
small: {
|
|
4716
5041
|
cell: 62,
|
|
4717
5042
|
font: 10.5,
|
|
@@ -4736,9 +5061,9 @@ var Xn = {
|
|
|
4736
5061
|
pad: 8,
|
|
4737
5062
|
gap: 4
|
|
4738
5063
|
}
|
|
4739
|
-
},
|
|
4740
|
-
function
|
|
4741
|
-
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 ? "" :
|
|
5064
|
+
}, Nr = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Pr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Fr = 366;
|
|
5065
|
+
function Ir(e, t = {}) {
|
|
5066
|
+
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 ? "" : ot(e), a = (e) => {
|
|
4742
5067
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4743
5068
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4744
5069
|
};
|
|
@@ -4754,7 +5079,7 @@ function er(e, t = {}) {
|
|
|
4754
5079
|
} : null;
|
|
4755
5080
|
}).filter(Boolean);
|
|
4756
5081
|
}
|
|
4757
|
-
function
|
|
5082
|
+
function Lr(e) {
|
|
4758
5083
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4759
5084
|
let n = e?.start ? new Date(e.start) : null;
|
|
4760
5085
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4769,20 +5094,20 @@ function tr(e) {
|
|
|
4769
5094
|
};
|
|
4770
5095
|
}).filter(Boolean);
|
|
4771
5096
|
}
|
|
4772
|
-
function
|
|
5097
|
+
function Rr(e) {
|
|
4773
5098
|
let t = /* @__PURE__ */ new Map();
|
|
4774
5099
|
for (let n of e) {
|
|
4775
|
-
let e =
|
|
5100
|
+
let e = Pr(n.start), r = n.end ? Pr(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Fr);
|
|
4776
5101
|
for (let r = 0; r <= i; r += 1) {
|
|
4777
|
-
let i =
|
|
5102
|
+
let i = Nr(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4778
5103
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4779
5104
|
}
|
|
4780
5105
|
}
|
|
4781
5106
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4782
5107
|
return t;
|
|
4783
5108
|
}
|
|
4784
|
-
function
|
|
4785
|
-
let { tenant: T, apiUrl: E, locale: D } = i(
|
|
5109
|
+
function zr({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: o = "", hrefField: s = "", colorField: c = "", 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 }) {
|
|
5110
|
+
let { tenant: T, apiUrl: E, locale: D } = i(Q), O = i(Qe)?.[t], [k, A] = l(null), [j, M] = l(() => {
|
|
4786
5111
|
let e = /* @__PURE__ */ new Date();
|
|
4787
5112
|
return {
|
|
4788
5113
|
year: e.getFullYear(),
|
|
@@ -4804,13 +5129,13 @@ function rr({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4804
5129
|
E,
|
|
4805
5130
|
O
|
|
4806
5131
|
]);
|
|
4807
|
-
let N =
|
|
5132
|
+
let N = Mr[m] ?? Mr.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 ? Ir(O ?? k ?? [], {
|
|
4808
5133
|
titleField: n,
|
|
4809
5134
|
startField: r,
|
|
4810
5135
|
endField: o,
|
|
4811
5136
|
hrefField: s,
|
|
4812
5137
|
colorField: c
|
|
4813
|
-
}) :
|
|
5138
|
+
}) : Lr(e), B = Rr(z), V = D || void 0, H = (e, t) => {
|
|
4814
5139
|
let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
|
|
4815
5140
|
width: 6,
|
|
4816
5141
|
height: 6,
|
|
@@ -4942,10 +5267,10 @@ function rr({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4942
5267
|
})]
|
|
4943
5268
|
});
|
|
4944
5269
|
}
|
|
4945
|
-
let ne = new Date(j.year, j.month, 1),
|
|
4946
|
-
for (let e = 0; e <
|
|
4947
|
-
let t = e -
|
|
4948
|
-
|
|
5270
|
+
let ne = new Date(j.year, j.month, 1), G = y === "sunday" ? 0 : 1, K = (ne.getDay() - G + 7) % 7, re = new Date(j.year, j.month + 1, 0).getDate(), q = Math.ceil((K + re) / 7), ie = Nr(/* @__PURE__ */ new Date()), ae = new Intl.DateTimeFormat(V, { weekday: "short" }), J = [];
|
|
5271
|
+
for (let e = 0; e < q * 7; e += 1) {
|
|
5272
|
+
let t = e - K + 1, n = t >= 1 && t <= re, r = Nr(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
|
|
5273
|
+
J.push(/* @__PURE__ */ f("div", {
|
|
4949
5274
|
style: {
|
|
4950
5275
|
minHeight: N.cell,
|
|
4951
5276
|
borderTop: `1px solid ${I}`,
|
|
@@ -5002,31 +5327,31 @@ function rr({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
5002
5327
|
textAlign: "center",
|
|
5003
5328
|
padding: `0 0 ${N.pad}px`
|
|
5004
5329
|
},
|
|
5005
|
-
children:
|
|
5006
|
-
}, `head-${t}`)),
|
|
5330
|
+
children: ae.format(new Date(2024, 0, 7 + G + t))
|
|
5331
|
+
}, `head-${t}`)), J]
|
|
5007
5332
|
}),
|
|
5008
5333
|
/* @__PURE__ */ d("div", { style: { borderTop: `1px solid ${I}` } })
|
|
5009
5334
|
]
|
|
5010
5335
|
});
|
|
5011
5336
|
}
|
|
5012
|
-
var
|
|
5337
|
+
var Br = {
|
|
5013
5338
|
small: 36,
|
|
5014
5339
|
medium: 56,
|
|
5015
5340
|
large: 88
|
|
5016
5341
|
};
|
|
5017
|
-
function
|
|
5018
|
-
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" :
|
|
5342
|
+
function Vr(e, t = {}) {
|
|
5343
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : ot(e);
|
|
5019
5344
|
return n.map((e) => {
|
|
5020
|
-
let n = e.data ?? e, i =
|
|
5345
|
+
let n = e.data ?? e, i = it(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(it(n, t.nameField)) : r(n.name);
|
|
5021
5346
|
return {
|
|
5022
5347
|
src: typeof o == "string" ? o.trim() : "",
|
|
5023
5348
|
alt: s,
|
|
5024
|
-
href: t.hrefField ? r(
|
|
5349
|
+
href: t.hrefField ? r(it(n, t.hrefField)) : ""
|
|
5025
5350
|
};
|
|
5026
5351
|
}).filter((e) => e.src);
|
|
5027
5352
|
}
|
|
5028
|
-
function
|
|
5029
|
-
let { tenant: D, apiUrl: O } = i(
|
|
5353
|
+
function Hr({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: o = "", variant: s = "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 }) {
|
|
5354
|
+
let { tenant: D, apiUrl: O } = i(Q), k = i(Qe)?.[t], [A, j] = l(null), M = c(null), N = c(null), [F, I] = l(0), [L, R] = l(0), [z, B] = l(0), [V, H] = l(!0), [U, ee] = l(!1), [W, te] = l(!1);
|
|
5030
5355
|
a(() => {
|
|
5031
5356
|
if (!t || k) return;
|
|
5032
5357
|
let e = !0;
|
|
@@ -5056,7 +5381,7 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5056
5381
|
let e = M.current;
|
|
5057
5382
|
if (!e) return;
|
|
5058
5383
|
let t = !0, n = () => {
|
|
5059
|
-
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight *
|
|
5384
|
+
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * K);
|
|
5060
5385
|
t && n.length && R(Math.ceil(Math.max(...n)));
|
|
5061
5386
|
};
|
|
5062
5387
|
n();
|
|
@@ -5065,12 +5390,12 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5065
5390
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
5066
5391
|
};
|
|
5067
5392
|
});
|
|
5068
|
-
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [],
|
|
5393
|
+
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], G = t ? Vr(k ?? A ?? [], {
|
|
5069
5394
|
imageField: n,
|
|
5070
5395
|
nameField: r,
|
|
5071
5396
|
hrefField: o
|
|
5072
|
-
}) : ne,
|
|
5073
|
-
if (!
|
|
5397
|
+
}) : ne, K = Br[p] ?? Br.medium, re = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, q = s === "marquee" ? "step" : s, ie = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), ae = Math.min(3e3, Math.max(100, Number(_) || 500)), J = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || K * 3) + re, ce = F ? Math.max(1, Math.floor(F / se)) : J, le = Math.min(J, ce), ue = F ? Math.min(se, F / le) : se;
|
|
5398
|
+
if (!G.length) return /* @__PURE__ */ d("div", {
|
|
5074
5399
|
ref: T,
|
|
5075
5400
|
style: {
|
|
5076
5401
|
width: "100%",
|
|
@@ -5082,7 +5407,7 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5082
5407
|
alignItems: "center",
|
|
5083
5408
|
justifyContent: "center",
|
|
5084
5409
|
flexWrap: "wrap",
|
|
5085
|
-
gap:
|
|
5410
|
+
gap: re
|
|
5086
5411
|
},
|
|
5087
5412
|
children: [
|
|
5088
5413
|
0,
|
|
@@ -5092,16 +5417,16 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5092
5417
|
4
|
|
5093
5418
|
].map((e) => /* @__PURE__ */ d("div", {
|
|
5094
5419
|
style: {
|
|
5095
|
-
height:
|
|
5096
|
-
width:
|
|
5420
|
+
height: K,
|
|
5421
|
+
width: K * 3,
|
|
5097
5422
|
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
5098
5423
|
borderRadius: 6,
|
|
5099
5424
|
display: "flex",
|
|
5100
5425
|
alignItems: "center",
|
|
5101
5426
|
justifyContent: "center",
|
|
5102
|
-
fontSize: Math.max(10, Math.round(
|
|
5427
|
+
fontSize: Math.max(10, Math.round(K / 4)),
|
|
5103
5428
|
opacity: .45,
|
|
5104
|
-
...
|
|
5429
|
+
...oe
|
|
5105
5430
|
},
|
|
5106
5431
|
children: "LOGO"
|
|
5107
5432
|
}, e))
|
|
@@ -5115,12 +5440,12 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5115
5440
|
children: C
|
|
5116
5441
|
}) : null
|
|
5117
5442
|
});
|
|
5118
|
-
let de =
|
|
5443
|
+
let de = G.length, fe = q === "step" && de > le, pe = q === "slider", me = fe && !E && !U && !W, he = v === "right", ge = he ? de : 0, _e = fe ? [...G, ...G] : G, ve = fe ? z * ue : 0, ye = (e, t, n) => {
|
|
5119
5444
|
let r = /* @__PURE__ */ d("img", {
|
|
5120
5445
|
src: e.src,
|
|
5121
5446
|
alt: e.alt ?? "",
|
|
5122
5447
|
style: {
|
|
5123
|
-
height:
|
|
5448
|
+
height: K,
|
|
5124
5449
|
width: "auto",
|
|
5125
5450
|
maxWidth: "100%",
|
|
5126
5451
|
objectFit: "contain",
|
|
@@ -5129,7 +5454,7 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5129
5454
|
}), i = fe ? {
|
|
5130
5455
|
width: ue,
|
|
5131
5456
|
flex: "0 0 auto",
|
|
5132
|
-
padding: `0 ${
|
|
5457
|
+
padding: `0 ${re / 2}px`,
|
|
5133
5458
|
justifyContent: "center"
|
|
5134
5459
|
} : {};
|
|
5135
5460
|
return e.href && !E ? /* @__PURE__ */ d("a", {
|
|
@@ -5161,20 +5486,20 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5161
5486
|
...fe ? {
|
|
5162
5487
|
width: _e.length * ue,
|
|
5163
5488
|
transform: `translateX(-${ve}px)`,
|
|
5164
|
-
transition: V ? `transform ${
|
|
5489
|
+
transition: V ? `transform ${ae}ms ease` : "none"
|
|
5165
5490
|
} : pe ? {
|
|
5166
|
-
gap:
|
|
5491
|
+
gap: re,
|
|
5167
5492
|
overflowX: "auto",
|
|
5168
5493
|
scrollBehavior: "smooth",
|
|
5169
5494
|
scrollSnapType: "x proximity"
|
|
5170
5495
|
} : {
|
|
5171
|
-
gap:
|
|
5496
|
+
gap: re,
|
|
5172
5497
|
flexWrap: "wrap",
|
|
5173
5498
|
justifyContent: "center"
|
|
5174
5499
|
}
|
|
5175
5500
|
},
|
|
5176
5501
|
children: _e.map((e, t) => ye(e, t, fe && t >= de))
|
|
5177
|
-
}),
|
|
5502
|
+
}), Y = (e) => {
|
|
5178
5503
|
if (pe) {
|
|
5179
5504
|
let t = M.current;
|
|
5180
5505
|
t && t.scrollBy({
|
|
@@ -5192,10 +5517,10 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5192
5517
|
H(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
5193
5518
|
H(!0), B(n + e);
|
|
5194
5519
|
}));
|
|
5195
|
-
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Z = X !== "off" && (pe ? F > 0 : fe),
|
|
5520
|
+
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Z = X !== "off" && (pe ? F > 0 : fe), xe = (e) => /* @__PURE__ */ d("button", {
|
|
5196
5521
|
type: "button",
|
|
5197
5522
|
"aria-label": e < 0 ? "Previous logos" : "Next logos",
|
|
5198
|
-
onClick: () =>
|
|
5523
|
+
onClick: () => Y(e),
|
|
5199
5524
|
className: `wb-logos-arrow${X === "hover" ? " wb-logos-arrow-shy" : ""}`,
|
|
5200
5525
|
style: { [e < 0 ? "left" : "right"]: 0 },
|
|
5201
5526
|
children: e < 0 ? "‹" : "›"
|
|
@@ -5242,22 +5567,22 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5242
5567
|
margin: "0 auto"
|
|
5243
5568
|
},
|
|
5244
5569
|
children: [
|
|
5245
|
-
Z ?
|
|
5570
|
+
Z ? xe(-1) : null,
|
|
5246
5571
|
/* @__PURE__ */ d("div", {
|
|
5247
5572
|
style: { overflow: "hidden" },
|
|
5248
5573
|
children: be
|
|
5249
5574
|
}),
|
|
5250
|
-
Z ?
|
|
5575
|
+
Z ? xe(1) : null
|
|
5251
5576
|
]
|
|
5252
5577
|
}) : /* @__PURE__ */ f(u, { children: [
|
|
5253
|
-
Z ?
|
|
5578
|
+
Z ? xe(-1) : null,
|
|
5254
5579
|
be,
|
|
5255
|
-
Z ?
|
|
5580
|
+
Z ? xe(1) : null
|
|
5256
5581
|
] }),
|
|
5257
|
-
/* @__PURE__ */ d(
|
|
5582
|
+
/* @__PURE__ */ d(Ur, {
|
|
5258
5583
|
running: me,
|
|
5259
|
-
every:
|
|
5260
|
-
slide:
|
|
5584
|
+
every: ie + ae,
|
|
5585
|
+
slide: ae,
|
|
5261
5586
|
step: he ? -1 : 1,
|
|
5262
5587
|
index: z,
|
|
5263
5588
|
total: de,
|
|
@@ -5268,7 +5593,7 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5268
5593
|
]
|
|
5269
5594
|
});
|
|
5270
5595
|
}
|
|
5271
|
-
function
|
|
5596
|
+
function Ur({ running: e, every: t, slide: n, step: r, index: i, total: o, home: s, setIndex: c, setAnimate: l }) {
|
|
5272
5597
|
a(() => {
|
|
5273
5598
|
if (!e) return;
|
|
5274
5599
|
let n = setInterval(() => {
|
|
@@ -5304,13 +5629,13 @@ function sr({ running: e, every: t, slide: n, step: r, index: i, total: o, home:
|
|
|
5304
5629
|
l
|
|
5305
5630
|
]), null;
|
|
5306
5631
|
}
|
|
5307
|
-
var
|
|
5632
|
+
var Wr = {
|
|
5308
5633
|
small: 380,
|
|
5309
5634
|
medium: 560,
|
|
5310
5635
|
large: 820,
|
|
5311
5636
|
full: "100%"
|
|
5312
5637
|
};
|
|
5313
|
-
function
|
|
5638
|
+
function Gr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: o = "medium", title: s = "", showClose: u = !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 }) {
|
|
5314
5639
|
let [C, w] = l(!1), T = c(null);
|
|
5315
5640
|
a(() => {
|
|
5316
5641
|
if (S || !e) return;
|
|
@@ -5335,7 +5660,7 @@ function lr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5335
5660
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
5336
5661
|
};
|
|
5337
5662
|
}, [S, C]);
|
|
5338
|
-
let E =
|
|
5663
|
+
let E = Wr[o] ?? Wr.medium, D = (e) => {
|
|
5339
5664
|
let t = {
|
|
5340
5665
|
padding: "9px 16px",
|
|
5341
5666
|
borderRadius: 6,
|
|
@@ -5504,7 +5829,7 @@ function lr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5504
5829
|
})]
|
|
5505
5830
|
});
|
|
5506
5831
|
}
|
|
5507
|
-
function
|
|
5832
|
+
function Kr({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: o = "", offset: s = 8, editorOpen: u = !0, linked: p, style: m, nodeRef: h, inert: g = !1 }) {
|
|
5508
5833
|
let [_, v] = l(!1), y = c(null), b = c(null), x = r !== "click", S = () => {
|
|
5509
5834
|
b.current && clearTimeout(b.current), b.current = null;
|
|
5510
5835
|
}, C = () => {
|
|
@@ -5605,100 +5930,101 @@ function ur({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
|
|
|
5605
5930
|
}), E]
|
|
5606
5931
|
});
|
|
5607
5932
|
}
|
|
5608
|
-
var
|
|
5609
|
-
PageRoot:
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5933
|
+
var qr = {
|
|
5934
|
+
PageRoot: _t,
|
|
5935
|
+
MarkdownBlock: Mt,
|
|
5936
|
+
CalendarBlock: zr,
|
|
5937
|
+
LogoCarousel: Hr,
|
|
5938
|
+
DialogBlock: Gr,
|
|
5939
|
+
DropdownBlock: Kr,
|
|
5940
|
+
Section: vt,
|
|
5941
|
+
Container: yt,
|
|
5942
|
+
Heading: bt,
|
|
5943
|
+
TextBlock: It,
|
|
5944
|
+
ButtonBlock: zt,
|
|
5945
|
+
ImageBlock: Bt,
|
|
5946
|
+
Spacer: Jt,
|
|
5947
|
+
Divider: Yt,
|
|
5948
|
+
BoxBlock: Xt,
|
|
5949
|
+
SliderBlock: nn,
|
|
5950
|
+
CanvasSlider: rn,
|
|
5951
|
+
TabsBlock: bn,
|
|
5952
|
+
QuickStack: Kn,
|
|
5953
|
+
CollectionList: qn,
|
|
5954
|
+
CollectionSearch: Jn,
|
|
5955
|
+
BreadcrumbsBlock: Yn,
|
|
5956
|
+
PaginationBlock: Xn,
|
|
5957
|
+
StepperBlock: pr,
|
|
5958
|
+
SocialLinksBlock: fr,
|
|
5959
|
+
ThemeModeBlock: tr,
|
|
5960
|
+
ScrollTopBlock: ur,
|
|
5961
|
+
CounterBlock: lr,
|
|
5962
|
+
OrgChartBlock: Tr,
|
|
5963
|
+
TableBlock: jr,
|
|
5964
|
+
IconBlock: pn,
|
|
5965
|
+
MapBlock: dn,
|
|
5966
|
+
MasonryBlock: hn,
|
|
5967
|
+
AccordionBlock: xn,
|
|
5968
|
+
NavbarBlock: yn,
|
|
5969
|
+
ListBlock: Ft,
|
|
5970
|
+
TextSpan: Tt,
|
|
5971
|
+
QuoteBlock: Pt,
|
|
5972
|
+
TextLink: Rt,
|
|
5973
|
+
RichTextBlock: jt,
|
|
5974
|
+
RichContentBlock: jt,
|
|
5975
|
+
VideoBlock: Vt,
|
|
5976
|
+
YouTubeBlock: Ut,
|
|
5977
|
+
IframeBlock: Wt,
|
|
5978
|
+
EmbedBlock: qt,
|
|
5979
|
+
FormBlock: Pn,
|
|
5980
|
+
FormLabel: zn,
|
|
5981
|
+
FormInput: Bn,
|
|
5982
|
+
FormTextarea: Vn,
|
|
5983
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(Hn, {
|
|
5658
5984
|
kind: "checkbox",
|
|
5659
5985
|
...e
|
|
5660
5986
|
}),
|
|
5661
|
-
FormRadio: (e) => /* @__PURE__ */ d(
|
|
5987
|
+
FormRadio: (e) => /* @__PURE__ */ d(Hn, {
|
|
5662
5988
|
kind: "radio",
|
|
5663
5989
|
...e
|
|
5664
5990
|
}),
|
|
5665
|
-
FormSelect:
|
|
5666
|
-
FormFile:
|
|
5667
|
-
FormRecaptcha:
|
|
5668
|
-
FormSubmit:
|
|
5669
|
-
},
|
|
5991
|
+
FormSelect: Un,
|
|
5992
|
+
FormFile: Wn,
|
|
5993
|
+
FormRecaptcha: Rn,
|
|
5994
|
+
FormSubmit: Gn
|
|
5995
|
+
}, Jr = {
|
|
5670
5996
|
id: "auth",
|
|
5671
5997
|
label: "Accounts",
|
|
5672
5998
|
category: "Apps",
|
|
5673
5999
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5674
6000
|
ssr: "shell",
|
|
5675
6001
|
settings: ["site.authRedirect"]
|
|
5676
|
-
},
|
|
6002
|
+
}, Yr = n({
|
|
5677
6003
|
user: null,
|
|
5678
6004
|
status: "idle",
|
|
5679
6005
|
ensure: () => {},
|
|
5680
6006
|
refresh: () => {},
|
|
5681
6007
|
signOut: () => {}
|
|
5682
6008
|
});
|
|
5683
|
-
function
|
|
6009
|
+
function Xr(e, t) {
|
|
5684
6010
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5685
6011
|
}
|
|
5686
|
-
function
|
|
6012
|
+
function Zr(e) {
|
|
5687
6013
|
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);
|
|
5688
6014
|
return {
|
|
5689
6015
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5690
6016
|
url: i,
|
|
5691
6017
|
mePath: a,
|
|
5692
6018
|
logoutPath: o,
|
|
5693
|
-
meUrl:
|
|
5694
|
-
logoutUrl:
|
|
6019
|
+
meUrl: Xr(i, a),
|
|
6020
|
+
logoutUrl: Xr(i, o),
|
|
5695
6021
|
loginPage: r(n.loginPage),
|
|
5696
6022
|
userPath: r(n.userPath),
|
|
5697
6023
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5698
6024
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5699
6025
|
};
|
|
5700
6026
|
}
|
|
5701
|
-
function
|
|
6027
|
+
function Qr(e, t) {
|
|
5702
6028
|
if (!t) return e ?? null;
|
|
5703
6029
|
let n = e;
|
|
5704
6030
|
for (let e of t.split(".")) {
|
|
@@ -5707,26 +6033,26 @@ function gr(e, t) {
|
|
|
5707
6033
|
}
|
|
5708
6034
|
return n ?? null;
|
|
5709
6035
|
}
|
|
5710
|
-
function
|
|
6036
|
+
function $r(e) {
|
|
5711
6037
|
try {
|
|
5712
6038
|
return window.localStorage.getItem(e) || "";
|
|
5713
6039
|
} catch {
|
|
5714
6040
|
return "";
|
|
5715
6041
|
}
|
|
5716
6042
|
}
|
|
5717
|
-
function
|
|
6043
|
+
function ei(e) {
|
|
5718
6044
|
try {
|
|
5719
6045
|
window.localStorage.removeItem(e);
|
|
5720
6046
|
} catch {}
|
|
5721
6047
|
}
|
|
5722
|
-
var
|
|
5723
|
-
let e = i(
|
|
6048
|
+
var ti = () => {
|
|
6049
|
+
let e = i(Yr);
|
|
5724
6050
|
return a(() => {
|
|
5725
6051
|
e.ensure();
|
|
5726
6052
|
}, [e]), e;
|
|
5727
6053
|
};
|
|
5728
|
-
function
|
|
5729
|
-
let f = i(
|
|
6054
|
+
function ni({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
|
|
6055
|
+
let f = i(Q), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", h = s(() => Zr(f?.settings), [f?.settings]), [g, _] = l(t ?? null), [v, y] = l(t ? "user" : n ? "guest" : "idle"), b = c(!1), x = r((e, t) => fetch(`${p}${e}`, {
|
|
5730
6056
|
...t,
|
|
5731
6057
|
credentials: "include",
|
|
5732
6058
|
headers: {
|
|
@@ -5738,9 +6064,9 @@ function br({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5738
6064
|
if (n) return Promise.resolve(null);
|
|
5739
6065
|
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5740
6066
|
if (h.mode === "custom") {
|
|
5741
|
-
let e = h.auth === "bearer" ?
|
|
6067
|
+
let e = h.auth === "bearer" ? $r(h.tokenKey) : "";
|
|
5742
6068
|
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) => {
|
|
5743
|
-
let t =
|
|
6069
|
+
let t = Qr(e, h.userPath);
|
|
5744
6070
|
return S(t && typeof t == "object" ? t : null);
|
|
5745
6071
|
}).catch(() => S(null));
|
|
5746
6072
|
}
|
|
@@ -5753,12 +6079,12 @@ function br({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5753
6079
|
]), w = r(() => {
|
|
5754
6080
|
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5755
6081
|
if (h.mode === "custom") {
|
|
5756
|
-
let e = h.auth === "bearer" ?
|
|
6082
|
+
let e = h.auth === "bearer" ? $r(h.tokenKey) : "";
|
|
5757
6083
|
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5758
6084
|
method: "post",
|
|
5759
6085
|
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5760
6086
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5761
|
-
h.auth === "bearer" &&
|
|
6087
|
+
h.auth === "bearer" && ei(h.tokenKey), S(null);
|
|
5762
6088
|
});
|
|
5763
6089
|
}
|
|
5764
6090
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -5808,19 +6134,19 @@ function br({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5808
6134
|
h.loginPage,
|
|
5809
6135
|
C,
|
|
5810
6136
|
w
|
|
5811
|
-
]), /* @__PURE__ */ d(
|
|
6137
|
+
]), /* @__PURE__ */ d(Yr.Provider, {
|
|
5812
6138
|
value: E,
|
|
5813
6139
|
children: e
|
|
5814
6140
|
});
|
|
5815
6141
|
}
|
|
5816
|
-
function
|
|
5817
|
-
let { status: n } =
|
|
6142
|
+
function ri({ when: e, children: t }) {
|
|
6143
|
+
let { status: n } = ti();
|
|
5818
6144
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5819
6145
|
}
|
|
5820
6146
|
//#endregion
|
|
5821
6147
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5822
|
-
function
|
|
5823
|
-
let { tenant: h, apiUrl: g, settings: _ } = i(
|
|
6148
|
+
function ii({ 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 }) {
|
|
6149
|
+
let { tenant: h, apiUrl: g, settings: _ } = i(Q), [v, y] = l("form"), [b, x] = l(""), [S, C] = l(!1), w = e === "register", T = u ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
5824
6150
|
if (e.preventDefault(), u) return;
|
|
5825
6151
|
let n = new FormData(e.currentTarget);
|
|
5826
6152
|
C(!0), x("");
|
|
@@ -5868,20 +6194,20 @@ function Sr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5868
6194
|
children: [
|
|
5869
6195
|
w ? /* @__PURE__ */ f("label", {
|
|
5870
6196
|
style: {
|
|
5871
|
-
...
|
|
6197
|
+
...Cn,
|
|
5872
6198
|
display: "grid",
|
|
5873
6199
|
gap: 6
|
|
5874
6200
|
},
|
|
5875
6201
|
children: [a, /* @__PURE__ */ d("input", {
|
|
5876
6202
|
name: "name",
|
|
5877
6203
|
type: "text",
|
|
5878
|
-
style:
|
|
5879
|
-
...
|
|
6204
|
+
style: wn,
|
|
6205
|
+
...En(u)
|
|
5880
6206
|
})]
|
|
5881
6207
|
}) : null,
|
|
5882
6208
|
/* @__PURE__ */ f("label", {
|
|
5883
6209
|
style: {
|
|
5884
|
-
...
|
|
6210
|
+
...Cn,
|
|
5885
6211
|
display: "grid",
|
|
5886
6212
|
gap: 6
|
|
5887
6213
|
},
|
|
@@ -5889,13 +6215,13 @@ function Sr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5889
6215
|
name: "email",
|
|
5890
6216
|
type: "email",
|
|
5891
6217
|
required: !u,
|
|
5892
|
-
style:
|
|
5893
|
-
...
|
|
6218
|
+
style: wn,
|
|
6219
|
+
...En(u)
|
|
5894
6220
|
})]
|
|
5895
6221
|
}),
|
|
5896
6222
|
/* @__PURE__ */ f("label", {
|
|
5897
6223
|
style: {
|
|
5898
|
-
...
|
|
6224
|
+
...Cn,
|
|
5899
6225
|
display: "grid",
|
|
5900
6226
|
gap: 6
|
|
5901
6227
|
},
|
|
@@ -5903,15 +6229,15 @@ function Sr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5903
6229
|
name: "password",
|
|
5904
6230
|
type: "password",
|
|
5905
6231
|
required: !u,
|
|
5906
|
-
style:
|
|
5907
|
-
...
|
|
6232
|
+
style: wn,
|
|
6233
|
+
...En(u)
|
|
5908
6234
|
})]
|
|
5909
6235
|
}),
|
|
5910
6236
|
/* @__PURE__ */ d("button", {
|
|
5911
6237
|
type: u ? "button" : "submit",
|
|
5912
6238
|
disabled: S || void 0,
|
|
5913
6239
|
style: {
|
|
5914
|
-
...
|
|
6240
|
+
...ft,
|
|
5915
6241
|
border: 0,
|
|
5916
6242
|
padding: "10px 22px",
|
|
5917
6243
|
borderRadius: 8,
|
|
@@ -5943,8 +6269,8 @@ function Sr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5943
6269
|
]
|
|
5944
6270
|
});
|
|
5945
6271
|
}
|
|
5946
|
-
function
|
|
5947
|
-
let { user: c, status: l, signOut: u } =
|
|
6272
|
+
function ai({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
6273
|
+
let { user: c, status: l, signOut: u } = ti(), p = a ? s || "user" : l, m = a ? {
|
|
5948
6274
|
name: "Ada Lovelace",
|
|
5949
6275
|
email: "ada@example.com"
|
|
5950
6276
|
} : c;
|
|
@@ -5965,7 +6291,7 @@ function Cr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5965
6291
|
children: [
|
|
5966
6292
|
/* @__PURE__ */ f("span", {
|
|
5967
6293
|
style: {
|
|
5968
|
-
...
|
|
6294
|
+
...Cn,
|
|
5969
6295
|
fontWeight: 600
|
|
5970
6296
|
},
|
|
5971
6297
|
children: [
|
|
@@ -5976,7 +6302,7 @@ function Cr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5976
6302
|
}),
|
|
5977
6303
|
n && m?.email ? /* @__PURE__ */ d("span", {
|
|
5978
6304
|
style: {
|
|
5979
|
-
...
|
|
6305
|
+
...Cn,
|
|
5980
6306
|
opacity: .7
|
|
5981
6307
|
},
|
|
5982
6308
|
children: m.email
|
|
@@ -5985,14 +6311,14 @@ function Cr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5985
6311
|
type: "button",
|
|
5986
6312
|
onClick: a ? void 0 : u,
|
|
5987
6313
|
style: {
|
|
5988
|
-
...
|
|
6314
|
+
...ft,
|
|
5989
6315
|
border: 0,
|
|
5990
6316
|
padding: "8px 16px",
|
|
5991
6317
|
borderRadius: 8,
|
|
5992
6318
|
fontSize: 14,
|
|
5993
6319
|
cursor: a ? "default" : "pointer"
|
|
5994
6320
|
},
|
|
5995
|
-
...
|
|
6321
|
+
...En(a),
|
|
5996
6322
|
children: t
|
|
5997
6323
|
})
|
|
5998
6324
|
]
|
|
@@ -6009,40 +6335,40 @@ function Cr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
6009
6335
|
}
|
|
6010
6336
|
//#endregion
|
|
6011
6337
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
6012
|
-
var
|
|
6338
|
+
var oi = {
|
|
6013
6339
|
id: "consent",
|
|
6014
6340
|
label: "Cookie consent",
|
|
6015
6341
|
category: "Apps",
|
|
6016
6342
|
keys: ["CookieConsent"],
|
|
6017
6343
|
ssr: "shell",
|
|
6018
6344
|
settings: []
|
|
6019
|
-
},
|
|
6020
|
-
function
|
|
6345
|
+
}, si = "webim.cookie_consent";
|
|
6346
|
+
function ci() {
|
|
6021
6347
|
try {
|
|
6022
|
-
let e = window.localStorage.getItem(
|
|
6348
|
+
let e = window.localStorage.getItem(si), t = e ? JSON.parse(e) : null;
|
|
6023
6349
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
6024
6350
|
} catch {
|
|
6025
6351
|
return "";
|
|
6026
6352
|
}
|
|
6027
6353
|
}
|
|
6028
|
-
function
|
|
6354
|
+
function li(e) {
|
|
6029
6355
|
try {
|
|
6030
6356
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
6031
6357
|
} catch {}
|
|
6032
6358
|
}
|
|
6033
|
-
function
|
|
6359
|
+
function ui(e) {
|
|
6034
6360
|
try {
|
|
6035
|
-
window.localStorage.setItem(
|
|
6361
|
+
window.localStorage.setItem(si, JSON.stringify({
|
|
6036
6362
|
choice: e,
|
|
6037
6363
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
6038
6364
|
}));
|
|
6039
6365
|
} catch {}
|
|
6040
|
-
|
|
6366
|
+
li(e);
|
|
6041
6367
|
try {
|
|
6042
6368
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
6043
6369
|
} catch {}
|
|
6044
6370
|
}
|
|
6045
|
-
var
|
|
6371
|
+
var di = {
|
|
6046
6372
|
bottom: {
|
|
6047
6373
|
left: 0,
|
|
6048
6374
|
right: 0,
|
|
@@ -6064,18 +6390,18 @@ var kr = {
|
|
|
6064
6390
|
maxWidth: 400
|
|
6065
6391
|
}
|
|
6066
6392
|
};
|
|
6067
|
-
function
|
|
6393
|
+
function fi({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
|
|
6068
6394
|
let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
|
|
6069
6395
|
y(e), typeof m == "function" && m(e);
|
|
6070
6396
|
};
|
|
6071
6397
|
if (a(() => {
|
|
6072
6398
|
if (h) return;
|
|
6073
|
-
let e =
|
|
6074
|
-
e ?
|
|
6399
|
+
let e = ci();
|
|
6400
|
+
e ? li(e) : _(!0);
|
|
6075
6401
|
}, [h, v]), !g) return null;
|
|
6076
6402
|
let x = (e) => () => {
|
|
6077
|
-
h || (
|
|
6078
|
-
}, S =
|
|
6403
|
+
h || (ui(e), _(!1));
|
|
6404
|
+
}, S = di[s] ?? di.bottom, C = {
|
|
6079
6405
|
appearance: "none",
|
|
6080
6406
|
font: "inherit",
|
|
6081
6407
|
fontSize: 14,
|
|
@@ -6155,37 +6481,37 @@ function Ar({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
6155
6481
|
}
|
|
6156
6482
|
//#endregion
|
|
6157
6483
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
6158
|
-
var
|
|
6484
|
+
var pi = {
|
|
6159
6485
|
id: "language",
|
|
6160
6486
|
label: "Language",
|
|
6161
6487
|
category: "Apps",
|
|
6162
6488
|
keys: ["SiteLanguagePicker"],
|
|
6163
6489
|
ssr: "prefetch",
|
|
6164
6490
|
settings: ["locales"]
|
|
6165
|
-
},
|
|
6491
|
+
}, mi = {
|
|
6166
6492
|
id: "search",
|
|
6167
6493
|
label: "Search",
|
|
6168
6494
|
category: "Apps",
|
|
6169
6495
|
keys: ["SiteSearch"],
|
|
6170
6496
|
ssr: "prefetch",
|
|
6171
6497
|
settings: []
|
|
6172
|
-
},
|
|
6173
|
-
function
|
|
6498
|
+
}, hi = 50, gi = 2e3;
|
|
6499
|
+
function _i() {
|
|
6174
6500
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
6175
6501
|
}
|
|
6176
|
-
function
|
|
6502
|
+
function vi(e, t) {
|
|
6177
6503
|
let n = e?.data ?? {}, r = [];
|
|
6178
6504
|
for (let e of Object.values(n)) {
|
|
6179
|
-
let t = e == null ? "" :
|
|
6180
|
-
if (t && r.push(t), r.join(" ").length >
|
|
6505
|
+
let t = e == null ? "" : ot(e);
|
|
6506
|
+
if (t && r.push(t), r.join(" ").length > gi) break;
|
|
6181
6507
|
}
|
|
6182
|
-
return r.join(" ").slice(0,
|
|
6508
|
+
return r.join(" ").slice(0, gi).toLocaleLowerCase(t || void 0);
|
|
6183
6509
|
}
|
|
6184
|
-
function
|
|
6185
|
-
let { tenant: b, apiUrl: x, locale: S } = i(
|
|
6510
|
+
function yi({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: o = "inline", includePages: s = !0, collections: u = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
|
|
6511
|
+
let { tenant: b, apiUrl: x, locale: S } = i(Q), [C, w] = l(() => _i()), [T, E] = l(() => _i()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
|
|
6186
6512
|
a(() => {
|
|
6187
6513
|
let e = () => {
|
|
6188
|
-
let e =
|
|
6514
|
+
let e = _i();
|
|
6189
6515
|
w(e), E(e);
|
|
6190
6516
|
};
|
|
6191
6517
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -6236,8 +6562,8 @@ function Lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6236
6562
|
});
|
|
6237
6563
|
}
|
|
6238
6564
|
else for (let t of e.rows) {
|
|
6239
|
-
if (!
|
|
6240
|
-
let n = t?.data ?? {}, r =
|
|
6565
|
+
if (!vi(t, S).includes(N)) continue;
|
|
6566
|
+
let n = t?.data ?? {}, r = ot(n.name) || "Untitled", i = ot(n.slug);
|
|
6241
6567
|
F.push({
|
|
6242
6568
|
key: `entry:${t.id}`,
|
|
6243
6569
|
title: r,
|
|
@@ -6245,7 +6571,7 @@ function Lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6245
6571
|
kind: "entry"
|
|
6246
6572
|
});
|
|
6247
6573
|
}
|
|
6248
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
6574
|
+
let I = F.slice(0, Math.min(Math.max(1, p), hi)), L = (e) => {
|
|
6249
6575
|
if (v) {
|
|
6250
6576
|
e.preventDefault(), w(T), A(!0);
|
|
6251
6577
|
return;
|
|
@@ -6327,7 +6653,7 @@ function Lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6327
6653
|
onChange: (e) => E(e.target.value),
|
|
6328
6654
|
onFocus: () => N && A(!0),
|
|
6329
6655
|
style: {
|
|
6330
|
-
...
|
|
6656
|
+
...wn,
|
|
6331
6657
|
flexGrow: 1,
|
|
6332
6658
|
minWidth: 0
|
|
6333
6659
|
}
|
|
@@ -6385,21 +6711,21 @@ function Lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6385
6711
|
}
|
|
6386
6712
|
//#endregion
|
|
6387
6713
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
6388
|
-
function
|
|
6714
|
+
function bi(e) {
|
|
6389
6715
|
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());
|
|
6390
6716
|
return [...new Set(n.map((e) => e.trim()))];
|
|
6391
6717
|
}
|
|
6392
|
-
var
|
|
6393
|
-
function
|
|
6718
|
+
var xi = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6719
|
+
function Si(e, t) {
|
|
6394
6720
|
let n = String(e ?? "").toUpperCase();
|
|
6395
6721
|
if (t === "code") return n;
|
|
6396
6722
|
let r = "";
|
|
6397
6723
|
try {
|
|
6398
|
-
r =
|
|
6724
|
+
r = xi(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
6399
6725
|
} catch {}
|
|
6400
6726
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
6401
6727
|
}
|
|
6402
|
-
function
|
|
6728
|
+
function Ci(e, t) {
|
|
6403
6729
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
6404
6730
|
if (typeof window > "u") return n || "?";
|
|
6405
6731
|
try {
|
|
@@ -6409,8 +6735,8 @@ function Vr(e, t) {
|
|
|
6409
6735
|
return n || "/";
|
|
6410
6736
|
}
|
|
6411
6737
|
}
|
|
6412
|
-
function
|
|
6413
|
-
let c = i(
|
|
6738
|
+
function wi({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
|
|
6739
|
+
let c = i(Q), l = bi(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
|
|
6414
6740
|
display: "inline-flex",
|
|
6415
6741
|
alignItems: "center",
|
|
6416
6742
|
gap: 8,
|
|
@@ -6445,7 +6771,7 @@ function Hr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6445
6771
|
style: { opacity: .4 },
|
|
6446
6772
|
children: n ?? "·"
|
|
6447
6773
|
}), /* @__PURE__ */ d("a", {
|
|
6448
|
-
href:
|
|
6774
|
+
href: Ci(e, e === u),
|
|
6449
6775
|
hrefLang: e,
|
|
6450
6776
|
"aria-current": e === p ? "true" : void 0,
|
|
6451
6777
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -6455,7 +6781,7 @@ function Hr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6455
6781
|
textDecoration: "none",
|
|
6456
6782
|
cursor: s ? "default" : "pointer"
|
|
6457
6783
|
},
|
|
6458
|
-
children:
|
|
6784
|
+
children: Si(e, t)
|
|
6459
6785
|
})]
|
|
6460
6786
|
}, e))]
|
|
6461
6787
|
}) : /* @__PURE__ */ f("div", {
|
|
@@ -6466,7 +6792,7 @@ function Hr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6466
6792
|
value: p,
|
|
6467
6793
|
onChange: s ? void 0 : (e) => {
|
|
6468
6794
|
let t = e.target.value;
|
|
6469
|
-
window.location.assign(
|
|
6795
|
+
window.location.assign(Ci(t, t === u));
|
|
6470
6796
|
},
|
|
6471
6797
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
6472
6798
|
style: {
|
|
@@ -6480,47 +6806,47 @@ function Hr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6480
6806
|
},
|
|
6481
6807
|
children: l.map((e) => /* @__PURE__ */ d("option", {
|
|
6482
6808
|
value: e,
|
|
6483
|
-
children:
|
|
6809
|
+
children: Si(e, t)
|
|
6484
6810
|
}, e))
|
|
6485
6811
|
})]
|
|
6486
6812
|
});
|
|
6487
6813
|
}
|
|
6488
6814
|
//#endregion
|
|
6489
6815
|
//#region ../ui/src/components/builder/apps/index.js
|
|
6490
|
-
var
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
],
|
|
6496
|
-
SiteLoginForm:
|
|
6497
|
-
SiteAccountMenu:
|
|
6498
|
-
SiteLanguagePicker:
|
|
6499
|
-
CookieConsent:
|
|
6500
|
-
SiteSearch:
|
|
6816
|
+
var Ti = [
|
|
6817
|
+
Jr,
|
|
6818
|
+
pi,
|
|
6819
|
+
oi,
|
|
6820
|
+
mi
|
|
6821
|
+
], Ei = {
|
|
6822
|
+
SiteLoginForm: ii,
|
|
6823
|
+
SiteAccountMenu: ai,
|
|
6824
|
+
SiteLanguagePicker: wi,
|
|
6825
|
+
CookieConsent: fi,
|
|
6826
|
+
SiteSearch: yi
|
|
6501
6827
|
};
|
|
6502
|
-
new Set(
|
|
6828
|
+
new Set(Ti.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
6503
6829
|
//#endregion
|
|
6504
6830
|
//#region ../ui/src/components/builder/three/runtime.js
|
|
6505
|
-
var
|
|
6831
|
+
var Di = "0.185.1", Oi = "4.2.0", ki = "https://cdn.jsdelivr.net/npm", Ai = `${ki}/three@${Di}/+esm`, ji = `${ki}/@google/model-viewer@${Oi}/dist/model-viewer.min.js`, Mi = (e) => import(
|
|
6506
6832
|
/* @vite-ignore */
|
|
6507
6833
|
/* webpackIgnore: true */
|
|
6508
6834
|
e
|
|
6509
|
-
),
|
|
6510
|
-
function
|
|
6511
|
-
if (
|
|
6835
|
+
), Ni = /* @__PURE__ */ new Map();
|
|
6836
|
+
function Pi(e) {
|
|
6837
|
+
if (Ni.has(e)) return Ni.get(e);
|
|
6512
6838
|
if (typeof window > "u") return new Promise(() => {});
|
|
6513
|
-
let t =
|
|
6514
|
-
throw
|
|
6839
|
+
let t = Mi(e).catch((t) => {
|
|
6840
|
+
throw Ni.delete(e), t;
|
|
6515
6841
|
});
|
|
6516
|
-
return
|
|
6842
|
+
return Ni.set(e, t), t;
|
|
6517
6843
|
}
|
|
6518
|
-
var
|
|
6519
|
-
function
|
|
6520
|
-
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) :
|
|
6844
|
+
var Fi = () => Pi(Ai), Ii = (e) => Pi(`${ki}/three@${Di}/examples/jsm/${e}/+esm`);
|
|
6845
|
+
function Li() {
|
|
6846
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Pi(ji);
|
|
6521
6847
|
}
|
|
6522
|
-
var
|
|
6523
|
-
function
|
|
6848
|
+
var Ri = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, zi = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
6849
|
+
function Bi(e, t) {
|
|
6524
6850
|
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
6525
6851
|
n = requestAnimationFrame(o), i ||= e;
|
|
6526
6852
|
let a = r ? (e - r) / 1e3 : 0;
|
|
@@ -6539,7 +6865,7 @@ function ii(e, t) {
|
|
|
6539
6865
|
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
6540
6866
|
};
|
|
6541
6867
|
}
|
|
6542
|
-
function
|
|
6868
|
+
function Vi(e, t, n = {}) {
|
|
6543
6869
|
let r = {
|
|
6544
6870
|
radius: n.distance ?? 4,
|
|
6545
6871
|
polar: n.polar ?? Math.PI / 2.4,
|
|
@@ -6588,13 +6914,13 @@ function ai(e, t, n = {}) {
|
|
|
6588
6914
|
}
|
|
6589
6915
|
//#endregion
|
|
6590
6916
|
//#region ../ui/src/components/builder/three/views.jsx
|
|
6591
|
-
var
|
|
6592
|
-
function
|
|
6917
|
+
var Hi = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Ui = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Wi = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Gi = (e) => typeof e == "string" && !!e.trim();
|
|
6918
|
+
function Ki({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
6593
6919
|
return /* @__PURE__ */ f("div", {
|
|
6594
6920
|
ref: r,
|
|
6595
6921
|
style: {
|
|
6596
6922
|
...P(i),
|
|
6597
|
-
minHeight:
|
|
6923
|
+
minHeight: Hi(n, 320),
|
|
6598
6924
|
display: "flex",
|
|
6599
6925
|
flexDirection: "column",
|
|
6600
6926
|
alignItems: "center",
|
|
@@ -6603,7 +6929,7 @@ function ui({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6603
6929
|
border: "1px dashed rgba(148,163,184,.55)",
|
|
6604
6930
|
borderRadius: 10,
|
|
6605
6931
|
background: "rgba(148,163,184,.08)",
|
|
6606
|
-
...
|
|
6932
|
+
...oe,
|
|
6607
6933
|
color: "rgba(100,116,139,.95)",
|
|
6608
6934
|
fontSize: 13,
|
|
6609
6935
|
textAlign: "center",
|
|
@@ -6622,24 +6948,24 @@ function ui({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6622
6948
|
}) : null]
|
|
6623
6949
|
});
|
|
6624
6950
|
}
|
|
6625
|
-
function
|
|
6951
|
+
function qi({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotateDelay: s, cameraControls: c, ar: u, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
|
|
6626
6952
|
let [y, b] = l(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = l(!1);
|
|
6627
6953
|
a(() => {
|
|
6628
6954
|
if (y || !e) return;
|
|
6629
6955
|
let t = !0;
|
|
6630
|
-
return
|
|
6956
|
+
return Li().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
6631
6957
|
t = !1;
|
|
6632
6958
|
};
|
|
6633
6959
|
}, [y, e]);
|
|
6634
6960
|
let C = {
|
|
6635
6961
|
display: "block",
|
|
6636
6962
|
width: "100%",
|
|
6637
|
-
minHeight:
|
|
6638
|
-
height:
|
|
6963
|
+
minHeight: Hi(r, 360),
|
|
6964
|
+
height: Hi(r, 360),
|
|
6639
6965
|
backgroundColor: i || "transparent",
|
|
6640
6966
|
...P(g)
|
|
6641
6967
|
};
|
|
6642
|
-
if (!e) return v ? /* @__PURE__ */ d(
|
|
6968
|
+
if (!e) return v ? /* @__PURE__ */ d(Ki, {
|
|
6643
6969
|
nodeRef: _,
|
|
6644
6970
|
style: g,
|
|
6645
6971
|
height: r,
|
|
@@ -6674,13 +7000,13 @@ function di({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
|
|
|
6674
7000
|
poster: t || void 0,
|
|
6675
7001
|
style: C,
|
|
6676
7002
|
"camera-controls": w(!v && c !== !1),
|
|
6677
|
-
"auto-rotate": w(T && !
|
|
6678
|
-
"auto-rotate-delay": T ? String(
|
|
7003
|
+
"auto-rotate": w(T && !Ri()),
|
|
7004
|
+
"auto-rotate-delay": T ? String(Hi(s, 0)) : void 0,
|
|
6679
7005
|
"rotation-per-second": "18deg",
|
|
6680
7006
|
ar: w(!v && u === !0),
|
|
6681
7007
|
"ar-modes": "webxr scene-viewer quick-look",
|
|
6682
|
-
"shadow-intensity": String(
|
|
6683
|
-
exposure: String(
|
|
7008
|
+
"shadow-intensity": String(Ui(p, 100)),
|
|
7009
|
+
exposure: String(Ui(f, 100)),
|
|
6684
7010
|
"field-of-view": m ? `${Number(m)}deg` : void 0,
|
|
6685
7011
|
"environment-image": h && h !== "neutral" ? h : "neutral",
|
|
6686
7012
|
"interaction-prompt": v ? "none" : void 0,
|
|
@@ -6698,7 +7024,7 @@ function di({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
|
|
|
6698
7024
|
}) : null
|
|
6699
7025
|
});
|
|
6700
7026
|
}
|
|
6701
|
-
var
|
|
7027
|
+
var Ji = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), Yi = [
|
|
6702
7028
|
"precision highp float;",
|
|
6703
7029
|
"uniform vec2 u_res;",
|
|
6704
7030
|
"uniform float u_time;",
|
|
@@ -6721,7 +7047,7 @@ var fi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6721
7047
|
" return v;",
|
|
6722
7048
|
"}",
|
|
6723
7049
|
""
|
|
6724
|
-
].join("\n"),
|
|
7050
|
+
].join("\n"), Xi = {
|
|
6725
7051
|
gradient: [
|
|
6726
7052
|
"void main(){",
|
|
6727
7053
|
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
@@ -6773,7 +7099,7 @@ var fi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6773
7099
|
"}"
|
|
6774
7100
|
].join("\n")
|
|
6775
7101
|
};
|
|
6776
|
-
function
|
|
7102
|
+
function Zi(e, t) {
|
|
6777
7103
|
let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
|
|
6778
7104
|
if (!n) return t;
|
|
6779
7105
|
let r = parseInt(n[1], 16);
|
|
@@ -6783,7 +7109,7 @@ function hi(e, t) {
|
|
|
6783
7109
|
(r & 255) / 255
|
|
6784
7110
|
];
|
|
6785
7111
|
}
|
|
6786
|
-
function
|
|
7112
|
+
function Qi(e, t, n) {
|
|
6787
7113
|
let r = e.createShader(t);
|
|
6788
7114
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
6789
7115
|
let t = e.getShaderInfoLog(r);
|
|
@@ -6791,13 +7117,13 @@ function gi(e, t, n) {
|
|
|
6791
7117
|
}
|
|
6792
7118
|
return r;
|
|
6793
7119
|
}
|
|
6794
|
-
function
|
|
7120
|
+
function $i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, scale: s, height: u, interactive: p, style: m, nodeRef: h, inert: g }) {
|
|
6795
7121
|
let _ = c(null), v = c(null), y = c(null), [b, x] = l("");
|
|
6796
7122
|
a(() => () => {
|
|
6797
7123
|
let e = y.current;
|
|
6798
7124
|
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
6799
7125
|
}, []);
|
|
6800
|
-
let S = typeof t == "string" && t.trim() ? t :
|
|
7126
|
+
let S = typeof t == "string" && t.trim() ? t : Xi[e] ?? Xi.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = Ui(o, 100), D = Math.max(.05, Ui(s, 100));
|
|
6801
7127
|
return a(() => {
|
|
6802
7128
|
let e = _.current, t = v.current;
|
|
6803
7129
|
if (!e || !t) return;
|
|
@@ -6812,7 +7138,7 @@ function _i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6812
7138
|
}
|
|
6813
7139
|
let r = null;
|
|
6814
7140
|
try {
|
|
6815
|
-
let e =
|
|
7141
|
+
let e = Qi(n, n.VERTEX_SHADER, Ji), t = Qi(n, n.FRAGMENT_SHADER, Yi + S);
|
|
6816
7142
|
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");
|
|
6817
7143
|
x("");
|
|
6818
7144
|
} catch (e) {
|
|
@@ -6848,28 +7174,28 @@ function _i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6848
7174
|
};
|
|
6849
7175
|
p !== !1 && t.addEventListener("pointermove", l);
|
|
6850
7176
|
let u = () => {
|
|
6851
|
-
let r =
|
|
7177
|
+
let r = zi(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
6852
7178
|
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
6853
7179
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6854
7180
|
d?.observe(t), u();
|
|
6855
|
-
let f =
|
|
6856
|
-
a:
|
|
7181
|
+
let f = Ri(), m = {
|
|
7182
|
+
a: Zi(C, [
|
|
6857
7183
|
.35,
|
|
6858
7184
|
.4,
|
|
6859
7185
|
.95
|
|
6860
7186
|
]),
|
|
6861
|
-
b:
|
|
7187
|
+
b: Zi(w, [
|
|
6862
7188
|
.05,
|
|
6863
7189
|
.06,
|
|
6864
7190
|
.16
|
|
6865
7191
|
]),
|
|
6866
|
-
c:
|
|
7192
|
+
c: Zi(T, [
|
|
6867
7193
|
.95,
|
|
6868
7194
|
.35,
|
|
6869
7195
|
.6
|
|
6870
7196
|
])
|
|
6871
7197
|
}, h = {};
|
|
6872
|
-
return h.stop =
|
|
7198
|
+
return h.stop = Bi(t, (t, r) => {
|
|
6873
7199
|
u(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (f ? 0 : r) * E), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, D), n.drawArrays(n.TRIANGLES, 0, 3), f && h.stop?.();
|
|
6874
7200
|
}), () => {
|
|
6875
7201
|
h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
|
|
@@ -6888,7 +7214,7 @@ function _i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6888
7214
|
},
|
|
6889
7215
|
style: {
|
|
6890
7216
|
position: "relative",
|
|
6891
|
-
minHeight:
|
|
7217
|
+
minHeight: Hi(u, 320),
|
|
6892
7218
|
overflow: "hidden",
|
|
6893
7219
|
...P(m)
|
|
6894
7220
|
},
|
|
@@ -6910,7 +7236,7 @@ function _i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6910
7236
|
justifyContent: "center",
|
|
6911
7237
|
padding: 12,
|
|
6912
7238
|
background: "rgba(15,23,42,.75)",
|
|
6913
|
-
...
|
|
7239
|
+
...oe,
|
|
6914
7240
|
color: "#fecaca",
|
|
6915
7241
|
fontSize: 11,
|
|
6916
7242
|
whiteSpace: "pre-wrap",
|
|
@@ -6920,7 +7246,7 @@ function _i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6920
7246
|
}) : null]
|
|
6921
7247
|
});
|
|
6922
7248
|
}
|
|
6923
|
-
function
|
|
7249
|
+
function ea(e, t) {
|
|
6924
7250
|
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
6925
7251
|
r.deleteAttribute("uv");
|
|
6926
7252
|
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
@@ -6936,23 +7262,23 @@ function vi(e, t) {
|
|
|
6936
7262
|
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
6937
7263
|
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
6938
7264
|
}
|
|
6939
|
-
var
|
|
6940
|
-
function
|
|
6941
|
-
if (
|
|
6942
|
-
let t =
|
|
7265
|
+
var ta = /* @__PURE__ */ new Map();
|
|
7266
|
+
function na(e) {
|
|
7267
|
+
if (ta.has(e)) return ta.get(e);
|
|
7268
|
+
let t = Ii("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
|
|
6943
7269
|
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
6944
7270
|
})).catch((t) => {
|
|
6945
|
-
throw
|
|
7271
|
+
throw ta.delete(e), t;
|
|
6946
7272
|
});
|
|
6947
|
-
return
|
|
7273
|
+
return ta.set(e, t), t;
|
|
6948
7274
|
}
|
|
6949
|
-
function
|
|
7275
|
+
function ra(e, t) {
|
|
6950
7276
|
let n = new e.Box3().setFromObject(t);
|
|
6951
7277
|
if (n.isEmpty()) return t;
|
|
6952
7278
|
let r = n.getSize(new e.Vector3()), i = n.getCenter(new e.Vector3()), a = Math.max(r.x, r.y, r.z) || 1, o = new e.Group();
|
|
6953
7279
|
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
6954
7280
|
}
|
|
6955
|
-
var
|
|
7281
|
+
var ia = {
|
|
6956
7282
|
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
6957
7283
|
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
6958
7284
|
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
@@ -6961,50 +7287,50 @@ var Si = {
|
|
|
6961
7287
|
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
6962
7288
|
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
6963
7289
|
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
6964
|
-
},
|
|
6965
|
-
function
|
|
6966
|
-
let g = c(null), [_, v] = l(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !
|
|
7290
|
+
}, aa = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
7291
|
+
function oa({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: o, controls: s, ground: u, height: f, style: p, nodeRef: m, inert: h }) {
|
|
7292
|
+
let g = c(null), [_, v] = l(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !Ri(), S = s !== !1 && !h;
|
|
6967
7293
|
return a(() => {
|
|
6968
7294
|
let e = g.current;
|
|
6969
7295
|
if (!e) return;
|
|
6970
7296
|
let i = !0, a = null;
|
|
6971
|
-
return
|
|
7297
|
+
return Fi().then((s) => {
|
|
6972
7298
|
if (!i || !e) return;
|
|
6973
7299
|
let c = new s.WebGLRenderer({
|
|
6974
7300
|
antialias: !0,
|
|
6975
7301
|
alpha: !t
|
|
6976
7302
|
});
|
|
6977
|
-
c.setPixelRatio(
|
|
7303
|
+
c.setPixelRatio(zi()), c.shadowMap.enabled = u !== !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);
|
|
6978
7304
|
let l = new s.Scene();
|
|
6979
|
-
t && (l.background = new s.Color(t)), l.environment =
|
|
6980
|
-
let d = new s.PerspectiveCamera(
|
|
6981
|
-
distance:
|
|
7305
|
+
t && (l.background = new s.Color(t)), l.environment = ea(s, c);
|
|
7306
|
+
let d = new s.PerspectiveCamera(aa(r, 45), 1, .1, 400), f = Vi(d, c.domElement, {
|
|
7307
|
+
distance: aa(n, 5),
|
|
6982
7308
|
enableZoom: S
|
|
6983
7309
|
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
6984
7310
|
p.position.set(4, 7, 5), p.castShadow = u !== !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));
|
|
6985
7311
|
let m = [], h = new s.Group(), g = (e, t) => {
|
|
6986
|
-
let n =
|
|
6987
|
-
e.position.set(
|
|
7312
|
+
let n = aa(t.scale, 1);
|
|
7313
|
+
e.position.set(aa(t.x, 0), aa(t.y, 0), aa(t.z, 0)), e.rotation.set(Wi(t.rx), Wi(t.ry), Wi(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Wi(t.spin);
|
|
6988
7314
|
};
|
|
6989
7315
|
for (let e of y) {
|
|
6990
7316
|
if (e.shape === "model") {
|
|
6991
|
-
if (!
|
|
7317
|
+
if (!Gi(e.src)) continue;
|
|
6992
7318
|
let t = new s.Group();
|
|
6993
|
-
g(t, e), h.add(t),
|
|
7319
|
+
g(t, e), h.add(t), na(e.src).then((e) => {
|
|
6994
7320
|
if (!i) return;
|
|
6995
|
-
let n =
|
|
7321
|
+
let n = ra(s, e.clone(!0));
|
|
6996
7322
|
n.traverse((e) => {
|
|
6997
7323
|
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
6998
7324
|
}), t.add(n);
|
|
6999
7325
|
}, () => {});
|
|
7000
7326
|
continue;
|
|
7001
7327
|
}
|
|
7002
|
-
let t = (
|
|
7328
|
+
let t = (ia[e.shape] ?? ia.box)(s), n = new s.MeshStandardMaterial({
|
|
7003
7329
|
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
7004
|
-
metalness: Math.min(1, Math.max(0,
|
|
7005
|
-
roughness: Math.min(1, Math.max(0,
|
|
7006
|
-
transparent:
|
|
7007
|
-
opacity: Math.min(1, Math.max(0,
|
|
7330
|
+
metalness: Math.min(1, Math.max(0, Ui(e.metalness, 10))),
|
|
7331
|
+
roughness: Math.min(1, Math.max(0, Ui(e.roughness, 35))),
|
|
7332
|
+
transparent: Ui(e.opacity, 100) < 1,
|
|
7333
|
+
opacity: Math.min(1, Math.max(0, Ui(e.opacity, 100))),
|
|
7008
7334
|
flatShading: e.flat === !0,
|
|
7009
7335
|
wireframe: e.wireframe === !0,
|
|
7010
7336
|
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
@@ -7015,14 +7341,14 @@ function wi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7015
7341
|
let _ = null;
|
|
7016
7342
|
if (u !== !1) {
|
|
7017
7343
|
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
7018
|
-
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y =
|
|
7344
|
+
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = aa(u === !0 ? 0 : u, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
|
|
7019
7345
|
}
|
|
7020
7346
|
let v = () => {
|
|
7021
7347
|
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
7022
7348
|
c.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
|
|
7023
7349
|
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
7024
7350
|
b?.observe(e), v();
|
|
7025
|
-
let C =
|
|
7351
|
+
let C = Wi(Number.isFinite(Number(o)) ? o : 20), w = Bi(e, (e) => {
|
|
7026
7352
|
f.autoSpin(x ? C : 0, e), f.update();
|
|
7027
7353
|
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
7028
7354
|
c.render(l, d);
|
|
@@ -7046,7 +7372,7 @@ function wi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7046
7372
|
o,
|
|
7047
7373
|
S,
|
|
7048
7374
|
u
|
|
7049
|
-
]), _ && h ? /* @__PURE__ */ d(
|
|
7375
|
+
]), _ && h ? /* @__PURE__ */ d(Ki, {
|
|
7050
7376
|
nodeRef: m,
|
|
7051
7377
|
style: p,
|
|
7052
7378
|
height: f,
|
|
@@ -7057,27 +7383,27 @@ function wi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7057
7383
|
g.current = e, typeof m == "function" && m(e);
|
|
7058
7384
|
},
|
|
7059
7385
|
style: {
|
|
7060
|
-
minHeight:
|
|
7061
|
-
height:
|
|
7386
|
+
minHeight: Hi(f, 380),
|
|
7387
|
+
height: Hi(f, 380),
|
|
7062
7388
|
overflow: "hidden",
|
|
7063
7389
|
touchAction: S ? "pan-y" : void 0,
|
|
7064
7390
|
...P(p)
|
|
7065
7391
|
}
|
|
7066
7392
|
});
|
|
7067
7393
|
}
|
|
7068
|
-
function
|
|
7394
|
+
function sa({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o }) {
|
|
7069
7395
|
let s = c(null), [u, f] = l("");
|
|
7070
7396
|
return a(() => {
|
|
7071
7397
|
let t = s.current;
|
|
7072
7398
|
if (o || !t || typeof e != "string" || !e.trim()) return;
|
|
7073
7399
|
let r = !0, i = null;
|
|
7074
|
-
return
|
|
7400
|
+
return Fi().then((a) => {
|
|
7075
7401
|
if (!r || !t) return;
|
|
7076
7402
|
let o = new a.WebGLRenderer({
|
|
7077
7403
|
antialias: !0,
|
|
7078
7404
|
alpha: !n
|
|
7079
7405
|
});
|
|
7080
|
-
o.setPixelRatio(
|
|
7406
|
+
o.setPixelRatio(zi()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
7081
7407
|
let s = new a.Scene();
|
|
7082
7408
|
n && (s.background = new a.Color(n));
|
|
7083
7409
|
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
@@ -7100,7 +7426,7 @@ function Ti({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7100
7426
|
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
7101
7427
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
7102
7428
|
d?.observe(t), u();
|
|
7103
|
-
let p = !1, m =
|
|
7429
|
+
let p = !1, m = Bi(t, (e, t) => {
|
|
7104
7430
|
if (!p && typeof l?.frame == "function") try {
|
|
7105
7431
|
l.frame(e, t);
|
|
7106
7432
|
} catch (e) {
|
|
@@ -7122,7 +7448,7 @@ function Ti({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7122
7448
|
e,
|
|
7123
7449
|
o,
|
|
7124
7450
|
n
|
|
7125
|
-
]), o ? /* @__PURE__ */ d(
|
|
7451
|
+
]), o ? /* @__PURE__ */ d(Ki, {
|
|
7126
7452
|
nodeRef: i,
|
|
7127
7453
|
style: r,
|
|
7128
7454
|
height: t,
|
|
@@ -7133,8 +7459,8 @@ function Ti({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7133
7459
|
s.current = e, typeof i == "function" && i(e);
|
|
7134
7460
|
},
|
|
7135
7461
|
style: {
|
|
7136
|
-
minHeight:
|
|
7137
|
-
height:
|
|
7462
|
+
minHeight: Hi(t, 380),
|
|
7463
|
+
height: Hi(t, 380),
|
|
7138
7464
|
overflow: "hidden",
|
|
7139
7465
|
position: "relative",
|
|
7140
7466
|
touchAction: "pan-y",
|
|
@@ -7149,7 +7475,7 @@ function Ti({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7149
7475
|
padding: "6px 8px",
|
|
7150
7476
|
borderRadius: 6,
|
|
7151
7477
|
background: "rgba(127,29,29,.85)",
|
|
7152
|
-
...
|
|
7478
|
+
...oe,
|
|
7153
7479
|
color: "#fee2e2",
|
|
7154
7480
|
fontSize: 11
|
|
7155
7481
|
},
|
|
@@ -7157,40 +7483,40 @@ function Ti({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7157
7483
|
}) : null
|
|
7158
7484
|
});
|
|
7159
7485
|
}
|
|
7160
|
-
var
|
|
7161
|
-
ModelViewerBlock:
|
|
7162
|
-
ShaderBlock:
|
|
7163
|
-
SceneBlock:
|
|
7164
|
-
ThreeCanvasBlock:
|
|
7165
|
-
},
|
|
7166
|
-
function
|
|
7167
|
-
if (
|
|
7486
|
+
var ca = {
|
|
7487
|
+
ModelViewerBlock: qi,
|
|
7488
|
+
ShaderBlock: $i,
|
|
7489
|
+
SceneBlock: oa,
|
|
7490
|
+
ThreeCanvasBlock: sa
|
|
7491
|
+
}, la = /* @__PURE__ */ new Map();
|
|
7492
|
+
function ua(e) {
|
|
7493
|
+
if (la.has(e)) return la.get(e);
|
|
7168
7494
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
7169
7495
|
/* @vite-ignore */
|
|
7170
7496
|
/* webpackIgnore: true */
|
|
7171
7497
|
t
|
|
7172
7498
|
).finally(() => URL.revokeObjectURL(t));
|
|
7173
|
-
return
|
|
7499
|
+
return la.set(e, n), n;
|
|
7174
7500
|
}
|
|
7175
|
-
function
|
|
7501
|
+
function da(e) {
|
|
7176
7502
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
7177
7503
|
return n && typeof n == "object" ? n : {};
|
|
7178
7504
|
}
|
|
7179
7505
|
//#endregion
|
|
7180
7506
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
7181
|
-
async function
|
|
7182
|
-
let n = await
|
|
7507
|
+
async function fa(e, t) {
|
|
7508
|
+
let n = await ua(e);
|
|
7183
7509
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
7184
7510
|
}
|
|
7185
|
-
var
|
|
7511
|
+
var pa = {
|
|
7186
7512
|
padding: "10px 12px",
|
|
7187
7513
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
7188
7514
|
borderRadius: 8,
|
|
7189
7515
|
fontSize: 12,
|
|
7190
7516
|
opacity: .6
|
|
7191
7517
|
};
|
|
7192
|
-
function
|
|
7193
|
-
let s = i(
|
|
7518
|
+
function ma({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
7519
|
+
let s = i(Q), l = da(s?.settings)[e], u = c(null), p = c(null), m = {
|
|
7194
7520
|
tenant: s?.tenant ?? "",
|
|
7195
7521
|
apiUrl: s?.apiUrl ?? "/api",
|
|
7196
7522
|
locale: s?.locale ?? "",
|
|
@@ -7202,7 +7528,7 @@ function Mi({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
7202
7528
|
let e = u.current;
|
|
7203
7529
|
if (!l?.code || !e) return;
|
|
7204
7530
|
let n = !0;
|
|
7205
|
-
return
|
|
7531
|
+
return fa(l.code, t).then((e) => {
|
|
7206
7532
|
if (!(!n || !e || !u.current)) {
|
|
7207
7533
|
p.current = e;
|
|
7208
7534
|
try {
|
|
@@ -7232,7 +7558,7 @@ function Mi({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
7232
7558
|
}) : /* @__PURE__ */ f("div", {
|
|
7233
7559
|
ref: o,
|
|
7234
7560
|
style: {
|
|
7235
|
-
...
|
|
7561
|
+
...pa,
|
|
7236
7562
|
...P(r)
|
|
7237
7563
|
},
|
|
7238
7564
|
children: [
|
|
@@ -7244,13 +7570,13 @@ function Mi({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
7244
7570
|
}
|
|
7245
7571
|
//#endregion
|
|
7246
7572
|
//#region ../ui/src/components/builder/render.jsx
|
|
7247
|
-
var
|
|
7248
|
-
...
|
|
7249
|
-
...Wr,
|
|
7573
|
+
var ha = {
|
|
7574
|
+
...qr,
|
|
7250
7575
|
...Ei,
|
|
7251
|
-
|
|
7576
|
+
...ca,
|
|
7577
|
+
PluginBlock: ma
|
|
7252
7578
|
};
|
|
7253
|
-
function
|
|
7579
|
+
function ga(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
7254
7580
|
let o = n[e];
|
|
7255
7581
|
if (!o || o.hidden) return null;
|
|
7256
7582
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -7258,11 +7584,11 @@ function Pi(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7258
7584
|
let n = o.props?.componentId, s = r?.[n];
|
|
7259
7585
|
if (!s?.template || i.has(n)) return null;
|
|
7260
7586
|
let c = new Set(i).add(n);
|
|
7261
|
-
return /* @__PURE__ */ d(t, { children:
|
|
7587
|
+
return /* @__PURE__ */ d(t, { children: ga(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
7262
7588
|
}
|
|
7263
|
-
let l =
|
|
7589
|
+
let l = ha[s];
|
|
7264
7590
|
if (!l) return null;
|
|
7265
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
7591
|
+
let u = (o.nodes ?? []).map((e) => ga(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, ga(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
7266
7592
|
...c,
|
|
7267
7593
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
7268
7594
|
linked: p,
|
|
@@ -7271,16 +7597,16 @@ function Pi(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7271
7597
|
},
|
|
7272
7598
|
children: u.length ? u : void 0
|
|
7273
7599
|
}, e);
|
|
7274
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
7600
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(ri, {
|
|
7275
7601
|
when: c.when,
|
|
7276
7602
|
children: m
|
|
7277
7603
|
}, e) : m;
|
|
7278
7604
|
}
|
|
7279
7605
|
//#endregion
|
|
7280
7606
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
7281
|
-
var
|
|
7282
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
7283
|
-
function
|
|
7607
|
+
var _a = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), va = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Ge(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
7608
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(Ge(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
7609
|
+
function ya({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, animations: c, tenant: l, apiUrl: u, datasets: p, locale: m, direction: g, settings: _, siteUser: v }) {
|
|
7284
7610
|
let y = o?.js?.trim();
|
|
7285
7611
|
if (a(() => {
|
|
7286
7612
|
if (!y) return;
|
|
@@ -7294,35 +7620,35 @@ function Li({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7294
7620
|
minHeight: "100%",
|
|
7295
7621
|
display: "flex",
|
|
7296
7622
|
flexDirection: "column"
|
|
7297
|
-
}, w =
|
|
7623
|
+
}, w = ga("ROOT", e, n), T = s(() => ({ render: (t, r) => ga(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = ae(e, n), O = ie(e, n), k = o?.css?.trim(), j = S(c), M = We(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Ve[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
|
|
7298
7624
|
rel: "stylesheet",
|
|
7299
7625
|
precedence: "default",
|
|
7300
7626
|
href: D(e)
|
|
7301
|
-
}, e)), F =
|
|
7302
|
-
return r === "auto" ? /* @__PURE__ */ d(
|
|
7627
|
+
}, e)), F = va(M);
|
|
7628
|
+
return r === "auto" ? /* @__PURE__ */ d(Q.Provider, {
|
|
7303
7629
|
value: {
|
|
7304
7630
|
tenant: l || "",
|
|
7305
7631
|
apiUrl: u || "/api",
|
|
7306
7632
|
locale: m || "",
|
|
7307
7633
|
settings: _ ?? null
|
|
7308
7634
|
},
|
|
7309
|
-
children: /* @__PURE__ */ d(
|
|
7635
|
+
children: /* @__PURE__ */ d(ni, {
|
|
7310
7636
|
initialUser: v,
|
|
7311
|
-
children: /* @__PURE__ */ d(
|
|
7637
|
+
children: /* @__PURE__ */ d(Qe.Provider, {
|
|
7312
7638
|
value: p ?? null,
|
|
7313
|
-
children: /* @__PURE__ */ d(
|
|
7639
|
+
children: /* @__PURE__ */ d(nt.Provider, {
|
|
7314
7640
|
value: T,
|
|
7315
7641
|
children: /* @__PURE__ */ f("div", {
|
|
7316
7642
|
...b,
|
|
7317
7643
|
className: "webim-page",
|
|
7318
7644
|
style: {
|
|
7319
7645
|
...C,
|
|
7320
|
-
...
|
|
7646
|
+
...Ke(t),
|
|
7321
7647
|
...i
|
|
7322
7648
|
},
|
|
7323
7649
|
children: [
|
|
7324
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
7325
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
7650
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${_a(Ge(M.light))} }
|
|
7651
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${_a(Ge(M.dark))} } }` }),
|
|
7326
7652
|
/* @__PURE__ */ d("style", { children: F }),
|
|
7327
7653
|
P,
|
|
7328
7654
|
/* @__PURE__ */ d("style", { children: x }),
|
|
@@ -7335,25 +7661,25 @@ function Li({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7335
7661
|
})
|
|
7336
7662
|
})
|
|
7337
7663
|
})
|
|
7338
|
-
}) : /* @__PURE__ */ d(
|
|
7664
|
+
}) : /* @__PURE__ */ d(Q.Provider, {
|
|
7339
7665
|
value: {
|
|
7340
7666
|
tenant: l || "",
|
|
7341
7667
|
apiUrl: u || "/api",
|
|
7342
7668
|
locale: m || "",
|
|
7343
7669
|
settings: _ ?? null
|
|
7344
7670
|
},
|
|
7345
|
-
children: /* @__PURE__ */ d(
|
|
7671
|
+
children: /* @__PURE__ */ d(ni, {
|
|
7346
7672
|
initialUser: v,
|
|
7347
|
-
children: /* @__PURE__ */ d(
|
|
7673
|
+
children: /* @__PURE__ */ d(Qe.Provider, {
|
|
7348
7674
|
value: p ?? null,
|
|
7349
|
-
children: /* @__PURE__ */ d(
|
|
7675
|
+
children: /* @__PURE__ */ d(nt.Provider, {
|
|
7350
7676
|
value: T,
|
|
7351
7677
|
children: /* @__PURE__ */ f("div", {
|
|
7352
7678
|
...b,
|
|
7353
7679
|
className: "webim-page",
|
|
7354
7680
|
style: {
|
|
7355
7681
|
...C,
|
|
7356
|
-
...
|
|
7682
|
+
...Ye(t, r),
|
|
7357
7683
|
...i
|
|
7358
7684
|
},
|
|
7359
7685
|
children: [
|
|
@@ -7375,8 +7701,8 @@ function Li({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7375
7701
|
}
|
|
7376
7702
|
//#endregion
|
|
7377
7703
|
//#region src/WebimContent.jsx
|
|
7378
|
-
function
|
|
7379
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
7704
|
+
function ba({ bundle: e, mode: t = "auto", style: n }) {
|
|
7705
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(ya, {
|
|
7380
7706
|
blocks: e.blocks,
|
|
7381
7707
|
theme: e.theme,
|
|
7382
7708
|
components: e.components,
|
|
@@ -7388,13 +7714,13 @@ function Ri({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
7388
7714
|
locale: e.locale,
|
|
7389
7715
|
direction: e.direction,
|
|
7390
7716
|
settings: e.settings,
|
|
7391
|
-
mode:
|
|
7717
|
+
mode: Ze(t, e.scheme),
|
|
7392
7718
|
style: n
|
|
7393
7719
|
}) : null;
|
|
7394
7720
|
}
|
|
7395
7721
|
//#endregion
|
|
7396
7722
|
//#region src/bundle.js
|
|
7397
|
-
function
|
|
7723
|
+
function xa({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
7398
7724
|
let a = {
|
|
7399
7725
|
...t?.global ?? {},
|
|
7400
7726
|
...t?.tenant ?? {}
|
|
@@ -7404,7 +7730,7 @@ function zi({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
7404
7730
|
title: e.title,
|
|
7405
7731
|
slug: e.slug,
|
|
7406
7732
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
7407
|
-
theme:
|
|
7733
|
+
theme: Xe(o, a.builder_themes?.themes),
|
|
7408
7734
|
components: a.builder_components?.components ?? {},
|
|
7409
7735
|
custom: o.custom,
|
|
7410
7736
|
animations: o.animations,
|
|
@@ -7420,18 +7746,18 @@ function zi({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
7420
7746
|
}
|
|
7421
7747
|
//#endregion
|
|
7422
7748
|
//#region src/fetchPage.js
|
|
7423
|
-
var
|
|
7749
|
+
var Sa = async (e) => {
|
|
7424
7750
|
let t = await e.json().catch(() => null);
|
|
7425
7751
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
7426
7752
|
return t?.payload ?? t;
|
|
7427
7753
|
};
|
|
7428
|
-
async function
|
|
7754
|
+
async function Ca({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
7429
7755
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
7430
7756
|
if (!n) throw Error("fetchPage: slug is required");
|
|
7431
7757
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
7432
7758
|
...t ? { "x-tenant": t } : {},
|
|
7433
7759
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
7434
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
7760
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Sa), c(`${l}/settings/public`, { headers: u }).then(Sa)]), p = xa({
|
|
7435
7761
|
page: d,
|
|
7436
7762
|
settings: f,
|
|
7437
7763
|
tenant: t,
|
|
@@ -7446,7 +7772,7 @@ async function Vi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
7446
7772
|
"LogoCarousel"
|
|
7447
7773
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
7448
7774
|
if (m.length) {
|
|
7449
|
-
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(
|
|
7775
|
+
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(Sa).then((e) => {
|
|
7450
7776
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
7451
7777
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
7452
7778
|
}).catch(() => [[t, []]])));
|
|
@@ -7460,40 +7786,40 @@ async function Vi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
7460
7786
|
}
|
|
7461
7787
|
//#endregion
|
|
7462
7788
|
//#region src/ssr.jsx
|
|
7463
|
-
var
|
|
7789
|
+
var wa = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
7464
7790
|
"&": "&",
|
|
7465
7791
|
"<": "<",
|
|
7466
7792
|
">": ">",
|
|
7467
7793
|
"\"": """
|
|
7468
7794
|
})[e]);
|
|
7469
|
-
function
|
|
7470
|
-
return e(/* @__PURE__ */ d(
|
|
7795
|
+
function Ta(t, { mode: n = "auto", style: r } = {}) {
|
|
7796
|
+
return e(/* @__PURE__ */ d(ba, {
|
|
7471
7797
|
bundle: t,
|
|
7472
7798
|
mode: n,
|
|
7473
7799
|
style: r
|
|
7474
7800
|
}));
|
|
7475
7801
|
}
|
|
7476
|
-
function
|
|
7802
|
+
function Ea(e, { mode: t = "auto", lang: n } = {}) {
|
|
7477
7803
|
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 = [
|
|
7478
7804
|
"<meta charset=\"utf-8\"/>",
|
|
7479
7805
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
7480
|
-
`<title>${
|
|
7481
|
-
r.description && `<meta name="description" content="${
|
|
7482
|
-
`<meta property="og:title" content="${
|
|
7483
|
-
r.image && `<meta property="og:image" content="${
|
|
7806
|
+
`<title>${wa(o)}</title>`,
|
|
7807
|
+
r.description && `<meta name="description" content="${wa(r.description)}"/>`,
|
|
7808
|
+
`<meta property="og:title" content="${wa(o)}"/>`,
|
|
7809
|
+
r.image && `<meta property="og:image" content="${wa(r.image)}"/>`,
|
|
7484
7810
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
7485
7811
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
7486
7812
|
].filter(Boolean).join("\n");
|
|
7487
7813
|
return `<!doctype html>
|
|
7488
|
-
<html lang="${
|
|
7814
|
+
<html lang="${wa(i)}"${a ? ` dir="${a}"` : ""}>
|
|
7489
7815
|
<head>
|
|
7490
7816
|
${c}
|
|
7491
7817
|
</head>
|
|
7492
7818
|
<body>
|
|
7493
|
-
${
|
|
7819
|
+
${Ta(e, { mode: t })}
|
|
7494
7820
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
7495
7821
|
</body>
|
|
7496
7822
|
</html>`;
|
|
7497
7823
|
}
|
|
7498
7824
|
//#endregion
|
|
7499
|
-
export {
|
|
7825
|
+
export { xa as assembleBundle, Ca as fetchPage, Ta as renderBundleHtml, Ea as renderPageDocument };
|