webim-adapter 1.1.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -254,30 +254,30 @@ function A(e) {
254
254
  R !== void 0 && U.push(`blur(${O(R)})`), z !== void 0 && U.push(`grayscale(${z}%)`), B !== void 0 && U.push(`brightness(${B}%)`), V !== void 0 && U.push(`contrast(${V}%)`), H !== void 0 && U.push(`saturate(${H}%)`), U.length && (t.filter = U.join(" "));
255
255
  let ee = F(L);
256
256
  ee.length && (t.backdropFilter = ee.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
257
- let { textStrokeWidth: te, textStrokeColor: ne } = t;
258
- delete t.textStrokeWidth, delete t.textStrokeColor, (te !== void 0 || ne !== void 0) && (t.WebkitTextStroke = `${O(te ?? 1)} ${ne || "currentColor"}`);
259
- let { clipText: re } = t;
260
- delete t.clipText, re && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
261
- let { transitions: W, transitionDuration: G, transitionEasing: K, transitionProperty: ie } = t, ae = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
257
+ let { textStrokeWidth: W, textStrokeColor: te } = t;
258
+ delete t.textStrokeWidth, delete t.textStrokeColor, (W !== void 0 || te !== void 0) && (t.WebkitTextStroke = `${O(W ?? 1)} ${te || "currentColor"}`);
259
+ let { clipText: ne } = t;
260
+ delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
261
+ let { transitions: re, transitionDuration: G, transitionEasing: K, transitionProperty: q } = t, ie = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
262
262
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
263
- let oe = (Array.isArray(W) ? W : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ae(e.duration ?? 200)} ${e.easing || "ease"}`);
264
- if (G !== void 0 && oe.push(`${ie || "all"} ${ae(G)} ${K || "ease"}`), oe.length && (t.transition = oe.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
263
+ let J = (Array.isArray(re) ? re : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ie(e.duration ?? 200)} ${e.easing || "ease"}`);
264
+ if (G !== void 0 && J.push(`${q || "all"} ${ie(G)} ${K || "ease"}`), J.length && (t.transition = J.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
265
265
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
266
266
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
267
267
  }
268
268
  delete t.backgroundVideo;
269
- let { overlayColor: q, overlayOpacity: se } = t;
270
- if (delete t.overlayColor, delete t.overlayOpacity, q) {
271
- let e = `color-mix(in srgb, ${q} ${se ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
269
+ let { overlayColor: ae, overlayOpacity: oe } = t;
270
+ if (delete t.overlayColor, delete t.overlayOpacity, ae) {
271
+ let e = `color-mix(in srgb, ${ae} ${oe ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
272
272
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
273
273
  }
274
274
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
275
- let { backgroundLayers: ce } = t;
275
+ let { backgroundLayers: se } = t;
276
276
  delete t.backgroundLayers;
277
- let le = (Array.isArray(ce) ? ce : []).filter((e) => e && e.on !== !1);
278
- if (le.length) {
277
+ let ce = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1);
278
+ if (ce.length) {
279
279
  let e = [], n = [], r = [], i = [], a = [];
280
- for (let t of le) 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");
280
+ for (let t of ce) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
281
281
  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");
282
282
  else {
283
283
  if (!t.src) continue;
@@ -377,7 +377,7 @@ function U(e, t, n, r = !1) {
377
377
  function ee(e, t, n) {
378
378
  return Object.entries(j).map(([r, i]) => U(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
379
379
  }
380
- var te = [
380
+ var W = [
381
381
  {
382
382
  key: "tablet",
383
383
  max: 991
@@ -390,17 +390,17 @@ var te = [
390
390
  key: "mobile",
391
391
  max: 478
392
392
  }
393
- ], ne = (e) => Object.entries(A(e)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
394
- function re(e, t) {
395
- return te.map(({ key: n, max: r }) => {
396
- let i = t?.[n] ? ne(t[n]) : "";
393
+ ], te = (e) => Object.entries(A(e)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
394
+ function ne(e, t) {
395
+ return W.map(({ key: n, max: r }) => {
396
+ let i = t?.[n] ? te(t[n]) : "";
397
397
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
398
398
  }).filter(Boolean).join("\n");
399
399
  }
400
- function W(e, t) {
400
+ function re(e, t) {
401
401
  let n = [], r = (e) => {
402
402
  for (let [t, r] of Object.entries(e || {})) {
403
- let e = re(t, r.props);
403
+ let e = ne(t, r.props);
404
404
  e && n.push(e);
405
405
  }
406
406
  };
@@ -419,7 +419,7 @@ function G(e, t) {
419
419
  for (let e of Object.values(t || {})) r(e.template?.nodes);
420
420
  return n.join("\n");
421
421
  }
422
- var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", ie = {
422
+ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", q = {
423
423
  fontFamily: K,
424
424
  fontStyle: "normal",
425
425
  fontWeight: 400,
@@ -427,7 +427,7 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
427
427
  textTransform: "none",
428
428
  lineHeight: 1.4,
429
429
  textShadow: "none"
430
- }, ae = {
430
+ }, ie = {
431
431
  light: {
432
432
  background: "#f2f2f2",
433
433
  surface: "#f2f2f2",
@@ -468,12 +468,21 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
468
468
  contrastText: "#052e2b"
469
469
  }
470
470
  }
471
- }, oe = {
471
+ }, J = {
472
+ h1: 40,
473
+ h2: 32,
474
+ h3: 26,
475
+ h4: 22,
476
+ h5: 19,
477
+ h6: 16
478
+ }, ae = {
472
479
  font: "system",
473
480
  headingFont: "inherit",
474
- light: ae.light,
475
- dark: ae.dark
476
- }, q = {
481
+ headings: J,
482
+ bodySize: 16,
483
+ light: ie.light,
484
+ dark: ie.dark
485
+ }, oe = {
477
486
  system: {
478
487
  label: "System",
479
488
  value: K
@@ -494,7 +503,7 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
494
503
  label: "Mono",
495
504
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
496
505
  }
497
- }, se = (e, t) => q[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), ce = (e, ...t) => {
506
+ }, se = (e, t) => oe[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), ce = (e, ...t) => {
498
507
  let n = Object.assign({}, e, ...t);
499
508
  return n.primary = {
500
509
  ...e.primary,
@@ -511,19 +520,24 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
511
520
  }, n;
512
521
  };
513
522
  function le(e) {
514
- let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
523
+ let { light: t, dark: n, font: r, headingFont: i, headings: a, bodySize: o, ...s } = e ?? {};
515
524
  return {
516
- font: r ?? oe.font,
517
- headingFont: i ?? oe.headingFont,
518
- light: ce(ae.light, a, t),
519
- dark: ce(ae.dark, n)
525
+ font: r ?? ae.font,
526
+ headingFont: i ?? ae.headingFont,
527
+ headings: {
528
+ ...J,
529
+ ...a ?? {}
530
+ },
531
+ bodySize: o ?? 16,
532
+ light: ce(ie.light, s, t),
533
+ dark: ce(ie.dark, n)
520
534
  };
521
535
  }
522
536
  function ue(e) {
523
537
  return {
524
538
  "--page-bg": e.background,
525
539
  "--page-surface": e.surface ?? e.background,
526
- "--page-border": e.border ?? ae.light.border,
540
+ "--page-border": e.border ?? ie.light.border,
527
541
  "--page-text": e.text,
528
542
  "--page-accent": e.accent,
529
543
  "--page-accent-text": e.accentText,
@@ -543,25 +557,38 @@ function de(e) {
543
557
  backgroundColor: "var(--page-bg)",
544
558
  color: "var(--page-text)",
545
559
  fontFamily: se(t.font, K),
546
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : se(t.headingFont, "inherit")
560
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : se(t.headingFont, "inherit"),
561
+ ...pe(t.headings),
562
+ "--page-body-size": fe(t.bodySize, 16)
547
563
  };
548
564
  }
549
- function fe(e, t = "light") {
565
+ function fe(e, t) {
566
+ return e === "" || e == null ? `${t}px` : isNaN(Number(e)) ? String(e) : `${Number(e)}px`;
567
+ }
568
+ function pe(e) {
569
+ let t = {};
570
+ for (let n of Object.keys(J)) {
571
+ let r = e?.[n] ?? J[n];
572
+ t[`--page-${n}`] = fe(r, J[n]);
573
+ }
574
+ return t;
575
+ }
576
+ function me(e, t = "light") {
550
577
  let n = le(e);
551
578
  return {
552
579
  ...de(e),
553
580
  ...ue(n[t] ?? n.light)
554
581
  };
555
582
  }
556
- function J(e, t) {
583
+ function he(e, t) {
557
584
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
558
585
  }
559
- function pe(e, t) {
586
+ function ge(e, t) {
560
587
  return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
561
588
  }
562
589
  //#endregion
563
590
  //#region src/bundle.js
564
- function me({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
591
+ function _e({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
565
592
  let a = {
566
593
  ...t?.global ?? {},
567
594
  ...t?.tenant ?? {}
@@ -571,7 +598,7 @@ function me({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
571
598
  title: e.title,
572
599
  slug: e.slug,
573
600
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
574
- theme: J(o, a.builder_themes?.themes),
601
+ theme: he(o, a.builder_themes?.themes),
575
602
  components: a.builder_components?.components ?? {},
576
603
  custom: o.custom,
577
604
  animations: o.animations,
@@ -587,18 +614,18 @@ function me({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
587
614
  }
588
615
  //#endregion
589
616
  //#region src/fetchPage.js
590
- var he = async (e) => {
617
+ var ve = async (e) => {
591
618
  let t = await e.json().catch(() => null);
592
619
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
593
620
  return t?.payload ?? t;
594
621
  };
595
- async function ge({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
622
+ async function ye({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
596
623
  if (!e) throw Error("fetchPage: apiUrl is required");
597
624
  if (!n) throw Error("fetchPage: slug is required");
598
625
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
599
626
  ...t ? { "x-tenant": t } : {},
600
627
  ...a ? { authorization: `Bearer ${a}` } : {}
601
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(he), c(`${l}/settings/public`, { headers: u }).then(he)]), p = me({
628
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(ve), c(`${l}/settings/public`, { headers: u }).then(ve)]), p = _e({
602
629
  page: d,
603
630
  settings: f,
604
631
  tenant: t,
@@ -613,7 +640,7 @@ async function ge({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
613
640
  "LogoCarousel"
614
641
  ].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
615
642
  if (m.length) {
616
- let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(he).then((e) => {
643
+ let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(ve).then((e) => {
617
644
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
618
645
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
619
646
  }).catch(() => [[t, []]])));
@@ -627,7 +654,7 @@ async function ge({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
627
654
  }
628
655
  //#endregion
629
656
  //#region ../ui/src/components/builder/locale.js
630
- var _e = /* @__PURE__ */ new Set([
657
+ var be = /* @__PURE__ */ new Set([
631
658
  "ar",
632
659
  "he",
633
660
  "fa",
@@ -638,34 +665,34 @@ var _e = /* @__PURE__ */ new Set([
638
665
  "yi",
639
666
  "dv",
640
667
  "ckb"
641
- ]), ve = (e) => _e.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", ye = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ve(t) : void 0, Y = t({
668
+ ]), Y = (e) => be.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", X = (e, t) => e === "ltr" || e === "rtl" ? e : t ? Y(t) : void 0, Z = t({
642
669
  tenant: "",
643
670
  apiUrl: "/api",
644
671
  locale: "",
645
672
  settings: null
646
- }), be = t(null), xe = (e) => {
673
+ }), xe = t(null), Se = (e) => {
647
674
  let t = Number(e?.__page);
648
675
  if (Number.isFinite(t) && t >= 1) return Math.floor(t);
649
676
  if (typeof window > "u") return 1;
650
677
  let n = Number(new URLSearchParams(window.location.search).get("page"));
651
678
  return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
652
- }, Se = () => {
679
+ }, Q = () => {
653
680
  if (typeof window > "u") return {};
654
681
  let e = {};
655
682
  return new URLSearchParams(window.location.search).forEach((t, n) => {
656
683
  n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
657
684
  }), e;
658
- }, X = (e) => {
685
+ }, Ce = (e) => {
659
686
  let t = {
660
687
  ...e && typeof e == "object" && !Array.isArray(e) ? e : {},
661
- ...Se()
688
+ ...Q()
662
689
  };
663
690
  return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
664
- }, Z = t(null), Q = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
665
- function Ce(e, t) {
691
+ }, we = t(null), Te = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
692
+ function Ee(e, t) {
666
693
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
667
694
  }
668
- var we = (e) => {
695
+ var De = (e) => {
669
696
  let t = [];
670
697
  for (let [n, r] of Object.entries(e ?? {})) {
671
698
  if (!/^[\w-]+$/.test(n)) continue;
@@ -675,36 +702,39 @@ var we = (e) => {
675
702
  }
676
703
  return t;
677
704
  };
678
- function Te(e) {
705
+ function Oe(e) {
679
706
  return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
680
707
  }
681
- function Ee(e, t) {
682
- let n = t?.data ?? {}, r = we(n);
708
+ function ke(e, t) {
709
+ let n = t?.data ?? {}, r = De(n);
683
710
  if (!r.length) return e;
684
- let i = RegExp(`:(${r.map(Q).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Te(Ce(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
711
+ let i = RegExp(`:(${r.map(Te).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Oe(Ee(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
685
712
  return a(e);
686
713
  }
687
- var De = {
714
+ var Ae = {
688
715
  margin: 0,
689
716
  fontWeight: 700,
690
717
  lineHeight: 1.2,
691
718
  fontFamily: "var(--page-heading-font, inherit)"
692
- }, Oe = { margin: 0 }, ke = {
719
+ }, je = J, Me = (e) => `var(--page-${e}, ${J[e] ?? J.h2}px)`, Ne = {
720
+ margin: 0,
721
+ fontSize: "var(--page-body-size, 16px)"
722
+ }, Pe = {
693
723
  display: "inline-block",
694
724
  textDecoration: "none",
695
725
  cursor: "pointer",
696
726
  backgroundColor: "var(--page-accent, #111827)",
697
727
  color: "var(--page-accent-text, #ffffff)"
698
- }, Ae = {
728
+ }, Fe = {
699
729
  flexGrow: 1,
700
730
  display: "flex",
701
731
  flexDirection: "column",
702
732
  position: "relative"
703
- }, je = {
733
+ }, Ie = {
704
734
  display: "flex",
705
735
  flexDirection: "column"
706
736
  };
707
- function Me({ style: e }) {
737
+ function Le({ style: e }) {
708
738
  let t = e?.backgroundVideo;
709
739
  if (!t) return null;
710
740
  let n = {
@@ -730,7 +760,7 @@ function Me({ style: e }) {
730
760
  background: r
731
761
  } })] });
732
762
  }
733
- var Ne = (e, t) => e?.backgroundVideo ? {
763
+ var Re = (e, t) => e?.backgroundVideo ? {
734
764
  position: "relative",
735
765
  ...t,
736
766
  ...A(e)
@@ -738,24 +768,24 @@ var Ne = (e, t) => e?.backgroundVideo ? {
738
768
  ...t,
739
769
  ...A(e)
740
770
  };
741
- function Pe({ style: e, nodeRef: t, children: n }) {
771
+ function ze({ style: e, nodeRef: t, children: n }) {
742
772
  return /* @__PURE__ */ d("div", {
743
773
  ref: t,
744
774
  style: {
745
- ...Ae,
775
+ ...Fe,
746
776
  ...A(e)
747
777
  },
748
- children: [/* @__PURE__ */ u(Me, { style: e }), n]
778
+ children: [/* @__PURE__ */ u(Le, { style: e }), n]
749
779
  });
750
780
  }
751
- function Fe({ style: e, nodeRef: t, children: n }) {
781
+ function Be({ style: e, nodeRef: t, children: n }) {
752
782
  return /* @__PURE__ */ d("section", {
753
783
  ref: t,
754
- style: Ne(e, je),
755
- children: [/* @__PURE__ */ u(Me, { style: e }), n]
784
+ style: Re(e, Ie),
785
+ children: [/* @__PURE__ */ u(Le, { style: e }), n]
756
786
  });
757
787
  }
758
- function Ie({ style: e, freeLayout: t, nodeRef: n, children: r }) {
788
+ function Ve({ style: e, freeLayout: t, nodeRef: n, children: r }) {
759
789
  let i = t ? {
760
790
  position: "relative",
761
791
  minHeight: 240
@@ -764,32 +794,33 @@ function Ie({ style: e, freeLayout: t, nodeRef: n, children: r }) {
764
794
  ref: n,
765
795
  style: i ? {
766
796
  ...i,
767
- ...Ne(e)
768
- } : Ne(e),
769
- children: [/* @__PURE__ */ u(Me, { style: e }), r]
797
+ ...Re(e)
798
+ } : Re(e),
799
+ children: [/* @__PURE__ */ u(Le, { style: e }), r]
770
800
  });
771
801
  }
772
- function Le({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
802
+ function He({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
773
803
  return /* @__PURE__ */ u(n, {
774
804
  ref: a,
775
805
  style: {
776
- ...De,
806
+ ...Ae,
807
+ fontSize: Me(n),
777
808
  ...A(r)
778
809
  },
779
- children: Be(t, e, i)
810
+ children: Ge(t, e, i)
780
811
  });
781
812
  }
782
- var Re = {
783
- fontFamily: q.mono.value,
813
+ var Ue = {
814
+ fontFamily: oe.mono.value,
784
815
  background: "rgba(148, 163, 184, 0.18)",
785
816
  padding: "1px 5px",
786
817
  borderRadius: 4,
787
818
  fontSize: "0.9em"
788
819
  };
789
- function ze(e, t = [], n, r) {
820
+ function We(e, t = [], n, r) {
790
821
  let i = e;
791
822
  return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
792
- style: Re,
823
+ style: Ue,
793
824
  children: i
794
825
  })), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n ? i = /* @__PURE__ */ u("a", {
795
826
  href: n,
@@ -805,13 +836,13 @@ function ze(e, t = [], n, r) {
805
836
  children: i
806
837
  })), i;
807
838
  }
808
- function Be(t, n, r) {
839
+ function Ge(t, n, r) {
809
840
  return t?.length ? t.map((t, n) => {
810
841
  if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
811
- if (t.parts) return /* @__PURE__ */ u(e, { children: Be(t.parts, "", r) }, n);
842
+ if (t.parts) return /* @__PURE__ */ u(e, { children: Ge(t.parts, "", r) }, n);
812
843
  let i = t.text;
813
844
  return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
814
- style: Re,
845
+ style: Ue,
815
846
  children: i
816
847
  })), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
817
848
  style: {
@@ -834,21 +865,35 @@ function Be(t, n, r) {
834
865
  })), /* @__PURE__ */ u(e, { children: i }, n);
835
866
  }) : n;
836
867
  }
837
- function Ve({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
868
+ function Ke({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
838
869
  return /* @__PURE__ */ u("span", {
839
870
  style: A(a),
840
- children: e?.length ? Be(e, t) : ze(t, n, r, i)
871
+ children: e?.length ? Ge(e, t) : We(t, n, r, i)
841
872
  });
842
873
  }
843
- var He = {
844
- h1: 40,
845
- h2: 32,
846
- h3: 26,
847
- h4: 22,
848
- h5: 19,
849
- h6: 16
850
- };
851
- function Ue({ align: e = "center", width: t, wrap: n } = {}) {
874
+ var qe = [
875
+ "left",
876
+ "center",
877
+ "right",
878
+ "justify"
879
+ ];
880
+ function Je(e, t, n) {
881
+ let r = e && e.cellStyles;
882
+ if (!r || typeof r != "object" || Array.isArray(r)) return {};
883
+ let i = r[`${t}:${n}`];
884
+ return i && typeof i == "object" && !Array.isArray(i) ? i : {};
885
+ }
886
+ function Ye(e, t) {
887
+ let n = e || {}, r = typeof n.bold == "boolean" ? n.bold : !!t;
888
+ return {
889
+ textAlign: qe.includes(n.align) ? n.align : "left",
890
+ fontWeight: r ? 700 : 400,
891
+ fontStyle: n.italic ? "italic" : void 0,
892
+ color: typeof n.color == "string" && n.color ? n.color : void 0,
893
+ backgroundColor: typeof n.bg == "string" && n.bg ? n.bg : void 0
894
+ };
895
+ }
896
+ function Xe({ align: e = "center", width: t, wrap: n } = {}) {
852
897
  let r = t ? `${t}%` : void 0;
853
898
  if (e === "full") return { width: "100%" };
854
899
  let i = e === "left" || e === "right";
@@ -882,8 +927,8 @@ function Ue({ align: e = "center", width: t, wrap: n } = {}) {
882
927
  marginRight: "auto"
883
928
  };
884
929
  }
885
- function We(e = [], t, n) {
886
- let r = n ?? ((e, n) => Be(e, n, t));
930
+ function Ze(e = [], t, n) {
931
+ let r = n ?? ((e, n) => Ge(e, n, t));
887
932
  return e.map((t, n) => {
888
933
  let i = {
889
934
  marginTop: 0,
@@ -905,7 +950,7 @@ function We(e = [], t, n) {
905
950
  marginLeft: 0,
906
951
  marginRight: 0,
907
952
  ...i,
908
- ...Ue(t)
953
+ ...Xe(t)
909
954
  },
910
955
  children: [t.href ? /* @__PURE__ */ u("a", {
911
956
  href: t.href,
@@ -924,16 +969,16 @@ function We(e = [], t, n) {
924
969
  })]
925
970
  }, n);
926
971
  }
927
- if (t.type === "video") return tt(t.url) ? /* @__PURE__ */ u("div", {
972
+ if (t.type === "video") return ct(t.url) ? /* @__PURE__ */ u("div", {
928
973
  style: {
929
974
  ...i,
930
- ...Ue({
975
+ ...Xe({
931
976
  align: t.align,
932
977
  wrap: t.wrap,
933
978
  width: t.width ?? 100
934
979
  })
935
980
  },
936
- children: /* @__PURE__ */ u(nt, {
981
+ children: /* @__PURE__ */ u(lt, {
937
982
  url: t.url,
938
983
  autoplay: t.autoplay,
939
984
  muted: t.muted,
@@ -994,9 +1039,11 @@ function We(e = [], t, n) {
994
1039
  let r = t.header !== !1, a = {
995
1040
  border: t.borders === !1 ? void 0 : "1px solid rgba(148, 163, 184, 0.4)",
996
1041
  padding: "6px 10px",
997
- textAlign: "left",
998
1042
  verticalAlign: "top"
999
- }, o = r ? e.slice(1) : e, s = Array.isArray(t.widths) ? t.widths : null;
1043
+ }, o = r ? e.slice(1) : e, s = Array.isArray(t.widths) ? t.widths : null, c = (e, n, r) => ({
1044
+ ...a,
1045
+ ...Ye(Je(t, e, n), r)
1046
+ });
1000
1047
  return /* @__PURE__ */ d("table", {
1001
1048
  style: {
1002
1049
  ...i,
@@ -1008,16 +1055,13 @@ function We(e = [], t, n) {
1008
1055
  children: [
1009
1056
  s && /* @__PURE__ */ u("colgroup", { children: s.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
1010
1057
  r && /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e[0].map((e, t) => /* @__PURE__ */ u("th", {
1011
- style: {
1012
- ...a,
1013
- fontWeight: 700
1014
- },
1058
+ style: c(0, t, !0),
1015
1059
  children: e
1016
1060
  }, t)) }) }),
1017
- /* @__PURE__ */ u("tbody", { children: o.map((e, t) => /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("td", {
1018
- style: a,
1061
+ /* @__PURE__ */ u("tbody", { children: o.map((e, t) => /* @__PURE__ */ u("tr", { children: e.map((e, n) => /* @__PURE__ */ u("td", {
1062
+ style: c(r ? t + 1 : t, n, !1),
1019
1063
  children: e
1020
- }, t)) }, t)) })
1064
+ }, n)) }, t)) })
1021
1065
  ]
1022
1066
  }, n);
1023
1067
  }
@@ -1036,17 +1080,17 @@ function We(e = [], t, n) {
1036
1080
  }
1037
1081
  if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
1038
1082
  style: {
1039
- ...Ke,
1083
+ ...$e,
1040
1084
  ...i
1041
1085
  },
1042
1086
  children: r(t.parts, t.text)
1043
1087
  }, n);
1044
- if (He[t.type]) {
1088
+ if (je[t.type]) {
1045
1089
  let e = t.type;
1046
1090
  return /* @__PURE__ */ u(e, {
1047
1091
  style: {
1048
- ...De,
1049
- fontSize: He[t.type],
1092
+ ...Ae,
1093
+ fontSize: Me(t.type),
1050
1094
  ...i
1051
1095
  },
1052
1096
  children: r(t.parts, t.text)
@@ -1054,39 +1098,39 @@ function We(e = [], t, n) {
1054
1098
  }
1055
1099
  return /* @__PURE__ */ u("p", {
1056
1100
  style: {
1057
- ...Oe,
1101
+ ...Ne,
1058
1102
  ...i
1059
1103
  },
1060
1104
  children: r(t.parts, t.text)
1061
1105
  }, n);
1062
1106
  });
1063
1107
  }
1064
- function Ge({ content: e, style: t, linked: n, nodeRef: r }) {
1108
+ function Qe({ content: e, style: t, linked: n, nodeRef: r }) {
1065
1109
  return /* @__PURE__ */ u("div", {
1066
1110
  ref: r,
1067
1111
  style: {
1068
1112
  display: "flow-root",
1069
1113
  ...A(t)
1070
1114
  },
1071
- children: We(e, n)
1115
+ children: Ze(e, n)
1072
1116
  });
1073
1117
  }
1074
- var Ke = {
1118
+ var $e = {
1075
1119
  margin: 0,
1076
1120
  padding: "8px 0 8px 20px",
1077
1121
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
1078
1122
  };
1079
- function qe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1123
+ function et({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1080
1124
  return /* @__PURE__ */ u("blockquote", {
1081
1125
  ref: i,
1082
1126
  style: {
1083
- ...Ke,
1127
+ ...$e,
1084
1128
  ...A(n)
1085
1129
  },
1086
- children: Be(t, e, r)
1130
+ children: Ge(t, e, r)
1087
1131
  });
1088
1132
  }
1089
- function Je({ ordered: e, items: t = [], style: n, nodeRef: r }) {
1133
+ function tt({ ordered: e, items: t = [], style: n, nodeRef: r }) {
1090
1134
  return /* @__PURE__ */ u(e ? "ol" : "ul", {
1091
1135
  ref: r,
1092
1136
  style: {
@@ -1096,53 +1140,53 @@ function Je({ ordered: e, items: t = [], style: n, nodeRef: r }) {
1096
1140
  },
1097
1141
  children: t.map((e, t) => /* @__PURE__ */ u("li", {
1098
1142
  style: { marginBottom: 4 },
1099
- children: Be(e.parts, e.text)
1143
+ children: Ge(e.parts, e.text)
1100
1144
  }, t))
1101
1145
  });
1102
1146
  }
1103
- function Ye({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1147
+ function nt({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1104
1148
  return /* @__PURE__ */ u("p", {
1105
1149
  ref: i,
1106
1150
  style: {
1107
- ...Oe,
1151
+ ...Ne,
1108
1152
  ...A(n)
1109
1153
  },
1110
- children: Be(t, e, r)
1154
+ children: Ge(t, e, r)
1111
1155
  });
1112
1156
  }
1113
- var Xe = {
1157
+ var rt = {
1114
1158
  color: "var(--page-accent, inherit)",
1115
1159
  textDecoration: "underline",
1116
1160
  textUnderlineOffset: 3,
1117
1161
  cursor: "pointer"
1118
1162
  };
1119
- function Ze({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1163
+ function it({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1120
1164
  return /* @__PURE__ */ u("a", {
1121
1165
  ref: o,
1122
1166
  href: n || "#",
1123
1167
  target: r || void 0,
1124
1168
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
1125
1169
  style: {
1126
- ...Xe,
1170
+ ...rt,
1127
1171
  ...A(i)
1128
1172
  },
1129
- children: Be(t, e, a)
1173
+ children: Ge(t, e, a)
1130
1174
  });
1131
1175
  }
1132
- function Qe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1176
+ function at({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1133
1177
  return /* @__PURE__ */ u("a", {
1134
1178
  ref: o,
1135
1179
  href: n || "#",
1136
1180
  target: r || void 0,
1137
1181
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
1138
1182
  style: {
1139
- ...ke,
1183
+ ...Pe,
1140
1184
  ...A(i)
1141
1185
  },
1142
- children: Be(t, e, a)
1186
+ children: Ge(t, e, a)
1143
1187
  });
1144
1188
  }
1145
- function $e({ src: e, alt: t, style: n, nodeRef: r }) {
1189
+ function ot({ src: e, alt: t, style: n, nodeRef: r }) {
1146
1190
  return e ? /* @__PURE__ */ u("img", {
1147
1191
  ref: r,
1148
1192
  src: e,
@@ -1154,7 +1198,7 @@ function $e({ src: e, alt: t, style: n, nodeRef: r }) {
1154
1198
  }
1155
1199
  }) : null;
1156
1200
  }
1157
- function et({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
1201
+ function st({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
1158
1202
  return e ? /* @__PURE__ */ u("video", {
1159
1203
  ref: s,
1160
1204
  src: e,
@@ -1172,9 +1216,9 @@ function et({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
1172
1216
  }
1173
1217
  }) : null;
1174
1218
  }
1175
- var tt = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
1176
- function nt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
1177
- let c = tt(e);
1219
+ var ct = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
1220
+ function lt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
1221
+ let c = ct(e);
1178
1222
  if (!c) return null;
1179
1223
  let l = new URLSearchParams({ rel: "0" });
1180
1224
  return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ u("div", {
@@ -1200,7 +1244,7 @@ function nt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
1200
1244
  })
1201
1245
  });
1202
1246
  }
1203
- function rt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
1247
+ function ut({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
1204
1248
  return e ? /* @__PURE__ */ u("iframe", {
1205
1249
  ref: i,
1206
1250
  src: e,
@@ -1216,7 +1260,7 @@ function rt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
1216
1260
  }
1217
1261
  }) : null;
1218
1262
  }
1219
- function it({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1263
+ function dt({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1220
1264
  let [a, o] = c(null);
1221
1265
  return i(() => {
1222
1266
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
@@ -1235,17 +1279,18 @@ function it({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1235
1279
  style: A(n)
1236
1280
  });
1237
1281
  }
1238
- function at({ height: e, nodeRef: t }) {
1282
+ function ft({ height: e, style: t, nodeRef: n }) {
1239
1283
  return /* @__PURE__ */ u("div", {
1240
- ref: t,
1284
+ ref: n,
1241
1285
  style: {
1242
1286
  height: e || 32,
1243
1287
  flexShrink: 0,
1244
- alignSelf: "stretch"
1288
+ alignSelf: "stretch",
1289
+ ...A(t)
1245
1290
  }
1246
1291
  });
1247
1292
  }
1248
- function ot({ style: e, nodeRef: t }) {
1293
+ function pt({ style: e, nodeRef: t }) {
1249
1294
  return /* @__PURE__ */ u("div", {
1250
1295
  ref: t,
1251
1296
  style: {
@@ -1256,7 +1301,16 @@ function ot({ style: e, nodeRef: t }) {
1256
1301
  }
1257
1302
  });
1258
1303
  }
1259
- var st = {
1304
+ function mt({ style: e, nodeRef: t }) {
1305
+ return /* @__PURE__ */ u("div", {
1306
+ ref: t,
1307
+ style: {
1308
+ flexShrink: 0,
1309
+ ...A(e)
1310
+ }
1311
+ });
1312
+ }
1313
+ var ht = {
1260
1314
  position: "absolute",
1261
1315
  top: "50%",
1262
1316
  transform: "translateY(-50%)",
@@ -1273,7 +1327,7 @@ var st = {
1273
1327
  alignItems: "center",
1274
1328
  justifyContent: "center",
1275
1329
  padding: 0
1276
- }, ct = {
1330
+ }, gt = {
1277
1331
  bottom: {
1278
1332
  inset: "auto 0 0 0",
1279
1333
  padding: "40px 24px 20px",
@@ -1292,8 +1346,8 @@ var st = {
1292
1346
  padding: 24,
1293
1347
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1294
1348
  }
1295
- }, lt = 48;
1296
- function ut({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1349
+ }, _t = 48;
1350
+ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1297
1351
  let [p, m] = c(0), [h, g] = c(!1), [_, v] = c(null), y = e ? Math.min(p, e - 1) : 0;
1298
1352
  if (i(() => {
1299
1353
  if (!n || h || _ || e < 2) return;
@@ -1309,7 +1363,7 @@ function ut({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1309
1363
  let b = (t) => m((t + e) % e), x = () => {
1310
1364
  if (!_) return;
1311
1365
  let { dx: e } = _;
1312
- v(null), e < -48 ? b(y + 1) : e > lt && b(y - 1);
1366
+ v(null), e < -48 ? b(y + 1) : e > _t && b(y - 1);
1313
1367
  };
1314
1368
  return /* @__PURE__ */ d("div", {
1315
1369
  ref: f,
@@ -1357,7 +1411,7 @@ function ut({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1357
1411
  type: "button",
1358
1412
  "aria-label": "Previous slide",
1359
1413
  style: {
1360
- ...st,
1414
+ ...ht,
1361
1415
  left: 12
1362
1416
  },
1363
1417
  onClick: () => b(y - 1),
@@ -1367,7 +1421,7 @@ function ut({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1367
1421
  type: "button",
1368
1422
  "aria-label": "Next slide",
1369
1423
  style: {
1370
- ...st,
1424
+ ...ht,
1371
1425
  right: 12
1372
1426
  },
1373
1427
  onClick: () => b(y + 1),
@@ -1401,7 +1455,7 @@ function ut({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1401
1455
  ] })]
1402
1456
  });
1403
1457
  }
1404
- var dt = (e, t) => ({
1458
+ var yt = (e, t) => ({
1405
1459
  position: "absolute",
1406
1460
  inset: 0,
1407
1461
  backgroundImage: e ? `url(${e})` : "none",
@@ -1409,18 +1463,18 @@ var dt = (e, t) => ({
1409
1463
  backgroundSize: "cover",
1410
1464
  backgroundPosition: "center"
1411
1465
  });
1412
- function ft({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1413
- return e.length ? /* @__PURE__ */ u(ut, {
1466
+ function bt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1467
+ return e.length ? /* @__PURE__ */ u(vt, {
1414
1468
  ...r,
1415
1469
  count: e.length,
1416
1470
  renderSlide: (r) => {
1417
1471
  let i = e[r];
1418
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: dt(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1472
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: yt(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1419
1473
  style: {
1420
1474
  position: "absolute",
1421
1475
  color: "#fff",
1422
1476
  textAlign: n,
1423
- ...ct[t] ?? ct.bottom
1477
+ ...gt[t] ?? gt.bottom
1424
1478
  },
1425
1479
  children: [i.title && /* @__PURE__ */ u("div", {
1426
1480
  style: {
@@ -1440,13 +1494,13 @@ function ft({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1440
1494
  }
1441
1495
  }) : null;
1442
1496
  }
1443
- function pt({ slides: e = [], linked: t, ...n }) {
1444
- return e.length ? /* @__PURE__ */ u(ut, {
1497
+ function xt({ slides: e = [], linked: t, ...n }) {
1498
+ return e.length ? /* @__PURE__ */ u(vt, {
1445
1499
  ...n,
1446
1500
  count: e.length,
1447
1501
  renderSlide: (n) => {
1448
1502
  let r = e[n];
1449
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: dt(r.image, r.color) }), /* @__PURE__ */ u("div", {
1503
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: yt(r.image, r.color) }), /* @__PURE__ */ u("div", {
1450
1504
  style: {
1451
1505
  position: "absolute",
1452
1506
  inset: 0,
@@ -1458,23 +1512,23 @@ function pt({ slides: e = [], linked: t, ...n }) {
1458
1512
  }
1459
1513
  }) : null;
1460
1514
  }
1461
- var mt = 256, ht = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), gt = (e, t, n) => {
1462
- let r = mt * 2 ** n;
1515
+ var St = 256, Ct = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), wt = (e, t, n) => {
1516
+ let r = St * 2 ** n;
1463
1517
  return {
1464
1518
  x: (Number(t) + 180) / 360 * r,
1465
- y: (.5 - ht(Number(e)) / (2 * Math.PI)) * r
1519
+ y: (.5 - Ct(Number(e)) / (2 * Math.PI)) * r
1466
1520
  };
1467
1521
  }, $ = (e, t) => {
1468
1522
  if (e === "" || e == null) return null;
1469
1523
  let n = Number(e);
1470
1524
  return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
1471
- }, _t = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
1472
- function vt(e, t, n = "directions", r = "") {
1525
+ }, Tt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
1526
+ function Et(e, t, n = "directions", r = "") {
1473
1527
  let i = `${e},${t}`;
1474
1528
  return n === "place" ? `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r ? "&query_place_id=" : ""}` : `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`;
1475
1529
  }
1476
- var yt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
1477
- function bt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize: o = 22, pinLink: l = "directions", link: f = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
1530
+ var Dt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
1531
+ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize: o = 22, pinLink: l = "directions", link: f = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
1478
1532
  let _ = s(null), [v, y] = c(1200);
1479
1533
  i(() => {
1480
1534
  let e = _.current;
@@ -1484,7 +1538,7 @@ function bt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1484
1538
  let n = new ResizeObserver(t);
1485
1539
  return n.observe(e), () => n.disconnect();
1486
1540
  }, []);
1487
- let b = (Array.isArray(e) ? e : []).filter(_t), x = _t({
1541
+ let b = (Array.isArray(e) ? e : []).filter(Tt), x = Tt({
1488
1542
  lat: t,
1489
1543
  lng: n
1490
1544
  }) ? {
@@ -1496,7 +1550,7 @@ function bt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1496
1550
  } : null, S = Math.max(80, Number(a) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
1497
1551
  if (b.length < 2) return 13;
1498
1552
  for (let e = 19; e >= 1; e--) {
1499
- let t = b.map((t) => gt($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
1553
+ let t = b.map((t) => wt($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
1500
1554
  if (n <= v * .8 && r <= S * .7) return e;
1501
1555
  }
1502
1556
  return 1;
@@ -1520,12 +1574,12 @@ function bt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1520
1574
  },
1521
1575
  children: "Set the coordinates in Settings"
1522
1576
  });
1523
- let T = gt(x.lat, x.lng, C), E = {
1577
+ let T = wt(x.lat, x.lng, C), E = {
1524
1578
  x: T.x - v / 2,
1525
1579
  y: T.y - S / 2
1526
1580
  }, D = [], O = [];
1527
- for (let e = Math.floor(E.x / mt); e <= Math.floor((E.x + v) / mt); e++) D.push(e);
1528
- for (let e = Math.floor(E.y / mt); e <= Math.floor((E.y + S) / mt); e++) O.push(e);
1581
+ for (let e = Math.floor(E.x / St); e <= Math.floor((E.x + v) / St); e++) D.push(e);
1582
+ for (let e = Math.floor(E.y / St); e <= Math.floor((E.y + S) / St); e++) O.push(e);
1529
1583
  let k = 2 ** C;
1530
1584
  return /* @__PURE__ */ d("div", {
1531
1585
  ref: (e) => {
@@ -1548,22 +1602,22 @@ function bt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1548
1602
  return e < 0 || e >= k ? null : /* @__PURE__ */ u("img", {
1549
1603
  src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
1550
1604
  alt: "",
1551
- width: mt,
1552
- height: mt,
1605
+ width: St,
1606
+ height: St,
1553
1607
  loading: "lazy",
1554
1608
  style: {
1555
1609
  position: "absolute",
1556
- left: Math.round(t * mt - E.x),
1557
- top: Math.round(e * mt - E.y),
1558
- width: mt,
1559
- height: mt,
1610
+ left: Math.round(t * St - E.x),
1611
+ top: Math.round(e * St - E.y),
1612
+ width: St,
1613
+ height: St,
1560
1614
  userSelect: "none",
1561
1615
  pointerEvents: "none"
1562
1616
  }
1563
1617
  }, `${t}-${e}`);
1564
1618
  })),
1565
1619
  b.map((e, t) => {
1566
- let n = gt($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", s = l === "none" || g ? null : vt($(e.lat, 90), $(e.lng, 180), l, e.title);
1620
+ let n = wt($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", s = l === "none" || g ? null : Et($(e.lat, 90), $(e.lng, 180), l, e.title);
1567
1621
  return /* @__PURE__ */ d(s ? "a" : "span", {
1568
1622
  href: s || void 0,
1569
1623
  target: s ? "_blank" : void 0,
@@ -1602,8 +1656,8 @@ function bt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1602
1656
  viewBox: "0 0 24 24",
1603
1657
  fill: a,
1604
1658
  style: { display: "block" },
1605
- children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), xt[e.icon] ? /* @__PURE__ */ u("path", {
1606
- d: xt[e.icon],
1659
+ children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), kt[e.icon] ? /* @__PURE__ */ u("path", {
1660
+ d: kt[e.icon],
1607
1661
  transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
1608
1662
  fill: "none",
1609
1663
  stroke: "#fff",
@@ -1639,7 +1693,7 @@ function bt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1639
1693
  })
1640
1694
  ]
1641
1695
  }), f ? /* @__PURE__ */ u("a", {
1642
- href: yt(x.lat, x.lng, C),
1696
+ href: Dt(x.lat, x.lng, C),
1643
1697
  target: "_blank",
1644
1698
  rel: "noopener noreferrer",
1645
1699
  onClick: g ? (e) => e.preventDefault() : void 0,
@@ -1653,7 +1707,7 @@ function bt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1653
1707
  }) : null]
1654
1708
  });
1655
1709
  }
1656
- var xt = {
1710
+ var kt = {
1657
1711
  check: "M4 12l5 5L20 6",
1658
1712
  close: "M6 6l12 12M18 6L6 18",
1659
1713
  plus: "M12 5v14M5 12h14",
@@ -1750,8 +1804,8 @@ var xt = {
1750
1804
  droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
1751
1805
  leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
1752
1806
  };
1753
- function St({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: d, inert: f }) {
1754
- let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [xt[e] ?? xt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
1807
+ function At({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: d, inert: f }) {
1808
+ let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [kt[e] ?? kt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
1755
1809
  viewBox: "0 0 24 24",
1756
1810
  width: g,
1757
1811
  height: g,
@@ -1787,10 +1841,10 @@ function St({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
1787
1841
  children: v
1788
1842
  });
1789
1843
  }
1790
- function Ct(e, t = {}, n = 0) {
1791
- let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Te(e), a = Math.max(0, Number(n) || 0), o = [];
1844
+ function jt(e, t = {}, n = 0) {
1845
+ let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Oe(e), a = Math.max(0, Number(n) || 0), o = [];
1792
1846
  for (let e of r) {
1793
- let n = e.data ?? e, r = Ce(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(Ce(n, t.nameField)) : i(n.name), l = t.hrefField ? i(Ce(n, t.hrefField)) : "";
1847
+ let n = e.data ?? e, r = Ee(n, t.imageField), s = (Array.isArray(r) ? r : [r]).map((e) => e && typeof e == "object" ? e.url ?? e.src ?? "" : e).filter((e) => typeof e == "string" && e.trim()), c = t.nameField ? i(Ee(n, t.nameField)) : i(n.name), l = t.hrefField ? i(Ee(n, t.hrefField)) : "";
1794
1848
  for (let e of s) if (o.push({
1795
1849
  src: e,
1796
1850
  name: c,
@@ -1800,8 +1854,8 @@ function Ct(e, t = {}, n = 0) {
1800
1854
  }
1801
1855
  return o;
1802
1856
  }
1803
- function wt({ images: e = [], source: t = "", entry: n = "", imageField: a = "", nameField: o = "", hrefField: s = "", limit: f = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
1804
- let { tenant: x, apiUrl: S } = r(Y), C = r(be)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
1857
+ function Mt({ images: e = [], source: t = "", entry: n = "", imageField: a = "", nameField: o = "", hrefField: s = "", limit: f = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
1858
+ let { tenant: x, apiUrl: S } = r(Z), C = r(xe)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
1805
1859
  i(() => {
1806
1860
  if (!t || C) return;
1807
1861
  let e = !0;
@@ -1818,7 +1872,7 @@ function wt({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
1818
1872
  C
1819
1873
  ]);
1820
1874
  let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, j = Math.max(0, Number(f) || 0), M = t ? (() => {
1821
- let e = Ct(k, {
1875
+ let e = jt(k, {
1822
1876
  imageField: a,
1823
1877
  nameField: o,
1824
1878
  hrefField: s
@@ -2023,20 +2077,20 @@ function wt({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
2023
2077
  ]
2024
2078
  });
2025
2079
  }
2026
- var Tt = {
2080
+ var Nt = {
2027
2081
  color: "inherit",
2028
2082
  textDecoration: "none",
2029
2083
  fontSize: 14,
2030
2084
  opacity: .85
2031
- }, Et = {
2085
+ }, Pt = {
2032
2086
  background: "var(--page-surface, #f2f2f2)",
2033
2087
  color: "var(--page-text, #111827)",
2034
2088
  border: "1px solid rgba(148, 163, 184, 0.25)",
2035
2089
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
2036
2090
  zIndex: 60
2037
2091
  };
2038
- function Dt(e, t = {}, n = "dropdown") {
2039
- 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 ? "" : Te(e), o = r.map((e) => {
2092
+ function Ft(e, t = {}, n = "dropdown") {
2093
+ let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" : Oe(e), o = r.map((e) => {
2040
2094
  let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
2041
2095
  return {
2042
2096
  key: e.id,
@@ -2077,8 +2131,8 @@ function Dt(e, t = {}, n = "dropdown") {
2077
2131
  type: e.children.length ? n : "link"
2078
2132
  }));
2079
2133
  }
2080
- function Ot({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], style: f, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
2081
- let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(Y), P = r(be)?.[g], [F, I] = c(null);
2134
+ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], style: f, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
2135
+ let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(Z), P = r(xe)?.[g], [F, I] = c(null);
2082
2136
  i(() => {
2083
2137
  if (!g || P) return;
2084
2138
  let e = !0;
@@ -2098,7 +2152,7 @@ function Ot({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2098
2152
  let e = new ResizeObserver(() => E(C.offsetWidth < h));
2099
2153
  return e.observe(C), () => e.disconnect();
2100
2154
  }, [C, h]);
2101
- let L = g ? Dt(P ?? F ?? [], {
2155
+ let L = g ? Ft(P ?? F ?? [], {
2102
2156
  labelField: _,
2103
2157
  hrefField: v,
2104
2158
  imageField: y,
@@ -2127,7 +2181,7 @@ function Ot({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2127
2181
  return /* @__PURE__ */ d("a", {
2128
2182
  href: e.href || "#",
2129
2183
  style: {
2130
- ...Tt,
2184
+ ...Nt,
2131
2185
  display: n ? "block" : "flex",
2132
2186
  alignItems: n ? void 0 : "center",
2133
2187
  gap: n ? void 0 : 10,
@@ -2224,7 +2278,7 @@ function Ot({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2224
2278
  let t = e.children ?? [];
2225
2279
  if (!t.length) return /* @__PURE__ */ u("a", {
2226
2280
  href: e.href || "#",
2227
- style: Tt,
2281
+ style: Nt,
2228
2282
  children: e.label
2229
2283
  }, e.key);
2230
2284
  let n = e.type === "mega";
@@ -2238,7 +2292,7 @@ function Ot({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2238
2292
  children: [/* @__PURE__ */ d("a", {
2239
2293
  href: e.href || "#",
2240
2294
  style: {
2241
- ...Tt,
2295
+ ...Nt,
2242
2296
  cursor: "pointer"
2243
2297
  },
2244
2298
  children: [
@@ -2254,7 +2308,7 @@ function Ot({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2254
2308
  ]
2255
2309
  }), k === e.key && (n ? /* @__PURE__ */ u("div", {
2256
2310
  style: {
2257
- ...Et,
2311
+ ...Pt,
2258
2312
  position: "absolute",
2259
2313
  left: 0,
2260
2314
  right: 0,
@@ -2270,7 +2324,7 @@ function Ot({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2270
2324
  }, !0))
2271
2325
  }) : /* @__PURE__ */ u("div", {
2272
2326
  style: {
2273
- ...Et,
2327
+ ...Pt,
2274
2328
  position: "absolute",
2275
2329
  top: "100%",
2276
2330
  left: 0,
@@ -2299,7 +2353,7 @@ function Ot({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2299
2353
  children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
2300
2354
  href: t.href || "#",
2301
2355
  style: {
2302
- ...Tt,
2356
+ ...Nt,
2303
2357
  padding: "10px 4px",
2304
2358
  fontWeight: (t.children ?? []).length ? 600 : 400,
2305
2359
  opacity: 1
@@ -2310,7 +2364,7 @@ function Ot({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2310
2364
  ]
2311
2365
  });
2312
2366
  }
2313
- function kt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2367
+ function Lt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2314
2368
  let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
2315
2369
  return e.length ? /* @__PURE__ */ d("div", {
2316
2370
  ref: r,
@@ -2350,13 +2404,13 @@ function kt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2350
2404
  }, e.key))]
2351
2405
  }) : null;
2352
2406
  }
2353
- function At({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: l, openColor: f, borderColor: p, style: m, nodeRef: h }) {
2407
+ function Rt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: l, openColor: f, borderColor: p, style: m, nodeRef: h }) {
2354
2408
  let [g, _] = c(() => new Set(e.length ? [e[0].key] : []));
2355
2409
  if (!e.length) return null;
2356
2410
  let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
2357
2411
  let n = Number(e);
2358
2412
  return e === "" || e == null || !Number.isFinite(n) ? t : n;
2359
- }, b = xt[r], x = (e) => _((t) => {
2413
+ }, b = kt[r], x = (e) => _((t) => {
2360
2414
  let r = new Set(n ? t : []);
2361
2415
  return t.has(e) ? r.delete(e) : r.add(e), r;
2362
2416
  });
@@ -2431,15 +2485,15 @@ function At({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
2431
2485
  })
2432
2486
  });
2433
2487
  }
2434
- var jt = {
2488
+ var zt = {
2435
2489
  display: "flex",
2436
2490
  flexDirection: "column",
2437
2491
  gap: "12px"
2438
- }, Mt = {
2492
+ }, Bt = {
2439
2493
  fontSize: "14px",
2440
2494
  fontWeight: 500,
2441
2495
  color: "var(--page-text, #111827)"
2442
- }, Nt = {
2496
+ }, Vt = {
2443
2497
  padding: "10px 12px",
2444
2498
  border: "1px solid var(--page-border, #d1d5db)",
2445
2499
  borderRadius: "6px",
@@ -2449,18 +2503,18 @@ var jt = {
2449
2503
  boxSizing: "border-box",
2450
2504
  backgroundColor: "var(--page-surface, #f2f2f2)",
2451
2505
  color: "var(--page-text, #111827)"
2452
- }, Pt = {
2506
+ }, Ht = {
2453
2507
  display: "flex",
2454
2508
  alignItems: "center",
2455
2509
  gap: "8px",
2456
2510
  fontSize: "14px",
2457
2511
  color: "var(--page-text, #111827)"
2458
- }, Ft = (e) => e ? {
2512
+ }, Ut = (e) => e ? {
2459
2513
  readOnly: !0,
2460
2514
  tabIndex: -1,
2461
2515
  onMouseDown: (e) => e.preventDefault()
2462
2516
  } : {};
2463
- function It(e, t) {
2517
+ function Wt(e, t) {
2464
2518
  if (!e) return !0;
2465
2519
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
2466
2520
  switch (e.op) {
@@ -2474,11 +2528,11 @@ function It(e, t) {
2474
2528
  default: return !1;
2475
2529
  }
2476
2530
  }
2477
- var Lt = {
2531
+ var Gt = {
2478
2532
  display: "flex",
2479
2533
  flexDirection: "column",
2480
2534
  gap: 6
2481
- }, Rt = {
2535
+ }, Kt = {
2482
2536
  font: "inherit",
2483
2537
  fontSize: 15,
2484
2538
  padding: "10px 12px",
@@ -2489,17 +2543,17 @@ var Lt = {
2489
2543
  width: "100%",
2490
2544
  boxSizing: "border-box"
2491
2545
  };
2492
- function zt(e, t) {
2546
+ function qt(e, t) {
2493
2547
  let n = Array.isArray(e?.options) ? e.options : [];
2494
2548
  if (!e?.parentField) return n;
2495
2549
  let r = t?.[e.parentField];
2496
2550
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
2497
2551
  }
2498
- var Bt = "g-recaptcha-response", Vt = (e) => e?.type === "recaptcha" ? Bt : e?.name;
2499
- function Ht({ field: e, value: t, onChange: n, inert: r, values: i }) {
2552
+ var Jt = "g-recaptcha-response", Yt = (e) => e?.type === "recaptcha" ? Jt : e?.name;
2553
+ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2500
2554
  let a = /* @__PURE__ */ d("span", {
2501
2555
  style: {
2502
- ...Mt,
2556
+ ...Bt,
2503
2557
  fontSize: 14
2504
2558
  },
2505
2559
  children: [e.label, e.required ? " *" : ""]
@@ -2508,7 +2562,7 @@ function Ht({ field: e, value: t, onChange: n, inert: r, values: i }) {
2508
2562
  required: e.required || void 0,
2509
2563
  placeholder: e.placeholder || void 0,
2510
2564
  disabled: r || void 0,
2511
- style: Rt,
2565
+ style: Kt,
2512
2566
  value: t ?? "",
2513
2567
  onChange: (t) => n(e.name, t.target.value)
2514
2568
  };
@@ -2537,12 +2591,12 @@ function Ht({ field: e, value: t, onChange: n, inert: r, values: i }) {
2537
2591
  borderRadius: 8,
2538
2592
  display: "block"
2539
2593
  }
2540
- }) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(qt, {
2594
+ }) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(tn, {
2541
2595
  theme: e.captchaTheme,
2542
2596
  size: e.captchaSize,
2543
2597
  inert: r,
2544
- onChange: (e) => n(Bt, e)
2545
- }) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(nt, {
2598
+ onChange: (e) => n(Jt, e)
2599
+ }) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(lt, {
2546
2600
  url: e.src,
2547
2601
  style: { width: "100%" }
2548
2602
  }) : /* @__PURE__ */ u("video", {
@@ -2554,14 +2608,14 @@ function Ht({ field: e, value: t, onChange: n, inert: r, values: i }) {
2554
2608
  display: "block"
2555
2609
  }
2556
2610
  }) : null : /* @__PURE__ */ d("label", {
2557
- style: Lt,
2611
+ style: Gt,
2558
2612
  children: [
2559
2613
  a,
2560
2614
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
2561
2615
  ...o,
2562
2616
  rows: 4,
2563
2617
  style: {
2564
- ...Rt,
2618
+ ...Kt,
2565
2619
  resize: "vertical"
2566
2620
  }
2567
2621
  }) : e.type === "select" ? /* @__PURE__ */ d("select", {
@@ -2570,7 +2624,7 @@ function Ht({ field: e, value: t, onChange: n, inert: r, values: i }) {
2570
2624
  children: [/* @__PURE__ */ u("option", {
2571
2625
  value: "",
2572
2626
  children: e.placeholder || "—"
2573
- }), zt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
2627
+ }), qt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
2574
2628
  value: typeof e == "string" ? e : e.value,
2575
2629
  children: typeof e == "string" ? e : e.label ?? e.value
2576
2630
  }, t))]
@@ -2617,8 +2671,8 @@ function Ht({ field: e, value: t, onChange: n, inert: r, values: i }) {
2617
2671
  ]
2618
2672
  });
2619
2673
  }
2620
- function Ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
2621
- let { tenant: y, apiUrl: b } = r(Y), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
2674
+ function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
2675
+ let { tenant: y, apiUrl: b } = r(Z), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
2622
2676
  i(() => {
2623
2677
  if (!f || !s) return;
2624
2678
  let e = !0;
@@ -2639,11 +2693,11 @@ function Ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2639
2693
  section: e,
2640
2694
  fields: []
2641
2695
  }) : j[j.length - 1].fields.push(e);
2642
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || It(e.section.condition, T)).map((e) => ({
2696
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Wt(e.section.condition, T)).map((e) => ({
2643
2697
  ...e,
2644
- fields: e.fields.filter((e) => It(e.condition, T))
2698
+ fields: e.fields.filter((e) => Wt(e.condition, T))
2645
2699
  })), P = M.length > 1, F = Math.min(D, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
2646
- let t = T[Vt(e)];
2700
+ let t = T[Yt(e)];
2647
2701
  return e.required && (t == null || t === "" || t === !1);
2648
2702
  }), R = F >= N.length - 1, z = (e, t) => E((n) => {
2649
2703
  let r = {
@@ -2699,11 +2753,11 @@ function Ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2699
2753
  }
2700
2754
  },
2701
2755
  style: {
2702
- ...jt,
2756
+ ...zt,
2703
2757
  display: k === "success" ? "none" : "flex"
2704
2758
  },
2705
2759
  children: f && s ? /* @__PURE__ */ d(l, { children: [
2706
- P && /* @__PURE__ */ u(vn, {
2760
+ P && /* @__PURE__ */ u(En, {
2707
2761
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
2708
2762
  active: F + 1,
2709
2763
  style: { marginBottom: 8 }
@@ -2716,9 +2770,9 @@ function Ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2716
2770
  },
2717
2771
  children: N[F].section.help
2718
2772
  }),
2719
- I.map((e) => /* @__PURE__ */ u(Ht, {
2773
+ I.map((e) => /* @__PURE__ */ u(Xt, {
2720
2774
  field: e,
2721
- value: T[Vt(e)],
2775
+ value: T[Yt(e)],
2722
2776
  values: T,
2723
2777
  onChange: z,
2724
2778
  inert: h
@@ -2735,7 +2789,7 @@ function Ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2735
2789
  disabled: h || void 0,
2736
2790
  onClick: () => O(F - 1),
2737
2791
  style: {
2738
- ...ke,
2792
+ ...Pe,
2739
2793
  background: "transparent",
2740
2794
  color: "inherit",
2741
2795
  border: 0,
@@ -2748,7 +2802,7 @@ function Ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2748
2802
  disabled: h || L.length > 0,
2749
2803
  onClick: () => O(F + 1),
2750
2804
  style: {
2751
- ...ke,
2805
+ ...Pe,
2752
2806
  border: 0,
2753
2807
  padding: "10px 22px",
2754
2808
  borderRadius: 8,
@@ -2762,7 +2816,7 @@ function Ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2762
2816
  type: "submit",
2763
2817
  disabled: h || void 0,
2764
2818
  style: {
2765
- ...ke,
2819
+ ...Pe,
2766
2820
  border: 0,
2767
2821
  padding: "10px 22px",
2768
2822
  borderRadius: 8,
@@ -2789,10 +2843,10 @@ function Ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2789
2843
  ]
2790
2844
  });
2791
2845
  }
2792
- var Wt = null, Gt = null, Kt = (e) => {
2846
+ var Qt = null, $t = null, en = (e) => {
2793
2847
  let t = typeof e == "string" && e.trim() ? e.trim() : "";
2794
- if (Wt && Gt === t) return Wt;
2795
- if (Wt && typeof window < "u") {
2848
+ if (Qt && $t === t) return Qt;
2849
+ if (Qt && typeof window < "u") {
2796
2850
  for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
2797
2851
  delete window[e];
2798
2852
  } catch {
@@ -2800,22 +2854,22 @@ var Wt = null, Gt = null, Kt = (e) => {
2800
2854
  }
2801
2855
  document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
2802
2856
  }
2803
- return Gt = t, Wt = new Promise((e) => {
2857
+ return $t = t, Qt = new Promise((e) => {
2804
2858
  if (typeof window > "u") return;
2805
2859
  if (window.grecaptcha?.render) return e(window.grecaptcha);
2806
2860
  window.__webimRecaptchaReady = () => e(window.grecaptcha);
2807
2861
  let n = document.createElement("script");
2808
2862
  n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
2809
- }), Wt;
2863
+ }), Qt;
2810
2864
  };
2811
- function qt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
2812
- let p = r(Y), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
2865
+ function tn({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
2866
+ let p = r(Z), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
2813
2867
  if (_.current = f, i(() => {
2814
2868
  if (l || !h || !g.current) return;
2815
2869
  let e = !0, r = (t) => {
2816
2870
  e && typeof _.current == "function" && _.current(t);
2817
2871
  };
2818
- return Kt(a).then((i) => {
2872
+ return en(a).then((i) => {
2819
2873
  if (!(!e || !g.current || !i?.render)) {
2820
2874
  g.current.innerHTML = "", r("");
2821
2875
  try {
@@ -2897,17 +2951,17 @@ function qt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
2897
2951
  children: /* @__PURE__ */ u("div", { ref: g })
2898
2952
  }) : null;
2899
2953
  }
2900
- function Jt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2954
+ function nn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2901
2955
  return /* @__PURE__ */ u("label", {
2902
2956
  ref: r,
2903
2957
  style: {
2904
- ...Mt,
2958
+ ...Bt,
2905
2959
  ...A(n)
2906
2960
  },
2907
- children: Be(t, e, i)
2961
+ children: Ge(t, e, i)
2908
2962
  });
2909
2963
  }
2910
- function Yt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2964
+ function rn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2911
2965
  return /* @__PURE__ */ u("input", {
2912
2966
  ref: a,
2913
2967
  type: e,
@@ -2915,13 +2969,13 @@ function Yt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
2915
2969
  placeholder: n,
2916
2970
  required: !o && !!r,
2917
2971
  style: {
2918
- ...Nt,
2972
+ ...Vt,
2919
2973
  ...A(i)
2920
2974
  },
2921
- ...Ft(o)
2975
+ ...Ut(o)
2922
2976
  });
2923
2977
  }
2924
- function Xt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2978
+ function an({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2925
2979
  return /* @__PURE__ */ u("textarea", {
2926
2980
  ref: a,
2927
2981
  name: e || void 0,
@@ -2929,18 +2983,18 @@ function Xt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
2929
2983
  rows: n,
2930
2984
  required: !o && !!r,
2931
2985
  style: {
2932
- ...Nt,
2986
+ ...Vt,
2933
2987
  resize: "vertical",
2934
2988
  ...A(i)
2935
2989
  },
2936
- ...Ft(o)
2990
+ ...Ut(o)
2937
2991
  });
2938
2992
  }
2939
- function Zt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2993
+ function on({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2940
2994
  return /* @__PURE__ */ d("label", {
2941
2995
  ref: o,
2942
2996
  style: {
2943
- ...Pt,
2997
+ ...Ht,
2944
2998
  ...A(a)
2945
2999
  },
2946
3000
  children: [/* @__PURE__ */ u("input", {
@@ -2957,7 +3011,7 @@ function Zt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
2957
3011
  }), t]
2958
3012
  });
2959
3013
  }
2960
- function Qt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
3014
+ function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2961
3015
  return /* @__PURE__ */ d("select", {
2962
3016
  ref: a,
2963
3017
  name: e || void 0,
@@ -2966,7 +3020,7 @@ function Qt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2966
3020
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
2967
3021
  tabIndex: o ? -1 : void 0,
2968
3022
  style: {
2969
- ...Nt,
3023
+ ...Vt,
2970
3024
  appearance: "auto",
2971
3025
  ...A(i)
2972
3026
  },
@@ -2980,12 +3034,12 @@ function Qt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2980
3034
  }, t))]
2981
3035
  });
2982
3036
  }
2983
- function $t({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
3037
+ function cn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2984
3038
  let [s, l] = c(null);
2985
3039
  return /* @__PURE__ */ d("label", {
2986
3040
  ref: a,
2987
3041
  style: {
2988
- ...Nt,
3042
+ ...Vt,
2989
3043
  display: "flex",
2990
3044
  alignItems: "center",
2991
3045
  gap: "8px",
@@ -3012,12 +3066,12 @@ function $t({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
3012
3066
  ]
3013
3067
  });
3014
3068
  }
3015
- function en({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3069
+ function ln({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3016
3070
  return /* @__PURE__ */ u("button", {
3017
3071
  ref: n,
3018
3072
  type: r ? "button" : "submit",
3019
3073
  style: {
3020
- ...ke,
3074
+ ...Pe,
3021
3075
  border: 0,
3022
3076
  cursor: "pointer",
3023
3077
  alignSelf: "flex-start",
@@ -3032,7 +3086,7 @@ function en({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3032
3086
  children: e
3033
3087
  });
3034
3088
  }
3035
- function tn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3089
+ function un({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3036
3090
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
3037
3091
  return /* @__PURE__ */ u("div", {
3038
3092
  ref: r,
@@ -3049,8 +3103,8 @@ function tn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3049
3103
  }, t))
3050
3104
  });
3051
3105
  }
3052
- function nn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
3053
- let { tenant: v, apiUrl: y, locale: b } = r(Y), x = r(Z), S = r(be), [, C] = c(0);
3106
+ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
3107
+ let { tenant: v, apiUrl: y, locale: b } = r(Z), x = r(we), S = r(xe), [, C] = c(0);
3054
3108
  i(() => {
3055
3109
  if (typeof window > "u") return;
3056
3110
  let e = () => C((e) => e + 1);
@@ -3058,7 +3112,7 @@ function nn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
3058
3112
  window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
3059
3113
  };
3060
3114
  }, []);
3061
- let w = X(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? xe(S) : 1, [k, j] = c(null);
3115
+ let w = Ce(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? Se(S) : 1, [k, j] = c(null);
3062
3116
  if (i(() => {
3063
3117
  if (!e || D) return;
3064
3118
  let n = !0, r = new URLSearchParams();
@@ -3103,7 +3157,7 @@ function nn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
3103
3157
  },
3104
3158
  children: N.map((e) => /* @__PURE__ */ u("div", {
3105
3159
  style: { minWidth: 0 },
3106
- children: x.render(p, (t) => Ee(t, e))
3160
+ children: x.render(p, (t) => ke(t, e))
3107
3161
  }, e.id ?? e?.data?.slug))
3108
3162
  }) : /* @__PURE__ */ u("div", {
3109
3163
  ref: _,
@@ -3113,7 +3167,7 @@ function nn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
3113
3167
  ...A(g)
3114
3168
  },
3115
3169
  children: N.map((e) => {
3116
- let t = o ? Ce(e?.data, o) : null, r = s ? Te(Ce(e?.data, s)) : null, i = l ? Ce(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : Te(i), f = n === "list";
3170
+ let t = o ? Ee(e?.data, o) : null, r = s ? Oe(Ee(e?.data, s)) : null, i = l ? Ee(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : Oe(i), f = n === "list";
3117
3171
  return /* @__PURE__ */ d("div", {
3118
3172
  style: {
3119
3173
  display: "flex",
@@ -3160,7 +3214,7 @@ function nn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
3160
3214
  lineHeight: 1.55,
3161
3215
  opacity: .85
3162
3216
  },
3163
- children: We(a)
3217
+ children: Ze(a)
3164
3218
  })
3165
3219
  ]
3166
3220
  })]
@@ -3168,8 +3222,8 @@ function nn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
3168
3222
  })
3169
3223
  });
3170
3224
  }
3171
- function rn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
3172
- let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Se(), s = {
3225
+ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
3226
+ let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Q(), s = {
3173
3227
  height: 34,
3174
3228
  padding: "0 12px",
3175
3229
  borderRadius: 8,
@@ -3217,7 +3271,7 @@ function rn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3217
3271
  name: `f_${e.name}`,
3218
3272
  defaultValue: o[e.name] ?? "",
3219
3273
  style: s,
3220
- ...Ft(i),
3274
+ ...Ut(i),
3221
3275
  children: [/* @__PURE__ */ u("option", {
3222
3276
  value: "",
3223
3277
  children: e.label || e.name
@@ -3232,7 +3286,7 @@ function rn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3232
3286
  name: `f_${e.name}`,
3233
3287
  defaultValue: o[e.name] ?? "",
3234
3288
  style: s,
3235
- ...Ft(i),
3289
+ ...Ut(i),
3236
3290
  children: [
3237
3291
  /* @__PURE__ */ u("option", {
3238
3292
  value: "",
@@ -3253,7 +3307,7 @@ function rn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3253
3307
  defaultValue: o[e.name] ?? "",
3254
3308
  placeholder: e.label || e.name,
3255
3309
  style: s,
3256
- ...Ft(i)
3310
+ ...Ut(i)
3257
3311
  }, e.name)), /* @__PURE__ */ u("button", {
3258
3312
  type: "submit",
3259
3313
  style: {
@@ -3266,12 +3320,12 @@ function rn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3266
3320
  fontWeight: 600,
3267
3321
  cursor: i ? "default" : "pointer"
3268
3322
  },
3269
- ...Ft(i),
3323
+ ...Ut(i),
3270
3324
  children: t
3271
3325
  })]
3272
3326
  });
3273
3327
  }
3274
- function an({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3328
+ function pn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3275
3329
  return e.length ? /* @__PURE__ */ u("nav", {
3276
3330
  ref: r,
3277
3331
  "aria-label": "Breadcrumb",
@@ -3321,8 +3375,8 @@ function an({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3321
3375
  })
3322
3376
  }) : null;
3323
3377
  }
3324
- function on({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: h }) {
3325
- let { tenant: g, apiUrl: _ } = r(Y), v = r(be), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
3378
+ function mn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: h }) {
3379
+ let { tenant: g, apiUrl: _ } = r(Z), v = r(xe), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
3326
3380
  i(() => {
3327
3381
  if (!o || Number.isFinite(x)) return;
3328
3382
  let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
@@ -3341,7 +3395,7 @@ function on({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
3341
3395
  ]);
3342
3396
  let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
3343
3397
  if (o && C === null || o && f && !(C > 0)) return null;
3344
- let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? xe(v) : Number(t) || 1, 1), w), E = (e) => {
3398
+ let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? Se(v) : Number(t) || 1, 1), w), E = (e) => {
3345
3399
  if (o) {
3346
3400
  if (typeof window < "u") {
3347
3401
  let t = new URLSearchParams(window.location.search);
@@ -3406,15 +3460,15 @@ function on({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
3406
3460
  ]
3407
3461
  });
3408
3462
  }
3409
- var sn = "webim.page_mode", cn = () => {
3463
+ var hn = "webim.page_mode", gn = () => {
3410
3464
  if (typeof window > "u") return "auto";
3411
3465
  try {
3412
- let e = window.localStorage.getItem(sn);
3466
+ let e = window.localStorage.getItem(hn);
3413
3467
  return e === "light" || e === "dark" ? e : "auto";
3414
3468
  } catch {
3415
3469
  return "auto";
3416
3470
  }
3417
- }, ln = (e) => {
3471
+ }, _n = (e) => {
3418
3472
  let t = {
3419
3473
  width: 16,
3420
3474
  height: 16,
@@ -3446,13 +3500,13 @@ var sn = "webim.page_mode", cn = () => {
3446
3500
  rx: "2"
3447
3501
  }), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
3448
3502
  });
3449
- }, un = {
3503
+ }, vn = {
3450
3504
  light: "Light theme",
3451
3505
  dark: "Dark theme",
3452
3506
  auto: "Follow the device theme"
3453
3507
  };
3454
- function dn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3455
- let [o, l] = c(a ? "auto" : cn), d = s(null), f = (e) => {
3508
+ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3509
+ let [o, l] = c(a ? "auto" : gn), d = s(null), f = (e) => {
3456
3510
  d.current = e, typeof r == "function" && r(e);
3457
3511
  };
3458
3512
  i(() => {
@@ -3460,7 +3514,7 @@ function dn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3460
3514
  let e = d.current?.closest?.(".webim-page");
3461
3515
  e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
3462
3516
  try {
3463
- o === "auto" ? window.localStorage.removeItem(sn) : window.localStorage.setItem(sn, o);
3517
+ o === "auto" ? window.localStorage.removeItem(hn) : window.localStorage.setItem(hn, o);
3464
3518
  } catch {}
3465
3519
  }, [o, a]);
3466
3520
  let p = t === !1 ? ["light", "dark"] : [
@@ -3495,8 +3549,8 @@ function dn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3495
3549
  },
3496
3550
  children: p.map((e) => /* @__PURE__ */ u("button", {
3497
3551
  type: "button",
3498
- title: un[e],
3499
- "aria-label": un[e],
3552
+ title: vn[e],
3553
+ "aria-label": vn[e],
3500
3554
  "aria-pressed": e === m,
3501
3555
  onClick: a ? void 0 : () => l(e),
3502
3556
  style: {
@@ -3507,15 +3561,15 @@ function dn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3507
3561
  background: e === m ? "var(--page-accent, #111827)" : "transparent",
3508
3562
  opacity: e === m ? 1 : .7
3509
3563
  },
3510
- children: ln(e)
3564
+ children: _n(e)
3511
3565
  }, e))
3512
3566
  });
3513
3567
  let g = p[(p.indexOf(m) + 1) % p.length];
3514
3568
  return /* @__PURE__ */ u("button", {
3515
3569
  ref: f,
3516
3570
  type: "button",
3517
- title: un[m],
3518
- "aria-label": `Theme: ${un[m]} — switch to ${un[g]}`,
3571
+ title: vn[m],
3572
+ "aria-label": `Theme: ${vn[m]} — switch to ${vn[g]}`,
3519
3573
  onClick: a ? void 0 : () => l(g),
3520
3574
  style: {
3521
3575
  ...h,
@@ -3524,10 +3578,10 @@ function dn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3524
3578
  border: "1px solid rgba(148, 163, 184, 0.4)",
3525
3579
  ...A(n)
3526
3580
  },
3527
- children: ln(m)
3581
+ children: _n(m)
3528
3582
  });
3529
3583
  }
3530
- function fn(e) {
3584
+ function bn(e) {
3531
3585
  let t = e?.parentElement;
3532
3586
  for (; t && t !== document.body;) {
3533
3587
  let e = getComputedStyle(t).overflowY;
@@ -3536,7 +3590,7 @@ function fn(e) {
3536
3590
  }
3537
3591
  return window;
3538
3592
  }
3539
- var pn = (e) => e === window ? window.scrollY : e.scrollTop, mn = {
3593
+ var xn = (e) => e === window ? window.scrollY : e.scrollTop, Sn = {
3540
3594
  "bottom-right": (e) => ({
3541
3595
  right: e,
3542
3596
  bottom: e
@@ -3551,7 +3605,7 @@ var pn = (e) => e === window ? window.scrollY : e.scrollTop, mn = {
3551
3605
  transform: "translateX(-50%)"
3552
3606
  })
3553
3607
  };
3554
- function hn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
3608
+ function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
3555
3609
  let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
3556
3610
  b(e), typeof p == "function" && p(e);
3557
3611
  };
@@ -3562,8 +3616,8 @@ function hn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3562
3616
  }
3563
3617
  if (!y) return;
3564
3618
  let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
3565
- let t = fn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
3566
- v(n || pn(t) > e);
3619
+ let t = bn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
3620
+ v(n || xn(t) > e);
3567
3621
  };
3568
3622
  return t(), document.addEventListener("scroll", t, {
3569
3623
  capture: !0,
@@ -3577,7 +3631,7 @@ function hn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3577
3631
  ]);
3578
3632
  let S = () => {
3579
3633
  if (m) return;
3580
- let e = fn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
3634
+ let e = bn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
3581
3635
  e === window ? window.scrollTo({
3582
3636
  top: 0,
3583
3637
  behavior: n
@@ -3585,7 +3639,7 @@ function hn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3585
3639
  top: 0,
3586
3640
  behavior: n
3587
3641
  });
3588
- }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = mn[n] ? n : "bottom-right", D = h ? {
3642
+ }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = Sn[n] ? n : "bottom-right", D = h ? {
3589
3643
  position: "fixed",
3590
3644
  zIndex: 5,
3591
3645
  bottom: (h.bottom ?? 0) + C,
@@ -3598,7 +3652,7 @@ function hn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3598
3652
  } : {
3599
3653
  position: "fixed",
3600
3654
  zIndex: 2147482e3,
3601
- ...mn[E](C)
3655
+ ...Sn[E](C)
3602
3656
  };
3603
3657
  return /* @__PURE__ */ d("button", {
3604
3658
  ref: x,
@@ -3649,7 +3703,7 @@ function hn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3649
3703
  }), w ? /* @__PURE__ */ u("span", { children: T }) : null]
3650
3704
  });
3651
3705
  }
3652
- var gn = {
3706
+ var wn = {
3653
3707
  facebook: {
3654
3708
  label: "Facebook",
3655
3709
  color: "#1877f2",
@@ -3716,8 +3770,8 @@ var gn = {
3716
3770
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
3717
3771
  }
3718
3772
  };
3719
- function _n({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3720
- let l = Array.isArray(e) ? e.filter((e) => e && gn[e.network]) : [];
3773
+ function Tn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3774
+ let l = Array.isArray(e) ? e.filter((e) => e && wn[e.network]) : [];
3721
3775
  if (!l.length) return null;
3722
3776
  let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
3723
3777
  return /* @__PURE__ */ u("div", {
@@ -3730,7 +3784,7 @@ function _n({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
3730
3784
  ...A(o)
3731
3785
  },
3732
3786
  children: l.map((e, r) => {
3733
- let i = gn[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);
3787
+ let i = wn[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
3734
3788
  return /* @__PURE__ */ u("a", {
3735
3789
  href: e.url || "#",
3736
3790
  onClick: h,
@@ -3764,7 +3818,7 @@ function _n({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
3764
3818
  })
3765
3819
  });
3766
3820
  }
3767
- function vn({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3821
+ function En({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3768
3822
  if (!t.length) return null;
3769
3823
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
3770
3824
  width: 32,
@@ -3842,7 +3896,7 @@ function vn({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
3842
3896
  })
3843
3897
  });
3844
3898
  }
3845
- var yn = {
3899
+ var Dn = {
3846
3900
  small: {
3847
3901
  w: 132,
3848
3902
  h: 46,
@@ -3864,21 +3918,21 @@ var yn = {
3864
3918
  title: 12.5,
3865
3919
  avatar: 46
3866
3920
  }
3867
- }, bn = (e) => yn[e] ?? yn.medium;
3868
- yn.medium.w, yn.medium.h;
3869
- var xn = (e) => String(e?.group ?? "").trim(), Sn = (e) => {
3921
+ }, On = (e) => Dn[e] ?? Dn.medium;
3922
+ Dn.medium.w, Dn.medium.h;
3923
+ var kn = (e) => String(e?.group ?? "").trim(), An = (e) => {
3870
3924
  let t = [], n = /* @__PURE__ */ new Map();
3871
3925
  return e.forEach((e, r) => {
3872
- let i = xn(e) || `#${r}`;
3926
+ let i = kn(e) || `#${r}`;
3873
3927
  n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
3874
3928
  }), t.flatMap((e) => n.get(e));
3875
3929
  };
3876
- function Cn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
3877
- let i = bn(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
3930
+ function jn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
3931
+ let i = On(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
3878
3932
  for (let e of c) e.parent && l.has(e.parent) && e.parent !== e.id ? (u.has(e.parent) || u.set(e.parent, []), u.get(e.parent).push(e)) : d.push(e);
3879
- d = Sn(d);
3880
- for (let [e, t] of u) u.set(e, Sn(t));
3881
- let f = (e, t) => o + (xn(e) !== xn(t) && (xn(e) || xn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
3933
+ d = An(d);
3934
+ for (let [e, t] of u) u.set(e, An(t));
3935
+ let f = (e, t) => o + (kn(e) !== kn(t) && (kn(e) || kn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
3882
3936
  if (t.has(e.id)) return 0;
3883
3937
  t.add(e.id);
3884
3938
  let n = u.get(e.id) ?? [], r = n.reduce((e, r, i) => e + m(r, t) + (i ? f(n[i - 1], r) : 0), 0), i = Math.max(a, r);
@@ -3894,7 +3948,7 @@ function Cn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
3894
3948
  x: m,
3895
3949
  y: b
3896
3950
  });
3897
- let x = xn(e);
3951
+ let x = kn(e);
3898
3952
  if (x) {
3899
3953
  let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
3900
3954
  _.has(t) || _.set(t, {
@@ -3968,19 +4022,19 @@ function Cn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
3968
4022
  horizontal: n
3969
4023
  };
3970
4024
  }
3971
- var wn = (e, t) => {
4025
+ var Mn = (e, t) => {
3972
4026
  let n = String(e ?? "");
3973
4027
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
3974
- }, Tn = (e) => {
4028
+ }, Nn = (e) => {
3975
4029
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
3976
4030
  if (!t) return "#ffffff";
3977
4031
  let n = t[1];
3978
4032
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
3979
4033
  let r = parseInt(n, 16);
3980
4034
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
3981
- }, En = (e) => !!(e?.cv?.trim?.() || e?.photo);
3982
- function Dn(e, t = {}) {
3983
- 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 ? "" : Te(e);
4035
+ }, Pn = (e) => !!(e?.cv?.trim?.() || e?.photo);
4036
+ function Fn(e, t = {}) {
4037
+ let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : Oe(e);
3984
4038
  return n.map((e) => {
3985
4039
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
3986
4040
  return {
@@ -3995,11 +4049,11 @@ function Dn(e, t = {}) {
3995
4049
  };
3996
4050
  });
3997
4051
  }
3998
- var On = {
4052
+ var In = {
3999
4053
  size: 36,
4000
4054
  pad: 10
4001
4055
  };
4002
- function kn({ node: e, onClose: t }) {
4056
+ function Ln({ node: e, onClose: t }) {
4003
4057
  return i(() => {
4004
4058
  let e = (e) => e.key === "Escape" && t();
4005
4059
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -4120,8 +4174,8 @@ function kn({ node: e, onClose: t }) {
4120
4174
  })
4121
4175
  });
4122
4176
  }
4123
- function An({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
4124
- let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(Y), O = r(be)?.[t], [k, j] = c(null);
4177
+ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
4178
+ let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(Z), O = r(xe)?.[t], [k, j] = c(null);
4125
4179
  i(() => {
4126
4180
  if (!t || O) return;
4127
4181
  let e = !0;
@@ -4137,7 +4191,7 @@ function An({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4137
4191
  D,
4138
4192
  O
4139
4193
  ]);
4140
- let M = t ? Dn(O ?? k ?? [], {
4194
+ let M = t ? Fn(O ?? k ?? [], {
4141
4195
  nameField: n,
4142
4196
  titleField: o,
4143
4197
  photoField: s,
@@ -4145,7 +4199,7 @@ function An({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4145
4199
  cvField: p,
4146
4200
  hrefField: m,
4147
4201
  groupField: h
4148
- }) : e, N = bn(v), { boxes: P, links: F, groups: I, width: L, height: R } = Cn(M, {
4202
+ }) : e, N = On(v), { boxes: P, links: F, groups: I, width: L, height: R } = jn(M, {
4149
4203
  size: v,
4150
4204
  horizontal: y,
4151
4205
  groupTitles: g
@@ -4203,8 +4257,8 @@ function An({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4203
4257
  fontSize: N.title + 1,
4204
4258
  fontWeight: "600",
4205
4259
  opacity: "0.55",
4206
- fill: r ? Tn(e.color || _) : "var(--page-text, #111827)",
4207
- children: wn(e.title, Math.floor(e.width / 7))
4260
+ fill: r ? Nn(e.color || _) : "var(--page-text, #111827)",
4261
+ children: Mn(e.title, Math.floor(e.width / 7))
4208
4262
  })] }, `group-${t}`);
4209
4263
  }),
4210
4264
  F.map((e, t) => /* @__PURE__ */ u("path", {
@@ -4214,7 +4268,7 @@ function An({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4214
4268
  strokeWidth: "1.5"
4215
4269
  }, t)),
4216
4270
  P.map(({ node: e, x: t, y: n }) => {
4217
- let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Tn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Tn(e.color2) : s, f = S && (En(e) || e.href), p = () => En(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + On.pad + N.avatar + 8 : t + N.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((N.w - N.avatar - 26) / 7) : Math.floor(N.w / 7.6), _ = N.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
4271
+ let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Nn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Nn(e.color2) : s, f = S && (Pn(e) || e.href), p = () => Pn(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + In.pad + N.avatar + 8 : t + N.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((N.w - N.avatar - 26) / 7) : Math.floor(N.w / 7.6), _ = N.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
4218
4272
  return /* @__PURE__ */ d("g", {
4219
4273
  onClick: f ? p : void 0,
4220
4274
  style: f ? { cursor: "pointer" } : void 0,
@@ -4278,13 +4332,13 @@ function An({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4278
4332
  e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
4279
4333
  id: `${C}-${e.id}`,
4280
4334
  children: /* @__PURE__ */ u("circle", {
4281
- cx: t + On.pad + N.avatar / 2,
4335
+ cx: t + In.pad + N.avatar / 2,
4282
4336
  cy: n + N.h / 2,
4283
4337
  r: N.avatar / 2
4284
4338
  })
4285
4339
  }), /* @__PURE__ */ u("image", {
4286
4340
  href: e.photo,
4287
- x: t + On.pad,
4341
+ x: t + In.pad,
4288
4342
  y: n + (N.h - N.avatar) / 2,
4289
4343
  width: N.avatar,
4290
4344
  height: N.avatar,
@@ -4298,7 +4352,7 @@ function An({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4298
4352
  fontSize: N.title,
4299
4353
  fontWeight: "600",
4300
4354
  fill: s,
4301
- children: wn(e.title, g + 4)
4355
+ children: Mn(e.title, g + 4)
4302
4356
  }), e.name && /* @__PURE__ */ u("text", {
4303
4357
  x: m,
4304
4358
  y: n + _ + _ / 2 + N.name * .35,
@@ -4306,7 +4360,7 @@ function An({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4306
4360
  fontSize: N.name,
4307
4361
  fontWeight: "600",
4308
4362
  fill: c,
4309
- children: wn(e.name, g)
4363
+ children: Mn(e.name, g)
4310
4364
  })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
4311
4365
  x: m,
4312
4366
  y: n + (v[1] ? N.h * .43 : N.h * .57),
@@ -4314,7 +4368,7 @@ function An({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4314
4368
  fontSize: N.name,
4315
4369
  fontWeight: "600",
4316
4370
  fill: s,
4317
- children: wn(v[0], g)
4371
+ children: Mn(v[0], g)
4318
4372
  }), v[1] && /* @__PURE__ */ u("text", {
4319
4373
  x: m,
4320
4374
  y: n + N.h * .73,
@@ -4322,19 +4376,19 @@ function An({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4322
4376
  fontSize: N.title,
4323
4377
  opacity: "0.7",
4324
4378
  fill: s,
4325
- children: wn(v[1], g + 4)
4379
+ children: Mn(v[1], g + 4)
4326
4380
  })] })
4327
4381
  ]
4328
4382
  }, e.id);
4329
4383
  })
4330
4384
  ]
4331
- }), w && /* @__PURE__ */ u(kn, {
4385
+ }), w && /* @__PURE__ */ u(Ln, {
4332
4386
  node: w,
4333
4387
  onClose: () => T(null)
4334
4388
  })]
4335
4389
  });
4336
4390
  }
4337
- function jn({ value: e, onCommit: t, style: n, hint: r }) {
4391
+ function zn({ value: e, onCommit: t, style: n, hint: r }) {
4338
4392
  let [a, o] = c(!1), l = s(null);
4339
4393
  return i(() => {
4340
4394
  if (!a || !l.current) return;
@@ -4364,7 +4418,7 @@ function jn({ value: e, onCommit: t, style: n, hint: r }) {
4364
4418
  children: e ?? ""
4365
4419
  });
4366
4420
  }
4367
- var Mn = 360, Nn = "\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", Pn = (e, t) => e && t ? `cell-${e}-${t}` : "", Fn = (e) => {
4421
+ var Bn = 360, Vn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", Hn = (e, t) => e && t ? `cell-${e}-${t}` : "", Un = (e) => {
4368
4422
  if (!e || typeof e != "object") return e ?? "";
4369
4423
  let t = String(e.text ?? "");
4370
4424
  return typeof e.href == "string" && e.href ? /* @__PURE__ */ u("a", {
@@ -4375,7 +4429,7 @@ var Mn = 360, Nn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
4375
4429
  children: t
4376
4430
  }) : t;
4377
4431
  };
4378
- function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], colKeys: o = [], heights: f = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: j, style: M, nodeRef: N, edit: P }) {
4432
+ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], colKeys: o = [], heights: f = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: j, style: M, nodeRef: N, edit: P }) {
4379
4433
  let F = s(null), I = s(null), [L, R] = c(null), [z, B] = c(null), V = (e, t) => () => R({
4380
4434
  r: e,
4381
4435
  c: t
@@ -4389,7 +4443,7 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4389
4443
  }
4390
4444
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
4391
4445
  top: r.bottom - n.top + 4,
4392
- left: Math.max(0, Math.min(r.left - n.left, n.width - Mn))
4446
+ left: Math.max(0, Math.min(r.left - n.left, n.width - Bn))
4393
4447
  };
4394
4448
  (z?.top !== i.top || z?.left !== i.left) && B(i);
4395
4449
  }), i(() => {
@@ -4399,36 +4453,36 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4399
4453
  };
4400
4454
  return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
4401
4455
  }, [P, L]);
4402
- let { tenant: H, apiUrl: U } = r(Y), ee = r(be), te = ee?.[h], ne = C ? xe(ee) : 1, [re, W] = c(null);
4456
+ let { tenant: H, apiUrl: U } = r(Z), ee = r(xe), W = ee?.[h], te = C ? Se(ee) : 1, [ne, re] = c(null);
4403
4457
  if (i(() => {
4404
- if (!h || te) return;
4405
- let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(ne - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
4458
+ if (!h || W) return;
4459
+ let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(te - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
4406
4460
  return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
4407
4461
  let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
4408
- return e && W(n);
4409
- }).catch(() => e && W([])), () => {
4462
+ return e && re(n);
4463
+ }).catch(() => e && re([])), () => {
4410
4464
  e = !1;
4411
4465
  };
4412
4466
  }, [
4413
4467
  h,
4414
4468
  H,
4415
4469
  U,
4416
- te,
4470
+ W,
4417
4471
  C,
4418
- ne,
4472
+ te,
4419
4473
  g
4420
4474
  ]), !e.length) return null;
4421
- let G = Math.max(1, Number(g) || 10), K = h ? C ? te || h.startsWith("api:") ? (te ?? re ?? []).slice((ne - 1) * G, ne * G) : (re ?? []).slice(0, G) : (te ?? re ?? []).slice(0, G) : null, ie = K ? K.map((t) => e.map((e) => Te(Ce(t?.data, e.field)))) : t, ae = !!h && !(h && !te && re === null) && ie.length === 0, oe = b ? {
4475
+ let G = Math.max(1, Number(g) || 10), K = h ? C ? W || h.startsWith("api:") ? (W ?? ne ?? []).slice((te - 1) * G, te * G) : (ne ?? []).slice(0, G) : (W ?? ne ?? []).slice(0, G) : null, q = K ? K.map((t) => e.map((e) => Oe(Ee(t?.data, e.field)))) : t, ie = !!h && !(h && !W && ne === null) && q.length === 0, J = b ? {
4422
4476
  y: 6,
4423
4477
  x: 10
4424
4478
  } : {
4425
4479
  y: 10,
4426
4480
  x: 14
4427
- }, q = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : oe.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : oe.x}px`, se = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, ce = y ? { border: se } : { borderBottom: se }, le = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), ue = [
4481
+ }, ae = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : J.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : J.x}px`, oe = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, se = y ? { border: oe } : { borderBottom: oe }, ce = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), le = [
4428
4482
  "left",
4429
4483
  "center",
4430
4484
  "right"
4431
- ], de = (t) => ue.includes(e[t]?.align) ? e[t].align : "", fe = (e) => de(e) || (ue.includes(O) ? O : "left"), J = Number.isFinite(Number(j)) && Number(j) > 0 ? Number(j) : 0, pe = A(M), me = !J && pe && pe.maxHeight !== void 0 ? pe.maxHeight : 0, he = J || me, ge = me ? {
4485
+ ], ue = (t) => le.includes(e[t]?.align) ? e[t].align : "", de = (e) => ue(e) || (le.includes(O) ? O : "left"), fe = Number.isFinite(Number(j)) && Number(j) > 0 ? Number(j) : 0, pe = A(M), me = !fe && pe && pe.maxHeight !== void 0 ? pe.maxHeight : 0, he = fe || me, ge = me ? {
4432
4486
  ...pe,
4433
4487
  maxHeight: void 0
4434
4488
  } : pe, _e = !!P && P.rows !== !1, ve = (t) => (r) => {
@@ -4436,7 +4490,7 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4436
4490
  r.preventDefault(), r.stopPropagation();
4437
4491
  let i = F.current, a = i ? i.clientWidth : 0;
4438
4492
  if (!a) return;
4439
- let o = le ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
4493
+ let o = ce ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
4440
4494
  let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
4441
4495
  i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, P.resize(i);
4442
4496
  }, u = () => {
@@ -4444,13 +4498,13 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4444
4498
  };
4445
4499
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
4446
4500
  }, ye = /* @__PURE__ */ new Set();
4447
- p && ie.forEach((t, n) => e.forEach((e, t) => {
4448
- let r = p[Pn(a[n], o[t])];
4501
+ p && q.forEach((t, n) => e.forEach((e, t) => {
4502
+ let r = p[Hn(a[n], o[t])];
4449
4503
  if (!r) return;
4450
4504
  let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
4451
4505
  for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && ye.add(`${n + e},${t + r}`);
4452
4506
  }));
4453
- let Se = (e) => (t) => {
4507
+ let be = (e) => (t) => {
4454
4508
  if (!P?.resizeRow) return;
4455
4509
  t.preventDefault(), t.stopPropagation();
4456
4510
  let n = t.currentTarget.closest("tr");
@@ -4459,7 +4513,7 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4459
4513
  window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
4460
4514
  };
4461
4515
  window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
4462
- }, X = (e, t, n, r) => r ? null : /* @__PURE__ */ u("span", {
4516
+ }, Y = (e, t, n, r) => r ? null : /* @__PURE__ */ u("span", {
4463
4517
  className: "wb-tedit-btn",
4464
4518
  role: "button",
4465
4519
  "data-hint": t,
@@ -4468,7 +4522,7 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4468
4522
  },
4469
4523
  onClick: n,
4470
4524
  children: e
4471
- }, t), Z = L && L.r < ie.length && L.c < e.length ? L : null, Q = (e, t) => P?.labels?.[e] ?? t, we = Z ? p?.[Pn(a[Z.r], o[Z.c])] : null, Ee = Math.max(1, Number(we?.c) || 1), De = Math.max(1, Number(we?.r) || 1);
4525
+ }, t), X = L && L.r < q.length && L.c < e.length ? L : null, Q = (e, t) => P?.labels?.[e] ?? t, Ce = X ? p?.[Hn(a[X.r], o[X.c])] : null, we = Math.max(1, Number(Ce?.c) || 1), Te = Math.max(1, Number(Ce?.r) || 1);
4472
4526
  return /* @__PURE__ */ d("div", {
4473
4527
  ref: (e) => {
4474
4528
  I.current = e, typeof N == "function" && N(e);
@@ -4479,8 +4533,8 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4479
4533
  ...ge
4480
4534
  },
4481
4535
  children: [
4482
- P && /* @__PURE__ */ u("style", { children: Nn }),
4483
- P && Z && z && /* @__PURE__ */ d("div", {
4536
+ P && /* @__PURE__ */ u("style", { children: Vn }),
4537
+ P && X && z && /* @__PURE__ */ d("div", {
4484
4538
  className: "wb-tedit-bar",
4485
4539
  style: {
4486
4540
  top: z.top,
@@ -4490,23 +4544,23 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4490
4544
  children: [
4491
4545
  /* @__PURE__ */ u("span", {
4492
4546
  className: "wb-tedit-at",
4493
- children: `R${Z.r + 1}·C${Z.c + 1}`
4547
+ children: `R${X.r + 1}·C${X.c + 1}`
4494
4548
  }),
4495
- X("+↑", Q("rowAbove", "Insert row above"), () => P.addRow(Z.r - 1)),
4496
- X("+↓", Q("rowBelow", "Insert row below"), () => P.addRow(Z.r)),
4497
- X("↑", Q("rowUp", "Move row up"), () => P.moveRow(Z.r, -1), Z.r === 0),
4498
- X("↓", Q("rowDown", "Move row down"), () => P.moveRow(Z.r, 1), Z.r >= ie.length - 1),
4499
- X("✕ row", Q("rowDelete", "Delete row"), () => P.dropRow(Z.r), ie.length <= 1),
4549
+ Y("+↑", Q("rowAbove", "Insert row above"), () => P.addRow(X.r - 1)),
4550
+ Y("+↓", Q("rowBelow", "Insert row below"), () => P.addRow(X.r)),
4551
+ Y("↑", Q("rowUp", "Move row up"), () => P.moveRow(X.r, -1), X.r === 0),
4552
+ Y("↓", Q("rowDown", "Move row down"), () => P.moveRow(X.r, 1), X.r >= q.length - 1),
4553
+ Y("✕ row", Q("rowDelete", "Delete row"), () => P.dropRow(X.r), q.length <= 1),
4500
4554
  /* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
4501
- X("+←", Q("colLeft", "Insert column left"), () => P.addColumn(Z.c - 1)),
4502
- X("+→", Q("colRight", "Insert column right"), () => P.addColumn(Z.c)),
4503
- X("←", Q("colMoveLeft", "Move column left"), () => P.moveColumn(Z.c, -1), Z.c === 0),
4504
- X("→", Q("colMoveRight", "Move column right"), () => P.moveColumn(Z.c, 1), Z.c >= e.length - 1),
4505
- X("✕ col", Q("colDelete", "Delete column"), () => P.dropColumn(Z.c), e.length <= 1),
4555
+ Y("+←", Q("colLeft", "Insert column left"), () => P.addColumn(X.c - 1)),
4556
+ Y("+→", Q("colRight", "Insert column right"), () => P.addColumn(X.c)),
4557
+ Y("←", Q("colMoveLeft", "Move column left"), () => P.moveColumn(X.c, -1), X.c === 0),
4558
+ Y("→", Q("colMoveRight", "Move column right"), () => P.moveColumn(X.c, 1), X.c >= e.length - 1),
4559
+ Y("✕ col", Q("colDelete", "Delete column"), () => P.dropColumn(X.c), e.length <= 1),
4506
4560
  /* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
4507
- X("↔", Q("mergeRight", "Merge with the cell on the right"), () => P.merge(Z.r, Z.c, "right"), Z.c + Ee >= e.length),
4508
- X("↕", Q("mergeDown", "Merge with the cell below"), () => P.merge(Z.r, Z.c, "down"), Z.r + De >= ie.length),
4509
- X("⤫", Q("split", "Split this cell"), () => P.split(Z.r, Z.c), Ee === 1 && De === 1)
4561
+ Y("↔", Q("mergeRight", "Merge with the cell on the right"), () => P.merge(X.r, X.c, "right"), X.c + we >= e.length),
4562
+ Y("↕", Q("mergeDown", "Merge with the cell below"), () => P.merge(X.r, X.c, "down"), X.r + Te >= q.length),
4563
+ Y("⤫", Q("split", "Split this cell"), () => P.split(X.r, X.c), we === 1 && Te === 1)
4510
4564
  ]
4511
4565
  }),
4512
4566
  /* @__PURE__ */ u("div", {
@@ -4525,17 +4579,17 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4525
4579
  borderCollapse: T && _ !== !1 ? "separate" : "collapse",
4526
4580
  borderSpacing: 0,
4527
4581
  fontSize: 14,
4528
- ...le ? { tableLayout: "fixed" } : null,
4529
- ...y ? { border: se } : {}
4582
+ ...ce ? { tableLayout: "fixed" } : null,
4583
+ ...y ? { border: oe } : {}
4530
4584
  },
4531
4585
  children: [
4532
- le && /* @__PURE__ */ u("colgroup", { children: n.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
4586
+ ce && /* @__PURE__ */ u("colgroup", { children: n.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
4533
4587
  _ === !1 ? null : /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((t, n) => /* @__PURE__ */ u("th", {
4534
4588
  className: P ? "wb-tedit-head" : void 0,
4535
4589
  style: {
4536
- textAlign: fe(n),
4590
+ textAlign: de(n),
4537
4591
  fontWeight: 600,
4538
- padding: q,
4592
+ padding: ae,
4539
4593
  ...typeof D == "string" && D ? { color: D } : null,
4540
4594
  background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
4541
4595
  ...T ? {
@@ -4543,9 +4597,9 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4543
4597
  top: 0,
4544
4598
  zIndex: 2
4545
4599
  } : P ? { position: "relative" } : null,
4546
- ...ce
4600
+ ...se
4547
4601
  },
4548
- children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(jn, {
4602
+ children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(zn, {
4549
4603
  value: t.label ?? t,
4550
4604
  onCommit: (e) => P.header(n, e),
4551
4605
  hint: Q("editCell", "Double-click to edit"),
@@ -4556,16 +4610,16 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4556
4610
  onPointerDown: ve(n)
4557
4611
  })] }) : t.label ?? t
4558
4612
  }, n)) }) }),
4559
- /* @__PURE__ */ d("tbody", { children: [ae && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
4613
+ /* @__PURE__ */ d("tbody", { children: [ie && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
4560
4614
  colSpan: e.length,
4561
4615
  style: {
4562
- padding: q,
4616
+ padding: ae,
4563
4617
  textAlign: "center",
4564
4618
  opacity: .6,
4565
- ...ce
4619
+ ...se
4566
4620
  },
4567
4621
  children: w || "No data yet"
4568
- }) }), ie.map((t, n) => /* @__PURE__ */ u("tr", {
4622
+ }) }), q.map((t, n) => /* @__PURE__ */ u("tr", {
4569
4623
  className: P ? "wb-tedit-row" : void 0,
4570
4624
  style: {
4571
4625
  ...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
@@ -4573,7 +4627,7 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4573
4627
  },
4574
4628
  children: e.map((e, r) => {
4575
4629
  if (ye.has(`${n},${r}`)) return null;
4576
- let i = Pn(a[n], o[r]), s = m?.[i], c = p?.[i], l = Math.max(1, Number(c?.c) || 1), f = Math.max(1, Number(c?.r) || 1);
4630
+ let i = Hn(a[n], o[r]), s = m?.[i], c = p?.[i], l = Math.max(1, Number(c?.c) || 1), f = Math.max(1, Number(c?.r) || 1);
4577
4631
  return /* @__PURE__ */ d("td", {
4578
4632
  className: P ? `wb-tedit-cell${L?.r === n && L?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
4579
4633
  onMouseDownCapture: _e ? V(n, r) : void 0,
@@ -4581,15 +4635,15 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4581
4635
  colSpan: l > 1 ? l : void 0,
4582
4636
  rowSpan: f > 1 ? f : void 0,
4583
4637
  style: {
4584
- padding: q,
4585
- ...de(r) ? { textAlign: de(r) } : null,
4638
+ padding: ae,
4639
+ ...ue(r) ? { textAlign: ue(r) } : null,
4586
4640
  ...P ? { position: "relative" } : null,
4587
- ...ce
4641
+ ...se
4588
4642
  },
4589
- children: [s ?? Fn(t?.[r]), P && _e && /* @__PURE__ */ u("span", {
4643
+ children: [s ?? Un(t?.[r]), P && _e && /* @__PURE__ */ u("span", {
4590
4644
  className: "wb-tedit-rowgrip",
4591
4645
  title: Q("rowHeight", "Drag to set the row height — double-click to fit the content"),
4592
- onPointerDown: Se(n),
4646
+ onPointerDown: be(n),
4593
4647
  onDoubleClick: () => P.resizeRow(n, 0)
4594
4648
  })]
4595
4649
  }, r);
@@ -4601,7 +4655,7 @@ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4601
4655
  ]
4602
4656
  });
4603
4657
  }
4604
- var Ln = {
4658
+ var Gn = {
4605
4659
  small: {
4606
4660
  cell: 62,
4607
4661
  font: 10.5,
@@ -4626,9 +4680,9 @@ var Ln = {
4626
4680
  pad: 8,
4627
4681
  gap: 4
4628
4682
  }
4629
- }, Rn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, zn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Bn = 366;
4630
- function Vn(e, t = {}) {
4631
- 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 ? "" : Te(e), a = (e) => {
4683
+ }, Kn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, qn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Jn = 366;
4684
+ function Yn(e, t = {}) {
4685
+ let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : Oe(e), a = (e) => {
4632
4686
  let t = i(r(e)), n = t ? new Date(t) : null;
4633
4687
  return n && !Number.isNaN(n.getTime()) ? n : null;
4634
4688
  };
@@ -4644,7 +4698,7 @@ function Vn(e, t = {}) {
4644
4698
  } : null;
4645
4699
  }).filter(Boolean);
4646
4700
  }
4647
- function Hn(e) {
4701
+ function Xn(e) {
4648
4702
  return (Array.isArray(e) ? e : []).map((e, t) => {
4649
4703
  let n = e?.start ? new Date(e.start) : null;
4650
4704
  if (!n || Number.isNaN(n.getTime())) return null;
@@ -4659,20 +4713,20 @@ function Hn(e) {
4659
4713
  };
4660
4714
  }).filter(Boolean);
4661
4715
  }
4662
- function Un(e) {
4716
+ function Zn(e) {
4663
4717
  let t = /* @__PURE__ */ new Map();
4664
4718
  for (let n of e) {
4665
- let e = zn(n.start), r = n.end ? zn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Bn);
4719
+ let e = qn(n.start), r = n.end ? qn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Jn);
4666
4720
  for (let r = 0; r <= i; r += 1) {
4667
- let i = Rn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
4721
+ let i = Kn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
4668
4722
  t.has(i) || t.set(i, []), t.get(i).push(n);
4669
4723
  }
4670
4724
  }
4671
4725
  for (let e of t.values()) e.sort((e, t) => e.start - t.start);
4672
4726
  return t;
4673
4727
  }
4674
- function Wn({ events: e = [], source: t = "", titleField: n = "", startField: a = "", endField: o = "", hrefField: s = "", colorField: f = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
4675
- let { tenant: T, apiUrl: E, locale: D } = r(Y), O = r(be)?.[t], [k, j] = c(null), [M, N] = c(() => {
4728
+ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a = "", endField: o = "", hrefField: s = "", colorField: f = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
4729
+ let { tenant: T, apiUrl: E, locale: D } = r(Z), O = r(xe)?.[t], [k, j] = c(null), [M, N] = c(() => {
4676
4730
  let e = /* @__PURE__ */ new Date();
4677
4731
  return {
4678
4732
  year: e.getFullYear(),
@@ -4694,13 +4748,13 @@ function Wn({ events: e = [], source: t = "", titleField: n = "", startField: a
4694
4748
  E,
4695
4749
  O
4696
4750
  ]);
4697
- let P = Ln[m] ?? Ln.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 ? Vn(O ?? k ?? [], {
4751
+ let P = Gn[m] ?? Gn.medium, F = h || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = g || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? Yn(O ?? k ?? [], {
4698
4752
  titleField: n,
4699
4753
  startField: a,
4700
4754
  endField: o,
4701
4755
  hrefField: s,
4702
4756
  colorField: f
4703
- }) : Hn(e), B = Un(z), V = D || void 0, H = (e, t) => {
4757
+ }) : Xn(e), B = Zn(z), V = D || void 0, H = (e, t) => {
4704
4758
  let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
4705
4759
  width: 6,
4706
4760
  height: 6,
@@ -4747,7 +4801,7 @@ function Wn({ events: e = [], source: t = "", titleField: n = "", startField: a
4747
4801
  year: n.getFullYear(),
4748
4802
  month: n.getMonth()
4749
4803
  };
4750
- }), te = (e, t) => /* @__PURE__ */ u("button", {
4804
+ }), W = (e, t) => /* @__PURE__ */ u("button", {
4751
4805
  type: "button",
4752
4806
  "aria-label": e,
4753
4807
  onClick: () => ee(t),
@@ -4762,7 +4816,7 @@ function Wn({ events: e = [], source: t = "", titleField: n = "", startField: a
4762
4816
  padding: "4px 8px"
4763
4817
  },
4764
4818
  children: t < 0 ? "‹" : "›"
4765
- }), ne = /* @__PURE__ */ d("div", {
4819
+ }), te = /* @__PURE__ */ d("div", {
4766
4820
  style: {
4767
4821
  display: "flex",
4768
4822
  alignItems: "center",
@@ -4779,8 +4833,8 @@ function Wn({ events: e = [], source: t = "", titleField: n = "", startField: a
4779
4833
  },
4780
4834
  children: U
4781
4835
  }),
4782
- te("Previous month", -1),
4783
- te("Next month", 1)
4836
+ W("Previous month", -1),
4837
+ W("Next month", 1)
4784
4838
  ]
4785
4839
  });
4786
4840
  if (p === "list") {
@@ -4796,7 +4850,7 @@ function Wn({ events: e = [], source: t = "", titleField: n = "", startField: a
4796
4850
  width: "100%",
4797
4851
  ...A(S)
4798
4852
  },
4799
- children: [ne, e.length ? /* @__PURE__ */ u("div", {
4853
+ children: [te, e.length ? /* @__PURE__ */ u("div", {
4800
4854
  style: {
4801
4855
  display: "flex",
4802
4856
  flexDirection: "column",
@@ -4832,10 +4886,10 @@ function Wn({ events: e = [], source: t = "", titleField: n = "", startField: a
4832
4886
  })]
4833
4887
  });
4834
4888
  }
4835
- let re = new Date(M.year, M.month, 1), W = y === "sunday" ? 0 : 1, G = (re.getDay() - W + 7) % 7, K = new Date(M.year, M.month + 1, 0).getDate(), ie = Math.ceil((G + K) / 7), ae = Rn(/* @__PURE__ */ new Date()), oe = new Intl.DateTimeFormat(V, { weekday: "short" }), q = [];
4836
- for (let e = 0; e < ie * 7; e += 1) {
4837
- let t = e - G + 1, n = t >= 1 && t <= K, r = Rn(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ae;
4838
- q.push(/* @__PURE__ */ d("div", {
4889
+ let ne = new Date(M.year, M.month, 1), re = y === "sunday" ? 0 : 1, G = (ne.getDay() - re + 7) % 7, K = new Date(M.year, M.month + 1, 0).getDate(), q = Math.ceil((G + K) / 7), ie = Kn(/* @__PURE__ */ new Date()), J = new Intl.DateTimeFormat(V, { weekday: "short" }), ae = [];
4890
+ for (let e = 0; e < q * 7; e += 1) {
4891
+ let t = e - G + 1, n = t >= 1 && t <= K, r = Kn(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
4892
+ ae.push(/* @__PURE__ */ d("div", {
4839
4893
  style: {
4840
4894
  minHeight: P.cell,
4841
4895
  borderTop: `1px solid ${I}`,
@@ -4878,7 +4932,7 @@ function Wn({ events: e = [], source: t = "", titleField: n = "", startField: a
4878
4932
  ...A(S)
4879
4933
  },
4880
4934
  children: [
4881
- ne,
4935
+ te,
4882
4936
  /* @__PURE__ */ d("div", {
4883
4937
  style: {
4884
4938
  display: "grid",
@@ -4892,31 +4946,31 @@ function Wn({ events: e = [], source: t = "", titleField: n = "", startField: a
4892
4946
  textAlign: "center",
4893
4947
  padding: `0 0 ${P.pad}px`
4894
4948
  },
4895
- children: oe.format(new Date(2024, 0, 7 + W + t))
4896
- }, `head-${t}`)), q]
4949
+ children: J.format(new Date(2024, 0, 7 + re + t))
4950
+ }, `head-${t}`)), ae]
4897
4951
  }),
4898
4952
  /* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
4899
4953
  ]
4900
4954
  });
4901
4955
  }
4902
- var Gn = {
4956
+ var $n = {
4903
4957
  small: 36,
4904
4958
  medium: 56,
4905
4959
  large: 88
4906
4960
  };
4907
- function Kn(e, t = {}) {
4908
- let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : Te(e);
4961
+ function er(e, t = {}) {
4962
+ let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : Oe(e);
4909
4963
  return n.map((e) => {
4910
- let n = e.data ?? e, i = Ce(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(Ce(n, t.nameField)) : r(n.name);
4964
+ let n = e.data ?? e, i = Ee(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(Ee(n, t.nameField)) : r(n.name);
4911
4965
  return {
4912
4966
  src: typeof o == "string" ? o.trim() : "",
4913
4967
  alt: s,
4914
- href: t.hrefField ? r(Ce(n, t.hrefField)) : ""
4968
+ href: t.hrefField ? r(Ee(n, t.hrefField)) : ""
4915
4969
  };
4916
4970
  }).filter((e) => e.src);
4917
4971
  }
4918
- function qn({ logos: e = [], source: t = "", imageField: n = "", nameField: a = "", hrefField: o = "", variant: f = "step", size: p = "medium", perView: m = 5, gap: h = 48, hold: g = 3, slideMs: _ = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
4919
- let { tenant: D, apiUrl: O } = r(Y), k = r(be)?.[t], [j, M] = c(null), N = s(null), P = s(null), [F, I] = c(0), [L, R] = c(0), [z, B] = c(0), [V, H] = c(!0), [U, ee] = c(!1), [te, ne] = c(!1);
4972
+ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a = "", hrefField: o = "", variant: f = "step", size: p = "medium", perView: m = 5, gap: h = 48, hold: g = 3, slideMs: _ = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
4973
+ let { tenant: D, apiUrl: O } = r(Z), k = r(xe)?.[t], [j, M] = c(null), N = s(null), P = s(null), [F, I] = c(0), [L, R] = c(0), [z, B] = c(0), [V, H] = c(!0), [U, ee] = c(!1), [W, te] = c(!1);
4920
4974
  i(() => {
4921
4975
  if (!t || k) return;
4922
4976
  let e = !0;
@@ -4933,7 +4987,7 @@ function qn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
4933
4987
  k
4934
4988
  ]), i(() => {
4935
4989
  if (typeof window > "u" || !window.matchMedia) return;
4936
- let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => ne(e.matches);
4990
+ let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => te(e.matches);
4937
4991
  return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
4938
4992
  }, []), i(() => {
4939
4993
  let e = P.current;
@@ -4955,12 +5009,12 @@ function qn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
4955
5009
  t = !1, r.forEach((e) => e.removeEventListener("load", n));
4956
5010
  };
4957
5011
  });
4958
- let re = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], W = t ? Kn(k ?? j ?? [], {
5012
+ let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], re = t ? er(k ?? j ?? [], {
4959
5013
  imageField: n,
4960
5014
  nameField: a,
4961
5015
  hrefField: o
4962
- }) : re, G = Gn[p] ?? Gn.medium, K = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ae = f === "marquee" ? "step" : f, oe = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), q = Math.min(3e3, Math.max(100, Number(_) || 500)), se = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), ce = (L || G * 3) + K, le = F ? Math.max(1, Math.floor(F / ce)) : se, ue = Math.min(se, le), de = F ? Math.min(ce, F / ue) : ce;
4963
- if (!W.length) return /* @__PURE__ */ u("div", {
5016
+ }) : ne, G = $n[p] ?? $n.medium, K = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ie = f === "marquee" ? "step" : f, J = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), ae = Math.min(3e3, Math.max(100, Number(_) || 500)), oe = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || G * 3) + K, ce = F ? Math.max(1, Math.floor(F / se)) : oe, le = Math.min(oe, ce), ue = F ? Math.min(se, F / le) : se;
5017
+ if (!re.length) return /* @__PURE__ */ u("div", {
4964
5018
  ref: T,
4965
5019
  style: {
4966
5020
  width: "100%",
@@ -4991,7 +5045,7 @@ function qn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
4991
5045
  justifyContent: "center",
4992
5046
  fontSize: Math.max(10, Math.round(G / 4)),
4993
5047
  opacity: .45,
4994
- ...ie
5048
+ ...q
4995
5049
  },
4996
5050
  children: "LOGO"
4997
5051
  }, e))
@@ -5005,7 +5059,7 @@ function qn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5005
5059
  children: C
5006
5060
  }) : null
5007
5061
  });
5008
- let fe = W.length, J = ae === "step" && fe > ue, pe = ae === "slider", me = J && !E && !U && !te, he = v === "right", ge = he ? fe : 0, _e = J ? [...W, ...W] : W, ve = J ? z * de : 0, ye = (e, t, n) => {
5062
+ let de = re.length, fe = ie === "step" && de > le, pe = ie === "slider", me = fe && !E && !U && !W, he = v === "right", ge = he ? de : 0, _e = fe ? [...re, ...re] : re, ve = fe ? z * ue : 0, ye = (e, t, n) => {
5009
5063
  let r = /* @__PURE__ */ u("img", {
5010
5064
  src: e.src,
5011
5065
  alt: e.alt ?? "",
@@ -5016,8 +5070,8 @@ function qn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5016
5070
  objectFit: "contain",
5017
5071
  display: "block"
5018
5072
  }
5019
- }), i = J ? {
5020
- width: de,
5073
+ }), i = fe ? {
5074
+ width: ue,
5021
5075
  flex: "0 0 auto",
5022
5076
  padding: `0 ${K / 2}px`,
5023
5077
  justifyContent: "center"
@@ -5042,16 +5096,16 @@ function qn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5042
5096
  ...n ? { "aria-hidden": "true" } : {},
5043
5097
  children: r
5044
5098
  }, `${n ? "c" : "o"}-${t}`);
5045
- }, xe = /* @__PURE__ */ u("div", {
5099
+ }, be = /* @__PURE__ */ u("div", {
5046
5100
  ref: N,
5047
5101
  className: "wb-logos-track",
5048
5102
  style: {
5049
5103
  display: "flex",
5050
5104
  alignItems: "center",
5051
- ...J ? {
5052
- width: _e.length * de,
5105
+ ...fe ? {
5106
+ width: _e.length * ue,
5053
5107
  transform: `translateX(-${ve}px)`,
5054
- transition: V ? `transform ${q}ms ease` : "none"
5108
+ transition: V ? `transform ${ae}ms ease` : "none"
5055
5109
  } : pe ? {
5056
5110
  gap: K,
5057
5111
  overflowX: "auto",
@@ -5063,8 +5117,8 @@ function qn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5063
5117
  justifyContent: "center"
5064
5118
  }
5065
5119
  },
5066
- children: _e.map((e, t) => ye(e, t, J && t >= fe))
5067
- }), Se = (e) => {
5120
+ children: _e.map((e, t) => ye(e, t, fe && t >= de))
5121
+ }), Y = (e) => {
5068
5122
  if (pe) {
5069
5123
  let t = N.current;
5070
5124
  t && t.scrollBy({
@@ -5074,18 +5128,18 @@ function qn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5074
5128
  return;
5075
5129
  }
5076
5130
  let t = z + e;
5077
- if (t >= 0 && t <= fe) {
5131
+ if (t >= 0 && t <= de) {
5078
5132
  H(!0), B(t);
5079
5133
  return;
5080
5134
  }
5081
- let n = t < 0 ? fe : 0;
5135
+ let n = t < 0 ? de : 0;
5082
5136
  H(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
5083
5137
  H(!0), B(n + e);
5084
5138
  }));
5085
- }, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Z = X !== "off" && (pe ? F > 0 : J), Q = (e) => /* @__PURE__ */ u("button", {
5139
+ }, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Se = X !== "off" && (pe ? F > 0 : fe), Q = (e) => /* @__PURE__ */ u("button", {
5086
5140
  type: "button",
5087
5141
  "aria-label": e < 0 ? "Previous logos" : "Next logos",
5088
- onClick: () => Se(e),
5142
+ onClick: () => Y(e),
5089
5143
  className: `wb-logos-arrow${X === "hover" ? " wb-logos-arrow-shy" : ""}`,
5090
5144
  style: { [e < 0 ? "left" : "right"]: 0 },
5091
5145
  children: e < 0 ? "‹" : "›"
@@ -5124,33 +5178,33 @@ function qn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5124
5178
  border: 1px solid var(--page-border, rgba(148, 163, 184, 0.5));
5125
5179
  }
5126
5180
  ` }),
5127
- J ? /* @__PURE__ */ d("div", {
5181
+ fe ? /* @__PURE__ */ d("div", {
5128
5182
  style: {
5129
5183
  position: "relative",
5130
- width: ue * de,
5184
+ width: le * ue,
5131
5185
  maxWidth: "100%",
5132
5186
  margin: "0 auto"
5133
5187
  },
5134
5188
  children: [
5135
- Z ? Q(-1) : null,
5189
+ Se ? Q(-1) : null,
5136
5190
  /* @__PURE__ */ u("div", {
5137
5191
  style: { overflow: "hidden" },
5138
- children: xe
5192
+ children: be
5139
5193
  }),
5140
- Z ? Q(1) : null
5194
+ Se ? Q(1) : null
5141
5195
  ]
5142
5196
  }) : /* @__PURE__ */ d(l, { children: [
5143
- Z ? Q(-1) : null,
5144
- xe,
5145
- Z ? Q(1) : null
5197
+ Se ? Q(-1) : null,
5198
+ be,
5199
+ Se ? Q(1) : null
5146
5200
  ] }),
5147
- /* @__PURE__ */ u(Jn, {
5201
+ /* @__PURE__ */ u(nr, {
5148
5202
  running: me,
5149
- every: oe + q,
5150
- slide: q,
5203
+ every: J + ae,
5204
+ slide: ae,
5151
5205
  step: he ? -1 : 1,
5152
5206
  index: z,
5153
- total: fe,
5207
+ total: de,
5154
5208
  home: ge,
5155
5209
  setIndex: B,
5156
5210
  setAnimate: H
@@ -5158,7 +5212,7 @@ function qn({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5158
5212
  ]
5159
5213
  });
5160
5214
  }
5161
- function Jn({ running: e, every: t, slide: n, step: r, index: a, total: o, home: s, setIndex: c, setAnimate: l }) {
5215
+ function nr({ running: e, every: t, slide: n, step: r, index: a, total: o, home: s, setIndex: c, setAnimate: l }) {
5162
5216
  i(() => {
5163
5217
  if (!e) return;
5164
5218
  let n = setInterval(() => {
@@ -5194,13 +5248,13 @@ function Jn({ running: e, every: t, slide: n, step: r, index: a, total: o, home:
5194
5248
  l
5195
5249
  ]), null;
5196
5250
  }
5197
- var Yn = {
5251
+ var rr = {
5198
5252
  small: 380,
5199
5253
  medium: 560,
5200
5254
  large: 820,
5201
5255
  full: "100%"
5202
5256
  };
5203
- function Xn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: a = 0, size: o = "medium", title: l = "", showClose: f = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
5257
+ function ir({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: a = 0, size: o = "medium", title: l = "", showClose: f = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
5204
5258
  let [C, w] = c(!1), T = s(null);
5205
5259
  i(() => {
5206
5260
  if (S || !e) return;
@@ -5225,7 +5279,7 @@ function Xn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
5225
5279
  document.removeEventListener("keydown", e), document.body.style.overflow = t;
5226
5280
  };
5227
5281
  }, [S, C]);
5228
- let E = Yn[o] ?? Yn.medium, D = (e) => {
5282
+ let E = rr[o] ?? rr.medium, D = (e) => {
5229
5283
  let t = {
5230
5284
  padding: "9px 16px",
5231
5285
  borderRadius: 6,
@@ -5394,97 +5448,98 @@ function Xn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
5394
5448
  })]
5395
5449
  });
5396
5450
  }
5397
- var Zn = {
5398
- PageRoot: Pe,
5399
- CalendarBlock: Wn,
5400
- LogoCarousel: qn,
5401
- DialogBlock: Xn,
5402
- Section: Fe,
5403
- Container: Ie,
5404
- Heading: Le,
5405
- TextBlock: Ye,
5406
- ButtonBlock: Qe,
5407
- ImageBlock: $e,
5408
- Spacer: at,
5409
- Divider: ot,
5410
- SliderBlock: ft,
5411
- CanvasSlider: pt,
5412
- TabsBlock: kt,
5413
- QuickStack: tn,
5414
- CollectionList: nn,
5415
- CollectionSearch: rn,
5416
- BreadcrumbsBlock: an,
5417
- PaginationBlock: on,
5418
- StepperBlock: vn,
5419
- SocialLinksBlock: _n,
5420
- ThemeModeBlock: dn,
5421
- ScrollTopBlock: hn,
5422
- OrgChartBlock: An,
5423
- TableBlock: In,
5424
- IconBlock: St,
5425
- MapBlock: bt,
5426
- MasonryBlock: wt,
5427
- AccordionBlock: At,
5428
- NavbarBlock: Ot,
5429
- ListBlock: Je,
5430
- TextSpan: Ve,
5431
- QuoteBlock: qe,
5432
- TextLink: Ze,
5433
- RichTextBlock: Ge,
5434
- RichContentBlock: Ge,
5435
- VideoBlock: et,
5436
- YouTubeBlock: nt,
5437
- IframeBlock: rt,
5438
- EmbedBlock: it,
5439
- FormBlock: Ut,
5440
- FormLabel: Jt,
5441
- FormInput: Yt,
5442
- FormTextarea: Xt,
5443
- FormCheckbox: (e) => /* @__PURE__ */ u(Zt, {
5451
+ var ar = {
5452
+ PageRoot: ze,
5453
+ CalendarBlock: Qn,
5454
+ LogoCarousel: tr,
5455
+ DialogBlock: ir,
5456
+ Section: Be,
5457
+ Container: Ve,
5458
+ Heading: He,
5459
+ TextBlock: nt,
5460
+ ButtonBlock: at,
5461
+ ImageBlock: ot,
5462
+ Spacer: ft,
5463
+ Divider: pt,
5464
+ BoxBlock: mt,
5465
+ SliderBlock: bt,
5466
+ CanvasSlider: xt,
5467
+ TabsBlock: Lt,
5468
+ QuickStack: un,
5469
+ CollectionList: dn,
5470
+ CollectionSearch: fn,
5471
+ BreadcrumbsBlock: pn,
5472
+ PaginationBlock: mn,
5473
+ StepperBlock: En,
5474
+ SocialLinksBlock: Tn,
5475
+ ThemeModeBlock: yn,
5476
+ ScrollTopBlock: Cn,
5477
+ OrgChartBlock: Rn,
5478
+ TableBlock: Wn,
5479
+ IconBlock: At,
5480
+ MapBlock: Ot,
5481
+ MasonryBlock: Mt,
5482
+ AccordionBlock: Rt,
5483
+ NavbarBlock: It,
5484
+ ListBlock: tt,
5485
+ TextSpan: Ke,
5486
+ QuoteBlock: et,
5487
+ TextLink: it,
5488
+ RichTextBlock: Qe,
5489
+ RichContentBlock: Qe,
5490
+ VideoBlock: st,
5491
+ YouTubeBlock: lt,
5492
+ IframeBlock: ut,
5493
+ EmbedBlock: dt,
5494
+ FormBlock: Zt,
5495
+ FormLabel: nn,
5496
+ FormInput: rn,
5497
+ FormTextarea: an,
5498
+ FormCheckbox: (e) => /* @__PURE__ */ u(on, {
5444
5499
  kind: "checkbox",
5445
5500
  ...e
5446
5501
  }),
5447
- FormRadio: (e) => /* @__PURE__ */ u(Zt, {
5502
+ FormRadio: (e) => /* @__PURE__ */ u(on, {
5448
5503
  kind: "radio",
5449
5504
  ...e
5450
5505
  }),
5451
- FormSelect: Qt,
5452
- FormFile: $t,
5453
- FormRecaptcha: qt,
5454
- FormSubmit: en
5455
- }, Qn = {
5506
+ FormSelect: sn,
5507
+ FormFile: cn,
5508
+ FormRecaptcha: tn,
5509
+ FormSubmit: ln
5510
+ }, or = {
5456
5511
  id: "auth",
5457
5512
  label: "Accounts",
5458
5513
  category: "Apps",
5459
5514
  keys: ["SiteLoginForm", "SiteAccountMenu"],
5460
5515
  ssr: "shell",
5461
5516
  settings: ["site.authRedirect"]
5462
- }, $n = t({
5517
+ }, sr = t({
5463
5518
  user: null,
5464
5519
  status: "idle",
5465
5520
  ensure: () => {},
5466
5521
  refresh: () => {},
5467
5522
  signOut: () => {}
5468
5523
  });
5469
- function er(e, t) {
5524
+ function cr(e, t) {
5470
5525
  return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
5471
5526
  }
5472
- function tr(e) {
5527
+ function lr(e) {
5473
5528
  let t = e && typeof e == "object" ? e["site.session"] : null, n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (e) => typeof e == "string" ? e.trim() : "", i = r(n.url), a = r(n.mePath), o = r(n.logoutPath);
5474
5529
  return {
5475
5530
  mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
5476
5531
  url: i,
5477
5532
  mePath: a,
5478
5533
  logoutPath: o,
5479
- meUrl: er(i, a),
5480
- logoutUrl: er(i, o),
5534
+ meUrl: cr(i, a),
5535
+ logoutUrl: cr(i, o),
5481
5536
  loginPage: r(n.loginPage),
5482
5537
  userPath: r(n.userPath),
5483
5538
  auth: n.auth === "bearer" ? "bearer" : "cookies",
5484
5539
  tokenKey: r(n.tokenKey) || "webim_session_token"
5485
5540
  };
5486
5541
  }
5487
- function nr(e, t) {
5542
+ function ur(e, t) {
5488
5543
  if (!t) return e ?? null;
5489
5544
  let n = e;
5490
5545
  for (let e of t.split(".")) {
@@ -5493,26 +5548,26 @@ function nr(e, t) {
5493
5548
  }
5494
5549
  return n ?? null;
5495
5550
  }
5496
- function rr(e) {
5551
+ function dr(e) {
5497
5552
  try {
5498
5553
  return window.localStorage.getItem(e) || "";
5499
5554
  } catch {
5500
5555
  return "";
5501
5556
  }
5502
5557
  }
5503
- function ir(e) {
5558
+ function fr(e) {
5504
5559
  try {
5505
5560
  window.localStorage.removeItem(e);
5506
5561
  } catch {}
5507
5562
  }
5508
- var ar = () => {
5509
- let e = r($n);
5563
+ var pr = () => {
5564
+ let e = r(sr);
5510
5565
  return i(() => {
5511
5566
  e.ensure();
5512
5567
  }, [e]), e;
5513
5568
  };
5514
- function or({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
5515
- let f = r(Y), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => tr(f?.settings), [f?.settings]), [g, _] = c(t ?? null), [v, y] = c(t ? "user" : a ? "guest" : "idle"), b = s(!1), x = n((e, t) => fetch(`${p}${e}`, {
5569
+ function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
5570
+ let f = r(Z), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => lr(f?.settings), [f?.settings]), [g, _] = c(t ?? null), [v, y] = c(t ? "user" : a ? "guest" : "idle"), b = s(!1), x = n((e, t) => fetch(`${p}${e}`, {
5516
5571
  ...t,
5517
5572
  credentials: "include",
5518
5573
  headers: {
@@ -5524,9 +5579,9 @@ function or({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
5524
5579
  if (a) return Promise.resolve(null);
5525
5580
  if (h.mode === "off") return Promise.resolve(S(null));
5526
5581
  if (h.mode === "custom") {
5527
- let e = h.auth === "bearer" ? rr(h.tokenKey) : "";
5582
+ let e = h.auth === "bearer" ? dr(h.tokenKey) : "";
5528
5583
  return !h.meUrl || h.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(h.meUrl, { ...h.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
5529
- let t = nr(e, h.userPath);
5584
+ let t = ur(e, h.userPath);
5530
5585
  return S(t && typeof t == "object" ? t : null);
5531
5586
  }).catch(() => S(null));
5532
5587
  }
@@ -5539,12 +5594,12 @@ function or({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
5539
5594
  ]), w = n(() => {
5540
5595
  if (h.mode === "off") return S(null), Promise.resolve();
5541
5596
  if (h.mode === "custom") {
5542
- let e = h.auth === "bearer" ? rr(h.tokenKey) : "";
5597
+ let e = h.auth === "bearer" ? dr(h.tokenKey) : "";
5543
5598
  return (h.logoutUrl ? fetch(h.logoutUrl, {
5544
5599
  method: "post",
5545
5600
  ...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
5546
5601
  }).catch(() => {}) : Promise.resolve()).then(() => {
5547
- h.auth === "bearer" && ir(h.tokenKey), S(null);
5602
+ h.auth === "bearer" && fr(h.tokenKey), S(null);
5548
5603
  });
5549
5604
  }
5550
5605
  return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
@@ -5594,19 +5649,19 @@ function or({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
5594
5649
  h.loginPage,
5595
5650
  C,
5596
5651
  w
5597
- ]), /* @__PURE__ */ u($n.Provider, {
5652
+ ]), /* @__PURE__ */ u(sr.Provider, {
5598
5653
  value: E,
5599
5654
  children: e
5600
5655
  });
5601
5656
  }
5602
- function sr({ when: e, children: t }) {
5603
- let { status: n } = ar();
5657
+ function hr({ when: e, children: t }) {
5658
+ let { status: n } = pr();
5604
5659
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
5605
5660
  }
5606
5661
  //#endregion
5607
5662
  //#region ../ui/src/components/builder/apps/auth/views.jsx
5608
- function cr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
5609
- let { tenant: h, apiUrl: g, settings: _ } = r(Y), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
5663
+ function gr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
5664
+ let { tenant: h, apiUrl: g, settings: _ } = r(Z), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
5610
5665
  if (e.preventDefault(), f) return;
5611
5666
  let n = new FormData(e.currentTarget);
5612
5667
  C(!0), x("");
@@ -5654,20 +5709,20 @@ function cr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5654
5709
  children: [
5655
5710
  w ? /* @__PURE__ */ d("label", {
5656
5711
  style: {
5657
- ...Mt,
5712
+ ...Bt,
5658
5713
  display: "grid",
5659
5714
  gap: 6
5660
5715
  },
5661
5716
  children: [a, /* @__PURE__ */ u("input", {
5662
5717
  name: "name",
5663
5718
  type: "text",
5664
- style: Nt,
5665
- ...Ft(f)
5719
+ style: Vt,
5720
+ ...Ut(f)
5666
5721
  })]
5667
5722
  }) : null,
5668
5723
  /* @__PURE__ */ d("label", {
5669
5724
  style: {
5670
- ...Mt,
5725
+ ...Bt,
5671
5726
  display: "grid",
5672
5727
  gap: 6
5673
5728
  },
@@ -5675,13 +5730,13 @@ function cr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5675
5730
  name: "email",
5676
5731
  type: "email",
5677
5732
  required: !f,
5678
- style: Nt,
5679
- ...Ft(f)
5733
+ style: Vt,
5734
+ ...Ut(f)
5680
5735
  })]
5681
5736
  }),
5682
5737
  /* @__PURE__ */ d("label", {
5683
5738
  style: {
5684
- ...Mt,
5739
+ ...Bt,
5685
5740
  display: "grid",
5686
5741
  gap: 6
5687
5742
  },
@@ -5689,15 +5744,15 @@ function cr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5689
5744
  name: "password",
5690
5745
  type: "password",
5691
5746
  required: !f,
5692
- style: Nt,
5693
- ...Ft(f)
5747
+ style: Vt,
5748
+ ...Ut(f)
5694
5749
  })]
5695
5750
  }),
5696
5751
  /* @__PURE__ */ u("button", {
5697
5752
  type: f ? "button" : "submit",
5698
5753
  disabled: S || void 0,
5699
5754
  style: {
5700
- ...ke,
5755
+ ...Pe,
5701
5756
  border: 0,
5702
5757
  padding: "10px 22px",
5703
5758
  borderRadius: 8,
@@ -5729,8 +5784,8 @@ function cr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5729
5784
  ]
5730
5785
  });
5731
5786
  }
5732
- function lr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
5733
- let { user: c, status: l, signOut: f } = ar(), p = a ? s || "user" : l, m = a ? {
5787
+ function _r({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
5788
+ let { user: c, status: l, signOut: f } = pr(), p = a ? s || "user" : l, m = a ? {
5734
5789
  name: "Ada Lovelace",
5735
5790
  email: "ada@example.com"
5736
5791
  } : c;
@@ -5751,7 +5806,7 @@ function lr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5751
5806
  children: [
5752
5807
  /* @__PURE__ */ d("span", {
5753
5808
  style: {
5754
- ...Mt,
5809
+ ...Bt,
5755
5810
  fontWeight: 600
5756
5811
  },
5757
5812
  children: [
@@ -5762,7 +5817,7 @@ function lr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5762
5817
  }),
5763
5818
  n && m?.email ? /* @__PURE__ */ u("span", {
5764
5819
  style: {
5765
- ...Mt,
5820
+ ...Bt,
5766
5821
  opacity: .7
5767
5822
  },
5768
5823
  children: m.email
@@ -5771,14 +5826,14 @@ function lr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5771
5826
  type: "button",
5772
5827
  onClick: a ? void 0 : f,
5773
5828
  style: {
5774
- ...ke,
5829
+ ...Pe,
5775
5830
  border: 0,
5776
5831
  padding: "8px 16px",
5777
5832
  borderRadius: 8,
5778
5833
  fontSize: 14,
5779
5834
  cursor: a ? "default" : "pointer"
5780
5835
  },
5781
- ...Ft(a),
5836
+ ...Ut(a),
5782
5837
  children: t
5783
5838
  })
5784
5839
  ]
@@ -5795,40 +5850,40 @@ function lr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5795
5850
  }
5796
5851
  //#endregion
5797
5852
  //#region ../ui/src/components/builder/apps/consent/manifest.js
5798
- var ur = {
5853
+ var vr = {
5799
5854
  id: "consent",
5800
5855
  label: "Cookie consent",
5801
5856
  category: "Apps",
5802
5857
  keys: ["CookieConsent"],
5803
5858
  ssr: "shell",
5804
5859
  settings: []
5805
- }, dr = "webim.cookie_consent";
5806
- function fr() {
5860
+ }, yr = "webim.cookie_consent";
5861
+ function br() {
5807
5862
  try {
5808
- let e = window.localStorage.getItem(dr), t = e ? JSON.parse(e) : null;
5863
+ let e = window.localStorage.getItem(yr), t = e ? JSON.parse(e) : null;
5809
5864
  return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
5810
5865
  } catch {
5811
5866
  return "";
5812
5867
  }
5813
5868
  }
5814
- function pr(e) {
5869
+ function xr(e) {
5815
5870
  try {
5816
5871
  document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
5817
5872
  } catch {}
5818
5873
  }
5819
- function mr(e) {
5874
+ function Sr(e) {
5820
5875
  try {
5821
- window.localStorage.setItem(dr, JSON.stringify({
5876
+ window.localStorage.setItem(yr, JSON.stringify({
5822
5877
  choice: e,
5823
5878
  at: (/* @__PURE__ */ new Date()).toISOString()
5824
5879
  }));
5825
5880
  } catch {}
5826
- pr(e);
5881
+ xr(e);
5827
5882
  try {
5828
5883
  window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
5829
5884
  } catch {}
5830
5885
  }
5831
- var hr = {
5886
+ var Cr = {
5832
5887
  bottom: {
5833
5888
  left: 0,
5834
5889
  right: 0,
@@ -5850,18 +5905,18 @@ var hr = {
5850
5905
  maxWidth: 400
5851
5906
  }
5852
5907
  };
5853
- function gr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
5908
+ function wr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
5854
5909
  let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
5855
5910
  y(e), typeof m == "function" && m(e);
5856
5911
  };
5857
5912
  if (i(() => {
5858
5913
  if (h) return;
5859
- let e = fr();
5860
- e ? pr(e) : _(!0);
5914
+ let e = br();
5915
+ e ? xr(e) : _(!0);
5861
5916
  }, [h, v]), !g) return null;
5862
5917
  let x = (e) => () => {
5863
- h || (mr(e), _(!1));
5864
- }, S = hr[s] ?? hr.bottom, C = {
5918
+ h || (Sr(e), _(!1));
5919
+ }, S = Cr[s] ?? Cr.bottom, C = {
5865
5920
  appearance: "none",
5866
5921
  font: "inherit",
5867
5922
  fontSize: 14,
@@ -5941,37 +5996,37 @@ function gr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
5941
5996
  }
5942
5997
  //#endregion
5943
5998
  //#region ../ui/src/components/builder/apps/language/manifest.js
5944
- var _r = {
5999
+ var Tr = {
5945
6000
  id: "language",
5946
6001
  label: "Language",
5947
6002
  category: "Apps",
5948
6003
  keys: ["SiteLanguagePicker"],
5949
6004
  ssr: "prefetch",
5950
6005
  settings: ["locales"]
5951
- }, vr = {
6006
+ }, Er = {
5952
6007
  id: "search",
5953
6008
  label: "Search",
5954
6009
  category: "Apps",
5955
6010
  keys: ["SiteSearch"],
5956
6011
  ssr: "prefetch",
5957
6012
  settings: []
5958
- }, yr = 50, br = 2e3;
5959
- function xr() {
6013
+ }, Dr = 50, Or = 2e3;
6014
+ function kr() {
5960
6015
  return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
5961
6016
  }
5962
- function Sr(e, t) {
6017
+ function Ar(e, t) {
5963
6018
  let n = e?.data ?? {}, r = [];
5964
6019
  for (let e of Object.values(n)) {
5965
- let t = e == null ? "" : Te(e);
5966
- if (t && r.push(t), r.join(" ").length > br) break;
6020
+ let t = e == null ? "" : Oe(e);
6021
+ if (t && r.push(t), r.join(" ").length > Or) break;
5967
6022
  }
5968
- return r.join(" ").slice(0, br).toLocaleLowerCase(t || void 0);
6023
+ return r.join(" ").slice(0, Or).toLocaleLowerCase(t || void 0);
5969
6024
  }
5970
- function Cr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
5971
- let { tenant: b, apiUrl: x, locale: S } = r(Y), [C, w] = c(() => xr()), [T, E] = c(() => xr()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
6025
+ function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
6026
+ let { tenant: b, apiUrl: x, locale: S } = r(Z), [C, w] = c(() => kr()), [T, E] = c(() => kr()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
5972
6027
  i(() => {
5973
6028
  let e = () => {
5974
- let e = xr();
6029
+ let e = kr();
5975
6030
  w(e), E(e);
5976
6031
  };
5977
6032
  return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
@@ -6022,8 +6077,8 @@ function Cr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6022
6077
  });
6023
6078
  }
6024
6079
  else for (let t of e.rows) {
6025
- if (!Sr(t, S).includes(P)) continue;
6026
- let n = t?.data ?? {}, r = Te(n.name) || "Untitled", i = Te(n.slug);
6080
+ if (!Ar(t, S).includes(P)) continue;
6081
+ let n = t?.data ?? {}, r = Oe(n.name) || "Untitled", i = Oe(n.slug);
6027
6082
  F.push({
6028
6083
  key: `entry:${t.id}`,
6029
6084
  title: r,
@@ -6031,7 +6086,7 @@ function Cr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6031
6086
  kind: "entry"
6032
6087
  });
6033
6088
  }
6034
- let I = F.slice(0, Math.min(Math.max(1, p), yr)), L = (e) => {
6089
+ let I = F.slice(0, Math.min(Math.max(1, p), Dr)), L = (e) => {
6035
6090
  if (v) {
6036
6091
  e.preventDefault(), w(T), j(!0);
6037
6092
  return;
@@ -6113,7 +6168,7 @@ function Cr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6113
6168
  onChange: (e) => E(e.target.value),
6114
6169
  onFocus: () => P && j(!0),
6115
6170
  style: {
6116
- ...Nt,
6171
+ ...Vt,
6117
6172
  flexGrow: 1,
6118
6173
  minWidth: 0
6119
6174
  }
@@ -6171,21 +6226,21 @@ function Cr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6171
6226
  }
6172
6227
  //#endregion
6173
6228
  //#region ../ui/src/components/builder/apps/language/views.jsx
6174
- function wr(e) {
6229
+ function Mr(e) {
6175
6230
  let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
6176
6231
  return [...new Set(n.map((e) => e.trim()))];
6177
6232
  }
6178
- var Tr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
6179
- function Er(e, t) {
6233
+ var Nr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
6234
+ function Pr(e, t) {
6180
6235
  let n = String(e ?? "").toUpperCase();
6181
6236
  if (t === "code") return n;
6182
6237
  let r = "";
6183
6238
  try {
6184
- r = Tr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
6239
+ r = Nr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
6185
6240
  } catch {}
6186
6241
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
6187
6242
  }
6188
- function Dr(e, t) {
6243
+ function Fr(e, t) {
6189
6244
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
6190
6245
  if (typeof window > "u") return n || "?";
6191
6246
  try {
@@ -6195,8 +6250,8 @@ function Dr(e, t) {
6195
6250
  return n || "/";
6196
6251
  }
6197
6252
  }
6198
- function Or({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
6199
- let c = r(Y), l = wr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
6253
+ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
6254
+ let c = r(Z), l = Mr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
6200
6255
  display: "inline-flex",
6201
6256
  alignItems: "center",
6202
6257
  gap: 8,
@@ -6231,7 +6286,7 @@ function Or({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
6231
6286
  style: { opacity: .4 },
6232
6287
  children: n ?? "·"
6233
6288
  }), /* @__PURE__ */ u("a", {
6234
- href: Dr(e, e === f),
6289
+ href: Fr(e, e === f),
6235
6290
  hrefLang: e,
6236
6291
  "aria-current": e === p ? "true" : void 0,
6237
6292
  onClick: s ? (e) => e.preventDefault() : void 0,
@@ -6241,7 +6296,7 @@ function Or({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
6241
6296
  textDecoration: "none",
6242
6297
  cursor: s ? "default" : "pointer"
6243
6298
  },
6244
- children: Er(e, t)
6299
+ children: Pr(e, t)
6245
6300
  })]
6246
6301
  }, e))]
6247
6302
  }) : /* @__PURE__ */ d("div", {
@@ -6252,7 +6307,7 @@ function Or({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
6252
6307
  value: p,
6253
6308
  onChange: s ? void 0 : (e) => {
6254
6309
  let t = e.target.value;
6255
- window.location.assign(Dr(t, t === f));
6310
+ window.location.assign(Fr(t, t === f));
6256
6311
  },
6257
6312
  onKeyDown: s ? (e) => e.preventDefault() : void 0,
6258
6313
  style: {
@@ -6266,57 +6321,682 @@ function Or({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
6266
6321
  },
6267
6322
  children: l.map((e) => /* @__PURE__ */ u("option", {
6268
6323
  value: e,
6269
- children: Er(e, t)
6324
+ children: Pr(e, t)
6270
6325
  }, e))
6271
6326
  })]
6272
6327
  });
6273
6328
  }
6274
6329
  //#endregion
6275
6330
  //#region ../ui/src/components/builder/apps/index.js
6276
- var kr = [
6277
- Qn,
6278
- _r,
6279
- ur,
6280
- vr
6281
- ], Ar = {
6282
- SiteLoginForm: cr,
6283
- SiteAccountMenu: lr,
6284
- SiteLanguagePicker: Or,
6285
- CookieConsent: gr,
6286
- SiteSearch: Cr
6331
+ var Lr = [
6332
+ or,
6333
+ Tr,
6334
+ vr,
6335
+ Er
6336
+ ], Rr = {
6337
+ SiteLoginForm: gr,
6338
+ SiteAccountMenu: _r,
6339
+ SiteLanguagePicker: Ir,
6340
+ CookieConsent: wr,
6341
+ SiteSearch: jr
6287
6342
  };
6288
- new Set(kr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
6343
+ new Set(Lr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
6289
6344
  //#endregion
6290
- //#region ../ui/src/components/builder/plugins/runtime.js
6291
- var jr = /* @__PURE__ */ new Map();
6292
- function Mr(e) {
6293
- if (jr.has(e)) return jr.get(e);
6345
+ //#region ../ui/src/components/builder/three/runtime.js
6346
+ var zr = "0.185.1", Br = "4.3.1", Vr = "https://cdn.jsdelivr.net/npm", Hr = `${Vr}/three@${zr}/build/three.module.js`, Ur = `${Vr}/@google/model-viewer@${Br}/dist/model-viewer.min.js`, Wr = (e) => import(
6347
+ /* @vite-ignore */
6348
+ /* webpackIgnore: true */
6349
+ e
6350
+ ), Gr = /* @__PURE__ */ new Map();
6351
+ function Kr(e) {
6352
+ if (Gr.has(e)) return Gr.get(e);
6353
+ if (typeof window > "u") return new Promise(() => {});
6354
+ let t = Wr(e).catch((t) => {
6355
+ throw Gr.delete(e), t;
6356
+ });
6357
+ return Gr.set(e, t), t;
6358
+ }
6359
+ var qr = () => Kr(Hr);
6360
+ function Jr() {
6361
+ return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Kr(Ur);
6362
+ }
6363
+ var Yr = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Xr = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
6364
+ function Zr(e, t) {
6365
+ let n = 0, r = 0, i = 0, a = !0, o = (e) => {
6366
+ n = requestAnimationFrame(o), i ||= e;
6367
+ let a = r ? (e - r) / 1e3 : 0;
6368
+ r = e, t(a, (e - i) / 1e3);
6369
+ }, s = () => {
6370
+ n && cancelAnimationFrame(n), n = 0, r = 0;
6371
+ }, c = () => {
6372
+ let e = a && document.visibilityState !== "hidden";
6373
+ e && !n ? n = requestAnimationFrame(o) : !e && n && s();
6374
+ };
6375
+ t(0, 0);
6376
+ let l = typeof IntersectionObserver > "u" ? null : new IntersectionObserver((e) => {
6377
+ a = e.some((e) => e.isIntersecting), c();
6378
+ }, { rootMargin: "120px" });
6379
+ return l && e && l.observe(e), document.addEventListener("visibilitychange", c), c(), () => {
6380
+ s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
6381
+ };
6382
+ }
6383
+ function Qr(e, t, n = {}) {
6384
+ let r = {
6385
+ radius: n.distance ?? 4,
6386
+ polar: n.polar ?? Math.PI / 2.4,
6387
+ azimuth: n.azimuth ?? .6,
6388
+ target: n.target ?? {
6389
+ x: 0,
6390
+ y: 0,
6391
+ z: 0
6392
+ }
6393
+ }, i = { ...r }, a = n.minDistance ?? .4, o = n.maxDistance ?? 200, s = n.damping ?? .12, c = .05, l = null, u = (e) => {
6394
+ e.button !== void 0 && e.button !== 0 || (l = {
6395
+ x: e.clientX,
6396
+ y: e.clientY,
6397
+ id: e.pointerId
6398
+ }, t.setPointerCapture?.(e.pointerId));
6399
+ }, d = (e) => {
6400
+ if (!l || e.pointerId !== l.id) return;
6401
+ let t = e.clientX - l.x, n = e.clientY - l.y;
6402
+ l = {
6403
+ ...l,
6404
+ x: e.clientX,
6405
+ y: e.clientY
6406
+ }, i.azimuth -= t * .006, i.polar = Math.max(c, Math.min(Math.PI - c, i.polar - n * .006)), e.preventDefault();
6407
+ }, f = (e) => {
6408
+ l && e.pointerId === l.id && t.releasePointerCapture?.(e.pointerId), l = null;
6409
+ }, p = (e) => {
6410
+ n.enableZoom !== !1 && (e.preventDefault(), i.radius = Math.max(a, Math.min(o, i.radius * (1 + Math.sign(e.deltaY) * .12))));
6411
+ };
6412
+ return t.addEventListener("pointerdown", u), t.addEventListener("pointermove", d), t.addEventListener("pointerup", f), t.addEventListener("pointercancel", f), t.addEventListener("wheel", p, { passive: !1 }), {
6413
+ update: () => {
6414
+ r.radius += (i.radius - r.radius) * s, r.polar += (i.polar - r.polar) * s, r.azimuth += (i.azimuth - r.azimuth) * s;
6415
+ let t = Math.sin(r.polar);
6416
+ e.position.set(r.target.x + r.radius * t * Math.sin(r.azimuth), r.target.y + r.radius * Math.cos(r.polar), r.target.z + r.radius * t * Math.cos(r.azimuth)), e.lookAt(r.target.x, r.target.y, r.target.z);
6417
+ },
6418
+ dragging: () => !!l,
6419
+ autoSpin: (e, t) => {
6420
+ !l && e && (i.azimuth += e * t);
6421
+ },
6422
+ frame: (e, t) => {
6423
+ i.radius = Math.max(a, Math.min(o, e)), r.radius = i.radius, t && (r.target = { ...t }, i.target = { ...t });
6424
+ },
6425
+ dispose: () => {
6426
+ t.removeEventListener("pointerdown", u), t.removeEventListener("pointermove", d), t.removeEventListener("pointerup", f), t.removeEventListener("pointercancel", f), t.removeEventListener("wheel", p);
6427
+ }
6428
+ };
6429
+ }
6430
+ //#endregion
6431
+ //#region ../ui/src/components/builder/three/views.jsx
6432
+ var $r = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ei = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, ti = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180;
6433
+ function ni({ label: e, note: t, height: n, nodeRef: r, style: i }) {
6434
+ return /* @__PURE__ */ d("div", {
6435
+ ref: r,
6436
+ style: {
6437
+ ...A(i),
6438
+ minHeight: $r(n, 320),
6439
+ display: "flex",
6440
+ flexDirection: "column",
6441
+ alignItems: "center",
6442
+ justifyContent: "center",
6443
+ gap: 6,
6444
+ border: "1px dashed rgba(148,163,184,.55)",
6445
+ borderRadius: 10,
6446
+ background: "rgba(148,163,184,.08)",
6447
+ ...q,
6448
+ color: "rgba(100,116,139,.95)",
6449
+ fontSize: 13,
6450
+ textAlign: "center",
6451
+ padding: 16
6452
+ },
6453
+ children: [/* @__PURE__ */ u("div", {
6454
+ style: { fontWeight: 600 },
6455
+ children: e
6456
+ }), t ? /* @__PURE__ */ u("div", {
6457
+ style: {
6458
+ fontSize: 11,
6459
+ opacity: .8,
6460
+ maxWidth: 320
6461
+ },
6462
+ children: t
6463
+ }) : null]
6464
+ });
6465
+ }
6466
+ function ri({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotateDelay: s, cameraControls: l, ar: d, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
6467
+ let [y, b] = c(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = c(!1);
6468
+ i(() => {
6469
+ if (y || !e) return;
6470
+ let t = !0;
6471
+ return Jr().then(() => t && b(!0), () => t && S(!0)), () => {
6472
+ t = !1;
6473
+ };
6474
+ }, [y, e]);
6475
+ let C = {
6476
+ ...A(g),
6477
+ display: "block",
6478
+ width: "100%",
6479
+ minHeight: $r(r, 360),
6480
+ height: $r(r, 360),
6481
+ backgroundColor: a || "transparent",
6482
+ borderRadius: A(g).borderRadius ?? void 0
6483
+ };
6484
+ if (!e) return v ? /* @__PURE__ */ u(ni, {
6485
+ nodeRef: _,
6486
+ style: g,
6487
+ height: r,
6488
+ label: "3D Model",
6489
+ note: "Pick a .glb or .gltf file in the Settings panel."
6490
+ }) : /* @__PURE__ */ u("div", {
6491
+ ref: _,
6492
+ style: C
6493
+ });
6494
+ if (x) return /* @__PURE__ */ u("div", {
6495
+ ref: _,
6496
+ style: {
6497
+ ...C,
6498
+ display: "flex",
6499
+ alignItems: "center",
6500
+ justifyContent: "center"
6501
+ },
6502
+ children: t ? /* @__PURE__ */ u("img", {
6503
+ src: t,
6504
+ alt: n || "",
6505
+ style: {
6506
+ maxWidth: "100%",
6507
+ maxHeight: "100%"
6508
+ }
6509
+ }) : null
6510
+ });
6511
+ let w = (e) => e ? "" : void 0, T = o !== !1;
6512
+ return /* @__PURE__ */ u("model-viewer", {
6513
+ ref: _,
6514
+ src: e,
6515
+ alt: n || "A 3D model",
6516
+ poster: t || void 0,
6517
+ style: C,
6518
+ "camera-controls": w(!v && l !== !1),
6519
+ "auto-rotate": w(T && !Yr()),
6520
+ "auto-rotate-delay": T ? String($r(s, 0)) : void 0,
6521
+ "rotation-per-second": "18deg",
6522
+ ar: w(!v && d === !0),
6523
+ "ar-modes": "webxr scene-viewer quick-look",
6524
+ "shadow-intensity": String(ei(p, 100)),
6525
+ exposure: String(ei(f, 100)),
6526
+ "field-of-view": m ? `${Number(m)}deg` : void 0,
6527
+ "environment-image": h && h !== "neutral" ? h : "neutral",
6528
+ "interaction-prompt": v ? "none" : void 0,
6529
+ loading: "lazy",
6530
+ "touch-action": "pan-y",
6531
+ children: t ? /* @__PURE__ */ u("img", {
6532
+ slot: "poster",
6533
+ src: t,
6534
+ alt: n || "",
6535
+ style: {
6536
+ width: "100%",
6537
+ height: "100%",
6538
+ objectFit: "contain"
6539
+ }
6540
+ }) : null
6541
+ });
6542
+ }
6543
+ var ii = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), ai = [
6544
+ "precision highp float;",
6545
+ "uniform vec2 u_res;",
6546
+ "uniform float u_time;",
6547
+ "uniform vec2 u_mouse;",
6548
+ "uniform vec3 u_a;",
6549
+ "uniform vec3 u_b;",
6550
+ "uniform vec3 u_c;",
6551
+ "uniform float u_scale;",
6552
+ "",
6553
+ "float hash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); }",
6554
+ "float noise(vec2 p){",
6555
+ " vec2 i = floor(p); vec2 f = fract(p);",
6556
+ " vec2 u = f * f * (3.0 - 2.0 * f);",
6557
+ " return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x),",
6558
+ " mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x), u.y);",
6559
+ "}",
6560
+ "float fbm(vec2 p){",
6561
+ " float v = 0.0; float a = 0.5;",
6562
+ " for (int i = 0; i < 5; i++) { v += a * noise(p); p *= 2.02; a *= 0.5; }",
6563
+ " return v;",
6564
+ "}",
6565
+ ""
6566
+ ].join("\n"), oi = {
6567
+ gradient: [
6568
+ "void main(){",
6569
+ " vec2 uv = gl_FragCoord.xy / u_res;",
6570
+ " vec2 sp = (gl_FragCoord.xy - 0.5 * u_res) / min(u_res.x, u_res.y);",
6571
+ " float t = u_time * 0.25;",
6572
+ " float d1 = length(sp - vec2(sin(t) * 0.4, cos(t * 0.8) * 0.3) - u_mouse * 0.25);",
6573
+ " float d2 = length(sp + vec2(cos(t * 1.1) * 0.45, sin(t * 0.7) * 0.35));",
6574
+ " vec3 col = mix(u_a, u_b, smoothstep(0.0, 1.0, d1 * u_scale));",
6575
+ " col = mix(col, u_c, smoothstep(0.0, 1.2, d2 * u_scale) * 0.65);",
6576
+ " gl_FragColor = vec4(col, 1.0);",
6577
+ "}"
6578
+ ].join("\n"),
6579
+ waves: [
6580
+ "void main(){",
6581
+ " vec2 uv = gl_FragCoord.xy / u_res;",
6582
+ " float t = u_time * 0.5;",
6583
+ " float y = uv.y * u_scale;",
6584
+ " float w = sin((uv.x * 6.0) + t) * 0.08 + sin((uv.x * 11.0) - (t * 1.3)) * 0.05;",
6585
+ " float band = smoothstep(0.0, 1.0, y + w + (u_mouse.y * 0.1));",
6586
+ " vec3 col = mix(u_a, u_b, band);",
6587
+ " col += u_c * (0.12 * smoothstep(0.02, 0.0, abs(y + w - 0.5)));",
6588
+ " gl_FragColor = vec4(col, 1.0);",
6589
+ "}"
6590
+ ].join("\n"),
6591
+ plasma: [
6592
+ "void main(){",
6593
+ " vec2 uv = gl_FragCoord.xy / u_res;",
6594
+ " vec2 p = (uv - 0.5) * u_scale * 3.0 + u_mouse * 0.3;",
6595
+ " float t = u_time * 0.2;",
6596
+ " float n = fbm(p + vec2(fbm(p + t), fbm(p - t)));",
6597
+ " vec3 col = mix(u_a, u_b, smoothstep(0.25, 0.75, n));",
6598
+ " col = mix(col, u_c, smoothstep(0.6, 0.95, n));",
6599
+ " gl_FragColor = vec4(col, 1.0);",
6600
+ "}"
6601
+ ].join("\n"),
6602
+ grid: [
6603
+ "void main(){",
6604
+ " vec2 uv = gl_FragCoord.xy / u_res;",
6605
+ " vec2 sp = (gl_FragCoord.xy - 0.5 * u_res) / min(u_res.x, u_res.y);",
6606
+ " float t = u_time * 0.15;",
6607
+ " vec2 g = sp * (8.0 * u_scale);",
6608
+ " g.y += t;",
6609
+ " vec2 f = abs(fract(g) - 0.5);",
6610
+ " float line = smoothstep(0.48, 0.5, max(f.x, f.y));",
6611
+ " float glow = 1.0 - smoothstep(0.0, 0.9, length(sp - u_mouse * 0.4));",
6612
+ " vec3 col = mix(u_a, u_b, line);",
6613
+ " col += u_c * glow * 0.35;",
6614
+ " gl_FragColor = vec4(col, 1.0);",
6615
+ "}"
6616
+ ].join("\n")
6617
+ };
6618
+ function si(e, t) {
6619
+ let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
6620
+ if (!n) return t;
6621
+ let r = parseInt(n[1], 16);
6622
+ return [
6623
+ (r >> 16 & 255) / 255,
6624
+ (r >> 8 & 255) / 255,
6625
+ (r & 255) / 255
6626
+ ];
6627
+ }
6628
+ function ci(e, t, n) {
6629
+ let r = e.createShader(t);
6630
+ if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
6631
+ let t = e.getShaderInfoLog(r);
6632
+ throw e.deleteShader(r), Error(t || "Shader failed to compile");
6633
+ }
6634
+ return r;
6635
+ }
6636
+ function li({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, scale: l, height: f, interactive: p, style: m, nodeRef: h, inert: g }) {
6637
+ let _ = s(null), v = s(null), [y, b] = c(""), x = typeof t == "string" && t.trim() ? t : oi[e] ?? oi.gradient, S = String(n ?? ""), C = String(r ?? ""), w = String(a ?? ""), T = ei(o, 100), E = Math.max(.05, ei(l, 100));
6638
+ return i(() => {
6639
+ let e = _.current, t = v.current;
6640
+ if (!e || !t) return;
6641
+ let n = e.getContext("webgl", {
6642
+ antialias: !0,
6643
+ alpha: !0,
6644
+ premultipliedAlpha: !1
6645
+ });
6646
+ if (!n) {
6647
+ b("WebGL is not available in this browser");
6648
+ return;
6649
+ }
6650
+ let r = null;
6651
+ try {
6652
+ let e = ci(n, n.VERTEX_SHADER, ii), t = ci(n, n.FRAGMENT_SHADER, ai + x);
6653
+ if (r = n.createProgram(), n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) throw Error(n.getProgramInfoLog(r) || "Link failed");
6654
+ b("");
6655
+ } catch (e) {
6656
+ b(e?.message || "Shader failed to compile");
6657
+ return;
6658
+ }
6659
+ n.useProgram(r);
6660
+ let i = n.createBuffer();
6661
+ n.bindBuffer(n.ARRAY_BUFFER, i), n.bufferData(n.ARRAY_BUFFER, new Float32Array([
6662
+ -1,
6663
+ -1,
6664
+ 3,
6665
+ -1,
6666
+ -1,
6667
+ 3
6668
+ ]), n.STATIC_DRAW);
6669
+ let a = n.getAttribLocation(r, "p");
6670
+ n.enableVertexAttribArray(a), n.vertexAttribPointer(a, 2, n.FLOAT, !1, 0, 0);
6671
+ let o = (e) => n.getUniformLocation(r, e), s = {
6672
+ res: o("u_res"),
6673
+ time: o("u_time"),
6674
+ mouse: o("u_mouse"),
6675
+ a: o("u_a"),
6676
+ b: o("u_b"),
6677
+ c: o("u_c"),
6678
+ scale: o("u_scale")
6679
+ }, c = {
6680
+ x: 0,
6681
+ y: 0
6682
+ }, l = (t) => {
6683
+ let n = e.getBoundingClientRect();
6684
+ !n.width || !n.height || (c.x = ((t.clientX - n.left) / n.width - .5) * 2, c.y = (.5 - (t.clientY - n.top) / n.height) * 2);
6685
+ };
6686
+ p !== !1 && t.addEventListener("pointermove", l);
6687
+ let u = () => {
6688
+ let r = Xr(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
6689
+ (e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
6690
+ }, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
6691
+ d?.observe(t), u();
6692
+ let f = Yr(), m = {
6693
+ a: si(S, [
6694
+ .35,
6695
+ .4,
6696
+ .95
6697
+ ]),
6698
+ b: si(C, [
6699
+ .05,
6700
+ .06,
6701
+ .16
6702
+ ]),
6703
+ c: si(w, [
6704
+ .95,
6705
+ .35,
6706
+ .6
6707
+ ])
6708
+ }, h = {};
6709
+ return h.stop = Zr(t, (t, r) => {
6710
+ u(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (f ? 0 : r) * T), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, E), n.drawArrays(n.TRIANGLES, 0, 3), f && h.stop?.();
6711
+ }), () => {
6712
+ h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i), n.getExtension("WEBGL_lose_context")?.loseContext();
6713
+ };
6714
+ }, [
6715
+ x,
6716
+ S,
6717
+ C,
6718
+ w,
6719
+ T,
6720
+ E,
6721
+ p
6722
+ ]), /* @__PURE__ */ d("div", {
6723
+ ref: (e) => {
6724
+ v.current = e, typeof h == "function" && h(e);
6725
+ },
6726
+ style: {
6727
+ ...A(m),
6728
+ position: A(m).position ?? "relative",
6729
+ minHeight: $r(f, 320),
6730
+ overflow: "hidden"
6731
+ },
6732
+ children: [/* @__PURE__ */ u("canvas", {
6733
+ ref: _,
6734
+ style: {
6735
+ display: "block",
6736
+ width: "100%",
6737
+ height: "100%",
6738
+ position: "absolute",
6739
+ inset: 0
6740
+ }
6741
+ }), y && g ? /* @__PURE__ */ u("div", {
6742
+ style: {
6743
+ position: "absolute",
6744
+ inset: 0,
6745
+ display: "flex",
6746
+ alignItems: "center",
6747
+ justifyContent: "center",
6748
+ padding: 12,
6749
+ background: "rgba(15,23,42,.75)",
6750
+ ...q,
6751
+ color: "#fecaca",
6752
+ fontSize: 11,
6753
+ whiteSpace: "pre-wrap",
6754
+ overflow: "auto"
6755
+ },
6756
+ children: y
6757
+ }) : null]
6758
+ });
6759
+ }
6760
+ function ui(e, t) {
6761
+ let n = new e.Scene(), r = new e.BoxGeometry();
6762
+ r.deleteAttribute("uv");
6763
+ let i = new e.Mesh(r, new e.MeshBasicMaterial({
6764
+ side: e.BackSide,
6765
+ color: 6710886
6766
+ }));
6767
+ i.scale.setScalar(12), n.add(i);
6768
+ let a = (t, i, a, o, s, c, l, u) => {
6769
+ let d = new e.Mesh(r, new e.MeshBasicMaterial());
6770
+ d.material.color.setHex(t), d.material.color.multiplyScalar(i), d.position.set(a, o, s), d.scale.set(c, l, u), n.add(d);
6771
+ };
6772
+ a(16777215, 4, 0, 6, 0, 10, .5, 10), a(16777215, 1.4, -6, 1, 2, .4, 6, 6), a(16777215, 1, 6, 1, -2, .4, 6, 6);
6773
+ let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
6774
+ return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
6775
+ }
6776
+ var di = {
6777
+ box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
6778
+ sphere: (e) => new e.SphereGeometry(.62, 48, 32),
6779
+ torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
6780
+ knot: (e) => new e.TorusKnotGeometry(.44, .15, 128, 24),
6781
+ cone: (e) => new e.ConeGeometry(.55, 1.1, 48),
6782
+ cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
6783
+ plane: (e) => new e.PlaneGeometry(1.4, 1.4),
6784
+ capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
6785
+ }, fi = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
6786
+ function pi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: a, spinSpeed: o, controls: l, ground: d, height: f, style: p, nodeRef: m, inert: h }) {
6787
+ let g = s(null), [_, v] = c(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = a !== !1 && !Yr(), S = l !== !1 && !h;
6788
+ return i(() => {
6789
+ let e = g.current;
6790
+ if (!e) return;
6791
+ let i = !0, a = null;
6792
+ return qr().then((s) => {
6793
+ if (!i || !e) return;
6794
+ let c = new s.WebGLRenderer({
6795
+ antialias: !0,
6796
+ alpha: !t
6797
+ });
6798
+ c.setPixelRatio(Xr()), c.shadowMap.enabled = d !== !1, c.shadowMap.type = s.PCFSoftShadowMap, c.outputColorSpace = s.SRGBColorSpace, c.toneMapping = s.ACESFilmicToneMapping, c.domElement.style.display = "block", c.domElement.style.width = "100%", c.domElement.style.height = "100%", e.appendChild(c.domElement);
6799
+ let l = new s.Scene();
6800
+ t && (l.background = new s.Color(t)), l.environment = ui(s, c);
6801
+ let u = new s.PerspectiveCamera(fi(r, 45), 1, .1, 400), f = Qr(u, c.domElement, {
6802
+ distance: fi(n, 5),
6803
+ enableZoom: S
6804
+ }), p = new s.DirectionalLight(16777215, 2.2);
6805
+ p.position.set(4, 7, 5), p.castShadow = d !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, l.add(p, new s.AmbientLight(16777215, .35));
6806
+ let m = [], h = new s.Group();
6807
+ for (let e of y) {
6808
+ let t = (di[e.shape] ?? di.box)(s), n = new s.MeshStandardMaterial({
6809
+ color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
6810
+ metalness: Math.min(1, Math.max(0, ei(e.metalness, 10))),
6811
+ roughness: Math.min(1, Math.max(0, ei(e.roughness, 35))),
6812
+ transparent: ei(e.opacity, 100) < 1,
6813
+ opacity: Math.min(1, Math.max(0, ei(e.opacity, 100))),
6814
+ flatShading: e.flat === !0,
6815
+ wireframe: e.wireframe === !0,
6816
+ side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
6817
+ }), r = new s.Mesh(t, n), i = fi(e.scale, 1);
6818
+ r.position.set(fi(e.x, 0), fi(e.y, 0), fi(e.z, 0)), r.rotation.set(fi(e.rx, 0) * Math.PI / 180, fi(e.ry, 0) * Math.PI / 180, fi(e.rz, 0) * Math.PI / 180), r.scale.setScalar(i > 0 ? i : 1), r.castShadow = !0, r.receiveShadow = !0, r.userData.spin = ti(e.spin), h.add(r), m.push(t, n);
6819
+ }
6820
+ l.add(h);
6821
+ let g = null;
6822
+ if (d !== !1) {
6823
+ let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
6824
+ g = new s.Mesh(t, e), g.rotation.x = -Math.PI / 2, g.position.y = fi(d === !0 ? 0 : d, -.85), g.receiveShadow = !0, l.add(g), m.push(t, e);
6825
+ }
6826
+ let _ = () => {
6827
+ let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
6828
+ c.setSize(t, n, !1), u.aspect = t / n, u.updateProjectionMatrix();
6829
+ }, v = typeof ResizeObserver > "u" ? null : new ResizeObserver(_);
6830
+ v?.observe(e), _();
6831
+ let b = ti(Number.isFinite(Number(o)) ? o : 20), C = Zr(e, (e) => {
6832
+ f.autoSpin(x ? b : 0, e), f.update();
6833
+ for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
6834
+ c.render(l, u);
6835
+ });
6836
+ a = () => {
6837
+ C(), v?.disconnect(), f.dispose();
6838
+ for (let e of m) e.dispose?.();
6839
+ l.environment?.dispose?.(), c.dispose(), c.domElement.remove();
6840
+ };
6841
+ }, () => {
6842
+ i && v(!0);
6843
+ }), () => {
6844
+ i = !1, a?.();
6845
+ };
6846
+ }, [
6847
+ b,
6848
+ t,
6849
+ n,
6850
+ r,
6851
+ x,
6852
+ o,
6853
+ S,
6854
+ d
6855
+ ]), _ && h ? /* @__PURE__ */ u(ni, {
6856
+ nodeRef: m,
6857
+ style: p,
6858
+ height: f,
6859
+ label: "3D Scene",
6860
+ note: "The 3D engine could not be loaded. Check the connection and try again."
6861
+ }) : /* @__PURE__ */ u("div", {
6862
+ ref: (e) => {
6863
+ g.current = e, typeof m == "function" && m(e);
6864
+ },
6865
+ style: {
6866
+ ...A(p),
6867
+ minHeight: $r(f, 380),
6868
+ height: $r(f, 380),
6869
+ overflow: "hidden",
6870
+ touchAction: S ? "pan-y" : void 0
6871
+ }
6872
+ });
6873
+ }
6874
+ function mi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o }) {
6875
+ let l = s(null), [d, f] = c("");
6876
+ return i(() => {
6877
+ let t = l.current;
6878
+ if (o || !t || typeof e != "string" || !e.trim()) return;
6879
+ let r = !0, i = null;
6880
+ return qr().then((a) => {
6881
+ if (!r || !t) return;
6882
+ let o = new a.WebGLRenderer({
6883
+ antialias: !0,
6884
+ alpha: !n
6885
+ });
6886
+ o.setPixelRatio(Xr()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
6887
+ let s = new a.Scene();
6888
+ n && (s.background = new a.Color(n));
6889
+ let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
6890
+ c.position.set(0, 1.2, 4);
6891
+ let l = null;
6892
+ try {
6893
+ l = Function("ctx", `"use strict";\n${e}`)({
6894
+ THREE: a,
6895
+ scene: s,
6896
+ camera: c,
6897
+ renderer: o,
6898
+ canvas: o.domElement,
6899
+ host: t
6900
+ });
6901
+ } catch (e) {
6902
+ f(e?.message || String(e));
6903
+ }
6904
+ let u = () => {
6905
+ let e = Math.max(1, t.clientWidth), n = Math.max(1, t.clientHeight);
6906
+ o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
6907
+ }, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
6908
+ d?.observe(t), u();
6909
+ let p = !1, m = Zr(t, (e, t) => {
6910
+ if (!p && typeof l?.frame == "function") try {
6911
+ l.frame(e, t);
6912
+ } catch (e) {
6913
+ p = !0, f(e?.message || String(e));
6914
+ }
6915
+ o.render(s, c);
6916
+ });
6917
+ i = () => {
6918
+ m(), d?.disconnect();
6919
+ try {
6920
+ l?.dispose?.();
6921
+ } catch {}
6922
+ o.dispose(), o.domElement.remove();
6923
+ };
6924
+ }), () => {
6925
+ r = !1, i?.();
6926
+ };
6927
+ }, [
6928
+ e,
6929
+ o,
6930
+ n
6931
+ ]), o ? /* @__PURE__ */ u(ni, {
6932
+ nodeRef: a,
6933
+ style: r,
6934
+ height: t,
6935
+ label: "three.js",
6936
+ note: typeof e == "string" && e.trim() ? "Custom scene code runs in Preview and on the published page." : "Open the code editor in the Settings panel to write your scene."
6937
+ }) : /* @__PURE__ */ u("div", {
6938
+ ref: (e) => {
6939
+ l.current = e, typeof a == "function" && a(e);
6940
+ },
6941
+ style: {
6942
+ ...A(r),
6943
+ minHeight: $r(t, 380),
6944
+ height: $r(t, 380),
6945
+ overflow: "hidden",
6946
+ position: "relative",
6947
+ touchAction: "pan-y"
6948
+ },
6949
+ children: d ? /* @__PURE__ */ u("div", {
6950
+ style: {
6951
+ position: "absolute",
6952
+ left: 8,
6953
+ top: 8,
6954
+ right: 8,
6955
+ padding: "6px 8px",
6956
+ borderRadius: 6,
6957
+ background: "rgba(127,29,29,.85)",
6958
+ ...q,
6959
+ color: "#fee2e2",
6960
+ fontSize: 11
6961
+ },
6962
+ children: d
6963
+ }) : null
6964
+ });
6965
+ }
6966
+ var hi = {
6967
+ ModelViewerBlock: ri,
6968
+ ShaderBlock: li,
6969
+ SceneBlock: pi,
6970
+ ThreeCanvasBlock: mi
6971
+ }, gi = /* @__PURE__ */ new Map();
6972
+ function _i(e) {
6973
+ if (gi.has(e)) return gi.get(e);
6294
6974
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
6295
6975
  /* @vite-ignore */
6296
6976
  /* webpackIgnore: true */
6297
6977
  t
6298
6978
  ).finally(() => URL.revokeObjectURL(t));
6299
- return jr.set(e, n), n;
6979
+ return gi.set(e, n), n;
6300
6980
  }
6301
- function Nr(e) {
6981
+ function vi(e) {
6302
6982
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
6303
6983
  return n && typeof n == "object" ? n : {};
6304
6984
  }
6305
6985
  //#endregion
6306
6986
  //#region ../ui/src/components/builder/plugins/view.jsx
6307
- async function Pr(e, t) {
6308
- let n = await Mr(e);
6987
+ async function yi(e, t) {
6988
+ let n = await _i(e);
6309
6989
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
6310
6990
  }
6311
- var Fr = {
6991
+ var bi = {
6312
6992
  padding: "10px 12px",
6313
6993
  border: "1px dashed rgba(148, 163, 184, 0.5)",
6314
6994
  borderRadius: 8,
6315
6995
  fontSize: 12,
6316
6996
  opacity: .6
6317
6997
  };
6318
- function Ir({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
6319
- let c = r(Y), l = Nr(c?.settings)[e], f = s(null), p = s(null), m = {
6998
+ function xi({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
6999
+ let c = r(Z), l = vi(c?.settings)[e], f = s(null), p = s(null), m = {
6320
7000
  tenant: c?.tenant ?? "",
6321
7001
  apiUrl: c?.apiUrl ?? "/api",
6322
7002
  locale: c?.locale ?? "",
@@ -6328,7 +7008,7 @@ function Ir({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
6328
7008
  let e = f.current;
6329
7009
  if (!l?.code || !e) return;
6330
7010
  let n = !0;
6331
- return Pr(l.code, t).then((e) => {
7011
+ return yi(l.code, t).then((e) => {
6332
7012
  if (!(!n || !e || !f.current)) {
6333
7013
  p.current = e;
6334
7014
  try {
@@ -6358,7 +7038,7 @@ function Ir({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
6358
7038
  }) : /* @__PURE__ */ d("div", {
6359
7039
  ref: o,
6360
7040
  style: {
6361
- ...Fr,
7041
+ ...bi,
6362
7042
  ...A(a)
6363
7043
  },
6364
7044
  children: [
@@ -6370,12 +7050,13 @@ function Ir({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
6370
7050
  }
6371
7051
  //#endregion
6372
7052
  //#region ../ui/src/components/builder/render.jsx
6373
- var Lr = {
6374
- ...Zn,
6375
- ...Ar,
6376
- PluginBlock: Ir
7053
+ var Si = {
7054
+ ...ar,
7055
+ ...Rr,
7056
+ ...hi,
7057
+ PluginBlock: xi
6377
7058
  };
6378
- function Rr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7059
+ function Ci(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
6379
7060
  let o = n[t];
6380
7061
  if (!o || o.hidden) return null;
6381
7062
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -6383,11 +7064,11 @@ function Rr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
6383
7064
  let n = o.props?.componentId, s = r?.[n];
6384
7065
  if (!s?.template || i.has(n)) return null;
6385
7066
  let c = new Set(i).add(n);
6386
- return /* @__PURE__ */ u(e, { children: Rr(s.template.rootId, s.template.nodes, r, c, a) }, t);
7067
+ return /* @__PURE__ */ u(e, { children: Ci(s.template.rootId, s.template.nodes, r, c, a) }, t);
6387
7068
  }
6388
- let l = Lr[s];
7069
+ let l = Si[s];
6389
7070
  if (!l) return null;
6390
- let d = (o.nodes ?? []).map((e) => Rr(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Rr(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
7071
+ let d = (o.nodes ?? []).map((e) => Ci(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Ci(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
6391
7072
  ...c,
6392
7073
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
6393
7074
  linked: p,
@@ -6396,16 +7077,16 @@ function Rr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
6396
7077
  },
6397
7078
  children: d.length ? d : void 0
6398
7079
  }, t);
6399
- return c.when && c.when !== "always" ? /* @__PURE__ */ u(sr, {
7080
+ return c.when && c.when !== "always" ? /* @__PURE__ */ u(hr, {
6400
7081
  when: c.when,
6401
7082
  children: m
6402
7083
  }, t) : m;
6403
7084
  }
6404
7085
  //#endregion
6405
7086
  //#region ../ui/src/components/builder/PageRenderer.jsx
6406
- var zr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Br = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ue(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
7087
+ var wi = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ti = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ue(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
6407
7088
  .webim-page[data-webim-mode="dark"] { ${Object.entries(ue(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
6408
- function Vr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, animations: c, tenant: l, apiUrl: f, datasets: p, locale: m, direction: h, settings: _, siteUser: v }) {
7089
+ function Ei({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, animations: c, tenant: l, apiUrl: f, datasets: p, locale: m, direction: h, settings: _, siteUser: v }) {
6409
7090
  let b = s?.js?.trim();
6410
7091
  if (i(() => {
6411
7092
  if (!b) return;
@@ -6414,28 +7095,28 @@ function Vr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
6414
7095
  }, [b]), !e?.ROOT) return null;
6415
7096
  let x = {
6416
7097
  lang: m || void 0,
6417
- dir: ye(h, m)
7098
+ dir: X(h, m)
6418
7099
  }, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
6419
7100
  minHeight: "100%",
6420
7101
  display: "flex",
6421
7102
  flexDirection: "column"
6422
- }, w = Rr("ROOT", e, n), T = o(() => ({ render: (t, r) => Rr(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = G(e, n), O = W(e, n), k = s?.css?.trim(), A = E(c), j = le(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !q[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
7103
+ }, w = Ci("ROOT", e, n), T = o(() => ({ render: (t, r) => Ci(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = G(e, n), O = re(e, n), k = s?.css?.trim(), A = E(c), j = le(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !oe[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
6423
7104
  rel: "stylesheet",
6424
7105
  precedence: "default",
6425
7106
  href: g(e)
6426
- }, e)), P = Br(j);
6427
- return r === "auto" ? /* @__PURE__ */ u(Y.Provider, {
7107
+ }, e)), P = Ti(j);
7108
+ return r === "auto" ? /* @__PURE__ */ u(Z.Provider, {
6428
7109
  value: {
6429
7110
  tenant: l || "",
6430
7111
  apiUrl: f || "/api",
6431
7112
  locale: m || "",
6432
7113
  settings: _ ?? null
6433
7114
  },
6434
- children: /* @__PURE__ */ u(or, {
7115
+ children: /* @__PURE__ */ u(mr, {
6435
7116
  initialUser: v,
6436
- children: /* @__PURE__ */ u(be.Provider, {
7117
+ children: /* @__PURE__ */ u(xe.Provider, {
6437
7118
  value: p ?? null,
6438
- children: /* @__PURE__ */ u(Z.Provider, {
7119
+ children: /* @__PURE__ */ u(we.Provider, {
6439
7120
  value: T,
6440
7121
  children: /* @__PURE__ */ d("div", {
6441
7122
  ...x,
@@ -6446,8 +7127,8 @@ function Vr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
6446
7127
  ...a
6447
7128
  },
6448
7129
  children: [
6449
- /* @__PURE__ */ u("style", { children: `.webim-page { ${zr(ue(j.light))} }
6450
- @media (prefers-color-scheme: dark) { .webim-page { ${zr(ue(j.dark))} } }` }),
7130
+ /* @__PURE__ */ u("style", { children: `.webim-page { ${wi(ue(j.light))} }
7131
+ @media (prefers-color-scheme: dark) { .webim-page { ${wi(ue(j.dark))} } }` }),
6451
7132
  /* @__PURE__ */ u("style", { children: P }),
6452
7133
  N,
6453
7134
  /* @__PURE__ */ u("style", { children: S }),
@@ -6460,25 +7141,25 @@ function Vr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
6460
7141
  })
6461
7142
  })
6462
7143
  })
6463
- }) : /* @__PURE__ */ u(Y.Provider, {
7144
+ }) : /* @__PURE__ */ u(Z.Provider, {
6464
7145
  value: {
6465
7146
  tenant: l || "",
6466
7147
  apiUrl: f || "/api",
6467
7148
  locale: m || "",
6468
7149
  settings: _ ?? null
6469
7150
  },
6470
- children: /* @__PURE__ */ u(or, {
7151
+ children: /* @__PURE__ */ u(mr, {
6471
7152
  initialUser: v,
6472
- children: /* @__PURE__ */ u(be.Provider, {
7153
+ children: /* @__PURE__ */ u(xe.Provider, {
6473
7154
  value: p ?? null,
6474
- children: /* @__PURE__ */ u(Z.Provider, {
7155
+ children: /* @__PURE__ */ u(we.Provider, {
6475
7156
  value: T,
6476
7157
  children: /* @__PURE__ */ d("div", {
6477
7158
  ...x,
6478
7159
  className: "webim-page",
6479
7160
  style: {
6480
7161
  ...C,
6481
- ...fe(t, r),
7162
+ ...me(t, r),
6482
7163
  ...a
6483
7164
  },
6484
7165
  children: [
@@ -6500,8 +7181,8 @@ function Vr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
6500
7181
  }
6501
7182
  //#endregion
6502
7183
  //#region src/WebimContent.jsx
6503
- function Hr({ bundle: e, mode: t = "auto", style: n }) {
6504
- return e?.blocks?.ROOT ? /* @__PURE__ */ u(Vr, {
7184
+ function Di({ bundle: e, mode: t = "auto", style: n }) {
7185
+ return e?.blocks?.ROOT ? /* @__PURE__ */ u(Ei, {
6505
7186
  blocks: e.blocks,
6506
7187
  theme: e.theme,
6507
7188
  components: e.components,
@@ -6513,13 +7194,13 @@ function Hr({ bundle: e, mode: t = "auto", style: n }) {
6513
7194
  locale: e.locale,
6514
7195
  direction: e.direction,
6515
7196
  settings: e.settings,
6516
- mode: pe(t, e.scheme),
7197
+ mode: ge(t, e.scheme),
6517
7198
  style: n
6518
7199
  }) : null;
6519
7200
  }
6520
7201
  //#endregion
6521
7202
  //#region src/WebimPage.jsx
6522
- function Ur({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
7203
+ function Oi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
6523
7204
  let [g, _] = c({ status: "loading" }), v = s({
6524
7205
  onLoad: m,
6525
7206
  onError: h
@@ -6529,7 +7210,7 @@ function Ur({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
6529
7210
  onError: h
6530
7211
  }, i(() => {
6531
7212
  let i = !0;
6532
- return _({ status: "loading" }), ge({
7213
+ return _({ status: "loading" }), ye({
6533
7214
  apiUrl: e,
6534
7215
  tenant: t,
6535
7216
  slug: n,
@@ -6556,11 +7237,11 @@ function Ur({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
6556
7237
  r,
6557
7238
  a,
6558
7239
  o
6559
- ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Hr, {
7240
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Di, {
6560
7241
  bundle: g.bundle,
6561
7242
  mode: l,
6562
7243
  style: d
6563
7244
  });
6564
7245
  }
6565
7246
  //#endregion
6566
- export { Vr as PageRenderer, Hr as WebimContent, Ur as WebimPage, ge as fetchPage, We as renderRichContent, J as resolveTheme };
7247
+ export { Ei as PageRenderer, Di as WebimContent, Oi as WebimPage, ye as fetchPage, Ze as renderRichContent, he as resolveTheme };