webim-adapter 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1203,19 +1203,218 @@ function Ye({ slides: e = [], linked: t, ...n }) {
1203
1203
  }
1204
1204
  }) : null;
1205
1205
  }
1206
+ function Xe({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lightbox: a = !0, style: o, nodeRef: s, inert: f }) {
1207
+ let p = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], m = Math.max(0, Number(n) || 0), g = f ? (e) => e.preventDefault() : void 0, [_, v] = c(null), y = a && !f && _ !== null && p[_];
1208
+ i(() => {
1209
+ if (!y) return;
1210
+ let e = (e) => {
1211
+ e.key === "Escape" && v(null), e.key === "ArrowRight" && v((e) => (e + 1) % p.length), e.key === "ArrowLeft" && v((e) => (e - 1 + p.length) % p.length);
1212
+ };
1213
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1214
+ }, [y, p.length]);
1215
+ let b = (e) => {
1216
+ if (typeof e.name == "string" && e.name.trim()) return e.name;
1217
+ if (typeof e.alt == "string" && e.alt.trim()) return e.alt;
1218
+ try {
1219
+ let t = String(e.src).split("?")[0].split("/").pop();
1220
+ return decodeURIComponent(t ?? "");
1221
+ } catch {
1222
+ return "";
1223
+ }
1224
+ };
1225
+ return /* @__PURE__ */ d("div", {
1226
+ ref: s,
1227
+ style: {
1228
+ columnCount: Math.min(Math.max(Number(t) || 3, 1), 8),
1229
+ columnGap: m,
1230
+ width: "100%",
1231
+ ...h(o)
1232
+ },
1233
+ children: [
1234
+ p.map((e, t) => {
1235
+ let n = /* @__PURE__ */ d("span", {
1236
+ style: {
1237
+ position: "relative",
1238
+ display: "block",
1239
+ borderRadius: "inherit",
1240
+ overflow: "hidden"
1241
+ },
1242
+ children: [/* @__PURE__ */ u("img", {
1243
+ src: e.src,
1244
+ alt: e.alt ?? "",
1245
+ style: {
1246
+ width: "100%",
1247
+ display: "block",
1248
+ borderRadius: "inherit"
1249
+ }
1250
+ }), r && b(e) && /* @__PURE__ */ u("span", {
1251
+ style: {
1252
+ position: "absolute",
1253
+ insetInline: 0,
1254
+ bottom: 0,
1255
+ padding: "14px 10px 8px",
1256
+ background: "linear-gradient(transparent, rgba(0, 0, 0, 0.65))",
1257
+ color: "#fff",
1258
+ fontSize: 12,
1259
+ lineHeight: 1.3,
1260
+ whiteSpace: "nowrap",
1261
+ overflow: "hidden",
1262
+ textOverflow: "ellipsis"
1263
+ },
1264
+ children: b(e)
1265
+ })]
1266
+ }), i = e.href ? /* @__PURE__ */ u("a", {
1267
+ href: e.href,
1268
+ onClick: g,
1269
+ target: e.target || void 0,
1270
+ rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
1271
+ style: {
1272
+ display: "block",
1273
+ borderRadius: "inherit"
1274
+ },
1275
+ children: n
1276
+ }) : a && !f ? /* @__PURE__ */ u("span", {
1277
+ role: "button",
1278
+ tabIndex: 0,
1279
+ onClick: () => v(t),
1280
+ onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && v(t),
1281
+ style: {
1282
+ display: "block",
1283
+ borderRadius: "inherit",
1284
+ cursor: "zoom-in"
1285
+ },
1286
+ children: n
1287
+ }) : n;
1288
+ return /* @__PURE__ */ u("div", {
1289
+ style: {
1290
+ breakInside: "avoid",
1291
+ marginBottom: m,
1292
+ borderRadius: "inherit",
1293
+ overflow: "hidden"
1294
+ },
1295
+ children: i
1296
+ }, t);
1297
+ }),
1298
+ !p.length && /* @__PURE__ */ u("div", {
1299
+ style: {
1300
+ padding: "24px 12px",
1301
+ fontSize: 13,
1302
+ opacity: .55,
1303
+ textAlign: "center",
1304
+ columnSpan: "all"
1305
+ },
1306
+ children: "Pick images in Settings to fill the gallery"
1307
+ }),
1308
+ y && /* @__PURE__ */ d("div", {
1309
+ role: "dialog",
1310
+ "aria-modal": "true",
1311
+ onClick: () => v(null),
1312
+ style: {
1313
+ position: "fixed",
1314
+ inset: 0,
1315
+ zIndex: 1400,
1316
+ background: "rgba(0, 0, 0, 0.86)",
1317
+ display: "flex",
1318
+ flexDirection: "column",
1319
+ alignItems: "center",
1320
+ justifyContent: "center",
1321
+ padding: 24
1322
+ },
1323
+ children: [
1324
+ /* @__PURE__ */ u("img", {
1325
+ src: p[_].src,
1326
+ alt: p[_].alt ?? "",
1327
+ onClick: (e) => e.stopPropagation(),
1328
+ style: {
1329
+ maxWidth: "92vw",
1330
+ maxHeight: "84vh",
1331
+ borderRadius: 8,
1332
+ boxShadow: "0 12px 48px rgba(0,0,0,0.5)"
1333
+ }
1334
+ }),
1335
+ b(p[_]) && /* @__PURE__ */ u("div", {
1336
+ style: {
1337
+ color: "#fff",
1338
+ fontSize: 14,
1339
+ marginTop: 12,
1340
+ opacity: .85
1341
+ },
1342
+ children: b(p[_])
1343
+ }),
1344
+ /* @__PURE__ */ u("button", {
1345
+ type: "button",
1346
+ "aria-label": "Close",
1347
+ onClick: () => v(null),
1348
+ style: {
1349
+ position: "absolute",
1350
+ top: 16,
1351
+ right: 20,
1352
+ background: "transparent",
1353
+ border: 0,
1354
+ color: "#fff",
1355
+ fontSize: 28,
1356
+ lineHeight: 1,
1357
+ cursor: "pointer"
1358
+ },
1359
+ children: "×"
1360
+ }),
1361
+ p.length > 1 && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("button", {
1362
+ type: "button",
1363
+ "aria-label": "Previous",
1364
+ onClick: (e) => {
1365
+ e.stopPropagation(), v((e) => (e - 1 + p.length) % p.length);
1366
+ },
1367
+ style: {
1368
+ position: "absolute",
1369
+ left: 16,
1370
+ top: "50%",
1371
+ transform: "translateY(-50%)",
1372
+ background: "transparent",
1373
+ border: 0,
1374
+ color: "#fff",
1375
+ fontSize: 36,
1376
+ cursor: "pointer",
1377
+ padding: 12
1378
+ },
1379
+ children: "‹"
1380
+ }), /* @__PURE__ */ u("button", {
1381
+ type: "button",
1382
+ "aria-label": "Next",
1383
+ onClick: (e) => {
1384
+ e.stopPropagation(), v((e) => (e + 1) % p.length);
1385
+ },
1386
+ style: {
1387
+ position: "absolute",
1388
+ right: 16,
1389
+ top: "50%",
1390
+ transform: "translateY(-50%)",
1391
+ background: "transparent",
1392
+ border: 0,
1393
+ color: "#fff",
1394
+ fontSize: 36,
1395
+ cursor: "pointer",
1396
+ padding: 12
1397
+ },
1398
+ children: "›"
1399
+ })] })
1400
+ ]
1401
+ })
1402
+ ]
1403
+ });
1404
+ }
1206
1405
  var Y = {
1207
1406
  color: "inherit",
1208
1407
  textDecoration: "none",
1209
1408
  fontSize: 14,
1210
1409
  opacity: .85
1211
- }, Xe = {
1410
+ }, Ze = {
1212
1411
  background: "var(--page-bg, #ffffff)",
1213
1412
  color: "var(--page-text, #111827)",
1214
1413
  border: "1px solid rgba(148, 163, 184, 0.25)",
1215
1414
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1216
1415
  zIndex: 60
1217
1416
  };
