webim-adapter 1.0.0 → 1.0.2

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