webim-adapter 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +1029 -481
- package/build/webim-bundle.js +223 -0
- package/build/webim-embed.js +64 -12
- package/build/webim-ssr.js +1043 -495
- package/bundle.d.ts +11 -0
- package/package.json +7 -2
package/build/webim-ssr.js
CHANGED
|
@@ -259,36 +259,36 @@ function P(e) {
|
|
|
259
259
|
color: O,
|
|
260
260
|
inset: k
|
|
261
261
|
})), A.length && (t.boxShadow = A.join(", "));
|
|
262
|
-
let P = (e) => e.type === "blur" ? `blur(${M(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: V, filterSaturate:
|
|
262
|
+
let P = (e) => e.type === "blur" ? `blur(${M(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: V, filterSaturate: ee } = t;
|
|
263
263
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
264
|
-
let
|
|
265
|
-
R !== void 0 &&
|
|
266
|
-
let
|
|
267
|
-
|
|
268
|
-
let { textStrokeWidth:
|
|
269
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
270
|
-
let { clipText:
|
|
271
|
-
delete t.clipText,
|
|
272
|
-
let { transitions:
|
|
264
|
+
let H = F(I);
|
|
265
|
+
R !== void 0 && H.push(`blur(${M(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), B !== void 0 && H.push(`brightness(${B}%)`), V !== void 0 && H.push(`contrast(${V}%)`), ee !== void 0 && H.push(`saturate(${ee}%)`), H.length && (t.filter = H.join(" "));
|
|
266
|
+
let te = F(L);
|
|
267
|
+
te.length && (t.backdropFilter = te.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
268
|
+
let { textStrokeWidth: U, textStrokeColor: ne } = t;
|
|
269
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (U !== void 0 || ne !== void 0) && (t.WebkitTextStroke = `${M(U ?? 1)} ${ne || "currentColor"}`);
|
|
270
|
+
let { clipText: re } = t;
|
|
271
|
+
delete t.clipText, re && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
272
|
+
let { transitions: ie, transitionDuration: ae, transitionEasing: oe, transitionProperty: se } = t, ce = (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 le = (Array.isArray(ie) ? ie : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ce(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
275
|
+
if (ae !== void 0 && le.push(`${se || "all"} ${ce(ae)} ${oe || "ease"}`), le.length && (t.transition = le.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: W, overlayOpacity: ue } = t;
|
|
281
|
+
if (delete t.overlayColor, delete t.overlayOpacity, W) {
|
|
282
|
+
let e = `color-mix(in srgb, ${W} ${ue ?? 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: G } = t;
|
|
287
287
|
delete t.backgroundLayers;
|
|
288
|
-
let
|
|
289
|
-
if (
|
|
288
|
+
let K = (Array.isArray(G) ? G : []).filter((e) => e && e.on !== !1);
|
|
289
|
+
if (K.length) {
|
|
290
290
|
let e = [], n = [], r = [], i = [], a = [];
|
|
291
|
-
for (let t of
|
|
291
|
+
for (let t of K) 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;
|
|
@@ -322,8 +322,8 @@ var F = {
|
|
|
322
322
|
"submit",
|
|
323
323
|
"keydown",
|
|
324
324
|
"inview"
|
|
325
|
-
], B = ["load", "pagescroll"], V = [...z, ...B],
|
|
326
|
-
function
|
|
325
|
+
], B = ["load", "pagescroll"], V = [...z, ...B], ee = /^[A-Za-z_$][\w$]*$/;
|
|
326
|
+
function H(e, t) {
|
|
327
327
|
let n = String(t ?? "").trim();
|
|
328
328
|
if (!n) return [e];
|
|
329
329
|
let r = e.closest?.(".webim-page") ?? e.closest?.(".builder-canvas") ?? document, i = /^[A-Za-z_][\w-]*$/.test(n) ? [`#${n}`, n] : [n];
|
|
@@ -335,15 +335,15 @@ function U(e, t) {
|
|
|
335
335
|
}
|
|
336
336
|
return [];
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function te(e, t) {
|
|
339
339
|
for (let t of e.__webimEvents ?? []) t();
|
|
340
340
|
let n = [];
|
|
341
341
|
for (let r of t ?? []) {
|
|
342
342
|
let t = String(r?.event ?? ""), i = r?.action === "animation", a = i ? (Array.isArray(r?.animations) ? r.animations : [r?.animation]).map((e) => String(e ?? "").trim()).filter(Boolean) : [], o = i ? "" : String(r?.handler ?? "").trim();
|
|
343
|
-
if (!V.includes(t) || (i ? !a.length : !
|
|
343
|
+
if (!V.includes(t) || (i ? !a.length : !ee.test(o))) continue;
|
|
344
344
|
let s = (t) => {
|
|
345
345
|
if (i) {
|
|
346
|
-
for (let t of
|
|
346
|
+
for (let t of H(e, r?.target)) x(t, a);
|
|
347
347
|
return;
|
|
348
348
|
}
|
|
349
349
|
let n = window[o];
|
|
@@ -366,7 +366,7 @@ function ee(e, t) {
|
|
|
366
366
|
}
|
|
367
367
|
e.__webimEvents = n;
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function U(e, t, n = []) {
|
|
370
370
|
t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
|
|
371
371
|
let r = R(t.classNames), i = R(e.getAttribute("data-wb-class"));
|
|
372
372
|
for (let t of i) r.includes(t) || e.classList.remove(t);
|
|
@@ -380,15 +380,15 @@ function te(e, t, n = []) {
|
|
|
380
380
|
}
|
|
381
381
|
return a;
|
|
382
382
|
}
|
|
383
|
-
var
|
|
384
|
-
function
|
|
385
|
-
let i = Object.entries(P(t)).map(([e, t]) => `${
|
|
383
|
+
var ne = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
384
|
+
function re(e, t, n, r = !1) {
|
|
385
|
+
let i = Object.entries(P(t)).map(([e, t]) => `${ne(e)}: ${t} !important;`).join(" ");
|
|
386
386
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
return Object.entries(F).map(([r, i]) =>
|
|
388
|
+
function ie(e, t, n) {
|
|
389
|
+
return Object.entries(F).map(([r, i]) => re(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
390
390
|
}
|
|
391
|
-
var
|
|
391
|
+
var ae = [
|
|
392
392
|
{
|
|
393
393
|
key: "tablet",
|
|
394
394
|
max: 991
|
|
@@ -401,17 +401,17 @@ var ie = [
|
|
|
401
401
|
key: "mobile",
|
|
402
402
|
max: 478
|
|
403
403
|
}
|
|
404
|
-
],
|
|
405
|
-
function
|
|
406
|
-
return
|
|
407
|
-
let i = t?.[n] ?
|
|
404
|
+
], oe = (e) => Object.entries(P(e)).map(([e, t]) => `${ne(e)}: ${t} !important;`).join(" ");
|
|
405
|
+
function se(e, t) {
|
|
406
|
+
return ae.map(({ key: n, max: r }) => {
|
|
407
|
+
let i = t?.[n] ? oe(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 ce(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
|
-
let e =
|
|
414
|
+
let e = se(t, r.props);
|
|
415
415
|
e && n.push(e);
|
|
416
416
|
}
|
|
417
417
|
};
|
|
@@ -419,10 +419,10 @@ function se(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 le(e, t) {
|
|
423
423
|
let n = [], r = (e) => {
|
|
424
424
|
for (let [t, r] of Object.entries(e || {})) {
|
|
425
|
-
let e =
|
|
425
|
+
let e = ie(t, r.props);
|
|
426
426
|
e && n.push(e);
|
|
427
427
|
}
|
|
428
428
|
};
|
|
@@ -430,7 +430,7 @@ function ce(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
|
|
433
|
+
var W = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", ue = {
|
|
434
434
|
light: {
|
|
435
435
|
background: "#f2f2f2",
|
|
436
436
|
surface: "#f2f2f2",
|
|
@@ -471,23 +471,23 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
471
471
|
contrastText: "#052e2b"
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
},
|
|
474
|
+
}, G = {
|
|
475
475
|
font: "system",
|
|
476
476
|
headingFont: "inherit",
|
|
477
|
-
light:
|
|
478
|
-
dark:
|
|
479
|
-
},
|
|
477
|
+
light: ue.light,
|
|
478
|
+
dark: ue.dark
|
|
479
|
+
}, K = {
|
|
480
480
|
system: {
|
|
481
481
|
label: "System",
|
|
482
|
-
value:
|
|
482
|
+
value: W
|
|
483
483
|
},
|
|
484
484
|
inter: {
|
|
485
485
|
label: "Inter",
|
|
486
|
-
value: `"Inter", ${
|
|
486
|
+
value: `"Inter", ${W}`
|
|
487
487
|
},
|
|
488
488
|
outfit: {
|
|
489
489
|
label: "Outfit",
|
|
490
|
-
value: `"Outfit", ${
|
|
490
|
+
value: `"Outfit", ${W}`
|
|
491
491
|
},
|
|
492
492
|
serif: {
|
|
493
493
|
label: "Serif",
|
|
@@ -497,7 +497,7 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
497
497
|
label: "Mono",
|
|
498
498
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
499
499
|
}
|
|
500
|
-
},
|
|
500
|
+
}, q = (e, t) => K[e]?.value ?? k(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), de = (e, ...t) => {
|
|
501
501
|
let n = Object.assign({}, e, ...t);
|
|
502
502
|
return n.primary = {
|
|
503
503
|
...e.primary,
|
|
@@ -513,20 +513,20 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
513
513
|
}), {})
|
|
514
514
|
}, n;
|
|
515
515
|
};
|
|
516
|
-
function
|
|
516
|
+
function fe(e) {
|
|
517
517
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
518
518
|
return {
|
|
519
|
-
font: r ??
|
|
520
|
-
headingFont: i ??
|
|
521
|
-
light:
|
|
522
|
-
dark:
|
|
519
|
+
font: r ?? G.font,
|
|
520
|
+
headingFont: i ?? G.headingFont,
|
|
521
|
+
light: de(ue.light, a, t),
|
|
522
|
+
dark: de(ue.dark, n)
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function pe(e) {
|
|
526
526
|
return {
|
|
527
527
|
"--page-bg": e.background,
|
|
528
528
|
"--page-surface": e.surface ?? e.background,
|
|
529
|
-
"--page-border": e.border ??
|
|
529
|
+
"--page-border": e.border ?? ue.light.border,
|
|
530
530
|
"--page-text": e.text,
|
|
531
531
|
"--page-accent": e.accent,
|
|
532
532
|
"--page-accent-text": e.accentText,
|
|
@@ -540,58 +540,58 @@ function he(e) {
|
|
|
540
540
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
|
-
function
|
|
544
|
-
let t =
|
|
543
|
+
function me(e) {
|
|
544
|
+
let t = fe(e);
|
|
545
545
|
return {
|
|
546
546
|
backgroundColor: "var(--page-bg)",
|
|
547
547
|
color: "var(--page-text)",
|
|
548
|
-
fontFamily:
|
|
549
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
548
|
+
fontFamily: q(t.font, W),
|
|
549
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : q(t.headingFont, "inherit")
|
|
550
550
|
};
|
|
551
551
|
}
|
|
552
|
-
function
|
|
553
|
-
let n =
|
|
552
|
+
function he(e, t = "light") {
|
|
553
|
+
let n = fe(e);
|
|
554
554
|
return {
|
|
555
|
-
...
|
|
556
|
-
...
|
|
555
|
+
...me(e),
|
|
556
|
+
...pe(n[t] ?? n.light)
|
|
557
557
|
};
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function ge(e, t) {
|
|
560
560
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function _e(e, t) {
|
|
563
563
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
564
564
|
}
|
|
565
565
|
//#endregion
|
|
566
566
|
//#region ../ui/src/components/builder/views.jsx
|
|
567
|
-
var
|
|
567
|
+
var J = n({
|
|
568
568
|
tenant: "",
|
|
569
569
|
apiUrl: "/api",
|
|
570
570
|
locale: "",
|
|
571
571
|
settings: null
|
|
572
|
-
}),
|
|
572
|
+
}), ve = n(null), ye = (e) => {
|
|
573
573
|
let t = Number(e?.__page);
|
|
574
574
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
575
575
|
if (typeof window > "u") return 1;
|
|
576
576
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
577
577
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
578
|
-
},
|
|
578
|
+
}, be = () => {
|
|
579
579
|
if (typeof window > "u") return {};
|
|
580
580
|
let e = {};
|
|
581
581
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
582
582
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
583
583
|
}), e;
|
|
584
|
-
},
|
|
584
|
+
}, xe = (e) => {
|
|
585
585
|
let t = {
|
|
586
586
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
587
|
-
...
|
|
587
|
+
...be()
|
|
588
588
|
};
|
|
589
589
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
590
|
-
},
|
|
591
|
-
function
|
|
590
|
+
}, Se = n(null), Ce = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
591
|
+
function we(e, t) {
|
|
592
592
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
593
593
|
}
|
|
594
|
-
var
|
|
594
|
+
var Te = (e) => {
|
|
595
595
|
let t = [];
|
|
596
596
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
597
597
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -601,21 +601,21 @@ var Ee = (e) => {
|
|
|
601
601
|
}
|
|
602
602
|
return t;
|
|
603
603
|
};
|
|
604
|
-
function
|
|
604
|
+
function Y(e) {
|
|
605
605
|
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(" ") : "";
|
|
606
606
|
}
|
|
607
|
-
function
|
|
608
|
-
let n = t?.data ?? {}, r =
|
|
607
|
+
function Ee(e, t) {
|
|
608
|
+
let n = t?.data ?? {}, r = Te(n);
|
|
609
609
|
if (!r.length) return e;
|
|
610
|
-
let i = RegExp(`:(${r.map(
|
|
610
|
+
let i = RegExp(`:(${r.map(Ce).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Y(we(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
611
611
|
return a(e);
|
|
612
612
|
}
|
|
613
|
-
var
|
|
613
|
+
var De = {
|
|
614
614
|
margin: 0,
|
|
615
615
|
fontWeight: 700,
|
|
616
616
|
lineHeight: 1.2,
|
|
617
617
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
618
|
-
},
|
|
618
|
+
}, Oe = { margin: 0 }, ke = {
|
|
619
619
|
display: "inline-block",
|
|
620
620
|
textDecoration: "none",
|
|
621
621
|
cursor: "pointer",
|
|
@@ -699,14 +699,14 @@ function Le({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a
|
|
|
699
699
|
return /* @__PURE__ */ d(n, {
|
|
700
700
|
ref: a,
|
|
701
701
|
style: {
|
|
702
|
-
...
|
|
702
|
+
...De,
|
|
703
703
|
...P(r)
|
|
704
704
|
},
|
|
705
705
|
children: X(t, e, i)
|
|
706
706
|
});
|
|
707
707
|
}
|
|
708
708
|
var Re = {
|
|
709
|
-
fontFamily:
|
|
709
|
+
fontFamily: K.mono.value,
|
|
710
710
|
background: "rgba(148, 163, 184, 0.18)",
|
|
711
711
|
padding: "1px 5px",
|
|
712
712
|
borderRadius: 4,
|
|
@@ -918,7 +918,7 @@ function Ue(e = [], t, n) {
|
|
|
918
918
|
let e = t.type;
|
|
919
919
|
return /* @__PURE__ */ d(e, {
|
|
920
920
|
style: {
|
|
921
|
-
...
|
|
921
|
+
...De,
|
|
922
922
|
fontSize: Ve[t.type],
|
|
923
923
|
...i
|
|
924
924
|
},
|
|
@@ -927,7 +927,7 @@ function Ue(e = [], t, n) {
|
|
|
927
927
|
}
|
|
928
928
|
return /* @__PURE__ */ d("p", {
|
|
929
929
|
style: {
|
|
930
|
-
...
|
|
930
|
+
...Oe,
|
|
931
931
|
...i
|
|
932
932
|
},
|
|
933
933
|
children: r(t.parts, t.text)
|
|
@@ -977,7 +977,7 @@ function Je({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
|
977
977
|
return /* @__PURE__ */ d("p", {
|
|
978
978
|
ref: i,
|
|
979
979
|
style: {
|
|
980
|
-
...
|
|
980
|
+
...Oe,
|
|
981
981
|
...P(n)
|
|
982
982
|
},
|
|
983
983
|
children: X(t, e, r)
|
|
@@ -1009,7 +1009,7 @@ function Ze({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRe
|
|
|
1009
1009
|
target: r || void 0,
|
|
1010
1010
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1011
1011
|
style: {
|
|
1012
|
-
...
|
|
1012
|
+
...ke,
|
|
1013
1013
|
...P(i)
|
|
1014
1014
|
},
|
|
1015
1015
|
children: X(t, e, a)
|
|
@@ -1331,16 +1331,381 @@ function ft({ slides: e = [], linked: t, ...n }) {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
}) : null;
|
|
1333
1333
|
}
|
|
1334
|
-
|
|
1335
|
-
let
|
|
1334
|
+
var Z = 256, pt = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), mt = (e, t, n) => {
|
|
1335
|
+
let r = Z * 2 ** n;
|
|
1336
|
+
return {
|
|
1337
|
+
x: (Number(t) + 180) / 360 * r,
|
|
1338
|
+
y: (.5 - pt(Number(e)) / (2 * Math.PI)) * r
|
|
1339
|
+
};
|
|
1340
|
+
}, Q = (e, t) => {
|
|
1341
|
+
if (e === "" || e == null) return null;
|
|
1342
|
+
let n = Number(e);
|
|
1343
|
+
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1344
|
+
}, ht = (e) => !!e && Q(e.lat, 90) !== null && Q(e.lng, 180) !== null;
|
|
1345
|
+
function gt(e, t, n = "directions", r = "") {
|
|
1346
|
+
let i = `${e},${t}`;
|
|
1347
|
+
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)}`;
|
|
1348
|
+
}
|
|
1349
|
+
var _t = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1350
|
+
function vt({ 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 }) {
|
|
1351
|
+
let _ = c(null), [v, y] = l(1200);
|
|
1336
1352
|
a(() => {
|
|
1337
|
-
|
|
1353
|
+
let e = _.current;
|
|
1354
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
1355
|
+
let t = () => y((t) => e.clientWidth && e.clientWidth !== t ? e.clientWidth : t);
|
|
1356
|
+
t();
|
|
1357
|
+
let n = new ResizeObserver(t);
|
|
1358
|
+
return n.observe(e), () => n.disconnect();
|
|
1359
|
+
}, []);
|
|
1360
|
+
let b = (Array.isArray(e) ? e : []).filter(ht), x = ht({
|
|
1361
|
+
lat: t,
|
|
1362
|
+
lng: n
|
|
1363
|
+
}) ? {
|
|
1364
|
+
lat: Q(t, 90),
|
|
1365
|
+
lng: Q(n, 180)
|
|
1366
|
+
} : b.length ? {
|
|
1367
|
+
lat: b.reduce((e, t) => e + Q(t.lat, 90), 0) / b.length,
|
|
1368
|
+
lng: b.reduce((e, t) => e + Q(t.lng, 180), 0) / b.length
|
|
1369
|
+
} : null, S = Math.max(80, Number(i) || 320), C = Q(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1370
|
+
if (b.length < 2) return 13;
|
|
1371
|
+
for (let e = 19; e >= 1; e--) {
|
|
1372
|
+
let t = b.map((t) => mt(Q(t.lat, 90), Q(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));
|
|
1373
|
+
if (n <= v * .8 && r <= S * .7) return e;
|
|
1374
|
+
}
|
|
1375
|
+
return 1;
|
|
1376
|
+
})(), w = {
|
|
1377
|
+
width: "100%",
|
|
1378
|
+
...P(m)
|
|
1379
|
+
};
|
|
1380
|
+
if (!x) return /* @__PURE__ */ d("div", {
|
|
1381
|
+
ref: (e) => {
|
|
1382
|
+
_.current = e, typeof h == "function" && h(e);
|
|
1383
|
+
},
|
|
1384
|
+
style: {
|
|
1385
|
+
...w,
|
|
1386
|
+
minHeight: 80,
|
|
1387
|
+
display: "grid",
|
|
1388
|
+
placeItems: "center",
|
|
1389
|
+
fontSize: 13,
|
|
1390
|
+
opacity: .6,
|
|
1391
|
+
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.4))",
|
|
1392
|
+
borderRadius: 8
|
|
1393
|
+
},
|
|
1394
|
+
children: "Set the coordinates in Settings"
|
|
1395
|
+
});
|
|
1396
|
+
let T = mt(x.lat, x.lng, C), E = {
|
|
1397
|
+
x: T.x - v / 2,
|
|
1398
|
+
y: T.y - S / 2
|
|
1399
|
+
}, D = [], O = [];
|
|
1400
|
+
for (let e = Math.floor(E.x / Z); e <= Math.floor((E.x + v) / Z); e++) D.push(e);
|
|
1401
|
+
for (let e = Math.floor(E.y / Z); e <= Math.floor((E.y + S) / Z); e++) O.push(e);
|
|
1402
|
+
let k = 2 ** C;
|
|
1403
|
+
return /* @__PURE__ */ f("div", {
|
|
1404
|
+
ref: (e) => {
|
|
1405
|
+
_.current = e, typeof h == "function" && h(e);
|
|
1406
|
+
},
|
|
1407
|
+
style: w,
|
|
1408
|
+
children: [/* @__PURE__ */ f("div", {
|
|
1409
|
+
role: "img",
|
|
1410
|
+
"aria-label": p || "Map",
|
|
1411
|
+
style: {
|
|
1412
|
+
position: "relative",
|
|
1413
|
+
height: S,
|
|
1414
|
+
overflow: "hidden",
|
|
1415
|
+
borderRadius: "inherit",
|
|
1416
|
+
background: "var(--page-surface, #e5e7eb)"
|
|
1417
|
+
},
|
|
1418
|
+
children: [
|
|
1419
|
+
O.map((e) => D.map((t) => {
|
|
1420
|
+
let n = (t % k + k) % k;
|
|
1421
|
+
return e < 0 || e >= k ? null : /* @__PURE__ */ d("img", {
|
|
1422
|
+
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1423
|
+
alt: "",
|
|
1424
|
+
width: Z,
|
|
1425
|
+
height: Z,
|
|
1426
|
+
loading: "lazy",
|
|
1427
|
+
style: {
|
|
1428
|
+
position: "absolute",
|
|
1429
|
+
left: Math.round(t * Z - E.x),
|
|
1430
|
+
top: Math.round(e * Z - E.y),
|
|
1431
|
+
width: Z,
|
|
1432
|
+
height: Z,
|
|
1433
|
+
userSelect: "none",
|
|
1434
|
+
pointerEvents: "none"
|
|
1435
|
+
}
|
|
1436
|
+
}, `${t}-${e}`);
|
|
1437
|
+
})),
|
|
1438
|
+
b.map((e, t) => {
|
|
1439
|
+
let n = mt(Q(e.lat, 90), Q(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 : gt(Q(e.lat, 90), Q(e.lng, 180), s, e.title);
|
|
1440
|
+
return /* @__PURE__ */ f(c ? "a" : "span", {
|
|
1441
|
+
href: c || void 0,
|
|
1442
|
+
target: c ? "_blank" : void 0,
|
|
1443
|
+
rel: c ? "noopener noreferrer" : void 0,
|
|
1444
|
+
title: c && e.title || void 0,
|
|
1445
|
+
style: {
|
|
1446
|
+
position: "absolute",
|
|
1447
|
+
left: r,
|
|
1448
|
+
top: i,
|
|
1449
|
+
transform: "translate(-50%, -100%)",
|
|
1450
|
+
cursor: c ? "pointer" : "default",
|
|
1451
|
+
textDecoration: "none",
|
|
1452
|
+
color: "inherit"
|
|
1453
|
+
},
|
|
1454
|
+
children: [e.title ? /* @__PURE__ */ d("span", {
|
|
1455
|
+
style: {
|
|
1456
|
+
position: "absolute",
|
|
1457
|
+
left: "50%",
|
|
1458
|
+
bottom: "100%",
|
|
1459
|
+
transform: "translateX(-50%)",
|
|
1460
|
+
marginBottom: 4,
|
|
1461
|
+
padding: "3px 7px",
|
|
1462
|
+
borderRadius: 6,
|
|
1463
|
+
background: "var(--page-surface, #ffffff)",
|
|
1464
|
+
color: "var(--page-text, #111827)",
|
|
1465
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
1466
|
+
boxShadow: "0 2px 8px rgba(15, 23, 42, 0.25)",
|
|
1467
|
+
fontSize: 12,
|
|
1468
|
+
lineHeight: 1.35,
|
|
1469
|
+
whiteSpace: "nowrap"
|
|
1470
|
+
},
|
|
1471
|
+
children: e.title
|
|
1472
|
+
}) : null, /* @__PURE__ */ f("svg", {
|
|
1473
|
+
width: Math.max(10, Number(o) || 22),
|
|
1474
|
+
height: Math.max(10, Number(o) || 22),
|
|
1475
|
+
viewBox: "0 0 24 24",
|
|
1476
|
+
fill: a,
|
|
1477
|
+
style: { display: "block" },
|
|
1478
|
+
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), yt[e.icon] ? /* @__PURE__ */ d("path", {
|
|
1479
|
+
d: yt[e.icon],
|
|
1480
|
+
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1481
|
+
fill: "none",
|
|
1482
|
+
stroke: "#fff",
|
|
1483
|
+
strokeWidth: 4,
|
|
1484
|
+
strokeLinecap: "round",
|
|
1485
|
+
strokeLinejoin: "round"
|
|
1486
|
+
}) : /* @__PURE__ */ d("circle", {
|
|
1487
|
+
cx: "12",
|
|
1488
|
+
cy: "10.5",
|
|
1489
|
+
r: "2.6",
|
|
1490
|
+
fill: "#fff"
|
|
1491
|
+
})]
|
|
1492
|
+
})]
|
|
1493
|
+
}, t);
|
|
1494
|
+
}),
|
|
1495
|
+
/* @__PURE__ */ d("a", {
|
|
1496
|
+
href: "https://www.openstreetmap.org/copyright",
|
|
1497
|
+
target: "_blank",
|
|
1498
|
+
rel: "noopener noreferrer",
|
|
1499
|
+
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
1500
|
+
style: {
|
|
1501
|
+
position: "absolute",
|
|
1502
|
+
right: 4,
|
|
1503
|
+
bottom: 3,
|
|
1504
|
+
padding: "1px 5px",
|
|
1505
|
+
borderRadius: 4,
|
|
1506
|
+
background: "rgba(255, 255, 255, 0.75)",
|
|
1507
|
+
color: "#334155",
|
|
1508
|
+
fontSize: 10,
|
|
1509
|
+
textDecoration: "none"
|
|
1510
|
+
},
|
|
1511
|
+
children: "© OpenStreetMap"
|
|
1512
|
+
})
|
|
1513
|
+
]
|
|
1514
|
+
}), u ? /* @__PURE__ */ d("a", {
|
|
1515
|
+
href: _t(x.lat, x.lng, C),
|
|
1516
|
+
target: "_blank",
|
|
1517
|
+
rel: "noopener noreferrer",
|
|
1518
|
+
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
1519
|
+
style: {
|
|
1520
|
+
display: "inline-block",
|
|
1521
|
+
marginTop: 6,
|
|
1522
|
+
fontSize: 12,
|
|
1523
|
+
color: "var(--page-accent, inherit)"
|
|
1524
|
+
},
|
|
1525
|
+
children: "View larger map"
|
|
1526
|
+
}) : null]
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
var yt = {
|
|
1530
|
+
check: "M4 12l5 5L20 6",
|
|
1531
|
+
close: "M6 6l12 12M18 6L6 18",
|
|
1532
|
+
plus: "M12 5v14M5 12h14",
|
|
1533
|
+
minus: "M5 12h14",
|
|
1534
|
+
"arrow-right": "M4 12h16M13 5l7 7-7 7",
|
|
1535
|
+
"arrow-left": "M20 12H4M11 5l-7 7 7 7",
|
|
1536
|
+
"arrow-up": "M12 20V4M5 11l7-7 7 7",
|
|
1537
|
+
"arrow-down": "M12 4v16M5 13l7 7 7-7",
|
|
1538
|
+
"chevron-right": "M9 5l7 7-7 7",
|
|
1539
|
+
"chevron-left": "M15 5l-7 7 7 7",
|
|
1540
|
+
"chevron-down": "M5 9l7 7 7-7",
|
|
1541
|
+
"chevron-up": "M5 15l7-7 7 7",
|
|
1542
|
+
menu: "M4 7h16M4 12h16M4 17h16",
|
|
1543
|
+
star: "M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z",
|
|
1544
|
+
heart: "M12 20s-7-4.4-7-9a4 4 0 0 1 7-2.6A4 4 0 0 1 19 11c0 4.6-7 9-7 9z",
|
|
1545
|
+
home: "M4 11l8-7 8 7M6 10v9h12v-9",
|
|
1546
|
+
user: "M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 20c0-3.3 3.6-5 8-5s8 1.7 8 5",
|
|
1547
|
+
mail: "M3 6h18v12H3zM3 6l9 7 9-7",
|
|
1548
|
+
phone: "M6 3h4l2 5-3 2a12 12 0 0 0 5 5l2-3 5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 4 5a2 2 0 0 1 2-2z",
|
|
1549
|
+
search: "M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14zM20 20l-4.2-4.2",
|
|
1550
|
+
clock: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 7v5l3 2",
|
|
1551
|
+
calendar: "M4 6h16v14H4zM4 10h16M8 3v4M16 3v4",
|
|
1552
|
+
download: "M12 4v10M8 11l4 4 4-4M4 19h16",
|
|
1553
|
+
upload: "M12 20V10M8 13l4-4 4 4M4 5h16",
|
|
1554
|
+
play: "M8 5l11 7-11 7z",
|
|
1555
|
+
pause: "M9 5v14M15 5v14",
|
|
1556
|
+
info: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 11v5M12 8h.01",
|
|
1557
|
+
alert: "M12 4l9 16H3zM12 10v4M12 17h.01",
|
|
1558
|
+
lock: "M6 11h12v9H6zM9 11V8a3 3 0 0 1 6 0v3",
|
|
1559
|
+
chat: "M4 5h16v11H9l-5 4z",
|
|
1560
|
+
"map-pin": "M12 21s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11zM12 12a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z",
|
|
1561
|
+
camera: "M4 8h4l2-2h4l2 2h4v12H4zM12 17a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z",
|
|
1562
|
+
image: "M4 5h16v14H4zM8 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM6 17l5-5 4 4 2-2 3 3",
|
|
1563
|
+
file: "M7 3h7l4 4v14H7zM14 3v5h4",
|
|
1564
|
+
link: "M10 14a4 4 0 0 0 6 .5l2-2a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6-.5l-2 2a4 4 0 0 0 6 6l1-1",
|
|
1565
|
+
external: "M14 4h6v6M20 4l-9 9M18 14v5H5V6h5",
|
|
1566
|
+
trash: "M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13",
|
|
1567
|
+
edit: "M4 20h4L19 9l-4-4L4 16z",
|
|
1568
|
+
filter: "M3 5h18l-7 8v6l-4-2v-4z",
|
|
1569
|
+
refresh: "M20 12a8 8 0 1 1-2.3-5.7M20 4v5h-5",
|
|
1570
|
+
globe: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM3 12h18M12 3c2.5 3 2.5 15 0 18M12 3c-2.5 3-2.5 15 0 18",
|
|
1571
|
+
bell: "M6 16V11a6 6 0 1 1 12 0v5l2 3H4zM10 22h4",
|
|
1572
|
+
tag: "M4 4h7l9 9-7 7-9-9zM8.5 8.5h.01",
|
|
1573
|
+
cart: "M4 5h2l2 10h10l2-7H7M9 20h.01M18 20h.01",
|
|
1574
|
+
card: "M3 6h18v12H3zM3 10h18",
|
|
1575
|
+
shield: "M12 3l8 3v6c0 5-4 8-8 9-4-1-8-4-8-9V6z",
|
|
1576
|
+
sun: "M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 2v2M12 20v2M4 12H2M22 12h-2M5 5l1.5 1.5M17.5 17.5L19 19M19 5l-1.5 1.5M6.5 17.5L5 19",
|
|
1577
|
+
moon: "M20 14a8 8 0 1 1-10-10 7 7 0 0 0 10 10z",
|
|
1578
|
+
settings: "M12 9.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM12 2l1 2.6 2.7-.6 1 2.5 2.6 1-.6 2.7L21 12l-2.3 1.8.6 2.7-2.6 1-1 2.5-2.7-.6L12 22l-1-2.6-2.7.6-1-2.5-2.6-1 .6-2.7L3 12l2.3-1.8-.6-2.7 2.6-1 1-2.5 2.7.6z",
|
|
1579
|
+
eye: "M2 12s4-7 10-7 10 7 10 7-4 7-10 7-10-7-10-7zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",
|
|
1580
|
+
"eye-off": "M4 4l16 16M9.5 9.6A3 3 0 0 0 12 15c.8 0 1.5-.3 2.1-.8M6.6 6.7C3.9 8.3 2 12 2 12s4 7 10 7c1.9 0 3.5-.5 4.9-1.2M14.1 5.4C13.4 5.1 12.7 5 12 5",
|
|
1581
|
+
share: "M8 12a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM21 6a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM21 18a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM7.8 10.8l8.4-3.6M7.8 13.2l8.4 3.6",
|
|
1582
|
+
send: "M21 3L3 10l7 3 3 7z",
|
|
1583
|
+
paperclip: "M20 11l-8.5 8.5a5 5 0 0 1-7-7L13 4a3.5 3.5 0 0 1 5 5l-8.5 8.5a2 2 0 0 1-3-3L15 6",
|
|
1584
|
+
video: "M3 7h11v10H3zM14 11l6-3v8l-6-3",
|
|
1585
|
+
music: "M9 18V6l10-2v12M9 18a2.5 2.5 0 1 1-2.5-2.5H9M19 16a2.5 2.5 0 1 1-2.5-2.5H19",
|
|
1586
|
+
mic: "M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3zM5 11a7 7 0 0 0 14 0M12 18v3",
|
|
1587
|
+
headphones: "M4 15v-3a8 8 0 1 1 16 0v3M4 15h3v5H5a1 1 0 0 1-1-1zM20 15h-3v5h2a1 1 0 0 0 1-1z",
|
|
1588
|
+
book: "M5 4h14v16H7a2 2 0 0 1-2-2zM7 4v14h12",
|
|
1589
|
+
bookmark: "M7 4h10v16l-5-4-5 4z",
|
|
1590
|
+
folder: "M4 6h5l2 2h9v10H4z",
|
|
1591
|
+
cloud: "M7 18a4 4 0 0 1 .5-8 5.5 5.5 0 0 1 10.4 1.5A3.5 3.5 0 0 1 17.5 18z",
|
|
1592
|
+
database: "M12 3c4.4 0 8 1.3 8 3s-3.6 3-8 3-8-1.3-8-3 3.6-3 8-3zM4 6v12c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3",
|
|
1593
|
+
server: "M4 4h16v6H4zM4 14h16v6H4zM8 7h.01M8 17h.01",
|
|
1594
|
+
code: "M9 8l-5 4 5 4M15 8l5 4-5 4",
|
|
1595
|
+
terminal: "M4 5h16v14H4zM8 10l3 2-3 2M13 14h4",
|
|
1596
|
+
wifi: "M5 12a10 10 0 0 1 14 0M8 15a6 6 0 0 1 8 0M12 19h.01",
|
|
1597
|
+
battery: "M3 8h15v8H3zM21 11v2",
|
|
1598
|
+
printer: "M7 8V4h10v4M7 16H4V8h16v8h-3M7 13h10v7H7z",
|
|
1599
|
+
gift: "M4 10h16v10H4zM3 6h18v4H3zM12 6v14M12 6c-2 0-4-1-4-2.5S9 2 10 3s2 3 2 3zM12 6c2 0 4-1 4-2.5S15 2 14 3s-2 3-2 3z",
|
|
1600
|
+
key: "M15 4a5 5 0 1 0-4.6 7L9 12.4V15H6.5L4 17.5V20h4l7-7A5 5 0 0 0 15 4z",
|
|
1601
|
+
compass: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM15 9l-2 5-5 2 2-5z",
|
|
1602
|
+
flag: "M5 21V4h13l-2 4 2 4H5",
|
|
1603
|
+
award: "M12 4a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM9 13l-1 7 4-2 4 2-1-7",
|
|
1604
|
+
chart: "M4 20V4M4 20h16M8 16v-5M12 16V8M16 16v-8",
|
|
1605
|
+
pie: "M12 3a9 9 0 1 0 9 9h-9z",
|
|
1606
|
+
trending: "M3 17l6-6 4 4 8-8M15 7h6v6",
|
|
1607
|
+
dollar: "M12 3v18M16 7.5C16 6 14.2 5 12 5S8 6 8 7.5 9.5 10 12 10.5s4 1.5 4 3-1.8 2.5-4 2.5-4-1-4-2.5",
|
|
1608
|
+
percent: "M5 19L19 5M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM16.5 14a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z",
|
|
1609
|
+
truck: "M3 6h11v9H3zM14 9h4l3 3v3h-7zM7.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM17.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z",
|
|
1610
|
+
package: "M12 3l8 4v10l-8 4-8-4V7zM4 7l8 4 8-4M12 11v10",
|
|
1611
|
+
store: "M4 9h16v11H4zM4 9l1.5-5h13L20 9M9 20v-6h6v6",
|
|
1612
|
+
building: "M5 21V4h9v17M14 9h5v12M8 8h3M8 12h3M8 16h3M17 12h.01M17 16h.01",
|
|
1613
|
+
users: "M9 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 20c0-3.3 3.1-5 7-5s7 1.7 7 5M17 5a4 4 0 0 1 0 7.9M22 20c0-2.6-1.6-4.2-4-4.8",
|
|
1614
|
+
"thumbs-up": "M7 21V10h3l3-6a2 2 0 0 1 2 2v4h4l-2 11z",
|
|
1615
|
+
smile: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9 10h.01M15 10h.01M8.5 14.5a5 5 0 0 0 7 0",
|
|
1616
|
+
help: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.7M12 17h.01",
|
|
1617
|
+
checkbox: "M4 4h16v16H4zM8 12l3 3 5-5",
|
|
1618
|
+
list: "M8 6h13M8 12h13M8 18h13M3.5 6h.01M3.5 12h.01M3.5 18h.01",
|
|
1619
|
+
grid: "M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z",
|
|
1620
|
+
layers: "M12 3l9 5-9 5-9-5zM3 13l9 5 9-5",
|
|
1621
|
+
zap: "M13 3L5 14h6l-1 7 8-11h-6z",
|
|
1622
|
+
flame: "M12 21a6 6 0 0 0 6-6c0-4-4-6-4-10 0 0-3 1.5-3 5 0 1.5-1 2-1.5 1.5C8 10 7.5 9 7.5 9A7.5 7.5 0 0 0 6 15a6 6 0 0 0 6 6z",
|
|
1623
|
+
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1624
|
+
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1625
|
+
};
|
|
1626
|
+
function bt({ 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 }) {
|
|
1627
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [yt[e] ?? yt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ d("svg", {
|
|
1628
|
+
viewBox: "0 0 24 24",
|
|
1629
|
+
width: g,
|
|
1630
|
+
height: g,
|
|
1631
|
+
fill: m ? _ : "none",
|
|
1632
|
+
stroke: m ? "none" : _,
|
|
1633
|
+
strokeWidth: m ? void 0 : Math.min(Math.max(Number(i) || 2, .5), 4),
|
|
1634
|
+
strokeLinecap: m ? void 0 : "round",
|
|
1635
|
+
strokeLinejoin: m ? void 0 : "round",
|
|
1636
|
+
role: c ? "img" : void 0,
|
|
1637
|
+
"aria-label": c || void 0,
|
|
1638
|
+
"aria-hidden": c ? void 0 : "true",
|
|
1639
|
+
style: { display: "block" },
|
|
1640
|
+
children: h.map((e, t) => /* @__PURE__ */ d("path", { d: e }, t))
|
|
1641
|
+
}), y = {
|
|
1642
|
+
display: "inline-flex",
|
|
1643
|
+
lineHeight: 0,
|
|
1644
|
+
...P(l)
|
|
1645
|
+
};
|
|
1646
|
+
return o ? /* @__PURE__ */ d("a", {
|
|
1647
|
+
ref: u,
|
|
1648
|
+
href: o,
|
|
1649
|
+
onClick: f ? (e) => e.preventDefault() : void 0,
|
|
1650
|
+
target: s || void 0,
|
|
1651
|
+
rel: s === "_blank" ? "noopener noreferrer" : void 0,
|
|
1652
|
+
style: {
|
|
1653
|
+
...y,
|
|
1654
|
+
color: "inherit"
|
|
1655
|
+
},
|
|
1656
|
+
children: v
|
|
1657
|
+
}) : /* @__PURE__ */ d("span", {
|
|
1658
|
+
ref: u,
|
|
1659
|
+
style: y,
|
|
1660
|
+
children: v
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
function xt(e, t = {}, n = 0) {
|
|
1664
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Y(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1665
|
+
for (let e of r) {
|
|
1666
|
+
let n = e.data ?? e, r = we(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(we(n, t.nameField)) : i(n.name), l = t.hrefField ? i(we(n, t.hrefField)) : "";
|
|
1667
|
+
for (let e of s) if (o.push({
|
|
1668
|
+
src: e,
|
|
1669
|
+
name: c,
|
|
1670
|
+
alt: c,
|
|
1671
|
+
href: l
|
|
1672
|
+
}), a && o.length >= a) return o;
|
|
1673
|
+
}
|
|
1674
|
+
return o;
|
|
1675
|
+
}
|
|
1676
|
+
function St({ 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 }) {
|
|
1677
|
+
let { tenant: x, apiUrl: S } = i(J), C = i(ve)?.[t], [w, T] = l(null), [E, D] = l(() => /* @__PURE__ */ new Set());
|
|
1678
|
+
a(() => {
|
|
1679
|
+
if (!t || C) return;
|
|
1680
|
+
let e = !0;
|
|
1681
|
+
return fetch(`${S}/dynamic/${encodeURIComponent(t)}`, { headers: x ? { "x-tenant": x } : {} }).then((e) => e.json()).then((t) => {
|
|
1682
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
1683
|
+
e && T(n);
|
|
1684
|
+
}).catch(() => e && T([])), () => {
|
|
1685
|
+
e = !1;
|
|
1686
|
+
};
|
|
1687
|
+
}, [
|
|
1688
|
+
t,
|
|
1689
|
+
x,
|
|
1690
|
+
S,
|
|
1691
|
+
C
|
|
1692
|
+
]);
|
|
1693
|
+
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 ? (() => {
|
|
1694
|
+
let e = xt(k, {
|
|
1695
|
+
imageField: r,
|
|
1696
|
+
nameField: o,
|
|
1697
|
+
hrefField: s
|
|
1698
|
+
}, 0).filter((e) => !E.has(e.src));
|
|
1699
|
+
return A ? e.slice(0, A) : e;
|
|
1700
|
+
})() : null, M = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], N = j ?? M, F = !!t && !C && w === null, I = Math.max(0, Number(h) || 0), L = b ? (e) => e.preventDefault() : void 0, [R, z] = l(null), B = _ && !b && R !== null && N[R];
|
|
1701
|
+
a(() => {
|
|
1702
|
+
if (!B) return;
|
|
1338
1703
|
let e = (e) => {
|
|
1339
|
-
e.key === "Escape" &&
|
|
1704
|
+
e.key === "Escape" && z(null), e.key === "ArrowRight" && z((e) => (e + 1) % N.length), e.key === "ArrowLeft" && z((e) => (e - 1 + N.length) % N.length);
|
|
1340
1705
|
};
|
|
1341
1706
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1342
|
-
}, [
|
|
1343
|
-
let
|
|
1707
|
+
}, [B, N.length]);
|
|
1708
|
+
let V = (e) => {
|
|
1344
1709
|
if (typeof e.name == "string" && e.name.trim()) return e.name;
|
|
1345
1710
|
if (typeof e.alt == "string" && e.alt.trim()) return e.alt;
|
|
1346
1711
|
try {
|
|
@@ -1351,16 +1716,16 @@ function pt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1351
1716
|
}
|
|
1352
1717
|
};
|
|
1353
1718
|
return /* @__PURE__ */ f("div", {
|
|
1354
|
-
ref:
|
|
1719
|
+
ref: y,
|
|
1355
1720
|
style: {
|
|
1356
|
-
columnCount: Math.min(Math.max(Number(
|
|
1357
|
-
columnGap:
|
|
1721
|
+
columnCount: Math.min(Math.max(Number(m) || 3, 1), 8),
|
|
1722
|
+
columnGap: I,
|
|
1358
1723
|
width: "100%",
|
|
1359
|
-
...P(
|
|
1724
|
+
...P(v)
|
|
1360
1725
|
},
|
|
1361
1726
|
children: [
|
|
1362
|
-
|
|
1363
|
-
let
|
|
1727
|
+
N.map((e, n) => {
|
|
1728
|
+
let r = /* @__PURE__ */ f("span", {
|
|
1364
1729
|
style: {
|
|
1365
1730
|
position: "relative",
|
|
1366
1731
|
display: "block",
|
|
@@ -1370,12 +1735,13 @@ function pt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1370
1735
|
children: [/* @__PURE__ */ d("img", {
|
|
1371
1736
|
src: e.src,
|
|
1372
1737
|
alt: e.alt ?? "",
|
|
1738
|
+
onError: t ? () => D((t) => new Set(t).add(e.src)) : void 0,
|
|
1373
1739
|
style: {
|
|
1374
1740
|
width: "100%",
|
|
1375
1741
|
display: "block",
|
|
1376
1742
|
borderRadius: "inherit"
|
|
1377
1743
|
}
|
|
1378
|
-
}),
|
|
1744
|
+
}), g && V(e) && /* @__PURE__ */ d("span", {
|
|
1379
1745
|
style: {
|
|
1380
1746
|
position: "absolute",
|
|
1381
1747
|
insetInline: 0,
|
|
@@ -1389,41 +1755,41 @@ function pt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1389
1755
|
overflow: "hidden",
|
|
1390
1756
|
textOverflow: "ellipsis"
|
|
1391
1757
|
},
|
|
1392
|
-
children:
|
|
1758
|
+
children: V(e)
|
|
1393
1759
|
})]
|
|
1394
|
-
}),
|
|
1760
|
+
}), i = e.href ? /* @__PURE__ */ d("a", {
|
|
1395
1761
|
href: e.href,
|
|
1396
|
-
onClick:
|
|
1762
|
+
onClick: L,
|
|
1397
1763
|
target: e.target || void 0,
|
|
1398
1764
|
rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
1399
1765
|
style: {
|
|
1400
1766
|
display: "block",
|
|
1401
1767
|
borderRadius: "inherit"
|
|
1402
1768
|
},
|
|
1403
|
-
children:
|
|
1404
|
-
}) :
|
|
1769
|
+
children: r
|
|
1770
|
+
}) : _ && !b ? /* @__PURE__ */ d("span", {
|
|
1405
1771
|
role: "button",
|
|
1406
1772
|
tabIndex: 0,
|
|
1407
|
-
onClick: () =>
|
|
1408
|
-
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") &&
|
|
1773
|
+
onClick: () => z(n),
|
|
1774
|
+
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && z(n),
|
|
1409
1775
|
style: {
|
|
1410
1776
|
display: "block",
|
|
1411
1777
|
borderRadius: "inherit",
|
|
1412
1778
|
cursor: "zoom-in"
|
|
1413
1779
|
},
|
|
1414
|
-
children:
|
|
1415
|
-
}) :
|
|
1780
|
+
children: r
|
|
1781
|
+
}) : r;
|
|
1416
1782
|
return /* @__PURE__ */ d("div", {
|
|
1417
1783
|
style: {
|
|
1418
1784
|
breakInside: "avoid",
|
|
1419
|
-
marginBottom:
|
|
1785
|
+
marginBottom: I,
|
|
1420
1786
|
borderRadius: "inherit",
|
|
1421
1787
|
overflow: "hidden"
|
|
1422
1788
|
},
|
|
1423
|
-
children:
|
|
1424
|
-
},
|
|
1789
|
+
children: i
|
|
1790
|
+
}, n);
|
|
1425
1791
|
}),
|
|
1426
|
-
!
|
|
1792
|
+
!N.length && !F && /* @__PURE__ */ d("div", {
|
|
1427
1793
|
style: {
|
|
1428
1794
|
padding: "24px 12px",
|
|
1429
1795
|
fontSize: 13,
|
|
@@ -1431,12 +1797,12 @@ function pt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1431
1797
|
textAlign: "center",
|
|
1432
1798
|
columnSpan: "all"
|
|
1433
1799
|
},
|
|
1434
|
-
children: "Pick images in Settings to fill the gallery"
|
|
1800
|
+
children: t ? p || "No images yet" : "Pick images in Settings to fill the gallery"
|
|
1435
1801
|
}),
|
|
1436
|
-
|
|
1802
|
+
B && /* @__PURE__ */ f("div", {
|
|
1437
1803
|
role: "dialog",
|
|
1438
1804
|
"aria-modal": "true",
|
|
1439
|
-
onClick: () =>
|
|
1805
|
+
onClick: () => z(null),
|
|
1440
1806
|
style: {
|
|
1441
1807
|
position: "fixed",
|
|
1442
1808
|
inset: 0,
|
|
@@ -1450,8 +1816,8 @@ function pt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1450
1816
|
},
|
|
1451
1817
|
children: [
|
|
1452
1818
|
/* @__PURE__ */ d("img", {
|
|
1453
|
-
src:
|
|
1454
|
-
alt:
|
|
1819
|
+
src: N[R].src,
|
|
1820
|
+
alt: N[R].alt ?? "",
|
|
1455
1821
|
onClick: (e) => e.stopPropagation(),
|
|
1456
1822
|
style: {
|
|
1457
1823
|
maxWidth: "92vw",
|
|
@@ -1460,19 +1826,19 @@ function pt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1460
1826
|
boxShadow: "0 12px 48px rgba(0,0,0,0.5)"
|
|
1461
1827
|
}
|
|
1462
1828
|
}),
|
|
1463
|
-
|
|
1829
|
+
V(N[R]) && /* @__PURE__ */ d("div", {
|
|
1464
1830
|
style: {
|
|
1465
1831
|
color: "#fff",
|
|
1466
1832
|
fontSize: 14,
|
|
1467
1833
|
marginTop: 12,
|
|
1468
1834
|
opacity: .85
|
|
1469
1835
|
},
|
|
1470
|
-
children:
|
|
1836
|
+
children: V(N[R])
|
|
1471
1837
|
}),
|
|
1472
1838
|
/* @__PURE__ */ d("button", {
|
|
1473
1839
|
type: "button",
|
|
1474
1840
|
"aria-label": "Close",
|
|
1475
|
-
onClick: () =>
|
|
1841
|
+
onClick: () => z(null),
|
|
1476
1842
|
style: {
|
|
1477
1843
|
position: "absolute",
|
|
1478
1844
|
top: 16,
|
|
@@ -1486,11 +1852,11 @@ function pt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1486
1852
|
},
|
|
1487
1853
|
children: "×"
|
|
1488
1854
|
}),
|
|
1489
|
-
|
|
1855
|
+
N.length > 1 && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("button", {
|
|
1490
1856
|
type: "button",
|
|
1491
1857
|
"aria-label": "Previous",
|
|
1492
1858
|
onClick: (e) => {
|
|
1493
|
-
e.stopPropagation(),
|
|
1859
|
+
e.stopPropagation(), z((e) => (e - 1 + N.length) % N.length);
|
|
1494
1860
|
},
|
|
1495
1861
|
style: {
|
|
1496
1862
|
position: "absolute",
|
|
@@ -1509,7 +1875,7 @@ function pt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1509
1875
|
type: "button",
|
|
1510
1876
|
"aria-label": "Next",
|
|
1511
1877
|
onClick: (e) => {
|
|
1512
|
-
e.stopPropagation(),
|
|
1878
|
+
e.stopPropagation(), z((e) => (e + 1) % N.length);
|
|
1513
1879
|
},
|
|
1514
1880
|
style: {
|
|
1515
1881
|
position: "absolute",
|
|
@@ -1530,20 +1896,20 @@ function pt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1530
1896
|
]
|
|
1531
1897
|
});
|
|
1532
1898
|
}
|
|
1533
|
-
var
|
|
1899
|
+
var Ct = {
|
|
1534
1900
|
color: "inherit",
|
|
1535
1901
|
textDecoration: "none",
|
|
1536
1902
|
fontSize: 14,
|
|
1537
1903
|
opacity: .85
|
|
1538
|
-
},
|
|
1904
|
+
}, wt = {
|
|
1539
1905
|
background: "var(--page-surface, #f2f2f2)",
|
|
1540
1906
|
color: "var(--page-text, #111827)",
|
|
1541
1907
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1542
1908
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1543
1909
|
zIndex: 60
|
|
1544
1910
|
};
|
|
1545
|
-
function
|
|
1546
|
-
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 ? "" :
|
|
1911
|
+
function Tt(e, t = {}, n = "dropdown") {
|
|
1912
|
+
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 ? "" : Y(e), o = r.map((e) => {
|
|
1547
1913
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
1548
1914
|
return {
|
|
1549
1915
|
key: e.id,
|
|
@@ -1584,8 +1950,8 @@ function gt(e, t = {}, n = "dropdown") {
|
|
|
1584
1950
|
type: e.children.length ? n : "link"
|
|
1585
1951
|
}));
|
|
1586
1952
|
}
|
|
1587
|
-
function
|
|
1588
|
-
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(
|
|
1953
|
+
function Et({ 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" }) {
|
|
1954
|
+
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(J), N = i(ve)?.[g], [F, I] = l(null);
|
|
1589
1955
|
a(() => {
|
|
1590
1956
|
if (!g || N) return;
|
|
1591
1957
|
let e = !0;
|
|
@@ -1605,7 +1971,7 @@ function _t({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
1605
1971
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
1606
1972
|
return e.observe(C), () => e.disconnect();
|
|
1607
1973
|
}, [C, h]);
|
|
1608
|
-
let L = g ?
|
|
1974
|
+
let L = g ? Tt(N ?? F ?? [], {
|
|
1609
1975
|
labelField: _,
|
|
1610
1976
|
hrefField: v,
|
|
1611
1977
|
imageField: y,
|
|
@@ -1634,7 +2000,7 @@ function _t({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
1634
2000
|
return /* @__PURE__ */ f("a", {
|
|
1635
2001
|
href: e.href || "#",
|
|
1636
2002
|
style: {
|
|
1637
|
-
...
|
|
2003
|
+
...Ct,
|
|
1638
2004
|
display: n ? "block" : "flex",
|
|
1639
2005
|
alignItems: n ? void 0 : "center",
|
|
1640
2006
|
gap: n ? void 0 : 10,
|
|
@@ -1731,7 +2097,7 @@ function _t({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
1731
2097
|
let t = e.children ?? [];
|
|
1732
2098
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
1733
2099
|
href: e.href || "#",
|
|
1734
|
-
style:
|
|
2100
|
+
style: Ct,
|
|
1735
2101
|
children: e.label
|
|
1736
2102
|
}, e.key);
|
|
1737
2103
|
let n = e.type === "mega";
|
|
@@ -1745,7 +2111,7 @@ function _t({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
1745
2111
|
children: [/* @__PURE__ */ f("a", {
|
|
1746
2112
|
href: e.href || "#",
|
|
1747
2113
|
style: {
|
|
1748
|
-
...
|
|
2114
|
+
...Ct,
|
|
1749
2115
|
cursor: "pointer"
|
|
1750
2116
|
},
|
|
1751
2117
|
children: [
|
|
@@ -1761,7 +2127,7 @@ function _t({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
1761
2127
|
]
|
|
1762
2128
|
}), k === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
1763
2129
|
style: {
|
|
1764
|
-
...
|
|
2130
|
+
...wt,
|
|
1765
2131
|
position: "absolute",
|
|
1766
2132
|
left: 0,
|
|
1767
2133
|
right: 0,
|
|
@@ -1777,7 +2143,7 @@ function _t({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
1777
2143
|
}, !0))
|
|
1778
2144
|
}) : /* @__PURE__ */ d("div", {
|
|
1779
2145
|
style: {
|
|
1780
|
-
...
|
|
2146
|
+
...wt,
|
|
1781
2147
|
position: "absolute",
|
|
1782
2148
|
top: "100%",
|
|
1783
2149
|
left: 0,
|
|
@@ -1806,7 +2172,7 @@ function _t({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
1806
2172
|
children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
1807
2173
|
href: e.href || "#",
|
|
1808
2174
|
style: {
|
|
1809
|
-
...
|
|
2175
|
+
...Ct,
|
|
1810
2176
|
padding: "10px 4px",
|
|
1811
2177
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
1812
2178
|
opacity: 1
|
|
@@ -1817,7 +2183,7 @@ function _t({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
1817
2183
|
]
|
|
1818
2184
|
});
|
|
1819
2185
|
}
|
|
1820
|
-
function
|
|
2186
|
+
function Dt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1821
2187
|
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1822
2188
|
return e.length ? /* @__PURE__ */ f("div", {
|
|
1823
2189
|
ref: r,
|
|
@@ -1857,7 +2223,7 @@ function vt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1857
2223
|
}, e.key))]
|
|
1858
2224
|
}) : null;
|
|
1859
2225
|
}
|
|
1860
|
-
function
|
|
2226
|
+
function Ot({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1861
2227
|
let [a, o] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
1862
2228
|
if (!e.length) return null;
|
|
1863
2229
|
let s = (e) => o((t) => {
|
|
@@ -1914,15 +2280,15 @@ function yt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1914
2280
|
})
|
|
1915
2281
|
});
|
|
1916
2282
|
}
|
|
1917
|
-
var
|
|
2283
|
+
var kt = {
|
|
1918
2284
|
display: "flex",
|
|
1919
2285
|
flexDirection: "column",
|
|
1920
2286
|
gap: "12px"
|
|
1921
|
-
},
|
|
2287
|
+
}, At = {
|
|
1922
2288
|
fontSize: "14px",
|
|
1923
2289
|
fontWeight: 500,
|
|
1924
2290
|
color: "var(--page-text, #111827)"
|
|
1925
|
-
},
|
|
2291
|
+
}, jt = {
|
|
1926
2292
|
padding: "10px 12px",
|
|
1927
2293
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
1928
2294
|
borderRadius: "6px",
|
|
@@ -1932,7 +2298,7 @@ var bt = {
|
|
|
1932
2298
|
boxSizing: "border-box",
|
|
1933
2299
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
1934
2300
|
color: "var(--page-text, #111827)"
|
|
1935
|
-
},
|
|
2301
|
+
}, Mt = {
|
|
1936
2302
|
display: "flex",
|
|
1937
2303
|
alignItems: "center",
|
|
1938
2304
|
gap: "8px",
|
|
@@ -1943,7 +2309,7 @@ var bt = {
|
|
|
1943
2309
|
tabIndex: -1,
|
|
1944
2310
|
onMouseDown: (e) => e.preventDefault()
|
|
1945
2311
|
} : {};
|
|
1946
|
-
function
|
|
2312
|
+
function Nt(e, t) {
|
|
1947
2313
|
if (!e) return !0;
|
|
1948
2314
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
1949
2315
|
switch (e.op) {
|
|
@@ -1957,11 +2323,11 @@ function St(e, t) {
|
|
|
1957
2323
|
default: return !1;
|
|
1958
2324
|
}
|
|
1959
2325
|
}
|
|
1960
|
-
var
|
|
2326
|
+
var Pt = {
|
|
1961
2327
|
display: "flex",
|
|
1962
2328
|
flexDirection: "column",
|
|
1963
2329
|
gap: 6
|
|
1964
|
-
},
|
|
2330
|
+
}, Ft = {
|
|
1965
2331
|
font: "inherit",
|
|
1966
2332
|
fontSize: 15,
|
|
1967
2333
|
padding: "10px 12px",
|
|
@@ -1972,16 +2338,17 @@ var Ct = {
|
|
|
1972
2338
|
width: "100%",
|
|
1973
2339
|
boxSizing: "border-box"
|
|
1974
2340
|
};
|
|
1975
|
-
function
|
|
2341
|
+
function It(e, t) {
|
|
1976
2342
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
1977
2343
|
if (!e?.parentField) return n;
|
|
1978
2344
|
let r = t?.[e.parentField];
|
|
1979
2345
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
1980
2346
|
}
|
|
1981
|
-
|
|
2347
|
+
var Lt = "g-recaptcha-response", Rt = (e) => e?.type === "recaptcha" ? Lt : e?.name;
|
|
2348
|
+
function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
1982
2349
|
let a = /* @__PURE__ */ f("span", {
|
|
1983
2350
|
style: {
|
|
1984
|
-
...
|
|
2351
|
+
...At,
|
|
1985
2352
|
fontSize: 14
|
|
1986
2353
|
},
|
|
1987
2354
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -1990,7 +2357,7 @@ function Et({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1990
2357
|
required: e.required || void 0,
|
|
1991
2358
|
placeholder: e.placeholder || void 0,
|
|
1992
2359
|
disabled: r || void 0,
|
|
1993
|
-
style:
|
|
2360
|
+
style: Ft,
|
|
1994
2361
|
value: t ?? "",
|
|
1995
2362
|
onChange: (t) => n(e.name, t.target.value)
|
|
1996
2363
|
};
|
|
@@ -2019,7 +2386,12 @@ function Et({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2019
2386
|
borderRadius: 8,
|
|
2020
2387
|
display: "block"
|
|
2021
2388
|
}
|
|
2022
|
-
}) : null : e.type === "
|
|
2389
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(Wt, {
|
|
2390
|
+
theme: e.captchaTheme,
|
|
2391
|
+
size: e.captchaSize,
|
|
2392
|
+
inert: r,
|
|
2393
|
+
onChange: (e) => n(Lt, e)
|
|
2394
|
+
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(tt, {
|
|
2023
2395
|
url: e.src,
|
|
2024
2396
|
style: { width: "100%" }
|
|
2025
2397
|
}) : /* @__PURE__ */ d("video", {
|
|
@@ -2031,14 +2403,14 @@ function Et({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2031
2403
|
display: "block"
|
|
2032
2404
|
}
|
|
2033
2405
|
}) : null : /* @__PURE__ */ f("label", {
|
|
2034
|
-
style:
|
|
2406
|
+
style: Pt,
|
|
2035
2407
|
children: [
|
|
2036
2408
|
a,
|
|
2037
2409
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
|
|
2038
2410
|
...o,
|
|
2039
2411
|
rows: 4,
|
|
2040
2412
|
style: {
|
|
2041
|
-
...
|
|
2413
|
+
...Ft,
|
|
2042
2414
|
resize: "vertical"
|
|
2043
2415
|
}
|
|
2044
2416
|
}) : e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
@@ -2047,7 +2419,7 @@ function Et({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2047
2419
|
children: [/* @__PURE__ */ d("option", {
|
|
2048
2420
|
value: "",
|
|
2049
2421
|
children: e.placeholder || "—"
|
|
2050
|
-
}),
|
|
2422
|
+
}), It(e, i).map((e, t) => /* @__PURE__ */ d("option", {
|
|
2051
2423
|
value: typeof e == "string" ? e : e.value,
|
|
2052
2424
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2053
2425
|
}, t))]
|
|
@@ -2094,8 +2466,8 @@ function Et({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2094
2466
|
]
|
|
2095
2467
|
});
|
|
2096
2468
|
}
|
|
2097
|
-
function
|
|
2098
|
-
let { tenant: y, apiUrl: b } = i(
|
|
2469
|
+
function Bt({ 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 }) {
|
|
2470
|
+
let { tenant: y, apiUrl: b } = i(J), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [D, O] = l(0), k = h ? v || "form" : x;
|
|
2099
2471
|
a(() => {
|
|
2100
2472
|
if (!c || !s) return;
|
|
2101
2473
|
let e = !0;
|
|
@@ -2116,11 +2488,11 @@ function Dt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2116
2488
|
section: e,
|
|
2117
2489
|
fields: []
|
|
2118
2490
|
}) : A[A.length - 1].fields.push(e);
|
|
2119
|
-
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section ||
|
|
2491
|
+
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Nt(e.section.condition, T)).map((e) => ({
|
|
2120
2492
|
...e,
|
|
2121
|
-
fields: e.fields.filter((e) =>
|
|
2493
|
+
fields: e.fields.filter((e) => Nt(e.condition, T))
|
|
2122
2494
|
})), 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) => {
|
|
2123
|
-
let t = T[e
|
|
2495
|
+
let t = T[Rt(e)];
|
|
2124
2496
|
return e.required && (t == null || t === "" || t === !1);
|
|
2125
2497
|
}), R = F >= M.length - 1, z = (e, t) => E((n) => {
|
|
2126
2498
|
let r = {
|
|
@@ -2176,11 +2548,11 @@ function Dt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2176
2548
|
}
|
|
2177
2549
|
},
|
|
2178
2550
|
style: {
|
|
2179
|
-
...
|
|
2551
|
+
...kt,
|
|
2180
2552
|
display: k === "success" ? "none" : "flex"
|
|
2181
2553
|
},
|
|
2182
2554
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
2183
|
-
N && /* @__PURE__ */ d(
|
|
2555
|
+
N && /* @__PURE__ */ d(hn, {
|
|
2184
2556
|
steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2185
2557
|
active: F + 1,
|
|
2186
2558
|
style: { marginBottom: 8 }
|
|
@@ -2193,9 +2565,9 @@ function Dt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2193
2565
|
},
|
|
2194
2566
|
children: M[F].section.help
|
|
2195
2567
|
}),
|
|
2196
|
-
I.map((e) => /* @__PURE__ */ d(
|
|
2568
|
+
I.map((e) => /* @__PURE__ */ d(zt, {
|
|
2197
2569
|
field: e,
|
|
2198
|
-
value: T[e
|
|
2570
|
+
value: T[Rt(e)],
|
|
2199
2571
|
values: T,
|
|
2200
2572
|
onChange: z,
|
|
2201
2573
|
inert: h
|
|
@@ -2212,7 +2584,7 @@ function Dt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2212
2584
|
disabled: h || void 0,
|
|
2213
2585
|
onClick: () => O(F - 1),
|
|
2214
2586
|
style: {
|
|
2215
|
-
...
|
|
2587
|
+
...ke,
|
|
2216
2588
|
background: "transparent",
|
|
2217
2589
|
color: "inherit",
|
|
2218
2590
|
border: 0,
|
|
@@ -2225,7 +2597,7 @@ function Dt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2225
2597
|
disabled: h || L.length > 0,
|
|
2226
2598
|
onClick: () => O(F + 1),
|
|
2227
2599
|
style: {
|
|
2228
|
-
...
|
|
2600
|
+
...ke,
|
|
2229
2601
|
border: 0,
|
|
2230
2602
|
padding: "10px 22px",
|
|
2231
2603
|
borderRadius: 8,
|
|
@@ -2239,7 +2611,7 @@ function Dt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2239
2611
|
type: "submit",
|
|
2240
2612
|
disabled: h || void 0,
|
|
2241
2613
|
style: {
|
|
2242
|
-
...
|
|
2614
|
+
...ke,
|
|
2243
2615
|
border: 0,
|
|
2244
2616
|
padding: "10px 22px",
|
|
2245
2617
|
borderRadius: 8,
|
|
@@ -2266,10 +2638,10 @@ function Dt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2266
2638
|
]
|
|
2267
2639
|
});
|
|
2268
2640
|
}
|
|
2269
|
-
var
|
|
2641
|
+
var Vt = null, Ht = null, Ut = (e) => {
|
|
2270
2642
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2271
|
-
if (
|
|
2272
|
-
if (
|
|
2643
|
+
if (Vt && Ht === t) return Vt;
|
|
2644
|
+
if (Vt && typeof window < "u") {
|
|
2273
2645
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2274
2646
|
delete window[e];
|
|
2275
2647
|
} catch {
|
|
@@ -2277,22 +2649,22 @@ var Ot = null, kt = null, At = (e) => {
|
|
|
2277
2649
|
}
|
|
2278
2650
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2279
2651
|
}
|
|
2280
|
-
return
|
|
2652
|
+
return Ht = t, Vt = new Promise((e) => {
|
|
2281
2653
|
if (typeof window > "u") return;
|
|
2282
2654
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2283
2655
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2284
2656
|
let n = document.createElement("script");
|
|
2285
2657
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2286
|
-
}),
|
|
2658
|
+
}), Vt;
|
|
2287
2659
|
};
|
|
2288
|
-
function
|
|
2289
|
-
let p = i(
|
|
2660
|
+
function Wt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
|
|
2661
|
+
let p = i(J), 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);
|
|
2290
2662
|
if (_.current = u, a(() => {
|
|
2291
2663
|
if (l || !h || !g.current) return;
|
|
2292
2664
|
let e = !0, i = (t) => {
|
|
2293
2665
|
e && typeof _.current == "function" && _.current(t);
|
|
2294
2666
|
};
|
|
2295
|
-
return
|
|
2667
|
+
return Ut(r).then((r) => {
|
|
2296
2668
|
if (!(!e || !g.current || !r?.render)) {
|
|
2297
2669
|
g.current.innerHTML = "", i("");
|
|
2298
2670
|
try {
|
|
@@ -2374,17 +2746,17 @@ function jt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
|
|
|
2374
2746
|
children: /* @__PURE__ */ d("div", { ref: g })
|
|
2375
2747
|
}) : null;
|
|
2376
2748
|
}
|
|
2377
|
-
function
|
|
2749
|
+
function Gt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2378
2750
|
return /* @__PURE__ */ d("label", {
|
|
2379
2751
|
ref: r,
|
|
2380
2752
|
style: {
|
|
2381
|
-
...
|
|
2753
|
+
...At,
|
|
2382
2754
|
...P(n)
|
|
2383
2755
|
},
|
|
2384
2756
|
children: X(t, e, i)
|
|
2385
2757
|
});
|
|
2386
2758
|
}
|
|
2387
|
-
function
|
|
2759
|
+
function Kt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2388
2760
|
return /* @__PURE__ */ d("input", {
|
|
2389
2761
|
ref: a,
|
|
2390
2762
|
type: e,
|
|
@@ -2392,13 +2764,13 @@ function Nt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2392
2764
|
placeholder: n,
|
|
2393
2765
|
required: !o && !!r,
|
|
2394
2766
|
style: {
|
|
2395
|
-
...
|
|
2767
|
+
...jt,
|
|
2396
2768
|
...P(i)
|
|
2397
2769
|
},
|
|
2398
2770
|
...$(o)
|
|
2399
2771
|
});
|
|
2400
2772
|
}
|
|
2401
|
-
function
|
|
2773
|
+
function qt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2402
2774
|
return /* @__PURE__ */ d("textarea", {
|
|
2403
2775
|
ref: a,
|
|
2404
2776
|
name: e || void 0,
|
|
@@ -2406,18 +2778,18 @@ function Pt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2406
2778
|
rows: n,
|
|
2407
2779
|
required: !o && !!r,
|
|
2408
2780
|
style: {
|
|
2409
|
-
...
|
|
2781
|
+
...jt,
|
|
2410
2782
|
resize: "vertical",
|
|
2411
2783
|
...P(i)
|
|
2412
2784
|
},
|
|
2413
2785
|
...$(o)
|
|
2414
2786
|
});
|
|
2415
2787
|
}
|
|
2416
|
-
function
|
|
2788
|
+
function Jt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2417
2789
|
return /* @__PURE__ */ f("label", {
|
|
2418
2790
|
ref: o,
|
|
2419
2791
|
style: {
|
|
2420
|
-
...
|
|
2792
|
+
...Mt,
|
|
2421
2793
|
...P(a)
|
|
2422
2794
|
},
|
|
2423
2795
|
children: [/* @__PURE__ */ d("input", {
|
|
@@ -2434,7 +2806,7 @@ function Ft({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2434
2806
|
}), t]
|
|
2435
2807
|
});
|
|
2436
2808
|
}
|
|
2437
|
-
function
|
|
2809
|
+
function Yt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2438
2810
|
return /* @__PURE__ */ f("select", {
|
|
2439
2811
|
ref: a,
|
|
2440
2812
|
name: e || void 0,
|
|
@@ -2443,7 +2815,7 @@ function It({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2443
2815
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2444
2816
|
tabIndex: o ? -1 : void 0,
|
|
2445
2817
|
style: {
|
|
2446
|
-
...
|
|
2818
|
+
...jt,
|
|
2447
2819
|
appearance: "auto",
|
|
2448
2820
|
...P(i)
|
|
2449
2821
|
},
|
|
@@ -2457,12 +2829,12 @@ function It({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2457
2829
|
}, t))]
|
|
2458
2830
|
});
|
|
2459
2831
|
}
|
|
2460
|
-
function
|
|
2832
|
+
function Xt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2461
2833
|
let [s, c] = l(null);
|
|
2462
2834
|
return /* @__PURE__ */ f("label", {
|
|
2463
2835
|
ref: a,
|
|
2464
2836
|
style: {
|
|
2465
|
-
...
|
|
2837
|
+
...jt,
|
|
2466
2838
|
display: "flex",
|
|
2467
2839
|
alignItems: "center",
|
|
2468
2840
|
gap: "8px",
|
|
@@ -2489,12 +2861,12 @@ function Lt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
2489
2861
|
]
|
|
2490
2862
|
});
|
|
2491
2863
|
}
|
|
2492
|
-
function
|
|
2864
|
+
function Zt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
2493
2865
|
return /* @__PURE__ */ d("button", {
|
|
2494
2866
|
ref: n,
|
|
2495
2867
|
type: r ? "button" : "submit",
|
|
2496
2868
|
style: {
|
|
2497
|
-
...
|
|
2869
|
+
...ke,
|
|
2498
2870
|
border: 0,
|
|
2499
2871
|
cursor: "pointer",
|
|
2500
2872
|
alignSelf: "flex-start",
|
|
@@ -2509,7 +2881,7 @@ function Rt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2509
2881
|
children: e
|
|
2510
2882
|
});
|
|
2511
2883
|
}
|
|
2512
|
-
function
|
|
2884
|
+
function Qt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
2513
2885
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
2514
2886
|
return /* @__PURE__ */ d("div", {
|
|
2515
2887
|
ref: r,
|
|
@@ -2526,8 +2898,8 @@ function zt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2526
2898
|
}, t))
|
|
2527
2899
|
});
|
|
2528
2900
|
}
|
|
2529
|
-
function
|
|
2530
|
-
let { tenant: v, apiUrl: y, locale: b } = i(
|
|
2901
|
+
function $t({ 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: _ }) {
|
|
2902
|
+
let { tenant: v, apiUrl: y, locale: b } = i(J), x = i(Se), S = i(ve), [, C] = l(0);
|
|
2531
2903
|
a(() => {
|
|
2532
2904
|
if (typeof window > "u") return;
|
|
2533
2905
|
let e = () => C((e) => e + 1);
|
|
@@ -2535,7 +2907,7 @@ function Bt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2535
2907
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
2536
2908
|
};
|
|
2537
2909
|
}, []);
|
|
2538
|
-
let w =
|
|
2910
|
+
let w = xe(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? ye(S) : 1, [k, A] = l(null);
|
|
2539
2911
|
if (a(() => {
|
|
2540
2912
|
if (!e || D) return;
|
|
2541
2913
|
let n = !0, r = new URLSearchParams();
|
|
@@ -2580,7 +2952,7 @@ function Bt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2580
2952
|
},
|
|
2581
2953
|
children: M.map((e) => /* @__PURE__ */ d("div", {
|
|
2582
2954
|
style: { minWidth: 0 },
|
|
2583
|
-
children: x.render(p, (t) =>
|
|
2955
|
+
children: x.render(p, (t) => Ee(t, e))
|
|
2584
2956
|
}, e.id ?? e?.data?.slug))
|
|
2585
2957
|
}) : /* @__PURE__ */ d("div", {
|
|
2586
2958
|
ref: _,
|
|
@@ -2590,7 +2962,7 @@ function Bt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2590
2962
|
...P(g)
|
|
2591
2963
|
},
|
|
2592
2964
|
children: M.map((e) => {
|
|
2593
|
-
let t = o ?
|
|
2965
|
+
let t = o ? we(e?.data, o) : null, r = s ? Y(we(e?.data, s)) : null, i = c ? we(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : Y(i), u = n === "list";
|
|
2594
2966
|
return /* @__PURE__ */ f("div", {
|
|
2595
2967
|
style: {
|
|
2596
2968
|
display: "flex",
|
|
@@ -2645,8 +3017,8 @@ function Bt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2645
3017
|
})
|
|
2646
3018
|
});
|
|
2647
3019
|
}
|
|
2648
|
-
function
|
|
2649
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3020
|
+
function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3021
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : be(), s = {
|
|
2650
3022
|
height: 34,
|
|
2651
3023
|
padding: "0 12px",
|
|
2652
3024
|
borderRadius: 8,
|
|
@@ -2748,7 +3120,7 @@ function Vt({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2748
3120
|
})]
|
|
2749
3121
|
});
|
|
2750
3122
|
}
|
|
2751
|
-
function
|
|
3123
|
+
function tn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
2752
3124
|
return e.length ? /* @__PURE__ */ d("nav", {
|
|
2753
3125
|
ref: r,
|
|
2754
3126
|
"aria-label": "Breadcrumb",
|
|
@@ -2798,8 +3170,8 @@ function Ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2798
3170
|
})
|
|
2799
3171
|
}) : null;
|
|
2800
3172
|
}
|
|
2801
|
-
function
|
|
2802
|
-
let { tenant: g, apiUrl: _ } = i(
|
|
3173
|
+
function nn({ 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 }) {
|
|
3174
|
+
let { tenant: g, apiUrl: _ } = i(J), v = i(ve), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
2803
3175
|
a(() => {
|
|
2804
3176
|
if (!o || Number.isFinite(x)) return;
|
|
2805
3177
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -2818,7 +3190,7 @@ function Ut({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
2818
3190
|
]);
|
|
2819
3191
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
2820
3192
|
if (o && C === null || o && u && !(C > 0)) return null;
|
|
2821
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3193
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? ye(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
2822
3194
|
if (o) {
|
|
2823
3195
|
if (typeof window < "u") {
|
|
2824
3196
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -2883,15 +3255,15 @@ function Ut({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
2883
3255
|
]
|
|
2884
3256
|
});
|
|
2885
3257
|
}
|
|
2886
|
-
var
|
|
3258
|
+
var rn = "webim.page_mode", an = () => {
|
|
2887
3259
|
if (typeof window > "u") return "auto";
|
|
2888
3260
|
try {
|
|
2889
|
-
let e = window.localStorage.getItem(
|
|
3261
|
+
let e = window.localStorage.getItem(rn);
|
|
2890
3262
|
return e === "light" || e === "dark" ? e : "auto";
|
|
2891
3263
|
} catch {
|
|
2892
3264
|
return "auto";
|
|
2893
3265
|
}
|
|
2894
|
-
},
|
|
3266
|
+
}, on = (e) => {
|
|
2895
3267
|
let t = {
|
|
2896
3268
|
width: 16,
|
|
2897
3269
|
height: 16,
|
|
@@ -2923,13 +3295,13 @@ var Wt = "webim.page_mode", Gt = () => {
|
|
|
2923
3295
|
rx: "2"
|
|
2924
3296
|
}), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
|
|
2925
3297
|
});
|
|
2926
|
-
},
|
|
3298
|
+
}, sn = {
|
|
2927
3299
|
light: "Light theme",
|
|
2928
3300
|
dark: "Dark theme",
|
|
2929
3301
|
auto: "Follow the device theme"
|
|
2930
3302
|
};
|
|
2931
|
-
function
|
|
2932
|
-
let [o, s] = l(i ? "auto" :
|
|
3303
|
+
function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
3304
|
+
let [o, s] = l(i ? "auto" : an), u = c(null), f = (e) => {
|
|
2933
3305
|
u.current = e, typeof r == "function" && r(e);
|
|
2934
3306
|
};
|
|
2935
3307
|
a(() => {
|
|
@@ -2937,7 +3309,7 @@ function Jt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
2937
3309
|
let e = u.current?.closest?.(".webim-page");
|
|
2938
3310
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
2939
3311
|
try {
|
|
2940
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3312
|
+
o === "auto" ? window.localStorage.removeItem(rn) : window.localStorage.setItem(rn, o);
|
|
2941
3313
|
} catch {}
|
|
2942
3314
|
}, [o, i]);
|
|
2943
3315
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -2972,8 +3344,8 @@ function Jt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
2972
3344
|
},
|
|
2973
3345
|
children: p.map((e) => /* @__PURE__ */ d("button", {
|
|
2974
3346
|
type: "button",
|
|
2975
|
-
title:
|
|
2976
|
-
"aria-label":
|
|
3347
|
+
title: sn[e],
|
|
3348
|
+
"aria-label": sn[e],
|
|
2977
3349
|
"aria-pressed": e === m,
|
|
2978
3350
|
onClick: i ? void 0 : () => s(e),
|
|
2979
3351
|
style: {
|
|
@@ -2984,15 +3356,15 @@ function Jt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
2984
3356
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
2985
3357
|
opacity: e === m ? 1 : .7
|
|
2986
3358
|
},
|
|
2987
|
-
children:
|
|
3359
|
+
children: on(e)
|
|
2988
3360
|
}, e))
|
|
2989
3361
|
});
|
|
2990
3362
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
2991
3363
|
return /* @__PURE__ */ d("button", {
|
|
2992
3364
|
ref: f,
|
|
2993
3365
|
type: "button",
|
|
2994
|
-
title:
|
|
2995
|
-
"aria-label": `Theme: ${
|
|
3366
|
+
title: sn[m],
|
|
3367
|
+
"aria-label": `Theme: ${sn[m]} — switch to ${sn[g]}`,
|
|
2996
3368
|
onClick: i ? void 0 : () => s(g),
|
|
2997
3369
|
style: {
|
|
2998
3370
|
...h,
|
|
@@ -3001,10 +3373,10 @@ function Jt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3001
3373
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3002
3374
|
...P(n)
|
|
3003
3375
|
},
|
|
3004
|
-
children:
|
|
3376
|
+
children: on(m)
|
|
3005
3377
|
});
|
|
3006
3378
|
}
|
|
3007
|
-
function
|
|
3379
|
+
function ln(e) {
|
|
3008
3380
|
let t = e?.parentElement;
|
|
3009
3381
|
for (; t && t !== document.body;) {
|
|
3010
3382
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3013,7 +3385,7 @@ function Yt(e) {
|
|
|
3013
3385
|
}
|
|
3014
3386
|
return window;
|
|
3015
3387
|
}
|
|
3016
|
-
var
|
|
3388
|
+
var un = (e) => e === window ? window.scrollY : e.scrollTop, dn = {
|
|
3017
3389
|
"bottom-right": (e) => ({
|
|
3018
3390
|
right: e,
|
|
3019
3391
|
bottom: e
|
|
@@ -3028,7 +3400,7 @@ var Xt = (e) => e === window ? window.scrollY : e.scrollTop, Zt = {
|
|
|
3028
3400
|
transform: "translateX(-50%)"
|
|
3029
3401
|
})
|
|
3030
3402
|
};
|
|
3031
|
-
function
|
|
3403
|
+
function fn({ 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 }) {
|
|
3032
3404
|
let [_, v] = l(!!m), [y, b] = l(null), x = (e) => {
|
|
3033
3405
|
b(e), typeof p == "function" && p(e);
|
|
3034
3406
|
};
|
|
@@ -3039,8 +3411,8 @@ function Qt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3039
3411
|
}
|
|
3040
3412
|
if (!y) return;
|
|
3041
3413
|
let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
|
|
3042
|
-
let t =
|
|
3043
|
-
v(n ||
|
|
3414
|
+
let t = ln(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
3415
|
+
v(n || un(t) > e);
|
|
3044
3416
|
};
|
|
3045
3417
|
return t(), document.addEventListener("scroll", t, {
|
|
3046
3418
|
capture: !0,
|
|
@@ -3054,7 +3426,7 @@ function Qt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3054
3426
|
]);
|
|
3055
3427
|
let S = () => {
|
|
3056
3428
|
if (m) return;
|
|
3057
|
-
let e =
|
|
3429
|
+
let e = ln(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3058
3430
|
e === window ? window.scrollTo({
|
|
3059
3431
|
top: 0,
|
|
3060
3432
|
behavior: n
|
|
@@ -3062,7 +3434,7 @@ function Qt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3062
3434
|
top: 0,
|
|
3063
3435
|
behavior: n
|
|
3064
3436
|
});
|
|
3065
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
3437
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = dn[n] ? n : "bottom-right", D = h ? {
|
|
3066
3438
|
position: "fixed",
|
|
3067
3439
|
zIndex: 5,
|
|
3068
3440
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3075,7 +3447,7 @@ function Qt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3075
3447
|
} : {
|
|
3076
3448
|
position: "fixed",
|
|
3077
3449
|
zIndex: 2147482e3,
|
|
3078
|
-
...
|
|
3450
|
+
...dn[E](C)
|
|
3079
3451
|
};
|
|
3080
3452
|
return /* @__PURE__ */ f("button", {
|
|
3081
3453
|
ref: x,
|
|
@@ -3126,7 +3498,7 @@ function Qt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3126
3498
|
}), w ? /* @__PURE__ */ d("span", { children: T }) : null]
|
|
3127
3499
|
});
|
|
3128
3500
|
}
|
|
3129
|
-
var
|
|
3501
|
+
var pn = {
|
|
3130
3502
|
facebook: {
|
|
3131
3503
|
label: "Facebook",
|
|
3132
3504
|
color: "#1877f2",
|
|
@@ -3193,8 +3565,8 @@ var $t = {
|
|
|
3193
3565
|
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"
|
|
3194
3566
|
}
|
|
3195
3567
|
};
|
|
3196
|
-
function
|
|
3197
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
3568
|
+
function mn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
3569
|
+
let l = Array.isArray(e) ? e.filter((e) => e && pn[e.network]) : [];
|
|
3198
3570
|
if (!l.length) return null;
|
|
3199
3571
|
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;
|
|
3200
3572
|
return /* @__PURE__ */ d("div", {
|
|
@@ -3207,7 +3579,7 @@ function en({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3207
3579
|
...P(o)
|
|
3208
3580
|
},
|
|
3209
3581
|
children: l.map((e, r) => {
|
|
3210
|
-
let i =
|
|
3582
|
+
let i = pn[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);
|
|
3211
3583
|
return /* @__PURE__ */ d("a", {
|
|
3212
3584
|
href: e.url || "#",
|
|
3213
3585
|
onClick: h,
|
|
@@ -3241,7 +3613,7 @@ function en({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3241
3613
|
})
|
|
3242
3614
|
});
|
|
3243
3615
|
}
|
|
3244
|
-
function
|
|
3616
|
+
function hn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3245
3617
|
if (!e.length) return null;
|
|
3246
3618
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
3247
3619
|
width: 32,
|
|
@@ -3319,7 +3691,7 @@ function tn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3319
3691
|
})
|
|
3320
3692
|
});
|
|
3321
3693
|
}
|
|
3322
|
-
var
|
|
3694
|
+
var gn = {
|
|
3323
3695
|
small: {
|
|
3324
3696
|
w: 132,
|
|
3325
3697
|
h: 46,
|
|
@@ -3341,10 +3713,10 @@ var nn = {
|
|
|
3341
3713
|
title: 12.5,
|
|
3342
3714
|
avatar: 46
|
|
3343
3715
|
}
|
|
3344
|
-
},
|
|
3345
|
-
|
|
3346
|
-
function
|
|
3347
|
-
let r =
|
|
3716
|
+
}, _n = (e) => gn[e] ?? gn.medium;
|
|
3717
|
+
gn.medium.w, gn.medium.h;
|
|
3718
|
+
function vn(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
3719
|
+
let r = _n(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
|
|
3348
3720
|
for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
|
|
3349
3721
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
3350
3722
|
if (t.has(e.id)) return 0;
|
|
@@ -3396,19 +3768,19 @@ function an(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
3396
3768
|
horizontal: n
|
|
3397
3769
|
};
|
|
3398
3770
|
}
|
|
3399
|
-
var
|
|
3771
|
+
var yn = (e, t) => {
|
|
3400
3772
|
let n = String(e ?? "");
|
|
3401
3773
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3402
|
-
},
|
|
3774
|
+
}, bn = (e) => {
|
|
3403
3775
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3404
3776
|
if (!t) return "#ffffff";
|
|
3405
3777
|
let n = t[1];
|
|
3406
3778
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3407
3779
|
let r = parseInt(n, 16);
|
|
3408
3780
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3409
|
-
},
|
|
3410
|
-
function
|
|
3411
|
-
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 ? "" :
|
|
3781
|
+
}, xn = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
3782
|
+
function Sn(e, t = {}) {
|
|
3783
|
+
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 ? "" : Y(e);
|
|
3412
3784
|
return n.map((e) => {
|
|
3413
3785
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3414
3786
|
return {
|
|
@@ -3422,11 +3794,11 @@ function ln(e, t = {}) {
|
|
|
3422
3794
|
};
|
|
3423
3795
|
});
|
|
3424
3796
|
}
|
|
3425
|
-
var
|
|
3797
|
+
var Cn = {
|
|
3426
3798
|
size: 36,
|
|
3427
3799
|
pad: 10
|
|
3428
3800
|
};
|
|
3429
|
-
function
|
|
3801
|
+
function wn({ node: e, onClose: t }) {
|
|
3430
3802
|
return a(() => {
|
|
3431
3803
|
let e = (e) => e.key === "Escape" && t();
|
|
3432
3804
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -3547,8 +3919,8 @@ function dn({ node: e, onClose: t }) {
|
|
|
3547
3919
|
})
|
|
3548
3920
|
});
|
|
3549
3921
|
}
|
|
3550
|
-
function
|
|
3551
|
-
let b = o(), [x, S] = l(null), { tenant: C, apiUrl: w } = i(
|
|
3922
|
+
function Tn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
|
|
3923
|
+
let b = o(), [x, S] = l(null), { tenant: C, apiUrl: w } = i(J), T = i(ve)?.[t], [E, D] = l(null);
|
|
3552
3924
|
a(() => {
|
|
3553
3925
|
if (!t || T) return;
|
|
3554
3926
|
let e = !0;
|
|
@@ -3564,14 +3936,14 @@ function fn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3564
3936
|
w,
|
|
3565
3937
|
T
|
|
3566
3938
|
]);
|
|
3567
|
-
let O = t ?
|
|
3939
|
+
let O = t ? Sn(T ?? E ?? [], {
|
|
3568
3940
|
nameField: n,
|
|
3569
3941
|
titleField: r,
|
|
3570
3942
|
photoField: s,
|
|
3571
3943
|
parentField: c,
|
|
3572
3944
|
cvField: p,
|
|
3573
3945
|
hrefField: m
|
|
3574
|
-
}) : e, k =
|
|
3946
|
+
}) : e, k = _n(h), { boxes: A, links: j, width: M, height: N } = vn(O, {
|
|
3575
3947
|
size: h,
|
|
3576
3948
|
horizontal: g
|
|
3577
3949
|
});
|
|
@@ -3617,7 +3989,7 @@ function fn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3617
3989
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
3618
3990
|
strokeWidth: "1.5"
|
|
3619
3991
|
}, t)), A.map(({ node: e, x: t, y: n }) => {
|
|
3620
|
-
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ?
|
|
3992
|
+
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? bn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? bn(e.color2) : s, l = y && (xn(e) || e.href), p = () => xn(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Cn.pad + k.avatar + 8 : t + k.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((k.w - k.avatar - 26) / 7) : Math.floor(k.w / 7.6), _ = k.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
3621
3993
|
return /* @__PURE__ */ f("g", {
|
|
3622
3994
|
onClick: l ? p : void 0,
|
|
3623
3995
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -3681,13 +4053,13 @@ function fn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3681
4053
|
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
3682
4054
|
id: `${b}-${e.id}`,
|
|
3683
4055
|
children: /* @__PURE__ */ d("circle", {
|
|
3684
|
-
cx: t +
|
|
4056
|
+
cx: t + Cn.pad + k.avatar / 2,
|
|
3685
4057
|
cy: n + k.h / 2,
|
|
3686
4058
|
r: k.avatar / 2
|
|
3687
4059
|
})
|
|
3688
4060
|
}), /* @__PURE__ */ d("image", {
|
|
3689
4061
|
href: e.photo,
|
|
3690
|
-
x: t +
|
|
4062
|
+
x: t + Cn.pad,
|
|
3691
4063
|
y: n + (k.h - k.avatar) / 2,
|
|
3692
4064
|
width: k.avatar,
|
|
3693
4065
|
height: k.avatar,
|
|
@@ -3701,7 +4073,7 @@ function fn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3701
4073
|
fontSize: k.title,
|
|
3702
4074
|
fontWeight: "600",
|
|
3703
4075
|
fill: s,
|
|
3704
|
-
children:
|
|
4076
|
+
children: yn(e.title, g + 4)
|
|
3705
4077
|
}), e.name && /* @__PURE__ */ d("text", {
|
|
3706
4078
|
x: m,
|
|
3707
4079
|
y: n + _ + _ / 2 + k.name * .35,
|
|
@@ -3709,7 +4081,7 @@ function fn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3709
4081
|
fontSize: k.name,
|
|
3710
4082
|
fontWeight: "600",
|
|
3711
4083
|
fill: c,
|
|
3712
|
-
children:
|
|
4084
|
+
children: yn(e.name, g)
|
|
3713
4085
|
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
3714
4086
|
x: m,
|
|
3715
4087
|
y: n + (v[1] ? k.h * .43 : k.h * .57),
|
|
@@ -3717,7 +4089,7 @@ function fn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3717
4089
|
fontSize: k.name,
|
|
3718
4090
|
fontWeight: "600",
|
|
3719
4091
|
fill: s,
|
|
3720
|
-
children:
|
|
4092
|
+
children: yn(v[0], g)
|
|
3721
4093
|
}), v[1] && /* @__PURE__ */ d("text", {
|
|
3722
4094
|
x: m,
|
|
3723
4095
|
y: n + k.h * .73,
|
|
@@ -3725,84 +4097,257 @@ function fn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3725
4097
|
fontSize: k.title,
|
|
3726
4098
|
opacity: "0.7",
|
|
3727
4099
|
fill: s,
|
|
3728
|
-
children:
|
|
4100
|
+
children: yn(v[1], g + 4)
|
|
3729
4101
|
})] })
|
|
3730
4102
|
]
|
|
3731
4103
|
}, e.id);
|
|
3732
4104
|
})]
|
|
3733
|
-
}), x && /* @__PURE__ */ d(
|
|
4105
|
+
}), x && /* @__PURE__ */ d(wn, {
|
|
3734
4106
|
node: x,
|
|
3735
4107
|
onClose: () => S(null)
|
|
3736
4108
|
})]
|
|
3737
4109
|
});
|
|
3738
4110
|
}
|
|
3739
|
-
function
|
|
3740
|
-
let
|
|
4111
|
+
function En({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4112
|
+
let [i, o] = l(!1), s = c(null);
|
|
4113
|
+
return a(() => {
|
|
4114
|
+
if (!i || !s.current) return;
|
|
4115
|
+
let e = s.current, t = document.createRange();
|
|
4116
|
+
e.focus(), t.selectNodeContents(e), t.collapse(!1);
|
|
4117
|
+
let n = window.getSelection();
|
|
4118
|
+
n.removeAllRanges(), n.addRange(t);
|
|
4119
|
+
}, [i]), /* @__PURE__ */ d("span", {
|
|
4120
|
+
ref: s,
|
|
4121
|
+
contentEditable: i,
|
|
4122
|
+
suppressContentEditableWarning: !0,
|
|
4123
|
+
title: i ? void 0 : r || "Double-click to edit",
|
|
4124
|
+
onDoubleClick: () => o(!0),
|
|
4125
|
+
onBlur: i ? (e) => {
|
|
4126
|
+
o(!1), t(e.currentTarget.textContent);
|
|
4127
|
+
} : void 0,
|
|
4128
|
+
onKeyDown: i ? (t) => {
|
|
4129
|
+
t.stopPropagation(), t.key === "Escape" && (t.currentTarget.textContent = e ?? "", t.currentTarget.blur()), t.key === "Enter" && (t.preventDefault(), t.currentTarget.blur());
|
|
4130
|
+
} : void 0,
|
|
4131
|
+
style: {
|
|
4132
|
+
display: "block",
|
|
4133
|
+
minHeight: "1em",
|
|
4134
|
+
outline: "none",
|
|
4135
|
+
cursor: i ? "text" : "inherit",
|
|
4136
|
+
...n
|
|
4137
|
+
},
|
|
4138
|
+
children: e ?? ""
|
|
4139
|
+
});
|
|
4140
|
+
}
|
|
4141
|
+
var Dn = 360, On = "\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", kn = (e, t) => e && t ? `cell-${e}-${t}` : "";
|
|
4142
|
+
function An({ 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, style: T, nodeRef: E, edit: D }) {
|
|
4143
|
+
let O = c(null), k = c(null), [A, j] = l(null), [M, N] = l(null), F = (e, t) => () => j({
|
|
4144
|
+
r: e,
|
|
4145
|
+
c: t
|
|
4146
|
+
});
|
|
4147
|
+
a(() => {
|
|
4148
|
+
if (!D) return;
|
|
4149
|
+
let e = k.current, t = A && e?.querySelector(`[data-cell="${A.r}-${A.c}"]`);
|
|
4150
|
+
if (!t) {
|
|
4151
|
+
M && N(null);
|
|
4152
|
+
return;
|
|
4153
|
+
}
|
|
4154
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4155
|
+
top: r.bottom - n.top + 4,
|
|
4156
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - Dn))
|
|
4157
|
+
};
|
|
4158
|
+
(M?.top !== i.top || M?.left !== i.left) && N(i);
|
|
4159
|
+
}), a(() => {
|
|
4160
|
+
if (!D || !A) return;
|
|
4161
|
+
let e = (e) => {
|
|
4162
|
+
k.current?.contains(e.target) || j(null);
|
|
4163
|
+
};
|
|
4164
|
+
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4165
|
+
}, [D, A]);
|
|
4166
|
+
let { tenant: I, apiUrl: L } = i(J), R = i(ve), z = R?.[h], B = C ? ye(R) : 1, [V, ee] = l(null);
|
|
3741
4167
|
if (a(() => {
|
|
3742
|
-
if (!
|
|
3743
|
-
let e = !0, t = Math.max(1, Number(
|
|
3744
|
-
return fetch(
|
|
4168
|
+
if (!h || z) return;
|
|
4169
|
+
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(B - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${L}/data/${encodeURIComponent(h.slice(4))}` : `${L}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4170
|
+
return fetch(r, { headers: I ? { "x-tenant": I } : {} }).then((e) => e.json()).then((t) => {
|
|
3745
4171
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
3746
|
-
return e &&
|
|
3747
|
-
}).catch(() => e &&
|
|
4172
|
+
return e && ee(n);
|
|
4173
|
+
}).catch(() => e && ee([])), () => {
|
|
3748
4174
|
e = !1;
|
|
3749
4175
|
};
|
|
3750
4176
|
}, [
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
4177
|
+
h,
|
|
4178
|
+
I,
|
|
4179
|
+
L,
|
|
4180
|
+
z,
|
|
4181
|
+
C,
|
|
4182
|
+
B,
|
|
4183
|
+
g
|
|
3758
4184
|
]), !e.length) return null;
|
|
3759
|
-
let
|
|
3760
|
-
|
|
3761
|
-
|
|
4185
|
+
let H = Math.max(1, Number(g) || 10), te = h ? C ? z || h.startsWith("api:") ? (z ?? V ?? []).slice((B - 1) * H, B * H) : (V ?? []).slice(0, H) : (z ?? V ?? []).slice(0, H) : null, U = te ? te.map((t) => e.map((e) => Y(we(t?.data, e.field)))) : t, ne = !!h && !(h && !z && V === null) && U.length === 0, re = b ? {
|
|
4186
|
+
y: 6,
|
|
4187
|
+
x: 10
|
|
4188
|
+
} : {
|
|
4189
|
+
y: 10,
|
|
4190
|
+
x: 14
|
|
4191
|
+
}, ie = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : re.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : re.x}px`, ae = "1px solid rgba(148, 163, 184, 0.35)", oe = y ? { border: ae } : { borderBottom: ae }, se = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), ce = !!D && D.rows !== !1, le = (t) => (r) => {
|
|
4192
|
+
if (!D?.resize || t >= e.length - 1) return;
|
|
4193
|
+
r.preventDefault(), r.stopPropagation();
|
|
4194
|
+
let i = O.current, a = i ? i.clientWidth : 0;
|
|
4195
|
+
if (!a) return;
|
|
4196
|
+
let o = se ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4197
|
+
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4198
|
+
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, D.resize(i);
|
|
4199
|
+
}, u = () => {
|
|
4200
|
+
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
|
|
4201
|
+
};
|
|
4202
|
+
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4203
|
+
}, W = /* @__PURE__ */ new Set();
|
|
4204
|
+
p && U.forEach((t, n) => e.forEach((e, t) => {
|
|
4205
|
+
let i = p[kn(r[n], o[t])];
|
|
4206
|
+
if (!i) return;
|
|
4207
|
+
let a = Math.max(1, Number(i.c) || 1), s = Math.max(1, Number(i.r) || 1);
|
|
4208
|
+
for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) && W.add(`${n + e},${t + r}`);
|
|
4209
|
+
}));
|
|
4210
|
+
let ue = (e) => (t) => {
|
|
4211
|
+
if (!D?.resizeRow) return;
|
|
4212
|
+
t.preventDefault(), t.stopPropagation();
|
|
4213
|
+
let n = t.currentTarget.closest("tr");
|
|
4214
|
+
if (!n) return;
|
|
4215
|
+
let r = t.clientY, i = n.offsetHeight, a = (t) => D.resizeRow(e, Math.max(20, Math.round(i + (t.clientY - r)))), o = () => {
|
|
4216
|
+
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4217
|
+
};
|
|
4218
|
+
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4219
|
+
}, G = (e, t, n, r) => r ? null : /* @__PURE__ */ d("span", {
|
|
4220
|
+
className: "wb-tedit-btn",
|
|
4221
|
+
role: "button",
|
|
4222
|
+
"data-hint": t,
|
|
4223
|
+
onMouseDown: (e) => {
|
|
4224
|
+
e.preventDefault(), e.stopPropagation();
|
|
4225
|
+
},
|
|
4226
|
+
onClick: n,
|
|
4227
|
+
children: e
|
|
4228
|
+
}, t), K = A && A.r < U.length && A.c < e.length ? A : null, q = (e, t) => D?.labels?.[e] ?? t, de = K ? p?.[kn(r[K.r], o[K.c])] : null, fe = Math.max(1, Number(de?.c) || 1), pe = Math.max(1, Number(de?.r) || 1);
|
|
4229
|
+
return /* @__PURE__ */ f("div", {
|
|
4230
|
+
ref: (e) => {
|
|
4231
|
+
k.current = e, typeof E == "function" && E(e);
|
|
4232
|
+
},
|
|
3762
4233
|
style: {
|
|
3763
4234
|
width: "100%",
|
|
3764
|
-
|
|
3765
|
-
...P(
|
|
4235
|
+
...D ? { position: "relative" } : null,
|
|
4236
|
+
...P(T)
|
|
3766
4237
|
},
|
|
3767
|
-
children:
|
|
3768
|
-
style:
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
fontSize: 14,
|
|
3772
|
-
...s ? { border: O } : {}
|
|
3773
|
-
},
|
|
3774
|
-
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((e, t) => /* @__PURE__ */ d("th", {
|
|
4238
|
+
children: [
|
|
4239
|
+
D && /* @__PURE__ */ d("style", { children: On }),
|
|
4240
|
+
D && K && M && /* @__PURE__ */ f("div", {
|
|
4241
|
+
className: "wb-tedit-bar",
|
|
3775
4242
|
style: {
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
padding: D,
|
|
3779
|
-
background: "rgba(148, 163, 184, 0.12)",
|
|
3780
|
-
...k
|
|
4243
|
+
top: M.top,
|
|
4244
|
+
left: M.left
|
|
3781
4245
|
},
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
4246
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
4247
|
+
children: [
|
|
4248
|
+
/* @__PURE__ */ d("span", {
|
|
4249
|
+
className: "wb-tedit-at",
|
|
4250
|
+
children: `R${K.r + 1}·C${K.c + 1}`
|
|
4251
|
+
}),
|
|
4252
|
+
G("+↑", q("rowAbove", "Insert row above"), () => D.addRow(K.r - 1)),
|
|
4253
|
+
G("+↓", q("rowBelow", "Insert row below"), () => D.addRow(K.r)),
|
|
4254
|
+
G("↑", q("rowUp", "Move row up"), () => D.moveRow(K.r, -1), K.r === 0),
|
|
4255
|
+
G("↓", q("rowDown", "Move row down"), () => D.moveRow(K.r, 1), K.r >= U.length - 1),
|
|
4256
|
+
G("✕ row", q("rowDelete", "Delete row"), () => D.dropRow(K.r), U.length <= 1),
|
|
4257
|
+
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4258
|
+
G("+←", q("colLeft", "Insert column left"), () => D.addColumn(K.c - 1)),
|
|
4259
|
+
G("+→", q("colRight", "Insert column right"), () => D.addColumn(K.c)),
|
|
4260
|
+
G("←", q("colMoveLeft", "Move column left"), () => D.moveColumn(K.c, -1), K.c === 0),
|
|
4261
|
+
G("→", q("colMoveRight", "Move column right"), () => D.moveColumn(K.c, 1), K.c >= e.length - 1),
|
|
4262
|
+
G("✕ col", q("colDelete", "Delete column"), () => D.dropColumn(K.c), e.length <= 1),
|
|
4263
|
+
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4264
|
+
G("↔", q("mergeRight", "Merge with the cell on the right"), () => D.merge(K.r, K.c, "right"), K.c + fe >= e.length),
|
|
4265
|
+
G("↕", q("mergeDown", "Merge with the cell below"), () => D.merge(K.r, K.c, "down"), K.r + pe >= U.length),
|
|
4266
|
+
G("⤫", q("split", "Split this cell"), () => D.split(K.r, K.c), fe === 1 && pe === 1)
|
|
4267
|
+
]
|
|
4268
|
+
}),
|
|
4269
|
+
/* @__PURE__ */ d("div", {
|
|
3785
4270
|
style: {
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
opacity: .6,
|
|
3789
|
-
...k
|
|
4271
|
+
width: "100%",
|
|
4272
|
+
overflowX: "auto"
|
|
3790
4273
|
},
|
|
3791
|
-
children:
|
|
3792
|
-
|
|
3793
|
-
style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
3794
|
-
children: e.map((e, n) => /* @__PURE__ */ d("td", {
|
|
4274
|
+
children: /* @__PURE__ */ f("table", {
|
|
4275
|
+
ref: O,
|
|
3795
4276
|
style: {
|
|
3796
|
-
|
|
3797
|
-
|
|
4277
|
+
width: "100%",
|
|
4278
|
+
borderCollapse: "collapse",
|
|
4279
|
+
fontSize: 14,
|
|
4280
|
+
...se ? { tableLayout: "fixed" } : null,
|
|
4281
|
+
...y ? { border: ae } : {}
|
|
3798
4282
|
},
|
|
3799
|
-
children:
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
4283
|
+
children: [
|
|
4284
|
+
se && /* @__PURE__ */ d("colgroup", { children: n.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
|
|
4285
|
+
_ === !1 ? null : /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((t, n) => /* @__PURE__ */ d("th", {
|
|
4286
|
+
className: D ? "wb-tedit-head" : void 0,
|
|
4287
|
+
style: {
|
|
4288
|
+
textAlign: "left",
|
|
4289
|
+
fontWeight: 600,
|
|
4290
|
+
padding: ie,
|
|
4291
|
+
background: "rgba(148, 163, 184, 0.12)",
|
|
4292
|
+
...D ? { position: "relative" } : null,
|
|
4293
|
+
...oe
|
|
4294
|
+
},
|
|
4295
|
+
children: D ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(En, {
|
|
4296
|
+
value: t.label ?? t,
|
|
4297
|
+
onCommit: (e) => D.header(n, e),
|
|
4298
|
+
hint: q("editCell", "Double-click to edit"),
|
|
4299
|
+
style: { paddingRight: 6 }
|
|
4300
|
+
}), n < e.length - 1 && /* @__PURE__ */ d("span", {
|
|
4301
|
+
className: "wb-tedit-grip",
|
|
4302
|
+
title: q("colWidth", "Drag to resize the column"),
|
|
4303
|
+
onPointerDown: le(n)
|
|
4304
|
+
})] }) : t.label ?? t
|
|
4305
|
+
}, n)) }) }),
|
|
4306
|
+
/* @__PURE__ */ f("tbody", { children: [ne && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
4307
|
+
colSpan: e.length,
|
|
4308
|
+
style: {
|
|
4309
|
+
padding: ie,
|
|
4310
|
+
textAlign: "center",
|
|
4311
|
+
opacity: .6,
|
|
4312
|
+
...oe
|
|
4313
|
+
},
|
|
4314
|
+
children: w || "No data yet"
|
|
4315
|
+
}) }), U.map((t, n) => /* @__PURE__ */ d("tr", {
|
|
4316
|
+
className: D ? "wb-tedit-row" : void 0,
|
|
4317
|
+
style: {
|
|
4318
|
+
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
4319
|
+
...Number.isFinite(Number(s?.[n])) && s[n] > 0 ? { height: s[n] } : null
|
|
4320
|
+
},
|
|
4321
|
+
children: e.map((e, i) => {
|
|
4322
|
+
if (W.has(`${n},${i}`)) return null;
|
|
4323
|
+
let a = kn(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);
|
|
4324
|
+
return /* @__PURE__ */ f("td", {
|
|
4325
|
+
className: D ? `wb-tedit-cell${A?.r === n && A?.c === i ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4326
|
+
onMouseDownCapture: ce ? F(n, i) : void 0,
|
|
4327
|
+
"data-cell": D ? `${n}-${i}` : void 0,
|
|
4328
|
+
colSpan: l > 1 ? l : void 0,
|
|
4329
|
+
rowSpan: u > 1 ? u : void 0,
|
|
4330
|
+
style: {
|
|
4331
|
+
padding: ie,
|
|
4332
|
+
...D ? { position: "relative" } : null,
|
|
4333
|
+
...oe
|
|
4334
|
+
},
|
|
4335
|
+
children: [s ?? t?.[i] ?? "", D && ce && /* @__PURE__ */ d("span", {
|
|
4336
|
+
className: "wb-tedit-rowgrip",
|
|
4337
|
+
title: q("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4338
|
+
onPointerDown: ue(n),
|
|
4339
|
+
onDoubleClick: () => D.resizeRow(n, 0)
|
|
4340
|
+
})]
|
|
4341
|
+
}, i);
|
|
4342
|
+
})
|
|
4343
|
+
}, r[n] ?? n))] })
|
|
4344
|
+
]
|
|
4345
|
+
})
|
|
4346
|
+
})
|
|
4347
|
+
]
|
|
3803
4348
|
});
|
|
3804
4349
|
}
|
|
3805
|
-
var
|
|
4350
|
+
var jn = {
|
|
3806
4351
|
small: {
|
|
3807
4352
|
cell: 62,
|
|
3808
4353
|
font: 10.5,
|
|
@@ -3827,9 +4372,9 @@ var mn = {
|
|
|
3827
4372
|
pad: 8,
|
|
3828
4373
|
gap: 4
|
|
3829
4374
|
}
|
|
3830
|
-
},
|
|
3831
|
-
function
|
|
3832
|
-
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 ? "" :
|
|
4375
|
+
}, Mn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Nn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Pn = 366;
|
|
4376
|
+
function Fn(e, t = {}) {
|
|
4377
|
+
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 ? "" : Y(e), a = (e) => {
|
|
3833
4378
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
3834
4379
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
3835
4380
|
};
|
|
@@ -3845,7 +4390,7 @@ function vn(e, t = {}) {
|
|
|
3845
4390
|
} : null;
|
|
3846
4391
|
}).filter(Boolean);
|
|
3847
4392
|
}
|
|
3848
|
-
function
|
|
4393
|
+
function In(e) {
|
|
3849
4394
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
3850
4395
|
let n = e?.start ? new Date(e.start) : null;
|
|
3851
4396
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -3860,20 +4405,20 @@ function yn(e) {
|
|
|
3860
4405
|
};
|
|
3861
4406
|
}).filter(Boolean);
|
|
3862
4407
|
}
|
|
3863
|
-
function
|
|
4408
|
+
function Ln(e) {
|
|
3864
4409
|
let t = /* @__PURE__ */ new Map();
|
|
3865
4410
|
for (let n of e) {
|
|
3866
|
-
let e =
|
|
4411
|
+
let e = Nn(n.start), r = n.end ? Nn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Pn);
|
|
3867
4412
|
for (let r = 0; r <= i; r += 1) {
|
|
3868
|
-
let i =
|
|
4413
|
+
let i = Mn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
3869
4414
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
3870
4415
|
}
|
|
3871
4416
|
}
|
|
3872
4417
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
3873
4418
|
return t;
|
|
3874
4419
|
}
|
|
3875
|
-
function
|
|
3876
|
-
let { tenant: T, apiUrl: E, locale: D } = i(
|
|
4420
|
+
function Rn({ 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 }) {
|
|
4421
|
+
let { tenant: T, apiUrl: E, locale: D } = i(J), O = i(ve)?.[t], [k, A] = l(null), [j, M] = l(() => {
|
|
3877
4422
|
let e = /* @__PURE__ */ new Date();
|
|
3878
4423
|
return {
|
|
3879
4424
|
year: e.getFullYear(),
|
|
@@ -3895,13 +4440,13 @@ function xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
3895
4440
|
E,
|
|
3896
4441
|
O
|
|
3897
4442
|
]);
|
|
3898
|
-
let N =
|
|
4443
|
+
let N = jn[m] ?? jn.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 ? Fn(O ?? k ?? [], {
|
|
3899
4444
|
titleField: n,
|
|
3900
4445
|
startField: r,
|
|
3901
4446
|
endField: o,
|
|
3902
4447
|
hrefField: s,
|
|
3903
4448
|
colorField: c
|
|
3904
|
-
}) :
|
|
4449
|
+
}) : In(e), B = Ln(z), V = D || void 0, ee = (e, t) => {
|
|
3905
4450
|
let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
|
|
3906
4451
|
width: 6,
|
|
3907
4452
|
height: 6,
|
|
@@ -3939,19 +4484,19 @@ function xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
3939
4484
|
title: e.title,
|
|
3940
4485
|
children: n
|
|
3941
4486
|
}, e.key);
|
|
3942
|
-
},
|
|
4487
|
+
}, H = new Intl.DateTimeFormat(V, {
|
|
3943
4488
|
month: "long",
|
|
3944
4489
|
year: "numeric"
|
|
3945
|
-
}).format(new Date(j.year, j.month, 1)),
|
|
4490
|
+
}).format(new Date(j.year, j.month, 1)), te = (e) => M((t) => {
|
|
3946
4491
|
let n = new Date(t.year, t.month + e, 1);
|
|
3947
4492
|
return {
|
|
3948
4493
|
year: n.getFullYear(),
|
|
3949
4494
|
month: n.getMonth()
|
|
3950
4495
|
};
|
|
3951
|
-
}),
|
|
4496
|
+
}), U = (e, t) => /* @__PURE__ */ d("button", {
|
|
3952
4497
|
type: "button",
|
|
3953
4498
|
"aria-label": e,
|
|
3954
|
-
onClick: () =>
|
|
4499
|
+
onClick: () => te(t),
|
|
3955
4500
|
style: {
|
|
3956
4501
|
background: "transparent",
|
|
3957
4502
|
border: `1px solid ${I}`,
|
|
@@ -3963,7 +4508,7 @@ function xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
3963
4508
|
padding: "4px 8px"
|
|
3964
4509
|
},
|
|
3965
4510
|
children: t < 0 ? "‹" : "›"
|
|
3966
|
-
}),
|
|
4511
|
+
}), ne = /* @__PURE__ */ f("div", {
|
|
3967
4512
|
style: {
|
|
3968
4513
|
display: "flex",
|
|
3969
4514
|
alignItems: "center",
|
|
@@ -3978,10 +4523,10 @@ function xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
3978
4523
|
flexGrow: 1,
|
|
3979
4524
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
3980
4525
|
},
|
|
3981
|
-
children:
|
|
4526
|
+
children: H
|
|
3982
4527
|
}),
|
|
3983
|
-
|
|
3984
|
-
|
|
4528
|
+
U("Previous month", -1),
|
|
4529
|
+
U("Next month", 1)
|
|
3985
4530
|
]
|
|
3986
4531
|
});
|
|
3987
4532
|
if (p === "list") {
|
|
@@ -3997,7 +4542,7 @@ function xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
3997
4542
|
width: "100%",
|
|
3998
4543
|
...P(S)
|
|
3999
4544
|
},
|
|
4000
|
-
children: [
|
|
4545
|
+
children: [ne, e.length ? /* @__PURE__ */ d("div", {
|
|
4001
4546
|
style: {
|
|
4002
4547
|
display: "flex",
|
|
4003
4548
|
flexDirection: "column",
|
|
@@ -4018,7 +4563,7 @@ function xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4018
4563
|
minWidth: 96
|
|
4019
4564
|
},
|
|
4020
4565
|
children: t.format(e.start)
|
|
4021
|
-
}),
|
|
4566
|
+
}), ee(e, {
|
|
4022
4567
|
flexGrow: 1,
|
|
4023
4568
|
minWidth: 0
|
|
4024
4569
|
})]
|
|
@@ -4033,10 +4578,10 @@ function xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4033
4578
|
})]
|
|
4034
4579
|
});
|
|
4035
4580
|
}
|
|
4036
|
-
let
|
|
4037
|
-
for (let e = 0; e <
|
|
4038
|
-
let t = e -
|
|
4039
|
-
|
|
4581
|
+
let re = new Date(j.year, j.month, 1), ie = y === "sunday" ? 0 : 1, ae = (re.getDay() - ie + 7) % 7, oe = new Date(j.year, j.month + 1, 0).getDate(), se = Math.ceil((ae + oe) / 7), ce = Mn(/* @__PURE__ */ new Date()), le = new Intl.DateTimeFormat(V, { weekday: "short" }), W = [];
|
|
4582
|
+
for (let e = 0; e < se * 7; e += 1) {
|
|
4583
|
+
let t = e - ae + 1, n = t >= 1 && t <= oe, r = Mn(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ce;
|
|
4584
|
+
W.push(/* @__PURE__ */ f("div", {
|
|
4040
4585
|
style: {
|
|
4041
4586
|
minHeight: N.cell,
|
|
4042
4587
|
borderTop: `1px solid ${I}`,
|
|
@@ -4061,7 +4606,7 @@ function xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4061
4606
|
},
|
|
4062
4607
|
children: n ? t : new Date(j.year, j.month, t).getDate()
|
|
4063
4608
|
}),
|
|
4064
|
-
a.map((e) =>
|
|
4609
|
+
a.map((e) => ee(e)),
|
|
4065
4610
|
i.length > a.length && /* @__PURE__ */ d("span", {
|
|
4066
4611
|
style: {
|
|
4067
4612
|
fontSize: N.font,
|
|
@@ -4079,7 +4624,7 @@ function xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4079
4624
|
...P(S)
|
|
4080
4625
|
},
|
|
4081
4626
|
children: [
|
|
4082
|
-
|
|
4627
|
+
ne,
|
|
4083
4628
|
/* @__PURE__ */ f("div", {
|
|
4084
4629
|
style: {
|
|
4085
4630
|
display: "grid",
|
|
@@ -4093,20 +4638,20 @@ function xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4093
4638
|
textAlign: "center",
|
|
4094
4639
|
padding: `0 0 ${N.pad}px`
|
|
4095
4640
|
},
|
|
4096
|
-
children:
|
|
4097
|
-
}, `head-${t}`)),
|
|
4641
|
+
children: le.format(new Date(2024, 0, 7 + ie + t))
|
|
4642
|
+
}, `head-${t}`)), W]
|
|
4098
4643
|
}),
|
|
4099
4644
|
/* @__PURE__ */ d("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4100
4645
|
]
|
|
4101
4646
|
});
|
|
4102
4647
|
}
|
|
4103
|
-
var
|
|
4648
|
+
var zn = {
|
|
4104
4649
|
small: 380,
|
|
4105
4650
|
medium: 560,
|
|
4106
4651
|
large: 820,
|
|
4107
4652
|
full: "100%"
|
|
4108
4653
|
};
|
|
4109
|
-
function
|
|
4654
|
+
function Bn({ 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 }) {
|
|
4110
4655
|
let [C, w] = l(!1), T = c(null);
|
|
4111
4656
|
a(() => {
|
|
4112
4657
|
if (S || !e) return;
|
|
@@ -4131,7 +4676,7 @@ function Cn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4131
4676
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
4132
4677
|
};
|
|
4133
4678
|
}, [S, C]);
|
|
4134
|
-
let E =
|
|
4679
|
+
let E = zn[o] ?? zn.medium, D = (e) => {
|
|
4135
4680
|
let t = {
|
|
4136
4681
|
padding: "9px 16px",
|
|
4137
4682
|
borderRadius: 6,
|
|
@@ -4300,10 +4845,10 @@ function Cn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4300
4845
|
})]
|
|
4301
4846
|
});
|
|
4302
4847
|
}
|
|
4303
|
-
var
|
|
4848
|
+
var Vn = {
|
|
4304
4849
|
PageRoot: Pe,
|
|
4305
|
-
CalendarBlock:
|
|
4306
|
-
DialogBlock:
|
|
4850
|
+
CalendarBlock: Rn,
|
|
4851
|
+
DialogBlock: Bn,
|
|
4307
4852
|
Section: Fe,
|
|
4308
4853
|
Container: Ie,
|
|
4309
4854
|
Heading: Le,
|
|
@@ -4314,21 +4859,23 @@ var wn = {
|
|
|
4314
4859
|
Divider: at,
|
|
4315
4860
|
SliderBlock: dt,
|
|
4316
4861
|
CanvasSlider: ft,
|
|
4317
|
-
TabsBlock:
|
|
4318
|
-
QuickStack:
|
|
4319
|
-
CollectionList:
|
|
4320
|
-
CollectionSearch:
|
|
4321
|
-
BreadcrumbsBlock:
|
|
4322
|
-
PaginationBlock:
|
|
4323
|
-
StepperBlock:
|
|
4324
|
-
SocialLinksBlock:
|
|
4325
|
-
ThemeModeBlock:
|
|
4326
|
-
ScrollTopBlock:
|
|
4327
|
-
OrgChartBlock:
|
|
4328
|
-
TableBlock:
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4862
|
+
TabsBlock: Dt,
|
|
4863
|
+
QuickStack: Qt,
|
|
4864
|
+
CollectionList: $t,
|
|
4865
|
+
CollectionSearch: en,
|
|
4866
|
+
BreadcrumbsBlock: tn,
|
|
4867
|
+
PaginationBlock: nn,
|
|
4868
|
+
StepperBlock: hn,
|
|
4869
|
+
SocialLinksBlock: mn,
|
|
4870
|
+
ThemeModeBlock: cn,
|
|
4871
|
+
ScrollTopBlock: fn,
|
|
4872
|
+
OrgChartBlock: Tn,
|
|
4873
|
+
TableBlock: An,
|
|
4874
|
+
IconBlock: bt,
|
|
4875
|
+
MapBlock: vt,
|
|
4876
|
+
MasonryBlock: St,
|
|
4877
|
+
AccordionBlock: Ot,
|
|
4878
|
+
NavbarBlock: Et,
|
|
4332
4879
|
ListBlock: qe,
|
|
4333
4880
|
TextSpan: Be,
|
|
4334
4881
|
QuoteBlock: Ke,
|
|
@@ -4339,43 +4886,43 @@ var wn = {
|
|
|
4339
4886
|
YouTubeBlock: tt,
|
|
4340
4887
|
IframeBlock: nt,
|
|
4341
4888
|
EmbedBlock: rt,
|
|
4342
|
-
FormBlock:
|
|
4343
|
-
FormLabel:
|
|
4344
|
-
FormInput:
|
|
4345
|
-
FormTextarea:
|
|
4346
|
-
FormCheckbox: (e) => /* @__PURE__ */ d(
|
|
4889
|
+
FormBlock: Bt,
|
|
4890
|
+
FormLabel: Gt,
|
|
4891
|
+
FormInput: Kt,
|
|
4892
|
+
FormTextarea: qt,
|
|
4893
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(Jt, {
|
|
4347
4894
|
kind: "checkbox",
|
|
4348
4895
|
...e
|
|
4349
4896
|
}),
|
|
4350
|
-
FormRadio: (e) => /* @__PURE__ */ d(
|
|
4897
|
+
FormRadio: (e) => /* @__PURE__ */ d(Jt, {
|
|
4351
4898
|
kind: "radio",
|
|
4352
4899
|
...e
|
|
4353
4900
|
}),
|
|
4354
|
-
FormSelect:
|
|
4355
|
-
FormFile:
|
|
4356
|
-
FormRecaptcha:
|
|
4357
|
-
FormSubmit:
|
|
4358
|
-
},
|
|
4901
|
+
FormSelect: Yt,
|
|
4902
|
+
FormFile: Xt,
|
|
4903
|
+
FormRecaptcha: Wt,
|
|
4904
|
+
FormSubmit: Zt
|
|
4905
|
+
}, Hn = {
|
|
4359
4906
|
id: "auth",
|
|
4360
4907
|
label: "Accounts",
|
|
4361
4908
|
category: "Apps",
|
|
4362
4909
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
4363
4910
|
ssr: "shell",
|
|
4364
4911
|
settings: ["site.authRedirect"]
|
|
4365
|
-
},
|
|
4912
|
+
}, Un = n({
|
|
4366
4913
|
user: null,
|
|
4367
4914
|
status: "idle",
|
|
4368
4915
|
ensure: () => {},
|
|
4369
4916
|
refresh: () => {},
|
|
4370
4917
|
signOut: () => {}
|
|
4371
|
-
}),
|
|
4372
|
-
let e = i(
|
|
4918
|
+
}), Wn = () => {
|
|
4919
|
+
let e = i(Un);
|
|
4373
4920
|
return a(() => {
|
|
4374
4921
|
e.ensure();
|
|
4375
4922
|
}, [e]), e;
|
|
4376
4923
|
};
|
|
4377
|
-
function
|
|
4378
|
-
let f = i(
|
|
4924
|
+
function Gn({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
|
|
4925
|
+
let f = i(J), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", [h, g] = l(t ?? null), [_, v] = l(t ? "user" : n ? "guest" : "idle"), y = c(!1), b = r((e, t) => fetch(`${p}${e}`, {
|
|
4379
4926
|
...t,
|
|
4380
4927
|
credentials: "include",
|
|
4381
4928
|
headers: {
|
|
@@ -4425,19 +4972,19 @@ function On({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
4425
4972
|
t,
|
|
4426
4973
|
x,
|
|
4427
4974
|
S
|
|
4428
|
-
]), /* @__PURE__ */ d(
|
|
4975
|
+
]), /* @__PURE__ */ d(Un.Provider, {
|
|
4429
4976
|
value: w,
|
|
4430
4977
|
children: e
|
|
4431
4978
|
});
|
|
4432
4979
|
}
|
|
4433
|
-
function
|
|
4434
|
-
let { status: n } =
|
|
4980
|
+
function Kn({ when: e, children: t }) {
|
|
4981
|
+
let { status: n } = Wn();
|
|
4435
4982
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
4436
4983
|
}
|
|
4437
4984
|
//#endregion
|
|
4438
4985
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
4439
|
-
function
|
|
4440
|
-
let { tenant: h, apiUrl: g, settings: _ } = i(
|
|
4986
|
+
function qn({ 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 }) {
|
|
4987
|
+
let { tenant: h, apiUrl: g, settings: _ } = i(J), [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) => {
|
|
4441
4988
|
if (e.preventDefault(), u) return;
|
|
4442
4989
|
let n = new FormData(e.currentTarget);
|
|
4443
4990
|
C(!0), x("");
|
|
@@ -4485,20 +5032,20 @@ function An({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
4485
5032
|
children: [
|
|
4486
5033
|
w ? /* @__PURE__ */ f("label", {
|
|
4487
5034
|
style: {
|
|
4488
|
-
...
|
|
5035
|
+
...At,
|
|
4489
5036
|
display: "grid",
|
|
4490
5037
|
gap: 6
|
|
4491
5038
|
},
|
|
4492
5039
|
children: [a, /* @__PURE__ */ d("input", {
|
|
4493
5040
|
name: "name",
|
|
4494
5041
|
type: "text",
|
|
4495
|
-
style:
|
|
5042
|
+
style: jt,
|
|
4496
5043
|
...$(u)
|
|
4497
5044
|
})]
|
|
4498
5045
|
}) : null,
|
|
4499
5046
|
/* @__PURE__ */ f("label", {
|
|
4500
5047
|
style: {
|
|
4501
|
-
...
|
|
5048
|
+
...At,
|
|
4502
5049
|
display: "grid",
|
|
4503
5050
|
gap: 6
|
|
4504
5051
|
},
|
|
@@ -4506,13 +5053,13 @@ function An({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
4506
5053
|
name: "email",
|
|
4507
5054
|
type: "email",
|
|
4508
5055
|
required: !u,
|
|
4509
|
-
style:
|
|
5056
|
+
style: jt,
|
|
4510
5057
|
...$(u)
|
|
4511
5058
|
})]
|
|
4512
5059
|
}),
|
|
4513
5060
|
/* @__PURE__ */ f("label", {
|
|
4514
5061
|
style: {
|
|
4515
|
-
...
|
|
5062
|
+
...At,
|
|
4516
5063
|
display: "grid",
|
|
4517
5064
|
gap: 6
|
|
4518
5065
|
},
|
|
@@ -4520,7 +5067,7 @@ function An({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
4520
5067
|
name: "password",
|
|
4521
5068
|
type: "password",
|
|
4522
5069
|
required: !u,
|
|
4523
|
-
style:
|
|
5070
|
+
style: jt,
|
|
4524
5071
|
...$(u)
|
|
4525
5072
|
})]
|
|
4526
5073
|
}),
|
|
@@ -4528,7 +5075,7 @@ function An({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
4528
5075
|
type: u ? "button" : "submit",
|
|
4529
5076
|
disabled: S || void 0,
|
|
4530
5077
|
style: {
|
|
4531
|
-
...
|
|
5078
|
+
...ke,
|
|
4532
5079
|
border: 0,
|
|
4533
5080
|
padding: "10px 22px",
|
|
4534
5081
|
borderRadius: 8,
|
|
@@ -4560,8 +5107,8 @@ function An({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
4560
5107
|
]
|
|
4561
5108
|
});
|
|
4562
5109
|
}
|
|
4563
|
-
function
|
|
4564
|
-
let { user: c, status: l, signOut: u } =
|
|
5110
|
+
function Jn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
5111
|
+
let { user: c, status: l, signOut: u } = Wn(), p = a ? s || "user" : l, m = a ? {
|
|
4565
5112
|
name: "Ada Lovelace",
|
|
4566
5113
|
email: "ada@example.com"
|
|
4567
5114
|
} : c;
|
|
@@ -4582,7 +5129,7 @@ function jn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
4582
5129
|
children: [
|
|
4583
5130
|
/* @__PURE__ */ f("span", {
|
|
4584
5131
|
style: {
|
|
4585
|
-
...
|
|
5132
|
+
...At,
|
|
4586
5133
|
fontWeight: 600
|
|
4587
5134
|
},
|
|
4588
5135
|
children: [
|
|
@@ -4593,7 +5140,7 @@ function jn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
4593
5140
|
}),
|
|
4594
5141
|
n && m?.email ? /* @__PURE__ */ d("span", {
|
|
4595
5142
|
style: {
|
|
4596
|
-
...
|
|
5143
|
+
...At,
|
|
4597
5144
|
opacity: .7
|
|
4598
5145
|
},
|
|
4599
5146
|
children: m.email
|
|
@@ -4602,7 +5149,7 @@ function jn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
4602
5149
|
type: "button",
|
|
4603
5150
|
onClick: a ? void 0 : u,
|
|
4604
5151
|
style: {
|
|
4605
|
-
...
|
|
5152
|
+
...ke,
|
|
4606
5153
|
border: 0,
|
|
4607
5154
|
padding: "8px 16px",
|
|
4608
5155
|
borderRadius: 8,
|
|
@@ -4626,40 +5173,40 @@ function jn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
4626
5173
|
}
|
|
4627
5174
|
//#endregion
|
|
4628
5175
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
4629
|
-
var
|
|
5176
|
+
var Yn = {
|
|
4630
5177
|
id: "consent",
|
|
4631
5178
|
label: "Cookie consent",
|
|
4632
5179
|
category: "Apps",
|
|
4633
5180
|
keys: ["CookieConsent"],
|
|
4634
5181
|
ssr: "shell",
|
|
4635
5182
|
settings: []
|
|
4636
|
-
},
|
|
4637
|
-
function
|
|
5183
|
+
}, Xn = "webim.cookie_consent";
|
|
5184
|
+
function Zn() {
|
|
4638
5185
|
try {
|
|
4639
|
-
let e = window.localStorage.getItem(
|
|
5186
|
+
let e = window.localStorage.getItem(Xn), t = e ? JSON.parse(e) : null;
|
|
4640
5187
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
4641
5188
|
} catch {
|
|
4642
5189
|
return "";
|
|
4643
5190
|
}
|
|
4644
5191
|
}
|
|
4645
|
-
function
|
|
5192
|
+
function Qn(e) {
|
|
4646
5193
|
try {
|
|
4647
5194
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
4648
5195
|
} catch {}
|
|
4649
5196
|
}
|
|
4650
|
-
function
|
|
5197
|
+
function $n(e) {
|
|
4651
5198
|
try {
|
|
4652
|
-
window.localStorage.setItem(
|
|
5199
|
+
window.localStorage.setItem(Xn, JSON.stringify({
|
|
4653
5200
|
choice: e,
|
|
4654
5201
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4655
5202
|
}));
|
|
4656
5203
|
} catch {}
|
|
4657
|
-
|
|
5204
|
+
Qn(e);
|
|
4658
5205
|
try {
|
|
4659
5206
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
4660
5207
|
} catch {}
|
|
4661
5208
|
}
|
|
4662
|
-
var
|
|
5209
|
+
var er = {
|
|
4663
5210
|
bottom: {
|
|
4664
5211
|
left: 0,
|
|
4665
5212
|
right: 0,
|
|
@@ -4681,18 +5228,18 @@ var Ln = {
|
|
|
4681
5228
|
maxWidth: 400
|
|
4682
5229
|
}
|
|
4683
5230
|
};
|
|
4684
|
-
function
|
|
5231
|
+
function tr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
|
|
4685
5232
|
let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
|
|
4686
5233
|
y(e), typeof m == "function" && m(e);
|
|
4687
5234
|
};
|
|
4688
5235
|
if (a(() => {
|
|
4689
5236
|
if (h) return;
|
|
4690
|
-
let e =
|
|
4691
|
-
e ?
|
|
5237
|
+
let e = Zn();
|
|
5238
|
+
e ? Qn(e) : _(!0);
|
|
4692
5239
|
}, [h, v]), !g) return null;
|
|
4693
5240
|
let x = (e) => () => {
|
|
4694
|
-
h || (
|
|
4695
|
-
}, S =
|
|
5241
|
+
h || ($n(e), _(!1));
|
|
5242
|
+
}, S = er[s] ?? er.bottom, C = {
|
|
4696
5243
|
appearance: "none",
|
|
4697
5244
|
font: "inherit",
|
|
4698
5245
|
fontSize: 14,
|
|
@@ -4772,37 +5319,37 @@ function Rn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
4772
5319
|
}
|
|
4773
5320
|
//#endregion
|
|
4774
5321
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
4775
|
-
var
|
|
5322
|
+
var nr = {
|
|
4776
5323
|
id: "language",
|
|
4777
5324
|
label: "Language",
|
|
4778
5325
|
category: "Apps",
|
|
4779
5326
|
keys: ["SiteLanguagePicker"],
|
|
4780
5327
|
ssr: "prefetch",
|
|
4781
5328
|
settings: ["locales"]
|
|
4782
|
-
},
|
|
5329
|
+
}, rr = {
|
|
4783
5330
|
id: "search",
|
|
4784
5331
|
label: "Search",
|
|
4785
5332
|
category: "Apps",
|
|
4786
5333
|
keys: ["SiteSearch"],
|
|
4787
5334
|
ssr: "prefetch",
|
|
4788
5335
|
settings: []
|
|
4789
|
-
},
|
|
4790
|
-
function
|
|
5336
|
+
}, ir = 50, ar = 2e3;
|
|
5337
|
+
function or() {
|
|
4791
5338
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
4792
5339
|
}
|
|
4793
|
-
function
|
|
5340
|
+
function sr(e, t) {
|
|
4794
5341
|
let n = e?.data ?? {}, r = [];
|
|
4795
5342
|
for (let e of Object.values(n)) {
|
|
4796
|
-
let t = e == null ? "" :
|
|
4797
|
-
if (t && r.push(t), r.join(" ").length >
|
|
5343
|
+
let t = e == null ? "" : Y(e);
|
|
5344
|
+
if (t && r.push(t), r.join(" ").length > ar) break;
|
|
4798
5345
|
}
|
|
4799
|
-
return r.join(" ").slice(0,
|
|
5346
|
+
return r.join(" ").slice(0, ar).toLocaleLowerCase(t || void 0);
|
|
4800
5347
|
}
|
|
4801
|
-
function
|
|
4802
|
-
let { tenant: b, apiUrl: x, locale: S } = i(
|
|
5348
|
+
function cr({ 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 }) {
|
|
5349
|
+
let { tenant: b, apiUrl: x, locale: S } = i(J), [C, w] = l(() => or()), [T, E] = l(() => or()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
|
|
4803
5350
|
a(() => {
|
|
4804
5351
|
let e = () => {
|
|
4805
|
-
let e =
|
|
5352
|
+
let e = or();
|
|
4806
5353
|
w(e), E(e);
|
|
4807
5354
|
};
|
|
4808
5355
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -4853,8 +5400,8 @@ function Gn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
4853
5400
|
});
|
|
4854
5401
|
}
|
|
4855
5402
|
else for (let t of e.rows) {
|
|
4856
|
-
if (!
|
|
4857
|
-
let n = t?.data ?? {}, r =
|
|
5403
|
+
if (!sr(t, S).includes(N)) continue;
|
|
5404
|
+
let n = t?.data ?? {}, r = Y(n.name) || "Untitled", i = Y(n.slug);
|
|
4858
5405
|
F.push({
|
|
4859
5406
|
key: `entry:${t.id}`,
|
|
4860
5407
|
title: r,
|
|
@@ -4862,7 +5409,7 @@ function Gn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
4862
5409
|
kind: "entry"
|
|
4863
5410
|
});
|
|
4864
5411
|
}
|
|
4865
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
5412
|
+
let I = F.slice(0, Math.min(Math.max(1, p), ir)), L = (e) => {
|
|
4866
5413
|
if (v) {
|
|
4867
5414
|
e.preventDefault(), w(T), A(!0);
|
|
4868
5415
|
return;
|
|
@@ -4883,7 +5430,7 @@ function Gn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
4883
5430
|
title: "Spring collection",
|
|
4884
5431
|
url: "/blog/spring",
|
|
4885
5432
|
kind: "entry"
|
|
4886
|
-
}] : null, z = R ?? I, B = !R && N && D && !I.length, V = !M || k && (z.length > 0 || B),
|
|
5433
|
+
}] : null, z = R ?? I, B = !R && N && D && !I.length, V = !M || k && (z.length > 0 || B), ee = z.length > 0 && /* @__PURE__ */ d("ul", {
|
|
4887
5434
|
style: {
|
|
4888
5435
|
listStyle: "none",
|
|
4889
5436
|
margin: 0,
|
|
@@ -4944,7 +5491,7 @@ function Gn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
4944
5491
|
onChange: (e) => E(e.target.value),
|
|
4945
5492
|
onFocus: () => N && A(!0),
|
|
4946
5493
|
style: {
|
|
4947
|
-
...
|
|
5494
|
+
...jt,
|
|
4948
5495
|
flexGrow: 1,
|
|
4949
5496
|
minWidth: 0
|
|
4950
5497
|
}
|
|
@@ -4987,7 +5534,7 @@ function Gn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
4987
5534
|
background: "var(--page-surface, #f2f2f2)",
|
|
4988
5535
|
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.18)"
|
|
4989
5536
|
} : { marginTop: 14 },
|
|
4990
|
-
children: [
|
|
5537
|
+
children: [ee, B && /* @__PURE__ */ d("div", {
|
|
4991
5538
|
style: {
|
|
4992
5539
|
fontSize: 14,
|
|
4993
5540
|
opacity: .65,
|
|
@@ -5002,21 +5549,21 @@ function Gn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5002
5549
|
}
|
|
5003
5550
|
//#endregion
|
|
5004
5551
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
5005
|
-
function
|
|
5552
|
+
function lr(e) {
|
|
5006
5553
|
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());
|
|
5007
5554
|
return [...new Set(n.map((e) => e.trim()))];
|
|
5008
5555
|
}
|
|
5009
|
-
var
|
|
5010
|
-
function
|
|
5556
|
+
var ur = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
5557
|
+
function dr(e, t) {
|
|
5011
5558
|
let n = String(e ?? "").toUpperCase();
|
|
5012
5559
|
if (t === "code") return n;
|
|
5013
5560
|
let r = "";
|
|
5014
5561
|
try {
|
|
5015
|
-
r =
|
|
5562
|
+
r = ur(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
5016
5563
|
} catch {}
|
|
5017
5564
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
5018
5565
|
}
|
|
5019
|
-
function
|
|
5566
|
+
function fr(e, t) {
|
|
5020
5567
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
5021
5568
|
if (typeof window > "u") return n || "?";
|
|
5022
5569
|
try {
|
|
@@ -5026,8 +5573,8 @@ function Yn(e, t) {
|
|
|
5026
5573
|
return n || "/";
|
|
5027
5574
|
}
|
|
5028
5575
|
}
|
|
5029
|
-
function
|
|
5030
|
-
let c = i(
|
|
5576
|
+
function pr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
|
|
5577
|
+
let c = i(J), l = lr(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
|
|
5031
5578
|
display: "inline-flex",
|
|
5032
5579
|
alignItems: "center",
|
|
5033
5580
|
gap: 8,
|
|
@@ -5062,7 +5609,7 @@ function Xn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5062
5609
|
style: { opacity: .4 },
|
|
5063
5610
|
children: n ?? "·"
|
|
5064
5611
|
}), /* @__PURE__ */ d("a", {
|
|
5065
|
-
href:
|
|
5612
|
+
href: fr(e, e === u),
|
|
5066
5613
|
hrefLang: e,
|
|
5067
5614
|
"aria-current": e === p ? "true" : void 0,
|
|
5068
5615
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -5072,7 +5619,7 @@ function Xn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5072
5619
|
textDecoration: "none",
|
|
5073
5620
|
cursor: s ? "default" : "pointer"
|
|
5074
5621
|
},
|
|
5075
|
-
children:
|
|
5622
|
+
children: dr(e, t)
|
|
5076
5623
|
})]
|
|
5077
5624
|
}, e))]
|
|
5078
5625
|
}) : /* @__PURE__ */ f("div", {
|
|
@@ -5083,7 +5630,7 @@ function Xn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5083
5630
|
value: p,
|
|
5084
5631
|
onChange: s ? void 0 : (e) => {
|
|
5085
5632
|
let t = e.target.value;
|
|
5086
|
-
window.location.assign(
|
|
5633
|
+
window.location.assign(fr(t, t === u));
|
|
5087
5634
|
},
|
|
5088
5635
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
5089
5636
|
style: {
|
|
@@ -5097,57 +5644,57 @@ function Xn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5097
5644
|
},
|
|
5098
5645
|
children: l.map((e) => /* @__PURE__ */ d("option", {
|
|
5099
5646
|
value: e,
|
|
5100
|
-
children:
|
|
5647
|
+
children: dr(e, t)
|
|
5101
5648
|
}, e))
|
|
5102
5649
|
})]
|
|
5103
5650
|
});
|
|
5104
5651
|
}
|
|
5105
5652
|
//#endregion
|
|
5106
5653
|
//#region ../ui/src/components/builder/apps/index.js
|
|
5107
|
-
var
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
],
|
|
5113
|
-
SiteLoginForm:
|
|
5114
|
-
SiteAccountMenu:
|
|
5115
|
-
SiteLanguagePicker:
|
|
5116
|
-
CookieConsent:
|
|
5117
|
-
SiteSearch:
|
|
5654
|
+
var mr = [
|
|
5655
|
+
Hn,
|
|
5656
|
+
nr,
|
|
5657
|
+
Yn,
|
|
5658
|
+
rr
|
|
5659
|
+
], hr = {
|
|
5660
|
+
SiteLoginForm: qn,
|
|
5661
|
+
SiteAccountMenu: Jn,
|
|
5662
|
+
SiteLanguagePicker: pr,
|
|
5663
|
+
CookieConsent: tr,
|
|
5664
|
+
SiteSearch: cr
|
|
5118
5665
|
};
|
|
5119
|
-
new Set(
|
|
5666
|
+
new Set(mr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
5120
5667
|
//#endregion
|
|
5121
5668
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
5122
|
-
var
|
|
5123
|
-
function
|
|
5124
|
-
if (
|
|
5669
|
+
var gr = /* @__PURE__ */ new Map();
|
|
5670
|
+
function _r(e) {
|
|
5671
|
+
if (gr.has(e)) return gr.get(e);
|
|
5125
5672
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
5126
5673
|
/* @vite-ignore */
|
|
5127
5674
|
/* webpackIgnore: true */
|
|
5128
5675
|
t
|
|
5129
5676
|
).finally(() => URL.revokeObjectURL(t));
|
|
5130
|
-
return
|
|
5677
|
+
return gr.set(e, n), n;
|
|
5131
5678
|
}
|
|
5132
|
-
function
|
|
5679
|
+
function vr(e) {
|
|
5133
5680
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
5134
5681
|
return n && typeof n == "object" ? n : {};
|
|
5135
5682
|
}
|
|
5136
5683
|
//#endregion
|
|
5137
5684
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
5138
|
-
async function
|
|
5139
|
-
let n = await
|
|
5685
|
+
async function yr(e, t) {
|
|
5686
|
+
let n = await _r(e);
|
|
5140
5687
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
5141
5688
|
}
|
|
5142
|
-
var
|
|
5689
|
+
var br = {
|
|
5143
5690
|
padding: "10px 12px",
|
|
5144
5691
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
5145
5692
|
borderRadius: 8,
|
|
5146
5693
|
fontSize: 12,
|
|
5147
5694
|
opacity: .6
|
|
5148
5695
|
};
|
|
5149
|
-
function
|
|
5150
|
-
let s = i(
|
|
5696
|
+
function xr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
5697
|
+
let s = i(J), l = vr(s?.settings)[e], u = c(null), p = c(null), m = {
|
|
5151
5698
|
tenant: s?.tenant ?? "",
|
|
5152
5699
|
apiUrl: s?.apiUrl ?? "/api",
|
|
5153
5700
|
locale: s?.locale ?? "",
|
|
@@ -5159,7 +5706,7 @@ function ir({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
5159
5706
|
let e = u.current;
|
|
5160
5707
|
if (!l?.code || !e) return;
|
|
5161
5708
|
let n = !0;
|
|
5162
|
-
return
|
|
5709
|
+
return yr(l.code, t).then((e) => {
|
|
5163
5710
|
if (!(!n || !e || !u.current)) {
|
|
5164
5711
|
p.current = e;
|
|
5165
5712
|
try {
|
|
@@ -5189,7 +5736,7 @@ function ir({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
5189
5736
|
}) : /* @__PURE__ */ f("div", {
|
|
5190
5737
|
ref: o,
|
|
5191
5738
|
style: {
|
|
5192
|
-
...
|
|
5739
|
+
...br,
|
|
5193
5740
|
...P(r)
|
|
5194
5741
|
},
|
|
5195
5742
|
children: [
|
|
@@ -5201,12 +5748,12 @@ function ir({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
5201
5748
|
}
|
|
5202
5749
|
//#endregion
|
|
5203
5750
|
//#region ../ui/src/components/builder/render.jsx
|
|
5204
|
-
var
|
|
5205
|
-
...
|
|
5206
|
-
...
|
|
5207
|
-
PluginBlock:
|
|
5751
|
+
var Sr = {
|
|
5752
|
+
...Vn,
|
|
5753
|
+
...hr,
|
|
5754
|
+
PluginBlock: xr
|
|
5208
5755
|
};
|
|
5209
|
-
function
|
|
5756
|
+
function Cr(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
5210
5757
|
let o = n[e];
|
|
5211
5758
|
if (!o || o.hidden) return null;
|
|
5212
5759
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -5214,29 +5761,29 @@ function or(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5214
5761
|
let n = o.props?.componentId, s = r?.[n];
|
|
5215
5762
|
if (!s?.template || i.has(n)) return null;
|
|
5216
5763
|
let c = new Set(i).add(n);
|
|
5217
|
-
return /* @__PURE__ */ d(t, { children:
|
|
5764
|
+
return /* @__PURE__ */ d(t, { children: Cr(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
5218
5765
|
}
|
|
5219
|
-
let l =
|
|
5766
|
+
let l = Sr[s];
|
|
5220
5767
|
if (!l) return null;
|
|
5221
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
5768
|
+
let u = (o.nodes ?? []).map((e) => Cr(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Cr(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
5222
5769
|
...c,
|
|
5223
5770
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
5224
5771
|
linked: p,
|
|
5225
5772
|
nodeRef: (t) => {
|
|
5226
|
-
t && (t.setAttribute("data-wb", e),
|
|
5773
|
+
t && (t.setAttribute("data-wb", e), U(t, c), te(t, a?.events === !1 ? [] : c.events));
|
|
5227
5774
|
},
|
|
5228
5775
|
children: u.length ? u : void 0
|
|
5229
5776
|
}, e);
|
|
5230
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
5777
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(Kn, {
|
|
5231
5778
|
when: c.when,
|
|
5232
5779
|
children: m
|
|
5233
5780
|
}, e) : m;
|
|
5234
5781
|
}
|
|
5235
5782
|
//#endregion
|
|
5236
5783
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
5237
|
-
var
|
|
5238
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
5239
|
-
function
|
|
5784
|
+
var wr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Tr = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(pe(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
5785
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(pe(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
5786
|
+
function Er({ 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 }) {
|
|
5240
5787
|
let y = o?.js?.trim();
|
|
5241
5788
|
if (a(() => {
|
|
5242
5789
|
if (!y) return;
|
|
@@ -5250,35 +5797,35 @@ function lr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5250
5797
|
minHeight: "100%",
|
|
5251
5798
|
display: "flex",
|
|
5252
5799
|
flexDirection: "column"
|
|
5253
|
-
}, w =
|
|
5800
|
+
}, w = Cr("ROOT", e, n), T = s(() => ({ render: (t, r) => Cr(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = le(e, n), O = ce(e, n), k = o?.css?.trim(), j = S(c), M = fe(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !K[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
|
|
5254
5801
|
rel: "stylesheet",
|
|
5255
5802
|
precedence: "default",
|
|
5256
5803
|
href: D(e)
|
|
5257
|
-
}, e)), F =
|
|
5258
|
-
return r === "auto" ? /* @__PURE__ */ d(
|
|
5804
|
+
}, e)), F = Tr(M);
|
|
5805
|
+
return r === "auto" ? /* @__PURE__ */ d(J.Provider, {
|
|
5259
5806
|
value: {
|
|
5260
5807
|
tenant: l || "",
|
|
5261
5808
|
apiUrl: u || "/api",
|
|
5262
5809
|
locale: m || "",
|
|
5263
5810
|
settings: _ ?? null
|
|
5264
5811
|
},
|
|
5265
|
-
children: /* @__PURE__ */ d(
|
|
5812
|
+
children: /* @__PURE__ */ d(Gn, {
|
|
5266
5813
|
initialUser: v,
|
|
5267
|
-
children: /* @__PURE__ */ d(
|
|
5814
|
+
children: /* @__PURE__ */ d(ve.Provider, {
|
|
5268
5815
|
value: p ?? null,
|
|
5269
|
-
children: /* @__PURE__ */ d(
|
|
5816
|
+
children: /* @__PURE__ */ d(Se.Provider, {
|
|
5270
5817
|
value: T,
|
|
5271
5818
|
children: /* @__PURE__ */ f("div", {
|
|
5272
5819
|
...b,
|
|
5273
5820
|
className: "webim-page",
|
|
5274
5821
|
style: {
|
|
5275
5822
|
...C,
|
|
5276
|
-
...
|
|
5823
|
+
...me(t),
|
|
5277
5824
|
...i
|
|
5278
5825
|
},
|
|
5279
5826
|
children: [
|
|
5280
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
5281
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
5827
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${wr(pe(M.light))} }
|
|
5828
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${wr(pe(M.dark))} } }` }),
|
|
5282
5829
|
/* @__PURE__ */ d("style", { children: F }),
|
|
5283
5830
|
P,
|
|
5284
5831
|
/* @__PURE__ */ d("style", { children: x }),
|
|
@@ -5291,25 +5838,25 @@ function lr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5291
5838
|
})
|
|
5292
5839
|
})
|
|
5293
5840
|
})
|
|
5294
|
-
}) : /* @__PURE__ */ d(
|
|
5841
|
+
}) : /* @__PURE__ */ d(J.Provider, {
|
|
5295
5842
|
value: {
|
|
5296
5843
|
tenant: l || "",
|
|
5297
5844
|
apiUrl: u || "/api",
|
|
5298
5845
|
locale: m || "",
|
|
5299
5846
|
settings: _ ?? null
|
|
5300
5847
|
},
|
|
5301
|
-
children: /* @__PURE__ */ d(
|
|
5848
|
+
children: /* @__PURE__ */ d(Gn, {
|
|
5302
5849
|
initialUser: v,
|
|
5303
|
-
children: /* @__PURE__ */ d(
|
|
5850
|
+
children: /* @__PURE__ */ d(ve.Provider, {
|
|
5304
5851
|
value: p ?? null,
|
|
5305
|
-
children: /* @__PURE__ */ d(
|
|
5852
|
+
children: /* @__PURE__ */ d(Se.Provider, {
|
|
5306
5853
|
value: T,
|
|
5307
5854
|
children: /* @__PURE__ */ f("div", {
|
|
5308
5855
|
...b,
|
|
5309
5856
|
className: "webim-page",
|
|
5310
5857
|
style: {
|
|
5311
5858
|
...C,
|
|
5312
|
-
...
|
|
5859
|
+
...he(t, r),
|
|
5313
5860
|
...i
|
|
5314
5861
|
},
|
|
5315
5862
|
children: [
|
|
@@ -5331,8 +5878,8 @@ function lr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5331
5878
|
}
|
|
5332
5879
|
//#endregion
|
|
5333
5880
|
//#region src/WebimContent.jsx
|
|
5334
|
-
function
|
|
5335
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
5881
|
+
function Dr({ bundle: e, mode: t = "auto", style: n }) {
|
|
5882
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(Er, {
|
|
5336
5883
|
blocks: e.blocks,
|
|
5337
5884
|
theme: e.theme,
|
|
5338
5885
|
components: e.components,
|
|
@@ -5344,13 +5891,13 @@ function ur({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
5344
5891
|
locale: e.locale,
|
|
5345
5892
|
direction: e.direction,
|
|
5346
5893
|
settings: e.settings,
|
|
5347
|
-
mode:
|
|
5894
|
+
mode: _e(t, e.scheme),
|
|
5348
5895
|
style: n
|
|
5349
5896
|
}) : null;
|
|
5350
5897
|
}
|
|
5351
5898
|
//#endregion
|
|
5352
5899
|
//#region src/bundle.js
|
|
5353
|
-
function
|
|
5900
|
+
function Or({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
5354
5901
|
let a = {
|
|
5355
5902
|
...t?.global ?? {},
|
|
5356
5903
|
...t?.tenant ?? {}
|
|
@@ -5360,7 +5907,7 @@ function dr({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
5360
5907
|
title: e.title,
|
|
5361
5908
|
slug: e.slug,
|
|
5362
5909
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
5363
|
-
theme:
|
|
5910
|
+
theme: ge(o, a.builder_themes?.themes),
|
|
5364
5911
|
components: a.builder_components?.components ?? {},
|
|
5365
5912
|
custom: o.custom,
|
|
5366
5913
|
animations: o.animations,
|
|
@@ -5376,18 +5923,18 @@ function dr({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
5376
5923
|
}
|
|
5377
5924
|
//#endregion
|
|
5378
5925
|
//#region src/fetchPage.js
|
|
5379
|
-
var
|
|
5926
|
+
var kr = async (e) => {
|
|
5380
5927
|
let t = await e.json().catch(() => null);
|
|
5381
5928
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
5382
5929
|
return t?.payload ?? t;
|
|
5383
5930
|
};
|
|
5384
|
-
async function
|
|
5931
|
+
async function Ar({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
5385
5932
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
5386
5933
|
if (!n) throw Error("fetchPage: slug is required");
|
|
5387
5934
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
5388
5935
|
...t ? { "x-tenant": t } : {},
|
|
5389
5936
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
5390
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
5937
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(kr), c(`${l}/settings/public`, { headers: u }).then(kr)]), p = Or({
|
|
5391
5938
|
page: d,
|
|
5392
5939
|
settings: f,
|
|
5393
5940
|
tenant: t,
|
|
@@ -5397,10 +5944,11 @@ async function pr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
5397
5944
|
"TableBlock",
|
|
5398
5945
|
"OrgChartBlock",
|
|
5399
5946
|
"NavbarBlock",
|
|
5400
|
-
"CalendarBlock"
|
|
5947
|
+
"CalendarBlock",
|
|
5948
|
+
"MasonryBlock"
|
|
5401
5949
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
5402
5950
|
if (m.length) {
|
|
5403
|
-
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(
|
|
5951
|
+
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(kr).then((e) => {
|
|
5404
5952
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
5405
5953
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
5406
5954
|
}).catch(() => [[t, []]])));
|
|
@@ -5414,40 +5962,40 @@ async function pr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
5414
5962
|
}
|
|
5415
5963
|
//#endregion
|
|
5416
5964
|
//#region src/ssr.jsx
|
|
5417
|
-
var
|
|
5965
|
+
var jr = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
5418
5966
|
"&": "&",
|
|
5419
5967
|
"<": "<",
|
|
5420
5968
|
">": ">",
|
|
5421
5969
|
"\"": """
|
|
5422
5970
|
})[e]);
|
|
5423
|
-
function
|
|
5424
|
-
return e(/* @__PURE__ */ d(
|
|
5971
|
+
function Mr(t, { mode: n = "auto", style: r } = {}) {
|
|
5972
|
+
return e(/* @__PURE__ */ d(Dr, {
|
|
5425
5973
|
bundle: t,
|
|
5426
5974
|
mode: n,
|
|
5427
5975
|
style: r
|
|
5428
5976
|
}));
|
|
5429
5977
|
}
|
|
5430
|
-
function
|
|
5978
|
+
function Nr(e, { mode: t = "auto", lang: n } = {}) {
|
|
5431
5979
|
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 = [
|
|
5432
5980
|
"<meta charset=\"utf-8\"/>",
|
|
5433
5981
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
5434
|
-
`<title>${
|
|
5435
|
-
r.description && `<meta name="description" content="${
|
|
5436
|
-
`<meta property="og:title" content="${
|
|
5437
|
-
r.image && `<meta property="og:image" content="${
|
|
5982
|
+
`<title>${jr(o)}</title>`,
|
|
5983
|
+
r.description && `<meta name="description" content="${jr(r.description)}"/>`,
|
|
5984
|
+
`<meta property="og:title" content="${jr(o)}"/>`,
|
|
5985
|
+
r.image && `<meta property="og:image" content="${jr(r.image)}"/>`,
|
|
5438
5986
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
5439
5987
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
5440
5988
|
].filter(Boolean).join("\n");
|
|
5441
5989
|
return `<!doctype html>
|
|
5442
|
-
<html lang="${
|
|
5990
|
+
<html lang="${jr(i)}"${a ? ` dir="${a}"` : ""}>
|
|
5443
5991
|
<head>
|
|
5444
5992
|
${c}
|
|
5445
5993
|
</head>
|
|
5446
5994
|
<body>
|
|
5447
|
-
${
|
|
5995
|
+
${Mr(e, { mode: t })}
|
|
5448
5996
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
5449
5997
|
</body>
|
|
5450
5998
|
</html>`;
|
|
5451
5999
|
}
|
|
5452
6000
|
//#endregion
|
|
5453
|
-
export {
|
|
6001
|
+
export { Or as assembleBundle, Ar as fetchPage, Mr as renderBundleHtml, Nr as renderPageDocument };
|