webim-adapter 2.0.1 → 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.
@@ -254,21 +254,21 @@ function A(e) {
254
254
  R !== void 0 && U.push(`blur(${O(R)})`), z !== void 0 && U.push(`grayscale(${z}%)`), B !== void 0 && U.push(`brightness(${B}%)`), V !== void 0 && U.push(`contrast(${V}%)`), H !== void 0 && U.push(`saturate(${H}%)`), U.length && (t.filter = U.join(" "));
255
255
  let ee = F(L);
256
256
  ee.length && (t.backdropFilter = ee.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
257
- let { textStrokeWidth: W, textStrokeColor: te } = t;
258
- delete t.textStrokeWidth, delete t.textStrokeColor, (W !== void 0 || te !== void 0) && (t.WebkitTextStroke = `${O(W ?? 1)} ${te || "currentColor"}`);
259
- let { clipText: ne } = t;
260
- delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
261
- let { transitions: re, transitionDuration: G, transitionEasing: K, transitionProperty: q } = t, ie = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
257
+ let { textStrokeWidth: te, textStrokeColor: ne } = t;
258
+ delete t.textStrokeWidth, delete t.textStrokeColor, (te !== void 0 || ne !== void 0) && (t.WebkitTextStroke = `${O(te ?? 1)} ${ne || "currentColor"}`);
259
+ let { clipText: re } = t;
260
+ delete t.clipText, re && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
261
+ let { transitions: ie, transitionDuration: W, transitionEasing: G, transitionProperty: K } = t, ae = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
262
262
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
263
- let J = (Array.isArray(re) ? re : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ie(e.duration ?? 200)} ${e.easing || "ease"}`);
264
- if (G !== void 0 && J.push(`${q || "all"} ${ie(G)} ${K || "ease"}`), J.length && (t.transition = J.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
263
+ let q = (Array.isArray(ie) ? ie : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ae(e.duration ?? 200)} ${e.easing || "ease"}`);
264
+ if (W !== void 0 && q.push(`${K || "all"} ${ae(W)} ${G || "ease"}`), q.length && (t.transition = q.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
265
265
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
266
266
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
267
267
  }
268
268
  delete t.backgroundVideo;
269
- let { overlayColor: ae, overlayOpacity: oe } = t;
270
- if (delete t.overlayColor, delete t.overlayOpacity, ae) {
271
- let e = `color-mix(in srgb, ${ae} ${oe ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
269
+ let { overlayColor: J, overlayOpacity: oe } = t;
270
+ if (delete t.overlayColor, delete t.overlayOpacity, J) {
271
+ let e = `color-mix(in srgb, ${J} ${oe ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
272
272
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
273
273
  }
274
274
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
@@ -377,7 +377,7 @@ function U(e, t, n, r = !1) {
377
377
  function ee(e, t, n) {
378
378
  return Object.entries(j).map(([r, i]) => U(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
379
379
  }
380
- var W = [
380
+ var te = [
381
381
  {
382
382
  key: "tablet",
383
383
  max: 991
@@ -390,17 +390,17 @@ var W = [
390
390
  key: "mobile",
391
391
  max: 478
392
392
  }
393
- ], te = (e) => Object.entries(A(e)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
394
- function ne(e, t) {
395
- return W.map(({ key: n, max: r }) => {
396
- let i = t?.[n] ? te(t[n]) : "";
393
+ ], ne = (e) => Object.entries(A(e)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
394
+ function re(e, t) {
395
+ return te.map(({ key: n, max: r }) => {
396
+ let i = t?.[n] ? ne(t[n]) : "";
397
397
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
398
398
  }).filter(Boolean).join("\n");
399
399
  }
400
- function re(e, t) {
400
+ function ie(e, t) {
401
401
  let n = [], r = (e) => {
402
402
  for (let [t, r] of Object.entries(e || {})) {
403
- let e = ne(t, r.props);
403
+ let e = re(t, r.props);
404
404
  e && n.push(e);
405
405
  }
406
406
  };
@@ -408,7 +408,7 @@ function re(e, t) {
408
408
  for (let e of Object.values(t || {})) r(e.template?.nodes);
409
409
  return n.join("\n");
410
410
  }
411
- function G(e, t) {
411
+ function W(e, t) {
412
412
  let n = [], r = (e) => {
413
413
  for (let [t, r] of Object.entries(e || {})) {
414
414
  let e = ee(t, r.props);
@@ -419,15 +419,15 @@ function G(e, t) {
419
419
  for (let e of Object.values(t || {})) r(e.template?.nodes);
420
420
  return n.join("\n");
421
421
  }
422
- var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", q = {
423
- fontFamily: K,
422
+ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", K = {
423
+ fontFamily: G,
424
424
  fontStyle: "normal",
425
425
  fontWeight: 400,
426
426
  letterSpacing: "normal",
427
427
  textTransform: "none",
428
428
  lineHeight: 1.4,
429
429
  textShadow: "none"
430
- }, ie = {
430
+ }, ae = {
431
431
  light: {
432
432
  background: "#f2f2f2",
433
433
  surface: "#f2f2f2",
@@ -468,32 +468,32 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
468
468
  contrastText: "#052e2b"
469
469
  }
470
470
  }
471
- }, J = {
471
+ }, q = {
472
472
  h1: 40,
473
473
  h2: 32,
474
474
  h3: 26,
475
475
  h4: 22,
476
476
  h5: 19,
477
477
  h6: 16
478
- }, ae = {
478
+ }, J = {
479
479
  font: "system",
480
480
  headingFont: "inherit",
481
- headings: J,
481
+ headings: q,
482
482
  bodySize: 16,
483
- light: ie.light,
484
- dark: ie.dark
483
+ light: ae.light,
484
+ dark: ae.dark
485
485
  }, oe = {
486
486
  system: {
487
487
  label: "System",
488
- value: K
488
+ value: G
489
489
  },
490
490
  inter: {
491
491
  label: "Inter",
492
- value: `"Inter", ${K}`
492
+ value: `"Inter", ${G}`
493
493
  },
494
494
  outfit: {
495
495
  label: "Outfit",
496
- value: `"Outfit", ${K}`
496
+ value: `"Outfit", ${G}`
497
497
  },
498
498
  serif: {
499
499
  label: "Serif",
@@ -522,22 +522,22 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
522
522
  function le(e) {
523
523
  let { light: t, dark: n, font: r, headingFont: i, headings: a, bodySize: o, ...s } = e ?? {};
524
524
  return {
525
- font: r ?? ae.font,
526
- headingFont: i ?? ae.headingFont,
525
+ font: r ?? J.font,
526
+ headingFont: i ?? J.headingFont,
527
527
  headings: {
528
- ...J,
528
+ ...q,
529
529
  ...a ?? {}
530
530
  },
531
531
  bodySize: o ?? 16,
532
- light: ce(ie.light, s, t),
533
- dark: ce(ie.dark, n)
532
+ light: ce(ae.light, s, t),
533
+ dark: ce(ae.dark, n)
534
534
  };
535
535
  }
536
536
  function ue(e) {
537
537
  return {
538
538
  "--page-bg": e.background,
539
539
  "--page-surface": e.surface ?? e.background,
540
- "--page-border": e.border ?? ie.light.border,
540
+ "--page-border": e.border ?? ae.light.border,
541
541
  "--page-text": e.text,
542
542
  "--page-accent": e.accent,
543
543
  "--page-accent-text": e.accentText,
@@ -556,7 +556,7 @@ function de(e) {
556
556
  return {
557
557
  backgroundColor: "var(--page-bg)",
558
558
  color: "var(--page-text)",
559
- fontFamily: se(t.font, K),
559
+ fontFamily: se(t.font, G),
560
560
  "--page-heading-font": t.headingFont === "inherit" ? "inherit" : se(t.headingFont, "inherit"),
561
561
  ...pe(t.headings),
562
562
  "--page-body-size": fe(t.bodySize, 16)
@@ -567,9 +567,9 @@ function fe(e, t) {
567
567
  }
568
568
  function pe(e) {
569
569
  let t = {};
570
- for (let n of Object.keys(J)) {
571
- let r = e?.[n] ?? J[n];
572
- t[`--page-${n}`] = fe(r, J[n]);
570
+ for (let n of Object.keys(q)) {
571
+ let r = e?.[n] ?? q[n];
572
+ t[`--page-${n}`] = fe(r, q[n]);
573
573
  }
574
574
  return t;
575
575
  }
@@ -716,7 +716,7 @@ var Ae = {
716
716
  fontWeight: 700,
717
717
  lineHeight: 1.2,
718
718
  fontFamily: "var(--page-heading-font, inherit)"
719
- }, je = J, Me = (e) => `var(--page-${e}, ${J[e] ?? J.h2}px)`, Ne = {
719
+ }, je = q, Me = (e) => `var(--page-${e}, ${q[e] ?? q.h2}px)`, Ne = {
720
720
  margin: 0,
721
721
  fontSize: "var(--page-body-size, 16px)"
722
722
  }, Pe = {
@@ -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(() => {
@@ -4454,32 +4575,32 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4454
4575
  };
4455
4576
  return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
4456
4577
  }, [P, L]);
4457
- let { tenant: H, apiUrl: U } = r(Z), ee = r(xe), W = ee?.[h], te = C ? Se(ee) : 1, [ne, re] = c(null);
4578
+ let { tenant: H, apiUrl: U } = r(Z), ee = r(xe), te = ee?.[h], ne = C ? Se(ee) : 1, [re, ie] = c(null);
4458
4579
  if (i(() => {
4459
- if (!h || W) return;
4460
- let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(te - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
4580
+ if (!h || te) return;
4581
+ let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(ne - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
4461
4582
  return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
4462
4583
  let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
4463
- return e && re(n);
4464
- }).catch(() => e && re([])), () => {
4584
+ return e && ie(n);
4585
+ }).catch(() => e && ie([])), () => {
4465
4586
  e = !1;
4466
4587
  };
4467
4588
  }, [
4468
4589
  h,
4469
4590
  H,
4470
4591
  U,
4471
- W,
4472
- C,
4473
4592
  te,
4593
+ C,
4594
+ ne,
4474
4595
  g
4475
4596
  ]), !e.length) return null;
4476
- let G = Math.max(1, Number(g) || 10), K = h ? C ? W || h.startsWith("api:") ? (W ?? ne ?? []).slice((te - 1) * G, te * G) : (ne ?? []).slice(0, G) : (W ?? ne ?? []).slice(0, G) : null, q = K ? K.map((t) => e.map((e) => Oe(Ee(t?.data, e.field)))) : t, ie = !!h && !(h && !W && ne === null) && q.length === 0, J = b ? {
4597
+ let W = Math.max(1, Number(g) || 10), G = h ? C ? te || h.startsWith("api:") ? (te ?? re ?? []).slice((ne - 1) * W, ne * W) : (re ?? []).slice(0, W) : (te ?? re ?? []).slice(0, W) : null, K = G ? G.map((t) => e.map((e) => Oe(Ee(t?.data, e.field)))) : t, ae = !!h && !(h && !te && re === null) && K.length === 0, q = b ? {
4477
4598
  y: 6,
4478
4599
  x: 10
4479
4600
  } : {
4480
4601
  y: 10,
4481
4602
  x: 14
4482
- }, ae = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : J.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : J.x}px`, oe = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, se = y ? { border: oe } : { borderBottom: oe }, ce = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), le = [
4603
+ }, J = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : q.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : q.x}px`, oe = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, se = y ? { border: oe } : { borderBottom: oe }, ce = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), le = [
4483
4604
  "left",
4484
4605
  "center",
4485
4606
  "right"
@@ -4499,8 +4620,8 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4499
4620
  };
4500
4621
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
4501
4622
  }, ye = /* @__PURE__ */ new Set();
4502
- p && q.forEach((t, n) => e.forEach((e, t) => {
4503
- let r = p[Hn(a[n], o[t])];
4623
+ p && K.forEach((t, n) => e.forEach((e, 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 < q.length && L.c < e.length ? L : null, Q = (e, t) => P?.labels?.[e] ?? t, Ce = X ? p?.[Hn(a[X.r], o[X.c])] : null, we = Math.max(1, Number(Ce?.c) || 1), Te = Math.max(1, Number(Ce?.r) || 1);
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: {
@@ -4550,8 +4671,8 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4550
4671
  Y("+↑", Q("rowAbove", "Insert row above"), () => P.addRow(X.r - 1)),
4551
4672
  Y("+↓", Q("rowBelow", "Insert row below"), () => P.addRow(X.r)),
4552
4673
  Y("↑", Q("rowUp", "Move row up"), () => P.moveRow(X.r, -1), X.r === 0),
4553
- Y("↓", Q("rowDown", "Move row down"), () => P.moveRow(X.r, 1), X.r >= q.length - 1),
4554
- Y("✕ row", Q("rowDelete", "Delete row"), () => P.dropRow(X.r), q.length <= 1),
4674
+ Y("↓", Q("rowDown", "Move row down"), () => P.moveRow(X.r, 1), X.r >= K.length - 1),
4675
+ Y("✕ row", Q("rowDelete", "Delete row"), () => P.dropRow(X.r), K.length <= 1),
4555
4676
  /* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
4556
4677
  Y("+←", Q("colLeft", "Insert column left"), () => P.addColumn(X.c - 1)),
4557
4678
  Y("+→", Q("colRight", "Insert column right"), () => P.addColumn(X.c)),
@@ -4560,7 +4681,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4560
4681
  Y("✕ col", Q("colDelete", "Delete column"), () => P.dropColumn(X.c), e.length <= 1),
4561
4682
  /* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
4562
4683
  Y("↔", Q("mergeRight", "Merge with the cell on the right"), () => P.merge(X.r, X.c, "right"), X.c + we >= e.length),
4563
- Y("↕", Q("mergeDown", "Merge with the cell below"), () => P.merge(X.r, X.c, "down"), X.r + Te >= q.length),
4684
+ Y("↕", Q("mergeDown", "Merge with the cell below"), () => P.merge(X.r, X.c, "down"), X.r + Te >= K.length),
4564
4685
  Y("⤫", Q("split", "Split this cell"), () => P.split(X.r, X.c), we === 1 && Te === 1)
4565
4686
  ]
4566
4687
  }),
@@ -4590,7 +4711,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4590
4711
  style: {
4591
4712
  textAlign: de(n),
4592
4713
  fontWeight: 600,
4593
- padding: ae,
4714
+ padding: J,
4594
4715
  ...typeof D == "string" && D ? { color: D } : null,
4595
4716
  background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
4596
4717
  ...T ? {
@@ -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"),
@@ -4611,16 +4732,16 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4611
4732
  onPointerDown: ve(n)
4612
4733
  })] }) : t.label ?? t
4613
4734
  }, n)) }) }),
4614
- /* @__PURE__ */ d("tbody", { children: [ie && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
4735
+ /* @__PURE__ */ d("tbody", { children: [ae && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
4615
4736
  colSpan: e.length,
4616
4737
  style: {
4617
- padding: ae,
4738
+ padding: J,
4618
4739
  textAlign: "center",
4619
4740
  opacity: .6,
4620
4741
  ...se
4621
4742
  },
4622
4743
  children: w || "No data yet"
4623
- }) }), q.map((t, n) => /* @__PURE__ */ u("tr", {
4744
+ }) }), K.map((t, n) => /* @__PURE__ */ u("tr", {
4624
4745
  className: P ? "wb-tedit-row" : void 0,
4625
4746
  style: {
4626
4747
  ...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
@@ -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,
@@ -4636,12 +4757,12 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4636
4757
  colSpan: l > 1 ? l : void 0,
4637
4758
  rowSpan: f > 1 ? f : void 0,
4638
4759
  style: {
4639
- padding: ae,
4760
+ padding: J,
4640
4761
  ...ue(r) ? { textAlign: ue(r) } : null,
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,
@@ -4802,7 +4923,7 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
4802
4923
  year: n.getFullYear(),
4803
4924
  month: n.getMonth()
4804
4925
  };
4805
- }), W = (e, t) => /* @__PURE__ */ u("button", {
4926
+ }), te = (e, t) => /* @__PURE__ */ u("button", {
4806
4927
  type: "button",
4807
4928
  "aria-label": e,
4808
4929
  onClick: () => ee(t),
@@ -4817,7 +4938,7 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
4817
4938
  padding: "4px 8px"
4818
4939
  },
4819
4940
  children: t < 0 ? "‹" : "›"
4820
- }), te = /* @__PURE__ */ d("div", {
4941
+ }), ne = /* @__PURE__ */ d("div", {
4821
4942
  style: {
4822
4943
  display: "flex",
4823
4944
  alignItems: "center",
@@ -4834,8 +4955,8 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
4834
4955
  },
4835
4956
  children: U
4836
4957
  }),
4837
- W("Previous month", -1),
4838
- W("Next month", 1)
4958
+ te("Previous month", -1),
4959
+ te("Next month", 1)
4839
4960
  ]
4840
4961
  });
4841
4962
  if (p === "list") {
@@ -4851,7 +4972,7 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
4851
4972
  width: "100%",
4852
4973
  ...A(S)
4853
4974
  },
4854
- children: [te, e.length ? /* @__PURE__ */ u("div", {
4975
+ children: [ne, e.length ? /* @__PURE__ */ u("div", {
4855
4976
  style: {
4856
4977
  display: "flex",
4857
4978
  flexDirection: "column",
@@ -4887,10 +5008,10 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
4887
5008
  })]
4888
5009
  });
4889
5010
  }
4890
- let ne = new Date(M.year, M.month, 1), re = y === "sunday" ? 0 : 1, G = (ne.getDay() - re + 7) % 7, K = new Date(M.year, M.month + 1, 0).getDate(), q = Math.ceil((G + K) / 7), ie = Kn(/* @__PURE__ */ new Date()), J = new Intl.DateTimeFormat(V, { weekday: "short" }), ae = [];
4891
- for (let e = 0; e < q * 7; e += 1) {
4892
- let t = e - G + 1, n = t >= 1 && t <= K, r = Kn(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
4893
- ae.push(/* @__PURE__ */ d("div", {
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 = [];
5012
+ for (let e = 0; e < K * 7; e += 1) {
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;
5014
+ J.push(/* @__PURE__ */ d("div", {
4894
5015
  style: {
4895
5016
  minHeight: P.cell,
4896
5017
  borderTop: `1px solid ${I}`,
@@ -4933,7 +5054,7 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
4933
5054
  ...A(S)
4934
5055
  },
4935
5056
  children: [
4936
- te,
5057
+ ne,
4937
5058
  /* @__PURE__ */ d("div", {
4938
5059
  style: {
4939
5060
  display: "grid",
@@ -4947,19 +5068,19 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
4947
5068
  textAlign: "center",
4948
5069
  padding: `0 0 ${P.pad}px`
4949
5070
  },
4950
- children: J.format(new Date(2024, 0, 7 + re + t))
4951
- }, `head-${t}`)), ae]
5071
+ children: q.format(new Date(2024, 0, 7 + ie + t))
5072
+ }, `head-${t}`)), J]
4952
5073
  }),
4953
5074
  /* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
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,8 +5091,8 @@ 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 }) {
4974
- let { tenant: D, apiUrl: O } = r(Z), k = r(xe)?.[t], [j, M] = c(null), N = s(null), P = s(null), [F, I] = c(0), [L, R] = c(0), [z, B] = c(0), [V, H] = c(!0), [U, ee] = c(!1), [W, te] = c(!1);
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 }) {
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;
4977
5098
  let e = !0;
@@ -4988,7 +5109,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
4988
5109
  k
4989
5110
  ]), i(() => {
4990
5111
  if (typeof window > "u" || !window.matchMedia) return;
4991
- let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => te(e.matches);
5112
+ let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => ne(e.matches);
4992
5113
  return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
4993
5114
  }, []), i(() => {
4994
5115
  let e = P.current;
@@ -5001,7 +5122,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5001
5122
  let e = N.current;
5002
5123
  if (!e) return;
5003
5124
  let t = !0, n = () => {
5004
- let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * G);
5125
+ let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * W);
5005
5126
  t && n.length && R(Math.ceil(Math.max(...n)));
5006
5127
  };
5007
5128
  n();
@@ -5010,12 +5131,12 @@ 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 ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], re = 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
- }) : ne, G = $n[p] ?? $n.medium, K = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ie = f === "marquee" ? "step" : f, J = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), ae = Math.min(3e3, Math.max(100, Number(_) || 500)), oe = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || G * 3) + K, ce = F ? Math.max(1, Math.floor(F / se)) : oe, le = Math.min(oe, ce), ue = F ? Math.min(se, F / le) : se;
5018
- if (!re.length) return /* @__PURE__ */ u("div", {
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;
5139
+ if (!ie.length) return /* @__PURE__ */ u("div", {
5019
5140
  ref: T,
5020
5141
  style: {
5021
5142
  width: "100%",
@@ -5027,7 +5148,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5027
5148
  alignItems: "center",
5028
5149
  justifyContent: "center",
5029
5150
  flexWrap: "wrap",
5030
- gap: K
5151
+ gap: G
5031
5152
  },
5032
5153
  children: [
5033
5154
  0,
@@ -5037,16 +5158,16 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5037
5158
  4
5038
5159
  ].map((e) => /* @__PURE__ */ u("div", {
5039
5160
  style: {
5040
- height: G,
5041
- width: G * 3,
5161
+ height: W,
5162
+ width: W * 3,
5042
5163
  border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
5043
5164
  borderRadius: 6,
5044
5165
  display: "flex",
5045
5166
  alignItems: "center",
5046
5167
  justifyContent: "center",
5047
- fontSize: Math.max(10, Math.round(G / 4)),
5168
+ fontSize: Math.max(10, Math.round(W / 4)),
5048
5169
  opacity: .45,
5049
- ...q
5170
+ ...K
5050
5171
  },
5051
5172
  children: "LOGO"
5052
5173
  }, e))
@@ -5060,12 +5181,12 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5060
5181
  children: C
5061
5182
  }) : null
5062
5183
  });
5063
- let de = re.length, fe = ie === "step" && de > le, pe = ie === "slider", me = fe && !E && !U && !W, he = v === "right", ge = he ? de : 0, _e = fe ? [...re, ...re] : re, ve = fe ? z * ue : 0, ye = (e, t, n) => {
5184
+ let de = ie.length, fe = ae === "step" && de > le, pe = ae === "slider", me = fe && !E && !U && !te, he = v === "right", ge = he ? de : 0, _e = fe ? [...ie, ...ie] : ie, ve = fe ? z * ue : 0, ye = (e, t, n) => {
5064
5185
  let r = /* @__PURE__ */ u("img", {
5065
5186
  src: e.src,
5066
5187
  alt: e.alt ?? "",
5067
5188
  style: {
5068
- height: G,
5189
+ height: W,
5069
5190
  width: "auto",
5070
5191
  maxWidth: "100%",
5071
5192
  objectFit: "contain",
@@ -5074,7 +5195,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5074
5195
  }), i = fe ? {
5075
5196
  width: ue,
5076
5197
  flex: "0 0 auto",
5077
- padding: `0 ${K / 2}px`,
5198
+ padding: `0 ${G / 2}px`,
5078
5199
  justifyContent: "center"
5079
5200
  } : {};
5080
5201
  return e.href && !E ? /* @__PURE__ */ u("a", {
@@ -5106,14 +5227,14 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
5106
5227
  ...fe ? {
5107
5228
  width: _e.length * ue,
5108
5229
  transform: `translateX(-${ve}px)`,
5109
- transition: V ? `transform ${ae}ms ease` : "none"
5230
+ transition: V ? `transform ${J}ms ease` : "none"
5110
5231
  } : pe ? {
5111
- gap: K,
5232
+ gap: G,
5112
5233
  overflowX: "auto",
5113
5234
  scrollBehavior: "smooth",
5114
5235
  scrollSnapType: "x proximity"
5115
5236
  } : {
5116
- gap: K,
5237
+ gap: G,
5117
5238
  flexWrap: "wrap",
5118
5239
  justifyContent: "center"
5119
5240
  }
@@ -5199,10 +5320,10 @@ 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
- every: J + ae,
5205
- slide: ae,
5325
+ every: q + J,
5326
+ slide: J,
5206
5327
  step: he ? -1 : 1,
5207
5328
  index: z,
5208
5329
  total: de,
@@ -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,39 +5570,142 @@ function ir({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
5449
5570
  })]
5450
5571
  });
5451
5572
  }
5452
- var ar = {
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 }) {
5574
+ let [_, v] = c(!1), y = s(null), b = s(null), x = r !== "click", S = () => {
5575
+ b.current && clearTimeout(b.current), b.current = null;
5576
+ }, C = () => {
5577
+ S(), b.current = setTimeout(() => v(!1), 160);
5578
+ };
5579
+ i(() => {
5580
+ if (g || !e) return;
5581
+ let t = `[data-webim-toggle="${e}"]`, n = (e) => {
5582
+ e.target.closest?.(t) && (e.preventDefault(), S(), v((e) => !e));
5583
+ }, r = (e) => {
5584
+ e.target.closest?.(t) && (S(), v(!0));
5585
+ }, i = (e) => {
5586
+ let n = e.target.closest?.(t);
5587
+ !n || e.relatedTarget && n.contains(e.relatedTarget) || C();
5588
+ };
5589
+ return document.addEventListener("click", n), x && (document.addEventListener("mouseover", r), document.addEventListener("mouseout", i)), () => {
5590
+ document.removeEventListener("click", n), document.removeEventListener("mouseover", r), document.removeEventListener("mouseout", i);
5591
+ };
5592
+ }, [
5593
+ g,
5594
+ e,
5595
+ x
5596
+ ]), i(() => {
5597
+ if (g || !_) return;
5598
+ let t = (t) => {
5599
+ y.current?.contains(t.target) || e && t.target.closest?.(`[data-webim-toggle="${e}"]`) || v(!1);
5600
+ }, n = (e) => e.key === "Escape" && v(!1);
5601
+ return document.addEventListener("mousedown", t), document.addEventListener("keydown", n), () => {
5602
+ document.removeEventListener("mousedown", t), document.removeEventListener("keydown", n);
5603
+ };
5604
+ }, [
5605
+ g,
5606
+ _,
5607
+ e
5608
+ ]), i(() => S, []);
5609
+ let w = Number(o) > 0 ? Number(o) : null, T = g ? f !== !1 : _, E = /* @__PURE__ */ u("div", {
5610
+ style: {
5611
+ position: "absolute",
5612
+ top: `calc(100% + ${Number(l) || 0}px)`,
5613
+ ...a === "right" ? { right: 0 } : a === "center" ? {
5614
+ left: "50%",
5615
+ transform: "translateX(-50%)"
5616
+ } : { left: 0 },
5617
+ zIndex: 60,
5618
+ display: T ? "block" : "none",
5619
+ minWidth: w ?? 240,
5620
+ width: w ?? void 0,
5621
+ maxWidth: "92vw",
5622
+ padding: 14,
5623
+ borderRadius: 10,
5624
+ background: "var(--page-surface, #ffffff)",
5625
+ color: "var(--page-text, inherit)",
5626
+ border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
5627
+ boxShadow: "0 16px 44px rgba(15, 23, 42, 0.22)",
5628
+ ...A(m)
5629
+ },
5630
+ children: p?.content ?? null
5631
+ });
5632
+ return /* @__PURE__ */ d("div", {
5633
+ ref: (e) => {
5634
+ y.current = e, h && h(e);
5635
+ },
5636
+ id: e || void 0,
5637
+ onMouseEnter: !g && x ? () => {
5638
+ S(), v(!0);
5639
+ } : void 0,
5640
+ onMouseLeave: !g && x ? C : void 0,
5641
+ style: {
5642
+ position: "relative",
5643
+ display: "inline-block"
5644
+ },
5645
+ children: [t !== "none" && /* @__PURE__ */ d("button", {
5646
+ type: "button",
5647
+ "aria-haspopup": "true",
5648
+ "aria-expanded": g ? void 0 : _,
5649
+ onClick: () => !g && v((e) => !e),
5650
+ style: {
5651
+ padding: "9px 16px",
5652
+ border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
5653
+ borderRadius: 6,
5654
+ cursor: "pointer",
5655
+ fontSize: 15,
5656
+ fontFamily: "inherit",
5657
+ background: "var(--page-surface, transparent)",
5658
+ color: "inherit",
5659
+ display: "inline-flex",
5660
+ alignItems: "center",
5661
+ gap: 6
5662
+ },
5663
+ children: [n, /* @__PURE__ */ u("span", {
5664
+ "aria-hidden": "true",
5665
+ style: {
5666
+ fontSize: 10,
5667
+ opacity: .7
5668
+ },
5669
+ children: "▾"
5670
+ })]
5671
+ }), E]
5672
+ });
5673
+ }
5674
+ var pr = {
5453
5675
  PageRoot: ze,
5454
- CalendarBlock: Qn,
5455
- LogoCarousel: tr,
5456
- DialogBlock: ir,
5676
+ CalendarBlock: ar,
5677
+ LogoCarousel: cr,
5678
+ DialogBlock: dr,
5679
+ DropdownBlock: fr,
5457
5680
  Section: Be,
5458
5681
  Container: Ve,
5459
5682
  Heading: He,
5460
5683
  TextBlock: nt,
5461
5684
  ButtonBlock: at,
5462
5685
  ImageBlock: ot,
5463
- Spacer: ft,
5464
- Divider: pt,
5465
- BoxBlock: mt,
5466
- SliderBlock: bt,
5467
- CanvasSlider: xt,
5468
- TabsBlock: Lt,
5469
- QuickStack: un,
5470
- CollectionList: dn,
5471
- CollectionSearch: fn,
5472
- BreadcrumbsBlock: pn,
5473
- PaginationBlock: mn,
5474
- StepperBlock: En,
5475
- SocialLinksBlock: Tn,
5476
- ThemeModeBlock: yn,
5477
- ScrollTopBlock: Cn,
5478
- OrgChartBlock: Rn,
5479
- TableBlock: Wn,
5480
- IconBlock: At,
5481
- MapBlock: Ot,
5482
- MasonryBlock: Mt,
5483
- AccordionBlock: Rt,
5484
- 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,
5485
5709
  ListBlock: tt,
5486
5710
  TextSpan: Ke,
5487
5711
  QuoteBlock: et,
@@ -5491,56 +5715,56 @@ var ar = {
5491
5715
  VideoBlock: st,
5492
5716
  YouTubeBlock: lt,
5493
5717
  IframeBlock: ut,
5494
- EmbedBlock: dt,
5495
- FormBlock: Zt,
5496
- FormLabel: nn,
5497
- FormInput: rn,
5498
- FormTextarea: an,
5499
- 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, {
5500
5724
  kind: "checkbox",
5501
5725
  ...e
5502
5726
  }),
5503
- FormRadio: (e) => /* @__PURE__ */ u(on, {
5727
+ FormRadio: (e) => /* @__PURE__ */ u(cn, {
5504
5728
  kind: "radio",
5505
5729
  ...e
5506
5730
  }),
5507
- FormSelect: sn,
5508
- FormFile: cn,
5509
- FormRecaptcha: tn,
5510
- FormSubmit: ln
5511
- }, or = {
5731
+ FormSelect: ln,
5732
+ FormFile: un,
5733
+ FormRecaptcha: rn,
5734
+ FormSubmit: dn
5735
+ }, mr = {
5512
5736
  id: "auth",
5513
5737
  label: "Accounts",
5514
5738
  category: "Apps",
5515
5739
  keys: ["SiteLoginForm", "SiteAccountMenu"],
5516
5740
  ssr: "shell",
5517
5741
  settings: ["site.authRedirect"]
5518
- }, sr = t({
5742
+ }, hr = t({
5519
5743
  user: null,
5520
5744
  status: "idle",
5521
5745
  ensure: () => {},
5522
5746
  refresh: () => {},
5523
5747
  signOut: () => {}
5524
5748
  });
5525
- function cr(e, t) {
5749
+ function gr(e, t) {
5526
5750
  return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
5527
5751
  }
5528
- function lr(e) {
5752
+ function _r(e) {
5529
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);
5530
5754
  return {
5531
5755
  mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
5532
5756
  url: i,
5533
5757
  mePath: a,
5534
5758
  logoutPath: o,
5535
- meUrl: cr(i, a),
5536
- logoutUrl: cr(i, o),
5759
+ meUrl: gr(i, a),
5760
+ logoutUrl: gr(i, o),
5537
5761
  loginPage: r(n.loginPage),
5538
5762
  userPath: r(n.userPath),
5539
5763
  auth: n.auth === "bearer" ? "bearer" : "cookies",
5540
5764
  tokenKey: r(n.tokenKey) || "webim_session_token"
5541
5765
  };
5542
5766
  }
5543
- function ur(e, t) {
5767
+ function vr(e, t) {
5544
5768
  if (!t) return e ?? null;
5545
5769
  let n = e;
5546
5770
  for (let e of t.split(".")) {
@@ -5549,26 +5773,26 @@ function ur(e, t) {
5549
5773
  }
5550
5774
  return n ?? null;
5551
5775
  }
5552
- function dr(e) {
5776
+ function yr(e) {
5553
5777
  try {
5554
5778
  return window.localStorage.getItem(e) || "";
5555
5779
  } catch {
5556
5780
  return "";
5557
5781
  }
5558
5782
  }
5559
- function fr(e) {
5783
+ function br(e) {
5560
5784
  try {
5561
5785
  window.localStorage.removeItem(e);
5562
5786
  } catch {}
5563
5787
  }
5564
- var pr = () => {
5565
- let e = r(sr);
5788
+ var xr = () => {
5789
+ let e = r(hr);
5566
5790
  return i(() => {
5567
5791
  e.ensure();
5568
5792
  }, [e]), e;
5569
5793
  };
5570
- function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
5571
- let f = r(Z), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => lr(f?.settings), [f?.settings]), [g, _] = c(t ?? null), [v, y] = c(t ? "user" : a ? "guest" : "idle"), b = s(!1), x = n((e, t) => fetch(`${p}${e}`, {
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}`, {
5572
5796
  ...t,
5573
5797
  credentials: "include",
5574
5798
  headers: {
@@ -5580,9 +5804,9 @@ function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
5580
5804
  if (a) return Promise.resolve(null);
5581
5805
  if (h.mode === "off") return Promise.resolve(S(null));
5582
5806
  if (h.mode === "custom") {
5583
- let e = h.auth === "bearer" ? dr(h.tokenKey) : "";
5807
+ let e = h.auth === "bearer" ? yr(h.tokenKey) : "";
5584
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) => {
5585
- let t = ur(e, h.userPath);
5809
+ let t = vr(e, h.userPath);
5586
5810
  return S(t && typeof t == "object" ? t : null);
5587
5811
  }).catch(() => S(null));
5588
5812
  }
@@ -5595,12 +5819,12 @@ function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
5595
5819
  ]), w = n(() => {
5596
5820
  if (h.mode === "off") return S(null), Promise.resolve();
5597
5821
  if (h.mode === "custom") {
5598
- let e = h.auth === "bearer" ? dr(h.tokenKey) : "";
5822
+ let e = h.auth === "bearer" ? yr(h.tokenKey) : "";
5599
5823
  return (h.logoutUrl ? fetch(h.logoutUrl, {
5600
5824
  method: "post",
5601
5825
  ...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
5602
5826
  }).catch(() => {}) : Promise.resolve()).then(() => {
5603
- h.auth === "bearer" && fr(h.tokenKey), S(null);
5827
+ h.auth === "bearer" && br(h.tokenKey), S(null);
5604
5828
  });
5605
5829
  }
5606
5830
  return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
@@ -5650,18 +5874,18 @@ function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
5650
5874
  h.loginPage,
5651
5875
  C,
5652
5876
  w
5653
- ]), /* @__PURE__ */ u(sr.Provider, {
5877
+ ]), /* @__PURE__ */ u(hr.Provider, {
5654
5878
  value: E,
5655
5879
  children: e
5656
5880
  });
5657
5881
  }
5658
- function hr({ when: e, children: t }) {
5659
- let { status: n } = pr();
5882
+ function Cr({ when: e, children: t }) {
5883
+ let { status: n } = xr();
5660
5884
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
5661
5885
  }
5662
5886
  //#endregion
5663
5887
  //#region ../ui/src/components/builder/apps/auth/views.jsx
5664
- function gr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
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 }) {
5665
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) => {
5666
5890
  if (e.preventDefault(), f) return;
5667
5891
  let n = new FormData(e.currentTarget);
@@ -5710,20 +5934,20 @@ function gr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5710
5934
  children: [
5711
5935
  w ? /* @__PURE__ */ d("label", {
5712
5936
  style: {
5713
- ...Bt,
5937
+ ...Ht,
5714
5938
  display: "grid",
5715
5939
  gap: 6
5716
5940
  },
5717
5941
  children: [a, /* @__PURE__ */ u("input", {
5718
5942
  name: "name",
5719
5943
  type: "text",
5720
- style: Vt,
5721
- ...Ut(f)
5944
+ style: Ut,
5945
+ ...Gt(f)
5722
5946
  })]
5723
5947
  }) : null,
5724
5948
  /* @__PURE__ */ d("label", {
5725
5949
  style: {
5726
- ...Bt,
5950
+ ...Ht,
5727
5951
  display: "grid",
5728
5952
  gap: 6
5729
5953
  },
@@ -5731,13 +5955,13 @@ function gr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5731
5955
  name: "email",
5732
5956
  type: "email",
5733
5957
  required: !f,
5734
- style: Vt,
5735
- ...Ut(f)
5958
+ style: Ut,
5959
+ ...Gt(f)
5736
5960
  })]
5737
5961
  }),
5738
5962
  /* @__PURE__ */ d("label", {
5739
5963
  style: {
5740
- ...Bt,
5964
+ ...Ht,
5741
5965
  display: "grid",
5742
5966
  gap: 6
5743
5967
  },
@@ -5745,8 +5969,8 @@ function gr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5745
5969
  name: "password",
5746
5970
  type: "password",
5747
5971
  required: !f,
5748
- style: Vt,
5749
- ...Ut(f)
5972
+ style: Ut,
5973
+ ...Gt(f)
5750
5974
  })]
5751
5975
  }),
5752
5976
  /* @__PURE__ */ u("button", {
@@ -5785,8 +6009,8 @@ function gr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5785
6009
  ]
5786
6010
  });
5787
6011
  }
5788
- function _r({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
5789
- let { user: c, status: l, signOut: f } = pr(), 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 ? {
5790
6014
  name: "Ada Lovelace",
5791
6015
  email: "ada@example.com"
5792
6016
  } : c;
@@ -5807,7 +6031,7 @@ function _r({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5807
6031
  children: [
5808
6032
  /* @__PURE__ */ d("span", {
5809
6033
  style: {
5810
- ...Bt,
6034
+ ...Ht,
5811
6035
  fontWeight: 600
5812
6036
  },
5813
6037
  children: [
@@ -5818,7 +6042,7 @@ function _r({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5818
6042
  }),
5819
6043
  n && m?.email ? /* @__PURE__ */ u("span", {
5820
6044
  style: {
5821
- ...Bt,
6045
+ ...Ht,
5822
6046
  opacity: .7
5823
6047
  },
5824
6048
  children: m.email
@@ -5834,7 +6058,7 @@ function _r({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5834
6058
  fontSize: 14,
5835
6059
  cursor: a ? "default" : "pointer"
5836
6060
  },
5837
- ...Ut(a),
6061
+ ...Gt(a),
5838
6062
  children: t
5839
6063
  })
5840
6064
  ]
@@ -5851,40 +6075,40 @@ function _r({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5851
6075
  }
5852
6076
  //#endregion
5853
6077
  //#region ../ui/src/components/builder/apps/consent/manifest.js
5854
- var vr = {
6078
+ var Er = {
5855
6079
  id: "consent",
5856
6080
  label: "Cookie consent",
5857
6081
  category: "Apps",
5858
6082
  keys: ["CookieConsent"],
5859
6083
  ssr: "shell",
5860
6084
  settings: []
5861
- }, yr = "webim.cookie_consent";
5862
- function br() {
6085
+ }, Dr = "webim.cookie_consent";
6086
+ function Or() {
5863
6087
  try {
5864
- let e = window.localStorage.getItem(yr), t = e ? JSON.parse(e) : null;
6088
+ let e = window.localStorage.getItem(Dr), t = e ? JSON.parse(e) : null;
5865
6089
  return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
5866
6090
  } catch {
5867
6091
  return "";
5868
6092
  }
5869
6093
  }
5870
- function xr(e) {
6094
+ function kr(e) {
5871
6095
  try {
5872
6096
  document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
5873
6097
  } catch {}
5874
6098
  }
5875
- function Sr(e) {
6099
+ function Ar(e) {
5876
6100
  try {
5877
- window.localStorage.setItem(yr, JSON.stringify({
6101
+ window.localStorage.setItem(Dr, JSON.stringify({
5878
6102
  choice: e,
5879
6103
  at: (/* @__PURE__ */ new Date()).toISOString()
5880
6104
  }));
5881
6105
  } catch {}
5882
- xr(e);
6106
+ kr(e);
5883
6107
  try {
5884
6108
  window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
5885
6109
  } catch {}
5886
6110
  }
5887
- var Cr = {
6111
+ var jr = {
5888
6112
  bottom: {
5889
6113
  left: 0,
5890
6114
  right: 0,
@@ -5906,18 +6130,18 @@ var Cr = {
5906
6130
  maxWidth: 400
5907
6131
  }
5908
6132
  };
5909
- function wr({ 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 }) {
5910
6134
  let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
5911
6135
  y(e), typeof m == "function" && m(e);
5912
6136
  };
5913
6137
  if (i(() => {
5914
6138
  if (h) return;
5915
- let e = br();
5916
- e ? xr(e) : _(!0);
6139
+ let e = Or();
6140
+ e ? kr(e) : _(!0);
5917
6141
  }, [h, v]), !g) return null;
5918
6142
  let x = (e) => () => {
5919
- h || (Sr(e), _(!1));
5920
- }, S = Cr[s] ?? Cr.bottom, C = {
6143
+ h || (Ar(e), _(!1));
6144
+ }, S = jr[s] ?? jr.bottom, C = {
5921
6145
  appearance: "none",
5922
6146
  font: "inherit",
5923
6147
  fontSize: 14,
@@ -5997,37 +6221,37 @@ function wr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
5997
6221
  }
5998
6222
  //#endregion
5999
6223
  //#region ../ui/src/components/builder/apps/language/manifest.js
6000
- var Tr = {
6224
+ var Nr = {
6001
6225
  id: "language",
6002
6226
  label: "Language",
6003
6227
  category: "Apps",
6004
6228
  keys: ["SiteLanguagePicker"],
6005
6229
  ssr: "prefetch",
6006
6230
  settings: ["locales"]
6007
- }, Er = {
6231
+ }, Pr = {
6008
6232
  id: "search",
6009
6233
  label: "Search",
6010
6234
  category: "Apps",
6011
6235
  keys: ["SiteSearch"],
6012
6236
  ssr: "prefetch",
6013
6237
  settings: []
6014
- }, Dr = 50, Or = 2e3;
6015
- function kr() {
6238
+ }, Fr = 50, Ir = 2e3;
6239
+ function Lr() {
6016
6240
  return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
6017
6241
  }
6018
- function Ar(e, t) {
6242
+ function Rr(e, t) {
6019
6243
  let n = e?.data ?? {}, r = [];
6020
6244
  for (let e of Object.values(n)) {
6021
6245
  let t = e == null ? "" : Oe(e);
6022
- if (t && r.push(t), r.join(" ").length > Or) break;
6246
+ if (t && r.push(t), r.join(" ").length > Ir) break;
6023
6247
  }
6024
- return r.join(" ").slice(0, Or).toLocaleLowerCase(t || void 0);
6248
+ return r.join(" ").slice(0, Ir).toLocaleLowerCase(t || void 0);
6025
6249
  }
6026
- function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
6027
- let { tenant: b, apiUrl: x, locale: S } = r(Z), [C, w] = c(() => kr()), [T, E] = c(() => kr()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
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";
6028
6252
  i(() => {
6029
6253
  let e = () => {
6030
- let e = kr();
6254
+ let e = Lr();
6031
6255
  w(e), E(e);
6032
6256
  };
6033
6257
  return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
@@ -6078,7 +6302,7 @@ function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6078
6302
  });
6079
6303
  }
6080
6304
  else for (let t of e.rows) {
6081
- if (!Ar(t, S).includes(P)) continue;
6305
+ if (!Rr(t, S).includes(P)) continue;
6082
6306
  let n = t?.data ?? {}, r = Oe(n.name) || "Untitled", i = Oe(n.slug);
6083
6307
  F.push({
6084
6308
  key: `entry:${t.id}`,
@@ -6087,7 +6311,7 @@ function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6087
6311
  kind: "entry"
6088
6312
  });
6089
6313
  }
6090
- let I = F.slice(0, Math.min(Math.max(1, p), Dr)), L = (e) => {
6314
+ let I = F.slice(0, Math.min(Math.max(1, p), Fr)), L = (e) => {
6091
6315
  if (v) {
6092
6316
  e.preventDefault(), w(T), j(!0);
6093
6317
  return;
@@ -6169,7 +6393,7 @@ function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6169
6393
  onChange: (e) => E(e.target.value),
6170
6394
  onFocus: () => P && j(!0),
6171
6395
  style: {
6172
- ...Vt,
6396
+ ...Ut,
6173
6397
  flexGrow: 1,
6174
6398
  minWidth: 0
6175
6399
  }
@@ -6227,21 +6451,21 @@ function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6227
6451
  }
6228
6452
  //#endregion
6229
6453
  //#region ../ui/src/components/builder/apps/language/views.jsx
6230
- function Mr(e) {
6454
+ function Br(e) {
6231
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());
6232
6456
  return [...new Set(n.map((e) => e.trim()))];
6233
6457
  }
6234
- var Nr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
6235
- function Pr(e, t) {
6458
+ var Vr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
6459
+ function Hr(e, t) {
6236
6460
  let n = String(e ?? "").toUpperCase();
6237
6461
  if (t === "code") return n;
6238
6462
  let r = "";
6239
6463
  try {
6240
- r = Nr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
6464
+ r = Vr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
6241
6465
  } catch {}
6242
6466
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
6243
6467
  }
6244
- function Fr(e, t) {
6468
+ function Ur(e, t) {
6245
6469
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
6246
6470
  if (typeof window > "u") return n || "?";
6247
6471
  try {
@@ -6251,8 +6475,8 @@ function Fr(e, t) {
6251
6475
  return n || "/";
6252
6476
  }
6253
6477
  }
6254
- function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
6255
- let c = r(Z), l = Mr(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 = {
6256
6480
  display: "inline-flex",
6257
6481
  alignItems: "center",
6258
6482
  gap: 8,
@@ -6287,7 +6511,7 @@ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
6287
6511
  style: { opacity: .4 },
6288
6512
  children: n ?? "·"
6289
6513
  }), /* @__PURE__ */ u("a", {
6290
- href: Fr(e, e === f),
6514
+ href: Ur(e, e === f),
6291
6515
  hrefLang: e,
6292
6516
  "aria-current": e === p ? "true" : void 0,
6293
6517
  onClick: s ? (e) => e.preventDefault() : void 0,
@@ -6297,7 +6521,7 @@ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
6297
6521
  textDecoration: "none",
6298
6522
  cursor: s ? "default" : "pointer"
6299
6523
  },
6300
- children: Pr(e, t)
6524
+ children: Hr(e, t)
6301
6525
  })]
6302
6526
  }, e))]
6303
6527
  }) : /* @__PURE__ */ d("div", {
@@ -6308,7 +6532,7 @@ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
6308
6532
  value: p,
6309
6533
  onChange: s ? void 0 : (e) => {
6310
6534
  let t = e.target.value;
6311
- window.location.assign(Fr(t, t === f));
6535
+ window.location.assign(Ur(t, t === f));
6312
6536
  },
6313
6537
  onKeyDown: s ? (e) => e.preventDefault() : void 0,
6314
6538
  style: {
@@ -6322,47 +6546,47 @@ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
6322
6546
  },
6323
6547
  children: l.map((e) => /* @__PURE__ */ u("option", {
6324
6548
  value: e,
6325
- children: Pr(e, t)
6549
+ children: Hr(e, t)
6326
6550
  }, e))
6327
6551
  })]
6328
6552
  });
6329
6553
  }
6330
6554
  //#endregion
6331
6555
  //#region ../ui/src/components/builder/apps/index.js
6332
- var Lr = [
6333
- or,
6334
- Tr,
6335
- vr,
6336
- Er
6337
- ], Rr = {
6338
- SiteLoginForm: gr,
6339
- SiteAccountMenu: _r,
6340
- SiteLanguagePicker: Ir,
6341
- CookieConsent: wr,
6342
- SiteSearch: jr
6556
+ var Gr = [
6557
+ mr,
6558
+ Nr,
6559
+ Er,
6560
+ Pr
6561
+ ], Kr = {
6562
+ SiteLoginForm: wr,
6563
+ SiteAccountMenu: Tr,
6564
+ SiteLanguagePicker: Wr,
6565
+ CookieConsent: Mr,
6566
+ SiteSearch: zr
6343
6567
  };
6344
- new Set(Lr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
6568
+ new Set(Gr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
6345
6569
  //#endregion
6346
6570
  //#region ../ui/src/components/builder/three/runtime.js
6347
- var zr = "0.185.1", Br = "4.2.0", Vr = "https://cdn.jsdelivr.net/npm", Hr = `${Vr}/three@${zr}/+esm`, Ur = `${Vr}/@google/model-viewer@${Br}/dist/model-viewer.min.js`, Wr = (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(
6348
6572
  /* @vite-ignore */
6349
6573
  /* webpackIgnore: true */
6350
6574
  e
6351
- ), Gr = /* @__PURE__ */ new Map();
6352
- function Kr(e) {
6353
- if (Gr.has(e)) return Gr.get(e);
6575
+ ), $r = /* @__PURE__ */ new Map();
6576
+ function ei(e) {
6577
+ if ($r.has(e)) return $r.get(e);
6354
6578
  if (typeof window > "u") return new Promise(() => {});
6355
- let t = Wr(e).catch((t) => {
6356
- throw Gr.delete(e), t;
6579
+ let t = Qr(e).catch((t) => {
6580
+ throw $r.delete(e), t;
6357
6581
  });
6358
- return Gr.set(e, t), t;
6582
+ return $r.set(e, t), t;
6359
6583
  }
6360
- var qr = () => Kr(Hr), Jr = (e) => Kr(`${Vr}/three@${zr}/examples/jsm/${e}/+esm`);
6361
- function Yr() {
6362
- return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Kr(Ur);
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);
6363
6587
  }
6364
- var Xr = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Zr = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
6365
- function Qr(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) {
6366
6590
  let n = 0, r = 0, i = 0, a = !0, o = (e) => {
6367
6591
  n = requestAnimationFrame(o), i ||= e;
6368
6592
  let a = r ? (e - r) / 1e3 : 0;
@@ -6381,7 +6605,7 @@ function Qr(e, t) {
6381
6605
  s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
6382
6606
  };
6383
6607
  }
6384
- function $r(e, t, n = {}) {
6608
+ function si(e, t, n = {}) {
6385
6609
  let r = {
6386
6610
  radius: n.distance ?? 4,
6387
6611
  polar: n.polar ?? Math.PI / 2.4,
@@ -6430,13 +6654,13 @@ function $r(e, t, n = {}) {
6430
6654
  }
6431
6655
  //#endregion
6432
6656
  //#region ../ui/src/components/builder/three/views.jsx
6433
- var ei = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ti = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, ni = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, ri = (e) => typeof e == "string" && !!e.trim();
6434
- function ii({ 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 }) {
6435
6659
  return /* @__PURE__ */ d("div", {
6436
6660
  ref: r,
6437
6661
  style: {
6438
6662
  ...A(i),
6439
- minHeight: ei(n, 320),
6663
+ minHeight: ci(n, 320),
6440
6664
  display: "flex",
6441
6665
  flexDirection: "column",
6442
6666
  alignItems: "center",
@@ -6445,7 +6669,7 @@ function ii({ label: e, note: t, height: n, nodeRef: r, style: i }) {
6445
6669
  border: "1px dashed rgba(148,163,184,.55)",
6446
6670
  borderRadius: 10,
6447
6671
  background: "rgba(148,163,184,.08)",
6448
- ...q,
6672
+ ...K,
6449
6673
  color: "rgba(100,116,139,.95)",
6450
6674
  fontSize: 13,
6451
6675
  textAlign: "center",
@@ -6464,24 +6688,24 @@ function ii({ label: e, note: t, height: n, nodeRef: r, style: i }) {
6464
6688
  }) : null]
6465
6689
  });
6466
6690
  }
6467
- function ai({ 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 }) {
6468
6692
  let [y, b] = c(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = c(!1);
6469
6693
  i(() => {
6470
6694
  if (y || !e) return;
6471
6695
  let t = !0;
6472
- return Yr().then(() => t && b(!0), () => t && S(!0)), () => {
6696
+ return ri().then(() => t && b(!0), () => t && S(!0)), () => {
6473
6697
  t = !1;
6474
6698
  };
6475
6699
  }, [y, e]);
6476
6700
  let C = {
6477
6701
  display: "block",
6478
6702
  width: "100%",
6479
- minHeight: ei(r, 360),
6480
- height: ei(r, 360),
6703
+ minHeight: ci(r, 360),
6704
+ height: ci(r, 360),
6481
6705
  backgroundColor: a || "transparent",
6482
6706
  ...A(g)
6483
6707
  };
6484
- if (!e) return v ? /* @__PURE__ */ u(ii, {
6708
+ if (!e) return v ? /* @__PURE__ */ u(fi, {
6485
6709
  nodeRef: _,
6486
6710
  style: g,
6487
6711
  height: r,
@@ -6516,13 +6740,13 @@ function ai({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotate
6516
6740
  poster: t || void 0,
6517
6741
  style: C,
6518
6742
  "camera-controls": w(!v && l !== !1),
6519
- "auto-rotate": w(T && !Xr()),
6520
- "auto-rotate-delay": T ? String(ei(s, 0)) : void 0,
6743
+ "auto-rotate": w(T && !ii()),
6744
+ "auto-rotate-delay": T ? String(ci(s, 0)) : void 0,
6521
6745
  "rotation-per-second": "18deg",
6522
6746
  ar: w(!v && d === !0),
6523
6747
  "ar-modes": "webxr scene-viewer quick-look",
6524
- "shadow-intensity": String(ti(p, 100)),
6525
- exposure: String(ti(f, 100)),
6748
+ "shadow-intensity": String(li(p, 100)),
6749
+ exposure: String(li(f, 100)),
6526
6750
  "field-of-view": m ? `${Number(m)}deg` : void 0,
6527
6751
  "environment-image": h && h !== "neutral" ? h : "neutral",
6528
6752
  "interaction-prompt": v ? "none" : void 0,
@@ -6540,7 +6764,7 @@ function ai({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotate
6540
6764
  }) : null
6541
6765
  });
6542
6766
  }
6543
- var oi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), si = [
6767
+ var mi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), hi = [
6544
6768
  "precision highp float;",
6545
6769
  "uniform vec2 u_res;",
6546
6770
  "uniform float u_time;",
@@ -6563,7 +6787,7 @@ var oi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
6563
6787
  " return v;",
6564
6788
  "}",
6565
6789
  ""
6566
- ].join("\n"), ci = {
6790
+ ].join("\n"), gi = {
6567
6791
  gradient: [
6568
6792
  "void main(){",
6569
6793
  " vec2 uv = gl_FragCoord.xy / u_res;",
@@ -6615,7 +6839,7 @@ var oi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
6615
6839
  "}"
6616
6840
  ].join("\n")
6617
6841
  };
6618
- function li(e, t) {
6842
+ function _i(e, t) {
6619
6843
  let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
6620
6844
  if (!n) return t;
6621
6845
  let r = parseInt(n[1], 16);
@@ -6625,7 +6849,7 @@ function li(e, t) {
6625
6849
  (r & 255) / 255
6626
6850
  ];
6627
6851
  }
6628
- function ui(e, t, n) {
6852
+ function vi(e, t, n) {
6629
6853
  let r = e.createShader(t);
6630
6854
  if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
6631
6855
  let t = e.getShaderInfoLog(r);
@@ -6633,13 +6857,13 @@ function ui(e, t, n) {
6633
6857
  }
6634
6858
  return r;
6635
6859
  }
6636
- function di({ 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 }) {
6637
6861
  let _ = s(null), v = s(null), y = s(null), [b, x] = c("");
6638
6862
  i(() => () => {
6639
6863
  let e = y.current;
6640
6864
  y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
6641
6865
  }, []);
6642
- let S = typeof t == "string" && t.trim() ? t : ci[e] ?? ci.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(a ?? ""), E = ti(o, 100), D = Math.max(.05, ti(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));
6643
6867
  return i(() => {
6644
6868
  let e = _.current, t = v.current;
6645
6869
  if (!e || !t) return;
@@ -6654,7 +6878,7 @@ function di({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
6654
6878
  }
6655
6879
  let r = null;
6656
6880
  try {
6657
- let e = ui(n, n.VERTEX_SHADER, oi), t = ui(n, n.FRAGMENT_SHADER, si + S);
6881
+ let e = vi(n, n.VERTEX_SHADER, mi), t = vi(n, n.FRAGMENT_SHADER, hi + S);
6658
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");
6659
6883
  x("");
6660
6884
  } catch (e) {
@@ -6690,28 +6914,28 @@ function di({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
6690
6914
  };
6691
6915
  p !== !1 && t.addEventListener("pointermove", l);
6692
6916
  let u = () => {
6693
- let r = Zr(), 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));
6694
6918
  (e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
6695
6919
  }, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
6696
6920
  d?.observe(t), u();
6697
- let f = Xr(), m = {
6698
- a: li(C, [
6921
+ let f = ii(), m = {
6922
+ a: _i(C, [
6699
6923
  .35,
6700
6924
  .4,
6701
6925
  .95
6702
6926
  ]),
6703
- b: li(w, [
6927
+ b: _i(w, [
6704
6928
  .05,
6705
6929
  .06,
6706
6930
  .16
6707
6931
  ]),
6708
- c: li(T, [
6932
+ c: _i(T, [
6709
6933
  .95,
6710
6934
  .35,
6711
6935
  .6
6712
6936
  ])
6713
6937
  }, h = {};
6714
- return h.stop = Qr(t, (t, r) => {
6938
+ return h.stop = oi(t, (t, r) => {
6715
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?.();
6716
6940
  }), () => {
6717
6941
  h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
@@ -6730,7 +6954,7 @@ function di({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
6730
6954
  },
6731
6955
  style: {
6732
6956
  position: "relative",
6733
- minHeight: ei(f, 320),
6957
+ minHeight: ci(f, 320),
6734
6958
  overflow: "hidden",
6735
6959
  ...A(m)
6736
6960
  },
@@ -6752,7 +6976,7 @@ function di({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
6752
6976
  justifyContent: "center",
6753
6977
  padding: 12,
6754
6978
  background: "rgba(15,23,42,.75)",
6755
- ...q,
6979
+ ...K,
6756
6980
  color: "#fecaca",
6757
6981
  fontSize: 11,
6758
6982
  whiteSpace: "pre-wrap",
@@ -6762,7 +6986,7 @@ function di({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
6762
6986
  }) : null]
6763
6987
  });
6764
6988
  }
6765
- function fi(e, t) {
6989
+ function bi(e, t) {
6766
6990
  let n = new e.Scene(), r = new e.BoxGeometry();
6767
6991
  r.deleteAttribute("uv");
6768
6992
  let i = new e.Mesh(r, new e.MeshBasicMaterial({
@@ -6778,23 +7002,23 @@ function fi(e, t) {
6778
7002
  let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
6779
7003
  return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
6780
7004
  }
6781
- var pi = /* @__PURE__ */ new Map();
6782
- function mi(e) {
6783
- if (pi.has(e)) return pi.get(e);
6784
- let t = Jr("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) => {
6785
7009
  new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
6786
7010
  })).catch((t) => {
6787
- throw pi.delete(e), t;
7011
+ throw xi.delete(e), t;
6788
7012
  });
6789
- return pi.set(e, t), t;
7013
+ return xi.set(e, t), t;
6790
7014
  }
6791
- function hi(e, t) {
7015
+ function Ci(e, t) {
6792
7016
  let n = new e.Box3().setFromObject(t);
6793
7017
  if (n.isEmpty()) return t;
6794
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();
6795
7019
  return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
6796
7020
  }
6797
- var gi = {
7021
+ var wi = {
6798
7022
  box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
6799
7023
  sphere: (e) => new e.SphereGeometry(.62, 48, 32),
6800
7024
  torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
@@ -6803,50 +7027,50 @@ var gi = {
6803
7027
  cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
6804
7028
  plane: (e) => new e.PlaneGeometry(1.4, 1.4),
6805
7029
  capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
6806
- }, _i = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
6807
- function vi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: a, spinSpeed: o, controls: l, ground: d, height: f, style: p, nodeRef: m, inert: h }) {
6808
- 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 && !Xr(), 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;
6809
7033
  return i(() => {
6810
7034
  let e = g.current;
6811
7035
  if (!e) return;
6812
7036
  let i = !0, a = null;
6813
- return qr().then((s) => {
7037
+ return ti().then((s) => {
6814
7038
  if (!i || !e) return;
6815
7039
  let c = new s.WebGLRenderer({
6816
7040
  antialias: !0,
6817
7041
  alpha: !t
6818
7042
  });
6819
- c.setPixelRatio(Zr()), 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);
6820
7044
  let l = new s.Scene();
6821
- t && (l.background = new s.Color(t)), l.environment = fi(s, c);
6822
- let u = new s.PerspectiveCamera(_i(r, 45), 1, .1, 400), f = $r(u, c.domElement, {
6823
- distance: _i(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),
6824
7048
  enableZoom: S
6825
7049
  }), p = new s.DirectionalLight(16777215, 2.2);
6826
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));
6827
7051
  let m = [], h = new s.Group(), g = (e, t) => {
6828
- let n = _i(t.scale, 1);
6829
- e.position.set(_i(t.x, 0), _i(t.y, 0), _i(t.z, 0)), e.rotation.set(ni(t.rx), ni(t.ry), ni(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = ni(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);
6830
7054
  };
6831
7055
  for (let e of y) {
6832
7056
  if (e.shape === "model") {
6833
- if (!ri(e.src)) continue;
7057
+ if (!di(e.src)) continue;
6834
7058
  let t = new s.Group();
6835
- g(t, e), h.add(t), mi(e.src).then((e) => {
7059
+ g(t, e), h.add(t), Si(e.src).then((e) => {
6836
7060
  if (!i) return;
6837
- let n = hi(s, e.clone(!0));
7061
+ let n = Ci(s, e.clone(!0));
6838
7062
  n.traverse((e) => {
6839
7063
  e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
6840
7064
  }), t.add(n);
6841
7065
  }, () => {});
6842
7066
  continue;
6843
7067
  }
6844
- let t = (gi[e.shape] ?? gi.box)(s), n = new s.MeshStandardMaterial({
7068
+ let t = (wi[e.shape] ?? wi.box)(s), n = new s.MeshStandardMaterial({
6845
7069
  color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
6846
- metalness: Math.min(1, Math.max(0, ti(e.metalness, 10))),
6847
- roughness: Math.min(1, Math.max(0, ti(e.roughness, 35))),
6848
- transparent: ti(e.opacity, 100) < 1,
6849
- opacity: Math.min(1, Math.max(0, ti(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))),
6850
7074
  flatShading: e.flat === !0,
6851
7075
  wireframe: e.wireframe === !0,
6852
7076
  side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
@@ -6857,14 +7081,14 @@ function vi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
6857
7081
  let _ = null;
6858
7082
  if (d !== !1) {
6859
7083
  let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
6860
- _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = _i(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);
6861
7085
  }
6862
7086
  let v = () => {
6863
7087
  let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
6864
7088
  c.setSize(t, n, !1), u.aspect = t / n, u.updateProjectionMatrix();
6865
7089
  }, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
6866
7090
  b?.observe(e), v();
6867
- let C = ni(Number.isFinite(Number(o)) ? o : 20), w = Qr(e, (e) => {
7091
+ let C = ui(Number.isFinite(Number(o)) ? o : 20), w = oi(e, (e) => {
6868
7092
  f.autoSpin(x ? C : 0, e), f.update();
6869
7093
  for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
6870
7094
  c.render(l, u);
@@ -6888,7 +7112,7 @@ function vi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
6888
7112
  o,
6889
7113
  S,
6890
7114
  d
6891
- ]), _ && h ? /* @__PURE__ */ u(ii, {
7115
+ ]), _ && h ? /* @__PURE__ */ u(fi, {
6892
7116
  nodeRef: m,
6893
7117
  style: p,
6894
7118
  height: f,
@@ -6899,27 +7123,27 @@ function vi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
6899
7123
  g.current = e, typeof m == "function" && m(e);
6900
7124
  },
6901
7125
  style: {
6902
- minHeight: ei(f, 380),
6903
- height: ei(f, 380),
7126
+ minHeight: ci(f, 380),
7127
+ height: ci(f, 380),
6904
7128
  overflow: "hidden",
6905
7129
  touchAction: S ? "pan-y" : void 0,
6906
7130
  ...A(p)
6907
7131
  }
6908
7132
  });
6909
7133
  }
6910
- function yi({ 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 }) {
6911
7135
  let l = s(null), [d, f] = c("");
6912
7136
  return i(() => {
6913
7137
  let t = l.current;
6914
7138
  if (o || !t || typeof e != "string" || !e.trim()) return;
6915
7139
  let r = !0, i = null;
6916
- return qr().then((a) => {
7140
+ return ti().then((a) => {
6917
7141
  if (!r || !t) return;
6918
7142
  let o = new a.WebGLRenderer({
6919
7143
  antialias: !0,
6920
7144
  alpha: !n
6921
7145
  });
6922
- o.setPixelRatio(Zr()), 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);
6923
7147
  let s = new a.Scene();
6924
7148
  n && (s.background = new a.Color(n));
6925
7149
  let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
@@ -6942,7 +7166,7 @@ function yi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
6942
7166
  o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
6943
7167
  }, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
6944
7168
  d?.observe(t), u();
6945
- let p = !1, m = Qr(t, (e, t) => {
7169
+ let p = !1, m = oi(t, (e, t) => {
6946
7170
  if (!p && typeof l?.frame == "function") try {
6947
7171
  l.frame(e, t);
6948
7172
  } catch (e) {
@@ -6964,7 +7188,7 @@ function yi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
6964
7188
  e,
6965
7189
  o,
6966
7190
  n
6967
- ]), o ? /* @__PURE__ */ u(ii, {
7191
+ ]), o ? /* @__PURE__ */ u(fi, {
6968
7192
  nodeRef: a,
6969
7193
  style: r,
6970
7194
  height: t,
@@ -6975,8 +7199,8 @@ function yi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
6975
7199
  l.current = e, typeof a == "function" && a(e);
6976
7200
  },
6977
7201
  style: {
6978
- minHeight: ei(t, 380),
6979
- height: ei(t, 380),
7202
+ minHeight: ci(t, 380),
7203
+ height: ci(t, 380),
6980
7204
  overflow: "hidden",
6981
7205
  position: "relative",
6982
7206
  touchAction: "pan-y",
@@ -6991,7 +7215,7 @@ function yi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
6991
7215
  padding: "6px 8px",
6992
7216
  borderRadius: 6,
6993
7217
  background: "rgba(127,29,29,.85)",
6994
- ...q,
7218
+ ...K,
6995
7219
  color: "#fee2e2",
6996
7220
  fontSize: 11
6997
7221
  },
@@ -6999,40 +7223,40 @@ function yi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
6999
7223
  }) : null
7000
7224
  });
7001
7225
  }
7002
- var bi = {
7003
- ModelViewerBlock: ai,
7004
- ShaderBlock: di,
7005
- SceneBlock: vi,
7006
- ThreeCanvasBlock: yi
7007
- }, xi = /* @__PURE__ */ new Map();
7008
- function Si(e) {
7009
- if (xi.has(e)) return xi.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);
7010
7234
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
7011
7235
  /* @vite-ignore */
7012
7236
  /* webpackIgnore: true */
7013
7237
  t
7014
7238
  ).finally(() => URL.revokeObjectURL(t));
7015
- return xi.set(e, n), n;
7239
+ return ki.set(e, n), n;
7016
7240
  }
7017
- function Ci(e) {
7241
+ function ji(e) {
7018
7242
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
7019
7243
  return n && typeof n == "object" ? n : {};
7020
7244
  }
7021
7245
  //#endregion
7022
7246
  //#region ../ui/src/components/builder/plugins/view.jsx
7023
- async function wi(e, t) {
7024
- let n = await Si(e);
7247
+ async function Mi(e, t) {
7248
+ let n = await Ai(e);
7025
7249
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
7026
7250
  }
7027
- var Ti = {
7251
+ var Ni = {
7028
7252
  padding: "10px 12px",
7029
7253
  border: "1px dashed rgba(148, 163, 184, 0.5)",
7030
7254
  borderRadius: 8,
7031
7255
  fontSize: 12,
7032
7256
  opacity: .6
7033
7257
  };
7034
- function Ei({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
7035
- let c = r(Z), l = Ci(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 = {
7036
7260
  tenant: c?.tenant ?? "",
7037
7261
  apiUrl: c?.apiUrl ?? "/api",
7038
7262
  locale: c?.locale ?? "",
@@ -7044,7 +7268,7 @@ function Ei({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
7044
7268
  let e = f.current;
7045
7269
  if (!l?.code || !e) return;
7046
7270
  let n = !0;
7047
- return wi(l.code, t).then((e) => {
7271
+ return Mi(l.code, t).then((e) => {
7048
7272
  if (!(!n || !e || !f.current)) {
7049
7273
  p.current = e;
7050
7274
  try {
@@ -7074,7 +7298,7 @@ function Ei({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
7074
7298
  }) : /* @__PURE__ */ d("div", {
7075
7299
  ref: o,
7076
7300
  style: {
7077
- ...Ti,
7301
+ ...Ni,
7078
7302
  ...A(a)
7079
7303
  },
7080
7304
  children: [
@@ -7086,13 +7310,13 @@ function Ei({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
7086
7310
  }
7087
7311
  //#endregion
7088
7312
  //#region ../ui/src/components/builder/render.jsx
7089
- var Di = {
7090
- ...ar,
7091
- ...Rr,
7092
- ...bi,
7093
- PluginBlock: Ei
7313
+ var Fi = {
7314
+ ...pr,
7315
+ ...Kr,
7316
+ ...Oi,
7317
+ PluginBlock: Pi
7094
7318
  };
7095
- function Oi(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7319
+ function Ii(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7096
7320
  let o = n[t];
7097
7321
  if (!o || o.hidden) return null;
7098
7322
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -7100,11 +7324,11 @@ function Oi(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7100
7324
  let n = o.props?.componentId, s = r?.[n];
7101
7325
  if (!s?.template || i.has(n)) return null;
7102
7326
  let c = new Set(i).add(n);
7103
- return /* @__PURE__ */ u(e, { children: Oi(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);
7104
7328
  }
7105
- let l = Di[s];
7329
+ let l = Fi[s];
7106
7330
  if (!l) return null;
7107
- let d = (o.nodes ?? []).map((e) => Oi(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Oi(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, {
7108
7332
  ...c,
7109
7333
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
7110
7334
  linked: p,
@@ -7113,16 +7337,16 @@ function Oi(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7113
7337
  },
7114
7338
  children: d.length ? d : void 0
7115
7339
  }, t);
7116
- return c.when && c.when !== "always" ? /* @__PURE__ */ u(hr, {
7340
+ return c.when && c.when !== "always" ? /* @__PURE__ */ u(Cr, {
7117
7341
  when: c.when,
7118
7342
  children: m
7119
7343
  }, t) : m;
7120
7344
  }
7121
7345
  //#endregion
7122
7346
  //#region ../ui/src/components/builder/PageRenderer.jsx
7123
- var ki = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ai = (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(" ")} }
7124
7348
  .webim-page[data-webim-mode="dark"] { ${Object.entries(ue(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
7125
- function ji({ 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 }) {
7126
7350
  let b = s?.js?.trim();
7127
7351
  if (i(() => {
7128
7352
  if (!b) return;
@@ -7136,11 +7360,11 @@ function ji({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
7136
7360
  minHeight: "100%",
7137
7361
  display: "flex",
7138
7362
  flexDirection: "column"
7139
- }, w = Oi("ROOT", e, n), T = o(() => ({ render: (t, r) => Oi(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = G(e, n), O = re(e, n), k = s?.css?.trim(), A = E(c), j = le(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !oe[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
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", {
7140
7364
  rel: "stylesheet",
7141
7365
  precedence: "default",
7142
7366
  href: g(e)
7143
- }, e)), P = Ai(j);
7367
+ }, e)), P = Ri(j);
7144
7368
  return r === "auto" ? /* @__PURE__ */ u(Z.Provider, {
7145
7369
  value: {
7146
7370
  tenant: l || "",
@@ -7148,7 +7372,7 @@ function ji({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
7148
7372
  locale: m || "",
7149
7373
  settings: _ ?? null
7150
7374
  },
7151
- children: /* @__PURE__ */ u(mr, {
7375
+ children: /* @__PURE__ */ u(Sr, {
7152
7376
  initialUser: v,
7153
7377
  children: /* @__PURE__ */ u(xe.Provider, {
7154
7378
  value: p ?? null,
@@ -7163,8 +7387,8 @@ function ji({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
7163
7387
  ...a
7164
7388
  },
7165
7389
  children: [
7166
- /* @__PURE__ */ u("style", { children: `.webim-page { ${ki(ue(j.light))} }
7167
- @media (prefers-color-scheme: dark) { .webim-page { ${ki(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))} } }` }),
7168
7392
  /* @__PURE__ */ u("style", { children: P }),
7169
7393
  N,
7170
7394
  /* @__PURE__ */ u("style", { children: S }),
@@ -7184,7 +7408,7 @@ function ji({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
7184
7408
  locale: m || "",
7185
7409
  settings: _ ?? null
7186
7410
  },
7187
- children: /* @__PURE__ */ u(mr, {
7411
+ children: /* @__PURE__ */ u(Sr, {
7188
7412
  initialUser: v,
7189
7413
  children: /* @__PURE__ */ u(xe.Provider, {
7190
7414
  value: p ?? null,
@@ -7217,8 +7441,8 @@ function ji({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
7217
7441
  }
7218
7442
  //#endregion
7219
7443
  //#region src/WebimContent.jsx
7220
- function Mi({ bundle: e, mode: t = "auto", style: n }) {
7221
- return e?.blocks?.ROOT ? /* @__PURE__ */ u(ji, {
7444
+ function Bi({ bundle: e, mode: t = "auto", style: n }) {
7445
+ return e?.blocks?.ROOT ? /* @__PURE__ */ u(zi, {
7222
7446
  blocks: e.blocks,
7223
7447
  theme: e.theme,
7224
7448
  components: e.components,
@@ -7236,7 +7460,7 @@ function Mi({ bundle: e, mode: t = "auto", style: n }) {
7236
7460
  }
7237
7461
  //#endregion
7238
7462
  //#region src/WebimPage.jsx
7239
- function Ni({ 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 }) {
7240
7464
  let [g, _] = c({ status: "loading" }), v = s({
7241
7465
  onLoad: m,
7242
7466
  onError: h
@@ -7273,11 +7497,11 @@ function Ni({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
7273
7497
  r,
7274
7498
  a,
7275
7499
  o
7276
- ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Mi, {
7500
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Bi, {
7277
7501
  bundle: g.bundle,
7278
7502
  mode: l,
7279
7503
  style: d
7280
7504
  });
7281
7505
  }
7282
7506
  //#endregion
7283
- export { ji as PageRenderer, Mi as WebimContent, Ni 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 };