webim-adapter 0.10.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,36 +48,36 @@ function h(e) {
48
48
  color: j,
49
49
  inset: M
50
50
  })), N.length && (t.boxShadow = N.join(", "));
51
- let P = (e) => e.type === "blur" ? `blur(${p(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: ee, filterBrightness: z, filterContrast: B, filterSaturate: te } = t;
51
+ let P = (e) => e.type === "blur" ? `blur(${p(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: ee, filterBlur: L, filterGrayscale: te, filterBrightness: R, filterContrast: z, filterSaturate: ne } = t;
52
52
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
53
- let V = F(I);
54
- R !== void 0 && V.push(`blur(${p(R)})`), ee !== void 0 && V.push(`grayscale(${ee}%)`), z !== void 0 && V.push(`brightness(${z}%)`), B !== void 0 && V.push(`contrast(${B}%)`), te !== void 0 && V.push(`saturate(${te}%)`), V.length && (t.filter = V.join(" "));
55
- let ne = F(L);
56
- ne.length && (t.backdropFilter = ne.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
- let { textStrokeWidth: re, textStrokeColor: ie } = t;
58
- delete t.textStrokeWidth, delete t.textStrokeColor, (re !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${p(re ?? 1)} ${ie || "currentColor"}`);
59
- let { clipText: ae } = t;
60
- delete t.clipText, ae && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
- let { transitions: oe, transitionDuration: H, transitionEasing: U, transitionProperty: W } = t, se = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
53
+ let B = F(I);
54
+ L !== void 0 && B.push(`blur(${p(L)})`), te !== void 0 && B.push(`grayscale(${te}%)`), R !== void 0 && B.push(`brightness(${R}%)`), z !== void 0 && B.push(`contrast(${z}%)`), ne !== void 0 && B.push(`saturate(${ne}%)`), B.length && (t.filter = B.join(" "));
55
+ let re = F(ee);
56
+ re.length && (t.backdropFilter = re.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
+ let { textStrokeWidth: ie, textStrokeColor: ae } = t;
58
+ delete t.textStrokeWidth, delete t.textStrokeColor, (ie !== void 0 || ae !== void 0) && (t.WebkitTextStroke = `${p(ie ?? 1)} ${ae || "currentColor"}`);
59
+ let { clipText: oe } = t;
60
+ delete t.clipText, oe && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
+ let { transitions: se, transitionDuration: V, transitionEasing: H, transitionProperty: U } = t, W = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
62
62
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
63
- let G = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${se(e.duration ?? 200)} ${e.easing || "ease"}`);
64
- if (H !== void 0 && G.push(`${W || "all"} ${se(H)} ${U || "ease"}`), G.length && (t.transition = G.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
63
+ let G = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${W(e.duration ?? 200)} ${e.easing || "ease"}`);
64
+ if (V !== void 0 && G.push(`${U || "all"} ${W(V)} ${H || "ease"}`), G.length && (t.transition = G.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
65
65
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
66
66
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
67
67
  }
68
68
  delete t.backgroundVideo;
69
- let { overlayColor: ce, overlayOpacity: K } = t;
70
- if (delete t.overlayColor, delete t.overlayOpacity, ce) {
71
- let e = `color-mix(in srgb, ${ce} ${K ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
69
+ let { overlayColor: K, overlayOpacity: ce } = t;
70
+ if (delete t.overlayColor, delete t.overlayOpacity, K) {
71
+ let e = `color-mix(in srgb, ${K} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
72
72
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
73
73
  }
74
74
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
75
- let { backgroundLayers: le } = t;
75
+ let { backgroundLayers: q } = t;
76
76
  delete t.backgroundLayers;
77
- let q = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
78
- if (q.length) {
77
+ let le = (Array.isArray(q) ? q : []).filter((e) => e && e.on !== !1);
78
+ if (le.length) {
79
79
  let e = [], n = [], r = [], i = [], a = [];
80
- for (let t of q) 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");
80
+ 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");
81
81
  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");
82
82
  else {
83
83
  if (!t.src) continue;
@@ -272,19 +272,19 @@ function I(e) {
272
272
  "--page-heading-font": t.headingFont === "inherit" ? "inherit" : M(t.headingFont, "inherit")
273
273
  };
274
274
  }
275
- function L(e, t = "light") {
275
+ function ee(e, t = "light") {
276
276
  let n = P(e);
277
277
  return {
278
278
  ...I(e),
279
279
  ...F(n[t] ?? n.light)
280
280
  };
281
281
  }
282
- function R(e, t) {
282
+ function L(e, t) {
283
283
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
284
284
  }
285
285
  //#endregion
286
286
  //#region src/bundle.js
287
- function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
287
+ function te({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
288
288
  let a = {
289
289
  ...t?.global ?? {},
290
290
  ...t?.tenant ?? {}
@@ -294,7 +294,7 @@ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
294
294
  title: e.title,
295
295
  slug: e.slug,
296
296
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
297
- theme: R(o, a.builder_themes?.themes),
297
+ theme: L(o, a.builder_themes?.themes),
298
298
  components: a.builder_components?.components ?? {},
299
299
  custom: o.custom,
300
300
  seo: o.seo,
@@ -308,29 +308,36 @@ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
308
308
  }
309
309
  //#endregion
310
310
  //#region src/fetchPage.js
311
- var z = async (e) => {
311
+ var R = async (e) => {
312
312
  let t = await e.json().catch(() => null);
313
313
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
314
314
  return t?.payload ?? t;
315
315
  };
316
- async function B({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
316
+ async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
317
317
  if (!e) throw Error("fetchPage: apiUrl is required");
318
318
  if (!n) throw Error("fetchPage: slug is required");
319
- let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
319
+ let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
320
320
  ...t ? { "x-tenant": t } : {},
321
321
  ...a ? { authorization: `Bearer ${a}` } : {}
322
- }, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(z), s(`${c}/settings/public`, { headers: l }).then(z)]), f = ee({
323
- page: u,
324
- settings: d,
322
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(R), c(`${l}/settings/public`, { headers: u }).then(R)]), p = te({
323
+ page: d,
324
+ settings: f,
325
325
  tenant: t,
326
- apiUrl: c,
326
+ apiUrl: l,
327
327
  locale: r
328
- }), p = [...new Set(Object.values(f.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
329
- if (p.length) {
330
- let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(z).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
331
- f.datasets = Object.fromEntries(t);
328
+ }), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
329
+ if (m.length) {
330
+ 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(R).then((e) => {
331
+ let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
332
+ return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
333
+ }).catch(() => [[t, []]])));
334
+ p.datasets = Object.fromEntries(t.flat());
332
335
  }
333
- return f;
336
+ let h = Number(o);
337
+ return Number.isFinite(h) && h >= 1 && (p.datasets = {
338
+ ...p.datasets ?? {},
339
+ __page: Math.floor(h)
340
+ }), p;
334
341
  }
335
342
  new Map([
336
343
  {
@@ -438,14 +445,14 @@ new Map([
438
445
  fallback: "sans-serif"
439
446
  }
440
447
  ].map((e) => [e.family, e]));
441
- function te(e) {
448
+ function ne(e) {
442
449
  return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
443
450
  }
444
- var V = (e) => te([e]), ne = (e) => {
451
+ var B = (e) => ne([e]), re = (e) => {
445
452
  let t = typeof e == "string" && e.match(/^"([^"]+)"/);
446
453
  return t ? t[1] : null;
447
454
  };
448
- function re(e, t) {
455
+ function ie(e, t) {
449
456
  let n = /* @__PURE__ */ new Set(), r = (e) => {
450
457
  for (let t of Object.values(e || {})) for (let e of [
451
458
  "style",
@@ -453,7 +460,7 @@ function re(e, t) {
453
460
  "pressed",
454
461
  "focused"
455
462
  ]) {
456
- let r = ne(t.props?.[e]?.fontFamily);
463
+ let r = re(t.props?.[e]?.fontFamily);
457
464
  r && n.add(r);
458
465
  }
459
466
  };
@@ -463,7 +470,7 @@ function re(e, t) {
463
470
  }
464
471
  //#endregion
465
472
  //#region ../ui/src/components/builder/locale.js
466
- var ie = /* @__PURE__ */ new Set([
473
+ var ae = /* @__PURE__ */ new Set([
467
474
  "ar",
468
475
  "he",
469
476
  "fa",
@@ -474,13 +481,19 @@ var ie = /* @__PURE__ */ new Set([
474
481
  "yi",
475
482
  "dv",
476
483
  "ckb"
477
- ]), ae = (e) => ie.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", oe = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ae(t) : void 0, H = t({
484
+ ]), oe = (e) => ae.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", se = (e, t) => e === "ltr" || e === "rtl" ? e : t ? oe(t) : void 0, V = t({
478
485
  tenant: "",
479
486
  apiUrl: "/api",
480
487
  locale: "",
481
488
  settings: null
482
- }), U = t(null), W = t(null), se = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
483
- function G(e, t) {
489
+ }), H = t(null), U = (e) => {
490
+ let t = Number(e?.__page);
491
+ if (Number.isFinite(t) && t >= 1) return Math.floor(t);
492
+ if (typeof window > "u") return 1;
493
+ let n = Number(new URLSearchParams(window.location.search).get("page"));
494
+ return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
495
+ }, W = t(null), G = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
496
+ function K(e, t) {
484
497
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
485
498
  }
486
499
  var ce = (e) => {
@@ -493,36 +506,36 @@ var ce = (e) => {
493
506
  }
494
507
  return t;
495
508
  };
496
- function K(e) {
509
+ function q(e) {
497
510
  return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
498
511
  }
499
512
  function le(e, t) {
500
513
  let n = t?.data ?? {}, r = ce(n);
501
514
  if (!r.length) return e;
502
- let i = RegExp(`:(${r.map(se).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(G(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
515
+ let i = RegExp(`:(${r.map(G).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => q(K(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
503
516
  return a(e);
504
517
  }
505
- var q = {
518
+ var ue = {
506
519
  margin: 0,
507
520
  fontWeight: 700,
508
521
  lineHeight: 1.2,
509
522
  fontFamily: "var(--page-heading-font, inherit)"
510
- }, ue = { margin: 0 }, J = {
523
+ }, de = { margin: 0 }, J = {
511
524
  display: "inline-block",
512
525
  textDecoration: "none",
513
526
  cursor: "pointer",
514
527
  backgroundColor: "var(--page-accent, #111827)",
515
528
  color: "var(--page-accent-text, #ffffff)"
516
- }, de = {
529
+ }, fe = {
517
530
  flexGrow: 1,
518
531
  display: "flex",
519
532
  flexDirection: "column",
520
533
  position: "relative"
521
- }, fe = {
534
+ }, pe = {
522
535
  display: "flex",
523
536
  flexDirection: "column"
524
537
  };
525
- function pe({ style: e }) {
538
+ function me({ style: e }) {
526
539
  let t = e?.backgroundVideo;
527
540
  if (!t) return null;
528
541
  let n = {
@@ -548,7 +561,7 @@ function pe({ style: e }) {
548
561
  background: r
549
562
  } })] });
550
563
  }
551
- var me = (e, t) => e?.backgroundVideo ? {
564
+ var he = (e, t) => e?.backgroundVideo ? {
552
565
  position: "relative",
553
566
  ...t,
554
567
  ...h(e)
@@ -556,24 +569,24 @@ var me = (e, t) => e?.backgroundVideo ? {
556
569
  ...t,
557
570
  ...h(e)
558
571
  };
559
- function he({ style: e, nodeRef: t, children: n }) {
572
+ function ge({ style: e, nodeRef: t, children: n }) {
560
573
  return /* @__PURE__ */ d("div", {
561
574
  ref: t,
562
575
  style: {
563
- ...de,
576
+ ...fe,
564
577
  ...h(e)
565
578
  },
566
- children: [/* @__PURE__ */ u(pe, { style: e }), n]
579
+ children: [/* @__PURE__ */ u(me, { style: e }), n]
567
580
  });
568
581
  }
569
- function ge({ style: e, nodeRef: t, children: n }) {
582
+ function _e({ style: e, nodeRef: t, children: n }) {
570
583
  return /* @__PURE__ */ d("section", {
571
584
  ref: t,
572
- style: me(e, fe),
573
- children: [/* @__PURE__ */ u(pe, { style: e }), n]
585
+ style: he(e, pe),
586
+ children: [/* @__PURE__ */ u(me, { style: e }), n]
574
587
  });
575
588
  }
576
- function _e({ style: e, freeLayout: t, nodeRef: n, children: r }) {
589
+ function ve({ style: e, freeLayout: t, nodeRef: n, children: r }) {
577
590
  let i = t ? {
578
591
  position: "relative",
579
592
  minHeight: 240
@@ -582,32 +595,32 @@ function _e({ style: e, freeLayout: t, nodeRef: n, children: r }) {
582
595
  ref: n,
583
596
  style: i ? {
584
597
  ...i,
585
- ...me(e)
586
- } : me(e),
587
- children: [/* @__PURE__ */ u(pe, { style: e }), r]
598
+ ...he(e)
599
+ } : he(e),
600
+ children: [/* @__PURE__ */ u(me, { style: e }), r]
588
601
  });
589
602
  }
590
- function ve({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
603
+ function ye({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
591
604
  return /* @__PURE__ */ u(n, {
592
605
  ref: a,
593
606
  style: {
594
- ...q,
607
+ ...ue,
595
608
  ...h(r)
596
609
  },
597
610
  children: Y(t, e, i)
598
611
  });
599
612
  }
600
- var ye = {
613
+ var be = {
601
614
  fontFamily: j.mono.value,
602
615
  background: "rgba(148, 163, 184, 0.18)",
603
616
  padding: "1px 5px",
604
617
  borderRadius: 4,
605
618
  fontSize: "0.9em"
606
619
  };
607
- function be(e, t = [], n, r) {
620
+ function xe(e, t = [], n, r) {
608
621
  let i = e;
609
622
  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", {
610
- style: ye,
623
+ style: be,
611
624
  children: i
612
625
  })), 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", {
613
626
  href: n,
@@ -623,7 +636,7 @@ function Y(t, n, r) {
623
636
  if (t.parts) return /* @__PURE__ */ u(e, { children: Y(t.parts, "", r) }, n);
624
637
  let i = t.text;
625
638
  return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
626
- style: ye,
639
+ style: be,
627
640
  children: i
628
641
  })), 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", {
629
642
  style: {
@@ -640,13 +653,13 @@ function Y(t, n, r) {
640
653
  })), /* @__PURE__ */ u(e, { children: i }, n);
641
654
  }) : n;
642
655
  }
643
- function xe({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
656
+ function Se({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
644
657
  return /* @__PURE__ */ u("span", {
645
658
  style: h(a),
646
- children: e?.length ? Y(e, t) : be(t, n, r, i)
659
+ children: e?.length ? Y(e, t) : xe(t, n, r, i)
647
660
  });
648
661
  }
649
- var Se = {
662
+ var Ce = {
650
663
  h1: 40,
651
664
  h2: 32,
652
665
  h3: 26,
@@ -654,7 +667,7 @@ var Se = {
654
667
  h5: 19,
655
668
  h6: 16
656
669
  };
657
- function Ce({ align: e = "center", width: t, wrap: n } = {}) {
670
+ function we({ align: e = "center", width: t, wrap: n } = {}) {
658
671
  let r = t ? `${t}%` : void 0;
659
672
  if (e === "full") return { width: "100%" };
660
673
  let i = e === "left" || e === "right";
@@ -688,7 +701,7 @@ function Ce({ align: e = "center", width: t, wrap: n } = {}) {
688
701
  marginRight: "auto"
689
702
  };
690
703
  }
691
- function we(e = [], t, n) {
704
+ function Te(e = [], t, n) {
692
705
  let r = n ?? ((e, n) => Y(e, n, t));
693
706
  return e.map((t, n) => {
694
707
  let i = {
@@ -711,7 +724,7 @@ function we(e = [], t, n) {
711
724
  marginLeft: 0,
712
725
  marginRight: 0,
713
726
  ...i,
714
- ...Ce(t)
727
+ ...we(t)
715
728
  },
716
729
  children: [t.href ? /* @__PURE__ */ u("a", {
717
730
  href: t.href,
@@ -730,16 +743,16 @@ function we(e = [], t, n) {
730
743
  })]
731
744
  }, n);
732
745
  }
733
- if (t.type === "video") return Fe(t.url) ? /* @__PURE__ */ u("div", {
746
+ if (t.type === "video") return Ie(t.url) ? /* @__PURE__ */ u("div", {
734
747
  style: {
735
748
  ...i,
736
- ...Ce({
749
+ ...we({
737
750
  align: t.align,
738
751
  wrap: t.wrap,
739
752
  width: t.width ?? 100
740
753
  })
741
754
  },
742
- children: /* @__PURE__ */ u(Ie, {
755
+ children: /* @__PURE__ */ u(Le, {
743
756
  url: t.url,
744
757
  autoplay: t.autoplay,
745
758
  muted: t.muted,
@@ -768,17 +781,17 @@ function we(e = [], t, n) {
768
781
  }
769
782
  if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
770
783
  style: {
771
- ...Ee,
784
+ ...De,
772
785
  ...i
773
786
  },
774
787
  children: r(t.parts, t.text)
775
788
  }, n);
776
- if (Se[t.type]) {
789
+ if (Ce[t.type]) {
777
790
  let e = t.type;
778
791
  return /* @__PURE__ */ u(e, {
779
792
  style: {
780
- ...q,
781
- fontSize: Se[t.type],
793
+ ...ue,
794
+ fontSize: Ce[t.type],
782
795
  ...i
783
796
  },
784
797
  children: r(t.parts, t.text)
@@ -786,39 +799,39 @@ function we(e = [], t, n) {
786
799
  }
787
800
  return /* @__PURE__ */ u("p", {
788
801
  style: {
789
- ...ue,
802
+ ...de,
790
803
  ...i
791
804
  },
792
805
  children: r(t.parts, t.text)
793
806
  }, n);
794
807
  });
795
808
  }
796
- function Te({ content: e, style: t, linked: n, nodeRef: r }) {
809
+ function Ee({ content: e, style: t, linked: n, nodeRef: r }) {
797
810
  return /* @__PURE__ */ u("div", {
798
811
  ref: r,
799
812
  style: {
800
813
  display: "flow-root",
801
814
  ...h(t)
802
815
  },
803
- children: we(e, n)
816
+ children: Te(e, n)
804
817
  });
805
818
  }
806
- var Ee = {
819
+ var De = {
807
820
  margin: 0,
808
821
  padding: "8px 0 8px 20px",
809
822
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
810
823
  };
811
- function De({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
824
+ function Oe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
812
825
  return /* @__PURE__ */ u("blockquote", {
813
826
  ref: i,
814
827
  style: {
815
- ...Ee,
828
+ ...De,
816
829
  ...h(n)
817
830
  },
818
831
  children: Y(t, e, r)
819
832
  });
820
833
  }
821
- function Oe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
834
+ function ke({ ordered: e, items: t = [], style: n, nodeRef: r }) {
822
835
  return /* @__PURE__ */ u(e ? "ol" : "ul", {
823
836
  ref: r,
824
837
  style: {
@@ -832,36 +845,36 @@ function Oe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
832
845
  }, t))
833
846
  });
834
847
  }
835
- function ke({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
848
+ function Ae({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
836
849
  return /* @__PURE__ */ u("p", {
837
850
  ref: i,
838
851
  style: {
839
- ...ue,
852
+ ...de,
840
853
  ...h(n)
841
854
  },
842
855
  children: Y(t, e, r)
843
856
  });
844
857
  }
845
- var Ae = {
858
+ var je = {
846
859
  color: "var(--page-accent, inherit)",
847
860
  textDecoration: "underline",
848
861
  textUnderlineOffset: 3,
849
862
  cursor: "pointer"
850
863
  };
851
- function je({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
864
+ function Me({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
852
865
  return /* @__PURE__ */ u("a", {
853
866
  ref: o,
854
867
  href: n || "#",
855
868
  target: r || void 0,
856
869
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
857
870
  style: {
858
- ...Ae,
871
+ ...je,
859
872
  ...h(i)
860
873
  },
861
874
  children: Y(t, e, a)
862
875
  });
863
876
  }
864
- function Me({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
877
+ function Ne({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
865
878
  return /* @__PURE__ */ u("a", {
866
879
  ref: o,
867
880
  href: n || "#",
@@ -874,7 +887,7 @@ function Me({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRe
874
887
  children: Y(t, e, a)
875
888
  });
876
889
  }
877
- function Ne({ src: e, alt: t, style: n, nodeRef: r }) {
890
+ function Pe({ src: e, alt: t, style: n, nodeRef: r }) {
878
891
  return e ? /* @__PURE__ */ u("img", {
879
892
  ref: r,
880
893
  src: e,
@@ -886,7 +899,7 @@ function Ne({ src: e, alt: t, style: n, nodeRef: r }) {
886
899
  }
887
900
  }) : null;
888
901
  }
889
- function Pe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
902
+ function Fe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
890
903
  return e ? /* @__PURE__ */ u("video", {
891
904
  ref: s,
892
905
  src: e,
@@ -904,9 +917,9 @@ function Pe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
904
917
  }
905
918
  }) : null;
906
919
  }
907
- var Fe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
908
- function Ie({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
909
- let c = Fe(e);
920
+ var Ie = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
921
+ function Le({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
922
+ let c = Ie(e);
910
923
  if (!c) return null;
911
924
  let l = new URLSearchParams({ rel: "0" });
912
925
  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", {
@@ -932,7 +945,7 @@ function Ie({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
932
945
  })
933
946
  });
934
947
  }
935
- function Le({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
948
+ function Re({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
936
949
  return e ? /* @__PURE__ */ u("iframe", {
937
950
  ref: i,
938
951
  src: e,
@@ -948,7 +961,7 @@ function Le({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
948
961
  }
949
962
  }) : null;
950
963
  }
951
- function Re({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
964
+ function ze({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
952
965
  let [a, o] = c(null);
953
966
  return i(() => {
954
967
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
@@ -967,7 +980,7 @@ function Re({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
967
980
  style: h(n)
968
981
  });
969
982
  }
970
- function ze({ height: e, nodeRef: t }) {
983
+ function Be({ height: e, nodeRef: t }) {
971
984
  return /* @__PURE__ */ u("div", {
972
985
  ref: t,
973
986
  style: {
@@ -977,7 +990,7 @@ function ze({ height: e, nodeRef: t }) {
977
990
  }
978
991
  });
979
992
  }
980
- function Be({ style: e, nodeRef: t }) {
993
+ function Ve({ style: e, nodeRef: t }) {
981
994
  return /* @__PURE__ */ u("div", {
982
995
  ref: t,
983
996
  style: {
@@ -988,7 +1001,7 @@ function Be({ style: e, nodeRef: t }) {
988
1001
  }
989
1002
  });
990
1003
  }
991
- var Ve = {
1004
+ var He = {
992
1005
  position: "absolute",
993
1006
  top: "50%",
994
1007
  transform: "translateY(-50%)",
@@ -1005,7 +1018,7 @@ var Ve = {
1005
1018
  alignItems: "center",
1006
1019
  justifyContent: "center",
1007
1020
  padding: 0
1008
- }, He = {
1021
+ }, Ue = {
1009
1022
  bottom: {
1010
1023
  inset: "auto 0 0 0",
1011
1024
  padding: "40px 24px 20px",
@@ -1024,8 +1037,8 @@ var Ve = {
1024
1037
  padding: 24,
1025
1038
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1026
1039
  }
1027
- }, Ue = 48;
1028
- function We({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1040
+ }, We = 48;
1041
+ function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1029
1042
  let [p, m] = c(0), [g, _] = c(!1), [v, y] = c(null), b = e ? Math.min(p, e - 1) : 0;
1030
1043
  if (i(() => {
1031
1044
  if (!n || g || v || e < 2) return;
@@ -1041,7 +1054,7 @@ function We({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1041
1054
  let x = (t) => m((t + e) % e), S = () => {
1042
1055
  if (!v) return;
1043
1056
  let { dx: e } = v;
1044
- y(null), e < -48 ? x(b + 1) : e > Ue && x(b - 1);
1057
+ y(null), e < -48 ? x(b + 1) : e > We && x(b - 1);
1045
1058
  };
1046
1059
  return /* @__PURE__ */ d("div", {
1047
1060
  ref: f,
@@ -1089,7 +1102,7 @@ function We({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1089
1102
  type: "button",
1090
1103
  "aria-label": "Previous slide",
1091
1104
  style: {
1092
- ...Ve,
1105
+ ...He,
1093
1106
  left: 12
1094
1107
  },
1095
1108
  onClick: () => x(b - 1),
@@ -1099,7 +1112,7 @@ function We({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1099
1112
  type: "button",
1100
1113
  "aria-label": "Next slide",
1101
1114
  style: {
1102
- ...Ve,
1115
+ ...He,
1103
1116
  right: 12
1104
1117
  },
1105
1118
  onClick: () => x(b + 1),
@@ -1133,7 +1146,7 @@ function We({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1133
1146
  ] })]
1134
1147
  });
1135
1148
  }
1136
- var Ge = (e, t) => ({
1149
+ var Ke = (e, t) => ({
1137
1150
  position: "absolute",
1138
1151
  inset: 0,
1139
1152
  backgroundImage: e ? `url(${e})` : "none",
@@ -1141,18 +1154,18 @@ var Ge = (e, t) => ({
1141
1154
  backgroundSize: "cover",
1142
1155
  backgroundPosition: "center"
1143
1156
  });
1144
- function Ke({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1145
- return e.length ? /* @__PURE__ */ u(We, {
1157
+ function qe({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1158
+ return e.length ? /* @__PURE__ */ u(Ge, {
1146
1159
  ...r,
1147
1160
  count: e.length,
1148
1161
  renderSlide: (r) => {
1149
1162
  let i = e[r];
1150
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ge(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1163
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ke(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1151
1164
  style: {
1152
1165
  position: "absolute",
1153
1166
  color: "#fff",
1154
1167
  textAlign: n,
1155
- ...He[t] ?? He.bottom
1168
+ ...Ue[t] ?? Ue.bottom
1156
1169
  },
1157
1170
  children: [i.title && /* @__PURE__ */ u("div", {
1158
1171
  style: {
@@ -1172,13 +1185,13 @@ function Ke({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1172
1185
  }
1173
1186
  }) : null;
1174
1187
  }
1175
- function qe({ slides: e = [], linked: t, ...n }) {
1176
- return e.length ? /* @__PURE__ */ u(We, {
1188
+ function Je({ slides: e = [], linked: t, ...n }) {
1189
+ return e.length ? /* @__PURE__ */ u(Ge, {
1177
1190
  ...n,
1178
1191
  count: e.length,
1179
1192
  renderSlide: (n) => {
1180
1193
  let r = e[n];
1181
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ge(r.image, r.color) }), /* @__PURE__ */ u("div", {
1194
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ke(r.image, r.color) }), /* @__PURE__ */ u("div", {
1182
1195
  style: {
1183
1196
  position: "absolute",
1184
1197
  inset: 0,
@@ -1190,29 +1203,29 @@ function qe({ slides: e = [], linked: t, ...n }) {
1190
1203
  }
1191
1204
  }) : null;
1192
1205
  }
1193
- var Je = {
1206
+ var Ye = {
1194
1207
  color: "inherit",
1195
1208
  textDecoration: "none",
1196
1209
  fontSize: 14,
1197
1210
  opacity: .85
1198
- }, Ye = {
1211
+ }, Xe = {
1199
1212
  background: "var(--page-bg, #ffffff)",
1200
1213
  color: "var(--page-text, #111827)",
1201
1214
  border: "1px solid rgba(148, 163, 184, 0.25)",
1202
1215
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1203
1216
  zIndex: 60
1204
1217
  };
1205
- function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s = "auto", breakpoint: l = 768 }) {
1206
- let [f, p] = c(null), [m, g] = c(!1), [_, v] = c(!1), [y, b] = c(null);
1218
+ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], style: s, nodeRef: f, menu: p = "auto", breakpoint: m = 768 }) {
1219
+ let [g, _] = c(null), [v, y] = c(!1), [b, x] = c(!1), [S, C] = c(null);
1207
1220
  i(() => {
1208
- if (!f) return;
1209
- let e = new ResizeObserver(() => g(f.offsetWidth < l));
1210
- return e.observe(f), () => e.disconnect();
1211
- }, [f, l]);
1212
- let x = s === "hamburger" || s === "auto" && m, S = (e, t) => /* @__PURE__ */ d("a", {
1221
+ if (!g) return;
1222
+ let e = new ResizeObserver(() => y(g.offsetWidth < m));
1223
+ return e.observe(g), () => e.disconnect();
1224
+ }, [g, m]);
1225
+ let w = p === "hamburger" || p === "auto" && v, T = (e, t) => /* @__PURE__ */ d("a", {
1213
1226
  href: e.href || "#",
1214
1227
  style: {
1215
- ...Je,
1228
+ ...Ye,
1216
1229
  display: "block",
1217
1230
  ...t
1218
1231
  },
@@ -1228,7 +1241,7 @@ function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s =
1228
1241
  }, e.key);
1229
1242
  return /* @__PURE__ */ d("nav", {
1230
1243
  ref: (e) => {
1231
- p(e), o && o(e);
1244
+ _(e), f && f(e);
1232
1245
  },
1233
1246
  style: {
1234
1247
  display: "flex",
@@ -1238,30 +1251,47 @@ function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s =
1238
1251
  padding: "14px 24px",
1239
1252
  width: "100%",
1240
1253
  position: "relative",
1241
- ...h(a)
1254
+ ...h(s)
1242
1255
  },
1243
1256
  children: [
1244
- n && /* @__PURE__ */ u("img", {
1245
- src: n,
1246
- alt: t || "Logo",
1247
- style: {
1248
- height: 28,
1249
- display: "block"
1250
- }
1251
- }),
1252
- t && /* @__PURE__ */ u("div", {
1253
- style: {
1254
- fontWeight: 700,
1255
- fontSize: 18,
1256
- fontFamily: "var(--page-heading-font, inherit)"
1257
- },
1258
- children: t
1259
- }),
1257
+ (n || t) && (() => {
1258
+ let e = /* @__PURE__ */ d(l, { children: [n && /* @__PURE__ */ u("img", {
1259
+ src: n,
1260
+ alt: t || "Logo",
1261
+ style: {
1262
+ height: 28,
1263
+ display: "block"
1264
+ }
1265
+ }), t && /* @__PURE__ */ u("span", {
1266
+ style: {
1267
+ fontWeight: 700,
1268
+ fontSize: 18,
1269
+ fontFamily: "var(--page-heading-font, inherit)"
1270
+ },
1271
+ children: t
1272
+ })] }), i = {
1273
+ display: "flex",
1274
+ alignItems: "center",
1275
+ gap: 10,
1276
+ color: "inherit",
1277
+ textDecoration: "none"
1278
+ };
1279
+ return r ? /* @__PURE__ */ u("a", {
1280
+ href: r,
1281
+ target: a || void 0,
1282
+ rel: a === "_blank" ? "noopener noreferrer" : void 0,
1283
+ style: i,
1284
+ children: e
1285
+ }) : /* @__PURE__ */ u("div", {
1286
+ style: i,
1287
+ children: e
1288
+ });
1289
+ })(),
1260
1290
  /* @__PURE__ */ u("div", { style: { flexGrow: 1 } }),
1261
- x ? /* @__PURE__ */ u("button", {
1291
+ w ? /* @__PURE__ */ u("button", {
1262
1292
  type: "button",
1263
- "aria-label": _ ? "Close menu" : "Open menu",
1264
- onClick: () => v(!_),
1293
+ "aria-label": b ? "Close menu" : "Open menu",
1294
+ onClick: () => x(!b),
1265
1295
  style: {
1266
1296
  background: "transparent",
1267
1297
  border: 0,
@@ -1271,7 +1301,7 @@ function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s =
1271
1301
  lineHeight: 1,
1272
1302
  padding: 4
1273
1303
  },
1274
- children: _ ? "✕" : "☰"
1304
+ children: b ? "✕" : "☰"
1275
1305
  }) : /* @__PURE__ */ u("div", {
1276
1306
  style: {
1277
1307
  display: "flex",
@@ -1279,11 +1309,11 @@ function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s =
1279
1309
  alignItems: "center",
1280
1310
  flexWrap: "wrap"
1281
1311
  },
1282
- children: r.map((e) => {
1312
+ children: o.map((e) => {
1283
1313
  let t = e.children ?? [];
1284
1314
  if (!t.length) return /* @__PURE__ */ u("a", {
1285
1315
  href: e.href || "#",
1286
- style: Je,
1316
+ style: Ye,
1287
1317
  children: e.label
1288
1318
  }, e.key);
1289
1319
  let n = e.type === "mega";
@@ -1292,12 +1322,12 @@ function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s =
1292
1322
  position: n ? "static" : "relative",
1293
1323
  display: "inline-flex"
1294
1324
  },
1295
- onMouseEnter: () => b(e.key),
1296
- onMouseLeave: () => b(null),
1325
+ onMouseEnter: () => C(e.key),
1326
+ onMouseLeave: () => C(null),
1297
1327
  children: [/* @__PURE__ */ d("a", {
1298
1328
  href: e.href || "#",
1299
1329
  style: {
1300
- ...Je,
1330
+ ...Ye,
1301
1331
  cursor: "pointer"
1302
1332
  },
1303
1333
  children: [
@@ -1311,9 +1341,9 @@ function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s =
1311
1341
  children: "▼"
1312
1342
  })
1313
1343
  ]
1314
- }), y === e.key && (n ? /* @__PURE__ */ u("div", {
1344
+ }), S === e.key && (n ? /* @__PURE__ */ u("div", {
1315
1345
  style: {
1316
- ...Ye,
1346
+ ...Xe,
1317
1347
  position: "absolute",
1318
1348
  left: 0,
1319
1349
  right: 0,
@@ -1323,13 +1353,13 @@ function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s =
1323
1353
  gridTemplateColumns: "repeat(auto-fit, minmax(170px, 1fr))",
1324
1354
  gap: 16
1325
1355
  },
1326
- children: t.map((e) => S(e, {
1356
+ children: t.map((e) => T(e, {
1327
1357
  padding: "6px 8px",
1328
1358
  borderRadius: 6
1329
1359
  }))
1330
1360
  }) : /* @__PURE__ */ u("div", {
1331
1361
  style: {
1332
- ...Ye,
1362
+ ...Xe,
1333
1363
  position: "absolute",
1334
1364
  top: "100%",
1335
1365
  left: 0,
@@ -1339,7 +1369,7 @@ function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s =
1339
1369
  display: "flex",
1340
1370
  flexDirection: "column"
1341
1371
  },
1342
- children: t.map((e) => S(e, {
1372
+ children: t.map((e) => T(e, {
1343
1373
  padding: "8px 12px",
1344
1374
  borderRadius: 6
1345
1375
  }))
@@ -1347,7 +1377,7 @@ function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s =
1347
1377
  }, e.key);
1348
1378
  })
1349
1379
  }),
1350
- x && _ && /* @__PURE__ */ u("div", {
1380
+ w && b && /* @__PURE__ */ u("div", {
1351
1381
  style: {
1352
1382
  flexBasis: "100%",
1353
1383
  width: "100%",
@@ -1355,21 +1385,21 @@ function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s =
1355
1385
  flexDirection: "column",
1356
1386
  paddingTop: 10
1357
1387
  },
1358
- children: r.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
1388
+ children: o.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
1359
1389
  href: t.href || "#",
1360
1390
  style: {
1361
- ...Je,
1391
+ ...Ye,
1362
1392
  padding: "10px 4px",
1363
1393
  fontWeight: (t.children ?? []).length ? 600 : 400,
1364
1394
  opacity: 1
1365
1395
  },
1366
1396
  children: t.label
1367
- }), (t.children ?? []).map((e) => S(e, { padding: "8px 4px 8px 22px" }))] }, t.key))
1397
+ }), (t.children ?? []).map((e) => T(e, { padding: "8px 4px 8px 22px" }))] }, t.key))
1368
1398
  })
1369
1399
  ]
1370
1400
  });
1371
1401
  }
1372
- function Ze({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1402
+ function Qe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1373
1403
  let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1374
1404
  return e.length ? /* @__PURE__ */ d("div", {
1375
1405
  ref: r,
@@ -1409,7 +1439,7 @@ function Ze({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1409
1439
  }, e.key))]
1410
1440
  }) : null;
1411
1441
  }
1412
- function Qe({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1442
+ function $e({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1413
1443
  let [a, o] = c(() => new Set(e.length ? [e[0].key] : []));
1414
1444
  if (!e.length) return null;
1415
1445
  let s = (e) => o((t) => {
@@ -1466,7 +1496,7 @@ function Qe({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1466
1496
  })
1467
1497
  });
1468
1498
  }
1469
- var $e = {
1499
+ var et = {
1470
1500
  display: "flex",
1471
1501
  flexDirection: "column",
1472
1502
  gap: "12px"
@@ -1484,7 +1514,7 @@ var $e = {
1484
1514
  boxSizing: "border-box",
1485
1515
  backgroundColor: "#ffffff",
1486
1516
  color: "#111827"
1487
- }, et = {
1517
+ }, tt = {
1488
1518
  display: "flex",
1489
1519
  alignItems: "center",
1490
1520
  gap: "8px",
@@ -1495,7 +1525,7 @@ var $e = {
1495
1525
  tabIndex: -1,
1496
1526
  onMouseDown: (e) => e.preventDefault()
1497
1527
  } : {};
1498
- function tt(e, t) {
1528
+ function nt(e, t) {
1499
1529
  if (!e) return !0;
1500
1530
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1501
1531
  switch (e.op) {
@@ -1509,11 +1539,11 @@ function tt(e, t) {
1509
1539
  default: return !1;
1510
1540
  }
1511
1541
  }
1512
- var nt = {
1542
+ var rt = {
1513
1543
  display: "flex",
1514
1544
  flexDirection: "column",
1515
1545
  gap: 6
1516
- }, rt = {
1546
+ }, it = {
1517
1547
  font: "inherit",
1518
1548
  fontSize: 15,
1519
1549
  padding: "10px 12px",
@@ -1524,13 +1554,13 @@ var nt = {
1524
1554
  width: "100%",
1525
1555
  boxSizing: "border-box"
1526
1556
  };
1527
- function it(e, t) {
1557
+ function at(e, t) {
1528
1558
  let n = Array.isArray(e?.options) ? e.options : [];
1529
1559
  if (!e?.parentField) return n;
1530
1560
  let r = t?.[e.parentField];
1531
1561
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
1532
1562
  }
1533
- function at({ field: e, value: t, onChange: n, inert: r, values: i }) {
1563
+ function ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
1534
1564
  let a = /* @__PURE__ */ d("span", {
1535
1565
  style: {
1536
1566
  ...X,
@@ -1542,7 +1572,7 @@ function at({ field: e, value: t, onChange: n, inert: r, values: i }) {
1542
1572
  required: e.required || void 0,
1543
1573
  placeholder: e.placeholder || void 0,
1544
1574
  disabled: r || void 0,
1545
- style: rt,
1575
+ style: it,
1546
1576
  value: t ?? "",
1547
1577
  onChange: (t) => n(e.name, t.target.value)
1548
1578
  };
@@ -1571,7 +1601,7 @@ function at({ field: e, value: t, onChange: n, inert: r, values: i }) {
1571
1601
  borderRadius: 8,
1572
1602
  display: "block"
1573
1603
  }
1574
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Ie, {
1604
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Le, {
1575
1605
  url: e.src,
1576
1606
  style: { width: "100%" }
1577
1607
  }) : /* @__PURE__ */ u("video", {
@@ -1583,14 +1613,14 @@ function at({ field: e, value: t, onChange: n, inert: r, values: i }) {
1583
1613
  display: "block"
1584
1614
  }
1585
1615
  }) : null : /* @__PURE__ */ d("label", {
1586
- style: nt,
1616
+ style: rt,
1587
1617
  children: [
1588
1618
  a,
1589
1619
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
1590
1620
  ...o,
1591
1621
  rows: 4,
1592
1622
  style: {
1593
- ...rt,
1623
+ ...it,
1594
1624
  resize: "vertical"
1595
1625
  }
1596
1626
  }) : e.type === "select" ? /* @__PURE__ */ d("select", {
@@ -1599,7 +1629,7 @@ function at({ field: e, value: t, onChange: n, inert: r, values: i }) {
1599
1629
  children: [/* @__PURE__ */ u("option", {
1600
1630
  value: "",
1601
1631
  children: e.placeholder || "—"
1602
- }), it(e, i).map((e, t) => /* @__PURE__ */ u("option", {
1632
+ }), at(e, i).map((e, t) => /* @__PURE__ */ u("option", {
1603
1633
  value: typeof e == "string" ? e : e.value,
1604
1634
  children: typeof e == "string" ? e : e.label ?? e.value
1605
1635
  }, t))]
@@ -1646,8 +1676,8 @@ function at({ field: e, value: t, onChange: n, inert: r, values: i }) {
1646
1676
  ]
1647
1677
  });
1648
1678
  }
1649
- function ot({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: g, children: _, linked: v, show: y }) {
1650
- let { tenant: b, apiUrl: x } = r(H), [S, C] = c("form"), [w, T] = c(null), [E, D] = c({}), [O, k] = c(0), A = g ? y || "form" : S;
1679
+ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: g, children: _, linked: v, show: y }) {
1680
+ let { tenant: b, apiUrl: x } = r(V), [S, C] = c("form"), [w, T] = c(null), [E, D] = c({}), [O, k] = c(0), A = g ? y || "form" : S;
1651
1681
  i(() => {
1652
1682
  if (!f || !s) return;
1653
1683
  let e = !0;
@@ -1668,13 +1698,13 @@ function ot({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1668
1698
  section: e,
1669
1699
  fields: []
1670
1700
  }) : j[j.length - 1].fields.push(e);
1671
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || tt(e.section.condition, E)).map((e) => ({
1701
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || nt(e.section.condition, E)).map((e) => ({
1672
1702
  ...e,
1673
- fields: e.fields.filter((e) => tt(e.condition, E))
1674
- })), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
1703
+ fields: e.fields.filter((e) => nt(e.condition, E))
1704
+ })), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), ee = I.filter((e) => {
1675
1705
  let t = E[e.name];
1676
1706
  return e.required && (t == null || t === "" || t === !1);
1677
- }), R = F >= N.length - 1, ee = (e, t) => D((n) => {
1707
+ }), L = F >= N.length - 1, te = (e, t) => D((n) => {
1678
1708
  let r = {
1679
1709
  ...n,
1680
1710
  [e]: t
@@ -1728,11 +1758,11 @@ function ot({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1728
1758
  }
1729
1759
  },
1730
1760
  style: {
1731
- ...$e,
1761
+ ...et,
1732
1762
  display: A === "success" ? "none" : "flex"
1733
1763
  },
1734
1764
  children: f && s ? /* @__PURE__ */ d(l, { children: [
1735
- P && /* @__PURE__ */ u(vt, {
1765
+ P && /* @__PURE__ */ u(St, {
1736
1766
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1737
1767
  active: F + 1,
1738
1768
  style: { marginBottom: 8 }
@@ -1745,11 +1775,11 @@ function ot({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1745
1775
  },
1746
1776
  children: N[F].section.help
1747
1777
  }),
1748
- I.map((e) => /* @__PURE__ */ u(at, {
1778
+ I.map((e) => /* @__PURE__ */ u(ot, {
1749
1779
  field: e,
1750
1780
  value: E[e.name],
1751
1781
  values: E,
1752
- onChange: ee,
1782
+ onChange: te,
1753
1783
  inert: g
1754
1784
  }, e.name)),
1755
1785
  /* @__PURE__ */ d("div", {
@@ -1772,9 +1802,9 @@ function ot({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1772
1802
  cursor: "pointer"
1773
1803
  },
1774
1804
  children: "Back"
1775
- }), P && !R ? /* @__PURE__ */ u("button", {
1805
+ }), P && !L ? /* @__PURE__ */ u("button", {
1776
1806
  type: "button",
1777
- disabled: g || L.length > 0,
1807
+ disabled: g || ee.length > 0,
1778
1808
  onClick: () => k(F + 1),
1779
1809
  style: {
1780
1810
  ...J,
@@ -1784,7 +1814,7 @@ function ot({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1784
1814
  fontSize: 15,
1785
1815
  fontWeight: 600,
1786
1816
  cursor: "pointer",
1787
- opacity: L.length ? .5 : 1
1817
+ opacity: ee.length ? .5 : 1
1788
1818
  },
1789
1819
  children: "Next"
1790
1820
  }) : /* @__PURE__ */ u("button", {
@@ -1818,7 +1848,97 @@ function ot({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1818
1848
  ]
1819
1849
  });
1820
1850
  }
1821
- function st({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1851
+ var ct = null, lt = () => ct || (ct = new Promise((e) => {
1852
+ if (typeof window > "u") return;
1853
+ if (window.grecaptcha?.render) return e(window.grecaptcha);
1854
+ window.__webimRecaptchaReady = () => e(window.grecaptcha);
1855
+ let t = document.createElement("script");
1856
+ t.src = "https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit", t.async = !0, document.head.appendChild(t);
1857
+ }), ct);
1858
+ function ut({ siteKey: e, theme: t, size: n, style: a, nodeRef: o, inert: c }) {
1859
+ let l = r(V), f = l?.settings && typeof l.settings == "object" ? l.settings["google.recaptchaKey"] : "", p = typeof e == "string" && e.trim() || (typeof f == "string" ? f.trim() : ""), m = s(null), g = s(!1);
1860
+ if (i(() => {
1861
+ if (c || !p || g.current || !m.current) return;
1862
+ let e = !0;
1863
+ return lt().then((r) => {
1864
+ if (!(!e || g.current || !m.current || !r?.render)) {
1865
+ g.current = !0;
1866
+ try {
1867
+ r.render(m.current, {
1868
+ sitekey: p,
1869
+ theme: t === "dark" ? "dark" : "light",
1870
+ size: n === "compact" ? "compact" : "normal"
1871
+ });
1872
+ } catch {}
1873
+ }
1874
+ }), () => {
1875
+ e = !1;
1876
+ };
1877
+ }, [
1878
+ c,
1879
+ p,
1880
+ t,
1881
+ n
1882
+ ]), c) {
1883
+ let e = t === "dark";
1884
+ return /* @__PURE__ */ d("div", {
1885
+ ref: o,
1886
+ style: h(a),
1887
+ children: [/* @__PURE__ */ d("div", {
1888
+ style: {
1889
+ width: n === "compact" ? 164 : 302,
1890
+ boxSizing: "border-box",
1891
+ padding: "12px 14px",
1892
+ display: "flex",
1893
+ alignItems: "center",
1894
+ gap: 12,
1895
+ borderRadius: 4,
1896
+ border: `1px solid ${e ? "#52565b" : "#d3d3d3"}`,
1897
+ background: e ? "#222528" : "#f9f9f9",
1898
+ color: e ? "#f1f1f1" : "#282828",
1899
+ fontSize: 14,
1900
+ fontFamily: "Roboto, Arial, sans-serif"
1901
+ },
1902
+ children: [
1903
+ /* @__PURE__ */ u("span", { style: {
1904
+ width: 24,
1905
+ height: 24,
1906
+ flexShrink: 0,
1907
+ borderRadius: 3,
1908
+ border: `2px solid ${e ? "#8a8f94" : "#c1c1c1"}`,
1909
+ background: e ? "#2f3337" : "#fff"
1910
+ } }),
1911
+ /* @__PURE__ */ u("span", {
1912
+ style: { flexGrow: 1 },
1913
+ children: "I'm not a robot"
1914
+ }),
1915
+ /* @__PURE__ */ u("span", {
1916
+ style: {
1917
+ fontSize: 9,
1918
+ opacity: .6,
1919
+ textAlign: "center",
1920
+ lineHeight: 1.3
1921
+ },
1922
+ children: "reCAPTCHA"
1923
+ })
1924
+ ]
1925
+ }), !p && /* @__PURE__ */ u("div", {
1926
+ style: {
1927
+ marginTop: 6,
1928
+ fontSize: 11,
1929
+ color: "#b45309"
1930
+ },
1931
+ children: "Set the google.recaptchaKey tenant setting (or a site key in Settings) to activate it."
1932
+ })]
1933
+ });
1934
+ }
1935
+ return p ? /* @__PURE__ */ u("div", {
1936
+ ref: o,
1937
+ style: h(a),
1938
+ children: /* @__PURE__ */ u("div", { ref: m })
1939
+ }) : null;
1940
+ }
1941
+ function dt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1822
1942
  return /* @__PURE__ */ u("label", {
1823
1943
  ref: r,
1824
1944
  style: {
@@ -1828,7 +1948,7 @@ function st({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1828
1948
  children: Y(t, e, i)
1829
1949
  });
1830
1950
  }
1831
- function ct({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1951
+ function ft({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1832
1952
  return /* @__PURE__ */ u("input", {
1833
1953
  ref: a,
1834
1954
  type: e,
@@ -1842,7 +1962,7 @@ function ct({ type: e = "text", name: t, placeholder: n, required: r, style: i,
1842
1962
  ...Q(o)
1843
1963
  });
1844
1964
  }
1845
- function lt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1965
+ function pt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1846
1966
  return /* @__PURE__ */ u("textarea", {
1847
1967
  ref: a,
1848
1968
  name: e || void 0,
@@ -1857,11 +1977,11 @@ function lt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
1857
1977
  ...Q(o)
1858
1978
  });
1859
1979
  }
1860
- function ut({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1980
+ function mt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1861
1981
  return /* @__PURE__ */ d("label", {
1862
1982
  ref: o,
1863
1983
  style: {
1864
- ...et,
1984
+ ...tt,
1865
1985
  ...h(a)
1866
1986
  },
1867
1987
  children: [/* @__PURE__ */ u("input", {
@@ -1878,7 +1998,7 @@ function ut({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1878
1998
  }), t]
1879
1999
  });
1880
2000
  }
1881
- function dt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2001
+ function ht({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1882
2002
  return /* @__PURE__ */ d("select", {
1883
2003
  ref: a,
1884
2004
  name: e || void 0,
@@ -1901,7 +2021,7 @@ function dt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1901
2021
  }, t))]
1902
2022
  });
1903
2023
  }
1904
- function ft({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2024
+ function gt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
1905
2025
  let [s, l] = c(null);
1906
2026
  return /* @__PURE__ */ d("label", {
1907
2027
  ref: a,
@@ -1933,7 +2053,7 @@ function ft({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
1933
2053
  ]
1934
2054
  });
1935
2055
  }
1936
- function pt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2056
+ function _t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1937
2057
  return /* @__PURE__ */ u("button", {
1938
2058
  ref: n,
1939
2059
  type: r ? "button" : "submit",
@@ -1953,7 +2073,7 @@ function pt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1953
2073
  children: e
1954
2074
  });
1955
2075
  }
1956
- function mt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2076
+ function vt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1957
2077
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1958
2078
  return /* @__PURE__ */ u("div", {
1959
2079
  ref: r,
@@ -1970,53 +2090,61 @@ function mt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1970
2090
  }, t))
1971
2091
  });
1972
2092
  }
1973
- function ht({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, style: m, nodeRef: g }) {
1974
- let { tenant: _, apiUrl: v, locale: y } = r(H), b = r(W), x = r(U)?.[e], [S, C] = c(null);
2093
+ function yt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, style: g, nodeRef: _ }) {
2094
+ let { tenant: v, apiUrl: y, locale: b } = r(V), x = r(W), S = r(H), C = S?.[e], w = m ? U(S) : 1, [T, E] = c(null);
1975
2095
  if (i(() => {
1976
- if (!e || x) return;
1977
- let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}${y ? `?locale=${encodeURIComponent(y)}` : ""}`;
1978
- return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => {
1979
- let n = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
1980
- return t && C(n.filter((e) => e && typeof e == "object"));
1981
- }).catch(() => t && C([])), () => {
1982
- t = !1;
2096
+ if (!e || C) return;
2097
+ let n = !0, r = new URLSearchParams();
2098
+ if (b && r.set("locale", b), m && !e.startsWith("api:")) {
2099
+ let e = Math.max(1, Number(t) || 6);
2100
+ r.set("offset", String((w - 1) * e)), r.set("limit", String(e));
2101
+ }
2102
+ let i = r.toString(), a = e.startsWith("api:") ? `${y}/data/${encodeURIComponent(e.slice(4))}` : `${y}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
2103
+ return fetch(a, { headers: v ? { "x-tenant": v } : {} }).then((e) => e.json()).then((e) => {
2104
+ let t = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
2105
+ return n && E(t.filter((e) => e && typeof e == "object"));
2106
+ }).catch(() => n && E([])), () => {
2107
+ n = !1;
1983
2108
  };
1984
2109
  }, [
1985
2110
  e,
1986
- _,
1987
2111
  v,
1988
2112
  y,
1989
- x
2113
+ b,
2114
+ C,
2115
+ m,
2116
+ w,
2117
+ t
1990
2118
  ]), !e) return null;
1991
- let w = (x ?? S ?? []).slice(0, Math.max(1, Number(t) || 6)), T = Math.min(Math.max(Number(a) || 3, 1), 6), E = n === "list" ? {
2119
+ let D = Math.max(1, Number(t) || 6), O = m ? C || e.startsWith("api:") ? (C ?? T ?? []).slice((w - 1) * D, w * D) : (T ?? []).slice(0, D) : (C ?? T ?? []).slice(0, D), k = Math.min(Math.max(Number(a) || 3, 1), 6), A = n === "list" ? {
1992
2120
  display: "flex",
1993
2121
  flexDirection: "column",
1994
2122
  gap: 20
1995
2123
  } : {
1996
2124
  display: "grid",
1997
- gridTemplateColumns: `repeat(${T}, minmax(0, 1fr))`,
2125
+ gridTemplateColumns: `repeat(${k}, minmax(0, 1fr))`,
1998
2126
  gap: 24
1999
2127
  };
2000
- return f && p && b?.render ? /* @__PURE__ */ u("div", {
2001
- ref: g,
2128
+ return f && p && x?.render ? /* @__PURE__ */ u("div", {
2129
+ ref: _,
2002
2130
  style: {
2003
2131
  width: "100%",
2004
- ...E,
2005
- ...h(m)
2132
+ ...A,
2133
+ ...h(g)
2006
2134
  },
2007
- children: w.map((e) => /* @__PURE__ */ u("div", {
2135
+ children: O.map((e) => /* @__PURE__ */ u("div", {
2008
2136
  style: { minWidth: 0 },
2009
- children: b.render(p, (t) => le(t, e))
2137
+ children: x.render(p, (t) => le(t, e))
2010
2138
  }, e.id ?? e?.data?.slug))
2011
2139
  }) : /* @__PURE__ */ u("div", {
2012
- ref: g,
2140
+ ref: _,
2013
2141
  style: {
2014
2142
  width: "100%",
2015
- ...E,
2016
- ...h(m)
2143
+ ...A,
2144
+ ...h(g)
2017
2145
  },
2018
- children: w.map((e) => {
2019
- let t = o ? G(e?.data, o) : null, r = s ? K(G(e?.data, s)) : null, i = l ? G(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : K(i), f = n === "list";
2146
+ children: O.map((e) => {
2147
+ let t = o ? K(e?.data, o) : null, r = s ? q(K(e?.data, s)) : null, i = l ? K(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : q(i), f = n === "list";
2020
2148
  return /* @__PURE__ */ d("div", {
2021
2149
  style: {
2022
2150
  display: "flex",
@@ -2063,7 +2191,7 @@ function ht({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2063
2191
  lineHeight: 1.55,
2064
2192
  opacity: .85
2065
2193
  },
2066
- children: we(a)
2194
+ children: Te(a)
2067
2195
  })
2068
2196
  ]
2069
2197
  })]
@@ -2071,7 +2199,7 @@ function ht({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2071
2199
  })
2072
2200
  });
2073
2201
  }
2074
- function gt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2202
+ function bt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2075
2203
  return e.length ? /* @__PURE__ */ u("nav", {
2076
2204
  ref: r,
2077
2205
  "aria-label": "Breadcrumb",
@@ -2121,8 +2249,36 @@ function gt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2121
2249
  })
2122
2250
  }) : null;
2123
2251
  }
2124
- function _t({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2125
- let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), c = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", l = (e) => ({
2252
+ function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, style: f, nodeRef: p }) {
2253
+ let { tenant: m, apiUrl: g } = r(V), _ = r(H), [v, y] = c(null), b = o ? Number(_?.[`${o}:total`]) : NaN;
2254
+ i(() => {
2255
+ if (!o || Number.isFinite(b)) return;
2256
+ let e = !0, t = o.startsWith("api:") ? `${g}/data/${encodeURIComponent(o.slice(4))}` : `${g}/dynamic/${encodeURIComponent(o)}?limit=1`;
2257
+ return fetch(t, { headers: m ? { "x-tenant": m } : {} }).then((e) => e.json()).then((t) => {
2258
+ if (!e) return;
2259
+ let n = t?.payload, r = Array.isArray(n) ? n.length : Number(n?.total?.filtered ?? n?.total?.all ?? (Array.isArray(n?.data) ? n.data.length : 0));
2260
+ y(Number.isFinite(r) ? r : 0);
2261
+ }).catch(() => e && y(0)), () => {
2262
+ e = !1;
2263
+ };
2264
+ }, [
2265
+ o,
2266
+ m,
2267
+ g,
2268
+ b
2269
+ ]);
2270
+ let x = Math.max(1, Number(s) || 6), S = Number.isFinite(b) ? b : v;
2271
+ if (o && S === null) return null;
2272
+ let C = Math.min(Math.max(o ? Math.ceil(S / x) : Number(e) || 1, 1), 50), w = Math.min(Math.max(o ? U(_) : Number(t) || 1, 1), C), T = (e) => {
2273
+ if (o) {
2274
+ if (typeof window < "u") {
2275
+ let t = new URLSearchParams(window.location.search);
2276
+ return t.set("page", String(e)), `?${t.toString()}`;
2277
+ }
2278
+ return `?page=${e}`;
2279
+ }
2280
+ return a && a !== "#" ? a.replace("{page}", String(e)) : "#";
2281
+ }, E = l === "center" ? "center" : l === "right" ? "flex-end" : "flex-start", D = (e) => ({
2126
2282
  display: "inline-flex",
2127
2283
  alignItems: "center",
2128
2284
  justifyContent: "center",
@@ -2137,44 +2293,45 @@ function _t({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2137
2293
  border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
2138
2294
  });
2139
2295
  return /* @__PURE__ */ d("nav", {
2140
- ref: a,
2296
+ ref: p,
2141
2297
  "aria-label": "Pagination",
2142
2298
  style: {
2143
2299
  display: "flex",
2144
2300
  flexWrap: "wrap",
2145
2301
  gap: 8,
2146
2302
  alignItems: "center",
2147
- ...h(i)
2303
+ justifyContent: E,
2304
+ ...h(f)
2148
2305
  },
2149
2306
  children: [
2150
2307
  n && /* @__PURE__ */ u("a", {
2151
- href: s > 1 ? c(s - 1) : "#",
2308
+ href: w > 1 ? T(w - 1) : "#",
2152
2309
  "aria-label": "Previous",
2153
2310
  style: {
2154
- ...l(!1),
2155
- opacity: s > 1 ? 1 : .4
2311
+ ...D(!1),
2312
+ opacity: w > 1 ? 1 : .4
2156
2313
  },
2157
2314
  children: "‹"
2158
2315
  }),
2159
- Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
2160
- href: c(e),
2161
- "aria-current": e === s ? "page" : void 0,
2162
- style: l(e === s),
2316
+ Array.from({ length: C }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
2317
+ href: T(e),
2318
+ "aria-current": e === w ? "page" : void 0,
2319
+ style: D(e === w),
2163
2320
  children: e
2164
2321
  }, e)),
2165
2322
  n && /* @__PURE__ */ u("a", {
2166
- href: s < o ? c(s + 1) : "#",
2323
+ href: w < C ? T(w + 1) : "#",
2167
2324
  "aria-label": "Next",
2168
2325
  style: {
2169
- ...l(!1),
2170
- opacity: s < o ? 1 : .4
2326
+ ...D(!1),
2327
+ opacity: w < C ? 1 : .4
2171
2328
  },
2172
2329
  children: "›"
2173
2330
  })
2174
2331
  ]
2175
2332
  });
2176
2333
  }
2177
- function vt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2334
+ function St({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2178
2335
  if (!t.length) return null;
2179
2336
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
2180
2337
  width: 32,
@@ -2252,7 +2409,7 @@ function vt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2252
2409
  })
2253
2410
  });
2254
2411
  }
2255
- var yt = {
2412
+ var Ct = {
2256
2413
  small: {
2257
2414
  w: 132,
2258
2415
  h: 46,
@@ -2274,10 +2431,10 @@ var yt = {
2274
2431
  title: 12.5,
2275
2432
  avatar: 46
2276
2433
  }
2277
- }, bt = (e) => yt[e] ?? yt.medium;
2278
- yt.medium.w, yt.medium.h;
2279
- function xt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2280
- let r = bt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
2434
+ }, wt = (e) => Ct[e] ?? Ct.medium;
2435
+ Ct.medium.w, Ct.medium.h;
2436
+ function Tt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2437
+ let r = wt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
2281
2438
  for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
2282
2439
  let d = /* @__PURE__ */ new Map(), f = (e, t) => {
2283
2440
  if (t.has(e.id)) return 0;
@@ -2329,19 +2486,19 @@ function xt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2329
2486
  horizontal: n
2330
2487
  };
2331
2488
  }
2332
- var St = (e, t) => {
2489
+ var Et = (e, t) => {
2333
2490
  let n = String(e ?? "");
2334
2491
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
2335
- }, Ct = (e) => {
2492
+ }, Dt = (e) => {
2336
2493
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
2337
2494
  if (!t) return "#ffffff";
2338
2495
  let n = t[1];
2339
2496
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
2340
2497
  let r = parseInt(n, 16);
2341
2498
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
2342
- }, wt = (e) => !!(e?.cv?.trim?.() || e?.photo);
2343
- function Tt(e, t = {}) {
2344
- let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : K(e);
2499
+ }, Ot = (e) => !!(e?.cv?.trim?.() || e?.photo);
2500
+ function kt(e, t = {}) {
2501
+ 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 ? "" : q(e);
2345
2502
  return n.map((e) => {
2346
2503
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
2347
2504
  return {
@@ -2355,11 +2512,11 @@ function Tt(e, t = {}) {
2355
2512
  };
2356
2513
  });
2357
2514
  }
2358
- var Et = {
2515
+ var At = {
2359
2516
  size: 36,
2360
2517
  pad: 10
2361
2518
  };
2362
- function Dt({ node: e, onClose: t }) {
2519
+ function jt({ node: e, onClose: t }) {
2363
2520
  return i(() => {
2364
2521
  let e = (e) => e.key === "Escape" && t();
2365
2522
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -2477,8 +2634,8 @@ function Dt({ node: e, onClose: t }) {
2477
2634
  })
2478
2635
  });
2479
2636
  }
2480
- function Ot({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
2481
- let x = a(), [S, C] = c(null), { tenant: w, apiUrl: T } = r(H), E = r(U)?.[t], [D, O] = c(null);
2637
+ function Mt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
2638
+ let x = a(), [S, C] = c(null), { tenant: w, apiUrl: T } = r(V), E = r(H)?.[t], [D, O] = c(null);
2482
2639
  i(() => {
2483
2640
  if (!t || E) return;
2484
2641
  let e = !0;
@@ -2494,14 +2651,14 @@ function Ot({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2494
2651
  T,
2495
2652
  E
2496
2653
  ]);
2497
- let k = t ? Tt(E ?? D ?? [], {
2654
+ let k = t ? kt(E ?? D ?? [], {
2498
2655
  nameField: n,
2499
2656
  titleField: o,
2500
2657
  photoField: s,
2501
2658
  parentField: f,
2502
2659
  cvField: p,
2503
2660
  hrefField: m
2504
- }) : e, A = bt(g), { boxes: j, links: M, width: N, height: P } = xt(k, {
2661
+ }) : e, A = wt(g), { boxes: j, links: M, width: N, height: P } = Tt(k, {
2505
2662
  size: g,
2506
2663
  horizontal: _
2507
2664
  });
@@ -2547,7 +2704,7 @@ function Ot({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2547
2704
  stroke: "rgba(148, 163, 184, 0.7)",
2548
2705
  strokeWidth: "1.5"
2549
2706
  }, t)), j.map(({ node: e, x: t, y: n }) => {
2550
- let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Ct(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Ct(e.color2) : s, f = b && (wt(e) || e.href), p = () => wt(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Et.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
2707
+ let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Dt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Dt(e.color2) : s, f = b && (Ot(e) || e.href), p = () => Ot(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + At.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
2551
2708
  return /* @__PURE__ */ d("g", {
2552
2709
  onClick: f ? p : void 0,
2553
2710
  style: f ? { cursor: "pointer" } : void 0,
@@ -2611,13 +2768,13 @@ function Ot({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2611
2768
  e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
2612
2769
  id: `${x}-${e.id}`,
2613
2770
  children: /* @__PURE__ */ u("circle", {
2614
- cx: t + Et.pad + A.avatar / 2,
2771
+ cx: t + At.pad + A.avatar / 2,
2615
2772
  cy: n + A.h / 2,
2616
2773
  r: A.avatar / 2
2617
2774
  })
2618
2775
  }), /* @__PURE__ */ u("image", {
2619
2776
  href: e.photo,
2620
- x: t + Et.pad,
2777
+ x: t + At.pad,
2621
2778
  y: n + (A.h - A.avatar) / 2,
2622
2779
  width: A.avatar,
2623
2780
  height: A.avatar,
@@ -2631,7 +2788,7 @@ function Ot({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2631
2788
  fontSize: A.title,
2632
2789
  fontWeight: "600",
2633
2790
  fill: s,
2634
- children: St(e.title, g + 4)
2791
+ children: Et(e.title, g + 4)
2635
2792
  }), e.name && /* @__PURE__ */ u("text", {
2636
2793
  x: m,
2637
2794
  y: n + _ + _ / 2 + A.name * .35,
@@ -2639,7 +2796,7 @@ function Ot({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2639
2796
  fontSize: A.name,
2640
2797
  fontWeight: "600",
2641
2798
  fill: c,
2642
- children: St(e.name, g)
2799
+ children: Et(e.name, g)
2643
2800
  })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
2644
2801
  x: m,
2645
2802
  y: n + (v[1] ? A.h * .43 : A.h * .57),
@@ -2647,7 +2804,7 @@ function Ot({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2647
2804
  fontSize: A.name,
2648
2805
  fontWeight: "600",
2649
2806
  fill: s,
2650
- children: St(v[0], g)
2807
+ children: Et(v[0], g)
2651
2808
  }), v[1] && /* @__PURE__ */ u("text", {
2652
2809
  x: m,
2653
2810
  y: n + A.h * .73,
@@ -2655,136 +2812,152 @@ function Ot({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2655
2812
  fontSize: A.title,
2656
2813
  opacity: "0.7",
2657
2814
  fill: s,
2658
- children: St(v[1], g + 4)
2815
+ children: Et(v[1], g + 4)
2659
2816
  })] })
2660
2817
  ]
2661
2818
  }, e.id);
2662
2819
  })]
2663
- }), S && /* @__PURE__ */ u(Dt, {
2820
+ }), S && /* @__PURE__ */ u(jt, {
2664
2821
  node: S,
2665
2822
  onClose: () => C(null)
2666
2823
  })]
2667
2824
  });
2668
2825
  }
2669
- function kt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, style: f, nodeRef: p }) {
2670
- let { tenant: m, apiUrl: g } = r(H), _ = r(U)?.[n], [v, y] = c(null);
2826
+ function Nt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, paged: f, emptyText: p, style: m, nodeRef: g }) {
2827
+ let { tenant: _, apiUrl: v } = r(V), y = r(H), b = y?.[n], x = f ? U(y) : 1, [S, C] = c(null);
2671
2828
  if (i(() => {
2672
- if (!n || _) return;
2673
- let e = !0, t = n.startsWith("api:") ? `${g}/data/${encodeURIComponent(n.slice(4))}` : `${g}/dynamic/${encodeURIComponent(n)}`;
2674
- return fetch(t, { headers: m ? { "x-tenant": m } : {} }).then((e) => e.json()).then((t) => e && y(Array.isArray(t?.payload) ? t.payload : [])).catch(() => e && y([])), () => {
2829
+ if (!n || b) return;
2830
+ let e = !0, t = Math.max(1, Number(a) || 10), r = f && !n.startsWith("api:") ? `?offset=${(x - 1) * t}&limit=${t}` : "", i = n.startsWith("api:") ? `${v}/data/${encodeURIComponent(n.slice(4))}` : `${v}/dynamic/${encodeURIComponent(n)}${r}`;
2831
+ return fetch(i, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((t) => {
2832
+ let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
2833
+ return e && C(n);
2834
+ }).catch(() => e && C([])), () => {
2675
2835
  e = !1;
2676
2836
  };
2677
2837
  }, [
2678
2838
  n,
2679
- m,
2680
- g,
2681
- _
2839
+ _,
2840
+ v,
2841
+ b,
2842
+ f,
2843
+ x,
2844
+ a
2682
2845
  ]), !e.length) return null;
2683
- let b = n ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, S = l ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = s ? { border: C } : { borderBottom: C };
2846
+ let w = Math.max(1, Number(a) || 10), T = n ? f ? b || n.startsWith("api:") ? (b ?? S ?? []).slice((x - 1) * w, x * w) : (S ?? []).slice(0, w) : (b ?? S ?? []).slice(0, w) : null, E = T ? T.map((t) => e.map((e) => q(K(t?.data, e.field)))) : t, D = !!n && !(n && !b && S === null) && E.length === 0, O = l ? "6px 10px" : "10px 14px", k = "1px solid rgba(148, 163, 184, 0.35)", A = s ? { border: k } : { borderBottom: k };
2684
2847
  return /* @__PURE__ */ u("div", {
2685
- ref: p,
2848
+ ref: g,
2686
2849
  style: {
2687
2850
  width: "100%",
2688
2851
  overflowX: "auto",
2689
- ...h(f)
2852
+ ...h(m)
2690
2853
  },
2691
2854
  children: /* @__PURE__ */ d("table", {
2692
2855
  style: {
2693
2856
  width: "100%",
2694
2857
  borderCollapse: "collapse",
2695
2858
  fontSize: 14,
2696
- ...s ? { border: C } : {}
2859
+ ...s ? { border: k } : {}
2697
2860
  },
2698
2861
  children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("th", {
2699
2862
  style: {
2700
2863
  textAlign: "left",
2701
2864
  fontWeight: 600,
2702
- padding: S,
2865
+ padding: O,
2703
2866
  background: "rgba(148, 163, 184, 0.12)",
2704
- ...w
2867
+ ...A
2705
2868
  },
2706
2869
  children: e.label ?? e
2707
- }, t)) }) }), /* @__PURE__ */ u("tbody", { children: x.map((t, n) => /* @__PURE__ */ u("tr", {
2870
+ }, t)) }) }), /* @__PURE__ */ d("tbody", { children: [D && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
2871
+ colSpan: e.length,
2872
+ style: {
2873
+ padding: O,
2874
+ textAlign: "center",
2875
+ opacity: .6,
2876
+ ...A
2877
+ },
2878
+ children: p || "No data yet"
2879
+ }) }), E.map((t, n) => /* @__PURE__ */ u("tr", {
2708
2880
  style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2709
2881
  children: e.map((e, n) => /* @__PURE__ */ u("td", {
2710
2882
  style: {
2711
- padding: S,
2712
- ...w
2883
+ padding: O,
2884
+ ...A
2713
2885
  },
2714
2886
  children: t?.[n] ?? ""
2715
2887
  }, n))
2716
- }, n)) })]
2888
+ }, n))] })]
2717
2889
  })
2718
2890
  });
2719
2891
  }
2720
- var At = {
2721
- PageRoot: he,
2722
- Section: ge,
2723
- Container: _e,
2724
- Heading: ve,
2725
- TextBlock: ke,
2726
- ButtonBlock: Me,
2727
- ImageBlock: Ne,
2728
- Spacer: ze,
2729
- Divider: Be,
2730
- SliderBlock: Ke,
2731
- CanvasSlider: qe,
2732
- TabsBlock: Ze,
2733
- QuickStack: mt,
2734
- CollectionList: ht,
2735
- BreadcrumbsBlock: gt,
2736
- PaginationBlock: _t,
2737
- StepperBlock: vt,
2738
- OrgChartBlock: Ot,
2739
- TableBlock: kt,
2740
- AccordionBlock: Qe,
2741
- NavbarBlock: Xe,
2742
- ListBlock: Oe,
2743
- TextSpan: xe,
2744
- QuoteBlock: De,
2745
- TextLink: je,
2746
- RichTextBlock: Te,
2747
- RichContentBlock: Te,
2748
- VideoBlock: Pe,
2749
- YouTubeBlock: Ie,
2750
- IframeBlock: Le,
2751
- EmbedBlock: Re,
2752
- FormBlock: ot,
2753
- FormLabel: st,
2754
- FormInput: ct,
2755
- FormTextarea: lt,
2756
- FormCheckbox: (e) => /* @__PURE__ */ u(ut, {
2892
+ var Pt = {
2893
+ PageRoot: ge,
2894
+ Section: _e,
2895
+ Container: ve,
2896
+ Heading: ye,
2897
+ TextBlock: Ae,
2898
+ ButtonBlock: Ne,
2899
+ ImageBlock: Pe,
2900
+ Spacer: Be,
2901
+ Divider: Ve,
2902
+ SliderBlock: qe,
2903
+ CanvasSlider: Je,
2904
+ TabsBlock: Qe,
2905
+ QuickStack: vt,
2906
+ CollectionList: yt,
2907
+ BreadcrumbsBlock: bt,
2908
+ PaginationBlock: xt,
2909
+ StepperBlock: St,
2910
+ OrgChartBlock: Mt,
2911
+ TableBlock: Nt,
2912
+ AccordionBlock: $e,
2913
+ NavbarBlock: Ze,
2914
+ ListBlock: ke,
2915
+ TextSpan: Se,
2916
+ QuoteBlock: Oe,
2917
+ TextLink: Me,
2918
+ RichTextBlock: Ee,
2919
+ RichContentBlock: Ee,
2920
+ VideoBlock: Fe,
2921
+ YouTubeBlock: Le,
2922
+ IframeBlock: Re,
2923
+ EmbedBlock: ze,
2924
+ FormBlock: st,
2925
+ FormLabel: dt,
2926
+ FormInput: ft,
2927
+ FormTextarea: pt,
2928
+ FormCheckbox: (e) => /* @__PURE__ */ u(mt, {
2757
2929
  kind: "checkbox",
2758
2930
  ...e
2759
2931
  }),
2760
- FormRadio: (e) => /* @__PURE__ */ u(ut, {
2932
+ FormRadio: (e) => /* @__PURE__ */ u(mt, {
2761
2933
  kind: "radio",
2762
2934
  ...e
2763
2935
  }),
2764
- FormSelect: dt,
2765
- FormFile: ft,
2766
- FormSubmit: pt
2767
- }, jt = {
2936
+ FormSelect: ht,
2937
+ FormFile: gt,
2938
+ FormRecaptcha: ut,
2939
+ FormSubmit: _t
2940
+ }, Ft = {
2768
2941
  id: "auth",
2769
2942
  label: "Accounts",
2770
2943
  category: "Apps",
2771
2944
  keys: ["SiteLoginForm", "SiteAccountMenu"],
2772
2945
  ssr: "shell",
2773
2946
  settings: ["apps.auth.redirect"]
2774
- }, Mt = t({
2947
+ }, It = t({
2775
2948
  user: null,
2776
2949
  status: "idle",
2777
2950
  ensure: () => {},
2778
2951
  refresh: () => {},
2779
2952
  signOut: () => {}
2780
- }), Nt = () => {
2781
- let e = r(Mt);
2953
+ }), Lt = () => {
2954
+ let e = r(It);
2782
2955
  return i(() => {
2783
2956
  e.ensure();
2784
2957
  }, [e]), e;
2785
2958
  };
2786
- function Pt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
2787
- let d = r(H), f = a || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : i ? "guest" : "idle"), v = s(!1), y = n((e, t) => fetch(`${f}${e}`, {
2959
+ function Rt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
2960
+ let d = r(V), f = a || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : i ? "guest" : "idle"), v = s(!1), y = n((e, t) => fetch(`${f}${e}`, {
2788
2961
  ...t,
2789
2962
  credentials: "include",
2790
2963
  headers: {
@@ -2816,19 +2989,19 @@ function Pt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l })
2816
2989
  b,
2817
2990
  x
2818
2991
  ]);
2819
- return /* @__PURE__ */ u(Mt.Provider, {
2992
+ return /* @__PURE__ */ u(It.Provider, {
2820
2993
  value: C,
2821
2994
  children: e
2822
2995
  });
2823
2996
  }
2824
- function Ft({ when: e, children: t }) {
2825
- let { status: n } = Nt();
2997
+ function zt({ when: e, children: t }) {
2998
+ let { status: n } = Lt();
2826
2999
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
2827
3000
  }
2828
3001
  //#endregion
2829
3002
  //#region ../ui/src/components/builder/apps/auth/views.jsx
2830
- function It({ 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 }) {
2831
- let { tenant: g, apiUrl: _, settings: v } = r(H), [y, b] = c("form"), [x, S] = c(""), [C, w] = c(!1), T = e === "register", E = f ? m || "form" : y, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
3003
+ function Bt({ 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 }) {
3004
+ let { tenant: g, apiUrl: _, settings: v } = r(V), [y, b] = c("form"), [x, S] = c(""), [C, w] = c(!1), T = e === "register", E = f ? m || "form" : y, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
2832
3005
  if (e.preventDefault(), f) return;
2833
3006
  let n = new FormData(e.currentTarget);
2834
3007
  w(!0), S("");
@@ -2951,8 +3124,8 @@ function It({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
2951
3124
  ]
2952
3125
  });
2953
3126
  }
2954
- function Lt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
2955
- let { user: c, status: l, signOut: f } = Nt(), p = a ? s || "user" : l, m = a ? {
3127
+ function Vt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3128
+ let { user: c, status: l, signOut: f } = Lt(), p = a ? s || "user" : l, m = a ? {
2956
3129
  name: "Ada Lovelace",
2957
3130
  email: "ada@example.com"
2958
3131
  } : c;
@@ -3017,16 +3190,16 @@ function Lt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3017
3190
  }
3018
3191
  //#endregion
3019
3192
  //#region ../ui/src/components/builder/apps/index.js
3020
- var Rt = [jt], zt = {
3021
- SiteLoginForm: It,
3022
- SiteAccountMenu: Lt
3193
+ var Ht = [Ft], Ut = {
3194
+ SiteLoginForm: Bt,
3195
+ SiteAccountMenu: Vt
3023
3196
  };
3024
- new Set(Rt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3197
+ new Set(Ht.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3025
3198
  //#endregion
3026
3199
  //#region ../ui/src/components/builder/render.jsx
3027
- var Bt = {
3028
- ...At,
3029
- ...zt
3200
+ var Wt = {
3201
+ ...Pt,
3202
+ ...Ut
3030
3203
  };
3031
3204
  function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3032
3205
  let o = n[t];
@@ -3038,7 +3211,7 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3038
3211
  let c = new Set(i).add(n);
3039
3212
  return /* @__PURE__ */ u(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
3040
3213
  }
3041
- let l = Bt[s];
3214
+ let l = Wt[s];
3042
3215
  if (!l) return null;
3043
3216
  let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
3044
3217
  ...c,
@@ -3049,15 +3222,15 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3049
3222
  },
3050
3223
  children: d.length ? d : void 0
3051
3224
  }, t);
3052
- return c.when && c.when !== "always" ? /* @__PURE__ */ u(Ft, {
3225
+ return c.when && c.when !== "always" ? /* @__PURE__ */ u(zt, {
3053
3226
  when: c.when,
3054
3227
  children: m
3055
3228
  }, t) : m;
3056
3229
  }
3057
3230
  //#endregion
3058
3231
  //#region ../ui/src/components/builder/PageRenderer.jsx
3059
- var Vt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
3060
- function Ht({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: g }) {
3232
+ var Gt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
3233
+ function Kt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: g }) {
3061
3234
  let _ = s?.js?.trim();
3062
3235
  if (i(() => {
3063
3236
  if (!_) return;
@@ -3066,78 +3239,81 @@ function Ht({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
3066
3239
  }, [_]), !e?.ROOT) return null;
3067
3240
  let v = {
3068
3241
  lang: p || void 0,
3069
- dir: oe(m, p)
3070
- }, y = {
3242
+ dir: se(m, p)
3243
+ }, y = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", b = {
3071
3244
  minHeight: "100%",
3072
3245
  display: "flex",
3073
3246
  flexDirection: "column"
3074
- }, b = $("ROOT", e, n), x = o(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), S = D(e, n), C = E(e, n), w = s?.css?.trim(), T = re(e, n).map((e) => /* @__PURE__ */ u("link", {
3247
+ }, x = $("ROOT", e, n), S = o(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), C = D(e, n), w = E(e, n), T = s?.css?.trim(), O = ie(e, n).map((e) => /* @__PURE__ */ u("link", {
3075
3248
  rel: "stylesheet",
3076
3249
  precedence: "default",
3077
- href: V(e)
3250
+ href: B(e)
3078
3251
  }, e));
3079
- if (r !== "auto") return /* @__PURE__ */ u(H.Provider, {
3252
+ if (r !== "auto") return /* @__PURE__ */ u(V.Provider, {
3080
3253
  value: {
3081
3254
  tenant: c || "",
3082
3255
  apiUrl: l || "/api",
3083
3256
  locale: p || "",
3084
3257
  settings: h ?? null
3085
3258
  },
3086
- children: /* @__PURE__ */ u(Pt, {
3259
+ children: /* @__PURE__ */ u(Rt, {
3087
3260
  initialUser: g,
3088
- children: /* @__PURE__ */ u(U.Provider, {
3261
+ children: /* @__PURE__ */ u(H.Provider, {
3089
3262
  value: f ?? null,
3090
3263
  children: /* @__PURE__ */ u(W.Provider, {
3091
- value: x,
3264
+ value: S,
3092
3265
  children: /* @__PURE__ */ d("div", {
3093
3266
  ...v,
3267
+ className: "webim-page",
3094
3268
  style: {
3095
- ...y,
3096
- ...L(t, r),
3269
+ ...b,
3270
+ ...ee(t, r),
3097
3271
  ...a
3098
3272
  },
3099
3273
  children: [
3100
- T,
3101
- S && /* @__PURE__ */ u("style", { children: S }),
3274
+ O,
3275
+ /* @__PURE__ */ u("style", { children: y }),
3102
3276
  C && /* @__PURE__ */ u("style", { children: C }),
3103
3277
  w && /* @__PURE__ */ u("style", { children: w }),
3104
- b
3278
+ T && /* @__PURE__ */ u("style", { children: T }),
3279
+ x
3105
3280
  ]
3106
3281
  })
3107
3282
  })
3108
3283
  })
3109
3284
  })
3110
3285
  });
3111
- let O = P(t);
3112
- return /* @__PURE__ */ u(H.Provider, {
3286
+ let k = P(t);
3287
+ return /* @__PURE__ */ u(V.Provider, {
3113
3288
  value: {
3114
3289
  tenant: c || "",
3115
3290
  apiUrl: l || "/api",
3116
3291
  locale: p || "",
3117
3292
  settings: h ?? null
3118
3293
  },
3119
- children: /* @__PURE__ */ u(Pt, {
3294
+ children: /* @__PURE__ */ u(Rt, {
3120
3295
  initialUser: g,
3121
- children: /* @__PURE__ */ u(U.Provider, {
3296
+ children: /* @__PURE__ */ u(H.Provider, {
3122
3297
  value: f ?? null,
3123
3298
  children: /* @__PURE__ */ u(W.Provider, {
3124
- value: x,
3299
+ value: S,
3125
3300
  children: /* @__PURE__ */ d("div", {
3126
3301
  ...v,
3127
3302
  className: "webim-page",
3128
3303
  style: {
3129
- ...y,
3304
+ ...b,
3130
3305
  ...I(t),
3131
3306
  ...a
3132
3307
  },
3133
3308
  children: [
3134
- /* @__PURE__ */ u("style", { children: `.webim-page { ${Vt(F(O.light))} }
3135
- @media (prefers-color-scheme: dark) { .webim-page { ${Vt(F(O.dark))} } }` }),
3136
- T,
3137
- S && /* @__PURE__ */ u("style", { children: S }),
3309
+ /* @__PURE__ */ u("style", { children: `.webim-page { ${Gt(F(k.light))} }
3310
+ @media (prefers-color-scheme: dark) { .webim-page { ${Gt(F(k.dark))} } }` }),
3311
+ O,
3312
+ /* @__PURE__ */ u("style", { children: y }),
3138
3313
  C && /* @__PURE__ */ u("style", { children: C }),
3139
3314
  w && /* @__PURE__ */ u("style", { children: w }),
3140
- b
3315
+ T && /* @__PURE__ */ u("style", { children: T }),
3316
+ x
3141
3317
  ]
3142
3318
  })
3143
3319
  })
@@ -3147,8 +3323,8 @@ function Ht({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
3147
3323
  }
3148
3324
  //#endregion
3149
3325
  //#region src/WebimContent.jsx
3150
- function Ut({ bundle: e, mode: t = "auto", style: n }) {
3151
- return e?.blocks?.ROOT ? /* @__PURE__ */ u(Ht, {
3326
+ function qt({ bundle: e, mode: t = "auto", style: n }) {
3327
+ return e?.blocks?.ROOT ? /* @__PURE__ */ u(Kt, {
3152
3328
  blocks: e.blocks,
3153
3329
  theme: e.theme,
3154
3330
  components: e.components,
@@ -3165,7 +3341,7 @@ function Ut({ bundle: e, mode: t = "auto", style: n }) {
3165
3341
  }
3166
3342
  //#endregion
3167
3343
  //#region src/WebimPage.jsx
3168
- function Wt({ 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 }) {
3344
+ function Jt({ 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 }) {
3169
3345
  let [g, _] = c({ status: "loading" }), v = s({
3170
3346
  onLoad: m,
3171
3347
  onError: h
@@ -3175,7 +3351,7 @@ function Wt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
3175
3351
  onError: h
3176
3352
  }, i(() => {
3177
3353
  let i = !0;
3178
- return _({ status: "loading" }), B({
3354
+ return _({ status: "loading" }), z({
3179
3355
  apiUrl: e,
3180
3356
  tenant: t,
3181
3357
  slug: n,
@@ -3202,11 +3378,11 @@ function Wt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
3202
3378
  r,
3203
3379
  a,
3204
3380
  o
3205
- ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Ut, {
3381
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(qt, {
3206
3382
  bundle: g.bundle,
3207
3383
  mode: l,
3208
3384
  style: d
3209
3385
  });
3210
3386
  }
3211
3387
  //#endregion
3212
- export { Ht as PageRenderer, Ut as WebimContent, Wt as WebimPage, B as fetchPage, we as renderRichContent, R as resolveTheme };
3388
+ export { Kt as PageRenderer, qt as WebimContent, Jt as WebimPage, z as fetchPage, Te as renderRichContent, L as resolveTheme };