1218
- function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], style: s, nodeRef: f, menu: p = "auto", breakpoint: m = 768 }) {
1417
+ function Qe({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], style: s, nodeRef: f, menu: p = "auto", breakpoint: m = 768 }) {
1219
1418
  let [g, _] = c(null), [v, y] = c(!1), [b, x] = c(!1), [S, C] = c(null);
1220
1419
  i(() => {
1221
1420
  if (!g) return;
@@ -1343,7 +1542,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1343
1542
  ]
1344
1543
  }), S === e.key && (n ? /* @__PURE__ */ u("div", {
1345
1544
  style: {
1346
- ...Xe,
1545
+ ...Ze,
1347
1546
  position: "absolute",
1348
1547
  left: 0,
1349
1548
  right: 0,
@@ -1359,7 +1558,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1359
1558
  }))
1360
1559
  }) : /* @__PURE__ */ u("div", {
1361
1560
  style: {
1362
- ...Xe,
1561
+ ...Ze,
1363
1562
  position: "absolute",
1364
1563
  top: "100%",
1365
1564
  left: 0,
@@ -1399,7 +1598,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1399
1598
  ]
1400
1599
  });
1401
1600
  }
1402
- function Qe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1601
+ function $e({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1403
1602
  let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1404
1603
  return e.length ? /* @__PURE__ */ d("div", {
1405
1604
  ref: r,
@@ -1439,7 +1638,7 @@ function Qe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1439
1638
  }, e.key))]
1440
1639
  }) : null;
1441
1640
  }
