webim-adapter 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1260,26 +1260,33 @@ function ut({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
1260
1260
  }
1261
1261
  }) : null;
1262
1262
  }
1263
- function dt({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1264
- let [a, o] = c(null);
1263
+ var dt = /(^|[\s,>+~{}])(:root|html|body)(?=$|[\s,{.:#[>+~])/g;
1264
+ function ft(e) {
1265
+ return `@scope ([data-wb-embed]) {\n${e.replace(dt, "$1:scope")}\n}`;
1266
+ }
1267
+ function pt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRef: a }) {
1268
+ let [o, s] = c(null);
1265
1269
  return i(() => {
1266
- a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
1270
+ o && (o.innerHTML = e || "", n ? (o.setAttribute("data-wb-embed", ""), o.querySelectorAll("style").forEach((e) => {
1271
+ e.textContent = ft(e.textContent || "");
1272
+ })) : o.removeAttribute("data-wb-embed"), t && o.querySelectorAll("script").forEach((e) => {
1267
1273
  let t = document.createElement("script");
1268
1274
  for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
1269
1275
  t.text = e.textContent, e.replaceWith(t);
1270
1276
  }));
1271
1277
  }, [
1272
- a,
1278
+ o,
1273
1279
  e,
1274
- t
1280
+ t,
1281
+ n
1275
1282
  ]), /* @__PURE__ */ u("div", {
1276
1283
  ref: (e) => {
1277
- o(e), r && r(e);
1284
+ s(e), a && a(e);
1278
1285
  },
1279
- style: A(n)
1286
+ style: A(r)
1280
1287
  });
1281
1288
  }
1282
- function ft({ height: e, style: t, nodeRef: n }) {
1289
+ function mt({ height: e, style: t, nodeRef: n }) {
1283
1290
  return /* @__PURE__ */ u("div", {
1284
1291
  ref: n,
1285
1292
  style: {
@@ -1290,7 +1297,7 @@ function ft({ height: e, style: t, nodeRef: n }) {
1290
1297
  }
1291
1298
  });
1292
1299
  }
1293
- function pt({ style: e, nodeRef: t }) {
1300
+ function ht({ style: e, nodeRef: t }) {
1294
1301
  return /* @__PURE__ */ u("div", {
1295
1302
  ref: t,
1296
1303
  style: {
@@ -1301,7 +1308,7 @@ function pt({ style: e, nodeRef: t }) {
1301
1308
  }
1302
1309
  });
1303
1310
  }
1304
- function mt({ style: e, nodeRef: t }) {
1311
+ function gt({ style: e, nodeRef: t }) {
1305
1312
  return /* @__PURE__ */ u("div", {
1306
1313
  ref: t,
1307
1314
  style: {
@@ -1310,7 +1317,7 @@ function mt({ style: e, nodeRef: t }) {
1310
1317
  }
1311
1318
  });
1312
1319
  }
1313
- var ht = {
1320
+ var _t = {
1314
1321
  position: "absolute",
1315
1322
  top: "50%",
1316
1323
  transform: "translateY(-50%)",
@@ -1327,7 +1334,7 @@ var ht = {
1327
1334
  alignItems: "center",
1328
1335
  justifyContent: "center",
1329
1336
  padding: 0
1330
- }, gt = {
1337
+ }, vt = {
1331
1338
  bottom: {
1332
1339
  inset: "auto 0 0 0",
1333
1340
  padding: "40px 24px 20px",
@@ -1346,8 +1353,8 @@ var ht = {
1346
1353
  padding: 24,
1347
1354
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1348
1355
  }
1349
- }, _t = 48;
1350
- function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1356
+ }, yt = 48;
1357
+ function bt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1351
1358
  let [p, m] = c(0), [h, g] = c(!1), [_, v] = c(null), y = e ? Math.min(p, e - 1) : 0;
1352
1359
  if (i(() => {
1353
1360
  if (!n || h || _ || e < 2) return;
@@ -1363,7 +1370,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1363
1370
  let b = (t) => m((t + e) % e), x = () => {
1364
1371
  if (!_) return;
1365
1372
  let { dx: e } = _;
1366
- v(null), e < -48 ? b(y + 1) : e > _t && b(y - 1);
1373
+ v(null), e < -48 ? b(y + 1) : e > yt && b(y - 1);
1367
1374
  };
1368
1375
  return /* @__PURE__ */ d("div", {
1369
1376
  ref: f,
@@ -1412,7 +1419,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1412
1419
  type: "button",
1413
1420
  "aria-label": "Previous slide",
1414
1421
  style: {
1415
- ...ht,
1422
+ ..._t,
1416
1423
  left: 12
1417
1424
  },
1418
1425
  onClick: () => b(y - 1),
@@ -1422,7 +1429,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1422
1429
  type: "button",
1423
1430
  "aria-label": "Next slide",
1424
1431
  style: {
1425
- ...ht,
1432
+ ..._t,
1426
1433
  right: 12
1427
1434
  },
1428
1435
  onClick: () => b(y + 1),
@@ -1456,7 +1463,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1456
1463
  ] })]
1457
1464
  });
1458
1465
  }
1459
- var yt = (e, t) => ({
1466
+ var xt = (e, t) => ({
1460
1467
  position: "absolute",
1461
1468
  inset: 0,
1462
1469
  backgroundImage: e ? `url(${e})` : "none",
@@ -1464,18 +1471,18 @@ var yt = (e, t) => ({
1464
1471
  backgroundSize: "cover",
1465
1472
  backgroundPosition: "center"
1466
1473
  });
1467
- function bt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1468
- return e.length ? /* @__PURE__ */ u(vt, {
1474
+ function St({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1475
+ return e.length ? /* @__PURE__ */ u(bt, {
1469
1476
  ...r,
1470
1477
  count: e.length,
1471
1478
  renderSlide: (r) => {
1472
1479
  let i = e[r];
1473
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: yt(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1480
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: xt(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1474
1481
  style: {
1475
1482
  position: "absolute",
1476
1483
  color: "#fff",
1477
1484
  textAlign: n,
1478
- ...gt[t] ?? gt.bottom
1485
+ ...vt[t] ?? vt.bottom
1479
1486
  },
1480
1487
  children: [i.title && /* @__PURE__ */ u("div", {
1481
1488
  style: {
@@ -1495,13 +1502,13 @@ function bt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1495
1502
  }
1496
1503
  }) : null;
1497
1504
  }
1498
- function xt({ slides: e = [], linked: t, ...n }) {
1499
- return e.length ? /* @__PURE__ */ u(vt, {
1505
+ function Ct({ slides: e = [], linked: t, ...n }) {
1506
+ return e.length ? /* @__PURE__ */ u(bt, {
1500
1507
  ...n,
1501
1508
  count: e.length,
1502
1509
  renderSlide: (n) => {
1503
1510
  let r = e[n];
1504
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: yt(r.image, r.color) }), /* @__PURE__ */ u("div", {
1511
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: xt(r.image, r.color) }), /* @__PURE__ */ u("div", {
1505
1512
  style: {
1506
1513
  position: "absolute",
1507
1514
  inset: 0,
@@ -1513,23 +1520,23 @@ function xt({ slides: e = [], linked: t, ...n }) {
1513
1520
  }
1514
1521
  }) : null;
1515
1522
  }
1516
- var St = 256, Ct = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), wt = (e, t, n) => {
1517
- let r = St * 2 ** n;
1523
+ var wt = 256, Tt = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), Et = (e, t, n) => {
1524
+ let r = wt * 2 ** n;
1518
1525
  return {
1519
1526
  x: (Number(t) + 180) / 360 * r,
1520
- y: (.5 - Ct(Number(e)) / (2 * Math.PI)) * r
1527
+ y: (.5 - Tt(Number(e)) / (2 * Math.PI)) * r
1521
1528
  };
1522
1529
  }, $ = (e, t) => {
1523
1530
  if (e === "" || e == null) return null;
1524
1531
  let n = Number(e);
1525
1532
  return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
1526
- }, Tt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
1527
- function Et(e, t, n = "directions", r = "") {
1533
+ }, Dt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
1534
+ function Ot(e, t, n = "directions", r = "") {
1528
1535
  let i = `${e},${t}`;
1529
1536
  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)}`;
1530
1537
  }
1531
- var Dt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
1532
- function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize: o = 22, pinLink: l = "directions", link: f = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
1538
+ var kt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
1539
+ function At({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize: o = 22, pinLink: l = "directions", link: f = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
1533
1540
  let _ = s(null), [v, y] = c(1200);
1534
1541
  i(() => {
1535
1542
  let e = _.current;
@@ -1539,7 +1546,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1539
1546
  let n = new ResizeObserver(t);
1540
1547
  return n.observe(e), () => n.disconnect();
1541
1548
  }, []);
1542
- let b = (Array.isArray(e) ? e : []).filter(Tt), x = Tt({
1549
+ let b = (Array.isArray(e) ? e : []).filter(Dt), x = Dt({
1543
1550
  lat: t,
1544
1551
  lng: n
1545
1552
  }) ? {
@@ -1551,7 +1558,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1551
1558
  } : null, S = Math.max(80, Number(a) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
1552
1559
  if (b.length < 2) return 13;
1553
1560
  for (let e = 19; e >= 1; e--) {
1554
- let t = b.map((t) => wt($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
1561
+ let t = b.map((t) => Et($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
1555
1562
  if (n <= v * .8 && r <= S * .7) return e;
1556
1563
  }
1557
1564
  return 1;
@@ -1575,12 +1582,12 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1575
1582
  },
1576
1583
  children: "Set the coordinates in Settings"
1577
1584
  });
1578
- let T = wt(x.lat, x.lng, C), E = {
1585
+ let T = Et(x.lat, x.lng, C), E = {
1579
1586
  x: T.x - v / 2,
1580
1587
  y: T.y - S / 2
1581
1588
  }, D = [], O = [];
1582
- for (let e = Math.floor(E.x / St); e <= Math.floor((E.x + v) / St); e++) D.push(e);
1583
- for (let e = Math.floor(E.y / St); e <= Math.floor((E.y + S) / St); e++) O.push(e);
1589
+ for (let e = Math.floor(E.x / wt); e <= Math.floor((E.x + v) / wt); e++) D.push(e);
1590
+ for (let e = Math.floor(E.y / wt); e <= Math.floor((E.y + S) / wt); e++) O.push(e);
1584
1591
  let k = 2 ** C;
1585
1592
  return /* @__PURE__ */ d("div", {
1586
1593
  ref: (e) => {
@@ -1603,22 +1610,22 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1603
1610
  return e < 0 || e >= k ? null : /* @__PURE__ */ u("img", {
1604
1611
  src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
1605
1612
  alt: "",
1606
- width: St,
1607
- height: St,
1613
+ width: wt,
1614
+ height: wt,
1608
1615
  loading: "lazy",
1609
1616
  style: {
1610
1617
  position: "absolute",
1611
- left: Math.round(t * St - E.x),
1612
- top: Math.round(e * St - E.y),
1613
- width: St,
1614
- height: St,
1618
+ left: Math.round(t * wt - E.x),
1619
+ top: Math.round(e * wt - E.y),
1620
+ width: wt,
1621
+ height: wt,
1615
1622
  userSelect: "none",
1616
1623
  pointerEvents: "none"
1617
1624
  }
1618
1625
  }, `${t}-${e}`);
1619
1626
  })),
1620
1627
  b.map((e, t) => {
1621
- let n = wt($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", s = l === "none" || g ? null : Et($(e.lat, 90), $(e.lng, 180), l, e.title);
1628
+ let n = Et($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", s = l === "none" || g ? null : Ot($(e.lat, 90), $(e.lng, 180), l, e.title);
1622
1629
  return /* @__PURE__ */ d(s ? "a" : "span", {
1623
1630
  href: s || void 0,
1624
1631
  target: s ? "_blank" : void 0,
@@ -1657,8 +1664,8 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1657
1664
  viewBox: "0 0 24 24",
1658
1665
  fill: a,
1659
1666
  style: { display: "block" },
1660
- children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), kt[e.icon] ? /* @__PURE__ */ u("path", {
1661
- d: kt[e.icon],
1667
+ children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), jt[e.icon] ? /* @__PURE__ */ u("path", {
1668
+ d: jt[e.icon],
1662
1669
  transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
1663
1670
  fill: "none",
1664
1671
  stroke: "#fff",
@@ -1694,7 +1701,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1694
1701
  })
1695
1702
  ]
1696
1703
  }), f ? /* @__PURE__ */ u("a", {
1697
- href: Dt(x.lat, x.lng, C),
1704
+ href: kt(x.lat, x.lng, C),
1698
1705
  target: "_blank",
1699
1706
  rel: "noopener noreferrer",
1700
1707
  onClick: g ? (e) => e.preventDefault() : void 0,
@@ -1708,7 +1715,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1708
1715
  }) : null]
1709
1716
  });
1710
1717
  }
1711
- var kt = {
1718
+ var jt = {
1712
1719
  check: "M4 12l5 5L20 6",
1713
1720
  close: "M6 6l12 12M18 6L6 18",
1714
1721
  plus: "M12 5v14M5 12h14",
@@ -1805,8 +1812,8 @@ var kt = {
1805
1812
  droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
1806
1813
  leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
1807
1814
  };
1808
- function At({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: d, inert: f }) {
1809
- let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [kt[e] ?? kt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
1815
+ function Mt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: d, inert: f }) {
1816
+ let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [jt[e] ?? jt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
1810
1817
  viewBox: "0 0 24 24",
1811
1818
  width: g,
1812
1819
  height: g,
@@ -1842,7 +1849,7 @@ function At({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
1842
1849
  children: v
1843
1850
  });
1844
1851
  }
1845
- function jt(e, t = {}, n = 0) {
1852
+ function Nt(e, t = {}, n = 0) {
1846
1853
  let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Oe(e), a = Math.max(0, Number(n) || 0), o = [];
1847
1854
  for (let e of r) {
1848
1855
  let n = e.data ?? e, r = Ee(n, t.imageField), s = (Array.isArray(r) ? r : [r]).map((e) => e && typeof e == "object" ? e.url ?? e.src ?? "" : e).filter((e) => typeof e == "string" && e.trim()), c = t.nameField ? i(Ee(n, t.nameField)) : i(n.name), l = t.hrefField ? i(Ee(n, t.hrefField)) : "";
@@ -1855,7 +1862,7 @@ function jt(e, t = {}, n = 0) {
1855
1862
  }
1856
1863
  return o;
1857
1864
  }
1858
- function Mt({ images: e = [], source: t = "", entry: n = "", imageField: a = "", nameField: o = "", hrefField: s = "", limit: f = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
1865
+ function Pt({ images: e = [], source: t = "", entry: n = "", imageField: a = "", nameField: o = "", hrefField: s = "", limit: f = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
1859
1866
  let { tenant: x, apiUrl: S } = r(Z), C = r(xe)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
1860
1867
  i(() => {
1861
1868
  if (!t || C) return;
@@ -1873,7 +1880,7 @@ function Mt({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
1873
1880
  C
1874
1881
  ]);
1875
1882
  let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, j = Math.max(0, Number(f) || 0), M = t ? (() => {
1876
- let e = jt(k, {
1883
+ let e = Nt(k, {
1877
1884
  imageField: a,
1878
1885
  nameField: o,
1879
1886
  hrefField: s
@@ -2078,19 +2085,19 @@ function Mt({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
2078
2085
  ]
2079
2086
  });
2080
2087
  }
2081
- var Nt = {
2088
+ var Ft = {
2082
2089
  color: "inherit",
2083
2090
  textDecoration: "none",
2084
2091
  fontSize: 14,
2085
2092
  opacity: .85
2086
- }, Pt = {
2093
+ }, It = {
2087
2094
  background: "var(--page-surface, #f2f2f2)",
2088
2095
  color: "var(--page-text, #111827)",
2089
2096
  border: "1px solid rgba(148, 163, 184, 0.25)",
2090
2097
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
2091
2098
  zIndex: 60
2092
2099
  };
2093
- function Ft(e, t = {}, n = "dropdown") {
2100
+ function Lt(e, t = {}, n = "dropdown") {
2094
2101
  let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" : Oe(e), o = r.map((e) => {
2095
2102
  let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
2096
2103
  return {
@@ -2132,7 +2139,7 @@ function Ft(e, t = {}, n = "dropdown") {
2132
2139
  type: e.children.length ? n : "link"
2133
2140
  }));
2134
2141
  }
2135
- function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], style: f, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
2142
+ function Rt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], style: f, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
2136
2143
  let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(Z), P = r(xe)?.[g], [F, I] = c(null);
2137
2144
  i(() => {
2138
2145
  if (!g || P) return;
@@ -2153,7 +2160,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2153
2160
  let e = new ResizeObserver(() => E(C.offsetWidth < h));
2154
2161
  return e.observe(C), () => e.disconnect();
2155
2162
  }, [C, h]);
2156
- let L = g ? Ft(P ?? F ?? [], {
2163
+ let L = g ? Lt(P ?? F ?? [], {
2157
2164
  labelField: _,
2158
2165
  hrefField: v,
2159
2166
  imageField: y,
@@ -2182,7 +2189,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2182
2189
  return /* @__PURE__ */ d("a", {
2183
2190
  href: e.href || "#",
2184
2191
  style: {
2185
- ...Nt,
2192
+ ...Ft,
2186
2193
  display: n ? "block" : "flex",
2187
2194
  alignItems: n ? void 0 : "center",
2188
2195
  gap: n ? void 0 : 10,
@@ -2279,7 +2286,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2279
2286
  let t = e.children ?? [];
2280
2287
  if (!t.length) return /* @__PURE__ */ u("a", {
2281
2288
  href: e.href || "#",
2282
- style: Nt,
2289
+ style: Ft,
2283
2290
  children: e.label
2284
2291
  }, e.key);
2285
2292
  let n = e.type === "mega";
@@ -2293,7 +2300,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2293
2300
  children: [/* @__PURE__ */ d("a", {
2294
2301
  href: e.href || "#",
2295
2302
  style: {
2296
- ...Nt,
2303
+ ...Ft,
2297
2304
  cursor: "pointer"
2298
2305
  },
2299
2306
  children: [
@@ -2309,7 +2316,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2309
2316
  ]
2310
2317
  }), k === e.key && (n ? /* @__PURE__ */ u("div", {
2311
2318
  style: {
2312
- ...Pt,
2319
+ ...It,
2313
2320
  position: "absolute",
2314
2321
  left: 0,
2315
2322
  right: 0,
@@ -2325,7 +2332,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2325
2332
  }, !0))
2326
2333
  }) : /* @__PURE__ */ u("div", {
2327
2334
  style: {
2328
- ...Pt,
2335
+ ...It,
2329
2336
  position: "absolute",
2330
2337
  top: "100%",
2331
2338
  left: 0,
@@ -2354,7 +2361,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2354
2361
  children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
2355
2362
  href: t.href || "#",
2356
2363
  style: {
2357
- ...Nt,
2364
+ ...Ft,
2358
2365
  padding: "10px 4px",
2359
2366
  fontWeight: (t.children ?? []).length ? 600 : 400,
2360
2367
  opacity: 1
@@ -2365,7 +2372,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2365
2372
  ]
2366
2373
  });
2367
2374
  }
2368
- function Lt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2375
+ function zt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2369
2376
  let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
2370
2377
  return e.length ? /* @__PURE__ */ d("div", {
2371
2378
  ref: r,
@@ -2405,13 +2412,13 @@ function Lt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2405
2412
  }, e.key))]
2406
2413
  }) : null;
2407
2414
  }
2408
- function Rt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: l, openColor: f, borderColor: p, style: m, nodeRef: h }) {
2415
+ function Bt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: l, openColor: f, borderColor: p, style: m, nodeRef: h }) {
2409
2416
  let [g, _] = c(() => new Set(e.length ? [e[0].key] : []));
2410
2417
  if (!e.length) return null;
2411
2418
  let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
2412
2419
  let n = Number(e);
2413
2420
  return e === "" || e == null || !Number.isFinite(n) ? t : n;
2414
- }, b = kt[r], x = (e) => _((t) => {
2421
+ }, b = jt[r], x = (e) => _((t) => {
2415
2422
  let r = new Set(n ? t : []);
2416
2423
  return t.has(e) ? r.delete(e) : r.add(e), r;
2417
2424
  });
@@ -2486,15 +2493,15 @@ function Rt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
2486
2493
  })
2487
2494
  });
2488
2495
  }
2489
- var zt = {
2496
+ var Vt = {
2490
2497
  display: "flex",
2491
2498
  flexDirection: "column",
2492
2499
  gap: "12px"
2493
- }, Bt = {
2500
+ }, Ht = {
2494
2501
  fontSize: "14px",
2495
2502
  fontWeight: 500,
2496
2503
  color: "var(--page-text, #111827)"
2497
- }, Vt = {
2504
+ }, Ut = {
2498
2505
  padding: "10px 12px",
2499
2506
  border: "1px solid var(--page-border, #d1d5db)",
2500
2507
  borderRadius: "6px",
@@ -2504,18 +2511,18 @@ var zt = {
2504
2511
  boxSizing: "border-box",
2505
2512
  backgroundColor: "var(--page-surface, #f2f2f2)",
2506
2513
  color: "var(--page-text, #111827)"
2507
- }, Ht = {
2514
+ }, Wt = {
2508
2515
  display: "flex",
2509
2516
  alignItems: "center",
2510
2517
  gap: "8px",
2511
2518
  fontSize: "14px",
2512
2519
  color: "var(--page-text, #111827)"
2513
- }, Ut = (e) => e ? {
2520
+ }, Gt = (e) => e ? {
2514
2521
  readOnly: !0,
2515
2522
  tabIndex: -1,
2516
2523
  onMouseDown: (e) => e.preventDefault()
2517
2524
  } : {};
2518
- function Wt(e, t) {
2525
+ function Kt(e, t) {
2519
2526
  if (!e) return !0;
2520
2527
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
2521
2528
  switch (e.op) {
@@ -2529,11 +2536,11 @@ function Wt(e, t) {
2529
2536
  default: return !1;
2530
2537
  }
2531
2538
  }
2532
- var Gt = {
2539
+ var qt = {
2533
2540
  display: "flex",
2534
2541
  flexDirection: "column",
2535
2542
  gap: 6
2536
- }, Kt = {
2543
+ }, Jt = {
2537
2544
  font: "inherit",
2538
2545
  fontSize: 15,
2539
2546
  padding: "10px 12px",
@@ -2544,17 +2551,17 @@ var Gt = {
2544
2551
  width: "100%",
2545
2552
  boxSizing: "border-box"
2546
2553
  };
2547
- function qt(e, t) {
2554
+ function Yt(e, t) {
2548
2555
  let n = Array.isArray(e?.options) ? e.options : [];
2549
2556
  if (!e?.parentField) return n;
2550
2557
  let r = t?.[e.parentField];
2551
2558
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
2552
2559
  }
2553
- var Jt = "g-recaptcha-response", Yt = (e) => e?.type === "recaptcha" ? Jt : e?.name;
2554
- function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2560
+ var Xt = "g-recaptcha-response", Zt = (e) => e?.type === "recaptcha" ? Xt : e?.name;
2561
+ function Qt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2555
2562
  let a = /* @__PURE__ */ d("span", {
2556
2563
  style: {
2557
- ...Bt,
2564
+ ...Ht,
2558
2565
  fontSize: 14
2559
2566
  },
2560
2567
  children: [e.label, e.required ? " *" : ""]
@@ -2563,7 +2570,7 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2563
2570
  required: e.required || void 0,
2564
2571
  placeholder: e.placeholder || void 0,
2565
2572
  disabled: r || void 0,
2566
- style: Kt,
2573
+ style: Jt,
2567
2574
  value: t ?? "",
2568
2575
  onChange: (t) => n(e.name, t.target.value)
2569
2576
  };
@@ -2592,11 +2599,11 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2592
2599
  borderRadius: 8,
2593
2600
  display: "block"
2594
2601
  }
2595
- }) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(tn, {
2602
+ }) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(rn, {
2596
2603
  theme: e.captchaTheme,
2597
2604
  size: e.captchaSize,
2598
2605
  inert: r,
2599
- onChange: (e) => n(Jt, e)
2606
+ onChange: (e) => n(Xt, e)
2600
2607
  }) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(lt, {
2601
2608
  url: e.src,
2602
2609
  style: { width: "100%" }
@@ -2609,14 +2616,14 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2609
2616
  display: "block"
2610
2617
  }
2611
2618
  }) : null : /* @__PURE__ */ d("label", {
2612
- style: Gt,
2619
+ style: qt,
2613
2620
  children: [
2614
2621
  a,
2615
2622
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
2616
2623
  ...o,
2617
2624
  rows: 4,
2618
2625
  style: {
2619
- ...Kt,
2626
+ ...Jt,
2620
2627
  resize: "vertical"
2621
2628
  }
2622
2629
  }) : e.type === "select" ? /* @__PURE__ */ d("select", {
@@ -2625,7 +2632,7 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2625
2632
  children: [/* @__PURE__ */ u("option", {
2626
2633
  value: "",
2627
2634
  children: e.placeholder || "—"
2628
- }), qt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
2635
+ }), Yt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
2629
2636
  value: typeof e == "string" ? e : e.value,
2630
2637
  children: typeof e == "string" ? e : e.label ?? e.value
2631
2638
  }, t))]
@@ -2672,7 +2679,7 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2672
2679
  ]
2673
2680
  });
2674
2681
  }
2675
- function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
2682
+ function $t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
2676
2683
  let { tenant: y, apiUrl: b } = r(Z), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
2677
2684
  i(() => {
2678
2685
  if (!f || !s) return;
@@ -2694,11 +2701,11 @@ function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2694
2701
  section: e,
2695
2702
  fields: []
2696
2703
  }) : j[j.length - 1].fields.push(e);
2697
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Wt(e.section.condition, T)).map((e) => ({
2704
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Kt(e.section.condition, T)).map((e) => ({
2698
2705
  ...e,
2699
- fields: e.fields.filter((e) => Wt(e.condition, T))
2706
+ fields: e.fields.filter((e) => Kt(e.condition, T))
2700
2707
  })), P = M.length > 1, F = Math.min(D, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
2701
- let t = T[Yt(e)];
2708
+ let t = T[Zt(e)];
2702
2709
  return e.required && (t == null || t === "" || t === !1);
2703
2710
  }), R = F >= N.length - 1, z = (e, t) => E((n) => {
2704
2711
  let r = {
@@ -2754,11 +2761,11 @@ function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2754
2761
  }
2755
2762
  },
2756
2763
  style: {
2757
- ...zt,
2764
+ ...Vt,
2758
2765
  display: k === "success" ? "none" : "flex"
2759
2766
  },
2760
2767
  children: f && s ? /* @__PURE__ */ d(l, { children: [
2761
- P && /* @__PURE__ */ u(En, {
2768
+ P && /* @__PURE__ */ u(Nn, {
2762
2769
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
2763
2770
  active: F + 1,
2764
2771
  style: { marginBottom: 8 }
@@ -2771,9 +2778,9 @@ function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2771
2778
  },
2772
2779
  children: N[F].section.help
2773
2780
  }),
2774
- I.map((e) => /* @__PURE__ */ u(Xt, {
2781
+ I.map((e) => /* @__PURE__ */ u(Qt, {
2775
2782
  field: e,
2776
- value: T[Yt(e)],
2783
+ value: T[Zt(e)],
2777
2784
  values: T,
2778
2785
  onChange: z,
2779
2786
  inert: h
@@ -2844,10 +2851,10 @@ function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2844
2851
  ]
2845
2852
  });
2846
2853
  }
2847
- var Qt = null, $t = null, en = (e) => {
2854
+ var en = null, tn = null, nn = (e) => {
2848
2855
  let t = typeof e == "string" && e.trim() ? e.trim() : "";
2849
- if (Qt && $t === t) return Qt;
2850
- if (Qt && typeof window < "u") {
2856
+ if (en && tn === t) return en;
2857
+ if (en && typeof window < "u") {
2851
2858
  for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
2852
2859
  delete window[e];
2853
2860
  } catch {
@@ -2855,22 +2862,22 @@ var Qt = null, $t = null, en = (e) => {
2855
2862
  }
2856
2863
  document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
2857
2864
  }
2858
- return $t = t, Qt = new Promise((e) => {
2865
+ return tn = t, en = new Promise((e) => {
2859
2866
  if (typeof window > "u") return;
2860
2867
  if (window.grecaptcha?.render) return e(window.grecaptcha);
2861
2868
  window.__webimRecaptchaReady = () => e(window.grecaptcha);
2862
2869
  let n = document.createElement("script");
2863
2870
  n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
2864
- }), Qt;
2871
+ }), en;
2865
2872
  };
2866
- function tn({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
2873
+ function rn({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
2867
2874
  let p = r(Z), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
2868
2875
  if (_.current = f, i(() => {
2869
2876
  if (l || !h || !g.current) return;
2870
2877
  let e = !0, r = (t) => {
2871
2878
  e && typeof _.current == "function" && _.current(t);
2872
2879
  };
2873
- return en(a).then((i) => {
2880
+ return nn(a).then((i) => {
2874
2881
  if (!(!e || !g.current || !i?.render)) {
2875
2882
  g.current.innerHTML = "", r("");
2876
2883
  try {
@@ -2952,17 +2959,17 @@ function tn({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
2952
2959
  children: /* @__PURE__ */ u("div", { ref: g })
2953
2960
  }) : null;
2954
2961
  }
2955
- function nn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2962
+ function an({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2956
2963
  return /* @__PURE__ */ u("label", {
2957
2964
  ref: r,
2958
2965
  style: {
2959
- ...Bt,
2966
+ ...Ht,
2960
2967
  ...A(n)
2961
2968
  },
2962
2969
  children: Ge(t, e, i)
2963
2970
  });
2964
2971
  }
2965
- function rn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2972
+ function on({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2966
2973
  return /* @__PURE__ */ u("input", {
2967
2974
  ref: a,
2968
2975
  type: e,
@@ -2970,13 +2977,13 @@ function rn({ type: e = "text", name: t, placeholder: n, required: r, style: i,
2970
2977
  placeholder: n,
2971
2978
  required: !o && !!r,
2972
2979
  style: {
2973
- ...Vt,
2980
+ ...Ut,
2974
2981
  ...A(i)
2975
2982
  },
2976
- ...Ut(o)
2983
+ ...Gt(o)
2977
2984
  });
2978
2985
  }
2979
- function an({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2986
+ function sn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2980
2987
  return /* @__PURE__ */ u("textarea", {
2981
2988
  ref: a,
2982
2989
  name: e || void 0,
@@ -2984,18 +2991,18 @@ function an({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
2984
2991
  rows: n,
2985
2992
  required: !o && !!r,
2986
2993
  style: {
2987
- ...Vt,
2994
+ ...Ut,
2988
2995
  resize: "vertical",
2989
2996
  ...A(i)
2990
2997
  },
2991
- ...Ut(o)
2998
+ ...Gt(o)
2992
2999
  });
2993
3000
  }
2994
- function on({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
3001
+ function cn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2995
3002
  return /* @__PURE__ */ d("label", {
2996
3003
  ref: o,
2997
3004
  style: {
2998
- ...Ht,
3005
+ ...Wt,
2999
3006
  ...A(a)
3000
3007
  },
3001
3008
  children: [/* @__PURE__ */ u("input", {
@@ -3012,7 +3019,7 @@ function on({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
3012
3019
  }), t]
3013
3020
  });
3014
3021
  }
3015
- function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
3022
+ function ln({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
3016
3023
  return /* @__PURE__ */ d("select", {
3017
3024
  ref: a,
3018
3025
  name: e || void 0,
@@ -3021,7 +3028,7 @@ function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
3021
3028
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
3022
3029
  tabIndex: o ? -1 : void 0,
3023
3030
  style: {
3024
- ...Vt,
3031
+ ...Ut,
3025
3032
  appearance: "auto",
3026
3033
  ...A(i)
3027
3034
  },
@@ -3035,12 +3042,12 @@ function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
3035
3042
  }, t))]
3036
3043
  });
3037
3044
  }
3038
- function cn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
3045
+ function un({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
3039
3046
  let [s, l] = c(null);
3040
3047
  return /* @__PURE__ */ d("label", {
3041
3048
  ref: a,
3042
3049
  style: {
3043
- ...Vt,
3050
+ ...Ut,
3044
3051
  display: "flex",
3045
3052
  alignItems: "center",
3046
3053
  gap: "8px",
@@ -3067,7 +3074,7 @@ function cn({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
3067
3074
  ]
3068
3075
  });
3069
3076
  }
3070
- function ln({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3077
+ function dn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3071
3078
  return /* @__PURE__ */ u("button", {
3072
3079
  ref: n,
3073
3080
  type: r ? "button" : "submit",
@@ -3087,7 +3094,7 @@ function ln({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3087
3094
  children: e
3088
3095
  });
3089
3096
  }
3090
- function un({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3097
+ function fn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3091
3098
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
3092
3099
  return /* @__PURE__ */ u("div", {
3093
3100
  ref: r,
@@ -3104,7 +3111,7 @@ function un({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3104
3111
  }, t))
3105
3112
  });
3106
3113
  }
3107
- function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
3114
+ function pn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
3108
3115
  let { tenant: v, apiUrl: y, locale: b } = r(Z), x = r(we), S = r(xe), [, C] = c(0);
3109
3116
  i(() => {
3110
3117
  if (typeof window > "u") return;
@@ -3223,7 +3230,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
3223
3230
  })
3224
3231
  });
3225
3232
  }
3226
- function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
3233
+ function mn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
3227
3234
  let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Q(), s = {
3228
3235
  height: 34,
3229
3236
  padding: "0 12px",
@@ -3272,7 +3279,7 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3272
3279
  name: `f_${e.name}`,
3273
3280
  defaultValue: o[e.name] ?? "",
3274
3281
  style: s,
3275
- ...Ut(i),
3282
+ ...Gt(i),
3276
3283
  children: [/* @__PURE__ */ u("option", {
3277
3284
  value: "",
3278
3285
  children: e.label || e.name
@@ -3287,7 +3294,7 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3287
3294
  name: `f_${e.name}`,
3288
3295
  defaultValue: o[e.name] ?? "",
3289
3296
  style: s,
3290
- ...Ut(i),
3297
+ ...Gt(i),
3291
3298
  children: [
3292
3299
  /* @__PURE__ */ u("option", {
3293
3300
  value: "",
@@ -3308,7 +3315,7 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3308
3315
  defaultValue: o[e.name] ?? "",
3309
3316
  placeholder: e.label || e.name,
3310
3317
  style: s,
3311
- ...Ut(i)
3318
+ ...Gt(i)
3312
3319
  }, e.name)), /* @__PURE__ */ u("button", {
3313
3320
  type: "submit",
3314
3321
  style: {
@@ -3321,12 +3328,12 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3321
3328
  fontWeight: 600,
3322
3329
  cursor: i ? "default" : "pointer"
3323
3330
  },
3324
- ...Ut(i),
3331
+ ...Gt(i),
3325
3332
  children: t
3326
3333
  })]
3327
3334
  });
3328
3335
  }
3329
- function pn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3336
+ function hn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3330
3337
  return e.length ? /* @__PURE__ */ u("nav", {
3331
3338
  ref: r,
3332
3339
  "aria-label": "Breadcrumb",
@@ -3376,7 +3383,7 @@ function pn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3376
3383
  })
3377
3384
  }) : null;
3378
3385
  }
3379
- function mn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: h }) {
3386
+ function gn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: h }) {
3380
3387
  let { tenant: g, apiUrl: _ } = r(Z), v = r(xe), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
3381
3388
  i(() => {
3382
3389
  if (!o || Number.isFinite(x)) return;
@@ -3461,15 +3468,15 @@ function mn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
3461
3468
  ]
3462
3469
  });
3463
3470
  }
3464
- var hn = "webim.page_mode", gn = () => {
3471
+ var _n = "webim.page_mode", vn = () => {
3465
3472
  if (typeof window > "u") return "auto";
3466
3473
  try {
3467
- let e = window.localStorage.getItem(hn);
3474
+ let e = window.localStorage.getItem(_n);
3468
3475
  return e === "light" || e === "dark" ? e : "auto";
3469
3476
  } catch {
3470
3477
  return "auto";
3471
3478
  }
3472
- }, _n = (e) => {
3479
+ }, yn = (e) => {
3473
3480
  let t = {
3474
3481
  width: 16,
3475
3482
  height: 16,
@@ -3501,13 +3508,13 @@ var hn = "webim.page_mode", gn = () => {
3501
3508
  rx: "2"
3502
3509
  }), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
3503
3510
  });
3504
- }, vn = {
3511
+ }, bn = {
3505
3512
  light: "Light theme",
3506
3513
  dark: "Dark theme",
3507
3514
  auto: "Follow the device theme"
3508
3515
  };
3509
- function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3510
- let [o, l] = c(a ? "auto" : gn), d = s(null), f = (e) => {
3516
+ function xn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3517
+ let [o, l] = c(a ? "auto" : vn), d = s(null), f = (e) => {
3511
3518
  d.current = e, typeof r == "function" && r(e);
3512
3519
  };
3513
3520
  i(() => {
@@ -3515,7 +3522,7 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3515
3522
  let e = d.current?.closest?.(".webim-page");
3516
3523
  e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
3517
3524
  try {
3518
- o === "auto" ? window.localStorage.removeItem(hn) : window.localStorage.setItem(hn, o);
3525
+ o === "auto" ? window.localStorage.removeItem(_n) : window.localStorage.setItem(_n, o);
3519
3526
  } catch {}
3520
3527
  }, [o, a]);
3521
3528
  let p = t === !1 ? ["light", "dark"] : [
@@ -3550,8 +3557,8 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3550
3557
  },
3551
3558
  children: p.map((e) => /* @__PURE__ */ u("button", {
3552
3559
  type: "button",
3553
- title: vn[e],
3554
- "aria-label": vn[e],
3560
+ title: bn[e],
3561
+ "aria-label": bn[e],
3555
3562
  "aria-pressed": e === m,
3556
3563
  onClick: a ? void 0 : () => l(e),
3557
3564
  style: {
@@ -3562,15 +3569,15 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3562
3569
  background: e === m ? "var(--page-accent, #111827)" : "transparent",
3563
3570
  opacity: e === m ? 1 : .7
3564
3571
  },
3565
- children: _n(e)
3572
+ children: yn(e)
3566
3573
  }, e))
3567
3574
  });
3568
3575
  let g = p[(p.indexOf(m) + 1) % p.length];
3569
3576
  return /* @__PURE__ */ u("button", {
3570
3577
  ref: f,
3571
3578
  type: "button",
3572
- title: vn[m],
3573
- "aria-label": `Theme: ${vn[m]} — switch to ${vn[g]}`,
3579
+ title: bn[m],
3580
+ "aria-label": `Theme: ${bn[m]} — switch to ${bn[g]}`,
3574
3581
  onClick: a ? void 0 : () => l(g),
3575
3582
  style: {
3576
3583
  ...h,
@@ -3579,10 +3586,10 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3579
3586
  border: "1px solid rgba(148, 163, 184, 0.4)",
3580
3587
  ...A(n)
3581
3588
  },
3582
- children: _n(m)
3589
+ children: yn(m)
3583
3590
  });
3584
3591
  }
3585
- function bn(e) {
3592
+ function Sn(e) {
3586
3593
  let t = e?.parentElement;
3587
3594
  for (; t && t !== document.body;) {
3588
3595
  let e = getComputedStyle(t).overflowY;
@@ -3591,7 +3598,7 @@ function bn(e) {
3591
3598
  }
3592
3599
  return window;
3593
3600
  }
3594
- var xn = (e) => e === window ? window.scrollY : e.scrollTop, Sn = {
3601
+ var Cn = (e) => e === window ? window.scrollY : e.scrollTop, wn = {
3595
3602
  "bottom-right": (e) => ({
3596
3603
  right: e,
3597
3604
  bottom: e
@@ -3605,8 +3612,122 @@ var xn = (e) => e === window ? window.scrollY : e.scrollTop, Sn = {
3605
3612
  bottom: e,
3606
3613
  transform: "translateX(-50%)"
3607
3614
  })
3615
+ }, Tn = {
3616
+ linear: (e) => e,
3617
+ out: (e) => 1 - (1 - e) ** 3,
3618
+ inout: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2
3619
+ }, En = (e) => {
3620
+ let t = e.getBoundingClientRect(), n = e.parentElement;
3621
+ for (; n && n !== document.body;) {
3622
+ let e = getComputedStyle(n);
3623
+ if (/(auto|scroll)/.test(e.overflowY) && n.scrollHeight > n.clientHeight) break;
3624
+ n = n.parentElement;
3625
+ }
3626
+ return !n || n === document.body ? Math.max(document.documentElement.scrollHeight - (t.bottom + window.scrollY), 0) : Math.max(n.scrollHeight - (t.bottom - n.getBoundingClientRect().top + n.scrollTop), 0);
3627
+ }, Dn = (e, t) => {
3628
+ let n = typeof e == "number" ? e : parseFloat(e);
3629
+ return Number.isFinite(n) ? n : t;
3608
3630
  };
3609
- function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
3631
+ function On(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
3632
+ let i = Math.min(Math.max(Math.round(Dn(n, 0)), 0), 6);
3633
+ try {
3634
+ return new Intl.NumberFormat(t || void 0, {
3635
+ minimumFractionDigits: i,
3636
+ maximumFractionDigits: i,
3637
+ useGrouping: r !== "none"
3638
+ }).format(e);
3639
+ } catch {
3640
+ return e.toFixed(i);
3641
+ }
3642
+ }
3643
+ function kn({ from: e, to: t, duration: n, delay: a, decimals: o, prefix: l, suffix: f, separator: p, easing: m, trigger: h, offset: g, once: _, label: v, align: y, style: b, nodeRef: x, inert: S }) {
3644
+ let { locale: C } = r(Z), w = Math.max(Dn(g, 0), 0), T = Dn(e, 0), E = Dn(t, 100), [D, O] = c(E), k = s(null), [j, M] = c(!1);
3645
+ return i(() => {
3646
+ let e = k.current;
3647
+ if (S || !j || !e) {
3648
+ O(E);
3649
+ return;
3650
+ }
3651
+ O(T);
3652
+ let t = Math.max(Dn(n, 2e3), 0), r = Math.max(Dn(a, 0), 0), i = Tn[m] || Tn.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, u = () => {
3653
+ if (cancelAnimationFrame(s), clearTimeout(c), o || t === 0) {
3654
+ O(E);
3655
+ return;
3656
+ }
3657
+ c = setTimeout(() => {
3658
+ let e = performance.now(), n = (r) => {
3659
+ let a = Math.min((r - e) / t, 1);
3660
+ O(T + (E - T) * i(a)), a < 1 && (s = requestAnimationFrame(n));
3661
+ };
3662
+ s = requestAnimationFrame(n);
3663
+ }, r);
3664
+ };
3665
+ if (h === "load" || typeof IntersectionObserver > "u") return u(), () => {
3666
+ cancelAnimationFrame(s), clearTimeout(c);
3667
+ };
3668
+ let d = new IntersectionObserver((e) => {
3669
+ let t = e.some((e) => e.isIntersecting);
3670
+ t && (!l || _ === !1) ? (l = !0, u()) : !t && _ === !1 && (cancelAnimationFrame(s), clearTimeout(c), O(T));
3671
+ }, {
3672
+ rootMargin: `0px 0px -${Math.min(w, Math.floor(En(e)))}px 0px`,
3673
+ threshold: w > 0 ? 0 : .3
3674
+ });
3675
+ return d.observe(e), () => {
3676
+ d.disconnect(), cancelAnimationFrame(s), clearTimeout(c);
3677
+ };
3678
+ }, [
3679
+ j,
3680
+ S,
3681
+ T,
3682
+ E,
3683
+ n,
3684
+ a,
3685
+ m,
3686
+ h,
3687
+ w,
3688
+ _
3689
+ ]), /* @__PURE__ */ d("div", {
3690
+ ref: (e) => {
3691
+ k.current = e, e && M(!0), typeof x == "function" && x(e);
3692
+ },
3693
+ "data-wb-counter": "",
3694
+ style: {
3695
+ display: "flex",
3696
+ flexDirection: "column",
3697
+ alignItems: y === "left" ? "flex-start" : y === "right" ? "flex-end" : "center",
3698
+ gap: 4,
3699
+ fontSize: 48,
3700
+ fontWeight: 700,
3701
+ lineHeight: 1.1,
3702
+ textAlign: y === "left" ? "left" : y === "right" ? "right" : "center",
3703
+ ...A(b)
3704
+ },
3705
+ children: [/* @__PURE__ */ d("span", {
3706
+ style: {
3707
+ fontVariantNumeric: "tabular-nums",
3708
+ whiteSpace: "nowrap"
3709
+ },
3710
+ children: [
3711
+ l || "",
3712
+ On(D, {
3713
+ locale: C,
3714
+ decimals: o,
3715
+ separator: p
3716
+ }),
3717
+ f || ""
3718
+ ]
3719
+ }), v ? /* @__PURE__ */ u("span", {
3720
+ style: {
3721
+ fontSize: "0.3em",
3722
+ fontWeight: 400,
3723
+ lineHeight: 1.4,
3724
+ opacity: .72
3725
+ },
3726
+ children: v
3727
+ }) : null]
3728
+ });
3729
+ }
3730
+ function An({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
3610
3731
  let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
3611
3732
  b(e), typeof p == "function" && p(e);
3612
3733
  };
@@ -3617,8 +3738,8 @@ function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3617
3738
  }
3618
3739
  if (!y) return;
3619
3740
  let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
3620
- let t = bn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
3621
- v(n || xn(t) > e);
3741
+ let t = Sn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
3742
+ v(n || Cn(t) > e);
3622
3743
  };
3623
3744
  return t(), document.addEventListener("scroll", t, {
3624
3745
  capture: !0,
@@ -3632,7 +3753,7 @@ function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3632
3753
  ]);
3633
3754
  let S = () => {
3634
3755
  if (m) return;
3635
- let e = bn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
3756
+ let e = Sn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
3636
3757
  e === window ? window.scrollTo({
3637
3758
  top: 0,
3638
3759
  behavior: n
@@ -3640,7 +3761,7 @@ function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3640
3761
  top: 0,
3641
3762
  behavior: n
3642
3763
  });
3643
- }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = Sn[n] ? n : "bottom-right", D = h ? {
3764
+ }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = wn[n] ? n : "bottom-right", D = h ? {
3644
3765
  position: "fixed",
3645
3766
  zIndex: 5,
3646
3767
  bottom: (h.bottom ?? 0) + C,
@@ -3653,7 +3774,7 @@ function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3653
3774
  } : {
3654
3775
  position: "fixed",
3655
3776
  zIndex: 2147482e3,
3656
- ...Sn[E](C)
3777
+ ...wn[E](C)
3657
3778
  };
3658
3779
  return /* @__PURE__ */ d("button", {
3659
3780
  ref: x,
@@ -3704,7 +3825,7 @@ function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3704
3825
  }), w ? /* @__PURE__ */ u("span", { children: T }) : null]
3705
3826
  });
3706
3827
  }
3707
- var wn = {
3828
+ var jn = {
3708
3829
  facebook: {
3709
3830
  label: "Facebook",
3710
3831
  color: "#1877f2",
@@ -3771,8 +3892,8 @@ var wn = {
3771
3892
  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"
3772
3893
  }
3773
3894
  };
3774
- function Tn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3775
- let l = Array.isArray(e) ? e.filter((e) => e && wn[e.network]) : [];
3895
+ function Mn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3896
+ let l = Array.isArray(e) ? e.filter((e) => e && jn[e.network]) : [];
3776
3897
  if (!l.length) return null;
3777
3898
  let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
3778
3899
  return /* @__PURE__ */ u("div", {
@@ -3785,7 +3906,7 @@ function Tn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
3785
3906
  ...A(o)
3786
3907
  },
3787
3908
  children: l.map((e, r) => {
3788
- let i = wn[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
3909
+ let i = jn[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);
3789
3910
  return /* @__PURE__ */ u("a", {
3790
3911
  href: e.url || "#",
3791
3912
  onClick: h,
@@ -3819,7 +3940,7 @@ function Tn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
3819
3940
  })
3820
3941
  });
3821
3942
  }
3822
- function En({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3943
+ function Nn({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3823
3944
  if (!t.length) return null;
3824
3945
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
3825
3946
  width: 32,
@@ -3897,7 +4018,7 @@ function En({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
3897
4018
  })
3898
4019
  });
3899
4020
  }
3900
- var Dn = {
4021
+ var Pn = {
3901
4022
  small: {
3902
4023
  w: 132,
3903
4024
  h: 46,
@@ -3919,21 +4040,21 @@ var Dn = {
3919
4040
  title: 12.5,
3920
4041
  avatar: 46
3921
4042
  }
3922
- }, On = (e) => Dn[e] ?? Dn.medium;
3923
- Dn.medium.w, Dn.medium.h;
3924
- var kn = (e) => String(e?.group ?? "").trim(), An = (e) => {
4043
+ }, Fn = (e) => Pn[e] ?? Pn.medium;
4044
+ Pn.medium.w, Pn.medium.h;
4045
+ var In = (e) => String(e?.group ?? "").trim(), Ln = (e) => {
3925
4046
  let t = [], n = /* @__PURE__ */ new Map();
3926
4047
  return e.forEach((e, r) => {
3927
- let i = kn(e) || `#${r}`;
4048
+ let i = In(e) || `#${r}`;
3928
4049
  n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
3929
4050
  }), t.flatMap((e) => n.get(e));
3930
4051
  };
3931
- function jn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
3932
- let i = On(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
4052
+ function Rn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
4053
+ let i = Fn(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
3933
4054
  for (let e of c) e.parent && l.has(e.parent) && e.parent !== e.id ? (u.has(e.parent) || u.set(e.parent, []), u.get(e.parent).push(e)) : d.push(e);
3934
- d = An(d);
3935
- for (let [e, t] of u) u.set(e, An(t));
3936
- let f = (e, t) => o + (kn(e) !== kn(t) && (kn(e) || kn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
4055
+ d = Ln(d);
4056
+ for (let [e, t] of u) u.set(e, Ln(t));
4057
+ let f = (e, t) => o + (In(e) !== In(t) && (In(e) || In(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
3937
4058
  if (t.has(e.id)) return 0;
3938
4059
  t.add(e.id);
3939
4060
  let n = u.get(e.id) ?? [], r = n.reduce((e, r, i) => e + m(r, t) + (i ? f(n[i - 1], r) : 0), 0), i = Math.max(a, r);
@@ -3949,7 +4070,7 @@ function jn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
3949
4070
  x: m,
3950
4071
  y: b
3951
4072
  });
3952
- let x = kn(e);
4073
+ let x = In(e);
3953
4074
  if (x) {
3954
4075
  let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
3955
4076
  _.has(t) || _.set(t, {
@@ -4023,18 +4144,18 @@ function jn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
4023
4144
  horizontal: n
4024
4145
  };
4025
4146
  }
4026
- var Mn = (e, t) => {
4147
+ var zn = (e, t) => {
4027
4148
  let n = String(e ?? "");
4028
4149
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
4029
- }, Nn = (e) => {
4150
+ }, Bn = (e) => {
4030
4151
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
4031
4152
  if (!t) return "#ffffff";
4032
4153
  let n = t[1];
4033
4154
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
4034
4155
  let r = parseInt(n, 16);
4035
4156
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
4036
- }, Pn = (e) => !!(e?.cv?.trim?.() || e?.photo);
4037
- function Fn(e, t = {}) {
4157
+ }, Vn = (e) => !!(e?.cv?.trim?.() || e?.photo);
4158
+ function Hn(e, t = {}) {
4038
4159
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : Oe(e);
4039
4160
  return n.map((e) => {
4040
4161
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
@@ -4050,11 +4171,11 @@ function Fn(e, t = {}) {
4050
4171
  };
4051
4172
  });
4052
4173
  }
4053
- var In = {
4174
+ var Un = {
4054
4175
  size: 36,
4055
4176
  pad: 10
4056
4177
  };
4057
- function Ln({ node: e, onClose: t }) {
4178
+ function Wn({ node: e, onClose: t }) {
4058
4179
  return i(() => {
4059
4180
  let e = (e) => e.key === "Escape" && t();
4060
4181
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -4175,7 +4296,7 @@ function Ln({ node: e, onClose: t }) {
4175
4296
  })
4176
4297
  });
4177
4298
  }
4178
- function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
4299
+ function Gn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
4179
4300
  let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(Z), O = r(xe)?.[t], [k, j] = c(null);
4180
4301
  i(() => {
4181
4302
  if (!t || O) return;
@@ -4192,7 +4313,7 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4192
4313
  D,
4193
4314
  O
4194
4315
  ]);
4195
- let M = t ? Fn(O ?? k ?? [], {
4316
+ let M = t ? Hn(O ?? k ?? [], {
4196
4317
  nameField: n,
4197
4318
  titleField: o,
4198
4319
  photoField: s,
@@ -4200,7 +4321,7 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4200
4321
  cvField: p,
4201
4322
  hrefField: m,
4202
4323
  groupField: h
4203
- }) : e, N = On(v), { boxes: P, links: F, groups: I, width: L, height: R } = jn(M, {
4324
+ }) : e, N = Fn(v), { boxes: P, links: F, groups: I, width: L, height: R } = Rn(M, {
4204
4325
  size: v,
4205
4326
  horizontal: y,
4206
4327
  groupTitles: g
@@ -4258,8 +4379,8 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4258
4379
  fontSize: N.title + 1,
4259
4380
  fontWeight: "600",
4260
4381
  opacity: "0.55",
4261
- fill: r ? Nn(e.color || _) : "var(--page-text, #111827)",
4262
- children: Mn(e.title, Math.floor(e.width / 7))
4382
+ fill: r ? Bn(e.color || _) : "var(--page-text, #111827)",
4383
+ children: zn(e.title, Math.floor(e.width / 7))
4263
4384
  })] }, `group-${t}`);
4264
4385
  }),
4265
4386
  F.map((e, t) => /* @__PURE__ */ u("path", {
@@ -4269,7 +4390,7 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4269
4390
  strokeWidth: "1.5"
4270
4391
  }, t)),
4271
4392
  P.map(({ node: e, x: t, y: n }) => {
4272
- let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Nn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Nn(e.color2) : s, f = S && (Pn(e) || e.href), p = () => Pn(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + In.pad + N.avatar + 8 : t + N.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((N.w - N.avatar - 26) / 7) : Math.floor(N.w / 7.6), _ = N.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
4393
+ let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Bn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Bn(e.color2) : s, f = S && (Vn(e) || e.href), p = () => Vn(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Un.pad + N.avatar + 8 : t + N.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((N.w - N.avatar - 26) / 7) : Math.floor(N.w / 7.6), _ = N.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
4273
4394
  return /* @__PURE__ */ d("g", {
4274
4395
  onClick: f ? p : void 0,
4275
4396
  style: f ? { cursor: "pointer" } : void 0,
@@ -4333,13 +4454,13 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4333
4454
  e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
4334
4455
  id: `${C}-${e.id}`,
4335
4456
  children: /* @__PURE__ */ u("circle", {
4336
- cx: t + In.pad + N.avatar / 2,
4457
+ cx: t + Un.pad + N.avatar / 2,
4337
4458
  cy: n + N.h / 2,
4338
4459
  r: N.avatar / 2
4339
4460
  })
4340
4461
  }), /* @__PURE__ */ u("image", {
4341
4462
  href: e.photo,
4342
- x: t + In.pad,
4463
+ x: t + Un.pad,
4343
4464
  y: n + (N.h - N.avatar) / 2,
4344
4465
  width: N.avatar,
4345
4466
  height: N.avatar,
@@ -4353,7 +4474,7 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4353
4474
  fontSize: N.title,
4354
4475
  fontWeight: "600",
4355
4476
  fill: s,
4356
- children: Mn(e.title, g + 4)
4477
+ children: zn(e.title, g + 4)
4357
4478
  }), e.name && /* @__PURE__ */ u("text", {
4358
4479
  x: m,
4359
4480
  y: n + _ + _ / 2 + N.name * .35,
@@ -4361,7 +4482,7 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4361
4482
  fontSize: N.name,
4362
4483
  fontWeight: "600",
4363
4484
  fill: c,
4364
- children: Mn(e.name, g)
4485
+ children: zn(e.name, g)
4365
4486
  })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
4366
4487
  x: m,
4367
4488
  y: n + (v[1] ? N.h * .43 : N.h * .57),
@@ -4369,7 +4490,7 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4369
4490
  fontSize: N.name,
4370
4491
  fontWeight: "600",
4371
4492
  fill: s,
4372
- children: Mn(v[0], g)
4493
+ children: zn(v[0], g)
4373
4494
  }), v[1] && /* @__PURE__ */ u("text", {
4374
4495
  x: m,
4375
4496
  y: n + N.h * .73,
@@ -4377,19 +4498,19 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4377
4498
  fontSize: N.title,
4378
4499
  opacity: "0.7",
4379
4500
  fill: s,
4380
- children: Mn(v[1], g + 4)
4501
+ children: zn(v[1], g + 4)
4381
4502
  })] })
4382
4503
  ]
4383
4504
  }, e.id);
4384
4505
  })
4385
4506
  ]
4386
- }), w && /* @__PURE__ */ u(Ln, {
4507
+ }), w && /* @__PURE__ */ u(Wn, {
4387
4508
  node: w,
4388
4509
  onClose: () => T(null)
4389
4510
  })]
4390
4511
  });
4391
4512
  }
4392
- function zn({ value: e, onCommit: t, style: n, hint: r }) {
4513
+ function Kn({ value: e, onCommit: t, style: n, hint: r }) {
4393
4514
  let [a, o] = c(!1), l = s(null);
4394
4515
  return i(() => {
4395
4516
  if (!a || !l.current) return;
@@ -4419,7 +4540,7 @@ function zn({ value: e, onCommit: t, style: n, hint: r }) {
4419
4540
  children: e ?? ""
4420
4541
  });
4421
4542
  }
4422
- var Bn = 360, Vn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", Hn = (e, t) => e && t ? `cell-${e}-${t}` : "", Un = (e) => {
4543
+ var qn = 360, Jn = "\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", Yn = (e, t) => e && t ? `cell-${e}-${t}` : "", Xn = (e) => {
4423
4544
  if (!e || typeof e != "object") return e ?? "";
4424
4545
  let t = String(e.text ?? "");
4425
4546
  return typeof e.href == "string" && e.href ? /* @__PURE__ */ u("a", {
@@ -4430,7 +4551,7 @@ var Bn = 360, Vn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
4430
4551
  children: t
4431
4552
  }) : t;
4432
4553
  };
4433
- function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], colKeys: o = [], heights: f = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: j, style: M, nodeRef: N, edit: P }) {
4554
+ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], colKeys: o = [], heights: f = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: j, style: M, nodeRef: N, edit: P }) {
4434
4555
  let F = s(null), I = s(null), [L, R] = c(null), [z, B] = c(null), V = (e, t) => () => R({
4435
4556
  r: e,
4436
4557
  c: t
@@ -4444,7 +4565,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4444
4565
  }
4445
4566
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
4446
4567
  top: r.bottom - n.top + 4,
4447
- left: Math.max(0, Math.min(r.left - n.left, n.width - Bn))
4568
+ left: Math.max(0, Math.min(r.left - n.left, n.width - qn))
4448
4569
  };
4449
4570
  (z?.top !== i.top || z?.left !== i.left) && B(i);
4450
4571
  }), i(() => {
@@ -4500,7 +4621,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4500
4621
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
4501
4622
  }, ye = /* @__PURE__ */ new Set();
4502
4623
  p && K.forEach((t, n) => e.forEach((e, t) => {
4503
- let r = p[Hn(a[n], o[t])];
4624
+ let r = p[Yn(a[n], o[t])];
4504
4625
  if (!r) return;
4505
4626
  let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
4506
4627
  for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && ye.add(`${n + e},${t + r}`);
@@ -4523,7 +4644,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4523
4644
  },
4524
4645
  onClick: n,
4525
4646
  children: e
4526
- }, t), X = L && L.r < K.length && L.c < e.length ? L : null, Q = (e, t) => P?.labels?.[e] ?? t, Ce = X ? p?.[Hn(a[X.r], o[X.c])] : null, we = Math.max(1, Number(Ce?.c) || 1), Te = Math.max(1, Number(Ce?.r) || 1);
4647
+ }, t), X = L && L.r < K.length && L.c < e.length ? L : null, Q = (e, t) => P?.labels?.[e] ?? t, Ce = X ? p?.[Yn(a[X.r], o[X.c])] : null, we = Math.max(1, Number(Ce?.c) || 1), Te = Math.max(1, Number(Ce?.r) || 1);
4527
4648
  return /* @__PURE__ */ d("div", {
4528
4649
  ref: (e) => {
4529
4650
  I.current = e, typeof N == "function" && N(e);
@@ -4534,7 +4655,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4534
4655
  ...ge
4535
4656
  },
4536
4657
  children: [
4537
- P && /* @__PURE__ */ u("style", { children: Vn }),
4658
+ P && /* @__PURE__ */ u("style", { children: Jn }),
4538
4659
  P && X && z && /* @__PURE__ */ d("div", {
4539
4660
  className: "wb-tedit-bar",
4540
4661
  style: {
@@ -4600,7 +4721,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4600
4721
  } : P ? { position: "relative" } : null,
4601
4722
  ...se
4602
4723
  },
4603
- children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(zn, {
4724
+ children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(Kn, {
4604
4725
  value: t.label ?? t,
4605
4726
  onCommit: (e) => P.header(n, e),
4606
4727
  hint: Q("editCell", "Double-click to edit"),
@@ -4628,7 +4749,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4628
4749
  },
4629
4750
  children: e.map((e, r) => {
4630
4751
  if (ye.has(`${n},${r}`)) return null;
4631
- let i = Hn(a[n], o[r]), s = m?.[i], c = p?.[i], l = Math.max(1, Number(c?.c) || 1), f = Math.max(1, Number(c?.r) || 1);
4752
+ let i = Yn(a[n], o[r]), s = m?.[i], c = p?.[i], l = Math.max(1, Number(c?.c) || 1), f = Math.max(1, Number(c?.r) || 1);
4632
4753
  return /* @__PURE__ */ d("td", {
4633
4754
  className: P ? `wb-tedit-cell${L?.r === n && L?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
4634
4755
  onMouseDownCapture: _e ? V(n, r) : void 0,
@@ -4641,7 +4762,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4641
4762
  ...P ? { position: "relative" } : null,
4642
4763
  ...se
4643
4764
  },
4644
- children: [s ?? Un(t?.[r]), P && _e && /* @__PURE__ */ u("span", {
4765
+ children: [s ?? Xn(t?.[r]), P && _e && /* @__PURE__ */ u("span", {
4645
4766
  className: "wb-tedit-rowgrip",
4646
4767
  title: Q("rowHeight", "Drag to set the row height — double-click to fit the content"),
4647
4768
  onPointerDown: be(n),
@@ -4656,7 +4777,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4656
4777
  ]
4657
4778
  });
4658
4779
  }
4659
- var Gn = {
4780
+ var Qn = {
4660
4781
  small: {
4661
4782
  cell: 62,
4662
4783
  font: 10.5,
@@ -4681,8 +4802,8 @@ var Gn = {
4681
4802
  pad: 8,
4682
4803
  gap: 4
4683
4804
  }
4684
- }, Kn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, qn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Jn = 366;
4685
- function Yn(e, t = {}) {
4805
+ }, $n = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, er = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), tr = 366;
4806
+ function nr(e, t = {}) {
4686
4807
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : Oe(e), a = (e) => {
4687
4808
  let t = i(r(e)), n = t ? new Date(t) : null;
4688
4809
  return n && !Number.isNaN(n.getTime()) ? n : null;
@@ -4699,7 +4820,7 @@ function Yn(e, t = {}) {
4699
4820
  } : null;
4700
4821
  }).filter(Boolean);
4701
4822
  }
4702
- function Xn(e) {
4823
+ function rr(e) {
4703
4824
  return (Array.isArray(e) ? e : []).map((e, t) => {
4704
4825
  let n = e?.start ? new Date(e.start) : null;
4705
4826
  if (!n || Number.isNaN(n.getTime())) return null;
@@ -4714,19 +4835,19 @@ function Xn(e) {
4714
4835
  };
4715
4836
  }).filter(Boolean);
4716
4837
  }
4717
- function Zn(e) {
4838
+ function ir(e) {
4718
4839
  let t = /* @__PURE__ */ new Map();
4719
4840
  for (let n of e) {
4720
- let e = qn(n.start), r = n.end ? qn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Jn);
4841
+ let e = er(n.start), r = n.end ? er(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), tr);
4721
4842
  for (let r = 0; r <= i; r += 1) {
4722
- let i = Kn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
4843
+ let i = $n(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
4723
4844
  t.has(i) || t.set(i, []), t.get(i).push(n);
4724
4845
  }
4725
4846
  }
4726
4847
  for (let e of t.values()) e.sort((e, t) => e.start - t.start);
4727
4848
  return t;
4728
4849
  }
4729
- function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a = "", endField: o = "", hrefField: s = "", colorField: f = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
4850
+ function ar({ events: e = [], source: t = "", titleField: n = "", startField: a = "", endField: o = "", hrefField: s = "", colorField: f = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
4730
4851
  let { tenant: T, apiUrl: E, locale: D } = r(Z), O = r(xe)?.[t], [k, j] = c(null), [M, N] = c(() => {
4731
4852
  let e = /* @__PURE__ */ new Date();
4732
4853
  return {
@@ -4749,13 +4870,13 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
4749
4870
  E,
4750
4871
  O
4751
4872
  ]);
4752
- let P = Gn[m] ?? Gn.medium, F = h || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = g || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? Yn(O ?? k ?? [], {
4873
+ let P = Qn[m] ?? Qn.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 ? nr(O ?? k ?? [], {
4753
4874
  titleField: n,
4754
4875
  startField: a,
4755
4876
  endField: o,
4756
4877
  hrefField: s,
4757
4878
  colorField: f
4758
- }) : Xn(e), B = Zn(z), V = D || void 0, H = (e, t) => {
4879
+ }) : rr(e), B = ir(z), V = D || void 0, H = (e, t) => {
4759
4880
  let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
4760
4881
  width: 6,
4761
4882
  height: 6,
@@ -4887,9 +5008,9 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
4887
5008
  })]
4888
5009
  });
4889
5010
  }
4890
- let re = new Date(M.year, M.month, 1), ie = y === "sunday" ? 0 : 1, W = (re.getDay() - ie + 7) % 7, G = new Date(M.year, M.month + 1, 0).getDate(), K = Math.ceil((W + G) / 7), ae = Kn(/* @__PURE__ */ new Date()), q = new Intl.DateTimeFormat(V, { weekday: "short" }), J = [];
5011
+ let re = new Date(M.year, M.month, 1), ie = y === "sunday" ? 0 : 1, W = (re.getDay() - ie + 7) % 7, G = new Date(M.year, M.month + 1, 0).getDate(), K = Math.ceil((W + G) / 7), ae = $n(/* @__PURE__ */ new Date()), q = new Intl.DateTimeFormat(V, { weekday: "short" }), J = [];
4891
5012
  for (let e = 0; e < K * 7; e += 1) {
4892
- let t = e - W + 1, n = t >= 1 && t <= G, r = Kn(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ae;
5013
+ let t = e - W + 1, n = t >= 1 && t <= G, r = $n(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ae;
4893
5014
  J.push(/* @__PURE__ */ d("div", {
4894
5015
  style: {
4895
5016
  minHeight: P.cell,
@@ -4954,12 +5075,12 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
4954
5075
  ]
4955
5076
  });
4956
5077
  }
4957
- var $n = {
5078
+ var or = {
4958
5079
  small: 36,
4959
5080
  medium: 56,
4960
5081
  large: 88
4961
5082
  };
4962
- function er(e, t = {}) {
5083
+ function sr(e, t = {}) {
4963
5084
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : Oe(e);
4964
5085
  return n.map((e) => {
4965
5086
  let n = e.data ?? e, i = Ee(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(Ee(n, t.nameField)) : r(n.name);
@@ -4970,7 +5091,7 @@ function er(e, t = {}) {
4970
5091
  };
4971
5092
  }).filter((e) => e.src);
4972
5093
  }
4973
- function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a = "", hrefField: o = "", variant: f = "step", size: p = "medium", perView: m = 5, gap: h = 48, hold: g = 3, slideMs: _ = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
5094
+ function cr({ logos: e = [], source: t = "", imageField: n = "", nameField: a = "", hrefField: o = "", variant: f = "step", size: p = "medium", perView: m = 5, gap: h = 48, hold: g = 3, slideMs: _ = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
4974
5095
  let { tenant: D, apiUrl: O } = r(Z), k = r(xe)?.[t], [j, M] = c(null), N = s(null), P = s(null), [F, I] = c(0), [L, R] = c(0), [z, B] = c(0), [V, H] = c(!0), [U, ee] = c(!1), [te, ne] = c(!1);
4975
5096
  i(() => {
4976
5097
  if (!t || k) return;
@@ -5010,11 +5131,11 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5010
5131
  t = !1, r.forEach((e) => e.removeEventListener("load", n));
5011
5132
  };
5012
5133
  });
5013
- let re = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ie = t ? er(k ?? j ?? [], {
5134
+ let re = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ie = t ? sr(k ?? j ?? [], {
5014
5135
  imageField: n,
5015
5136
  nameField: a,
5016
5137
  hrefField: o
5017
- }) : re, W = $n[p] ?? $n.medium, G = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ae = f === "marquee" ? "step" : f, q = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), J = Math.min(3e3, Math.max(100, Number(_) || 500)), oe = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || W * 3) + G, ce = F ? Math.max(1, Math.floor(F / se)) : oe, le = Math.min(oe, ce), ue = F ? Math.min(se, F / le) : se;
5138
+ }) : re, W = or[p] ?? or.medium, G = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ae = f === "marquee" ? "step" : f, q = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), J = Math.min(3e3, Math.max(100, Number(_) || 500)), oe = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || W * 3) + G, ce = F ? Math.max(1, Math.floor(F / se)) : oe, le = Math.min(oe, ce), ue = F ? Math.min(se, F / le) : se;
5018
5139
  if (!ie.length) return /* @__PURE__ */ u("div", {
5019
5140
  ref: T,
5020
5141
  style: {
@@ -5199,7 +5320,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5199
5320
  be,
5200
5321
  Se ? Q(1) : null
5201
5322
  ] }),
5202
- /* @__PURE__ */ u(nr, {
5323
+ /* @__PURE__ */ u(lr, {
5203
5324
  running: me,
5204
5325
  every: q + J,
5205
5326
  slide: J,
@@ -5213,7 +5334,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5213
5334
  ]
5214
5335
  });
5215
5336
  }
5216
- function nr({ running: e, every: t, slide: n, step: r, index: a, total: o, home: s, setIndex: c, setAnimate: l }) {
5337
+ function lr({ running: e, every: t, slide: n, step: r, index: a, total: o, home: s, setIndex: c, setAnimate: l }) {
5217
5338
  i(() => {
5218
5339
  if (!e) return;
5219
5340
  let n = setInterval(() => {
@@ -5249,13 +5370,13 @@ function nr({ running: e, every: t, slide: n, step: r, index: a, total: o, home:
5249
5370
  l
5250
5371
  ]), null;
5251
5372
  }
5252
- var rr = {
5373
+ var ur = {
5253
5374
  small: 380,
5254
5375
  medium: 560,
5255
5376
  large: 820,
5256
5377
  full: "100%"
5257
5378
  };
5258
- function ir({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: a = 0, size: o = "medium", title: l = "", showClose: f = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
5379
+ function dr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: a = 0, size: o = "medium", title: l = "", showClose: f = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
5259
5380
  let [C, w] = c(!1), T = s(null);
5260
5381
  i(() => {
5261
5382
  if (S || !e) return;
@@ -5280,7 +5401,7 @@ function ir({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
5280
5401
  document.removeEventListener("keydown", e), document.body.style.overflow = t;
5281
5402
  };
5282
5403
  }, [S, C]);
5283
- let E = rr[o] ?? rr.medium, D = (e) => {
5404
+ let E = ur[o] ?? ur.medium, D = (e) => {
5284
5405
  let t = {
5285
5406
  padding: "9px 16px",
5286
5407
  borderRadius: 6,
@@ -5449,7 +5570,7 @@ function ir({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
5449
5570
  })]
5450
5571
  });
5451
5572
  }
5452
- function ar({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: a = "left", panelWidth: o = "", offset: l = 8, editorOpen: f = !0, linked: p, style: m, nodeRef: h, inert: g = !1 }) {
5573
+ function fr({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: a = "left", panelWidth: o = "", offset: l = 8, editorOpen: f = !0, linked: p, style: m, nodeRef: h, inert: g = !1 }) {
5453
5574
  let [_, v] = c(!1), y = s(null), b = s(null), x = r !== "click", S = () => {
5454
5575
  b.current && clearTimeout(b.current), b.current = null;
5455
5576
  }, C = () => {
@@ -5550,40 +5671,41 @@ function ar({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
5550
5671
  }), E]
5551
5672
  });
5552
5673
  }
5553
- var or = {
5674
+ var pr = {
5554
5675
  PageRoot: ze,
5555
- CalendarBlock: Qn,
5556
- LogoCarousel: tr,
5557
- DialogBlock: ir,
5558
- DropdownBlock: ar,
5676
+ CalendarBlock: ar,
5677
+ LogoCarousel: cr,
5678
+ DialogBlock: dr,
5679
+ DropdownBlock: fr,
5559
5680
  Section: Be,
5560
5681
  Container: Ve,
5561
5682
  Heading: He,
5562
5683
  TextBlock: nt,
5563
5684
  ButtonBlock: at,
5564
5685
  ImageBlock: ot,
5565
- Spacer: ft,
5566
- Divider: pt,
5567
- BoxBlock: mt,
5568
- SliderBlock: bt,
5569
- CanvasSlider: xt,
5570
- TabsBlock: Lt,
5571
- QuickStack: un,
5572
- CollectionList: dn,
5573
- CollectionSearch: fn,
5574
- BreadcrumbsBlock: pn,
5575
- PaginationBlock: mn,
5576
- StepperBlock: En,
5577
- SocialLinksBlock: Tn,
5578
- ThemeModeBlock: yn,
5579
- ScrollTopBlock: Cn,
5580
- OrgChartBlock: Rn,
5581
- TableBlock: Wn,
5582
- IconBlock: At,
5583
- MapBlock: Ot,
5584
- MasonryBlock: Mt,
5585
- AccordionBlock: Rt,
5586
- NavbarBlock: It,
5686
+ Spacer: mt,
5687
+ Divider: ht,
5688
+ BoxBlock: gt,
5689
+ SliderBlock: St,
5690
+ CanvasSlider: Ct,
5691
+ TabsBlock: zt,
5692
+ QuickStack: fn,
5693
+ CollectionList: pn,
5694
+ CollectionSearch: mn,
5695
+ BreadcrumbsBlock: hn,
5696
+ PaginationBlock: gn,
5697
+ StepperBlock: Nn,
5698
+ SocialLinksBlock: Mn,
5699
+ ThemeModeBlock: xn,
5700
+ ScrollTopBlock: An,
5701
+ CounterBlock: kn,
5702
+ OrgChartBlock: Gn,
5703
+ TableBlock: Zn,
5704
+ IconBlock: Mt,
5705
+ MapBlock: At,
5706
+ MasonryBlock: Pt,
5707
+ AccordionBlock: Bt,
5708
+ NavbarBlock: Rt,
5587
5709
  ListBlock: tt,
5588
5710
  TextSpan: Ke,
5589
5711
  QuoteBlock: et,
@@ -5593,56 +5715,56 @@ var or = {
5593
5715
  VideoBlock: st,
5594
5716
  YouTubeBlock: lt,
5595
5717
  IframeBlock: ut,
5596
- EmbedBlock: dt,
5597
- FormBlock: Zt,
5598
- FormLabel: nn,
5599
- FormInput: rn,
5600
- FormTextarea: an,
5601
- FormCheckbox: (e) => /* @__PURE__ */ u(on, {
5718
+ EmbedBlock: pt,
5719
+ FormBlock: $t,
5720
+ FormLabel: an,
5721
+ FormInput: on,
5722
+ FormTextarea: sn,
5723
+ FormCheckbox: (e) => /* @__PURE__ */ u(cn, {
5602
5724
  kind: "checkbox",
5603
5725
  ...e
5604
5726
  }),
5605
- FormRadio: (e) => /* @__PURE__ */ u(on, {
5727
+ FormRadio: (e) => /* @__PURE__ */ u(cn, {
5606
5728
  kind: "radio",
5607
5729
  ...e
5608
5730
  }),
5609
- FormSelect: sn,
5610
- FormFile: cn,
5611
- FormRecaptcha: tn,
5612
- FormSubmit: ln
5613
- }, sr = {
5731
+ FormSelect: ln,
5732
+ FormFile: un,
5733
+ FormRecaptcha: rn,
5734
+ FormSubmit: dn
5735
+ }, mr = {
5614
5736
  id: "auth",
5615
5737
  label: "Accounts",
5616
5738
  category: "Apps",
5617
5739
  keys: ["SiteLoginForm", "SiteAccountMenu"],
5618
5740
  ssr: "shell",
5619
5741
  settings: ["site.authRedirect"]
5620
- }, cr = t({
5742
+ }, hr = t({
5621
5743
  user: null,
5622
5744
  status: "idle",
5623
5745
  ensure: () => {},
5624
5746
  refresh: () => {},
5625
5747
  signOut: () => {}
5626
5748
  });
5627
- function lr(e, t) {
5749
+ function gr(e, t) {
5628
5750
  return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
5629
5751
  }
5630
- function ur(e) {
5752
+ function _r(e) {
5631
5753
  let t = e && typeof e == "object" ? e["site.session"] : null, n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (e) => typeof e == "string" ? e.trim() : "", i = r(n.url), a = r(n.mePath), o = r(n.logoutPath);
5632
5754
  return {
5633
5755
  mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
5634
5756
  url: i,
5635
5757
  mePath: a,
5636
5758
  logoutPath: o,
5637
- meUrl: lr(i, a),
5638
- logoutUrl: lr(i, o),
5759
+ meUrl: gr(i, a),
5760
+ logoutUrl: gr(i, o),
5639
5761
  loginPage: r(n.loginPage),
5640
5762
  userPath: r(n.userPath),
5641
5763
  auth: n.auth === "bearer" ? "bearer" : "cookies",
5642
5764
  tokenKey: r(n.tokenKey) || "webim_session_token"
5643
5765
  };
5644
5766
  }
5645
- function dr(e, t) {
5767
+ function vr(e, t) {
5646
5768
  if (!t) return e ?? null;
5647
5769
  let n = e;
5648
5770
  for (let e of t.split(".")) {
@@ -5651,26 +5773,26 @@ function dr(e, t) {
5651
5773
  }
5652
5774
  return n ?? null;
5653
5775
  }
5654
- function fr(e) {
5776
+ function yr(e) {
5655
5777
  try {
5656
5778
  return window.localStorage.getItem(e) || "";
5657
5779
  } catch {
5658
5780
  return "";
5659
5781
  }
5660
5782
  }
5661
- function pr(e) {
5783
+ function br(e) {
5662
5784
  try {
5663
5785
  window.localStorage.removeItem(e);
5664
5786
  } catch {}
5665
5787
  }
5666
- var mr = () => {
5667
- let e = r(cr);
5788
+ var xr = () => {
5789
+ let e = r(hr);
5668
5790
  return i(() => {
5669
5791
  e.ensure();
5670
5792
  }, [e]), e;
5671
5793
  };
5672
- function hr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
5673
- let f = r(Z), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => ur(f?.settings), [f?.settings]), [g, _] = c(t ?? null), [v, y] = c(t ? "user" : a ? "guest" : "idle"), b = s(!1), x = n((e, t) => fetch(`${p}${e}`, {
5794
+ function Sr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
5795
+ let f = r(Z), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => _r(f?.settings), [f?.settings]), [g, _] = c(t ?? null), [v, y] = c(t ? "user" : a ? "guest" : "idle"), b = s(!1), x = n((e, t) => fetch(`${p}${e}`, {
5674
5796
  ...t,
5675
5797
  credentials: "include",
5676
5798
  headers: {
@@ -5682,9 +5804,9 @@ function hr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
5682
5804
  if (a) return Promise.resolve(null);
5683
5805
  if (h.mode === "off") return Promise.resolve(S(null));
5684
5806
  if (h.mode === "custom") {
5685
- let e = h.auth === "bearer" ? fr(h.tokenKey) : "";
5807
+ let e = h.auth === "bearer" ? yr(h.tokenKey) : "";
5686
5808
  return !h.meUrl || h.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(h.meUrl, { ...h.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
5687
- let t = dr(e, h.userPath);
5809
+ let t = vr(e, h.userPath);
5688
5810
  return S(t && typeof t == "object" ? t : null);
5689
5811
  }).catch(() => S(null));
5690
5812
  }
@@ -5697,12 +5819,12 @@ function hr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
5697
5819
  ]), w = n(() => {
5698
5820
  if (h.mode === "off") return S(null), Promise.resolve();
5699
5821
  if (h.mode === "custom") {
5700
- let e = h.auth === "bearer" ? fr(h.tokenKey) : "";
5822
+ let e = h.auth === "bearer" ? yr(h.tokenKey) : "";
5701
5823
  return (h.logoutUrl ? fetch(h.logoutUrl, {
5702
5824
  method: "post",
5703
5825
  ...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
5704
5826
  }).catch(() => {}) : Promise.resolve()).then(() => {
5705
- h.auth === "bearer" && pr(h.tokenKey), S(null);
5827
+ h.auth === "bearer" && br(h.tokenKey), S(null);
5706
5828
  });
5707
5829
  }
5708
5830
  return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
@@ -5752,18 +5874,18 @@ function hr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
5752
5874
  h.loginPage,
5753
5875
  C,
5754
5876
  w
5755
- ]), /* @__PURE__ */ u(cr.Provider, {
5877
+ ]), /* @__PURE__ */ u(hr.Provider, {
5756
5878
  value: E,
5757
5879
  children: e
5758
5880
  });
5759
5881
  }
5760
- function gr({ when: e, children: t }) {
5761
- let { status: n } = mr();
5882
+ function Cr({ when: e, children: t }) {
5883
+ let { status: n } = xr();
5762
5884
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
5763
5885
  }
5764
5886
  //#endregion
5765
5887
  //#region ../ui/src/components/builder/apps/auth/views.jsx
5766
- function _r({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
5888
+ function wr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
5767
5889
  let { tenant: h, apiUrl: g, settings: _ } = r(Z), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
5768
5890
  if (e.preventDefault(), f) return;
5769
5891
  let n = new FormData(e.currentTarget);
@@ -5812,20 +5934,20 @@ function _r({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5812
5934
  children: [
5813
5935
  w ? /* @__PURE__ */ d("label", {
5814
5936
  style: {
5815
- ...Bt,
5937
+ ...Ht,
5816
5938
  display: "grid",
5817
5939
  gap: 6
5818
5940
  },
5819
5941
  children: [a, /* @__PURE__ */ u("input", {
5820
5942
  name: "name",
5821
5943
  type: "text",
5822
- style: Vt,
5823
- ...Ut(f)
5944
+ style: Ut,
5945
+ ...Gt(f)
5824
5946
  })]
5825
5947
  }) : null,
5826
5948
  /* @__PURE__ */ d("label", {
5827
5949
  style: {
5828
- ...Bt,
5950
+ ...Ht,
5829
5951
  display: "grid",
5830
5952
  gap: 6
5831
5953
  },
@@ -5833,13 +5955,13 @@ function _r({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5833
5955
  name: "email",
5834
5956
  type: "email",
5835
5957
  required: !f,
5836
- style: Vt,
5837
- ...Ut(f)
5958
+ style: Ut,
5959
+ ...Gt(f)
5838
5960
  })]
5839
5961
  }),
5840
5962
  /* @__PURE__ */ d("label", {
5841
5963
  style: {
5842
- ...Bt,
5964
+ ...Ht,
5843
5965
  display: "grid",
5844
5966
  gap: 6
5845
5967
  },
@@ -5847,8 +5969,8 @@ function _r({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5847
5969
  name: "password",
5848
5970
  type: "password",
5849
5971
  required: !f,
5850
- style: Vt,
5851
- ...Ut(f)
5972
+ style: Ut,
5973
+ ...Gt(f)
5852
5974
  })]
5853
5975
  }),
5854
5976
  /* @__PURE__ */ u("button", {
@@ -5887,8 +6009,8 @@ function _r({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5887
6009
  ]
5888
6010
  });
5889
6011
  }
5890
- function vr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
5891
- let { user: c, status: l, signOut: f } = mr(), p = a ? s || "user" : l, m = a ? {
6012
+ function Tr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
6013
+ let { user: c, status: l, signOut: f } = xr(), p = a ? s || "user" : l, m = a ? {
5892
6014
  name: "Ada Lovelace",
5893
6015
  email: "ada@example.com"
5894
6016
  } : c;
@@ -5909,7 +6031,7 @@ function vr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5909
6031
  children: [
5910
6032
  /* @__PURE__ */ d("span", {
5911
6033
  style: {
5912
- ...Bt,
6034
+ ...Ht,
5913
6035
  fontWeight: 600
5914
6036
  },
5915
6037
  children: [
@@ -5920,7 +6042,7 @@ function vr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5920
6042
  }),
5921
6043
  n && m?.email ? /* @__PURE__ */ u("span", {
5922
6044
  style: {
5923
- ...Bt,
6045
+ ...Ht,
5924
6046
  opacity: .7
5925
6047
  },
5926
6048
  children: m.email
@@ -5936,7 +6058,7 @@ function vr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5936
6058
  fontSize: 14,
5937
6059
  cursor: a ? "default" : "pointer"
5938
6060
  },
5939
- ...Ut(a),
6061
+ ...Gt(a),
5940
6062
  children: t
5941
6063
  })
5942
6064
  ]
@@ -5953,40 +6075,40 @@ function vr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5953
6075
  }
5954
6076
  //#endregion
5955
6077
  //#region ../ui/src/components/builder/apps/consent/manifest.js
5956
- var yr = {
6078
+ var Er = {
5957
6079
  id: "consent",
5958
6080
  label: "Cookie consent",
5959
6081
  category: "Apps",
5960
6082
  keys: ["CookieConsent"],
5961
6083
  ssr: "shell",
5962
6084
  settings: []
5963
- }, br = "webim.cookie_consent";
5964
- function xr() {
6085
+ }, Dr = "webim.cookie_consent";
6086
+ function Or() {
5965
6087
  try {
5966
- let e = window.localStorage.getItem(br), t = e ? JSON.parse(e) : null;
6088
+ let e = window.localStorage.getItem(Dr), t = e ? JSON.parse(e) : null;
5967
6089
  return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
5968
6090
  } catch {
5969
6091
  return "";
5970
6092
  }
5971
6093
  }
5972
- function Sr(e) {
6094
+ function kr(e) {
5973
6095
  try {
5974
6096
  document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
5975
6097
  } catch {}
5976
6098
  }
5977
- function Cr(e) {
6099
+ function Ar(e) {
5978
6100
  try {
5979
- window.localStorage.setItem(br, JSON.stringify({
6101
+ window.localStorage.setItem(Dr, JSON.stringify({
5980
6102
  choice: e,
5981
6103
  at: (/* @__PURE__ */ new Date()).toISOString()
5982
6104
  }));
5983
6105
  } catch {}
5984
- Sr(e);
6106
+ kr(e);
5985
6107
  try {
5986
6108
  window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
5987
6109
  } catch {}
5988
6110
  }
5989
- var wr = {
6111
+ var jr = {
5990
6112
  bottom: {
5991
6113
  left: 0,
5992
6114
  right: 0,
@@ -6008,18 +6130,18 @@ var wr = {
6008
6130
  maxWidth: 400
6009
6131
  }
6010
6132
  };
6011
- function Tr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
6133
+ function Mr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
6012
6134
  let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
6013
6135
  y(e), typeof m == "function" && m(e);
6014
6136
  };
6015
6137
  if (i(() => {
6016
6138
  if (h) return;
6017
- let e = xr();
6018
- e ? Sr(e) : _(!0);
6139
+ let e = Or();
6140
+ e ? kr(e) : _(!0);
6019
6141
  }, [h, v]), !g) return null;
6020
6142
  let x = (e) => () => {
6021
- h || (Cr(e), _(!1));
6022
- }, S = wr[s] ?? wr.bottom, C = {
6143
+ h || (Ar(e), _(!1));
6144
+ }, S = jr[s] ?? jr.bottom, C = {
6023
6145
  appearance: "none",
6024
6146
  font: "inherit",
6025
6147
  fontSize: 14,
@@ -6099,37 +6221,37 @@ function Tr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
6099
6221
  }
6100
6222
  //#endregion
6101
6223
  //#region ../ui/src/components/builder/apps/language/manifest.js
6102
- var Er = {
6224
+ var Nr = {
6103
6225
  id: "language",
6104
6226
  label: "Language",
6105
6227
  category: "Apps",
6106
6228
  keys: ["SiteLanguagePicker"],
6107
6229
  ssr: "prefetch",
6108
6230
  settings: ["locales"]
6109
- }, Dr = {
6231
+ }, Pr = {
6110
6232
  id: "search",
6111
6233
  label: "Search",
6112
6234
  category: "Apps",
6113
6235
  keys: ["SiteSearch"],
6114
6236
  ssr: "prefetch",
6115
6237
  settings: []
6116
- }, Or = 50, kr = 2e3;
6117
- function Ar() {
6238
+ }, Fr = 50, Ir = 2e3;
6239
+ function Lr() {
6118
6240
  return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
6119
6241
  }
6120
- function jr(e, t) {
6242
+ function Rr(e, t) {
6121
6243
  let n = e?.data ?? {}, r = [];
6122
6244
  for (let e of Object.values(n)) {
6123
6245
  let t = e == null ? "" : Oe(e);
6124
- if (t && r.push(t), r.join(" ").length > kr) break;
6246
+ if (t && r.push(t), r.join(" ").length > Ir) break;
6125
6247
  }
6126
- return r.join(" ").slice(0, kr).toLocaleLowerCase(t || void 0);
6248
+ return r.join(" ").slice(0, Ir).toLocaleLowerCase(t || void 0);
6127
6249
  }
6128
- function Mr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
6129
- let { tenant: b, apiUrl: x, locale: S } = r(Z), [C, w] = c(() => Ar()), [T, E] = c(() => Ar()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
6250
+ function zr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
6251
+ let { tenant: b, apiUrl: x, locale: S } = r(Z), [C, w] = c(() => Lr()), [T, E] = c(() => Lr()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
6130
6252
  i(() => {
6131
6253
  let e = () => {
6132
- let e = Ar();
6254
+ let e = Lr();
6133
6255
  w(e), E(e);
6134
6256
  };
6135
6257
  return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
@@ -6180,7 +6302,7 @@ function Mr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6180
6302
  });
6181
6303
  }
6182
6304
  else for (let t of e.rows) {
6183
- if (!jr(t, S).includes(P)) continue;
6305
+ if (!Rr(t, S).includes(P)) continue;
6184
6306
  let n = t?.data ?? {}, r = Oe(n.name) || "Untitled", i = Oe(n.slug);
6185
6307
  F.push({
6186
6308
  key: `entry:${t.id}`,
@@ -6189,7 +6311,7 @@ function Mr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6189
6311
  kind: "entry"
6190
6312
  });
6191
6313
  }
6192
- let I = F.slice(0, Math.min(Math.max(1, p), Or)), L = (e) => {
6314
+ let I = F.slice(0, Math.min(Math.max(1, p), Fr)), L = (e) => {
6193
6315
  if (v) {
6194
6316
  e.preventDefault(), w(T), j(!0);
6195
6317
  return;
@@ -6271,7 +6393,7 @@ function Mr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6271
6393
  onChange: (e) => E(e.target.value),
6272
6394
  onFocus: () => P && j(!0),
6273
6395
  style: {
6274
- ...Vt,
6396
+ ...Ut,
6275
6397
  flexGrow: 1,
6276
6398
  minWidth: 0
6277
6399
  }
@@ -6329,21 +6451,21 @@ function Mr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6329
6451
  }
6330
6452
  //#endregion
6331
6453
  //#region ../ui/src/components/builder/apps/language/views.jsx
6332
- function Nr(e) {
6454
+ function Br(e) {
6333
6455
  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());
6334
6456
  return [...new Set(n.map((e) => e.trim()))];
6335
6457
  }
6336
- var Pr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
6337
- function Fr(e, t) {
6458
+ var Vr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
6459
+ function Hr(e, t) {
6338
6460
  let n = String(e ?? "").toUpperCase();
6339
6461
  if (t === "code") return n;
6340
6462
  let r = "";
6341
6463
  try {
6342
- r = Pr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
6464
+ r = Vr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
6343
6465
  } catch {}
6344
6466
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
6345
6467
  }
6346
- function Ir(e, t) {
6468
+ function Ur(e, t) {
6347
6469
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
6348
6470
  if (typeof window > "u") return n || "?";
6349
6471
  try {
@@ -6353,8 +6475,8 @@ function Ir(e, t) {
6353
6475
  return n || "/";
6354
6476
  }
6355
6477
  }
6356
- function Lr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
6357
- let c = r(Z), l = Nr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
6478
+ function Wr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
6479
+ let c = r(Z), l = Br(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
6358
6480
  display: "inline-flex",
6359
6481
  alignItems: "center",
6360
6482
  gap: 8,
@@ -6389,7 +6511,7 @@ function Lr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
6389
6511
  style: { opacity: .4 },
6390
6512
  children: n ?? "·"
6391
6513
  }), /* @__PURE__ */ u("a", {
6392
- href: Ir(e, e === f),
6514
+ href: Ur(e, e === f),
6393
6515
  hrefLang: e,
6394
6516
  "aria-current": e === p ? "true" : void 0,
6395
6517
  onClick: s ? (e) => e.preventDefault() : void 0,
@@ -6399,7 +6521,7 @@ function Lr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
6399
6521
  textDecoration: "none",
6400
6522
  cursor: s ? "default" : "pointer"
6401
6523
  },
6402
- children: Fr(e, t)
6524
+ children: Hr(e, t)
6403
6525
  })]
6404
6526
  }, e))]
6405
6527
  }) : /* @__PURE__ */ d("div", {
@@ -6410,7 +6532,7 @@ function Lr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
6410
6532
  value: p,
6411
6533
  onChange: s ? void 0 : (e) => {
6412
6534
  let t = e.target.value;
6413
- window.location.assign(Ir(t, t === f));
6535
+ window.location.assign(Ur(t, t === f));
6414
6536
  },
6415
6537
  onKeyDown: s ? (e) => e.preventDefault() : void 0,
6416
6538
  style: {
@@ -6424,47 +6546,47 @@ function Lr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
6424
6546
  },
6425
6547
  children: l.map((e) => /* @__PURE__ */ u("option", {
6426
6548
  value: e,
6427
- children: Fr(e, t)
6549
+ children: Hr(e, t)
6428
6550
  }, e))
6429
6551
  })]
6430
6552
  });
6431
6553
  }
6432
6554
  //#endregion
6433
6555
  //#region ../ui/src/components/builder/apps/index.js
6434
- var Rr = [
6435
- sr,
6556
+ var Gr = [
6557
+ mr,
6558
+ Nr,
6436
6559
  Er,
6437
- yr,
6438
- Dr
6439
- ], zr = {
6440
- SiteLoginForm: _r,
6441
- SiteAccountMenu: vr,
6442
- SiteLanguagePicker: Lr,
6443
- CookieConsent: Tr,
6444
- SiteSearch: Mr
6560
+ Pr
6561
+ ], Kr = {
6562
+ SiteLoginForm: wr,
6563
+ SiteAccountMenu: Tr,
6564
+ SiteLanguagePicker: Wr,
6565
+ CookieConsent: Mr,
6566
+ SiteSearch: zr
6445
6567
  };
6446
- new Set(Rr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
6568
+ new Set(Gr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
6447
6569
  //#endregion
6448
6570
  //#region ../ui/src/components/builder/three/runtime.js
6449
- var Br = "0.185.1", Vr = "4.2.0", Hr = "https://cdn.jsdelivr.net/npm", Ur = `${Hr}/three@${Br}/+esm`, Wr = `${Hr}/@google/model-viewer@${Vr}/dist/model-viewer.min.js`, Gr = (e) => import(
6571
+ var qr = "0.185.1", Jr = "4.2.0", Yr = "https://cdn.jsdelivr.net/npm", Xr = `${Yr}/three@${qr}/+esm`, Zr = `${Yr}/@google/model-viewer@${Jr}/dist/model-viewer.min.js`, Qr = (e) => import(
6450
6572
  /* @vite-ignore */
6451
6573
  /* webpackIgnore: true */
6452
6574
  e
6453
- ), Kr = /* @__PURE__ */ new Map();
6454
- function qr(e) {
6455
- if (Kr.has(e)) return Kr.get(e);
6575
+ ), $r = /* @__PURE__ */ new Map();
6576
+ function ei(e) {
6577
+ if ($r.has(e)) return $r.get(e);
6456
6578
  if (typeof window > "u") return new Promise(() => {});
6457
- let t = Gr(e).catch((t) => {
6458
- throw Kr.delete(e), t;
6579
+ let t = Qr(e).catch((t) => {
6580
+ throw $r.delete(e), t;
6459
6581
  });
6460
- return Kr.set(e, t), t;
6582
+ return $r.set(e, t), t;
6461
6583
  }
6462
- var Jr = () => qr(Ur), Yr = (e) => qr(`${Hr}/three@${Br}/examples/jsm/${e}/+esm`);
6463
- function Xr() {
6464
- return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : qr(Wr);
6584
+ var ti = () => ei(Xr), ni = (e) => ei(`${Yr}/three@${qr}/examples/jsm/${e}/+esm`);
6585
+ function ri() {
6586
+ return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : ei(Zr);
6465
6587
  }
6466
- var Zr = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Qr = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
6467
- function $r(e, t) {
6588
+ var ii = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, ai = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
6589
+ function oi(e, t) {
6468
6590
  let n = 0, r = 0, i = 0, a = !0, o = (e) => {
6469
6591
  n = requestAnimationFrame(o), i ||= e;
6470
6592
  let a = r ? (e - r) / 1e3 : 0;
@@ -6483,7 +6605,7 @@ function $r(e, t) {
6483
6605
  s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
6484
6606
  };
6485
6607
  }
6486
- function ei(e, t, n = {}) {
6608
+ function si(e, t, n = {}) {
6487
6609
  let r = {
6488
6610
  radius: n.distance ?? 4,
6489
6611
  polar: n.polar ?? Math.PI / 2.4,
@@ -6532,13 +6654,13 @@ function ei(e, t, n = {}) {
6532
6654
  }
6533
6655
  //#endregion
6534
6656
  //#region ../ui/src/components/builder/three/views.jsx
6535
- var ti = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ni = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, ri = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, ii = (e) => typeof e == "string" && !!e.trim();
6536
- function ai({ label: e, note: t, height: n, nodeRef: r, style: i }) {
6657
+ var ci = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, li = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, ui = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, di = (e) => typeof e == "string" && !!e.trim();
6658
+ function fi({ label: e, note: t, height: n, nodeRef: r, style: i }) {
6537
6659
  return /* @__PURE__ */ d("div", {
6538
6660
  ref: r,
6539
6661
  style: {
6540
6662
  ...A(i),
6541
- minHeight: ti(n, 320),
6663
+ minHeight: ci(n, 320),
6542
6664
  display: "flex",
6543
6665
  flexDirection: "column",
6544
6666
  alignItems: "center",
@@ -6566,24 +6688,24 @@ function ai({ label: e, note: t, height: n, nodeRef: r, style: i }) {
6566
6688
  }) : null]
6567
6689
  });
6568
6690
  }
6569
- function oi({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotateDelay: s, cameraControls: l, ar: d, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
6691
+ function pi({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotateDelay: s, cameraControls: l, ar: d, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
6570
6692
  let [y, b] = c(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = c(!1);
6571
6693
  i(() => {
6572
6694
  if (y || !e) return;
6573
6695
  let t = !0;
6574
- return Xr().then(() => t && b(!0), () => t && S(!0)), () => {
6696
+ return ri().then(() => t && b(!0), () => t && S(!0)), () => {
6575
6697
  t = !1;
6576
6698
  };
6577
6699
  }, [y, e]);
6578
6700
  let C = {
6579
6701
  display: "block",
6580
6702
  width: "100%",
6581
- minHeight: ti(r, 360),
6582
- height: ti(r, 360),
6703
+ minHeight: ci(r, 360),
6704
+ height: ci(r, 360),
6583
6705
  backgroundColor: a || "transparent",
6584
6706
  ...A(g)
6585
6707
  };
6586
- if (!e) return v ? /* @__PURE__ */ u(ai, {
6708
+ if (!e) return v ? /* @__PURE__ */ u(fi, {
6587
6709
  nodeRef: _,
6588
6710
  style: g,
6589
6711
  height: r,
@@ -6618,13 +6740,13 @@ function oi({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotate
6618
6740
  poster: t || void 0,
6619
6741
  style: C,
6620
6742
  "camera-controls": w(!v && l !== !1),
6621
- "auto-rotate": w(T && !Zr()),
6622
- "auto-rotate-delay": T ? String(ti(s, 0)) : void 0,
6743
+ "auto-rotate": w(T && !ii()),
6744
+ "auto-rotate-delay": T ? String(ci(s, 0)) : void 0,
6623
6745
  "rotation-per-second": "18deg",
6624
6746
  ar: w(!v && d === !0),
6625
6747
  "ar-modes": "webxr scene-viewer quick-look",
6626
- "shadow-intensity": String(ni(p, 100)),
6627
- exposure: String(ni(f, 100)),
6748
+ "shadow-intensity": String(li(p, 100)),
6749
+ exposure: String(li(f, 100)),
6628
6750
  "field-of-view": m ? `${Number(m)}deg` : void 0,
6629
6751
  "environment-image": h && h !== "neutral" ? h : "neutral",
6630
6752
  "interaction-prompt": v ? "none" : void 0,
@@ -6642,7 +6764,7 @@ function oi({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotate
6642
6764
  }) : null
6643
6765
  });
6644
6766
  }
6645
- var si = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), ci = [
6767
+ var mi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), hi = [
6646
6768
  "precision highp float;",
6647
6769
  "uniform vec2 u_res;",
6648
6770
  "uniform float u_time;",
@@ -6665,7 +6787,7 @@ var si = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
6665
6787
  " return v;",
6666
6788
  "}",
6667
6789
  ""
6668
- ].join("\n"), li = {
6790
+ ].join("\n"), gi = {
6669
6791
  gradient: [
6670
6792
  "void main(){",
6671
6793
  " vec2 uv = gl_FragCoord.xy / u_res;",
@@ -6717,7 +6839,7 @@ var si = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
6717
6839
  "}"
6718
6840
  ].join("\n")
6719
6841
  };
6720
- function ui(e, t) {
6842
+ function _i(e, t) {
6721
6843
  let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
6722
6844
  if (!n) return t;
6723
6845
  let r = parseInt(n[1], 16);
@@ -6727,7 +6849,7 @@ function ui(e, t) {
6727
6849
  (r & 255) / 255
6728
6850
  ];
6729
6851
  }
6730
- function di(e, t, n) {
6852
+ function vi(e, t, n) {
6731
6853
  let r = e.createShader(t);
6732
6854
  if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
6733
6855
  let t = e.getShaderInfoLog(r);
@@ -6735,13 +6857,13 @@ function di(e, t, n) {
6735
6857
  }
6736
6858
  return r;
6737
6859
  }
6738
- function fi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, scale: l, height: f, interactive: p, style: m, nodeRef: h, inert: g }) {
6860
+ function yi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, scale: l, height: f, interactive: p, style: m, nodeRef: h, inert: g }) {
6739
6861
  let _ = s(null), v = s(null), y = s(null), [b, x] = c("");
6740
6862
  i(() => () => {
6741
6863
  let e = y.current;
6742
6864
  y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
6743
6865
  }, []);
6744
- let S = typeof t == "string" && t.trim() ? t : li[e] ?? li.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(a ?? ""), E = ni(o, 100), D = Math.max(.05, ni(l, 100));
6866
+ let S = typeof t == "string" && t.trim() ? t : gi[e] ?? gi.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(a ?? ""), E = li(o, 100), D = Math.max(.05, li(l, 100));
6745
6867
  return i(() => {
6746
6868
  let e = _.current, t = v.current;
6747
6869
  if (!e || !t) return;
@@ -6756,7 +6878,7 @@ function fi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
6756
6878
  }
6757
6879
  let r = null;
6758
6880
  try {
6759
- let e = di(n, n.VERTEX_SHADER, si), t = di(n, n.FRAGMENT_SHADER, ci + S);
6881
+ let e = vi(n, n.VERTEX_SHADER, mi), t = vi(n, n.FRAGMENT_SHADER, hi + S);
6760
6882
  if (r = n.createProgram(), n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) throw Error(n.getProgramInfoLog(r) || "Link failed");
6761
6883
  x("");
6762
6884
  } catch (e) {
@@ -6792,28 +6914,28 @@ function fi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
6792
6914
  };
6793
6915
  p !== !1 && t.addEventListener("pointermove", l);
6794
6916
  let u = () => {
6795
- let r = Qr(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
6917
+ let r = ai(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
6796
6918
  (e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
6797
6919
  }, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
6798
6920
  d?.observe(t), u();
6799
- let f = Zr(), m = {
6800
- a: ui(C, [
6921
+ let f = ii(), m = {
6922
+ a: _i(C, [
6801
6923
  .35,
6802
6924
  .4,
6803
6925
  .95
6804
6926
  ]),
6805
- b: ui(w, [
6927
+ b: _i(w, [
6806
6928
  .05,
6807
6929
  .06,
6808
6930
  .16
6809
6931
  ]),
6810
- c: ui(T, [
6932
+ c: _i(T, [
6811
6933
  .95,
6812
6934
  .35,
6813
6935
  .6
6814
6936
  ])
6815
6937
  }, h = {};
6816
- return h.stop = $r(t, (t, r) => {
6938
+ return h.stop = oi(t, (t, r) => {
6817
6939
  u(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (f ? 0 : r) * E), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, D), n.drawArrays(n.TRIANGLES, 0, 3), f && h.stop?.();
6818
6940
  }), () => {
6819
6941
  h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
@@ -6832,7 +6954,7 @@ function fi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
6832
6954
  },
6833
6955
  style: {
6834
6956
  position: "relative",
6835
- minHeight: ti(f, 320),
6957
+ minHeight: ci(f, 320),
6836
6958
  overflow: "hidden",
6837
6959
  ...A(m)
6838
6960
  },
@@ -6864,7 +6986,7 @@ function fi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
6864
6986
  }) : null]
6865
6987
  });
6866
6988
  }
6867
- function pi(e, t) {
6989
+ function bi(e, t) {
6868
6990
  let n = new e.Scene(), r = new e.BoxGeometry();
6869
6991
  r.deleteAttribute("uv");
6870
6992
  let i = new e.Mesh(r, new e.MeshBasicMaterial({
@@ -6880,23 +7002,23 @@ function pi(e, t) {
6880
7002
  let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
6881
7003
  return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
6882
7004
  }
6883
- var mi = /* @__PURE__ */ new Map();
6884
- function hi(e) {
6885
- if (mi.has(e)) return mi.get(e);
6886
- let t = Yr("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
7005
+ var xi = /* @__PURE__ */ new Map();
7006
+ function Si(e) {
7007
+ if (xi.has(e)) return xi.get(e);
7008
+ let t = ni("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
6887
7009
  new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
6888
7010
  })).catch((t) => {
6889
- throw mi.delete(e), t;
7011
+ throw xi.delete(e), t;
6890
7012
  });
6891
- return mi.set(e, t), t;
7013
+ return xi.set(e, t), t;
6892
7014
  }
6893
- function gi(e, t) {
7015
+ function Ci(e, t) {
6894
7016
  let n = new e.Box3().setFromObject(t);
6895
7017
  if (n.isEmpty()) return t;
6896
7018
  let r = n.getSize(new e.Vector3()), i = n.getCenter(new e.Vector3()), a = Math.max(r.x, r.y, r.z) || 1, o = new e.Group();
6897
7019
  return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
6898
7020
  }
6899
- var _i = {
7021
+ var wi = {
6900
7022
  box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
6901
7023
  sphere: (e) => new e.SphereGeometry(.62, 48, 32),
6902
7024
  torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
@@ -6905,50 +7027,50 @@ var _i = {
6905
7027
  cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
6906
7028
  plane: (e) => new e.PlaneGeometry(1.4, 1.4),
6907
7029
  capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
6908
- }, vi = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
6909
- function yi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: a, spinSpeed: o, controls: l, ground: d, height: f, style: p, nodeRef: m, inert: h }) {
6910
- let g = s(null), [_, v] = c(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = a !== !1 && !Zr(), S = l !== !1 && !h;
7030
+ }, Ti = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
7031
+ function Ei({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: a, spinSpeed: o, controls: l, ground: d, height: f, style: p, nodeRef: m, inert: h }) {
7032
+ let g = s(null), [_, v] = c(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = a !== !1 && !ii(), S = l !== !1 && !h;
6911
7033
  return i(() => {
6912
7034
  let e = g.current;
6913
7035
  if (!e) return;
6914
7036
  let i = !0, a = null;
6915
- return Jr().then((s) => {
7037
+ return ti().then((s) => {
6916
7038
  if (!i || !e) return;
6917
7039
  let c = new s.WebGLRenderer({
6918
7040
  antialias: !0,
6919
7041
  alpha: !t
6920
7042
  });
6921
- c.setPixelRatio(Qr()), c.shadowMap.enabled = d !== !1, c.shadowMap.type = s.PCFSoftShadowMap, c.outputColorSpace = s.SRGBColorSpace, c.toneMapping = s.ACESFilmicToneMapping, c.domElement.style.display = "block", c.domElement.style.width = "100%", c.domElement.style.height = "100%", e.appendChild(c.domElement);
7043
+ c.setPixelRatio(ai()), c.shadowMap.enabled = d !== !1, c.shadowMap.type = s.PCFSoftShadowMap, c.outputColorSpace = s.SRGBColorSpace, c.toneMapping = s.ACESFilmicToneMapping, c.domElement.style.display = "block", c.domElement.style.width = "100%", c.domElement.style.height = "100%", e.appendChild(c.domElement);
6922
7044
  let l = new s.Scene();
6923
- t && (l.background = new s.Color(t)), l.environment = pi(s, c);
6924
- let u = new s.PerspectiveCamera(vi(r, 45), 1, .1, 400), f = ei(u, c.domElement, {
6925
- distance: vi(n, 5),
7045
+ t && (l.background = new s.Color(t)), l.environment = bi(s, c);
7046
+ let u = new s.PerspectiveCamera(Ti(r, 45), 1, .1, 400), f = si(u, c.domElement, {
7047
+ distance: Ti(n, 5),
6926
7048
  enableZoom: S
6927
7049
  }), p = new s.DirectionalLight(16777215, 2.2);
6928
7050
  p.position.set(4, 7, 5), p.castShadow = d !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, l.add(p, new s.AmbientLight(16777215, .35));
6929
7051
  let m = [], h = new s.Group(), g = (e, t) => {
6930
- let n = vi(t.scale, 1);
6931
- e.position.set(vi(t.x, 0), vi(t.y, 0), vi(t.z, 0)), e.rotation.set(ri(t.rx), ri(t.ry), ri(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = ri(t.spin);
7052
+ let n = Ti(t.scale, 1);
7053
+ e.position.set(Ti(t.x, 0), Ti(t.y, 0), Ti(t.z, 0)), e.rotation.set(ui(t.rx), ui(t.ry), ui(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = ui(t.spin);
6932
7054
  };
6933
7055
  for (let e of y) {
6934
7056
  if (e.shape === "model") {
6935
- if (!ii(e.src)) continue;
7057
+ if (!di(e.src)) continue;
6936
7058
  let t = new s.Group();
6937
- g(t, e), h.add(t), hi(e.src).then((e) => {
7059
+ g(t, e), h.add(t), Si(e.src).then((e) => {
6938
7060
  if (!i) return;
6939
- let n = gi(s, e.clone(!0));
7061
+ let n = Ci(s, e.clone(!0));
6940
7062
  n.traverse((e) => {
6941
7063
  e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
6942
7064
  }), t.add(n);
6943
7065
  }, () => {});
6944
7066
  continue;
6945
7067
  }
6946
- let t = (_i[e.shape] ?? _i.box)(s), n = new s.MeshStandardMaterial({
7068
+ let t = (wi[e.shape] ?? wi.box)(s), n = new s.MeshStandardMaterial({
6947
7069
  color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
6948
- metalness: Math.min(1, Math.max(0, ni(e.metalness, 10))),
6949
- roughness: Math.min(1, Math.max(0, ni(e.roughness, 35))),
6950
- transparent: ni(e.opacity, 100) < 1,
6951
- opacity: Math.min(1, Math.max(0, ni(e.opacity, 100))),
7070
+ metalness: Math.min(1, Math.max(0, li(e.metalness, 10))),
7071
+ roughness: Math.min(1, Math.max(0, li(e.roughness, 35))),
7072
+ transparent: li(e.opacity, 100) < 1,
7073
+ opacity: Math.min(1, Math.max(0, li(e.opacity, 100))),
6952
7074
  flatShading: e.flat === !0,
6953
7075
  wireframe: e.wireframe === !0,
6954
7076
  side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
@@ -6959,14 +7081,14 @@ function yi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
6959
7081
  let _ = null;
6960
7082
  if (d !== !1) {
6961
7083
  let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
6962
- _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = vi(d === !0 ? 0 : d, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
7084
+ _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = Ti(d === !0 ? 0 : d, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
6963
7085
  }
6964
7086
  let v = () => {
6965
7087
  let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
6966
7088
  c.setSize(t, n, !1), u.aspect = t / n, u.updateProjectionMatrix();
6967
7089
  }, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
6968
7090
  b?.observe(e), v();
6969
- let C = ri(Number.isFinite(Number(o)) ? o : 20), w = $r(e, (e) => {
7091
+ let C = ui(Number.isFinite(Number(o)) ? o : 20), w = oi(e, (e) => {
6970
7092
  f.autoSpin(x ? C : 0, e), f.update();
6971
7093
  for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
6972
7094
  c.render(l, u);
@@ -6990,7 +7112,7 @@ function yi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
6990
7112
  o,
6991
7113
  S,
6992
7114
  d
6993
- ]), _ && h ? /* @__PURE__ */ u(ai, {
7115
+ ]), _ && h ? /* @__PURE__ */ u(fi, {
6994
7116
  nodeRef: m,
6995
7117
  style: p,
6996
7118
  height: f,
@@ -7001,27 +7123,27 @@ function yi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
7001
7123
  g.current = e, typeof m == "function" && m(e);
7002
7124
  },
7003
7125
  style: {
7004
- minHeight: ti(f, 380),
7005
- height: ti(f, 380),
7126
+ minHeight: ci(f, 380),
7127
+ height: ci(f, 380),
7006
7128
  overflow: "hidden",
7007
7129
  touchAction: S ? "pan-y" : void 0,
7008
7130
  ...A(p)
7009
7131
  }
7010
7132
  });
7011
7133
  }
7012
- function bi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o }) {
7134
+ function Di({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o }) {
7013
7135
  let l = s(null), [d, f] = c("");
7014
7136
  return i(() => {
7015
7137
  let t = l.current;
7016
7138
  if (o || !t || typeof e != "string" || !e.trim()) return;
7017
7139
  let r = !0, i = null;
7018
- return Jr().then((a) => {
7140
+ return ti().then((a) => {
7019
7141
  if (!r || !t) return;
7020
7142
  let o = new a.WebGLRenderer({
7021
7143
  antialias: !0,
7022
7144
  alpha: !n
7023
7145
  });
7024
- o.setPixelRatio(Qr()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
7146
+ o.setPixelRatio(ai()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
7025
7147
  let s = new a.Scene();
7026
7148
  n && (s.background = new a.Color(n));
7027
7149
  let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
@@ -7044,7 +7166,7 @@ function bi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
7044
7166
  o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
7045
7167
  }, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
7046
7168
  d?.observe(t), u();
7047
- let p = !1, m = $r(t, (e, t) => {
7169
+ let p = !1, m = oi(t, (e, t) => {
7048
7170
  if (!p && typeof l?.frame == "function") try {
7049
7171
  l.frame(e, t);
7050
7172
  } catch (e) {
@@ -7066,7 +7188,7 @@ function bi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
7066
7188
  e,
7067
7189
  o,
7068
7190
  n
7069
- ]), o ? /* @__PURE__ */ u(ai, {
7191
+ ]), o ? /* @__PURE__ */ u(fi, {
7070
7192
  nodeRef: a,
7071
7193
  style: r,
7072
7194
  height: t,
@@ -7077,8 +7199,8 @@ function bi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
7077
7199
  l.current = e, typeof a == "function" && a(e);
7078
7200
  },
7079
7201
  style: {
7080
- minHeight: ti(t, 380),
7081
- height: ti(t, 380),
7202
+ minHeight: ci(t, 380),
7203
+ height: ci(t, 380),
7082
7204
  overflow: "hidden",
7083
7205
  position: "relative",
7084
7206
  touchAction: "pan-y",
@@ -7101,40 +7223,40 @@ function bi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
7101
7223
  }) : null
7102
7224
  });
7103
7225
  }
7104
- var xi = {
7105
- ModelViewerBlock: oi,
7106
- ShaderBlock: fi,
7107
- SceneBlock: yi,
7108
- ThreeCanvasBlock: bi
7109
- }, Si = /* @__PURE__ */ new Map();
7110
- function Ci(e) {
7111
- if (Si.has(e)) return Si.get(e);
7226
+ var Oi = {
7227
+ ModelViewerBlock: pi,
7228
+ ShaderBlock: yi,
7229
+ SceneBlock: Ei,
7230
+ ThreeCanvasBlock: Di
7231
+ }, ki = /* @__PURE__ */ new Map();
7232
+ function Ai(e) {
7233
+ if (ki.has(e)) return ki.get(e);
7112
7234
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
7113
7235
  /* @vite-ignore */
7114
7236
  /* webpackIgnore: true */
7115
7237
  t
7116
7238
  ).finally(() => URL.revokeObjectURL(t));
7117
- return Si.set(e, n), n;
7239
+ return ki.set(e, n), n;
7118
7240
  }
7119
- function wi(e) {
7241
+ function ji(e) {
7120
7242
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
7121
7243
  return n && typeof n == "object" ? n : {};
7122
7244
  }
7123
7245
  //#endregion
7124
7246
  //#region ../ui/src/components/builder/plugins/view.jsx
7125
- async function Ti(e, t) {
7126
- let n = await Ci(e);
7247
+ async function Mi(e, t) {
7248
+ let n = await Ai(e);
7127
7249
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
7128
7250
  }
7129
- var Ei = {
7251
+ var Ni = {
7130
7252
  padding: "10px 12px",
7131
7253
  border: "1px dashed rgba(148, 163, 184, 0.5)",
7132
7254
  borderRadius: 8,
7133
7255
  fontSize: 12,
7134
7256
  opacity: .6
7135
7257
  };
7136
- function Di({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
7137
- let c = r(Z), l = wi(c?.settings)[e], f = s(null), p = s(null), m = {
7258
+ function Pi({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
7259
+ let c = r(Z), l = ji(c?.settings)[e], f = s(null), p = s(null), m = {
7138
7260
  tenant: c?.tenant ?? "",
7139
7261
  apiUrl: c?.apiUrl ?? "/api",
7140
7262
  locale: c?.locale ?? "",
@@ -7146,7 +7268,7 @@ function Di({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
7146
7268
  let e = f.current;
7147
7269
  if (!l?.code || !e) return;
7148
7270
  let n = !0;
7149
- return Ti(l.code, t).then((e) => {
7271
+ return Mi(l.code, t).then((e) => {
7150
7272
  if (!(!n || !e || !f.current)) {
7151
7273
  p.current = e;
7152
7274
  try {
@@ -7176,7 +7298,7 @@ function Di({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
7176
7298
  }) : /* @__PURE__ */ d("div", {
7177
7299
  ref: o,
7178
7300
  style: {
7179
- ...Ei,
7301
+ ...Ni,
7180
7302
  ...A(a)
7181
7303
  },
7182
7304
  children: [
@@ -7188,13 +7310,13 @@ function Di({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
7188
7310
  }
7189
7311
  //#endregion
7190
7312
  //#region ../ui/src/components/builder/render.jsx
7191
- var Oi = {
7192
- ...or,
7193
- ...zr,
7194
- ...xi,
7195
- PluginBlock: Di
7313
+ var Fi = {
7314
+ ...pr,
7315
+ ...Kr,
7316
+ ...Oi,
7317
+ PluginBlock: Pi
7196
7318
  };
7197
- function ki(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7319
+ function Ii(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7198
7320
  let o = n[t];
7199
7321
  if (!o || o.hidden) return null;
7200
7322
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -7202,11 +7324,11 @@ function ki(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7202
7324
  let n = o.props?.componentId, s = r?.[n];
7203
7325
  if (!s?.template || i.has(n)) return null;
7204
7326
  let c = new Set(i).add(n);
7205
- return /* @__PURE__ */ u(e, { children: ki(s.template.rootId, s.template.nodes, r, c, a) }, t);
7327
+ return /* @__PURE__ */ u(e, { children: Ii(s.template.rootId, s.template.nodes, r, c, a) }, t);
7206
7328
  }
7207
- let l = Oi[s];
7329
+ let l = Fi[s];
7208
7330
  if (!l) return null;
7209
- let d = (o.nodes ?? []).map((e) => ki(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, ki(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
7331
+ let d = (o.nodes ?? []).map((e) => Ii(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Ii(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
7210
7332
  ...c,
7211
7333
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
7212
7334
  linked: p,
@@ -7215,16 +7337,16 @@ function ki(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7215
7337
  },
7216
7338
  children: d.length ? d : void 0
7217
7339
  }, t);
7218
- return c.when && c.when !== "always" ? /* @__PURE__ */ u(gr, {
7340
+ return c.when && c.when !== "always" ? /* @__PURE__ */ u(Cr, {
7219
7341
  when: c.when,
7220
7342
  children: m
7221
7343
  }, t) : m;
7222
7344
  }
7223
7345
  //#endregion
7224
7346
  //#region ../ui/src/components/builder/PageRenderer.jsx
7225
- var Ai = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), ji = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ue(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
7347
+ var Li = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ri = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ue(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
7226
7348
  .webim-page[data-webim-mode="dark"] { ${Object.entries(ue(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
7227
- function Mi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, animations: c, tenant: l, apiUrl: f, datasets: p, locale: m, direction: h, settings: _, siteUser: v }) {
7349
+ function zi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, animations: c, tenant: l, apiUrl: f, datasets: p, locale: m, direction: h, settings: _, siteUser: v }) {
7228
7350
  let b = s?.js?.trim();
7229
7351
  if (i(() => {
7230
7352
  if (!b) return;
@@ -7238,11 +7360,11 @@ function Mi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
7238
7360
  minHeight: "100%",
7239
7361
  display: "flex",
7240
7362
  flexDirection: "column"
7241
- }, w = ki("ROOT", e, n), T = o(() => ({ render: (t, r) => ki(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = W(e, n), O = ie(e, n), k = s?.css?.trim(), A = E(c), j = le(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !oe[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
7363
+ }, w = Ii("ROOT", e, n), T = o(() => ({ render: (t, r) => Ii(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = W(e, n), O = ie(e, n), k = s?.css?.trim(), A = E(c), j = le(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !oe[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
7242
7364
  rel: "stylesheet",
7243
7365
  precedence: "default",
7244
7366
  href: g(e)
7245
- }, e)), P = ji(j);
7367
+ }, e)), P = Ri(j);
7246
7368
  return r === "auto" ? /* @__PURE__ */ u(Z.Provider, {
7247
7369
  value: {
7248
7370
  tenant: l || "",
@@ -7250,7 +7372,7 @@ function Mi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
7250
7372
  locale: m || "",
7251
7373
  settings: _ ?? null
7252
7374
  },
7253
- children: /* @__PURE__ */ u(hr, {
7375
+ children: /* @__PURE__ */ u(Sr, {
7254
7376
  initialUser: v,
7255
7377
  children: /* @__PURE__ */ u(xe.Provider, {
7256
7378
  value: p ?? null,
@@ -7265,8 +7387,8 @@ function Mi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
7265
7387
  ...a
7266
7388
  },
7267
7389
  children: [
7268
- /* @__PURE__ */ u("style", { children: `.webim-page { ${Ai(ue(j.light))} }
7269
- @media (prefers-color-scheme: dark) { .webim-page { ${Ai(ue(j.dark))} } }` }),
7390
+ /* @__PURE__ */ u("style", { children: `.webim-page { ${Li(ue(j.light))} }
7391
+ @media (prefers-color-scheme: dark) { .webim-page { ${Li(ue(j.dark))} } }` }),
7270
7392
  /* @__PURE__ */ u("style", { children: P }),
7271
7393
  N,
7272
7394
  /* @__PURE__ */ u("style", { children: S }),
@@ -7286,7 +7408,7 @@ function Mi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
7286
7408
  locale: m || "",
7287
7409
  settings: _ ?? null
7288
7410
  },
7289
- children: /* @__PURE__ */ u(hr, {
7411
+ children: /* @__PURE__ */ u(Sr, {
7290
7412
  initialUser: v,
7291
7413
  children: /* @__PURE__ */ u(xe.Provider, {
7292
7414
  value: p ?? null,
@@ -7319,8 +7441,8 @@ function Mi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
7319
7441
  }
7320
7442
  //#endregion
7321
7443
  //#region src/WebimContent.jsx
7322
- function Ni({ bundle: e, mode: t = "auto", style: n }) {
7323
- return e?.blocks?.ROOT ? /* @__PURE__ */ u(Mi, {
7444
+ function Bi({ bundle: e, mode: t = "auto", style: n }) {
7445
+ return e?.blocks?.ROOT ? /* @__PURE__ */ u(zi, {
7324
7446
  blocks: e.blocks,
7325
7447
  theme: e.theme,
7326
7448
  components: e.components,
@@ -7338,7 +7460,7 @@ function Ni({ bundle: e, mode: t = "auto", style: n }) {
7338
7460
  }
7339
7461
  //#endregion
7340
7462
  //#region src/WebimPage.jsx
7341
- function Pi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
7463
+ function Vi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
7342
7464
  let [g, _] = c({ status: "loading" }), v = s({
7343
7465
  onLoad: m,
7344
7466
  onError: h
@@ -7375,11 +7497,11 @@ function Pi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
7375
7497
  r,
7376
7498
  a,
7377
7499
  o
7378
- ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Ni, {
7500
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Bi, {
7379
7501
  bundle: g.bundle,
7380
7502
  mode: l,
7381
7503
  style: d
7382
7504
  });
7383
7505
  }
7384
7506
  //#endregion
7385
- export { Mi as PageRenderer, Ni as WebimContent, Pi as WebimPage, ye as fetchPage, Ze as renderRichContent, he as resolveTheme };
7507
+ export { zi as PageRenderer, Bi as WebimContent, Vi as WebimPage, ye as fetchPage, Ze as renderRichContent, he as resolveTheme };