1442
- function $e({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1641
+ function et({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1443
1642
  let [a, o] = c(() => new Set(e.length ? [e[0].key] : []));
1444
1643
  if (!e.length) return null;
1445
1644
  let s = (e) => o((t) => {
@@ -1496,7 +1695,7 @@ function $e({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1496
1695
  })
1497
1696
  });
1498
1697
  }
1499
- var et = {
1698
+ var tt = {
1500
1699
  display: "flex",
1501
1700
  flexDirection: "column",
1502
1701
  gap: "12px"
@@ -1514,7 +1713,7 @@ var et = {
1514
1713
  boxSizing: "border-box",
1515
1714
  backgroundColor: "#ffffff",
1516
1715
  color: "#111827"
1517
- }, tt = {
1716
+ }, nt = {
1518
1717
  display: "flex",
1519
1718
  alignItems: "center",
1520
1719
  gap: "8px",
@@ -1525,7 +1724,7 @@ var et = {
1525
1724
  tabIndex: -1,
1526
1725
  onMouseDown: (e) => e.preventDefault()
1527
1726
  } : {};
1528
- function nt(e, t) {
1727
+ function rt(e, t) {
1529
1728
  if (!e) return !0;
1530
1729
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1531
1730
  switch (e.op) {
@@ -1539,11 +1738,11 @@ function nt(e, t) {
1539
1738
  default: return !1;
1540
1739
  }
1541
1740
  }
1542
- var rt = {
1741
+ var it = {
1543
1742
  display: "flex",
1544
1743
  flexDirection: "column",
1545
1744
  gap: 6
1546
- }, it = {
1745
+ }, at = {
1547
1746
  font: "inherit",
1548
1747
  fontSize: 15,
1549
1748
  padding: "10px 12px",
@@ -1554,13 +1753,13 @@ var rt = {
1554
1753
  width: "100%",
1555
1754
  boxSizing: "border-box"
1556
1755
  };
1557
- function at(e, t) {
1756
+ function ot(e, t) {
1558
1757
  let n = Array.isArray(e?.options) ? e.options : [];
1559
1758
  if (!e?.parentField) return n;
1560
1759
  let r = t?.[e.parentField];
1561
1760
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
1562
1761
  }
1563
- function ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
1762
+ function st({ field: e, value: t, onChange: n, inert: r, values: i }) {
1564
1763
  let a = /* @__PURE__ */ d("span", {
1565
1764
  style: {
1566
1765
  ...X,
@@ -1572,7 +1771,7 @@ function ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
1572
1771
  required: e.required || void 0,
1573
1772
  placeholder: e.placeholder || void 0,
1574
1773
  disabled: r || void 0,
1575
- style: it,
1774
+ style: at,
1576
1775
  value: t ?? "",
1577
1776
  onChange: (t) => n(e.name, t.target.value)
1578
1777
  };
@@ -1613,14 +1812,14 @@ function ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
1613
1812
  display: "block"
1614
1813
  }
1615
1814
  }) : null : /* @__PURE__ */ d("label", {
1616
- style: rt,
1815
+ style: it,
1617
1816
  children: [
1618
1817
  a,
1619
1818
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
1620
1819
  ...o,
1621
1820
  rows: 4,
1622
1821
  style: {
1623
- ...it,
1822
+ ...at,
1624
1823
  resize: "vertical"
1625
1824
  }
1626
1825
  }) : e.type === "select" ? /* @__PURE__ */ d("select", {
@@ -1629,7 +1828,7 @@ function ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
1629
1828
  children: [/* @__PURE__ */ u("option", {
1630
1829
  value: "",
1631
1830
  children: e.placeholder || "—"
1632
- }), at(e, i).map((e, t) => /* @__PURE__ */ u("option", {
1831
+ }), ot(e, i).map((e, t) => /* @__PURE__ */ u("option", {
1633
1832
  value: typeof e == "string" ? e : e.value,
1634
1833
  children: typeof e == "string" ? e : e.label ?? e.value
1635
1834
  }, t))]
@@ -1676,7 +1875,7 @@ function ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
1676
1875
  ]
1677
1876
  });
1678
1877
  }
1679
- function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: g, children: _, linked: v, show: y }) {
1878
+ function ct({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: g, children: _, linked: v, show: y }) {
1680
1879
  let { tenant: b, apiUrl: x } = r(V), [S, C] = c("form"), [w, T] = c(null), [E, D] = c({}), [O, k] = c(0), A = g ? y || "form" : S;
1681
1880
  i(() => {
1682
1881
  if (!f || !s) return;
@@ -1698,9 +1897,9 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1698
1897
  section: e,
1699
1898
  fields: []
1700
1899
  }) : j[j.length - 1].fields.push(e);
1701
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || nt(e.section.condition, E)).map((e) => ({
1900
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || rt(e.section.condition, E)).map((e) => ({
1702
1901
  ...e,
1703
- fields: e.fields.filter((e) => nt(e.condition, E))
1902
+ fields: e.fields.filter((e) => rt(e.condition, E))
1704
1903
  })), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), ee = I.filter((e) => {
1705
1904
  let t = E[e.name];
1706
1905
  return e.required && (t == null || t === "" || t === !1);
@@ -1758,11 +1957,11 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1758
1957
  }
1759
1958
  },
1760
1959
  style: {
1761
- ...et,
1960
+ ...tt,
1762
1961
  display: A === "success" ? "none" : "flex"
1763
1962
  },
1764
1963
  children: f && s ? /* @__PURE__ */ d(l, { children: [
1765
- P && /* @__PURE__ */ u(St, {
1964
+ P && /* @__PURE__ */ u(Ct, {
1766
1965
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1767
1966
  active: F + 1,
1768
1967
  style: { marginBottom: 8 }
@@ -1775,7 +1974,7 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1775
1974
  },
1776
1975
  children: N[F].section.help
1777
1976
  }),
1778
- I.map((e) => /* @__PURE__ */ u(ot, {
1977
+ I.map((e) => /* @__PURE__ */ u(st, {
1779
1978
  field: e,
1780
1979
  value: E[e.name],
1781
1980
  values: E,
@@ -1848,19 +2047,19 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1848
2047
  ]
1849
2048
  });
1850
2049
  }
1851
- var ct = null, lt = () => ct || (ct = new Promise((e) => {
2050
+ var lt = null, ut = () => lt || (lt = new Promise((e) => {
1852
2051
  if (typeof window > "u") return;
1853
2052
  if (window.grecaptcha?.render) return e(window.grecaptcha);
1854
2053
  window.__webimRecaptchaReady = () => e(window.grecaptcha);
1855
2054
  let t = document.createElement("script");
1856
2055
  t.src = "https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit", t.async = !0, document.head.appendChild(t);
1857
- }), ct);
1858
- function ut({ siteKey: e, theme: t, size: n, style: a, nodeRef: o, inert: c }) {
2056
+ }), lt);
2057
+ function dt({ siteKey: e, theme: t, size: n, style: a, nodeRef: o, inert: c }) {
1859
2058
  let l = r(V), f = l?.settings && typeof l.settings == "object" ? l.settings["google.recaptchaKey"] : "", p = typeof e == "string" && e.trim() || (typeof f == "string" ? f.trim() : ""), m = s(null), g = s(!1);
1860
2059
  if (i(() => {
1861
2060
  if (c || !p || g.current || !m.current) return;
1862
2061
  let e = !0;
1863
- return lt().then((r) => {
2062
+ return ut().then((r) => {
1864
2063
  if (!(!e || g.current || !m.current || !r?.render)) {
1865
2064
  g.current = !0;
1866
2065
  try {
@@ -1938,7 +2137,7 @@ function ut({ siteKey: e, theme: t, size: n, style: a, nodeRef: o, inert: c }) {
1938
2137
  children: /* @__PURE__ */ u("div", { ref: m })
1939
2138
  }) : null;
1940
2139
  }
1941
- function dt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2140
+ function ft({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1942
2141
  return /* @__PURE__ */ u("label", {
1943
2142
  ref: r,
1944
2143
  style: {
@@ -1948,7 +2147,7 @@ function dt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1948
2147
  children: J(t, e, i)
1949
2148
  });
1950
2149
  }
1951
- function ft({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2150
+ function pt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1952
2151
  return /* @__PURE__ */ u("input", {
1953
2152
  ref: a,
1954
2153
  type: e,
@@ -1962,7 +2161,7 @@ function ft({ type: e = "text", name: t, placeholder: n, required: r, style: i,
1962
2161
  ...Q(o)
1963
2162
  });
1964
2163
  }
1965
- function pt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2164
+ function mt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1966
2165
  return /* @__PURE__ */ u("textarea", {
1967
2166
  ref: a,
1968
2167
  name: e || void 0,
@@ -1977,11 +2176,11 @@ function pt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
1977
2176
  ...Q(o)
1978
2177
  });
1979
2178
  }
1980
- function mt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2179
+ function ht({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1981
2180
  return /* @__PURE__ */ d("label", {
1982
2181
  ref: o,
1983
2182
  style: {
1984
- ...tt,
2183
+ ...nt,
1985
2184
  ...h(a)
1986
2185
  },
1987
2186
  children: [/* @__PURE__ */ u("input", {
@@ -1998,7 +2197,7 @@ function mt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1998
2197
  }), t]
1999
2198
  });
2000
2199
  }
2001
- function ht({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2200
+ function gt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2002
2201
  return /* @__PURE__ */ d("select", {
2003
2202
  ref: a,
2004
2203
  name: e || void 0,
@@ -2021,7 +2220,7 @@ function ht({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2021
2220
  }, t))]
2022
2221
  });
2023
2222
  }
2024
- function gt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2223
+ function _t({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2025
2224
  let [s, l] = c(null);
2026
2225
  return /* @__PURE__ */ d("label", {
2027
2226
  ref: a,
@@ -2053,7 +2252,7 @@ function gt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
2053
2252
  ]
2054
2253
  });
2055
2254
  }
2056
- function _t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2255
+ function vt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2057
2256
  return /* @__PURE__ */ u("button", {
2058
2257
  ref: n,
2059
2258
  type: r ? "button" : "submit",
@@ -2073,7 +2272,7 @@ function _t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2073
2272
  children: e
2074
2273
  });
2075
2274
  }
2076
- function vt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2275
+ function yt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2077
2276
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
2078
2277
  return /* @__PURE__ */ u("div", {
2079
2278
  ref: r,
@@ -2090,7 +2289,7 @@ function vt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2090
2289
  }, t))
2091
2290
  });
2092
2291
  }
2093
- function yt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, style: g, nodeRef: _ }) {
2292
+ function bt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, style: g, nodeRef: _ }) {
2094
2293
  let { tenant: v, apiUrl: y, locale: b } = r(V), x = r(W), S = r(H), C = S?.[e], w = m ? U(S) : 1, [T, E] = c(null);
2095
2294
  if (i(() => {
2096
2295
  if (!e || C) return;
@@ -2199,7 +2398,7 @@ function yt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2199
2398
  })
2200
2399
  });
2201
2400
  }
2202
- function bt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2401
+ function xt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2203
2402
  return e.length ? /* @__PURE__ */ u("nav", {
2204
2403
  ref: r,
2205
2404
  "aria-label": "Breadcrumb",
@@ -2249,7 +2448,7 @@ function bt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2249
2448
  })
2250
2449
  }) : null;
2251
2450
  }
2252
- function xt({ 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: g }) {
2451
+ function St({ 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: g }) {
2253
2452
  let { tenant: _, apiUrl: v } = r(V), y = r(H), [b, x] = c(null), S = o ? Number(y?.[`${o}:total`]) : NaN;
2254
2453
  i(() => {
2255
2454
  if (!o || Number.isFinite(S)) return;
@@ -2334,7 +2533,7 @@ function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
2334
2533
  ]
2335
2534
  });
2336
2535
  }
2337
- function St({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2536
+ function Ct({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2338
2537
  if (!t.length) return null;
2339
2538
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
2340
2539
  width: 32,
@@ -2412,7 +2611,7 @@ function St({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2412
2611
  })
2413
2612
  });
2414
2613
  }
2415
- var Ct = {
2614
+ var wt = {
2416
2615
  small: {
2417
2616
  w: 132,
2418
2617
  h: 46,
@@ -2434,10 +2633,10 @@ var Ct = {
2434
2633
  title: 12.5,
2435
2634
  avatar: 46
2436
2635
  }
2437
- }, wt = (e) => Ct[e] ?? Ct.medium;
2438
- Ct.medium.w, Ct.medium.h;
2439
- function Tt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2440
- let r = wt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
2636
+ }, Tt = (e) => wt[e] ?? wt.medium;
2637
+ wt.medium.w, wt.medium.h;
2638
+ function Et(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2639
+ let r = Tt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
2441
2640
  for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
2442
2641
  let d = /* @__PURE__ */ new Map(), f = (e, t) => {
2443
2642
  if (t.has(e.id)) return 0;
@@ -2489,18 +2688,18 @@ function Tt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2489
2688
  horizontal: n
2490
2689
  };
2491
2690
  }
2492
- var Et = (e, t) => {
2691
+ var Dt = (e, t) => {
2493
2692
  let n = String(e ?? "");
2494
2693
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
2495
- }, Dt = (e) => {
2694
+ }, Ot = (e) => {
2496
2695
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
2497
2696
  if (!t) return "#ffffff";
2498
2697
  let n = t[1];
2499
2698
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
2500
2699
  let r = parseInt(n, 16);
2501
2700
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
2502
- }, Ot = (e) => !!(e?.cv?.trim?.() || e?.photo);
2503
- function kt(e, t = {}) {
2701
+ }, kt = (e) => !!(e?.cv?.trim?.() || e?.photo);
2702
+ function At(e, t = {}) {
2504
2703
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : K(e);
2505
2704
  return n.map((e) => {
2506
2705
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
@@ -2515,11 +2714,11 @@ function kt(e, t = {}) {
2515
2714
  };
2516
2715
  });
2517
2716
  }
2518
- var At = {
2717
+ var jt = {
2519
2718
  size: 36,
2520
2719
  pad: 10
2521
2720
  };
2522
- function jt({ node: e, onClose: t }) {
2721
+ function Mt({ node: e, onClose: t }) {
2523
2722
  return i(() => {
2524
2723
  let e = (e) => e.key === "Escape" && t();
2525
2724
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -2637,7 +2836,7 @@ function jt({ node: e, onClose: t }) {
2637
2836
  })
2638
2837
  });
2639
2838
  }
2640
- function Mt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
2839
+ function Nt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
2641
2840
  let x = a(), [S, C] = c(null), { tenant: w, apiUrl: T } = r(V), E = r(H)?.[t], [D, O] = c(null);
2642
2841
  i(() => {
2643
2842
  if (!t || E) return;
@@ -2654,14 +2853,14 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2654
2853
  T,
2655
2854
  E
2656
2855
  ]);
2657
- let k = t ? kt(E ?? D ?? [], {
2856
+ let k = t ? At(E ?? D ?? [], {
2658
2857
  nameField: n,
2659
2858
  titleField: o,
2660
2859
  photoField: s,
2661
2860
  parentField: f,
2662
2861
  cvField: p,
2663
2862
  hrefField: m
2664
- }) : e, A = wt(g), { boxes: j, links: M, width: N, height: P } = Tt(k, {
2863
+ }) : e, A = Tt(g), { boxes: j, links: M, width: N, height: P } = Et(k, {
2665
2864
  size: g,
2666
2865
  horizontal: _
2667
2866
  });
@@ -2707,7 +2906,7 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2707
2906
  stroke: "rgba(148, 163, 184, 0.7)",
2708
2907
  strokeWidth: "1.5"
2709
2908
  }, t)), j.map(({ node: e, x: t, y: n }) => {
2710
- let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Dt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Dt(e.color2) : s, f = b && (Ot(e) || e.href), p = () => Ot(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + At.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
2909
+ let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Ot(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Ot(e.color2) : s, f = b && (kt(e) || e.href), p = () => kt(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + jt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
2711
2910
  return /* @__PURE__ */ d("g", {
2712
2911
  onClick: f ? p : void 0,
2713
2912
  style: f ? { cursor: "pointer" } : void 0,
@@ -2771,13 +2970,13 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2771
2970
  e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
2772
2971
  id: `${x}-${e.id}`,
2773
2972
  children: /* @__PURE__ */ u("circle", {
2774
- cx: t + At.pad + A.avatar / 2,
2973
+ cx: t + jt.pad + A.avatar / 2,
2775
2974
  cy: n + A.h / 2,
2776
2975
  r: A.avatar / 2
2777
2976
  })
2778
2977
  }), /* @__PURE__ */ u("image", {
2779
2978
  href: e.photo,
2780
- x: t + At.pad,
2979
+ x: t + jt.pad,
2781
2980
  y: n + (A.h - A.avatar) / 2,
2782
2981
  width: A.avatar,
2783
2982
  height: A.avatar,
@@ -2791,7 +2990,7 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2791
2990
  fontSize: A.title,
2792
2991
  fontWeight: "600",
2793
2992
  fill: s,
2794
- children: Et(e.title, g + 4)
2993
+ children: Dt(e.title, g + 4)
2795
2994
  }), e.name && /* @__PURE__ */ u("text", {
2796
2995
  x: m,
2797
2996
  y: n + _ + _ / 2 + A.name * .35,
@@ -2799,7 +2998,7 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2799
2998
  fontSize: A.name,
2800
2999
  fontWeight: "600",
2801
3000
  fill: c,
2802
- children: Et(e.name, g)
3001
+ children: Dt(e.name, g)
2803
3002
  })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
2804
3003
  x: m,
2805
3004
  y: n + (v[1] ? A.h * .43 : A.h * .57),
@@ -2807,7 +3006,7 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2807
3006
  fontSize: A.name,
2808
3007
  fontWeight: "600",
2809
3008
  fill: s,
2810
- children: Et(v[0], g)
3009
+ children: Dt(v[0], g)
2811
3010
  }), v[1] && /* @__PURE__ */ u("text", {
2812
3011
  x: m,
2813
3012
  y: n + A.h * .73,
@@ -2815,18 +3014,18 @@ function Mt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2815
3014
  fontSize: A.title,
2816
3015
  opacity: "0.7",
2817
3016
  fill: s,
2818
- children: Et(v[1], g + 4)
3017
+ children: Dt(v[1], g + 4)
2819
3018
  })] })
2820
3019
  ]
2821
3020
  }, e.id);
2822
3021
  })]
2823
- }), S && /* @__PURE__ */ u(jt, {
3022
+ }), S && /* @__PURE__ */ u(Mt, {
2824
3023
  node: S,
2825
3024
  onClose: () => C(null)
2826
3025
  })]
2827
3026
  });
2828
3027
  }
2829
- function Nt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, paged: f, emptyText: p, style: m, nodeRef: g }) {
3028
+ function Pt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, paged: f, emptyText: p, style: m, nodeRef: g }) {
2830
3029
  let { tenant: _, apiUrl: v } = r(V), y = r(H), b = y?.[n], x = f ? U(y) : 1, [S, C] = c(null);
2831
3030
  if (i(() => {
2832
3031
  if (!n || b) return;
@@ -2892,7 +3091,7 @@ function Nt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
2892
3091
  })
2893
3092
  });
2894
3093
  }
2895
- var Pt = {
3094
+ var Ft = {
2896
3095
  PageRoot: _e,
2897
3096
  Section: ve,
2898
3097
  Container: ye,
@@ -2904,16 +3103,17 @@ var Pt = {
2904
3103
  Divider: He,
2905
3104
  SliderBlock: Je,
2906
3105
  CanvasSlider: Ye,
2907
- TabsBlock: Qe,
2908
- QuickStack: vt,
2909
- CollectionList: yt,
2910
- BreadcrumbsBlock: bt,
2911
- PaginationBlock: xt,
2912
- StepperBlock: St,
2913
- OrgChartBlock: Mt,
2914
- TableBlock: Nt,
2915
- AccordionBlock: $e,
2916
- NavbarBlock: Ze,
3106
+ TabsBlock: $e,
3107
+ QuickStack: yt,
3108
+ CollectionList: bt,
3109
+ BreadcrumbsBlock: xt,
3110
+ PaginationBlock: St,
3111
+ StepperBlock: Ct,
3112
+ OrgChartBlock: Nt,
3113
+ TableBlock: Pt,
3114
+ MasonryBlock: Xe,
3115
+ AccordionBlock: et,
3116
+ NavbarBlock: Qe,
2917
3117
  ListBlock: Ae,
2918
3118
  TextSpan: Ce,
2919
3119
  QuoteBlock: ke,
@@ -2924,42 +3124,42 @@ var Pt = {
2924
3124
  YouTubeBlock: Re,
2925
3125
  IframeBlock: ze,
2926
3126
  EmbedBlock: Be,
2927
- FormBlock: st,
2928
- FormLabel: dt,
2929
- FormInput: ft,
2930
- FormTextarea: pt,
2931
- FormCheckbox: (e) => /* @__PURE__ */ u(mt, {
3127
+ FormBlock: ct,
3128
+ FormLabel: ft,
3129
+ FormInput: pt,
3130
+ FormTextarea: mt,
3131
+ FormCheckbox: (e) => /* @__PURE__ */ u(ht, {
2932
3132
  kind: "checkbox",
2933
3133
  ...e
2934
3134
  }),
2935
- FormRadio: (e) => /* @__PURE__ */ u(mt, {
3135
+ FormRadio: (e) => /* @__PURE__ */ u(ht, {
2936
3136
  kind: "radio",
2937
3137
  ...e
2938
3138
  }),
2939
- FormSelect: ht,
2940
- FormFile: gt,
2941
- FormRecaptcha: ut,
2942
- FormSubmit: _t
2943
- }, Ft = {
3139
+ FormSelect: gt,
3140
+ FormFile: _t,
3141
+ FormRecaptcha: dt,
3142
+ FormSubmit: vt
3143
+ }, It = {
2944
3144
  id: "auth",
2945
3145
  label: "Accounts",
2946
3146
  category: "Apps",
2947
3147
  keys: ["SiteLoginForm", "SiteAccountMenu"],
2948
3148
  ssr: "shell",
2949
- settings: ["apps.auth.redirect"]
2950
- }, It = t({
3149
+ settings: ["site.authRedirect"]
3150
+ }, Lt = t({
2951
3151
  user: null,
2952
3152
  status: "idle",
2953
3153
  ensure: () => {},
2954
3154
  refresh: () => {},
2955
3155
  signOut: () => {}
2956
- }), Lt = () => {
2957
- let e = r(It);
3156
+ }), Rt = () => {
3157
+ let e = r(Lt);
2958
3158
  return i(() => {
2959
3159
  e.ensure();
2960
3160
  }, [e]), e;
2961
3161
  };
2962
- function Rt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
3162
+ function zt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
2963
3163
  let d = r(V), f = a || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : i ? "guest" : "idle"), v = s(!1), y = n((e, t) => fetch(`${f}${e}`, {
2964
3164
  ...t,
2965
3165
  credentials: "include",
@@ -2992,18 +3192,18 @@ function Rt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l })
2992
3192
  b,
2993
3193
  x
2994
3194
  ]);
2995
- return /* @__PURE__ */ u(It.Provider, {
3195
+ return /* @__PURE__ */ u(Lt.Provider, {
2996
3196
  value: C,
2997
3197
  children: e
2998
3198
  });
2999
3199
  }
3000
- function zt({ when: e, children: t }) {
3001
- let { status: n } = Lt();
3200
+ function Bt({ when: e, children: t }) {
3201
+ let { status: n } = Rt();
3002
3202
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
3003
3203
  }
3004
3204
  //#endregion
3005
3205
  //#region ../ui/src/components/builder/apps/auth/views.jsx
3006
- function Bt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
3206
+ function Vt({ 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 }) {
3007
3207
  let { tenant: g, apiUrl: _, settings: v } = r(V), [y, b] = c("form"), [x, S] = c(""), [C, w] = c(!1), T = e === "register", E = f ? m || "form" : y, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
3008
3208
  if (e.preventDefault(), f) return;
3009
3209
  let n = new FormData(e.currentTarget);
@@ -3027,7 +3227,7 @@ function Bt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3027
3227
  return;
3028
3228
  }
3029
3229
  if (b("success"), typeof window < "u") {
3030
- let e = D(t) || D(new URLSearchParams(window.location.search).get("next")) || D(v?.["apps.auth.redirect"]) || "/";
3230
+ let e = D(t) || D(new URLSearchParams(window.location.search).get("next")) || D(v?.["site.authRedirect"]) || D(v?.["apps.auth.redirect"]) || "/";
3031
3231
  window.location.assign(e);
3032
3232
  }
3033
3233
  } catch {
@@ -3127,8 +3327,8 @@ function Bt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3127
3327
  ]
3128
3328
  });
3129
3329
  }
3130
- function Vt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3131
- let { user: c, status: l, signOut: f } = Lt(), p = a ? s || "user" : l, m = a ? {
3330
+ function Ht({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3331
+ let { user: c, status: l, signOut: f } = Rt(), p = a ? s || "user" : l, m = a ? {
3132
3332
  name: "Ada Lovelace",
3133
3333
  email: "ada@example.com"
3134
3334
  } : c;
@@ -3193,41 +3393,42 @@ function Vt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3193
3393
  }
3194
3394
  //#endregion
3195
3395
  //#region ../ui/src/components/builder/apps/index.js
3196
- var Ht = [Ft], Ut = {
3197
- SiteLoginForm: Bt,
3198
- SiteAccountMenu: Vt
3396
+ var Ut = [It], Wt = {
3397
+ SiteLoginForm: Vt,
3398
+ SiteAccountMenu: Ht
3199
3399
  };
3200
- new Set(Ht.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3400
+ new Set(Ut.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3201
3401
  //#endregion
3202
3402
  //#region ../ui/src/components/builder/plugins/runtime.js
3203
- var Wt = /* @__PURE__ */ new Map();
3204
- function Gt(e) {
3205
- if (Wt.has(e)) return Wt.get(e);
3403
+ var Gt = /* @__PURE__ */ new Map();
3404
+ function Kt(e) {
3405
+ if (Gt.has(e)) return Gt.get(e);
3206
3406
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
3207
3407
  /* @vite-ignore */
3408
+ /* webpackIgnore: true */
3208
3409
  t
3209
3410
  ).finally(() => URL.revokeObjectURL(t));
3210
- return Wt.set(e, n), n;
3411
+ return Gt.set(e, n), n;
3211
3412
  }
3212
- function Kt(e) {
3413
+ function qt(e) {
3213
3414
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
3214
3415
  return n && typeof n == "object" ? n : {};
3215
3416
  }
3216
3417
  //#endregion
3217
3418
  //#region ../ui/src/components/builder/plugins/view.jsx
3218
- async function qt(e, t) {
3219
- let n = await Gt(e);
3419
+ async function Jt(e, t) {
3420
+ let n = await Kt(e);
3220
3421
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
3221
3422
  }
3222
- var Jt = {
3423
+ var Yt = {
3223
3424
  padding: "10px 12px",
3224
3425
  border: "1px dashed rgba(148, 163, 184, 0.5)",
3225
3426
  borderRadius: 8,
3226
3427
  fontSize: 12,
3227
3428
  opacity: .6
3228
3429
  };
3229
- function Yt({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3230
- let c = r(V), l = Kt(c?.settings)[e], f = s(null), p = s(null), m = {
3430
+ function Xt({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3431
+ let c = r(V), l = qt(c?.settings)[e], f = s(null), p = s(null), m = {
3231
3432
  tenant: c?.tenant ?? "",
3232
3433
  apiUrl: c?.apiUrl ?? "/api",
3233
3434
  locale: c?.locale ?? "",
@@ -3239,7 +3440,7 @@ function Yt({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3239
3440
  let e = f.current;
3240
3441
  if (!l?.code || !e) return;
3241
3442
  let n = !0;
3242
- return qt(l.code, t).then((e) => {
3443
+ return Jt(l.code, t).then((e) => {
3243
3444
  if (!(!n || !e || !f.current)) {
3244
3445
  p.current = e;
3245
3446
  try {
@@ -3269,7 +3470,7 @@ function Yt({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3269
3470
  }) : /* @__PURE__ */ d("div", {
3270
3471
  ref: o,
3271
3472
  style: {
3272
- ...Jt,
3473
+ ...Yt,
3273
3474
  ...h(a)
3274
3475
  },
3275
3476
  children: [
@@ -3281,10 +3482,10 @@ function Yt({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3281
3482
  }
3282
3483
  //#endregion
3283
3484
  //#region ../ui/src/components/builder/render.jsx
3284
- var Xt = {
3285
- ...Pt,
3286
- ...Ut,
3287
- PluginBlock: Yt
3485
+ var Zt = {
3486
+ ...Ft,
3487
+ ...Wt,
3488
+ PluginBlock: Xt
3288
3489
  };
3289
3490
  function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3290
3491
  let o = n[t];
@@ -3296,7 +3497,7 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3296
3497
  let c = new Set(i).add(n);
3297
3498
  return /* @__PURE__ */ u(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
3298
3499
  }
3299
- let l = Xt[s];
3500
+ let l = Zt[s];
3300
3501
  if (!l) return null;
3301
3502
  let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
3302
3503
  ...c,
@@ -3307,15 +3508,15 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3307
3508
  },
3308
3509
  children: d.length ? d : void 0
3309
3510
  }, t);
3310
- return c.when && c.when !== "always" ? /* @__PURE__ */ u(zt, {
3511
+ return c.when && c.when !== "always" ? /* @__PURE__ */ u(Bt, {
3311
3512
  when: c.when,
3312
3513
  children: m
3313
3514
  }, t) : m;
3314
3515
  }
3315
3516
  //#endregion
3316
3517
  //#region ../ui/src/components/builder/PageRenderer.jsx
3317
- var Zt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
3318
- function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: g }) {
3518
+ var Qt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
3519
+ function $t({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: g }) {
3319
3520
  let _ = s?.js?.trim();
3320
3521
  if (i(() => {
3321
3522
  if (!_) return;
@@ -3341,7 +3542,7 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
3341
3542
  locale: p || "",
3342
3543
  settings: h ?? null
3343
3544
  },
3344
- children: /* @__PURE__ */ u(Rt, {
3545
+ children: /* @__PURE__ */ u(zt, {
3345
3546
  initialUser: g,
3346
3547
  children: /* @__PURE__ */ u(H.Provider, {
3347
3548
  value: f ?? null,
@@ -3376,7 +3577,7 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
3376
3577
  locale: p || "",
3377
3578
  settings: h ?? null
3378
3579
  },
3379
- children: /* @__PURE__ */ u(Rt, {
3580
+ children: /* @__PURE__ */ u(zt, {
3380
3581
  initialUser: g,
3381
3582
  children: /* @__PURE__ */ u(H.Provider, {
3382
3583
  value: f ?? null,
@@ -3391,8 +3592,8 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
3391
3592
  ...a
3392
3593
  },
3393
3594
  children: [
3394
- /* @__PURE__ */ u("style", { children: `.webim-page { ${Zt(F(k.light))} }
3395
- @media (prefers-color-scheme: dark) { .webim-page { ${Zt(F(k.dark))} } }` }),
3595
+ /* @__PURE__ */ u("style", { children: `.webim-page { ${Qt(F(k.light))} }
3596
+ @media (prefers-color-scheme: dark) { .webim-page { ${Qt(F(k.dark))} } }` }),
3396
3597
  O,
3397
3598
  /* @__PURE__ */ u("style", { children: y }),
3398
3599
  C && /* @__PURE__ */ u("style", { children: C }),
@@ -3408,8 +3609,8 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
3408
3609
  }
3409
3610
  //#endregion
3410
3611
  //#region src/WebimContent.jsx
3411
- function $t({ bundle: e, mode: t = "auto", style: n }) {
3412
- return e?.blocks?.ROOT ? /* @__PURE__ */ u(Qt, {
3612
+ function en({ bundle: e, mode: t = "auto", style: n }) {
3613
+ return e?.blocks?.ROOT ? /* @__PURE__ */ u($t, {
3413
3614
  blocks: e.blocks,
3414
3615
  theme: e.theme,
3415
3616
  components: e.components,
@@ -3426,7 +3627,7 @@ function $t({ bundle: e, mode: t = "auto", style: n }) {
3426
3627
  }
3427
3628
  //#endregion
3428
3629
  //#region src/WebimPage.jsx
3429
- function en({ 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 }) {
3630
+ function tn({ 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 }) {
3430
3631
  let [g, _] = c({ status: "loading" }), v = s({
3431
3632
  onLoad: m,
3432
3633
  onError: h
@@ -3463,11 +3664,11 @@ function en({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
3463
3664
  r,
3464
3665
  a,
3465
3666
  o
3466
- ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u($t, {
3667
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(en, {
3467
3668
  bundle: g.bundle,
3468
3669
  mode: l,
3469
3670
  style: d
3470
3671
  });
3471
3672
  }
3472
3673
  //#endregion
3473
- export { Qt as PageRenderer, $t as WebimContent, en as WebimPage, z as fetchPage, Ee as renderRichContent, L as resolveTheme };
3674
+ export { $t as PageRenderer, en as WebimContent, tn as WebimPage, z as fetchPage, Ee as renderRichContent, L as resolveTheme };